@agentscope-ai/chat 1.1.4 → 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (686) hide show
  1. package/LICENSE +74 -0
  2. package/README.md +156 -56
  3. package/README.zh-CN.md +188 -0
  4. package/lib/AGUI/components/HelpModal/icons.d.ts +5 -0
  5. package/lib/AGUI/components/HelpModal/icons.js +84 -0
  6. package/lib/AGUI/components/HelpModal/index.d.ts +1 -0
  7. package/lib/AGUI/components/HelpModal/index.js +1 -0
  8. package/lib/AGUI/components/HelpModal/modal.d.ts +1 -0
  9. package/lib/AGUI/components/HelpModal/modal.js +104 -0
  10. package/lib/AGUI/components/chat/Button.d.ts +2 -0
  11. package/lib/AGUI/components/chat/Button.js +27 -0
  12. package/lib/AGUI/components/chat/Chat.d.ts +242 -0
  13. package/lib/AGUI/components/chat/Chat.js +634 -0
  14. package/lib/AGUI/components/chat/ChatContext.d.ts +142 -0
  15. package/lib/AGUI/components/chat/ChatContext.js +75 -0
  16. package/lib/AGUI/components/chat/CodeBlock.d.ts +12 -0
  17. package/lib/AGUI/components/chat/CodeBlock.js +398 -0
  18. package/lib/AGUI/components/chat/Header.d.ts +2 -0
  19. package/lib/AGUI/components/chat/Header.js +28 -0
  20. package/lib/AGUI/components/chat/Icons.d.ts +16 -0
  21. package/lib/AGUI/components/chat/Icons.js +247 -0
  22. package/lib/AGUI/components/chat/ImageUploadQueue.d.ts +11 -0
  23. package/lib/AGUI/components/chat/ImageUploadQueue.js +65 -0
  24. package/lib/AGUI/components/chat/Input.d.ts +2 -0
  25. package/lib/AGUI/components/chat/Input.js +30 -0
  26. package/lib/AGUI/components/chat/Markdown.d.ts +7 -0
  27. package/lib/AGUI/components/chat/Markdown.js +187 -0
  28. package/lib/AGUI/components/chat/Messages.d.ts +7 -0
  29. package/lib/AGUI/components/chat/Messages.js +242 -0
  30. package/lib/AGUI/components/chat/Modal.d.ts +43 -0
  31. package/lib/AGUI/components/chat/Modal.js +113 -0
  32. package/lib/AGUI/components/chat/Popup.d.ts +49 -0
  33. package/lib/AGUI/components/chat/Popup.js +64 -0
  34. package/lib/AGUI/components/chat/PoweredByTag.d.ts +3 -0
  35. package/lib/AGUI/components/chat/PoweredByTag.js +27 -0
  36. package/lib/AGUI/components/chat/Sidebar.d.ts +2 -0
  37. package/lib/AGUI/components/chat/Sidebar.js +85 -0
  38. package/lib/AGUI/components/chat/Suggestion.d.ts +16 -0
  39. package/{dist/voice-chat/VoiceChatService/index.js → lib/AGUI/components/chat/Suggestion.js} +138 -201
  40. package/lib/AGUI/components/chat/Suggestions.d.ts +2 -0
  41. package/lib/AGUI/components/chat/Suggestions.js +21 -0
  42. package/lib/AGUI/components/chat/Textarea.d.ts +11 -0
  43. package/lib/AGUI/components/chat/Textarea.js +60 -0
  44. package/lib/AGUI/components/chat/Window.d.ts +2 -0
  45. package/lib/AGUI/components/chat/Window.js +115 -0
  46. package/lib/AGUI/components/chat/index.d.ts +11 -0
  47. package/lib/AGUI/components/chat/index.js +11 -0
  48. package/lib/AGUI/components/chat/messages/AssistantMessage.d.ts +2 -0
  49. package/lib/AGUI/components/chat/messages/AssistantMessage.js +56 -0
  50. package/lib/AGUI/components/chat/messages/RenderActionExecutionMessage.d.ts +2 -0
  51. package/lib/AGUI/components/chat/messages/RenderActionExecutionMessage.js +114 -0
  52. package/lib/AGUI/components/chat/messages/RenderAgentStateMessage.d.ts +2 -0
  53. package/lib/AGUI/components/chat/messages/RenderAgentStateMessage.js +97 -0
  54. package/lib/AGUI/components/chat/messages/RenderImageMessage.d.ts +2 -0
  55. package/lib/AGUI/components/chat/messages/RenderImageMessage.js +61 -0
  56. package/lib/AGUI/components/chat/messages/RenderResultMessage.d.ts +2 -0
  57. package/lib/AGUI/components/chat/messages/RenderResultMessage.js +27 -0
  58. package/lib/AGUI/components/chat/messages/RenderTextMessage.d.ts +2 -0
  59. package/lib/AGUI/components/chat/messages/RenderTextMessage.js +47 -0
  60. package/lib/AGUI/components/chat/messages/UserMessage.d.ts +2 -0
  61. package/lib/AGUI/components/chat/messages/UserMessage.js +9 -0
  62. package/lib/AGUI/components/chat/props.d.ts +157 -0
  63. package/lib/AGUI/components/index.d.ts +1 -0
  64. package/lib/AGUI/components/index.js +1 -0
  65. package/lib/AGUI/context/index.d.ts +1 -0
  66. package/lib/AGUI/hooks/index.d.ts +1 -0
  67. package/lib/AGUI/hooks/index.js +1 -0
  68. package/lib/AGUI/hooks/use-copilot-chat-suggestions.d.ts +87 -0
  69. package/lib/AGUI/hooks/use-copilot-chat-suggestions.js +95 -0
  70. package/lib/AGUI/hooks/use-copy-to-clipboard.d.ts +7 -0
  71. package/{dist/theme/genStyleUtils.js → lib/AGUI/hooks/use-copy-to-clipboard.js} +27 -42
  72. package/lib/AGUI/hooks/use-dark-mode.d.ts +1 -0
  73. package/lib/AGUI/hooks/use-dark-mode.js +4 -0
  74. package/lib/AGUI/hooks/use-push-to-talk.d.ts +16 -0
  75. package/lib/AGUI/hooks/use-push-to-talk.js +260 -0
  76. package/lib/AGUI/index.d.ts +4 -0
  77. package/lib/AGUI/index.js +4 -0
  78. package/lib/AGUI/lib/utils.d.ts +2 -0
  79. package/lib/AGUI/lib/utils.js +52 -0
  80. package/lib/AGUI/types/index.d.ts +1 -0
  81. package/lib/AGUI/types/suggestions.d.ts +6 -0
  82. package/lib/Accordion/Accordion.d.ts +64 -0
  83. package/{dist/accordion → lib/Accordion}/Accordion.js +101 -40
  84. package/{dist/accordion → lib/Accordion}/BodyContent.d.ts +1 -1
  85. package/lib/Accordion/BodyContent.js +23 -0
  86. package/lib/Accordion/DeepThinking.d.ts +28 -0
  87. package/lib/Accordion/DeepThinking.js +35 -0
  88. package/lib/Accordion/SoftLightTitle.d.ts +3 -0
  89. package/lib/Accordion/SoftLightTitle.js +17 -0
  90. package/lib/Accordion/index.d.ts +2 -0
  91. package/lib/Accordion/style.d.ts +2 -0
  92. package/lib/Accordion/style.js +60 -0
  93. package/lib/Attachments/DropArea.d.ts +24 -0
  94. package/{dist/attachments → lib/Attachments}/DropArea.js +5 -11
  95. package/lib/Attachments/FileList/AudioIcon.d.ts +1 -0
  96. package/lib/Attachments/FileList/AudioIcon.js +24 -0
  97. package/lib/Attachments/FileList/FileListCard.d.ts +36 -0
  98. package/{dist/attachments → lib/Attachments}/FileList/FileListCard.js +109 -83
  99. package/lib/Attachments/FileList/Progress.d.ts +13 -0
  100. package/{dist/attachments → lib/Attachments}/FileList/Progress.js +7 -5
  101. package/lib/Attachments/FileList/VideoIcon.d.ts +1 -0
  102. package/lib/Attachments/FileList/VideoIcon.js +24 -0
  103. package/lib/Attachments/FileList/index.d.ts +56 -0
  104. package/{dist/attachments → lib/Attachments}/FileList/index.js +48 -48
  105. package/lib/Attachments/PlaceholderUploader.d.ts +49 -0
  106. package/{dist/attachments → lib/Attachments}/PlaceholderUploader.js +33 -28
  107. package/lib/Attachments/SilentUploader.d.ts +21 -0
  108. package/lib/Attachments/SilentUploader.js +30 -0
  109. package/lib/Attachments/context.d.ts +9 -0
  110. package/lib/Attachments/index.d.ts +97 -0
  111. package/lib/Attachments/index.en-US.md.bk +10 -0
  112. package/{dist/attachments → lib/Attachments}/index.js +51 -55
  113. package/lib/Attachments/index.zh-CN.md.bk +10 -0
  114. package/lib/Attachments/style/fileCard.d.ts +2 -0
  115. package/lib/Attachments/style/fileCard.js +68 -0
  116. package/lib/Attachments/style/index.d.ts +2 -0
  117. package/lib/Attachments/style/index.js +98 -0
  118. package/{dist/bubble → lib/Bubble}/Avatar.d.ts +0 -1
  119. package/{dist/bubble → lib/Bubble}/Avatar.js +8 -5
  120. package/lib/Bubble/Bubble.d.ts +19 -0
  121. package/{dist/bubble → lib/Bubble}/Bubble.js +39 -52
  122. package/lib/Bubble/BubbleList.d.ts +41 -0
  123. package/lib/Bubble/BubbleList.js +64 -0
  124. package/{dist/bubble → lib/Bubble}/Cards.d.ts +2 -8
  125. package/{dist/bubble → lib/Bubble}/Cards.js +9 -9
  126. package/{dist/bubble → lib/Bubble}/ScrollToBottom.d.ts +0 -1
  127. package/{dist/bubble → lib/Bubble}/ScrollToBottom.js +15 -14
  128. package/lib/Bubble/Spin.d.ts +1 -0
  129. package/lib/Bubble/Spin.js +21 -0
  130. package/lib/Bubble/hooks/useListData.d.ts +0 -0
  131. package/lib/Bubble/hooks/useListData.js +0 -0
  132. package/lib/Bubble/interface.d.ts +62 -0
  133. package/lib/Bubble/loading.js +17 -0
  134. package/lib/Bubble/style/avatar.d.ts +2 -0
  135. package/lib/Bubble/style/avatar.js +8 -0
  136. package/lib/Bubble/style/index.d.ts +2 -0
  137. package/lib/Bubble/style/index.js +46 -0
  138. package/lib/Bubble/style/list.d.ts +2 -0
  139. package/lib/Bubble/style/list.js +16 -0
  140. package/{dist/chat-anywhere → lib/ChatAnywhere}/Chat/index.d.ts +0 -1
  141. package/{dist/chat-anywhere → lib/ChatAnywhere}/Chat/index.js +39 -28
  142. package/lib/ChatAnywhere/Chat/style.d.ts +2 -0
  143. package/lib/ChatAnywhere/Chat/style.js +14 -0
  144. package/lib/ChatAnywhere/Header/index.d.ts +1 -0
  145. package/lib/ChatAnywhere/Header/index.js +39 -0
  146. package/lib/ChatAnywhere/Header/style.d.ts +2 -0
  147. package/lib/ChatAnywhere/Header/style.js +12 -0
  148. package/lib/ChatAnywhere/Input/index.d.ts +3 -0
  149. package/{dist/chat-anywhere → lib/ChatAnywhere}/Input/index.js +92 -70
  150. package/lib/ChatAnywhere/Input/style.d.ts +2 -0
  151. package/lib/ChatAnywhere/Input/style.js +6 -0
  152. package/{dist/chat-anywhere → lib/ChatAnywhere}/Layout/index.d.ts +1 -2
  153. package/lib/ChatAnywhere/Layout/index.js +91 -0
  154. package/lib/ChatAnywhere/Layout/style.d.ts +2 -0
  155. package/lib/ChatAnywhere/Layout/style.js +16 -0
  156. package/lib/ChatAnywhere/SessionList/index.d.ts +3 -0
  157. package/{dist/chat-anywhere → lib/ChatAnywhere}/SessionList/index.js +67 -55
  158. package/lib/ChatAnywhere/SessionList/style.d.ts +2 -0
  159. package/lib/ChatAnywhere/SessionList/style.js +14 -0
  160. package/lib/ChatAnywhere/hooks/ChatAnywhereProvider.d.ts +148 -0
  161. package/{dist/chat-anywhere → lib/ChatAnywhere}/hooks/ChatAnywhereProvider.js +11 -5
  162. package/lib/ChatAnywhere/hooks/types.d.ts +312 -0
  163. package/{dist/chat-anywhere → lib/ChatAnywhere}/hooks/useInput.d.ts +2 -0
  164. package/{dist/chat-anywhere → lib/ChatAnywhere}/hooks/useInput.js +8 -2
  165. package/{dist/chat-anywhere → lib/ChatAnywhere}/hooks/useMessages.d.ts +3 -1
  166. package/{dist/chat-anywhere → lib/ChatAnywhere}/hooks/useMessages.js +10 -2
  167. package/{dist/chat-anywhere → lib/ChatAnywhere}/index.d.ts +4 -1
  168. package/{dist/chat-anywhere → lib/ChatAnywhere}/index.js +28 -15
  169. package/{dist/conversations → lib/Conversations}/GroupTitle.d.ts +4 -0
  170. package/{dist/conversations → lib/Conversations}/GroupTitle.js +7 -5
  171. package/{dist/conversations → lib/Conversations}/Item.d.ts +1 -0
  172. package/lib/Conversations/Item.js +208 -0
  173. package/lib/Conversations/hooks/useGroupable.d.ts +8 -0
  174. package/lib/Conversations/index.d.ts +55 -0
  175. package/{dist/conversations → lib/Conversations}/index.js +50 -61
  176. package/lib/Conversations/interface.d.ts +56 -0
  177. package/lib/Conversations/style.d.ts +2 -0
  178. package/lib/Conversations/style.js +60 -0
  179. package/{dist/default-cards/DeepThink → lib/DefaultCards/DeepThinking}/index.d.ts +2 -3
  180. package/lib/DefaultCards/DeepThinking/index.js +12 -0
  181. package/lib/DefaultCards/Files/index.d.ts +1 -0
  182. package/lib/DefaultCards/Files/index.js +56 -0
  183. package/{dist/default-cards → lib/DefaultCards}/Footer/index.d.ts +3 -4
  184. package/lib/DefaultCards/Footer/index.js +74 -0
  185. package/lib/DefaultCards/Images/index.d.ts +1 -0
  186. package/lib/DefaultCards/Images/index.js +49 -0
  187. package/{dist/default-cards → lib/DefaultCards}/Interrupted/index.d.ts +1 -3
  188. package/lib/DefaultCards/Interrupted/index.js +54 -0
  189. package/lib/DefaultCards/Text/index.d.ts +1 -0
  190. package/{dist/default-cards → lib/DefaultCards}/Text/index.js +4 -2
  191. package/lib/DefaultCards/count/index.d.ts +1 -0
  192. package/lib/DefaultCards/count/index.js +36 -0
  193. package/{dist/default-cards → lib/DefaultCards}/index.d.ts +1 -1
  194. package/{dist/default-cards → lib/DefaultCards}/index.js +1 -1
  195. package/lib/Disclaimer/index.d.ts +22 -0
  196. package/lib/Disclaimer/index.js +26 -0
  197. package/lib/Disclaimer/style.d.ts +2 -0
  198. package/lib/Disclaimer/style.js +10 -0
  199. package/lib/ImageGenerator/index.d.ts +41 -0
  200. package/lib/ImageGenerator/index.js +75 -0
  201. package/lib/ImageGenerator/style.d.ts +2 -0
  202. package/lib/ImageGenerator/style.js +20 -0
  203. package/{dist/markdown → lib/Markdown}/Citation.js +19 -14
  204. package/{dist/markdown → lib/Markdown}/CodeBlock.d.ts +1 -0
  205. package/{dist/markdown → lib/Markdown}/CodeBlock.js +51 -30
  206. package/lib/Markdown/ImageOrMedia.d.ts +1 -0
  207. package/lib/Markdown/ImageOrMedia.js +113 -0
  208. package/lib/Markdown/Link.js +48 -0
  209. package/{dist/markdown → lib/Markdown}/Markdown.js +22 -11
  210. package/lib/Markdown/cursor/Dot.d.ts +1 -0
  211. package/lib/Markdown/cursor/Dot.js +36 -0
  212. package/lib/Markdown/cursor/Underline.d.ts +1 -0
  213. package/lib/Markdown/cursor/Underline.js +20 -0
  214. package/lib/Markdown/hooks/index.d.ts +0 -0
  215. package/lib/Markdown/hooks/index.js +0 -0
  216. package/{dist/markdown → lib/Markdown}/hooks/useTypedEffect.js +1 -1
  217. package/lib/Markdown/index.d.ts +63 -0
  218. package/lib/Markdown/index.js +40 -0
  219. package/lib/Markdown/style.d.ts +2 -0
  220. package/lib/Markdown/style.js +30 -0
  221. package/lib/Markdown/type.d.ts +186 -0
  222. package/{dist/markdown → lib/Markdown}/utils.js +1 -2
  223. package/lib/Mermaid/index.d.ts +18 -0
  224. package/{dist/voice-chat/Recorder → lib/Mermaid}/index.js +144 -160
  225. package/{dist/provider → lib/Provider}/CustomCardsProvider.d.ts +2 -1
  226. package/{dist/provider → lib/Provider}/CustomCardsProvider.js +5 -3
  227. package/{dist/provider → lib/Provider}/GlobalProvider.d.ts +1 -1
  228. package/{dist/provider → lib/Provider}/GlobalProvider.js +5 -3
  229. package/{dist/provider → lib/Provider}/index.d.ts +1 -2
  230. package/{dist/provider → lib/Provider}/index.js +9 -6
  231. package/lib/Provider/types.d.ts +24 -0
  232. package/lib/Provider/types.js +1 -0
  233. package/lib/ResponsesAPI/index.d.ts +0 -0
  234. package/lib/ResponsesAPI/index.js +0 -0
  235. package/lib/Sender/ModeSelect/index.d.ts +17 -0
  236. package/lib/Sender/ModeSelect/index.js +109 -0
  237. package/lib/Sender/ModeSelect/styles.d.ts +0 -0
  238. package/lib/Sender/ModeSelect/styles.js +0 -0
  239. package/lib/Sender/SenderHeader.d.ts +63 -0
  240. package/{dist/sender → lib/Sender}/SenderHeader.js +40 -32
  241. package/{dist/sender → lib/Sender}/StopLoading.d.ts +1 -1
  242. package/lib/Sender/StopLoading.js +25 -0
  243. package/lib/Sender/components/ActionButton.d.ts +72 -0
  244. package/{dist/sender → lib/Sender}/components/ActionButton.js +9 -5
  245. package/lib/Sender/components/ClearButton.js +19 -0
  246. package/lib/Sender/components/LoadingButton.js +28 -0
  247. package/lib/Sender/components/SendButton.js +20 -0
  248. package/lib/Sender/components/SpeechButton/RecordingIcon.d.ts +8 -0
  249. package/lib/Sender/components/SpeechButton/RecordingIcon.js +54 -0
  250. package/lib/Sender/components/SpeechButton/index.js +35 -0
  251. package/lib/Sender/index.d.ts +142 -0
  252. package/{dist/sender → lib/Sender}/index.js +128 -121
  253. package/lib/Sender/style/index.d.ts +2 -0
  254. package/lib/Sender/style/index.js +41 -0
  255. package/{dist/stream → lib/Stream}/index.d.ts +4 -2
  256. package/{dist/stream → lib/Stream}/index.js +1 -1
  257. package/lib/Util/createStyle.d.ts +5 -0
  258. package/lib/Util/createStyle.js +20 -0
  259. package/lib/Util/sleep.d.ts +1 -0
  260. package/lib/Util/sleep.js +5 -0
  261. package/lib/Util/type.js +1 -0
  262. package/{dist/_util → lib/Util}/warning.d.ts +2 -2
  263. package/lib/Voice/Recorder.d.ts +1 -0
  264. package/lib/Voice/Recorder.js +6 -0
  265. package/lib/Voice/index.d.ts +0 -0
  266. package/lib/Voice/index.js +0 -0
  267. package/lib/Welcome/index.d.ts +24 -0
  268. package/lib/Welcome/index.js +39 -0
  269. package/lib/index.d.ts +25 -0
  270. package/lib/index.js +24 -0
  271. package/package.json +28 -14
  272. package/dist/accordion/Accordion.d.ts +0 -22
  273. package/dist/accordion/BodyContent.js +0 -18
  274. package/dist/accordion/DeepThink.d.ts +0 -7
  275. package/dist/accordion/DeepThink.js +0 -35
  276. package/dist/accordion/index.d.ts +0 -2
  277. package/dist/accordion/index.less +0 -170
  278. package/dist/attachments/DropArea.d.ts +0 -8
  279. package/dist/attachments/FileList/AudioIcon.d.ts +0 -2
  280. package/dist/attachments/FileList/AudioIcon.js +0 -19
  281. package/dist/attachments/FileList/FileListCard.d.ts +0 -12
  282. package/dist/attachments/FileList/Progress.d.ts +0 -6
  283. package/dist/attachments/FileList/VideoIcon.d.ts +0 -2
  284. package/dist/attachments/FileList/VideoIcon.js +0 -19
  285. package/dist/attachments/FileList/index.d.ts +0 -16
  286. package/dist/attachments/PlaceholderUploader.d.ts +0 -17
  287. package/dist/attachments/SilentUploader.d.ts +0 -9
  288. package/dist/attachments/SilentUploader.js +0 -23
  289. package/dist/attachments/context.d.ts +0 -5
  290. package/dist/attachments/index.d.ts +0 -33
  291. package/dist/attachments/style/fileCard.d.ts +0 -4
  292. package/dist/attachments/style/fileCard.js +0 -124
  293. package/dist/attachments/style/index.d.ts +0 -10
  294. package/dist/attachments/style/index.js +0 -211
  295. package/dist/bubble/Bubble.d.ts +0 -11
  296. package/dist/bubble/BubbleList.d.ts +0 -15
  297. package/dist/bubble/BubbleList.js +0 -44
  298. package/dist/bubble/Spin.d.ts +0 -2
  299. package/dist/bubble/Spin.js +0 -18
  300. package/dist/bubble/interface.d.ts +0 -26
  301. package/dist/bubble/loading.js +0 -17
  302. package/dist/bubble/style/avatar.less +0 -40
  303. package/dist/bubble/style/content.d.ts +0 -4
  304. package/dist/bubble/style/content.js +0 -43
  305. package/dist/bubble/style/index.d.ts +0 -9
  306. package/dist/bubble/style/index.js +0 -53
  307. package/dist/bubble/style/list.less +0 -15
  308. package/dist/bubble/style/scrollToBottom.less +0 -174
  309. package/dist/chat-anywhere/Chat/index.less +0 -54
  310. package/dist/chat-anywhere/Header/index.d.ts +0 -3
  311. package/dist/chat-anywhere/Header/index.js +0 -32
  312. package/dist/chat-anywhere/Header/index.less +0 -24
  313. package/dist/chat-anywhere/Input/index.d.ts +0 -3
  314. package/dist/chat-anywhere/Input/index.less +0 -12
  315. package/dist/chat-anywhere/Layout/index.js +0 -73
  316. package/dist/chat-anywhere/Layout/index.less +0 -61
  317. package/dist/chat-anywhere/SessionList/index.d.ts +0 -5
  318. package/dist/chat-anywhere/SessionList/index.less +0 -52
  319. package/dist/chat-anywhere/hooks/ChatAnywhereProvider.d.ts +0 -43
  320. package/dist/chat-anywhere/hooks/types.d.ts +0 -57
  321. package/dist/conversations/Item.js +0 -96
  322. package/dist/conversations/hooks/useGroupable.d.ts +0 -9
  323. package/dist/conversations/index.d.ts +0 -62
  324. package/dist/conversations/interface.d.ts +0 -60
  325. package/dist/conversations/style/index.d.ts +0 -9
  326. package/dist/conversations/style/index.js +0 -80
  327. package/dist/default-cards/Count/index.d.ts +0 -3
  328. package/dist/default-cards/Count/index.js +0 -16
  329. package/dist/default-cards/Count/index.less +0 -19
  330. package/dist/default-cards/DeepThink/index.js +0 -11
  331. package/dist/default-cards/Files/index.d.ts +0 -2
  332. package/dist/default-cards/Files/index.js +0 -18
  333. package/dist/default-cards/Footer/index.js +0 -50
  334. package/dist/default-cards/Footer/index.less +0 -41
  335. package/dist/default-cards/Images/index.d.ts +0 -3
  336. package/dist/default-cards/Images/index.js +0 -33
  337. package/dist/default-cards/Images/index.less +0 -17
  338. package/dist/default-cards/Interrupted/index.js +0 -40
  339. package/dist/default-cards/Interrupted/index.less +0 -57
  340. package/dist/default-cards/Text/index.d.ts +0 -2
  341. package/dist/disclaimer/index.d.ts +0 -11
  342. package/dist/disclaimer/index.js +0 -26
  343. package/dist/docs/1896.async.js +0 -457
  344. package/dist/docs/2710.async.js +0 -62
  345. package/dist/docs/2863.async.js +0 -400
  346. package/dist/docs/3057.async.js +0 -46
  347. package/dist/docs/3364.async.js +0 -25
  348. package/dist/docs/404.html +0 -15
  349. package/dist/docs/4820.async.js +0 -1381
  350. package/dist/docs/5623.async.js +0 -60
  351. package/dist/docs/5757.async.js +0 -1
  352. package/dist/docs/5804.async.js +0 -271
  353. package/dist/docs/6198.async.js +0 -18
  354. package/dist/docs/6671.async.js +0 -137
  355. package/dist/docs/7195.async.js +0 -1
  356. package/dist/docs/7485.async.js +0 -29
  357. package/dist/docs/7931.async.js +0 -19
  358. package/dist/docs/7997.async.js +0 -5
  359. package/dist/docs/8156.async.js +0 -110
  360. package/dist/docs/8368.async.js +0 -2
  361. package/dist/docs/8480.async.js +0 -1449
  362. package/dist/docs/8618.async.js +0 -246
  363. package/dist/docs/9016.async.js +0 -32
  364. package/dist/docs/9016.chunk.css +0 -1
  365. package/dist/docs/9335.async.js +0 -11
  366. package/dist/docs/accordion__demos.async.js +0 -9
  367. package/dist/docs/attachments__demos.async.js +0 -1
  368. package/dist/docs/bubble__demos.async.js +0 -50
  369. package/dist/docs/components/accordion/index.html +0 -15
  370. package/dist/docs/components/accordion-cn/index.html +0 -15
  371. package/dist/docs/components/attachments/index.html +0 -15
  372. package/dist/docs/components/attachments-cn/index.html +0 -15
  373. package/dist/docs/components/bubble/index.html +0 -15
  374. package/dist/docs/components/bubble-cn/index.html +0 -15
  375. package/dist/docs/components/bubble-list/index.html +0 -15
  376. package/dist/docs/components/bubble-list-cn/index.html +0 -15
  377. package/dist/docs/components/conversations/index.html +0 -15
  378. package/dist/docs/components/conversations-cn/index.html +0 -15
  379. package/dist/docs/components/disclaimer/index.html +0 -15
  380. package/dist/docs/components/disclaimer-cn/index.html +0 -15
  381. package/dist/docs/components/footer/index.html +0 -15
  382. package/dist/docs/components/footer-cn/index.html +0 -15
  383. package/dist/docs/components/markdown/index.html +0 -15
  384. package/dist/docs/components/markdown-cn/index.html +0 -15
  385. package/dist/docs/components/sender/index.html +0 -15
  386. package/dist/docs/components/sender-cn/index.html +0 -15
  387. package/dist/docs/components/status/index.html +0 -15
  388. package/dist/docs/components/status-cn/index.html +0 -15
  389. package/dist/docs/components/welcome/index.html +0 -15
  390. package/dist/docs/components/welcome-cn/index.html +0 -15
  391. package/dist/docs/components__accordion__index.en-US.md.async.js +0 -6
  392. package/dist/docs/components__accordion__index.en-US.md.chunk.css +0 -1
  393. package/dist/docs/components__accordion__index.zh-CN.md.async.js +0 -6
  394. package/dist/docs/components__accordion__index.zh-CN.md.chunk.css +0 -1
  395. package/dist/docs/components__attachments__index.en-US.md.async.js +0 -1
  396. package/dist/docs/components__attachments__index.en-US.md.chunk.css +0 -1
  397. package/dist/docs/components__attachments__index.zh-CN.md.async.js +0 -1
  398. package/dist/docs/components__attachments__index.zh-CN.md.chunk.css +0 -1
  399. package/dist/docs/components__bubble-list__index.en-US.md.async.js +0 -2
  400. package/dist/docs/components__bubble-list__index.en-US.md.chunk.css +0 -1
  401. package/dist/docs/components__bubble-list__index.zh-CN.md.async.js +0 -2
  402. package/dist/docs/components__bubble-list__index.zh-CN.md.chunk.css +0 -1
  403. package/dist/docs/components__bubble__index.en-US.md.async.js +0 -1
  404. package/dist/docs/components__bubble__index.en-US.md.chunk.css +0 -1
  405. package/dist/docs/components__bubble__index.zh-CN.md.async.js +0 -1
  406. package/dist/docs/components__bubble__index.zh-CN.md.chunk.css +0 -1
  407. package/dist/docs/components__conversations__index.en-US.md.async.js +0 -2
  408. package/dist/docs/components__conversations__index.en-US.md.chunk.css +0 -1
  409. package/dist/docs/components__conversations__index.zh-CN.md.async.js +0 -1
  410. package/dist/docs/components__conversations__index.zh-CN.md.chunk.css +0 -1
  411. package/dist/docs/components__disclaimer__index.en-US.md.async.js +0 -1
  412. package/dist/docs/components__disclaimer__index.en-US.md.chunk.css +0 -1
  413. package/dist/docs/components__disclaimer__index.zh-CN.md.async.js +0 -1
  414. package/dist/docs/components__disclaimer__index.zh-CN.md.chunk.css +0 -1
  415. package/dist/docs/components__footer__index.en-US.md.async.js +0 -1
  416. package/dist/docs/components__footer__index.en-US.md.chunk.css +0 -1
  417. package/dist/docs/components__footer__index.zh-CN.md.async.js +0 -2
  418. package/dist/docs/components__footer__index.zh-CN.md.chunk.css +0 -1
  419. package/dist/docs/components__markdown__index.en-US.md.async.js +0 -1
  420. package/dist/docs/components__markdown__index.en-US.md.chunk.css +0 -1
  421. package/dist/docs/components__markdown__index.zh-CN.md.async.js +0 -1
  422. package/dist/docs/components__markdown__index.zh-CN.md.chunk.css +0 -1
  423. package/dist/docs/components__sender__index.en-US.md.async.js +0 -1
  424. package/dist/docs/components__sender__index.en-US.md.chunk.css +0 -1
  425. package/dist/docs/components__sender__index.zh-CN.md.async.js +0 -1
  426. package/dist/docs/components__sender__index.zh-CN.md.chunk.css +0 -1
  427. package/dist/docs/components__status__index.en-US.md.async.js +0 -1
  428. package/dist/docs/components__status__index.en-US.md.chunk.css +0 -1
  429. package/dist/docs/components__status__index.zh-CN.md.async.js +0 -2
  430. package/dist/docs/components__status__index.zh-CN.md.chunk.css +0 -1
  431. package/dist/docs/components__welcome__index.en-US.md.async.js +0 -2
  432. package/dist/docs/components__welcome__index.en-US.md.chunk.css +0 -1
  433. package/dist/docs/components__welcome__index.zh-CN.md.async.js +0 -2
  434. package/dist/docs/components__welcome__index.zh-CN.md.chunk.css +0 -1
  435. package/dist/docs/conversations__demos.async.js +0 -1
  436. package/dist/docs/demos.async.js +0 -47
  437. package/dist/docs/demos.chunk.css +0 -1
  438. package/dist/docs/disclaimer__demos.async.js +0 -1
  439. package/dist/docs/docs/development/ag-ui/index.html +0 -15
  440. package/dist/docs/docs/development/ag-ui-cn/index.html +0 -15
  441. package/dist/docs/docs/development/backend/index.html +0 -15
  442. package/dist/docs/docs/development/backend-cn/index.html +0 -15
  443. package/dist/docs/docs/development/cards/index.html +0 -15
  444. package/dist/docs/docs/development/cards-cn/index.html +0 -15
  445. package/dist/docs/docs/development/chatanywhere/index.html +0 -15
  446. package/dist/docs/docs/development/chatanywhere-api/index.html +0 -15
  447. package/dist/docs/docs/development/chatanywhere-api-cn/index.html +0 -15
  448. package/dist/docs/docs/development/chatanywhere-cn/index.html +0 -15
  449. package/dist/docs/docs/development/custom/index.html +0 -15
  450. package/dist/docs/docs/development/custom-cn/index.html +0 -15
  451. package/dist/docs/docs/development/overview/index.html +0 -15
  452. package/dist/docs/docs/development/overview-cn/index.html +0 -15
  453. package/dist/docs/docs/development/qwen/index.html +0 -15
  454. package/dist/docs/docs/development/qwen-cn/index.html +0 -15
  455. package/dist/docs/docs/templates/copilot/index.html +0 -15
  456. package/dist/docs/docs/templates/copilot-cn/index.html +0 -15
  457. package/dist/docs/docs/templates/native/index.html +0 -15
  458. package/dist/docs/docs/templates/native-cn/index.html +0 -15
  459. package/dist/docs/docs/templates/voice/index.html +0 -15
  460. package/dist/docs/docs/templates/voice-cn/index.html +0 -15
  461. package/dist/docs/docs__development__ag-ui.en-US.md.async.js +0 -210
  462. package/dist/docs/docs__development__ag-ui.en-US.md.chunk.css +0 -1
  463. package/dist/docs/docs__development__ag-ui.zh-CN.md.async.js +0 -210
  464. package/dist/docs/docs__development__ag-ui.zh-CN.md.chunk.css +0 -1
  465. package/dist/docs/docs__development__backend.en-US.md.async.js +0 -12
  466. package/dist/docs/docs__development__backend.en-US.md.chunk.css +0 -1
  467. package/dist/docs/docs__development__backend.zh-CN.md.async.js +0 -12
  468. package/dist/docs/docs__development__backend.zh-CN.md.chunk.css +0 -1
  469. package/dist/docs/docs__development__cards.en-US.md.async.js +0 -27
  470. package/dist/docs/docs__development__cards.en-US.md.chunk.css +0 -1
  471. package/dist/docs/docs__development__cards.zh-CN.md.async.js +0 -27
  472. package/dist/docs/docs__development__cards.zh-CN.md.chunk.css +0 -1
  473. package/dist/docs/docs__development__chatanywhere-api.en-US.md.async.js +0 -69
  474. package/dist/docs/docs__development__chatanywhere-api.en-US.md.chunk.css +0 -1
  475. package/dist/docs/docs__development__chatanywhere-api.zh-CN.md.async.js +0 -69
  476. package/dist/docs/docs__development__chatanywhere-api.zh-CN.md.chunk.css +0 -1
  477. package/dist/docs/docs__development__chatanywhere.en-US.md.async.js +0 -77
  478. package/dist/docs/docs__development__chatanywhere.en-US.md.chunk.css +0 -1
  479. package/dist/docs/docs__development__chatanywhere.zh-CN.md.async.js +0 -77
  480. package/dist/docs/docs__development__chatanywhere.zh-CN.md.chunk.css +0 -1
  481. package/dist/docs/docs__development__custom.en-US.md.async.js +0 -22
  482. package/dist/docs/docs__development__custom.en-US.md.chunk.css +0 -1
  483. package/dist/docs/docs__development__custom.zh-CN.md.async.js +0 -22
  484. package/dist/docs/docs__development__custom.zh-CN.md.chunk.css +0 -1
  485. package/dist/docs/docs__development__overview.en-US.md.async.js +0 -21
  486. package/dist/docs/docs__development__overview.en-US.md.chunk.css +0 -1
  487. package/dist/docs/docs__development__overview.zh-CN.md.async.js +0 -21
  488. package/dist/docs/docs__development__overview.zh-CN.md.chunk.css +0 -1
  489. package/dist/docs/docs__development__qwen.en-US.md.async.js +0 -25
  490. package/dist/docs/docs__development__qwen.en-US.md.chunk.css +0 -1
  491. package/dist/docs/docs__development__qwen.zh-CN.md.async.js +0 -25
  492. package/dist/docs/docs__development__qwen.zh-CN.md.chunk.css +0 -1
  493. package/dist/docs/docs__templates__copilot.en-US.md.async.js +0 -1
  494. package/dist/docs/docs__templates__copilot.en-US.md.chunk.css +0 -1
  495. package/dist/docs/docs__templates__copilot.zh-CN.md.async.js +0 -1
  496. package/dist/docs/docs__templates__copilot.zh-CN.md.chunk.css +0 -1
  497. package/dist/docs/docs__templates__native.en-US.md.async.js +0 -1
  498. package/dist/docs/docs__templates__native.en-US.md.chunk.css +0 -1
  499. package/dist/docs/docs__templates__native.zh-CN.md.async.js +0 -1
  500. package/dist/docs/docs__templates__native.zh-CN.md.chunk.css +0 -1
  501. package/dist/docs/docs__templates__voice.en-US.md.async.js +0 -20
  502. package/dist/docs/docs__templates__voice.en-US.md.chunk.css +0 -1
  503. package/dist/docs/docs__templates__voice.zh-CN.md.async.js +0 -1
  504. package/dist/docs/docs__templates__voice.zh-CN.md.chunk.css +0 -1
  505. package/dist/docs/dumi__pages__index__index.en-US.async.js +0 -1
  506. package/dist/docs/dumi__pages__index__index.en-US.chunk.css +0 -1
  507. package/dist/docs/dumi__pages__index__index.zh-CN.async.js +0 -1
  508. package/dist/docs/dumi__pages__index__index.zh-CN.chunk.css +0 -1
  509. package/dist/docs/dumi__theme__layouts__DocLayout__index.async.js +0 -1
  510. package/dist/docs/dumi__theme__layouts__DocLayout__index.chunk.css +0 -1
  511. package/dist/docs/dumi__theme__layouts__GlobalLayout__index.async.js +0 -18
  512. package/dist/docs/dumi__theme__layouts__GlobalLayout__index.chunk.css +0 -1
  513. package/dist/docs/dumi__tmp-production__dumi__theme__ContextWrapper.async.js +0 -1
  514. package/dist/docs/index/index.html +0 -15
  515. package/dist/docs/index-cn/index.html +0 -15
  516. package/dist/docs/markdown__demos.async.js +0 -164
  517. package/dist/docs/meta__components__en-US.async.js +0 -9
  518. package/dist/docs/meta__components__zh-CN.async.js +0 -10
  519. package/dist/docs/meta__docs__en-US.async.js +0 -475
  520. package/dist/docs/meta__docs__en-US.chunk.css +0 -1
  521. package/dist/docs/meta__docs__zh-CN.async.js +0 -456
  522. package/dist/docs/meta__docs__zh-CN.chunk.css +0 -1
  523. package/dist/docs/nm__dumi__dist__client__pages__404.async.js +0 -1
  524. package/dist/docs/nm__dumi__dist__client__pages__Demo__index.async.js +0 -1
  525. package/dist/docs/nm__dumi__dist__client__pages__Demo__index.chunk.css +0 -1
  526. package/dist/docs/preload_helper.js +0 -1
  527. package/dist/docs/sender__demos.async.js +0 -1
  528. package/dist/docs/umi.css +0 -1
  529. package/dist/docs/umi.js +0 -107
  530. package/dist/docs/welcome__demos.async.js +0 -1
  531. package/dist/docs/~demos/:id/index.html +0 -15
  532. package/dist/docs/~demos/accordion-demo-inline/index.html +0 -15
  533. package/dist/docs/~demos/accordion-demo-mutisteps/index.html +0 -15
  534. package/dist/docs/~demos/accordion-demo-thinking/index.html +0 -15
  535. package/dist/docs/~demos/attachments-demo-files/index.html +0 -15
  536. package/dist/docs/~demos/bubble-demo-basic/index.html +0 -15
  537. package/dist/docs/~demos/bubble-demo-havestopped/index.html +0 -15
  538. package/dist/docs/~demos/bubble-demo-userwithfile/index.html +0 -15
  539. package/dist/docs/~demos/bubble-demo-userwithimage/index.html +0 -15
  540. package/dist/docs/~demos/bubble-demo-userwithnormal/index.html +0 -15
  541. package/dist/docs/~demos/bubble-demo-withavatar/index.html +0 -15
  542. package/dist/docs/~demos/bubble-demo-withcode/index.html +0 -15
  543. package/dist/docs/~demos/bubble-demo-witherror/index.html +0 -15
  544. package/dist/docs/~demos/bubble-demo-witherrordetail/index.html +0 -15
  545. package/dist/docs/~demos/bubble-demo-withimage/index.html +0 -15
  546. package/dist/docs/~demos/bubble-demo-withusage/index.html +0 -15
  547. package/dist/docs/~demos/bubble-demo-withwaitingmessage/index.html +0 -15
  548. package/dist/docs/~demos/components-bubble-list-demo-basic/index.html +0 -15
  549. package/dist/docs/~demos/components-footer-demo-basic/index.html +0 -15
  550. package/dist/docs/~demos/components-footer-demo-withusage/index.html +0 -15
  551. package/dist/docs/~demos/components-status-demo-basic/index.html +0 -15
  552. package/dist/docs/~demos/conversations-demo-basic/index.html +0 -15
  553. package/dist/docs/~demos/disclaimer-demo-demo/index.html +0 -15
  554. package/dist/docs/~demos/disclaimer-demo-withlink/index.html +0 -15
  555. package/dist/docs/~demos/docs-development-ag-ui-demo-with-copilotkit/index.html +0 -15
  556. package/dist/docs/~demos/docs-development-cards-demo-file/index.html +0 -15
  557. package/dist/docs/~demos/docs-development-cards-demo-footer/index.html +0 -15
  558. package/dist/docs/~demos/docs-development-cards-demo-image/index.html +0 -15
  559. package/dist/docs/~demos/docs-development-cards-demo-text/index.html +0 -15
  560. package/dist/docs/~demos/docs-development-custom-demo-custom/index.html +0 -15
  561. package/dist/docs/~demos/docs-templates-copilot-demo-copilot/index.html +0 -15
  562. package/dist/docs/~demos/docs-templates-native-demo-basic/index.html +0 -15
  563. package/dist/docs/~demos/docs-templates-voice-demo-demo/index.html +0 -15
  564. package/dist/docs/~demos/markdown-demo-citations/index.html +0 -15
  565. package/dist/docs/~demos/markdown-demo-cursor/index.html +0 -15
  566. package/dist/docs/~demos/markdown-demo-mathjax/index.html +0 -15
  567. package/dist/docs/~demos/markdown-demo-md/index.html +0 -15
  568. package/dist/docs/~demos/sender-demo-basic/index.html +0 -15
  569. package/dist/docs/~demos/sender-demo-disabled/index.html +0 -15
  570. package/dist/docs/~demos/sender-demo-loading/index.html +0 -15
  571. package/dist/docs/~demos/sender-demo-moreprefixaction/index.html +0 -15
  572. package/dist/docs/~demos/sender-demo-withfile/index.html +0 -15
  573. package/dist/docs/~demos/welcome-demo-demo0/index.html +0 -15
  574. package/dist/docs/~demos/welcome-demo-demo1/index.html +0 -15
  575. package/dist/docs/~demos/welcome-demo-demo2/index.html +0 -15
  576. package/dist/index.d.ts +0 -26
  577. package/dist/index.js +0 -20
  578. package/dist/index.less +0 -1
  579. package/dist/markdown/ImageOrVideo.d.ts +0 -2
  580. package/dist/markdown/ImageOrVideo.js +0 -81
  581. package/dist/markdown/Link.js +0 -28
  582. package/dist/markdown/cursor/Blur.d.ts +0 -3
  583. package/dist/markdown/cursor/Blur.js +0 -7
  584. package/dist/markdown/cursor/Dot.d.ts +0 -3
  585. package/dist/markdown/cursor/Dot.js +0 -16
  586. package/dist/markdown/cursor/Underline.d.ts +0 -3
  587. package/dist/markdown/cursor/Underline.js +0 -7
  588. package/dist/markdown/cursor/index.less +0 -124
  589. package/dist/markdown/hooks/index.d.ts +0 -1
  590. package/dist/markdown/hooks/index.js +0 -49
  591. package/dist/markdown/index.d.ts +0 -16
  592. package/dist/markdown/index.js +0 -37
  593. package/dist/markdown/index.less +0 -204
  594. package/dist/markdown/type.d.ts +0 -46
  595. package/dist/provider/types.d.ts +0 -8
  596. package/dist/sender/SenderHeader.d.ts +0 -19
  597. package/dist/sender/StopLoading.js +0 -20
  598. package/dist/sender/components/ActionButton.d.ts +0 -22
  599. package/dist/sender/components/ClearButton.js +0 -13
  600. package/dist/sender/components/LoadingButton.js +0 -22
  601. package/dist/sender/components/SendButton.js +0 -14
  602. package/dist/sender/components/SpeechButton/RecordingIcon.d.ts +0 -5
  603. package/dist/sender/components/SpeechButton/RecordingIcon.js +0 -49
  604. package/dist/sender/components/SpeechButton/index.js +0 -30
  605. package/dist/sender/index.d.ts +0 -61
  606. package/dist/sender/style/header.d.ts +0 -4
  607. package/dist/sender/style/header.js +0 -46
  608. package/dist/sender/style/index.d.ts +0 -10
  609. package/dist/sender/style/index.js +0 -123
  610. package/dist/stream/index.en-US.md.bk +0 -50
  611. package/dist/stream/index.zh-CN.md.bk +0 -51
  612. package/dist/theme/components.d.ts +0 -10
  613. package/dist/theme/cssinjs-utils.d.ts +0 -14
  614. package/dist/theme/genStyleUtils.d.ts +0 -28
  615. package/dist/theme/useToken.d.ts +0 -18
  616. package/dist/theme/useToken.js +0 -110
  617. package/dist/voice-chat/Recorder/index.d.ts +0 -26
  618. package/dist/voice-chat/VoiceChatProvider/context.d.ts +0 -22
  619. package/dist/voice-chat/VoiceChatProvider/context.js +0 -3
  620. package/dist/voice-chat/VoiceChatProvider/hooks/useChatState.d.ts +0 -1
  621. package/dist/voice-chat/VoiceChatProvider/hooks/useChatState.js +0 -5
  622. package/dist/voice-chat/VoiceChatProvider/hooks/useMessages.d.ts +0 -8
  623. package/dist/voice-chat/VoiceChatProvider/hooks/useMessages.js +0 -31
  624. package/dist/voice-chat/VoiceChatProvider/hooks/useRecorder.d.ts +0 -5
  625. package/dist/voice-chat/VoiceChatProvider/hooks/useRecorder.js +0 -48
  626. package/dist/voice-chat/VoiceChatProvider/hooks/useVoiceChat.d.ts +0 -4
  627. package/dist/voice-chat/VoiceChatProvider/hooks/useVoiceChat.js +0 -10
  628. package/dist/voice-chat/VoiceChatProvider/index.d.ts +0 -9
  629. package/dist/voice-chat/VoiceChatProvider/index.js +0 -55
  630. package/dist/voice-chat/VoiceChatService/index.d.ts +0 -34
  631. package/dist/voice-chat/index.d.ts +0 -2
  632. package/dist/voice-chat/index.js +0 -2
  633. package/dist/voice-chat/types/index.d.ts +0 -12
  634. package/dist/voice-chat/types/index.js +0 -4
  635. package/dist/welcome/icon.d.ts +0 -2
  636. package/dist/welcome/icon.js +0 -38
  637. package/dist/welcome/index.d.ts +0 -9
  638. package/dist/welcome/index.js +0 -57
  639. /package/{dist/_util/type.js → lib/AGUI/components/chat/props.js} +0 -0
  640. /package/{dist/bubble/interface.js → lib/AGUI/context/index.js} +0 -0
  641. /package/{dist/bubble/hooks/useDisplayData.d.ts → lib/AGUI/styles.css} +0 -0
  642. /package/{dist/bubble/hooks/useDisplayData.js → lib/AGUI/types/css.d.ts} +0 -0
  643. /package/{dist/bubble/hooks/useListData.d.ts → lib/AGUI/types/css.js} +0 -0
  644. /package/{dist/chat-anywhere/hooks/types.js → lib/AGUI/types/index.js} +0 -0
  645. /package/{dist/conversations/interface.js → lib/AGUI/types/suggestions.js} +0 -0
  646. /package/{dist/accordion → lib/Accordion}/index.js +0 -0
  647. /package/{dist/attachments → lib/Attachments}/context.js +0 -0
  648. /package/{dist/attachments → lib/Attachments}/util.d.ts +0 -0
  649. /package/{dist/attachments → lib/Attachments}/util.js +0 -0
  650. /package/{dist/bubble/hooks/useListData.js → lib/Bubble/hooks/useDisplayData.d.ts} +0 -0
  651. /package/{dist/default-cards/DeepThink/index.less → lib/Bubble/hooks/useDisplayData.js} +0 -0
  652. /package/{dist/bubble → lib/Bubble}/index.d.ts +0 -0
  653. /package/{dist/bubble → lib/Bubble}/index.js +0 -0
  654. /package/{dist/markdown/type.js → lib/Bubble/interface.js} +0 -0
  655. /package/{dist/bubble → lib/Bubble}/loading.d.ts +0 -0
  656. /package/{dist/chat-anywhere → lib/ChatAnywhere}/Chat/Ref.d.ts +0 -0
  657. /package/{dist/chat-anywhere → lib/ChatAnywhere}/Chat/Ref.js +0 -0
  658. /package/{dist/provider → lib/ChatAnywhere/hooks}/types.js +0 -0
  659. /package/{dist/chat-anywhere → lib/ChatAnywhere}/hooks/useSessionList.d.ts +0 -0
  660. /package/{dist/chat-anywhere → lib/ChatAnywhere}/hooks/useSessionList.js +0 -0
  661. /package/{dist/conversations → lib/Conversations}/hooks/useGroupable.js +0 -0
  662. /package/{dist/theme/components.js → lib/Conversations/interface.js} +0 -0
  663. /package/{dist/markdown → lib/Markdown}/Citation.d.ts +0 -0
  664. /package/{dist/markdown → lib/Markdown}/Link.d.ts +0 -0
  665. /package/{dist/markdown → lib/Markdown}/Markdown.d.ts +0 -0
  666. /package/{dist/markdown → lib/Markdown}/hooks/useTypedEffect.d.ts +0 -0
  667. /package/{dist/markdown → lib/Markdown}/plugins/footnote.d.ts +0 -0
  668. /package/{dist/markdown → lib/Markdown}/plugins/footnote.js +0 -0
  669. /package/{dist/markdown → lib/Markdown}/plugins/katexDir.d.ts +0 -0
  670. /package/{dist/markdown → lib/Markdown}/plugins/katexDir.js +0 -0
  671. /package/{dist/markdown → lib/Markdown}/rehype/fadeIn.d.ts +0 -0
  672. /package/{dist/markdown → lib/Markdown}/rehype/fadeIn.js +0 -0
  673. /package/{dist/theme/cssinjs-utils.js → lib/Markdown/type.js} +0 -0
  674. /package/{dist/markdown → lib/Markdown}/utils.d.ts +0 -0
  675. /package/{dist/sender → lib/Sender}/components/ClearButton.d.ts +0 -0
  676. /package/{dist/sender → lib/Sender}/components/LoadingButton.d.ts +0 -0
  677. /package/{dist/sender → lib/Sender}/components/SendButton.d.ts +0 -0
  678. /package/{dist/sender → lib/Sender}/components/SpeechButton/index.d.ts +0 -0
  679. /package/{dist/sender → lib/Sender}/useSpeech.d.ts +0 -0
  680. /package/{dist/sender → lib/Sender}/useSpeech.js +0 -0
  681. /package/{dist/_util → lib/Util}/hooks/use-proxy-imperative-handle.d.ts +0 -0
  682. /package/{dist/_util → lib/Util}/hooks/use-proxy-imperative-handle.js +0 -0
  683. /package/{dist/_util → lib/Util}/type.d.ts +0 -0
  684. /package/{dist/_util → lib/Util}/warning.js +0 -0
  685. /package/{dist/version → lib/Version}/index.d.ts +0 -0
  686. /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
- # spark-ai/chat
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
- 一个免费、开源的对话框架,用于构建优秀的 LLM 对话体验
5
+ [![npm version](https://img.shields.io/npm/v/@ali/agentscope-ai-chat.svg)](https://www.npmjs.com/package/@ali/agentscope-ai-chat)
6
+ [![license](https://img.shields.io/npm/l/@ali/agentscope-ai-chat.svg)](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
- ![O1CN01PXnfNo1TXaRlPEuYp_!!6000000002392-2-tps-2944-1864.png](https://img.alicdn.com/imgextra/i3/O1CN01PXnfNo1TXaRlPEuYp_!!6000000002392-2-tps-2944-1864.png)
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
- ![O1CN01UsX0vG1dU3YEqZHvG_!!6000000003738-2-tps-2944-1864.png](https://img.alicdn.com/imgextra/i4/O1CN01UsX0vG1dU3YEqZHvG_!!6000000003738-2-tps-2944-1864.png)
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
- Spark Chat 所有对话都基于一个统一模型:
69
+ ## 📦 Core Components
18
70
 
19
- - 每条消息 = 一个 `Bubble`
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
- - **统一渲染引擎**:所有对话内容都走统一的 card 渲染管线,避免 UI 特例和嵌套分支逻辑
26
- - **语义隔离**:每种卡片封装自己的样式、逻辑、状态,无副作用,利于测试和协同
75
+ ```tsx
76
+ import { ChatAnywhere, ChatAnywhereRef } from '@agentscope-ai/chat';
27
77
 
28
- 在数据层面,它实现了从“语言-界面”之间的解耦:开发者可以仅通过结构数据来操控 UI 呈现,让人机交互从“流式对话”走向“结构对话”。
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
- Spark Chat 不再要求模型吐出自然语言,再由 UI “包裹”这些文字。我们拒绝“钉死”的输入输出组件,而是选择用“乐高式”语法描述整个界面状态,于是我们设计了一种对大模型友好的 UI 协议:
85
+ Message bubble component supporting various message type displays.
32
86
 
87
+ ```tsx
88
+ import { Bubble, DefaultCards } from '@agentscope-ai/chat';
33
89
 
34
- ```javascript
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
- ```javascript
52
- function MyCard(props) {
53
- return <div>MyCard</div>;
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
- ```javascript
59
- <CustomCardsProvider cardConfig={{ MyCard }}>...</CustomCardsProvider>
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
- ```javascript
67
- <Bubble
68
- cards={[
69
- {
70
- code: 'Text',
71
- data: {
72
- content: 'Hello World',
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.
@@ -0,0 +1,188 @@
1
+ # Alibaba Cloud Spark Chat
2
+
3
+ **注意**:`@agentscope-ai/design` 和 `@agentscope-ai/chat` 仍在加速推进开源中,我们预计在 2025 年年底完成开源。目前可以通过 npm 使用我们的项目。
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@ali/agentscope-ai-chat.svg)](https://www.npmjs.com/package/@ali/agentscope-ai-chat)
6
+ [![license](https://img.shields.io/npm/l/@ali/agentscope-ai-chat.svg)](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;