@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.
- package/CHANGELOG.md +17415 -0
- package/LICENSE +21 -0
- package/README.md +141 -0
- package/dist/chunk-3W6J75HS.mjs +126 -0
- package/dist/chunk-3W6J75HS.mjs.map +1 -0
- package/dist/chunk-54JAUBUJ.mjs +26 -0
- package/dist/chunk-54JAUBUJ.mjs.map +1 -0
- package/dist/chunk-7OURDQZJ.mjs +133 -0
- package/dist/chunk-7OURDQZJ.mjs.map +1 -0
- package/dist/chunk-7PR2KJDO.mjs +222 -0
- package/dist/chunk-7PR2KJDO.mjs.map +1 -0
- package/dist/chunk-BH6PCAAL.mjs +81 -0
- package/dist/chunk-BH6PCAAL.mjs.map +1 -0
- package/dist/chunk-C3GSYRC3.mjs +118 -0
- package/dist/chunk-C3GSYRC3.mjs.map +1 -0
- package/dist/chunk-DBKRAOH7.mjs +34 -0
- package/dist/chunk-DBKRAOH7.mjs.map +1 -0
- package/dist/chunk-EFZPSZWO.mjs +1 -0
- package/dist/chunk-EFZPSZWO.mjs.map +1 -0
- package/dist/chunk-ELGRNEAO.mjs +32 -0
- package/dist/chunk-ELGRNEAO.mjs.map +1 -0
- package/dist/chunk-ELUJRANC.mjs +21 -0
- package/dist/chunk-ELUJRANC.mjs.map +1 -0
- package/dist/chunk-FFJHOZX6.mjs +202 -0
- package/dist/chunk-FFJHOZX6.mjs.map +1 -0
- package/dist/chunk-GDSZGYCE.mjs +32 -0
- package/dist/chunk-GDSZGYCE.mjs.map +1 -0
- package/dist/chunk-HIW7RXCD.mjs +184 -0
- package/dist/chunk-HIW7RXCD.mjs.map +1 -0
- package/dist/chunk-IEMQ2SQW.mjs +93 -0
- package/dist/chunk-IEMQ2SQW.mjs.map +1 -0
- package/dist/chunk-IHFR6PYG.mjs +116 -0
- package/dist/chunk-IHFR6PYG.mjs.map +1 -0
- package/dist/chunk-IK2BPURM.mjs +400 -0
- package/dist/chunk-IK2BPURM.mjs.map +1 -0
- package/dist/chunk-IU3WTXLQ.mjs +1 -0
- package/dist/chunk-IU3WTXLQ.mjs.map +1 -0
- package/dist/chunk-JGMFJZMG.mjs +11 -0
- package/dist/chunk-JGMFJZMG.mjs.map +1 -0
- package/dist/chunk-JY2CSDKN.mjs +135 -0
- package/dist/chunk-JY2CSDKN.mjs.map +1 -0
- package/dist/chunk-JZ3RFQQ6.mjs +128 -0
- package/dist/chunk-JZ3RFQQ6.mjs.map +1 -0
- package/dist/chunk-KXE2JCUH.mjs +1 -0
- package/dist/chunk-KXE2JCUH.mjs.map +1 -0
- package/dist/chunk-LQEFRHRT.mjs +30 -0
- package/dist/chunk-LQEFRHRT.mjs.map +1 -0
- package/dist/chunk-MMVDU6DF.mjs +1 -0
- package/dist/chunk-MMVDU6DF.mjs.map +1 -0
- package/dist/chunk-MRXNTQOX.mjs +59 -0
- package/dist/chunk-MRXNTQOX.mjs.map +1 -0
- package/dist/chunk-NCIAFFQ2.mjs +82 -0
- package/dist/chunk-NCIAFFQ2.mjs.map +1 -0
- package/dist/chunk-NGJ32FAP.mjs +30 -0
- package/dist/chunk-NGJ32FAP.mjs.map +1 -0
- package/dist/chunk-NRA3CFEE.mjs +97 -0
- package/dist/chunk-NRA3CFEE.mjs.map +1 -0
- package/dist/chunk-O72ZB5V3.mjs +140 -0
- package/dist/chunk-O72ZB5V3.mjs.map +1 -0
- package/dist/chunk-PLHTVHUW.mjs +82 -0
- package/dist/chunk-PLHTVHUW.mjs.map +1 -0
- package/dist/chunk-Q5V6S67N.mjs +103 -0
- package/dist/chunk-Q5V6S67N.mjs.map +1 -0
- package/dist/chunk-QB3GUN2N.mjs +31 -0
- package/dist/chunk-QB3GUN2N.mjs.map +1 -0
- package/dist/chunk-QIOJXTIQ.mjs +64 -0
- package/dist/chunk-QIOJXTIQ.mjs.map +1 -0
- package/dist/chunk-QPQRLXN3.mjs +435 -0
- package/dist/chunk-QPQRLXN3.mjs.map +1 -0
- package/dist/chunk-RYUCX3ZK.mjs +32 -0
- package/dist/chunk-RYUCX3ZK.mjs.map +1 -0
- package/dist/chunk-SC6JRFAJ.mjs +1 -0
- package/dist/chunk-SC6JRFAJ.mjs.map +1 -0
- package/dist/chunk-T26KLXLH.mjs +1 -0
- package/dist/chunk-T26KLXLH.mjs.map +1 -0
- package/dist/chunk-UFN2VWSR.mjs +25 -0
- package/dist/chunk-UFN2VWSR.mjs.map +1 -0
- package/dist/chunk-V7W6IM2V.mjs +1 -0
- package/dist/chunk-V7W6IM2V.mjs.map +1 -0
- package/dist/chunk-WB3YULQ4.mjs +1 -0
- package/dist/chunk-WB3YULQ4.mjs.map +1 -0
- package/dist/chunk-XWG3L6QC.mjs +258 -0
- package/dist/chunk-XWG3L6QC.mjs.map +1 -0
- package/dist/chunk-Y4FKRAKJ.mjs +12 -0
- package/dist/chunk-Y4FKRAKJ.mjs.map +1 -0
- package/dist/components/chat/Button.d.ts +9 -0
- package/dist/components/chat/Button.js +71 -0
- package/dist/components/chat/Button.js.map +1 -0
- package/dist/components/chat/Button.mjs +10 -0
- package/dist/components/chat/Button.mjs.map +1 -0
- package/dist/components/chat/Chat.d.ts +204 -0
- package/dist/components/chat/Chat.js +2270 -0
- package/dist/components/chat/Chat.js.map +1 -0
- package/dist/components/chat/Chat.mjs +29 -0
- package/dist/components/chat/Chat.mjs.map +1 -0
- package/dist/components/chat/ChatContext.d.ts +145 -0
- package/dist/components/chat/ChatContext.js +329 -0
- package/dist/components/chat/ChatContext.js.map +1 -0
- package/dist/components/chat/ChatContext.mjs +13 -0
- package/dist/components/chat/ChatContext.mjs.map +1 -0
- package/dist/components/chat/CodeBlock.d.ts +14 -0
- package/dist/components/chat/CodeBlock.js +510 -0
- package/dist/components/chat/CodeBlock.js.map +1 -0
- package/dist/components/chat/CodeBlock.mjs +14 -0
- package/dist/components/chat/CodeBlock.mjs.map +1 -0
- package/dist/components/chat/Header.d.ts +9 -0
- package/dist/components/chat/Header.js +582 -0
- package/dist/components/chat/Header.js.map +1 -0
- package/dist/components/chat/Header.mjs +17 -0
- package/dist/components/chat/Header.mjs.map +1 -0
- package/dist/components/chat/Icons.d.ts +20 -0
- package/dist/components/chat/Icons.js +297 -0
- package/dist/components/chat/Icons.js.map +1 -0
- package/dist/components/chat/Icons.mjs +38 -0
- package/dist/components/chat/Icons.mjs.map +1 -0
- package/dist/components/chat/ImageUploadQueue.d.ts +13 -0
- package/dist/components/chat/ImageUploadQueue.js +106 -0
- package/dist/components/chat/ImageUploadQueue.js.map +1 -0
- package/dist/components/chat/ImageUploadQueue.mjs +8 -0
- package/dist/components/chat/ImageUploadQueue.mjs.map +1 -0
- package/dist/components/chat/Input.d.ts +9 -0
- package/dist/components/chat/Input.js +396 -0
- package/dist/components/chat/Input.js.map +1 -0
- package/dist/components/chat/Input.mjs +14 -0
- package/dist/components/chat/Input.mjs.map +1 -0
- package/dist/components/chat/Markdown.d.ts +10 -0
- package/dist/components/chat/Markdown.js +652 -0
- package/dist/components/chat/Markdown.js.map +1 -0
- package/dist/components/chat/Markdown.mjs +11 -0
- package/dist/components/chat/Markdown.mjs.map +1 -0
- package/dist/components/chat/Messages.d.ts +13 -0
- package/dist/components/chat/Messages.js +1195 -0
- package/dist/components/chat/Messages.js.map +1 -0
- package/dist/components/chat/Messages.mjs +20 -0
- package/dist/components/chat/Messages.mjs.map +1 -0
- package/dist/components/chat/Modal.d.ts +51 -0
- package/dist/components/chat/Modal.js +3075 -0
- package/dist/components/chat/Modal.js.map +1 -0
- package/dist/components/chat/Modal.mjs +38 -0
- package/dist/components/chat/Modal.mjs.map +1 -0
- package/dist/components/chat/Popup.d.ts +13 -0
- package/dist/components/chat/Popup.js +3086 -0
- package/dist/components/chat/Popup.js.map +1 -0
- package/dist/components/chat/Popup.mjs +39 -0
- package/dist/components/chat/Popup.mjs.map +1 -0
- package/dist/components/chat/PoweredByTag.d.ts +7 -0
- package/dist/components/chat/PoweredByTag.js +61 -0
- package/dist/components/chat/PoweredByTag.js.map +1 -0
- package/dist/components/chat/PoweredByTag.mjs +9 -0
- package/dist/components/chat/PoweredByTag.mjs.map +1 -0
- package/dist/components/chat/Sidebar.d.ts +13 -0
- package/dist/components/chat/Sidebar.js +3095 -0
- package/dist/components/chat/Sidebar.js.map +1 -0
- package/dist/components/chat/Sidebar.mjs +39 -0
- package/dist/components/chat/Sidebar.mjs.map +1 -0
- package/dist/components/chat/Suggestion.d.ts +12 -0
- package/dist/components/chat/Suggestion.js +56 -0
- package/dist/components/chat/Suggestion.js.map +1 -0
- package/dist/components/chat/Suggestion.mjs +9 -0
- package/dist/components/chat/Suggestion.mjs.map +1 -0
- package/dist/components/chat/Suggestions.d.ts +9 -0
- package/dist/components/chat/Suggestions.js +81 -0
- package/dist/components/chat/Suggestions.js.map +1 -0
- package/dist/components/chat/Suggestions.mjs +10 -0
- package/dist/components/chat/Suggestions.mjs.map +1 -0
- package/dist/components/chat/Textarea.d.ts +15 -0
- package/dist/components/chat/Textarea.js +84 -0
- package/dist/components/chat/Textarea.js.map +1 -0
- package/dist/components/chat/Textarea.mjs +8 -0
- package/dist/components/chat/Textarea.mjs.map +1 -0
- package/dist/components/chat/Window.d.ts +9 -0
- package/dist/components/chat/Window.js +164 -0
- package/dist/components/chat/Window.js.map +1 -0
- package/dist/components/chat/Window.mjs +10 -0
- package/dist/components/chat/Window.mjs.map +1 -0
- package/dist/components/chat/index.d.ts +18 -0
- package/dist/components/chat/index.js +3122 -0
- package/dist/components/chat/index.js.map +1 -0
- package/dist/components/chat/index.mjs +69 -0
- package/dist/components/chat/index.mjs.map +1 -0
- package/dist/components/chat/messages/AssistantMessage.d.ts +9 -0
- package/dist/components/chat/messages/AssistantMessage.js +775 -0
- package/dist/components/chat/messages/AssistantMessage.js.map +1 -0
- package/dist/components/chat/messages/AssistantMessage.mjs +13 -0
- package/dist/components/chat/messages/AssistantMessage.mjs.map +1 -0
- package/dist/components/chat/messages/ErrorMessage.d.ts +9 -0
- package/dist/components/chat/messages/ErrorMessage.js +722 -0
- package/dist/components/chat/messages/ErrorMessage.js.map +1 -0
- package/dist/components/chat/messages/ErrorMessage.mjs +66 -0
- package/dist/components/chat/messages/ErrorMessage.mjs.map +1 -0
- package/dist/components/chat/messages/ImageRenderer.d.ts +12 -0
- package/dist/components/chat/messages/ImageRenderer.js +58 -0
- package/dist/components/chat/messages/ImageRenderer.js.map +1 -0
- package/dist/components/chat/messages/ImageRenderer.mjs +8 -0
- package/dist/components/chat/messages/ImageRenderer.mjs.map +1 -0
- package/dist/components/chat/messages/LegacyRenderMessage.d.ts +28 -0
- package/dist/components/chat/messages/LegacyRenderMessage.js +1023 -0
- package/dist/components/chat/messages/LegacyRenderMessage.js.map +1 -0
- package/dist/components/chat/messages/LegacyRenderMessage.mjs +17 -0
- package/dist/components/chat/messages/LegacyRenderMessage.mjs.map +1 -0
- package/dist/components/chat/messages/RenderMessage.d.ts +9 -0
- package/dist/components/chat/messages/RenderMessage.js +898 -0
- package/dist/components/chat/messages/RenderMessage.js.map +1 -0
- package/dist/components/chat/messages/RenderMessage.mjs +16 -0
- package/dist/components/chat/messages/RenderMessage.mjs.map +1 -0
- package/dist/components/chat/messages/UserMessage.d.ts +9 -0
- package/dist/components/chat/messages/UserMessage.js +56 -0
- package/dist/components/chat/messages/UserMessage.js.map +1 -0
- package/dist/components/chat/messages/UserMessage.mjs +8 -0
- package/dist/components/chat/messages/UserMessage.mjs.map +1 -0
- package/dist/components/chat/props.d.ts +298 -0
- package/dist/components/chat/props.js +19 -0
- package/dist/components/chat/props.js.map +1 -0
- package/dist/components/chat/props.mjs +2 -0
- package/dist/components/chat/props.mjs.map +1 -0
- package/dist/components/dev-console/console.d.ts +11 -0
- package/dist/components/dev-console/console.js +537 -0
- package/dist/components/dev-console/console.js.map +1 -0
- package/dist/components/dev-console/console.mjs +17 -0
- package/dist/components/dev-console/console.mjs.map +1 -0
- package/dist/components/dev-console/icons.d.ts +9 -0
- package/dist/components/dev-console/icons.js +131 -0
- package/dist/components/dev-console/icons.js.map +1 -0
- package/dist/components/dev-console/icons.mjs +16 -0
- package/dist/components/dev-console/icons.mjs.map +1 -0
- package/dist/components/dev-console/index.d.ts +3 -0
- package/dist/components/dev-console/index.js +537 -0
- package/dist/components/dev-console/index.js.map +1 -0
- package/dist/components/dev-console/index.mjs +18 -0
- package/dist/components/dev-console/index.mjs.map +1 -0
- package/dist/components/dev-console/types.d.ts +9 -0
- package/dist/components/dev-console/types.js +19 -0
- package/dist/components/dev-console/types.js.map +1 -0
- package/dist/components/dev-console/types.mjs +1 -0
- package/dist/components/dev-console/types.mjs.map +1 -0
- package/dist/components/dev-console/utils.d.ts +10 -0
- package/dist/components/dev-console/utils.js +177 -0
- package/dist/components/dev-console/utils.js.map +1 -0
- package/dist/components/dev-console/utils.mjs +16 -0
- package/dist/components/dev-console/utils.mjs.map +1 -0
- package/dist/components/help-modal/icons.d.ts +9 -0
- package/dist/components/help-modal/icons.js +107 -0
- package/dist/components/help-modal/icons.js.map +1 -0
- package/dist/components/help-modal/icons.mjs +12 -0
- package/dist/components/help-modal/icons.mjs.map +1 -0
- package/dist/components/help-modal/index.d.ts +2 -0
- package/dist/components/help-modal/index.js +137 -0
- package/dist/components/help-modal/index.js.map +1 -0
- package/dist/components/help-modal/index.mjs +10 -0
- package/dist/components/help-modal/index.mjs.map +1 -0
- package/dist/components/help-modal/modal.d.ts +5 -0
- package/dist/components/help-modal/modal.js +135 -0
- package/dist/components/help-modal/modal.js.map +1 -0
- package/dist/components/help-modal/modal.mjs +9 -0
- package/dist/components/help-modal/modal.mjs.map +1 -0
- package/dist/components/index.d.ts +19 -0
- package/dist/components/index.js +3126 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index.mjs +76 -0
- package/dist/components/index.mjs.map +1 -0
- package/dist/context/index.d.ts +2 -0
- package/dist/context/index.js +19 -0
- package/dist/context/index.js.map +1 -0
- package/dist/context/index.mjs +2 -0
- package/dist/context/index.mjs.map +1 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +36 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/index.mjs +9 -0
- package/dist/hooks/index.mjs.map +1 -0
- package/dist/hooks/use-copilot-chat-suggestions.d.ts +66 -0
- package/dist/hooks/use-copilot-chat-suggestions.js +34 -0
- package/dist/hooks/use-copilot-chat-suggestions.js.map +1 -0
- package/dist/hooks/use-copilot-chat-suggestions.mjs +8 -0
- package/dist/hooks/use-copilot-chat-suggestions.mjs.map +1 -0
- package/dist/hooks/use-copy-to-clipboard.d.ts +9 -0
- package/dist/hooks/use-copy-to-clipboard.js +60 -0
- package/dist/hooks/use-copy-to-clipboard.js.map +1 -0
- package/dist/hooks/use-copy-to-clipboard.mjs +8 -0
- package/dist/hooks/use-copy-to-clipboard.mjs.map +1 -0
- package/dist/hooks/use-dark-mode.d.ts +3 -0
- package/dist/hooks/use-dark-mode.js +35 -0
- package/dist/hooks/use-dark-mode.js.map +1 -0
- package/dist/hooks/use-dark-mode.mjs +8 -0
- package/dist/hooks/use-dark-mode.mjs.map +1 -0
- package/dist/hooks/use-push-to-talk.d.ts +19 -0
- package/dist/hooks/use-push-to-talk.js +195 -0
- package/dist/hooks/use-push-to-talk.js.map +1 -0
- package/dist/hooks/use-push-to-talk.mjs +12 -0
- package/dist/hooks/use-push-to-talk.mjs.map +1 -0
- package/dist/index.css +1258 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +3135 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +84 -0
- package/dist/index.mjs.map +1 -0
- package/dist/lib/utils.d.ts +4 -0
- package/dist/lib/utils.js +76 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/utils.mjs +34 -0
- package/dist/lib/utils.mjs.map +1 -0
- package/dist/types/css.d.ts +22 -0
- package/dist/types/css.js +19 -0
- package/dist/types/css.js.map +1 -0
- package/dist/types/css.mjs +1 -0
- package/dist/types/css.mjs.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +19 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/index.mjs +2 -0
- package/dist/types/index.mjs.map +1 -0
- package/dist/types/suggestions.d.ts +9 -0
- package/dist/types/suggestions.js +19 -0
- package/dist/types/suggestions.js.map +1 -0
- package/dist/types/suggestions.mjs +1 -0
- package/dist/types/suggestions.mjs.map +1 -0
- package/dist/v2/index.css +4 -0
- package/dist/v2/index.css.map +1 -0
- package/dist/v2/index.d.ts +2 -0
- package/dist/v2/index.js +2 -0
- package/dist/v2/index.js.map +1 -0
- package/dist/v2/index.mjs +2 -0
- package/dist/v2/index.mjs.map +1 -0
- package/jest.config.js +5 -0
- package/package.json +83 -0
- package/postcss.config.js +60 -0
- package/src/components/chat/Button.tsx +18 -0
- package/src/components/chat/Chat.tsx +795 -0
- package/src/components/chat/ChatContext.tsx +248 -0
- package/src/components/chat/CodeBlock.tsx +418 -0
- package/src/components/chat/Header.tsx +24 -0
- package/src/components/chat/Icons.tsx +237 -0
- package/src/components/chat/ImageUploadQueue.tsx +77 -0
- package/src/components/chat/Input.tsx +156 -0
- package/src/components/chat/Markdown.tsx +144 -0
- package/src/components/chat/Messages.tsx +206 -0
- package/src/components/chat/Modal.tsx +220 -0
- package/src/components/chat/Popup.tsx +77 -0
- package/src/components/chat/PoweredByTag.tsx +42 -0
- package/src/components/chat/Sidebar.tsx +96 -0
- package/src/components/chat/Suggestion.tsx +29 -0
- package/src/components/chat/Suggestions.tsx +23 -0
- package/src/components/chat/Textarea.tsx +77 -0
- package/src/components/chat/Window.tsx +152 -0
- package/src/components/chat/index.tsx +11 -0
- package/src/components/chat/messages/AssistantMessage.tsx +118 -0
- package/src/components/chat/messages/ErrorMessage.tsx +59 -0
- package/src/components/chat/messages/ImageRenderer.tsx +37 -0
- package/src/components/chat/messages/LegacyRenderMessage.tsx +150 -0
- package/src/components/chat/messages/RenderMessage.tsx +61 -0
- package/src/components/chat/messages/UserMessage.tsx +46 -0
- package/src/components/chat/props.ts +353 -0
- package/src/components/dev-console/console.tsx +242 -0
- package/src/components/dev-console/icons.tsx +99 -0
- package/src/components/dev-console/index.tsx +2 -0
- package/src/components/dev-console/types.ts +7 -0
- package/src/components/dev-console/utils.ts +142 -0
- package/src/components/help-modal/icons.tsx +68 -0
- package/src/components/help-modal/index.tsx +1 -0
- package/src/components/help-modal/modal.tsx +101 -0
- package/src/components/index.ts +2 -0
- package/src/context/index.ts +1 -0
- package/src/css/animations.css +35 -0
- package/src/css/button.css +67 -0
- package/src/css/colors.css +78 -0
- package/src/css/console.css +166 -0
- package/src/css/crew.css +277 -0
- package/src/css/header.css +65 -0
- package/src/css/input.css +152 -0
- package/src/css/markdown.css +150 -0
- package/src/css/messages.css +244 -0
- package/src/css/panel.css +39 -0
- package/src/css/popup.css +22 -0
- package/src/css/sidebar.css +34 -0
- package/src/css/suggestions.css +43 -0
- package/src/css/window.css +60 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-copilot-chat-suggestions.tsx +71 -0
- package/src/hooks/use-copy-to-clipboard.tsx +29 -0
- package/src/hooks/use-dark-mode.ts +10 -0
- package/src/hooks/use-push-to-talk.tsx +167 -0
- package/src/index.tsx +7 -0
- package/src/lib/utils.test.ts +7 -0
- package/src/lib/utils.ts +27 -0
- package/src/styles.css +14 -0
- package/src/types/css.ts +21 -0
- package/src/types/index.ts +2 -0
- package/src/types/suggestions.ts +7 -0
- package/src/v2/index.ts +1 -0
- package/src/v2/styles.css +1 -0
- package/tailwind.config.js +7 -0
- package/tsconfig.json +12 -0
- package/tsup.config.ts +11 -0
- package/typedoc.json +4 -0
|
@@ -0,0 +1,106 @@
|
|
|
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/ImageUploadQueue.tsx
|
|
21
|
+
var ImageUploadQueue_exports = {};
|
|
22
|
+
__export(ImageUploadQueue_exports, {
|
|
23
|
+
ImageUploadQueue: () => ImageUploadQueue
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(ImageUploadQueue_exports);
|
|
26
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
27
|
+
var ImageUploadQueue = ({
|
|
28
|
+
images,
|
|
29
|
+
onRemoveImage,
|
|
30
|
+
className = ""
|
|
31
|
+
}) => {
|
|
32
|
+
if (images.length === 0)
|
|
33
|
+
return null;
|
|
34
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
className: `copilotKitImageUploadQueue ${className}`,
|
|
38
|
+
style: {
|
|
39
|
+
display: "flex",
|
|
40
|
+
flexWrap: "wrap",
|
|
41
|
+
gap: "8px",
|
|
42
|
+
margin: "8px",
|
|
43
|
+
padding: "8px"
|
|
44
|
+
},
|
|
45
|
+
children: images.map((image, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
46
|
+
"div",
|
|
47
|
+
{
|
|
48
|
+
className: "copilotKitImageUploadQueueItem",
|
|
49
|
+
style: {
|
|
50
|
+
position: "relative",
|
|
51
|
+
display: "inline-block",
|
|
52
|
+
width: "60px",
|
|
53
|
+
height: "60px",
|
|
54
|
+
borderRadius: "4px",
|
|
55
|
+
overflow: "hidden"
|
|
56
|
+
},
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
59
|
+
"img",
|
|
60
|
+
{
|
|
61
|
+
src: `data:${image.contentType};base64,${image.bytes}`,
|
|
62
|
+
alt: `Selected image ${index + 1}`,
|
|
63
|
+
style: {
|
|
64
|
+
width: "100%",
|
|
65
|
+
height: "100%",
|
|
66
|
+
objectFit: "cover"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
71
|
+
"button",
|
|
72
|
+
{
|
|
73
|
+
onClick: () => onRemoveImage(index),
|
|
74
|
+
className: "copilotKitImageUploadQueueRemoveButton",
|
|
75
|
+
style: {
|
|
76
|
+
position: "absolute",
|
|
77
|
+
top: "2px",
|
|
78
|
+
right: "2px",
|
|
79
|
+
background: "rgba(0,0,0,0.6)",
|
|
80
|
+
color: "white",
|
|
81
|
+
border: "none",
|
|
82
|
+
borderRadius: "50%",
|
|
83
|
+
width: "18px",
|
|
84
|
+
height: "18px",
|
|
85
|
+
display: "flex",
|
|
86
|
+
alignItems: "center",
|
|
87
|
+
justifyContent: "center",
|
|
88
|
+
cursor: "pointer",
|
|
89
|
+
fontSize: "10px",
|
|
90
|
+
padding: 0
|
|
91
|
+
},
|
|
92
|
+
children: "\u2715"
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
index
|
|
98
|
+
))
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
};
|
|
102
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
103
|
+
0 && (module.exports = {
|
|
104
|
+
ImageUploadQueue
|
|
105
|
+
});
|
|
106
|
+
//# sourceMappingURL=ImageUploadQueue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/chat/ImageUploadQueue.tsx"],"sourcesContent":["import React from \"react\";\n\ninterface ImageUploadQueueProps {\n images: Array<{ contentType: string; bytes: string }>;\n onRemoveImage: (index: number) => void;\n className?: string;\n}\n\nexport const ImageUploadQueue: React.FC<ImageUploadQueueProps> = ({\n images,\n onRemoveImage,\n className = \"\",\n}) => {\n if (images.length === 0) return null;\n\n return (\n <div\n className={`copilotKitImageUploadQueue ${className}`}\n style={{\n display: \"flex\",\n flexWrap: \"wrap\",\n gap: \"8px\",\n margin: \"8px\",\n padding: \"8px\",\n }}\n >\n {images.map((image, index) => (\n <div\n key={index}\n className=\"copilotKitImageUploadQueueItem\"\n style={{\n position: \"relative\",\n display: \"inline-block\",\n width: \"60px\",\n height: \"60px\",\n borderRadius: \"4px\",\n overflow: \"hidden\",\n }}\n >\n {/* eslint-disable-next-line @next/next/no-img-element */}\n <img\n src={`data:${image.contentType};base64,${image.bytes}`}\n alt={`Selected image ${index + 1}`}\n style={{\n width: \"100%\",\n height: \"100%\",\n objectFit: \"cover\",\n }}\n />\n <button\n onClick={() => onRemoveImage(index)}\n className=\"copilotKitImageUploadQueueRemoveButton\"\n style={{\n position: \"absolute\",\n top: \"2px\",\n right: \"2px\",\n background: \"rgba(0,0,0,0.6)\",\n color: \"white\",\n border: \"none\",\n borderRadius: \"50%\",\n width: \"18px\",\n height: \"18px\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n cursor: \"pointer\",\n fontSize: \"10px\",\n padding: 0,\n }}\n >\n ✕\n </button>\n </div>\n ))}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA2BQ;AAnBD,IAAM,mBAAoD,CAAC;AAAA,EAChE;AAAA,EACA;AAAA,EACA,YAAY;AACd,MAAM;AACJ,MAAI,OAAO,WAA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
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { InputProps } from './props.js';
|
|
3
|
+
import '@copilotkit/shared';
|
|
4
|
+
import '../../types/suggestions.js';
|
|
5
|
+
import 'react';
|
|
6
|
+
|
|
7
|
+
declare const Input: ({ inProgress, onSend, chatReady, onStop, onUpload, hideStopButton, }: InputProps) => react_jsx_runtime.JSX.Element;
|
|
8
|
+
|
|
9
|
+
export { Input };
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
var __export = (target, all) => {
|
|
23
|
+
for (var name in all)
|
|
24
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
25
|
+
};
|
|
26
|
+
var __copyProps = (to, from, except, desc) => {
|
|
27
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
28
|
+
for (let key of __getOwnPropNames(from))
|
|
29
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
30
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
31
|
+
}
|
|
32
|
+
return to;
|
|
33
|
+
};
|
|
34
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
35
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
36
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
37
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
38
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
39
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
40
|
+
mod
|
|
41
|
+
));
|
|
42
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
43
|
+
var __async = (__this, __arguments, generator) => {
|
|
44
|
+
return new Promise((resolve, reject) => {
|
|
45
|
+
var fulfilled = (value) => {
|
|
46
|
+
try {
|
|
47
|
+
step(generator.next(value));
|
|
48
|
+
} catch (e) {
|
|
49
|
+
reject(e);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
var rejected = (value) => {
|
|
53
|
+
try {
|
|
54
|
+
step(generator.throw(value));
|
|
55
|
+
} catch (e) {
|
|
56
|
+
reject(e);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
60
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
// src/components/chat/Input.tsx
|
|
65
|
+
var Input_exports = {};
|
|
66
|
+
__export(Input_exports, {
|
|
67
|
+
Input: () => Input
|
|
68
|
+
});
|
|
69
|
+
module.exports = __toCommonJS(Input_exports);
|
|
70
|
+
var import_react5 = require("react");
|
|
71
|
+
|
|
72
|
+
// src/components/chat/ChatContext.tsx
|
|
73
|
+
var import_react = __toESM(require("react"));
|
|
74
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
75
|
+
var ChatContext = import_react.default.createContext(void 0);
|
|
76
|
+
function useChatContext() {
|
|
77
|
+
const context = import_react.default.useContext(ChatContext);
|
|
78
|
+
if (context === void 0) {
|
|
79
|
+
throw new Error(
|
|
80
|
+
"Context not found. Did you forget to wrap your app in a <ChatContextProvider> component?"
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
return context;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// src/components/chat/Textarea.tsx
|
|
87
|
+
var import_react2 = require("react");
|
|
88
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
89
|
+
var AutoResizingTextarea = (0, import_react2.forwardRef)(
|
|
90
|
+
({
|
|
91
|
+
maxRows = 1,
|
|
92
|
+
placeholder,
|
|
93
|
+
value,
|
|
94
|
+
onChange,
|
|
95
|
+
onKeyDown,
|
|
96
|
+
onCompositionStart,
|
|
97
|
+
onCompositionEnd,
|
|
98
|
+
autoFocus
|
|
99
|
+
}, ref) => {
|
|
100
|
+
const internalTextareaRef = (0, import_react2.useRef)(null);
|
|
101
|
+
const [maxHeight, setMaxHeight] = (0, import_react2.useState)(0);
|
|
102
|
+
(0, import_react2.useImperativeHandle)(ref, () => internalTextareaRef.current);
|
|
103
|
+
(0, import_react2.useEffect)(() => {
|
|
104
|
+
const calculateMaxHeight = () => {
|
|
105
|
+
const textarea = internalTextareaRef.current;
|
|
106
|
+
if (textarea) {
|
|
107
|
+
textarea.style.height = "auto";
|
|
108
|
+
const singleRowHeight = textarea.scrollHeight;
|
|
109
|
+
setMaxHeight(singleRowHeight * maxRows);
|
|
110
|
+
if (autoFocus) {
|
|
111
|
+
textarea.focus();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
calculateMaxHeight();
|
|
116
|
+
}, [maxRows]);
|
|
117
|
+
(0, import_react2.useEffect)(() => {
|
|
118
|
+
const textarea = internalTextareaRef.current;
|
|
119
|
+
if (textarea) {
|
|
120
|
+
textarea.style.height = "auto";
|
|
121
|
+
textarea.style.height = `${Math.min(textarea.scrollHeight, maxHeight)}px`;
|
|
122
|
+
}
|
|
123
|
+
}, [value, maxHeight]);
|
|
124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
125
|
+
"textarea",
|
|
126
|
+
{
|
|
127
|
+
ref: internalTextareaRef,
|
|
128
|
+
value,
|
|
129
|
+
onChange,
|
|
130
|
+
onKeyDown,
|
|
131
|
+
onCompositionStart,
|
|
132
|
+
onCompositionEnd,
|
|
133
|
+
placeholder,
|
|
134
|
+
style: {
|
|
135
|
+
overflow: "auto",
|
|
136
|
+
resize: "none",
|
|
137
|
+
maxHeight: `${maxHeight}px`
|
|
138
|
+
},
|
|
139
|
+
rows: 1
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
var Textarea_default = AutoResizingTextarea;
|
|
145
|
+
|
|
146
|
+
// src/hooks/use-push-to-talk.tsx
|
|
147
|
+
var import_react_core = require("@copilotkit/react-core");
|
|
148
|
+
var import_runtime_client_gql = require("@copilotkit/runtime-client-gql");
|
|
149
|
+
var import_react3 = require("react");
|
|
150
|
+
var startRecording = (mediaStreamRef, mediaRecorderRef, audioContextRef, recordedChunks, onStop) => __async(void 0, null, function* () {
|
|
151
|
+
if (!mediaStreamRef.current || !audioContextRef.current) {
|
|
152
|
+
mediaStreamRef.current = yield navigator.mediaDevices.getUserMedia({ audio: true });
|
|
153
|
+
audioContextRef.current = new window.AudioContext();
|
|
154
|
+
yield audioContextRef.current.resume();
|
|
155
|
+
}
|
|
156
|
+
mediaRecorderRef.current = new MediaRecorder(mediaStreamRef.current);
|
|
157
|
+
mediaRecorderRef.current.start(1e3);
|
|
158
|
+
mediaRecorderRef.current.ondataavailable = (event) => {
|
|
159
|
+
recordedChunks.push(event.data);
|
|
160
|
+
};
|
|
161
|
+
mediaRecorderRef.current.onstop = onStop;
|
|
162
|
+
});
|
|
163
|
+
var stopRecording = (mediaRecorderRef) => {
|
|
164
|
+
if (mediaRecorderRef.current && mediaRecorderRef.current.state !== "inactive") {
|
|
165
|
+
mediaRecorderRef.current.stop();
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
var transcribeAudio = (recordedChunks, transcribeAudioUrl) => __async(void 0, null, function* () {
|
|
169
|
+
const completeBlob = new Blob(recordedChunks, { type: "audio/mp4" });
|
|
170
|
+
const formData = new FormData();
|
|
171
|
+
formData.append("file", completeBlob, "recording.mp4");
|
|
172
|
+
const response = yield fetch(transcribeAudioUrl, {
|
|
173
|
+
method: "POST",
|
|
174
|
+
body: formData
|
|
175
|
+
});
|
|
176
|
+
if (!response.ok) {
|
|
177
|
+
throw new Error(`Error: ${response.statusText}`);
|
|
178
|
+
}
|
|
179
|
+
const transcription = yield response.json();
|
|
180
|
+
return transcription.text;
|
|
181
|
+
});
|
|
182
|
+
var playAudioResponse = (text, textToSpeechUrl, audioContext) => {
|
|
183
|
+
const encodedText = encodeURIComponent(text);
|
|
184
|
+
const url = `${textToSpeechUrl}?text=${encodedText}`;
|
|
185
|
+
fetch(url).then((response) => response.arrayBuffer()).then((arrayBuffer) => audioContext.decodeAudioData(arrayBuffer)).then((audioBuffer) => {
|
|
186
|
+
const source = audioContext.createBufferSource();
|
|
187
|
+
source.buffer = audioBuffer;
|
|
188
|
+
source.connect(audioContext.destination);
|
|
189
|
+
source.start(0);
|
|
190
|
+
}).catch((error) => {
|
|
191
|
+
console.error("Error with decoding audio data", error);
|
|
192
|
+
});
|
|
193
|
+
};
|
|
194
|
+
var usePushToTalk = ({
|
|
195
|
+
sendFunction,
|
|
196
|
+
inProgress
|
|
197
|
+
}) => {
|
|
198
|
+
const [pushToTalkState, setPushToTalkState] = (0, import_react3.useState)("idle");
|
|
199
|
+
const mediaStreamRef = (0, import_react3.useRef)(null);
|
|
200
|
+
const audioContextRef = (0, import_react3.useRef)(null);
|
|
201
|
+
const mediaRecorderRef = (0, import_react3.useRef)(null);
|
|
202
|
+
const recordedChunks = (0, import_react3.useRef)([]);
|
|
203
|
+
const generalContext = (0, import_react_core.useCopilotContext)();
|
|
204
|
+
const messagesContext = (0, import_react_core.useCopilotMessagesContext)();
|
|
205
|
+
const context = __spreadValues(__spreadValues({}, generalContext), messagesContext);
|
|
206
|
+
const [startReadingFromMessageId, setStartReadingFromMessageId] = (0, import_react3.useState)(null);
|
|
207
|
+
(0, import_react3.useEffect)(() => {
|
|
208
|
+
if (pushToTalkState === "recording") {
|
|
209
|
+
startRecording(
|
|
210
|
+
mediaStreamRef,
|
|
211
|
+
mediaRecorderRef,
|
|
212
|
+
audioContextRef,
|
|
213
|
+
recordedChunks.current,
|
|
214
|
+
() => {
|
|
215
|
+
setPushToTalkState("transcribing");
|
|
216
|
+
}
|
|
217
|
+
);
|
|
218
|
+
} else {
|
|
219
|
+
stopRecording(mediaRecorderRef);
|
|
220
|
+
if (pushToTalkState === "transcribing") {
|
|
221
|
+
transcribeAudio(recordedChunks.current, context.copilotApiConfig.transcribeAudioUrl).then(
|
|
222
|
+
(transcription) => __async(void 0, null, function* () {
|
|
223
|
+
recordedChunks.current = [];
|
|
224
|
+
setPushToTalkState("idle");
|
|
225
|
+
const message = yield sendFunction(transcription);
|
|
226
|
+
setStartReadingFromMessageId(message.id);
|
|
227
|
+
})
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return () => {
|
|
232
|
+
stopRecording(mediaRecorderRef);
|
|
233
|
+
};
|
|
234
|
+
}, [pushToTalkState]);
|
|
235
|
+
(0, import_react3.useEffect)(() => {
|
|
236
|
+
if (inProgress === false && startReadingFromMessageId) {
|
|
237
|
+
const lastMessageIndex = context.messages.findIndex(
|
|
238
|
+
(message) => message.id === startReadingFromMessageId
|
|
239
|
+
);
|
|
240
|
+
const aguiMessages = (0, import_runtime_client_gql.gqlToAGUI)(context.messages);
|
|
241
|
+
const messagesAfterLast = aguiMessages.slice(lastMessageIndex + 1).filter((message) => message.role === "assistant");
|
|
242
|
+
const text = messagesAfterLast.map((message) => message.content).join("\n");
|
|
243
|
+
playAudioResponse(text, context.copilotApiConfig.textToSpeechUrl, audioContextRef.current);
|
|
244
|
+
setStartReadingFromMessageId(null);
|
|
245
|
+
}
|
|
246
|
+
}, [startReadingFromMessageId, inProgress]);
|
|
247
|
+
return { pushToTalkState, setPushToTalkState };
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
// src/components/chat/Input.tsx
|
|
251
|
+
var import_react_core2 = require("@copilotkit/react-core");
|
|
252
|
+
|
|
253
|
+
// src/components/chat/PoweredByTag.tsx
|
|
254
|
+
var import_react4 = require("react");
|
|
255
|
+
|
|
256
|
+
// src/hooks/use-dark-mode.ts
|
|
257
|
+
var useDarkMode = () => {
|
|
258
|
+
if (typeof window === "undefined")
|
|
259
|
+
return false;
|
|
260
|
+
return document.documentElement.classList.contains("dark") || document.body.classList.contains("dark") || document.documentElement.getAttribute("data-theme") === "dark" || document.body.getAttribute("data-theme") === "dark" || window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
// src/components/chat/PoweredByTag.tsx
|
|
264
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
265
|
+
function PoweredByTag({ showPoweredBy = true }) {
|
|
266
|
+
const [mounted, setMounted] = (0, import_react4.useState)(false);
|
|
267
|
+
const isDark = useDarkMode();
|
|
268
|
+
(0, import_react4.useEffect)(() => {
|
|
269
|
+
setMounted(true);
|
|
270
|
+
}, []);
|
|
271
|
+
if (!showPoweredBy) {
|
|
272
|
+
return null;
|
|
273
|
+
}
|
|
274
|
+
const poweredByStyle = {
|
|
275
|
+
visibility: "visible",
|
|
276
|
+
display: "block",
|
|
277
|
+
position: "static",
|
|
278
|
+
textAlign: "center",
|
|
279
|
+
fontSize: "12px",
|
|
280
|
+
padding: "3px 0",
|
|
281
|
+
color: mounted && isDark ? "rgb(69, 69, 69)" : "rgb(214, 214, 214)"
|
|
282
|
+
};
|
|
283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "poweredBy", style: poweredByStyle, children: "Powered by CopilotKit" }) });
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// src/components/chat/Input.tsx
|
|
287
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
288
|
+
var MAX_NEWLINES = 6;
|
|
289
|
+
var Input = ({
|
|
290
|
+
inProgress,
|
|
291
|
+
onSend,
|
|
292
|
+
chatReady = false,
|
|
293
|
+
onStop,
|
|
294
|
+
onUpload,
|
|
295
|
+
hideStopButton = false
|
|
296
|
+
}) => {
|
|
297
|
+
var _a;
|
|
298
|
+
const context = useChatContext();
|
|
299
|
+
const copilotContext = (0, import_react_core2.useCopilotContext)();
|
|
300
|
+
const showPoweredBy = !((_a = copilotContext.copilotApiConfig) == null ? void 0 : _a.publicApiKey);
|
|
301
|
+
const pushToTalkConfigured = copilotContext.copilotApiConfig.textToSpeechUrl !== void 0 && copilotContext.copilotApiConfig.transcribeAudioUrl !== void 0;
|
|
302
|
+
const textareaRef = (0, import_react5.useRef)(null);
|
|
303
|
+
const [isComposing, setIsComposing] = (0, import_react5.useState)(false);
|
|
304
|
+
const handleDivClick = (event) => {
|
|
305
|
+
var _a2;
|
|
306
|
+
const target = event.target;
|
|
307
|
+
if (target.closest("button"))
|
|
308
|
+
return;
|
|
309
|
+
if (target.tagName === "TEXTAREA")
|
|
310
|
+
return;
|
|
311
|
+
(_a2 = textareaRef.current) == null ? void 0 : _a2.focus();
|
|
312
|
+
};
|
|
313
|
+
const [text, setText] = (0, import_react5.useState)("");
|
|
314
|
+
const send = () => {
|
|
315
|
+
var _a2;
|
|
316
|
+
if (inProgress)
|
|
317
|
+
return;
|
|
318
|
+
onSend(text);
|
|
319
|
+
setText("");
|
|
320
|
+
(_a2 = textareaRef.current) == null ? void 0 : _a2.focus();
|
|
321
|
+
};
|
|
322
|
+
const { pushToTalkState, setPushToTalkState } = usePushToTalk({
|
|
323
|
+
sendFunction: onSend,
|
|
324
|
+
inProgress
|
|
325
|
+
});
|
|
326
|
+
const isInProgress = inProgress || pushToTalkState === "transcribing";
|
|
327
|
+
const { buttonIcon, buttonAlt } = (0, import_react5.useMemo)(() => {
|
|
328
|
+
if (!chatReady)
|
|
329
|
+
return { buttonIcon: context.icons.spinnerIcon, buttonAlt: "Loading" };
|
|
330
|
+
return isInProgress && !hideStopButton && chatReady ? { buttonIcon: context.icons.stopIcon, buttonAlt: "Stop" } : { buttonIcon: context.icons.sendIcon, buttonAlt: "Send" };
|
|
331
|
+
}, [isInProgress, chatReady, hideStopButton, context.icons.stopIcon, context.icons.sendIcon]);
|
|
332
|
+
const showPushToTalk = pushToTalkConfigured && (pushToTalkState === "idle" || pushToTalkState === "recording") && !inProgress;
|
|
333
|
+
const { interrupt } = (0, import_react_core2.useCopilotChatInternal)();
|
|
334
|
+
const canSend = (0, import_react5.useMemo)(() => {
|
|
335
|
+
return !isInProgress && text.trim().length > 0 && pushToTalkState === "idle" && !interrupt;
|
|
336
|
+
}, [interrupt, isInProgress, text, pushToTalkState]);
|
|
337
|
+
const canStop = (0, import_react5.useMemo)(() => {
|
|
338
|
+
return isInProgress && !hideStopButton;
|
|
339
|
+
}, [isInProgress, hideStopButton]);
|
|
340
|
+
const sendDisabled = !canSend && !canStop;
|
|
341
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: `copilotKitInputContainer ${showPoweredBy ? "poweredByContainer" : ""}`, children: [
|
|
342
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "copilotKitInput", onClick: handleDivClick, children: [
|
|
343
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
344
|
+
Textarea_default,
|
|
345
|
+
{
|
|
346
|
+
ref: textareaRef,
|
|
347
|
+
placeholder: context.labels.placeholder,
|
|
348
|
+
autoFocus: false,
|
|
349
|
+
maxRows: MAX_NEWLINES,
|
|
350
|
+
value: text,
|
|
351
|
+
onChange: (event) => setText(event.target.value),
|
|
352
|
+
onCompositionStart: () => setIsComposing(true),
|
|
353
|
+
onCompositionEnd: () => setIsComposing(false),
|
|
354
|
+
onKeyDown: (event) => {
|
|
355
|
+
if (event.key === "Enter" && !event.shiftKey && !isComposing) {
|
|
356
|
+
event.preventDefault();
|
|
357
|
+
if (canSend) {
|
|
358
|
+
send();
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
),
|
|
364
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "copilotKitInputControls", children: [
|
|
365
|
+
onUpload && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { onClick: onUpload, className: "copilotKitInputControlButton", children: context.icons.uploadIcon }),
|
|
366
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { flexGrow: 1 } }),
|
|
367
|
+
showPushToTalk && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
368
|
+
"button",
|
|
369
|
+
{
|
|
370
|
+
onClick: () => setPushToTalkState(pushToTalkState === "idle" ? "recording" : "transcribing"),
|
|
371
|
+
className: pushToTalkState === "recording" ? "copilotKitInputControlButton copilotKitPushToTalkRecording" : "copilotKitInputControlButton",
|
|
372
|
+
children: context.icons.pushToTalkIcon
|
|
373
|
+
}
|
|
374
|
+
),
|
|
375
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
376
|
+
"button",
|
|
377
|
+
{
|
|
378
|
+
disabled: sendDisabled,
|
|
379
|
+
onClick: isInProgress && !hideStopButton ? onStop : send,
|
|
380
|
+
"data-copilotkit-in-progress": inProgress,
|
|
381
|
+
"data-test-id": inProgress ? "copilot-chat-request-in-progress" : "copilot-chat-ready",
|
|
382
|
+
className: "copilotKitInputControlButton",
|
|
383
|
+
"aria-label": buttonAlt,
|
|
384
|
+
children: buttonIcon
|
|
385
|
+
}
|
|
386
|
+
)
|
|
387
|
+
] })
|
|
388
|
+
] }),
|
|
389
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PoweredByTag, { showPoweredBy })
|
|
390
|
+
] });
|
|
391
|
+
};
|
|
392
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
393
|
+
0 && (module.exports = {
|
|
394
|
+
Input
|
|
395
|
+
});
|
|
396
|
+
//# sourceMappingURL=Input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/chat/Input.tsx","../../../src/components/chat/ChatContext.tsx","../../../src/components/chat/Textarea.tsx","../../../src/hooks/use-push-to-talk.tsx","../../../src/components/chat/PoweredByTag.tsx","../../../src/hooks/use-dark-mode.ts"],"sourcesContent":["import React, { useMemo, useRef, useState } from \"react\";\nimport { InputProps } from \"./props\";\nimport { useChatContext } from \"./ChatContext\";\nimport AutoResizingTextarea from \"./Textarea\";\nimport { usePushToTalk } from \"../../hooks/use-push-to-talk\";\nimport { useCopilotContext, useCopilotChatInternal } from \"@copilotkit/react-core\";\nimport { PoweredByTag } from \"./PoweredByTag\";\n\nconst MAX_NEWLINES = 6;\n\nexport const Input = ({\n inProgress,\n onSend,\n chatReady = false,\n onStop,\n onUpload,\n hideStopButton = false,\n}: InputProps) => {\n const context = useChatContext();\n const copilotContext = useCopilotContext();\n\n const showPoweredBy = !copilotContext.copilotApiConfig?.publicApiKey;\n\n const pushToTalkConfigured =\n copilotContext.copilotApiConfig.textToSpeechUrl !== undefined &&\n copilotContext.copilotApiConfig.transcribeAudioUrl !== undefined;\n\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const [isComposing, setIsComposing] = useState(false);\n\n const handleDivClick = (event: React.MouseEvent<HTMLDivElement>) => {\n const target = event.target as HTMLElement;\n\n // If the user clicked a button or inside a button, don't focus the textarea\n if (target.closest(\"button\")) return;\n\n // If the user clicked the textarea, do nothing (it's already focused)\n if (target.tagName === \"TEXTAREA\") return;\n\n // Otherwise, focus the textarea\n textareaRef.current?.focus();\n };\n\n const [text, setText] = useState(\"\");\n const send = () => {\n if (inProgress) return;\n onSend(text);\n setText(\"\");\n\n textareaRef.current?.focus();\n };\n\n // tylerslaton:\n //\n // This scrolls CopilotKit into view always. Reading the commit history, it was likely\n // added to fix a bug but it is causing issues now.\n //\n // For the future, if we want this behavior again, we will need to find a way to do it without\n // forcing CopilotKit to always be in view. This code causes this because focusing an element\n // in most browsers will scroll that element into view.\n //\n // useEffect(() => {\n // if (isVisible) {\n // textareaRef.current?.focus();\n // }\n // }, [isVisible]);\n\n const { pushToTalkState, setPushToTalkState } = usePushToTalk({\n sendFunction: onSend,\n inProgress,\n });\n\n const isInProgress = inProgress || pushToTalkState === \"transcribing\";\n const { buttonIcon, buttonAlt } = useMemo(() => {\n if (!chatReady) return { buttonIcon: context.icons.spinnerIcon, buttonAlt: \"Loading\" };\n return isInProgress && !hideStopButton && chatReady\n ? { buttonIcon: context.icons.stopIcon, buttonAlt: \"Stop\" }\n : { buttonIcon: context.icons.sendIcon, buttonAlt: \"Send\" };\n }, [isInProgress, chatReady, hideStopButton, context.icons.stopIcon, context.icons.sendIcon]);\n const showPushToTalk =\n pushToTalkConfigured &&\n (pushToTalkState === \"idle\" || pushToTalkState === \"recording\") &&\n !inProgress;\n\n const { interrupt } = useCopilotChatInternal();\n\n const canSend = useMemo(() => {\n return !isInProgress && text.trim().length > 0 && pushToTalkState === \"idle\" && !interrupt;\n }, [interrupt, isInProgress, text, pushToTalkState]);\n\n const canStop = useMemo(() => {\n return isInProgress && !hideStopButton;\n }, [isInProgress, hideStopButton]);\n\n const sendDisabled = !canSend && !canStop;\n\n return (\n <div className={`copilotKitInputContainer ${showPoweredBy ? \"poweredByContainer\" : \"\"}`}>\n <div className=\"copilotKitInput\" onClick={handleDivClick}>\n <AutoResizingTextarea\n ref={textareaRef}\n placeholder={context.labels.placeholder}\n autoFocus={false}\n maxRows={MAX_NEWLINES}\n value={text}\n onChange={(event) => setText(event.target.value)}\n onCompositionStart={() => setIsComposing(true)}\n onCompositionEnd={() => setIsComposing(false)}\n onKeyDown={(event) => {\n if (event.key === \"Enter\" && !event.shiftKey && !isComposing) {\n event.preventDefault();\n if (canSend) {\n send();\n }\n }\n }}\n />\n <div className=\"copilotKitInputControls\">\n {onUpload && (\n <button onClick={onUpload} className=\"copilotKitInputControlButton\">\n {context.icons.uploadIcon}\n </button>\n )}\n\n <div style={{ flexGrow: 1 }} />\n\n {showPushToTalk && (\n <button\n onClick={() =>\n setPushToTalkState(pushToTalkState === \"idle\" ? \"recording\" : \"transcribing\")\n }\n className={\n pushToTalkState === \"recording\"\n ? \"copilotKitInputControlButton copilotKitPushToTalkRecording\"\n : \"copilotKitInputControlButton\"\n }\n >\n {context.icons.pushToTalkIcon}\n </button>\n )}\n <button\n disabled={sendDisabled}\n onClick={isInProgress && !hideStopButton ? onStop : send}\n data-copilotkit-in-progress={inProgress}\n data-test-id={inProgress ? \"copilot-chat-request-in-progress\" : \"copilot-chat-ready\"}\n className=\"copilotKitInputControlButton\"\n aria-label={buttonAlt}\n >\n {buttonIcon}\n </button>\n </div>\n </div>\n <PoweredByTag showPoweredBy={showPoweredBy} />\n </div>\n );\n};\n","import React, { useMemo, useState } from \"react\";\nimport * as DefaultIcons from \"./Icons\";\nimport { ThumbsDownIcon, ThumbsUpIcon } 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 * The icons to use for copy assistant response\n * @default <CopyIcon />\n */\n\n copyIcon?: React.ReactNode;\n\n /**\n * The icon to use for thumbs up/response approval.\n * @default <ThumbsUpIcon />\n */\n\n thumbsUpIcon?: React.ReactNode;\n\n /**\n * The icon to use for thumbs down/response rejection.\n * @default <ThumbsDownIcon />\n */\n\n thumbsDownIcon?: React.ReactNode;\n\n /**\n * The icon to use for the upload button.\n * @default <UploadIcon />\n */\n uploadIcon?: 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 /**\n * The label for the copy button.\n * @default \"Copy to clipboard\"\n */\n copyToClipboard?: string;\n\n /**\n * The label for the thumbs up button.\n * @default \"Thumbs up\"\n */\n thumbsUp?: string;\n\n /**\n * The label for the thumbs down button.\n * @default \"Thumbs down\"\n */\n thumbsDown?: string;\n\n /**\n * The text to display when content is copied.\n * @default \"Copied!\"\n */\n copied?: 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 copyToClipboard: \"Copy to clipboard\",\n thumbsUp: \"Thumbs up\",\n thumbsDown: \"Thumbs down\",\n copied: \"Copied!\",\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.MicrophoneIcon,\n copyIcon: DefaultIcons.CopyIcon,\n thumbsUpIcon: DefaultIcons.ThumbsUpIcon,\n thumbsDownIcon: DefaultIcons.ThumbsDownIcon,\n uploadIcon: DefaultIcons.UploadIcon,\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, { useState, useRef, useEffect, forwardRef, useImperativeHandle } from \"react\";\n\ninterface AutoResizingTextareaProps {\n maxRows?: number;\n placeholder?: string;\n value: string;\n onChange: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;\n onKeyDown?: (event: React.KeyboardEvent<HTMLTextAreaElement>) => void;\n onCompositionStart?: () => void;\n onCompositionEnd?: () => void;\n autoFocus?: boolean;\n}\n\nconst AutoResizingTextarea = forwardRef<HTMLTextAreaElement, AutoResizingTextareaProps>(\n (\n {\n maxRows = 1,\n placeholder,\n value,\n onChange,\n onKeyDown,\n onCompositionStart,\n onCompositionEnd,\n autoFocus,\n },\n ref,\n ) => {\n const internalTextareaRef = useRef<HTMLTextAreaElement>(null);\n const [maxHeight, setMaxHeight] = useState<number>(0);\n\n useImperativeHandle(ref, () => internalTextareaRef.current as HTMLTextAreaElement);\n\n useEffect(() => {\n const calculateMaxHeight = () => {\n const textarea = internalTextareaRef.current;\n if (textarea) {\n textarea.style.height = \"auto\";\n const singleRowHeight = textarea.scrollHeight;\n setMaxHeight(singleRowHeight * maxRows);\n if (autoFocus) {\n textarea.focus();\n }\n }\n };\n\n calculateMaxHeight();\n }, [maxRows]);\n\n useEffect(() => {\n const textarea = internalTextareaRef.current;\n if (textarea) {\n textarea.style.height = \"auto\";\n textarea.style.height = `${Math.min(textarea.scrollHeight, maxHeight)}px`;\n }\n }, [value, maxHeight]);\n\n return (\n <textarea\n ref={internalTextareaRef}\n value={value}\n onChange={onChange}\n onKeyDown={onKeyDown}\n onCompositionStart={onCompositionStart}\n onCompositionEnd={onCompositionEnd}\n placeholder={placeholder}\n style={{\n overflow: \"auto\",\n resize: \"none\",\n maxHeight: `${maxHeight}px`,\n }}\n rows={1}\n />\n );\n },\n);\n\nexport default AutoResizingTextarea;\n","import { useCopilotContext, useCopilotMessagesContext } from \"@copilotkit/react-core\";\nimport { gqlToAGUI } from \"@copilotkit/runtime-client-gql\";\nimport { Message } from \"@copilotkit/shared\";\nimport { MutableRefObject, useEffect, useRef, useState } from \"react\";\n\nexport const checkMicrophonePermission = async () => {\n try {\n const permissionStatus = await navigator.permissions.query({\n name: \"microphone\" as PermissionName,\n });\n if (permissionStatus.state === \"granted\") {\n return true;\n } else {\n return false;\n }\n } catch (err) {\n console.error(\"Error checking microphone permission\", err);\n }\n};\n\nexport const requestMicAndPlaybackPermission = async () => {\n try {\n const stream = await navigator.mediaDevices.getUserMedia({ audio: true });\n const audioContext = new window.AudioContext();\n await audioContext.resume();\n return { stream, audioContext };\n } catch (err) {\n console.error(\"Error requesting microphone and playback permissions\", err);\n return null;\n }\n};\n\nconst startRecording = async (\n mediaStreamRef: MutableRefObject<MediaStream | null>,\n mediaRecorderRef: MutableRefObject<MediaRecorder | null>,\n audioContextRef: MutableRefObject<AudioContext | null>,\n recordedChunks: Blob[],\n onStop: () => void,\n) => {\n if (!mediaStreamRef.current || !audioContextRef.current) {\n mediaStreamRef.current = await navigator.mediaDevices.getUserMedia({ audio: true });\n audioContextRef.current = new window.AudioContext();\n await audioContextRef.current.resume();\n }\n\n mediaRecorderRef.current = new MediaRecorder(mediaStreamRef.current!);\n mediaRecorderRef.current.start(1000);\n mediaRecorderRef.current.ondataavailable = (event) => {\n recordedChunks.push(event.data);\n };\n mediaRecorderRef.current.onstop = onStop;\n};\n\nconst stopRecording = (mediaRecorderRef: MutableRefObject<MediaRecorder | null>) => {\n if (mediaRecorderRef.current && mediaRecorderRef.current.state !== \"inactive\") {\n mediaRecorderRef.current.stop();\n }\n};\n\nconst transcribeAudio = async (recordedChunks: Blob[], transcribeAudioUrl: string) => {\n const completeBlob = new Blob(recordedChunks, { type: \"audio/mp4\" });\n const formData = new FormData();\n formData.append(\"file\", completeBlob, \"recording.mp4\");\n\n const response = await fetch(transcribeAudioUrl, {\n method: \"POST\",\n body: formData,\n });\n\n if (!response.ok) {\n throw new Error(`Error: ${response.statusText}`);\n }\n\n const transcription = await response.json();\n return transcription.text;\n};\n\nconst playAudioResponse = (text: string, textToSpeechUrl: string, audioContext: AudioContext) => {\n const encodedText = encodeURIComponent(text);\n const url = `${textToSpeechUrl}?text=${encodedText}`;\n\n fetch(url)\n .then((response) => response.arrayBuffer())\n .then((arrayBuffer) => audioContext.decodeAudioData(arrayBuffer))\n .then((audioBuffer) => {\n const source = audioContext.createBufferSource();\n source.buffer = audioBuffer;\n source.connect(audioContext.destination);\n source.start(0);\n })\n .catch((error) => {\n console.error(\"Error with decoding audio data\", error);\n });\n};\n\nexport type PushToTalkState = \"idle\" | \"recording\" | \"transcribing\";\n\nexport type SendFunction = (text: string) => Promise<Message>;\n\nexport const usePushToTalk = ({\n sendFunction,\n inProgress,\n}: {\n sendFunction: SendFunction;\n inProgress: boolean;\n}) => {\n const [pushToTalkState, setPushToTalkState] = useState<PushToTalkState>(\"idle\");\n const mediaStreamRef = useRef<MediaStream | null>(null);\n const audioContextRef = useRef<AudioContext | null>(null);\n const mediaRecorderRef = useRef<MediaRecorder | null>(null);\n const recordedChunks = useRef<Blob[]>([]);\n const generalContext = useCopilotContext();\n const messagesContext = useCopilotMessagesContext();\n const context = { ...generalContext, ...messagesContext };\n const [startReadingFromMessageId, setStartReadingFromMessageId] = useState<string | null>(null);\n\n useEffect(() => {\n if (pushToTalkState === \"recording\") {\n startRecording(\n mediaStreamRef,\n mediaRecorderRef,\n audioContextRef,\n recordedChunks.current,\n () => {\n setPushToTalkState(\"transcribing\");\n },\n );\n } else {\n stopRecording(mediaRecorderRef);\n if (pushToTalkState === \"transcribing\") {\n transcribeAudio(recordedChunks.current, context.copilotApiConfig.transcribeAudioUrl!).then(\n async (transcription) => {\n recordedChunks.current = [];\n setPushToTalkState(\"idle\");\n const message = await sendFunction(transcription);\n setStartReadingFromMessageId(message.id);\n },\n );\n }\n }\n\n return () => {\n stopRecording(mediaRecorderRef);\n };\n }, [pushToTalkState]);\n\n useEffect(() => {\n if (inProgress === false && startReadingFromMessageId) {\n const lastMessageIndex = context.messages.findIndex(\n (message) => message.id === startReadingFromMessageId,\n );\n\n const aguiMessages = gqlToAGUI(context.messages);\n\n const messagesAfterLast = aguiMessages\n .slice(lastMessageIndex + 1)\n .filter((message) => message.role === \"assistant\");\n\n const text = messagesAfterLast.map((message) => message.content).join(\"\\n\");\n playAudioResponse(text, context.copilotApiConfig.textToSpeechUrl!, audioContextRef.current!);\n\n setStartReadingFromMessageId(null);\n }\n }, [startReadingFromMessageId, inProgress]);\n\n return { pushToTalkState, setPushToTalkState };\n};\n","import React, { useState, useEffect } from \"react\";\nimport { useDarkMode } from \"../../hooks/use-dark-mode\";\n\nexport function PoweredByTag({ showPoweredBy = true }: { showPoweredBy?: boolean }) {\n const [mounted, setMounted] = useState(false);\n const isDark = useDarkMode();\n\n /*\n note(tylerslaton):\n\n Ensure we only use the isDark computed value after client-side mount.\n This prevents hydration mismatches by using a default color on the\n server and initial client render, then updating to the correct\n dark mode color after hydration is complete.\n */\n useEffect(() => {\n setMounted(true);\n }, []);\n\n if (!showPoweredBy) {\n return null;\n }\n\n const poweredByStyle = {\n visibility: \"visible\",\n display: \"block\",\n position: \"static\",\n textAlign: \"center\",\n fontSize: \"12px\",\n padding: \"3px 0\",\n color: mounted && isDark ? \"rgb(69, 69, 69)\" : \"rgb(214, 214, 214)\",\n };\n\n return (\n <div>\n {/*@ts-expect-error -- expecting position not to be a string, but it can be.*/}\n <p className=\"poweredBy\" style={poweredByStyle}>\n Powered by CopilotKit\n </p>\n </div>\n );\n}\n","export const useDarkMode = () => {\n if (typeof window === \"undefined\") return false;\n return (\n document.documentElement.classList.contains(\"dark\") ||\n document.body.classList.contains(\"dark\") ||\n document.documentElement.getAttribute(\"data-theme\") === \"dark\" ||\n document.body.getAttribute(\"data-theme\") === \"dark\" ||\n window.matchMedia(\"(prefers-color-scheme: dark)\").matches\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,gBAAiD;;;ACAjD,mBAAyC;AAsPhC;AApFF,IAAM,cAAc,aAAAC,QAAM,cAAuC,MAAS;AAE1E,SAAS,iBAA8B;AAC5C,QAAM,UAAU,aAAAA,QAAM,WAAW,WAAW;AAC5C,MAAI,YAAY,QAAW;AACzB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;;;AC5KA,IAAAC,gBAAoF;AAyD9E,IAAAC,sBAAA;AA5CN,IAAM,2BAAuB;AAAA,EAC3B,CACE;AAAA,IACE,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,GACA,QACG;AACH,UAAM,0BAAsB,sBAA4B,IAAI;AAC5D,UAAM,CAAC,WAAW,YAAY,QAAI,wBAAiB,CAAC;AAEpD,2CAAoB,KAAK,MAAM,oBAAoB,OAA8B;AAEjF,iCAAU,MAAM;AACd,YAAM,qBAAqB,MAAM;AAC/B,cAAM,WAAW,oBAAoB;AACrC,YAAI,UAAU;AACZ,mBAAS,MAAM,SAAS;AACxB,gBAAM,kBAAkB,SAAS;AACjC,uBAAa,kBAAkB,OAAO;AACtC,cAAI,WAAW;AACb,qBAAS,MAAM;AAAA,UACjB;AAAA,QACF;AAAA,MACF;AAEA,yBAAmB;AAAA,IACrB,GAAG,CAAC,OAAO,CAAC;AAEZ,iCAAU,MAAM;AACd,YAAM,WAAW,oBAAoB;AACrC,UAAI,UAAU;AACZ,iBAAS,MAAM,SAAS;AACxB,iBAAS,MAAM,SAAS,GAAG,KAAK,IAAI,SAAS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U,CAAC,UAAU,QAAQ,MAAM,OAAO,KAAK;AAAA,UAC/C,oBAAoB,MAAM,eAAe,IAAI;AAAA,UAC7C,kBAAkB,MAAM,eAAe,KAAK;AAAA,UAC5C,WAAW,CAAC,UAAU;AACpB,gBAAI,MAAM,QAAQ,WAAW,CAAC,MAAM,YAAY,CAAC,aAAa;AAC5D,oBAAM,eAAe;AACrB,kBAAI,SAAS;AACX,qBAAK;AAAA,cACP;AAAA,YACF;AAAA,UACF;AAAA;AAAA,MACF;AAAA,MACA,8CAAC,SAAI,WAAU,2BACZ;AAAA,oBACC,6CAAC,YAAO,SAAS,UAAU,WAAU,gCAClC,kBAAQ,MAAM,YACjB;AAAA,QAGF,6CAAC,SAAI,OAAO,EAAE,UAAU,EAAE,GAAG;AAAA,QAE5B,kBACC;AAAA,UAAC;AAAA;AAAA,YACC,SAAS,MACP,mBAAmB,oBAAoB,SAAS,cAAc,cAAc;AAAA,YAE9E,WACE,oBAAoB,cAChB,+DACA;AAAA,YAGL,kBAAQ,MAAM;AAAA;AAAA,QACjB;AAAA,QAEF;AAAA,UAAC;AAAA;AAAA,YACC,UAAU;AAAA,YACV,SAAS,gBAAgB,CAAC,iBAAiB,SAAS;AAAA,YACpD,+BAA6B;AAAA,YAC7B,gBAAc,aAAa,qCAAqC;AAAA,YAChE,WAAU;AAAA,YACV,cAAY;AAAA,YAEX;AAAA;AAAA,QACH;AAAA,SACF;AAAA,OACF;AAAA,IACA,6CAAC,gBAAa,eAA8B;AAAA,KAC9C;AAEJ;","names":["import_react","React","import_react","import_jsx_runtime","import_react","import_react_core","import_react","import_jsx_runtime","import_jsx_runtime","_a"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Input
|
|
3
|
+
} from "../../chunk-3W6J75HS.mjs";
|
|
4
|
+
import "../../chunk-ELGRNEAO.mjs";
|
|
5
|
+
import "../../chunk-QIOJXTIQ.mjs";
|
|
6
|
+
import "../../chunk-IEMQ2SQW.mjs";
|
|
7
|
+
import "../../chunk-XWG3L6QC.mjs";
|
|
8
|
+
import "../../chunk-JGMFJZMG.mjs";
|
|
9
|
+
import "../../chunk-O72ZB5V3.mjs";
|
|
10
|
+
import "../../chunk-MRXNTQOX.mjs";
|
|
11
|
+
export {
|
|
12
|
+
Input
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=Input.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Components } from 'react-markdown';
|
|
3
|
+
|
|
4
|
+
type MarkdownProps = {
|
|
5
|
+
content: string;
|
|
6
|
+
components?: Components;
|
|
7
|
+
};
|
|
8
|
+
declare const Markdown: ({ content, components }: MarkdownProps) => react_jsx_runtime.JSX.Element;
|
|
9
|
+
|
|
10
|
+
export { Markdown };
|