@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
package/LICENSE
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
|
10
|
+
|
|
11
|
+
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
|
12
|
+
|
|
13
|
+
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
|
14
|
+
|
|
15
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
|
16
|
+
|
|
17
|
+
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
|
18
|
+
|
|
19
|
+
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
|
20
|
+
|
|
21
|
+
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
|
22
|
+
|
|
23
|
+
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
|
24
|
+
|
|
25
|
+
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
|
26
|
+
|
|
27
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
|
28
|
+
|
|
29
|
+
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
|
30
|
+
|
|
31
|
+
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
|
32
|
+
|
|
33
|
+
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
|
34
|
+
|
|
35
|
+
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
|
36
|
+
|
|
37
|
+
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
|
|
38
|
+
|
|
39
|
+
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
|
40
|
+
|
|
41
|
+
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
|
42
|
+
|
|
43
|
+
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
|
44
|
+
|
|
45
|
+
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
|
46
|
+
|
|
47
|
+
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
|
48
|
+
|
|
49
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
|
50
|
+
|
|
51
|
+
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
|
52
|
+
|
|
53
|
+
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
|
54
|
+
|
|
55
|
+
END OF TERMS AND CONDITIONS
|
|
56
|
+
|
|
57
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
58
|
+
|
|
59
|
+
To apply the Apache License to your work, attach the following
|
|
60
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
61
|
+
replaced with your own identifying information. (Don't include
|
|
62
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
63
|
+
comment syntax for the file format. We also recommend that a
|
|
64
|
+
file or class name and description of purpose be included on the
|
|
65
|
+
same "printed page" as the copyright notice for easier
|
|
66
|
+
identification within third-party archives.
|
|
67
|
+
|
|
68
|
+
Copyright 2025 agentscope-ai
|
|
69
|
+
|
|
70
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
|
|
71
|
+
|
|
72
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
73
|
+
|
|
74
|
+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,88 +1,188 @@
|
|
|
1
|
+
# Alibaba Cloud Spark Chat
|
|
1
2
|
|
|
2
|
-
|
|
3
|
+
**Note**: `@agentscope-ai/design` and `@agentscope-ai/chat` are actively progressing towards open source, with completion expected by the end of 2025. Currently, you can access our projects through npm.
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/@ali/agentscope-ai-chat)
|
|
6
|
+
[](https://github.com/your-repo/spark-chat/blob/main/LICENSE)
|
|
5
7
|
|
|
6
|
-
|
|
8
|
+
A free, open-source React chat framework based on **Alibaba Cloud Spark Design**, designed for building excellent LLM conversation experiences.
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
## ✨ Features
|
|
9
11
|
|
|
12
|
+
- 🏆 Built on Alibaba Cloud Bailian best practices: Incorporates our team's extensive experience and real-world business solutions, enabling rapid development of excellent LLM conversation experiences.
|
|
13
|
+
- 🤖 Out-of-the-box model integration capabilities: Easily integrate with model inference services that comply with OpenAI standards.
|
|
14
|
+
- 🧩 Ultimate extensibility: Present model outputs through customizable card components, supporting diverse output display formats.
|
|
15
|
+
- 📝 Full TypeScript coverage: Developed with TypeScript, providing complete type support to enhance development experience and reliability.
|
|
16
|
+
- 🎨 Use Modern CSS-in-JS: Implements a contemporary CSS-in-JS styling solution with automatic on-demand loading, minimizing dependencies on developer's build configuration.
|
|
10
17
|
|
|
11
|
-
|
|
18
|
+
## 🚀 Quick Start
|
|
12
19
|
|
|
20
|
+
### Installation
|
|
13
21
|
|
|
14
|
-
|
|
22
|
+
```bash
|
|
23
|
+
# Install dependencies
|
|
24
|
+
npm install antd --save
|
|
25
|
+
npm install @agentscope-ai/design --save
|
|
26
|
+
npm install @agentscope-ai/chat --save
|
|
27
|
+
```
|
|
15
28
|
|
|
29
|
+
> **Note**: If you are an Alibaba internal developer, please use:
|
|
30
|
+
>
|
|
31
|
+
> ```bash
|
|
32
|
+
> tnpm install @ali/agentscope-ai-chat @ali/agentscope-ai-design --save
|
|
33
|
+
> ```
|
|
34
|
+
|
|
35
|
+
### Basic Usage
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import { ConfigProvider, carbonTheme } from '@agentscope-ai/design';
|
|
39
|
+
import { ChatAnywhere, ChatAnywhereRef, uuid } from '@agentscope-ai/chat';
|
|
40
|
+
import { useRef, useCallback } from 'react';
|
|
41
|
+
|
|
42
|
+
export default function App() {
|
|
43
|
+
const ref = useRef<ChatAnywhereRef>();
|
|
44
|
+
|
|
45
|
+
const onSubmit = useCallback(async (data) => {
|
|
46
|
+
// Add user message
|
|
47
|
+
ref.current.updateMessage({
|
|
48
|
+
id: uuid(),
|
|
49
|
+
role: 'user',
|
|
50
|
+
content: data.query,
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// Add assistant reply
|
|
54
|
+
ref.current.updateMessage({
|
|
55
|
+
id: uuid(),
|
|
56
|
+
role: 'assistant',
|
|
57
|
+
content: 'This is the assistant reply content',
|
|
58
|
+
});
|
|
59
|
+
}, []);
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<ConfigProvider {...carbonTheme}>
|
|
63
|
+
<ChatAnywhere ref={ref} onInput={{ onSubmit }} onStop={() => {}} />
|
|
64
|
+
</ConfigProvider>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
```
|
|
16
68
|
|
|
17
|
-
|
|
69
|
+
## 📦 Core Components
|
|
18
70
|
|
|
19
|
-
|
|
20
|
-
- 每个 `Bubble` 包含多个 `cards [ ]`
|
|
21
|
-
- 每张卡片由 `{ code, data }` 构成
|
|
71
|
+
### ChatAnywhere
|
|
22
72
|
|
|
23
|
-
|
|
73
|
+
An out-of-the-box chat container that eliminates the need to manage message state, enabling rapid development of LLM conversation experiences.
|
|
24
74
|
|
|
25
|
-
|
|
26
|
-
-
|
|
75
|
+
```tsx
|
|
76
|
+
import { ChatAnywhere, ChatAnywhereRef } from '@agentscope-ai/chat';
|
|
27
77
|
|
|
28
|
-
|
|
78
|
+
// Use ref to control message updates
|
|
79
|
+
const ref = useRef<ChatAnywhereRef>();
|
|
80
|
+
ref.current.updateMessage(message);
|
|
81
|
+
```
|
|
29
82
|
|
|
83
|
+
### Bubble
|
|
30
84
|
|
|
31
|
-
|
|
85
|
+
Message bubble component supporting various message type displays.
|
|
32
86
|
|
|
87
|
+
```tsx
|
|
88
|
+
import { Bubble, DefaultCards } from '@agentscope-ai/chat';
|
|
33
89
|
|
|
34
|
-
|
|
35
|
-
<Bubble
|
|
36
|
-
cards={[
|
|
37
|
-
{
|
|
38
|
-
code: 'Text',
|
|
39
|
-
data: {
|
|
40
|
-
content: 'Hello World',
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
]}
|
|
44
|
-
/>
|
|
90
|
+
<Bubble message={message} customCards={DefaultCards} />;
|
|
45
91
|
```
|
|
46
92
|
|
|
93
|
+
### Sender
|
|
47
94
|
|
|
48
|
-
|
|
95
|
+
Message sending component supporting multiple input modes.
|
|
49
96
|
|
|
97
|
+
```tsx
|
|
98
|
+
import { Sender } from '@agentscope-ai/chat';
|
|
50
99
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
100
|
+
<Sender onSubmit={handleSubmit} loading={loading} />;
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Markdown
|
|
104
|
+
|
|
105
|
+
Markdown rendering component supporting mathematical formulas, code highlighting, and more.
|
|
106
|
+
|
|
107
|
+
```tsx
|
|
108
|
+
import { Markdown } from '@agentscope-ai/chat';
|
|
109
|
+
|
|
110
|
+
<Markdown content={markdownContent} />;
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Mermaid
|
|
114
|
+
|
|
115
|
+
Flowchart rendering component.
|
|
116
|
+
|
|
117
|
+
```tsx
|
|
118
|
+
import { Mermaid } from '@agentscope-ai/chat';
|
|
119
|
+
|
|
120
|
+
<Mermaid code={mermaidCode} />;
|
|
55
121
|
```
|
|
56
122
|
|
|
123
|
+
## 🔧 Advanced Features
|
|
124
|
+
|
|
125
|
+
### Custom Cards
|
|
57
126
|
|
|
58
|
-
|
|
59
|
-
|
|
127
|
+
Display special content through custom card components:
|
|
128
|
+
|
|
129
|
+
```tsx
|
|
130
|
+
import { CustomCardsProvider } from '@agentscope-ai/chat';
|
|
131
|
+
|
|
132
|
+
const CustomCard = function(props: { data }) {
|
|
133
|
+
return <div>Custom Card</div>;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
<CustomCardsProvider cards={{ CustomCard }}>
|
|
137
|
+
<ChatAnywhere />
|
|
138
|
+
</CustomCardsProvider>;
|
|
60
139
|
```
|
|
61
140
|
|
|
141
|
+
### Streaming Response
|
|
62
142
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
code: 'MyCard',
|
|
77
|
-
data: [
|
|
78
|
-
['Active Users', 112893],
|
|
79
|
-
['Account Balance (CNY)', 112893],
|
|
80
|
-
],
|
|
81
|
-
},
|
|
82
|
-
]}
|
|
83
|
-
/>
|
|
143
|
+
Support streaming data updates:
|
|
144
|
+
|
|
145
|
+
```tsx
|
|
146
|
+
import { Stream } from '@agentscope-ai/chat';
|
|
147
|
+
|
|
148
|
+
const response = await fetch('/api/chat');
|
|
149
|
+
for await (const chunk of Stream({ readableStream: response.body })) {
|
|
150
|
+
// ...
|
|
151
|
+
// const answer = {...}
|
|
152
|
+
// ref.current.updateMessage(answer);
|
|
153
|
+
}
|
|
84
154
|
```
|
|
85
155
|
|
|
156
|
+
## 🌐 Compatible Environments
|
|
157
|
+
|
|
158
|
+
- Modern browsers
|
|
159
|
+
- Electron
|
|
160
|
+
- Tauri
|
|
161
|
+
|
|
162
|
+
| Edge | Firefox | Chrome | Safari | Opera | Electron |
|
|
163
|
+
| --------------- | --------------- | --------------- | --------------- | --------------- | --------------- |
|
|
164
|
+
| last 2 versions | last 2 versions | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
|
|
165
|
+
|
|
166
|
+
## 📚 Documentation
|
|
167
|
+
|
|
168
|
+
- [Overview](./docs/documents/overview.en-US.md)
|
|
169
|
+
- [ChatAnywhere Usage Guide](./docs/documents/chatanywhere.en-US.md)
|
|
170
|
+
- [Bailian Agent Integration](./docs/documents/bailian.en-US.md)
|
|
171
|
+
- [Custom Cards](./docs/documents/customCard.en-US.md)
|
|
172
|
+
- [Vite Integration](./docs/documents/vite.en-US.md)
|
|
173
|
+
- [Umi Integration](./docs/documents/umi.en-US.md)
|
|
174
|
+
|
|
175
|
+
## 🔗 Related Links
|
|
176
|
+
|
|
177
|
+
- [Alibaba Cloud Spark Design](https://design.aliyun.com/)
|
|
178
|
+
- [Alibaba Cloud Bailian](https://bailian.console.aliyun.com/)
|
|
179
|
+
- [React](https://react.dev/)
|
|
180
|
+
- [Ant Design](https://ant.design/)
|
|
181
|
+
|
|
182
|
+
## 🤝 Contributing
|
|
183
|
+
|
|
184
|
+
We welcome Issue submissions and Pull Requests!
|
|
185
|
+
|
|
186
|
+
## 📄 License
|
|
86
187
|
|
|
87
|
-
|
|
88
|
-
- https://bailian.agentscope.io/chat#/docs/development/overview-cn
|
|
188
|
+
This project is licensed under the Apache-2.0 License - see the [LICENSE](LICENSE) file for details.
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# Alibaba Cloud Spark Chat
|
|
2
|
+
|
|
3
|
+
**注意**:`@agentscope-ai/design` 和 `@agentscope-ai/chat` 仍在加速推进开源中,我们预计在 2025 年年底完成开源。目前可以通过 npm 使用我们的项目。
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@ali/agentscope-ai-chat)
|
|
6
|
+
[](https://github.com/your-repo/spark-chat/blob/main/LICENSE)
|
|
7
|
+
|
|
8
|
+
基于 **Alibaba Cloud Spark Design** 的免费、开源的 React 对话框架,用于构建优秀的 LLM 对话体验。
|
|
9
|
+
|
|
10
|
+
## ✨ 特性
|
|
11
|
+
|
|
12
|
+
- 🏆 **源自阿里云百炼最佳实践**:包含了众多我们的想法与真实业务实践,帮助业务快速构建优秀的 LLM 对话体验
|
|
13
|
+
- 🤖 **开箱即用的模型对接能力**:轻松对接符合 OpenAI 标准的模型推理服务
|
|
14
|
+
- 🧩 **极致的拓展能力**:通过卡片形式(自定义组件)展示模型输出,支持多种格式的输出展示
|
|
15
|
+
- 📝 **TypeScript 全覆盖**:采用 TypeScript 开发,提供完整类型支持,提升开发体验与可靠性
|
|
16
|
+
- 🎨 **CSS-in-JS 实践**:采用更现代的 CSS-in-JS 样式方案,样式自动按需加载,不强依赖开发者工程化环境配置
|
|
17
|
+
|
|
18
|
+
## 🚀 快速开始
|
|
19
|
+
|
|
20
|
+
### 安装
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# 安装依赖
|
|
24
|
+
npm install antd --save
|
|
25
|
+
npm install @agentscope-ai/design --save
|
|
26
|
+
npm install @agentscope-ai/chat --save
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
> **注意**:如果你是阿里内网开发者,请使用:
|
|
30
|
+
>
|
|
31
|
+
> ```bash
|
|
32
|
+
> tnpm install @ali/agentscope-ai-chat @ali/agentscope-ai-design --save
|
|
33
|
+
> ```
|
|
34
|
+
|
|
35
|
+
### 基础使用
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import { ConfigProvider, carbonTheme } from '@agentscope-ai/design';
|
|
39
|
+
import { ChatAnywhere, ChatAnywhereRef, uuid } from '@agentscope-ai/chat';
|
|
40
|
+
import { useRef, useCallback } from 'react';
|
|
41
|
+
|
|
42
|
+
export default function App() {
|
|
43
|
+
const ref = useRef<ChatAnywhereRef>();
|
|
44
|
+
|
|
45
|
+
const onSubmit = useCallback(async (data) => {
|
|
46
|
+
// 添加用户消息
|
|
47
|
+
ref.current.updateMessage({
|
|
48
|
+
id: uuid(),
|
|
49
|
+
role: 'user',
|
|
50
|
+
content: data.query,
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// 添加助手回复
|
|
54
|
+
ref.current.updateMessage({
|
|
55
|
+
id: uuid(),
|
|
56
|
+
role: 'assistant',
|
|
57
|
+
content: '这是助手的回复内容',
|
|
58
|
+
});
|
|
59
|
+
}, []);
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<ConfigProvider {...carbonTheme}>
|
|
63
|
+
<ChatAnywhere ref={ref} onInput={{ onSubmit }} onStop={() => {}} />
|
|
64
|
+
</ConfigProvider>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## 📦 核心组件
|
|
70
|
+
|
|
71
|
+
### ChatAnywhere
|
|
72
|
+
|
|
73
|
+
开箱即用的对话容器,无需关心消息状态管理,快速构建 LLM 对话体验。
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
import { ChatAnywhere, ChatAnywhereRef } from '@agentscope-ai/chat';
|
|
77
|
+
|
|
78
|
+
// 使用 ref 控制消息更新
|
|
79
|
+
const ref = useRef<ChatAnywhereRef>();
|
|
80
|
+
ref.current.updateMessage(message);
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Bubble
|
|
84
|
+
|
|
85
|
+
消息气泡组件,支持多种消息类型展示。
|
|
86
|
+
|
|
87
|
+
```tsx
|
|
88
|
+
import { Bubble, DefaultCards } from '@agentscope-ai/chat';
|
|
89
|
+
|
|
90
|
+
<Bubble message={message} customCards={DefaultCards} />;
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Sender
|
|
94
|
+
|
|
95
|
+
消息发送组件,支持多种输入模式。
|
|
96
|
+
|
|
97
|
+
```tsx
|
|
98
|
+
import { Sender } from '@agentscope-ai/chat';
|
|
99
|
+
|
|
100
|
+
<Sender onSubmit={handleSubmit} loading={loading} />;
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Markdown
|
|
104
|
+
|
|
105
|
+
Markdown 渲染组件,支持数学公式、代码高亮等。
|
|
106
|
+
|
|
107
|
+
```tsx
|
|
108
|
+
import { Markdown } from '@agentscope-ai/chat';
|
|
109
|
+
|
|
110
|
+
<Markdown content={markdownContent} />;
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Mermaid
|
|
114
|
+
|
|
115
|
+
流程图渲染组件。
|
|
116
|
+
|
|
117
|
+
```tsx
|
|
118
|
+
import { Mermaid } from '@agentscope-ai/chat';
|
|
119
|
+
|
|
120
|
+
<Mermaid code={mermaidCode} />;
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## 🔧 高级功能
|
|
124
|
+
|
|
125
|
+
### 自定义卡片
|
|
126
|
+
|
|
127
|
+
通过自定义卡片组件展示特殊内容:
|
|
128
|
+
|
|
129
|
+
```tsx
|
|
130
|
+
import { CustomCardsProvider } from '@agentscope-ai/chat';
|
|
131
|
+
|
|
132
|
+
const CustomCard = function(props: { data }) {
|
|
133
|
+
return <div>自定义卡片</div>;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
<CustomCardsProvider cards={{ CustomCard }}>
|
|
137
|
+
<ChatAnywhere />
|
|
138
|
+
</CustomCardsProvider>;
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### 流式响应
|
|
142
|
+
|
|
143
|
+
支持流式数据更新:
|
|
144
|
+
|
|
145
|
+
```tsx
|
|
146
|
+
import { Stream } from '@agentscope-ai/chat';
|
|
147
|
+
|
|
148
|
+
const response = await fetch('/api/chat');
|
|
149
|
+
for await (const chunk of Stream({ readableStream: response.body })) {
|
|
150
|
+
// ...
|
|
151
|
+
// const answer = {...}
|
|
152
|
+
// ref.current.updateMessage(answer);
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## 🌐 兼容环境
|
|
157
|
+
|
|
158
|
+
- 现代浏览器
|
|
159
|
+
- Electron
|
|
160
|
+
- Tauri
|
|
161
|
+
|
|
162
|
+
| Edge | Firefox | Chrome | Safari | Opera | Electron |
|
|
163
|
+
| --------------- | --------------- | --------------- | --------------- | --------------- | --------------- |
|
|
164
|
+
| last 2 versions | last 2 versions | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
|
|
165
|
+
|
|
166
|
+
## 📚 文档
|
|
167
|
+
|
|
168
|
+
- [概述](./docs/documents/overview.zh-CN.md)
|
|
169
|
+
- [ChatAnywhere 使用指南](./docs/documents/chatanywhere.zh-CN.md)
|
|
170
|
+
- [百炼智能体接入](./docs/documents/bailian.zh-CN.md)
|
|
171
|
+
- [自定义卡片](./docs/documents/customCard.zh-CN.md)
|
|
172
|
+
- [Vite 集成](./docs/documents/vite.zh-CN.md)
|
|
173
|
+
- [Umi 集成](./docs/documents/umi.zh-CN.md)
|
|
174
|
+
|
|
175
|
+
## 🔗 相关链接
|
|
176
|
+
|
|
177
|
+
- [Alibaba Cloud Spark Design](https://design.aliyun.com/)
|
|
178
|
+
- [阿里云百炼](https://bailian.console.aliyun.com/)
|
|
179
|
+
- [React](https://react.dev/)
|
|
180
|
+
- [Ant Design](https://ant.design/)
|
|
181
|
+
|
|
182
|
+
## 🤝 贡献
|
|
183
|
+
|
|
184
|
+
欢迎提交 Issue 和 Pull Request!
|
|
185
|
+
|
|
186
|
+
## 📄 许可证
|
|
187
|
+
|
|
188
|
+
本项目采用 Apache-2.0 许可证 - 查看 [LICENSE](LICENSE) 文件了解详情。
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const LifeBuoyIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const CloseIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const LoadingSpinnerIcon: ({ color }: {
|
|
4
|
+
color?: string;
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
export var LifeBuoyIcon = function LifeBuoyIcon() {
|
|
5
|
+
return /*#__PURE__*/_jsx("svg", {
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
width: "24",
|
|
8
|
+
height: "24",
|
|
9
|
+
viewBox: "0 0 24 24",
|
|
10
|
+
fill: "none",
|
|
11
|
+
stroke: "currentColor",
|
|
12
|
+
strokeWidth: "2",
|
|
13
|
+
strokeLinecap: "round",
|
|
14
|
+
strokeLinejoin: "round",
|
|
15
|
+
className: "icon icon-tabler icons-tabler-outline icon-tabler-lifebuoy",
|
|
16
|
+
children: /*#__PURE__*/_jsxs("g", {
|
|
17
|
+
transform: "translate(0, -1)",
|
|
18
|
+
children: [/*#__PURE__*/_jsx("path", {
|
|
19
|
+
stroke: "none",
|
|
20
|
+
d: "M0 0h24v24H0z",
|
|
21
|
+
fill: "none"
|
|
22
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
23
|
+
d: "M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0"
|
|
24
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
25
|
+
d: "M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"
|
|
26
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
27
|
+
d: "M15 15l3.35 3.35"
|
|
28
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
29
|
+
d: "M9 15l-3.35 3.35"
|
|
30
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
31
|
+
d: "M5.65 5.65l3.35 3.35"
|
|
32
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
33
|
+
d: "M18.35 5.65l-3.35 3.35"
|
|
34
|
+
})]
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
export var CloseIcon = function CloseIcon() {
|
|
39
|
+
return /*#__PURE__*/_jsx("svg", {
|
|
40
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
41
|
+
fill: "none",
|
|
42
|
+
viewBox: "0 0 24 24",
|
|
43
|
+
strokeWidth: "1.5",
|
|
44
|
+
stroke: "currentColor",
|
|
45
|
+
width: "20",
|
|
46
|
+
height: "20",
|
|
47
|
+
children: /*#__PURE__*/_jsx("path", {
|
|
48
|
+
strokeLinecap: "round",
|
|
49
|
+
strokeLinejoin: "round",
|
|
50
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
51
|
+
})
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
export var LoadingSpinnerIcon = function LoadingSpinnerIcon(_ref) {
|
|
55
|
+
var _ref$color = _ref.color,
|
|
56
|
+
color = _ref$color === void 0 ? "rgb(107 114 128)" : _ref$color;
|
|
57
|
+
return /*#__PURE__*/_jsxs("svg", {
|
|
58
|
+
style: {
|
|
59
|
+
animation: "copilotKitSpinAnimation 1s linear infinite",
|
|
60
|
+
color: color
|
|
61
|
+
},
|
|
62
|
+
width: "24",
|
|
63
|
+
height: "24",
|
|
64
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
65
|
+
fill: "none",
|
|
66
|
+
viewBox: "0 0 24 24",
|
|
67
|
+
children: [/*#__PURE__*/_jsx("circle", {
|
|
68
|
+
style: {
|
|
69
|
+
opacity: 0.25
|
|
70
|
+
},
|
|
71
|
+
cx: "12",
|
|
72
|
+
cy: "12",
|
|
73
|
+
r: "10",
|
|
74
|
+
stroke: "currentColor",
|
|
75
|
+
strokeWidth: "4"
|
|
76
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
77
|
+
style: {
|
|
78
|
+
opacity: 0.75
|
|
79
|
+
},
|
|
80
|
+
fill: "currentColor",
|
|
81
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
82
|
+
})]
|
|
83
|
+
});
|
|
84
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CopilotKitHelpModal } from "./modal";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CopilotKitHelpModal } from "./modal";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function CopilotKitHelpModal(): import("react/jsx-runtime").JSX.Element;
|