paul-ai-assistant 1.0.2 → 1.0.4

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 (213) hide show
  1. package/dist/6254.async.js +490 -490
  2. package/dist/7084.async.js +247 -0
  3. package/dist/customer-service-typewriter/index.html +44 -0
  4. package/dist/demos.async.js +384 -10
  5. package/dist/demos__customerServiceTypewriter__index.md.async.js +2 -0
  6. package/dist/dumi__tmp-production__dumi__theme__ContextWrapper.async.js +1 -1
  7. package/dist/meta__demos.async.js +1601 -1
  8. package/dist/meta__docs.async.js +29 -28
  9. package/dist/preload_helper.js +1 -1
  10. package/dist/umi.js +47 -47
  11. package/dist/~demos/demos-customer-service-typewriter-demo-customer-service-demo/index.html +44 -0
  12. package/dist/~demos/demos-customer-service-typewriter-demo-smart-scroll-demo/index.html +44 -0
  13. package/es/AssistantChat/AssistantChatApp/const.js +1 -1
  14. package/es/AssistantChat/AssistantChatApp/index.js +1 -1
  15. package/es/AssistantChat/AssistantChatCard/AgentCardRender/component/TraceComponent.js +4 -4
  16. package/es/AssistantChat/AssistantChatCard/AgentCardRender/index.js +4 -5
  17. package/es/AssistantChat/AssistantChatCard/LlmGenerateCard/index.js +2 -2
  18. package/es/AssistantChat/AssistantChatCard/LlmGenerateCardV5/index.js +1 -1
  19. package/es/AssistantChat/AssistantChatCard/OperationCard/Copy/index.js +1 -1
  20. package/es/AssistantChat/AssistantChatCard/OperationCard/CopyRequestId/index.js +1 -1
  21. package/es/AssistantChat/AssistantChatCard/OperationCard/FeedBack/index.js +2 -2
  22. package/es/AssistantChat/AssistantChatCard/OperationCard/ShareButton/index.js +1 -1
  23. package/es/AssistantChat/AssistantChatCard/OperationCard/index.js +1 -1
  24. package/es/AssistantChat/AssistantChatCard/UserQueryCardRender/AttachmentsRender.js +4 -4
  25. package/es/AssistantChat/AssistantChatCard/UserQueryCardRender/ImageRender.js +6 -6
  26. package/es/AssistantChat/AssistantChatInput/index.js +7 -5
  27. package/es/common/registerAssistChatForm.js +8 -5
  28. package/es/components/AgentCardSubmit/index.js +1 -2
  29. package/es/components/AgentResult/index.js +1 -1
  30. package/es/components/AgentSchemaForm/ScreenshotView.js +1 -1
  31. package/es/components/AgentSchemaForm/index.js +5 -5
  32. package/es/components/ArrayInput/index.js +1 -1
  33. package/es/components/InspectionCard/index.js +1 -1
  34. package/es/components/LlmMarkDown/MdAmarkGuess/index.js +1 -1
  35. package/es/components/LlmMarkDown/MdAmarkReference/index.js +3 -3
  36. package/es/components/LlmMarkDown/index.js +1 -1
  37. package/es/components/LlmModelChange/index.js +2 -2
  38. package/es/components/LlmReference/index.js +9 -9
  39. package/es/components/LlmTraceComponents/Disassemble/index.js +2 -2
  40. package/es/components/LlmTraceComponents/Rewrite/index.js +2 -2
  41. package/es/components/MarkDown/index.js +42 -13
  42. package/es/components/ModelSelect/ModeDropdown.js +1 -1
  43. package/es/components/ModelSelect/const.js +3 -3
  44. package/es/components/PaulButtonGroup/Select.js +2 -2
  45. package/es/components/PaulButtonGroup/index.js +2 -2
  46. package/es/components/PopAuth/index.js +2 -2
  47. package/es/components/SchemaInput/SchemaInputCore/index.js +1 -1
  48. package/es/components/SchemaInput/SimpleJSONEditor/index.js +1 -1
  49. package/es/components/SelectBlurry/index.js +2 -2
  50. package/es/components/ShareModal/index.js +2 -2
  51. package/es/components/ShareOperationBar/index.js +2 -2
  52. package/es/components/TextContent/index.js +3 -3
  53. package/es/components/TraceWithAgent/index.js +4 -9
  54. package/es/context/index.js +2 -1
  55. package/es/context/utils/messages.js +2 -2
  56. package/es/context/utils/send.js +3 -3
  57. package/es/context/utils/tool.js +2 -2
  58. package/es/utils/CSEIconTool.js +1 -1
  59. package/es/utils/apushAssistant.js +2 -3
  60. package/es/utils/clientPlugin.js +1 -1
  61. package/es/utils/common.js +17 -0
  62. package/es/utils/event.js +87 -0
  63. package/es/utils/formDataFormat.js +1 -1
  64. package/es/utils/formatData.js +1 -1
  65. package/es/utils/helpers.js +78 -0
  66. package/es/utils/log.js +1 -1
  67. package/es/utils/request.js +74 -0
  68. package/es/utils/send.js +1 -1
  69. package/es/utils/uploadImage.js +1 -1
  70. package/package.json +6 -19
  71. package/dist/2517.async.js +0 -247
  72. package/es/AssistantChat/AssistantChatApp/CardMatchRender/index.d.ts +0 -8
  73. package/es/AssistantChat/AssistantChatApp/OperationMatchRender/index.d.ts +0 -9
  74. package/es/AssistantChat/AssistantChatApp/const.d.ts +0 -51
  75. package/es/AssistantChat/AssistantChatApp/index.d.ts +0 -4
  76. package/es/AssistantChat/AssistantChatCard/AgentCardRender/TemplateCard.d.ts +0 -3
  77. package/es/AssistantChat/AssistantChatCard/AgentCardRender/common/types.d.ts +0 -3
  78. package/es/AssistantChat/AssistantChatCard/AgentCardRender/component/TemplateHeader.d.ts +0 -5
  79. package/es/AssistantChat/AssistantChatCard/AgentCardRender/component/TemplateHtml.d.ts +0 -7
  80. package/es/AssistantChat/AssistantChatCard/AgentCardRender/component/TemplateParagraph.d.ts +0 -3
  81. package/es/AssistantChat/AssistantChatCard/AgentCardRender/component/TemplateTitle.d.ts +0 -3
  82. package/es/AssistantChat/AssistantChatCard/AgentCardRender/component/TraceComponent.d.ts +0 -3
  83. package/es/AssistantChat/AssistantChatCard/AgentCardRender/context/index.d.ts +0 -29
  84. package/es/AssistantChat/AssistantChatCard/AgentCardRender/index.d.ts +0 -4
  85. package/es/AssistantChat/AssistantChatCard/AgentCardRender/utils.d.ts +0 -2
  86. package/es/AssistantChat/AssistantChatCard/AgentCommonCard/index.d.ts +0 -4
  87. package/es/AssistantChat/AssistantChatCard/AgentExecutionCard/index.d.ts +0 -16
  88. package/es/AssistantChat/AssistantChatCard/LlmGenerateCard/index.d.ts +0 -14
  89. package/es/AssistantChat/AssistantChatCard/LlmGenerateCardV5/index.d.ts +0 -78
  90. package/es/AssistantChat/AssistantChatCard/OperationCard/AigcTipsRender/index.d.ts +0 -7
  91. package/es/AssistantChat/AssistantChatCard/OperationCard/Copy/index.d.ts +0 -7
  92. package/es/AssistantChat/AssistantChatCard/OperationCard/CopyRequestId/index.d.ts +0 -3
  93. package/es/AssistantChat/AssistantChatCard/OperationCard/FeedBack/index.d.ts +0 -11
  94. package/es/AssistantChat/AssistantChatCard/OperationCard/ShareButton/index.d.ts +0 -3
  95. package/es/AssistantChat/AssistantChatCard/OperationCard/index.d.ts +0 -4
  96. package/es/AssistantChat/AssistantChatCard/UserQueryCardRender/AttachmentsRender.d.ts +0 -21
  97. package/es/AssistantChat/AssistantChatCard/UserQueryCardRender/ImageRender.d.ts +0 -7
  98. package/es/AssistantChat/AssistantChatCard/UserQueryCardRender/index.d.ts +0 -8
  99. package/es/AssistantChat/AssistantChatCard/index.d.ts +0 -5
  100. package/es/AssistantChat/AssistantChatInput/index.d.ts +0 -5
  101. package/es/AssistantChat/AssistantToolApp/const.d.ts +0 -12
  102. package/es/AssistantChat/AssistantToolApp/index.d.ts +0 -4
  103. package/es/AssistantChat/AssistantToolExecutionApp/const.d.ts +0 -7
  104. package/es/AssistantChat/AssistantToolExecutionApp/index.d.ts +0 -4
  105. package/es/AssistantChat/AssistentError/index.d.ts +0 -5
  106. package/es/AssistantChat/index.d.ts +0 -6
  107. package/es/AssistantChat/logCallback/aTagLog.d.ts +0 -1
  108. package/es/AssistantChat/logCallback/copyLog.d.ts +0 -3
  109. package/es/ErrorBoundary/ErrorBoundaryFallback/index.d.ts +0 -5
  110. package/es/ErrorBoundary/index.d.ts +0 -22
  111. package/es/common/registerAssistChatForm.d.ts +0 -2
  112. package/es/components/AgentCardSubmit/index.d.ts +0 -20
  113. package/es/components/AgentResult/index.d.ts +0 -8
  114. package/es/components/AgentSchemaForm/ScreenshotView.d.ts +0 -12
  115. package/es/components/AgentSchemaForm/_interface.d.ts +0 -37
  116. package/es/components/AgentSchemaForm/index.d.ts +0 -9
  117. package/es/components/AgentText/index.d.ts +0 -4
  118. package/es/components/AigcTips/index.d.ts +0 -9
  119. package/es/components/ArrayInput/index.d.ts +0 -3
  120. package/es/components/AssistantDrawer/index.d.ts +0 -22
  121. package/es/components/EmptyIcon/index.d.ts +0 -3
  122. package/es/components/HeaderSvgIcon/index.d.ts +0 -3
  123. package/es/components/InspectionCard/index.d.ts +0 -66
  124. package/es/components/InspectionCard/result.d.ts +0 -13
  125. package/es/components/LlmMarkDown/MdAmarkGuess/index.d.ts +0 -16
  126. package/es/components/LlmMarkDown/MdAmarkReference/index.d.ts +0 -21
  127. package/es/components/LlmMarkDown/index.d.ts +0 -30
  128. package/es/components/LlmModelChange/index.d.ts +0 -57
  129. package/es/components/LlmReference/index.d.ts +0 -25
  130. package/es/components/LlmTitle/index.d.ts +0 -14
  131. package/es/components/LlmTrace/index.d.ts +0 -17
  132. package/es/components/LlmTraceComponents/Disassemble/index.d.ts +0 -24
  133. package/es/components/LlmTraceComponents/ReadResource/index.d.ts +0 -24
  134. package/es/components/LlmTraceComponents/Rewrite/index.d.ts +0 -23
  135. package/es/components/LlmTraceComponents/TraceMarkDown/index.d.ts +0 -22
  136. package/es/components/LlmTraceComponents/const.d.ts +0 -25
  137. package/es/components/LlmTraceV2/index.d.ts +0 -56
  138. package/es/components/LlmTraceV3/components/TraceContentComponents/BusinessFlow/index.d.ts +0 -13
  139. package/es/components/LlmTraceV3/components/TraceContentComponents/CodeBlock/index.d.ts +0 -18
  140. package/es/components/LlmTraceV3/components/TraceContentComponents/DeepThinking/index.d.ts +0 -13
  141. package/es/components/LlmTraceV3/components/TraceContentComponents/InfoMissing/index.d.ts +0 -13
  142. package/es/components/LlmTraceV3/components/TraceContentComponents/LinkList/index.d.ts +0 -20
  143. package/es/components/LlmTraceV3/components/TraceContentComponents/SearchResults/index.d.ts +0 -13
  144. package/es/components/LlmTraceV3/components/TraceContentComponents/TaskPlanning/index.d.ts +0 -12
  145. package/es/components/LlmTraceV3/components/TraceContentComponents/ToolCall/index.d.ts +0 -13
  146. package/es/components/LlmTraceV3/components/TraceContentComponents/ToolResult/index.d.ts +0 -13
  147. package/es/components/LlmTraceV3/components/TraceContentComponents/const.d.ts +0 -32
  148. package/es/components/LlmTraceV3/components/TraceGroup/index.d.ts +0 -8
  149. package/es/components/LlmTraceV3/components/TraceHeader/index.d.ts +0 -8
  150. package/es/components/LlmTraceV3/components/TraceItem/index.d.ts +0 -8
  151. package/es/components/LlmTraceV3/components/TraceSlide/index.d.ts +0 -30
  152. package/es/components/LlmTraceV3/components/TraceStatusIcon/index.d.ts +0 -8
  153. package/es/components/LlmTraceV3/hooks/useGroupCollapse.d.ts +0 -18
  154. package/es/components/LlmTraceV3/hooks/useItemCollapse.d.ts +0 -18
  155. package/es/components/LlmTraceV3/hooks/useTraceAnimation.d.ts +0 -15
  156. package/es/components/LlmTraceV3/hooks/useTraceCollapse.d.ts +0 -17
  157. package/es/components/LlmTraceV3/index.d.ts +0 -11
  158. package/es/components/LlmTraceV3/types.d.ts +0 -263
  159. package/es/components/LlmTraceV3/utils/collapseLogic.d.ts +0 -26
  160. package/es/components/LlmTraceV3/utils/traceHelpers.d.ts +0 -42
  161. package/es/components/MarkDown/index.d.ts +0 -11
  162. package/es/components/ModelSelect/ModeDropdown.d.ts +0 -8
  163. package/es/components/ModelSelect/const.d.ts +0 -30
  164. package/es/components/ModelSelect/index.d.ts +0 -4
  165. package/es/components/PaulButtonGroup/Select.d.ts +0 -3
  166. package/es/components/PaulButtonGroup/index.d.ts +0 -16
  167. package/es/components/PopAuth/index.d.ts +0 -4
  168. package/es/components/ReferenceInfoItem/index.d.ts +0 -49
  169. package/es/components/ReferenceTag/index.d.ts +0 -11
  170. package/es/components/SchemaInput/SchemaInputCore/index.d.ts +0 -4
  171. package/es/components/SchemaInput/SchemaInputCore/utils.d.ts +0 -1
  172. package/es/components/SchemaInput/SimpleJSONEditor/index.d.ts +0 -4
  173. package/es/components/SchemaInput/index.d.ts +0 -8
  174. package/es/components/SelectBlurry/index.d.ts +0 -3
  175. package/es/components/SendMessageSvgIcon/index.d.ts +0 -3
  176. package/es/components/ShareContent/index.d.ts +0 -21
  177. package/es/components/ShareModal/index.d.ts +0 -15
  178. package/es/components/ShareOperationBar/index.d.ts +0 -4
  179. package/es/components/TextContent/index.d.ts +0 -14
  180. package/es/components/TraceMarkdownWithCard/index.d.ts +0 -6
  181. package/es/components/TraceWithAgent/index.d.ts +0 -23
  182. package/es/constants/assistChatEvent.d.ts +0 -33
  183. package/es/constants/common.d.ts +0 -71
  184. package/es/constants/logTrace.d.ts +0 -3
  185. package/es/constants/reference.d.ts +0 -109
  186. package/es/constants/traceDataStatus.d.ts +0 -34
  187. package/es/context/index.d.ts +0 -13
  188. package/es/context/utils/messages.d.ts +0 -33
  189. package/es/context/utils/send.d.ts +0 -29
  190. package/es/context/utils/tool.d.ts +0 -19
  191. package/es/index.d.ts +0 -37
  192. package/es/interface/IAgent.d.ts +0 -12
  193. package/es/interface/IChatBottom.d.ts +0 -69
  194. package/es/interface/IChatCard.d.ts +0 -40
  195. package/es/interface/IChatContext.d.ts +0 -59
  196. package/es/interface/IChatRef.d.ts +0 -75
  197. package/es/interface/IGuessQuestion.d.ts +0 -43
  198. package/es/interface/IMessage.d.ts +0 -17
  199. package/es/interface/ISend.d.ts +0 -19
  200. package/es/interface/index.d.ts +0 -272
  201. package/es/utils/CSEIconTool.d.ts +0 -8
  202. package/es/utils/apushAssistant.d.ts +0 -73
  203. package/es/utils/clientPlugin.d.ts +0 -3
  204. package/es/utils/common.d.ts +0 -10
  205. package/es/utils/copyToClipboard.d.ts +0 -2
  206. package/es/utils/formDataFormat.d.ts +0 -3
  207. package/es/utils/formatData.d.ts +0 -14
  208. package/es/utils/log.d.ts +0 -18
  209. package/es/utils/parseUrl.d.ts +0 -9
  210. package/es/utils/screenshot.d.ts +0 -45
  211. package/es/utils/send.d.ts +0 -10
  212. package/es/utils/uploadImage.d.ts +0 -9
  213. package/es/utils/websocketLogger.d.ts +0 -176
@@ -7,10 +7,11 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
7
7
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
8
8
  var _excluded = ["inline", "className", "children"],
9
9
  _excluded2 = ["data", "linkTarget", "className"],
10
- _excluded3 = ["remarkPlugins", "rehypePlugins", "components"];
10
+ _excluded3 = ["remarkPlugins", "rehypePlugins", "components", "previewImg"],
11
+ _excluded4 = ["node", "src", "alt"],
12
+ _excluded5 = ["node"];
11
13
  import React, { useEffect, useRef } from 'react';
12
- import { previewImg } from '@alife/goc-utils';
13
- import { MarkDown } from '@alife/magic-chat-ui';
14
+ import { previewImg } from "../../utils/helpers";
14
15
  import katex from 'katex';
15
16
  import mermaid from 'mermaid';
16
17
  import rehypeHighlight from 'rehype-highlight';
@@ -19,6 +20,7 @@ import rehypeRaw from 'rehype-raw';
19
20
  import remarkGfm from 'remark-gfm';
20
21
  import remarkMath from 'remark-math';
21
22
  import 'katex/dist/katex.min.css';
23
+ import ReactMarkdown from 'react-markdown';
22
24
  import "./index.scss";
23
25
  // LaTeX 渲染组件
24
26
  var LatexBlock = function LatexBlock(_ref) {
@@ -190,6 +192,7 @@ export default (function (_ref5) {
190
192
  var extraRemarkPlugins = otherProps.remarkPlugins,
191
193
  extraRehypePlugins = otherProps.rehypePlugins,
192
194
  extraComponents = otherProps.components,
195
+ customPreviewImg = otherProps.previewImg,
193
196
  restProps = _objectWithoutProperties(otherProps, _excluded3);
194
197
  var finalRemarkPlugins = [[remarkGfm, {
195
198
  singleTilde: false
@@ -204,19 +207,45 @@ export default (function (_ref5) {
204
207
  rehypeRaw,
205
208
  // 继承默认:支持 HTML
206
209
  rehypeKatex].concat(_toConsumableArray(extraRehypePlugins || []));
210
+ var defaultPreviewImg = function defaultPreviewImg(src) {
211
+ if (customPreviewImg) {
212
+ customPreviewImg(src);
213
+ } else {
214
+ previewImg(src);
215
+ }
216
+ };
207
217
  var finalComponents = _objectSpread({
208
- code: CodeBlock
209
- }, extraComponents || {});
210
- return /*#__PURE__*/React.createElement(MarkDown, _extends({
211
- hasOptions: true,
212
- previewImg: previewImg,
213
- linkTarget: linkTarget,
214
- transformLinkUri: function transformLinkUri(url) {
215
- return url;
218
+ code: CodeBlock,
219
+ // 自定义代码块,支持 Mermaid
220
+ img: function img(_ref6) {
221
+ var node = _ref6.node,
222
+ src = _ref6.src,
223
+ alt = _ref6.alt,
224
+ props = _objectWithoutProperties(_ref6, _excluded4);
225
+ return /*#__PURE__*/React.createElement("img", _extends({
226
+ src: src,
227
+ alt: alt,
228
+ onClick: function onClick() {
229
+ return defaultPreviewImg(src);
230
+ },
231
+ style: {
232
+ cursor: 'pointer'
233
+ }
234
+ }, props));
216
235
  },
217
- className: "assist-chat-markdown-content ".concat(className),
236
+ a: function a(_ref7) {
237
+ var node = _ref7.node,
238
+ props = _objectWithoutProperties(_ref7, _excluded5);
239
+ return /*#__PURE__*/React.createElement("a", _extends({
240
+ target: linkTarget
241
+ }, props));
242
+ }
243
+ }, extraComponents || {});
244
+ return /*#__PURE__*/React.createElement("div", {
245
+ className: "assist-chat-markdown-content ".concat(className)
246
+ }, /*#__PURE__*/React.createElement(ReactMarkdown, _extends({
218
247
  remarkPlugins: finalRemarkPlugins,
219
248
  rehypePlugins: finalRehypePlugins,
220
249
  components: finalComponents
221
- }, restProps), data);
250
+ }, restProps), data));
222
251
  });
@@ -6,7 +6,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
6
6
  * @description 模式选择的Dropdown
7
7
  */
8
8
  import React, { useEffect, useRef, useState } from 'react';
9
- import { Dropdown, Tooltip } from '@alife/magic-basic';
9
+ import { Dropdown, Tooltip } from 'antd';
10
10
  import classNames from 'classnames';
11
11
  import { FEATURE_MODE_TYPE_KEY, FEATURE_MODE_TYPE_MAP } from "./const";
12
12
  import "./index.scss";
@@ -1,6 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import React from 'react';
3
- import { EarthO, GeometryO } from '@alife/magic-icons';
3
+ import { GlobalOutlined, AppstoreOutlined } from '@ant-design/icons';
4
4
  export var AIGC_MODE_TYPE_V2 = {
5
5
  REASONING_QWEN: 'REASONING_QWEN',
6
6
  REASONING_DEEPSEEK: 'REASONING_DEEPSEEK'
@@ -13,7 +13,7 @@ export var FEATURE_MODE_TYPE_KEY = {
13
13
  };
14
14
  export var FEATURE_MODE_TYPE_MAP = _defineProperty(_defineProperty(_defineProperty({}, FEATURE_MODE_TYPE_KEY.AUTO, '自动'), FEATURE_MODE_TYPE_KEY.ON, '开'), FEATURE_MODE_TYPE_KEY.OFF, '关闭');
15
15
  export var AIGC_MODE_TYPE_V2_LIST = [{
16
- icon: /*#__PURE__*/React.createElement(GeometryO, null),
16
+ icon: /*#__PURE__*/React.createElement(AppstoreOutlined, null),
17
17
  value: AIGC_MODE_TYPE_V2.REASONING_QWEN,
18
18
  label: AIGC_MODE_TYPE_V2_MAP[AIGC_MODE_TYPE_V2.REASONING_QWEN],
19
19
  balloonText: '',
@@ -36,7 +36,7 @@ export var AIGC_MODE_TYPE_V2_LIST = [{
36
36
  describe: '快速直接回答问题'
37
37
  }]
38
38
  }, {
39
- icon: /*#__PURE__*/React.createElement(EarthO, null),
39
+ icon: /*#__PURE__*/React.createElement(GlobalOutlined, null),
40
40
  value: AIGC_MODE_TYPE_V2.REASONING_DEEPSEEK,
41
41
  label: AIGC_MODE_TYPE_V2_MAP[AIGC_MODE_TYPE_V2.REASONING_DEEPSEEK],
42
42
  balloonText: '',
@@ -8,8 +8,8 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
8
8
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
9
9
  var _excluded = ["value", "onChange", "apiConfig", "fieldMapping"];
10
10
  import React, { useState } from 'react';
11
- import { Select } from '@alife/magic-basic';
12
- import { customRequest } from '@alife/magic-request';
11
+ import { Select } from 'antd';
12
+ import { customRequest } from "../../utils/request";
13
13
  import { useDebounceFn } from 'ahooks';
14
14
  import { get } from 'lodash';
15
15
  export default (function (props) {
@@ -9,8 +9,8 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
9
9
  * value: { {configId: 29, opType: 'createSubmit'}, title: "提交" }
10
10
  */
11
11
  import React, { useCallback, useMemo, useState } from 'react';
12
- import { Button, Form, Input, Modal, Space } from '@alife/magic-basic';
13
- import { customRequest } from '@alife/magic-request';
12
+ import { Button, Form, Input, Modal, Space } from 'antd';
13
+ import { customRequest } from "../../utils/request";
14
14
  import { REQUEST_SUCCESS_CODE } from "../../constants/common";
15
15
  import Select from "./Select";
16
16
  import "./index.scss";
@@ -1,8 +1,8 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
3
  import React, { useEffect, useState } from 'react';
4
- import { Button, message } from '@alife/magic-basic';
5
- import { customRequest } from '@alife/magic-request';
4
+ import { Button, message } from 'antd';
5
+ import { customRequest } from "../../utils/request";
6
6
  import { debounce } from 'lodash';
7
7
  import "./index.scss";
8
8
  var PopAuth = function PopAuth(props) {
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
3
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
4
  import React, { useEffect, useState } from 'react';
5
- import { Input, Radio } from '@alife/magic-basic';
5
+ import { Input, Radio } from 'antd';
6
6
  import SimpleJSONEditor from "../SimpleJSONEditor";
7
7
  import "./index.scss";
8
8
  function SchemaInputCore(props) {
@@ -1,6 +1,6 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
2
  import React, { useEffect, useState } from 'react';
3
- import { Input } from '@alife/magic-basic';
3
+ import { Input } from 'antd';
4
4
  import "./index.scss";
5
5
  function SimpleJSONEditor(props) {
6
6
  var onChange = props.onChange,
@@ -4,8 +4,8 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
5
  var _excluded = ["query", "dataApi", "fieldNames", "method"];
6
6
  import React, { useEffect, useState } from 'react';
7
- import { message, Select } from '@alife/magic-basic';
8
- import { customRequest } from '@alife/magic-request';
7
+ import { message, Select } from 'antd';
8
+ import { customRequest } from "../../utils/request";
9
9
  import { debounce } from 'lodash';
10
10
  var SelectBlurry = function SelectBlurry(props) {
11
11
  var query = props.query,
@@ -2,8 +2,8 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
2
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
3
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
4
  import React, { useContext, useState } from 'react';
5
- import { Button, Input, message, Modal, Select } from '@alife/magic-basic';
6
- import { customRequest } from '@alife/magic-request';
5
+ import { Button, Input, message, Modal, Select } from 'antd';
6
+ import { customRequest } from "../../utils/request";
7
7
  import { AssistantChatContext } from "../../context";
8
8
  import { CSECustomIcon } from "../../utils/CSEIconTool";
9
9
  import ShareContent from "../ShareContent";
@@ -2,8 +2,8 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
2
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
3
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
4
  import React, { useContext, useState } from 'react';
5
- import { Button, message } from '@alife/magic-basic';
6
- import { customRequest } from '@alife/magic-request';
5
+ import { Button, message } from 'antd';
6
+ import { customRequest } from "../../utils/request";
7
7
  import { AssistantChatContext } from "../../context";
8
8
  import { CSECustomIcon } from "../../utils/CSEIconTool";
9
9
  import { processAgentCardRenderScreenshot } from "../../utils/screenshot";
@@ -1,7 +1,7 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
2
  import React, { useState } from 'react';
3
- import { Button } from '@alife/magic-basic';
4
- import { ArrowDownO, ArrowTopO } from '@alife/magic-icons';
3
+ import { Button } from 'antd';
4
+ import { DownOutlined, UpOutlined } from '@ant-design/icons';
5
5
  import { formatTextContentHtml } from "../../utils/formatData";
6
6
  import "./index.scss";
7
7
  /**
@@ -32,6 +32,6 @@ var TextContent = function TextContent(props) {
32
32
  }, /*#__PURE__*/React.createElement(Button, {
33
33
  type: "link",
34
34
  onClick: toggleCollapse
35
- }, collapse ? '查看更多' : '收起', collapse ? /*#__PURE__*/React.createElement(ArrowDownO, null) : /*#__PURE__*/React.createElement(ArrowTopO, null))));
35
+ }, collapse ? '查看更多' : '收起', collapse ? /*#__PURE__*/React.createElement(DownOutlined, null) : /*#__PURE__*/React.createElement(UpOutlined, null))));
36
36
  };
37
37
  export default TextContent;
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _typeof from "@babel/runtime/helpers/esm/typeof";
3
3
  import React from 'react';
4
- import { TeamF } from '@alife/magic-icons';
4
+ import { TeamOutlined } from '@ant-design/icons';
5
5
  import classNames from 'classnames';
6
6
  import InspectionCard from "../InspectionCard";
7
7
  import MarkDown from "../MarkDown";
@@ -69,15 +69,10 @@ var TraceWithAgent = function TraceWithAgent(props) {
69
69
  className: "agent-content-item"
70
70
  }, /*#__PURE__*/React.createElement("div", {
71
71
  className: "agent-icon-tips"
72
- }, subItem.type === 'tool' ? /*#__PURE__*/React.createElement(TeamF, {
73
- size: "small",
72
+ }, /*#__PURE__*/React.createElement(TeamOutlined, {
74
73
  style: {
75
- marginRight: 3
76
- }
77
- }) : /*#__PURE__*/React.createElement(TeamF, {
78
- size: "small",
79
- style: {
80
- marginRight: 3
74
+ marginRight: 3,
75
+ fontSize: 12
81
76
  }
82
77
  }), subItem.type === 'tool' ? '工具调用' : '业务流调用'), /*#__PURE__*/React.createElement("div", {
83
78
  className: "agent-content-item-name"
@@ -7,7 +7,8 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
7
7
  var _excluded = ["children", "bizId", "bizDomain", "locateAfterSingleMessageUpdate", "dataSource", "interruptLlmMessageScroll", "toolConfig", "placeholder", "messageCardWidth", "enableWsConnectCallback", "onSend", "assistantChat", "log", "logTrace", "messagesMaxLength", "mode", "activeToken", "onStopMessage", "imConnectCallback", "chatTitle", "isAssistant", "isThirdEmbed", "getApiHost"],
8
8
  _excluded2 = ["chatType", "onSuccessCallback"];
9
9
  import React, { createContext, useEffect, useRef, useState } from 'react';
10
- import { event, getWorkId } from '@alife/goc-utils';
10
+ import { event } from "../utils/event";
11
+ import { getWorkId } from "../utils/helpers";
11
12
  import { FEATURE_MODE_TYPE_KEY } from "../components/ModelSelect/const";
12
13
  import { ASSIST_CHAT_EVENT } from "../constants/assistChatEvent";
13
14
  import { CHAT_TYPE, ChatTypeEnum, COPILOT_TOOL_TYPE_ENUM, initPlaceholder } from "../constants/common";
@@ -1,7 +1,7 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
2
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
- import { event } from '@alife/goc-utils';
4
- import { customRequest } from '@alife/magic-request';
3
+ import { event } from "../../utils/event";
4
+ import { customRequest } from "../../utils/request";
5
5
  import { ASSIST_CHAT_EVENT } from "../../constants/assistChatEvent";
6
6
  import { REQUEST_SUCCESS_CODE } from "../../constants/common";
7
7
  import { countScrollDelay, locateToDialogId } from "../../utils/common";
@@ -1,8 +1,8 @@
1
1
  import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
2
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
- import { message } from '@alife/magic-basic';
4
- import { customRequest } from '@alife/magic-request';
5
- import { getWorkId } from '@alife/goc-utils';
3
+ import { message } from 'antd';
4
+ import { customRequest } from "../../utils/request";
5
+ import { getWorkId } from "../../utils/helpers";
6
6
  import { AGENT_TPYE, CHAT_TYPE, REQUEST_SUCCESS_CODE, SEARCH_TYPE } from "../../constants/common";
7
7
  import { LOG_TRACE_TYPE_ENUMS } from "../../constants/logTrace";
8
8
  export var sendMessageRequest = function sendMessageRequest(_ref) {
@@ -1,7 +1,7 @@
1
1
  import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
2
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
- import { message } from '@alife/magic-basic';
4
- import { customRequest } from '@alife/magic-request';
3
+ import { message } from 'antd';
4
+ import { customRequest } from "../../utils/request";
5
5
  import { REQUEST_SUCCESS_CODE } from "../../constants/common";
6
6
 
7
7
  // 工具搜索
@@ -1,5 +1,5 @@
1
1
  var _window;
2
- import { createFromIconfontCN } from '@alife/magic-icons';
2
+ import { createFromIconfontCN } from '@ant-design/icons';
3
3
  var CSECustomIcon = createFromIconfontCN({
4
4
  scriptUrl: ((_window = window) === null || _window === void 0 ? void 0 : _window.uniqueIconfontSymbolUrl) || '//at.alicdn.com/t/a/font_2186508_s77dlziunf.js'
5
5
  });
@@ -1,7 +1,6 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import { event } from '@alife/goc-utils';
3
- import IM from '@alife/magic-chat-im';
4
- import { customRequest } from '@alife/magic-request';
2
+ import { event } from "./event";
3
+ import { customRequest } from "./request";
5
4
  import { JsonParse } from "./formatData";
6
5
  import { AesCustomLogEventEnum } from "./log";
7
6
  import { logger } from "./websocketLogger";
@@ -1,5 +1,5 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import { customRequest } from '@alife/magic-request';
2
+ import { customRequest } from "./request";
3
3
  export var sendMsgToPlugin = function sendMsgToPlugin(serviceId, executionId, values) {
4
4
  window.dispatchEvent(new CustomEvent('TicketScriptEvent', {
5
5
  detail: {
@@ -6,6 +6,23 @@ export var getSelectedText = function getSelectedText() {
6
6
  return (_window = window) === null || _window === void 0 || (_window = _window.getSelection()) === null || _window === void 0 ? void 0 : _window.toString();
7
7
  };
8
8
 
9
+ /**
10
+ * 预览图片
11
+ * @param url 图片URL
12
+ */
13
+ export var previewImg = function previewImg(url) {
14
+ if (!url) return;
15
+ var img = new Image();
16
+ img.src = url;
17
+ var newWindow = window.open('');
18
+ if (newWindow) {
19
+ newWindow.document.body.appendChild(img);
20
+ newWindow.document.title = '图片预览';
21
+ newWindow.document.body.style.cssText = 'margin: 0; display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #f0f0f0;';
22
+ img.style.cssText = 'max-width: 100%; max-height: 100vh; object-fit: contain;';
23
+ }
24
+ };
25
+
9
26
  // 滚动到指定消息
10
27
  export var locateToDialogId = function locateToDialogId(dialogId) {
11
28
  var element = document.getElementById(dialogId);
@@ -0,0 +1,87 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
3
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
+ /**
5
+ * @description 事件发布订阅工具,替代 @alife/goc-utils 的 event
6
+ */
7
+ var EventEmitter = /*#__PURE__*/function () {
8
+ function EventEmitter() {
9
+ _classCallCheck(this, EventEmitter);
10
+ _defineProperty(this, "events", new Map());
11
+ }
12
+ _createClass(EventEmitter, [{
13
+ key: "on",
14
+ value:
15
+ /**
16
+ * 订阅事件
17
+ */
18
+ function on(eventName, callback) {
19
+ if (!this.events.has(eventName)) {
20
+ this.events.set(eventName, new Set());
21
+ }
22
+ this.events.get(eventName).add(callback);
23
+ }
24
+
25
+ /**
26
+ * 取消订阅
27
+ */
28
+ }, {
29
+ key: "off",
30
+ value: function off(eventName, callback) {
31
+ var callbacks = this.events.get(eventName);
32
+ if (callbacks) {
33
+ callbacks.delete(callback);
34
+ }
35
+ }
36
+
37
+ /**
38
+ * 发布事件
39
+ */
40
+ }, {
41
+ key: "emit",
42
+ value: function emit(eventName) {
43
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
44
+ args[_key - 1] = arguments[_key];
45
+ }
46
+ var callbacks = this.events.get(eventName);
47
+ if (callbacks) {
48
+ callbacks.forEach(function (callback) {
49
+ try {
50
+ callback.apply(void 0, args);
51
+ } catch (error) {
52
+ console.error("Event callback error for \"".concat(eventName, "\":"), error);
53
+ }
54
+ });
55
+ }
56
+ }
57
+
58
+ /**
59
+ * 一次性订阅
60
+ */
61
+ }, {
62
+ key: "once",
63
+ value: function once(eventName, callback) {
64
+ var _this = this;
65
+ var onceCallback = function onceCallback() {
66
+ callback.apply(void 0, arguments);
67
+ _this.off(eventName, onceCallback);
68
+ };
69
+ this.on(eventName, onceCallback);
70
+ }
71
+
72
+ /**
73
+ * 移除某个事件的所有监听器
74
+ */
75
+ }, {
76
+ key: "removeAllListeners",
77
+ value: function removeAllListeners(eventName) {
78
+ if (eventName) {
79
+ this.events.delete(eventName);
80
+ } else {
81
+ this.events.clear();
82
+ }
83
+ }
84
+ }]);
85
+ return EventEmitter;
86
+ }(); // 导出单例
87
+ export var event = new EventEmitter();
@@ -1,4 +1,4 @@
1
- import { LifeCycleTypes } from '@alife/magic-pro';
1
+ import { LifeCycleTypes } from '@formily/antd';
2
2
  import moment from 'moment';
3
3
  var formatComponentsArr = ['datepicker', 'datepicker2', 'rangepicker', 'rangetimepicker']; // 表单里的时间组件
4
4
  var dateFormat = 'YYYY-MM-DD';
@@ -1,6 +1,6 @@
1
1
  import _typeof from "@babel/runtime/helpers/esm/typeof";
2
2
  import React from 'react';
3
- import { urlToLink } from '@alife/goc-utils';
3
+ import { urlToLink } from "./helpers";
4
4
 
5
5
  /**
6
6
  * markdown数据格式化
@@ -0,0 +1,78 @@
1
+ /**
2
+ * @description 工具函数集合,替代 @alife/goc-utils
3
+ */
4
+
5
+ /**
6
+ * 生成唯一ID
7
+ * 替代 getWorkId
8
+ */
9
+ export var getWorkId = function getWorkId() {
10
+ return "".concat(Date.now(), "-").concat(Math.random().toString(36).substring(2, 11));
11
+ };
12
+
13
+ /**
14
+ * 预览图片
15
+ * 替代 previewImg
16
+ */
17
+ export var previewImg = function previewImg(url) {
18
+ if (!url) return;
19
+
20
+ // 创建预览容器
21
+ var overlay = document.createElement('div');
22
+ overlay.style.cssText = "\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, 0.8);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 9999;\n cursor: zoom-out;\n ";
23
+ var img = document.createElement('img');
24
+ img.src = url;
25
+ img.style.cssText = "\n max-width: 90%;\n max-height: 90%;\n object-fit: contain;\n ";
26
+ overlay.appendChild(img);
27
+ document.body.appendChild(overlay);
28
+
29
+ // 点击关闭
30
+ overlay.addEventListener('click', function () {
31
+ document.body.removeChild(overlay);
32
+ });
33
+
34
+ // ESC 关闭
35
+ var handleKeydown = function handleKeydown(e) {
36
+ if (e.key === 'Escape') {
37
+ document.body.removeChild(overlay);
38
+ document.removeEventListener('keydown', handleKeydown);
39
+ }
40
+ };
41
+ document.addEventListener('keydown', handleKeydown);
42
+ };
43
+
44
+ /**
45
+ * 将 URL 转换为链接
46
+ * 替代 urlToLink
47
+ */
48
+ export var urlToLink = function urlToLink(text) {
49
+ if (!text) return '';
50
+ var urlRegex = /(https?:\/\/[^\s<>"{}|\\^`[\]]+)/g;
51
+ return text.replace(urlRegex, '<a href="$1" target="_blank" rel="noopener noreferrer">$1</a>');
52
+ };
53
+
54
+ /**
55
+ * 检查是否为函数
56
+ * 替代 isFunc
57
+ */
58
+ export var isFunc = function isFunc(fn) {
59
+ return typeof fn === 'function';
60
+ };
61
+
62
+ /**
63
+ * 获取环境变量
64
+ * 替代 getEnv
65
+ */
66
+ export var getEnv = function getEnv() {
67
+ var host = window.location.host;
68
+ if (host.includes('localhost') || host.includes('127.0.0.1')) {
69
+ return 'local';
70
+ }
71
+ if (host.includes('pre-') || host.includes('pre.')) {
72
+ return 'pre';
73
+ }
74
+ if (host.includes('daily') || host.includes('dev')) {
75
+ return 'daily';
76
+ }
77
+ return 'prod';
78
+ };
package/es/utils/log.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import { isFunc } from '@alife/goc-utils';
2
+ import { isFunc } from "./helpers";
3
3
  export var AesCustomLogEventEnum = /*#__PURE__*/function (AesCustomLogEventEnum) {
4
4
  AesCustomLogEventEnum["APUSH_MSG"] = "apush-msg";
5
5
  AesCustomLogEventEnum["APUSH_CONNECT"] = "apush-connect";
@@ -0,0 +1,74 @@
1
+ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
5
+ /**
6
+ * @description HTTP 请求工具函数,替代 @alife/magic-request
7
+ */
8
+
9
+ /**
10
+ * 自定义请求函数
11
+ * @param options 请求配置
12
+ * @returns Promise<any>
13
+ */
14
+ export var customRequest = /*#__PURE__*/function () {
15
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(options) {
16
+ var method, url, query, _options$headers, headers, requestUrl, requestOptions, searchParams, queryString, response, data;
17
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
18
+ while (1) switch (_context.prev = _context.next) {
19
+ case 0:
20
+ method = options.method, url = options.url, query = options.query, _options$headers = options.headers, headers = _options$headers === void 0 ? {} : _options$headers;
21
+ requestUrl = url;
22
+ requestOptions = {
23
+ method: method,
24
+ credentials: 'include',
25
+ headers: _objectSpread({
26
+ 'Content-Type': 'application/json'
27
+ }, headers)
28
+ };
29
+ if (method === 'GET') {
30
+ // GET 请求:将 query 参数拼接到 URL
31
+ if (query && Object.keys(query).length > 0) {
32
+ searchParams = new URLSearchParams();
33
+ Object.entries(query).forEach(function (_ref2) {
34
+ var _ref3 = _slicedToArray(_ref2, 2),
35
+ key = _ref3[0],
36
+ value = _ref3[1];
37
+ if (value !== undefined && value !== null) {
38
+ searchParams.append(key, String(value));
39
+ }
40
+ });
41
+ queryString = searchParams.toString();
42
+ requestUrl = url.includes('?') ? "".concat(url, "&").concat(queryString) : "".concat(url, "?").concat(queryString);
43
+ }
44
+ } else {
45
+ // POST/PUT/DELETE 请求:将 query 作为请求体
46
+ if (query) {
47
+ requestOptions.body = JSON.stringify(query);
48
+ }
49
+ }
50
+ _context.prev = 4;
51
+ _context.next = 7;
52
+ return fetch(requestUrl, requestOptions);
53
+ case 7:
54
+ response = _context.sent;
55
+ _context.next = 10;
56
+ return response.json();
57
+ case 10:
58
+ data = _context.sent;
59
+ return _context.abrupt("return", data);
60
+ case 14:
61
+ _context.prev = 14;
62
+ _context.t0 = _context["catch"](4);
63
+ console.error('Request failed:', _context.t0);
64
+ throw _context.t0;
65
+ case 18:
66
+ case "end":
67
+ return _context.stop();
68
+ }
69
+ }, _callee, null, [[4, 14]]);
70
+ }));
71
+ return function customRequest(_x) {
72
+ return _ref.apply(this, arguments);
73
+ };
74
+ }();
package/es/utils/send.js CHANGED
@@ -1,4 +1,4 @@
1
- import { customRequest } from '@alife/magic-request';
1
+ import { customRequest } from "./request";
2
2
  export var sendMessage = function sendMessage(query) {
3
3
  customRequest({
4
4
  method: 'POST',
@@ -5,7 +5,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
5
5
  * @author cherry.zj
6
6
  * @description 图片上传和预览
7
7
  */
8
- import { customRequest } from '@alife/magic-request';
8
+ import { customRequest } from "./request";
9
9
  var queryDownloadUrl = function queryDownloadUrl(params) {
10
10
  return customRequest({
11
11
  method: 'GET',