@theokit/ui 0.13.0

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 (715) hide show
  1. package/CHANGELOG.md +1325 -0
  2. package/DESIGN.md +456 -0
  3. package/LICENSE +201 -0
  4. package/NOTICE +38 -0
  5. package/README.md +467 -0
  6. package/dist/chunk-27ENTTY7.js +146 -0
  7. package/dist/chunk-27ENTTY7.js.map +1 -0
  8. package/dist/chunk-2H6TQELG.js +33 -0
  9. package/dist/chunk-2H6TQELG.js.map +1 -0
  10. package/dist/chunk-2L6MRJD4.js +120 -0
  11. package/dist/chunk-2L6MRJD4.js.map +1 -0
  12. package/dist/chunk-2Y5V2PAL.js +80 -0
  13. package/dist/chunk-2Y5V2PAL.js.map +1 -0
  14. package/dist/chunk-34NAFDVL.js +46 -0
  15. package/dist/chunk-34NAFDVL.js.map +1 -0
  16. package/dist/chunk-36KJGXEK.js +112 -0
  17. package/dist/chunk-36KJGXEK.js.map +1 -0
  18. package/dist/chunk-3BMYYNN6.js +124 -0
  19. package/dist/chunk-3BMYYNN6.js.map +1 -0
  20. package/dist/chunk-3OHV7EEI.js +34 -0
  21. package/dist/chunk-3OHV7EEI.js.map +1 -0
  22. package/dist/chunk-3QKTS6F5.js +88 -0
  23. package/dist/chunk-3QKTS6F5.js.map +1 -0
  24. package/dist/chunk-3TBXLYNM.js +42 -0
  25. package/dist/chunk-3TBXLYNM.js.map +1 -0
  26. package/dist/chunk-4AM2HSXU.js +67 -0
  27. package/dist/chunk-4AM2HSXU.js.map +1 -0
  28. package/dist/chunk-4BCGKM65.js +44 -0
  29. package/dist/chunk-4BCGKM65.js.map +1 -0
  30. package/dist/chunk-4D3JILQX.js +145 -0
  31. package/dist/chunk-4D3JILQX.js.map +1 -0
  32. package/dist/chunk-4EJU2GBG.js +48 -0
  33. package/dist/chunk-4EJU2GBG.js.map +1 -0
  34. package/dist/chunk-4WKO3G5C.js +110 -0
  35. package/dist/chunk-4WKO3G5C.js.map +1 -0
  36. package/dist/chunk-53XPKI7Q.js +97 -0
  37. package/dist/chunk-53XPKI7Q.js.map +1 -0
  38. package/dist/chunk-55TDVDPG.js +58 -0
  39. package/dist/chunk-55TDVDPG.js.map +1 -0
  40. package/dist/chunk-56BJLFW7.js +26 -0
  41. package/dist/chunk-56BJLFW7.js.map +1 -0
  42. package/dist/chunk-5HOQLE6Y.js +35 -0
  43. package/dist/chunk-5HOQLE6Y.js.map +1 -0
  44. package/dist/chunk-5TY3NYF5.js +144 -0
  45. package/dist/chunk-5TY3NYF5.js.map +1 -0
  46. package/dist/chunk-5VOSCJKQ.js +92 -0
  47. package/dist/chunk-5VOSCJKQ.js.map +1 -0
  48. package/dist/chunk-65NVO6TK.js +171 -0
  49. package/dist/chunk-65NVO6TK.js.map +1 -0
  50. package/dist/chunk-6A5TPCKP.js +64 -0
  51. package/dist/chunk-6A5TPCKP.js.map +1 -0
  52. package/dist/chunk-6CO4LEXZ.js +41 -0
  53. package/dist/chunk-6CO4LEXZ.js.map +1 -0
  54. package/dist/chunk-6FVUPNPG.js +56 -0
  55. package/dist/chunk-6FVUPNPG.js.map +1 -0
  56. package/dist/chunk-76YWTIWK.js +106 -0
  57. package/dist/chunk-76YWTIWK.js.map +1 -0
  58. package/dist/chunk-7EI7424P.js +78 -0
  59. package/dist/chunk-7EI7424P.js.map +1 -0
  60. package/dist/chunk-AHTVYOPQ.js +26 -0
  61. package/dist/chunk-AHTVYOPQ.js.map +1 -0
  62. package/dist/chunk-AJTJNHKK.js +85 -0
  63. package/dist/chunk-AJTJNHKK.js.map +1 -0
  64. package/dist/chunk-AMT3CPMC.js +155 -0
  65. package/dist/chunk-AMT3CPMC.js.map +1 -0
  66. package/dist/chunk-AX5EH73R.js +59 -0
  67. package/dist/chunk-AX5EH73R.js.map +1 -0
  68. package/dist/chunk-B3VAJSZ2.js +35 -0
  69. package/dist/chunk-B3VAJSZ2.js.map +1 -0
  70. package/dist/chunk-B4CQMQ64.js +25 -0
  71. package/dist/chunk-B4CQMQ64.js.map +1 -0
  72. package/dist/chunk-BMRZXT5T.js +115 -0
  73. package/dist/chunk-BMRZXT5T.js.map +1 -0
  74. package/dist/chunk-BYZ6OFH4.js +73 -0
  75. package/dist/chunk-BYZ6OFH4.js.map +1 -0
  76. package/dist/chunk-C55VUQ7N.js +156 -0
  77. package/dist/chunk-C55VUQ7N.js.map +1 -0
  78. package/dist/chunk-D4GEAV4C.js +91 -0
  79. package/dist/chunk-D4GEAV4C.js.map +1 -0
  80. package/dist/chunk-DC43CHAM.js +152 -0
  81. package/dist/chunk-DC43CHAM.js.map +1 -0
  82. package/dist/chunk-DKCRLN35.js +92 -0
  83. package/dist/chunk-DKCRLN35.js.map +1 -0
  84. package/dist/chunk-DN5BUDBI.js +86 -0
  85. package/dist/chunk-DN5BUDBI.js.map +1 -0
  86. package/dist/chunk-DOLKDYMS.js +88 -0
  87. package/dist/chunk-DOLKDYMS.js.map +1 -0
  88. package/dist/chunk-DW34WXCG.js +28 -0
  89. package/dist/chunk-DW34WXCG.js.map +1 -0
  90. package/dist/chunk-DZAAKHGZ.js +135 -0
  91. package/dist/chunk-DZAAKHGZ.js.map +1 -0
  92. package/dist/chunk-E4IRSSHO.js +116 -0
  93. package/dist/chunk-E4IRSSHO.js.map +1 -0
  94. package/dist/chunk-E67WQXBV.js +104 -0
  95. package/dist/chunk-E67WQXBV.js.map +1 -0
  96. package/dist/chunk-EG6IHP3H.js +128 -0
  97. package/dist/chunk-EG6IHP3H.js.map +1 -0
  98. package/dist/chunk-EO7LOXG2.js +82 -0
  99. package/dist/chunk-EO7LOXG2.js.map +1 -0
  100. package/dist/chunk-EWDN56AS.js +24 -0
  101. package/dist/chunk-EWDN56AS.js.map +1 -0
  102. package/dist/chunk-F5P5P2SC.js +141 -0
  103. package/dist/chunk-F5P5P2SC.js.map +1 -0
  104. package/dist/chunk-FAWPRZTM.js +79 -0
  105. package/dist/chunk-FAWPRZTM.js.map +1 -0
  106. package/dist/chunk-FGYJ2WPX.js +36 -0
  107. package/dist/chunk-FGYJ2WPX.js.map +1 -0
  108. package/dist/chunk-GBG3I5I5.js +46 -0
  109. package/dist/chunk-GBG3I5I5.js.map +1 -0
  110. package/dist/chunk-GDMCDW66.js +19 -0
  111. package/dist/chunk-GDMCDW66.js.map +1 -0
  112. package/dist/chunk-H6HSQCOW.js +80 -0
  113. package/dist/chunk-H6HSQCOW.js.map +1 -0
  114. package/dist/chunk-HDM4RCIF.js +111 -0
  115. package/dist/chunk-HDM4RCIF.js.map +1 -0
  116. package/dist/chunk-HNTOGGVD.js +77 -0
  117. package/dist/chunk-HNTOGGVD.js.map +1 -0
  118. package/dist/chunk-HQW2ABO4.js +28 -0
  119. package/dist/chunk-HQW2ABO4.js.map +1 -0
  120. package/dist/chunk-HRDRGZ2Y.js +76 -0
  121. package/dist/chunk-HRDRGZ2Y.js.map +1 -0
  122. package/dist/chunk-HUOVA7SF.js +83 -0
  123. package/dist/chunk-HUOVA7SF.js.map +1 -0
  124. package/dist/chunk-ITA3SNOR.js +133 -0
  125. package/dist/chunk-ITA3SNOR.js.map +1 -0
  126. package/dist/chunk-IYNUPG2G.js +61 -0
  127. package/dist/chunk-IYNUPG2G.js.map +1 -0
  128. package/dist/chunk-JJ65ZI4P.js +199 -0
  129. package/dist/chunk-JJ65ZI4P.js.map +1 -0
  130. package/dist/chunk-JRBGZ6NI.js +106 -0
  131. package/dist/chunk-JRBGZ6NI.js.map +1 -0
  132. package/dist/chunk-K45OO62F.js +108 -0
  133. package/dist/chunk-K45OO62F.js.map +1 -0
  134. package/dist/chunk-KDTKA667.js +67 -0
  135. package/dist/chunk-KDTKA667.js.map +1 -0
  136. package/dist/chunk-KI7KZBSN.js +142 -0
  137. package/dist/chunk-KI7KZBSN.js.map +1 -0
  138. package/dist/chunk-KOJ7XOPZ.js +87 -0
  139. package/dist/chunk-KOJ7XOPZ.js.map +1 -0
  140. package/dist/chunk-KQTHJ22B.js +82 -0
  141. package/dist/chunk-KQTHJ22B.js.map +1 -0
  142. package/dist/chunk-KRC43RZR.js +77 -0
  143. package/dist/chunk-KRC43RZR.js.map +1 -0
  144. package/dist/chunk-LJQOEGQ2.js +116 -0
  145. package/dist/chunk-LJQOEGQ2.js.map +1 -0
  146. package/dist/chunk-LKRNUSKZ.js +149 -0
  147. package/dist/chunk-LKRNUSKZ.js.map +1 -0
  148. package/dist/chunk-LLL7QQ52.js +76 -0
  149. package/dist/chunk-LLL7QQ52.js.map +1 -0
  150. package/dist/chunk-LQ4B5X4Y.js +56 -0
  151. package/dist/chunk-LQ4B5X4Y.js.map +1 -0
  152. package/dist/chunk-M3FSLEHQ.js +76 -0
  153. package/dist/chunk-M3FSLEHQ.js.map +1 -0
  154. package/dist/chunk-M5G3O6H6.js +57 -0
  155. package/dist/chunk-M5G3O6H6.js.map +1 -0
  156. package/dist/chunk-M6JIC5PU.js +81 -0
  157. package/dist/chunk-M6JIC5PU.js.map +1 -0
  158. package/dist/chunk-N2HJ3SLS.js +186 -0
  159. package/dist/chunk-N2HJ3SLS.js.map +1 -0
  160. package/dist/chunk-NGZWBFTP.js +45 -0
  161. package/dist/chunk-NGZWBFTP.js.map +1 -0
  162. package/dist/chunk-OAKCXT35.js +34 -0
  163. package/dist/chunk-OAKCXT35.js.map +1 -0
  164. package/dist/chunk-OSD3U3HT.js +54 -0
  165. package/dist/chunk-OSD3U3HT.js.map +1 -0
  166. package/dist/chunk-OUXESQ2R.js +42 -0
  167. package/dist/chunk-OUXESQ2R.js.map +1 -0
  168. package/dist/chunk-OY2LJHMJ.js +43 -0
  169. package/dist/chunk-OY2LJHMJ.js.map +1 -0
  170. package/dist/chunk-OYEZR4CN.js +221 -0
  171. package/dist/chunk-OYEZR4CN.js.map +1 -0
  172. package/dist/chunk-P57HUMAE.js +66 -0
  173. package/dist/chunk-P57HUMAE.js.map +1 -0
  174. package/dist/chunk-P6Y2PI6L.js +82 -0
  175. package/dist/chunk-P6Y2PI6L.js.map +1 -0
  176. package/dist/chunk-PA7TDXUQ.js +51 -0
  177. package/dist/chunk-PA7TDXUQ.js.map +1 -0
  178. package/dist/chunk-PPBGGNPV.js +112 -0
  179. package/dist/chunk-PPBGGNPV.js.map +1 -0
  180. package/dist/chunk-PRH4HKND.js +48 -0
  181. package/dist/chunk-PRH4HKND.js.map +1 -0
  182. package/dist/chunk-PSPAZJUQ.js +32 -0
  183. package/dist/chunk-PSPAZJUQ.js.map +1 -0
  184. package/dist/chunk-Q5G5CGZ2.js +170 -0
  185. package/dist/chunk-Q5G5CGZ2.js.map +1 -0
  186. package/dist/chunk-QDAF3LP7.js +89 -0
  187. package/dist/chunk-QDAF3LP7.js.map +1 -0
  188. package/dist/chunk-QGVIGNJ3.js +37 -0
  189. package/dist/chunk-QGVIGNJ3.js.map +1 -0
  190. package/dist/chunk-QNUITYSY.js +68 -0
  191. package/dist/chunk-QNUITYSY.js.map +1 -0
  192. package/dist/chunk-QSWVN3RT.js +116 -0
  193. package/dist/chunk-QSWVN3RT.js.map +1 -0
  194. package/dist/chunk-QTLQZ7OJ.js +110 -0
  195. package/dist/chunk-QTLQZ7OJ.js.map +1 -0
  196. package/dist/chunk-QYAMLIG2.js +84 -0
  197. package/dist/chunk-QYAMLIG2.js.map +1 -0
  198. package/dist/chunk-REILH4XF.js +128 -0
  199. package/dist/chunk-REILH4XF.js.map +1 -0
  200. package/dist/chunk-S6SSK6QX.js +80 -0
  201. package/dist/chunk-S6SSK6QX.js.map +1 -0
  202. package/dist/chunk-SA7ED3PN.js +68 -0
  203. package/dist/chunk-SA7ED3PN.js.map +1 -0
  204. package/dist/chunk-SIJOEM4N.js +55 -0
  205. package/dist/chunk-SIJOEM4N.js.map +1 -0
  206. package/dist/chunk-SLOKAAH2.js +70 -0
  207. package/dist/chunk-SLOKAAH2.js.map +1 -0
  208. package/dist/chunk-TR6NPSMX.js +85 -0
  209. package/dist/chunk-TR6NPSMX.js.map +1 -0
  210. package/dist/chunk-TSZ5DEAT.js +106 -0
  211. package/dist/chunk-TSZ5DEAT.js.map +1 -0
  212. package/dist/chunk-TUNVF45W.js +127 -0
  213. package/dist/chunk-TUNVF45W.js.map +1 -0
  214. package/dist/chunk-TXOBNSQ5.js +63 -0
  215. package/dist/chunk-TXOBNSQ5.js.map +1 -0
  216. package/dist/chunk-U44DRLMM.js +88 -0
  217. package/dist/chunk-U44DRLMM.js.map +1 -0
  218. package/dist/chunk-U4THNRV5.js +114 -0
  219. package/dist/chunk-U4THNRV5.js.map +1 -0
  220. package/dist/chunk-UAZOFC4W.js +72 -0
  221. package/dist/chunk-UAZOFC4W.js.map +1 -0
  222. package/dist/chunk-UGKI466V.js +12 -0
  223. package/dist/chunk-UGKI466V.js.map +1 -0
  224. package/dist/chunk-VM4RMQQN.js +11 -0
  225. package/dist/chunk-VM4RMQQN.js.map +1 -0
  226. package/dist/chunk-VQ37VLAS.js +54 -0
  227. package/dist/chunk-VQ37VLAS.js.map +1 -0
  228. package/dist/chunk-VT7VSYH5.js +73 -0
  229. package/dist/chunk-VT7VSYH5.js.map +1 -0
  230. package/dist/chunk-VTIRUCLZ.js +57 -0
  231. package/dist/chunk-VTIRUCLZ.js.map +1 -0
  232. package/dist/chunk-VVBAEYKI.js +202 -0
  233. package/dist/chunk-VVBAEYKI.js.map +1 -0
  234. package/dist/chunk-WHFIQUCC.js +120 -0
  235. package/dist/chunk-WHFIQUCC.js.map +1 -0
  236. package/dist/chunk-WPSESV5Z.js +74 -0
  237. package/dist/chunk-WPSESV5Z.js.map +1 -0
  238. package/dist/chunk-WXEXCHEN.js +51 -0
  239. package/dist/chunk-WXEXCHEN.js.map +1 -0
  240. package/dist/chunk-X2DDPD3D.js +113 -0
  241. package/dist/chunk-X2DDPD3D.js.map +1 -0
  242. package/dist/chunk-X7VIMKLD.js +127 -0
  243. package/dist/chunk-X7VIMKLD.js.map +1 -0
  244. package/dist/chunk-XJ3EG6XY.js +30 -0
  245. package/dist/chunk-XJ3EG6XY.js.map +1 -0
  246. package/dist/chunk-XOT5HWSF.js +23 -0
  247. package/dist/chunk-XOT5HWSF.js.map +1 -0
  248. package/dist/chunk-Y72IP43U.js +117 -0
  249. package/dist/chunk-Y72IP43U.js.map +1 -0
  250. package/dist/chunk-YD6FLXBV.js +61 -0
  251. package/dist/chunk-YD6FLXBV.js.map +1 -0
  252. package/dist/chunk-YEQQGYYO.js +1022 -0
  253. package/dist/chunk-YEQQGYYO.js.map +1 -0
  254. package/dist/chunk-YYW6AEIT.js +46 -0
  255. package/dist/chunk-YYW6AEIT.js.map +1 -0
  256. package/dist/chunk-ZEVGXKRU.js +104 -0
  257. package/dist/chunk-ZEVGXKRU.js.map +1 -0
  258. package/dist/chunk-ZKSMMLDP.js +74 -0
  259. package/dist/chunk-ZKSMMLDP.js.map +1 -0
  260. package/dist/chunk-ZU6IM6PK.js +101 -0
  261. package/dist/chunk-ZU6IM6PK.js.map +1 -0
  262. package/dist/chunk-ZUS5KZGO.js +714 -0
  263. package/dist/chunk-ZUS5KZGO.js.map +1 -0
  264. package/dist/chunk-ZVS2GOT2.js +58 -0
  265. package/dist/chunk-ZVS2GOT2.js.map +1 -0
  266. package/dist/chunk-ZXPDS6DH.js +3 -0
  267. package/dist/chunk-ZXPDS6DH.js.map +1 -0
  268. package/dist/chunk-ZZQQJX5Z.js +173 -0
  269. package/dist/chunk-ZZQQJX5Z.js.map +1 -0
  270. package/dist/components.css +2 -0
  271. package/dist/composites/account-menu/index.js +6 -0
  272. package/dist/composites/account-menu/index.js.map +1 -0
  273. package/dist/composites/agent-composer/index.js +7 -0
  274. package/dist/composites/agent-composer/index.js.map +1 -0
  275. package/dist/composites/agent-editor/index.js +10 -0
  276. package/dist/composites/agent-editor/index.js.map +1 -0
  277. package/dist/composites/agent-stream/index.js +12 -0
  278. package/dist/composites/agent-stream/index.js.map +1 -0
  279. package/dist/composites/agent-timeline/index.js +5 -0
  280. package/dist/composites/agent-timeline/index.js.map +1 -0
  281. package/dist/composites/approval-card/index.js +5 -0
  282. package/dist/composites/approval-card/index.js.map +1 -0
  283. package/dist/composites/chat-composer/index.js +6 -0
  284. package/dist/composites/chat-composer/index.js.map +1 -0
  285. package/dist/composites/chat-message/index.js +6 -0
  286. package/dist/composites/chat-message/index.js.map +1 -0
  287. package/dist/composites/code-block/index.js +5 -0
  288. package/dist/composites/code-block/index.js.map +1 -0
  289. package/dist/composites/command-palette/index.js +5 -0
  290. package/dist/composites/command-palette/index.js.map +1 -0
  291. package/dist/composites/confirm-dialog/index.js +7 -0
  292. package/dist/composites/confirm-dialog/index.js.map +1 -0
  293. package/dist/composites/cron-jobs-list/index.js +5 -0
  294. package/dist/composites/cron-jobs-list/index.js.map +1 -0
  295. package/dist/composites/data-table/index.js +10 -0
  296. package/dist/composites/data-table/index.js.map +1 -0
  297. package/dist/composites/deployment-row/index.js +5 -0
  298. package/dist/composites/deployment-row/index.js.map +1 -0
  299. package/dist/composites/domain-config/index.js +7 -0
  300. package/dist/composites/domain-config/index.js.map +1 -0
  301. package/dist/composites/env-var-editor/index.js +7 -0
  302. package/dist/composites/env-var-editor/index.js.map +1 -0
  303. package/dist/composites/mcp-server-list/index.js +5 -0
  304. package/dist/composites/mcp-server-list/index.js.map +1 -0
  305. package/dist/composites/page-shell/index.js +7 -0
  306. package/dist/composites/page-shell/index.js.map +1 -0
  307. package/dist/composites/permission-modal/index.js +6 -0
  308. package/dist/composites/permission-modal/index.js.map +1 -0
  309. package/dist/composites/preview-env-card/index.js +6 -0
  310. package/dist/composites/preview-env-card/index.js.map +1 -0
  311. package/dist/composites/preview-panel/index.js +5 -0
  312. package/dist/composites/preview-panel/index.js.map +1 -0
  313. package/dist/composites/project-card/index.js +6 -0
  314. package/dist/composites/project-card/index.js.map +1 -0
  315. package/dist/composites/rollback-ui/index.js +6 -0
  316. package/dist/composites/rollback-ui/index.js.map +1 -0
  317. package/dist/composites/rule-editor/index.js +11 -0
  318. package/dist/composites/rule-editor/index.js.map +1 -0
  319. package/dist/composites/skill-editor/index.js +11 -0
  320. package/dist/composites/skill-editor/index.js.map +1 -0
  321. package/dist/composites/skills-list/index.js +5 -0
  322. package/dist/composites/skills-list/index.js.map +1 -0
  323. package/dist/composites/stability-bundle-viewer/index.js +4 -0
  324. package/dist/composites/stability-bundle-viewer/index.js.map +1 -0
  325. package/dist/composites/task-header/index.js +5 -0
  326. package/dist/composites/task-header/index.js.map +1 -0
  327. package/dist/composites/usage-meter/index.js +5 -0
  328. package/dist/composites/usage-meter/index.js.map +1 -0
  329. package/dist/fonts/LICENSE-GEIST.txt +92 -0
  330. package/dist/fonts/geist-400.woff2 +0 -0
  331. package/dist/fonts/geist-500.woff2 +0 -0
  332. package/dist/fonts/geist-600.woff2 +0 -0
  333. package/dist/fonts/geist-mono-400.woff2 +0 -0
  334. package/dist/fonts/geist-mono-500.woff2 +0 -0
  335. package/dist/fonts/geist-mono-600.woff2 +0 -0
  336. package/dist/fonts-cdn.css +28 -0
  337. package/dist/fonts.css +75 -0
  338. package/dist/index.d.ts +4621 -0
  339. package/dist/index.js +1338 -0
  340. package/dist/index.js.map +1 -0
  341. package/dist/plugin-D5xmXqYb.d.ts +172 -0
  342. package/dist/preset-v3-legacy.d.ts +35 -0
  343. package/dist/preset-v3-legacy.js +159 -0
  344. package/dist/preset-v3-legacy.js.map +1 -0
  345. package/dist/preset.css +27 -0
  346. package/dist/primitives/action-bar/index.js +4 -0
  347. package/dist/primitives/action-bar/index.js.map +1 -0
  348. package/dist/primitives/agent-error-card/index.js +5 -0
  349. package/dist/primitives/agent-error-card/index.js.map +1 -0
  350. package/dist/primitives/agent-event/index.js +4 -0
  351. package/dist/primitives/agent-event/index.js.map +1 -0
  352. package/dist/primitives/agent-handoff/index.js +4 -0
  353. package/dist/primitives/agent-handoff/index.js.map +1 -0
  354. package/dist/primitives/agent-profile/index.js +4 -0
  355. package/dist/primitives/agent-profile/index.js.map +1 -0
  356. package/dist/primitives/agent-starting-state/index.js +5 -0
  357. package/dist/primitives/agent-starting-state/index.js.map +1 -0
  358. package/dist/primitives/agent-streaming/index.js +5 -0
  359. package/dist/primitives/agent-streaming/index.js.map +1 -0
  360. package/dist/primitives/alert/index.js +4 -0
  361. package/dist/primitives/alert/index.js.map +1 -0
  362. package/dist/primitives/artifact-preview/index.js +4 -0
  363. package/dist/primitives/artifact-preview/index.js.map +1 -0
  364. package/dist/primitives/attachment-chip/index.js +4 -0
  365. package/dist/primitives/attachment-chip/index.js.map +1 -0
  366. package/dist/primitives/audit-log-entry/index.js +4 -0
  367. package/dist/primitives/audit-log-entry/index.js.map +1 -0
  368. package/dist/primitives/auto-compact-notice/index.js +5 -0
  369. package/dist/primitives/auto-compact-notice/index.js.map +1 -0
  370. package/dist/primitives/avatar/index.js +4 -0
  371. package/dist/primitives/avatar/index.js.map +1 -0
  372. package/dist/primitives/badge/index.js +4 -0
  373. package/dist/primitives/badge/index.js.map +1 -0
  374. package/dist/primitives/branch-indicator/index.js +4 -0
  375. package/dist/primitives/branch-indicator/index.js.map +1 -0
  376. package/dist/primitives/browser-controls/index.js +4 -0
  377. package/dist/primitives/browser-controls/index.js.map +1 -0
  378. package/dist/primitives/build-log-stream/index.js +5 -0
  379. package/dist/primitives/build-log-stream/index.js.map +1 -0
  380. package/dist/primitives/button/index.js +4 -0
  381. package/dist/primitives/button/index.js.map +1 -0
  382. package/dist/primitives/capability-indicator/index.js +4 -0
  383. package/dist/primitives/capability-indicator/index.js.map +1 -0
  384. package/dist/primitives/card/index.js +4 -0
  385. package/dist/primitives/card/index.js.map +1 -0
  386. package/dist/primitives/channel-card/index.js +4 -0
  387. package/dist/primitives/channel-card/index.js.map +1 -0
  388. package/dist/primitives/chat-thread/index.js +5 -0
  389. package/dist/primitives/chat-thread/index.js.map +1 -0
  390. package/dist/primitives/checkbox/index.js +4 -0
  391. package/dist/primitives/checkbox/index.js.map +1 -0
  392. package/dist/primitives/context-card/index.js +4 -0
  393. package/dist/primitives/context-card/index.js.map +1 -0
  394. package/dist/primitives/context-window-bar/index.js +4 -0
  395. package/dist/primitives/context-window-bar/index.js.map +1 -0
  396. package/dist/primitives/copy-button/index.js +4 -0
  397. package/dist/primitives/copy-button/index.js.map +1 -0
  398. package/dist/primitives/cost-meter/index.js +4 -0
  399. package/dist/primitives/cost-meter/index.js.map +1 -0
  400. package/dist/primitives/created-files-card/index.js +4 -0
  401. package/dist/primitives/created-files-card/index.js.map +1 -0
  402. package/dist/primitives/cron-job-card/index.js +4 -0
  403. package/dist/primitives/cron-job-card/index.js.map +1 -0
  404. package/dist/primitives/danger-zone/index.js +4 -0
  405. package/dist/primitives/danger-zone/index.js.map +1 -0
  406. package/dist/primitives/dialog/index.js +4 -0
  407. package/dist/primitives/dialog/index.js.map +1 -0
  408. package/dist/primitives/diff-viewer/index.js +4 -0
  409. package/dist/primitives/diff-viewer/index.js.map +1 -0
  410. package/dist/primitives/dropdown-menu/index.js +4 -0
  411. package/dist/primitives/dropdown-menu/index.js.map +1 -0
  412. package/dist/primitives/empty-state/index.js +4 -0
  413. package/dist/primitives/empty-state/index.js.map +1 -0
  414. package/dist/primitives/export-chat-dialog/index.js +4 -0
  415. package/dist/primitives/export-chat-dialog/index.js.map +1 -0
  416. package/dist/primitives/folder-context-card/index.js +4 -0
  417. package/dist/primitives/folder-context-card/index.js.map +1 -0
  418. package/dist/primitives/folder-selector/index.js +4 -0
  419. package/dist/primitives/folder-selector/index.js.map +1 -0
  420. package/dist/primitives/form-field/index.js +4 -0
  421. package/dist/primitives/form-field/index.js.map +1 -0
  422. package/dist/primitives/gateway-status-indicator/index.js +4 -0
  423. package/dist/primitives/gateway-status-indicator/index.js.map +1 -0
  424. package/dist/primitives/hook-config/index.js +4 -0
  425. package/dist/primitives/hook-config/index.js.map +1 -0
  426. package/dist/primitives/hook-event-log/index.js +4 -0
  427. package/dist/primitives/hook-event-log/index.js.map +1 -0
  428. package/dist/primitives/input/index.js +4 -0
  429. package/dist/primitives/input/index.js.map +1 -0
  430. package/dist/primitives/intent-selector/index.js +4 -0
  431. package/dist/primitives/intent-selector/index.js.map +1 -0
  432. package/dist/primitives/label/index.js +4 -0
  433. package/dist/primitives/label/index.js.map +1 -0
  434. package/dist/primitives/lane-board/index.js +4 -0
  435. package/dist/primitives/lane-board/index.js.map +1 -0
  436. package/dist/primitives/login-split/index.js +4 -0
  437. package/dist/primitives/login-split/index.js.map +1 -0
  438. package/dist/primitives/mcp-server-card/index.js +4 -0
  439. package/dist/primitives/mcp-server-card/index.js.map +1 -0
  440. package/dist/primitives/memory-editor/index.js +4 -0
  441. package/dist/primitives/memory-editor/index.js.map +1 -0
  442. package/dist/primitives/mention-menu/index.js +4 -0
  443. package/dist/primitives/mention-menu/index.js.map +1 -0
  444. package/dist/primitives/metrics-panel/index.js +4 -0
  445. package/dist/primitives/metrics-panel/index.js.map +1 -0
  446. package/dist/primitives/model-card/index.js +4 -0
  447. package/dist/primitives/model-card/index.js.map +1 -0
  448. package/dist/primitives/model-selector/index.js +4 -0
  449. package/dist/primitives/model-selector/index.js.map +1 -0
  450. package/dist/primitives/pagination/index.js +4 -0
  451. package/dist/primitives/pagination/index.js.map +1 -0
  452. package/dist/primitives/permission-matrix/index.js +4 -0
  453. package/dist/primitives/permission-matrix/index.js.map +1 -0
  454. package/dist/primitives/pin-input/index.js +4 -0
  455. package/dist/primitives/pin-input/index.js.map +1 -0
  456. package/dist/primitives/plan-badge/index.js +4 -0
  457. package/dist/primitives/plan-badge/index.js.map +1 -0
  458. package/dist/primitives/progress/index.js +4 -0
  459. package/dist/primitives/progress/index.js.map +1 -0
  460. package/dist/primitives/progress-checklist/index.js +4 -0
  461. package/dist/primitives/progress-checklist/index.js.map +1 -0
  462. package/dist/primitives/project-switcher/index.js +4 -0
  463. package/dist/primitives/project-switcher/index.js.map +1 -0
  464. package/dist/primitives/quick-action-chips/index.js +4 -0
  465. package/dist/primitives/quick-action-chips/index.js.map +1 -0
  466. package/dist/primitives/radio-group/index.js +4 -0
  467. package/dist/primitives/radio-group/index.js.map +1 -0
  468. package/dist/primitives/recent-folders-list/index.js +4 -0
  469. package/dist/primitives/recent-folders-list/index.js.map +1 -0
  470. package/dist/primitives/rule-card/index.js +4 -0
  471. package/dist/primitives/rule-card/index.js.map +1 -0
  472. package/dist/primitives/run-stats/index.js +4 -0
  473. package/dist/primitives/run-stats/index.js.map +1 -0
  474. package/dist/primitives/run-status-pill/index.js +4 -0
  475. package/dist/primitives/run-status-pill/index.js.map +1 -0
  476. package/dist/primitives/running-tasks-panel/index.js +4 -0
  477. package/dist/primitives/running-tasks-panel/index.js.map +1 -0
  478. package/dist/primitives/scroll-area/index.js +4 -0
  479. package/dist/primitives/scroll-area/index.js.map +1 -0
  480. package/dist/primitives/select/index.js +4 -0
  481. package/dist/primitives/select/index.js.map +1 -0
  482. package/dist/primitives/session-list-item/index.js +4 -0
  483. package/dist/primitives/session-list-item/index.js.map +1 -0
  484. package/dist/primitives/session-timeline/index.js +4 -0
  485. package/dist/primitives/session-timeline/index.js.map +1 -0
  486. package/dist/primitives/sheet/index.js +4 -0
  487. package/dist/primitives/sheet/index.js.map +1 -0
  488. package/dist/primitives/sidebar/index.js +4 -0
  489. package/dist/primitives/sidebar/index.js.map +1 -0
  490. package/dist/primitives/skeleton/index.js +5 -0
  491. package/dist/primitives/skeleton/index.js.map +1 -0
  492. package/dist/primitives/skill-card/index.js +4 -0
  493. package/dist/primitives/skill-card/index.js.map +1 -0
  494. package/dist/primitives/social-auth-row/index.js +4 -0
  495. package/dist/primitives/social-auth-row/index.js.map +1 -0
  496. package/dist/primitives/stat-tile/index.js +4 -0
  497. package/dist/primitives/stat-tile/index.js.map +1 -0
  498. package/dist/primitives/status-dot/index.js +4 -0
  499. package/dist/primitives/status-dot/index.js.map +1 -0
  500. package/dist/primitives/steps-rail/index.js +4 -0
  501. package/dist/primitives/steps-rail/index.js.map +1 -0
  502. package/dist/primitives/sub-agent-dispatch/index.js +4 -0
  503. package/dist/primitives/sub-agent-dispatch/index.js.map +1 -0
  504. package/dist/primitives/switch/index.js +4 -0
  505. package/dist/primitives/switch/index.js.map +1 -0
  506. package/dist/primitives/system-prompt-editor/index.js +4 -0
  507. package/dist/primitives/system-prompt-editor/index.js.map +1 -0
  508. package/dist/primitives/table/index.js +4 -0
  509. package/dist/primitives/table/index.js.map +1 -0
  510. package/dist/primitives/tabs/index.js +4 -0
  511. package/dist/primitives/tabs/index.js.map +1 -0
  512. package/dist/primitives/task-plan/index.js +4 -0
  513. package/dist/primitives/task-plan/index.js.map +1 -0
  514. package/dist/primitives/terminal-panel/index.js +5 -0
  515. package/dist/primitives/terminal-panel/index.js.map +1 -0
  516. package/dist/primitives/textarea/index.js +4 -0
  517. package/dist/primitives/textarea/index.js.map +1 -0
  518. package/dist/primitives/thinking-level-selector/index.js +4 -0
  519. package/dist/primitives/thinking-level-selector/index.js.map +1 -0
  520. package/dist/primitives/timestamp/index.js +4 -0
  521. package/dist/primitives/timestamp/index.js.map +1 -0
  522. package/dist/primitives/toast/index.js +4 -0
  523. package/dist/primitives/toast/index.js.map +1 -0
  524. package/dist/primitives/token-usage-chart/index.js +4 -0
  525. package/dist/primitives/token-usage-chart/index.js.map +1 -0
  526. package/dist/primitives/tool-call/index.js +4 -0
  527. package/dist/primitives/tool-call/index.js.map +1 -0
  528. package/dist/primitives/tool-call-card/index.js +4 -0
  529. package/dist/primitives/tool-call-card/index.js.map +1 -0
  530. package/dist/primitives/tool-result/index.js +4 -0
  531. package/dist/primitives/tool-result/index.js.map +1 -0
  532. package/dist/primitives/tools-list/index.js +4 -0
  533. package/dist/primitives/tools-list/index.js.map +1 -0
  534. package/dist/primitives/tooltip/index.js +4 -0
  535. package/dist/primitives/tooltip/index.js.map +1 -0
  536. package/dist/primitives/topnav/index.js +4 -0
  537. package/dist/primitives/topnav/index.js.map +1 -0
  538. package/dist/primitives/update-banner/index.js +4 -0
  539. package/dist/primitives/update-banner/index.js.map +1 -0
  540. package/dist/slide/index.d.ts +212 -0
  541. package/dist/slide/index.js +3 -0
  542. package/dist/slide/index.js.map +1 -0
  543. package/dist/slide/plugins/emoji/index.d.ts +29 -0
  544. package/dist/slide/plugins/emoji/index.js +157 -0
  545. package/dist/slide/plugins/emoji/index.js.map +1 -0
  546. package/dist/slide/plugins/math/index.d.ts +13 -0
  547. package/dist/slide/plugins/math/index.js +145 -0
  548. package/dist/slide/plugins/math/index.js.map +1 -0
  549. package/dist/slide/plugins/mermaid/index.d.ts +55 -0
  550. package/dist/slide/plugins/mermaid/index.js +218 -0
  551. package/dist/slide/plugins/mermaid/index.js.map +1 -0
  552. package/dist/slide/plugins/shiki/index.d.ts +18 -0
  553. package/dist/slide/plugins/shiki/index.js +87 -0
  554. package/dist/slide/plugins/shiki/index.js.map +1 -0
  555. package/dist/slide/themes/default.css +256 -0
  556. package/dist/slide/themes/layouts.css +143 -0
  557. package/dist/slide/themes/violet-forge.css +256 -0
  558. package/dist/slide-deck/index.css +52 -0
  559. package/dist/slide-deck/index.css.map +1 -0
  560. package/dist/slide-deck/index.d.ts +377 -0
  561. package/dist/slide-deck/index.js +1111 -0
  562. package/dist/slide-deck/index.js.map +1 -0
  563. package/dist/styles-v3-legacy.css +88 -0
  564. package/dist/styles.css +137 -0
  565. package/dist/tokens-v4.css +187 -0
  566. package/dist/tokens.css +230 -0
  567. package/dist/vite-plugin.d.ts +29 -0
  568. package/dist/vite-plugin.js +76 -0
  569. package/dist/vite-plugin.js.map +1 -0
  570. package/dist/whiteboard/index.d.ts +258 -0
  571. package/dist/whiteboard/index.js +738 -0
  572. package/dist/whiteboard/index.js.map +1 -0
  573. package/llms.txt +273 -0
  574. package/package.json +800 -0
  575. package/registry/index.json +856 -0
  576. package/registry/r/account-menu.json +24 -0
  577. package/registry/r/action-bar.json +22 -0
  578. package/registry/r/agent-composer.json +22 -0
  579. package/registry/r/agent-editor.json +27 -0
  580. package/registry/r/agent-error-card.json +22 -0
  581. package/registry/r/agent-event.json +24 -0
  582. package/registry/r/agent-handoff.json +22 -0
  583. package/registry/r/agent-profile.json +23 -0
  584. package/registry/r/agent-starting-state.json +22 -0
  585. package/registry/r/agent-stream.json +27 -0
  586. package/registry/r/agent-streaming.json +22 -0
  587. package/registry/r/agent-timeline.json +22 -0
  588. package/registry/r/agent-types.json +15 -0
  589. package/registry/r/alert.json +22 -0
  590. package/registry/r/approval-card.json +25 -0
  591. package/registry/r/artifact-preview.json +22 -0
  592. package/registry/r/attachment-chip.json +24 -0
  593. package/registry/r/audit-log-entry.json +23 -0
  594. package/registry/r/auto-compact-notice.json +22 -0
  595. package/registry/r/avatar.json +23 -0
  596. package/registry/r/badge.json +22 -0
  597. package/registry/r/browser-controls.json +22 -0
  598. package/registry/r/build-log-stream.json +19 -0
  599. package/registry/r/button.json +23 -0
  600. package/registry/r/capability-indicator.json +23 -0
  601. package/registry/r/card.json +22 -0
  602. package/registry/r/chat-composer.json +23 -0
  603. package/registry/r/chat-message.json +129 -0
  604. package/registry/r/chat-thread.json +20 -0
  605. package/registry/r/chat-types.json +15 -0
  606. package/registry/r/checkbox.json +24 -0
  607. package/registry/r/cn.json +19 -0
  608. package/registry/r/code-block.json +21 -0
  609. package/registry/r/command-palette.json +25 -0
  610. package/registry/r/confirm-dialog.json +25 -0
  611. package/registry/r/context-card.json +23 -0
  612. package/registry/r/context-window-bar.json +20 -0
  613. package/registry/r/copy-button.json +22 -0
  614. package/registry/r/cost-meter.json +22 -0
  615. package/registry/r/created-files-card.json +23 -0
  616. package/registry/r/cron-job-card.json +22 -0
  617. package/registry/r/cron-jobs-list.json +23 -0
  618. package/registry/r/danger-zone.json +20 -0
  619. package/registry/r/data-table.json +27 -0
  620. package/registry/r/deployment-row.json +23 -0
  621. package/registry/r/dialog.json +23 -0
  622. package/registry/r/diff-viewer.json +20 -0
  623. package/registry/r/domain-config.json +25 -0
  624. package/registry/r/dropdown-menu.json +23 -0
  625. package/registry/r/empty-state.json +20 -0
  626. package/registry/r/env-var-editor.json +25 -0
  627. package/registry/r/folder-context-card.json +23 -0
  628. package/registry/r/folder-selector.json +22 -0
  629. package/registry/r/form-field.json +23 -0
  630. package/registry/r/hook-config.json +22 -0
  631. package/registry/r/hook-event-log.json +22 -0
  632. package/registry/r/input.json +22 -0
  633. package/registry/r/intent-selector.json +24 -0
  634. package/registry/r/label.json +22 -0
  635. package/registry/r/lane-board.json +20 -0
  636. package/registry/r/live-region-context.json +16 -0
  637. package/registry/r/login-split.json +20 -0
  638. package/registry/r/mcp-server-card.json +22 -0
  639. package/registry/r/mcp-server-list.json +23 -0
  640. package/registry/r/memory-editor.json +23 -0
  641. package/registry/r/mention-menu.json +23 -0
  642. package/registry/r/metrics-panel.json +22 -0
  643. package/registry/r/mode-types.json +15 -0
  644. package/registry/r/model-card.json +23 -0
  645. package/registry/r/model-selector.json +23 -0
  646. package/registry/r/page-shell.json +25 -0
  647. package/registry/r/pagination.json +22 -0
  648. package/registry/r/permission-matrix.json +22 -0
  649. package/registry/r/permission-modal.json +24 -0
  650. package/registry/r/permission-types.json +15 -0
  651. package/registry/r/pin-input.json +20 -0
  652. package/registry/r/plan-badge.json +20 -0
  653. package/registry/r/preview-env-card.json +25 -0
  654. package/registry/r/preview-panel.json +21 -0
  655. package/registry/r/progress-checklist.json +23 -0
  656. package/registry/r/progress.json +20 -0
  657. package/registry/r/project-card.json +25 -0
  658. package/registry/r/project-switcher.json +22 -0
  659. package/registry/r/quick-action-chips.json +21 -0
  660. package/registry/r/radio-group.json +23 -0
  661. package/registry/r/recent-folders-list.json +22 -0
  662. package/registry/r/rollback-ui.json +24 -0
  663. package/registry/r/rule-card.json +23 -0
  664. package/registry/r/rule-editor.json +28 -0
  665. package/registry/r/rule-types.json +18 -0
  666. package/registry/r/run-stats.json +22 -0
  667. package/registry/r/running-tasks-panel.json +22 -0
  668. package/registry/r/safe-href.json +16 -0
  669. package/registry/r/scroll-area.json +22 -0
  670. package/registry/r/select.json +24 -0
  671. package/registry/r/session-list-item.json +20 -0
  672. package/registry/r/session-timeline.json +22 -0
  673. package/registry/r/sheet.json +24 -0
  674. package/registry/r/sidebar.json +19 -0
  675. package/registry/r/skeleton.json +19 -0
  676. package/registry/r/skill-card.json +24 -0
  677. package/registry/r/skill-editor.json +28 -0
  678. package/registry/r/skills-list.json +23 -0
  679. package/registry/r/slide-deck.json +130 -0
  680. package/registry/r/slide-plugin-emoji.json +28 -0
  681. package/registry/r/slide-plugin-math.json +24 -0
  682. package/registry/r/slide-plugin-mermaid.json +23 -0
  683. package/registry/r/slide-plugin-shiki.json +23 -0
  684. package/registry/r/slide.json +123 -0
  685. package/registry/r/social-auth-row.json +21 -0
  686. package/registry/r/stat-tile.json +22 -0
  687. package/registry/r/status-dot.json +20 -0
  688. package/registry/r/steps-rail.json +20 -0
  689. package/registry/r/sub-agent-dispatch.json +22 -0
  690. package/registry/r/switch.json +23 -0
  691. package/registry/r/system-prompt-editor.json +22 -0
  692. package/registry/r/table.json +22 -0
  693. package/registry/r/tabs.json +22 -0
  694. package/registry/r/tailwind-preset.json +19 -0
  695. package/registry/r/task-header.json +24 -0
  696. package/registry/r/task-plan.json +22 -0
  697. package/registry/r/task-types.json +15 -0
  698. package/registry/r/terminal-panel.json +22 -0
  699. package/registry/r/textarea.json +22 -0
  700. package/registry/r/theme-provider.json +59 -0
  701. package/registry/r/theme-script.json +18 -0
  702. package/registry/r/theo-ui-provider.json +20 -0
  703. package/registry/r/timestamp.json +20 -0
  704. package/registry/r/toast.json +30 -0
  705. package/registry/r/token-usage-chart.json +20 -0
  706. package/registry/r/tokens.json +21 -0
  707. package/registry/r/tool-call-card.json +23 -0
  708. package/registry/r/tool-call.json +22 -0
  709. package/registry/r/tool-result.json +20 -0
  710. package/registry/r/tools-list.json +23 -0
  711. package/registry/r/tooltip.json +22 -0
  712. package/registry/r/topnav.json +22 -0
  713. package/registry/r/types.json +15 -0
  714. package/registry/r/usage-meter.json +21 -0
  715. package/registry/r/whiteboard.json +101 -0
@@ -0,0 +1,1022 @@
1
+ import { safeHref } from './chunk-GDMCDW66.js';
2
+ import { Button } from './chunk-5VOSCJKQ.js';
3
+ import { cn } from './chunk-EWDN56AS.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-YEQQGYYO.js.map
1022
+ //# sourceMappingURL=chunk-YEQQGYYO.js.map