@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
+ 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
+ var __async = (__this, __arguments, generator) => {
20
+ return new Promise((resolve, reject) => {
21
+ var fulfilled = (value) => {
22
+ try {
23
+ step(generator.next(value));
24
+ } catch (e) {
25
+ reject(e);
26
+ }
27
+ };
28
+ var rejected = (value) => {
29
+ try {
30
+ step(generator.throw(value));
31
+ } catch (e) {
32
+ reject(e);
33
+ }
34
+ };
35
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
36
+ step((generator = generator.apply(__this, __arguments)).next());
37
+ });
38
+ };
39
+
40
+ // src/components/dev-console/index.tsx
41
+ var dev_console_exports = {};
42
+ __export(dev_console_exports, {
43
+ CopilotDevConsole: () => CopilotDevConsole,
44
+ shouldShowDevConsole: () => import_react_core2.shouldShowDevConsole
45
+ });
46
+ module.exports = __toCommonJS(dev_console_exports);
47
+
48
+ // src/components/dev-console/utils.ts
49
+ var import_react_core = require("@copilotkit/react-core");
50
+ var import_react_core2 = require("@copilotkit/react-core");
51
+ function getPublishedCopilotKitVersion(current, forceCheck = false) {
52
+ return __async(this, null, function* () {
53
+ const LOCAL_STORAGE_KEY = "__copilotkit_version_check__";
54
+ const serializedVersion = localStorage.getItem(LOCAL_STORAGE_KEY);
55
+ if (serializedVersion && !forceCheck) {
56
+ try {
57
+ const parsedVersion = JSON.parse(serializedVersion);
58
+ const oneHour = 60 * 60 * 1e3;
59
+ const now = (/* @__PURE__ */ new Date()).getTime();
60
+ if (parsedVersion.current === current && now - new Date(parsedVersion.lastChecked).getTime() < oneHour) {
61
+ return parsedVersion;
62
+ }
63
+ } catch (error) {
64
+ console.error("Failed to parse CopilotKitVersion from localStorage", error);
65
+ }
66
+ }
67
+ try {
68
+ const response = yield fetch("https://api.cloud.copilotkit.ai/check-for-updates", {
69
+ method: "POST",
70
+ headers: {
71
+ "Content-Type": "application/json"
72
+ },
73
+ body: JSON.stringify({
74
+ packages: [
75
+ {
76
+ packageName: "@copilotkit/shared",
77
+ packageVersion: current
78
+ }
79
+ ]
80
+ })
81
+ });
82
+ const data = yield response.json();
83
+ const version = {
84
+ current,
85
+ lastChecked: (/* @__PURE__ */ new Date()).getTime(),
86
+ latest: data.packages[0].latestVersion,
87
+ severity: data.packages[0].severity,
88
+ advisory: data.packages[0].advisory || null
89
+ };
90
+ localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(version));
91
+ return version;
92
+ } catch (error) {
93
+ console.error("Failed to check for updates", error);
94
+ throw error;
95
+ }
96
+ });
97
+ }
98
+ function logReadables(context) {
99
+ console.log("%cCurrent Readables:", "font-size: 16px; font-weight: bold;");
100
+ const readables = context.getContextString([], import_react_core.defaultCopilotContextCategories).trim();
101
+ if (readables.length === 0) {
102
+ console.log("No readables found");
103
+ return;
104
+ }
105
+ console.log(readables);
106
+ }
107
+ function logActions(context) {
108
+ console.log("%cCurrent Actions:", "font-size: 16px; font-weight: bold;");
109
+ if (Object.values(context.actions).length === 0) {
110
+ console.log("No actions found");
111
+ return;
112
+ }
113
+ for (const action of Object.values(context.actions)) {
114
+ console.group(action.name);
115
+ console.log("name", action.name);
116
+ console.log("description", action.description);
117
+ console.log("parameters", action.parameters);
118
+ console.groupEnd();
119
+ }
120
+ }
121
+ function logMessages(context) {
122
+ console.log("%cCurrent Messages:", "font-size: 16px; font-weight: bold;");
123
+ if (context.messages.length === 0) {
124
+ console.log("No messages found");
125
+ return;
126
+ }
127
+ const tableData = context.messages.map((message) => {
128
+ if (message.isTextMessage()) {
129
+ return {
130
+ id: message.id,
131
+ type: "TextMessage",
132
+ role: message.role,
133
+ name: void 0,
134
+ scope: void 0,
135
+ content: message.content
136
+ };
137
+ } else if (message.isActionExecutionMessage()) {
138
+ return {
139
+ id: message.id,
140
+ type: "ActionExecutionMessage",
141
+ role: void 0,
142
+ name: message.name,
143
+ scope: message.parentMessageId,
144
+ content: message.arguments
145
+ };
146
+ } else if (message.isResultMessage()) {
147
+ return {
148
+ id: message.id,
149
+ type: "ResultMessage",
150
+ role: void 0,
151
+ name: message.actionName,
152
+ scope: message.actionExecutionId,
153
+ content: message.result
154
+ };
155
+ } else if (message.isAgentStateMessage()) {
156
+ return {
157
+ id: message.id,
158
+ type: `AgentStateMessage (running: ${message.running})`,
159
+ role: message.role,
160
+ name: void 0,
161
+ scope: message.threadId,
162
+ content: message.state
163
+ };
164
+ }
165
+ });
166
+ console.table(tableData);
167
+ }
168
+
169
+ // src/components/dev-console/console.tsx
170
+ var import_react_core3 = require("@copilotkit/react-core");
171
+ var import_react2 = require("react");
172
+
173
+ // src/components/dev-console/icons.tsx
174
+ var import_jsx_runtime = require("react/jsx-runtime");
175
+ var ExclamationMarkTriangleIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
176
+ "svg",
177
+ {
178
+ width: "13.3967723px",
179
+ height: "12px",
180
+ viewBox: "0 0 13.3967723 12",
181
+ version: "1.1",
182
+ xmlns: "http://www.w3.org/2000/svg",
183
+ 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)(
184
+ "path",
185
+ {
186
+ 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",
187
+ id: "Shape"
188
+ }
189
+ ) }) })
190
+ }
191
+ );
192
+ var ExclamationMarkIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
193
+ "svg",
194
+ {
195
+ width: "14px",
196
+ height: "14px",
197
+ viewBox: "0 0 14 14",
198
+ version: "1.1",
199
+ xmlns: "http://www.w3.org/2000/svg",
200
+ 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)(
201
+ "path",
202
+ {
203
+ 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",
204
+ id: "Shape"
205
+ }
206
+ ) }) })
207
+ }
208
+ );
209
+ var ChevronDownIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
210
+ "svg",
211
+ {
212
+ width: "7px",
213
+ height: "4px",
214
+ viewBox: "0 0 7 4",
215
+ version: "1.1",
216
+ xmlns: "http://www.w3.org/2000/svg",
217
+ fill: "currentColor",
218
+ 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)(
219
+ "path",
220
+ {
221
+ 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",
222
+ id: "Path"
223
+ }
224
+ ) }) })
225
+ }
226
+ );
227
+ var CheckIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
228
+ "svg",
229
+ {
230
+ width: "14px",
231
+ height: "14px",
232
+ viewBox: "0 0 14 14",
233
+ version: "1.1",
234
+ xmlns: "http://www.w3.org/2000/svg",
235
+ 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)(
236
+ "path",
237
+ {
238
+ 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",
239
+ id: "Shape"
240
+ }
241
+ ) }) }) })
242
+ }
243
+ );
244
+
245
+ // src/components/dev-console/console.tsx
246
+ var import_react3 = require("@headlessui/react");
247
+ var import_shared = require("@copilotkit/shared");
248
+
249
+ // src/components/chat/Icons.tsx
250
+ var import_jsx_runtime2 = require("react/jsx-runtime");
251
+ var SmallSpinnerIcon = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "copilotKitSpinner", style: { width: "13px", height: "13px" } });
252
+
253
+ // src/components/help-modal/modal.tsx
254
+ var import_react = require("react");
255
+
256
+ // src/components/help-modal/icons.tsx
257
+ var import_jsx_runtime3 = require("react/jsx-runtime");
258
+ var CloseIcon = () => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
259
+ "svg",
260
+ {
261
+ xmlns: "http://www.w3.org/2000/svg",
262
+ fill: "none",
263
+ viewBox: "0 0 24 24",
264
+ strokeWidth: "1.5",
265
+ stroke: "currentColor",
266
+ width: "20",
267
+ height: "20",
268
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
269
+ }
270
+ );
271
+
272
+ // src/components/help-modal/modal.tsx
273
+ var import_jsx_runtime4 = require("react/jsx-runtime");
274
+ function CopilotKitHelpModal() {
275
+ const [showHelpModal, setShowHelpModal] = (0, import_react.useState)(false);
276
+ const buttonRef = (0, import_react.useRef)(null);
277
+ const popoverRef = (0, import_react.useRef)(null);
278
+ (0, import_react.useEffect)(() => {
279
+ const handleClickOutside = (event) => {
280
+ if (popoverRef.current && !popoverRef.current.contains(event.target) && buttonRef.current && !buttonRef.current.contains(event.target)) {
281
+ setShowHelpModal(false);
282
+ }
283
+ };
284
+ if (showHelpModal) {
285
+ document.addEventListener("mousedown", handleClickOutside);
286
+ }
287
+ return () => {
288
+ document.removeEventListener("mousedown", handleClickOutside);
289
+ };
290
+ }, [showHelpModal]);
291
+ const HelpButton = () => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
292
+ "button",
293
+ {
294
+ ref: buttonRef,
295
+ onClick: () => setShowHelpModal(!showHelpModal),
296
+ className: "copilotKitDebugMenuTriggerButton relative",
297
+ "aria-label": "Open Help",
298
+ children: "Help"
299
+ }
300
+ );
301
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "relative", children: [
302
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(HelpButton, {}),
303
+ showHelpModal && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
304
+ "div",
305
+ {
306
+ ref: popoverRef,
307
+ className: "absolute mt-2 z-50",
308
+ style: {
309
+ top: "100%",
310
+ right: "-120px",
311
+ width: "380px"
312
+ },
313
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "copilotKitHelpModal rounded-lg shadow-xl w-full p-4 flex-col relative", children: [
314
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
315
+ "button",
316
+ {
317
+ className: "copilotKitHelpModalCloseButton absolute text-gray-400 hover:text-gray-600 focus:outline-none",
318
+ style: { top: "10px", right: "10px" },
319
+ onClick: () => setShowHelpModal(false),
320
+ "aria-label": "Close",
321
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CloseIcon, {})
322
+ }
323
+ ),
324
+ /* @__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" }) }),
325
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "space-y-4 mb-4", children: [
326
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "copilotKitHelpItemButton", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
327
+ "a",
328
+ {
329
+ href: "https://docs.copilotkit.ai/coagents/troubleshooting/common-issues",
330
+ target: "_blank",
331
+ rel: "noopener noreferrer",
332
+ children: "Visit the Troubleshooting and FAQ section in the docs"
333
+ }
334
+ ) }),
335
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "copilotKitHelpItemButton", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
336
+ "a",
337
+ {
338
+ href: "https://go.copilotkit.ai/dev-console-support-discord",
339
+ target: "_blank",
340
+ rel: "noopener noreferrer",
341
+ children: "Go to Discord Support Channel (Community Support)"
342
+ }
343
+ ) }),
344
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "copilotKitHelpItemButton", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
345
+ "a",
346
+ {
347
+ href: "https://go.copilotkit.ai/dev-console-support-slack",
348
+ target: "_blank",
349
+ rel: "noopener noreferrer",
350
+ children: "Apply for Priority Direct Slack Support"
351
+ }
352
+ ) })
353
+ ] })
354
+ ] })
355
+ }
356
+ )
357
+ ] });
358
+ }
359
+
360
+ // src/components/dev-console/console.tsx
361
+ var import_jsx_runtime5 = require("react/jsx-runtime");
362
+ function CopilotDevConsole() {
363
+ const currentVersion = import_shared.COPILOTKIT_VERSION;
364
+ const context = (0, import_react_core3.useCopilotContext)();
365
+ const [showDevConsole, setShowDevConsole] = (0, import_react2.useState)(false);
366
+ (0, import_react2.useEffect)(() => {
367
+ setShowDevConsole((0, import_react_core2.shouldShowDevConsole)(context.showDevConsole));
368
+ }, [context.showDevConsole]);
369
+ const dontRunTwiceInDevMode = (0, import_react2.useRef)(false);
370
+ const [versionStatus, setVersionStatus] = (0, import_react2.useState)("unknown");
371
+ const [latestVersion, setLatestVersion] = (0, import_react2.useState)("");
372
+ const consoleRef = (0, import_react2.useRef)(null);
373
+ const [debugButtonMode, setDebugButtonMode] = (0, import_react2.useState)("full");
374
+ const checkForUpdates = (force = false) => {
375
+ setVersionStatus("checking");
376
+ getPublishedCopilotKitVersion(currentVersion, force).then((v) => {
377
+ setLatestVersion(v.latest);
378
+ let versionOk = false;
379
+ if (v.current === v.latest) {
380
+ versionOk = true;
381
+ } else if (/[a-zA-Z]/.test(v.current)) {
382
+ versionOk = true;
383
+ }
384
+ if (versionOk) {
385
+ setVersionStatus("latest");
386
+ } else if (v.severity !== "low") {
387
+ setVersionStatus("outdated");
388
+ } else {
389
+ setVersionStatus("update-available");
390
+ }
391
+ }).catch((e) => {
392
+ console.error(e);
393
+ setVersionStatus("unknown");
394
+ });
395
+ };
396
+ (0, import_react2.useEffect)(() => {
397
+ if (dontRunTwiceInDevMode.current === true) {
398
+ return;
399
+ }
400
+ dontRunTwiceInDevMode.current = true;
401
+ checkForUpdates();
402
+ }, []);
403
+ if (!showDevConsole) {
404
+ return null;
405
+ }
406
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
407
+ "div",
408
+ {
409
+ ref: consoleRef,
410
+ className: "copilotKitDevConsole " + (versionStatus === "update-available" ? "copilotKitDevConsoleUpgrade" : "") + (versionStatus === "outdated" ? "copilotKitDevConsoleWarnOutdated" : ""),
411
+ children: [
412
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
413
+ VersionInfo,
414
+ {
415
+ showDevConsole: context.showDevConsole,
416
+ versionStatus,
417
+ currentVersion,
418
+ latestVersion
419
+ }
420
+ ),
421
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CopilotKitHelpModal, {}),
422
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
423
+ DebugMenuButton,
424
+ {
425
+ setShowDevConsole,
426
+ checkForUpdates,
427
+ mode: debugButtonMode
428
+ }
429
+ )
430
+ ]
431
+ }
432
+ );
433
+ }
434
+ function VersionInfo({
435
+ showDevConsole,
436
+ versionStatus,
437
+ currentVersion,
438
+ latestVersion
439
+ }) {
440
+ const [copyStatus, setCopyStatus] = (0, import_react2.useState)("");
441
+ let versionLabel = "";
442
+ let versionIcon = "";
443
+ let currentVersionLabel = currentVersion;
444
+ if (versionStatus === "latest") {
445
+ versionLabel = "latest";
446
+ versionIcon = CheckIcon;
447
+ } else if (versionStatus === "checking") {
448
+ versionLabel = "checking";
449
+ versionIcon = SmallSpinnerIcon;
450
+ } else if (versionStatus === "update-available") {
451
+ versionLabel = "update available";
452
+ versionIcon = ExclamationMarkIcon;
453
+ currentVersionLabel = `${currentVersion} \u2192 ${latestVersion}`;
454
+ } else if (versionStatus === "outdated") {
455
+ versionLabel = "outdated";
456
+ versionIcon = ExclamationMarkTriangleIcon;
457
+ currentVersionLabel = `${currentVersion} \u2192 ${latestVersion}`;
458
+ }
459
+ let asideLabel = "";
460
+ if (showDevConsole === true) {
461
+ asideLabel = "(enabled)";
462
+ }
463
+ const installCommand = [
464
+ `npm install`,
465
+ `@copilotkit/react-core@${latestVersion}`,
466
+ `@copilotkit/react-ui@${latestVersion}`,
467
+ `@copilotkit/react-textarea@${latestVersion}`,
468
+ `&& npm install @copilotkit/runtime@${latestVersion}`
469
+ ].join(" ");
470
+ const handleCopyClick = () => {
471
+ navigator.clipboard.writeText(installCommand.trim()).then(() => {
472
+ setCopyStatus("Command copied to clipboard!");
473
+ setTimeout(() => setCopyStatus(""), 1e3);
474
+ });
475
+ };
476
+ if (versionStatus === "update-available" || versionStatus === "outdated") {
477
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "copilotKitVersionInfo", children: [
478
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { children: [
479
+ currentVersionLabel,
480
+ " ",
481
+ versionIcon
482
+ ] }),
483
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { onClick: handleCopyClick, children: copyStatus || installCommand })
484
+ ] });
485
+ }
486
+ return null;
487
+ }
488
+ function DebugMenuButton({
489
+ setShowDevConsole,
490
+ checkForUpdates,
491
+ mode
492
+ }) {
493
+ const context = (0, import_react_core3.useCopilotContext)();
494
+ const messagesContext = (0, import_react_core3.useCopilotMessagesContext)();
495
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react3.Menu, { children: [
496
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
497
+ import_react3.MenuButton,
498
+ {
499
+ className: `copilotKitDebugMenuTriggerButton ${mode === "compact" ? "compact" : ""}`,
500
+ children: mode == "compact" ? "Debug" : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
501
+ "Debug ",
502
+ ChevronDownIcon
503
+ ] })
504
+ }
505
+ ),
506
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
507
+ import_react3.MenuItems,
508
+ {
509
+ transition: true,
510
+ anchor: "bottom end",
511
+ className: "copilotKitDebugMenu",
512
+ style: { zIndex: 40 },
513
+ children: [
514
+ /* @__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" }) }),
515
+ /* @__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" }) }),
516
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react3.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
517
+ "button",
518
+ {
519
+ className: "copilotKitDebugMenuItem",
520
+ onClick: () => logMessages(messagesContext),
521
+ children: "Log Messages"
522
+ }
523
+ ) }),
524
+ /* @__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" }) }),
525
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("hr", {}),
526
+ /* @__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" }) })
527
+ ]
528
+ }
529
+ )
530
+ ] }) });
531
+ }
532
+ // Annotate the CommonJS export names for ESM import in node:
533
+ 0 && (module.exports = {
534
+ CopilotDevConsole,
535
+ shouldShowDevConsole
536
+ });
537
+ //# sourceMappingURL=index.js.map