@agentscope-ai/chat 1.1.4 → 1.1.7
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/LICENSE +74 -0
- package/README.md +156 -56
- package/README.zh-CN.md +188 -0
- package/lib/AGUI/components/HelpModal/icons.d.ts +5 -0
- package/lib/AGUI/components/HelpModal/icons.js +84 -0
- package/lib/AGUI/components/HelpModal/index.d.ts +1 -0
- package/lib/AGUI/components/HelpModal/index.js +1 -0
- package/lib/AGUI/components/HelpModal/modal.d.ts +1 -0
- package/lib/AGUI/components/HelpModal/modal.js +104 -0
- package/lib/AGUI/components/chat/Button.d.ts +2 -0
- package/lib/AGUI/components/chat/Button.js +27 -0
- package/lib/AGUI/components/chat/Chat.d.ts +242 -0
- package/lib/AGUI/components/chat/Chat.js +634 -0
- package/lib/AGUI/components/chat/ChatContext.d.ts +142 -0
- package/lib/AGUI/components/chat/ChatContext.js +75 -0
- package/lib/AGUI/components/chat/CodeBlock.d.ts +12 -0
- package/lib/AGUI/components/chat/CodeBlock.js +398 -0
- package/lib/AGUI/components/chat/Header.d.ts +2 -0
- package/lib/AGUI/components/chat/Header.js +28 -0
- package/lib/AGUI/components/chat/Icons.d.ts +16 -0
- package/lib/AGUI/components/chat/Icons.js +247 -0
- package/lib/AGUI/components/chat/ImageUploadQueue.d.ts +11 -0
- package/lib/AGUI/components/chat/ImageUploadQueue.js +65 -0
- package/lib/AGUI/components/chat/Input.d.ts +2 -0
- package/lib/AGUI/components/chat/Input.js +30 -0
- package/lib/AGUI/components/chat/Markdown.d.ts +7 -0
- package/lib/AGUI/components/chat/Markdown.js +187 -0
- package/lib/AGUI/components/chat/Messages.d.ts +7 -0
- package/lib/AGUI/components/chat/Messages.js +242 -0
- package/lib/AGUI/components/chat/Modal.d.ts +43 -0
- package/lib/AGUI/components/chat/Modal.js +113 -0
- package/lib/AGUI/components/chat/Popup.d.ts +49 -0
- package/lib/AGUI/components/chat/Popup.js +64 -0
- package/lib/AGUI/components/chat/PoweredByTag.d.ts +3 -0
- package/lib/AGUI/components/chat/PoweredByTag.js +27 -0
- package/lib/AGUI/components/chat/Sidebar.d.ts +2 -0
- package/lib/AGUI/components/chat/Sidebar.js +85 -0
- package/lib/AGUI/components/chat/Suggestion.d.ts +16 -0
- package/{dist/voice-chat/VoiceChatService/index.js → lib/AGUI/components/chat/Suggestion.js} +138 -201
- package/lib/AGUI/components/chat/Suggestions.d.ts +2 -0
- package/lib/AGUI/components/chat/Suggestions.js +21 -0
- package/lib/AGUI/components/chat/Textarea.d.ts +11 -0
- package/lib/AGUI/components/chat/Textarea.js +60 -0
- package/lib/AGUI/components/chat/Window.d.ts +2 -0
- package/lib/AGUI/components/chat/Window.js +115 -0
- package/lib/AGUI/components/chat/index.d.ts +11 -0
- package/lib/AGUI/components/chat/index.js +11 -0
- package/lib/AGUI/components/chat/messages/AssistantMessage.d.ts +2 -0
- package/lib/AGUI/components/chat/messages/AssistantMessage.js +56 -0
- package/lib/AGUI/components/chat/messages/RenderActionExecutionMessage.d.ts +2 -0
- package/lib/AGUI/components/chat/messages/RenderActionExecutionMessage.js +114 -0
- package/lib/AGUI/components/chat/messages/RenderAgentStateMessage.d.ts +2 -0
- package/lib/AGUI/components/chat/messages/RenderAgentStateMessage.js +97 -0
- package/lib/AGUI/components/chat/messages/RenderImageMessage.d.ts +2 -0
- package/lib/AGUI/components/chat/messages/RenderImageMessage.js +61 -0
- package/lib/AGUI/components/chat/messages/RenderResultMessage.d.ts +2 -0
- package/lib/AGUI/components/chat/messages/RenderResultMessage.js +27 -0
- package/lib/AGUI/components/chat/messages/RenderTextMessage.d.ts +2 -0
- package/lib/AGUI/components/chat/messages/RenderTextMessage.js +47 -0
- package/lib/AGUI/components/chat/messages/UserMessage.d.ts +2 -0
- package/lib/AGUI/components/chat/messages/UserMessage.js +9 -0
- package/lib/AGUI/components/chat/props.d.ts +157 -0
- package/lib/AGUI/components/index.d.ts +1 -0
- package/lib/AGUI/components/index.js +1 -0
- package/lib/AGUI/context/index.d.ts +1 -0
- package/lib/AGUI/hooks/index.d.ts +1 -0
- package/lib/AGUI/hooks/index.js +1 -0
- package/lib/AGUI/hooks/use-copilot-chat-suggestions.d.ts +87 -0
- package/lib/AGUI/hooks/use-copilot-chat-suggestions.js +95 -0
- package/lib/AGUI/hooks/use-copy-to-clipboard.d.ts +7 -0
- package/{dist/theme/genStyleUtils.js → lib/AGUI/hooks/use-copy-to-clipboard.js} +27 -42
- package/lib/AGUI/hooks/use-dark-mode.d.ts +1 -0
- package/lib/AGUI/hooks/use-dark-mode.js +4 -0
- package/lib/AGUI/hooks/use-push-to-talk.d.ts +16 -0
- package/lib/AGUI/hooks/use-push-to-talk.js +260 -0
- package/lib/AGUI/index.d.ts +4 -0
- package/lib/AGUI/index.js +4 -0
- package/lib/AGUI/lib/utils.d.ts +2 -0
- package/lib/AGUI/lib/utils.js +52 -0
- package/lib/AGUI/types/index.d.ts +1 -0
- package/lib/AGUI/types/suggestions.d.ts +6 -0
- package/lib/Accordion/Accordion.d.ts +64 -0
- package/{dist/accordion → lib/Accordion}/Accordion.js +101 -40
- package/{dist/accordion → lib/Accordion}/BodyContent.d.ts +1 -1
- package/lib/Accordion/BodyContent.js +23 -0
- package/lib/Accordion/DeepThinking.d.ts +28 -0
- package/lib/Accordion/DeepThinking.js +35 -0
- package/lib/Accordion/SoftLightTitle.d.ts +3 -0
- package/lib/Accordion/SoftLightTitle.js +17 -0
- package/lib/Accordion/index.d.ts +2 -0
- package/lib/Accordion/style.d.ts +2 -0
- package/lib/Accordion/style.js +60 -0
- package/lib/Attachments/DropArea.d.ts +24 -0
- package/{dist/attachments → lib/Attachments}/DropArea.js +5 -11
- package/lib/Attachments/FileList/AudioIcon.d.ts +1 -0
- package/lib/Attachments/FileList/AudioIcon.js +24 -0
- package/lib/Attachments/FileList/FileListCard.d.ts +36 -0
- package/{dist/attachments → lib/Attachments}/FileList/FileListCard.js +109 -83
- package/lib/Attachments/FileList/Progress.d.ts +13 -0
- package/{dist/attachments → lib/Attachments}/FileList/Progress.js +7 -5
- package/lib/Attachments/FileList/VideoIcon.d.ts +1 -0
- package/lib/Attachments/FileList/VideoIcon.js +24 -0
- package/lib/Attachments/FileList/index.d.ts +56 -0
- package/{dist/attachments → lib/Attachments}/FileList/index.js +48 -48
- package/lib/Attachments/PlaceholderUploader.d.ts +49 -0
- package/{dist/attachments → lib/Attachments}/PlaceholderUploader.js +33 -28
- package/lib/Attachments/SilentUploader.d.ts +21 -0
- package/lib/Attachments/SilentUploader.js +30 -0
- package/lib/Attachments/context.d.ts +9 -0
- package/lib/Attachments/index.d.ts +97 -0
- package/lib/Attachments/index.en-US.md.bk +10 -0
- package/{dist/attachments → lib/Attachments}/index.js +51 -55
- package/lib/Attachments/index.zh-CN.md.bk +10 -0
- package/lib/Attachments/style/fileCard.d.ts +2 -0
- package/lib/Attachments/style/fileCard.js +68 -0
- package/lib/Attachments/style/index.d.ts +2 -0
- package/lib/Attachments/style/index.js +98 -0
- package/{dist/bubble → lib/Bubble}/Avatar.d.ts +0 -1
- package/{dist/bubble → lib/Bubble}/Avatar.js +8 -5
- package/lib/Bubble/Bubble.d.ts +19 -0
- package/{dist/bubble → lib/Bubble}/Bubble.js +39 -52
- package/lib/Bubble/BubbleList.d.ts +41 -0
- package/lib/Bubble/BubbleList.js +64 -0
- package/{dist/bubble → lib/Bubble}/Cards.d.ts +2 -8
- package/{dist/bubble → lib/Bubble}/Cards.js +9 -9
- package/{dist/bubble → lib/Bubble}/ScrollToBottom.d.ts +0 -1
- package/{dist/bubble → lib/Bubble}/ScrollToBottom.js +15 -14
- package/lib/Bubble/Spin.d.ts +1 -0
- package/lib/Bubble/Spin.js +21 -0
- package/lib/Bubble/hooks/useListData.d.ts +0 -0
- package/lib/Bubble/hooks/useListData.js +0 -0
- package/lib/Bubble/interface.d.ts +62 -0
- package/lib/Bubble/loading.js +17 -0
- package/lib/Bubble/style/avatar.d.ts +2 -0
- package/lib/Bubble/style/avatar.js +8 -0
- package/lib/Bubble/style/index.d.ts +2 -0
- package/lib/Bubble/style/index.js +46 -0
- package/lib/Bubble/style/list.d.ts +2 -0
- package/lib/Bubble/style/list.js +16 -0
- package/{dist/chat-anywhere → lib/ChatAnywhere}/Chat/index.d.ts +0 -1
- package/{dist/chat-anywhere → lib/ChatAnywhere}/Chat/index.js +39 -28
- package/lib/ChatAnywhere/Chat/style.d.ts +2 -0
- package/lib/ChatAnywhere/Chat/style.js +14 -0
- package/lib/ChatAnywhere/Header/index.d.ts +1 -0
- package/lib/ChatAnywhere/Header/index.js +39 -0
- package/lib/ChatAnywhere/Header/style.d.ts +2 -0
- package/lib/ChatAnywhere/Header/style.js +12 -0
- package/lib/ChatAnywhere/Input/index.d.ts +3 -0
- package/{dist/chat-anywhere → lib/ChatAnywhere}/Input/index.js +87 -68
- package/lib/ChatAnywhere/Input/style.d.ts +2 -0
- package/lib/ChatAnywhere/Input/style.js +6 -0
- package/{dist/chat-anywhere → lib/ChatAnywhere}/Layout/index.d.ts +1 -2
- package/lib/ChatAnywhere/Layout/index.js +91 -0
- package/lib/ChatAnywhere/Layout/style.d.ts +2 -0
- package/lib/ChatAnywhere/Layout/style.js +16 -0
- package/lib/ChatAnywhere/SessionList/index.d.ts +3 -0
- package/{dist/chat-anywhere → lib/ChatAnywhere}/SessionList/index.js +67 -55
- package/lib/ChatAnywhere/SessionList/style.d.ts +2 -0
- package/lib/ChatAnywhere/SessionList/style.js +14 -0
- package/lib/ChatAnywhere/hooks/ChatAnywhereProvider.d.ts +148 -0
- package/{dist/chat-anywhere → lib/ChatAnywhere}/hooks/ChatAnywhereProvider.js +11 -5
- package/lib/ChatAnywhere/hooks/types.d.ts +312 -0
- package/{dist/chat-anywhere → lib/ChatAnywhere}/hooks/useMessages.d.ts +3 -1
- package/{dist/chat-anywhere → lib/ChatAnywhere}/hooks/useMessages.js +10 -2
- package/{dist/chat-anywhere → lib/ChatAnywhere}/index.d.ts +4 -1
- package/{dist/chat-anywhere → lib/ChatAnywhere}/index.js +28 -15
- package/{dist/conversations → lib/Conversations}/GroupTitle.d.ts +4 -0
- package/{dist/conversations → lib/Conversations}/GroupTitle.js +7 -5
- package/{dist/conversations → lib/Conversations}/Item.d.ts +1 -0
- package/lib/Conversations/Item.js +208 -0
- package/lib/Conversations/hooks/useGroupable.d.ts +8 -0
- package/lib/Conversations/index.d.ts +55 -0
- package/{dist/conversations → lib/Conversations}/index.js +50 -61
- package/lib/Conversations/interface.d.ts +56 -0
- package/lib/Conversations/style.d.ts +2 -0
- package/lib/Conversations/style.js +60 -0
- package/{dist/default-cards/DeepThink → lib/DefaultCards/DeepThinking}/index.d.ts +2 -3
- package/lib/DefaultCards/DeepThinking/index.js +12 -0
- package/lib/DefaultCards/Files/index.d.ts +1 -0
- package/lib/DefaultCards/Files/index.js +56 -0
- package/{dist/default-cards → lib/DefaultCards}/Footer/index.d.ts +3 -4
- package/lib/DefaultCards/Footer/index.js +74 -0
- package/lib/DefaultCards/Images/index.d.ts +1 -0
- package/lib/DefaultCards/Images/index.js +49 -0
- package/{dist/default-cards → lib/DefaultCards}/Interrupted/index.d.ts +1 -3
- package/lib/DefaultCards/Interrupted/index.js +54 -0
- package/lib/DefaultCards/Text/index.d.ts +1 -0
- package/{dist/default-cards → lib/DefaultCards}/Text/index.js +4 -2
- package/lib/DefaultCards/count/index.d.ts +1 -0
- package/lib/DefaultCards/count/index.js +36 -0
- package/{dist/default-cards → lib/DefaultCards}/index.d.ts +1 -1
- package/{dist/default-cards → lib/DefaultCards}/index.js +1 -1
- package/lib/Disclaimer/index.d.ts +22 -0
- package/lib/Disclaimer/index.js +26 -0
- package/lib/Disclaimer/style.d.ts +2 -0
- package/lib/Disclaimer/style.js +10 -0
- package/lib/ImageGenerator/index.d.ts +41 -0
- package/lib/ImageGenerator/index.js +75 -0
- package/lib/ImageGenerator/style.d.ts +2 -0
- package/lib/ImageGenerator/style.js +20 -0
- package/{dist/markdown → lib/Markdown}/Citation.js +19 -14
- package/{dist/markdown → lib/Markdown}/CodeBlock.d.ts +1 -0
- package/{dist/markdown → lib/Markdown}/CodeBlock.js +51 -30
- package/lib/Markdown/ImageOrMedia.d.ts +1 -0
- package/lib/Markdown/ImageOrMedia.js +113 -0
- package/lib/Markdown/Link.js +48 -0
- package/{dist/markdown → lib/Markdown}/Markdown.js +22 -11
- package/lib/Markdown/cursor/Dot.d.ts +1 -0
- package/lib/Markdown/cursor/Dot.js +35 -0
- package/lib/Markdown/cursor/Underline.d.ts +1 -0
- package/lib/Markdown/cursor/Underline.js +19 -0
- package/lib/Markdown/hooks/index.d.ts +0 -0
- package/lib/Markdown/hooks/index.js +0 -0
- package/{dist/markdown → lib/Markdown}/hooks/useTypedEffect.js +1 -1
- package/lib/Markdown/index.d.ts +63 -0
- package/lib/Markdown/index.js +44 -0
- package/lib/Markdown/style.d.ts +2 -0
- package/lib/Markdown/style.js +36 -0
- package/lib/Markdown/type.d.ts +186 -0
- package/{dist/markdown → lib/Markdown}/utils.js +1 -2
- package/lib/Mermaid/index.d.ts +18 -0
- package/{dist/voice-chat/Recorder → lib/Mermaid}/index.js +144 -160
- package/{dist/provider → lib/Provider}/CustomCardsProvider.d.ts +2 -1
- package/{dist/provider → lib/Provider}/CustomCardsProvider.js +5 -3
- package/{dist/provider → lib/Provider}/GlobalProvider.d.ts +1 -1
- package/{dist/provider → lib/Provider}/GlobalProvider.js +5 -3
- package/{dist/provider → lib/Provider}/index.d.ts +1 -2
- package/{dist/provider → lib/Provider}/index.js +9 -6
- package/lib/Provider/types.d.ts +24 -0
- package/lib/Provider/types.js +1 -0
- package/lib/Sender/ModeSelect/index.d.ts +17 -0
- package/lib/Sender/ModeSelect/index.js +109 -0
- package/lib/Sender/ModeSelect/styles.d.ts +0 -0
- package/lib/Sender/ModeSelect/styles.js +0 -0
- package/lib/Sender/SenderHeader.d.ts +63 -0
- package/{dist/sender → lib/Sender}/SenderHeader.js +40 -32
- package/{dist/sender → lib/Sender}/StopLoading.d.ts +1 -1
- package/lib/Sender/StopLoading.js +25 -0
- package/lib/Sender/components/ActionButton.d.ts +72 -0
- package/{dist/sender → lib/Sender}/components/ActionButton.js +9 -5
- package/lib/Sender/components/ClearButton.js +19 -0
- package/lib/Sender/components/LoadingButton.js +28 -0
- package/lib/Sender/components/SendButton.js +20 -0
- package/lib/Sender/components/SpeechButton/RecordingIcon.d.ts +8 -0
- package/lib/Sender/components/SpeechButton/RecordingIcon.js +54 -0
- package/lib/Sender/components/SpeechButton/index.js +35 -0
- package/lib/Sender/index.d.ts +142 -0
- package/{dist/sender → lib/Sender}/index.js +128 -121
- package/lib/Sender/style/index.d.ts +2 -0
- package/lib/Sender/style/index.js +41 -0
- package/{dist/stream → lib/Stream}/index.d.ts +4 -2
- package/{dist/stream → lib/Stream}/index.js +1 -1
- package/lib/Util/createStyle.d.ts +5 -0
- package/lib/Util/createStyle.js +20 -0
- package/lib/Util/sleep.d.ts +1 -0
- package/lib/Util/sleep.js +5 -0
- package/lib/Util/type.js +1 -0
- package/{dist/_util → lib/Util}/warning.d.ts +2 -2
- package/lib/Voice/Recorder.d.ts +1 -0
- package/lib/Voice/Recorder.js +6 -0
- package/lib/Voice/index.d.ts +0 -0
- package/lib/Voice/index.js +0 -0
- package/lib/Welcome/index.d.ts +24 -0
- package/lib/Welcome/index.js +39 -0
- package/lib/index.d.ts +25 -0
- package/lib/index.js +24 -0
- package/lib/index.less +0 -0
- package/package.json +27 -13
- package/dist/accordion/Accordion.d.ts +0 -22
- package/dist/accordion/BodyContent.js +0 -18
- package/dist/accordion/DeepThink.d.ts +0 -7
- package/dist/accordion/DeepThink.js +0 -35
- package/dist/accordion/index.d.ts +0 -2
- package/dist/accordion/index.less +0 -170
- package/dist/attachments/DropArea.d.ts +0 -8
- package/dist/attachments/FileList/AudioIcon.d.ts +0 -2
- package/dist/attachments/FileList/AudioIcon.js +0 -19
- package/dist/attachments/FileList/FileListCard.d.ts +0 -12
- package/dist/attachments/FileList/Progress.d.ts +0 -6
- package/dist/attachments/FileList/VideoIcon.d.ts +0 -2
- package/dist/attachments/FileList/VideoIcon.js +0 -19
- package/dist/attachments/FileList/index.d.ts +0 -16
- package/dist/attachments/PlaceholderUploader.d.ts +0 -17
- package/dist/attachments/SilentUploader.d.ts +0 -9
- package/dist/attachments/SilentUploader.js +0 -23
- package/dist/attachments/context.d.ts +0 -5
- package/dist/attachments/index.d.ts +0 -33
- package/dist/attachments/style/fileCard.d.ts +0 -4
- package/dist/attachments/style/fileCard.js +0 -124
- package/dist/attachments/style/index.d.ts +0 -10
- package/dist/attachments/style/index.js +0 -211
- package/dist/bubble/Bubble.d.ts +0 -11
- package/dist/bubble/BubbleList.d.ts +0 -15
- package/dist/bubble/BubbleList.js +0 -44
- package/dist/bubble/Spin.d.ts +0 -2
- package/dist/bubble/Spin.js +0 -18
- package/dist/bubble/interface.d.ts +0 -26
- package/dist/bubble/loading.js +0 -17
- package/dist/bubble/style/avatar.less +0 -40
- package/dist/bubble/style/content.d.ts +0 -4
- package/dist/bubble/style/content.js +0 -43
- package/dist/bubble/style/index.d.ts +0 -9
- package/dist/bubble/style/index.js +0 -53
- package/dist/bubble/style/list.less +0 -15
- package/dist/bubble/style/scrollToBottom.less +0 -174
- package/dist/chat-anywhere/Chat/index.less +0 -54
- package/dist/chat-anywhere/Header/index.d.ts +0 -3
- package/dist/chat-anywhere/Header/index.js +0 -32
- package/dist/chat-anywhere/Header/index.less +0 -24
- package/dist/chat-anywhere/Input/index.d.ts +0 -3
- package/dist/chat-anywhere/Input/index.less +0 -12
- package/dist/chat-anywhere/Layout/index.js +0 -73
- package/dist/chat-anywhere/Layout/index.less +0 -61
- package/dist/chat-anywhere/SessionList/index.d.ts +0 -5
- package/dist/chat-anywhere/SessionList/index.less +0 -52
- package/dist/chat-anywhere/hooks/ChatAnywhereProvider.d.ts +0 -43
- package/dist/chat-anywhere/hooks/types.d.ts +0 -57
- package/dist/conversations/Item.js +0 -96
- package/dist/conversations/hooks/useGroupable.d.ts +0 -9
- package/dist/conversations/index.d.ts +0 -62
- package/dist/conversations/interface.d.ts +0 -60
- package/dist/conversations/style/index.d.ts +0 -9
- package/dist/conversations/style/index.js +0 -80
- package/dist/default-cards/Count/index.d.ts +0 -3
- package/dist/default-cards/Count/index.js +0 -16
- package/dist/default-cards/Count/index.less +0 -19
- package/dist/default-cards/DeepThink/index.js +0 -11
- package/dist/default-cards/Files/index.d.ts +0 -2
- package/dist/default-cards/Files/index.js +0 -18
- package/dist/default-cards/Footer/index.js +0 -50
- package/dist/default-cards/Footer/index.less +0 -41
- package/dist/default-cards/Images/index.d.ts +0 -3
- package/dist/default-cards/Images/index.js +0 -33
- package/dist/default-cards/Images/index.less +0 -17
- package/dist/default-cards/Interrupted/index.js +0 -40
- package/dist/default-cards/Interrupted/index.less +0 -57
- package/dist/default-cards/Text/index.d.ts +0 -2
- package/dist/disclaimer/index.d.ts +0 -11
- package/dist/disclaimer/index.js +0 -26
- package/dist/docs/1896.async.js +0 -457
- package/dist/docs/2710.async.js +0 -62
- package/dist/docs/2863.async.js +0 -400
- package/dist/docs/3057.async.js +0 -46
- package/dist/docs/3364.async.js +0 -25
- package/dist/docs/404.html +0 -15
- package/dist/docs/4820.async.js +0 -1381
- package/dist/docs/5623.async.js +0 -60
- package/dist/docs/5757.async.js +0 -1
- package/dist/docs/5804.async.js +0 -271
- package/dist/docs/6198.async.js +0 -18
- package/dist/docs/6671.async.js +0 -137
- package/dist/docs/7195.async.js +0 -1
- package/dist/docs/7485.async.js +0 -29
- package/dist/docs/7931.async.js +0 -19
- package/dist/docs/7997.async.js +0 -5
- package/dist/docs/8156.async.js +0 -110
- package/dist/docs/8368.async.js +0 -2
- package/dist/docs/8480.async.js +0 -1449
- package/dist/docs/8618.async.js +0 -246
- package/dist/docs/9016.async.js +0 -32
- package/dist/docs/9016.chunk.css +0 -1
- package/dist/docs/9335.async.js +0 -11
- package/dist/docs/accordion__demos.async.js +0 -9
- package/dist/docs/attachments__demos.async.js +0 -1
- package/dist/docs/bubble__demos.async.js +0 -50
- package/dist/docs/components/accordion/index.html +0 -15
- package/dist/docs/components/accordion-cn/index.html +0 -15
- package/dist/docs/components/attachments/index.html +0 -15
- package/dist/docs/components/attachments-cn/index.html +0 -15
- package/dist/docs/components/bubble/index.html +0 -15
- package/dist/docs/components/bubble-cn/index.html +0 -15
- package/dist/docs/components/bubble-list/index.html +0 -15
- package/dist/docs/components/bubble-list-cn/index.html +0 -15
- package/dist/docs/components/conversations/index.html +0 -15
- package/dist/docs/components/conversations-cn/index.html +0 -15
- package/dist/docs/components/disclaimer/index.html +0 -15
- package/dist/docs/components/disclaimer-cn/index.html +0 -15
- package/dist/docs/components/footer/index.html +0 -15
- package/dist/docs/components/footer-cn/index.html +0 -15
- package/dist/docs/components/markdown/index.html +0 -15
- package/dist/docs/components/markdown-cn/index.html +0 -15
- package/dist/docs/components/sender/index.html +0 -15
- package/dist/docs/components/sender-cn/index.html +0 -15
- package/dist/docs/components/status/index.html +0 -15
- package/dist/docs/components/status-cn/index.html +0 -15
- package/dist/docs/components/welcome/index.html +0 -15
- package/dist/docs/components/welcome-cn/index.html +0 -15
- package/dist/docs/components__accordion__index.en-US.md.async.js +0 -6
- package/dist/docs/components__accordion__index.en-US.md.chunk.css +0 -1
- package/dist/docs/components__accordion__index.zh-CN.md.async.js +0 -6
- package/dist/docs/components__accordion__index.zh-CN.md.chunk.css +0 -1
- package/dist/docs/components__attachments__index.en-US.md.async.js +0 -1
- package/dist/docs/components__attachments__index.en-US.md.chunk.css +0 -1
- package/dist/docs/components__attachments__index.zh-CN.md.async.js +0 -1
- package/dist/docs/components__attachments__index.zh-CN.md.chunk.css +0 -1
- package/dist/docs/components__bubble-list__index.en-US.md.async.js +0 -2
- package/dist/docs/components__bubble-list__index.en-US.md.chunk.css +0 -1
- package/dist/docs/components__bubble-list__index.zh-CN.md.async.js +0 -2
- package/dist/docs/components__bubble-list__index.zh-CN.md.chunk.css +0 -1
- package/dist/docs/components__bubble__index.en-US.md.async.js +0 -1
- package/dist/docs/components__bubble__index.en-US.md.chunk.css +0 -1
- package/dist/docs/components__bubble__index.zh-CN.md.async.js +0 -1
- package/dist/docs/components__bubble__index.zh-CN.md.chunk.css +0 -1
- package/dist/docs/components__conversations__index.en-US.md.async.js +0 -2
- package/dist/docs/components__conversations__index.en-US.md.chunk.css +0 -1
- package/dist/docs/components__conversations__index.zh-CN.md.async.js +0 -1
- package/dist/docs/components__conversations__index.zh-CN.md.chunk.css +0 -1
- package/dist/docs/components__disclaimer__index.en-US.md.async.js +0 -1
- package/dist/docs/components__disclaimer__index.en-US.md.chunk.css +0 -1
- package/dist/docs/components__disclaimer__index.zh-CN.md.async.js +0 -1
- package/dist/docs/components__disclaimer__index.zh-CN.md.chunk.css +0 -1
- package/dist/docs/components__footer__index.en-US.md.async.js +0 -1
- package/dist/docs/components__footer__index.en-US.md.chunk.css +0 -1
- package/dist/docs/components__footer__index.zh-CN.md.async.js +0 -2
- package/dist/docs/components__footer__index.zh-CN.md.chunk.css +0 -1
- package/dist/docs/components__markdown__index.en-US.md.async.js +0 -1
- package/dist/docs/components__markdown__index.en-US.md.chunk.css +0 -1
- package/dist/docs/components__markdown__index.zh-CN.md.async.js +0 -1
- package/dist/docs/components__markdown__index.zh-CN.md.chunk.css +0 -1
- package/dist/docs/components__sender__index.en-US.md.async.js +0 -1
- package/dist/docs/components__sender__index.en-US.md.chunk.css +0 -1
- package/dist/docs/components__sender__index.zh-CN.md.async.js +0 -1
- package/dist/docs/components__sender__index.zh-CN.md.chunk.css +0 -1
- package/dist/docs/components__status__index.en-US.md.async.js +0 -1
- package/dist/docs/components__status__index.en-US.md.chunk.css +0 -1
- package/dist/docs/components__status__index.zh-CN.md.async.js +0 -2
- package/dist/docs/components__status__index.zh-CN.md.chunk.css +0 -1
- package/dist/docs/components__welcome__index.en-US.md.async.js +0 -2
- package/dist/docs/components__welcome__index.en-US.md.chunk.css +0 -1
- package/dist/docs/components__welcome__index.zh-CN.md.async.js +0 -2
- package/dist/docs/components__welcome__index.zh-CN.md.chunk.css +0 -1
- package/dist/docs/conversations__demos.async.js +0 -1
- package/dist/docs/demos.async.js +0 -47
- package/dist/docs/demos.chunk.css +0 -1
- package/dist/docs/disclaimer__demos.async.js +0 -1
- package/dist/docs/docs/development/ag-ui/index.html +0 -15
- package/dist/docs/docs/development/ag-ui-cn/index.html +0 -15
- package/dist/docs/docs/development/backend/index.html +0 -15
- package/dist/docs/docs/development/backend-cn/index.html +0 -15
- package/dist/docs/docs/development/cards/index.html +0 -15
- package/dist/docs/docs/development/cards-cn/index.html +0 -15
- package/dist/docs/docs/development/chatanywhere/index.html +0 -15
- package/dist/docs/docs/development/chatanywhere-api/index.html +0 -15
- package/dist/docs/docs/development/chatanywhere-api-cn/index.html +0 -15
- package/dist/docs/docs/development/chatanywhere-cn/index.html +0 -15
- package/dist/docs/docs/development/custom/index.html +0 -15
- package/dist/docs/docs/development/custom-cn/index.html +0 -15
- package/dist/docs/docs/development/overview/index.html +0 -15
- package/dist/docs/docs/development/overview-cn/index.html +0 -15
- package/dist/docs/docs/development/qwen/index.html +0 -15
- package/dist/docs/docs/development/qwen-cn/index.html +0 -15
- package/dist/docs/docs/templates/copilot/index.html +0 -15
- package/dist/docs/docs/templates/copilot-cn/index.html +0 -15
- package/dist/docs/docs/templates/native/index.html +0 -15
- package/dist/docs/docs/templates/native-cn/index.html +0 -15
- package/dist/docs/docs/templates/voice/index.html +0 -15
- package/dist/docs/docs/templates/voice-cn/index.html +0 -15
- package/dist/docs/docs__development__ag-ui.en-US.md.async.js +0 -210
- package/dist/docs/docs__development__ag-ui.en-US.md.chunk.css +0 -1
- package/dist/docs/docs__development__ag-ui.zh-CN.md.async.js +0 -210
- package/dist/docs/docs__development__ag-ui.zh-CN.md.chunk.css +0 -1
- package/dist/docs/docs__development__backend.en-US.md.async.js +0 -12
- package/dist/docs/docs__development__backend.en-US.md.chunk.css +0 -1
- package/dist/docs/docs__development__backend.zh-CN.md.async.js +0 -12
- package/dist/docs/docs__development__backend.zh-CN.md.chunk.css +0 -1
- package/dist/docs/docs__development__cards.en-US.md.async.js +0 -27
- package/dist/docs/docs__development__cards.en-US.md.chunk.css +0 -1
- package/dist/docs/docs__development__cards.zh-CN.md.async.js +0 -27
- package/dist/docs/docs__development__cards.zh-CN.md.chunk.css +0 -1
- package/dist/docs/docs__development__chatanywhere-api.en-US.md.async.js +0 -69
- package/dist/docs/docs__development__chatanywhere-api.en-US.md.chunk.css +0 -1
- package/dist/docs/docs__development__chatanywhere-api.zh-CN.md.async.js +0 -69
- package/dist/docs/docs__development__chatanywhere-api.zh-CN.md.chunk.css +0 -1
- package/dist/docs/docs__development__chatanywhere.en-US.md.async.js +0 -77
- package/dist/docs/docs__development__chatanywhere.en-US.md.chunk.css +0 -1
- package/dist/docs/docs__development__chatanywhere.zh-CN.md.async.js +0 -77
- package/dist/docs/docs__development__chatanywhere.zh-CN.md.chunk.css +0 -1
- package/dist/docs/docs__development__custom.en-US.md.async.js +0 -22
- package/dist/docs/docs__development__custom.en-US.md.chunk.css +0 -1
- package/dist/docs/docs__development__custom.zh-CN.md.async.js +0 -22
- package/dist/docs/docs__development__custom.zh-CN.md.chunk.css +0 -1
- package/dist/docs/docs__development__overview.en-US.md.async.js +0 -21
- package/dist/docs/docs__development__overview.en-US.md.chunk.css +0 -1
- package/dist/docs/docs__development__overview.zh-CN.md.async.js +0 -21
- package/dist/docs/docs__development__overview.zh-CN.md.chunk.css +0 -1
- package/dist/docs/docs__development__qwen.en-US.md.async.js +0 -25
- package/dist/docs/docs__development__qwen.en-US.md.chunk.css +0 -1
- package/dist/docs/docs__development__qwen.zh-CN.md.async.js +0 -25
- package/dist/docs/docs__development__qwen.zh-CN.md.chunk.css +0 -1
- package/dist/docs/docs__templates__copilot.en-US.md.async.js +0 -1
- package/dist/docs/docs__templates__copilot.en-US.md.chunk.css +0 -1
- package/dist/docs/docs__templates__copilot.zh-CN.md.async.js +0 -1
- package/dist/docs/docs__templates__copilot.zh-CN.md.chunk.css +0 -1
- package/dist/docs/docs__templates__native.en-US.md.async.js +0 -1
- package/dist/docs/docs__templates__native.en-US.md.chunk.css +0 -1
- package/dist/docs/docs__templates__native.zh-CN.md.async.js +0 -1
- package/dist/docs/docs__templates__native.zh-CN.md.chunk.css +0 -1
- package/dist/docs/docs__templates__voice.en-US.md.async.js +0 -20
- package/dist/docs/docs__templates__voice.en-US.md.chunk.css +0 -1
- package/dist/docs/docs__templates__voice.zh-CN.md.async.js +0 -1
- package/dist/docs/docs__templates__voice.zh-CN.md.chunk.css +0 -1
- package/dist/docs/dumi__pages__index__index.en-US.async.js +0 -1
- package/dist/docs/dumi__pages__index__index.en-US.chunk.css +0 -1
- package/dist/docs/dumi__pages__index__index.zh-CN.async.js +0 -1
- package/dist/docs/dumi__pages__index__index.zh-CN.chunk.css +0 -1
- package/dist/docs/dumi__theme__layouts__DocLayout__index.async.js +0 -1
- package/dist/docs/dumi__theme__layouts__DocLayout__index.chunk.css +0 -1
- package/dist/docs/dumi__theme__layouts__GlobalLayout__index.async.js +0 -18
- package/dist/docs/dumi__theme__layouts__GlobalLayout__index.chunk.css +0 -1
- package/dist/docs/dumi__tmp-production__dumi__theme__ContextWrapper.async.js +0 -1
- package/dist/docs/index/index.html +0 -15
- package/dist/docs/index-cn/index.html +0 -15
- package/dist/docs/markdown__demos.async.js +0 -164
- package/dist/docs/meta__components__en-US.async.js +0 -9
- package/dist/docs/meta__components__zh-CN.async.js +0 -10
- package/dist/docs/meta__docs__en-US.async.js +0 -475
- package/dist/docs/meta__docs__en-US.chunk.css +0 -1
- package/dist/docs/meta__docs__zh-CN.async.js +0 -456
- package/dist/docs/meta__docs__zh-CN.chunk.css +0 -1
- package/dist/docs/nm__dumi__dist__client__pages__404.async.js +0 -1
- package/dist/docs/nm__dumi__dist__client__pages__Demo__index.async.js +0 -1
- package/dist/docs/nm__dumi__dist__client__pages__Demo__index.chunk.css +0 -1
- package/dist/docs/preload_helper.js +0 -1
- package/dist/docs/sender__demos.async.js +0 -1
- package/dist/docs/umi.css +0 -1
- package/dist/docs/umi.js +0 -107
- package/dist/docs/welcome__demos.async.js +0 -1
- package/dist/docs/~demos/:id/index.html +0 -15
- package/dist/docs/~demos/accordion-demo-inline/index.html +0 -15
- package/dist/docs/~demos/accordion-demo-mutisteps/index.html +0 -15
- package/dist/docs/~demos/accordion-demo-thinking/index.html +0 -15
- package/dist/docs/~demos/attachments-demo-files/index.html +0 -15
- package/dist/docs/~demos/bubble-demo-basic/index.html +0 -15
- package/dist/docs/~demos/bubble-demo-havestopped/index.html +0 -15
- package/dist/docs/~demos/bubble-demo-userwithfile/index.html +0 -15
- package/dist/docs/~demos/bubble-demo-userwithimage/index.html +0 -15
- package/dist/docs/~demos/bubble-demo-userwithnormal/index.html +0 -15
- package/dist/docs/~demos/bubble-demo-withavatar/index.html +0 -15
- package/dist/docs/~demos/bubble-demo-withcode/index.html +0 -15
- package/dist/docs/~demos/bubble-demo-witherror/index.html +0 -15
- package/dist/docs/~demos/bubble-demo-witherrordetail/index.html +0 -15
- package/dist/docs/~demos/bubble-demo-withimage/index.html +0 -15
- package/dist/docs/~demos/bubble-demo-withusage/index.html +0 -15
- package/dist/docs/~demos/bubble-demo-withwaitingmessage/index.html +0 -15
- package/dist/docs/~demos/components-bubble-list-demo-basic/index.html +0 -15
- package/dist/docs/~demos/components-footer-demo-basic/index.html +0 -15
- package/dist/docs/~demos/components-footer-demo-withusage/index.html +0 -15
- package/dist/docs/~demos/components-status-demo-basic/index.html +0 -15
- package/dist/docs/~demos/conversations-demo-basic/index.html +0 -15
- package/dist/docs/~demos/disclaimer-demo-demo/index.html +0 -15
- package/dist/docs/~demos/disclaimer-demo-withlink/index.html +0 -15
- package/dist/docs/~demos/docs-development-ag-ui-demo-with-copilotkit/index.html +0 -15
- package/dist/docs/~demos/docs-development-cards-demo-file/index.html +0 -15
- package/dist/docs/~demos/docs-development-cards-demo-footer/index.html +0 -15
- package/dist/docs/~demos/docs-development-cards-demo-image/index.html +0 -15
- package/dist/docs/~demos/docs-development-cards-demo-text/index.html +0 -15
- package/dist/docs/~demos/docs-development-custom-demo-custom/index.html +0 -15
- package/dist/docs/~demos/docs-templates-copilot-demo-copilot/index.html +0 -15
- package/dist/docs/~demos/docs-templates-native-demo-basic/index.html +0 -15
- package/dist/docs/~demos/docs-templates-voice-demo-demo/index.html +0 -15
- package/dist/docs/~demos/markdown-demo-citations/index.html +0 -15
- package/dist/docs/~demos/markdown-demo-cursor/index.html +0 -15
- package/dist/docs/~demos/markdown-demo-mathjax/index.html +0 -15
- package/dist/docs/~demos/markdown-demo-md/index.html +0 -15
- package/dist/docs/~demos/sender-demo-basic/index.html +0 -15
- package/dist/docs/~demos/sender-demo-disabled/index.html +0 -15
- package/dist/docs/~demos/sender-demo-loading/index.html +0 -15
- package/dist/docs/~demos/sender-demo-moreprefixaction/index.html +0 -15
- package/dist/docs/~demos/sender-demo-withfile/index.html +0 -15
- package/dist/docs/~demos/welcome-demo-demo0/index.html +0 -15
- package/dist/docs/~demos/welcome-demo-demo1/index.html +0 -15
- package/dist/docs/~demos/welcome-demo-demo2/index.html +0 -15
- package/dist/index.d.ts +0 -26
- package/dist/index.js +0 -20
- package/dist/index.less +0 -1
- package/dist/markdown/ImageOrVideo.d.ts +0 -2
- package/dist/markdown/ImageOrVideo.js +0 -81
- package/dist/markdown/Link.js +0 -28
- package/dist/markdown/cursor/Blur.d.ts +0 -3
- package/dist/markdown/cursor/Blur.js +0 -7
- package/dist/markdown/cursor/Dot.d.ts +0 -3
- package/dist/markdown/cursor/Dot.js +0 -16
- package/dist/markdown/cursor/Underline.d.ts +0 -3
- package/dist/markdown/cursor/Underline.js +0 -7
- package/dist/markdown/cursor/index.less +0 -124
- package/dist/markdown/hooks/index.d.ts +0 -1
- package/dist/markdown/hooks/index.js +0 -49
- package/dist/markdown/index.d.ts +0 -16
- package/dist/markdown/index.js +0 -37
- package/dist/markdown/index.less +0 -204
- package/dist/markdown/type.d.ts +0 -46
- package/dist/provider/types.d.ts +0 -8
- package/dist/sender/SenderHeader.d.ts +0 -19
- package/dist/sender/StopLoading.js +0 -20
- package/dist/sender/components/ActionButton.d.ts +0 -22
- package/dist/sender/components/ClearButton.js +0 -13
- package/dist/sender/components/LoadingButton.js +0 -22
- package/dist/sender/components/SendButton.js +0 -14
- package/dist/sender/components/SpeechButton/RecordingIcon.d.ts +0 -5
- package/dist/sender/components/SpeechButton/RecordingIcon.js +0 -49
- package/dist/sender/components/SpeechButton/index.js +0 -30
- package/dist/sender/index.d.ts +0 -61
- package/dist/sender/style/header.d.ts +0 -4
- package/dist/sender/style/header.js +0 -46
- package/dist/sender/style/index.d.ts +0 -10
- package/dist/sender/style/index.js +0 -123
- package/dist/stream/index.en-US.md.bk +0 -50
- package/dist/stream/index.zh-CN.md.bk +0 -51
- package/dist/theme/components.d.ts +0 -10
- package/dist/theme/cssinjs-utils.d.ts +0 -14
- package/dist/theme/genStyleUtils.d.ts +0 -28
- package/dist/theme/useToken.d.ts +0 -18
- package/dist/theme/useToken.js +0 -110
- package/dist/voice-chat/Recorder/index.d.ts +0 -26
- package/dist/voice-chat/VoiceChatProvider/context.d.ts +0 -22
- package/dist/voice-chat/VoiceChatProvider/context.js +0 -3
- package/dist/voice-chat/VoiceChatProvider/hooks/useChatState.d.ts +0 -1
- package/dist/voice-chat/VoiceChatProvider/hooks/useChatState.js +0 -5
- package/dist/voice-chat/VoiceChatProvider/hooks/useMessages.d.ts +0 -8
- package/dist/voice-chat/VoiceChatProvider/hooks/useMessages.js +0 -31
- package/dist/voice-chat/VoiceChatProvider/hooks/useRecorder.d.ts +0 -5
- package/dist/voice-chat/VoiceChatProvider/hooks/useRecorder.js +0 -48
- package/dist/voice-chat/VoiceChatProvider/hooks/useVoiceChat.d.ts +0 -4
- package/dist/voice-chat/VoiceChatProvider/hooks/useVoiceChat.js +0 -10
- package/dist/voice-chat/VoiceChatProvider/index.d.ts +0 -9
- package/dist/voice-chat/VoiceChatProvider/index.js +0 -55
- package/dist/voice-chat/VoiceChatService/index.d.ts +0 -34
- package/dist/voice-chat/index.d.ts +0 -2
- package/dist/voice-chat/index.js +0 -2
- package/dist/voice-chat/types/index.d.ts +0 -12
- package/dist/voice-chat/types/index.js +0 -4
- package/dist/welcome/icon.d.ts +0 -2
- package/dist/welcome/icon.js +0 -38
- package/dist/welcome/index.d.ts +0 -9
- package/dist/welcome/index.js +0 -57
- /package/{dist/_util/type.js → lib/AGUI/components/chat/props.js} +0 -0
- /package/{dist/bubble/interface.js → lib/AGUI/context/index.js} +0 -0
- /package/{dist/bubble/hooks/useDisplayData.d.ts → lib/AGUI/styles.css} +0 -0
- /package/{dist/bubble/hooks/useDisplayData.js → lib/AGUI/types/css.d.ts} +0 -0
- /package/{dist/bubble/hooks/useListData.d.ts → lib/AGUI/types/css.js} +0 -0
- /package/{dist/chat-anywhere/hooks/types.js → lib/AGUI/types/index.js} +0 -0
- /package/{dist/conversations/interface.js → lib/AGUI/types/suggestions.js} +0 -0
- /package/{dist/accordion → lib/Accordion}/index.js +0 -0
- /package/{dist/attachments → lib/Attachments}/context.js +0 -0
- /package/{dist/attachments → lib/Attachments}/util.d.ts +0 -0
- /package/{dist/attachments → lib/Attachments}/util.js +0 -0
- /package/{dist/bubble/hooks/useListData.js → lib/Bubble/hooks/useDisplayData.d.ts} +0 -0
- /package/{dist/default-cards/DeepThink/index.less → lib/Bubble/hooks/useDisplayData.js} +0 -0
- /package/{dist/bubble → lib/Bubble}/index.d.ts +0 -0
- /package/{dist/bubble → lib/Bubble}/index.js +0 -0
- /package/{dist/markdown/type.js → lib/Bubble/interface.js} +0 -0
- /package/{dist/bubble → lib/Bubble}/loading.d.ts +0 -0
- /package/{dist/chat-anywhere → lib/ChatAnywhere}/Chat/Ref.d.ts +0 -0
- /package/{dist/chat-anywhere → lib/ChatAnywhere}/Chat/Ref.js +0 -0
- /package/{dist/provider → lib/ChatAnywhere/hooks}/types.js +0 -0
- /package/{dist/chat-anywhere → lib/ChatAnywhere}/hooks/useInput.d.ts +0 -0
- /package/{dist/chat-anywhere → lib/ChatAnywhere}/hooks/useInput.js +0 -0
- /package/{dist/chat-anywhere → lib/ChatAnywhere}/hooks/useSessionList.d.ts +0 -0
- /package/{dist/chat-anywhere → lib/ChatAnywhere}/hooks/useSessionList.js +0 -0
- /package/{dist/conversations → lib/Conversations}/hooks/useGroupable.js +0 -0
- /package/{dist/theme/components.js → lib/Conversations/interface.js} +0 -0
- /package/{dist/markdown → lib/Markdown}/Citation.d.ts +0 -0
- /package/{dist/markdown → lib/Markdown}/Link.d.ts +0 -0
- /package/{dist/markdown → lib/Markdown}/Markdown.d.ts +0 -0
- /package/{dist/markdown → lib/Markdown}/hooks/useTypedEffect.d.ts +0 -0
- /package/{dist/markdown → lib/Markdown}/plugins/footnote.d.ts +0 -0
- /package/{dist/markdown → lib/Markdown}/plugins/footnote.js +0 -0
- /package/{dist/markdown → lib/Markdown}/plugins/katexDir.d.ts +0 -0
- /package/{dist/markdown → lib/Markdown}/plugins/katexDir.js +0 -0
- /package/{dist/markdown → lib/Markdown}/rehype/fadeIn.d.ts +0 -0
- /package/{dist/markdown → lib/Markdown}/rehype/fadeIn.js +0 -0
- /package/{dist/theme/cssinjs-utils.js → lib/Markdown/type.js} +0 -0
- /package/{dist/markdown → lib/Markdown}/utils.d.ts +0 -0
- /package/{dist/sender → lib/Sender}/components/ClearButton.d.ts +0 -0
- /package/{dist/sender → lib/Sender}/components/LoadingButton.d.ts +0 -0
- /package/{dist/sender → lib/Sender}/components/SendButton.d.ts +0 -0
- /package/{dist/sender → lib/Sender}/components/SpeechButton/index.d.ts +0 -0
- /package/{dist/sender → lib/Sender}/useSpeech.d.ts +0 -0
- /package/{dist/sender → lib/Sender}/useSpeech.js +0 -0
- /package/{dist/_util → lib/Util}/hooks/use-proxy-imperative-handle.d.ts +0 -0
- /package/{dist/_util → lib/Util}/hooks/use-proxy-imperative-handle.js +0 -0
- /package/{dist/_util → lib/Util}/type.d.ts +0 -0
- /package/{dist/_util → lib/Util}/warning.js +0 -0
- /package/{dist/version → lib/Version}/index.d.ts +0 -0
- /package/{dist/version → lib/Version}/index.js +0 -0
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
7
|
+
import { useEffect, useRef } from "react";
|
|
8
|
+
import { ResultMessage, TextMessage, Role } from "@copilotkit/runtime-client-gql";
|
|
9
|
+
import { Bubble } from "../../..";
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
export var Messages = function Messages(_ref) {
|
|
12
|
+
var messages = _ref.messages,
|
|
13
|
+
inProgress = _ref.inProgress,
|
|
14
|
+
children = _ref.children,
|
|
15
|
+
RenderTextMessage = _ref.RenderTextMessage,
|
|
16
|
+
RenderActionExecutionMessage = _ref.RenderActionExecutionMessage,
|
|
17
|
+
RenderAgentStateMessage = _ref.RenderAgentStateMessage,
|
|
18
|
+
RenderResultMessage = _ref.RenderResultMessage,
|
|
19
|
+
RenderImageMessage = _ref.RenderImageMessage,
|
|
20
|
+
AssistantMessage = _ref.AssistantMessage,
|
|
21
|
+
UserMessage = _ref.UserMessage,
|
|
22
|
+
onRegenerate = _ref.onRegenerate,
|
|
23
|
+
onCopy = _ref.onCopy,
|
|
24
|
+
onThumbsUp = _ref.onThumbsUp,
|
|
25
|
+
onThumbsDown = _ref.onThumbsDown,
|
|
26
|
+
markdownTagRenderers = _ref.markdownTagRenderers;
|
|
27
|
+
var actionResults = {};
|
|
28
|
+
var _loop = function _loop() {
|
|
29
|
+
if (messages[i].isActionExecutionMessage()) {
|
|
30
|
+
var id = messages[i].id;
|
|
31
|
+
var resultMessage = messages.find(function (message) {
|
|
32
|
+
return message.isResultMessage() && message.actionExecutionId === id;
|
|
33
|
+
});
|
|
34
|
+
if (resultMessage) {
|
|
35
|
+
actionResults[id] = ResultMessage.decodeResult(resultMessage.result || "");
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
for (var i = 0; i < messages.length; i++) {
|
|
40
|
+
_loop();
|
|
41
|
+
}
|
|
42
|
+
return /*#__PURE__*/_jsx(Bubble.List, {
|
|
43
|
+
style: {
|
|
44
|
+
height: 0,
|
|
45
|
+
flex: 1
|
|
46
|
+
},
|
|
47
|
+
children: messages.map(function (message, index) {
|
|
48
|
+
var isCurrentMessage = index === messages.length - 1;
|
|
49
|
+
if (message.isTextMessage()) {
|
|
50
|
+
return /*#__PURE__*/_jsx(RenderTextMessage, {
|
|
51
|
+
message: message,
|
|
52
|
+
inProgress: inProgress,
|
|
53
|
+
index: index,
|
|
54
|
+
isCurrentMessage: isCurrentMessage,
|
|
55
|
+
AssistantMessage: AssistantMessage,
|
|
56
|
+
UserMessage: UserMessage,
|
|
57
|
+
onRegenerate: onRegenerate,
|
|
58
|
+
onCopy: onCopy,
|
|
59
|
+
onThumbsUp: onThumbsUp,
|
|
60
|
+
onThumbsDown: onThumbsDown,
|
|
61
|
+
markdownTagRenderers: markdownTagRenderers
|
|
62
|
+
}, message.id);
|
|
63
|
+
} else if (message.isActionExecutionMessage()) {
|
|
64
|
+
return /*#__PURE__*/_jsx(RenderActionExecutionMessage, {
|
|
65
|
+
message: message,
|
|
66
|
+
inProgress: inProgress,
|
|
67
|
+
index: index,
|
|
68
|
+
isCurrentMessage: isCurrentMessage,
|
|
69
|
+
actionResult: actionResults[message.id],
|
|
70
|
+
AssistantMessage: AssistantMessage,
|
|
71
|
+
UserMessage: UserMessage
|
|
72
|
+
}, index);
|
|
73
|
+
}
|
|
74
|
+
return null;
|
|
75
|
+
})
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// return (
|
|
79
|
+
// <div className="copilotKitMessages" ref={messagesContainerRef}>
|
|
80
|
+
// <div className="copilotKitMessagesContainer">
|
|
81
|
+
// {messages.map((message, index) => {
|
|
82
|
+
// const isCurrentMessage = index === messages.length - 1;
|
|
83
|
+
|
|
84
|
+
// if (message.isTextMessage()) {
|
|
85
|
+
// return (
|
|
86
|
+
// <RenderTextMessage
|
|
87
|
+
// key={index}
|
|
88
|
+
// message={message}
|
|
89
|
+
// inProgress={inProgress}
|
|
90
|
+
// index={index}
|
|
91
|
+
// isCurrentMessage={isCurrentMessage}
|
|
92
|
+
// AssistantMessage={AssistantMessage}
|
|
93
|
+
// UserMessage={UserMessage}
|
|
94
|
+
// onRegenerate={onRegenerate}
|
|
95
|
+
// onCopy={onCopy}
|
|
96
|
+
// onThumbsUp={onThumbsUp}
|
|
97
|
+
// onThumbsDown={onThumbsDown}
|
|
98
|
+
// markdownTagRenderers={markdownTagRenderers}
|
|
99
|
+
// />
|
|
100
|
+
// );
|
|
101
|
+
// } else if (message.isActionExecutionMessage()) {
|
|
102
|
+
// return (
|
|
103
|
+
// <RenderActionExecutionMessage
|
|
104
|
+
// key={index}
|
|
105
|
+
// message={message}
|
|
106
|
+
// inProgress={inProgress}
|
|
107
|
+
// index={index}
|
|
108
|
+
// isCurrentMessage={isCurrentMessage}
|
|
109
|
+
// actionResult={actionResults[message.id]}
|
|
110
|
+
// AssistantMessage={AssistantMessage}
|
|
111
|
+
// UserMessage={UserMessage}
|
|
112
|
+
// />
|
|
113
|
+
// );
|
|
114
|
+
// } else if (message.isAgentStateMessage()) {
|
|
115
|
+
// return (
|
|
116
|
+
// <RenderAgentStateMessage
|
|
117
|
+
// key={index}
|
|
118
|
+
// message={message}
|
|
119
|
+
// inProgress={inProgress}
|
|
120
|
+
// index={index}
|
|
121
|
+
// isCurrentMessage={isCurrentMessage}
|
|
122
|
+
// AssistantMessage={AssistantMessage}
|
|
123
|
+
// UserMessage={UserMessage}
|
|
124
|
+
// />
|
|
125
|
+
// );
|
|
126
|
+
// } else if (message.isResultMessage()) {
|
|
127
|
+
// return (
|
|
128
|
+
// <RenderResultMessage
|
|
129
|
+
// key={index}
|
|
130
|
+
// message={message}
|
|
131
|
+
// inProgress={inProgress}
|
|
132
|
+
// index={index}
|
|
133
|
+
// isCurrentMessage={isCurrentMessage}
|
|
134
|
+
// AssistantMessage={AssistantMessage}
|
|
135
|
+
// UserMessage={UserMessage}
|
|
136
|
+
// />
|
|
137
|
+
// );
|
|
138
|
+
// } else if (message.isImageMessage && message.isImageMessage()) {
|
|
139
|
+
// return (
|
|
140
|
+
// <RenderImageMessage
|
|
141
|
+
// key={index}
|
|
142
|
+
// message={message}
|
|
143
|
+
// inProgress={inProgress}
|
|
144
|
+
// index={index}
|
|
145
|
+
// isCurrentMessage={isCurrentMessage}
|
|
146
|
+
// AssistantMessage={AssistantMessage}
|
|
147
|
+
// UserMessage={UserMessage}
|
|
148
|
+
// onRegenerate={onRegenerate}
|
|
149
|
+
// onCopy={onCopy}
|
|
150
|
+
// onThumbsUp={onThumbsUp}
|
|
151
|
+
// onThumbsDown={onThumbsDown}
|
|
152
|
+
// />
|
|
153
|
+
// );
|
|
154
|
+
// }
|
|
155
|
+
// })}
|
|
156
|
+
// {interrupt}
|
|
157
|
+
// </div>
|
|
158
|
+
|
|
159
|
+
// </div>
|
|
160
|
+
// );
|
|
161
|
+
};
|
|
162
|
+
function makeInitialMessages(initial) {
|
|
163
|
+
var initialArray = [];
|
|
164
|
+
if (initial) {
|
|
165
|
+
if (Array.isArray(initial)) {
|
|
166
|
+
initialArray.push.apply(initialArray, _toConsumableArray(initial));
|
|
167
|
+
} else {
|
|
168
|
+
initialArray.push(initial);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return initialArray.map(function (message) {
|
|
172
|
+
return new TextMessage({
|
|
173
|
+
role: Role.Assistant,
|
|
174
|
+
content: message
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
export function useScrollToBottom(messages) {
|
|
179
|
+
var messagesEndRef = useRef(null);
|
|
180
|
+
var messagesContainerRef = useRef(null);
|
|
181
|
+
var isProgrammaticScrollRef = useRef(false);
|
|
182
|
+
var isUserScrollUpRef = useRef(false);
|
|
183
|
+
var scrollToBottom = function scrollToBottom() {
|
|
184
|
+
if (messagesContainerRef.current && messagesEndRef.current) {
|
|
185
|
+
isProgrammaticScrollRef.current = true;
|
|
186
|
+
messagesContainerRef.current.scrollTop = messagesContainerRef.current.scrollHeight;
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
var handleScroll = function handleScroll() {
|
|
190
|
+
if (isProgrammaticScrollRef.current) {
|
|
191
|
+
isProgrammaticScrollRef.current = false;
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
if (messagesContainerRef.current) {
|
|
195
|
+
var _messagesContainerRef = messagesContainerRef.current,
|
|
196
|
+
scrollTop = _messagesContainerRef.scrollTop,
|
|
197
|
+
scrollHeight = _messagesContainerRef.scrollHeight,
|
|
198
|
+
clientHeight = _messagesContainerRef.clientHeight;
|
|
199
|
+
isUserScrollUpRef.current = scrollTop + clientHeight < scrollHeight;
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
useEffect(function () {
|
|
203
|
+
var container = messagesContainerRef.current;
|
|
204
|
+
if (container) {
|
|
205
|
+
container.addEventListener("scroll", handleScroll);
|
|
206
|
+
}
|
|
207
|
+
return function () {
|
|
208
|
+
if (container) {
|
|
209
|
+
container.removeEventListener("scroll", handleScroll);
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
}, []);
|
|
213
|
+
useEffect(function () {
|
|
214
|
+
var container = messagesContainerRef.current;
|
|
215
|
+
if (!container) {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
var mutationObserver = new MutationObserver(function () {
|
|
219
|
+
if (!isUserScrollUpRef.current) {
|
|
220
|
+
scrollToBottom();
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
mutationObserver.observe(container, {
|
|
224
|
+
childList: true,
|
|
225
|
+
subtree: true,
|
|
226
|
+
characterData: true
|
|
227
|
+
});
|
|
228
|
+
return function () {
|
|
229
|
+
mutationObserver.disconnect();
|
|
230
|
+
};
|
|
231
|
+
}, []);
|
|
232
|
+
useEffect(function () {
|
|
233
|
+
isUserScrollUpRef.current = false;
|
|
234
|
+
scrollToBottom();
|
|
235
|
+
}, [messages.filter(function (m) {
|
|
236
|
+
return m.isTextMessage() && m.role === Role.User;
|
|
237
|
+
}).length]);
|
|
238
|
+
return {
|
|
239
|
+
messagesEndRef: messagesEndRef,
|
|
240
|
+
messagesContainerRef: messagesContainerRef
|
|
241
|
+
};
|
|
242
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ButtonProps, HeaderProps, WindowProps } from "./props";
|
|
3
|
+
import { CopilotChatProps } from "./Chat";
|
|
4
|
+
export interface CopilotModalProps extends CopilotChatProps {
|
|
5
|
+
/**
|
|
6
|
+
* Whether the chat window should be open by default.
|
|
7
|
+
* @default false
|
|
8
|
+
*/
|
|
9
|
+
defaultOpen?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* If the chat window should close when the user clicks outside of it.
|
|
12
|
+
* @default true
|
|
13
|
+
*/
|
|
14
|
+
clickOutsideToClose?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* If the chat window should close when the user hits the Escape key.
|
|
17
|
+
* @default true
|
|
18
|
+
*/
|
|
19
|
+
hitEscapeToClose?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The shortcut key to open the chat window.
|
|
22
|
+
* Uses Command-[shortcut] on a Mac and Ctrl-[shortcut] on Windows.
|
|
23
|
+
* @default '/'
|
|
24
|
+
*/
|
|
25
|
+
shortcut?: string;
|
|
26
|
+
/**
|
|
27
|
+
* A callback that gets called when the chat window opens or closes.
|
|
28
|
+
*/
|
|
29
|
+
onSetOpen?: (open: boolean) => void;
|
|
30
|
+
/**
|
|
31
|
+
* A custom Window component to use instead of the default.
|
|
32
|
+
*/
|
|
33
|
+
Window?: React.ComponentType<WindowProps>;
|
|
34
|
+
/**
|
|
35
|
+
* A custom Button component to use instead of the default.
|
|
36
|
+
*/
|
|
37
|
+
Button?: React.ComponentType<ButtonProps>;
|
|
38
|
+
/**
|
|
39
|
+
* A custom Header component to use instead of the default.
|
|
40
|
+
*/
|
|
41
|
+
Header?: React.ComponentType<HeaderProps>;
|
|
42
|
+
}
|
|
43
|
+
export declare const CopilotModal: ({ instructions, defaultOpen, clickOutsideToClose, hitEscapeToClose, onSetOpen, onSubmitMessage, onStopGeneration, onReloadMessages, shortcut, icons, labels, makeSystemMessage, onInProgress, Window, Button, Header, Messages, Input, AssistantMessage, UserMessage, onThumbsUp, onThumbsDown, onCopy, onRegenerate, markdownTagRenderers, className, children, ...props }: CopilotModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["instructions", "defaultOpen", "clickOutsideToClose", "hitEscapeToClose", "onSetOpen", "onSubmitMessage", "onStopGeneration", "onReloadMessages", "shortcut", "icons", "labels", "makeSystemMessage", "onInProgress", "Window", "Button", "Header", "Messages", "Input", "AssistantMessage", "UserMessage", "onThumbsUp", "onThumbsDown", "onCopy", "onRegenerate", "markdownTagRenderers", "className", "children"];
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
12
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
15
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
16
|
+
import React, { useMemo } from "react";
|
|
17
|
+
import { ChatContextProvider } from "./ChatContext";
|
|
18
|
+
import { Window as DefaultWindow } from "./Window";
|
|
19
|
+
import { Button as DefaultButton } from "./Button";
|
|
20
|
+
import { Header as DefaultHeader } from "./Header";
|
|
21
|
+
import { Messages as DefaultMessages } from "./Messages";
|
|
22
|
+
import { Input as DefaultInput } from "./Input";
|
|
23
|
+
import { CopilotChat } from "./Chat";
|
|
24
|
+
import { AssistantMessage as DefaultAssistantMessage } from "./messages/AssistantMessage";
|
|
25
|
+
import { UserMessage as DefaultUserMessage } from "./messages/UserMessage";
|
|
26
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
|
+
export var CopilotModal = function CopilotModal(_ref) {
|
|
29
|
+
var instructions = _ref.instructions,
|
|
30
|
+
_ref$defaultOpen = _ref.defaultOpen,
|
|
31
|
+
defaultOpen = _ref$defaultOpen === void 0 ? false : _ref$defaultOpen,
|
|
32
|
+
_ref$clickOutsideToCl = _ref.clickOutsideToClose,
|
|
33
|
+
clickOutsideToClose = _ref$clickOutsideToCl === void 0 ? true : _ref$clickOutsideToCl,
|
|
34
|
+
_ref$hitEscapeToClose = _ref.hitEscapeToClose,
|
|
35
|
+
hitEscapeToClose = _ref$hitEscapeToClose === void 0 ? true : _ref$hitEscapeToClose,
|
|
36
|
+
onSetOpen = _ref.onSetOpen,
|
|
37
|
+
onSubmitMessage = _ref.onSubmitMessage,
|
|
38
|
+
onStopGeneration = _ref.onStopGeneration,
|
|
39
|
+
onReloadMessages = _ref.onReloadMessages,
|
|
40
|
+
_ref$shortcut = _ref.shortcut,
|
|
41
|
+
shortcut = _ref$shortcut === void 0 ? "/" : _ref$shortcut,
|
|
42
|
+
icons = _ref.icons,
|
|
43
|
+
labels = _ref.labels,
|
|
44
|
+
makeSystemMessage = _ref.makeSystemMessage,
|
|
45
|
+
onInProgress = _ref.onInProgress,
|
|
46
|
+
_ref$Window = _ref.Window,
|
|
47
|
+
Window = _ref$Window === void 0 ? DefaultWindow : _ref$Window,
|
|
48
|
+
_ref$Button = _ref.Button,
|
|
49
|
+
Button = _ref$Button === void 0 ? DefaultButton : _ref$Button,
|
|
50
|
+
_ref$Header = _ref.Header,
|
|
51
|
+
Header = _ref$Header === void 0 ? DefaultHeader : _ref$Header,
|
|
52
|
+
_ref$Messages = _ref.Messages,
|
|
53
|
+
Messages = _ref$Messages === void 0 ? DefaultMessages : _ref$Messages,
|
|
54
|
+
_ref$Input = _ref.Input,
|
|
55
|
+
Input = _ref$Input === void 0 ? DefaultInput : _ref$Input,
|
|
56
|
+
_ref$AssistantMessage = _ref.AssistantMessage,
|
|
57
|
+
AssistantMessage = _ref$AssistantMessage === void 0 ? DefaultAssistantMessage : _ref$AssistantMessage,
|
|
58
|
+
_ref$UserMessage = _ref.UserMessage,
|
|
59
|
+
UserMessage = _ref$UserMessage === void 0 ? DefaultUserMessage : _ref$UserMessage,
|
|
60
|
+
onThumbsUp = _ref.onThumbsUp,
|
|
61
|
+
onThumbsDown = _ref.onThumbsDown,
|
|
62
|
+
onCopy = _ref.onCopy,
|
|
63
|
+
onRegenerate = _ref.onRegenerate,
|
|
64
|
+
markdownTagRenderers = _ref.markdownTagRenderers,
|
|
65
|
+
className = _ref.className,
|
|
66
|
+
children = _ref.children,
|
|
67
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
68
|
+
var _React$useState = React.useState(defaultOpen),
|
|
69
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
70
|
+
openState = _React$useState2[0],
|
|
71
|
+
setOpenState = _React$useState2[1];
|
|
72
|
+
var setOpen = function setOpen(open) {
|
|
73
|
+
onSetOpen === null || onSetOpen === void 0 || onSetOpen(open);
|
|
74
|
+
setOpenState(open);
|
|
75
|
+
};
|
|
76
|
+
var memoizedHeader = useMemo(function () {
|
|
77
|
+
return /*#__PURE__*/_jsx(Header, {});
|
|
78
|
+
}, [Header]);
|
|
79
|
+
var memoizedChildren = useMemo(function () {
|
|
80
|
+
return children;
|
|
81
|
+
}, [children]);
|
|
82
|
+
return /*#__PURE__*/_jsxs(ChatContextProvider, {
|
|
83
|
+
icons: icons,
|
|
84
|
+
labels: labels,
|
|
85
|
+
open: openState,
|
|
86
|
+
setOpen: setOpen,
|
|
87
|
+
children: [memoizedChildren, /*#__PURE__*/_jsxs("div", {
|
|
88
|
+
className: className,
|
|
89
|
+
children: [/*#__PURE__*/_jsx(Button, {}), /*#__PURE__*/_jsxs(Window, {
|
|
90
|
+
clickOutsideToClose: clickOutsideToClose,
|
|
91
|
+
shortcut: shortcut,
|
|
92
|
+
hitEscapeToClose: hitEscapeToClose,
|
|
93
|
+
children: [memoizedHeader, /*#__PURE__*/_jsx(CopilotChat, _objectSpread(_objectSpread({}, props), {}, {
|
|
94
|
+
instructions: instructions,
|
|
95
|
+
onSubmitMessage: onSubmitMessage,
|
|
96
|
+
onStopGeneration: onStopGeneration,
|
|
97
|
+
onReloadMessages: onReloadMessages,
|
|
98
|
+
makeSystemMessage: makeSystemMessage,
|
|
99
|
+
onInProgress: onInProgress,
|
|
100
|
+
Messages: Messages,
|
|
101
|
+
Input: Input,
|
|
102
|
+
AssistantMessage: AssistantMessage,
|
|
103
|
+
UserMessage: UserMessage,
|
|
104
|
+
onThumbsUp: onThumbsUp,
|
|
105
|
+
onThumbsDown: onThumbsDown,
|
|
106
|
+
onCopy: onCopy,
|
|
107
|
+
onRegenerate: onRegenerate,
|
|
108
|
+
markdownTagRenderers: markdownTagRenderers
|
|
109
|
+
}))]
|
|
110
|
+
})]
|
|
111
|
+
})]
|
|
112
|
+
});
|
|
113
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <br/>
|
|
3
|
+
* <img src="/images/CopilotPopup.gif" width="500" />
|
|
4
|
+
*
|
|
5
|
+
* A chatbot popup component for the CopilotKit framework. The component allows for a high degree
|
|
6
|
+
* of customization through various props and custom CSS.
|
|
7
|
+
*
|
|
8
|
+
* See [CopilotSidebar](/reference/components/chat/CopilotSidebar) for a sidebar version of this component.
|
|
9
|
+
*
|
|
10
|
+
* ## Install Dependencies
|
|
11
|
+
*
|
|
12
|
+
* This component is part of the [@copilotkit/react-ui](https://npmjs.com/package/@copilotkit/react-ui) package.
|
|
13
|
+
*
|
|
14
|
+
* ```shell npm2yarn \"@copilotkit/react-ui"\
|
|
15
|
+
* npm install @copilotkit/react-core @copilotkit/react-ui
|
|
16
|
+
* ```
|
|
17
|
+
* ## Usage
|
|
18
|
+
*
|
|
19
|
+
* ```tsx
|
|
20
|
+
* import { CopilotPopup } from "@copilotkit/react-ui";
|
|
21
|
+
* import "@copilotkit/react-ui/styles.css";
|
|
22
|
+
*
|
|
23
|
+
* <CopilotPopup
|
|
24
|
+
* labels={{
|
|
25
|
+
* title: "Your Assistant",
|
|
26
|
+
* initial: "Hi! 👋 How can I assist you today?",
|
|
27
|
+
* }}
|
|
28
|
+
* />
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* ### Look & Feel
|
|
32
|
+
*
|
|
33
|
+
* By default, CopilotKit components do not have any styles. You can import CopilotKit's stylesheet at the root of your project:
|
|
34
|
+
* ```tsx title="YourRootComponent.tsx"
|
|
35
|
+
* ...
|
|
36
|
+
* import "@copilotkit/react-ui/styles.css"; // [!code highlight]
|
|
37
|
+
*
|
|
38
|
+
* export function YourRootComponent() {
|
|
39
|
+
* return (
|
|
40
|
+
* <CopilotKit>
|
|
41
|
+
* ...
|
|
42
|
+
* </CopilotKit>
|
|
43
|
+
* );
|
|
44
|
+
* }
|
|
45
|
+
* ```
|
|
46
|
+
* For more information about how to customize the styles, check out the [Customize Look & Feel](/guides/custom-look-and-feel/customize-built-in-ui-components) guide.
|
|
47
|
+
*/
|
|
48
|
+
import { CopilotModalProps } from "./Modal";
|
|
49
|
+
export declare function CopilotPopup(props: CopilotModalProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
/**
|
|
8
|
+
* <br/>
|
|
9
|
+
* <img src="/images/CopilotPopup.gif" width="500" />
|
|
10
|
+
*
|
|
11
|
+
* A chatbot popup component for the CopilotKit framework. The component allows for a high degree
|
|
12
|
+
* of customization through various props and custom CSS.
|
|
13
|
+
*
|
|
14
|
+
* See [CopilotSidebar](/reference/components/chat/CopilotSidebar) for a sidebar version of this component.
|
|
15
|
+
*
|
|
16
|
+
* ## Install Dependencies
|
|
17
|
+
*
|
|
18
|
+
* This component is part of the [@copilotkit/react-ui](https://npmjs.com/package/@copilotkit/react-ui) package.
|
|
19
|
+
*
|
|
20
|
+
* ```shell npm2yarn \"@copilotkit/react-ui"\
|
|
21
|
+
* npm install @copilotkit/react-core @copilotkit/react-ui
|
|
22
|
+
* ```
|
|
23
|
+
* ## Usage
|
|
24
|
+
*
|
|
25
|
+
* ```tsx
|
|
26
|
+
* import { CopilotPopup } from "@copilotkit/react-ui";
|
|
27
|
+
* import "@copilotkit/react-ui/styles.css";
|
|
28
|
+
*
|
|
29
|
+
* <CopilotPopup
|
|
30
|
+
* labels={{
|
|
31
|
+
* title: "Your Assistant",
|
|
32
|
+
* initial: "Hi! 👋 How can I assist you today?",
|
|
33
|
+
* }}
|
|
34
|
+
* />
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* ### Look & Feel
|
|
38
|
+
*
|
|
39
|
+
* By default, CopilotKit components do not have any styles. You can import CopilotKit's stylesheet at the root of your project:
|
|
40
|
+
* ```tsx title="YourRootComponent.tsx"
|
|
41
|
+
* ...
|
|
42
|
+
* import "@copilotkit/react-ui/styles.css"; // [!code highlight]
|
|
43
|
+
*
|
|
44
|
+
* export function YourRootComponent() {
|
|
45
|
+
* return (
|
|
46
|
+
* <CopilotKit>
|
|
47
|
+
* ...
|
|
48
|
+
* </CopilotKit>
|
|
49
|
+
* );
|
|
50
|
+
* }
|
|
51
|
+
* ```
|
|
52
|
+
* For more information about how to customize the styles, check out the [Customize Look & Feel](/guides/custom-look-and-feel/customize-built-in-ui-components) guide.
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
import { CopilotModal } from "./Modal";
|
|
56
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
57
|
+
export function CopilotPopup(props) {
|
|
58
|
+
props = _objectSpread(_objectSpread({}, props), {}, {
|
|
59
|
+
className: props.className ? props.className + " copilotKitPopup" : "copilotKitPopup"
|
|
60
|
+
});
|
|
61
|
+
return /*#__PURE__*/_jsx(CopilotModal, _objectSpread(_objectSpread({}, props), {}, {
|
|
62
|
+
children: props.children
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { useDarkMode } from "../../hooks/use-dark-mode";
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
export function PoweredByTag(_ref) {
|
|
5
|
+
var _ref$showPoweredBy = _ref.showPoweredBy,
|
|
6
|
+
showPoweredBy = _ref$showPoweredBy === void 0 ? true : _ref$showPoweredBy;
|
|
7
|
+
var isDark = useDarkMode();
|
|
8
|
+
if (!showPoweredBy) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
var poweredByStyle = {
|
|
12
|
+
visibility: "visible",
|
|
13
|
+
display: "block",
|
|
14
|
+
position: "static",
|
|
15
|
+
textAlign: "center",
|
|
16
|
+
fontSize: "12px",
|
|
17
|
+
padding: "3px 0",
|
|
18
|
+
color: isDark ? "rgb(69, 69, 69)" : "rgb(214, 214, 214)"
|
|
19
|
+
};
|
|
20
|
+
return /*#__PURE__*/_jsx("div", {
|
|
21
|
+
children: /*#__PURE__*/_jsx("p", {
|
|
22
|
+
className: "poweredBy",
|
|
23
|
+
style: poweredByStyle,
|
|
24
|
+
children: "Powered by CopilotKit"
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
6
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
7
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
12
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
13
|
+
/**
|
|
14
|
+
* <br/>
|
|
15
|
+
* <img src="/images/CopilotSidebar.gif" width="500" />
|
|
16
|
+
*
|
|
17
|
+
* A chatbot sidebar component for the CopilotKit framework. Highly customizable through various props and custom CSS.
|
|
18
|
+
*
|
|
19
|
+
* See [CopilotPopup](/reference/components/chat/CopilotPopup) for a popup version of this component.
|
|
20
|
+
*
|
|
21
|
+
* ## Install Dependencies
|
|
22
|
+
*
|
|
23
|
+
* This component is part of the [@copilotkit/react-ui](https://npmjs.com/package/@copilotkit/react-ui) package.
|
|
24
|
+
*
|
|
25
|
+
* ```shell npm2yarn \"@copilotkit/react-ui"\
|
|
26
|
+
* npm install @copilotkit/react-core @copilotkit/react-ui
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* ## Usage
|
|
30
|
+
*
|
|
31
|
+
* ```tsx
|
|
32
|
+
* import { CopilotSidebar } from "@copilotkit/react-ui";
|
|
33
|
+
* import "@copilotkit/react-ui/styles.css";
|
|
34
|
+
*
|
|
35
|
+
* <CopilotSidebar
|
|
36
|
+
* labels={{
|
|
37
|
+
* title: "Your Assistant",
|
|
38
|
+
* initial: "Hi! 👋 How can I assist you today?",
|
|
39
|
+
* }}
|
|
40
|
+
* >
|
|
41
|
+
* <YourApp/>
|
|
42
|
+
* </CopilotSidebar>
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* ### Look & Feel
|
|
46
|
+
*
|
|
47
|
+
* By default, CopilotKit components do not have any styles. You can import CopilotKit's stylesheet at the root of your project:
|
|
48
|
+
* ```tsx title="YourRootComponent.tsx"
|
|
49
|
+
* ...
|
|
50
|
+
* import "@copilotkit/react-ui/styles.css"; // [!code highlight]
|
|
51
|
+
*
|
|
52
|
+
* export function YourRootComponent() {
|
|
53
|
+
* return (
|
|
54
|
+
* <CopilotKit>
|
|
55
|
+
* ...
|
|
56
|
+
* </CopilotKit>
|
|
57
|
+
* );
|
|
58
|
+
* }
|
|
59
|
+
* ```
|
|
60
|
+
* For more information about how to customize the styles, check out the [Customize Look & Feel](/guides/custom-look-and-feel/customize-built-in-ui-components) guide.
|
|
61
|
+
*/
|
|
62
|
+
import React, { useState } from "react";
|
|
63
|
+
import { CopilotModal } from "./Modal";
|
|
64
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
65
|
+
export function CopilotSidebar(props) {
|
|
66
|
+
props = _objectSpread(_objectSpread({}, props), {}, {
|
|
67
|
+
className: props.className ? props.className + " copilotKitSidebar" : "copilotKitSidebar"
|
|
68
|
+
});
|
|
69
|
+
var _useState = useState(props.defaultOpen ? "sidebarExpanded" : ""),
|
|
70
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
71
|
+
expandedClassName = _useState2[0],
|
|
72
|
+
setExpandedClassName = _useState2[1];
|
|
73
|
+
var onSetOpen = function onSetOpen(open) {
|
|
74
|
+
var _props$onSetOpen, _props;
|
|
75
|
+
(_props$onSetOpen = (_props = props).onSetOpen) === null || _props$onSetOpen === void 0 || _props$onSetOpen.call(_props, open);
|
|
76
|
+
setExpandedClassName(open ? "sidebarExpanded" : "");
|
|
77
|
+
};
|
|
78
|
+
return /*#__PURE__*/_jsx("div", {
|
|
79
|
+
className: "copilotKitSidebarContentWrapper ".concat(expandedClassName),
|
|
80
|
+
children: /*#__PURE__*/_jsx(CopilotModal, _objectSpread(_objectSpread({}, props), {}, {
|
|
81
|
+
onSetOpen: onSetOpen,
|
|
82
|
+
children: props.children
|
|
83
|
+
}))
|
|
84
|
+
});
|
|
85
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CopilotContextParams, CopilotChatSuggestionConfiguration, CopilotMessagesContextParams } from "@copilotkit/react-core";
|
|
2
|
+
interface SuggestionsProps {
|
|
3
|
+
title: string;
|
|
4
|
+
message: string;
|
|
5
|
+
partial?: boolean;
|
|
6
|
+
className?: string;
|
|
7
|
+
onClick: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function Suggestion({ title, onClick, partial, className }: SuggestionsProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const reloadSuggestions: (context: CopilotContextParams & CopilotMessagesContextParams, chatSuggestionConfiguration: {
|
|
11
|
+
[key: string]: CopilotChatSuggestionConfiguration;
|
|
12
|
+
}, setCurrentSuggestions: (suggestions: {
|
|
13
|
+
title: string;
|
|
14
|
+
message: string;
|
|
15
|
+
}[]) => void, abortControllerRef: React.MutableRefObject<AbortController | null>) => Promise<void>;
|
|
16
|
+
export {};
|