@usetheo/ui 0.12.0 → 0.13.1

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 (1227) hide show
  1. package/CHANGELOG.md +634 -68
  2. package/DESIGN.md +18 -18
  3. package/NOTICE +2 -2
  4. package/README.md +69 -66
  5. package/dist/chunk-23YEYNDS.js +89 -0
  6. package/dist/chunk-23YEYNDS.js.map +1 -0
  7. package/dist/chunk-25KBUQEQ.js +95 -0
  8. package/dist/chunk-25KBUQEQ.js.map +1 -0
  9. package/dist/chunk-2A3E5Y72.js +165 -0
  10. package/dist/chunk-2A3E5Y72.js.map +1 -0
  11. package/dist/chunk-2EUKYGH5.js +98 -0
  12. package/dist/chunk-2EUKYGH5.js.map +1 -0
  13. package/dist/chunk-2NZYMQKT.js +56 -0
  14. package/dist/chunk-2NZYMQKT.js.map +1 -0
  15. package/dist/chunk-2OVFVPSZ.js +26 -0
  16. package/dist/chunk-2OVFVPSZ.js.map +1 -0
  17. package/dist/chunk-2UP7SECE.js +78 -0
  18. package/dist/chunk-2UP7SECE.js.map +1 -0
  19. package/dist/chunk-33ETHPT7.js +112 -0
  20. package/dist/chunk-33ETHPT7.js.map +1 -0
  21. package/dist/chunk-33IIDFSM.js +43 -0
  22. package/dist/chunk-33IIDFSM.js.map +1 -0
  23. package/dist/chunk-345HYADQ.js +88 -0
  24. package/dist/chunk-345HYADQ.js.map +1 -0
  25. package/dist/chunk-3ZXZGZOX.js +57 -0
  26. package/dist/chunk-3ZXZGZOX.js.map +1 -0
  27. package/dist/chunk-45FWKR23.js +62 -0
  28. package/dist/chunk-45FWKR23.js.map +1 -0
  29. package/dist/chunk-4DTLUBRW.js +122 -0
  30. package/dist/chunk-4DTLUBRW.js.map +1 -0
  31. package/dist/chunk-4EH6F54D.js +69 -0
  32. package/dist/chunk-4EH6F54D.js.map +1 -0
  33. package/dist/chunk-4EKF4EIE.js +140 -0
  34. package/dist/chunk-4EKF4EIE.js.map +1 -0
  35. package/dist/chunk-4SMYNLTA.js +83 -0
  36. package/dist/chunk-4SMYNLTA.js.map +1 -0
  37. package/dist/chunk-4UBFLXS3.js +35 -0
  38. package/dist/chunk-4UBFLXS3.js.map +1 -0
  39. package/dist/chunk-52J7SDYH.js +48 -0
  40. package/dist/chunk-52J7SDYH.js.map +1 -0
  41. package/dist/chunk-5XCTTXC3.js +180 -0
  42. package/dist/chunk-5XCTTXC3.js.map +1 -0
  43. package/dist/chunk-624AATQZ.js +77 -0
  44. package/dist/chunk-624AATQZ.js.map +1 -0
  45. package/dist/chunk-6IODJQWC.js +47 -0
  46. package/dist/chunk-6IODJQWC.js.map +1 -0
  47. package/dist/chunk-75IDWFYX.js +134 -0
  48. package/dist/chunk-75IDWFYX.js.map +1 -0
  49. package/dist/chunk-7BGCWJQR.js +113 -0
  50. package/dist/chunk-7BGCWJQR.js.map +1 -0
  51. package/dist/chunk-7BQXMG2A.js +93 -0
  52. package/dist/chunk-7BQXMG2A.js.map +1 -0
  53. package/dist/chunk-7RFWVNQA.js +47 -0
  54. package/dist/chunk-7RFWVNQA.js.map +1 -0
  55. package/dist/chunk-7T4NK6W6.js +192 -0
  56. package/dist/chunk-7T4NK6W6.js.map +1 -0
  57. package/dist/chunk-A3OU6ICP.js +91 -0
  58. package/dist/chunk-A3OU6ICP.js.map +1 -0
  59. package/dist/chunk-ABBXLAJW.js +74 -0
  60. package/dist/chunk-ABBXLAJW.js.map +1 -0
  61. package/dist/chunk-AENNHS3S.js +83 -0
  62. package/dist/chunk-AENNHS3S.js.map +1 -0
  63. package/dist/chunk-AXNJFBYX.js +136 -0
  64. package/dist/chunk-AXNJFBYX.js.map +1 -0
  65. package/dist/chunk-AXUAQM45.js +154 -0
  66. package/dist/chunk-AXUAQM45.js.map +1 -0
  67. package/dist/chunk-B2FL7KBJ.js +65 -0
  68. package/dist/chunk-B2FL7KBJ.js.map +1 -0
  69. package/dist/chunk-BE232OKN.js +42 -0
  70. package/dist/chunk-BE232OKN.js.map +1 -0
  71. package/dist/chunk-BP4RQSX7.js +200 -0
  72. package/dist/chunk-BP4RQSX7.js.map +1 -0
  73. package/dist/chunk-BPJ3RN3U.js +112 -0
  74. package/dist/chunk-BPJ3RN3U.js.map +1 -0
  75. package/dist/chunk-BSF4Y4UT.js +77 -0
  76. package/dist/chunk-BSF4Y4UT.js.map +1 -0
  77. package/dist/chunk-BWIDDAR7.js +86 -0
  78. package/dist/chunk-BWIDDAR7.js.map +1 -0
  79. package/dist/chunk-BYUWQ6OP.js +45 -0
  80. package/dist/chunk-BYUWQ6OP.js.map +1 -0
  81. package/dist/chunk-C5ULP2P5.js +140 -0
  82. package/dist/chunk-C5ULP2P5.js.map +1 -0
  83. package/dist/chunk-CCG7PXLX.js +24 -0
  84. package/dist/chunk-CCG7PXLX.js.map +1 -0
  85. package/dist/chunk-CED2LKHI.js +117 -0
  86. package/dist/chunk-CED2LKHI.js.map +1 -0
  87. package/dist/chunk-CGWIOIEO.js +27 -0
  88. package/dist/chunk-CGWIOIEO.js.map +1 -0
  89. package/dist/chunk-CSEGVTKO.js +110 -0
  90. package/dist/chunk-CSEGVTKO.js.map +1 -0
  91. package/dist/chunk-CVFSNA4K.js +716 -0
  92. package/dist/chunk-CVFSNA4K.js.map +1 -0
  93. package/dist/chunk-E26M7ATD.js +61 -0
  94. package/dist/chunk-E26M7ATD.js.map +1 -0
  95. package/dist/chunk-E63IRXZZ.js +78 -0
  96. package/dist/chunk-E63IRXZZ.js.map +1 -0
  97. package/dist/chunk-ESJUISWY.js +45 -0
  98. package/dist/chunk-ESJUISWY.js.map +1 -0
  99. package/dist/chunk-ET7A3TQZ.js +158 -0
  100. package/dist/chunk-ET7A3TQZ.js.map +1 -0
  101. package/dist/chunk-ETTL6XGU.js +139 -0
  102. package/dist/chunk-ETTL6XGU.js.map +1 -0
  103. package/dist/chunk-EWDN56AS.js +24 -0
  104. package/dist/chunk-EWDN56AS.js.map +1 -0
  105. package/dist/chunk-FJZKA2LV.js +165 -0
  106. package/dist/chunk-FJZKA2LV.js.map +1 -0
  107. package/dist/chunk-G2WCT6PJ.js +69 -0
  108. package/dist/chunk-G2WCT6PJ.js.map +1 -0
  109. package/dist/chunk-GC52HWIL.js +41 -0
  110. package/dist/chunk-GC52HWIL.js.map +1 -0
  111. package/dist/chunk-GCKFA7X7.js +83 -0
  112. package/dist/chunk-GCKFA7X7.js.map +1 -0
  113. package/dist/chunk-GDMCDW66.js +19 -0
  114. package/dist/chunk-GDMCDW66.js.map +1 -0
  115. package/dist/chunk-GIXHBTHH.js +59 -0
  116. package/dist/chunk-GIXHBTHH.js.map +1 -0
  117. package/dist/chunk-GLEOUWPN.js +108 -0
  118. package/dist/chunk-GLEOUWPN.js.map +1 -0
  119. package/dist/chunk-GLRUM43F.js +121 -0
  120. package/dist/chunk-GLRUM43F.js.map +1 -0
  121. package/dist/chunk-H3L7WZDZ.js +74 -0
  122. package/dist/chunk-H3L7WZDZ.js.map +1 -0
  123. package/dist/chunk-H55WXDME.js +45 -0
  124. package/dist/chunk-H55WXDME.js.map +1 -0
  125. package/dist/chunk-H5QPJNVD.js +98 -0
  126. package/dist/chunk-H5QPJNVD.js.map +1 -0
  127. package/dist/chunk-HB45JHMM.js +43 -0
  128. package/dist/chunk-HB45JHMM.js.map +1 -0
  129. package/dist/chunk-HETHTYEZ.js +80 -0
  130. package/dist/chunk-HETHTYEZ.js.map +1 -0
  131. package/dist/chunk-HHSKNB32.js +55 -0
  132. package/dist/chunk-HHSKNB32.js.map +1 -0
  133. package/dist/chunk-HILOUYES.js +151 -0
  134. package/dist/chunk-HILOUYES.js.map +1 -0
  135. package/dist/chunk-HTJVHFNW.js +178 -0
  136. package/dist/chunk-HTJVHFNW.js.map +1 -0
  137. package/dist/chunk-HZ7Z22VW.js +130 -0
  138. package/dist/chunk-HZ7Z22VW.js.map +1 -0
  139. package/dist/chunk-JFKBFQA5.js +129 -0
  140. package/dist/chunk-JFKBFQA5.js.map +1 -0
  141. package/dist/chunk-JIZKW3WC.js +74 -0
  142. package/dist/chunk-JIZKW3WC.js.map +1 -0
  143. package/dist/chunk-JQTCCKZA.js +154 -0
  144. package/dist/chunk-JQTCCKZA.js.map +1 -0
  145. package/dist/chunk-JR4H3FJ2.js +74 -0
  146. package/dist/chunk-JR4H3FJ2.js.map +1 -0
  147. package/dist/chunk-JRW53TVG.js +53 -0
  148. package/dist/chunk-JRW53TVG.js.map +1 -0
  149. package/dist/chunk-JXOCE27Z.js +82 -0
  150. package/dist/chunk-JXOCE27Z.js.map +1 -0
  151. package/dist/chunk-JYW5YNF7.js +188 -0
  152. package/dist/chunk-JYW5YNF7.js.map +1 -0
  153. package/dist/chunk-K72DJOXR.js +81 -0
  154. package/dist/chunk-K72DJOXR.js.map +1 -0
  155. package/dist/chunk-KDE3NYTI.js +144 -0
  156. package/dist/chunk-KDE3NYTI.js.map +1 -0
  157. package/dist/chunk-KFUFTZLS.js +111 -0
  158. package/dist/chunk-KFUFTZLS.js.map +1 -0
  159. package/dist/chunk-KHBXI6AV.js +149 -0
  160. package/dist/chunk-KHBXI6AV.js.map +1 -0
  161. package/dist/chunk-M74ZYBOK.js +93 -0
  162. package/dist/chunk-M74ZYBOK.js.map +1 -0
  163. package/dist/chunk-ML7WLNIK.js +11 -0
  164. package/dist/chunk-ML7WLNIK.js.map +1 -0
  165. package/dist/chunk-MXB2GVEQ.js +57 -0
  166. package/dist/chunk-MXB2GVEQ.js.map +1 -0
  167. package/dist/chunk-NEMXW2LB.js +102 -0
  168. package/dist/chunk-NEMXW2LB.js.map +1 -0
  169. package/dist/chunk-OJPPSJMF.js +65 -0
  170. package/dist/chunk-OJPPSJMF.js.map +1 -0
  171. package/dist/chunk-OMR6ZGME.js +63 -0
  172. package/dist/chunk-OMR6ZGME.js.map +1 -0
  173. package/dist/chunk-ORVYP73T.js +223 -0
  174. package/dist/chunk-ORVYP73T.js.map +1 -0
  175. package/dist/chunk-OZFUUO2Q.js +50 -0
  176. package/dist/chunk-OZFUUO2Q.js.map +1 -0
  177. package/dist/chunk-P44UAK45.js +115 -0
  178. package/dist/chunk-P44UAK45.js.map +1 -0
  179. package/dist/chunk-PJUP4BJD.js +116 -0
  180. package/dist/chunk-PJUP4BJD.js.map +1 -0
  181. package/dist/chunk-PJWYIOY4.js +3 -0
  182. package/dist/chunk-PJWYIOY4.js.map +1 -0
  183. package/dist/chunk-PVCW4O37.js +147 -0
  184. package/dist/chunk-PVCW4O37.js.map +1 -0
  185. package/dist/chunk-PXT47DRZ.js +59 -0
  186. package/dist/chunk-PXT47DRZ.js.map +1 -0
  187. package/dist/chunk-PZGUZHI7.js +142 -0
  188. package/dist/chunk-PZGUZHI7.js.map +1 -0
  189. package/dist/chunk-Q2BAL2PF.js +965 -0
  190. package/dist/chunk-Q2BAL2PF.js.map +1 -0
  191. package/dist/chunk-QBUTRD2M.js +58 -0
  192. package/dist/chunk-QBUTRD2M.js.map +1 -0
  193. package/dist/chunk-QCQTTOMD.js +236 -0
  194. package/dist/chunk-QCQTTOMD.js.map +1 -0
  195. package/dist/chunk-QNYOIVQ4.js +36 -0
  196. package/dist/chunk-QNYOIVQ4.js.map +1 -0
  197. package/dist/chunk-QPURZJJM.js +88 -0
  198. package/dist/chunk-QPURZJJM.js.map +1 -0
  199. package/dist/chunk-QRXIYPWP.js +121 -0
  200. package/dist/chunk-QRXIYPWP.js.map +1 -0
  201. package/dist/chunk-QV4BQRNH.js +29 -0
  202. package/dist/chunk-QV4BQRNH.js.map +1 -0
  203. package/dist/chunk-REFY5MLN.js +212 -0
  204. package/dist/chunk-REFY5MLN.js.map +1 -0
  205. package/dist/chunk-RJ6RAMKH.js +89 -0
  206. package/dist/chunk-RJ6RAMKH.js.map +1 -0
  207. package/dist/chunk-RJBCTMVW.js +59 -0
  208. package/dist/chunk-RJBCTMVW.js.map +1 -0
  209. package/dist/chunk-RLWULF5B.js +113 -0
  210. package/dist/chunk-RLWULF5B.js.map +1 -0
  211. package/dist/chunk-RPZMFGYI.js +31 -0
  212. package/dist/chunk-RPZMFGYI.js.map +1 -0
  213. package/dist/chunk-RQT5DWGG.js +34 -0
  214. package/dist/chunk-RQT5DWGG.js.map +1 -0
  215. package/dist/chunk-SBKVVVYY.js +89 -0
  216. package/dist/chunk-SBKVVVYY.js.map +1 -0
  217. package/dist/chunk-SOJW47EZ.js +70 -0
  218. package/dist/chunk-SOJW47EZ.js.map +1 -0
  219. package/dist/chunk-SQ66DCXY.js +35 -0
  220. package/dist/chunk-SQ66DCXY.js.map +1 -0
  221. package/dist/chunk-SXKGWHAM.js +179 -0
  222. package/dist/chunk-SXKGWHAM.js.map +1 -0
  223. package/dist/chunk-T2OKGV6M.js +13 -0
  224. package/dist/chunk-T2OKGV6M.js.map +1 -0
  225. package/dist/chunk-TJLULCZW.js +108 -0
  226. package/dist/chunk-TJLULCZW.js.map +1 -0
  227. package/dist/chunk-TY6NTWN5.js +29 -0
  228. package/dist/chunk-TY6NTWN5.js.map +1 -0
  229. package/dist/chunk-U3AEEFVB.js +152 -0
  230. package/dist/chunk-U3AEEFVB.js.map +1 -0
  231. package/dist/chunk-V3HFDVZ3.js +102 -0
  232. package/dist/chunk-V3HFDVZ3.js.map +1 -0
  233. package/dist/chunk-V6H2RUVP.js +77 -0
  234. package/dist/chunk-V6H2RUVP.js.map +1 -0
  235. package/dist/chunk-VB53UMAL.js +106 -0
  236. package/dist/chunk-VB53UMAL.js.map +1 -0
  237. package/dist/chunk-VBEMLZGX.js +86 -0
  238. package/dist/chunk-VBEMLZGX.js.map +1 -0
  239. package/dist/chunk-VBQFE5RV.js +92 -0
  240. package/dist/chunk-VBQFE5RV.js.map +1 -0
  241. package/dist/chunk-VHK2OUCW.js +38 -0
  242. package/dist/chunk-VHK2OUCW.js.map +1 -0
  243. package/dist/chunk-VHTAVROO.js +53 -0
  244. package/dist/chunk-VHTAVROO.js.map +1 -0
  245. package/dist/chunk-VZX4HLBM.js +84 -0
  246. package/dist/chunk-VZX4HLBM.js.map +1 -0
  247. package/dist/chunk-W47V2F3Q.js +115 -0
  248. package/dist/chunk-W47V2F3Q.js.map +1 -0
  249. package/dist/chunk-W7I3ZX66.js +76 -0
  250. package/dist/chunk-W7I3ZX66.js.map +1 -0
  251. package/dist/chunk-WD42UBGR.js +64 -0
  252. package/dist/chunk-WD42UBGR.js.map +1 -0
  253. package/dist/chunk-XC7SYZYR.js +86 -0
  254. package/dist/chunk-XC7SYZYR.js.map +1 -0
  255. package/dist/chunk-XJA4B3F5.js +68 -0
  256. package/dist/chunk-XJA4B3F5.js.map +1 -0
  257. package/dist/chunk-XSENM65D.js +128 -0
  258. package/dist/chunk-XSENM65D.js.map +1 -0
  259. package/dist/chunk-YD2QEVHO.js +68 -0
  260. package/dist/chunk-YD2QEVHO.js.map +1 -0
  261. package/dist/chunk-YDKRUSB5.js +35 -0
  262. package/dist/chunk-YDKRUSB5.js.map +1 -0
  263. package/dist/chunk-YES6SPDT.js +55 -0
  264. package/dist/chunk-YES6SPDT.js.map +1 -0
  265. package/dist/chunk-YNDHYMPI.js +46 -0
  266. package/dist/chunk-YNDHYMPI.js.map +1 -0
  267. package/dist/chunk-YO3WEMOH.js +130 -0
  268. package/dist/chunk-YO3WEMOH.js.map +1 -0
  269. package/dist/chunk-YUFFAWNB.js +90 -0
  270. package/dist/chunk-YUFFAWNB.js.map +1 -0
  271. package/dist/chunk-YVXMWUWD.js +118 -0
  272. package/dist/chunk-YVXMWUWD.js.map +1 -0
  273. package/dist/chunk-Z6HZMGO2.js +106 -0
  274. package/dist/chunk-Z6HZMGO2.js.map +1 -0
  275. package/dist/chunk-ZAMPCRFJ.js +121 -0
  276. package/dist/chunk-ZAMPCRFJ.js.map +1 -0
  277. package/dist/chunk-ZEFOXF2I.js +87 -0
  278. package/dist/chunk-ZEFOXF2I.js.map +1 -0
  279. package/dist/chunk-ZJXOHLQE.js +66 -0
  280. package/dist/chunk-ZJXOHLQE.js.map +1 -0
  281. package/dist/chunk-ZPURFK4C.js +203 -0
  282. package/dist/chunk-ZPURFK4C.js.map +1 -0
  283. package/dist/chunk-ZZZIOTLC.js +89 -0
  284. package/dist/chunk-ZZZIOTLC.js.map +1 -0
  285. package/dist/components/composites/account-menu/account-menu.d.ts +43 -0
  286. package/dist/components/composites/account-menu/index.d.ts +1 -0
  287. package/dist/components/composites/agent-composer/agent-composer.d.ts +41 -0
  288. package/dist/components/composites/agent-composer/index.d.ts +1 -0
  289. package/dist/components/composites/agent-editor/agent-editor.d.ts +31 -0
  290. package/dist/components/composites/agent-editor/index.d.ts +1 -0
  291. package/dist/components/composites/agent-stream/agent-stream.d.ts +72 -0
  292. package/dist/components/composites/agent-stream/index.d.ts +2 -0
  293. package/dist/components/composites/agent-stream/to-agent-stream-items.d.ts +32 -0
  294. package/dist/components/composites/agent-timeline/agent-timeline.d.ts +22 -0
  295. package/dist/components/composites/agent-timeline/index.d.ts +1 -0
  296. package/dist/components/composites/agent-tool-renderer/agent-tool-renderer.d.ts +60 -0
  297. package/dist/components/composites/agent-tool-renderer/index.d.ts +1 -0
  298. package/dist/components/composites/agent-tool-renderer/tool-call-part.d.ts +5 -0
  299. package/dist/components/composites/approval-card/approval-card.d.ts +35 -0
  300. package/dist/components/composites/approval-card/index.d.ts +1 -0
  301. package/dist/components/composites/chat-composer/chat-composer.d.ts +68 -0
  302. package/dist/components/composites/chat-composer/index.d.ts +1 -0
  303. package/dist/components/composites/chat-message/chat-message-actions.d.ts +22 -0
  304. package/dist/components/composites/chat-message/chat-message-branch.d.ts +17 -0
  305. package/dist/components/composites/chat-message/chat-message-response.d.ts +15 -0
  306. package/dist/components/composites/chat-message/chat-message-toolbar.d.ts +7 -0
  307. package/dist/components/composites/chat-message/chat-message.d.ts +94 -0
  308. package/dist/components/composites/chat-message/index.d.ts +23 -0
  309. package/dist/components/composites/chat-message/parts/data-part.d.ts +9 -0
  310. package/dist/components/composites/chat-message/parts/file-part.d.ts +5 -0
  311. package/dist/components/composites/chat-message/parts/reasoning-part.d.ts +7 -0
  312. package/dist/components/composites/chat-message/parts/source-part.d.ts +9 -0
  313. package/dist/components/composites/chat-message/parts/text-part.d.ts +11 -0
  314. package/dist/components/composites/choice-prompt/choice-prompt.d.ts +65 -0
  315. package/dist/components/composites/choice-prompt/index.d.ts +2 -0
  316. package/dist/components/composites/code-block/code-block.d.ts +29 -0
  317. package/dist/components/composites/code-block/index.d.ts +1 -0
  318. package/dist/components/composites/command-palette/command-palette.d.ts +41 -0
  319. package/dist/components/composites/command-palette/index.d.ts +1 -0
  320. package/dist/components/composites/confirm-dialog/confirm-dialog.d.ts +41 -0
  321. package/dist/components/composites/confirm-dialog/index.d.ts +1 -0
  322. package/dist/components/composites/confirm-prompt/confirm-prompt.d.ts +31 -0
  323. package/dist/components/composites/confirm-prompt/index.d.ts +1 -0
  324. package/dist/components/composites/cron-jobs-list/cron-jobs-list.d.ts +15 -0
  325. package/dist/components/composites/cron-jobs-list/index.d.ts +1 -0
  326. package/dist/components/composites/data-table/data-table.d.ts +63 -0
  327. package/dist/components/composites/data-table/index.d.ts +1 -0
  328. package/dist/components/composites/deployment-row/deployment-row.d.ts +28 -0
  329. package/dist/components/composites/deployment-row/index.d.ts +1 -0
  330. package/dist/components/composites/domain-config/domain-config.d.ts +34 -0
  331. package/dist/components/composites/domain-config/index.d.ts +1 -0
  332. package/dist/components/composites/env-var-editor/env-var-editor.d.ts +35 -0
  333. package/dist/components/composites/env-var-editor/index.d.ts +1 -0
  334. package/dist/components/composites/mcp-server-list/index.d.ts +1 -0
  335. package/dist/components/composites/mcp-server-list/mcp-server-list.d.ts +15 -0
  336. package/dist/components/composites/metric-card/index.d.ts +2 -0
  337. package/dist/components/composites/metric-card/metric-card.d.ts +46 -0
  338. package/dist/components/composites/multi-select-prompt/index.d.ts +1 -0
  339. package/dist/components/composites/multi-select-prompt/multi-select-prompt.d.ts +61 -0
  340. package/dist/components/composites/page-shell/index.d.ts +1 -0
  341. package/dist/components/composites/page-shell/page-shell.d.ts +68 -0
  342. package/dist/components/composites/permission-modal/index.d.ts +1 -0
  343. package/dist/components/composites/permission-modal/permission-modal.d.ts +48 -0
  344. package/dist/components/composites/preview-env-card/index.d.ts +1 -0
  345. package/dist/components/composites/preview-env-card/preview-env-card.d.ts +36 -0
  346. package/dist/components/composites/preview-panel/index.d.ts +1 -0
  347. package/dist/components/composites/preview-panel/preview-panel.d.ts +24 -0
  348. package/dist/components/composites/project-card/index.d.ts +1 -0
  349. package/dist/components/composites/project-card/project-card.d.ts +32 -0
  350. package/dist/components/composites/rollback-ui/index.d.ts +1 -0
  351. package/dist/components/composites/rollback-ui/rollback-ui.d.ts +32 -0
  352. package/dist/components/composites/rule-editor/index.d.ts +1 -0
  353. package/dist/components/composites/rule-editor/rule-editor.d.ts +18 -0
  354. package/dist/components/composites/skill-editor/index.d.ts +1 -0
  355. package/dist/components/composites/skill-editor/skill-editor.d.ts +19 -0
  356. package/dist/components/composites/skills-list/index.d.ts +1 -0
  357. package/dist/components/composites/skills-list/skills-list.d.ts +15 -0
  358. package/dist/components/composites/slide-deck/context.d.ts +23 -0
  359. package/dist/components/composites/slide-deck/controls.d.ts +8 -0
  360. package/dist/components/composites/slide-deck/fragments.d.ts +20 -0
  361. package/dist/components/composites/slide-deck/index.d.ts +21 -0
  362. package/dist/components/composites/slide-deck/notes.d.ts +14 -0
  363. package/dist/components/composites/slide-deck/presenter-view.d.ts +15 -0
  364. package/dist/components/composites/slide-deck/print-styles.d.ts +21 -0
  365. package/dist/components/composites/slide-deck/progress-bar.d.ts +8 -0
  366. package/dist/components/composites/slide-deck/schema.d.ts +31 -0
  367. package/dist/components/composites/slide-deck/slide-deck.d.ts +78 -0
  368. package/dist/components/composites/slide-deck/slide-number.d.ts +11 -0
  369. package/dist/components/composites/slide-deck/split-deck.d.ts +2 -0
  370. package/dist/components/composites/slide-deck/thumbnails.d.ts +19 -0
  371. package/dist/components/composites/slide-deck/use-deck-hash-routing.d.ts +23 -0
  372. package/dist/components/composites/slide-deck/use-deck-keyboard.d.ts +25 -0
  373. package/dist/components/composites/slide-deck/use-deck-state.d.ts +57 -0
  374. package/dist/components/composites/slide-deck/use-deck-swipe.d.ts +20 -0
  375. package/dist/components/composites/slide-deck/use-fullscreen.d.ts +18 -0
  376. package/dist/components/composites/stability-bundle-viewer/index.d.ts +1 -0
  377. package/dist/components/composites/stability-bundle-viewer/stability-bundle-viewer.d.ts +28 -0
  378. package/dist/components/composites/status-indicator/index.d.ts +2 -0
  379. package/dist/components/composites/status-indicator/status-indicator.d.ts +31 -0
  380. package/dist/components/composites/task-header/index.d.ts +1 -0
  381. package/dist/components/composites/task-header/task-header.d.ts +20 -0
  382. package/dist/components/composites/text-prompt/index.d.ts +1 -0
  383. package/dist/components/composites/text-prompt/text-prompt.d.ts +48 -0
  384. package/dist/components/composites/usage-meter/index.d.ts +1 -0
  385. package/dist/components/composites/usage-meter/usage-meter.d.ts +56 -0
  386. package/dist/components/primitives/action-bar/action-bar.d.ts +34 -0
  387. package/dist/components/primitives/action-bar/index.d.ts +1 -0
  388. package/dist/components/primitives/agent-error-card/agent-error-card.d.ts +47 -0
  389. package/dist/components/primitives/agent-error-card/index.d.ts +1 -0
  390. package/dist/components/primitives/agent-event/agent-event.d.ts +25 -0
  391. package/dist/components/primitives/agent-event/index.d.ts +1 -0
  392. package/dist/components/primitives/agent-handoff/agent-handoff.d.ts +24 -0
  393. package/dist/components/primitives/agent-handoff/index.d.ts +1 -0
  394. package/dist/components/primitives/agent-profile/agent-profile.d.ts +28 -0
  395. package/dist/components/primitives/agent-profile/index.d.ts +1 -0
  396. package/dist/components/primitives/agent-starting-state/agent-starting-state.d.ts +15 -0
  397. package/dist/components/primitives/agent-starting-state/index.d.ts +1 -0
  398. package/dist/components/primitives/agent-streaming/agent-streaming.d.ts +16 -0
  399. package/dist/components/primitives/agent-streaming/index.d.ts +1 -0
  400. package/dist/components/primitives/alert/alert.d.ts +31 -0
  401. package/dist/components/primitives/alert/index.d.ts +1 -0
  402. package/dist/components/primitives/artifact-preview/artifact-preview.d.ts +25 -0
  403. package/dist/components/primitives/artifact-preview/index.d.ts +1 -0
  404. package/dist/components/primitives/attachment-chip/attachment-chip.d.ts +14 -0
  405. package/dist/components/primitives/attachment-chip/index.d.ts +1 -0
  406. package/dist/components/primitives/audit-log-entry/audit-log-entry.d.ts +29 -0
  407. package/dist/components/primitives/audit-log-entry/index.d.ts +1 -0
  408. package/dist/components/primitives/auto-compact-notice/auto-compact-notice.d.ts +24 -0
  409. package/dist/components/primitives/auto-compact-notice/index.d.ts +1 -0
  410. package/dist/components/primitives/avatar/avatar.d.ts +26 -0
  411. package/dist/components/primitives/avatar/index.d.ts +1 -0
  412. package/dist/components/primitives/badge/badge.d.ts +33 -0
  413. package/dist/components/primitives/badge/index.d.ts +1 -0
  414. package/dist/components/primitives/branch-indicator/branch-indicator.d.ts +13 -0
  415. package/dist/components/primitives/branch-indicator/index.d.ts +1 -0
  416. package/dist/components/primitives/browser-controls/browser-controls.d.ts +19 -0
  417. package/dist/components/primitives/browser-controls/index.d.ts +1 -0
  418. package/dist/components/primitives/build-log-stream/build-log-stream.d.ts +51 -0
  419. package/dist/components/primitives/build-log-stream/index.d.ts +1 -0
  420. package/dist/components/primitives/button/button.d.ts +26 -0
  421. package/dist/components/primitives/button/index.d.ts +1 -0
  422. package/dist/components/primitives/capability-indicator/capability-indicator.d.ts +57 -0
  423. package/dist/components/primitives/capability-indicator/index.d.ts +1 -0
  424. package/dist/components/primitives/card/card.d.ts +40 -0
  425. package/dist/components/primitives/card/index.d.ts +1 -0
  426. package/dist/components/primitives/channel-card/channel-card.d.ts +28 -0
  427. package/dist/components/primitives/channel-card/index.d.ts +1 -0
  428. package/dist/components/primitives/chat-thread/chat-thread.d.ts +12 -0
  429. package/dist/components/primitives/chat-thread/index.d.ts +1 -0
  430. package/dist/components/primitives/checkbox/checkbox.d.ts +20 -0
  431. package/dist/components/primitives/checkbox/index.d.ts +1 -0
  432. package/dist/components/primitives/context-card/context-card.d.ts +18 -0
  433. package/dist/components/primitives/context-card/index.d.ts +1 -0
  434. package/dist/components/primitives/context-window-bar/context-window-bar.d.ts +27 -0
  435. package/dist/components/primitives/context-window-bar/index.d.ts +1 -0
  436. package/dist/components/primitives/copy-button/copy-button.d.ts +17 -0
  437. package/dist/components/primitives/copy-button/index.d.ts +1 -0
  438. package/dist/components/primitives/cost-meter/cost-meter.d.ts +23 -0
  439. package/dist/components/primitives/cost-meter/index.d.ts +1 -0
  440. package/dist/components/primitives/created-files-card/created-files-card.d.ts +30 -0
  441. package/dist/components/primitives/created-files-card/index.d.ts +1 -0
  442. package/dist/components/primitives/cron-job-card/cron-job-card.d.ts +30 -0
  443. package/dist/components/primitives/cron-job-card/index.d.ts +1 -0
  444. package/dist/components/primitives/danger-zone/danger-zone.d.ts +40 -0
  445. package/dist/components/primitives/danger-zone/index.d.ts +1 -0
  446. package/dist/components/primitives/dialog/dialog.d.ts +26 -0
  447. package/dist/components/primitives/dialog/index.d.ts +1 -0
  448. package/dist/components/primitives/diff-viewer/diff-viewer.d.ts +45 -0
  449. package/dist/components/primitives/diff-viewer/index.d.ts +1 -0
  450. package/dist/components/primitives/dropdown-menu/dropdown-menu.d.ts +68 -0
  451. package/dist/components/primitives/dropdown-menu/index.d.ts +1 -0
  452. package/dist/components/primitives/empty-state/empty-state.d.ts +22 -0
  453. package/dist/components/primitives/empty-state/index.d.ts +1 -0
  454. package/dist/components/primitives/export-chat-dialog/export-chat-dialog.d.ts +18 -0
  455. package/dist/components/primitives/export-chat-dialog/index.d.ts +1 -0
  456. package/dist/components/primitives/folder-context-card/folder-context-card.d.ts +40 -0
  457. package/dist/components/primitives/folder-context-card/index.d.ts +1 -0
  458. package/dist/components/primitives/folder-selector/folder-selector.d.ts +18 -0
  459. package/dist/components/primitives/folder-selector/index.d.ts +1 -0
  460. package/dist/components/primitives/form-field/form-field.d.ts +44 -0
  461. package/dist/components/primitives/form-field/index.d.ts +1 -0
  462. package/dist/components/primitives/gateway-status-indicator/gateway-status-indicator.d.ts +19 -0
  463. package/dist/components/primitives/gateway-status-indicator/index.d.ts +1 -0
  464. package/dist/components/primitives/hook-config/hook-config.d.ts +27 -0
  465. package/dist/components/primitives/hook-config/index.d.ts +1 -0
  466. package/dist/components/primitives/hook-event-log/hook-event-log.d.ts +27 -0
  467. package/dist/components/primitives/hook-event-log/index.d.ts +1 -0
  468. package/dist/components/primitives/input/index.d.ts +1 -0
  469. package/dist/components/primitives/input/input.d.ts +24 -0
  470. package/dist/components/primitives/intent-selector/index.d.ts +1 -0
  471. package/dist/components/primitives/intent-selector/intent-selector.d.ts +22 -0
  472. package/dist/components/primitives/label/index.d.ts +1 -0
  473. package/dist/components/primitives/label/label.d.ts +15 -0
  474. package/dist/components/primitives/lane-board/index.d.ts +1 -0
  475. package/dist/components/primitives/lane-board/lane-board.d.ts +26 -0
  476. package/dist/components/primitives/login-split/index.d.ts +1 -0
  477. package/dist/components/primitives/login-split/login-split.d.ts +24 -0
  478. package/dist/components/primitives/mcp-server-card/index.d.ts +1 -0
  479. package/dist/components/primitives/mcp-server-card/mcp-server-card.d.ts +32 -0
  480. package/dist/components/primitives/memory-editor/index.d.ts +1 -0
  481. package/dist/components/primitives/memory-editor/memory-editor.d.ts +29 -0
  482. package/dist/components/primitives/mention-menu/index.d.ts +1 -0
  483. package/dist/components/primitives/mention-menu/mention-menu.d.ts +44 -0
  484. package/dist/components/primitives/metrics-panel/index.d.ts +1 -0
  485. package/dist/components/primitives/metrics-panel/metrics-panel.d.ts +62 -0
  486. package/dist/components/primitives/model-card/index.d.ts +1 -0
  487. package/dist/components/primitives/model-card/model-card.d.ts +72 -0
  488. package/dist/components/primitives/model-selector/index.d.ts +1 -0
  489. package/dist/components/primitives/model-selector/model-selector.d.ts +21 -0
  490. package/dist/components/primitives/pagination/index.d.ts +1 -0
  491. package/dist/components/primitives/pagination/pagination.d.ts +44 -0
  492. package/dist/components/primitives/permission-matrix/index.d.ts +1 -0
  493. package/dist/components/primitives/permission-matrix/permission-matrix.d.ts +43 -0
  494. package/dist/components/primitives/pin-input/index.d.ts +1 -0
  495. package/dist/components/primitives/pin-input/pin-input.d.ts +41 -0
  496. package/dist/components/primitives/plan-badge/index.d.ts +1 -0
  497. package/dist/components/primitives/plan-badge/plan-badge.d.ts +35 -0
  498. package/dist/components/primitives/progress/index.d.ts +1 -0
  499. package/dist/components/primitives/progress/progress.d.ts +44 -0
  500. package/dist/components/primitives/progress-checklist/index.d.ts +1 -0
  501. package/dist/components/primitives/progress-checklist/progress-checklist.d.ts +18 -0
  502. package/dist/components/primitives/project-switcher/index.d.ts +1 -0
  503. package/dist/components/primitives/project-switcher/project-switcher.d.ts +32 -0
  504. package/dist/components/primitives/quick-action-chips/index.d.ts +1 -0
  505. package/dist/components/primitives/quick-action-chips/quick-action-chips.d.ts +22 -0
  506. package/dist/components/primitives/radio-group/index.d.ts +1 -0
  507. package/dist/components/primitives/radio-group/radio-group.d.ts +5 -0
  508. package/dist/components/primitives/recent-folders-list/index.d.ts +1 -0
  509. package/dist/components/primitives/recent-folders-list/recent-folders-list.d.ts +21 -0
  510. package/dist/components/primitives/rule-card/index.d.ts +1 -0
  511. package/dist/components/primitives/rule-card/rule-card.d.ts +15 -0
  512. package/dist/components/primitives/run-stats/index.d.ts +1 -0
  513. package/dist/components/primitives/run-stats/run-stats.d.ts +16 -0
  514. package/dist/components/primitives/run-status-pill/index.d.ts +1 -0
  515. package/dist/components/primitives/run-status-pill/run-status-pill.d.ts +13 -0
  516. package/dist/components/primitives/running-tasks-panel/index.d.ts +1 -0
  517. package/dist/components/primitives/running-tasks-panel/running-tasks-panel.d.ts +20 -0
  518. package/dist/components/primitives/scroll-area/index.d.ts +2 -0
  519. package/dist/components/primitives/scroll-area/scroll-area.d.ts +40 -0
  520. package/dist/components/primitives/scroll-area/use-stick-to-bottom.d.ts +20 -0
  521. package/dist/components/primitives/select/index.d.ts +1 -0
  522. package/dist/components/primitives/select/select.d.ts +50 -0
  523. package/dist/components/primitives/session-list-item/index.d.ts +1 -0
  524. package/dist/components/primitives/session-list-item/session-list-item.d.ts +35 -0
  525. package/dist/components/primitives/session-timeline/index.d.ts +1 -0
  526. package/dist/components/primitives/session-timeline/session-timeline.d.ts +32 -0
  527. package/dist/components/primitives/sheet/index.d.ts +1 -0
  528. package/dist/components/primitives/sheet/sheet.d.ts +57 -0
  529. package/dist/components/primitives/sidebar/index.d.ts +1 -0
  530. package/dist/components/primitives/sidebar/sidebar.d.ts +18 -0
  531. package/dist/components/primitives/skeleton/index.d.ts +1 -0
  532. package/dist/components/primitives/skeleton/skeleton.d.ts +21 -0
  533. package/dist/components/primitives/skill-card/index.d.ts +1 -0
  534. package/dist/components/primitives/skill-card/skill-card.d.ts +28 -0
  535. package/dist/components/primitives/slide/alerts.d.ts +31 -0
  536. package/dist/components/primitives/slide/frontmatter.d.ts +23 -0
  537. package/dist/components/primitives/slide/index.d.ts +16 -0
  538. package/dist/components/primitives/slide/json-schema.d.ts +9 -0
  539. package/dist/components/primitives/slide/marpit-bg.d.ts +36 -0
  540. package/dist/components/primitives/slide/parse.d.ts +59 -0
  541. package/dist/components/primitives/slide/plugin.d.ts +79 -0
  542. package/dist/components/primitives/slide/plugins/emoji/index.d.ts +8 -0
  543. package/dist/components/primitives/slide/plugins/emoji/map.d.ts +15 -0
  544. package/dist/components/primitives/slide/plugins/math/index.d.ts +6 -0
  545. package/dist/components/primitives/slide/plugins/mermaid/index.d.ts +48 -0
  546. package/dist/components/primitives/slide/plugins/shiki/index.d.ts +11 -0
  547. package/dist/components/primitives/slide/sanitize.d.ts +33 -0
  548. package/dist/components/primitives/slide/schema.d.ts +109 -0
  549. package/dist/components/primitives/slide/slide.d.ts +53 -0
  550. package/dist/components/primitives/slide/themes/index.d.ts +9 -0
  551. package/dist/components/primitives/slide/use-slide-fit.d.ts +21 -0
  552. package/dist/components/primitives/slide/validate.d.ts +33 -0
  553. package/dist/components/primitives/social-auth-row/index.d.ts +1 -0
  554. package/dist/components/primitives/social-auth-row/social-auth-row.d.ts +24 -0
  555. package/dist/components/primitives/stat-tile/index.d.ts +1 -0
  556. package/dist/components/primitives/stat-tile/stat-tile.d.ts +28 -0
  557. package/dist/components/primitives/status-dot/index.d.ts +1 -0
  558. package/dist/components/primitives/status-dot/status-dot.d.ts +31 -0
  559. package/dist/components/primitives/steps-rail/index.d.ts +1 -0
  560. package/dist/components/primitives/steps-rail/steps-rail.d.ts +24 -0
  561. package/dist/components/primitives/sub-agent-dispatch/index.d.ts +1 -0
  562. package/dist/components/primitives/sub-agent-dispatch/sub-agent-dispatch.d.ts +30 -0
  563. package/dist/components/primitives/switch/index.d.ts +1 -0
  564. package/dist/components/primitives/switch/switch.d.ts +20 -0
  565. package/dist/components/primitives/system-prompt-editor/index.d.ts +1 -0
  566. package/dist/components/primitives/system-prompt-editor/system-prompt-editor.d.ts +25 -0
  567. package/dist/components/primitives/table/index.d.ts +1 -0
  568. package/dist/components/primitives/table/table.d.ts +61 -0
  569. package/dist/components/primitives/tabs/index.d.ts +1 -0
  570. package/dist/components/primitives/tabs/tabs.d.ts +7 -0
  571. package/dist/components/primitives/task-plan/index.d.ts +1 -0
  572. package/dist/components/primitives/task-plan/task-plan.d.ts +36 -0
  573. package/dist/components/primitives/terminal-panel/index.d.ts +1 -0
  574. package/dist/components/primitives/terminal-panel/terminal-panel.d.ts +32 -0
  575. package/dist/components/primitives/textarea/index.d.ts +1 -0
  576. package/dist/components/primitives/textarea/textarea.d.ts +20 -0
  577. package/dist/components/primitives/thinking-level-selector/index.d.ts +1 -0
  578. package/dist/components/primitives/thinking-level-selector/thinking-level-selector.d.ts +24 -0
  579. package/dist/components/primitives/timestamp/index.d.ts +1 -0
  580. package/dist/components/primitives/timestamp/timestamp.d.ts +34 -0
  581. package/dist/components/primitives/toast/index.d.ts +2 -0
  582. package/dist/components/primitives/toast/toast.d.ts +34 -0
  583. package/dist/components/primitives/toast/toaster.d.ts +38 -0
  584. package/dist/components/primitives/token-usage-chart/index.d.ts +2 -0
  585. package/dist/components/primitives/token-usage-chart/token-usage-chart.d.ts +44 -0
  586. package/dist/components/primitives/token-usage-chart/usage-metrics.d.ts +23 -0
  587. package/dist/components/primitives/tool-call/index.d.ts +1 -0
  588. package/dist/components/primitives/tool-call/tool-call.d.ts +30 -0
  589. package/dist/components/primitives/tool-call-card/index.d.ts +1 -0
  590. package/dist/components/primitives/tool-call-card/tool-call-card.d.ts +30 -0
  591. package/dist/components/primitives/tool-result/index.d.ts +1 -0
  592. package/dist/components/primitives/tool-result/tool-result.d.ts +19 -0
  593. package/dist/components/primitives/tools-list/index.d.ts +1 -0
  594. package/dist/components/primitives/tools-list/tools-list.d.ts +32 -0
  595. package/dist/components/primitives/tooltip/index.d.ts +1 -0
  596. package/dist/components/primitives/tooltip/tooltip.d.ts +33 -0
  597. package/dist/components/primitives/topnav/index.d.ts +1 -0
  598. package/dist/components/primitives/topnav/topnav.d.ts +29 -0
  599. package/dist/components/primitives/update-banner/index.d.ts +1 -0
  600. package/dist/components/primitives/update-banner/update-banner.d.ts +16 -0
  601. package/dist/components/primitives/whiteboard/index.d.ts +2 -0
  602. package/dist/components/primitives/whiteboard/render/freedraw.d.ts +2 -0
  603. package/dist/components/primitives/whiteboard/render/line.d.ts +4 -0
  604. package/dist/components/primitives/whiteboard/render/rough-paths.d.ts +16 -0
  605. package/dist/components/primitives/whiteboard/render/scene.d.ts +3 -0
  606. package/dist/components/primitives/whiteboard/render/shape.d.ts +5 -0
  607. package/dist/components/primitives/whiteboard/render/style.d.ts +24 -0
  608. package/dist/components/primitives/whiteboard/render/text.d.ts +2 -0
  609. package/dist/components/primitives/whiteboard/schema.d.ts +596 -0
  610. package/dist/components/primitives/whiteboard/seed.d.ts +22 -0
  611. package/dist/components/primitives/whiteboard/validate.d.ts +26 -0
  612. package/dist/components/primitives/whiteboard/viewport/use-pointer-pan.d.ts +11 -0
  613. package/dist/components/primitives/whiteboard/viewport/use-viewport.d.ts +33 -0
  614. package/dist/components/primitives/whiteboard/whiteboard.d.ts +21 -0
  615. package/dist/components.css +1 -1
  616. package/dist/composites/account-menu/index.js +4 -4
  617. package/dist/composites/agent-composer/index.js +6 -5
  618. package/dist/composites/agent-editor/index.js +8 -7
  619. package/dist/composites/agent-stream/index.js +21 -9
  620. package/dist/composites/agent-timeline/index.js +3 -3
  621. package/dist/composites/agent-tool-renderer/index.js +17 -0
  622. package/dist/composites/agent-tool-renderer/index.js.map +1 -0
  623. package/dist/composites/approval-card/index.js +3 -3
  624. package/dist/composites/chat-composer/index.js +3 -3
  625. package/dist/composites/chat-message/index.js +18 -4
  626. package/dist/composites/choice-prompt/index.js +11 -0
  627. package/dist/composites/choice-prompt/index.js.map +1 -0
  628. package/dist/composites/code-block/index.js +3 -3
  629. package/dist/composites/command-palette/index.js +4 -3
  630. package/dist/composites/confirm-dialog/index.js +6 -5
  631. package/dist/composites/confirm-prompt/index.js +7 -0
  632. package/dist/composites/confirm-prompt/index.js.map +1 -0
  633. package/dist/composites/cron-jobs-list/index.js +3 -3
  634. package/dist/composites/data-table/index.js +8 -7
  635. package/dist/composites/deployment-row/index.js +3 -3
  636. package/dist/composites/domain-config/index.js +6 -5
  637. package/dist/composites/env-var-editor/index.js +7 -5
  638. package/dist/composites/mcp-server-list/index.js +4 -3
  639. package/dist/composites/metric-card/index.js +5 -0
  640. package/dist/composites/metric-card/index.js.map +1 -0
  641. package/dist/composites/multi-select-prompt/index.js +11 -0
  642. package/dist/composites/multi-select-prompt/index.js.map +1 -0
  643. package/dist/composites/page-shell/index.js +6 -5
  644. package/dist/composites/permission-modal/index.js +5 -4
  645. package/dist/composites/preview-env-card/index.js +4 -4
  646. package/dist/composites/preview-panel/index.js +3 -3
  647. package/dist/composites/project-card/index.js +4 -4
  648. package/dist/composites/rollback-ui/index.js +5 -4
  649. package/dist/composites/rule-editor/index.js +9 -8
  650. package/dist/composites/skill-editor/index.js +9 -8
  651. package/dist/composites/skills-list/index.js +4 -3
  652. package/dist/composites/stability-bundle-viewer/index.js +5 -0
  653. package/dist/composites/stability-bundle-viewer/index.js.map +1 -0
  654. package/dist/composites/status-indicator/index.js +4 -0
  655. package/dist/composites/status-indicator/index.js.map +1 -0
  656. package/dist/composites/task-header/index.js +3 -3
  657. package/dist/composites/text-prompt/index.js +10 -0
  658. package/dist/composites/text-prompt/index.js.map +1 -0
  659. package/dist/composites/usage-meter/index.js +3 -3
  660. package/dist/fonts-cdn.css +4 -4
  661. package/dist/fonts.css +2 -2
  662. package/dist/index.d.ts +144 -4461
  663. package/dist/index.js +999 -731
  664. package/dist/index.js.map +1 -1
  665. package/dist/lib/cn.d.ts +6 -0
  666. package/dist/lib/env.d.ts +55 -0
  667. package/dist/lib/live-region-context.d.ts +2 -0
  668. package/dist/lib/markdown/code-block.d.ts +14 -0
  669. package/dist/lib/markdown/inline-code.d.ts +10 -0
  670. package/dist/lib/markdown/math.d.ts +12 -0
  671. package/dist/lib/markdown/mermaid.d.ts +6 -0
  672. package/dist/lib/markdown/parser.d.ts +47 -0
  673. package/dist/lib/markdown/streaming-preprocess.d.ts +39 -0
  674. package/dist/lib/prompt.d.ts +40 -0
  675. package/dist/lib/safe-href.d.ts +27 -0
  676. package/dist/lib/sdk-tools-adapters/index.d.ts +1 -0
  677. package/dist/lib/sdk-tools-adapters/index.js +3 -0
  678. package/dist/lib/sdk-tools-adapters/index.js.map +1 -0
  679. package/dist/lib/sdk-tools-adapters/sdk-tools-adapters.d.ts +60 -0
  680. package/dist/lib/types.d.ts +10 -0
  681. package/dist/preset-v3-legacy.d.ts +7 -10
  682. package/dist/preset-v3-legacy.js +23 -3
  683. package/dist/preset-v3-legacy.js.map +1 -1
  684. package/dist/preset.css +2 -2
  685. package/dist/primitives/action-bar/index.js +2 -2
  686. package/dist/primitives/agent-error-card/index.js +2 -2
  687. package/dist/primitives/agent-event/index.js +3 -2
  688. package/dist/primitives/agent-handoff/index.js +2 -2
  689. package/dist/primitives/agent-profile/index.js +2 -2
  690. package/dist/primitives/agent-starting-state/index.js +2 -2
  691. package/dist/primitives/agent-streaming/index.js +2 -2
  692. package/dist/primitives/alert/index.js +2 -2
  693. package/dist/primitives/artifact-preview/index.js +2 -2
  694. package/dist/primitives/attachment-chip/index.js +2 -2
  695. package/dist/primitives/audit-log-entry/index.js +2 -2
  696. package/dist/primitives/auto-compact-notice/index.js +2 -2
  697. package/dist/primitives/avatar/index.js +2 -2
  698. package/dist/primitives/badge/index.js +2 -2
  699. package/dist/primitives/branch-indicator/index.js +4 -0
  700. package/dist/primitives/branch-indicator/index.js.map +1 -0
  701. package/dist/primitives/browser-controls/index.js +2 -2
  702. package/dist/primitives/build-log-stream/index.js +4 -2
  703. package/dist/primitives/button/index.js +2 -2
  704. package/dist/primitives/capability-indicator/index.js +2 -2
  705. package/dist/primitives/card/index.js +3 -2
  706. package/dist/primitives/channel-card/index.js +4 -0
  707. package/dist/primitives/channel-card/index.js.map +1 -0
  708. package/dist/primitives/chat-thread/index.js +2 -2
  709. package/dist/primitives/checkbox/index.js +2 -2
  710. package/dist/primitives/context-card/index.js +2 -2
  711. package/dist/primitives/context-window-bar/index.js +2 -2
  712. package/dist/primitives/copy-button/index.js +3 -2
  713. package/dist/primitives/cost-meter/index.js +2 -2
  714. package/dist/primitives/created-files-card/index.js +2 -2
  715. package/dist/primitives/cron-job-card/index.js +2 -2
  716. package/dist/primitives/danger-zone/index.js +2 -2
  717. package/dist/primitives/dialog/index.js +2 -2
  718. package/dist/primitives/diff-viewer/index.js +2 -2
  719. package/dist/primitives/dropdown-menu/index.js +2 -2
  720. package/dist/primitives/empty-state/index.js +2 -2
  721. package/dist/primitives/export-chat-dialog/index.js +5 -0
  722. package/dist/primitives/export-chat-dialog/index.js.map +1 -0
  723. package/dist/primitives/folder-context-card/index.js +2 -2
  724. package/dist/primitives/folder-selector/index.js +2 -2
  725. package/dist/primitives/form-field/index.js +3 -2
  726. package/dist/primitives/gateway-status-indicator/index.js +4 -0
  727. package/dist/primitives/gateway-status-indicator/index.js.map +1 -0
  728. package/dist/primitives/hook-config/index.js +3 -2
  729. package/dist/primitives/hook-event-log/index.js +2 -2
  730. package/dist/primitives/input/index.js +2 -2
  731. package/dist/primitives/intent-selector/index.js +2 -2
  732. package/dist/primitives/label/index.js +2 -2
  733. package/dist/primitives/lane-board/index.js +2 -2
  734. package/dist/primitives/login-split/index.js +2 -2
  735. package/dist/primitives/mcp-server-card/index.js +2 -2
  736. package/dist/primitives/memory-editor/index.js +2 -2
  737. package/dist/primitives/mention-menu/index.js +3 -2
  738. package/dist/primitives/metrics-panel/index.js +2 -2
  739. package/dist/primitives/model-card/index.js +2 -2
  740. package/dist/primitives/model-selector/index.js +2 -2
  741. package/dist/primitives/pagination/index.js +2 -2
  742. package/dist/primitives/permission-matrix/index.js +3 -2
  743. package/dist/primitives/pin-input/index.js +3 -2
  744. package/dist/primitives/plan-badge/index.js +2 -2
  745. package/dist/primitives/progress/index.js +2 -2
  746. package/dist/primitives/progress-checklist/index.js +2 -2
  747. package/dist/primitives/project-switcher/index.js +2 -2
  748. package/dist/primitives/quick-action-chips/index.js +2 -2
  749. package/dist/primitives/radio-group/index.js +2 -2
  750. package/dist/primitives/recent-folders-list/index.js +2 -2
  751. package/dist/primitives/rule-card/index.js +2 -2
  752. package/dist/primitives/run-stats/index.js +2 -2
  753. package/dist/primitives/run-status-pill/index.js +4 -0
  754. package/dist/primitives/run-status-pill/index.js.map +1 -0
  755. package/dist/primitives/running-tasks-panel/index.js +2 -2
  756. package/dist/primitives/scroll-area/index.js +3 -2
  757. package/dist/primitives/select/index.js +2 -2
  758. package/dist/primitives/session-list-item/index.js +2 -2
  759. package/dist/primitives/session-timeline/index.js +2 -2
  760. package/dist/primitives/sheet/index.js +2 -2
  761. package/dist/primitives/sidebar/index.js +2 -2
  762. package/dist/primitives/skeleton/index.js +2 -2
  763. package/dist/primitives/skill-card/index.js +2 -2
  764. package/dist/primitives/social-auth-row/index.js +2 -2
  765. package/dist/primitives/stat-tile/index.js +2 -2
  766. package/dist/primitives/status-dot/index.js +4 -2
  767. package/dist/primitives/steps-rail/index.js +2 -2
  768. package/dist/primitives/sub-agent-dispatch/index.js +2 -2
  769. package/dist/primitives/switch/index.js +2 -2
  770. package/dist/primitives/system-prompt-editor/index.js +3 -2
  771. package/dist/primitives/table/index.js +3 -2
  772. package/dist/primitives/tabs/index.js +2 -2
  773. package/dist/primitives/task-plan/index.js +2 -2
  774. package/dist/primitives/terminal-panel/index.js +2 -2
  775. package/dist/primitives/textarea/index.js +2 -2
  776. package/dist/primitives/thinking-level-selector/index.js +5 -0
  777. package/dist/primitives/thinking-level-selector/index.js.map +1 -0
  778. package/dist/primitives/timestamp/index.js +4 -2
  779. package/dist/primitives/toast/index.js +3 -2
  780. package/dist/primitives/token-usage-chart/index.js +2 -2
  781. package/dist/primitives/tool-call/index.js +3 -2
  782. package/dist/primitives/tool-call-card/index.js +3 -2
  783. package/dist/primitives/tool-result/index.js +2 -2
  784. package/dist/primitives/tools-list/index.js +2 -2
  785. package/dist/primitives/tooltip/index.js +2 -2
  786. package/dist/primitives/topnav/index.js +2 -2
  787. package/dist/primitives/update-banner/index.js +4 -0
  788. package/dist/primitives/update-banner/index.js.map +1 -0
  789. package/dist/screens/theo-code-shell.d.ts +9 -0
  790. package/dist/screens/theo-code-shell.data.d.ts +147 -0
  791. package/dist/slide/index.js +2 -1
  792. package/dist/slide/plugins/mermaid/index.js +1 -1
  793. package/dist/slide/plugins/mermaid/index.js.map +1 -1
  794. package/dist/slide/plugins/shiki/index.js.map +1 -1
  795. package/dist/slide/themes/violet-forge.css +1 -1
  796. package/dist/slide-deck/index.js +13 -2
  797. package/dist/slide-deck/index.js.map +1 -1
  798. package/dist/styles/tailwind-preset.d.ts +29 -0
  799. package/dist/styles.css +3 -3
  800. package/dist/test/a11y.d.ts +13 -0
  801. package/dist/test/setup.d.ts +1 -0
  802. package/dist/themes/anthropic-style.d.ts +11 -0
  803. package/dist/themes/aurora-terminal.d.ts +9 -0
  804. package/dist/themes/classic-paper.d.ts +17 -0
  805. package/dist/themes/color-value-pattern.d.ts +22 -0
  806. package/dist/themes/color.d.ts +62 -0
  807. package/dist/themes/define.d.ts +65 -0
  808. package/dist/themes/density.d.ts +17 -0
  809. package/dist/themes/dracula.d.ts +14 -0
  810. package/dist/themes/github-dark.d.ts +11 -0
  811. package/dist/themes/index.d.ts +26 -0
  812. package/dist/themes/linear-glass.d.ts +11 -0
  813. package/dist/themes/one-dark.d.ts +11 -0
  814. package/dist/themes/openai-style.d.ts +10 -0
  815. package/dist/themes/schema.d.ts +112 -0
  816. package/dist/themes/theme-provider.d.ts +82 -0
  817. package/dist/themes/theme-script.d.ts +48 -0
  818. package/dist/themes/theme-switcher.d.ts +17 -0
  819. package/dist/themes/types.d.ts +88 -0
  820. package/dist/themes/vercel-mono.d.ts +11 -0
  821. package/dist/themes/violet-forge.d.ts +12 -0
  822. package/dist/theo-ui-provider.d.ts +50 -0
  823. package/dist/tokens-v4.css +77 -41
  824. package/dist/tokens.css +159 -74
  825. package/dist/types/agent.d.ts +19 -0
  826. package/dist/types/chat.d.ts +173 -0
  827. package/dist/types/mode.d.ts +16 -0
  828. package/dist/types/permission.d.ts +8 -0
  829. package/dist/types/rule.d.ts +28 -0
  830. package/dist/types/task.d.ts +9 -0
  831. package/dist/vite-plugin.d.ts +7 -11
  832. package/dist/vite-plugin.js +4 -4
  833. package/dist/vite-plugin.js.map +1 -1
  834. package/dist/whiteboard/index.js +3 -0
  835. package/dist/whiteboard/index.js.map +1 -1
  836. package/llms.txt +39 -39
  837. package/package.json +246 -174
  838. package/registry/index.json +58 -4
  839. package/registry/r/account-menu.json +1 -1
  840. package/registry/r/action-bar.json +1 -1
  841. package/registry/r/agent-composer.json +1 -1
  842. package/registry/r/agent-editor.json +1 -1
  843. package/registry/r/agent-error-card.json +1 -1
  844. package/registry/r/agent-event.json +1 -1
  845. package/registry/r/agent-handoff.json +1 -1
  846. package/registry/r/agent-profile.json +1 -1
  847. package/registry/r/agent-starting-state.json +1 -1
  848. package/registry/r/agent-stream.json +1 -1
  849. package/registry/r/agent-streaming.json +1 -1
  850. package/registry/r/agent-timeline.json +1 -1
  851. package/registry/r/agent-tool-renderer.json +40 -0
  852. package/registry/r/alert.json +1 -1
  853. package/registry/r/approval-card.json +1 -1
  854. package/registry/r/artifact-preview.json +1 -1
  855. package/registry/r/attachment-chip.json +1 -1
  856. package/registry/r/audit-log-entry.json +1 -1
  857. package/registry/r/auto-compact-notice.json +1 -1
  858. package/registry/r/avatar.json +1 -1
  859. package/registry/r/badge.json +1 -1
  860. package/registry/r/browser-controls.json +1 -1
  861. package/registry/r/build-log-stream.json +2 -1
  862. package/registry/r/button.json +1 -1
  863. package/registry/r/capability-indicator.json +1 -1
  864. package/registry/r/card.json +1 -1
  865. package/registry/r/chat-composer.json +1 -1
  866. package/registry/r/chat-message.json +11 -16
  867. package/registry/r/chat-thread.json +1 -1
  868. package/registry/r/chat-types.json +1 -1
  869. package/registry/r/checkbox.json +1 -1
  870. package/registry/r/choice-prompt.json +25 -0
  871. package/registry/r/cn.json +1 -1
  872. package/registry/r/code-block.json +1 -1
  873. package/registry/r/command-palette.json +1 -1
  874. package/registry/r/confirm-dialog.json +1 -1
  875. package/registry/r/confirm-prompt.json +21 -0
  876. package/registry/r/context-card.json +1 -1
  877. package/registry/r/context-window-bar.json +1 -1
  878. package/registry/r/copy-button.json +1 -1
  879. package/registry/r/cost-meter.json +1 -1
  880. package/registry/r/created-files-card.json +1 -1
  881. package/registry/r/cron-job-card.json +1 -1
  882. package/registry/r/cron-jobs-list.json +1 -1
  883. package/registry/r/danger-zone.json +1 -1
  884. package/registry/r/data-table.json +1 -1
  885. package/registry/r/deployment-row.json +1 -1
  886. package/registry/r/dialog.json +1 -1
  887. package/registry/r/diff-viewer.json +1 -1
  888. package/registry/r/domain-config.json +1 -1
  889. package/registry/r/dropdown-menu.json +2 -2
  890. package/registry/r/empty-state.json +1 -1
  891. package/registry/r/env-var-editor.json +2 -1
  892. package/registry/r/env.json +15 -0
  893. package/registry/r/folder-context-card.json +1 -1
  894. package/registry/r/folder-selector.json +1 -1
  895. package/registry/r/form-field.json +1 -1
  896. package/registry/r/hook-config.json +1 -1
  897. package/registry/r/hook-event-log.json +1 -1
  898. package/registry/r/input.json +1 -1
  899. package/registry/r/intent-selector.json +1 -1
  900. package/registry/r/label.json +1 -1
  901. package/registry/r/lane-board.json +1 -1
  902. package/registry/r/login-split.json +1 -1
  903. package/registry/r/mcp-server-card.json +1 -1
  904. package/registry/r/mcp-server-list.json +1 -1
  905. package/registry/r/memory-editor.json +1 -1
  906. package/registry/r/mention-menu.json +1 -1
  907. package/registry/r/metric-card.json +23 -0
  908. package/registry/r/metrics-panel.json +1 -1
  909. package/registry/r/model-card.json +1 -1
  910. package/registry/r/model-selector.json +1 -1
  911. package/registry/r/multi-select-prompt.json +25 -0
  912. package/registry/r/page-shell.json +1 -1
  913. package/registry/r/pagination.json +1 -1
  914. package/registry/r/permission-matrix.json +1 -1
  915. package/registry/r/permission-modal.json +1 -1
  916. package/registry/r/pin-input.json +1 -1
  917. package/registry/r/plan-badge.json +1 -1
  918. package/registry/r/preview-env-card.json +1 -1
  919. package/registry/r/preview-panel.json +1 -1
  920. package/registry/r/progress-checklist.json +1 -1
  921. package/registry/r/progress.json +1 -1
  922. package/registry/r/project-card.json +1 -1
  923. package/registry/r/project-switcher.json +1 -1
  924. package/registry/r/prompt.json +15 -0
  925. package/registry/r/quick-action-chips.json +1 -1
  926. package/registry/r/radio-group.json +1 -1
  927. package/registry/r/recent-folders-list.json +1 -1
  928. package/registry/r/rollback-ui.json +1 -1
  929. package/registry/r/rule-card.json +1 -1
  930. package/registry/r/rule-editor.json +1 -1
  931. package/registry/r/run-stats.json +1 -1
  932. package/registry/r/running-tasks-panel.json +1 -1
  933. package/registry/r/safe-href.json +1 -1
  934. package/registry/r/scroll-area.json +1 -1
  935. package/registry/r/select.json +1 -1
  936. package/registry/r/session-list-item.json +1 -1
  937. package/registry/r/session-timeline.json +1 -1
  938. package/registry/r/sheet.json +1 -1
  939. package/registry/r/sidebar.json +1 -1
  940. package/registry/r/skeleton.json +1 -1
  941. package/registry/r/skill-card.json +1 -1
  942. package/registry/r/skill-editor.json +1 -1
  943. package/registry/r/skills-list.json +1 -1
  944. package/registry/r/slide-deck.json +8 -8
  945. package/registry/r/slide-plugin-mermaid.json +1 -1
  946. package/registry/r/slide-plugin-shiki.json +1 -1
  947. package/registry/r/slide.json +6 -6
  948. package/registry/r/social-auth-row.json +1 -1
  949. package/registry/r/stat-tile.json +1 -1
  950. package/registry/r/status-dot.json +2 -1
  951. package/registry/r/status-indicator.json +20 -0
  952. package/registry/r/steps-rail.json +1 -1
  953. package/registry/r/sub-agent-dispatch.json +1 -1
  954. package/registry/r/switch.json +1 -1
  955. package/registry/r/system-prompt-editor.json +1 -1
  956. package/registry/r/table.json +1 -1
  957. package/registry/r/tabs.json +1 -1
  958. package/registry/r/tailwind-preset.json +1 -1
  959. package/registry/r/task-header.json +1 -1
  960. package/registry/r/task-plan.json +1 -1
  961. package/registry/r/terminal-panel.json +1 -1
  962. package/registry/r/text-prompt.json +24 -0
  963. package/registry/r/textarea.json +1 -1
  964. package/registry/r/theme-provider.json +7 -6
  965. package/registry/r/theo-ui-provider.json +1 -1
  966. package/registry/r/timestamp.json +2 -1
  967. package/registry/r/toast.json +2 -2
  968. package/registry/r/token-usage-chart.json +1 -1
  969. package/registry/r/tokens.json +2 -2
  970. package/registry/r/tool-call-card.json +1 -1
  971. package/registry/r/tool-call.json +1 -1
  972. package/registry/r/tool-result.json +1 -1
  973. package/registry/r/tools-list.json +1 -1
  974. package/registry/r/tooltip.json +1 -1
  975. package/registry/r/topnav.json +1 -1
  976. package/registry/r/usage-meter.json +1 -1
  977. package/registry/r/whiteboard.json +3 -3
  978. package/dist/chunk-2UJROWAG.js +0 -106
  979. package/dist/chunk-2UJROWAG.js.map +0 -1
  980. package/dist/chunk-2XPWOUEH.js +0 -68
  981. package/dist/chunk-2XPWOUEH.js.map +0 -1
  982. package/dist/chunk-3GHLNCM3.js +0 -42
  983. package/dist/chunk-3GHLNCM3.js.map +0 -1
  984. package/dist/chunk-3HOXC25T.js +0 -48
  985. package/dist/chunk-3HOXC25T.js.map +0 -1
  986. package/dist/chunk-3QGO5SB3.js +0 -46
  987. package/dist/chunk-3QGO5SB3.js.map +0 -1
  988. package/dist/chunk-47QJVWW2.js +0 -85
  989. package/dist/chunk-47QJVWW2.js.map +0 -1
  990. package/dist/chunk-4L63UW3I.js +0 -35
  991. package/dist/chunk-4L63UW3I.js.map +0 -1
  992. package/dist/chunk-4UUSJJFZ.js +0 -25
  993. package/dist/chunk-4UUSJJFZ.js.map +0 -1
  994. package/dist/chunk-4ZBZBRG5.js +0 -127
  995. package/dist/chunk-4ZBZBRG5.js.map +0 -1
  996. package/dist/chunk-57NXT3OX.js +0 -92
  997. package/dist/chunk-57NXT3OX.js.map +0 -1
  998. package/dist/chunk-5FF5EUZP.js +0 -44
  999. package/dist/chunk-5FF5EUZP.js.map +0 -1
  1000. package/dist/chunk-5UGQXB2P.js +0 -714
  1001. package/dist/chunk-5UGQXB2P.js.map +0 -1
  1002. package/dist/chunk-62FT22CI.js +0 -85
  1003. package/dist/chunk-62FT22CI.js.map +0 -1
  1004. package/dist/chunk-673R3GSK.js +0 -19
  1005. package/dist/chunk-673R3GSK.js.map +0 -1
  1006. package/dist/chunk-6VINZJBV.js +0 -128
  1007. package/dist/chunk-6VINZJBV.js.map +0 -1
  1008. package/dist/chunk-74NZ5U3E.js +0 -145
  1009. package/dist/chunk-74NZ5U3E.js.map +0 -1
  1010. package/dist/chunk-755NWSNW.js +0 -36
  1011. package/dist/chunk-755NWSNW.js.map +0 -1
  1012. package/dist/chunk-7GLBWWMW.js +0 -70
  1013. package/dist/chunk-7GLBWWMW.js.map +0 -1
  1014. package/dist/chunk-7RXYW5VM.js +0 -88
  1015. package/dist/chunk-7RXYW5VM.js.map +0 -1
  1016. package/dist/chunk-AC4MGCXI.js +0 -92
  1017. package/dist/chunk-AC4MGCXI.js.map +0 -1
  1018. package/dist/chunk-AEVSVDT6.js +0 -67
  1019. package/dist/chunk-AEVSVDT6.js.map +0 -1
  1020. package/dist/chunk-AODIMN2N.js +0 -68
  1021. package/dist/chunk-AODIMN2N.js.map +0 -1
  1022. package/dist/chunk-ATHOPBCA.js +0 -61
  1023. package/dist/chunk-ATHOPBCA.js.map +0 -1
  1024. package/dist/chunk-AXKBNRZW.js +0 -173
  1025. package/dist/chunk-AXKBNRZW.js.map +0 -1
  1026. package/dist/chunk-B75MEYNR.js +0 -106
  1027. package/dist/chunk-B75MEYNR.js.map +0 -1
  1028. package/dist/chunk-BGKA6DI6.js +0 -34
  1029. package/dist/chunk-BGKA6DI6.js.map +0 -1
  1030. package/dist/chunk-BNQAJGEN.js +0 -88
  1031. package/dist/chunk-BNQAJGEN.js.map +0 -1
  1032. package/dist/chunk-BP2SETUC.js +0 -101
  1033. package/dist/chunk-BP2SETUC.js.map +0 -1
  1034. package/dist/chunk-BPUQWMBD.js +0 -79
  1035. package/dist/chunk-BPUQWMBD.js.map +0 -1
  1036. package/dist/chunk-BVDASR3Y.js +0 -74
  1037. package/dist/chunk-BVDASR3Y.js.map +0 -1
  1038. package/dist/chunk-BX7A5GUV.js +0 -78
  1039. package/dist/chunk-BX7A5GUV.js.map +0 -1
  1040. package/dist/chunk-CDA6RYOX.js +0 -115
  1041. package/dist/chunk-CDA6RYOX.js.map +0 -1
  1042. package/dist/chunk-CG7O3A42.js +0 -80
  1043. package/dist/chunk-CG7O3A42.js.map +0 -1
  1044. package/dist/chunk-CIYGNPKT.js +0 -76
  1045. package/dist/chunk-CIYGNPKT.js.map +0 -1
  1046. package/dist/chunk-CKXY4FTV.js +0 -59
  1047. package/dist/chunk-CKXY4FTV.js.map +0 -1
  1048. package/dist/chunk-CVOKZITR.js +0 -82
  1049. package/dist/chunk-CVOKZITR.js.map +0 -1
  1050. package/dist/chunk-CWFMFKDI.js +0 -82
  1051. package/dist/chunk-CWFMFKDI.js.map +0 -1
  1052. package/dist/chunk-CWVKSV7S.js +0 -124
  1053. package/dist/chunk-CWVKSV7S.js.map +0 -1
  1054. package/dist/chunk-CYOLRWOX.js +0 -63
  1055. package/dist/chunk-CYOLRWOX.js.map +0 -1
  1056. package/dist/chunk-D23LRJT6.js +0 -116
  1057. package/dist/chunk-D23LRJT6.js.map +0 -1
  1058. package/dist/chunk-DFADMEJK.js +0 -127
  1059. package/dist/chunk-DFADMEJK.js.map +0 -1
  1060. package/dist/chunk-DKQAHZG2.js +0 -83
  1061. package/dist/chunk-DKQAHZG2.js.map +0 -1
  1062. package/dist/chunk-DW247T3Q.js +0 -199
  1063. package/dist/chunk-DW247T3Q.js.map +0 -1
  1064. package/dist/chunk-E5A7HN6H.js +0 -32
  1065. package/dist/chunk-E5A7HN6H.js.map +0 -1
  1066. package/dist/chunk-EI63GTN7.js +0 -57
  1067. package/dist/chunk-EI63GTN7.js.map +0 -1
  1068. package/dist/chunk-EP25QJ4N.js +0 -146
  1069. package/dist/chunk-EP25QJ4N.js.map +0 -1
  1070. package/dist/chunk-ET44426Q.js +0 -80
  1071. package/dist/chunk-ET44426Q.js.map +0 -1
  1072. package/dist/chunk-ETEIDY34.js +0 -67
  1073. package/dist/chunk-ETEIDY34.js.map +0 -1
  1074. package/dist/chunk-EU55O4P7.js +0 -76
  1075. package/dist/chunk-EU55O4P7.js.map +0 -1
  1076. package/dist/chunk-F436537E.js +0 -104
  1077. package/dist/chunk-F436537E.js.map +0 -1
  1078. package/dist/chunk-FLBTGNQI.js +0 -86
  1079. package/dist/chunk-FLBTGNQI.js.map +0 -1
  1080. package/dist/chunk-FUT45NFW.js +0 -46
  1081. package/dist/chunk-FUT45NFW.js.map +0 -1
  1082. package/dist/chunk-G3LWNTVZ.js +0 -51
  1083. package/dist/chunk-G3LWNTVZ.js.map +0 -1
  1084. package/dist/chunk-GBJB5WLT.js +0 -58
  1085. package/dist/chunk-GBJB5WLT.js.map +0 -1
  1086. package/dist/chunk-GIEPEFRX.js +0 -110
  1087. package/dist/chunk-GIEPEFRX.js.map +0 -1
  1088. package/dist/chunk-GSO7MISR.js +0 -58
  1089. package/dist/chunk-GSO7MISR.js.map +0 -1
  1090. package/dist/chunk-GUQFYUIC.js +0 -61
  1091. package/dist/chunk-GUQFYUIC.js.map +0 -1
  1092. package/dist/chunk-H3VJMFJQ.js +0 -35
  1093. package/dist/chunk-H3VJMFJQ.js.map +0 -1
  1094. package/dist/chunk-HG4WEERE.js +0 -26
  1095. package/dist/chunk-HG4WEERE.js.map +0 -1
  1096. package/dist/chunk-HGPBGLNP.js +0 -51
  1097. package/dist/chunk-HGPBGLNP.js.map +0 -1
  1098. package/dist/chunk-HQFTW7SF.js +0 -141
  1099. package/dist/chunk-HQFTW7SF.js.map +0 -1
  1100. package/dist/chunk-I7WYM63C.js +0 -170
  1101. package/dist/chunk-I7WYM63C.js.map +0 -1
  1102. package/dist/chunk-IPEYGWA7.js +0 -186
  1103. package/dist/chunk-IPEYGWA7.js.map +0 -1
  1104. package/dist/chunk-JQXLPVWP.js +0 -74
  1105. package/dist/chunk-JQXLPVWP.js.map +0 -1
  1106. package/dist/chunk-K5ARID4S.js +0 -26
  1107. package/dist/chunk-K5ARID4S.js.map +0 -1
  1108. package/dist/chunk-K6RTLPIJ.js +0 -41
  1109. package/dist/chunk-K6RTLPIJ.js.map +0 -1
  1110. package/dist/chunk-KQNKKV2C.js +0 -56
  1111. package/dist/chunk-KQNKKV2C.js.map +0 -1
  1112. package/dist/chunk-KRN4NE4U.js +0 -155
  1113. package/dist/chunk-KRN4NE4U.js.map +0 -1
  1114. package/dist/chunk-L2BI762I.js +0 -82
  1115. package/dist/chunk-L2BI762I.js.map +0 -1
  1116. package/dist/chunk-LEEH63B2.js +0 -56
  1117. package/dist/chunk-LEEH63B2.js.map +0 -1
  1118. package/dist/chunk-LHRWVM3G.js +0 -42
  1119. package/dist/chunk-LHRWVM3G.js.map +0 -1
  1120. package/dist/chunk-LIGWMGXM.js +0 -117
  1121. package/dist/chunk-LIGWMGXM.js.map +0 -1
  1122. package/dist/chunk-LKYSX3QF.js +0 -104
  1123. package/dist/chunk-LKYSX3QF.js.map +0 -1
  1124. package/dist/chunk-MCIFB6VS.js +0 -54
  1125. package/dist/chunk-MCIFB6VS.js.map +0 -1
  1126. package/dist/chunk-MI5CXMZU.js +0 -171
  1127. package/dist/chunk-MI5CXMZU.js.map +0 -1
  1128. package/dist/chunk-NQZYY4LR.js +0 -84
  1129. package/dist/chunk-NQZYY4LR.js.map +0 -1
  1130. package/dist/chunk-O23LKHUR.js +0 -66
  1131. package/dist/chunk-O23LKHUR.js.map +0 -1
  1132. package/dist/chunk-PASI2U2R.js +0 -23
  1133. package/dist/chunk-PASI2U2R.js.map +0 -1
  1134. package/dist/chunk-PPH5NTHV.js +0 -34
  1135. package/dist/chunk-PPH5NTHV.js.map +0 -1
  1136. package/dist/chunk-PR6OZF6D.js +0 -28
  1137. package/dist/chunk-PR6OZF6D.js.map +0 -1
  1138. package/dist/chunk-PWXOXPFT.js +0 -142
  1139. package/dist/chunk-PWXOXPFT.js.map +0 -1
  1140. package/dist/chunk-QB6BNHO3.js +0 -112
  1141. package/dist/chunk-QB6BNHO3.js.map +0 -1
  1142. package/dist/chunk-QJGGTIUN.js +0 -110
  1143. package/dist/chunk-QJGGTIUN.js.map +0 -1
  1144. package/dist/chunk-QSOIJ6J3.js +0 -91
  1145. package/dist/chunk-QSOIJ6J3.js.map +0 -1
  1146. package/dist/chunk-R2PAGRDP.js +0 -152
  1147. package/dist/chunk-R2PAGRDP.js.map +0 -1
  1148. package/dist/chunk-R63ZKLQM.js +0 -45
  1149. package/dist/chunk-R63ZKLQM.js.map +0 -1
  1150. package/dist/chunk-RTYYJPPE.js +0 -77
  1151. package/dist/chunk-RTYYJPPE.js.map +0 -1
  1152. package/dist/chunk-RVOBP7PO.js +0 -116
  1153. package/dist/chunk-RVOBP7PO.js.map +0 -1
  1154. package/dist/chunk-SF6R5VMQ.js +0 -97
  1155. package/dist/chunk-SF6R5VMQ.js.map +0 -1
  1156. package/dist/chunk-SP4CP5HY.js +0 -57
  1157. package/dist/chunk-SP4CP5HY.js.map +0 -1
  1158. package/dist/chunk-SWJ4EUOI.js +0 -30
  1159. package/dist/chunk-SWJ4EUOI.js.map +0 -1
  1160. package/dist/chunk-TK24HQJJ.js +0 -128
  1161. package/dist/chunk-TK24HQJJ.js.map +0 -1
  1162. package/dist/chunk-TNBJ36XJ.js +0 -156
  1163. package/dist/chunk-TNBJ36XJ.js.map +0 -1
  1164. package/dist/chunk-TO3UAT6O.js +0 -221
  1165. package/dist/chunk-TO3UAT6O.js.map +0 -1
  1166. package/dist/chunk-UAYOOTRR.js +0 -77
  1167. package/dist/chunk-UAYOOTRR.js.map +0 -1
  1168. package/dist/chunk-UDTAMHXW.js +0 -55
  1169. package/dist/chunk-UDTAMHXW.js.map +0 -1
  1170. package/dist/chunk-UOXU7NDY.js +0 -120
  1171. package/dist/chunk-UOXU7NDY.js.map +0 -1
  1172. package/dist/chunk-V7OOTVK3.js +0 -106
  1173. package/dist/chunk-V7OOTVK3.js.map +0 -1
  1174. package/dist/chunk-VI5M7KJ2.js +0 -1022
  1175. package/dist/chunk-VI5M7KJ2.js.map +0 -1
  1176. package/dist/chunk-VMMATOPE.js +0 -64
  1177. package/dist/chunk-VMMATOPE.js.map +0 -1
  1178. package/dist/chunk-W2PVSIW3.js +0 -89
  1179. package/dist/chunk-W2PVSIW3.js.map +0 -1
  1180. package/dist/chunk-W3DUDZDU.js +0 -88
  1181. package/dist/chunk-W3DUDZDU.js.map +0 -1
  1182. package/dist/chunk-WKEUU2FU.js +0 -114
  1183. package/dist/chunk-WKEUU2FU.js.map +0 -1
  1184. package/dist/chunk-WKLW7RC6.js +0 -28
  1185. package/dist/chunk-WKLW7RC6.js.map +0 -1
  1186. package/dist/chunk-WSJGZNUH.js +0 -111
  1187. package/dist/chunk-WSJGZNUH.js.map +0 -1
  1188. package/dist/chunk-WVPDQMC2.js +0 -144
  1189. package/dist/chunk-WVPDQMC2.js.map +0 -1
  1190. package/dist/chunk-WWNH5ENT.js +0 -43
  1191. package/dist/chunk-WWNH5ENT.js.map +0 -1
  1192. package/dist/chunk-X5L62PXY.js +0 -112
  1193. package/dist/chunk-X5L62PXY.js.map +0 -1
  1194. package/dist/chunk-XGCV5E6W.js +0 -133
  1195. package/dist/chunk-XGCV5E6W.js.map +0 -1
  1196. package/dist/chunk-XRKIEL5M.js +0 -72
  1197. package/dist/chunk-XRKIEL5M.js.map +0 -1
  1198. package/dist/chunk-XUJYEADU.js +0 -80
  1199. package/dist/chunk-XUJYEADU.js.map +0 -1
  1200. package/dist/chunk-XVYNSIQC.js +0 -116
  1201. package/dist/chunk-XVYNSIQC.js.map +0 -1
  1202. package/dist/chunk-XWTISHXO.js +0 -54
  1203. package/dist/chunk-XWTISHXO.js.map +0 -1
  1204. package/dist/chunk-YOGHS4UU.js +0 -202
  1205. package/dist/chunk-YOGHS4UU.js.map +0 -1
  1206. package/dist/chunk-YRSKXEOD.js +0 -135
  1207. package/dist/chunk-YRSKXEOD.js.map +0 -1
  1208. package/dist/chunk-ZALLCR7X.js +0 -108
  1209. package/dist/chunk-ZALLCR7X.js.map +0 -1
  1210. package/dist/chunk-ZDAOHMCW.js +0 -46
  1211. package/dist/chunk-ZDAOHMCW.js.map +0 -1
  1212. package/dist/chunk-ZESICCKK.js +0 -37
  1213. package/dist/chunk-ZESICCKK.js.map +0 -1
  1214. package/dist/chunk-ZIKFOD6N.js +0 -87
  1215. package/dist/chunk-ZIKFOD6N.js.map +0 -1
  1216. package/dist/chunk-ZJRWCQEN.js +0 -76
  1217. package/dist/chunk-ZJRWCQEN.js.map +0 -1
  1218. package/dist/chunk-ZSRJCIWF.js +0 -24
  1219. package/dist/chunk-ZSRJCIWF.js.map +0 -1
  1220. package/dist/plugin-Atb0VKtr.d.ts +0 -172
  1221. package/dist/slide/index.d.ts +0 -212
  1222. package/dist/slide/plugins/emoji/index.d.ts +0 -29
  1223. package/dist/slide/plugins/math/index.d.ts +0 -13
  1224. package/dist/slide/plugins/mermaid/index.d.ts +0 -55
  1225. package/dist/slide/plugins/shiki/index.d.ts +0 -18
  1226. package/dist/slide-deck/index.d.ts +0 -377
  1227. package/dist/whiteboard/index.d.ts +0 -258
@@ -1,1022 +0,0 @@
1
- import { safeHref } from './chunk-673R3GSK.js';
2
- import { Button } from './chunk-57NXT3OX.js';
3
- import { cn } from './chunk-ZSRJCIWF.js';
4
- import { memo, forwardRef, createContext, useState, useEffect, createElement, useCallback, useMemo, useContext } from 'react';
5
- import { BrainCircuitIcon, ImageIcon, FileIcon, ExternalLinkIcon, FileTextIcon, WrenchIcon, CodeIcon, ShieldIcon, AlertCircleIcon, CheckCircleIcon, LoaderIcon, ChevronLeftIcon, ChevronRightIcon, CheckIcon, CopyIcon } from 'lucide-react';
6
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
-
8
- // src/types/chat.ts
9
- function isTextUIPart(part) {
10
- return part.type === "text";
11
- }
12
- function isReasoningUIPart(part) {
13
- return part.type === "reasoning";
14
- }
15
- function isFileUIPart(part) {
16
- return part.type === "file";
17
- }
18
- function isReasoningFileUIPart(part) {
19
- return part.type === "reasoning-file";
20
- }
21
- function isSourceUrlUIPart(part) {
22
- return part.type === "source-url";
23
- }
24
- function isSourceDocumentUIPart(part) {
25
- return part.type === "source-document";
26
- }
27
- function isStepStartUIPart(part) {
28
- return part.type === "step-start";
29
- }
30
- function isCustomContentUIPart(part) {
31
- return part.type === "custom";
32
- }
33
- function isToolUIPart(part) {
34
- return part.type === "dynamic-tool" || part.type.startsWith("tool-");
35
- }
36
- function isDataUIPart(part) {
37
- return part.type.startsWith("data-");
38
- }
39
- function deriveDataName(part) {
40
- return part.type.slice("data-".length);
41
- }
42
- function DataPart({ part, renderers }) {
43
- const name = deriveDataName(part);
44
- const renderer = renderers?.[part.type] ?? renderers?.[name];
45
- if (renderer) return renderer(part.data, part);
46
- return /* @__PURE__ */ jsxs(
47
- "details",
48
- {
49
- className: cn("my-2 rounded-md border border-border bg-muted/20 px-3 py-1.5 text-body-sm"),
50
- "data-theo-data": name,
51
- children: [
52
- /* @__PURE__ */ jsxs("summary", { className: "flex cursor-pointer items-center gap-1.5 font-mono text-label-caps text-muted-foreground uppercase tracking-wider", children: [
53
- /* @__PURE__ */ jsx(CodeIcon, { className: "size-3", "aria-hidden": "true" }),
54
- /* @__PURE__ */ jsxs("span", { children: [
55
- "data-",
56
- name
57
- ] })
58
- ] }),
59
- /* @__PURE__ */ jsx("pre", { className: "mt-2 overflow-x-auto border-border border-t pt-2 text-code-sm", children: /* @__PURE__ */ jsx("code", { children: safeStringify(part.data) }) })
60
- ]
61
- }
62
- );
63
- }
64
- function safeStringify(value) {
65
- try {
66
- return JSON.stringify(value, null, 2);
67
- } catch {
68
- return String(value);
69
- }
70
- }
71
- function isImage(mediaType) {
72
- return mediaType.startsWith("image/") || mediaType === "image";
73
- }
74
- function FilePart({ part }) {
75
- const safeUrl = safeHref(part.url);
76
- const label = part.filename ?? part.url.split("/").pop() ?? "file";
77
- if (isImage(part.mediaType)) {
78
- if (!safeUrl) {
79
- return /* @__PURE__ */ jsxs(
80
- "div",
81
- {
82
- className: cn(
83
- "my-2 inline-flex items-center gap-2 rounded-md border border-border bg-muted/30 px-3 py-2",
84
- "text-body-sm text-muted-foreground"
85
- ),
86
- children: [
87
- /* @__PURE__ */ jsx(ImageIcon, { className: "size-4", "aria-hidden": "true" }),
88
- /* @__PURE__ */ jsx("span", { children: label }),
89
- /* @__PURE__ */ jsx("span", { className: "text-destructive", children: "(blocked)" })
90
- ]
91
- }
92
- );
93
- }
94
- return /* @__PURE__ */ jsxs(
95
- "figure",
96
- {
97
- className: "my-3 overflow-hidden rounded-lg border border-border",
98
- "data-theo-file": "image",
99
- children: [
100
- /* @__PURE__ */ jsx("img", { src: safeUrl, alt: label, className: "block max-w-full", loading: "lazy" }),
101
- part.filename ? /* @__PURE__ */ jsx("figcaption", { className: "border-border border-t bg-muted/30 px-3 py-1.5 font-mono text-label-caps text-muted-foreground uppercase tracking-wider", children: part.filename }) : null
102
- ]
103
- }
104
- );
105
- }
106
- return /* @__PURE__ */ jsxs(
107
- "div",
108
- {
109
- className: cn(
110
- "my-2 inline-flex items-center gap-2 rounded-md border border-border bg-card px-3 py-2",
111
- "text-body-sm"
112
- ),
113
- "data-theo-file": "generic",
114
- children: [
115
- /* @__PURE__ */ jsx(FileIcon, { className: "size-4 text-muted-foreground", "aria-hidden": "true" }),
116
- safeUrl ? /* @__PURE__ */ jsx("a", { href: safeUrl, className: "text-primary hover:text-primary-deep hover:underline", children: label }) : /* @__PURE__ */ jsx("span", { children: label }),
117
- /* @__PURE__ */ jsx("span", { className: "font-mono text-label-caps text-muted-foreground uppercase tracking-wider", children: part.mediaType })
118
- ]
119
- }
120
- );
121
- }
122
- var DEFAULT_THEMES = { light: "github-light", dark: "github-dark" };
123
- var cachedHighlighter = null;
124
- var highlighterFailed = false;
125
- async function getHighlighter(themes) {
126
- if (cachedHighlighter) return cachedHighlighter;
127
- if (highlighterFailed) return null;
128
- try {
129
- const shiki = await import('shiki');
130
- cachedHighlighter = await shiki.createHighlighter({
131
- themes: [themes.light, themes.dark],
132
- langs: [
133
- "ts",
134
- "tsx",
135
- "js",
136
- "jsx",
137
- "python",
138
- "go",
139
- "rust",
140
- "java",
141
- "json",
142
- "yaml",
143
- "bash",
144
- "shell",
145
- "html",
146
- "css",
147
- "sql",
148
- "markdown"
149
- ]
150
- });
151
- return cachedHighlighter;
152
- } catch {
153
- highlighterFailed = true;
154
- return null;
155
- }
156
- }
157
- function CodeBlock({ code, language, themes, className }) {
158
- const [html, setHtml] = useState(null);
159
- const [copied, setCopied] = useState(false);
160
- const effectiveThemes = themes ?? DEFAULT_THEMES;
161
- useEffect(() => {
162
- let cancelled = false;
163
- if (!language) return;
164
- getHighlighter(effectiveThemes).then((hl) => {
165
- if (cancelled || !hl) return;
166
- try {
167
- const out = hl.codeToHtml(code, {
168
- lang: language,
169
- themes: { light: effectiveThemes.light, dark: effectiveThemes.dark },
170
- defaultColor: "light"
171
- });
172
- setHtml(out);
173
- } catch {
174
- }
175
- }).catch(() => {
176
- });
177
- return () => {
178
- cancelled = true;
179
- };
180
- }, [code, language, effectiveThemes.light, effectiveThemes.dark, effectiveThemes]);
181
- const handleCopy = async () => {
182
- try {
183
- await navigator.clipboard.writeText(code);
184
- setCopied(true);
185
- setTimeout(() => setCopied(false), 2e3);
186
- } catch {
187
- }
188
- };
189
- return /* @__PURE__ */ jsxs(
190
- "div",
191
- {
192
- className: cn(
193
- "group relative my-4 overflow-hidden rounded-lg border border-border bg-muted/30",
194
- className
195
- ),
196
- "data-theo-code-block": "",
197
- children: [
198
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between border-border border-b bg-muted/50 px-3 py-1.5", children: [
199
- /* @__PURE__ */ jsx("span", { className: "font-mono text-label-caps text-muted-foreground uppercase tracking-wider", children: language || "text" }),
200
- /* @__PURE__ */ jsx(
201
- "button",
202
- {
203
- type: "button",
204
- onClick: handleCopy,
205
- className: cn(
206
- "inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-label",
207
- "text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground",
208
- "focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring"
209
- ),
210
- "aria-label": copied ? "Copied" : "Copy code",
211
- children: copied ? /* @__PURE__ */ jsxs(Fragment, { children: [
212
- /* @__PURE__ */ jsx(CheckIcon, { className: "size-3.5", "aria-hidden": "true" }),
213
- /* @__PURE__ */ jsx("span", { children: "Copied" })
214
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
215
- /* @__PURE__ */ jsx(CopyIcon, { className: "size-3.5", "aria-hidden": "true" }),
216
- /* @__PURE__ */ jsx("span", { children: "Copy" })
217
- ] })
218
- }
219
- )
220
- ] }),
221
- html ? /* @__PURE__ */ jsx(
222
- "div",
223
- {
224
- className: "[&_pre]:!bg-transparent [&_pre]:!m-0 [&_pre]:!p-0 overflow-x-auto p-3 text-code-sm",
225
- dangerouslySetInnerHTML: { __html: html }
226
- }
227
- ) : /* @__PURE__ */ jsx("pre", { className: "overflow-x-auto p-3 text-code-sm", children: /* @__PURE__ */ jsx("code", { className: language ? `language-${language}` : void 0, children: code }) })
228
- ]
229
- }
230
- );
231
- }
232
- function InlineCode({ className, children, ...props }) {
233
- return /* @__PURE__ */ jsx(
234
- "code",
235
- {
236
- className: cn(
237
- "rounded bg-muted px-1.5 py-0.5 font-mono text-code-sm text-foreground",
238
- className
239
- ),
240
- ...props,
241
- children
242
- }
243
- );
244
- }
245
-
246
- // src/lib/markdown/streaming-preprocess.ts
247
- function preprocessStreaming(markdown, isStreaming = true) {
248
- if (!isStreaming) return markdown;
249
- let buf = markdown;
250
- const fenceCount = countTripleBackticks(buf);
251
- if (fenceCount % 2 === 1) {
252
- buf = `${buf.endsWith("\n") ? buf : `${buf}
253
- `}\`\`\``;
254
- return buf;
255
- }
256
- const blockMathCount = countOccurrences(buf, "$$");
257
- if (blockMathCount % 2 === 1) {
258
- buf = `${buf}$$`;
259
- return buf;
260
- }
261
- const inlineBackticks = countSingleBackticks(buf);
262
- if (inlineBackticks % 2 === 1) {
263
- buf = `${buf}\``;
264
- }
265
- const inlineDollars = countSingleDollars(buf);
266
- if (inlineDollars % 2 === 1) {
267
- buf = `${buf}$`;
268
- }
269
- for (const marker of ["**", "__", "*", "_"]) {
270
- if (countMarker(buf, marker) % 2 === 1) {
271
- buf = `${buf}${marker}`;
272
- }
273
- }
274
- buf = closeUnclosedLink(buf);
275
- return buf;
276
- }
277
- function countTripleBackticks(s) {
278
- let count = 0;
279
- let i = 0;
280
- while (i < s.length) {
281
- if (s[i] === "`" && s[i + 1] === "`" && s[i + 2] === "`") {
282
- count++;
283
- i += 3;
284
- } else {
285
- i++;
286
- }
287
- }
288
- return count;
289
- }
290
- function countSingleBackticks(s) {
291
- let count = 0;
292
- let i = 0;
293
- while (i < s.length) {
294
- if (s[i] === "`") {
295
- if (s[i + 1] === "`" && s[i + 2] === "`") {
296
- i += 3;
297
- continue;
298
- }
299
- count++;
300
- }
301
- i++;
302
- }
303
- return count;
304
- }
305
- function countOccurrences(s, needle) {
306
- if (needle.length === 0) return 0;
307
- let count = 0;
308
- let i = s.indexOf(needle);
309
- while (i !== -1) {
310
- count++;
311
- i = s.indexOf(needle, i + needle.length);
312
- }
313
- return count;
314
- }
315
- function countSingleDollars(s) {
316
- let count = 0;
317
- let i = 0;
318
- while (i < s.length) {
319
- if (s[i] === "$") {
320
- if (s[i + 1] === "$") {
321
- i += 2;
322
- continue;
323
- }
324
- if (i > 0 && s[i - 1] === "\\") {
325
- i++;
326
- continue;
327
- }
328
- count++;
329
- }
330
- i++;
331
- }
332
- return count;
333
- }
334
- function countMarker(s, marker) {
335
- if (marker.length === 0) return 0;
336
- if (marker.length === 1) {
337
- let count2 = 0;
338
- let i2 = 0;
339
- while (i2 < s.length) {
340
- if (s[i2] === marker) {
341
- if (s[i2 + 1] === marker) {
342
- i2 += 2;
343
- continue;
344
- }
345
- if (i2 > 0 && s[i2 - 1] === "\\") {
346
- i2++;
347
- continue;
348
- }
349
- count2++;
350
- }
351
- i2++;
352
- }
353
- return count2;
354
- }
355
- let count = 0;
356
- let i = 0;
357
- while (i <= s.length - marker.length) {
358
- if (s.substring(i, i + marker.length) === marker) {
359
- count++;
360
- i += marker.length;
361
- } else {
362
- i++;
363
- }
364
- }
365
- return count;
366
- }
367
- function closeUnclosedLink(s) {
368
- const lastOpenParen = s.lastIndexOf("(");
369
- const lastCloseParen = s.lastIndexOf(")");
370
- if (lastOpenParen === -1 || lastOpenParen <= lastCloseParen) return s;
371
- if (s[lastOpenParen - 1] !== "]") return s;
372
- const closingBracket = lastOpenParen - 1;
373
- const openingBracket = s.lastIndexOf("[", closingBracket - 1);
374
- if (openingBracket === -1) return s;
375
- return `${s})`;
376
- }
377
-
378
- // src/lib/markdown/parser.ts
379
- async function parseBody(body) {
380
- const [{ fromMarkdown }, { gfmFromMarkdown }, { gfm }] = await Promise.all([
381
- import('mdast-util-from-markdown'),
382
- import('mdast-util-gfm'),
383
- import('micromark-extension-gfm')
384
- ]);
385
- return fromMarkdown(body, {
386
- extensions: [gfm()],
387
- mdastExtensions: [gfmFromMarkdown()]
388
- });
389
- }
390
- async function mdastToHast(tree) {
391
- const { toHast } = await import('mdast-util-to-hast');
392
- const hast = toHast(tree, { allowDangerousHtml: false });
393
- if (!hast || hast.type !== "root") {
394
- return { type: "root", children: hast ? [hast] : [] };
395
- }
396
- return hast;
397
- }
398
- async function sanitizeHast(tree) {
399
- const { sanitize, defaultSchema } = await import('hast-util-sanitize');
400
- const schema = {
401
- ...defaultSchema,
402
- attributes: {
403
- ...defaultSchema.attributes ?? {},
404
- code: [...defaultSchema.attributes?.code ?? [], ["className", /^language-./]],
405
- pre: [...defaultSchema.attributes?.pre ?? [], ["className", /./]],
406
- span: [...defaultSchema.attributes?.span ?? [], ["className", /./], ["style"]]
407
- }
408
- };
409
- const safe = sanitize(tree, schema);
410
- return safe.type === "root" ? safe : { type: "root", children: [safe] };
411
- }
412
- async function hastToReact(tree, components) {
413
- const { Fragment: Fragment4, jsx: jsx14, jsxs: jsxs10 } = await import('react/jsx-runtime');
414
- const { toJsxRuntime } = await import('hast-util-to-jsx-runtime');
415
- return toJsxRuntime(tree, {
416
- Fragment: Fragment4,
417
- jsx: jsx14,
418
- jsxs: jsxs10,
419
- components
420
- });
421
- }
422
- async function parseMarkdownToReact(markdown, opts = {}) {
423
- const preprocessed = preprocessStreaming(markdown, opts.isStreaming ?? false);
424
- const mdast = await parseBody(preprocessed);
425
- const hast = await mdastToHast(mdast);
426
- const safe = await sanitizeHast(hast);
427
- return hastToReact(safe, opts.components);
428
- }
429
- async function parseMarkdownToReactSafe(markdown, opts = {}) {
430
- try {
431
- return await parseMarkdownToReact(markdown, opts);
432
- } catch {
433
- return createElement("span", { className: "whitespace-pre-wrap" }, markdown);
434
- }
435
- }
436
- function isFenced(props) {
437
- const cls = props.className;
438
- if (typeof cls === "string") return cls.startsWith("language-");
439
- if (Array.isArray(cls))
440
- return cls.some((c) => typeof c === "string" && c.startsWith("language-"));
441
- return false;
442
- }
443
- function extractLanguage(props) {
444
- const cls = props.className;
445
- const list = typeof cls === "string" ? [cls] : Array.isArray(cls) ? cls : [];
446
- for (const c of list) {
447
- if (typeof c === "string" && c.startsWith("language-")) {
448
- return c.slice("language-".length);
449
- }
450
- }
451
- return void 0;
452
- }
453
- function extractText(children) {
454
- if (typeof children === "string") return children;
455
- if (Array.isArray(children)) return children.map(extractText).join("");
456
- if (children && typeof children === "object" && "props" in children && children.props) {
457
- return extractText(children.props.children);
458
- }
459
- return "";
460
- }
461
- var MARKDOWN_COMPONENTS = {
462
- code: (props) => {
463
- if (isFenced(props)) {
464
- const language = extractLanguage(props);
465
- const code = extractText(props.children);
466
- return /* @__PURE__ */ jsx(CodeBlock, { code, language });
467
- }
468
- return /* @__PURE__ */ jsx(InlineCode, { ...props, children: props.children });
469
- },
470
- // Strip the default `<pre>` since `<CodeBlock>` ships its own wrapper.
471
- // Inline `<pre>` still works for raw whitespace-preserving text.
472
- pre: ({ children }) => {
473
- return /* @__PURE__ */ jsx(Fragment, { children });
474
- }
475
- };
476
- function ChatMessageResponseImpl({
477
- text,
478
- isStreaming = false,
479
- className
480
- }) {
481
- const [tree, setTree] = useState(null);
482
- useEffect(() => {
483
- let cancelled = false;
484
- parseMarkdownToReactSafe(text, {
485
- isStreaming,
486
- components: MARKDOWN_COMPONENTS
487
- }).then((next) => {
488
- if (!cancelled) setTree(next);
489
- });
490
- return () => {
491
- cancelled = true;
492
- };
493
- }, [text, isStreaming]);
494
- return /* @__PURE__ */ jsx(
495
- "div",
496
- {
497
- className: cn(
498
- "prose-theo max-w-none text-body-md text-foreground leading-relaxed",
499
- // First/last child margin reset — fork from vercel/ai-elements
500
- "[&>*:first-child]:mt-0 [&>*:last-child]:mb-0",
501
- // Heading sizes inside chat use our typescale, not browser defaults
502
- "[&_h1]:mt-4 [&_h1]:mb-2 [&_h1]:font-semibold [&_h1]:text-title-lg",
503
- "[&_h2]:mt-3 [&_h2]:mb-2 [&_h2]:font-semibold [&_h2]:text-title-md",
504
- "[&_h3]:mt-3 [&_h3]:mb-1.5 [&_h3]:font-semibold [&_h3]:text-body-lg",
505
- "[&_p]:my-2",
506
- "[&_ul]:my-2 [&_ul]:list-disc [&_ul]:pl-5",
507
- "[&_ol]:my-2 [&_ol]:list-decimal [&_ol]:pl-5",
508
- "[&_li]:my-0.5",
509
- "[&_blockquote]:my-2 [&_blockquote]:border-primary/40 [&_blockquote]:border-l-2 [&_blockquote]:pl-3 [&_blockquote]:text-muted-foreground",
510
- "[&_a:hover]:text-primary-deep [&_a]:text-primary [&_a]:underline",
511
- "[&_table]:my-3 [&_table]:w-full [&_table]:border-collapse",
512
- "[&_th]:border [&_th]:border-border [&_th]:bg-muted/40 [&_th]:px-3 [&_th]:py-1.5 [&_th]:text-left",
513
- "[&_td]:border [&_td]:border-border [&_td]:px-3 [&_td]:py-1.5",
514
- "[&_hr]:my-4 [&_hr]:border-border",
515
- className
516
- ),
517
- "data-theo-chat-response": "",
518
- children: tree
519
- }
520
- );
521
- }
522
- var ChatMessageResponse = memo(ChatMessageResponseImpl, (prev, next) => {
523
- return prev.text === next.text && prev.isStreaming === next.isStreaming;
524
- });
525
- ChatMessageResponse.displayName = "ChatMessageResponse";
526
- function ReasoningPart({ part, defaultOpen }) {
527
- const isStreaming = part.state === "streaming";
528
- const open = defaultOpen ?? isStreaming;
529
- return /* @__PURE__ */ jsxs(
530
- "details",
531
- {
532
- className: cn(
533
- "my-2 rounded-md border border-border bg-muted/20 px-3 py-2",
534
- "[&[open]]:bg-muted/40"
535
- ),
536
- open,
537
- "data-theo-reasoning": "",
538
- children: [
539
- /* @__PURE__ */ jsxs(
540
- "summary",
541
- {
542
- className: cn(
543
- "cursor-pointer list-none font-mono text-label-caps text-muted-foreground uppercase tracking-wider",
544
- "flex items-center gap-1.5 marker:hidden",
545
- "transition-colors hover:text-foreground"
546
- ),
547
- children: [
548
- /* @__PURE__ */ jsx(BrainCircuitIcon, { className: "size-3.5", "aria-hidden": "true" }),
549
- /* @__PURE__ */ jsx("span", { children: "Reasoning" }),
550
- isStreaming ? /* @__PURE__ */ jsx("span", { className: "text-primary/80", children: "\u2026" }) : null
551
- ]
552
- }
553
- ),
554
- /* @__PURE__ */ jsx("div", { className: "mt-2 border-border border-t pt-2", children: /* @__PURE__ */ jsx(ChatMessageResponse, { text: part.text, isStreaming }) })
555
- ]
556
- }
557
- );
558
- }
559
- function SourceUrlPart({ part }) {
560
- const safe = safeHref(part.url);
561
- const label = part.title || part.url;
562
- return /* @__PURE__ */ jsxs(
563
- "span",
564
- {
565
- className: cn(
566
- "my-1 inline-flex max-w-full items-center gap-1.5 rounded-md border border-border bg-card px-2 py-1",
567
- "align-middle font-mono text-label"
568
- ),
569
- "data-theo-source": "url",
570
- children: [
571
- /* @__PURE__ */ jsx(ExternalLinkIcon, { className: "size-3 text-muted-foreground", "aria-hidden": "true" }),
572
- safe ? /* @__PURE__ */ jsx(
573
- "a",
574
- {
575
- href: safe,
576
- className: "truncate text-primary hover:text-primary-deep hover:underline",
577
- rel: "noopener noreferrer",
578
- target: "_blank",
579
- children: label
580
- }
581
- ) : /* @__PURE__ */ jsx("span", { className: "truncate text-muted-foreground", children: label })
582
- ]
583
- }
584
- );
585
- }
586
- function SourceDocumentPart({ part }) {
587
- return /* @__PURE__ */ jsxs(
588
- "span",
589
- {
590
- className: cn(
591
- "my-1 inline-flex max-w-full items-center gap-1.5 rounded-md border border-border bg-card px-2 py-1",
592
- "align-middle font-mono text-label"
593
- ),
594
- "data-theo-source": "document",
595
- children: [
596
- /* @__PURE__ */ jsx(FileTextIcon, { className: "size-3 text-muted-foreground", "aria-hidden": "true" }),
597
- /* @__PURE__ */ jsx("span", { className: "truncate text-foreground", children: part.title }),
598
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "\xB7" }),
599
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: part.mediaType })
600
- ]
601
- }
602
- );
603
- }
604
- function TextPart({ part }) {
605
- return /* @__PURE__ */ jsx(ChatMessageResponse, { text: part.text, isStreaming: part.state === "streaming" });
606
- }
607
- function deriveToolName(part) {
608
- if (part.toolName) return part.toolName;
609
- if (part.type === "dynamic-tool") return "dynamic-tool";
610
- return part.type.slice("tool-".length);
611
- }
612
- function stateBadge(state) {
613
- switch (state) {
614
- case "input-streaming":
615
- return {
616
- icon: /* @__PURE__ */ jsx(LoaderIcon, { className: "size-3.5 animate-spin", "aria-hidden": "true" }),
617
- label: "Streaming input",
618
- tone: "text-muted-foreground"
619
- };
620
- case "input-available":
621
- return {
622
- icon: /* @__PURE__ */ jsx(WrenchIcon, { className: "size-3.5", "aria-hidden": "true" }),
623
- label: "Ready to call",
624
- tone: "text-primary"
625
- };
626
- case "approval-requested":
627
- return {
628
- icon: /* @__PURE__ */ jsx(ShieldIcon, { className: "size-3.5", "aria-hidden": "true" }),
629
- label: "Awaiting approval",
630
- tone: "text-warning"
631
- };
632
- case "approval-responded":
633
- return {
634
- icon: /* @__PURE__ */ jsx(ShieldIcon, { className: "size-3.5", "aria-hidden": "true" }),
635
- label: "Approval responded",
636
- tone: "text-primary"
637
- };
638
- case "output-available":
639
- return {
640
- icon: /* @__PURE__ */ jsx(CheckCircleIcon, { className: "size-3.5", "aria-hidden": "true" }),
641
- label: "Completed",
642
- tone: "text-success"
643
- };
644
- case "output-error":
645
- return {
646
- icon: /* @__PURE__ */ jsx(AlertCircleIcon, { className: "size-3.5", "aria-hidden": "true" }),
647
- label: "Error",
648
- tone: "text-destructive"
649
- };
650
- case "output-denied":
651
- return {
652
- icon: /* @__PURE__ */ jsx(ShieldIcon, { className: "size-3.5", "aria-hidden": "true" }),
653
- label: "Denied",
654
- tone: "text-destructive"
655
- };
656
- default:
657
- return {
658
- icon: /* @__PURE__ */ jsx(WrenchIcon, { className: "size-3.5", "aria-hidden": "true" }),
659
- label: "Unknown",
660
- tone: "text-muted-foreground"
661
- };
662
- }
663
- }
664
- function safeStringify2(value) {
665
- if (value === void 0) return "";
666
- if (typeof value === "string") return value;
667
- try {
668
- return JSON.stringify(value, null, 2);
669
- } catch {
670
- return String(value);
671
- }
672
- }
673
- function ToolCallPart({ part }) {
674
- const toolName = deriveToolName(part);
675
- const badge = stateBadge(part.state);
676
- const inputStr = safeStringify2(part.input);
677
- const outputStr = part.state === "output-available" ? safeStringify2(part.output) : part.errorText ?? "";
678
- return /* @__PURE__ */ jsxs(
679
- "div",
680
- {
681
- className: cn("my-3 overflow-hidden rounded-lg border border-border bg-card", "shadow-sm"),
682
- "data-theo-tool-call": part.state,
683
- children: [
684
- /* @__PURE__ */ jsxs("header", { className: "flex items-center justify-between gap-3 border-border border-b bg-muted/30 px-3 py-1.5", children: [
685
- /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
686
- /* @__PURE__ */ jsx(WrenchIcon, { className: "size-3.5 shrink-0 text-muted-foreground", "aria-hidden": "true" }),
687
- /* @__PURE__ */ jsx("span", { className: "truncate font-mono text-foreground text-label", children: toolName })
688
- ] }),
689
- /* @__PURE__ */ jsxs(
690
- "span",
691
- {
692
- className: cn(
693
- "inline-flex items-center gap-1 text-label-caps uppercase tracking-wider",
694
- badge.tone
695
- ),
696
- children: [
697
- badge.icon,
698
- /* @__PURE__ */ jsx("span", { children: badge.label })
699
- ]
700
- }
701
- )
702
- ] }),
703
- inputStr ? /* @__PURE__ */ jsxs("details", { className: "border-border border-b", open: part.state === "input-streaming", children: [
704
- /* @__PURE__ */ jsx("summary", { className: "cursor-pointer px-3 py-1.5 font-mono text-label-caps text-muted-foreground uppercase tracking-wider hover:text-foreground", children: "Input" }),
705
- /* @__PURE__ */ jsx("pre", { className: "overflow-x-auto bg-muted/20 px-3 py-2 text-code-sm", children: /* @__PURE__ */ jsx("code", { children: inputStr }) })
706
- ] }) : null,
707
- outputStr ? /* @__PURE__ */ jsxs("details", { open: part.state === "output-error" || part.state === "output-available", children: [
708
- /* @__PURE__ */ jsx(
709
- "summary",
710
- {
711
- className: cn(
712
- "cursor-pointer px-3 py-1.5 font-mono text-label-caps uppercase tracking-wider hover:text-foreground",
713
- part.state === "output-error" ? "text-destructive" : "text-muted-foreground"
714
- ),
715
- children: part.state === "output-error" ? "Error" : "Output"
716
- }
717
- ),
718
- /* @__PURE__ */ jsx(
719
- "pre",
720
- {
721
- className: cn(
722
- "overflow-x-auto px-3 py-2 text-code-sm",
723
- part.state === "output-error" ? "bg-destructive/5" : "bg-muted/20"
724
- ),
725
- children: /* @__PURE__ */ jsx("code", { children: outputStr })
726
- }
727
- )
728
- ] }) : null
729
- ]
730
- }
731
- );
732
- }
733
- var ChatMessageRoot = forwardRef(
734
- ({ className, from, children, ...props }, ref) => /* @__PURE__ */ jsx(
735
- "div",
736
- {
737
- ref,
738
- className: cn(
739
- "group flex w-full max-w-[95%] flex-col gap-2",
740
- from === "user" ? "is-user ml-auto justify-end" : from === "assistant" ? "is-assistant" : "is-system",
741
- className
742
- ),
743
- "data-theo-chat-message": from,
744
- ...props,
745
- children
746
- }
747
- )
748
- );
749
- ChatMessageRoot.displayName = "ChatMessageRoot";
750
- var ChatMessageContent = forwardRef(
751
- ({ className, variant, children, ...props }, ref) => /* @__PURE__ */ jsx(
752
- "div",
753
- {
754
- ref,
755
- className: cn(
756
- "flex w-fit min-w-0 max-w-full flex-col gap-2 overflow-hidden text-body-md",
757
- // User bubble — secondary surface, right-aligned (within the `is-user` group)
758
- "group-[.is-user]:ml-auto",
759
- variant !== "flat" && "group-[.is-user]:rounded-2xl group-[.is-user]:rounded-tr-md group-[.is-user]:border group-[.is-user]:border-border/40 group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3",
760
- // Assistant card — primary accent border-left
761
- variant === "contained" && "group-[.is-assistant]:rounded-2xl group-[.is-assistant]:rounded-tl-md group-[.is-assistant]:border group-[.is-assistant]:border-border/40 group-[.is-assistant]:border-l-2 group-[.is-assistant]:border-l-primary group-[.is-assistant]:bg-card group-[.is-assistant]:px-5 group-[.is-assistant]:py-4 group-[.is-assistant]:shadow-sm",
762
- // System callout — accent-deep border
763
- "group-[.is-system]:rounded-lg group-[.is-system]:border group-[.is-system]:border-accent-deep/40 group-[.is-system]:border-l-4 group-[.is-system]:bg-accent/10 group-[.is-system]:px-4 group-[.is-system]:py-2 group-[.is-system]:text-body-sm",
764
- "group-[.is-assistant]:text-foreground group-[.is-user]:text-secondary-foreground",
765
- className
766
- ),
767
- "data-theo-chat-content": "",
768
- ...props,
769
- children
770
- }
771
- )
772
- );
773
- ChatMessageContent.displayName = "ChatMessageContent";
774
- function renderPart(part, opts = {}) {
775
- const overrides = opts.partRenderers ?? {};
776
- if (isTextUIPart(part)) {
777
- return overrides.text?.(part) ?? /* @__PURE__ */ jsx(TextPart, { part });
778
- }
779
- if (isReasoningUIPart(part)) {
780
- return overrides.reasoning?.(part) ?? /* @__PURE__ */ jsx(ReasoningPart, { part });
781
- }
782
- if (isReasoningFileUIPart(part)) {
783
- return overrides["reasoning-file"]?.(part) ?? null;
784
- }
785
- if (isFileUIPart(part)) {
786
- return overrides.file?.(part) ?? /* @__PURE__ */ jsx(FilePart, { part });
787
- }
788
- if (isSourceUrlUIPart(part)) {
789
- return overrides["source-url"]?.(part) ?? /* @__PURE__ */ jsx(SourceUrlPart, { part });
790
- }
791
- if (isSourceDocumentUIPart(part)) {
792
- return overrides["source-document"]?.(part) ?? /* @__PURE__ */ jsx(SourceDocumentPart, { part });
793
- }
794
- if (isToolUIPart(part)) {
795
- return overrides.tool?.(part) ?? /* @__PURE__ */ jsx(ToolCallPart, { part });
796
- }
797
- if (isDataUIPart(part)) {
798
- return overrides.data?.(part) ?? /* @__PURE__ */ jsx(DataPart, { part, renderers: opts.dataRenderers });
799
- }
800
- if (isStepStartUIPart(part)) {
801
- return overrides["step-start"]?.() ?? /* @__PURE__ */ jsx("hr", { className: "my-3 border-border", "aria-label": "Step boundary" });
802
- }
803
- return null;
804
- }
805
- var ChatMessage = forwardRef(
806
- ({ message, avatar, actions, variant, partRenderers, dataRenderers, className, ...props }, ref) => {
807
- const inner = /* @__PURE__ */ jsxs(
808
- ChatMessageContent,
809
- {
810
- variant: variant ?? (message.role === "assistant" ? "contained" : void 0),
811
- children: [
812
- message.parts.map((part, idx) => /* @__PURE__ */ jsx("div", { children: renderPart(part, { dataRenderers, partRenderers }) }, `${part.type}-${idx}`)),
813
- actions
814
- ]
815
- }
816
- );
817
- if (message.role === "user") {
818
- return /* @__PURE__ */ jsxs(ChatMessageRoot, { ref, from: "user", className, ...props, children: [
819
- inner,
820
- avatar ? /* @__PURE__ */ jsx("div", { className: "shrink-0", children: avatar }) : null
821
- ] });
822
- }
823
- return /* @__PURE__ */ jsxs(ChatMessageRoot, { ref, from: message.role, className, ...props, children: [
824
- avatar ? /* @__PURE__ */ jsx("div", { className: "shrink-0", children: avatar }) : null,
825
- inner
826
- ] });
827
- }
828
- );
829
- ChatMessage.displayName = "ChatMessage";
830
- function ChatMessageActions({
831
- className,
832
- children,
833
- ...props
834
- }) {
835
- return /* @__PURE__ */ jsx("div", { className: cn("flex items-center gap-1", className), "data-theo-chat-actions": "", ...props, children });
836
- }
837
- function ChatMessageAction({
838
- tooltip,
839
- label,
840
- variant = "ghost",
841
- size = "icon",
842
- className,
843
- children,
844
- ...props
845
- }) {
846
- return /* @__PURE__ */ jsxs(
847
- Button,
848
- {
849
- type: "button",
850
- variant,
851
- size,
852
- title: tooltip,
853
- className: cn(className),
854
- ...props,
855
- children: [
856
- children,
857
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: label || tooltip })
858
- ]
859
- }
860
- );
861
- }
862
- function ChatMessageToolbar({
863
- className,
864
- children,
865
- ...props
866
- }) {
867
- return /* @__PURE__ */ jsx(
868
- "div",
869
- {
870
- className: cn("mt-3 flex w-full items-center justify-between gap-3", className),
871
- "data-theo-chat-toolbar": "",
872
- ...props,
873
- children
874
- }
875
- );
876
- }
877
- var MessageBranchContext = createContext(null);
878
- function useMessageBranch() {
879
- const ctx = useContext(MessageBranchContext);
880
- if (!ctx) {
881
- throw new Error("ChatMessageBranch* components must be wrapped in <ChatMessageBranch>.");
882
- }
883
- return ctx;
884
- }
885
- function ChatMessageBranch({
886
- defaultBranch = 0,
887
- onBranchChange,
888
- className,
889
- ...props
890
- }) {
891
- const [currentBranch, setCurrentBranch] = useState(defaultBranch);
892
- const [branches, setBranches] = useState([]);
893
- const handleChange = useCallback(
894
- (next) => {
895
- setCurrentBranch(next);
896
- onBranchChange?.(next);
897
- },
898
- [onBranchChange]
899
- );
900
- const goToPrevious = useCallback(() => {
901
- handleChange(currentBranch > 0 ? currentBranch - 1 : branches.length - 1);
902
- }, [currentBranch, branches.length, handleChange]);
903
- const goToNext = useCallback(() => {
904
- handleChange(currentBranch < branches.length - 1 ? currentBranch + 1 : 0);
905
- }, [currentBranch, branches.length, handleChange]);
906
- const value = useMemo(
907
- () => ({
908
- branches,
909
- currentBranch,
910
- goToNext,
911
- goToPrevious,
912
- setBranches,
913
- totalBranches: branches.length
914
- }),
915
- [branches, currentBranch, goToNext, goToPrevious]
916
- );
917
- return /* @__PURE__ */ jsx(MessageBranchContext.Provider, { value, children: /* @__PURE__ */ jsx("div", { className: cn("grid w-full gap-2", className), ...props }) });
918
- }
919
- function ChatMessageBranchContent({
920
- children,
921
- ...props
922
- }) {
923
- const { currentBranch, setBranches, branches } = useMessageBranch();
924
- const childrenArray = useMemo(
925
- () => Array.isArray(children) ? children : [children],
926
- [children]
927
- );
928
- useEffect(() => {
929
- if (branches.length !== childrenArray.length) {
930
- setBranches(childrenArray);
931
- }
932
- }, [childrenArray, branches, setBranches]);
933
- return /* @__PURE__ */ jsx(Fragment, { children: childrenArray.map((branch, idx) => /* @__PURE__ */ jsx(
934
- "div",
935
- {
936
- className: cn("grid gap-2 overflow-hidden", idx === currentBranch ? "block" : "hidden"),
937
- ...props,
938
- children: branch
939
- },
940
- // Prefer a stable element key; fall back to index
941
- branch?.key ?? `branch-${idx}`
942
- )) });
943
- }
944
- function ChatMessageBranchSelector({
945
- className,
946
- ...props
947
- }) {
948
- const { totalBranches } = useMessageBranch();
949
- if (totalBranches <= 1) return null;
950
- return /* @__PURE__ */ jsx(
951
- "div",
952
- {
953
- className: cn("inline-flex items-center gap-0.5 rounded-md border border-border", className),
954
- role: "group",
955
- "aria-label": "Branch selector",
956
- ...props
957
- }
958
- );
959
- }
960
- function ChatMessageBranchPrevious({
961
- children,
962
- ...props
963
- }) {
964
- const { goToPrevious, totalBranches } = useMessageBranch();
965
- return /* @__PURE__ */ jsx(
966
- Button,
967
- {
968
- type: "button",
969
- variant: "ghost",
970
- size: "icon",
971
- "aria-label": "Previous branch",
972
- disabled: totalBranches <= 1,
973
- onClick: goToPrevious,
974
- ...props,
975
- children: children ?? /* @__PURE__ */ jsx(ChevronLeftIcon, { className: "size-3.5", "aria-hidden": "true" })
976
- }
977
- );
978
- }
979
- function ChatMessageBranchNext({
980
- children,
981
- ...props
982
- }) {
983
- const { goToNext, totalBranches } = useMessageBranch();
984
- return /* @__PURE__ */ jsx(
985
- Button,
986
- {
987
- type: "button",
988
- variant: "ghost",
989
- size: "icon",
990
- "aria-label": "Next branch",
991
- disabled: totalBranches <= 1,
992
- onClick: goToNext,
993
- ...props,
994
- children: children ?? /* @__PURE__ */ jsx(ChevronRightIcon, { className: "size-3.5", "aria-hidden": "true" })
995
- }
996
- );
997
- }
998
- function ChatMessageBranchPage({
999
- className,
1000
- ...props
1001
- }) {
1002
- const { currentBranch, totalBranches } = useMessageBranch();
1003
- return /* @__PURE__ */ jsxs(
1004
- "span",
1005
- {
1006
- className: cn(
1007
- "inline-flex items-center px-2 font-mono text-label-caps text-muted-foreground",
1008
- className
1009
- ),
1010
- ...props,
1011
- children: [
1012
- currentBranch + 1,
1013
- " of ",
1014
- totalBranches
1015
- ]
1016
- }
1017
- );
1018
- }
1019
-
1020
- export { ChatMessage, ChatMessageAction, ChatMessageActions, ChatMessageBranch, ChatMessageBranchContent, ChatMessageBranchNext, ChatMessageBranchPage, ChatMessageBranchPrevious, ChatMessageBranchSelector, ChatMessageContent, ChatMessageResponse, ChatMessageRoot, ChatMessageToolbar, DataPart, FilePart, ReasoningPart, SourceDocumentPart, SourceUrlPart, TextPart, ToolCallPart, isCustomContentUIPart, isDataUIPart, isFileUIPart, isReasoningFileUIPart, isReasoningUIPart, isSourceDocumentUIPart, isSourceUrlUIPart, isStepStartUIPart, isTextUIPart, isToolUIPart, renderPart };
1021
- //# sourceMappingURL=chunk-VI5M7KJ2.js.map
1022
- //# sourceMappingURL=chunk-VI5M7KJ2.js.map