@myun/gimi-chat 0.0.3 → 0.0.5

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 (206) hide show
  1. package/dist/apis/fetch.d.ts +64 -0
  2. package/dist/apis/fetch.js +512 -0
  3. package/dist/apis/useApi.d.ts +57 -0
  4. package/dist/apis/useApi.js +378 -0
  5. package/dist/assets/image/Subtract.png +0 -0
  6. package/dist/assets/image/ai-logo.png +0 -0
  7. package/dist/assets/image/copyIcon.png +0 -0
  8. package/dist/assets/image/deepthinkActive.png +0 -0
  9. package/dist/assets/image/empty-img-dark.png +0 -0
  10. package/dist/assets/image/empty-img.png +0 -0
  11. package/dist/assets/image/like_active.png +0 -0
  12. package/dist/assets/image/love.png +0 -0
  13. package/dist/assets/image/retry.png +0 -0
  14. package/dist/assets/image/soundOut.png +0 -0
  15. package/dist/assets/image/unlike_active.png +0 -0
  16. package/dist/assets/image/unlove.png +0 -0
  17. package/dist/assets/lottie/ai-bg.json +1704 -0
  18. package/dist/assets/lottie/ai-loading.json +192 -0
  19. package/dist/assets/lottie/ai-output-loading.json +272 -0
  20. package/dist/assets/lottie/ai-output-normal.json +17694 -0
  21. package/dist/assets/lottie/ai-output-strengthen.json +17321 -0
  22. package/dist/assets/lottie/ai-voice-play.json +1 -0
  23. package/dist/assets/lottie/living.json +705 -0
  24. package/dist/assets/lottie/myun-living.json +726 -0
  25. package/dist/assets/lottie/myun-loading.json +530 -0
  26. package/dist/components/ai-chat-dialogue/index.d.ts +16 -0
  27. package/dist/components/ai-chat-dialogue/index.js +1056 -0
  28. package/dist/components/ai-chat-dialogue/index.module.css +230 -0
  29. package/dist/components/ai-chat-dialogue/message-parser.d.ts +36 -0
  30. package/dist/components/ai-chat-dialogue/message-parser.js +52 -0
  31. package/dist/components/ai-chat-dialogue/tlv.d.ts +7 -0
  32. package/dist/components/ai-chat-dialogue/tlv.js +32 -0
  33. package/dist/components/ai-chat-dialogue/volc-voice-call-client.d.ts +47 -0
  34. package/dist/components/ai-chat-dialogue/volc-voice-call-client.js +246 -0
  35. package/dist/components/ai-correction/index.d.ts +5 -0
  36. package/dist/components/ai-correction/index.js +45 -0
  37. package/dist/components/ai-loading/index.d.ts +3 -0
  38. package/dist/components/ai-loading/index.js +14 -0
  39. package/dist/components/ai-loading/index.module.css +11 -0
  40. package/dist/components/answer-item/index.d.ts +27 -0
  41. package/dist/components/answer-item/index.js +194 -0
  42. package/dist/components/answer-item/index.module.css +266 -0
  43. package/dist/components/ask-card/index.d.ts +10 -0
  44. package/dist/components/ask-card/index.js +76 -0
  45. package/dist/components/ask-card/index.module.css +122 -0
  46. package/dist/components/chat-input/index.d.ts +31 -0
  47. package/dist/components/chat-input/index.js +433 -0
  48. package/dist/components/chat-input/index.module.css +42 -0
  49. package/dist/components/chat-voice/VoiceCommunication.d.ts +7 -0
  50. package/dist/components/chat-voice/VoiceCommunication.js +69 -0
  51. package/dist/components/chat-voice/VoiceRecord.d.ts +7 -0
  52. package/dist/components/chat-voice/VoiceRecord.js +34 -0
  53. package/dist/components/conversation-delete/index.d.ts +5 -0
  54. package/dist/components/conversation-delete/index.js +24 -0
  55. package/dist/components/dots-loading/index.d.ts +2 -0
  56. package/dist/components/dots-loading/index.js +11 -0
  57. package/dist/components/dots-loading/index.module.css +41 -0
  58. package/dist/components/empty/index.d.ts +9 -0
  59. package/dist/components/empty/index.js +32 -0
  60. package/dist/components/empty/index.module.css +24 -0
  61. package/dist/components/excel-components/ExcelCard.d.ts +11 -0
  62. package/dist/components/excel-components/ExcelCard.js +35 -0
  63. package/dist/components/excel-components/ExcelExcuting.d.ts +10 -0
  64. package/dist/components/excel-components/ExcelExcuting.js +263 -0
  65. package/dist/components/excel-components/ExcelFailCard.d.ts +9 -0
  66. package/dist/components/excel-components/ExcelFailCard.js +20 -0
  67. package/dist/components/excel-components/ExcelSuccessCard.d.ts +5 -0
  68. package/dist/components/excel-components/ExcelSuccessCard.js +50 -0
  69. package/dist/components/excel-components/index.module.css +212 -0
  70. package/dist/components/excel-components/styles.module.css +178 -0
  71. package/dist/components/file-card/fileCardSidebar.d.ts +8 -0
  72. package/dist/components/file-card/fileCardSidebar.js +56 -0
  73. package/dist/components/file-card/index.d.ts +15 -0
  74. package/dist/components/file-card/index.js +97 -0
  75. package/dist/components/file-card/index.module.css +139 -0
  76. package/dist/components/file-preview/index.d.ts +3 -0
  77. package/dist/components/file-preview/index.js +227 -0
  78. package/dist/components/file-preview/index.module.css +83 -0
  79. package/dist/components/file-upload/index.d.ts +16 -0
  80. package/dist/components/file-upload/index.js +238 -0
  81. package/dist/components/file-upload/uploadV1.d.ts +16 -0
  82. package/dist/components/file-upload/uploadV1.js +267 -0
  83. package/dist/components/gimi-sidebar/index.d.ts +17 -0
  84. package/dist/components/gimi-sidebar/index.js +41 -0
  85. package/dist/components/gimi-sidebar/index.module.css +118 -0
  86. package/dist/components/header/index.d.ts +5 -0
  87. package/dist/components/header/index.js +20 -0
  88. package/dist/components/header/index.module.css +19 -0
  89. package/dist/components/iconfont-com/index.d.ts +11 -0
  90. package/dist/components/iconfont-com/index.js +29 -0
  91. package/dist/components/index.d.ts +1 -0
  92. package/dist/components/index.js +1 -0
  93. package/dist/components/knowledge-trace/KnowledgeIconComponent.d.ts +7 -0
  94. package/dist/components/knowledge-trace/KnowledgeIconComponent.js +101 -0
  95. package/dist/components/knowledge-trace/classList.d.ts +6 -0
  96. package/dist/components/knowledge-trace/classList.js +72 -0
  97. package/dist/components/knowledge-trace/documentList.d.ts +6 -0
  98. package/dist/components/knowledge-trace/documentList.js +75 -0
  99. package/dist/components/knowledge-trace/index.d.ts +18 -0
  100. package/dist/components/knowledge-trace/index.js +155 -0
  101. package/dist/components/knowledge-trace/index.module.css +254 -0
  102. package/dist/components/knowledge-trace/interfaces.d.ts +166 -0
  103. package/dist/components/knowledge-trace/interfaces.js +1 -0
  104. package/dist/components/knowledge-trace/videoList.d.ts +6 -0
  105. package/dist/components/knowledge-trace/videoList.js +91 -0
  106. package/dist/components/lottie-img/index.d.ts +8 -0
  107. package/dist/components/lottie-img/index.js +99 -0
  108. package/dist/components/message-actions/CopyButton.d.ts +7 -0
  109. package/dist/components/message-actions/CopyButton.js +33 -0
  110. package/dist/components/message-actions/LikeButton.d.ts +7 -0
  111. package/dist/components/message-actions/LikeButton.js +34 -0
  112. package/dist/components/message-actions/RegenerateButton.d.ts +5 -0
  113. package/dist/components/message-actions/RegenerateButton.js +27 -0
  114. package/dist/components/message-actions/UnLikeButton.d.ts +7 -0
  115. package/dist/components/message-actions/UnLikeButton.js +34 -0
  116. package/dist/components/message-actions/VoicePlay.d.ts +10 -0
  117. package/dist/components/message-actions/VoicePlay.js +74 -0
  118. package/dist/components/message-list/index.d.ts +19 -0
  119. package/dist/components/message-list/index.js +164 -0
  120. package/dist/components/message-list/index.module.css +261 -0
  121. package/dist/components/no-microphone-root/index.d.ts +6 -0
  122. package/dist/components/no-microphone-root/index.js +36 -0
  123. package/dist/components/no-microphone-root/index.module.css +48 -0
  124. package/dist/components/preset-agent-content/index.d.ts +8 -0
  125. package/dist/components/preset-agent-content/index.js +24 -0
  126. package/dist/components/preset-agent-content/index.module.css +46 -0
  127. package/dist/components/quoted-content/index.d.ts +0 -0
  128. package/dist/components/quoted-content/index.js +171 -0
  129. package/dist/components/quoted-content/index.module.css +80 -0
  130. package/dist/components/reasoning-content/index.d.ts +6 -0
  131. package/dist/components/reasoning-content/index.js +116 -0
  132. package/dist/components/reasoning-content/index.module.css +169 -0
  133. package/dist/components/reference-content/index.d.ts +28 -0
  134. package/dist/components/reference-content/index.js +125 -0
  135. package/dist/components/reference-content/index.module.css +84 -0
  136. package/dist/components/templates/CommonChat.d.ts +5 -0
  137. package/dist/components/templates/CommonChat.js +218 -0
  138. package/dist/components/templates/GimiChatComponent.d.ts +4 -0
  139. package/dist/components/templates/GimiChatComponent.js +23 -0
  140. package/dist/components/templates/demo/demo.d.ts +2 -0
  141. package/dist/components/templates/demo/demo.js +109 -0
  142. package/dist/components/templates/index.module.css +109 -0
  143. package/dist/components/upload-list/index.d.ts +15 -0
  144. package/dist/components/upload-list/index.js +90 -0
  145. package/dist/components/upload-list/index.module.css +119 -0
  146. package/dist/components/voice-bars/index.d.ts +4 -0
  147. package/dist/components/voice-bars/index.js +174 -0
  148. package/dist/components/voice-check-dialog/index.d.ts +8 -0
  149. package/dist/components/voice-check-dialog/index.js +163 -0
  150. package/dist/components/voice-check-dialog/index.module.css +9 -0
  151. package/dist/components/voice-recording/index.d.ts +9 -0
  152. package/dist/components/voice-recording/index.js +54 -0
  153. package/dist/components/voice-recording/index.module.css +41 -0
  154. package/dist/components/work-flow-content/demo.d.ts +3 -0
  155. package/dist/components/work-flow-content/demo.js +11 -0
  156. package/dist/components/work-flow-content/index.d.ts +6 -0
  157. package/dist/components/work-flow-content/index.js +55 -0
  158. package/dist/components/work-flow-content/index.module.css +24 -0
  159. package/dist/constants.d.ts +24 -0
  160. package/dist/constants.js +24 -0
  161. package/dist/hooks/useChatActions.d.ts +12 -0
  162. package/dist/hooks/useChatActions.js +207 -0
  163. package/dist/hooks/useChatHistory.d.ts +8 -0
  164. package/dist/hooks/useChatHistory.js +225 -0
  165. package/dist/hooks/useChatMessage.d.ts +49 -0
  166. package/dist/hooks/useChatMessage.js +87 -0
  167. package/dist/hooks/useChatRecommend.d.ts +8 -0
  168. package/dist/hooks/useChatRecommend.js +126 -0
  169. package/dist/hooks/useChatStream.d.ts +20 -0
  170. package/dist/hooks/useChatStream.js +244 -0
  171. package/dist/hooks/useChatUI.d.ts +32 -0
  172. package/dist/hooks/useChatUI.js +134 -0
  173. package/dist/hooks/useChatVoice.d.ts +11 -0
  174. package/dist/hooks/useChatVoice.js +379 -0
  175. package/dist/hooks/useCommonChatAPI.d.ts +27 -0
  176. package/dist/hooks/useCommonChatAPI.js +1276 -0
  177. package/dist/hooks/useFile.d.ts +13 -0
  178. package/dist/hooks/useFile.js +288 -0
  179. package/dist/hooks/useKnowledgeService.d.ts +17 -0
  180. package/dist/hooks/useKnowledgeService.js +210 -0
  181. package/dist/hooks/useLastEventId.d.ts +8 -0
  182. package/dist/hooks/useLastEventId.js +66 -0
  183. package/dist/hooks/useLongPoll.d.ts +3 -0
  184. package/dist/hooks/useLongPoll.js +111 -0
  185. package/dist/hooks/useScroll.d.ts +4 -0
  186. package/dist/hooks/useScroll.js +172 -0
  187. package/dist/index.d.ts +1 -0
  188. package/dist/index.js +1 -0
  189. package/dist/interfaces/chatMessage.d.ts +139 -0
  190. package/dist/interfaces/fileInterface.d.ts +10 -0
  191. package/dist/interfaces/fileInterface.js +11 -0
  192. package/dist/interfaces/knowledgeTrace.d.ts +177 -0
  193. package/dist/store/hooks.d.ts +4 -0
  194. package/dist/store/hooks.js +3 -0
  195. package/dist/store/index.d.ts +7 -0
  196. package/dist/store/index.js +7 -0
  197. package/dist/store/slices/gimiMenuSlice.d.ts +95 -0
  198. package/dist/store/slices/gimiMenuSlice.js +251 -0
  199. package/dist/utils/chatInputUtil.d.ts +19 -0
  200. package/dist/utils/chatInputUtil.js +45 -0
  201. package/dist/utils/tools.d.ts +50 -0
  202. package/dist/utils/tools.js +474 -0
  203. package/dist/utils/voice-stream.d.ts +119 -0
  204. package/dist/utils/voice-stream.js +1162 -0
  205. package/package.json +5 -6
  206. package/LICENSE +0 -21
@@ -0,0 +1,163 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
10
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
+ import React from 'react';
14
+ import classNames from 'classnames';
15
+ import styles from "./index.module.css";
16
+ import NoMicrophoneModalContent from "../no-microphone-root";
17
+ import { useAppDispatch, useAppSelector } from "../../store/hooks";
18
+ import { setShowMicWarning } from "../../store/slices/gimiMenuSlice";
19
+ var VoiceCheckDialog = function VoiceCheckDialog(_ref) {
20
+ var _layout$x, _layout$y;
21
+ var className = _ref.className,
22
+ style = _ref.style,
23
+ trigger = _ref.trigger;
24
+ var showMicWarning = useAppSelector(function (state) {
25
+ return state.gimiMenu.showMicWarning;
26
+ });
27
+ var dispatch = useAppDispatch();
28
+ var _React$useState = React.useState(null),
29
+ _React$useState2 = _slicedToArray(_React$useState, 2),
30
+ layout = _React$useState2[0],
31
+ setLayout = _React$useState2[1];
32
+ var dialogRef = React.useRef(null);
33
+ var triggerRef = React.useRef(null);
34
+ React.useLayoutEffect(function () {
35
+ var calculateLayout = function calculateLayout() {
36
+ if (triggerRef.current && dialogRef.current) {
37
+ var triggerRect = triggerRef.current.getBoundingClientRect();
38
+ var dialogRect = dialogRef.current.getBoundingClientRect();
39
+ var w = dialogRect.width;
40
+ var h = dialogRect.height;
41
+ var vw = window.innerWidth;
42
+ var vh = window.innerHeight;
43
+
44
+ // Priority: Top, Bottom, Left, Right
45
+ // Default to Top (Align Left)
46
+ var directions = [
47
+ // Top (Align Left)
48
+ {
49
+ x: triggerRect.left + 50,
50
+ y: triggerRect.top - h
51
+ },
52
+ // Bottom (Align Left)
53
+ {
54
+ x: triggerRect.left,
55
+ y: triggerRect.bottom
56
+ },
57
+ // Left (Align Top)
58
+ {
59
+ x: triggerRect.left - w,
60
+ y: triggerRect.top
61
+ },
62
+ // Right (Align Top)
63
+ {
64
+ x: triggerRect.right,
65
+ y: triggerRect.top
66
+ }];
67
+ var bestPos = null;
68
+
69
+ // 1. Try to find a position that fully fits
70
+ for (var _i = 0, _directions = directions; _i < _directions.length; _i++) {
71
+ var pos = _directions[_i];
72
+ var fitH = pos.x >= 0 && pos.x + w <= vw;
73
+ var fitV = pos.y >= 0 && pos.y + h <= vh;
74
+ if (fitH && fitV) {
75
+ bestPos = pos;
76
+ break;
77
+ }
78
+ }
79
+
80
+ // 2. If no full fit, try Top/Bottom but shift X to fit
81
+ if (!bestPos) {
82
+ // Try Top
83
+ var top = triggerRect.top - h;
84
+ if (top >= 0) {
85
+ // Check X
86
+ var left = triggerRect.left;
87
+ if (left + w > vw) left = vw - w;
88
+ if (left < 0) left = 0;
89
+ bestPos = {
90
+ x: left,
91
+ y: top
92
+ };
93
+ } else {
94
+ // Try Bottom
95
+ var _top = triggerRect.bottom;
96
+ if (_top + h <= vh) {
97
+ var _left = triggerRect.left;
98
+ if (_left + w > vw) _left = vw - w;
99
+ if (_left < 0) _left = 0;
100
+ bestPos = {
101
+ x: _left,
102
+ y: _top
103
+ };
104
+ }
105
+ }
106
+ }
107
+
108
+ // 3. Fallback: Force Top (or Bottom) and Clamp
109
+ if (!bestPos) {
110
+ var _top2 = triggerRect.top - h;
111
+ // If really no space on top, try bottom
112
+ if (_top2 < 0 && triggerRect.bottom + h < vh) {
113
+ _top2 = triggerRect.bottom;
114
+ }
115
+ var _left2 = triggerRect.left;
116
+
117
+ // Clamp
118
+ if (_left2 + w > vw) _left2 = vw - w;
119
+ if (_left2 < 0) _left2 = 0;
120
+ if (_top2 + h > vh) _top2 = vh - h;
121
+ if (_top2 < 0) _top2 = 0;
122
+ bestPos = {
123
+ x: _left2,
124
+ y: _top2
125
+ };
126
+ }
127
+ setLayout(bestPos);
128
+ }
129
+ };
130
+ if (showMicWarning) {
131
+ calculateLayout();
132
+ window.addEventListener('resize', calculateLayout);
133
+ } else {
134
+ setLayout(null);
135
+ }
136
+ return function () {
137
+ window.removeEventListener('resize', calculateLayout);
138
+ };
139
+ }, [showMicWarning]);
140
+ var onCancel = function onCancel() {
141
+ dispatch(setShowMicWarning({
142
+ showMicWarning: false
143
+ }));
144
+ };
145
+ return /*#__PURE__*/React.createElement(React.Fragment, null, trigger && /*#__PURE__*/React.createElement("div", {
146
+ ref: triggerRef,
147
+ style: {
148
+ display: 'flex'
149
+ }
150
+ }, trigger), showMicWarning && /*#__PURE__*/React.createElement("div", {
151
+ ref: dialogRef,
152
+ className: classNames(styles['voice-check-dialog'], className),
153
+ style: _objectSpread({
154
+ left: "".concat((_layout$x = layout === null || layout === void 0 ? void 0 : layout.x) !== null && _layout$x !== void 0 ? _layout$x : 0, "px"),
155
+ top: "".concat((_layout$y = layout === null || layout === void 0 ? void 0 : layout.y) !== null && _layout$y !== void 0 ? _layout$y : 0, "px"),
156
+ opacity: layout ? 1 : 0,
157
+ visibility: layout ? 'visible' : 'hidden'
158
+ }, style)
159
+ }, /*#__PURE__*/React.createElement(NoMicrophoneModalContent, {
160
+ onOk: onCancel
161
+ })));
162
+ };
163
+ export default VoiceCheckDialog;
@@ -0,0 +1,9 @@
1
+ .voice-check-dialog {
2
+ position: fixed;
3
+ z-index: 9999;
4
+ padding: 10px;
5
+ border-radius: 12px;
6
+ border: 1px solid rgb(223, 232, 247);
7
+ background-color: #ffffff;
8
+ box-shadow: 0px 2px 16px 0px rgba(84, 105, 140, 0.15);
9
+ }
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface IProps {
3
+ recordingCount: number;
4
+ stopRecording: (value: boolean) => void;
5
+ }
6
+ declare const VoiceRecording: React.FC<IProps & {
7
+ containerWidth: number;
8
+ }>;
9
+ export default VoiceRecording;
@@ -0,0 +1,54 @@
1
+ import { Tooltip } from '@douyinfe/semi-ui';
2
+ import VoiceBars from "../voice-bars";
3
+ import styles from "./index.module.css";
4
+ import React from 'react';
5
+ var CHECK_ICON_ADDRESS = 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202601/04/8b0e2_20260104154821.png';
6
+ var CANCEL_ICON_ADDRESS = 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202601/04/94bfe_20260104154857.png';
7
+ var VoiceRecording = function VoiceRecording(_ref) {
8
+ var recordingCount = _ref.recordingCount,
9
+ stopRecording = _ref.stopRecording,
10
+ containerWidth = _ref.containerWidth;
11
+ return /*#__PURE__*/React.createElement("div", {
12
+ className: styles.main
13
+ }, /*#__PURE__*/React.createElement("div", {
14
+ className: styles.text
15
+ }, /*#__PURE__*/React.createElement("span", {
16
+ className: styles.font_weight_600
17
+ }, "\u8BED\u97F3\u8F93\u5165\u4E2D"), recordingCount > 0 && recordingCount <= 10 && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
18
+ className: styles.font_weight_400
19
+ }, "(\u5012\u8BA1\u65F6"), /*#__PURE__*/React.createElement("span", {
20
+ className: styles.count
21
+ }, recordingCount), /*#__PURE__*/React.createElement("span", {
22
+ className: styles.font_weight_400
23
+ }, "\u79D2)"))), /*#__PURE__*/React.createElement("div", {
24
+ className: styles.voice_bar
25
+ }, /*#__PURE__*/React.createElement(VoiceBars, {
26
+ parentWidth: containerWidth - 48 * 2 - 20 * 2 - 10
27
+ }), /*#__PURE__*/React.createElement("div", {
28
+ style: {
29
+ display: 'flex',
30
+ gap: '10px'
31
+ }
32
+ }, /*#__PURE__*/React.createElement(Tooltip, {
33
+ content: "\u653E\u5F03\u8F6C\u5199",
34
+ arrowPointAtCenter: true
35
+ }, /*#__PURE__*/React.createElement("img", {
36
+ className: styles.icon,
37
+ src: CANCEL_ICON_ADDRESS,
38
+ alt: "\u653E\u5F03\u8F6C\u5199",
39
+ onClick: function onClick() {
40
+ stopRecording(false);
41
+ }
42
+ })), /*#__PURE__*/React.createElement(Tooltip, {
43
+ content: "\u5F00\u59CB\u8F6C\u5199",
44
+ arrowPointAtCenter: true
45
+ }, /*#__PURE__*/React.createElement("img", {
46
+ className: styles.icon,
47
+ src: CHECK_ICON_ADDRESS,
48
+ alt: "\u5F00\u59CB\u8F6C\u5199",
49
+ onClick: function onClick() {
50
+ stopRecording(true);
51
+ }
52
+ })))));
53
+ };
54
+ export default VoiceRecording;
@@ -0,0 +1,41 @@
1
+ .main {
2
+ display: flex;
3
+ flex-direction: column;
4
+ align-items: center;
5
+ justify-content: center;
6
+ width: 100%;
7
+ padding: 20px;
8
+ border-radius: 12px;
9
+ border: 1px solid rgb(223, 232, 247);
10
+ }
11
+ .main .text {
12
+ font-family: PingFang SC;
13
+ font-weight: 600;
14
+ font-style: Semibold;
15
+ font-size: 16px;
16
+ line-height: 18px;
17
+ letter-spacing: 0px;
18
+ }
19
+ .main .text .font_weight_600 {
20
+ font-weight: 600;
21
+ margin-right: 5px;
22
+ }
23
+ .main .text .font_weight_400 {
24
+ font-weight: 400;
25
+ }
26
+ .main .text .count {
27
+ font-weight: 600;
28
+ color: #007aff;
29
+ padding: 0 5px;
30
+ }
31
+ .main .voice_bar {
32
+ display: flex;
33
+ align-items: center;
34
+ justify-content: space-between;
35
+ width: 100%;
36
+ }
37
+ .main .voice_bar .icon {
38
+ width: 48px;
39
+ height: 48px;
40
+ cursor: pointer;
41
+ }
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const Demo: () => React.JSX.Element;
3
+ export default Demo;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import WorkFlowContent from "./index";
3
+ var Demo = function Demo() {
4
+ return /*#__PURE__*/React.createElement(WorkFlowContent, {
5
+ chatItem: {
6
+ mcp: '这是一条工作流内容',
7
+ status: 'executeWorkflowByDescription'
8
+ }
9
+ });
10
+ };
11
+ export default Demo;
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ interface IWorkFlowContentProps {
3
+ chatItem: any;
4
+ }
5
+ declare const WorkFlowContent: React.FC<IWorkFlowContentProps>;
6
+ export default WorkFlowContent;
@@ -0,0 +1,55 @@
1
+ import * as React from 'react';
2
+ import styles from "./index.module.css";
3
+ import { Spin } from '@douyinfe/semi-ui';
4
+ import { LoadingOutlined, InfoCircleOutlined } from '@ant-design/icons';
5
+ var antIcon = /*#__PURE__*/React.createElement(LoadingOutlined, {
6
+ style: {
7
+ fontSize: 16
8
+ },
9
+ spin: true
10
+ });
11
+ var warnIcon = /*#__PURE__*/React.createElement(InfoCircleOutlined, {
12
+ style: {
13
+ fontSize: 16
14
+ }
15
+ });
16
+ var WorkFlowContent = function WorkFlowContent(_ref) {
17
+ var chatItem = _ref.chatItem;
18
+ // const isExecuting = chatItem.mcps.some((item: MCPItem) => !item.isFinished);
19
+ var mcp = chatItem.mcp;
20
+ return /*#__PURE__*/React.createElement("div", {
21
+ className: styles.layout
22
+ }, mcp.status === 'executeWorkflowByDescription' ? '正在查询可用工作流...' : mcp.status === 'interrupt' ? '运行终止' : "\u6B63\u5728\u8C03\u7528 ".concat(mcp.name || '工作流', "..."), mcp.status === 'interrupt' ? warnIcon : /*#__PURE__*/React.createElement(Spin, {
23
+ className: styles.spin,
24
+ indicator: antIcon
25
+ }));
26
+
27
+ // return (
28
+ // <Collapse
29
+ // bordered={false}
30
+ // defaultActiveKey={isExecuting ? ['1'] : []}
31
+ // expandIcon={({ isActive }) => <CaretRightOutlined rotate={isActive ? 90 : 0} />}
32
+ // className={styles.collapse}
33
+ // >
34
+ // <Panel header="工具流运行过程" key="1" className="site-collapse-custom-panel">
35
+ // {chatItem.mcps.map((mcp: MCPItem, index: number) => {
36
+ // return (
37
+ // <div className={styles.layout} key={index}>
38
+ // {
39
+ // mcp.isFinished ? `已调用 ${mcp.name}` :
40
+ // mcp.status === 'executeWorkflowByDescription' ? '正在查询可用工作流...'
41
+ // : mcp.status === 'interrupt' ? '运行终止' : `正在调用 ${mcp.name || 'MCP工具'}...`
42
+ // }
43
+ // {
44
+ // mcp.isFinished ? checkIcon :
45
+ // mcp.status === 'interrupt' ? warnIcon
46
+ // : <Spin className={styles.spin} indicator={antIcon} />
47
+ // }
48
+ // </div>
49
+ // )
50
+ // })}
51
+ // </Panel>
52
+ // </Collapse>
53
+ // )
54
+ };
55
+ export default WorkFlowContent;
@@ -0,0 +1,24 @@
1
+ .collapse {
2
+ border-radius: 8px;
3
+ margin-bottom: 10px;
4
+ }
5
+
6
+ .layout {
7
+ display: flex;
8
+ justify-content: start;
9
+ align-items: center;
10
+ width: fit-content;
11
+ gap: 10px;
12
+ padding: 5px 10px;
13
+ margin-bottom: 5px;
14
+ border: 1px solid #d9dce5;
15
+ border-radius: 8px;
16
+ font-family: "PingFang SC";
17
+ font-weight: 400;
18
+ font-size: 14px;
19
+ line-height: 18px;
20
+ letter-spacing: 0px;
21
+ }
22
+ .layout .spin {
23
+ color: #d9d9d9;
24
+ }
@@ -0,0 +1,24 @@
1
+ export declare const knowledgeConstants: {
2
+ VIDEO_ICON_ADDRESS: string;
3
+ VIDEO_ICON_KNOWLADGE_TRACE_ADDRESS: string;
4
+ DOCUMENT_ICON_ADDRESS: string;
5
+ CLASS_ICON_ADDRESS: string;
6
+ CLASS_ICON_BIG_ADDRESS: string;
7
+ VIDEO_ICON_WHITE_ADDRESS: string;
8
+ DOCUMENT_WHITE_ICON_ADDRESS: string;
9
+ CLASS_ICON_WHITE_ADDRESS: string;
10
+ VIDEO_PLAY_ICON_ADDRESS: string;
11
+ VIDEO_DEFAULT_COVER_ADDRESS: string;
12
+ };
13
+ export declare const documentConstants: {
14
+ txt: string;
15
+ xls: string;
16
+ xlsx: string;
17
+ docx: string;
18
+ doc: string;
19
+ default: string;
20
+ };
21
+ export declare const gimiConstants: {
22
+ GIMI_ICON_HEAD: string;
23
+ GIMI_ICON_HEAD_WITH_NAME: string;
24
+ };
@@ -0,0 +1,24 @@
1
+ export var knowledgeConstants = {
2
+ VIDEO_ICON_ADDRESS: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202511/28/19116_20251128152844.png',
3
+ VIDEO_ICON_KNOWLADGE_TRACE_ADDRESS: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202512/05/5dda1_20251205145434.png',
4
+ DOCUMENT_ICON_ADDRESS: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202511/10/1c1a5_20251110100244.png',
5
+ CLASS_ICON_ADDRESS: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202511/10/3c093_20251110102706.png',
6
+ CLASS_ICON_BIG_ADDRESS: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202511/28/7c759_20251128153111.png',
7
+ VIDEO_ICON_WHITE_ADDRESS: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202511/10/77cdc_20251110132223.png',
8
+ DOCUMENT_WHITE_ICON_ADDRESS: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202511/10/fa3ea_20251110132431.png',
9
+ CLASS_ICON_WHITE_ADDRESS: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202511/10/61fdf_20251110132334.png',
10
+ VIDEO_PLAY_ICON_ADDRESS: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202511/19/1f688_20251119160747.png',
11
+ VIDEO_DEFAULT_COVER_ADDRESS: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202511/19/7a643_20251119160927.png'
12
+ };
13
+ export var documentConstants = {
14
+ txt: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202509/17/b46c7_20250917144926.png',
15
+ xls: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202509/17/0094f_20250917144837.png',
16
+ xlsx: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202509/17/0094f_20250917144837.png',
17
+ docx: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202511/07/8b9fd_20251107170539.png',
18
+ doc: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202511/07/8b9fd_20251107170539.png',
19
+ default: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202511/20/901c2_20251120162226.png'
20
+ };
21
+ export var gimiConstants = {
22
+ GIMI_ICON_HEAD: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202511/28/f6086_20251128163416.png',
23
+ GIMI_ICON_HEAD_WITH_NAME: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202511/28/576a3_20251128164232.png'
24
+ };
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { IChatMessageItem } from '../interfaces/chatMessage';
3
+ export declare const usePureChatActions: () => {
4
+ copyToClipboard: (value: IChatMessageItem, replaceTags?: string[]) => Promise<void>;
5
+ handleUnlove: (item: IChatMessageItem, type: 'love' | 'unlove') => Promise<void>;
6
+ };
7
+ declare const useChatActions: (showCopyId: number | null, inputModelRef: React.MutableRefObject<any>, handleSend: (val: string, agent?: any, isSystemAuto?: boolean) => void) => {
8
+ showOpera: (id: number) => boolean;
9
+ showCommend: (id: number) => boolean;
10
+ handleClickAskList: (item: any, operation: string, key: string, value?: string | undefined) => void;
11
+ };
12
+ export default useChatActions;