@copilotkit/react-ui 0.0.0-0.0.0-max-changeset-10101010101010-20260109191632

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (395) hide show
  1. package/CHANGELOG.md +17415 -0
  2. package/LICENSE +21 -0
  3. package/README.md +141 -0
  4. package/dist/chunk-3W6J75HS.mjs +126 -0
  5. package/dist/chunk-3W6J75HS.mjs.map +1 -0
  6. package/dist/chunk-54JAUBUJ.mjs +26 -0
  7. package/dist/chunk-54JAUBUJ.mjs.map +1 -0
  8. package/dist/chunk-7OURDQZJ.mjs +133 -0
  9. package/dist/chunk-7OURDQZJ.mjs.map +1 -0
  10. package/dist/chunk-7PR2KJDO.mjs +222 -0
  11. package/dist/chunk-7PR2KJDO.mjs.map +1 -0
  12. package/dist/chunk-BH6PCAAL.mjs +81 -0
  13. package/dist/chunk-BH6PCAAL.mjs.map +1 -0
  14. package/dist/chunk-C3GSYRC3.mjs +118 -0
  15. package/dist/chunk-C3GSYRC3.mjs.map +1 -0
  16. package/dist/chunk-DBKRAOH7.mjs +34 -0
  17. package/dist/chunk-DBKRAOH7.mjs.map +1 -0
  18. package/dist/chunk-EFZPSZWO.mjs +1 -0
  19. package/dist/chunk-EFZPSZWO.mjs.map +1 -0
  20. package/dist/chunk-ELGRNEAO.mjs +32 -0
  21. package/dist/chunk-ELGRNEAO.mjs.map +1 -0
  22. package/dist/chunk-ELUJRANC.mjs +21 -0
  23. package/dist/chunk-ELUJRANC.mjs.map +1 -0
  24. package/dist/chunk-FFJHOZX6.mjs +202 -0
  25. package/dist/chunk-FFJHOZX6.mjs.map +1 -0
  26. package/dist/chunk-GDSZGYCE.mjs +32 -0
  27. package/dist/chunk-GDSZGYCE.mjs.map +1 -0
  28. package/dist/chunk-HIW7RXCD.mjs +184 -0
  29. package/dist/chunk-HIW7RXCD.mjs.map +1 -0
  30. package/dist/chunk-IEMQ2SQW.mjs +93 -0
  31. package/dist/chunk-IEMQ2SQW.mjs.map +1 -0
  32. package/dist/chunk-IHFR6PYG.mjs +116 -0
  33. package/dist/chunk-IHFR6PYG.mjs.map +1 -0
  34. package/dist/chunk-IK2BPURM.mjs +400 -0
  35. package/dist/chunk-IK2BPURM.mjs.map +1 -0
  36. package/dist/chunk-IU3WTXLQ.mjs +1 -0
  37. package/dist/chunk-IU3WTXLQ.mjs.map +1 -0
  38. package/dist/chunk-JGMFJZMG.mjs +11 -0
  39. package/dist/chunk-JGMFJZMG.mjs.map +1 -0
  40. package/dist/chunk-JY2CSDKN.mjs +135 -0
  41. package/dist/chunk-JY2CSDKN.mjs.map +1 -0
  42. package/dist/chunk-JZ3RFQQ6.mjs +128 -0
  43. package/dist/chunk-JZ3RFQQ6.mjs.map +1 -0
  44. package/dist/chunk-KXE2JCUH.mjs +1 -0
  45. package/dist/chunk-KXE2JCUH.mjs.map +1 -0
  46. package/dist/chunk-LQEFRHRT.mjs +30 -0
  47. package/dist/chunk-LQEFRHRT.mjs.map +1 -0
  48. package/dist/chunk-MMVDU6DF.mjs +1 -0
  49. package/dist/chunk-MMVDU6DF.mjs.map +1 -0
  50. package/dist/chunk-MRXNTQOX.mjs +59 -0
  51. package/dist/chunk-MRXNTQOX.mjs.map +1 -0
  52. package/dist/chunk-NCIAFFQ2.mjs +82 -0
  53. package/dist/chunk-NCIAFFQ2.mjs.map +1 -0
  54. package/dist/chunk-NGJ32FAP.mjs +30 -0
  55. package/dist/chunk-NGJ32FAP.mjs.map +1 -0
  56. package/dist/chunk-NRA3CFEE.mjs +97 -0
  57. package/dist/chunk-NRA3CFEE.mjs.map +1 -0
  58. package/dist/chunk-O72ZB5V3.mjs +140 -0
  59. package/dist/chunk-O72ZB5V3.mjs.map +1 -0
  60. package/dist/chunk-PLHTVHUW.mjs +82 -0
  61. package/dist/chunk-PLHTVHUW.mjs.map +1 -0
  62. package/dist/chunk-Q5V6S67N.mjs +103 -0
  63. package/dist/chunk-Q5V6S67N.mjs.map +1 -0
  64. package/dist/chunk-QB3GUN2N.mjs +31 -0
  65. package/dist/chunk-QB3GUN2N.mjs.map +1 -0
  66. package/dist/chunk-QIOJXTIQ.mjs +64 -0
  67. package/dist/chunk-QIOJXTIQ.mjs.map +1 -0
  68. package/dist/chunk-QPQRLXN3.mjs +435 -0
  69. package/dist/chunk-QPQRLXN3.mjs.map +1 -0
  70. package/dist/chunk-RYUCX3ZK.mjs +32 -0
  71. package/dist/chunk-RYUCX3ZK.mjs.map +1 -0
  72. package/dist/chunk-SC6JRFAJ.mjs +1 -0
  73. package/dist/chunk-SC6JRFAJ.mjs.map +1 -0
  74. package/dist/chunk-T26KLXLH.mjs +1 -0
  75. package/dist/chunk-T26KLXLH.mjs.map +1 -0
  76. package/dist/chunk-UFN2VWSR.mjs +25 -0
  77. package/dist/chunk-UFN2VWSR.mjs.map +1 -0
  78. package/dist/chunk-V7W6IM2V.mjs +1 -0
  79. package/dist/chunk-V7W6IM2V.mjs.map +1 -0
  80. package/dist/chunk-WB3YULQ4.mjs +1 -0
  81. package/dist/chunk-WB3YULQ4.mjs.map +1 -0
  82. package/dist/chunk-XWG3L6QC.mjs +258 -0
  83. package/dist/chunk-XWG3L6QC.mjs.map +1 -0
  84. package/dist/chunk-Y4FKRAKJ.mjs +12 -0
  85. package/dist/chunk-Y4FKRAKJ.mjs.map +1 -0
  86. package/dist/components/chat/Button.d.ts +9 -0
  87. package/dist/components/chat/Button.js +71 -0
  88. package/dist/components/chat/Button.js.map +1 -0
  89. package/dist/components/chat/Button.mjs +10 -0
  90. package/dist/components/chat/Button.mjs.map +1 -0
  91. package/dist/components/chat/Chat.d.ts +204 -0
  92. package/dist/components/chat/Chat.js +2270 -0
  93. package/dist/components/chat/Chat.js.map +1 -0
  94. package/dist/components/chat/Chat.mjs +29 -0
  95. package/dist/components/chat/Chat.mjs.map +1 -0
  96. package/dist/components/chat/ChatContext.d.ts +145 -0
  97. package/dist/components/chat/ChatContext.js +329 -0
  98. package/dist/components/chat/ChatContext.js.map +1 -0
  99. package/dist/components/chat/ChatContext.mjs +13 -0
  100. package/dist/components/chat/ChatContext.mjs.map +1 -0
  101. package/dist/components/chat/CodeBlock.d.ts +14 -0
  102. package/dist/components/chat/CodeBlock.js +510 -0
  103. package/dist/components/chat/CodeBlock.js.map +1 -0
  104. package/dist/components/chat/CodeBlock.mjs +14 -0
  105. package/dist/components/chat/CodeBlock.mjs.map +1 -0
  106. package/dist/components/chat/Header.d.ts +9 -0
  107. package/dist/components/chat/Header.js +582 -0
  108. package/dist/components/chat/Header.js.map +1 -0
  109. package/dist/components/chat/Header.mjs +17 -0
  110. package/dist/components/chat/Header.mjs.map +1 -0
  111. package/dist/components/chat/Icons.d.ts +20 -0
  112. package/dist/components/chat/Icons.js +297 -0
  113. package/dist/components/chat/Icons.js.map +1 -0
  114. package/dist/components/chat/Icons.mjs +38 -0
  115. package/dist/components/chat/Icons.mjs.map +1 -0
  116. package/dist/components/chat/ImageUploadQueue.d.ts +13 -0
  117. package/dist/components/chat/ImageUploadQueue.js +106 -0
  118. package/dist/components/chat/ImageUploadQueue.js.map +1 -0
  119. package/dist/components/chat/ImageUploadQueue.mjs +8 -0
  120. package/dist/components/chat/ImageUploadQueue.mjs.map +1 -0
  121. package/dist/components/chat/Input.d.ts +9 -0
  122. package/dist/components/chat/Input.js +396 -0
  123. package/dist/components/chat/Input.js.map +1 -0
  124. package/dist/components/chat/Input.mjs +14 -0
  125. package/dist/components/chat/Input.mjs.map +1 -0
  126. package/dist/components/chat/Markdown.d.ts +10 -0
  127. package/dist/components/chat/Markdown.js +652 -0
  128. package/dist/components/chat/Markdown.js.map +1 -0
  129. package/dist/components/chat/Markdown.mjs +11 -0
  130. package/dist/components/chat/Markdown.mjs.map +1 -0
  131. package/dist/components/chat/Messages.d.ts +13 -0
  132. package/dist/components/chat/Messages.js +1195 -0
  133. package/dist/components/chat/Messages.js.map +1 -0
  134. package/dist/components/chat/Messages.mjs +20 -0
  135. package/dist/components/chat/Messages.mjs.map +1 -0
  136. package/dist/components/chat/Modal.d.ts +51 -0
  137. package/dist/components/chat/Modal.js +3075 -0
  138. package/dist/components/chat/Modal.js.map +1 -0
  139. package/dist/components/chat/Modal.mjs +38 -0
  140. package/dist/components/chat/Modal.mjs.map +1 -0
  141. package/dist/components/chat/Popup.d.ts +13 -0
  142. package/dist/components/chat/Popup.js +3086 -0
  143. package/dist/components/chat/Popup.js.map +1 -0
  144. package/dist/components/chat/Popup.mjs +39 -0
  145. package/dist/components/chat/Popup.mjs.map +1 -0
  146. package/dist/components/chat/PoweredByTag.d.ts +7 -0
  147. package/dist/components/chat/PoweredByTag.js +61 -0
  148. package/dist/components/chat/PoweredByTag.js.map +1 -0
  149. package/dist/components/chat/PoweredByTag.mjs +9 -0
  150. package/dist/components/chat/PoweredByTag.mjs.map +1 -0
  151. package/dist/components/chat/Sidebar.d.ts +13 -0
  152. package/dist/components/chat/Sidebar.js +3095 -0
  153. package/dist/components/chat/Sidebar.js.map +1 -0
  154. package/dist/components/chat/Sidebar.mjs +39 -0
  155. package/dist/components/chat/Sidebar.mjs.map +1 -0
  156. package/dist/components/chat/Suggestion.d.ts +12 -0
  157. package/dist/components/chat/Suggestion.js +56 -0
  158. package/dist/components/chat/Suggestion.js.map +1 -0
  159. package/dist/components/chat/Suggestion.mjs +9 -0
  160. package/dist/components/chat/Suggestion.mjs.map +1 -0
  161. package/dist/components/chat/Suggestions.d.ts +9 -0
  162. package/dist/components/chat/Suggestions.js +81 -0
  163. package/dist/components/chat/Suggestions.js.map +1 -0
  164. package/dist/components/chat/Suggestions.mjs +10 -0
  165. package/dist/components/chat/Suggestions.mjs.map +1 -0
  166. package/dist/components/chat/Textarea.d.ts +15 -0
  167. package/dist/components/chat/Textarea.js +84 -0
  168. package/dist/components/chat/Textarea.js.map +1 -0
  169. package/dist/components/chat/Textarea.mjs +8 -0
  170. package/dist/components/chat/Textarea.mjs.map +1 -0
  171. package/dist/components/chat/Window.d.ts +9 -0
  172. package/dist/components/chat/Window.js +164 -0
  173. package/dist/components/chat/Window.js.map +1 -0
  174. package/dist/components/chat/Window.mjs +10 -0
  175. package/dist/components/chat/Window.mjs.map +1 -0
  176. package/dist/components/chat/index.d.ts +18 -0
  177. package/dist/components/chat/index.js +3122 -0
  178. package/dist/components/chat/index.js.map +1 -0
  179. package/dist/components/chat/index.mjs +69 -0
  180. package/dist/components/chat/index.mjs.map +1 -0
  181. package/dist/components/chat/messages/AssistantMessage.d.ts +9 -0
  182. package/dist/components/chat/messages/AssistantMessage.js +775 -0
  183. package/dist/components/chat/messages/AssistantMessage.js.map +1 -0
  184. package/dist/components/chat/messages/AssistantMessage.mjs +13 -0
  185. package/dist/components/chat/messages/AssistantMessage.mjs.map +1 -0
  186. package/dist/components/chat/messages/ErrorMessage.d.ts +9 -0
  187. package/dist/components/chat/messages/ErrorMessage.js +722 -0
  188. package/dist/components/chat/messages/ErrorMessage.js.map +1 -0
  189. package/dist/components/chat/messages/ErrorMessage.mjs +66 -0
  190. package/dist/components/chat/messages/ErrorMessage.mjs.map +1 -0
  191. package/dist/components/chat/messages/ImageRenderer.d.ts +12 -0
  192. package/dist/components/chat/messages/ImageRenderer.js +58 -0
  193. package/dist/components/chat/messages/ImageRenderer.js.map +1 -0
  194. package/dist/components/chat/messages/ImageRenderer.mjs +8 -0
  195. package/dist/components/chat/messages/ImageRenderer.mjs.map +1 -0
  196. package/dist/components/chat/messages/LegacyRenderMessage.d.ts +28 -0
  197. package/dist/components/chat/messages/LegacyRenderMessage.js +1023 -0
  198. package/dist/components/chat/messages/LegacyRenderMessage.js.map +1 -0
  199. package/dist/components/chat/messages/LegacyRenderMessage.mjs +17 -0
  200. package/dist/components/chat/messages/LegacyRenderMessage.mjs.map +1 -0
  201. package/dist/components/chat/messages/RenderMessage.d.ts +9 -0
  202. package/dist/components/chat/messages/RenderMessage.js +898 -0
  203. package/dist/components/chat/messages/RenderMessage.js.map +1 -0
  204. package/dist/components/chat/messages/RenderMessage.mjs +16 -0
  205. package/dist/components/chat/messages/RenderMessage.mjs.map +1 -0
  206. package/dist/components/chat/messages/UserMessage.d.ts +9 -0
  207. package/dist/components/chat/messages/UserMessage.js +56 -0
  208. package/dist/components/chat/messages/UserMessage.js.map +1 -0
  209. package/dist/components/chat/messages/UserMessage.mjs +8 -0
  210. package/dist/components/chat/messages/UserMessage.mjs.map +1 -0
  211. package/dist/components/chat/props.d.ts +298 -0
  212. package/dist/components/chat/props.js +19 -0
  213. package/dist/components/chat/props.js.map +1 -0
  214. package/dist/components/chat/props.mjs +2 -0
  215. package/dist/components/chat/props.mjs.map +1 -0
  216. package/dist/components/dev-console/console.d.ts +11 -0
  217. package/dist/components/dev-console/console.js +537 -0
  218. package/dist/components/dev-console/console.js.map +1 -0
  219. package/dist/components/dev-console/console.mjs +17 -0
  220. package/dist/components/dev-console/console.mjs.map +1 -0
  221. package/dist/components/dev-console/icons.d.ts +9 -0
  222. package/dist/components/dev-console/icons.js +131 -0
  223. package/dist/components/dev-console/icons.js.map +1 -0
  224. package/dist/components/dev-console/icons.mjs +16 -0
  225. package/dist/components/dev-console/icons.mjs.map +1 -0
  226. package/dist/components/dev-console/index.d.ts +3 -0
  227. package/dist/components/dev-console/index.js +537 -0
  228. package/dist/components/dev-console/index.js.map +1 -0
  229. package/dist/components/dev-console/index.mjs +18 -0
  230. package/dist/components/dev-console/index.mjs.map +1 -0
  231. package/dist/components/dev-console/types.d.ts +9 -0
  232. package/dist/components/dev-console/types.js +19 -0
  233. package/dist/components/dev-console/types.js.map +1 -0
  234. package/dist/components/dev-console/types.mjs +1 -0
  235. package/dist/components/dev-console/types.mjs.map +1 -0
  236. package/dist/components/dev-console/utils.d.ts +10 -0
  237. package/dist/components/dev-console/utils.js +177 -0
  238. package/dist/components/dev-console/utils.js.map +1 -0
  239. package/dist/components/dev-console/utils.mjs +16 -0
  240. package/dist/components/dev-console/utils.mjs.map +1 -0
  241. package/dist/components/help-modal/icons.d.ts +9 -0
  242. package/dist/components/help-modal/icons.js +107 -0
  243. package/dist/components/help-modal/icons.js.map +1 -0
  244. package/dist/components/help-modal/icons.mjs +12 -0
  245. package/dist/components/help-modal/icons.mjs.map +1 -0
  246. package/dist/components/help-modal/index.d.ts +2 -0
  247. package/dist/components/help-modal/index.js +137 -0
  248. package/dist/components/help-modal/index.js.map +1 -0
  249. package/dist/components/help-modal/index.mjs +10 -0
  250. package/dist/components/help-modal/index.mjs.map +1 -0
  251. package/dist/components/help-modal/modal.d.ts +5 -0
  252. package/dist/components/help-modal/modal.js +135 -0
  253. package/dist/components/help-modal/modal.js.map +1 -0
  254. package/dist/components/help-modal/modal.mjs +9 -0
  255. package/dist/components/help-modal/modal.mjs.map +1 -0
  256. package/dist/components/index.d.ts +19 -0
  257. package/dist/components/index.js +3126 -0
  258. package/dist/components/index.js.map +1 -0
  259. package/dist/components/index.mjs +76 -0
  260. package/dist/components/index.mjs.map +1 -0
  261. package/dist/context/index.d.ts +2 -0
  262. package/dist/context/index.js +19 -0
  263. package/dist/context/index.js.map +1 -0
  264. package/dist/context/index.mjs +2 -0
  265. package/dist/context/index.mjs.map +1 -0
  266. package/dist/hooks/index.d.ts +2 -0
  267. package/dist/hooks/index.js +36 -0
  268. package/dist/hooks/index.js.map +1 -0
  269. package/dist/hooks/index.mjs +9 -0
  270. package/dist/hooks/index.mjs.map +1 -0
  271. package/dist/hooks/use-copilot-chat-suggestions.d.ts +66 -0
  272. package/dist/hooks/use-copilot-chat-suggestions.js +34 -0
  273. package/dist/hooks/use-copilot-chat-suggestions.js.map +1 -0
  274. package/dist/hooks/use-copilot-chat-suggestions.mjs +8 -0
  275. package/dist/hooks/use-copilot-chat-suggestions.mjs.map +1 -0
  276. package/dist/hooks/use-copy-to-clipboard.d.ts +9 -0
  277. package/dist/hooks/use-copy-to-clipboard.js +60 -0
  278. package/dist/hooks/use-copy-to-clipboard.js.map +1 -0
  279. package/dist/hooks/use-copy-to-clipboard.mjs +8 -0
  280. package/dist/hooks/use-copy-to-clipboard.mjs.map +1 -0
  281. package/dist/hooks/use-dark-mode.d.ts +3 -0
  282. package/dist/hooks/use-dark-mode.js +35 -0
  283. package/dist/hooks/use-dark-mode.js.map +1 -0
  284. package/dist/hooks/use-dark-mode.mjs +8 -0
  285. package/dist/hooks/use-dark-mode.mjs.map +1 -0
  286. package/dist/hooks/use-push-to-talk.d.ts +19 -0
  287. package/dist/hooks/use-push-to-talk.js +195 -0
  288. package/dist/hooks/use-push-to-talk.js.map +1 -0
  289. package/dist/hooks/use-push-to-talk.mjs +12 -0
  290. package/dist/hooks/use-push-to-talk.mjs.map +1 -0
  291. package/dist/index.css +1258 -0
  292. package/dist/index.css.map +1 -0
  293. package/dist/index.d.ts +21 -0
  294. package/dist/index.js +3135 -0
  295. package/dist/index.js.map +1 -0
  296. package/dist/index.mjs +84 -0
  297. package/dist/index.mjs.map +1 -0
  298. package/dist/lib/utils.d.ts +4 -0
  299. package/dist/lib/utils.js +76 -0
  300. package/dist/lib/utils.js.map +1 -0
  301. package/dist/lib/utils.mjs +34 -0
  302. package/dist/lib/utils.mjs.map +1 -0
  303. package/dist/types/css.d.ts +22 -0
  304. package/dist/types/css.js +19 -0
  305. package/dist/types/css.js.map +1 -0
  306. package/dist/types/css.mjs +1 -0
  307. package/dist/types/css.mjs.map +1 -0
  308. package/dist/types/index.d.ts +3 -0
  309. package/dist/types/index.js +19 -0
  310. package/dist/types/index.js.map +1 -0
  311. package/dist/types/index.mjs +2 -0
  312. package/dist/types/index.mjs.map +1 -0
  313. package/dist/types/suggestions.d.ts +9 -0
  314. package/dist/types/suggestions.js +19 -0
  315. package/dist/types/suggestions.js.map +1 -0
  316. package/dist/types/suggestions.mjs +1 -0
  317. package/dist/types/suggestions.mjs.map +1 -0
  318. package/dist/v2/index.css +4 -0
  319. package/dist/v2/index.css.map +1 -0
  320. package/dist/v2/index.d.ts +2 -0
  321. package/dist/v2/index.js +2 -0
  322. package/dist/v2/index.js.map +1 -0
  323. package/dist/v2/index.mjs +2 -0
  324. package/dist/v2/index.mjs.map +1 -0
  325. package/jest.config.js +5 -0
  326. package/package.json +83 -0
  327. package/postcss.config.js +60 -0
  328. package/src/components/chat/Button.tsx +18 -0
  329. package/src/components/chat/Chat.tsx +795 -0
  330. package/src/components/chat/ChatContext.tsx +248 -0
  331. package/src/components/chat/CodeBlock.tsx +418 -0
  332. package/src/components/chat/Header.tsx +24 -0
  333. package/src/components/chat/Icons.tsx +237 -0
  334. package/src/components/chat/ImageUploadQueue.tsx +77 -0
  335. package/src/components/chat/Input.tsx +156 -0
  336. package/src/components/chat/Markdown.tsx +144 -0
  337. package/src/components/chat/Messages.tsx +206 -0
  338. package/src/components/chat/Modal.tsx +220 -0
  339. package/src/components/chat/Popup.tsx +77 -0
  340. package/src/components/chat/PoweredByTag.tsx +42 -0
  341. package/src/components/chat/Sidebar.tsx +96 -0
  342. package/src/components/chat/Suggestion.tsx +29 -0
  343. package/src/components/chat/Suggestions.tsx +23 -0
  344. package/src/components/chat/Textarea.tsx +77 -0
  345. package/src/components/chat/Window.tsx +152 -0
  346. package/src/components/chat/index.tsx +11 -0
  347. package/src/components/chat/messages/AssistantMessage.tsx +118 -0
  348. package/src/components/chat/messages/ErrorMessage.tsx +59 -0
  349. package/src/components/chat/messages/ImageRenderer.tsx +37 -0
  350. package/src/components/chat/messages/LegacyRenderMessage.tsx +150 -0
  351. package/src/components/chat/messages/RenderMessage.tsx +61 -0
  352. package/src/components/chat/messages/UserMessage.tsx +46 -0
  353. package/src/components/chat/props.ts +353 -0
  354. package/src/components/dev-console/console.tsx +242 -0
  355. package/src/components/dev-console/icons.tsx +99 -0
  356. package/src/components/dev-console/index.tsx +2 -0
  357. package/src/components/dev-console/types.ts +7 -0
  358. package/src/components/dev-console/utils.ts +142 -0
  359. package/src/components/help-modal/icons.tsx +68 -0
  360. package/src/components/help-modal/index.tsx +1 -0
  361. package/src/components/help-modal/modal.tsx +101 -0
  362. package/src/components/index.ts +2 -0
  363. package/src/context/index.ts +1 -0
  364. package/src/css/animations.css +35 -0
  365. package/src/css/button.css +67 -0
  366. package/src/css/colors.css +78 -0
  367. package/src/css/console.css +166 -0
  368. package/src/css/crew.css +277 -0
  369. package/src/css/header.css +65 -0
  370. package/src/css/input.css +152 -0
  371. package/src/css/markdown.css +150 -0
  372. package/src/css/messages.css +244 -0
  373. package/src/css/panel.css +39 -0
  374. package/src/css/popup.css +22 -0
  375. package/src/css/sidebar.css +34 -0
  376. package/src/css/suggestions.css +43 -0
  377. package/src/css/window.css +60 -0
  378. package/src/hooks/index.ts +1 -0
  379. package/src/hooks/use-copilot-chat-suggestions.tsx +71 -0
  380. package/src/hooks/use-copy-to-clipboard.tsx +29 -0
  381. package/src/hooks/use-dark-mode.ts +10 -0
  382. package/src/hooks/use-push-to-talk.tsx +167 -0
  383. package/src/index.tsx +7 -0
  384. package/src/lib/utils.test.ts +7 -0
  385. package/src/lib/utils.ts +27 -0
  386. package/src/styles.css +14 -0
  387. package/src/types/css.ts +21 -0
  388. package/src/types/index.ts +2 -0
  389. package/src/types/suggestions.ts +7 -0
  390. package/src/v2/index.ts +1 -0
  391. package/src/v2/styles.css +1 -0
  392. package/tailwind.config.js +7 -0
  393. package/tsconfig.json +12 -0
  394. package/tsup.config.ts +11 -0
  395. package/typedoc.json +4 -0
@@ -0,0 +1,537 @@
1
+ "use strict";
2
+ "use client";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var __async = (__this, __arguments, generator) => {
21
+ return new Promise((resolve, reject) => {
22
+ var fulfilled = (value) => {
23
+ try {
24
+ step(generator.next(value));
25
+ } catch (e) {
26
+ reject(e);
27
+ }
28
+ };
29
+ var rejected = (value) => {
30
+ try {
31
+ step(generator.throw(value));
32
+ } catch (e) {
33
+ reject(e);
34
+ }
35
+ };
36
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
37
+ step((generator = generator.apply(__this, __arguments)).next());
38
+ });
39
+ };
40
+
41
+ // src/components/dev-console/console.tsx
42
+ var console_exports = {};
43
+ __export(console_exports, {
44
+ CopilotDevConsole: () => CopilotDevConsole,
45
+ default: () => DebugMenuButton
46
+ });
47
+ module.exports = __toCommonJS(console_exports);
48
+ var import_react_core3 = require("@copilotkit/react-core");
49
+
50
+ // src/components/dev-console/utils.ts
51
+ var import_react_core = require("@copilotkit/react-core");
52
+ var import_react_core2 = require("@copilotkit/react-core");
53
+ function getPublishedCopilotKitVersion(current, forceCheck = false) {
54
+ return __async(this, null, function* () {
55
+ const LOCAL_STORAGE_KEY = "__copilotkit_version_check__";
56
+ const serializedVersion = localStorage.getItem(LOCAL_STORAGE_KEY);
57
+ if (serializedVersion && !forceCheck) {
58
+ try {
59
+ const parsedVersion = JSON.parse(serializedVersion);
60
+ const oneHour = 60 * 60 * 1e3;
61
+ const now = (/* @__PURE__ */ new Date()).getTime();
62
+ if (parsedVersion.current === current && now - new Date(parsedVersion.lastChecked).getTime() < oneHour) {
63
+ return parsedVersion;
64
+ }
65
+ } catch (error) {
66
+ console.error("Failed to parse CopilotKitVersion from localStorage", error);
67
+ }
68
+ }
69
+ try {
70
+ const response = yield fetch("https://api.cloud.copilotkit.ai/check-for-updates", {
71
+ method: "POST",
72
+ headers: {
73
+ "Content-Type": "application/json"
74
+ },
75
+ body: JSON.stringify({
76
+ packages: [
77
+ {
78
+ packageName: "@copilotkit/shared",
79
+ packageVersion: current
80
+ }
81
+ ]
82
+ })
83
+ });
84
+ const data = yield response.json();
85
+ const version = {
86
+ current,
87
+ lastChecked: (/* @__PURE__ */ new Date()).getTime(),
88
+ latest: data.packages[0].latestVersion,
89
+ severity: data.packages[0].severity,
90
+ advisory: data.packages[0].advisory || null
91
+ };
92
+ localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(version));
93
+ return version;
94
+ } catch (error) {
95
+ console.error("Failed to check for updates", error);
96
+ throw error;
97
+ }
98
+ });
99
+ }
100
+ function logReadables(context) {
101
+ console.log("%cCurrent Readables:", "font-size: 16px; font-weight: bold;");
102
+ const readables = context.getContextString([], import_react_core.defaultCopilotContextCategories).trim();
103
+ if (readables.length === 0) {
104
+ console.log("No readables found");
105
+ return;
106
+ }
107
+ console.log(readables);
108
+ }
109
+ function logActions(context) {
110
+ console.log("%cCurrent Actions:", "font-size: 16px; font-weight: bold;");
111
+ if (Object.values(context.actions).length === 0) {
112
+ console.log("No actions found");
113
+ return;
114
+ }
115
+ for (const action of Object.values(context.actions)) {
116
+ console.group(action.name);
117
+ console.log("name", action.name);
118
+ console.log("description", action.description);
119
+ console.log("parameters", action.parameters);
120
+ console.groupEnd();
121
+ }
122
+ }
123
+ function logMessages(context) {
124
+ console.log("%cCurrent Messages:", "font-size: 16px; font-weight: bold;");
125
+ if (context.messages.length === 0) {
126
+ console.log("No messages found");
127
+ return;
128
+ }
129
+ const tableData = context.messages.map((message) => {
130
+ if (message.isTextMessage()) {
131
+ return {
132
+ id: message.id,
133
+ type: "TextMessage",
134
+ role: message.role,
135
+ name: void 0,
136
+ scope: void 0,
137
+ content: message.content
138
+ };
139
+ } else if (message.isActionExecutionMessage()) {
140
+ return {
141
+ id: message.id,
142
+ type: "ActionExecutionMessage",
143
+ role: void 0,
144
+ name: message.name,
145
+ scope: message.parentMessageId,
146
+ content: message.arguments
147
+ };
148
+ } else if (message.isResultMessage()) {
149
+ return {
150
+ id: message.id,
151
+ type: "ResultMessage",
152
+ role: void 0,
153
+ name: message.actionName,
154
+ scope: message.actionExecutionId,
155
+ content: message.result
156
+ };
157
+ } else if (message.isAgentStateMessage()) {
158
+ return {
159
+ id: message.id,
160
+ type: `AgentStateMessage (running: ${message.running})`,
161
+ role: message.role,
162
+ name: void 0,
163
+ scope: message.threadId,
164
+ content: message.state
165
+ };
166
+ }
167
+ });
168
+ console.table(tableData);
169
+ }
170
+
171
+ // src/components/dev-console/console.tsx
172
+ var import_react2 = require("react");
173
+
174
+ // src/components/dev-console/icons.tsx
175
+ var import_jsx_runtime = require("react/jsx-runtime");
176
+ var ExclamationMarkTriangleIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
177
+ "svg",
178
+ {
179
+ width: "13.3967723px",
180
+ height: "12px",
181
+ viewBox: "0 0 13.3967723 12",
182
+ version: "1.1",
183
+ xmlns: "http://www.w3.org/2000/svg",
184
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { id: "Page-1", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { id: "exclamation-triangle", fill: "#CD2121", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
185
+ "path",
186
+ {
187
+ d: "M5.39935802,0.75 C5.97670802,-0.25 7.42007802,-0.25 7.99742802,0.75 L13.193588,9.75 C13.770888,10.75 13.049288,12 11.894588,12 L1.50223802,12 C0.34753802,12 -0.37414898,10.75 0.20319802,9.75 L5.39935802,0.75 Z M6.69838802,2.5 C7.11260802,2.5 7.44838802,2.83579 7.44838802,3.25 L7.44838802,6.25 C7.44838802,6.66421 7.11260802,7 6.69838802,7 C6.28417802,7 5.94838802,6.66421 5.94838802,6.25 L5.94838802,3.25 C5.94838802,2.83579 6.28417802,2.5 6.69838802,2.5 Z M6.69838802,10.5 C7.25067802,10.5 7.69838802,10.0523 7.69838802,9.5 C7.69838802,8.9477 7.25067802,8.5 6.69838802,8.5 C6.14610802,8.5 5.69838802,8.9477 5.69838802,9.5 C5.69838802,10.0523 6.14610802,10.5 6.69838802,10.5 Z",
188
+ id: "Shape"
189
+ }
190
+ ) }) })
191
+ }
192
+ );
193
+ var ExclamationMarkIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
194
+ "svg",
195
+ {
196
+ width: "14px",
197
+ height: "14px",
198
+ viewBox: "0 0 14 14",
199
+ version: "1.1",
200
+ xmlns: "http://www.w3.org/2000/svg",
201
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { id: "Page-1", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { id: "exclamation-circle", fill: "#EC662C", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
202
+ "path",
203
+ {
204
+ d: "M7,14 C10.866,14 14,10.866 14,7 C14,3.13401 10.866,0 7,0 C3.13401,0 0,3.13401 0,7 C0,10.866 3.13401,14 7,14 Z M7,3 C7.41421,3 7.75,3.33579 7.75,3.75 L7.75,6.75 C7.75,7.16421 7.41421,7.5 7,7.5 C6.58579,7.5 6.25,7.16421 6.25,6.75 L6.25,3.75 C6.25,3.33579 6.58579,3 7,3 Z M7,11 C7.55228,11 8,10.5523 8,10 C8,9.4477 7.55228,9 7,9 C6.44772,9 6,9.4477 6,10 C6,10.5523 6.44772,11 7,11 Z",
205
+ id: "Shape"
206
+ }
207
+ ) }) })
208
+ }
209
+ );
210
+ var ChevronDownIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
211
+ "svg",
212
+ {
213
+ width: "7px",
214
+ height: "4px",
215
+ viewBox: "0 0 7 4",
216
+ version: "1.1",
217
+ xmlns: "http://www.w3.org/2000/svg",
218
+ fill: "currentColor",
219
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { id: "Page-1", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { id: "Group", fill: "currentColor", fillRule: "nonzero", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
220
+ "path",
221
+ {
222
+ d: "M3.71690723,3.90271086 C3.59268176,4.03242971 3.39143629,4.03242971 3.26721082,3.90271086 L0.0853966595,0.57605615 C-0.0314221035,0.444981627 -0.0279751448,0.240725043 0.0931934622,0.114040675 C0.214362069,-0.0126436935 0.409725445,-0.0162475626 0.535093061,0.105888951 L3.49205902,3.19746006 L6.44902499,0.105888951 C6.52834574,0.0168884389 6.64780588,-0.0197473458 6.7605411,0.0103538404 C6.87327633,0.0404550266 6.96130636,0.132492308 6.99009696,0.250359396 C7.01888756,0.368226483 6.98384687,0.493124608 6.89872139,0.57605615 L3.71690723,3.90271086 Z",
223
+ id: "Path"
224
+ }
225
+ ) }) })
226
+ }
227
+ );
228
+ var CheckIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
229
+ "svg",
230
+ {
231
+ width: "14px",
232
+ height: "14px",
233
+ viewBox: "0 0 14 14",
234
+ version: "1.1",
235
+ xmlns: "http://www.w3.org/2000/svg",
236
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { id: "Page-1", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { id: "Group-2", transform: "translate(-118, 0)", fill: "#1BC030", fillRule: "nonzero", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { id: "Group", transform: "translate(118, 0)", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
237
+ "path",
238
+ {
239
+ d: "M0,7 C0,3.13384615 3.13384615,0 7,0 C10.8661538,0 14,3.13384615 14,7 C14,10.8661538 10.8661538,14 7,14 C3.13384615,14 0,10.8661538 0,7 Z M9.59179487,5.69764103 C9.70905818,5.54139023 9.73249341,5.33388318 9.65303227,5.15541491 C9.57357113,4.97694665 9.40367989,4.85551619 9.20909814,4.83811118 C9.01451638,4.82070616 8.82577109,4.91005717 8.71589744,5.07158974 L6.39261538,8.32389744 L5.22666667,7.15794872 C5.01450582,6.96025518 4.68389046,6.9660885 4.47883563,7.17114332 C4.27378081,7.37619815 4.26794748,7.70681351 4.46564103,7.91897436 L6.08102564,9.53435897 C6.19289944,9.64614839 6.3482622,9.70310251 6.50588106,9.69010587 C6.66349993,9.67710922 6.80743532,9.59547613 6.89948718,9.46687179 L9.59179487,5.69764103 L9.59179487,5.69764103 Z",
240
+ id: "Shape"
241
+ }
242
+ ) }) }) })
243
+ }
244
+ );
245
+
246
+ // src/components/dev-console/console.tsx
247
+ var import_react3 = require("@headlessui/react");
248
+ var import_shared = require("@copilotkit/shared");
249
+
250
+ // src/components/chat/Icons.tsx
251
+ var import_jsx_runtime2 = require("react/jsx-runtime");
252
+ var SmallSpinnerIcon = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "copilotKitSpinner", style: { width: "13px", height: "13px" } });
253
+
254
+ // src/components/help-modal/modal.tsx
255
+ var import_react = require("react");
256
+
257
+ // src/components/help-modal/icons.tsx
258
+ var import_jsx_runtime3 = require("react/jsx-runtime");
259
+ var CloseIcon = () => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
260
+ "svg",
261
+ {
262
+ xmlns: "http://www.w3.org/2000/svg",
263
+ fill: "none",
264
+ viewBox: "0 0 24 24",
265
+ strokeWidth: "1.5",
266
+ stroke: "currentColor",
267
+ width: "20",
268
+ height: "20",
269
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
270
+ }
271
+ );
272
+
273
+ // src/components/help-modal/modal.tsx
274
+ var import_jsx_runtime4 = require("react/jsx-runtime");
275
+ function CopilotKitHelpModal() {
276
+ const [showHelpModal, setShowHelpModal] = (0, import_react.useState)(false);
277
+ const buttonRef = (0, import_react.useRef)(null);
278
+ const popoverRef = (0, import_react.useRef)(null);
279
+ (0, import_react.useEffect)(() => {
280
+ const handleClickOutside = (event) => {
281
+ if (popoverRef.current && !popoverRef.current.contains(event.target) && buttonRef.current && !buttonRef.current.contains(event.target)) {
282
+ setShowHelpModal(false);
283
+ }
284
+ };
285
+ if (showHelpModal) {
286
+ document.addEventListener("mousedown", handleClickOutside);
287
+ }
288
+ return () => {
289
+ document.removeEventListener("mousedown", handleClickOutside);
290
+ };
291
+ }, [showHelpModal]);
292
+ const HelpButton = () => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
293
+ "button",
294
+ {
295
+ ref: buttonRef,
296
+ onClick: () => setShowHelpModal(!showHelpModal),
297
+ className: "copilotKitDebugMenuTriggerButton relative",
298
+ "aria-label": "Open Help",
299
+ children: "Help"
300
+ }
301
+ );
302
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "relative", children: [
303
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(HelpButton, {}),
304
+ showHelpModal && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
305
+ "div",
306
+ {
307
+ ref: popoverRef,
308
+ className: "absolute mt-2 z-50",
309
+ style: {
310
+ top: "100%",
311
+ right: "-120px",
312
+ width: "380px"
313
+ },
314
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "copilotKitHelpModal rounded-lg shadow-xl w-full p-4 flex-col relative", children: [
315
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
316
+ "button",
317
+ {
318
+ className: "copilotKitHelpModalCloseButton absolute text-gray-400 hover:text-gray-600 focus:outline-none",
319
+ style: { top: "10px", right: "10px" },
320
+ onClick: () => setShowHelpModal(false),
321
+ "aria-label": "Close",
322
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CloseIcon, {})
323
+ }
324
+ ),
325
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "w-full flex mb-6 justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h2", { className: "text-2xl font-bold", children: "Help Options" }) }),
326
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "space-y-4 mb-4", children: [
327
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "copilotKitHelpItemButton", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
328
+ "a",
329
+ {
330
+ href: "https://docs.copilotkit.ai/coagents/troubleshooting/common-issues",
331
+ target: "_blank",
332
+ rel: "noopener noreferrer",
333
+ children: "Visit the Troubleshooting and FAQ section in the docs"
334
+ }
335
+ ) }),
336
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "copilotKitHelpItemButton", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
337
+ "a",
338
+ {
339
+ href: "https://go.copilotkit.ai/dev-console-support-discord",
340
+ target: "_blank",
341
+ rel: "noopener noreferrer",
342
+ children: "Go to Discord Support Channel (Community Support)"
343
+ }
344
+ ) }),
345
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "copilotKitHelpItemButton", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
346
+ "a",
347
+ {
348
+ href: "https://go.copilotkit.ai/dev-console-support-slack",
349
+ target: "_blank",
350
+ rel: "noopener noreferrer",
351
+ children: "Apply for Priority Direct Slack Support"
352
+ }
353
+ ) })
354
+ ] })
355
+ ] })
356
+ }
357
+ )
358
+ ] });
359
+ }
360
+
361
+ // src/components/dev-console/console.tsx
362
+ var import_jsx_runtime5 = require("react/jsx-runtime");
363
+ function CopilotDevConsole() {
364
+ const currentVersion = import_shared.COPILOTKIT_VERSION;
365
+ const context = (0, import_react_core3.useCopilotContext)();
366
+ const [showDevConsole, setShowDevConsole] = (0, import_react2.useState)(false);
367
+ (0, import_react2.useEffect)(() => {
368
+ setShowDevConsole((0, import_react_core2.shouldShowDevConsole)(context.showDevConsole));
369
+ }, [context.showDevConsole]);
370
+ const dontRunTwiceInDevMode = (0, import_react2.useRef)(false);
371
+ const [versionStatus, setVersionStatus] = (0, import_react2.useState)("unknown");
372
+ const [latestVersion, setLatestVersion] = (0, import_react2.useState)("");
373
+ const consoleRef = (0, import_react2.useRef)(null);
374
+ const [debugButtonMode, setDebugButtonMode] = (0, import_react2.useState)("full");
375
+ const checkForUpdates = (force = false) => {
376
+ setVersionStatus("checking");
377
+ getPublishedCopilotKitVersion(currentVersion, force).then((v) => {
378
+ setLatestVersion(v.latest);
379
+ let versionOk = false;
380
+ if (v.current === v.latest) {
381
+ versionOk = true;
382
+ } else if (/[a-zA-Z]/.test(v.current)) {
383
+ versionOk = true;
384
+ }
385
+ if (versionOk) {
386
+ setVersionStatus("latest");
387
+ } else if (v.severity !== "low") {
388
+ setVersionStatus("outdated");
389
+ } else {
390
+ setVersionStatus("update-available");
391
+ }
392
+ }).catch((e) => {
393
+ console.error(e);
394
+ setVersionStatus("unknown");
395
+ });
396
+ };
397
+ (0, import_react2.useEffect)(() => {
398
+ if (dontRunTwiceInDevMode.current === true) {
399
+ return;
400
+ }
401
+ dontRunTwiceInDevMode.current = true;
402
+ checkForUpdates();
403
+ }, []);
404
+ if (!showDevConsole) {
405
+ return null;
406
+ }
407
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
408
+ "div",
409
+ {
410
+ ref: consoleRef,
411
+ className: "copilotKitDevConsole " + (versionStatus === "update-available" ? "copilotKitDevConsoleUpgrade" : "") + (versionStatus === "outdated" ? "copilotKitDevConsoleWarnOutdated" : ""),
412
+ children: [
413
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
414
+ VersionInfo,
415
+ {
416
+ showDevConsole: context.showDevConsole,
417
+ versionStatus,
418
+ currentVersion,
419
+ latestVersion
420
+ }
421
+ ),
422
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CopilotKitHelpModal, {}),
423
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
424
+ DebugMenuButton,
425
+ {
426
+ setShowDevConsole,
427
+ checkForUpdates,
428
+ mode: debugButtonMode
429
+ }
430
+ )
431
+ ]
432
+ }
433
+ );
434
+ }
435
+ function VersionInfo({
436
+ showDevConsole,
437
+ versionStatus,
438
+ currentVersion,
439
+ latestVersion
440
+ }) {
441
+ const [copyStatus, setCopyStatus] = (0, import_react2.useState)("");
442
+ let versionLabel = "";
443
+ let versionIcon = "";
444
+ let currentVersionLabel = currentVersion;
445
+ if (versionStatus === "latest") {
446
+ versionLabel = "latest";
447
+ versionIcon = CheckIcon;
448
+ } else if (versionStatus === "checking") {
449
+ versionLabel = "checking";
450
+ versionIcon = SmallSpinnerIcon;
451
+ } else if (versionStatus === "update-available") {
452
+ versionLabel = "update available";
453
+ versionIcon = ExclamationMarkIcon;
454
+ currentVersionLabel = `${currentVersion} \u2192 ${latestVersion}`;
455
+ } else if (versionStatus === "outdated") {
456
+ versionLabel = "outdated";
457
+ versionIcon = ExclamationMarkTriangleIcon;
458
+ currentVersionLabel = `${currentVersion} \u2192 ${latestVersion}`;
459
+ }
460
+ let asideLabel = "";
461
+ if (showDevConsole === true) {
462
+ asideLabel = "(enabled)";
463
+ }
464
+ const installCommand = [
465
+ `npm install`,
466
+ `@copilotkit/react-core@${latestVersion}`,
467
+ `@copilotkit/react-ui@${latestVersion}`,
468
+ `@copilotkit/react-textarea@${latestVersion}`,
469
+ `&& npm install @copilotkit/runtime@${latestVersion}`
470
+ ].join(" ");
471
+ const handleCopyClick = () => {
472
+ navigator.clipboard.writeText(installCommand.trim()).then(() => {
473
+ setCopyStatus("Command copied to clipboard!");
474
+ setTimeout(() => setCopyStatus(""), 1e3);
475
+ });
476
+ };
477
+ if (versionStatus === "update-available" || versionStatus === "outdated") {
478
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "copilotKitVersionInfo", children: [
479
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { children: [
480
+ currentVersionLabel,
481
+ " ",
482
+ versionIcon
483
+ ] }),
484
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { onClick: handleCopyClick, children: copyStatus || installCommand })
485
+ ] });
486
+ }
487
+ return null;
488
+ }
489
+ function DebugMenuButton({
490
+ setShowDevConsole,
491
+ checkForUpdates,
492
+ mode
493
+ }) {
494
+ const context = (0, import_react_core3.useCopilotContext)();
495
+ const messagesContext = (0, import_react_core3.useCopilotMessagesContext)();
496
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react3.Menu, { children: [
497
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
498
+ import_react3.MenuButton,
499
+ {
500
+ className: `copilotKitDebugMenuTriggerButton ${mode === "compact" ? "compact" : ""}`,
501
+ children: mode == "compact" ? "Debug" : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
502
+ "Debug ",
503
+ ChevronDownIcon
504
+ ] })
505
+ }
506
+ ),
507
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
508
+ import_react3.MenuItems,
509
+ {
510
+ transition: true,
511
+ anchor: "bottom end",
512
+ className: "copilotKitDebugMenu",
513
+ style: { zIndex: 40 },
514
+ children: [
515
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react3.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { className: "copilotKitDebugMenuItem", onClick: () => logReadables(context), children: "Log Readables" }) }),
516
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react3.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { className: "copilotKitDebugMenuItem", onClick: () => logActions(context), children: "Log Actions" }) }),
517
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react3.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
518
+ "button",
519
+ {
520
+ className: "copilotKitDebugMenuItem",
521
+ onClick: () => logMessages(messagesContext),
522
+ children: "Log Messages"
523
+ }
524
+ ) }),
525
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react3.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { className: "copilotKitDebugMenuItem", onClick: () => checkForUpdates(true), children: "Check for Updates" }) }),
526
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("hr", {}),
527
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react3.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { className: "copilotKitDebugMenuItem", onClick: () => setShowDevConsole(false), children: "Hide Dev Console" }) })
528
+ ]
529
+ }
530
+ )
531
+ ] }) });
532
+ }
533
+ // Annotate the CommonJS export names for ESM import in node:
534
+ 0 && (module.exports = {
535
+ CopilotDevConsole
536
+ });
537
+ //# sourceMappingURL=console.js.map