@copilotkit/react-ui 0.0.0-feat-dynamic-copilotcloud-qa-20250117190454

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 (368) hide show
  1. package/CHANGELOG.md +2436 -0
  2. package/README.md +46 -0
  3. package/dist/chunk-34FREWVK.mjs +180 -0
  4. package/dist/chunk-34FREWVK.mjs.map +1 -0
  5. package/dist/chunk-3VNMQWGT.mjs +25 -0
  6. package/dist/chunk-3VNMQWGT.mjs.map +1 -0
  7. package/dist/chunk-3XAXY2Z3.mjs +18 -0
  8. package/dist/chunk-3XAXY2Z3.mjs.map +1 -0
  9. package/dist/chunk-54JAUBUJ.mjs +26 -0
  10. package/dist/chunk-54JAUBUJ.mjs.map +1 -0
  11. package/dist/chunk-B23XDGH4.mjs +30 -0
  12. package/dist/chunk-B23XDGH4.mjs.map +1 -0
  13. package/dist/chunk-BH6PCAAL.mjs +81 -0
  14. package/dist/chunk-BH6PCAAL.mjs.map +1 -0
  15. package/dist/chunk-CBBFRI3Q.mjs +81 -0
  16. package/dist/chunk-CBBFRI3Q.mjs.map +1 -0
  17. package/dist/chunk-EFZPSZWO.mjs +1 -0
  18. package/dist/chunk-EFZPSZWO.mjs.map +1 -0
  19. package/dist/chunk-EMQEEXUB.mjs +97 -0
  20. package/dist/chunk-EMQEEXUB.mjs.map +1 -0
  21. package/dist/chunk-F2W5FD7L.mjs +232 -0
  22. package/dist/chunk-F2W5FD7L.mjs.map +1 -0
  23. package/dist/chunk-F7VWGY77.mjs +22 -0
  24. package/dist/chunk-F7VWGY77.mjs.map +1 -0
  25. package/dist/chunk-FZC7X5PK.mjs +262 -0
  26. package/dist/chunk-FZC7X5PK.mjs.map +1 -0
  27. package/dist/chunk-HEIDCT7I.mjs +10 -0
  28. package/dist/chunk-HEIDCT7I.mjs.map +1 -0
  29. package/dist/chunk-I7MG52I5.mjs +314 -0
  30. package/dist/chunk-I7MG52I5.mjs.map +1 -0
  31. package/dist/chunk-IU3WTXLQ.mjs +1 -0
  32. package/dist/chunk-IU3WTXLQ.mjs.map +1 -0
  33. package/dist/chunk-KXE2JCUH.mjs +1 -0
  34. package/dist/chunk-KXE2JCUH.mjs.map +1 -0
  35. package/dist/chunk-MMVDU6DF.mjs +1 -0
  36. package/dist/chunk-MMVDU6DF.mjs.map +1 -0
  37. package/dist/chunk-MRXNTQOX.mjs +59 -0
  38. package/dist/chunk-MRXNTQOX.mjs.map +1 -0
  39. package/dist/chunk-O6JFOQQA.mjs +21 -0
  40. package/dist/chunk-O6JFOQQA.mjs.map +1 -0
  41. package/dist/chunk-OFYI4UU4.mjs +35 -0
  42. package/dist/chunk-OFYI4UU4.mjs.map +1 -0
  43. package/dist/chunk-OTPAZXVR.mjs +92 -0
  44. package/dist/chunk-OTPAZXVR.mjs.map +1 -0
  45. package/dist/chunk-P5A3A5FO.mjs +112 -0
  46. package/dist/chunk-P5A3A5FO.mjs.map +1 -0
  47. package/dist/chunk-PNQVKBPN.mjs +146 -0
  48. package/dist/chunk-PNQVKBPN.mjs.map +1 -0
  49. package/dist/chunk-RJCZRKTV.mjs +106 -0
  50. package/dist/chunk-RJCZRKTV.mjs.map +1 -0
  51. package/dist/chunk-RQNJNK2W.mjs +25 -0
  52. package/dist/chunk-RQNJNK2W.mjs.map +1 -0
  53. package/dist/chunk-S5MBUNGN.mjs +140 -0
  54. package/dist/chunk-S5MBUNGN.mjs.map +1 -0
  55. package/dist/chunk-SQMEPWVT.mjs +1 -0
  56. package/dist/chunk-SQMEPWVT.mjs.map +1 -0
  57. package/dist/chunk-T26KLXLH.mjs +1 -0
  58. package/dist/chunk-T26KLXLH.mjs.map +1 -0
  59. package/dist/chunk-TI7SY2RI.mjs +164 -0
  60. package/dist/chunk-TI7SY2RI.mjs.map +1 -0
  61. package/dist/chunk-UPTB2MVO.mjs +395 -0
  62. package/dist/chunk-UPTB2MVO.mjs.map +1 -0
  63. package/dist/chunk-UWWMAJ7R.mjs +100 -0
  64. package/dist/chunk-UWWMAJ7R.mjs.map +1 -0
  65. package/dist/chunk-V7W6IM2V.mjs +1 -0
  66. package/dist/chunk-V7W6IM2V.mjs.map +1 -0
  67. package/dist/chunk-VEC45H6Q.mjs +18 -0
  68. package/dist/chunk-VEC45H6Q.mjs.map +1 -0
  69. package/dist/chunk-VKVNMHM5.mjs +105 -0
  70. package/dist/chunk-VKVNMHM5.mjs.map +1 -0
  71. package/dist/chunk-WB3YULQ4.mjs +1 -0
  72. package/dist/chunk-WB3YULQ4.mjs.map +1 -0
  73. package/dist/chunk-YAGE7RCE.mjs +118 -0
  74. package/dist/chunk-YAGE7RCE.mjs.map +1 -0
  75. package/dist/chunk-YQ3D5IQV.mjs +75 -0
  76. package/dist/chunk-YQ3D5IQV.mjs.map +1 -0
  77. package/dist/chunk-YQFVRDNC.mjs +53 -0
  78. package/dist/chunk-YQFVRDNC.mjs.map +1 -0
  79. package/dist/chunk-Z2UZSN3K.mjs +29 -0
  80. package/dist/chunk-Z2UZSN3K.mjs.map +1 -0
  81. package/dist/components/chat/Button.d.ts +7 -0
  82. package/dist/components/chat/Button.js +71 -0
  83. package/dist/components/chat/Button.js.map +1 -0
  84. package/dist/components/chat/Button.mjs +10 -0
  85. package/dist/components/chat/Button.mjs.map +1 -0
  86. package/dist/components/chat/Chat.d.ts +156 -0
  87. package/dist/components/chat/Chat.js +2540 -0
  88. package/dist/components/chat/Chat.js.map +1 -0
  89. package/dist/components/chat/Chat.mjs +36 -0
  90. package/dist/components/chat/Chat.mjs.map +1 -0
  91. package/dist/components/chat/ChatContext.d.ts +105 -0
  92. package/dist/components/chat/ChatContext.js +279 -0
  93. package/dist/components/chat/ChatContext.js.map +1 -0
  94. package/dist/components/chat/ChatContext.mjs +13 -0
  95. package/dist/components/chat/ChatContext.mjs.map +1 -0
  96. package/dist/components/chat/CodeBlock.d.ts +14 -0
  97. package/dist/components/chat/CodeBlock.js +523 -0
  98. package/dist/components/chat/CodeBlock.js.map +1 -0
  99. package/dist/components/chat/CodeBlock.mjs +14 -0
  100. package/dist/components/chat/CodeBlock.mjs.map +1 -0
  101. package/dist/components/chat/Header.d.ts +7 -0
  102. package/dist/components/chat/Header.js +64 -0
  103. package/dist/components/chat/Header.js.map +1 -0
  104. package/dist/components/chat/Header.mjs +10 -0
  105. package/dist/components/chat/Header.mjs.map +1 -0
  106. package/dist/components/chat/Icons.d.ts +18 -0
  107. package/dist/components/chat/Icons.js +321 -0
  108. package/dist/components/chat/Icons.js.map +1 -0
  109. package/dist/components/chat/Icons.mjs +32 -0
  110. package/dist/components/chat/Icons.mjs.map +1 -0
  111. package/dist/components/chat/Input.d.ts +7 -0
  112. package/dist/components/chat/Input.js +324 -0
  113. package/dist/components/chat/Input.js.map +1 -0
  114. package/dist/components/chat/Input.mjs +12 -0
  115. package/dist/components/chat/Input.mjs.map +1 -0
  116. package/dist/components/chat/Markdown.d.ts +8 -0
  117. package/dist/components/chat/Markdown.js +583 -0
  118. package/dist/components/chat/Markdown.js.map +1 -0
  119. package/dist/components/chat/Markdown.mjs +11 -0
  120. package/dist/components/chat/Markdown.mjs.map +1 -0
  121. package/dist/components/chat/Messages.d.ts +12 -0
  122. package/dist/components/chat/Messages.js +227 -0
  123. package/dist/components/chat/Messages.js.map +1 -0
  124. package/dist/components/chat/Messages.mjs +12 -0
  125. package/dist/components/chat/Messages.mjs.map +1 -0
  126. package/dist/components/chat/Modal.d.ts +51 -0
  127. package/dist/components/chat/Modal.js +2743 -0
  128. package/dist/components/chat/Modal.js.map +1 -0
  129. package/dist/components/chat/Modal.mjs +36 -0
  130. package/dist/components/chat/Modal.mjs.map +1 -0
  131. package/dist/components/chat/Popup.d.ts +13 -0
  132. package/dist/components/chat/Popup.js +2754 -0
  133. package/dist/components/chat/Popup.js.map +1 -0
  134. package/dist/components/chat/Popup.mjs +37 -0
  135. package/dist/components/chat/Popup.mjs.map +1 -0
  136. package/dist/components/chat/Response.d.ts +7 -0
  137. package/dist/components/chat/Response.js +64 -0
  138. package/dist/components/chat/Response.js.map +1 -0
  139. package/dist/components/chat/Response.mjs +10 -0
  140. package/dist/components/chat/Response.mjs.map +1 -0
  141. package/dist/components/chat/Sidebar.d.ts +13 -0
  142. package/dist/components/chat/Sidebar.js +2763 -0
  143. package/dist/components/chat/Sidebar.js.map +1 -0
  144. package/dist/components/chat/Sidebar.mjs +37 -0
  145. package/dist/components/chat/Sidebar.mjs.map +1 -0
  146. package/dist/components/chat/Suggestion.d.ts +14 -0
  147. package/dist/components/chat/Suggestion.js +181 -0
  148. package/dist/components/chat/Suggestion.js.map +1 -0
  149. package/dist/components/chat/Suggestion.mjs +11 -0
  150. package/dist/components/chat/Suggestion.mjs.map +1 -0
  151. package/dist/components/chat/Textarea.d.ts +13 -0
  152. package/dist/components/chat/Textarea.js +73 -0
  153. package/dist/components/chat/Textarea.js.map +1 -0
  154. package/dist/components/chat/Textarea.mjs +8 -0
  155. package/dist/components/chat/Textarea.mjs.map +1 -0
  156. package/dist/components/chat/Window.d.ts +7 -0
  157. package/dist/components/chat/Window.js +164 -0
  158. package/dist/components/chat/Window.js.map +1 -0
  159. package/dist/components/chat/Window.mjs +10 -0
  160. package/dist/components/chat/Window.mjs.map +1 -0
  161. package/dist/components/chat/index.d.ts +14 -0
  162. package/dist/components/chat/index.js +2784 -0
  163. package/dist/components/chat/index.js.map +1 -0
  164. package/dist/components/chat/index.mjs +58 -0
  165. package/dist/components/chat/index.mjs.map +1 -0
  166. package/dist/components/chat/messages/AssistantMessage.d.ts +7 -0
  167. package/dist/components/chat/messages/AssistantMessage.js +615 -0
  168. package/dist/components/chat/messages/AssistantMessage.js.map +1 -0
  169. package/dist/components/chat/messages/AssistantMessage.mjs +13 -0
  170. package/dist/components/chat/messages/AssistantMessage.mjs.map +1 -0
  171. package/dist/components/chat/messages/RenderActionExecutionMessage.d.ts +7 -0
  172. package/dist/components/chat/messages/RenderActionExecutionMessage.js +136 -0
  173. package/dist/components/chat/messages/RenderActionExecutionMessage.js.map +1 -0
  174. package/dist/components/chat/messages/RenderActionExecutionMessage.mjs +8 -0
  175. package/dist/components/chat/messages/RenderActionExecutionMessage.mjs.map +1 -0
  176. package/dist/components/chat/messages/RenderAgentStateMessage.d.ts +7 -0
  177. package/dist/components/chat/messages/RenderAgentStateMessage.js +124 -0
  178. package/dist/components/chat/messages/RenderAgentStateMessage.js.map +1 -0
  179. package/dist/components/chat/messages/RenderAgentStateMessage.mjs +8 -0
  180. package/dist/components/chat/messages/RenderAgentStateMessage.mjs.map +1 -0
  181. package/dist/components/chat/messages/RenderResultMessage.d.ts +7 -0
  182. package/dist/components/chat/messages/RenderResultMessage.js +46 -0
  183. package/dist/components/chat/messages/RenderResultMessage.js.map +1 -0
  184. package/dist/components/chat/messages/RenderResultMessage.mjs +8 -0
  185. package/dist/components/chat/messages/RenderResultMessage.mjs.map +1 -0
  186. package/dist/components/chat/messages/RenderTextMessage.d.ts +7 -0
  187. package/dist/components/chat/messages/RenderTextMessage.js +59 -0
  188. package/dist/components/chat/messages/RenderTextMessage.js.map +1 -0
  189. package/dist/components/chat/messages/RenderTextMessage.mjs +8 -0
  190. package/dist/components/chat/messages/RenderTextMessage.mjs.map +1 -0
  191. package/dist/components/chat/messages/UserMessage.d.ts +7 -0
  192. package/dist/components/chat/messages/UserMessage.js +34 -0
  193. package/dist/components/chat/messages/UserMessage.js.map +1 -0
  194. package/dist/components/chat/messages/UserMessage.mjs +8 -0
  195. package/dist/components/chat/messages/UserMessage.mjs.map +1 -0
  196. package/dist/components/chat/props.d.ts +81 -0
  197. package/dist/components/chat/props.js +19 -0
  198. package/dist/components/chat/props.js.map +1 -0
  199. package/dist/components/chat/props.mjs +2 -0
  200. package/dist/components/chat/props.mjs.map +1 -0
  201. package/dist/components/dev-console/console.d.ts +10 -0
  202. package/dist/components/dev-console/console.js +720 -0
  203. package/dist/components/dev-console/console.js.map +1 -0
  204. package/dist/components/dev-console/console.mjs +17 -0
  205. package/dist/components/dev-console/console.mjs.map +1 -0
  206. package/dist/components/dev-console/icons.d.ts +9 -0
  207. package/dist/components/dev-console/icons.js +120 -0
  208. package/dist/components/dev-console/icons.js.map +1 -0
  209. package/dist/components/dev-console/icons.mjs +16 -0
  210. package/dist/components/dev-console/icons.mjs.map +1 -0
  211. package/dist/components/dev-console/index.d.ts +5 -0
  212. package/dist/components/dev-console/index.js +720 -0
  213. package/dist/components/dev-console/index.js.map +1 -0
  214. package/dist/components/dev-console/index.mjs +18 -0
  215. package/dist/components/dev-console/index.mjs.map +1 -0
  216. package/dist/components/dev-console/types.d.ts +9 -0
  217. package/dist/components/dev-console/types.js +19 -0
  218. package/dist/components/dev-console/types.js.map +1 -0
  219. package/dist/components/dev-console/types.mjs +1 -0
  220. package/dist/components/dev-console/types.mjs.map +1 -0
  221. package/dist/components/dev-console/utils.d.ts +10 -0
  222. package/dist/components/dev-console/utils.js +188 -0
  223. package/dist/components/dev-console/utils.js.map +1 -0
  224. package/dist/components/dev-console/utils.mjs +16 -0
  225. package/dist/components/dev-console/utils.mjs.map +1 -0
  226. package/dist/components/help-modal/icons.d.ts +9 -0
  227. package/dist/components/help-modal/icons.js +107 -0
  228. package/dist/components/help-modal/icons.js.map +1 -0
  229. package/dist/components/help-modal/icons.mjs +12 -0
  230. package/dist/components/help-modal/icons.mjs.map +1 -0
  231. package/dist/components/help-modal/index.d.ts +2 -0
  232. package/dist/components/help-modal/index.js +255 -0
  233. package/dist/components/help-modal/index.js.map +1 -0
  234. package/dist/components/help-modal/index.mjs +10 -0
  235. package/dist/components/help-modal/index.mjs.map +1 -0
  236. package/dist/components/help-modal/modal.d.ts +5 -0
  237. package/dist/components/help-modal/modal.js +253 -0
  238. package/dist/components/help-modal/modal.js.map +1 -0
  239. package/dist/components/help-modal/modal.mjs +9 -0
  240. package/dist/components/help-modal/modal.mjs.map +1 -0
  241. package/dist/components/index.d.ts +17 -0
  242. package/dist/components/index.js +2788 -0
  243. package/dist/components/index.js.map +1 -0
  244. package/dist/components/index.mjs +65 -0
  245. package/dist/components/index.mjs.map +1 -0
  246. package/dist/context/index.d.ts +2 -0
  247. package/dist/context/index.js +19 -0
  248. package/dist/context/index.js.map +1 -0
  249. package/dist/context/index.mjs +2 -0
  250. package/dist/context/index.mjs.map +1 -0
  251. package/dist/hooks/index.d.ts +1 -0
  252. package/dist/hooks/index.js +55 -0
  253. package/dist/hooks/index.js.map +1 -0
  254. package/dist/hooks/index.mjs +9 -0
  255. package/dist/hooks/index.mjs.map +1 -0
  256. package/dist/hooks/use-copilot-chat-suggestions.d.ts +83 -0
  257. package/dist/hooks/use-copilot-chat-suggestions.js +53 -0
  258. package/dist/hooks/use-copilot-chat-suggestions.js.map +1 -0
  259. package/dist/hooks/use-copilot-chat-suggestions.mjs +8 -0
  260. package/dist/hooks/use-copilot-chat-suggestions.mjs.map +1 -0
  261. package/dist/hooks/use-copy-to-clipboard.d.ts +9 -0
  262. package/dist/hooks/use-copy-to-clipboard.js +60 -0
  263. package/dist/hooks/use-copy-to-clipboard.js.map +1 -0
  264. package/dist/hooks/use-copy-to-clipboard.mjs +8 -0
  265. package/dist/hooks/use-copy-to-clipboard.mjs.map +1 -0
  266. package/dist/hooks/use-push-to-talk.d.ts +19 -0
  267. package/dist/hooks/use-push-to-talk.js +195 -0
  268. package/dist/hooks/use-push-to-talk.js.map +1 -0
  269. package/dist/hooks/use-push-to-talk.mjs +12 -0
  270. package/dist/hooks/use-push-to-talk.mjs.map +1 -0
  271. package/dist/index.css +751 -0
  272. package/dist/index.css.map +1 -0
  273. package/dist/index.d.ts +19 -0
  274. package/dist/index.js +2816 -0
  275. package/dist/index.js.map +1 -0
  276. package/dist/index.mjs +73 -0
  277. package/dist/index.mjs.map +1 -0
  278. package/dist/lib/utils.d.ts +4 -0
  279. package/dist/lib/utils.js +76 -0
  280. package/dist/lib/utils.js.map +1 -0
  281. package/dist/lib/utils.mjs +34 -0
  282. package/dist/lib/utils.mjs.map +1 -0
  283. package/dist/lib/utils.test.d.ts +2 -0
  284. package/dist/lib/utils.test.js +9 -0
  285. package/dist/lib/utils.test.js.map +1 -0
  286. package/dist/lib/utils.test.mjs +7 -0
  287. package/dist/lib/utils.test.mjs.map +1 -0
  288. package/dist/types/css.d.ts +16 -0
  289. package/dist/types/css.js +19 -0
  290. package/dist/types/css.js.map +1 -0
  291. package/dist/types/css.mjs +1 -0
  292. package/dist/types/css.mjs.map +1 -0
  293. package/dist/types/index.d.ts +2 -0
  294. package/dist/types/index.js +19 -0
  295. package/dist/types/index.js.map +1 -0
  296. package/dist/types/index.mjs +2 -0
  297. package/dist/types/index.mjs.map +1 -0
  298. package/dist/types/suggestions.d.ts +8 -0
  299. package/dist/types/suggestions.js +19 -0
  300. package/dist/types/suggestions.js.map +1 -0
  301. package/dist/types/suggestions.mjs +1 -0
  302. package/dist/types/suggestions.mjs.map +1 -0
  303. package/jest.config.js +5 -0
  304. package/package.json +78 -0
  305. package/postcss.config.js +60 -0
  306. package/src/components/chat/Button.tsx +18 -0
  307. package/src/components/chat/Chat.tsx +541 -0
  308. package/src/components/chat/ChatContext.tsx +188 -0
  309. package/src/components/chat/CodeBlock.tsx +408 -0
  310. package/src/components/chat/Header.tsx +15 -0
  311. package/src/components/chat/Icons.tsx +223 -0
  312. package/src/components/chat/Input.tsx +100 -0
  313. package/src/components/chat/Markdown.tsx +80 -0
  314. package/src/components/chat/Messages.tsx +188 -0
  315. package/src/components/chat/Modal.tsx +124 -0
  316. package/src/components/chat/Popup.tsx +57 -0
  317. package/src/components/chat/Response.tsx +12 -0
  318. package/src/components/chat/Sidebar.tsx +74 -0
  319. package/src/components/chat/Suggestion.tsx +125 -0
  320. package/src/components/chat/Textarea.tsx +61 -0
  321. package/src/components/chat/Window.tsx +153 -0
  322. package/src/components/chat/index.tsx +8 -0
  323. package/src/components/chat/messages/AssistantMessage.tsx +20 -0
  324. package/src/components/chat/messages/RenderActionExecutionMessage.tsx +122 -0
  325. package/src/components/chat/messages/RenderAgentStateMessage.tsx +112 -0
  326. package/src/components/chat/messages/RenderResultMessage.tsx +17 -0
  327. package/src/components/chat/messages/RenderTextMessage.tsx +29 -0
  328. package/src/components/chat/messages/UserMessage.tsx +5 -0
  329. package/src/components/chat/props.ts +92 -0
  330. package/src/components/dev-console/console.tsx +281 -0
  331. package/src/components/dev-console/icons.tsx +92 -0
  332. package/src/components/dev-console/index.tsx +2 -0
  333. package/src/components/dev-console/types.ts +7 -0
  334. package/src/components/dev-console/utils.ts +162 -0
  335. package/src/components/help-modal/icons.tsx +68 -0
  336. package/src/components/help-modal/index.tsx +1 -0
  337. package/src/components/help-modal/modal.tsx +164 -0
  338. package/src/components/index.ts +2 -0
  339. package/src/context/index.ts +1 -0
  340. package/src/css/animations.css +35 -0
  341. package/src/css/button.css +56 -0
  342. package/src/css/colors.css +12 -0
  343. package/src/css/console.css +134 -0
  344. package/src/css/header.css +43 -0
  345. package/src/css/input.css +89 -0
  346. package/src/css/markdown.css +136 -0
  347. package/src/css/messages.css +73 -0
  348. package/src/css/panel.css +38 -0
  349. package/src/css/popup.css +22 -0
  350. package/src/css/response.css +26 -0
  351. package/src/css/sidebar.css +34 -0
  352. package/src/css/suggestions.css +35 -0
  353. package/src/css/window.css +60 -0
  354. package/src/hooks/index.ts +1 -0
  355. package/src/hooks/use-copilot-chat-suggestions.tsx +112 -0
  356. package/src/hooks/use-copy-to-clipboard.tsx +29 -0
  357. package/src/hooks/use-push-to-talk.tsx +166 -0
  358. package/src/index.tsx +7 -0
  359. package/src/lib/utils.test.ts +7 -0
  360. package/src/lib/utils.ts +27 -0
  361. package/src/styles.css +14 -0
  362. package/src/types/css.ts +15 -0
  363. package/src/types/index.ts +1 -0
  364. package/src/types/suggestions.ts +6 -0
  365. package/tailwind.config.js +7 -0
  366. package/tsconfig.json +12 -0
  367. package/tsup.config.ts +16 -0
  368. package/typedoc.json +4 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/chat/messages/AssistantMessage.tsx","../../../../src/components/chat/ChatContext.tsx","../../../../src/components/chat/Icons.tsx","../../../../src/components/chat/Markdown.tsx","../../../../src/components/chat/CodeBlock.tsx","../../../../src/hooks/use-copy-to-clipboard.tsx"],"sourcesContent":["import { AssistantMessageProps } from \"../props\";\nimport { useChatContext } from \"../ChatContext\";\nimport { Markdown } from \"../Markdown\";\n\nexport const AssistantMessage = (props: AssistantMessageProps) => {\n const { icons } = useChatContext();\n const { message, isLoading, subComponent } = props;\n\n return (\n <>\n {(message || isLoading) && (\n <div className=\"copilotKitMessage copilotKitAssistantMessage\">\n {message && <Markdown content={message || \"\"} />}\n {isLoading && icons.spinnerIcon}\n </div>\n )}\n <div style={{ marginBottom: \"0.5rem\" }}>{subComponent}</div>\n </>\n );\n};\n","import React, { useMemo, useState } from \"react\";\nimport * as DefaultIcons from \"./Icons\";\n\n/**\n * Icons for CopilotChat component.\n */\nexport interface CopilotChatIcons {\n /**\n * The icon to use for the open chat button.\n * @default <OpenIcon />\n */\n openIcon?: React.ReactNode;\n\n /**\n * The icon to use for the close chat button.\n * @default <CloseIcon />\n */\n closeIcon?: React.ReactNode;\n\n /**\n * The icon to use for the close chat button in the header.\n * @default <HeaderCloseIcon />\n */\n headerCloseIcon?: React.ReactNode;\n\n /**\n * The icon to use for the send button.\n * @default <SendIcon />\n */\n sendIcon?: React.ReactNode;\n\n /**\n * The icon to use for the activity indicator.\n * @default <ActivityIcon />\n */\n activityIcon?: React.ReactNode;\n\n /**\n * The icon to use for the spinner.\n * @default <SpinnerIcon />\n */\n spinnerIcon?: React.ReactNode;\n\n /**\n * The icon to use for the stop button.\n * @default <StopIcon />\n */\n stopIcon?: React.ReactNode;\n\n /**\n * The icon to use for the regenerate button.\n * @default <RegenerateIcon />\n */\n regenerateIcon?: React.ReactNode;\n\n /**\n * The icons to use for push to talk.\n * @default <PushToTalkIcon />\n */\n\n pushToTalkIcon?: React.ReactNode;\n}\n\n/**\n * Labels for CopilotChat component.\n */\nexport interface CopilotChatLabels {\n /**\n * The initial message(s) to display in the chat window.\n */\n initial?: string | string[];\n\n /**\n * The title to display in the header.\n * @default \"CopilotKit\"\n */\n title?: string;\n\n /**\n * The placeholder to display in the input.\n * @default \"Type a message...\"\n */\n placeholder?: string;\n\n /**\n * The message to display when an error occurs.\n * @default \"❌ An error occurred. Please try again.\"\n */\n error?: string;\n\n /**\n * The label to display on the stop button.\n * @default \"Stop generating\"\n */\n stopGenerating?: string;\n\n /**\n * The label to display on the regenerate button.\n * @default \"Regenerate response\"\n */\n regenerateResponse?: string;\n}\n\ninterface ChatContext {\n labels: Required<CopilotChatLabels>;\n icons: Required<CopilotChatIcons>;\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\nexport const ChatContext = React.createContext<ChatContext | undefined>(undefined);\n\nexport function useChatContext(): ChatContext {\n const context = React.useContext(ChatContext);\n if (context === undefined) {\n throw new Error(\n \"Context not found. Did you forget to wrap your app in a <ChatContextProvider> component?\",\n );\n }\n return context;\n}\n\ninterface ChatContextProps {\n // temperature?: number;\n // instructions?: string;\n // maxFeedback?: number;\n labels?: CopilotChatLabels;\n icons?: CopilotChatIcons;\n children?: React.ReactNode;\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\nexport const ChatContextProvider = ({\n // temperature,\n // instructions,\n // maxFeedback,\n labels,\n icons,\n children,\n open,\n setOpen,\n}: ChatContextProps) => {\n const memoizedLabels = useMemo(\n () => ({\n ...{\n initial: \"\",\n title: \"CopilotKit\",\n placeholder: \"Type a message...\",\n error: \"❌ An error occurred. Please try again.\",\n stopGenerating: \"Stop generating\",\n regenerateResponse: \"Regenerate response\",\n },\n ...labels,\n }),\n [labels],\n );\n\n const memoizedIcons = useMemo(\n () => ({\n ...{\n openIcon: DefaultIcons.OpenIcon,\n closeIcon: DefaultIcons.CloseIcon,\n headerCloseIcon: DefaultIcons.HeaderCloseIcon,\n sendIcon: DefaultIcons.SendIcon,\n activityIcon: DefaultIcons.ActivityIcon,\n spinnerIcon: DefaultIcons.SpinnerIcon,\n stopIcon: DefaultIcons.StopIcon,\n regenerateIcon: DefaultIcons.RegenerateIcon,\n pushToTalkIcon: DefaultIcons.PushToTalkIcon,\n },\n ...icons,\n }),\n [icons],\n );\n\n const context = useMemo(\n () => ({\n labels: memoizedLabels,\n icons: memoizedIcons,\n open,\n setOpen,\n }),\n [memoizedLabels, memoizedIcons, open, setOpen],\n );\n\n return <ChatContext.Provider value={context}>{children}</ChatContext.Provider>;\n};\n","import React from \"react\";\n\nexport const OpenIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n width=\"24\"\n height=\"24\"\n >\n <g transform=\"translate(24, 0) scale(-1, 1)\">\n <path\n fillRule=\"evenodd\"\n d=\"M5.337 21.718a6.707 6.707 0 01-.533-.074.75.75 0 01-.44-1.223 3.73 3.73 0 00.814-1.686c.023-.115-.022-.317-.254-.543C3.274 16.587 2.25 14.41 2.25 12c0-5.03 4.428-9 9.75-9s9.75 3.97 9.75 9c0 5.03-4.428 9-9.75 9-.833 0-1.643-.097-2.417-.279a6.721 6.721 0 01-4.246.997z\"\n clipRule=\"evenodd\"\n />\n </g>\n </svg>\n);\n\nexport const CloseIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n width=\"24\"\n height=\"24\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M19.5 8.25l-7.5 7.5-7.5-7.5\" />\n </svg>\n);\n\nexport const HeaderCloseIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n width=\"24\"\n height=\"24\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n);\n\nexport const SendIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth={1.5}\n stroke=\"currentColor\"\n width=\"24\"\n height=\"24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5\"\n />\n </svg>\n);\n\nexport const SpinnerIcon = (\n <svg\n style={{\n animation: \"copilotKitSpinAnimation 1s linear infinite\",\n color: \"rgb(107 114 128)\",\n }}\n width=\"24\"\n height=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n style={{ opacity: 0.25 }}\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n ></circle>\n <path\n style={{ opacity: 0.75 }}\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n);\n\nexport const SmallSpinnerIcon = (\n <svg\n style={{\n animation: \"copilotKitSpinAnimation 1s linear infinite\",\n }}\n width=\"13\"\n height=\"13\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n style={{ opacity: 0.25 }}\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n ></circle>\n <path\n style={{ opacity: 0.75 }}\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n);\n\nexport const ActivityIcon = (\n <svg\n style={{\n display: \"inline-block\",\n marginLeft: \"0.25rem\",\n marginRight: \"0.25rem\",\n }}\n height=\"24\"\n width=\"24\"\n viewBox=\"0 0 27 27\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n >\n <circle className=\"copilotKitActivityDot1\" cx=\"4\" cy=\"12\" r=\"3\" />\n <circle className=\"copilotKitActivityDot1 copilotKitActivityDot2\" cx=\"12\" cy=\"12\" r=\"3\" />\n <circle className=\"copilotKitActivityDot1 copilotKitActivityDot3\" cx=\"20\" cy=\"12\" r=\"3\" />\n </svg>\n);\n\nexport function CheckIcon({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n style={{ height: \"1rem\", width: \"1rem\" }}\n className={className}\n {...props}\n >\n <path d=\"m229.66 77.66-128 128a8 8 0 0 1-11.32 0l-56-56a8 8 0 0 1 11.32-11.32L96 188.69 218.34 66.34a8 8 0 0 1 11.32 11.32Z\" />\n </svg>\n );\n}\n\nexport function DownloadIcon({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n style={{ height: \"1rem\", width: \"1rem\" }}\n className={className}\n {...props}\n >\n <path d=\"M224 152v56a16 16 0 0 1-16 16H48a16 16 0 0 1-16-16v-56a8 8 0 0 1 16 0v56h160v-56a8 8 0 0 1 16 0Zm-101.66 5.66a8 8 0 0 0 11.32 0l40-40a8 8 0 0 0-11.32-11.32L136 132.69V40a8 8 0 0 0-16 0v92.69l-26.34-26.35a8 8 0 0 0-11.32 11.32Z\" />\n </svg>\n );\n}\n\nexport function CopyIcon({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n style={{ height: \"1rem\", width: \"1rem\" }}\n className={className}\n {...props}\n >\n <path d=\"M216 32H88a8 8 0 0 0-8 8v40H40a8 8 0 0 0-8 8v128a8 8 0 0 0 8 8h128a8 8 0 0 0 8-8v-40h40a8 8 0 0 0 8-8V40a8 8 0 0 0-8-8Zm-56 176H48V96h112Zm48-48h-32V88a8 8 0 0 0-8-8H96V48h112Z\" />\n </svg>\n );\n}\n\nexport const StopIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n style={{ height: \"1rem\", width: \"1rem\" }}\n >\n <path d=\"M128 24a104 104 0 1 0 104 104A104.11 104.11 0 0 0 128 24Zm0 192a88 88 0 1 1 88-88 88.1 88.1 0 0 1-88 88Zm24-120h-48a8 8 0 0 0-8 8v48a8 8 0 0 0 8 8h48a8 8 0 0 0 8-8v-48a8 8 0 0 0-8-8Zm-8 48h-32v-32h32Z\" />\n </svg>\n);\n\nexport const RegenerateIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n style={{ height: \"1rem\", width: \"1rem\" }}\n >\n <path d=\"M197.67 186.37a8 8 0 0 1 0 11.29C196.58 198.73 170.82 224 128 224c-37.39 0-64.53-22.4-80-39.85V208a8 8 0 0 1-16 0v-48a8 8 0 0 1 8-8h48a8 8 0 0 1 0 16H55.44C67.76 183.35 93 208 128 208c36 0 58.14-21.46 58.36-21.68a8 8 0 0 1 11.31.05ZM216 40a8 8 0 0 0-8 8v23.85C192.53 54.4 165.39 32 128 32c-42.82 0-68.58 25.27-69.66 26.34a8 8 0 0 0 11.3 11.34C69.86 69.46 92 48 128 48c35 0 60.24 24.65 72.56 40H168a8 8 0 0 0 0 16h48a8 8 0 0 0 8-8V48a8 8 0 0 0-8-8Z\" />\n </svg>\n);\n\nexport const PushToTalkIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth={1.5}\n stroke=\"currentColor\"\n className=\"w-6 h-6\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M12 18.75a6 6 0 0 0 6-6v-1.5m-6 7.5a6 6 0 0 1-6-6v-1.5m6 7.5v3.75m-3.75 0h7.5M12 15.75a3 3 0 0 1-3-3V4.5a3 3 0 1 1 6 0v8.25a3 3 0 0 1-3 3Z\"\n />\n </svg>\n);\n","import { FC, memo } from \"react\";\nimport ReactMarkdown, { Options, Components } from \"react-markdown\";\nimport { CodeBlock } from \"./CodeBlock\";\nimport remarkGfm from \"remark-gfm\";\nimport remarkMath from \"remark-math\";\n\nconst MemoizedReactMarkdown: FC<Options> = memo(\n ReactMarkdown,\n (prevProps, nextProps) =>\n prevProps.children === nextProps.children && prevProps.className === nextProps.className,\n);\n\ntype MarkdownProps = {\n content: string;\n};\n\nexport const Markdown = ({ content }: MarkdownProps) => {\n return (\n <div className=\"copilotKitMarkdown\">\n <MemoizedReactMarkdown components={components} remarkPlugins={[remarkGfm, remarkMath]}>\n {content}\n </MemoizedReactMarkdown>\n </div>\n );\n};\n\nconst components: Components = {\n p({ children }) {\n return <p>{children}</p>;\n },\n a({ children, ...props }) {\n return (\n <a\n style={{ color: \"blue\", textDecoration: \"underline\" }}\n {...props}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {children}\n </a>\n );\n },\n code({ children, className, inline, ...props }) {\n if (children.length) {\n if (children[0] == \"▍\") {\n return (\n <span\n style={{\n animation: \"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite\",\n marginTop: \"0.25rem\",\n }}\n >\n ▍\n </span>\n );\n }\n\n children[0] = (children[0] as string).replace(\"`▍`\", \"▍\");\n }\n\n const match = /language-(\\w+)/.exec(className || \"\");\n\n if (inline) {\n return (\n <code className={className} {...props}>\n {children}\n </code>\n );\n }\n\n return (\n <CodeBlock\n key={Math.random()}\n language={(match && match[1]) || \"\"}\n value={String(children).replace(/\\n$/, \"\")}\n {...props}\n />\n );\n },\n};\n","import { FC, memo } from \"react\";\nimport { Prism as SyntaxHighlighter } from \"react-syntax-highlighter\";\nimport { useCopyToClipboard } from \"../../hooks/use-copy-to-clipboard\";\nimport { CheckIcon, CopyIcon, DownloadIcon } from \"./Icons\";\n\ninterface CodeActionButtonProps {\n onClick: () => void;\n children: React.ReactNode;\n}\n\ninterface Props {\n language: string;\n value: string;\n}\n\ninterface languageMap {\n [key: string]: string | undefined;\n}\n\nexport const programmingLanguages: languageMap = {\n javascript: \".js\",\n python: \".py\",\n java: \".java\",\n c: \".c\",\n cpp: \".cpp\",\n \"c++\": \".cpp\",\n \"c#\": \".cs\",\n ruby: \".rb\",\n php: \".php\",\n swift: \".swift\",\n \"objective-c\": \".m\",\n kotlin: \".kt\",\n typescript: \".ts\",\n go: \".go\",\n perl: \".pl\",\n rust: \".rs\",\n scala: \".scala\",\n haskell: \".hs\",\n lua: \".lua\",\n shell: \".sh\",\n sql: \".sql\",\n html: \".html\",\n css: \".css\",\n // add more file extensions here, make sure the key is same as language prop in CodeBlock.tsx component\n};\n\nexport const generateRandomString = (length: number, lowercase = false) => {\n const chars = \"ABCDEFGHJKLMNPQRSTUVWXY3456789\"; // excluding similar looking characters like Z, 2, I, 1, O, 0\n let result = \"\";\n for (let i = 0; i < length; i++) {\n result += chars.charAt(Math.floor(Math.random() * chars.length));\n }\n return lowercase ? result.toLowerCase() : result;\n};\n\nconst CodeBlock: FC<Props> = memo(({ language, value }) => {\n const { isCopied, copyToClipboard } = useCopyToClipboard({ timeout: 2000 });\n\n const downloadAsFile = () => {\n if (typeof window === \"undefined\") {\n return;\n }\n const fileExtension = programmingLanguages[language] || \".file\";\n const suggestedFileName = `file-${generateRandomString(3, true)}${fileExtension}`;\n const fileName = window.prompt(\"Enter file name\" || \"\", suggestedFileName);\n\n if (!fileName) {\n // User pressed cancel on prompt.\n return;\n }\n\n const blob = new Blob([value], { type: \"text/plain\" });\n const url = URL.createObjectURL(blob);\n const link = document.createElement(\"a\");\n link.download = fileName;\n link.href = url;\n link.style.display = \"none\";\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n URL.revokeObjectURL(url);\n };\n\n const onCopy = () => {\n if (isCopied) return;\n copyToClipboard(value);\n };\n\n return (\n <div className=\"copilotKitCodeBlock\">\n <div className=\"copilotKitCodeBlockToolbar\">\n <span className=\"copilotKitCodeBlockToolbarLanguage\">{language}</span>\n <div className=\"copilotKitCodeBlockToolbarButtons\">\n <button className=\"copilotKitCodeBlockToolbarButton\" onClick={downloadAsFile}>\n <DownloadIcon />\n <span className=\"sr-only\">Download</span>\n </button>\n <button className=\"copilotKitCodeBlockToolbarButton\" onClick={onCopy}>\n {isCopied ? <CheckIcon /> : <CopyIcon />}\n <span className=\"sr-only\">Copy code</span>\n </button>\n </div>\n </div>\n <SyntaxHighlighter\n language={language}\n style={highlightStyle}\n PreTag=\"div\"\n customStyle={{\n margin: 0,\n borderBottomLeftRadius: \"0.375rem\",\n borderBottomRightRadius: \"0.375rem\",\n }}\n >\n {value}\n </SyntaxHighlighter>\n </div>\n );\n});\nCodeBlock.displayName = \"CodeBlock\";\n\nexport { CodeBlock };\n\n// import { vscDarkPlus as highlightStyle } from \"react-syntax-highlighter/dist/esm/styles/prism\";\n// As a workaround, we inline the vscDarkPlus from react-syntax-highlighter.\n// Importing it as recommended in the documentation leads to build errors in the non app router\n// (Next.js classic) setup.\nconst highlightStyle: any = {\n 'pre[class*=\"language-\"]': {\n color: \"#d4d4d4\",\n fontSize: \"13px\",\n textShadow: \"none\",\n fontFamily: 'Menlo, Monaco, Consolas, \"Andale Mono\", \"Ubuntu Mono\", \"Courier New\", monospace',\n direction: \"ltr\",\n textAlign: \"left\",\n whiteSpace: \"pre\",\n wordSpacing: \"normal\",\n wordBreak: \"normal\",\n lineHeight: \"1.5\",\n MozTabSize: \"4\",\n OTabSize: \"4\",\n tabSize: \"4\",\n WebkitHyphens: \"none\",\n MozHyphens: \"none\",\n msHyphens: \"none\",\n hyphens: \"none\",\n padding: \"1em\",\n margin: \".5em 0\",\n overflow: \"auto\",\n background: \"#1e1e1e\",\n },\n 'code[class*=\"language-\"]': {\n color: \"#d4d4d4\",\n fontSize: \"13px\",\n textShadow: \"none\",\n fontFamily: 'Menlo, Monaco, Consolas, \"Andale Mono\", \"Ubuntu Mono\", \"Courier New\", monospace',\n direction: \"ltr\",\n textAlign: \"left\",\n whiteSpace: \"pre\",\n wordSpacing: \"normal\",\n wordBreak: \"normal\",\n lineHeight: \"1.5\",\n MozTabSize: \"4\",\n OTabSize: \"4\",\n tabSize: \"4\",\n WebkitHyphens: \"none\",\n MozHyphens: \"none\",\n msHyphens: \"none\",\n hyphens: \"none\",\n },\n 'pre[class*=\"language-\"]::selection': {\n textShadow: \"none\",\n background: \"#264F78\",\n },\n 'code[class*=\"language-\"]::selection': {\n textShadow: \"none\",\n background: \"#264F78\",\n },\n 'pre[class*=\"language-\"] *::selection': {\n textShadow: \"none\",\n background: \"#264F78\",\n },\n 'code[class*=\"language-\"] *::selection': {\n textShadow: \"none\",\n background: \"#264F78\",\n },\n ':not(pre) > code[class*=\"language-\"]': {\n padding: \".1em .3em\",\n borderRadius: \".3em\",\n color: \"#db4c69\",\n background: \"#1e1e1e\",\n },\n \".namespace\": {\n Opacity: \".7\",\n },\n \"doctype.doctype-tag\": {\n color: \"#569CD6\",\n },\n \"doctype.name\": {\n color: \"#9cdcfe\",\n },\n comment: {\n color: \"#6a9955\",\n },\n prolog: {\n color: \"#6a9955\",\n },\n punctuation: {\n color: \"#d4d4d4\",\n },\n \".language-html .language-css .token.punctuation\": {\n color: \"#d4d4d4\",\n },\n \".language-html .language-javascript .token.punctuation\": {\n color: \"#d4d4d4\",\n },\n property: {\n color: \"#9cdcfe\",\n },\n tag: {\n color: \"#569cd6\",\n },\n boolean: {\n color: \"#569cd6\",\n },\n number: {\n color: \"#b5cea8\",\n },\n constant: {\n color: \"#9cdcfe\",\n },\n symbol: {\n color: \"#b5cea8\",\n },\n inserted: {\n color: \"#b5cea8\",\n },\n unit: {\n color: \"#b5cea8\",\n },\n selector: {\n color: \"#d7ba7d\",\n },\n \"attr-name\": {\n color: \"#9cdcfe\",\n },\n string: {\n color: \"#ce9178\",\n },\n char: {\n color: \"#ce9178\",\n },\n builtin: {\n color: \"#ce9178\",\n },\n deleted: {\n color: \"#ce9178\",\n },\n \".language-css .token.string.url\": {\n textDecoration: \"underline\",\n },\n operator: {\n color: \"#d4d4d4\",\n },\n entity: {\n color: \"#569cd6\",\n },\n \"operator.arrow\": {\n color: \"#569CD6\",\n },\n atrule: {\n color: \"#ce9178\",\n },\n \"atrule.rule\": {\n color: \"#c586c0\",\n },\n \"atrule.url\": {\n color: \"#9cdcfe\",\n },\n \"atrule.url.function\": {\n color: \"#dcdcaa\",\n },\n \"atrule.url.punctuation\": {\n color: \"#d4d4d4\",\n },\n keyword: {\n color: \"#569CD6\",\n },\n \"keyword.module\": {\n color: \"#c586c0\",\n },\n \"keyword.control-flow\": {\n color: \"#c586c0\",\n },\n function: {\n color: \"#dcdcaa\",\n },\n \"function.maybe-class-name\": {\n color: \"#dcdcaa\",\n },\n regex: {\n color: \"#d16969\",\n },\n important: {\n color: \"#569cd6\",\n },\n italic: {\n fontStyle: \"italic\",\n },\n \"class-name\": {\n color: \"#4ec9b0\",\n },\n \"maybe-class-name\": {\n color: \"#4ec9b0\",\n },\n console: {\n color: \"#9cdcfe\",\n },\n parameter: {\n color: \"#9cdcfe\",\n },\n interpolation: {\n color: \"#9cdcfe\",\n },\n \"punctuation.interpolation-punctuation\": {\n color: \"#569cd6\",\n },\n variable: {\n color: \"#9cdcfe\",\n },\n \"imports.maybe-class-name\": {\n color: \"#9cdcfe\",\n },\n \"exports.maybe-class-name\": {\n color: \"#9cdcfe\",\n },\n escape: {\n color: \"#d7ba7d\",\n },\n \"tag.punctuation\": {\n color: \"#808080\",\n },\n cdata: {\n color: \"#808080\",\n },\n \"attr-value\": {\n color: \"#ce9178\",\n },\n \"attr-value.punctuation\": {\n color: \"#ce9178\",\n },\n \"attr-value.punctuation.attr-equals\": {\n color: \"#d4d4d4\",\n },\n namespace: {\n color: \"#4ec9b0\",\n },\n 'pre[class*=\"language-javascript\"]': {\n color: \"#9cdcfe\",\n },\n 'code[class*=\"language-javascript\"]': {\n color: \"#9cdcfe\",\n },\n 'pre[class*=\"language-jsx\"]': {\n color: \"#9cdcfe\",\n },\n 'code[class*=\"language-jsx\"]': {\n color: \"#9cdcfe\",\n },\n 'pre[class*=\"language-typescript\"]': {\n color: \"#9cdcfe\",\n },\n 'code[class*=\"language-typescript\"]': {\n color: \"#9cdcfe\",\n },\n 'pre[class*=\"language-tsx\"]': {\n color: \"#9cdcfe\",\n },\n 'code[class*=\"language-tsx\"]': {\n color: \"#9cdcfe\",\n },\n 'pre[class*=\"language-css\"]': {\n color: \"#ce9178\",\n },\n 'code[class*=\"language-css\"]': {\n color: \"#ce9178\",\n },\n 'pre[class*=\"language-html\"]': {\n color: \"#d4d4d4\",\n },\n 'code[class*=\"language-html\"]': {\n color: \"#d4d4d4\",\n },\n \".language-regex .token.anchor\": {\n color: \"#dcdcaa\",\n },\n \".language-html .token.punctuation\": {\n color: \"#808080\",\n },\n 'pre[class*=\"language-\"] > code[class*=\"language-\"]': {\n position: \"relative\",\n zIndex: \"1\",\n },\n \".line-highlight.line-highlight\": {\n background: \"#f7ebc6\",\n boxShadow: \"inset 5px 0 0 #f7d87c\",\n zIndex: \"0\",\n },\n};\n","import * as React from \"react\";\n\nexport interface useCopyToClipboardProps {\n timeout?: number;\n}\n\nexport function useCopyToClipboard({ timeout = 2000 }: useCopyToClipboardProps) {\n const [isCopied, setIsCopied] = React.useState<Boolean>(false);\n\n const copyToClipboard = (value: string) => {\n if (typeof window === \"undefined\" || !navigator.clipboard?.writeText) {\n return;\n }\n\n if (!value) {\n return;\n }\n\n navigator.clipboard.writeText(value).then(() => {\n setIsCopied(true);\n\n setTimeout(() => {\n setIsCopied(false);\n }, timeout);\n });\n };\n\n return { isCopied, copyToClipboard };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAyC;;;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IAAI,eAAe;AACjC,QAAM,EAAE,SAAS,WAAW,aAAa,IAAI;AAE7C,SACE,8EACI;AAAA,gBAAW,cACX,8CAAC,SAAI,WAAU,gDACZ;AAAA,iBAAW,6CAAC,YAAS,SAAS,WAAW,IAAI;AAAA,MAC7C,aAAa,MAAM;AAAA,OACtB;AAAA,IAEF,6CAAC,SAAI,OAAO,EAAE,cAAc,SAAS,GAAI,wBAAa;AAAA,KACxD;AAEJ;","names":["import_jsx_runtime","React","import_react","import_react","React","import_jsx_runtime","SyntaxHighlighter","import_jsx_runtime","ReactMarkdown","remarkGfm","remarkMath","import_jsx_runtime"]}
@@ -0,0 +1,13 @@
1
+ import {
2
+ AssistantMessage
3
+ } from "../../../chunk-3VNMQWGT.mjs";
4
+ import "../../../chunk-YQ3D5IQV.mjs";
5
+ import "../../../chunk-CBBFRI3Q.mjs";
6
+ import "../../../chunk-UPTB2MVO.mjs";
7
+ import "../../../chunk-FZC7X5PK.mjs";
8
+ import "../../../chunk-54JAUBUJ.mjs";
9
+ import "../../../chunk-MRXNTQOX.mjs";
10
+ export {
11
+ AssistantMessage
12
+ };
13
+ //# sourceMappingURL=AssistantMessage.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,7 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { RenderMessageProps } from '../props.js';
3
+ import '@copilotkit/runtime-client-gql';
4
+
5
+ declare function RenderActionExecutionMessage(props: RenderMessageProps): react_jsx_runtime.JSX.Element | null | undefined;
6
+
7
+ export { RenderActionExecutionMessage };
@@ -0,0 +1,136 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/components/chat/messages/RenderActionExecutionMessage.tsx
21
+ var RenderActionExecutionMessage_exports = {};
22
+ __export(RenderActionExecutionMessage_exports, {
23
+ RenderActionExecutionMessage: () => RenderActionExecutionMessage
24
+ });
25
+ module.exports = __toCommonJS(RenderActionExecutionMessage_exports);
26
+ var import_runtime_client_gql = require("@copilotkit/runtime-client-gql");
27
+ var import_react_core = require("@copilotkit/react-core");
28
+ var import_jsx_runtime = require("react/jsx-runtime");
29
+ function RenderActionExecutionMessage(props) {
30
+ const { chatComponentsCache } = (0, import_react_core.useCopilotContext)();
31
+ const { message, inProgress, index, isCurrentMessage, actionResult, AssistantMessage } = props;
32
+ if (message.isActionExecutionMessage()) {
33
+ if (chatComponentsCache.current !== null && (chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"])) {
34
+ const render = chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"];
35
+ if (typeof render === "string") {
36
+ if (isCurrentMessage && inProgress) {
37
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
38
+ AssistantMessage,
39
+ {
40
+ rawData: message,
41
+ "data-message-role": "assistant",
42
+ isLoading: false,
43
+ isGenerating: true,
44
+ message: render
45
+ },
46
+ index
47
+ );
48
+ } else {
49
+ return null;
50
+ }
51
+ } else {
52
+ const args = message.arguments;
53
+ let status = "inProgress";
54
+ if (actionResult !== void 0) {
55
+ status = "complete";
56
+ } else if (message.status.code !== import_runtime_client_gql.MessageStatusCode.Pending) {
57
+ status = "executing";
58
+ }
59
+ try {
60
+ const toRender = render({
61
+ status,
62
+ args,
63
+ result: actionResult,
64
+ name: message.name
65
+ });
66
+ if (!toRender && status === "complete") {
67
+ return null;
68
+ }
69
+ if (typeof toRender === "string") {
70
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
71
+ AssistantMessage,
72
+ {
73
+ rawData: message,
74
+ "data-message-role": "assistant",
75
+ isLoading: false,
76
+ isGenerating: false,
77
+ message: toRender
78
+ },
79
+ index
80
+ );
81
+ } else {
82
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
83
+ AssistantMessage,
84
+ {
85
+ rawData: message,
86
+ "data-message-role": "action-render",
87
+ isLoading: false,
88
+ isGenerating: false,
89
+ subComponent: toRender
90
+ },
91
+ index
92
+ );
93
+ }
94
+ } catch (e) {
95
+ console.error(`Error executing render function for action ${message.name}: ${e}`);
96
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
97
+ AssistantMessage,
98
+ {
99
+ rawData: message,
100
+ "data-message-role": "assistant",
101
+ isLoading: false,
102
+ isGenerating: false,
103
+ subComponent: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
104
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("b", { children: [
105
+ "\u274C Error executing render: ",
106
+ message.name
107
+ ] }),
108
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {}),
109
+ e instanceof Error ? e.message : String(e)
110
+ ] })
111
+ },
112
+ index
113
+ );
114
+ }
115
+ }
116
+ } else if (!inProgress || !isCurrentMessage) {
117
+ return null;
118
+ } else {
119
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
120
+ AssistantMessage,
121
+ {
122
+ rawData: message,
123
+ "data-message-role": "assistant",
124
+ isLoading: true,
125
+ isGenerating: true
126
+ },
127
+ index
128
+ );
129
+ }
130
+ }
131
+ }
132
+ // Annotate the CommonJS export names for ESM import in node:
133
+ 0 && (module.exports = {
134
+ RenderActionExecutionMessage
135
+ });
136
+ //# sourceMappingURL=RenderActionExecutionMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/chat/messages/RenderActionExecutionMessage.tsx"],"sourcesContent":["import { MessageStatusCode } from \"@copilotkit/runtime-client-gql\";\nimport { RenderMessageProps } from \"../props\";\nimport { RenderFunctionStatus, useCopilotContext } from \"@copilotkit/react-core\";\n\nexport function RenderActionExecutionMessage(props: RenderMessageProps) {\n const { chatComponentsCache } = useCopilotContext();\n const { message, inProgress, index, isCurrentMessage, actionResult, AssistantMessage } = props;\n\n if (message.isActionExecutionMessage()) {\n if (\n chatComponentsCache.current !== null &&\n (chatComponentsCache.current.actions[message.name] ||\n chatComponentsCache.current.actions[\"*\"])\n ) {\n const render =\n chatComponentsCache.current.actions[message.name] ||\n chatComponentsCache.current.actions[\"*\"];\n // render a static string\n if (typeof render === \"string\") {\n // when render is static, we show it only when in progress\n if (isCurrentMessage && inProgress) {\n return (\n <AssistantMessage\n rawData={message}\n key={index}\n data-message-role=\"assistant\"\n isLoading={false}\n isGenerating={true}\n message={render}\n />\n );\n }\n // Done - silent by default to avoid a series of \"done\" messages\n else {\n return null;\n }\n }\n // render is a function\n else {\n const args = message.arguments;\n\n let status: RenderFunctionStatus = \"inProgress\";\n\n if (actionResult !== undefined) {\n status = \"complete\";\n } else if (message.status.code !== MessageStatusCode.Pending) {\n status = \"executing\";\n }\n\n try {\n const toRender = render({\n status: status as any,\n args,\n result: actionResult,\n name: message.name,\n });\n // No result and complete: stay silent\n if (!toRender && status === \"complete\") {\n return null;\n }\n if (typeof toRender === \"string\") {\n return (\n <AssistantMessage\n rawData={message}\n data-message-role=\"assistant\"\n key={index}\n isLoading={false}\n isGenerating={false}\n message={toRender}\n />\n );\n } else {\n return (\n <AssistantMessage\n rawData={message}\n data-message-role=\"action-render\"\n key={index}\n isLoading={false}\n isGenerating={false}\n subComponent={toRender}\n />\n );\n }\n } catch (e) {\n console.error(`Error executing render function for action ${message.name}: ${e}`);\n return (\n <AssistantMessage\n rawData={message}\n data-message-role=\"assistant\"\n key={index}\n isLoading={false}\n isGenerating={false}\n subComponent={\n <div>\n <b>❌ Error executing render: {message.name}</b>\n <br />\n {e instanceof Error ? e.message : String(e)}\n </div>\n }\n />\n );\n }\n }\n }\n // No render function found- show the default message\n else if (!inProgress || !isCurrentMessage) {\n // Done - silent by default to avoid a series of \"done\" messages\n return null;\n } else {\n // In progress\n return (\n <AssistantMessage\n rawData={message}\n key={index}\n data-message-role=\"assistant\"\n isLoading={true}\n isGenerating={true}\n />\n );\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gCAAkC;AAElC,wBAAwD;AAoB5C;AAlBL,SAAS,6BAA6B,OAA2B;AACtE,QAAM,EAAE,oBAAoB,QAAI,qCAAkB;AAClD,QAAM,EAAE,SAAS,YAAY,OAAO,kBAAkB,cAAc,iBAAiB,IAAI;AAEzF,MAAI,QAAQ,yBAAyB,GAAG;AACtC,QACE,oBAAoB,YAAY,SAC/B,oBAAoB,QAAQ,QAAQ,QAAQ,IAAI,KAC/C,oBAAoB,QAAQ,QAAQ,GAAG,IACzC;AACA,YAAM,SACJ,oBAAoB,QAAQ,QAAQ,QAAQ,IAAI,KAChD,oBAAoB,QAAQ,QAAQ,GAAG;AAEzC,UAAI,OAAO,WAAW,UAAU;AAE9B,YAAI,oBAAoB,YAAY;AAClC,iBACE;AAAA,YAAC;AAAA;AAAA,cACC,SAAS;AAAA,cAET,qBAAkB;AAAA,cAClB,WAAW;AAAA,cACX,cAAc;AAAA,cACd,SAAS;AAAA;AAAA,YAJJ;AAAA,UAKP;AAAA,QAEJ,OAEK;AACH,iBAAO;AAAA,QACT;AAAA,MACF,OAEK;AACH,cAAM,OAAO,QAAQ;AAErB,YAAI,SAA+B;AAEnC,YAAI,iBAAiB,QAAW;AAC9B,mBAAS;AAAA,QACX,WAAW,QAAQ,OAAO,SAAS,4CAAkB,SAAS;AAC5D,mBAAS;A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RenderActionExecutionMessage
3
+ } from "../../../chunk-P5A3A5FO.mjs";
4
+ import "../../../chunk-MRXNTQOX.mjs";
5
+ export {
6
+ RenderActionExecutionMessage
7
+ };
8
+ //# sourceMappingURL=RenderActionExecutionMessage.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,7 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { RenderMessageProps } from '../props.js';
3
+ import '@copilotkit/runtime-client-gql';
4
+
5
+ declare function RenderAgentStateMessage(props: RenderMessageProps): react_jsx_runtime.JSX.Element | null | undefined;
6
+
7
+ export { RenderAgentStateMessage };
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/components/chat/messages/RenderAgentStateMessage.tsx
21
+ var RenderAgentStateMessage_exports = {};
22
+ __export(RenderAgentStateMessage_exports, {
23
+ RenderAgentStateMessage: () => RenderAgentStateMessage
24
+ });
25
+ module.exports = __toCommonJS(RenderAgentStateMessage_exports);
26
+ var import_react_core = require("@copilotkit/react-core");
27
+ var import_jsx_runtime = require("react/jsx-runtime");
28
+ function RenderAgentStateMessage(props) {
29
+ const { chatComponentsCache } = (0, import_react_core.useCopilotContext)();
30
+ const { message, inProgress, index, isCurrentMessage, AssistantMessage } = props;
31
+ if (message.isAgentStateMessage()) {
32
+ let render;
33
+ if (chatComponentsCache.current !== null) {
34
+ render = chatComponentsCache.current.coAgentStateRenders[`${message.agentName}-${message.nodeName}`] || chatComponentsCache.current.coAgentStateRenders[`${message.agentName}-global`];
35
+ }
36
+ if (render) {
37
+ if (typeof render === "string") {
38
+ if (isCurrentMessage && inProgress) {
39
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
40
+ AssistantMessage,
41
+ {
42
+ rawData: message,
43
+ message: render,
44
+ "data-message-role": "assistant",
45
+ isLoading: true,
46
+ isGenerating: true
47
+ },
48
+ index
49
+ );
50
+ } else {
51
+ return null;
52
+ }
53
+ } else {
54
+ const state = message.state;
55
+ let status = message.active ? "inProgress" : "complete";
56
+ const toRender = render({
57
+ status,
58
+ state,
59
+ nodeName: message.nodeName
60
+ });
61
+ if (!toRender && status === "complete") {
62
+ return null;
63
+ }
64
+ if (!toRender && isCurrentMessage && inProgress) {
65
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
66
+ AssistantMessage,
67
+ {
68
+ "data-message-role": "assistant",
69
+ rawData: message,
70
+ isLoading: true,
71
+ isGenerating: true
72
+ },
73
+ index
74
+ );
75
+ } else if (!toRender) {
76
+ return null;
77
+ }
78
+ if (typeof toRender === "string") {
79
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
80
+ AssistantMessage,
81
+ {
82
+ rawData: message,
83
+ message: toRender,
84
+ isLoading: true,
85
+ isGenerating: true,
86
+ "data-message-role": "assistant"
87
+ },
88
+ index
89
+ );
90
+ } else {
91
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
92
+ AssistantMessage,
93
+ {
94
+ rawData: message,
95
+ "data-message-role": "agent-state-render",
96
+ isLoading: false,
97
+ isGenerating: false,
98
+ subComponent: toRender
99
+ },
100
+ index
101
+ );
102
+ }
103
+ }
104
+ } else if (!inProgress || !isCurrentMessage) {
105
+ return null;
106
+ } else {
107
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
108
+ AssistantMessage,
109
+ {
110
+ rawData: message,
111
+ isLoading: true,
112
+ isGenerating: true,
113
+ "data-message-role": "assistant"
114
+ },
115
+ index
116
+ );
117
+ }
118
+ }
119
+ }
120
+ // Annotate the CommonJS export names for ESM import in node:
121
+ 0 && (module.exports = {
122
+ RenderAgentStateMessage
123
+ });
124
+ //# sourceMappingURL=RenderAgentStateMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/chat/messages/RenderAgentStateMessage.tsx"],"sourcesContent":["import { RenderMessageProps } from \"../props\";\nimport { CoagentInChatRenderFunction, useCopilotContext } from \"@copilotkit/react-core\";\n\nexport function RenderAgentStateMessage(props: RenderMessageProps) {\n const { chatComponentsCache } = useCopilotContext();\n const { message, inProgress, index, isCurrentMessage, AssistantMessage } = props;\n\n if (message.isAgentStateMessage()) {\n let render: string | CoagentInChatRenderFunction | undefined;\n\n if (chatComponentsCache.current !== null) {\n render =\n chatComponentsCache.current.coAgentStateRenders[\n `${message.agentName}-${message.nodeName}`\n ] || chatComponentsCache.current.coAgentStateRenders[`${message.agentName}-global`];\n }\n\n if (render) {\n // render a static string\n if (typeof render === \"string\") {\n // when render is static, we show it only when in progress\n if (isCurrentMessage && inProgress) {\n return (\n <AssistantMessage\n rawData={message}\n message={render}\n data-message-role=\"assistant\"\n key={index}\n isLoading={true}\n isGenerating={true}\n />\n );\n }\n // Done - silent by default to avoid a series of \"done\" messages\n else {\n return null;\n }\n }\n // render is a function\n else {\n const state = message.state;\n\n let status = message.active ? \"inProgress\" : \"complete\";\n\n const toRender = render({\n status: status as any,\n state,\n nodeName: message.nodeName,\n });\n\n // No result and complete: stay silent\n if (!toRender && status === \"complete\") {\n return null;\n }\n\n if (!toRender && isCurrentMessage && inProgress) {\n return (\n <AssistantMessage\n data-message-role=\"assistant\"\n key={index}\n rawData={message}\n isLoading={true}\n isGenerating={true}\n />\n );\n } else if (!toRender) {\n return null;\n }\n\n if (typeof toRender === \"string\") {\n return (\n <AssistantMessage\n rawData={message}\n message={toRender}\n isLoading={true}\n isGenerating={true}\n data-message-role=\"assistant\"\n key={index}\n />\n );\n } else {\n return (\n <AssistantMessage\n rawData={message}\n data-message-role=\"agent-state-render\"\n key={index}\n isLoading={false}\n isGenerating={false}\n subComponent={toRender}\n />\n );\n }\n }\n }\n // No render function found- show the default message\n else if (!inProgress || !isCurrentMessage) {\n // Done - silent by default to avoid a series of \"done\" messages\n return null;\n } else {\n // In progress\n return (\n <AssistantMessage\n rawData={message}\n isLoading={true}\n isGenerating={true}\n data-message-role=\"assistant\"\n key={index}\n />\n );\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAA+D;AAsBnD;AApBL,SAAS,wBAAwB,OAA2B;AACjE,QAAM,EAAE,oBAAoB,QAAI,qCAAkB;AAClD,QAAM,EAAE,SAAS,YAAY,OAAO,kBAAkB,iBAAiB,IAAI;AAE3E,MAAI,QAAQ,oBAAoB,GAAG;AACjC,QAAI;AAEJ,QAAI,oBAAoB,YAAY,MAAM;AACxC,eACE,oBAAoB,QAAQ,oBAC1B,GAAG,QAAQ,aAAa,QAAQ,UAClC,KAAK,oBAAoB,QAAQ,oBAAoB,GAAG,QAAQ,kBAAkB;AAAA,IACtF;AAEA,QAAI,QAAQ;AAEV,UAAI,OAAO,WAAW,UAAU;AAE9B,YAAI,oBAAoB,YAAY;AAClC,iBACE;AAAA,YAAC;AAAA;AAAA,cACC,SAAS;AAAA,cACT,SAAS;AAAA,cACT,qBAAkB;AAAA,cAElB,WAAW;AAAA,cACX,cAAc;AAAA;AAAA,YAFT;AAAA,UAGP;AAAA,QAEJ,OAEK;AACH,iBAAO;AAAA,QACT;AAAA,MACF,OAEK;AACH,cAAM,QAAQ,QAAQ;AAEtB,YAAI,SAAS,QAAQ,SAAS,eAAe;AAE7C,cAAM,WAAW,OAAO;AAAA,UACtB;AAAA,UACA;AAAA,UACA,UAAU,QAAQ;AAAA,QACpB,CAAC;AAGD,YAAI,CAAC,YAAY,WAAW,YAAY;AACtC,iBAAO;AAAA,QACT;AAEA,YAAI,CAAC,YAAY,oBAAoB,YAAY;AAC/C,iBACE;AAAA,YAAC;AAAA;AAAA,cACC,qBAAkB;AAAA,cAElB,SAAS;AAAA,cACT,WAAW;AAAA,cACX,cAAc;AAAA;AAAA,YAHT;AAAA,UAIP;AAAA,QAEJ,WAAW,CAAC,UAAU;AACpB,iBAAO;AAAA,QACT;AAEA,YAAI,OAAO,aAAa,UAAU;AAChC,iBACE;AAAA,YAAC;AAAA;AAAA,cACC,SAAS;AAAA,cACT,SAAS;AAAA,cACT,WAAW;AAAA,cACX,cAAc;AAAA,cACd,qBAAkB;AAAA;AAAA,YACb;AAAA,UACP;AAAA,QAEJ,OAAO;AACL,iBACE;AAAA,YAAC;AAAA;AAAA,cACC,SAAS;AAAA,cACT,qBAAkB;AAAA,cAElB,WAAW;AAAA,cACX,cAAc;AAAA,cACd,cAAc;AAAA;AAAA,YAHT;AAAA,UAIP;AAAA,QAEJ;AAAA,MACF;AAAA,IACF,WAES,CAAC,cAAc,CAAC,kBAAkB;AAEzC,aAAO;AAAA,IACT,OAAO;AAEL,aACE;AAAA,QAAC;AAAA;AAAA,UACC,SAAS;AAAA,UACT,WAAW;AAAA,UACX,cAAc;AAAA,UACd,qBAAkB;AAAA;AAAA,QACb;AAAA,MACP;AAAA,IAEJ;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,8 @@
1
+ import {
2
+ RenderAgentStateMessage
3
+ } from "../../../chunk-UWWMAJ7R.mjs";
4
+ import "../../../chunk-MRXNTQOX.mjs";
5
+ export {
6
+ RenderAgentStateMessage
7
+ };
8
+ //# sourceMappingURL=RenderAgentStateMessage.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,7 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { RenderMessageProps } from '../props.js';
3
+ import '@copilotkit/runtime-client-gql';
4
+
5
+ declare function RenderResultMessage(props: RenderMessageProps): react_jsx_runtime.JSX.Element | undefined;
6
+
7
+ export { RenderResultMessage };
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/components/chat/messages/RenderResultMessage.tsx
21
+ var RenderResultMessage_exports = {};
22
+ __export(RenderResultMessage_exports, {
23
+ RenderResultMessage: () => RenderResultMessage
24
+ });
25
+ module.exports = __toCommonJS(RenderResultMessage_exports);
26
+ var import_jsx_runtime = require("react/jsx-runtime");
27
+ function RenderResultMessage(props) {
28
+ const { message, inProgress, index, isCurrentMessage, AssistantMessage } = props;
29
+ if (message.isResultMessage() && inProgress && isCurrentMessage) {
30
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
31
+ AssistantMessage,
32
+ {
33
+ "data-message-role": "assistant",
34
+ rawData: message,
35
+ isLoading: true,
36
+ isGenerating: true
37
+ },
38
+ index
39
+ );
40
+ }
41
+ }
42
+ // Annotate the CommonJS export names for ESM import in node:
43
+ 0 && (module.exports = {
44
+ RenderResultMessage
45
+ });
46
+ //# sourceMappingURL=RenderResultMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/chat/messages/RenderResultMessage.tsx"],"sourcesContent":["import { RenderMessageProps } from \"../props\";\n\nexport function RenderResultMessage(props: RenderMessageProps) {\n const { message, inProgress, index, isCurrentMessage, AssistantMessage } = props;\n\n if (message.isResultMessage() && inProgress && isCurrentMessage) {\n return (\n <AssistantMessage\n key={index}\n data-message-role=\"assistant\"\n rawData={message}\n isLoading={true}\n isGenerating={true}\n />\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOM;AALC,SAAS,oBAAoB,OAA2B;AAC7D,QAAM,EAAE,SAAS,YAAY,OAAO,kBAAkB,iBAAiB,IAAI;AAE3E,MAAI,QAAQ,gBAAgB,KAAK,cAAc,kBAAkB;AAC/D,WACE;AAAA,MAAC;AAAA;AAAA,QAEC,qBAAkB;AAAA,QAClB,SAAS;AAAA,QACT,WAAW;AAAA,QACX,cAAc;AAAA;AAAA,MAJT;AAAA,IAKP;AAAA,EAEJ;AACF;","names":[]}
@@ -0,0 +1,8 @@
1
+ import {
2
+ RenderResultMessage
3
+ } from "../../../chunk-F7VWGY77.mjs";
4
+ import "../../../chunk-MRXNTQOX.mjs";
5
+ export {
6
+ RenderResultMessage
7
+ };
8
+ //# sourceMappingURL=RenderResultMessage.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,7 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { RenderMessageProps } from '../props.js';
3
+ import '@copilotkit/runtime-client-gql';
4
+
5
+ declare function RenderTextMessage(props: RenderMessageProps): react_jsx_runtime.JSX.Element | undefined;
6
+
7
+ export { RenderTextMessage };
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/components/chat/messages/RenderTextMessage.tsx
21
+ var RenderTextMessage_exports = {};
22
+ __export(RenderTextMessage_exports, {
23
+ RenderTextMessage: () => RenderTextMessage
24
+ });
25
+ module.exports = __toCommonJS(RenderTextMessage_exports);
26
+ var import_jsx_runtime = require("react/jsx-runtime");
27
+ function RenderTextMessage(props) {
28
+ const { message, inProgress, index, isCurrentMessage, UserMessage, AssistantMessage } = props;
29
+ if (message.isTextMessage()) {
30
+ if (message.role === "user") {
31
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
32
+ UserMessage,
33
+ {
34
+ "data-message-role": "user",
35
+ message: message.content,
36
+ rawData: message
37
+ },
38
+ index
39
+ );
40
+ } else if (message.role == "assistant") {
41
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
42
+ AssistantMessage,
43
+ {
44
+ "data-message-role": "assistant",
45
+ message: message.content,
46
+ rawData: message,
47
+ isLoading: inProgress && isCurrentMessage && !message.content,
48
+ isGenerating: inProgress && isCurrentMessage && !!message.content
49
+ },
50
+ index
51
+ );
52
+ }
53
+ }
54
+ }
55
+ // Annotate the CommonJS export names for ESM import in node:
56
+ 0 && (module.exports = {
57
+ RenderTextMessage
58
+ });
59
+ //# sourceMappingURL=RenderTextMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/chat/messages/RenderTextMessage.tsx"],"sourcesContent":["import { RenderMessageProps } from \"../props\";\n\nexport function RenderTextMessage(props: RenderMessageProps) {\n const { message, inProgress, index, isCurrentMessage, UserMessage, AssistantMessage } = props;\n\n if (message.isTextMessage()) {\n if (message.role === \"user\") {\n return (\n <UserMessage\n key={index}\n data-message-role=\"user\"\n message={message.content}\n rawData={message}\n />\n );\n } else if (message.role == \"assistant\") {\n return (\n <AssistantMessage\n key={index}\n data-message-role=\"assistant\"\n message={message.content}\n rawData={message}\n isLoading={inProgress && isCurrentMessage && !message.content}\n isGenerating={inProgress && isCurrentMessage && !!message.content}\n />\n );\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQQ;AAND,SAAS,kBAAkB,OAA2B;AAC3D,QAAM,EAAE,SAAS,YAAY,OAAO,kBAAkB,aAAa,iBAAiB,IAAI;AAExF,MAAI,QAAQ,cAAc,GAAG;AAC3B,QAAI,QAAQ,SAAS,QAAQ;AAC3B,aACE;AAAA,QAAC;AAAA;AAAA,UAEC,qBAAkB;AAAA,UAClB,SAAS,QAAQ;AAAA,UACjB,SAAS;AAAA;AAAA,QAHJ;AAAA,MAIP;AAAA,IAEJ,WAAW,QAAQ,QAAQ,aAAa;AACtC,aACE;AAAA,QAAC;AAAA;AAAA,UAEC,qBAAkB;AAAA,UAClB,SAAS,QAAQ;AAAA,UACjB,SAAS;AAAA,UACT,WAAW,cAAc,oBAAoB,CAAC,QAAQ;AAAA,UACtD,cAAc,cAAc,oBAAoB,CAAC,CAAC,QAAQ;AAAA;AAAA,QALrD;AAAA,MAMP;AAAA,IAEJ;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,8 @@
1
+ import {
2
+ RenderTextMessage
3
+ } from "../../../chunk-OFYI4UU4.mjs";
4
+ import "../../../chunk-MRXNTQOX.mjs";
5
+ export {
6
+ RenderTextMessage
7
+ };
8
+ //# sourceMappingURL=RenderTextMessage.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,7 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { UserMessageProps } from '../props.js';
3
+ import '@copilotkit/runtime-client-gql';
4
+
5
+ declare const UserMessage: (props: UserMessageProps) => react_jsx_runtime.JSX.Element;
6
+
7
+ export { UserMessage };