@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.
Files changed (685) 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 +87 -68
  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/useMessages.d.ts +3 -1
  164. package/{dist/chat-anywhere → lib/ChatAnywhere}/hooks/useMessages.js +10 -2
  165. package/{dist/chat-anywhere → lib/ChatAnywhere}/index.d.ts +4 -1
  166. package/{dist/chat-anywhere → lib/ChatAnywhere}/index.js +28 -15
  167. package/{dist/conversations → lib/Conversations}/GroupTitle.d.ts +4 -0
  168. package/{dist/conversations → lib/Conversations}/GroupTitle.js +7 -5
  169. package/{dist/conversations → lib/Conversations}/Item.d.ts +1 -0
  170. package/lib/Conversations/Item.js +208 -0
  171. package/lib/Conversations/hooks/useGroupable.d.ts +8 -0
  172. package/lib/Conversations/index.d.ts +55 -0
  173. package/{dist/conversations → lib/Conversations}/index.js +50 -61
  174. package/lib/Conversations/interface.d.ts +56 -0
  175. package/lib/Conversations/style.d.ts +2 -0
  176. package/lib/Conversations/style.js +60 -0
  177. package/{dist/default-cards/DeepThink → lib/DefaultCards/DeepThinking}/index.d.ts +2 -3
  178. package/lib/DefaultCards/DeepThinking/index.js +12 -0
  179. package/lib/DefaultCards/Files/index.d.ts +1 -0
  180. package/lib/DefaultCards/Files/index.js +56 -0
  181. package/{dist/default-cards → lib/DefaultCards}/Footer/index.d.ts +3 -4
  182. package/lib/DefaultCards/Footer/index.js +74 -0
  183. package/lib/DefaultCards/Images/index.d.ts +1 -0
  184. package/lib/DefaultCards/Images/index.js +49 -0
  185. package/{dist/default-cards → lib/DefaultCards}/Interrupted/index.d.ts +1 -3
  186. package/lib/DefaultCards/Interrupted/index.js +54 -0
  187. package/lib/DefaultCards/Text/index.d.ts +1 -0
  188. package/{dist/default-cards → lib/DefaultCards}/Text/index.js +4 -2
  189. package/lib/DefaultCards/count/index.d.ts +1 -0
  190. package/lib/DefaultCards/count/index.js +36 -0
  191. package/{dist/default-cards → lib/DefaultCards}/index.d.ts +1 -1
  192. package/{dist/default-cards → lib/DefaultCards}/index.js +1 -1
  193. package/lib/Disclaimer/index.d.ts +22 -0
  194. package/lib/Disclaimer/index.js +26 -0
  195. package/lib/Disclaimer/style.d.ts +2 -0
  196. package/lib/Disclaimer/style.js +10 -0
  197. package/lib/ImageGenerator/index.d.ts +41 -0
  198. package/lib/ImageGenerator/index.js +75 -0
  199. package/lib/ImageGenerator/style.d.ts +2 -0
  200. package/lib/ImageGenerator/style.js +20 -0
  201. package/{dist/markdown → lib/Markdown}/Citation.js +19 -14
  202. package/{dist/markdown → lib/Markdown}/CodeBlock.d.ts +1 -0
  203. package/{dist/markdown → lib/Markdown}/CodeBlock.js +51 -30
  204. package/lib/Markdown/ImageOrMedia.d.ts +1 -0
  205. package/lib/Markdown/ImageOrMedia.js +113 -0
  206. package/lib/Markdown/Link.js +48 -0
  207. package/{dist/markdown → lib/Markdown}/Markdown.js +22 -11
  208. package/lib/Markdown/cursor/Dot.d.ts +1 -0
  209. package/lib/Markdown/cursor/Dot.js +35 -0
  210. package/lib/Markdown/cursor/Underline.d.ts +1 -0
  211. package/lib/Markdown/cursor/Underline.js +19 -0
  212. package/lib/Markdown/hooks/index.d.ts +0 -0
  213. package/lib/Markdown/hooks/index.js +0 -0
  214. package/{dist/markdown → lib/Markdown}/hooks/useTypedEffect.js +1 -1
  215. package/lib/Markdown/index.d.ts +63 -0
  216. package/lib/Markdown/index.js +44 -0
  217. package/lib/Markdown/style.d.ts +2 -0
  218. package/lib/Markdown/style.js +36 -0
  219. package/lib/Markdown/type.d.ts +186 -0
  220. package/{dist/markdown → lib/Markdown}/utils.js +1 -2
  221. package/lib/Mermaid/index.d.ts +18 -0
  222. package/{dist/voice-chat/Recorder → lib/Mermaid}/index.js +144 -160
  223. package/{dist/provider → lib/Provider}/CustomCardsProvider.d.ts +2 -1
  224. package/{dist/provider → lib/Provider}/CustomCardsProvider.js +5 -3
  225. package/{dist/provider → lib/Provider}/GlobalProvider.d.ts +1 -1
  226. package/{dist/provider → lib/Provider}/GlobalProvider.js +5 -3
  227. package/{dist/provider → lib/Provider}/index.d.ts +1 -2
  228. package/{dist/provider → lib/Provider}/index.js +9 -6
  229. package/lib/Provider/types.d.ts +24 -0
  230. package/lib/Provider/types.js +1 -0
  231. package/lib/Sender/ModeSelect/index.d.ts +17 -0
  232. package/lib/Sender/ModeSelect/index.js +109 -0
  233. package/lib/Sender/ModeSelect/styles.d.ts +0 -0
  234. package/lib/Sender/ModeSelect/styles.js +0 -0
  235. package/lib/Sender/SenderHeader.d.ts +63 -0
  236. package/{dist/sender → lib/Sender}/SenderHeader.js +40 -32
  237. package/{dist/sender → lib/Sender}/StopLoading.d.ts +1 -1
  238. package/lib/Sender/StopLoading.js +25 -0
  239. package/lib/Sender/components/ActionButton.d.ts +72 -0
  240. package/{dist/sender → lib/Sender}/components/ActionButton.js +9 -5
  241. package/lib/Sender/components/ClearButton.js +19 -0
  242. package/lib/Sender/components/LoadingButton.js +28 -0
  243. package/lib/Sender/components/SendButton.js +20 -0
  244. package/lib/Sender/components/SpeechButton/RecordingIcon.d.ts +8 -0
  245. package/lib/Sender/components/SpeechButton/RecordingIcon.js +54 -0
  246. package/lib/Sender/components/SpeechButton/index.js +35 -0
  247. package/lib/Sender/index.d.ts +142 -0
  248. package/{dist/sender → lib/Sender}/index.js +128 -121
  249. package/lib/Sender/style/index.d.ts +2 -0
  250. package/lib/Sender/style/index.js +41 -0
  251. package/{dist/stream → lib/Stream}/index.d.ts +4 -2
  252. package/{dist/stream → lib/Stream}/index.js +1 -1
  253. package/lib/Util/createStyle.d.ts +5 -0
  254. package/lib/Util/createStyle.js +20 -0
  255. package/lib/Util/sleep.d.ts +1 -0
  256. package/lib/Util/sleep.js +5 -0
  257. package/lib/Util/type.js +1 -0
  258. package/{dist/_util → lib/Util}/warning.d.ts +2 -2
  259. package/lib/Voice/Recorder.d.ts +1 -0
  260. package/lib/Voice/Recorder.js +6 -0
  261. package/lib/Voice/index.d.ts +0 -0
  262. package/lib/Voice/index.js +0 -0
  263. package/lib/Welcome/index.d.ts +24 -0
  264. package/lib/Welcome/index.js +39 -0
  265. package/lib/index.d.ts +25 -0
  266. package/lib/index.js +24 -0
  267. package/lib/index.less +0 -0
  268. package/package.json +27 -13
  269. package/dist/accordion/Accordion.d.ts +0 -22
  270. package/dist/accordion/BodyContent.js +0 -18
  271. package/dist/accordion/DeepThink.d.ts +0 -7
  272. package/dist/accordion/DeepThink.js +0 -35
  273. package/dist/accordion/index.d.ts +0 -2
  274. package/dist/accordion/index.less +0 -170
  275. package/dist/attachments/DropArea.d.ts +0 -8
  276. package/dist/attachments/FileList/AudioIcon.d.ts +0 -2
  277. package/dist/attachments/FileList/AudioIcon.js +0 -19
  278. package/dist/attachments/FileList/FileListCard.d.ts +0 -12
  279. package/dist/attachments/FileList/Progress.d.ts +0 -6
  280. package/dist/attachments/FileList/VideoIcon.d.ts +0 -2
  281. package/dist/attachments/FileList/VideoIcon.js +0 -19
  282. package/dist/attachments/FileList/index.d.ts +0 -16
  283. package/dist/attachments/PlaceholderUploader.d.ts +0 -17
  284. package/dist/attachments/SilentUploader.d.ts +0 -9
  285. package/dist/attachments/SilentUploader.js +0 -23
  286. package/dist/attachments/context.d.ts +0 -5
  287. package/dist/attachments/index.d.ts +0 -33
  288. package/dist/attachments/style/fileCard.d.ts +0 -4
  289. package/dist/attachments/style/fileCard.js +0 -124
  290. package/dist/attachments/style/index.d.ts +0 -10
  291. package/dist/attachments/style/index.js +0 -211
  292. package/dist/bubble/Bubble.d.ts +0 -11
  293. package/dist/bubble/BubbleList.d.ts +0 -15
  294. package/dist/bubble/BubbleList.js +0 -44
  295. package/dist/bubble/Spin.d.ts +0 -2
  296. package/dist/bubble/Spin.js +0 -18
  297. package/dist/bubble/interface.d.ts +0 -26
  298. package/dist/bubble/loading.js +0 -17
  299. package/dist/bubble/style/avatar.less +0 -40
  300. package/dist/bubble/style/content.d.ts +0 -4
  301. package/dist/bubble/style/content.js +0 -43
  302. package/dist/bubble/style/index.d.ts +0 -9
  303. package/dist/bubble/style/index.js +0 -53
  304. package/dist/bubble/style/list.less +0 -15
  305. package/dist/bubble/style/scrollToBottom.less +0 -174
  306. package/dist/chat-anywhere/Chat/index.less +0 -54
  307. package/dist/chat-anywhere/Header/index.d.ts +0 -3
  308. package/dist/chat-anywhere/Header/index.js +0 -32
  309. package/dist/chat-anywhere/Header/index.less +0 -24
  310. package/dist/chat-anywhere/Input/index.d.ts +0 -3
  311. package/dist/chat-anywhere/Input/index.less +0 -12
  312. package/dist/chat-anywhere/Layout/index.js +0 -73
  313. package/dist/chat-anywhere/Layout/index.less +0 -61
  314. package/dist/chat-anywhere/SessionList/index.d.ts +0 -5
  315. package/dist/chat-anywhere/SessionList/index.less +0 -52
  316. package/dist/chat-anywhere/hooks/ChatAnywhereProvider.d.ts +0 -43
  317. package/dist/chat-anywhere/hooks/types.d.ts +0 -57
  318. package/dist/conversations/Item.js +0 -96
  319. package/dist/conversations/hooks/useGroupable.d.ts +0 -9
  320. package/dist/conversations/index.d.ts +0 -62
  321. package/dist/conversations/interface.d.ts +0 -60
  322. package/dist/conversations/style/index.d.ts +0 -9
  323. package/dist/conversations/style/index.js +0 -80
  324. package/dist/default-cards/Count/index.d.ts +0 -3
  325. package/dist/default-cards/Count/index.js +0 -16
  326. package/dist/default-cards/Count/index.less +0 -19
  327. package/dist/default-cards/DeepThink/index.js +0 -11
  328. package/dist/default-cards/Files/index.d.ts +0 -2
  329. package/dist/default-cards/Files/index.js +0 -18
  330. package/dist/default-cards/Footer/index.js +0 -50
  331. package/dist/default-cards/Footer/index.less +0 -41
  332. package/dist/default-cards/Images/index.d.ts +0 -3
  333. package/dist/default-cards/Images/index.js +0 -33
  334. package/dist/default-cards/Images/index.less +0 -17
  335. package/dist/default-cards/Interrupted/index.js +0 -40
  336. package/dist/default-cards/Interrupted/index.less +0 -57
  337. package/dist/default-cards/Text/index.d.ts +0 -2
  338. package/dist/disclaimer/index.d.ts +0 -11
  339. package/dist/disclaimer/index.js +0 -26
  340. package/dist/docs/1896.async.js +0 -457
  341. package/dist/docs/2710.async.js +0 -62
  342. package/dist/docs/2863.async.js +0 -400
  343. package/dist/docs/3057.async.js +0 -46
  344. package/dist/docs/3364.async.js +0 -25
  345. package/dist/docs/404.html +0 -15
  346. package/dist/docs/4820.async.js +0 -1381
  347. package/dist/docs/5623.async.js +0 -60
  348. package/dist/docs/5757.async.js +0 -1
  349. package/dist/docs/5804.async.js +0 -271
  350. package/dist/docs/6198.async.js +0 -18
  351. package/dist/docs/6671.async.js +0 -137
  352. package/dist/docs/7195.async.js +0 -1
  353. package/dist/docs/7485.async.js +0 -29
  354. package/dist/docs/7931.async.js +0 -19
  355. package/dist/docs/7997.async.js +0 -5
  356. package/dist/docs/8156.async.js +0 -110
  357. package/dist/docs/8368.async.js +0 -2
  358. package/dist/docs/8480.async.js +0 -1449
  359. package/dist/docs/8618.async.js +0 -246
  360. package/dist/docs/9016.async.js +0 -32
  361. package/dist/docs/9016.chunk.css +0 -1
  362. package/dist/docs/9335.async.js +0 -11
  363. package/dist/docs/accordion__demos.async.js +0 -9
  364. package/dist/docs/attachments__demos.async.js +0 -1
  365. package/dist/docs/bubble__demos.async.js +0 -50
  366. package/dist/docs/components/accordion/index.html +0 -15
  367. package/dist/docs/components/accordion-cn/index.html +0 -15
  368. package/dist/docs/components/attachments/index.html +0 -15
  369. package/dist/docs/components/attachments-cn/index.html +0 -15
  370. package/dist/docs/components/bubble/index.html +0 -15
  371. package/dist/docs/components/bubble-cn/index.html +0 -15
  372. package/dist/docs/components/bubble-list/index.html +0 -15
  373. package/dist/docs/components/bubble-list-cn/index.html +0 -15
  374. package/dist/docs/components/conversations/index.html +0 -15
  375. package/dist/docs/components/conversations-cn/index.html +0 -15
  376. package/dist/docs/components/disclaimer/index.html +0 -15
  377. package/dist/docs/components/disclaimer-cn/index.html +0 -15
  378. package/dist/docs/components/footer/index.html +0 -15
  379. package/dist/docs/components/footer-cn/index.html +0 -15
  380. package/dist/docs/components/markdown/index.html +0 -15
  381. package/dist/docs/components/markdown-cn/index.html +0 -15
  382. package/dist/docs/components/sender/index.html +0 -15
  383. package/dist/docs/components/sender-cn/index.html +0 -15
  384. package/dist/docs/components/status/index.html +0 -15
  385. package/dist/docs/components/status-cn/index.html +0 -15
  386. package/dist/docs/components/welcome/index.html +0 -15
  387. package/dist/docs/components/welcome-cn/index.html +0 -15
  388. package/dist/docs/components__accordion__index.en-US.md.async.js +0 -6
  389. package/dist/docs/components__accordion__index.en-US.md.chunk.css +0 -1
  390. package/dist/docs/components__accordion__index.zh-CN.md.async.js +0 -6
  391. package/dist/docs/components__accordion__index.zh-CN.md.chunk.css +0 -1
  392. package/dist/docs/components__attachments__index.en-US.md.async.js +0 -1
  393. package/dist/docs/components__attachments__index.en-US.md.chunk.css +0 -1
  394. package/dist/docs/components__attachments__index.zh-CN.md.async.js +0 -1
  395. package/dist/docs/components__attachments__index.zh-CN.md.chunk.css +0 -1
  396. package/dist/docs/components__bubble-list__index.en-US.md.async.js +0 -2
  397. package/dist/docs/components__bubble-list__index.en-US.md.chunk.css +0 -1
  398. package/dist/docs/components__bubble-list__index.zh-CN.md.async.js +0 -2
  399. package/dist/docs/components__bubble-list__index.zh-CN.md.chunk.css +0 -1
  400. package/dist/docs/components__bubble__index.en-US.md.async.js +0 -1
  401. package/dist/docs/components__bubble__index.en-US.md.chunk.css +0 -1
  402. package/dist/docs/components__bubble__index.zh-CN.md.async.js +0 -1
  403. package/dist/docs/components__bubble__index.zh-CN.md.chunk.css +0 -1
  404. package/dist/docs/components__conversations__index.en-US.md.async.js +0 -2
  405. package/dist/docs/components__conversations__index.en-US.md.chunk.css +0 -1
  406. package/dist/docs/components__conversations__index.zh-CN.md.async.js +0 -1
  407. package/dist/docs/components__conversations__index.zh-CN.md.chunk.css +0 -1
  408. package/dist/docs/components__disclaimer__index.en-US.md.async.js +0 -1
  409. package/dist/docs/components__disclaimer__index.en-US.md.chunk.css +0 -1
  410. package/dist/docs/components__disclaimer__index.zh-CN.md.async.js +0 -1
  411. package/dist/docs/components__disclaimer__index.zh-CN.md.chunk.css +0 -1
  412. package/dist/docs/components__footer__index.en-US.md.async.js +0 -1
  413. package/dist/docs/components__footer__index.en-US.md.chunk.css +0 -1
  414. package/dist/docs/components__footer__index.zh-CN.md.async.js +0 -2
  415. package/dist/docs/components__footer__index.zh-CN.md.chunk.css +0 -1
  416. package/dist/docs/components__markdown__index.en-US.md.async.js +0 -1
  417. package/dist/docs/components__markdown__index.en-US.md.chunk.css +0 -1
  418. package/dist/docs/components__markdown__index.zh-CN.md.async.js +0 -1
  419. package/dist/docs/components__markdown__index.zh-CN.md.chunk.css +0 -1
  420. package/dist/docs/components__sender__index.en-US.md.async.js +0 -1
  421. package/dist/docs/components__sender__index.en-US.md.chunk.css +0 -1
  422. package/dist/docs/components__sender__index.zh-CN.md.async.js +0 -1
  423. package/dist/docs/components__sender__index.zh-CN.md.chunk.css +0 -1
  424. package/dist/docs/components__status__index.en-US.md.async.js +0 -1
  425. package/dist/docs/components__status__index.en-US.md.chunk.css +0 -1
  426. package/dist/docs/components__status__index.zh-CN.md.async.js +0 -2
  427. package/dist/docs/components__status__index.zh-CN.md.chunk.css +0 -1
  428. package/dist/docs/components__welcome__index.en-US.md.async.js +0 -2
  429. package/dist/docs/components__welcome__index.en-US.md.chunk.css +0 -1
  430. package/dist/docs/components__welcome__index.zh-CN.md.async.js +0 -2
  431. package/dist/docs/components__welcome__index.zh-CN.md.chunk.css +0 -1
  432. package/dist/docs/conversations__demos.async.js +0 -1
  433. package/dist/docs/demos.async.js +0 -47
  434. package/dist/docs/demos.chunk.css +0 -1
  435. package/dist/docs/disclaimer__demos.async.js +0 -1
  436. package/dist/docs/docs/development/ag-ui/index.html +0 -15
  437. package/dist/docs/docs/development/ag-ui-cn/index.html +0 -15
  438. package/dist/docs/docs/development/backend/index.html +0 -15
  439. package/dist/docs/docs/development/backend-cn/index.html +0 -15
  440. package/dist/docs/docs/development/cards/index.html +0 -15
  441. package/dist/docs/docs/development/cards-cn/index.html +0 -15
  442. package/dist/docs/docs/development/chatanywhere/index.html +0 -15
  443. package/dist/docs/docs/development/chatanywhere-api/index.html +0 -15
  444. package/dist/docs/docs/development/chatanywhere-api-cn/index.html +0 -15
  445. package/dist/docs/docs/development/chatanywhere-cn/index.html +0 -15
  446. package/dist/docs/docs/development/custom/index.html +0 -15
  447. package/dist/docs/docs/development/custom-cn/index.html +0 -15
  448. package/dist/docs/docs/development/overview/index.html +0 -15
  449. package/dist/docs/docs/development/overview-cn/index.html +0 -15
  450. package/dist/docs/docs/development/qwen/index.html +0 -15
  451. package/dist/docs/docs/development/qwen-cn/index.html +0 -15
  452. package/dist/docs/docs/templates/copilot/index.html +0 -15
  453. package/dist/docs/docs/templates/copilot-cn/index.html +0 -15
  454. package/dist/docs/docs/templates/native/index.html +0 -15
  455. package/dist/docs/docs/templates/native-cn/index.html +0 -15
  456. package/dist/docs/docs/templates/voice/index.html +0 -15
  457. package/dist/docs/docs/templates/voice-cn/index.html +0 -15
  458. package/dist/docs/docs__development__ag-ui.en-US.md.async.js +0 -210
  459. package/dist/docs/docs__development__ag-ui.en-US.md.chunk.css +0 -1
  460. package/dist/docs/docs__development__ag-ui.zh-CN.md.async.js +0 -210
  461. package/dist/docs/docs__development__ag-ui.zh-CN.md.chunk.css +0 -1
  462. package/dist/docs/docs__development__backend.en-US.md.async.js +0 -12
  463. package/dist/docs/docs__development__backend.en-US.md.chunk.css +0 -1
  464. package/dist/docs/docs__development__backend.zh-CN.md.async.js +0 -12
  465. package/dist/docs/docs__development__backend.zh-CN.md.chunk.css +0 -1
  466. package/dist/docs/docs__development__cards.en-US.md.async.js +0 -27
  467. package/dist/docs/docs__development__cards.en-US.md.chunk.css +0 -1
  468. package/dist/docs/docs__development__cards.zh-CN.md.async.js +0 -27
  469. package/dist/docs/docs__development__cards.zh-CN.md.chunk.css +0 -1
  470. package/dist/docs/docs__development__chatanywhere-api.en-US.md.async.js +0 -69
  471. package/dist/docs/docs__development__chatanywhere-api.en-US.md.chunk.css +0 -1
  472. package/dist/docs/docs__development__chatanywhere-api.zh-CN.md.async.js +0 -69
  473. package/dist/docs/docs__development__chatanywhere-api.zh-CN.md.chunk.css +0 -1
  474. package/dist/docs/docs__development__chatanywhere.en-US.md.async.js +0 -77
  475. package/dist/docs/docs__development__chatanywhere.en-US.md.chunk.css +0 -1
  476. package/dist/docs/docs__development__chatanywhere.zh-CN.md.async.js +0 -77
  477. package/dist/docs/docs__development__chatanywhere.zh-CN.md.chunk.css +0 -1
  478. package/dist/docs/docs__development__custom.en-US.md.async.js +0 -22
  479. package/dist/docs/docs__development__custom.en-US.md.chunk.css +0 -1
  480. package/dist/docs/docs__development__custom.zh-CN.md.async.js +0 -22
  481. package/dist/docs/docs__development__custom.zh-CN.md.chunk.css +0 -1
  482. package/dist/docs/docs__development__overview.en-US.md.async.js +0 -21
  483. package/dist/docs/docs__development__overview.en-US.md.chunk.css +0 -1
  484. package/dist/docs/docs__development__overview.zh-CN.md.async.js +0 -21
  485. package/dist/docs/docs__development__overview.zh-CN.md.chunk.css +0 -1
  486. package/dist/docs/docs__development__qwen.en-US.md.async.js +0 -25
  487. package/dist/docs/docs__development__qwen.en-US.md.chunk.css +0 -1
  488. package/dist/docs/docs__development__qwen.zh-CN.md.async.js +0 -25
  489. package/dist/docs/docs__development__qwen.zh-CN.md.chunk.css +0 -1
  490. package/dist/docs/docs__templates__copilot.en-US.md.async.js +0 -1
  491. package/dist/docs/docs__templates__copilot.en-US.md.chunk.css +0 -1
  492. package/dist/docs/docs__templates__copilot.zh-CN.md.async.js +0 -1
  493. package/dist/docs/docs__templates__copilot.zh-CN.md.chunk.css +0 -1
  494. package/dist/docs/docs__templates__native.en-US.md.async.js +0 -1
  495. package/dist/docs/docs__templates__native.en-US.md.chunk.css +0 -1
  496. package/dist/docs/docs__templates__native.zh-CN.md.async.js +0 -1
  497. package/dist/docs/docs__templates__native.zh-CN.md.chunk.css +0 -1
  498. package/dist/docs/docs__templates__voice.en-US.md.async.js +0 -20
  499. package/dist/docs/docs__templates__voice.en-US.md.chunk.css +0 -1
  500. package/dist/docs/docs__templates__voice.zh-CN.md.async.js +0 -1
  501. package/dist/docs/docs__templates__voice.zh-CN.md.chunk.css +0 -1
  502. package/dist/docs/dumi__pages__index__index.en-US.async.js +0 -1
  503. package/dist/docs/dumi__pages__index__index.en-US.chunk.css +0 -1
  504. package/dist/docs/dumi__pages__index__index.zh-CN.async.js +0 -1
  505. package/dist/docs/dumi__pages__index__index.zh-CN.chunk.css +0 -1
  506. package/dist/docs/dumi__theme__layouts__DocLayout__index.async.js +0 -1
  507. package/dist/docs/dumi__theme__layouts__DocLayout__index.chunk.css +0 -1
  508. package/dist/docs/dumi__theme__layouts__GlobalLayout__index.async.js +0 -18
  509. package/dist/docs/dumi__theme__layouts__GlobalLayout__index.chunk.css +0 -1
  510. package/dist/docs/dumi__tmp-production__dumi__theme__ContextWrapper.async.js +0 -1
  511. package/dist/docs/index/index.html +0 -15
  512. package/dist/docs/index-cn/index.html +0 -15
  513. package/dist/docs/markdown__demos.async.js +0 -164
  514. package/dist/docs/meta__components__en-US.async.js +0 -9
  515. package/dist/docs/meta__components__zh-CN.async.js +0 -10
  516. package/dist/docs/meta__docs__en-US.async.js +0 -475
  517. package/dist/docs/meta__docs__en-US.chunk.css +0 -1
  518. package/dist/docs/meta__docs__zh-CN.async.js +0 -456
  519. package/dist/docs/meta__docs__zh-CN.chunk.css +0 -1
  520. package/dist/docs/nm__dumi__dist__client__pages__404.async.js +0 -1
  521. package/dist/docs/nm__dumi__dist__client__pages__Demo__index.async.js +0 -1
  522. package/dist/docs/nm__dumi__dist__client__pages__Demo__index.chunk.css +0 -1
  523. package/dist/docs/preload_helper.js +0 -1
  524. package/dist/docs/sender__demos.async.js +0 -1
  525. package/dist/docs/umi.css +0 -1
  526. package/dist/docs/umi.js +0 -107
  527. package/dist/docs/welcome__demos.async.js +0 -1
  528. package/dist/docs/~demos/:id/index.html +0 -15
  529. package/dist/docs/~demos/accordion-demo-inline/index.html +0 -15
  530. package/dist/docs/~demos/accordion-demo-mutisteps/index.html +0 -15
  531. package/dist/docs/~demos/accordion-demo-thinking/index.html +0 -15
  532. package/dist/docs/~demos/attachments-demo-files/index.html +0 -15
  533. package/dist/docs/~demos/bubble-demo-basic/index.html +0 -15
  534. package/dist/docs/~demos/bubble-demo-havestopped/index.html +0 -15
  535. package/dist/docs/~demos/bubble-demo-userwithfile/index.html +0 -15
  536. package/dist/docs/~demos/bubble-demo-userwithimage/index.html +0 -15
  537. package/dist/docs/~demos/bubble-demo-userwithnormal/index.html +0 -15
  538. package/dist/docs/~demos/bubble-demo-withavatar/index.html +0 -15
  539. package/dist/docs/~demos/bubble-demo-withcode/index.html +0 -15
  540. package/dist/docs/~demos/bubble-demo-witherror/index.html +0 -15
  541. package/dist/docs/~demos/bubble-demo-witherrordetail/index.html +0 -15
  542. package/dist/docs/~demos/bubble-demo-withimage/index.html +0 -15
  543. package/dist/docs/~demos/bubble-demo-withusage/index.html +0 -15
  544. package/dist/docs/~demos/bubble-demo-withwaitingmessage/index.html +0 -15
  545. package/dist/docs/~demos/components-bubble-list-demo-basic/index.html +0 -15
  546. package/dist/docs/~demos/components-footer-demo-basic/index.html +0 -15
  547. package/dist/docs/~demos/components-footer-demo-withusage/index.html +0 -15
  548. package/dist/docs/~demos/components-status-demo-basic/index.html +0 -15
  549. package/dist/docs/~demos/conversations-demo-basic/index.html +0 -15
  550. package/dist/docs/~demos/disclaimer-demo-demo/index.html +0 -15
  551. package/dist/docs/~demos/disclaimer-demo-withlink/index.html +0 -15
  552. package/dist/docs/~demos/docs-development-ag-ui-demo-with-copilotkit/index.html +0 -15
  553. package/dist/docs/~demos/docs-development-cards-demo-file/index.html +0 -15
  554. package/dist/docs/~demos/docs-development-cards-demo-footer/index.html +0 -15
  555. package/dist/docs/~demos/docs-development-cards-demo-image/index.html +0 -15
  556. package/dist/docs/~demos/docs-development-cards-demo-text/index.html +0 -15
  557. package/dist/docs/~demos/docs-development-custom-demo-custom/index.html +0 -15
  558. package/dist/docs/~demos/docs-templates-copilot-demo-copilot/index.html +0 -15
  559. package/dist/docs/~demos/docs-templates-native-demo-basic/index.html +0 -15
  560. package/dist/docs/~demos/docs-templates-voice-demo-demo/index.html +0 -15
  561. package/dist/docs/~demos/markdown-demo-citations/index.html +0 -15
  562. package/dist/docs/~demos/markdown-demo-cursor/index.html +0 -15
  563. package/dist/docs/~demos/markdown-demo-mathjax/index.html +0 -15
  564. package/dist/docs/~demos/markdown-demo-md/index.html +0 -15
  565. package/dist/docs/~demos/sender-demo-basic/index.html +0 -15
  566. package/dist/docs/~demos/sender-demo-disabled/index.html +0 -15
  567. package/dist/docs/~demos/sender-demo-loading/index.html +0 -15
  568. package/dist/docs/~demos/sender-demo-moreprefixaction/index.html +0 -15
  569. package/dist/docs/~demos/sender-demo-withfile/index.html +0 -15
  570. package/dist/docs/~demos/welcome-demo-demo0/index.html +0 -15
  571. package/dist/docs/~demos/welcome-demo-demo1/index.html +0 -15
  572. package/dist/docs/~demos/welcome-demo-demo2/index.html +0 -15
  573. package/dist/index.d.ts +0 -26
  574. package/dist/index.js +0 -20
  575. package/dist/index.less +0 -1
  576. package/dist/markdown/ImageOrVideo.d.ts +0 -2
  577. package/dist/markdown/ImageOrVideo.js +0 -81
  578. package/dist/markdown/Link.js +0 -28
  579. package/dist/markdown/cursor/Blur.d.ts +0 -3
  580. package/dist/markdown/cursor/Blur.js +0 -7
  581. package/dist/markdown/cursor/Dot.d.ts +0 -3
  582. package/dist/markdown/cursor/Dot.js +0 -16
  583. package/dist/markdown/cursor/Underline.d.ts +0 -3
  584. package/dist/markdown/cursor/Underline.js +0 -7
  585. package/dist/markdown/cursor/index.less +0 -124
  586. package/dist/markdown/hooks/index.d.ts +0 -1
  587. package/dist/markdown/hooks/index.js +0 -49
  588. package/dist/markdown/index.d.ts +0 -16
  589. package/dist/markdown/index.js +0 -37
  590. package/dist/markdown/index.less +0 -204
  591. package/dist/markdown/type.d.ts +0 -46
  592. package/dist/provider/types.d.ts +0 -8
  593. package/dist/sender/SenderHeader.d.ts +0 -19
  594. package/dist/sender/StopLoading.js +0 -20
  595. package/dist/sender/components/ActionButton.d.ts +0 -22
  596. package/dist/sender/components/ClearButton.js +0 -13
  597. package/dist/sender/components/LoadingButton.js +0 -22
  598. package/dist/sender/components/SendButton.js +0 -14
  599. package/dist/sender/components/SpeechButton/RecordingIcon.d.ts +0 -5
  600. package/dist/sender/components/SpeechButton/RecordingIcon.js +0 -49
  601. package/dist/sender/components/SpeechButton/index.js +0 -30
  602. package/dist/sender/index.d.ts +0 -61
  603. package/dist/sender/style/header.d.ts +0 -4
  604. package/dist/sender/style/header.js +0 -46
  605. package/dist/sender/style/index.d.ts +0 -10
  606. package/dist/sender/style/index.js +0 -123
  607. package/dist/stream/index.en-US.md.bk +0 -50
  608. package/dist/stream/index.zh-CN.md.bk +0 -51
  609. package/dist/theme/components.d.ts +0 -10
  610. package/dist/theme/cssinjs-utils.d.ts +0 -14
  611. package/dist/theme/genStyleUtils.d.ts +0 -28
  612. package/dist/theme/useToken.d.ts +0 -18
  613. package/dist/theme/useToken.js +0 -110
  614. package/dist/voice-chat/Recorder/index.d.ts +0 -26
  615. package/dist/voice-chat/VoiceChatProvider/context.d.ts +0 -22
  616. package/dist/voice-chat/VoiceChatProvider/context.js +0 -3
  617. package/dist/voice-chat/VoiceChatProvider/hooks/useChatState.d.ts +0 -1
  618. package/dist/voice-chat/VoiceChatProvider/hooks/useChatState.js +0 -5
  619. package/dist/voice-chat/VoiceChatProvider/hooks/useMessages.d.ts +0 -8
  620. package/dist/voice-chat/VoiceChatProvider/hooks/useMessages.js +0 -31
  621. package/dist/voice-chat/VoiceChatProvider/hooks/useRecorder.d.ts +0 -5
  622. package/dist/voice-chat/VoiceChatProvider/hooks/useRecorder.js +0 -48
  623. package/dist/voice-chat/VoiceChatProvider/hooks/useVoiceChat.d.ts +0 -4
  624. package/dist/voice-chat/VoiceChatProvider/hooks/useVoiceChat.js +0 -10
  625. package/dist/voice-chat/VoiceChatProvider/index.d.ts +0 -9
  626. package/dist/voice-chat/VoiceChatProvider/index.js +0 -55
  627. package/dist/voice-chat/VoiceChatService/index.d.ts +0 -34
  628. package/dist/voice-chat/index.d.ts +0 -2
  629. package/dist/voice-chat/index.js +0 -2
  630. package/dist/voice-chat/types/index.d.ts +0 -12
  631. package/dist/voice-chat/types/index.js +0 -4
  632. package/dist/welcome/icon.d.ts +0 -2
  633. package/dist/welcome/icon.js +0 -38
  634. package/dist/welcome/index.d.ts +0 -9
  635. package/dist/welcome/index.js +0 -57
  636. /package/{dist/_util/type.js → lib/AGUI/components/chat/props.js} +0 -0
  637. /package/{dist/bubble/interface.js → lib/AGUI/context/index.js} +0 -0
  638. /package/{dist/bubble/hooks/useDisplayData.d.ts → lib/AGUI/styles.css} +0 -0
  639. /package/{dist/bubble/hooks/useDisplayData.js → lib/AGUI/types/css.d.ts} +0 -0
  640. /package/{dist/bubble/hooks/useListData.d.ts → lib/AGUI/types/css.js} +0 -0
  641. /package/{dist/chat-anywhere/hooks/types.js → lib/AGUI/types/index.js} +0 -0
  642. /package/{dist/conversations/interface.js → lib/AGUI/types/suggestions.js} +0 -0
  643. /package/{dist/accordion → lib/Accordion}/index.js +0 -0
  644. /package/{dist/attachments → lib/Attachments}/context.js +0 -0
  645. /package/{dist/attachments → lib/Attachments}/util.d.ts +0 -0
  646. /package/{dist/attachments → lib/Attachments}/util.js +0 -0
  647. /package/{dist/bubble/hooks/useListData.js → lib/Bubble/hooks/useDisplayData.d.ts} +0 -0
  648. /package/{dist/default-cards/DeepThink/index.less → lib/Bubble/hooks/useDisplayData.js} +0 -0
  649. /package/{dist/bubble → lib/Bubble}/index.d.ts +0 -0
  650. /package/{dist/bubble → lib/Bubble}/index.js +0 -0
  651. /package/{dist/markdown/type.js → lib/Bubble/interface.js} +0 -0
  652. /package/{dist/bubble → lib/Bubble}/loading.d.ts +0 -0
  653. /package/{dist/chat-anywhere → lib/ChatAnywhere}/Chat/Ref.d.ts +0 -0
  654. /package/{dist/chat-anywhere → lib/ChatAnywhere}/Chat/Ref.js +0 -0
  655. /package/{dist/provider → lib/ChatAnywhere/hooks}/types.js +0 -0
  656. /package/{dist/chat-anywhere → lib/ChatAnywhere}/hooks/useInput.d.ts +0 -0
  657. /package/{dist/chat-anywhere → lib/ChatAnywhere}/hooks/useInput.js +0 -0
  658. /package/{dist/chat-anywhere → lib/ChatAnywhere}/hooks/useSessionList.d.ts +0 -0
  659. /package/{dist/chat-anywhere → lib/ChatAnywhere}/hooks/useSessionList.js +0 -0
  660. /package/{dist/conversations → lib/Conversations}/hooks/useGroupable.js +0 -0
  661. /package/{dist/theme/components.js → lib/Conversations/interface.js} +0 -0
  662. /package/{dist/markdown → lib/Markdown}/Citation.d.ts +0 -0
  663. /package/{dist/markdown → lib/Markdown}/Link.d.ts +0 -0
  664. /package/{dist/markdown → lib/Markdown}/Markdown.d.ts +0 -0
  665. /package/{dist/markdown → lib/Markdown}/hooks/useTypedEffect.d.ts +0 -0
  666. /package/{dist/markdown → lib/Markdown}/plugins/footnote.d.ts +0 -0
  667. /package/{dist/markdown → lib/Markdown}/plugins/footnote.js +0 -0
  668. /package/{dist/markdown → lib/Markdown}/plugins/katexDir.d.ts +0 -0
  669. /package/{dist/markdown → lib/Markdown}/plugins/katexDir.js +0 -0
  670. /package/{dist/markdown → lib/Markdown}/rehype/fadeIn.d.ts +0 -0
  671. /package/{dist/markdown → lib/Markdown}/rehype/fadeIn.js +0 -0
  672. /package/{dist/theme/cssinjs-utils.js → lib/Markdown/type.js} +0 -0
  673. /package/{dist/markdown → lib/Markdown}/utils.d.ts +0 -0
  674. /package/{dist/sender → lib/Sender}/components/ClearButton.d.ts +0 -0
  675. /package/{dist/sender → lib/Sender}/components/LoadingButton.d.ts +0 -0
  676. /package/{dist/sender → lib/Sender}/components/SendButton.d.ts +0 -0
  677. /package/{dist/sender → lib/Sender}/components/SpeechButton/index.d.ts +0 -0
  678. /package/{dist/sender → lib/Sender}/useSpeech.d.ts +0 -0
  679. /package/{dist/sender → lib/Sender}/useSpeech.js +0 -0
  680. /package/{dist/_util → lib/Util}/hooks/use-proxy-imperative-handle.d.ts +0 -0
  681. /package/{dist/_util → lib/Util}/hooks/use-proxy-imperative-handle.js +0 -0
  682. /package/{dist/_util → lib/Util}/type.d.ts +0 -0
  683. /package/{dist/_util → lib/Util}/warning.js +0 -0
  684. /package/{dist/version → lib/Version}/index.d.ts +0 -0
  685. /package/{dist/version → lib/Version}/index.js +0 -0
@@ -1,1449 +0,0 @@
1
- "use strict";(self.webpackChunk_agentscope_ai_chat=self.webpackChunk_agentscope_ai_chat||[]).push([[8480],{93006:function(e,n){n.Z=`import { ChatAnywhere, ChatAnywhereRef, uuid, Stream, TMessage, createCard, DefaultCards, Welcome } from '@ali/spark-chat';
2
- import { UploadFile, Button } from 'antd';
3
- import React, { useCallback, useEffect, useRef } from 'react';
4
-
5
- export default function Demo() {
6
- const ref = useRef<ChatAnywhereRef>();
7
-
8
- // @ts-ignore
9
- window.ref = ref;
10
-
11
- const onInput = useCallback(async (data: { query: string; fileList?: UploadFile<any>[] }) => {
12
- const query = data.query;
13
-
14
- ref.current.updateMessage({
15
- id: uuid(),
16
- cards: [{
17
- code: 'Text',
18
- data: {
19
- content: query
20
- }
21
- }],
22
- role: 'user',
23
- msgStatus: 'finished',
24
- });
25
-
26
-
27
- setTimeout(() => {
28
- ref.current.updateMessage({
29
- id: uuid(),
30
- cards: [{
31
- code: 'Text',
32
- data: {
33
- content: \`answer for: \${query}\`,
34
- }
35
- }],
36
- role: 'assistant',
37
- msgStatus: 'finished',
38
- });
39
-
40
- }, 1000);
41
-
42
- }, []);
43
-
44
- const onStop = useCallback(async () => {
45
- }, []);
46
-
47
-
48
- return <ChatAnywhere
49
- ref={ref}
50
- cardConfig={{
51
- Welcome: () => <h1>\u81EA\u5B9A\u4E49\u6B22\u8FCE\u5361\u7247</h1>
52
- }}
53
- uiConfig={{
54
- quickInput: <>
55
- <Button size="small" onClick={() => {
56
- ref.current.updateMessage({
57
- id: uuid(),
58
- cards: [{
59
- code: 'Text',
60
- data: {
61
- content: \`some text\`,
62
- }
63
- }],
64
- role: 'assistant',
65
- msgStatus: 'finished',
66
- });
67
- }}>text</Button>
68
- <Button size="small" onClick={() => {
69
- ref.current.updateMessage({
70
- id: uuid(),
71
- cards: [
72
- {
73
- code: 'Text',
74
- data: {
75
- content: 'what is citypop'
76
- },
77
-
78
- },
79
- {
80
- code: 'Images',
81
- data: [
82
- { url: 'https://gw.alicdn.com/imgextra/i4/O1CN01sjZ4Uu1erFDOC6IkA_!!6000000003924-2-tps-396-224.png', },
83
- ],
84
- }
85
- ],
86
- role: 'user',
87
- msgStatus: 'finished',
88
- });
89
- }}>text with image</Button>
90
- <Button size="small" onClick={() => {
91
- ref.current.updateMessage({
92
- id: uuid(),
93
- cards: [
94
- {
95
- code: 'Text',
96
- data: {
97
- content: 'what is citypop'
98
- },
99
-
100
- },
101
- {
102
- code: 'Files',
103
- data: [
104
- { filename: 'citypop.pdf', bytes: 1024 },
105
- { filename: 'citypop.pdf', bytes: 2048 },
106
- ],
107
- }
108
- ],
109
- role: 'user',
110
- msgStatus: 'finished',
111
- });
112
- }}>text with file</Button>
113
- <Button size="small" onClick={() => {
114
- ref.current.updateMessage({
115
- id: uuid(),
116
- cards: [
117
- {
118
- code: 'Welcome',
119
- data: {},
120
- },
121
- ],
122
- role: 'assistant',
123
- msgStatus: 'finished',
124
- });
125
- }}>custom card a</Button>
126
- <Button size="small">custom card b</Button>
127
- </>,
128
- disclaimer: 'AI can also make mistakes, so please check carefully and use it with caution',
129
- narrowScreen: true,
130
- }}
131
- onInput={{
132
- onSubmit: onInput,
133
- }}
134
- onStop={onStop}
135
- ></ChatAnywhere>;
136
-
137
- }`},70822:function(e,n){n.Z=`import React from 'react';
138
- import { createStyles } from 'antd-style';
139
- import Chat from './Chat';
140
-
141
- const useStyles = createStyles(({ css, token }) => ({
142
- container: css\`
143
- display: flex;
144
- height: 100vh;
145
- \`,
146
-
147
- iframe: css\`
148
- flex: 5;
149
- height: 100%;
150
- border: none;
151
- display: block;
152
- \`,
153
-
154
- chat: css\`
155
- flex: 3;
156
- height: 100%;
157
- border-left: 1px solid \${token.colorBorderSecondary};
158
- \`,
159
-
160
-
161
- }));
162
-
163
- export default function () {
164
- const { styles } = useStyles();
165
-
166
- return <div className={styles.container}>
167
- <iframe className={styles.iframe} src="https://market.m.taobao.com/app/liveme-console/agentscope-portal/index.html" />
168
- <div className={styles.chat}>
169
- <Chat />
170
- </div>
171
- </div>;
172
-
173
- }`},18135:function(e,n){n.Z=`import { ChatAnywhere, ChatAnywhereRef, uuid, Stream, TMessage, createCard, DefaultCards, Welcome, useChatAnywhere } from '@ali/spark-chat';
174
- import React, { useCallback, useEffect, useRef, useState } from 'react';
175
- import { Card, Flex, Statistic, UploadFile, Input } from 'antd';
176
- import { CopyOutlined, GlobalOutlined, PaperClipOutlined, RedoOutlined } from '@ant-design/icons';
177
- import Header from '../Header';
178
- import sessionLocalStorage from '../sessionLocalStorage';
179
- import compact from 'lodash/compact'
180
- import { Button } from '@spark-ai/design';
181
- import ReactDOM from 'react-dom';
182
- import { useMount } from 'ahooks';
183
- import { useDemoContext } from '../DemoContext';
184
-
185
- export default function () {
186
- const ref = useRef<ChatAnywhereRef>();
187
- const { demoContext, getDemoContext, setDemoContext } = useDemoContext();
188
- // @ts-ignore
189
- window.ref = ref;
190
-
191
- const currentQA = useRef<{
192
- query?: TMessage,
193
- answer?: TMessage,
194
- abortController?: AbortController;
195
- }>({});
196
-
197
-
198
- useMount(() => {
199
- ref.current.updateSession(
200
- sessionLocalStorage.get()
201
- );
202
- })
203
-
204
-
205
- const onFinish = useCallback((status: 'finished' | 'interrupted' = 'finished', usage?: any) => {
206
- currentQA.current.answer.msgStatus = status;
207
- currentQA.current.answer.cards = currentQA.current.answer.cards.map(item => {
208
- if (item.code === 'Text') {
209
- return createCard('Text', {
210
- ...item.data,
211
- msgStatus: status,
212
- });
213
- } else if (item.code === 'DeepThink') {
214
- return createCard('DeepThink', {
215
- ...item.data,
216
- loading: false,
217
- });
218
- } else {
219
- return item;
220
- }
221
- });
222
-
223
- if (status === 'interrupted') {
224
- currentQA.current.answer.cards.push(
225
- createCard('Interrupted', {})
226
- );
227
- }
228
-
229
- currentQA.current.answer.cards.push(
230
- createCard('Footer', {
231
- left: <DefaultCards.FooterActions data={[
232
- {
233
- icon: <RedoOutlined />, label: '\u91CD\u65B0\u751F\u6210', onClick: () => {
234
- onRegenerate(currentQA.current.answer);
235
- }
236
- },
237
- ]} />,
238
- right: usage ? <DefaultCards.FooterCount data={[['\u8F93\u5165tokens', usage.prompt_tokens], ['\u8F93\u51FAtokens', usage.completion_tokens]]} ></DefaultCards.FooterCount> : null
239
-
240
- })
241
- )
242
- ref.current.setLoading(false);
243
- ReactDOM.flushSync(() => {
244
- ref.current.updateMessage(currentQA.current.answer);
245
- });
246
-
247
- saveToLocalStorage();
248
- }, [demoContext]);
249
-
250
- const saveToLocalStorage = useCallback(async () => {
251
- // \u5C06\u5F53\u524D\u7684\u6D88\u606F\u5217\u8868\u540C\u6B65\u5230\u5F53\u524D session \u4E2D
252
- ReactDOM.flushSync(() => {
253
- ref.current.updateSessionMessages(ref.current.getMessages());
254
- });
255
-
256
- sessionLocalStorage.set(ref.current.getSession());
257
- }, [demoContext]);
258
-
259
- const chat = useCallback(async (messages: TMessage[]) => {
260
-
261
- currentQA.current.answer = {
262
- id: uuid(),
263
- cards: [],
264
- content: '',
265
- role: 'assistant',
266
- msgStatus: 'generating',
267
- }
268
-
269
- ref.current.updateMessage(currentQA.current.answer);
270
-
271
- currentQA.current.abortController = new AbortController();
272
-
273
- const requestMessages = messages.map(msg => {
274
- return {
275
- ...msg,
276
- content: msg.content || (msg.cards || []).reduce((p, c) => { return p + (c.code === 'Text' ? c.data.content : '') }, '')
277
- };
278
- });
279
-
280
-
281
- const response = await fetch('https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions', {
282
- method: 'POST',
283
- headers: {
284
- 'Content-Type': 'application/json',
285
- 'Authorization': \`Bearer sk-9c2fde3cee7d4edb8825d18f4f0fc0a9\`
286
- },
287
- body: JSON.stringify({
288
- model: getDemoContext().model,
289
- enable_thinking: getDemoContext().enable_thinking,
290
- messages: requestMessages,
291
- stream: true,
292
- stream_options: {
293
- include_usage: true,
294
-
295
- },
296
- }),
297
- signal: currentQA.current.abortController.signal
298
- });
299
-
300
-
301
- if (response.status !== 200) {
302
-
303
-
304
- return
305
- }
306
-
307
-
308
- let content = '';
309
- let reasoning_content = '';
310
- for await (const chunk of Stream({
311
- readableStream: response.body,
312
- }, {
313
- openaiCompatible: true,
314
- })) {
315
-
316
- if (currentQA.current.answer.msgStatus === 'interrupted') {
317
- debugger;
318
- currentQA.current.abortController.abort();
319
- break;
320
- }
321
-
322
- if (chunk.data === '[DONE]') {
323
- onFinish('finished')
324
- break;
325
- }
326
-
327
- const data = JSON.parse(chunk.data);
328
- if (data.usage) {
329
- onFinish('finished', data.usage);
330
- break;
331
- }
332
-
333
- content += data.choices[0]?.delta.content || '';
334
- reasoning_content += data.choices[0]?.delta.reasoning_content || '';
335
-
336
- currentQA.current.answer.cards = compact([
337
- reasoning_content && createCard('DeepThink', {
338
- content: reasoning_content,
339
- loading: !content,
340
- }),
341
- content && createCard('Text', {
342
- content: content,
343
- typing: true,
344
- msgStatus: 'generating'
345
- })
346
- ])
347
-
348
-
349
- ref.current.updateMessage(currentQA.current.answer);
350
- }
351
- }, [demoContext]);
352
-
353
- const onInput = useCallback(async (data: { query: string; fileList?: UploadFile[][] }) => {
354
- if (!getDemoContext().apikey) {
355
- document.dispatchEvent(new CustomEvent('settingOpen'));
356
- return;
357
- }
358
-
359
- clearFooter();
360
- currentQA.current.answer = undefined;
361
- currentQA.current.query = {
362
- id: uuid(),
363
- cards: [],
364
- content: data.query,
365
- role: 'user',
366
- msgStatus: 'finished',
367
- };
368
-
369
- if (data.fileList?.length) {
370
- const images = [];
371
- const files = [];
372
- // @ts-ignore
373
- const allFileList = data.fileList.reduce((p, c) => [...p, ...c], [])
374
- allFileList.forEach(file => {
375
- if (file.type.startsWith('image')) {
376
- images.push(file)
377
- } else {
378
- files.push(file)
379
- }
380
- })
381
-
382
- if (images.length) {
383
- currentQA.current.query.cards.push(createCard('Images', images.map(item => {
384
- return item.response
385
- })))
386
- }
387
-
388
- if (files.length) {
389
- currentQA.current.query.cards.push(
390
- createCard('Files', files.map(item => {
391
- return {
392
- filename: item.name,
393
- bytes: item.size
394
- }
395
- }))
396
- )
397
- }
398
- }
399
-
400
- ref.current.setLoading(true);
401
-
402
-
403
- ReactDOM.flushSync(() => {
404
- ref.current.updateMessage(currentQA.current.query);
405
- });
406
-
407
- ref.current.scrollToBottom();
408
- chat(ref.current.getMessages());
409
- }, [demoContext]);
410
-
411
- const onStop = useCallback(() => {
412
- onFinish('interrupted');
413
- }, [demoContext]);
414
-
415
- const clearFooter = useCallback(() => {
416
- try {
417
- currentQA.current.answer.cards = currentQA.current.answer.cards.filter(item => item.code !== 'Footer');
418
- ref.current.updateMessage(currentQA.current.answer);
419
- } catch (error) {
420
- }
421
- }, [demoContext]);
422
-
423
- const onRegenerate = useCallback((msg: Partial<TMessage>) => {
424
- ReactDOM.flushSync(() => {
425
- ref.current.removeMessage(msg);
426
- });
427
- const messages = ref.current.getMessages();
428
- chat(messages);
429
- }, [demoContext]);
430
-
431
- const enable_thinking = demoContext.enable_thinking;
432
-
433
- return <div style={{ height: '100vh' }}>
434
- <ChatAnywhere
435
- cardConfig={{ MyCard }}
436
- uiConfig={{
437
- welcome: <Welcome
438
- style={{ marginTop: '35vh' }}
439
- title="Nice to meet you!"
440
- desc={"How can I help you today?"}
441
- />,
442
- disclaimer: 'AI can also make mistakes, so please check and use it carefully',
443
- header: <Header />,
444
- logo: <div style={{ fontFamily: 'Montserrat', fontWeight: 'bold' }}>Spark Chat</div>,
445
- quickInput: <>
446
- <Button size="small" onClick={() => {
447
- ReactDOM.flushSync(() => {
448
- ref.current.updateMessage({
449
- id: uuid(),
450
- cards: [
451
- {
452
- code: 'MyCard',
453
- data: [
454
- ['MyCard', 10000]
455
- ],
456
- },
457
- ],
458
- role: 'assistant',
459
- msgStatus: 'finished',
460
- })
461
-
462
- })
463
- ref.current.scrollToBottom();
464
- }}>quickInput</Button>
465
- <Button size="small">test case A</Button>
466
- <Button size="small">test case B</Button>
467
- </>
468
- }}
469
- ref={ref}
470
- onInput={{
471
- morePrefixActions: <>
472
- {
473
- enable_thinking !== undefined ?
474
- <Button type="text" color={enable_thinking ? 'primary' : 'default'} variant={enable_thinking ? 'filled' : 'text'} icon={<GlobalOutlined />} style={{ padding: '0 6px', gap: 6 }} onClick={() => setDemoContext({ enable_thinking: !enable_thinking })}>DeepThink</Button>
475
- : null
476
- }
477
- </>,
478
- onSubmit: onInput,
479
- maxLength: 100000,
480
- beforeSubmit: () => Promise.resolve(true),
481
- zoomable: true,
482
- }}
483
- onStop={onStop}
484
- onRegenerate={onRegenerate}
485
- onSessionKeyChange={(currentSessionKey) => {
486
- currentQA.current.answer = undefined;
487
- currentQA.current.query = undefined;
488
- sessionLocalStorage.set({ currentSessionKey });
489
- }}
490
- onUpload={[{
491
- multiple: false,
492
- icon: <PaperClipOutlined />,
493
- customRequest(options) {
494
- options.onSuccess({
495
- url: URL.createObjectURL(options.file as Blob)
496
- });
497
- }
498
- }, {
499
- multiple: false,
500
- icon: <CopyOutlined />,
501
- customRequest(options) {
502
- options.onError(new Error('\u4E0A\u4F20\u5931\u8D25'));
503
- }
504
- }]}
505
- ></ChatAnywhere>
506
- </div>
507
- }
508
-
509
-
510
- function MyCard(props) {
511
- const onInput = useChatAnywhere(v => v.onInput);
512
-
513
- const [v, sv] = useState('');
514
- return <Card title="my card" size="small">
515
- <Flex gap={32}>
516
- {props.data.map((item) => {
517
- return <Statistic title={item[0]} value={item[1]} key={item[0]} />
518
- })}
519
- </Flex>
520
- <br />
521
- <Flex gap={8}>
522
- <Input placeholder="\u8BF7\u8F93\u5165" onChange={e => sv(e.target.value)} /> <Button onClick={() => {
523
- onInput.onSubmit({ query: v });
524
- }}>\u63D0\u4EA4</Button>
525
- </Flex>
526
- </Card>;
527
- }`},97763:function(e,n){n.Z=`import { useSetState } from 'ahooks';
528
- import { SetState } from 'ahooks/lib/useSetState';
529
- import React, { useState } from 'react';
530
- import { useGetState } from 'ahooks';
531
-
532
- type TContext = {
533
- model: string
534
- apikey: string
535
- theme: 'purple' | 'carbon' | string
536
- enable_thinking?: boolean;
537
- }
538
-
539
- export const DemoContext = React.createContext<{
540
- demoContext: TContext,
541
- setDemoContext: SetState<TContext>,
542
- getDemoContext: () => TContext
543
- }>(undefined);
544
-
545
- export const DemoContextProvider = function (props: { children: React.ReactNode }) {
546
- const [demoContext, setDemoContext, getDemoContext] = useGetState<TContext>({
547
- model: 'qwq-plus',
548
- apikey: localStorage.getItem('apikey') || '',
549
- theme: localStorage.getItem('theme') || 'carbon',
550
- enable_thinking: undefined,
551
- });
552
-
553
-
554
- return <DemoContext.Provider value={{
555
- demoContext, getDemoContext, setDemoContext: data => {
556
- return setDemoContext((state) => {
557
- const nextState = {
558
- ...state,
559
- ...data,
560
- }
561
-
562
- if (nextState.model === 'qwen3-32b' && nextState.enable_thinking === undefined) {
563
- nextState.enable_thinking = true
564
- }
565
-
566
- if (nextState.model !== 'qwen3-32b') {
567
- nextState.enable_thinking = undefined;
568
- }
569
-
570
- localStorage.setItem('apikey', nextState.apikey);
571
- localStorage.setItem('theme', nextState.theme);
572
- return nextState
573
- });
574
- }
575
- }}>
576
- {props.children}
577
- </DemoContext.Provider>
578
- };
579
-
580
-
581
- export const useDemoContext = function () {
582
- return React.useContext(DemoContext);
583
- };
584
-
585
-
586
- `},60097:function(e,n){n.Z=`import React from "react";
587
- // @ts-ignore
588
- import styles from './index.module.less';
589
- import { Dropdown, MenuProps, Space, Typography, Button } from 'antd';
590
- import { DownOutlined } from "@ant-design/icons";
591
- import { useDemoContext } from '../DemoContext';
592
-
593
- const items = [
594
- {
595
- key: 'qwen-turbo',
596
- label: <Model name="Qwen-Turbo" />
597
- },
598
- {
599
- key: 'qwen-max',
600
- label: <Model name="Qwen-Max" />
601
- },
602
- {
603
- key: 'qwq-plus',
604
- label: <Model name="Qwen-QwQ-Plus" />
605
- },
606
- {
607
- key: 'qwen3-32b',
608
- label: <Model name="Qwen3-32B" />
609
- },
610
- ];
611
-
612
- function Model(props: {
613
- name?: string;
614
- size?: number;
615
- arrow?: boolean
616
- }) {
617
- const { name = '', size = 12, arrow = false } = props;
618
- return <div className={styles.model}>
619
- <img src="https://img.alicdn.com/imgextra/i4/O1CN01SdyYTH1Kfz6skC36o_!!6000000001192-2-tps-96-96.png" className={styles.modelLogo} />
620
- <div className={styles.modelName} style={{ fontSize: size }} >{name}</div>
621
- {
622
- arrow && <DownOutlined />
623
- }
624
- </div>
625
- }
626
-
627
- export default function () {
628
- const { demoContext, setDemoContext } = useDemoContext();
629
-
630
- const current = items.find(item => item.key === demoContext.model);
631
-
632
- return <Dropdown
633
- menu={{
634
- items,
635
- selectable: true,
636
- onSelect: ({ key }) => {
637
- setDemoContext({
638
- model: key,
639
- });
640
- }
641
- }}
642
- >
643
- <Button type="text" style={{ padding: '0 6px' }}>
644
- {current?.label ? React.cloneElement(current.label, { size: 16, arrow: true }) : null}
645
- </Button>
646
- </Dropdown>
647
- }`},73381:function(e,n){n.Z=`import React, { useEffect, useState } from "react";
648
- import { Drawer, Button, Form, Input } from '@spark-ai/design';
649
- import { SettingOutlined } from "@ant-design/icons";
650
- import { ColorPicker, Flex, Radio, Switch, theme } from "antd";
651
- import { useDemoContext } from "../DemoContext";
652
- import { usePrefersColor } from "dumi";
653
-
654
-
655
- export default function () {
656
- const [form] = Form.useForm();
657
- const [open, setOpen] = useState(false);
658
- const { getDemoContext, setDemoContext } = useDemoContext();
659
- const [
660
- color,
661
- prefersColor,
662
- setPrefersColor,
663
- ] = usePrefersColor();
664
-
665
- useEffect(() => {
666
- const settingOpen = () => setOpen(true);
667
- document.addEventListener('settingOpen', settingOpen);
668
- return () => {
669
- document.removeEventListener('settingOpen', settingOpen);
670
- }
671
- }, [])
672
-
673
-
674
-
675
- return <>
676
- <Button type="text" icon={<SettingOutlined />} onClick={() => setOpen(true)}>
677
- </Button>
678
-
679
- <Drawer title="Setting"
680
-
681
- afterOpenChange={() => {
682
- form.setFieldsValue({
683
- apikey: getDemoContext().apikey,
684
- theme: getDemoContext().theme,
685
- darkMode: color === 'dark',
686
- })
687
- }}
688
-
689
- onClose={() => setOpen(false)} open={open} footer={<Button type="primary" onClick={async () => {
690
- const values = await form.validateFields();
691
- setPrefersColor(!!values.darkMode ? 'dark' : 'light');
692
- setDemoContext({
693
- apikey: values.apikey,
694
- theme: values.theme,
695
- })
696
- setOpen(false);
697
- }}>Save</Button>}>
698
- <Form
699
- form={form}
700
- >
701
- <Form.Item name="apikey" label="API Key" rules={[{ required: true }]}>
702
- <Input />
703
- </Form.Item>
704
-
705
-
706
- <Form.Item name="theme" label="Theme" rules={[{ required: true }]}>
707
- {/* @ts-ignore */}
708
- <ThemeInput />
709
- </Form.Item>
710
-
711
-
712
- <Form.Item name="darkMode" label="Dark Mode" rules={[{ required: true }]}>
713
- <Switch />
714
- </Form.Item>
715
- </Form>
716
- </Drawer>
717
- </>
718
- }
719
-
720
-
721
- function ThemeInput({ value, onChange }) {
722
- return <Flex gap={8} align="center">
723
- <Radio.Group options={[
724
- { label: 'Carbon', value: 'carbon' },
725
- { label: 'Purple', value: 'purple' },
726
- ]} value={value} onChange={e => onChange(e.target.value)} />
727
- <ColorPicker value={value} onChange={e => {
728
- return onChange(e.toCssString());
729
- }} /></Flex>
730
- }`},36416:function(e,n){n.Z=`@import '../../../../index.less';
731
-
732
- .header {
733
- height: 100%;
734
- display: flex;
735
- align-items: center;
736
- justify-content: space-between;
737
- padding: 0 12px 0 12px;
738
- width: 100%;
739
- }
740
-
741
- .model {
742
- height: 20px;
743
- display: flex;
744
- align-items: center;
745
- gap: 8px;
746
-
747
- :global {
748
- .anticon-down {
749
- transform: scaleY(0.75);
750
- }
751
- }
752
-
753
- .modelLogo {
754
- width: 20px;
755
- height: 20px;
756
- background-color: e('var(--@{ant-prefix}-color-bg-base)');
757
- border-radius: 6px;
758
- }
759
-
760
- .modelName {
761
- font-weight: 500;
762
- line-height: 20px;
763
- color: e('var(--@{ant-prefix}-color-text)');
764
- }
765
- }
766
- `},97626:function(e,n){n.Z=`import React from "react";
767
- // @ts-ignore
768
- import styles from './index.module.less';
769
- import ModelSelect from "./ModelSelect";
770
- import Setting from "./Setting";
771
-
772
- export default function () {
773
- return <div className={styles.header}>
774
- <ModelSelect />
775
- <div style={{ flex: 1 }} />
776
- <Setting />
777
- </div>
778
- }`},90013:function(e,n){n.Z=`import React from 'react';
779
- import { DemoContextProvider } from './DemoContext';
780
- import Chat from './Chat';
781
- import './index.less';
782
-
783
- export default function () {
784
- return <div style={{ height: '100vh' }} className='chat-anywhere-demo'>
785
- <DemoContextProvider>
786
- <Chat />
787
- </DemoContextProvider>
788
- </div>
789
- }
790
-
791
- `},4752:function(e,n){n.Z=`.chat-anywhere-demo {
792
- .spc-chat-anywhere-chat-welcome {
793
- height: auto;
794
- }
795
- }`},80142:function(e,n){n.Z=`const sessionLocalStorage = {
796
- get() {
797
- const localStorageDataString = localStorage.getItem(
798
- 'chat-anywhere-session',
799
- );
800
-
801
- if (localStorageDataString) {
802
- return JSON.parse(localStorageDataString);
803
- } else {
804
- return {
805
- sessionList: [
806
- {
807
- label: Date.now().toString(),
808
- key: '9ed1150f-6046-4917-a124-6e85ba1ea933',
809
- messages: [[]],
810
- },
811
- ],
812
- currentSessionKey: '9ed1150f-6046-4917-a124-6e85ba1ea933',
813
- currentRegenerateIndex: 0,
814
- };
815
- }
816
- },
817
- set(data) {
818
- const beforeData = sessionLocalStorage.get() || {};
819
-
820
- localStorage.setItem(
821
- 'chat-anywhere-session',
822
- JSON.stringify({
823
- ...beforeData,
824
- ...data,
825
- }),
826
- );
827
- },
828
- };
829
-
830
- export default sessionLocalStorage;
831
- `},97318:function(e,n){n.Z=`import React, { useCallback } from 'react';
832
- import { useCopilotChat } from "@copilotkit/react-core";
833
- import { Sender, Bubble, CustomCardsProvider } from '@ali/spark-chat';
834
- import { TMessage } from '@ali/spark-chat';
835
- import { CodeBlock } from '@spark-ai/design';
836
- import Input from './Input';
837
-
838
- export default function Chat() {
839
- const context = useCopilotChat();
840
-
841
- const messages = context.visibleMessages.map((message) => {
842
-
843
- if (message.type === 'TextMessage' && message.role === "user") {
844
- return {
845
- role: 'user',
846
- content: message.content,
847
- id: message.id,
848
- }
849
- }
850
-
851
- if (message.type === 'TextMessage' && message.role === "assistant") {
852
- return {
853
- role: 'assistant',
854
- typing: true,
855
- msgStatus: message.status.code === 'Pending' ? 'generating' : void 0,
856
- content: message.content,
857
- id: message.id,
858
- }
859
- }
860
-
861
- return {
862
- role: 'assistant',
863
- cards: [{
864
- code: 'Code',
865
- data: message,
866
- }],
867
- id: message.id,
868
- }
869
-
870
- }).filter(i => !!i);
871
-
872
-
873
-
874
- return (
875
- <>
876
- <CustomCardsProvider cardConfig={{ Code }}>
877
- <Bubble.List
878
- style={{ height: 0, flex: 1, }}
879
- items={messages as TMessage[]}
880
- />
881
- </CustomCardsProvider>
882
- <Input />
883
- </>
884
- );
885
- }
886
-
887
-
888
- function Code(props) {
889
- return <div style={{ width: '80%', border: '1px solid #ccc' }}>
890
- <CodeBlock language="json" value={JSON.stringify(props.data)} />
891
- </div>
892
- }`},58658:function(e,n){n.Z=`import React from 'react';
893
- import { Sender, Bubble, CustomCardsProvider, TMessage } from '@ali/spark-chat';
894
- import { useCopilotChat } from "@copilotkit/react-core";
895
- import { Role, TextMessage } from '@copilotkit/runtime-client-gql';
896
-
897
-
898
- export default function () {
899
- const [content, setContent] = React.useState('');
900
- const context = useCopilotChat();
901
-
902
- return <div>
903
- <Sender
904
- value={content}
905
- loading={context.isLoading}
906
- onChange={setContent}
907
- onSubmit={async () => {
908
- context.appendMessage(new TextMessage({
909
- content: content,
910
- role: Role.User,
911
- }))
912
- setContent('');
913
- }} />
914
- </div>
915
- }`},71235:function(e,n){n.Z=`import { Button, Checkbox } from "antd";
916
- import { useTasks } from "./hook";
917
- import { TaskStatus, type Task } from "./hook";
918
- import React from 'react';
919
- import { DeleteOutlined } from "@ant-design/icons";
920
-
921
- export function Task({ task: { id, title, status } }: { task: Task }) {
922
- const { setTaskStatus, deleteTask } = useTasks();
923
-
924
- return (
925
- <div
926
- style={{
927
- display: "flex",
928
- alignItems: "center",
929
- justifyContent: "space-between",
930
- flex: 1
931
- }}
932
- >
933
- <Checkbox checked={status === TaskStatus.done} onChange={() => {
934
- setTaskStatus(id, status === TaskStatus.done ? TaskStatus.todo : TaskStatus.done)
935
- }}>
936
- <label
937
- >
938
- {title}
939
- </label>
940
- </Checkbox>
941
- <Button onClick={() => deleteTask(id)} icon={<DeleteOutlined />}>
942
- </Button>
943
- </div>
944
- );
945
- }
946
- `},36323:function(e,n){n.Z=`import React from 'react';
947
- import { Task } from "./Task";
948
- import { useTasks } from "./hook";
949
- import { List } from 'antd';
950
-
951
- export function TasksList() {
952
- const { tasks } = useTasks();
953
- return <List
954
- style={{ margin: 16 }}
955
- rowKey="id"
956
- header={<div>AI TODO MVC</div>}
957
- bordered
958
- dataSource={tasks}
959
- renderItem={(item) => {
960
- return (
961
- <List.Item>
962
- <Task task={item} />
963
- </List.Item>
964
- )
965
- }}
966
- />
967
-
968
- }
969
- `},60793:function(e,n){n.Z=`import { useCopilotAction, useCopilotReadable } from "@copilotkit/react-core";
970
- import { createContext, useContext, useState, ReactNode } from "react";
971
- import React from 'react';
972
-
973
- export type Task = {
974
- id: number;
975
- title: string;
976
- status: TaskStatus;
977
- };
978
-
979
- export enum TaskStatus {
980
- todo = "todo",
981
- done = "done",
982
- }
983
-
984
-
985
- const defaultTasks: Task[] = [
986
- {
987
- id: 1,
988
- title: "Complete project proposal",
989
- status: TaskStatus.done,
990
- },
991
- {
992
- id: 2,
993
- title: "Review design mockups",
994
- status: TaskStatus.done,
995
- },
996
- {
997
- id: 3,
998
- title: "Prepare presentation slides",
999
- status: TaskStatus.todo,
1000
- },
1001
- {
1002
- id: 4,
1003
- title: "Send meeting notes email",
1004
- status: TaskStatus.todo,
1005
- },
1006
- {
1007
- id: 5,
1008
- title: "Review Uli's pull request",
1009
- status: TaskStatus.todo,
1010
- },
1011
- ];
1012
-
1013
- let nextId = defaultTasks.length + 1;
1014
-
1015
- type TasksContextType = {
1016
- tasks: Task[];
1017
- addTask: (title: string) => void;
1018
- setTaskStatus: (id: number, status: TaskStatus) => void;
1019
- deleteTask: (id: number) => void;
1020
- };
1021
-
1022
- const TasksContext = createContext<TasksContextType | undefined>(undefined);
1023
-
1024
- export const TasksProvider = ({ children }: { children: ReactNode }) => {
1025
- const [tasks, setTasks] = useState<Task[]>(defaultTasks);
1026
-
1027
- useCopilotReadable({
1028
- description: "The state of the todo list",
1029
- value: JSON.stringify(tasks),
1030
- });
1031
-
1032
- useCopilotAction({
1033
- name: "addTask",
1034
- description: "Adds a task to the todo list",
1035
- parameters: [
1036
- {
1037
- name: "title",
1038
- type: "string",
1039
- description: "The title of the task",
1040
- required: true,
1041
- },
1042
- ],
1043
- handler: ({ title }) => {
1044
- addTask(title);
1045
- }
1046
- });
1047
-
1048
- useCopilotAction({
1049
- name: "deleteTask",
1050
- description: "Deletes a task from the todo list",
1051
- parameters: [
1052
- {
1053
- name: "id",
1054
- type: "number",
1055
- description: "The id of the task",
1056
- required: true,
1057
- },
1058
- ],
1059
- handler: ({ id }) => {
1060
- deleteTask(id);
1061
- }
1062
- });
1063
-
1064
- useCopilotAction({
1065
- name: "setTaskStatus",
1066
- description: "Sets the status of a task",
1067
- parameters: [
1068
- {
1069
- name: "id",
1070
- type: "number",
1071
- description: "The id of the task",
1072
- required: true,
1073
- },
1074
- {
1075
- name: "status",
1076
- type: "string",
1077
- description: "The status of the task",
1078
- enum: Object.values(TaskStatus),
1079
- required: true,
1080
- },
1081
- ],
1082
- handler: ({ id, status }) => {
1083
- setTaskStatus(id, status);
1084
- }
1085
- });
1086
-
1087
- const addTask = (title: string) => {
1088
- setTasks([...tasks, { id: nextId++, title, status: TaskStatus.todo }]);
1089
- };
1090
-
1091
- const setTaskStatus = (id: number, status: TaskStatus) => {
1092
- setTasks(
1093
- tasks.map((task) =>
1094
- task.id === id ? { ...task, status } : task
1095
- )
1096
- );
1097
- };
1098
-
1099
- const deleteTask = (id: number) => {
1100
- setTasks(tasks.filter((task) => task.id !== id));
1101
- };
1102
-
1103
- return (
1104
- <TasksContext.Provider value={{ tasks, addTask, setTaskStatus, deleteTask }}>
1105
- {children}
1106
- </TasksContext.Provider>
1107
- );
1108
- };
1109
-
1110
- export const useTasks = () => {
1111
- const context = useContext(TasksContext);
1112
- if (context === undefined) {
1113
- throw new Error("useTasks must be used within a TasksProvider");
1114
- }
1115
- return context;
1116
- };
1117
- `},30513:function(e,n){n.Z=`import React from 'react';
1118
- import { TasksList } from './TasksList';
1119
- import { TasksProvider } from './hook';
1120
- import { CopilotKit } from "@copilotkit/react-core";
1121
- import { createStyles } from 'antd-style';
1122
- import Chat from './Chat';
1123
-
1124
- const useStyles = createStyles(({ css, token }) => ({
1125
- container: css\`
1126
- display: flex;
1127
- height: 100%;
1128
- \`,
1129
-
1130
- left: css\`
1131
- flex: 1;
1132
- \`,
1133
- right: css\`
1134
- flex: 1;
1135
- display: flex;
1136
- flex-direction: column;
1137
- border-left: 1px solid \${token.colorBorderSecondary};
1138
- \`
1139
- }));
1140
-
1141
-
1142
- export default function () {
1143
- const { styles } = useStyles();
1144
-
1145
- return <CopilotKit runtimeUrl="https://func-jfa-zedphfubal.cn-hangzhou.fcapp.run/ag-ui"><div className={styles.container}>
1146
-
1147
- <div className={styles.left}>
1148
- <TasksProvider>
1149
- <TasksList />
1150
- </TasksProvider>
1151
- </div>
1152
-
1153
- <div className={styles.right}>
1154
- <Chat />
1155
- </div>
1156
- </div>
1157
- </CopilotKit>
1158
-
1159
- }`},57373:function(e,n){n.Z=`import React, { useCallback } from 'react';
1160
- import { Bubble, TMessage, SparkChatProvider } from '@ali/spark-chat'
1161
- import { Card, Carousel, Flex, Statistic } from 'antd';
1162
-
1163
- const contentStyle: React.CSSProperties = {
1164
- margin: 0,
1165
- height: '160px',
1166
- color: '#fff',
1167
- lineHeight: '160px',
1168
- textAlign: 'center',
1169
- background: '#364d79',
1170
- };
1171
-
1172
- function MyCard(props) {
1173
- return <Card title="my card" size="small">
1174
- <Flex gap={32}>
1175
- {props.data.map((item) => {
1176
- return <Statistic title={item[0]} value={item[1]} />
1177
- })}
1178
- </Flex>
1179
- </Card>;
1180
- }
1181
-
1182
- export default function Custom() {
1183
- const getRoles = useCallback((bubble: any) => {
1184
- const message = bubble as TMessage;
1185
- const roleConfig: any = {};
1186
- if (message.role === 'assistant') {
1187
- roleConfig.placement = 'start';
1188
- }
1189
-
1190
- if (message.role === 'user') roleConfig.placement = 'end';
1191
- return roleConfig;
1192
- }, []);
1193
-
1194
- const messages = [
1195
- {
1196
- role: 'user',
1197
- content: '\u4F60\u662F\u8C01',
1198
- id: '1',
1199
- },
1200
- {
1201
- role: 'assistant',
1202
- content: '\u6211\u662F\u901A\u4E49\u5343\u95EE\uFF0C\u963F\u91CC\u5DF4\u5DF4\u96C6\u56E2\u65D7\u4E0B\u7684\u8D85\u5927\u89C4\u6A21\u8BED\u8A00\u6A21\u578B\u3002\u6211\u7684\u4E2D\u6587\u540D\u662F\u901A\u4E49\u5343\u95EE\uFF0C\u82F1\u6587\u540D\u662FQwen\u3002\u6211\u80FD\u591F\u5E2E\u52A9\u60A8\u56DE\u7B54\u95EE\u9898\u3001\u64B0\u5199\u6587\u7AE0\u3001\u7F16\u5199\u4EE3\u7801\u3001\u8FDB\u884C\u903B\u8F91\u63A8\u7406\u3001\u8868\u8FBE\u89C2\u70B9\u3001\u73A9\u6E38\u620F\u7B49\u3002\u5982\u679C\u60A8\u6709\u4EFB\u4F55\u95EE\u9898\u6216\u9700\u8981\u5E2E\u52A9\uFF0C\u6B22\u8FCE\u968F\u65F6\u544A\u8BC9\u6211\uFF01',
1203
- id: '2',
1204
- },
1205
- {
1206
- role: 'user',
1207
- content: 'what is citypop',
1208
- id: '3',
1209
- },
1210
- {
1211
- role: 'assistant',
1212
- content: \`city pop, short for city pop, is a genre of music that originated in japan during the late 1970s and early 1980s. it blends elements of jazz, folk, easy listening, and aor (adult oriented rock) with a distinctly urban feel. the term "city pop" often evokes images of the sophisticated, stylish, and sometimes nostalgic lifestyle of tokyo and other major japanese cities during this period.
1213
- city pop is characterized by its smooth melodies, mellow rhythms, and often dreamy or introspective lyrics. common themes include city life, summer vibes, nature, and romantic encounters. the music is frequently associated with a particular aesthetic that reflects the fashion, design, and cultural trends of urban japan in the 1980s.
1214
- some notable city pop artists include mariya takeuchi, known for her iconic song " plastic love," and joe hisaishi, a composer famous for his work on studio ghibli films, though he is not strictly considered a city pop artist.
1215
- today, city pop has experienced a resurgence in popularity, particularly among younger generations who appreciate its unique sound and the nostalgic value it holds.\`,
1216
- id: '4',
1217
- },
1218
- {
1219
- role: 'user',
1220
- content: '\u4F60\u662F\u8C01',
1221
- id: '5',
1222
- },
1223
- {
1224
- role: 'assistant',
1225
- content: '\u6211\u662F\u901A\u4E49\u5343\u95EE\uFF08Qwen\uFF09\uFF0C\u963F\u91CC\u5DF4\u5DF4\u96C6\u56E2\u65D7\u4E0B\u7684\u8D85\u5927\u89C4\u6A21\u8BED\u8A00\u6A21\u578B\u3002\u6211\u7684\u4E2D\u6587\u540D\u662F\u901A\u4E49\u5343\u95EE\uFF0C\u82F1\u6587\u540D\u662FQwen\u3002\u6211\u80FD\u591F\u5E2E\u52A9\u60A8\u56DE\u7B54\u95EE\u9898\u3001\u64B0\u5199\u6587\u7AE0\u3001\u7F16\u5199\u4EE3\u7801\u3001\u8FDB\u884C\u903B\u8F91\u63A8\u7406\u3001\u8868\u8FBE\u89C2\u70B9\u3001\u73A9\u6E38\u620F\u7B49\u3002\u5982\u679C\u60A8\u6709\u4EFB\u4F55\u95EE\u9898\u6216\u9700\u8981\u5E2E\u52A9\uFF0C\u6B22\u8FCE\u968F\u65F6\u544A\u8BC9\u6211\uFF01',
1226
- id: '6',
1227
- },
1228
- {
1229
- role: 'user',
1230
- cards: [
1231
- {
1232
- code: 'Text',
1233
- data: {
1234
- content: 'what is citypop'
1235
- },
1236
- }
1237
- ],
1238
- id: '7',
1239
- },
1240
- {
1241
- role: 'assistant',
1242
- cards: [
1243
- {
1244
- code: 'Text',
1245
- data: {
1246
- content: \`city pop, short for city pop, is a genre of music that originated in japan during the late 1970s and early 1980s. it blends elements of jazz, folk, easy listening, and aor (adult oriented rock) with a distinctly urban feel. the term "city pop" often evokes images of the sophisticated, stylish, and sometimes nostalgic lifestyle of tokyo and other major japanese cities during this period.
1247
- city pop is characterized by its smooth melodies, mellow rhythms, and often dreamy or introspective lyrics. common themes include city life, summer vibes, nature, and romantic encounters. the music is frequently associated with a particular aesthetic that reflects the fashion, design, and cultural trends of urban japan in the 1980s.
1248
- some notable city pop artists include mariya takeuchi, known for her iconic song " plastic love," and joe hisaishi, a composer famous for his work on studio ghibli films, though he is not strictly considered a city pop artist.
1249
- today, city pop has experienced a resurgence in popularity, particularly among younger generations who appreciate its unique sound and the nostalgic value it holds.\`,
1250
- }
1251
- },
1252
- {
1253
- code: 'MyCard',
1254
- data: [['Active Users', 112893], ['Account Balance (CNY)', 112893]],
1255
- },
1256
- {
1257
- code: 'Foo',
1258
- component: () => <Card size="small" title="card with inline component">
1259
- <Carousel >
1260
- <div>
1261
- <h3 style={contentStyle}>1</h3>
1262
- </div>
1263
- <div>
1264
- <h3 style={contentStyle}>2</h3>
1265
- </div>
1266
- <div>
1267
- <h3 style={contentStyle}>3</h3>
1268
- </div>
1269
- <div>
1270
- <h3 style={contentStyle}>4</h3>
1271
- </div>
1272
- </Carousel>
1273
- </Card>
1274
- },
1275
- {
1276
- code: 'Bar',
1277
- component: <h1>Bar</h1>
1278
- }
1279
- ],
1280
- id: '8',
1281
- },
1282
- ]
1283
-
1284
-
1285
- return (
1286
- <SparkChatProvider
1287
- cardConfig={{ MyCard }}>
1288
- <Bubble.List
1289
- style={{ height: 400 }}
1290
- roles={getRoles}
1291
- items={messages}
1292
- />
1293
- </SparkChatProvider>
1294
- );
1295
- }
1296
-
1297
- `},63399:function(e,n){n.Z=`import { Bubble } from '@ali/spark-chat';
1298
- import React from 'react';
1299
-
1300
- export default function () {
1301
- return <Bubble
1302
-
1303
- cards={[
1304
-
1305
- {
1306
- code: 'Files',
1307
- data: [
1308
- { filename: 'citypop.pdf', bytes: 1024 },
1309
- { filename: 'citypop.pdf', bytes: 2048 },
1310
- ],
1311
- },
1312
- ]} />
1313
- }`},53679:function(e,n){n.Z=`import { Bubble, DefaultCards } from '@ali/spark-chat';
1314
- import { CopyOutlined, DislikeOutlined, LikeOutlined, RedoOutlined } from '@ant-design/icons';
1315
- import React from 'react';
1316
-
1317
- export default function () {
1318
- return <Bubble
1319
-
1320
- cards={[
1321
-
1322
- {
1323
- code: 'Footer',
1324
- data: {
1325
- left: <DefaultCards.FooterActions data={[
1326
-
1327
- {
1328
- icon: <CopyOutlined />, onClick: () => {
1329
- }
1330
- },
1331
- {
1332
- icon: <LikeOutlined />, onClick: () => {
1333
- }
1334
- },
1335
- {
1336
- icon: <DislikeOutlined />, onClick: () => {
1337
- }
1338
- },
1339
-
1340
- {
1341
- icon: <RedoOutlined />, onClick: () => {
1342
- }
1343
- },
1344
- ]} />,
1345
- right: <DefaultCards.FooterCount data={[
1346
- ['Words', 99],
1347
- ['Input tokens', 200],
1348
- ['Output tokens', 300],
1349
- ]} />
1350
-
1351
- }
1352
- },
1353
- ]} />
1354
- }`},56391:function(e,n){n.Z=`import React from 'react';
1355
- import { Bubble } from '@ali/spark-chat';
1356
- const App = () => <Bubble cards={[
1357
- {
1358
- code: 'Images',
1359
- data: [
1360
- { url: 'https://gw.alicdn.com/imgextra/i4/O1CN01sjZ4Uu1erFDOC6IkA_!!6000000003924-2-tps-396-224.png', },
1361
- ],
1362
- },
1363
- ]} />;
1364
-
1365
- export default App;
1366
- `},48481:function(e,n){n.Z=`import React from 'react';
1367
- import { Bubble } from '@ali/spark-chat';
1368
-
1369
- const content = \`city pop, short for city pop, is a genre of music that originated in japan during the late 1970s and early 1980s. it blends elements of jazz, folk, easy listening, and aor (adult oriented rock) with a distinctly urban feel. the term "city pop" often evokes images of the sophisticated, stylish, and sometimes nostalgic lifestyle of tokyo and other major japanese cities during this period.
1370
- city pop is characterized by its smooth melodies, mellow rhythms, and often dreamy or introspective lyrics. common themes include city life, summer vibes, nature, and romantic encounters. the music is frequently associated with a particular aesthetic that reflects the fashion, design, and cultural trends of urban japan in the 1980s.
1371
- some notable city pop artists include mariya takeuchi, known for her iconic song " plastic love," and joe hisaishi, a composer famous for his work on studio ghibli films, though he is not strictly considered a city pop artist.
1372
- today, city pop has experienced a resurgence in popularity, particularly among younger generations who appreciate its unique sound and the nostalgic value it holds.\`
1373
- const App = () => <Bubble cards={[
1374
- {
1375
- code: 'Text',
1376
- data: {
1377
- content
1378
- },
1379
- },
1380
- ]} />;
1381
-
1382
- export default App;
1383
- `},26873:function(e,n){n.Z=`import React, { useCallback } from 'react';
1384
- import { VoiceChatProvider, useVoiceChat } from '@ali/spark-chat';
1385
- import { Sender, Bubble, CustomCardsProvider } from '@ali/spark-chat';
1386
- import { IconButton } from '@spark-ai/design';
1387
- import { AudioMutedOutlined, AudioOutlined, PhoneOutlined } from '@ant-design/icons';
1388
-
1389
- export default () => {
1390
- return <VoiceChatProvider>
1391
- <App />
1392
- </VoiceChatProvider>
1393
- };
1394
-
1395
-
1396
- function App() {
1397
- const context = useVoiceChat();
1398
- const getRoles = useCallback((bubble: any) => {
1399
- const message = bubble as TMessage;
1400
- const roleConfig: any = {};
1401
- if (message.role === 'assistant') {
1402
- roleConfig.placement = 'start';
1403
- }
1404
-
1405
- if (message.role === 'user') roleConfig.placement = 'end';
1406
- return roleConfig;
1407
- }, []);
1408
-
1409
- const wsConnected = context.voiceChatContext.wsConnected;
1410
-
1411
-
1412
- return <div style={{
1413
- height: '100vh',
1414
- display: 'flex',
1415
- flexDirection: 'column',
1416
- }}>
1417
-
1418
- <Bubble.List
1419
- roles={getRoles}
1420
- style={{ height: 0, flex: 1, padding: 16 }}
1421
- items={context.voiceChatContext.messages}
1422
- />
1423
-
1424
- <div style={{ display: 'flex', justifyContent: 'center', flexDirection: 'column', alignItems: 'center', padding: 32 }}>
1425
-
1426
- <div className='tts' style={{ width: 165, height: 45, marginBottom: 32 }} >
1427
-
1428
- </div>
1429
-
1430
-
1431
- <IconButton
1432
- type="primary"
1433
- danger={wsConnected}
1434
- onClick={() => {
1435
- if (wsConnected) {
1436
- context.recorderContext.recorderRef.current.stop();
1437
- } else {
1438
- context.recorderContext.recorderRef.current.start();
1439
- }
1440
- }}
1441
- shape="circle" icon={
1442
- wsConnected ? <AudioMutedOutlined /> :
1443
- <PhoneOutlined />
1444
- } size="large"
1445
- />
1446
-
1447
- </div>
1448
- </div>;
1449
- }`}}]);