@vectorx/agent-simulator 1.0.0 → 1.1.0

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 (311) hide show
  1. package/lib/app.d.ts +1 -1
  2. package/lib/app.js +4 -4
  3. package/lib/config/api.config.d.ts +0 -1
  4. package/lib/config/api.config.js +3 -2
  5. package/lib/config/app.config.d.ts +2 -1
  6. package/lib/config/app.config.js +0 -1
  7. package/lib/config/upload.config.d.ts +0 -1
  8. package/lib/config/upload.config.js +0 -1
  9. package/lib/container/container.d.ts +0 -1
  10. package/lib/container/container.js +4 -2
  11. package/lib/container/identifiers.d.ts +0 -1
  12. package/lib/container/identifiers.js +0 -1
  13. package/lib/container/index.d.ts +0 -1
  14. package/lib/container/index.js +0 -1
  15. package/lib/container/types.d.ts +9 -1
  16. package/lib/container/types.js +0 -1
  17. package/lib/controllers/agent.controller.d.ts +6 -3
  18. package/lib/controllers/agent.controller.js +17 -3
  19. package/lib/controllers/auth.controller.d.ts +4 -5
  20. package/lib/controllers/auth.controller.js +3 -4
  21. package/lib/controllers/simulator.controller.d.ts +2 -3
  22. package/lib/controllers/simulator.controller.js +1 -2
  23. package/lib/controllers/upload.controller.d.ts +1 -2
  24. package/lib/controllers/upload.controller.js +5 -2
  25. package/lib/index.d.ts +1 -2
  26. package/lib/index.js +0 -1
  27. package/lib/middleware/cors.middleware.d.ts +0 -1
  28. package/lib/middleware/cors.middleware.js +0 -1
  29. package/lib/middleware/error.middleware.d.ts +3 -4
  30. package/lib/middleware/error.middleware.js +2 -3
  31. package/lib/middleware/proxy.middleware.d.ts +1 -2
  32. package/lib/middleware/proxy.middleware.js +0 -1
  33. package/lib/middleware/upload.middleware.d.ts +0 -1
  34. package/lib/middleware/upload.middleware.js +0 -1
  35. package/lib/routes/agent.d.ts +0 -1
  36. package/lib/routes/agent.js +2 -1
  37. package/lib/routes/auth.d.ts +0 -1
  38. package/lib/routes/auth.js +0 -1
  39. package/lib/routes/index.d.ts +0 -1
  40. package/lib/routes/index.js +0 -1
  41. package/lib/routes/simulator.d.ts +0 -1
  42. package/lib/routes/simulator.js +0 -1
  43. package/lib/routes/upload.d.ts +0 -1
  44. package/lib/routes/upload.js +0 -1
  45. package/lib/services/agent.service.d.ts +15 -2
  46. package/lib/services/agent.service.js +34 -8
  47. package/lib/services/auth.service.d.ts +1 -2
  48. package/lib/services/auth.service.js +5 -6
  49. package/lib/services/simulator.service.d.ts +0 -1
  50. package/lib/services/simulator.service.js +0 -1
  51. package/lib/services/upload.service.d.ts +0 -1
  52. package/lib/services/upload.service.js +0 -1
  53. package/lib/simulator.d.ts +11 -1
  54. package/lib/simulator.js +90 -6
  55. package/lib/utils/env-helper.d.ts +0 -1
  56. package/lib/utils/env-helper.js +0 -1
  57. package/lib/utils/logger.d.ts +0 -1
  58. package/lib/utils/logger.js +0 -1
  59. package/lib/utils/request.d.ts +0 -1
  60. package/lib/utils/request.js +6 -2
  61. package/lib/utils/url-parser.d.ts +0 -1
  62. package/lib/utils/url-parser.js +1 -2
  63. package/lib/utils.d.ts +0 -1
  64. package/lib/utils.js +0 -1
  65. package/lib/webview-ui/Agent.d.ts +0 -1
  66. package/lib/webview-ui/Agent.js +0 -1
  67. package/lib/webview-ui/App.d.ts +0 -1
  68. package/lib/webview-ui/App.js +176 -34
  69. package/lib/webview-ui/ErrorBoundary.d.ts +0 -1
  70. package/lib/webview-ui/ErrorBoundary.js +0 -1
  71. package/lib/webview-ui/components/AsyncTaskBlock.d.ts +1 -2
  72. package/lib/webview-ui/components/AsyncTaskBlock.js +16 -5
  73. package/lib/webview-ui/components/AuthIndicator.d.ts +1 -2
  74. package/lib/webview-ui/components/AuthIndicator.js +0 -1
  75. package/lib/webview-ui/components/ErrorCard.d.ts +1 -2
  76. package/lib/webview-ui/components/ErrorCard.js +7 -5
  77. package/lib/webview-ui/components/KnowledgeBaseSearchBlock.d.ts +1 -2
  78. package/lib/webview-ui/components/KnowledgeBaseSearchBlock.js +4 -3
  79. package/lib/webview-ui/components/KnowledgeBaseSearchResult.d.ts +1 -2
  80. package/lib/webview-ui/components/KnowledgeBaseSearchResult.js +1 -2
  81. package/lib/webview-ui/components/MarkdownRenderer.d.ts +1 -2
  82. package/lib/webview-ui/components/MarkdownRenderer.js +3 -8
  83. package/lib/webview-ui/components/MessageRenderer.d.ts +1 -2
  84. package/lib/webview-ui/components/MessageRenderer.js +48 -5
  85. package/lib/webview-ui/components/MultimodalFileRenderer.d.ts +2 -2
  86. package/lib/webview-ui/components/MultimodalFileRenderer.js +97 -40
  87. package/lib/webview-ui/components/ThinkingBlock.d.ts +2 -3
  88. package/lib/webview-ui/components/ThinkingBlock.js +0 -1
  89. package/lib/webview-ui/components/ToolUseBlock.d.ts +1 -2
  90. package/lib/webview-ui/components/ToolUseBlock.js +1 -2
  91. package/lib/webview-ui/components/ToolUseBlockHeader.d.ts +1 -2
  92. package/lib/webview-ui/components/ToolUseBlockHeader.js +1 -2
  93. package/lib/webview-ui/components/UploadPreview.d.ts +1 -2
  94. package/lib/webview-ui/components/UploadPreview.js +0 -1
  95. package/lib/webview-ui/components/WelcomeModule.d.ts +0 -1
  96. package/lib/webview-ui/components/WelcomeModule.js +46 -16
  97. package/lib/webview-ui/components/index.d.ts +0 -1
  98. package/lib/webview-ui/components/index.js +0 -1
  99. package/lib/webview-ui/config/cos-config.d.ts +0 -1
  100. package/lib/webview-ui/config/cos-config.js +0 -1
  101. package/lib/webview-ui/config/http-config.d.ts +0 -1
  102. package/lib/webview-ui/config/http-config.js +0 -1
  103. package/lib/webview-ui/constants.d.ts +0 -1
  104. package/lib/webview-ui/constants.js +0 -1
  105. package/lib/webview-ui/contexts/AgentContext.d.ts +1 -2
  106. package/lib/webview-ui/contexts/AgentContext.js +0 -1
  107. package/lib/webview-ui/contexts/AuthContext.d.ts +2 -2
  108. package/lib/webview-ui/contexts/AuthContext.js +0 -1
  109. package/lib/webview-ui/contexts/ThemeContext.d.ts +2 -2
  110. package/lib/webview-ui/contexts/ThemeContext.js +0 -1
  111. package/lib/webview-ui/hooks/useAgentStatus.d.ts +4 -2
  112. package/lib/webview-ui/hooks/useAgentStatus.js +31 -5
  113. package/lib/webview-ui/hooks/useUploader.d.ts +0 -1
  114. package/lib/webview-ui/hooks/useUploader.js +5 -2
  115. package/lib/webview-ui/hooks/useUserAvatar.d.ts +0 -1
  116. package/lib/webview-ui/hooks/useUserAvatar.js +0 -1
  117. package/lib/webview-ui/index.d.ts +1 -1
  118. package/lib/webview-ui/index.js +1 -1
  119. package/lib/webview-ui/services/agent-service.d.ts +14 -1
  120. package/lib/webview-ui/services/agent-service.js +7 -1
  121. package/lib/webview-ui/services/index.d.ts +0 -1
  122. package/lib/webview-ui/services/index.js +0 -1
  123. package/lib/webview-ui/services/logger-service.d.ts +0 -1
  124. package/lib/webview-ui/services/logger-service.js +0 -1
  125. package/lib/webview-ui/styles/copilot.d.ts +0 -1
  126. package/lib/webview-ui/styles/copilot.js +80 -22
  127. package/lib/webview-ui/styles/workarea.d.ts +0 -1
  128. package/lib/webview-ui/styles/workarea.js +7 -2
  129. package/lib/webview-ui/types.d.ts +11 -2
  130. package/lib/webview-ui/types.js +0 -1
  131. package/lib/webview-ui/utils/cos.d.ts +0 -1
  132. package/lib/webview-ui/utils/cos.js +4 -3
  133. package/lib/webview-ui/utils/env-helper.d.ts +6 -1
  134. package/lib/webview-ui/utils/env-helper.js +16 -2
  135. package/lib/webview-ui/utils/http-client.d.ts +1 -2
  136. package/lib/webview-ui/utils/http-client.js +0 -1
  137. package/lib/webview-ui/utils/markdownHighlight.d.ts +3 -0
  138. package/lib/webview-ui/utils/markdownHighlight.js +75 -0
  139. package/lib/webview-ui/utils/stream-text-handler.d.ts +0 -1
  140. package/lib/webview-ui/utils/stream-text-handler.js +6 -3
  141. package/lib/webview-ui/utils/upload.d.ts +0 -1
  142. package/lib/webview-ui/utils/upload.js +5 -2
  143. package/lib/webview-ui/widgets/BubbleComponents.d.ts +1 -2
  144. package/lib/webview-ui/widgets/BubbleComponents.js +1 -2
  145. package/lib/webview-ui/widgets/ChatInput.d.ts +1 -2
  146. package/lib/webview-ui/widgets/ChatInput.js +63 -90
  147. package/lib/webview-ui/widgets/LogPanel.d.ts +2 -3
  148. package/lib/webview-ui/widgets/LogPanel.js +5 -2
  149. package/lib/webview-ui/widgets/SystemLogs.d.ts +1 -2
  150. package/lib/webview-ui/widgets/SystemLogs.js +26 -9
  151. package/lib/webview-ui/widgets/ToolBar.d.ts +4 -3
  152. package/lib/webview-ui/widgets/ToolBar.js +6 -4
  153. package/lib/webview-ui/widgets/WebSocketDebugger.d.ts +6 -0
  154. package/lib/webview-ui/widgets/WebSocketDebugger.js +226 -0
  155. package/lib/webview-ui/widgets/index.d.ts +0 -1
  156. package/lib/webview-ui/widgets/index.js +0 -1
  157. package/package.json +9 -7
  158. package/public/assets/main.js +193 -166
  159. package/public/assets/style.css +1 -1
  160. package/lib/app.d.ts.map +0 -1
  161. package/lib/app.js.map +0 -1
  162. package/lib/config/api.config.d.ts.map +0 -1
  163. package/lib/config/api.config.js.map +0 -1
  164. package/lib/config/app.config.d.ts.map +0 -1
  165. package/lib/config/app.config.js.map +0 -1
  166. package/lib/config/upload.config.d.ts.map +0 -1
  167. package/lib/config/upload.config.js.map +0 -1
  168. package/lib/container/container.d.ts.map +0 -1
  169. package/lib/container/container.js.map +0 -1
  170. package/lib/container/identifiers.d.ts.map +0 -1
  171. package/lib/container/identifiers.js.map +0 -1
  172. package/lib/container/index.d.ts.map +0 -1
  173. package/lib/container/index.js.map +0 -1
  174. package/lib/container/types.d.ts.map +0 -1
  175. package/lib/container/types.js.map +0 -1
  176. package/lib/controllers/agent.controller.d.ts.map +0 -1
  177. package/lib/controllers/agent.controller.js.map +0 -1
  178. package/lib/controllers/auth.controller.d.ts.map +0 -1
  179. package/lib/controllers/auth.controller.js.map +0 -1
  180. package/lib/controllers/simulator.controller.d.ts.map +0 -1
  181. package/lib/controllers/simulator.controller.js.map +0 -1
  182. package/lib/controllers/upload.controller.d.ts.map +0 -1
  183. package/lib/controllers/upload.controller.js.map +0 -1
  184. package/lib/index.d.ts.map +0 -1
  185. package/lib/index.js.map +0 -1
  186. package/lib/middleware/cors.middleware.d.ts.map +0 -1
  187. package/lib/middleware/cors.middleware.js.map +0 -1
  188. package/lib/middleware/error.middleware.d.ts.map +0 -1
  189. package/lib/middleware/error.middleware.js.map +0 -1
  190. package/lib/middleware/proxy.middleware.d.ts.map +0 -1
  191. package/lib/middleware/proxy.middleware.js.map +0 -1
  192. package/lib/middleware/upload.middleware.d.ts.map +0 -1
  193. package/lib/middleware/upload.middleware.js.map +0 -1
  194. package/lib/routes/agent.d.ts.map +0 -1
  195. package/lib/routes/agent.js.map +0 -1
  196. package/lib/routes/auth.d.ts.map +0 -1
  197. package/lib/routes/auth.js.map +0 -1
  198. package/lib/routes/index.d.ts.map +0 -1
  199. package/lib/routes/index.js.map +0 -1
  200. package/lib/routes/simulator.d.ts.map +0 -1
  201. package/lib/routes/simulator.js.map +0 -1
  202. package/lib/routes/upload.d.ts.map +0 -1
  203. package/lib/routes/upload.js.map +0 -1
  204. package/lib/services/agent.service.d.ts.map +0 -1
  205. package/lib/services/agent.service.js.map +0 -1
  206. package/lib/services/auth.service.d.ts.map +0 -1
  207. package/lib/services/auth.service.js.map +0 -1
  208. package/lib/services/simulator.service.d.ts.map +0 -1
  209. package/lib/services/simulator.service.js.map +0 -1
  210. package/lib/services/upload.service.d.ts.map +0 -1
  211. package/lib/services/upload.service.js.map +0 -1
  212. package/lib/simulator.d.ts.map +0 -1
  213. package/lib/simulator.js.map +0 -1
  214. package/lib/utils/env-helper.d.ts.map +0 -1
  215. package/lib/utils/env-helper.js.map +0 -1
  216. package/lib/utils/logger.d.ts.map +0 -1
  217. package/lib/utils/logger.js.map +0 -1
  218. package/lib/utils/request.d.ts.map +0 -1
  219. package/lib/utils/request.js.map +0 -1
  220. package/lib/utils/url-parser.d.ts.map +0 -1
  221. package/lib/utils/url-parser.js.map +0 -1
  222. package/lib/utils.d.ts.map +0 -1
  223. package/lib/utils.js.map +0 -1
  224. package/lib/webview-ui/Agent.d.ts.map +0 -1
  225. package/lib/webview-ui/Agent.js.map +0 -1
  226. package/lib/webview-ui/App.d.ts.map +0 -1
  227. package/lib/webview-ui/App.js.map +0 -1
  228. package/lib/webview-ui/ErrorBoundary.d.ts.map +0 -1
  229. package/lib/webview-ui/ErrorBoundary.js.map +0 -1
  230. package/lib/webview-ui/components/AsyncTaskBlock.d.ts.map +0 -1
  231. package/lib/webview-ui/components/AsyncTaskBlock.js.map +0 -1
  232. package/lib/webview-ui/components/AuthIndicator.d.ts.map +0 -1
  233. package/lib/webview-ui/components/AuthIndicator.js.map +0 -1
  234. package/lib/webview-ui/components/ErrorCard.d.ts.map +0 -1
  235. package/lib/webview-ui/components/ErrorCard.js.map +0 -1
  236. package/lib/webview-ui/components/KnowledgeBaseSearchBlock.d.ts.map +0 -1
  237. package/lib/webview-ui/components/KnowledgeBaseSearchBlock.js.map +0 -1
  238. package/lib/webview-ui/components/KnowledgeBaseSearchResult.d.ts.map +0 -1
  239. package/lib/webview-ui/components/KnowledgeBaseSearchResult.js.map +0 -1
  240. package/lib/webview-ui/components/MarkdownRenderer.d.ts.map +0 -1
  241. package/lib/webview-ui/components/MarkdownRenderer.js.map +0 -1
  242. package/lib/webview-ui/components/MessageRenderer.d.ts.map +0 -1
  243. package/lib/webview-ui/components/MessageRenderer.js.map +0 -1
  244. package/lib/webview-ui/components/MultimodalFileRenderer.d.ts.map +0 -1
  245. package/lib/webview-ui/components/MultimodalFileRenderer.js.map +0 -1
  246. package/lib/webview-ui/components/ThinkingBlock.d.ts.map +0 -1
  247. package/lib/webview-ui/components/ThinkingBlock.js.map +0 -1
  248. package/lib/webview-ui/components/ToolUseBlock.d.ts.map +0 -1
  249. package/lib/webview-ui/components/ToolUseBlock.js.map +0 -1
  250. package/lib/webview-ui/components/ToolUseBlockHeader.d.ts.map +0 -1
  251. package/lib/webview-ui/components/ToolUseBlockHeader.js.map +0 -1
  252. package/lib/webview-ui/components/UploadPreview.d.ts.map +0 -1
  253. package/lib/webview-ui/components/UploadPreview.js.map +0 -1
  254. package/lib/webview-ui/components/WelcomeModule.d.ts.map +0 -1
  255. package/lib/webview-ui/components/WelcomeModule.js.map +0 -1
  256. package/lib/webview-ui/components/index.d.ts.map +0 -1
  257. package/lib/webview-ui/components/index.js.map +0 -1
  258. package/lib/webview-ui/config/cos-config.d.ts.map +0 -1
  259. package/lib/webview-ui/config/cos-config.js.map +0 -1
  260. package/lib/webview-ui/config/http-config.d.ts.map +0 -1
  261. package/lib/webview-ui/config/http-config.js.map +0 -1
  262. package/lib/webview-ui/constants.d.ts.map +0 -1
  263. package/lib/webview-ui/constants.js.map +0 -1
  264. package/lib/webview-ui/contexts/AgentContext.d.ts.map +0 -1
  265. package/lib/webview-ui/contexts/AgentContext.js.map +0 -1
  266. package/lib/webview-ui/contexts/AuthContext.d.ts.map +0 -1
  267. package/lib/webview-ui/contexts/AuthContext.js.map +0 -1
  268. package/lib/webview-ui/contexts/ThemeContext.d.ts.map +0 -1
  269. package/lib/webview-ui/contexts/ThemeContext.js.map +0 -1
  270. package/lib/webview-ui/hooks/useAgentStatus.d.ts.map +0 -1
  271. package/lib/webview-ui/hooks/useAgentStatus.js.map +0 -1
  272. package/lib/webview-ui/hooks/useUploader.d.ts.map +0 -1
  273. package/lib/webview-ui/hooks/useUploader.js.map +0 -1
  274. package/lib/webview-ui/hooks/useUserAvatar.d.ts.map +0 -1
  275. package/lib/webview-ui/hooks/useUserAvatar.js.map +0 -1
  276. package/lib/webview-ui/index.d.ts.map +0 -1
  277. package/lib/webview-ui/index.js.map +0 -1
  278. package/lib/webview-ui/services/agent-service.d.ts.map +0 -1
  279. package/lib/webview-ui/services/agent-service.js.map +0 -1
  280. package/lib/webview-ui/services/index.d.ts.map +0 -1
  281. package/lib/webview-ui/services/index.js.map +0 -1
  282. package/lib/webview-ui/services/logger-service.d.ts.map +0 -1
  283. package/lib/webview-ui/services/logger-service.js.map +0 -1
  284. package/lib/webview-ui/styles/copilot.d.ts.map +0 -1
  285. package/lib/webview-ui/styles/copilot.js.map +0 -1
  286. package/lib/webview-ui/styles/workarea.d.ts.map +0 -1
  287. package/lib/webview-ui/styles/workarea.js.map +0 -1
  288. package/lib/webview-ui/types.d.ts.map +0 -1
  289. package/lib/webview-ui/types.js.map +0 -1
  290. package/lib/webview-ui/utils/cos.d.ts.map +0 -1
  291. package/lib/webview-ui/utils/cos.js.map +0 -1
  292. package/lib/webview-ui/utils/env-helper.d.ts.map +0 -1
  293. package/lib/webview-ui/utils/env-helper.js.map +0 -1
  294. package/lib/webview-ui/utils/http-client.d.ts.map +0 -1
  295. package/lib/webview-ui/utils/http-client.js.map +0 -1
  296. package/lib/webview-ui/utils/stream-text-handler.d.ts.map +0 -1
  297. package/lib/webview-ui/utils/stream-text-handler.js.map +0 -1
  298. package/lib/webview-ui/utils/upload.d.ts.map +0 -1
  299. package/lib/webview-ui/utils/upload.js.map +0 -1
  300. package/lib/webview-ui/widgets/BubbleComponents.d.ts.map +0 -1
  301. package/lib/webview-ui/widgets/BubbleComponents.js.map +0 -1
  302. package/lib/webview-ui/widgets/ChatInput.d.ts.map +0 -1
  303. package/lib/webview-ui/widgets/ChatInput.js.map +0 -1
  304. package/lib/webview-ui/widgets/LogPanel.d.ts.map +0 -1
  305. package/lib/webview-ui/widgets/LogPanel.js.map +0 -1
  306. package/lib/webview-ui/widgets/SystemLogs.d.ts.map +0 -1
  307. package/lib/webview-ui/widgets/SystemLogs.js.map +0 -1
  308. package/lib/webview-ui/widgets/ToolBar.d.ts.map +0 -1
  309. package/lib/webview-ui/widgets/ToolBar.js.map +0 -1
  310. package/lib/webview-ui/widgets/index.d.ts.map +0 -1
  311. package/lib/webview-ui/widgets/index.js.map +0 -1
@@ -58,6 +58,24 @@ const http_client_1 = require("./utils/http-client");
58
58
  const stream_text_handler_1 = require("./utils/stream-text-handler");
59
59
  const widgets_1 = require("./widgets");
60
60
  const LogPanel_1 = require("./widgets/LogPanel");
61
+ const WebSocketDebugger_1 = require("./widgets/WebSocketDebugger");
62
+ /** 从消息中取摘要(用于列表展示);有 parts 时从 parts 推导,否则用 content */
63
+ function getMessageSummary(msg) {
64
+ const parts = msg.parts;
65
+ if (parts?.length) {
66
+ const first = parts[0];
67
+ if (first.type === "text" && first.content.trim())
68
+ return first.content.trim().slice(0, 80);
69
+ if (first.type === "image")
70
+ return "[图片]";
71
+ if (first.type === "video")
72
+ return "[视频]";
73
+ if (first.type === "audio")
74
+ return "[音频]";
75
+ return "[多段内容]";
76
+ }
77
+ return msg.content || "";
78
+ }
61
79
  // 根据 mimeType 确定文件类型的工具函数
62
80
  const getFileTypeFromMimeType = (mimeType) => {
63
81
  const normalizedType = mimeType.toLowerCase();
@@ -88,7 +106,7 @@ const getFileTypeFromMimeType = (mimeType) => {
88
106
  }
89
107
  };
90
108
  const ChatAgent = ({ agentSimulatorInfo, onMessageUpdate, onRequestStart, onRequestEnd, onUserSubmit, onCancel, }) => {
91
- let abortController = (0, react_1.useRef)(null);
109
+ const abortController = (0, react_1.useRef)(null);
92
110
  const [agent] = (0, x_1.useXAgent)({
93
111
  baseURL: (0, Agent_1.getSendMessageUri)(agentSimulatorInfo),
94
112
  });
@@ -162,7 +180,7 @@ const ChatAgent = ({ agentSimulatorInfo, onMessageUpdate, onRequestStart, onRequ
162
180
  // 其他类型暂不参与多模态对话内容,仍在气泡中展示
163
181
  });
164
182
  }
165
- if (val && val.trim()) {
183
+ if (val?.trim()) {
166
184
  contentParts.push({ type: "text", text: val.trim() });
167
185
  }
168
186
  // 合并标准文件和 OpenAI 文件到统一的 files 字段(用于请求)
@@ -199,6 +217,7 @@ const ChatAgent = ({ agentSimulatorInfo, onMessageUpdate, onRequestStart, onRequ
199
217
  ]
200
218
  : [],
201
219
  };
220
+ const requestMessageId = `msg-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
202
221
  agent.request(requestData, {
203
222
  onUpdate: (chunk) => {
204
223
  try {
@@ -236,7 +255,7 @@ const ChatAgent = ({ agentSimulatorInfo, onMessageUpdate, onRequestStart, onRequ
236
255
  }
237
256
  // 处理错误响应(没有 choices 字段的响应)
238
257
  if (rawChunk && !message) {
239
- const errorMessageId = `error-${Date.now()}`;
258
+ const errorMessageId = requestMessageId;
240
259
  // 构建标准错误信息格式,与 ErrorCard 的消费逻辑匹配
241
260
  const errorInfo = {
242
261
  message: rawChunk.message || rawChunk.error || "请求失败",
@@ -299,11 +318,15 @@ const ChatAgent = ({ agentSimulatorInfo, onMessageUpdate, onRequestStart, onRequ
299
318
  const choice = message.choices[0];
300
319
  const messageData = choice.message || choice.delta || {};
301
320
  // 检测错误类型:空 type 或 "error" type,或者有 finish_reason 为 "error"
302
- const isError = (choice.message && !messageData.type) || messageData.type === "error" || choice.finish_reason === "error";
303
- const msgType = isError ? "error" : (messageData.type || "answer");
321
+ const isError = (choice.message && !messageData.type) ||
322
+ messageData.type === "error" ||
323
+ choice.finish_reason === "error";
324
+ const msgType = isError
325
+ ? "error"
326
+ : (messageData.type || "answer");
304
327
  const currentText = messageData.content || "";
305
328
  const currentReasoning = messageData.reasoning_content || "";
306
- const messageId = message.id;
329
+ const messageId = requestMessageId;
307
330
  // 对于错误情况,提取错误信息(构建标准格式,与 ErrorCard 匹配)
308
331
  const errorInfo = isError
309
332
  ? {
@@ -334,6 +357,7 @@ const ChatAgent = ({ agentSimulatorInfo, onMessageUpdate, onRequestStart, onRequ
334
357
  uiTimeStr: new Date().toLocaleTimeString(),
335
358
  type: "thinking",
336
359
  cards: [],
360
+ parts: [],
337
361
  timestamp: Date.now(),
338
362
  };
339
363
  newMessages.push(newMessage);
@@ -344,7 +368,8 @@ const ChatAgent = ({ agentSimulatorInfo, onMessageUpdate, onRequestStart, onRequ
344
368
  const updatedMessage = {
345
369
  ...existingMessage,
346
370
  };
347
- updatedMessage.reasoningContent = (updatedMessage.reasoningContent || "") + currentReasoning;
371
+ updatedMessage.reasoningContent =
372
+ (updatedMessage.reasoningContent || "") + currentReasoning;
348
373
  updatedMessage.isThinking = !!currentReasoning;
349
374
  // 根据消息类型处理
350
375
  if (msgType === "error") {
@@ -361,8 +386,27 @@ const ChatAgent = ({ agentSimulatorInfo, onMessageUpdate, onRequestStart, onRequ
361
386
  ];
362
387
  }
363
388
  else if (msgType === "answer") {
364
- updatedMessage.content = (updatedMessage.content || "") + currentText;
365
- updatedMessage.type = "answer";
389
+ if (Array.isArray(updatedMessage.parts)) {
390
+ const parts = [...updatedMessage.parts];
391
+ const last = parts[parts.length - 1];
392
+ if (last?.type === "text") {
393
+ last.content += currentText;
394
+ }
395
+ else {
396
+ parts.push({ type: "text", content: currentText });
397
+ }
398
+ updatedMessage.parts = parts;
399
+ updatedMessage.type = "composite";
400
+ updatedMessage.isThinking = false;
401
+ updatedMessage.content = parts
402
+ .filter((p) => p.type === "text")
403
+ .map((p) => p.content)
404
+ .join("");
405
+ }
406
+ else {
407
+ updatedMessage.content = (updatedMessage.content || "") + currentText;
408
+ updatedMessage.type = "answer";
409
+ }
366
410
  }
367
411
  else if ([
368
412
  "function_call",
@@ -389,14 +433,65 @@ const ChatAgent = ({ agentSimulatorInfo, onMessageUpdate, onRequestStart, onRequ
389
433
  updatedMessage.type = msgType;
390
434
  }
391
435
  }
392
- // 图片/视频类型:主内容按图片渲染,type 跟随分片类型
436
+ // 图片/视频类型:追加到 parts,支持多图与图文混排
393
437
  else if (msgType === "image" || msgType === "video") {
394
- if (currentText) {
395
- updatedMessage.content = currentText; // 图片/视频 URL/base64
438
+ if (Array.isArray(updatedMessage.parts)) {
439
+ const parts = [...updatedMessage.parts];
440
+ if (currentText)
441
+ parts.push({ type: msgType, content: currentText });
442
+ updatedMessage.parts = parts;
443
+ updatedMessage.type = "composite";
444
+ updatedMessage.isThinking = false;
445
+ }
446
+ else {
447
+ if (currentText)
448
+ updatedMessage.content = currentText;
449
+ updatedMessage.type = msgType;
450
+ updatedMessage.isThinking = false;
451
+ }
452
+ }
453
+ // 音频类型:有 parts 时追加到 parts,否则保持原逻辑(独立消息或单段音频)
454
+ else if (msgType === "audio") {
455
+ const audioMetadata = messageData.metadata || undefined;
456
+ const parts = updatedMessage.parts ?? [];
457
+ if (parts.length > 0) {
458
+ if (currentText) {
459
+ parts.push({
460
+ type: "audio",
461
+ content: currentText,
462
+ metadata: audioMetadata,
463
+ });
464
+ }
465
+ updatedMessage.parts = [...parts];
466
+ updatedMessage.type = "composite";
467
+ updatedMessage.isThinking = false;
468
+ }
469
+ else if (existingMessage.type !== "audio" &&
470
+ (existingMessage.content || (existingMessage.parts?.length ?? 0) > 0)) {
471
+ const audioMessage = {
472
+ id: `${messageId}-audio-${Date.now()}`,
473
+ role: "assistant",
474
+ content: currentText,
475
+ type: "audio",
476
+ isThinking: false,
477
+ isTimeout: false,
478
+ isInterrupted: false,
479
+ isUiDiscard: false,
480
+ uiTimeStr: new Date().toLocaleTimeString(),
481
+ timestamp: Date.now(),
482
+ metadata: audioMetadata,
483
+ };
484
+ newMessages.push(audioMessage);
485
+ newMessages[existingIndex] = updatedMessage;
486
+ return newMessages;
487
+ }
488
+ else {
489
+ if (currentText)
490
+ updatedMessage.content = currentText;
491
+ updatedMessage.type = "audio";
492
+ updatedMessage.isThinking = false;
493
+ updatedMessage.metadata = audioMetadata;
396
494
  }
397
- updatedMessage.type = msgType;
398
- // 图片/视频结果为最终结果,确保结束思考态以触发渲染
399
- updatedMessage.isThinking = false;
400
495
  }
401
496
  // 异步任务类型:统一走卡片渲染
402
497
  else if (msgType === "async_task") {
@@ -425,7 +520,7 @@ const ChatAgent = ({ agentSimulatorInfo, onMessageUpdate, onRequestStart, onRequ
425
520
  console.error("Transform message error:", error);
426
521
  }
427
522
  },
428
- onSuccess: (chunks) => {
523
+ onSuccess: (_chunks) => {
429
524
  onMessageUpdate((prev) => {
430
525
  return prev.map((msg) => ({
431
526
  ...msg,
@@ -527,6 +622,7 @@ const Copilot = () => {
527
622
  const { styles } = (0, copilot_1.useCopilotStyle)();
528
623
  const { isLoggedIn } = (0, AuthContext_1.useAuth)();
529
624
  const { getUserAvatarProps } = (0, useUserAvatar_1.useUserAvatar)();
625
+ const embedded = (0, env_helper_1.isEmbeddedInIde)();
530
626
  const chatUserSubmitRef = (0, react_1.useRef)(null);
531
627
  const chatCancelRef = (0, react_1.useRef)(null);
532
628
  // ==================== State ====================
@@ -537,7 +633,7 @@ const Copilot = () => {
537
633
  const [messages, setMessages] = (0, react_1.useState)([]);
538
634
  const [loading, setLoading] = (0, react_1.useState)(false);
539
635
  // ==================== Agent Status ====================
540
- const { agentSimulatorInfo, debugStatus, isConnecting, retryConnection } = (0, useAgentStatus_1.useAgentStatus)();
636
+ const { agentSimulatorInfo, debugStatus, isConnecting, retryConnection, functionMode } = (0, useAgentStatus_1.useAgentStatus)();
541
637
  // ========== Widgets 相关状态 ==========
542
638
  const [showSystemLogs, setShowSystemLogs] = (0, react_1.useState)(false);
543
639
  const [activeLogTab, setActiveLogTab] = (0, react_1.useState)("system");
@@ -547,6 +643,12 @@ const Copilot = () => {
547
643
  setMessages([]);
548
644
  };
549
645
  const handleToggleLogs = () => setShowSystemLogs((v) => !v);
646
+ // 监听 embedded 模式下来自父窗口的清空对话事件
647
+ react_1.default.useEffect(() => {
648
+ const handler = () => handleClearChat();
649
+ window.addEventListener("simulator:clear-chat", handler);
650
+ return () => window.removeEventListener("simulator:clear-chat", handler);
651
+ }, []);
550
652
  // ==================== 消息发送可用性检查 ====================
551
653
  const canSendMessage = agentSimulatorInfo && debugStatus === "normal";
552
654
  const getDisabledReason = () => {
@@ -669,7 +771,7 @@ const Copilot = () => {
669
771
  }
670
772
  catch (error) {
671
773
  // 处理 HTTP 错误
672
- if (error.message && error.message.includes("500")) {
774
+ if (error.message?.includes("500")) {
673
775
  if ((0, env_helper_1.isIDE)()) {
674
776
  throw new Error("IDE 环境下上传服务异常,请检查后端服务是否正常运行");
675
777
  }
@@ -695,7 +797,15 @@ const Copilot = () => {
695
797
  uploadFiles([file], {
696
798
  onStart: () => { },
697
799
  onComplete: (ok) => {
698
- setAttachedFiles((prev) => prev.map((it) => it.uid === uid ? { ...it, status: "done", url: ok.url, percent: 100, fileSource: "standard" } : it));
800
+ setAttachedFiles((prev) => prev.map((it) => it.uid === uid
801
+ ? {
802
+ ...it,
803
+ status: "done",
804
+ url: ok.url,
805
+ percent: 100,
806
+ fileSource: "standard",
807
+ }
808
+ : it));
699
809
  antd_2.message.success(`${ok.name} 上传成功`);
700
810
  // 上传成功后自动打开 Attachments 面板
701
811
  setAttachmentsOpen(true);
@@ -712,9 +822,9 @@ const Copilot = () => {
712
822
  fileList.forEach((f) => enqueueUpload(f));
713
823
  };
714
824
  // 获取文件类型
715
- const getFileType = (file) => {
825
+ const _getFileType = (file) => {
716
826
  const mimeType = file.type.toLowerCase();
717
- return cos_config_1.uploadConfig.fileTypeMap[mimeType] || "document";
827
+ return (cos_config_1.uploadConfig.fileTypeMap[mimeType] || "document");
718
828
  };
719
829
  const onPasteFile = (_, files) => {
720
830
  // IDE 环境下跳过登录检查
@@ -728,9 +838,12 @@ const Copilot = () => {
728
838
  };
729
839
  // 预览功能如需启用,请结合 UploadFile 结构扩展;当前手动上传暂不启用内置预览。
730
840
  // ==================== Nodes ====================
731
- const chatList = ((0, jsx_runtime_1.jsx)("div", { className: styles.chatList, style: { display: "flex", flexDirection: "column" }, children: messages?.length ? ((0, jsx_runtime_1.jsx)(x_1.Bubble.List, { style: { height: "100%", padding: "12px 16px" }, items: messages.map((item) => {
841
+ const chatList = ((0, jsx_runtime_1.jsx)("div", { className: styles.chatList, style: { display: "flex", flexDirection: "column" }, children: messages?.length ? ((0, jsx_runtime_1.jsx)(x_1.Bubble.List, { style: {
842
+ height: "100%",
843
+ padding: embedded ? "8px 10px" : "12px 16px",
844
+ }, items: messages.map((item) => {
732
845
  return {
733
- content: item.content,
846
+ content: getMessageSummary(item),
734
847
  role: item.role,
735
848
  messageRender: () => (0, jsx_runtime_1.jsx)(components_1.MessageRenderer, { message: item }),
736
849
  };
@@ -753,7 +866,7 @@ const Copilot = () => {
753
866
  placement: "start",
754
867
  avatar: {
755
868
  ...getUserAvatarProps(),
756
- size: 40,
869
+ size: embedded ? 28 : 40,
757
870
  },
758
871
  },
759
872
  } })) : ((0, jsx_runtime_1.jsx)(components_1.WelcomeModule, { onPromptSelect: handleUserSubmit, onModuleChange: setCurrentModule, isDark: isDark })) }));
@@ -763,18 +876,23 @@ const Copilot = () => {
763
876
  newFileList.splice(index, 1);
764
877
  setAttachedFiles(newFileList);
765
878
  }, getDisabledReason: getDisabledReason }));
879
+ // 构建 WebSocket 代理 URL(通过模拟器代理到 rcb-ff)
880
+ const wsProxyBase = `ws://${window.location.host}/ws-proxy/`;
881
+ // 嵌入到 Web IDE 时,不展示 ToolBar(Agent 信息 + 调试控制)和 LogPanel(调试日志),
882
+ // 这些信息由 Web IDE 侧统一展示。
766
883
  return ((0, jsx_runtime_1.jsx)(AgentContext_1.AgentProvider, { agentSimulatorInfo: agentSimulatorInfo, children: (0, jsx_runtime_1.jsxs)("div", { className: styles.copilotChat, style: {
767
884
  background: token.colorBgContainer,
768
- minHeight: "100vh",
885
+ minHeight: embedded ? 0 : "100vh",
886
+ height: embedded ? "100%" : undefined,
769
887
  borderRadius: 0,
770
888
  boxShadow: "none",
771
889
  padding: 0,
772
- border: `1px solid ${token.colorBorder}`,
773
- }, children: [(0, jsx_runtime_1.jsx)(widgets_1.ToolBar, { agentSimulatorInfo: agentSimulatorInfo, debugStatus: debugStatus, showSystemLogs: showSystemLogs, isConnecting: isConnecting, onRetryConnection: retryConnection, onClearChat: handleClearChat, onToggleLogs: handleToggleLogs }), (0, jsx_runtime_1.jsx)(LogPanel_1.LogPanel, { open: showSystemLogs, activeTab: activeLogTab, onTabChange: setActiveLogTab, onClose: () => setShowSystemLogs(false), agentSimulatorInfo: agentSimulatorInfo, height: constants_1.LOG_PANEL_HEIGHT, debugStatus: debugStatus }), chatList, chatSender, agentSimulatorInfo && ((0, jsx_runtime_1.jsx)(ChatAgent, { agentSimulatorInfo: agentSimulatorInfo, onMessageUpdate: setMessages, onRequestStart: () => setLoading(true), onRequestEnd: () => setLoading(false), onUserSubmit: (fn) => {
774
- chatUserSubmitRef.current = fn;
775
- }, onCancel: (fn) => {
776
- chatCancelRef.current = fn;
777
- } }))] }) }));
890
+ border: embedded ? "none" : `1px solid ${token.colorBorder}`,
891
+ }, children: [!embedded && ((0, jsx_runtime_1.jsx)(widgets_1.ToolBar, { agentSimulatorInfo: agentSimulatorInfo, debugStatus: debugStatus, showSystemLogs: showSystemLogs, isConnecting: isConnecting, onRetryConnection: retryConnection, onClearChat: handleClearChat, onToggleLogs: handleToggleLogs, functionMode: functionMode })), !embedded && ((0, jsx_runtime_1.jsx)(LogPanel_1.LogPanel, { open: showSystemLogs, activeTab: activeLogTab, onTabChange: setActiveLogTab, onClose: () => setShowSystemLogs(false), agentSimulatorInfo: agentSimulatorInfo, height: constants_1.LOG_PANEL_HEIGHT, debugStatus: debugStatus })), functionMode === "websocket" ? ((0, jsx_runtime_1.jsx)(WebSocketDebugger_1.WebSocketDebugger, { wsProxyBase: wsProxyBase })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [chatList, chatSender, agentSimulatorInfo && ((0, jsx_runtime_1.jsx)(ChatAgent, { agentSimulatorInfo: agentSimulatorInfo, onMessageUpdate: setMessages, onRequestStart: () => setLoading(true), onRequestEnd: () => setLoading(false), onUserSubmit: (fn) => {
892
+ chatUserSubmitRef.current = fn;
893
+ }, onCancel: (fn) => {
894
+ chatCancelRef.current = fn;
895
+ } }))] }))] }) }));
778
896
  };
779
897
  const CopilotSimulator = () => {
780
898
  const { styles: workareaStyles } = (0, workarea_1.useWorkareaStyle)();
@@ -785,17 +903,41 @@ const CopilotSimulator = () => {
785
903
  };
786
904
  const initIsDarkMode = getIsDarkFromQuery();
787
905
  const [darkMode, setDarkMode] = (0, react_1.useState)(initIsDarkMode);
906
+ // 检测是否嵌入在 IDE 中
907
+ const embedded = (0, env_helper_1.isEmbeddedInIde)();
908
+ // 同步 body 背景色与根节点 class,便于全局暗色样式(例如代码高亮)生效
909
+ react_1.default.useEffect(() => {
910
+ document.body.style.backgroundColor = darkMode ? "#141414" : "#f5f5f5";
911
+ document.body.style.color = darkMode ? "#ffffffd9" : "#333";
912
+ const root = document.documentElement;
913
+ root.classList.remove("vfd-theme-light", "vfd-theme-dark");
914
+ root.classList.add(darkMode ? "vfd-theme-dark" : "vfd-theme-light");
915
+ }, [darkMode]);
916
+ // 监听来自父窗口的 postMessage(主题切换、清空对话等)
917
+ react_1.default.useEffect(() => {
918
+ const handleMessage = (event) => {
919
+ if (!event.data)
920
+ return;
921
+ if (event.data.type === "setTheme") {
922
+ setDarkMode(!!event.data.isDark);
923
+ }
924
+ if (event.data.type === "clearChat") {
925
+ window.dispatchEvent(new CustomEvent("simulator:clear-chat"));
926
+ }
927
+ };
928
+ window.addEventListener("message", handleMessage);
929
+ return () => window.removeEventListener("message", handleMessage);
930
+ }, []);
788
931
  if (typeof require === "function") {
789
932
  // 当前运行在IDE中,electron环境
790
933
  const { ipcRenderer } = require("electron");
791
934
  // @ts-ignore
792
- ipcRenderer.on("setTheme", (event, isDark) => {
935
+ ipcRenderer.on("setTheme", (_event, isDark) => {
793
936
  setDarkMode(isDark);
794
937
  });
795
938
  }
796
939
  return ((0, jsx_runtime_1.jsx)(ThemeContext_1.ThemeProvider, { isDark: darkMode, children: (0, jsx_runtime_1.jsx)(antd_1.ConfigProvider, { theme: {
797
940
  algorithm: darkMode ? antd_1.theme.darkAlgorithm : antd_1.theme.defaultAlgorithm,
798
- }, children: (0, jsx_runtime_1.jsx)(AuthContext_1.AuthProvider, { children: (0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)("div", { className: workareaStyles.copilotWrapper, children: (0, jsx_runtime_1.jsx)(Copilot, {}) }) }) }) }) }));
941
+ }, children: (0, jsx_runtime_1.jsx)(AuthContext_1.AuthProvider, { children: (0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)("div", { className: `${workareaStyles.copilotWrapper} ${embedded ? "embed-ide" : ""} ${darkMode ? "vfd-theme-dark" : "vfd-theme-light"}`, children: (0, jsx_runtime_1.jsx)(Copilot, {}) }) }) }) }) }));
799
942
  };
800
943
  exports.default = CopilotSimulator;
801
- //# sourceMappingURL=App.js.map
@@ -16,4 +16,3 @@ declare class ErrorBoundary extends React.Component<{
16
16
  render(): string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<React.ReactNode> | null | undefined;
17
17
  }
18
18
  export { ErrorBoundary };
19
- //# sourceMappingURL=ErrorBoundary.d.ts.map
@@ -51,4 +51,3 @@ class ErrorBoundary extends react_1.default.Component {
51
51
  }
52
52
  }
53
53
  exports.ErrorBoundary = ErrorBoundary;
54
- //# sourceMappingURL=ErrorBoundary.js.map
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import type React from "react";
2
2
  import "./AsyncTaskBlock.less";
3
3
  interface AsyncTaskBlockProps {
4
4
  task_id?: string;
@@ -10,4 +10,3 @@ interface AsyncTaskBlockProps {
10
10
  }
11
11
  export declare const AsyncTaskBlock: React.FC<AsyncTaskBlockProps>;
12
12
  export {};
13
- //# sourceMappingURL=AsyncTaskBlock.d.ts.map
@@ -29,7 +29,11 @@ function normalizeTaskResults(output) {
29
29
  const url = (typeof c?.url === "string" && c.url) ||
30
30
  (typeof c?.image === "string" && c.image) ||
31
31
  (typeof c?.image_url === "string" && c.image_url) ||
32
- (c?.image_url && typeof c.image_url === "object" ? (c.image_url.url ? String(c.image_url.url) : "") : "");
32
+ (c?.image_url && typeof c.image_url === "object"
33
+ ? c.image_url.url
34
+ ? String(c.image_url.url)
35
+ : ""
36
+ : "");
33
37
  return url
34
38
  ? {
35
39
  url,
@@ -79,7 +83,13 @@ const TaskResultsDisplay = ({ output, usage }) => {
79
83
  return "default";
80
84
  }
81
85
  };
82
- return ((0, jsx_runtime_1.jsxs)("div", { className: "task-results-display", children: [(0, jsx_runtime_1.jsxs)("div", { className: "task-results-header", children: [(0, jsx_runtime_1.jsx)(antd_1.Tag, { color: getStatusColor(task_status), children: task_status }), usage?.image_count && ((0, jsx_runtime_1.jsxs)(Text, { type: "secondary", className: "image-count-text", children: ["\u751F\u6210 ", usage.image_count, " \u5F20\u56FE\u7247"] })), submit_time && end_time && ((0, jsx_runtime_1.jsxs)(Text, { type: "secondary", className: "time-text", children: ["\u7528\u65F6: ", new Date(end_time).getTime() - new Date(submit_time).getTime(), "ms"] }))] }), task_status === "FAILED" && (code || message) && ((0, jsx_runtime_1.jsxs)("div", { className: "error-info-section", children: [(0, jsx_runtime_1.jsx)("div", { className: "error-header", children: (0, jsx_runtime_1.jsx)(Text, { strong: true, type: "danger", children: "\u274C \u4EFB\u52A1\u6267\u884C\u5931\u8D25" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "error-details", children: [code && ((0, jsx_runtime_1.jsxs)("div", { className: "error-code", children: [(0, jsx_runtime_1.jsx)(Text, { strong: true, children: "\u9519\u8BEF\u4EE3\u7801:" }), (0, jsx_runtime_1.jsx)(Text, { code: true, className: "error-code-text", children: code })] })), message && ((0, jsx_runtime_1.jsxs)("div", { className: "error-message", children: [(0, jsx_runtime_1.jsx)(Text, { strong: true, children: "\u9519\u8BEF\u4FE1\u606F:" }), (0, jsx_runtime_1.jsx)(Text, { type: "danger", className: "error-message-text", children: message })] }))] })] })), (0, jsx_runtime_1.jsx)("div", { className: "results-list", children: results.map((result, index) => ((0, jsx_runtime_1.jsx)(antd_1.Card, { size: "small", className: "result-card", children: (0, jsx_runtime_1.jsxs)("div", { className: "result-content", children: [result.url && ((0, jsx_runtime_1.jsxs)("div", { className: "image-container", children: [!imageLoadStates[index] && ((0, jsx_runtime_1.jsx)("div", { className: "image-loading", children: (0, jsx_runtime_1.jsx)("div", { className: "loading-text", children: "Loading" }) })), (0, jsx_runtime_1.jsx)("img", { src: result.url, alt: `Generated ${index + 1}`, className: `result-image ${imageLoadStates[index] ? "loaded" : ""}`, onClick: () => handleImagePreview(result.url, `生成图片 ${index + 1}`), onLoad: () => handleImageLoad(index) })] })), (0, jsx_runtime_1.jsxs)("div", { className: "text-info", children: [result.orig_prompt && ((0, jsx_runtime_1.jsxs)("div", { className: "prompt-section", children: [(0, jsx_runtime_1.jsx)(Text, { strong: true, className: "prompt-label", children: "\u539F\u59CB\u63D0\u793A\u8BCD:" }), (0, jsx_runtime_1.jsx)(Paragraph, { className: "prompt-text", ellipsis: { rows: 2, tooltip: result.orig_prompt }, children: result.orig_prompt })] })), result.actual_prompt && result.actual_prompt !== result.orig_prompt && ((0, jsx_runtime_1.jsxs)("div", { className: "prompt-section", children: [(0, jsx_runtime_1.jsx)(Text, { strong: true, className: "prompt-label", children: "\u4F18\u5316\u540E\u63D0\u793A\u8BCD:" }), (0, jsx_runtime_1.jsx)(Paragraph, { className: "prompt-text", ellipsis: { rows: 2, tooltip: result.actual_prompt }, children: result.actual_prompt })] })), result.url && ((0, jsx_runtime_1.jsxs)(antd_1.Space, { size: "small", className: "action-buttons", children: [(0, jsx_runtime_1.jsx)(antd_1.Button, { size: "small", icon: (0, jsx_runtime_1.jsx)(icons_1.EyeOutlined, {}), onClick: () => handleImagePreview(result.url, `生成图片 ${index + 1}`), children: "\u9884\u89C8" }), (0, jsx_runtime_1.jsx)(antd_1.Button, { size: "small", icon: (0, jsx_runtime_1.jsx)(icons_1.DownloadOutlined, {}), onClick: () => handleImageDownload(result.url, index), children: "\u4E0B\u8F7D" })] }))] })] }) }, index))) }), (0, jsx_runtime_1.jsx)(antd_1.Modal, { title: previewTitle, open: previewVisible, onCancel: () => setPreviewVisible(false), footer: [
86
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "task-results-display", children: [(0, jsx_runtime_1.jsxs)("div", { className: "task-results-header", children: [(0, jsx_runtime_1.jsx)(antd_1.Tag, { color: getStatusColor(task_status), children: task_status }), usage?.image_count && ((0, jsx_runtime_1.jsxs)(Text, { type: "secondary", className: "image-count-text", children: ["\u751F\u6210 ", usage.image_count, " \u5F20\u56FE\u7247"] })), submit_time && end_time && ((0, jsx_runtime_1.jsxs)(Text, { type: "secondary", className: "time-text", children: ["\u7528\u65F6: ", new Date(end_time).getTime() - new Date(submit_time).getTime(), "ms"] }))] }), task_status === "FAILED" && (code || message) && ((0, jsx_runtime_1.jsxs)("div", { className: "error-info-section", children: [(0, jsx_runtime_1.jsx)("div", { className: "error-header", children: (0, jsx_runtime_1.jsx)(Text, { strong: true, type: "danger", children: "\u274C \u4EFB\u52A1\u6267\u884C\u5931\u8D25" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "error-details", children: [code && ((0, jsx_runtime_1.jsxs)("div", { className: "error-code", children: [(0, jsx_runtime_1.jsx)(Text, { strong: true, children: "\u9519\u8BEF\u4EE3\u7801:" }), (0, jsx_runtime_1.jsx)(Text, { code: true, className: "error-code-text", children: code })] })), message && ((0, jsx_runtime_1.jsxs)("div", { className: "error-message", children: [(0, jsx_runtime_1.jsx)(Text, { strong: true, children: "\u9519\u8BEF\u4FE1\u606F:" }), (0, jsx_runtime_1.jsx)(Text, { type: "danger", className: "error-message-text", children: message })] }))] })] })), (0, jsx_runtime_1.jsx)("div", { className: "results-list", children: results.map((result, index) => ((0, jsx_runtime_1.jsx)(antd_1.Card, { size: "small", className: "result-card", children: (0, jsx_runtime_1.jsxs)("div", { className: "result-content", children: [result.url && ((0, jsx_runtime_1.jsxs)("div", { className: "image-container", children: [!imageLoadStates[index] && ((0, jsx_runtime_1.jsx)("div", { className: "image-loading", children: (0, jsx_runtime_1.jsx)("div", { className: "loading-text", children: "Loading" }) })), (0, jsx_runtime_1.jsx)("img", { src: result.url, alt: `Generated ${index + 1}`, className: `result-image ${imageLoadStates[index] ? "loaded" : ""}`, onClick: () => handleImagePreview(result.url, `生成图片 ${index + 1}`), onLoad: () => handleImageLoad(index) })] })), (0, jsx_runtime_1.jsxs)("div", { className: "text-info", children: [result.orig_prompt && ((0, jsx_runtime_1.jsxs)("div", { className: "prompt-section", children: [(0, jsx_runtime_1.jsx)(Text, { strong: true, className: "prompt-label", children: "\u539F\u59CB\u63D0\u793A\u8BCD:" }), (0, jsx_runtime_1.jsx)(Paragraph, { className: "prompt-text", ellipsis: {
87
+ rows: 2,
88
+ tooltip: result.orig_prompt,
89
+ }, children: result.orig_prompt })] })), result.actual_prompt && result.actual_prompt !== result.orig_prompt && ((0, jsx_runtime_1.jsxs)("div", { className: "prompt-section", children: [(0, jsx_runtime_1.jsx)(Text, { strong: true, className: "prompt-label", children: "\u4F18\u5316\u540E\u63D0\u793A\u8BCD:" }), (0, jsx_runtime_1.jsx)(Paragraph, { className: "prompt-text", ellipsis: {
90
+ rows: 2,
91
+ tooltip: result.actual_prompt,
92
+ }, children: result.actual_prompt })] })), result.url && ((0, jsx_runtime_1.jsxs)(antd_1.Space, { size: "small", className: "action-buttons", children: [(0, jsx_runtime_1.jsx)(antd_1.Button, { size: "small", icon: (0, jsx_runtime_1.jsx)(icons_1.EyeOutlined, {}), onClick: () => handleImagePreview(result.url, `生成图片 ${index + 1}`), children: "\u9884\u89C8" }), (0, jsx_runtime_1.jsx)(antd_1.Button, { size: "small", icon: (0, jsx_runtime_1.jsx)(icons_1.DownloadOutlined, {}), onClick: () => handleImageDownload(result.url, index), children: "\u4E0B\u8F7D" })] }))] })] }) }, index))) }), (0, jsx_runtime_1.jsx)(antd_1.Modal, { title: previewTitle, open: previewVisible, onCancel: () => setPreviewVisible(false), footer: [
83
93
  (0, jsx_runtime_1.jsx)(antd_1.Button, { icon: (0, jsx_runtime_1.jsx)(icons_1.DownloadOutlined, {}), onClick: () => {
84
94
  const link = document.createElement("a");
85
95
  link.href = previewImage;
@@ -140,7 +150,9 @@ const AsyncTaskBlock = (props) => {
140
150
  if (usage) {
141
151
  setTaskUsage(usage);
142
152
  }
143
- if (nextStatus === "SUCCEEDED" || nextStatus === "FAILED" || nextStatus === "CANCELED") {
153
+ if (nextStatus === "SUCCEEDED" ||
154
+ nextStatus === "FAILED" ||
155
+ nextStatus === "CANCELED") {
144
156
  setLoading(false);
145
157
  if (timerRef.current) {
146
158
  window.clearInterval(timerRef.current);
@@ -207,7 +219,6 @@ const AsyncTaskBlock = (props) => {
207
219
  ? "error"
208
220
  : pollStatus === "CANCELED"
209
221
  ? "warning"
210
- : "processing", children: pollStatus })] })), pollCount > 0 && !isManualRetry && ((0, jsx_runtime_1.jsxs)("div", { className: "poll-count", children: [(0, jsx_runtime_1.jsx)("span", { children: "\u8F6E\u8BE2:" }), (0, jsx_runtime_1.jsxs)("span", { className: "poll-count-badge", children: [pollCount, "/10"] })] }))] })] }), loading && ((0, jsx_runtime_1.jsx)("div", { className: "loading-container", children: (0, jsx_runtime_1.jsx)("div", { className: "loading-animation", children: (0, jsx_runtime_1.jsx)("div", { className: "loading-text", children: "Loading" }) }) })), isTimeout && ((0, jsx_runtime_1.jsxs)("div", { className: "timeout-retry-bar", children: [(0, jsx_runtime_1.jsx)("span", { className: "timeout-message", children: "\u8F6E\u8BE2\u8D85\u65F6\uFF0C\u8BF7\u624B\u52A8\u91CD\u8BD5" }), (0, jsx_runtime_1.jsx)(antd_1.Button, { size: "small", type: "primary", icon: (0, jsx_runtime_1.jsx)(icons_1.ReloadOutlined, {}), onClick: handleRetry, children: "\u91CD\u8BD5" })] })), !loading && taskOutput && (0, jsx_runtime_1.jsx)(TaskResultsDisplay, { output: taskOutput, usage: taskUsage || undefined })] }));
222
+ : "processing", children: pollStatus })] })), pollCount > 0 && !isManualRetry && ((0, jsx_runtime_1.jsxs)("div", { className: "poll-count", children: [(0, jsx_runtime_1.jsx)("span", { children: "\u8F6E\u8BE2:" }), (0, jsx_runtime_1.jsxs)("span", { className: "poll-count-badge", children: [pollCount, "/10"] })] }))] })] }), loading && ((0, jsx_runtime_1.jsx)("div", { className: "loading-container", children: (0, jsx_runtime_1.jsx)("div", { className: "loading-animation", children: (0, jsx_runtime_1.jsx)("div", { className: "loading-text", children: "Loading" }) }) })), isTimeout && ((0, jsx_runtime_1.jsxs)("div", { className: "timeout-retry-bar", children: [(0, jsx_runtime_1.jsx)("span", { className: "timeout-message", children: "\u8F6E\u8BE2\u8D85\u65F6\uFF0C\u8BF7\u624B\u52A8\u91CD\u8BD5" }), (0, jsx_runtime_1.jsx)(antd_1.Button, { size: "small", type: "primary", icon: (0, jsx_runtime_1.jsx)(icons_1.ReloadOutlined, {}), onClick: handleRetry, children: "\u91CD\u8BD5" })] })), !loading && taskOutput && ((0, jsx_runtime_1.jsx)(TaskResultsDisplay, { output: taskOutput, usage: taskUsage || undefined }))] }));
211
223
  };
212
224
  exports.AsyncTaskBlock = AsyncTaskBlock;
213
- //# sourceMappingURL=AsyncTaskBlock.js.map
@@ -1,3 +1,2 @@
1
- import React from "react";
1
+ import type React from "react";
2
2
  export declare const AuthIndicator: React.FC;
3
- //# sourceMappingURL=AuthIndicator.d.ts.map
@@ -19,4 +19,3 @@ const AuthIndicator = () => {
19
19
  return ((0, jsx_runtime_1.jsx)("div", { className: "auth-indicator not-logged-in", children: (0, jsx_runtime_1.jsx)("span", { className: "auth-status", children: "\u672A\u767B\u5F55" }) }));
20
20
  };
21
21
  exports.AuthIndicator = AuthIndicator;
22
- //# sourceMappingURL=AuthIndicator.js.map
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import type React from "react";
2
2
  import "./ErrorCard.less";
3
3
  interface ErrorCardProps {
4
4
  code?: string | number;
@@ -8,4 +8,3 @@ interface ErrorCardProps {
8
8
  }
9
9
  export declare const ErrorCard: React.FC<ErrorCardProps>;
10
10
  export {};
11
- //# sourceMappingURL=ErrorCard.d.ts.map
@@ -2,17 +2,19 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ErrorCard = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const ThemeContext_1 = require("../contexts/ThemeContext");
5
6
  require("./ErrorCard.less");
6
7
  const ErrorCard = ({ code, log_id, details, rawData }) => {
7
- // rawData 中获取错误信息(标准格式)
8
- const errorMessage = rawData?.message || rawData?.error || details?.message || (typeof details === "string" ? details : "未知错误");
8
+ const { isDark } = (0, ThemeContext_1.useThemeHook)();
9
+ const errorMessage = rawData?.message ||
10
+ rawData?.error ||
11
+ details?.message ||
12
+ (typeof details === "string" ? details : "未知错误");
9
13
  const errorCode = code || rawData?.code;
10
14
  const errorLogId = log_id || rawData?.log_id;
11
- // 过滤掉空值,只保留有效的错误详情
12
15
  const filteredDetails = rawData
13
16
  ? Object.fromEntries(Object.entries(rawData).filter(([_, value]) => value !== undefined && value !== null && value !== ""))
14
17
  : null;
15
- return ((0, jsx_runtime_1.jsxs)("div", { className: "error-card", children: [(0, jsx_runtime_1.jsxs)("div", { className: "error-card__header", children: [(0, jsx_runtime_1.jsx)("div", { className: "error-card__header-icon", children: "!" }), (0, jsx_runtime_1.jsx)("span", { className: "error-card__header-title", children: "\u9519\u8BEF\u4FE1\u606F" })] }), (0, jsx_runtime_1.jsx)("div", { className: "error-card__message", children: errorMessage }), (errorCode || errorLogId) && ((0, jsx_runtime_1.jsxs)("div", { className: "error-card__meta", children: [errorCode && ((0, jsx_runtime_1.jsxs)("div", { className: "error-card__meta-item", children: [(0, jsx_runtime_1.jsx)("span", { className: "error-card__meta-item-label", children: "\u9519\u8BEF\u7801:" }), " ", errorCode] })), errorLogId && ((0, jsx_runtime_1.jsxs)("div", { className: "error-card__meta-item", children: [(0, jsx_runtime_1.jsx)("span", { className: "error-card__meta-item-label", children: "\u65E5\u5FD7ID:" }), " ", errorLogId] }))] })), filteredDetails && Object.keys(filteredDetails).length > 0 && ((0, jsx_runtime_1.jsxs)("details", { className: "error-card__details", children: [(0, jsx_runtime_1.jsx)("summary", { className: "error-card__details-summary", children: "\u8BE6\u7EC6\u4FE1\u606F" }), (0, jsx_runtime_1.jsx)("pre", { className: "error-card__details-content", children: JSON.stringify(filteredDetails, null, 2) })] }))] }));
18
+ return ((0, jsx_runtime_1.jsxs)("div", { className: `error-card ${isDark ? "dark" : ""}`, children: [(0, jsx_runtime_1.jsxs)("div", { className: "error-card__header", children: [(0, jsx_runtime_1.jsx)("div", { className: "error-card__header-icon", children: "!" }), (0, jsx_runtime_1.jsx)("span", { className: "error-card__header-title", children: "\u9519\u8BEF\u4FE1\u606F" })] }), (0, jsx_runtime_1.jsx)("div", { className: "error-card__message", children: errorMessage }), (errorCode || errorLogId) && ((0, jsx_runtime_1.jsxs)("div", { className: "error-card__meta", children: [errorCode && ((0, jsx_runtime_1.jsxs)("div", { className: "error-card__meta-item", children: [(0, jsx_runtime_1.jsx)("span", { className: "error-card__meta-item-label", children: "\u9519\u8BEF\u7801:" }), " ", errorCode] })), errorLogId && ((0, jsx_runtime_1.jsxs)("div", { className: "error-card__meta-item", children: [(0, jsx_runtime_1.jsx)("span", { className: "error-card__meta-item-label", children: "\u65E5\u5FD7ID:" }), " ", errorLogId] }))] })), filteredDetails && Object.keys(filteredDetails).length > 0 && ((0, jsx_runtime_1.jsxs)("details", { className: "error-card__details", children: [(0, jsx_runtime_1.jsx)("summary", { className: "error-card__details-summary", children: "\u8BE6\u7EC6\u4FE1\u606F" }), (0, jsx_runtime_1.jsx)("pre", { className: "error-card__details-content", children: JSON.stringify(filteredDetails, null, 2) })] }))] }));
16
19
  };
17
20
  exports.ErrorCard = ErrorCard;
18
- //# sourceMappingURL=ErrorCard.js.map
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import type React from "react";
2
2
  interface Chunk {
3
3
  id: string;
4
4
  score: number;
@@ -17,4 +17,3 @@ interface KnowledgeBaseSearchBlockProps {
17
17
  }
18
18
  export declare const KnowledgeBaseSearchBlock: React.FC<KnowledgeBaseSearchBlockProps>;
19
19
  export {};
20
- //# sourceMappingURL=KnowledgeBaseSearchBlock.d.ts.map
@@ -37,9 +37,10 @@ const useStyles = (0, antd_style_1.createStyles)(({ token, css }) => ({
37
37
  const KnowledgeBaseSearchBlock = ({ query, knowledge_base_id, score_threshold, knowledge_search_mode, chunks, isResponse, reason_msg, has_result, }) => {
38
38
  const [isExpanded, setIsExpanded] = (0, react_1.useState)(true);
39
39
  const { styles } = useStyles();
40
- const headerText = isResponse ? "知识库检索结果(检索到 " + (chunks?.length || 0) + " 条)" : "知识库检索";
40
+ const headerText = isResponse
41
+ ? "知识库检索结果(检索到 " + (chunks?.length || 0) + " 条)"
42
+ : "知识库检索";
41
43
  const icon = (0, jsx_runtime_1.jsx)(icons_1.SearchOutlined, {});
42
- return ((0, jsx_runtime_1.jsxs)("div", { className: styles.block, style: { width: "100%" }, children: [(0, jsx_runtime_1.jsx)(_1.ToolUseBlockHeader, { toolName: headerText, isExpanded: isExpanded, onToggleExpand: () => setIsExpanded(!isExpanded), icon: icon }), isExpanded && ((0, jsx_runtime_1.jsx)("div", { className: styles.body, children: !isResponse ? ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: styles.query, children: ["\u67E5\u8BE2: \"", query, "\""] }), (0, jsx_runtime_1.jsxs)("div", { className: styles.kbId, children: ["\u77E5\u8BC6\u5E93ID: ", knowledge_base_id || "N/A"] }), knowledge_search_mode && (0, jsx_runtime_1.jsxs)("div", { className: styles.param, children: ["\u68C0\u7D22\u6A21\u5F0F: ", knowledge_search_mode] }), score_threshold !== undefined && (0, jsx_runtime_1.jsxs)("div", { className: styles.param, children: ["\u9608\u503C: ", score_threshold] })] })) : ((0, jsx_runtime_1.jsx)("div", { children: has_result && chunks?.length ? (chunks.map((chunk, index) => (0, jsx_runtime_1.jsx)(_1.KnowledgeBaseSearchResult, { ...chunk }, chunk.id || index))) : ((0, jsx_runtime_1.jsx)("div", { className: styles.noResult, children: reason_msg || "未找到相关内容" })) })) }))] }));
44
+ return ((0, jsx_runtime_1.jsxs)("div", { className: styles.block, style: { width: "100%" }, children: [(0, jsx_runtime_1.jsx)(_1.ToolUseBlockHeader, { toolName: headerText, isExpanded: isExpanded, onToggleExpand: () => setIsExpanded(!isExpanded), icon: icon }), isExpanded && ((0, jsx_runtime_1.jsx)("div", { className: styles.body, children: !isResponse ? ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: styles.query, children: ["\u67E5\u8BE2: \"", query, "\""] }), (0, jsx_runtime_1.jsxs)("div", { className: styles.kbId, children: ["\u77E5\u8BC6\u5E93ID: ", knowledge_base_id || "N/A"] }), knowledge_search_mode && ((0, jsx_runtime_1.jsxs)("div", { className: styles.param, children: ["\u68C0\u7D22\u6A21\u5F0F: ", knowledge_search_mode] })), score_threshold !== undefined && ((0, jsx_runtime_1.jsxs)("div", { className: styles.param, children: ["\u9608\u503C: ", score_threshold] }))] })) : ((0, jsx_runtime_1.jsx)("div", { children: has_result && chunks?.length ? (chunks.map((chunk, index) => ((0, jsx_runtime_1.jsx)(_1.KnowledgeBaseSearchResult, { ...chunk }, chunk.id || index)))) : ((0, jsx_runtime_1.jsx)("div", { className: styles.noResult, children: reason_msg || "未找到相关内容" })) })) }))] }));
43
45
  };
44
46
  exports.KnowledgeBaseSearchBlock = KnowledgeBaseSearchBlock;
45
- //# sourceMappingURL=KnowledgeBaseSearchBlock.js.map
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import type React from "react";
2
2
  interface KnowledgeBaseSearchResultProps {
3
3
  id: string;
4
4
  score: number;
@@ -6,4 +6,3 @@ interface KnowledgeBaseSearchResultProps {
6
6
  }
7
7
  export declare const KnowledgeBaseSearchResult: React.FC<KnowledgeBaseSearchResultProps>;
8
8
  export {};
9
- //# sourceMappingURL=KnowledgeBaseSearchResult.d.ts.map
@@ -23,9 +23,8 @@ const useStyles = (0, antd_style_1.createStyles)(({ token, css }) => ({
23
23
  font-size: 12px;
24
24
  `,
25
25
  }));
26
- const KnowledgeBaseSearchResult = ({ score, detail }) => {
26
+ const KnowledgeBaseSearchResult = ({ score, detail, }) => {
27
27
  const { styles } = useStyles();
28
28
  return ((0, jsx_runtime_1.jsxs)("div", { className: styles.result, children: [(0, jsx_runtime_1.jsx)("div", { className: styles.detail, children: detail }), (0, jsx_runtime_1.jsxs)("div", { className: styles.score, children: ["\u76F8\u5173\u6027\u5206\u6570: ", score.toFixed(4)] })] }));
29
29
  };
30
30
  exports.KnowledgeBaseSearchResult = KnowledgeBaseSearchResult;
31
- //# sourceMappingURL=KnowledgeBaseSearchResult.js.map
@@ -1,7 +1,6 @@
1
- import React from "react";
1
+ import type React from "react";
2
2
  interface MarkdownRendererProps {
3
3
  content: string;
4
4
  }
5
5
  export declare const MarkdownRenderer: React.FC<MarkdownRendererProps>;
6
6
  export {};
7
- //# sourceMappingURL=MarkdownRenderer.d.ts.map
@@ -1,17 +1,13 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.MarkdownRenderer = void 0;
7
4
  const jsx_runtime_1 = require("react/jsx-runtime");
8
5
  const antd_1 = require("antd");
9
6
  const antd_style_1 = require("antd-style");
10
- const markdown_it_1 = __importDefault(require("markdown-it"));
11
7
  const react_1 = require("react");
12
8
  const copilot_1 = require("../styles/copilot");
13
- const md = (0, markdown_it_1.default)({ html: true, breaks: true });
14
- const useStyles = (0, antd_style_1.createStyles)(({ token, css }) => ({
9
+ const markdownHighlight_1 = require("../utils/markdownHighlight");
10
+ const useStyles = (0, antd_style_1.createStyles)(({ css }) => ({
15
11
  // Markdown 内容容器
16
12
  markdownContent: css `
17
13
  transition: opacity 0.2s ease-in-out;
@@ -21,8 +17,7 @@ const useStyles = (0, antd_style_1.createStyles)(({ token, css }) => ({
21
17
  const MarkdownRenderer = ({ content }) => {
22
18
  const { styles } = useStyles();
23
19
  const { styles: copilotStyles } = (0, copilot_1.useCopilotStyle)();
24
- const html = (0, react_1.useMemo)(() => md.render(content), [content]);
20
+ const html = (0, react_1.useMemo)(() => markdownHighlight_1.mdWithHighlight.render(content), [content]);
25
21
  return ((0, jsx_runtime_1.jsx)(antd_1.Typography, { children: (0, jsx_runtime_1.jsx)("div", { className: `markdown-content ${copilotStyles.markdownContent} ${styles.markdownContent}`, dangerouslySetInnerHTML: { __html: html } }) }));
26
22
  };
27
23
  exports.MarkdownRenderer = MarkdownRenderer;
28
- //# sourceMappingURL=MarkdownRenderer.js.map
@@ -1,7 +1,6 @@
1
- import React from "react";
1
+ import type React from "react";
2
2
  import type { ChatMessage } from "../types";
3
3
  export interface MessageRendererProps {
4
4
  message: ChatMessage;
5
5
  }
6
6
  export declare const MessageRenderer: React.FC<MessageRendererProps>;
7
- //# sourceMappingURL=MessageRenderer.d.ts.map