@agentscope-ai/chat 1.1.20 → 1.1.22

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 (335) hide show
  1. package/bin/client.js +1 -1
  2. package/components/AGUI/components/HelpModal/icons.tsx +68 -0
  3. package/components/AGUI/components/HelpModal/index.tsx +1 -0
  4. package/components/AGUI/components/HelpModal/modal.tsx +101 -0
  5. package/components/AGUI/components/chat/Button.tsx +18 -0
  6. package/components/AGUI/components/chat/Chat.tsx +780 -0
  7. package/components/AGUI/components/chat/ChatContext.tsx +248 -0
  8. package/components/AGUI/components/chat/CodeBlock.tsx +406 -0
  9. package/components/AGUI/components/chat/Header.tsx +22 -0
  10. package/components/AGUI/components/chat/Icons.tsx +237 -0
  11. package/components/AGUI/components/chat/ImageUploadQueue.tsx +77 -0
  12. package/components/AGUI/components/chat/Input.tsx +24 -0
  13. package/components/AGUI/components/chat/Markdown.tsx +134 -0
  14. package/components/AGUI/components/chat/Messages.tsx +259 -0
  15. package/components/AGUI/components/chat/Modal.tsx +133 -0
  16. package/components/AGUI/components/chat/Popup.tsx +57 -0
  17. package/components/AGUI/components/chat/PoweredByTag.tsx +29 -0
  18. package/components/AGUI/components/chat/Sidebar.tsx +74 -0
  19. package/components/AGUI/components/chat/Suggestion.tsx +132 -0
  20. package/components/AGUI/components/chat/Suggestions.tsx +20 -0
  21. package/components/AGUI/components/chat/Textarea.tsx +61 -0
  22. package/components/AGUI/components/chat/Window.tsx +152 -0
  23. package/components/AGUI/components/chat/index.tsx +11 -0
  24. package/components/AGUI/components/chat/messages/AssistantMessage.tsx +69 -0
  25. package/components/AGUI/components/chat/messages/RenderActionExecutionMessage.tsx +129 -0
  26. package/components/AGUI/components/chat/messages/RenderAgentStateMessage.tsx +116 -0
  27. package/components/AGUI/components/chat/messages/RenderImageMessage.tsx +64 -0
  28. package/components/AGUI/components/chat/messages/RenderResultMessage.tsx +26 -0
  29. package/components/AGUI/components/chat/messages/RenderTextMessage.tsx +51 -0
  30. package/components/AGUI/components/chat/messages/UserMessage.tsx +10 -0
  31. package/components/AGUI/components/chat/props.ts +186 -0
  32. package/components/AGUI/components/index.ts +1 -0
  33. package/components/AGUI/context/index.ts +1 -0
  34. package/components/AGUI/hooks/index.ts +1 -0
  35. package/components/AGUI/hooks/use-copilot-chat-suggestions.tsx +122 -0
  36. package/components/AGUI/hooks/use-copy-to-clipboard.tsx +29 -0
  37. package/components/AGUI/hooks/use-dark-mode.ts +10 -0
  38. package/components/AGUI/hooks/use-push-to-talk.tsx +166 -0
  39. package/components/AGUI/index.tsx +4 -0
  40. package/components/AGUI/lib/utils.test.ts +7 -0
  41. package/components/AGUI/lib/utils.ts +27 -0
  42. package/components/AGUI/styles.css +0 -0
  43. package/components/AGUI/types/css.ts +0 -0
  44. package/components/AGUI/types/index.ts +1 -0
  45. package/components/AGUI/types/suggestions.ts +6 -0
  46. package/components/Accordion/Accordion.tsx +203 -0
  47. package/components/Accordion/BodyContent.tsx +28 -0
  48. package/components/Accordion/DeepThinking.tsx +91 -0
  49. package/components/Accordion/SoftLightTitle.tsx +13 -0
  50. package/components/Accordion/demo/search.tsx +39 -0
  51. package/components/Accordion/demo/steps.tsx +135 -0
  52. package/components/Accordion/demo/thinking.tsx +62 -0
  53. package/components/Accordion/index.en-US.md +34 -0
  54. package/components/Accordion/index.tsx +3 -0
  55. package/components/Accordion/index.zh-CN.md +34 -0
  56. package/components/Accordion/style.ts +208 -0
  57. package/components/AgentScopeRuntimeWebUI/demo/index.tsx +4 -0
  58. package/components/AgentScopeRuntimeWebUI/index.tsx +3 -0
  59. package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Request/Builder.tsx +82 -0
  60. package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Request/Card.tsx +52 -0
  61. package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Response/Actions.tsx +39 -0
  62. package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Response/Builder.tsx +205 -0
  63. package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Response/Card.tsx +44 -0
  64. package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Response/Error.tsx +7 -0
  65. package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Response/Message.tsx +23 -0
  66. package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Response/Reasoning.tsx +16 -0
  67. package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Response/Tool.tsx +19 -0
  68. package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/index.tsx +0 -0
  69. package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/types.tsx +100 -0
  70. package/components/AgentScopeRuntimeWebUI/lib/Chat/Input/index.tsx +77 -0
  71. package/components/AgentScopeRuntimeWebUI/lib/Chat/Input/useAttachments.tsx +53 -0
  72. package/components/AgentScopeRuntimeWebUI/lib/Chat/MessageList/index.tsx +30 -0
  73. package/components/AgentScopeRuntimeWebUI/lib/Chat/Welcome/index.tsx +66 -0
  74. package/components/AgentScopeRuntimeWebUI/lib/Chat/Welcome/styles.ts +51 -0
  75. package/components/AgentScopeRuntimeWebUI/lib/Chat/hooks/index.tsx +5 -0
  76. package/components/AgentScopeRuntimeWebUI/lib/Chat/hooks/useChatController.tsx +130 -0
  77. package/components/AgentScopeRuntimeWebUI/lib/Chat/hooks/useChatMessageHandler.tsx +87 -0
  78. package/components/AgentScopeRuntimeWebUI/lib/Chat/hooks/useChatRequest.tsx +114 -0
  79. package/components/AgentScopeRuntimeWebUI/lib/Chat/hooks/useChatSessionHandler.tsx +50 -0
  80. package/components/AgentScopeRuntimeWebUI/lib/Chat/index.tsx +18 -0
  81. package/components/AgentScopeRuntimeWebUI/lib/Chat/styles.tsx +59 -0
  82. package/components/AgentScopeRuntimeWebUI/lib/ChatAnywhere/ComposedProvider.tsx +27 -0
  83. package/components/AgentScopeRuntimeWebUI/lib/ChatAnywhere/index.tsx +29 -0
  84. package/components/AgentScopeRuntimeWebUI/lib/Context/ChatAnywhereControl.tsx +0 -0
  85. package/components/AgentScopeRuntimeWebUI/lib/Context/ChatAnywhereInputContext.tsx +27 -0
  86. package/components/AgentScopeRuntimeWebUI/lib/Context/ChatAnywhereLayoutContext.tsx +27 -0
  87. package/components/AgentScopeRuntimeWebUI/lib/Context/ChatAnywhereMessagesContext.tsx +82 -0
  88. package/components/AgentScopeRuntimeWebUI/lib/Context/ChatAnywhereOptionsContext.tsx +76 -0
  89. package/components/AgentScopeRuntimeWebUI/lib/Context/ChatAnywhereSessionsContext.tsx +111 -0
  90. package/components/AgentScopeRuntimeWebUI/lib/Context/useChatAnywhereEventEmitter.tsx +30 -0
  91. package/components/AgentScopeRuntimeWebUI/lib/Header/index.tsx +45 -0
  92. package/components/AgentScopeRuntimeWebUI/lib/Header/styles.ts +23 -0
  93. package/components/AgentScopeRuntimeWebUI/lib/Layout/index.tsx +45 -0
  94. package/components/AgentScopeRuntimeWebUI/lib/Layout/styles.tsx +104 -0
  95. package/components/AgentScopeRuntimeWebUI/lib/Sessions/index.tsx +114 -0
  96. package/components/AgentScopeRuntimeWebUI/lib/Sessions/styles.tsx +0 -0
  97. package/components/AgentScopeRuntimeWebUI/lib/demo/OptionsPanel/FormItem.tsx +37 -0
  98. package/components/AgentScopeRuntimeWebUI/lib/demo/OptionsPanel/OptionsEditor.tsx +163 -0
  99. package/components/AgentScopeRuntimeWebUI/lib/demo/OptionsPanel/defaultConfig.ts +43 -0
  100. package/components/AgentScopeRuntimeWebUI/lib/demo/OptionsPanel/index.tsx +27 -0
  101. package/components/AgentScopeRuntimeWebUI/lib/demo/index.tsx +57 -0
  102. package/components/AgentScopeRuntimeWebUI/lib/demo/sessionApi/index.ts +51 -0
  103. package/components/AgentScopeRuntimeWebUI/lib/types/IChatAnywhere.ts +358 -0
  104. package/components/AgentScopeRuntimeWebUI/lib/types/IMessages.tsx +52 -0
  105. package/components/AgentScopeRuntimeWebUI/lib/types/ISessions.tsx +29 -0
  106. package/components/AgentScopeRuntimeWebUI/lib/types/index.tsx +3 -0
  107. package/components/AgentScopeRuntimeWebUI/starter/OptionsPanel/FormItem.tsx +37 -0
  108. package/components/AgentScopeRuntimeWebUI/starter/OptionsPanel/OptionsEditor.tsx +163 -0
  109. package/components/AgentScopeRuntimeWebUI/starter/OptionsPanel/defaultConfig.ts +43 -0
  110. package/components/AgentScopeRuntimeWebUI/starter/OptionsPanel/index.tsx +27 -0
  111. package/components/AgentScopeRuntimeWebUI/starter/index.tsx +57 -0
  112. package/components/AgentScopeRuntimeWebUI/starter/sessionApi/index.ts +51 -0
  113. package/components/Attachments/DropArea.tsx +97 -0
  114. package/components/Attachments/FileList/AudioIcon.tsx +20 -0
  115. package/components/Attachments/FileList/FileListCard.tsx +270 -0
  116. package/components/Attachments/FileList/Progress.tsx +30 -0
  117. package/components/Attachments/FileList/VideoIcon.tsx +20 -0
  118. package/components/Attachments/FileList/index.tsx +201 -0
  119. package/components/Attachments/PlaceholderUploader.tsx +124 -0
  120. package/components/Attachments/SilentUploader.tsx +39 -0
  121. package/components/Attachments/context.tsx +11 -0
  122. package/components/Attachments/demo/basic.tsx +71 -0
  123. package/components/Attachments/index.en-US.md.bk +10 -0
  124. package/components/Attachments/index.tsx +274 -0
  125. package/components/Attachments/index.zh-CN.md.bk +10 -0
  126. package/components/Attachments/style/fileCard.ts +163 -0
  127. package/components/Attachments/style/index.ts +232 -0
  128. package/components/Attachments/util.ts +56 -0
  129. package/components/Bubble/Avatar.tsx +39 -0
  130. package/components/Bubble/Bubble.tsx +131 -0
  131. package/components/Bubble/BubbleList.tsx +105 -0
  132. package/components/Bubble/Cards.tsx +61 -0
  133. package/components/Bubble/Footer.tsx +55 -0
  134. package/components/Bubble/Interrupted.tsx +82 -0
  135. package/components/Bubble/ScrollToBottom.tsx +42 -0
  136. package/components/Bubble/Spin.tsx +13 -0
  137. package/components/Bubble/demo/assistantWithCode.tsx +60 -0
  138. package/components/Bubble/demo/assistantWithErrorStatus.tsx +102 -0
  139. package/components/Bubble/demo/assistantWithImage.tsx +46 -0
  140. package/components/Bubble/demo/assistantWithProcess.tsx +103 -0
  141. package/components/Bubble/demo/assistantWithSearch.tsx +69 -0
  142. package/components/Bubble/demo/assistantWithThinking.tsx +54 -0
  143. package/components/Bubble/demo/basic.tsx +55 -0
  144. package/components/Bubble/demo/userWithFile.tsx +27 -0
  145. package/components/Bubble/demo/userWithImage.tsx +26 -0
  146. package/components/Bubble/hooks/useDisplayData.ts +0 -0
  147. package/components/Bubble/hooks/useListData.ts +0 -0
  148. package/components/Bubble/index.en-US.md +33 -0
  149. package/components/Bubble/index.tsx +21 -0
  150. package/components/Bubble/index.zh-CN.md +33 -0
  151. package/components/Bubble/interface.ts +71 -0
  152. package/components/Bubble/loading.tsx +15 -0
  153. package/components/Bubble/style/avatar.ts +43 -0
  154. package/components/Bubble/style/footer.ts +45 -0
  155. package/components/Bubble/style/index.ts +192 -0
  156. package/components/Bubble/style/list.ts +51 -0
  157. package/components/ChatAnywhere/Chat/Ref.tsx +20 -0
  158. package/components/ChatAnywhere/Chat/index.tsx +56 -0
  159. package/components/ChatAnywhere/Chat/style.ts +59 -0
  160. package/components/ChatAnywhere/Header/index.tsx +37 -0
  161. package/components/ChatAnywhere/Header/style.ts +27 -0
  162. package/components/ChatAnywhere/Input/index.tsx +158 -0
  163. package/components/ChatAnywhere/Input/style.ts +14 -0
  164. package/components/ChatAnywhere/Layout/index.tsx +70 -0
  165. package/components/ChatAnywhere/Layout/style.ts +51 -0
  166. package/components/ChatAnywhere/SessionList/index.tsx +122 -0
  167. package/components/ChatAnywhere/SessionList/style.ts +53 -0
  168. package/components/ChatAnywhere/hooks/ChatAnywhereProvider.tsx +219 -0
  169. package/components/ChatAnywhere/hooks/types.ts +333 -0
  170. package/components/ChatAnywhere/hooks/useInput.tsx +22 -0
  171. package/components/ChatAnywhere/hooks/useMessages.tsx +63 -0
  172. package/components/ChatAnywhere/hooks/useSessionList.tsx +123 -0
  173. package/components/ChatAnywhere/index.tsx +49 -0
  174. package/components/Conversations/GroupTitle.tsx +28 -0
  175. package/components/Conversations/Item.tsx +189 -0
  176. package/components/Conversations/demo/basic.tsx +107 -0
  177. package/components/Conversations/demo/timeline.tsx +111 -0
  178. package/components/Conversations/demo/timestamp.tsx +110 -0
  179. package/components/Conversations/hooks/useGroupable.ts +81 -0
  180. package/components/Conversations/index.en-US.md +32 -0
  181. package/components/Conversations/index.tsx +176 -0
  182. package/components/Conversations/index.zh-CN.md +31 -0
  183. package/components/Conversations/interface.ts +69 -0
  184. package/components/Conversations/style.ts +153 -0
  185. package/components/DefaultCards/DeepThinking/index.tsx +33 -0
  186. package/components/DefaultCards/Files/index.tsx +69 -0
  187. package/components/DefaultCards/Footer/index.tsx +16 -0
  188. package/components/DefaultCards/Images/index.tsx +53 -0
  189. package/components/DefaultCards/Interrupted/index.tsx +13 -0
  190. package/components/DefaultCards/Text/index.tsx +13 -0
  191. package/components/DefaultCards/index.tsx +6 -0
  192. package/components/DeviceAction/actionMap.tsx +100 -0
  193. package/components/DeviceAction/demo/index.tsx +132 -0
  194. package/components/DeviceAction/index.en-US.md +19 -0
  195. package/components/DeviceAction/index.tsx +75 -0
  196. package/components/DeviceAction/index.zh-CN.md +19 -0
  197. package/components/Disclaimer/demo/index.tsx +4 -0
  198. package/components/Disclaimer/demo/withLink.tsx +4 -0
  199. package/components/Disclaimer/index.en-US.md +23 -0
  200. package/components/Disclaimer/index.tsx +42 -0
  201. package/components/Disclaimer/index.zh-CN.md +24 -0
  202. package/components/Disclaimer/style.ts +17 -0
  203. package/components/ImageGenerator/demo/basic.tsx +23 -0
  204. package/components/ImageGenerator/demo/custom.tsx +56 -0
  205. package/components/ImageGenerator/demo/size.tsx +15 -0
  206. package/components/ImageGenerator/index.en-US.md +23 -0
  207. package/components/ImageGenerator/index.tsx +124 -0
  208. package/components/ImageGenerator/index.zh-CN.md +23 -0
  209. package/components/ImageGenerator/style.ts +99 -0
  210. package/components/Markdown/Markdown/AnimationNode.tsx +89 -0
  211. package/components/Markdown/Markdown/Markdown.tsx +61 -0
  212. package/components/Markdown/Markdown/core/Parser.ts +52 -0
  213. package/components/Markdown/Markdown/core/Renderer.ts +121 -0
  214. package/components/Markdown/Markdown/core/index.ts +4 -0
  215. package/components/Markdown/Markdown/defaultComponents/CodeBlock.tsx +113 -0
  216. package/components/Markdown/Markdown/defaultComponents/DisabledImage.tsx +3 -0
  217. package/components/Markdown/Markdown/defaultComponents/Media.tsx +71 -0
  218. package/components/Markdown/Markdown/hooks/index.ts +4 -0
  219. package/components/Markdown/Markdown/hooks/useAnimation.tsx +27 -0
  220. package/components/Markdown/Markdown/hooks/useCitationsData.tsx +36 -0
  221. package/components/Markdown/Markdown/hooks/useStreaming.ts +503 -0
  222. package/components/Markdown/Markdown/hooks/useTyping.ts +22 -0
  223. package/components/Markdown/Markdown/index.tsx +198 -0
  224. package/components/Markdown/Markdown/interface.ts +217 -0
  225. package/components/Markdown/Markdown/style.ts +152 -0
  226. package/components/Markdown/demo/basic.tsx +107 -0
  227. package/components/Markdown/demo/citations.tsx +47 -0
  228. package/components/Markdown/demo/cursor.tsx +9 -0
  229. package/components/Markdown/demo/latex.tsx +77 -0
  230. package/components/Markdown/demo/typing.tsx +82 -0
  231. package/components/Markdown/index.en-US.md +27 -0
  232. package/components/Markdown/index.ts +1 -0
  233. package/components/Markdown/index.zh-CN.md +28 -0
  234. package/components/Markdown/plugins/citations/CitationComponent.tsx +72 -0
  235. package/components/Markdown/plugins/citations/index.tsx +37 -0
  236. package/components/Markdown/plugins/cursor/Dot.tsx +106 -0
  237. package/components/Markdown/plugins/cursor/Underline.tsx +38 -0
  238. package/components/Markdown/plugins/cursor/index.tsx +59 -0
  239. package/components/Markdown/plugins/latex/index.ts +109 -0
  240. package/components/Markdown/plugins/type.ts +71 -0
  241. package/components/Mermaid/demo/basic.tsx +12 -0
  242. package/components/Mermaid/demo/class.tsx +31 -0
  243. package/components/Mermaid/demo/flowchart.tsx +13 -0
  244. package/components/Mermaid/demo/sequence.tsx +18 -0
  245. package/components/Mermaid/demo/state.tsx +16 -0
  246. package/components/Mermaid/demo/timeline.tsx +15 -0
  247. package/components/Mermaid/index.en-US.md +27 -0
  248. package/components/Mermaid/index.tsx +118 -0
  249. package/components/Mermaid/index.zh-CN.md +27 -0
  250. package/components/OperateCard/OperateCard.tsx +93 -0
  251. package/components/OperateCard/demo/index.tsx +35 -0
  252. package/components/OperateCard/demo/rag.tsx +19 -0
  253. package/components/OperateCard/demo/thinking.tsx +17 -0
  254. package/components/OperateCard/demo/todo.tsx +28 -0
  255. package/components/OperateCard/demo/toolCall.tsx +14 -0
  256. package/components/OperateCard/demo/webSearch.tsx +12 -0
  257. package/components/OperateCard/index.en-US.md +51 -0
  258. package/components/OperateCard/index.tsx +1 -0
  259. package/components/OperateCard/index.zh-CN.md +51 -0
  260. package/components/OperateCard/preset/Rag.tsx +90 -0
  261. package/components/OperateCard/preset/Thinking.tsx +45 -0
  262. package/components/OperateCard/preset/TodoList.tsx +73 -0
  263. package/components/OperateCard/preset/ToolCall.tsx +67 -0
  264. package/components/OperateCard/preset/WebSearch.tsx +65 -0
  265. package/components/OperateCard/preset/index.tsx +5 -0
  266. package/components/OperateCard/style.ts +268 -0
  267. package/components/Provider/CustomCardsProvider.tsx +17 -0
  268. package/components/Provider/GlobalProvider.tsx +17 -0
  269. package/components/Provider/index.tsx +33 -0
  270. package/components/Provider/types.ts +23 -0
  271. package/components/ResponsesAPI/index.tsx +0 -0
  272. package/components/Sender/ModeSelect/index.tsx +160 -0
  273. package/components/Sender/ModeSelect/styles.ts +0 -0
  274. package/components/Sender/SenderHeader.tsx +164 -0
  275. package/components/Sender/StopLoading.tsx +48 -0
  276. package/components/Sender/components/ActionButton.tsx +106 -0
  277. package/components/Sender/components/ClearButton.tsx +10 -0
  278. package/components/Sender/components/LoadingButton.tsx +26 -0
  279. package/components/Sender/components/SendButton.tsx +22 -0
  280. package/components/Sender/components/SpeechButton/RecordingIcon.tsx +68 -0
  281. package/components/Sender/components/SpeechButton/index.tsx +30 -0
  282. package/components/Sender/demo/asr.tsx +7 -0
  283. package/components/Sender/demo/basic.tsx +7 -0
  284. package/components/Sender/demo/loading.tsx +5 -0
  285. package/components/Sender/demo/moreMode.tsx +45 -0
  286. package/components/Sender/demo/morePrefixAction.tsx +40 -0
  287. package/components/Sender/demo/withFile.tsx +54 -0
  288. package/components/Sender/demo/withImage.tsx +52 -0
  289. package/components/Sender/index.en-US.md +29 -0
  290. package/components/Sender/index.tsx +491 -0
  291. package/components/Sender/index.zh-CN.md +30 -0
  292. package/components/Sender/style/index.ts +150 -0
  293. package/components/Sender/useSpeech.ts +133 -0
  294. package/components/StatusCard/demo/index.tsx +32 -0
  295. package/components/StatusCard/index.en-US.md +30 -0
  296. package/components/StatusCard/index.tsx +162 -0
  297. package/components/StatusCard/index.zh-CN.md +27 -0
  298. package/components/StatusCard/style.ts +119 -0
  299. package/components/Stream/index.ts +203 -0
  300. package/components/Util/hooks/use-proxy-imperative-handle.ts +25 -0
  301. package/components/Util/sleep.ts +3 -0
  302. package/components/Util/type.ts +1 -0
  303. package/components/Util/warning.ts +118 -0
  304. package/components/Version/index.ts +3 -0
  305. package/components/Voice/Recorder.tsx +3 -0
  306. package/components/Voice/demo/index.tsx +0 -0
  307. package/components/Voice/index.en-US.md +8 -0
  308. package/components/Voice/index.tsx +0 -0
  309. package/components/Voice/index.zh-CN.md +9 -0
  310. package/components/Welcome/demo/EyeFollower.tsx +161 -0
  311. package/components/Welcome/demo/demo0.tsx +14 -0
  312. package/components/Welcome/demo/demo1.tsx +16 -0
  313. package/components/Welcome/demo/demo2.tsx +30 -0
  314. package/components/Welcome/demo/demo3.tsx +16 -0
  315. package/components/Welcome/index.en-US.md +28 -0
  316. package/components/Welcome/index.tsx +72 -0
  317. package/components/Welcome/index.zh-CN.md +28 -0
  318. package/components/index.ts +88 -0
  319. package/components/overview.en-US.md +10 -0
  320. package/components/overview.zh-CN.md +10 -0
  321. package/lib/AgentScopeRuntimeWebUI/index.d.ts +1 -0
  322. package/lib/AgentScopeRuntimeWebUI/index.js +1 -0
  323. package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/FormItem.d.ts +9 -0
  324. package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/FormItem.js +33 -0
  325. package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/OptionsEditor.d.ts +7 -0
  326. package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/OptionsEditor.js +188 -0
  327. package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/defaultConfig.d.ts +29 -0
  328. package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/defaultConfig.js +35 -0
  329. package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/index.d.ts +6 -0
  330. package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/index.js +49 -0
  331. package/lib/AgentScopeRuntimeWebUI/starter/index.d.ts +1 -0
  332. package/lib/AgentScopeRuntimeWebUI/starter/index.js +70 -0
  333. package/lib/AgentScopeRuntimeWebUI/starter/sessionApi/index.d.ts +14 -0
  334. package/lib/AgentScopeRuntimeWebUI/starter/sessionApi/index.js +143 -0
  335. package/package.json +3 -2
@@ -0,0 +1,237 @@
1
+ import React from "react";
2
+
3
+ export const OpenIcon = (
4
+ <svg
5
+ xmlns="http://www.w3.org/2000/svg"
6
+ viewBox="0 0 24 24"
7
+ fill="currentColor"
8
+ width="24"
9
+ height="24"
10
+ >
11
+ <g transform="translate(24, 0) scale(-1, 1)">
12
+ <path
13
+ fillRule="evenodd"
14
+ d="M5.337 21.718a6.707 6.707 0 01-.533-.074.75.75 0 01-.44-1.223 3.73 3.73 0 00.814-1.686c.023-.115-.022-.317-.254-.543C3.274 16.587 2.25 14.41 2.25 12c0-5.03 4.428-9 9.75-9s9.75 3.97 9.75 9c0 5.03-4.428 9-9.75 9-.833 0-1.643-.097-2.417-.279a6.721 6.721 0 01-4.246.997z"
15
+ clipRule="evenodd"
16
+ />
17
+ </g>
18
+ </svg>
19
+ );
20
+
21
+ export const CloseIcon = (
22
+ <svg
23
+ xmlns="http://www.w3.org/2000/svg"
24
+ fill="none"
25
+ viewBox="0 0 24 24"
26
+ strokeWidth="1.5"
27
+ stroke="currentColor"
28
+ width="24"
29
+ height="24"
30
+ >
31
+ <path strokeLinecap="round" strokeLinejoin="round" d="M19.5 8.25l-7.5 7.5-7.5-7.5" />
32
+ </svg>
33
+ );
34
+
35
+ export const HeaderCloseIcon = (
36
+ <svg
37
+ xmlns="http://www.w3.org/2000/svg"
38
+ fill="none"
39
+ viewBox="0 0 24 24"
40
+ strokeWidth="1.5"
41
+ stroke="currentColor"
42
+ width="24"
43
+ height="24"
44
+ >
45
+ <path strokeLinecap="round" strokeLinejoin="round" d="M6 18L18 6M6 6l12 12" />
46
+ </svg>
47
+ );
48
+
49
+ export const SendIcon = (
50
+ <svg
51
+ xmlns="http://www.w3.org/2000/svg"
52
+ fill="none"
53
+ viewBox="0 0 24 24"
54
+ strokeWidth="1.5"
55
+ stroke="currentColor"
56
+ width="24"
57
+ height="24"
58
+ >
59
+ <path strokeLinecap="round" strokeLinejoin="round" d="M12 19V5m0 0l-7 7m7-7l7 7" />
60
+ </svg>
61
+ );
62
+
63
+ export const MicrophoneIcon = (
64
+ <svg
65
+ xmlns="http://www.w3.org/2000/svg"
66
+ fill="none"
67
+ viewBox="0 0 24 24"
68
+ strokeWidth="1.5"
69
+ stroke="currentColor"
70
+ width="24"
71
+ height="24"
72
+ >
73
+ <path
74
+ strokeLinecap="round"
75
+ strokeLinejoin="round"
76
+ d="M12 18.75a6 6 0 006-6v-1.5m-6 7.5a6 6 0 01-6-6v-1.5m6 7.5v3.75m-3.75 0h7.5M12 15.75a3 3 0 01-3-3V4.5a3 3 0 116 0v8.25a3 3 0 01-3 3z"
77
+ />
78
+ </svg>
79
+ );
80
+
81
+ export const StopIcon = (
82
+ <svg
83
+ xmlns="http://www.w3.org/2000/svg"
84
+ fill="none"
85
+ viewBox="0 0 24 24"
86
+ strokeWidth="1.5"
87
+ stroke="currentColor"
88
+ width="24"
89
+ height="24"
90
+ >
91
+ <path
92
+ strokeLinecap="round"
93
+ strokeLinejoin="round"
94
+ d="M5.25 7.5A2.25 2.25 0 017.5 5.25h9a2.25 2.25 0 012.25 2.25v9a2.25 2.25 0 01-2.25 2.25h-9a2.25 2.25 0 01-2.25-2.25v-9z"
95
+ />
96
+ </svg>
97
+ );
98
+
99
+ export const RegenerateIcon = (
100
+ <svg
101
+ xmlns="http://www.w3.org/2000/svg"
102
+ fill="none"
103
+ viewBox="0 0 24 24"
104
+ strokeWidth="2"
105
+ stroke="currentColor"
106
+ width="16"
107
+ height="16"
108
+ style={{ minWidth: "16px", minHeight: "16px" }}
109
+ >
110
+ <path
111
+ strokeLinecap="round"
112
+ strokeLinejoin="round"
113
+ d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99"
114
+ />
115
+ </svg>
116
+ );
117
+
118
+ export const CopyIcon = (
119
+ <svg
120
+ xmlns="http://www.w3.org/2000/svg"
121
+ fill="none"
122
+ viewBox="0 0 24 24"
123
+ strokeWidth="2"
124
+ stroke="currentColor"
125
+ width="16"
126
+ height="16"
127
+ style={{ minWidth: "16px", minHeight: "16px" }}
128
+ >
129
+ <path
130
+ strokeLinecap="round"
131
+ strokeLinejoin="round"
132
+ d="M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 01-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 011.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 00-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 01-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 00-3.375-3.375h-1.5a1.125 1.125 0 01-1.125-1.125v-1.5a3.375 3.375 0 00-3.375-3.375H9.75"
133
+ />
134
+ </svg>
135
+ );
136
+
137
+ export const SmallSpinnerIcon = (
138
+ <span className="copilotKitSpinner" style={{ width: "13px", height: "13px" }}></span>
139
+ );
140
+
141
+ export const SpinnerIcon = (
142
+ <span className="copilotKitSpinner" style={{ width: "24px", height: "24px" }}></span>
143
+ );
144
+
145
+ export const ActivityIcon = (
146
+ <div style={{ display: "flex", alignItems: "center", gap: "4px" }}>
147
+ <span className="copilotKitActivityDot" style={{ animationDelay: "0s" }}></span>
148
+ <span className="copilotKitActivityDot" style={{ animationDelay: "0.2s" }}></span>
149
+ <span className="copilotKitActivityDot" style={{ animationDelay: "0.4s" }}></span>
150
+ </div>
151
+ );
152
+
153
+ export const ThumbsUpIcon = (
154
+ <svg
155
+ xmlns="http://www.w3.org/2000/svg"
156
+ fill="none"
157
+ viewBox="0 0 24 24"
158
+ strokeWidth="2"
159
+ stroke="currentColor"
160
+ width="16"
161
+ height="16"
162
+ style={{ minWidth: "16px", minHeight: "16px" }}
163
+ >
164
+ <path
165
+ strokeLinecap="round"
166
+ strokeLinejoin="round"
167
+ d="M6.633 10.5c.806 0 1.533-.446 2.031-1.08a9.041 9.041 0 012.861-2.4c.723-.384 1.35-.956 1.653-1.715a4.498 4.498 0 00.322-1.672V3a.75.75 0 01.75-.75A2.25 2.25 0 0116.5 4.5c0 1.152-.26 2.243-.723 3.218-.266.558.107 1.282.725 1.282h3.126c1.026 0 1.945.694 2.054 1.715.045.422.068.85.068 1.285a11.95 11.95 0 01-2.649 7.521c-.388.482-.987.729-1.605.729H13.48c-.483 0-.964-.078-1.423-.23l-3.114-1.04a4.501 4.501 0 00-1.423-.23H5.904M14.25 9h2.25M5.904 18.75c.083.205.173.405.27.602.197.4-.078.898-.523.898h-.908c-.889 0-1.713-.518-1.972-1.368a12 12 0 01-.521-3.507c0-1.553.295-3.036.831-4.398C3.387 10.203 4.167 9.75 5 9.75h1.053c.472 0 .745.556.5.96a8.958 8.958 0 00-1.302 4.665c0 1.194.232 2.333.654 3.375z"
168
+ />
169
+ </svg>
170
+ );
171
+
172
+ export const ThumbsDownIcon = (
173
+ <svg
174
+ xmlns="http://www.w3.org/2000/svg"
175
+ fill="none"
176
+ viewBox="0 0 24 24"
177
+ strokeWidth="2"
178
+ stroke="currentColor"
179
+ width="16"
180
+ height="16"
181
+ style={{ minWidth: "16px", minHeight: "16px" }}
182
+ >
183
+ <path
184
+ strokeLinecap="round"
185
+ strokeLinejoin="round"
186
+ d="M7.5 15h2.25m8.024-9.75c.011.05.028.1.052.148.591 1.2.924 2.55.924 3.977a8.96 8.96 0 01-.999 4.125m.023-8.25c-.076-.365.183-.75.575-.75h.908c.889 0 1.713.518 1.972 1.368.339 1.11.521 2.287.521 3.507 0 1.553-.295 3.036-.831 4.398C20.613 14.547 19.833 15 19 15h-1.053c-.472 0-.745-.556-.5-.96a8.95 8.95 0 00.303-.54m.023-8.25H16.48a4.5 4.5 0 01-1.423-.23l-3.114-1.04a4.5 4.5 0 00-1.423-.23H6.504c-.618 0-1.217.247-1.605.729A11.95 11.95 0 002.25 12c0 .434.023.863.068 1.285C2.427 14.306 3.346 15 4.372 15h3.126c.618 0 .991.724.725 1.282A7.471 7.471 0 007.5 19.5a2.25 2.25 0 002.25 2.25.75.75 0 00.75-.75v-.633c0-.573.11-1.14.322-1.672.304-.76.93-1.33 1.653-1.715a9.04 9.04 0 002.86-2.4c.498-.634 1.226-1.08 2.032-1.08h.384"
187
+ />
188
+ </svg>
189
+ );
190
+
191
+ export const DownloadIcon = (
192
+ <svg
193
+ xmlns="http://www.w3.org/2000/svg"
194
+ fill="none"
195
+ viewBox="0 0 24 24"
196
+ strokeWidth="2"
197
+ stroke="currentColor"
198
+ width="16"
199
+ height="16"
200
+ style={{ minWidth: "16px", minHeight: "16px" }}
201
+ >
202
+ <path
203
+ strokeLinecap="round"
204
+ strokeLinejoin="round"
205
+ d="M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"
206
+ />
207
+ </svg>
208
+ );
209
+
210
+ export const UploadIcon = (
211
+ <svg
212
+ xmlns="http://www.w3.org/2000/svg"
213
+ fill="none"
214
+ viewBox="0 0 24 24"
215
+ strokeWidth="1.5"
216
+ stroke="currentColor"
217
+ width="24"
218
+ height="24"
219
+ >
220
+ <path strokeLinecap="round" strokeLinejoin="round" d="M12 4.5v15m7.5-7.5h-15" />
221
+ </svg>
222
+ );
223
+
224
+ export const CheckIcon = (
225
+ <svg
226
+ xmlns="http://www.w3.org/2000/svg"
227
+ fill="none"
228
+ viewBox="0 0 24 24"
229
+ strokeWidth="2"
230
+ stroke="currentColor"
231
+ width="16"
232
+ height="16"
233
+ style={{ minWidth: "16px", minHeight: "16px" }}
234
+ >
235
+ <path strokeLinecap="round" strokeLinejoin="round" d="M4.5 12.75l6 6 9-13.5" />
236
+ </svg>
237
+ );
@@ -0,0 +1,77 @@
1
+ import React from "react";
2
+
3
+ interface ImageUploadQueueProps {
4
+ images: Array<{ contentType: string; bytes: string }>;
5
+ onRemoveImage: (index: number) => void;
6
+ className?: string;
7
+ }
8
+
9
+ export const ImageUploadQueue: React.FC<ImageUploadQueueProps> = ({
10
+ images,
11
+ onRemoveImage,
12
+ className = "",
13
+ }) => {
14
+ if (images.length === 0) return null;
15
+
16
+ return (
17
+ <div
18
+ className={`copilotKitImageUploadQueue ${className}`}
19
+ style={{
20
+ display: "flex",
21
+ flexWrap: "wrap",
22
+ gap: "8px",
23
+ margin: "8px",
24
+ padding: "8px",
25
+ }}
26
+ >
27
+ {images.map((image, index) => (
28
+ <div
29
+ key={index}
30
+ className="copilotKitImageUploadQueueItem"
31
+ style={{
32
+ position: "relative",
33
+ display: "inline-block",
34
+ width: "60px",
35
+ height: "60px",
36
+ borderRadius: "4px",
37
+ overflow: "hidden",
38
+ }}
39
+ >
40
+ {/* eslint-disable-next-line @next/next/no-img-element */}
41
+ <img
42
+ src={`data:${image.contentType};base64,${image.bytes}`}
43
+ alt={`Selected image ${index + 1}`}
44
+ style={{
45
+ width: "100%",
46
+ height: "100%",
47
+ objectFit: "cover",
48
+ }}
49
+ />
50
+ <button
51
+ onClick={() => onRemoveImage(index)}
52
+ className="copilotKitImageUploadQueueRemoveButton"
53
+ style={{
54
+ position: "absolute",
55
+ top: "2px",
56
+ right: "2px",
57
+ background: "rgba(0,0,0,0.6)",
58
+ color: "white",
59
+ border: "none",
60
+ borderRadius: "50%",
61
+ width: "18px",
62
+ height: "18px",
63
+ display: "flex",
64
+ alignItems: "center",
65
+ justifyContent: "center",
66
+ cursor: "pointer",
67
+ fontSize: "10px",
68
+ padding: 0,
69
+ }}
70
+ >
71
+
72
+ </button>
73
+ </div>
74
+ ))}
75
+ </div>
76
+ );
77
+ };
@@ -0,0 +1,24 @@
1
+ import React, { useMemo, useRef, useState } from "react";
2
+ import { InputProps } from "./props";
3
+ import { ChatInput } from '@agentscope-ai/chat';
4
+
5
+ export const Input = ({
6
+ inProgress,
7
+ onSend,
8
+ onStop,
9
+ }: InputProps) => {
10
+ const [text, setText] = useState("");
11
+ const send = () => {
12
+ if (inProgress) return;
13
+ onSend(text);
14
+ setText("");
15
+ };
16
+
17
+ return <ChatInput
18
+ value={text}
19
+ onChange={setText}
20
+ onSubmit={send}
21
+ loading={inProgress}
22
+ onCancel={onStop}
23
+ />;
24
+ };
@@ -0,0 +1,134 @@
1
+ import { FC, memo } from "react";
2
+ import ReactMarkdown, { Options, Components } from "react-markdown";
3
+ import { CodeBlock } from "./CodeBlock";
4
+ import remarkGfm from "remark-gfm";
5
+ import remarkMath from "remark-math";
6
+ import rehypeRaw from "rehype-raw";
7
+
8
+ const defaultComponents: Components = {
9
+ a({ children, ...props }) {
10
+ return (
11
+ <a className="copilotKitMarkdownElement" {...props} target="_blank" rel="noopener noreferrer">
12
+ {children}
13
+ </a>
14
+ );
15
+ },
16
+ // @ts-expect-error -- inline
17
+ code({ children, className, inline, ...props }) {
18
+ if (Array.isArray(children) && children.length) {
19
+ if (children[0] == "▍") {
20
+ return (
21
+ <span
22
+ style={{
23
+ animation: "pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
24
+ marginTop: "0.25rem",
25
+ }}
26
+ >
27
+
28
+ </span>
29
+ );
30
+ }
31
+
32
+ children[0] = (children?.[0] as string).replace("`▍`", "▍");
33
+ }
34
+
35
+ const match = /language-(\w+)/.exec(className || "");
36
+
37
+ if (inline) {
38
+ return (
39
+ <code className={className} {...props}>
40
+ {children}
41
+ </code>
42
+ );
43
+ }
44
+
45
+ return (
46
+ <CodeBlock
47
+ key={Math.random()}
48
+ language={(match && match[1]) || ""}
49
+ value={String(children).replace(/\n$/, "")}
50
+ {...props}
51
+ />
52
+ );
53
+ },
54
+ h1: ({ children, ...props }) => (
55
+ <h1 className="copilotKitMarkdownElement" {...props}>
56
+ {children}
57
+ </h1>
58
+ ),
59
+ h2: ({ children, ...props }) => (
60
+ <h2 className="copilotKitMarkdownElement" {...props}>
61
+ {children}
62
+ </h2>
63
+ ),
64
+ h3: ({ children, ...props }) => (
65
+ <h3 className="copilotKitMarkdownElement" {...props}>
66
+ {children}
67
+ </h3>
68
+ ),
69
+ h4: ({ children, ...props }) => (
70
+ <h4 className="copilotKitMarkdownElement" {...props}>
71
+ {children}
72
+ </h4>
73
+ ),
74
+ h5: ({ children, ...props }) => (
75
+ <h5 className="copilotKitMarkdownElement" {...props}>
76
+ {children}
77
+ </h5>
78
+ ),
79
+ h6: ({ children, ...props }) => (
80
+ <h6 className="copilotKitMarkdownElement" {...props}>
81
+ {children}
82
+ </h6>
83
+ ),
84
+ p: ({ children, ...props }) => (
85
+ <p className="copilotKitMarkdownElement" {...props}>
86
+ {children}
87
+ </p>
88
+ ),
89
+ pre: ({ children, ...props }) => (
90
+ <pre className="copilotKitMarkdownElement" {...props}>
91
+ {children}
92
+ </pre>
93
+ ),
94
+ blockquote: ({ children, ...props }) => (
95
+ <blockquote className="copilotKitMarkdownElement" {...props}>
96
+ {children}
97
+ </blockquote>
98
+ ),
99
+ ul: ({ children, ...props }) => (
100
+ <ul className="copilotKitMarkdownElement" {...props}>
101
+ {children}
102
+ </ul>
103
+ ),
104
+ li: ({ children, ...props }) => (
105
+ <li className="copilotKitMarkdownElement" {...props}>
106
+ {children}
107
+ </li>
108
+ ),
109
+ };
110
+
111
+ const MemoizedReactMarkdown: FC<Options> = memo(
112
+ ReactMarkdown,
113
+ (prevProps, nextProps) =>
114
+ prevProps.children === nextProps.children && prevProps.components === nextProps.components,
115
+ );
116
+
117
+ type MarkdownProps = {
118
+ content: string;
119
+ components?: Components;
120
+ };
121
+
122
+ export const Markdown = ({ content, components }: MarkdownProps) => {
123
+ return (
124
+ <div className="copilotKitMarkdown">
125
+ <MemoizedReactMarkdown
126
+ components={{ ...defaultComponents, ...components }}
127
+ remarkPlugins={[remarkGfm, remarkMath]}
128
+ rehypePlugins={[rehypeRaw]}
129
+ >
130
+ {content}
131
+ </MemoizedReactMarkdown>
132
+ </div>
133
+ );
134
+ };