@zero-library/chat-copilot 3.1.12 → 3.1.14

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.
package/dist/index.cjs.js CHANGED
@@ -19,7 +19,7 @@ var LexicalTypeaheadMenuPlugin = require('@lexical/react/LexicalTypeaheadMenuPlu
19
19
  var utils = require('@lexical/utils');
20
20
  var ReactDOM = require('react-dom');
21
21
  var dayjs = require('dayjs');
22
- var classNames2 = require('classnames');
22
+ var classNames = require('classnames');
23
23
  var InfiniteScroll = require('react-infinite-scroll-component');
24
24
  var xCard = require('@ant-design/x-card');
25
25
  require('@ant-design/x-markdown/themes/light.css');
@@ -49,7 +49,7 @@ function _interopNamespace(e) {
49
49
  var React10__namespace = /*#__PURE__*/_interopNamespace(React10);
50
50
  var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
51
51
  var dayjs__default = /*#__PURE__*/_interopDefault(dayjs);
52
- var classNames2__default = /*#__PURE__*/_interopDefault(classNames2);
52
+ var classNames__default = /*#__PURE__*/_interopDefault(classNames);
53
53
  var InfiniteScroll__default = /*#__PURE__*/_interopDefault(InfiniteScroll);
54
54
  var XMarkdown__default = /*#__PURE__*/_interopDefault(XMarkdown);
55
55
  var Latex__default = /*#__PURE__*/_interopDefault(Latex);
@@ -74,7 +74,7 @@ var styles_module_default = {
74
74
  var Attachments_default = React10.forwardRef(({ fileUpload, fileUploadConfig, fileList = [], onChange, extraParams }, ref) => {
75
75
  const { message: message3 } = antd.App.useApp();
76
76
  const chatStore = useChatStore();
77
- valtio.useSnapshot(chatStore.agent);
77
+ const configState = valtio.useSnapshot(chatStore.config);
78
78
  const fileListRef = React10.useRef([]);
79
79
  const [attachedFiles, setAttachedFiles, getAttachedFiles] = common.useRefState([]);
80
80
  React10.useEffect(() => {
@@ -193,8 +193,8 @@ var Attachments_default = React10.forwardRef(({ fileUpload, fileUploadConfig, fi
193
193
  currentFile.abortController.abort();
194
194
  }
195
195
  setAttachedFiles(attachedFiles.filter((f) => f.uid !== file.uid));
196
- chatStore.config.params.convMeta?.libraryId;
197
- file.path;
196
+ const filePath = file.path;
197
+ configState.hooks?.onAfterRemoveFile?.(filePath);
198
198
  };
199
199
  React10.useImperativeHandle(
200
200
  ref,
@@ -1027,6 +1027,9 @@ var createChatService = (request, config) => {
1027
1027
  const getAgentAvatar = (path) => {
1028
1028
  return request.get(`/files/access?path=${path}&workspaceType=${"global" /* GLOBAL */}`, void 0, { responseType: "blob" });
1029
1029
  };
1030
+ const conversationFavorite = (conversationId, isFavorite) => {
1031
+ return request.put("/agents/conversations/favorite", { conversationIds: [conversationId], favorite: isFavorite });
1032
+ };
1030
1033
  return {
1031
1034
  fetchModelList,
1032
1035
  fetchAgentInfo,
@@ -1045,7 +1048,8 @@ var createChatService = (request, config) => {
1045
1048
  listLibrarys,
1046
1049
  listDataSources,
1047
1050
  listTags,
1048
- getAgentAvatar
1051
+ getAgentAvatar,
1052
+ conversationFavorite
1049
1053
  };
1050
1054
  };
1051
1055
 
@@ -1235,6 +1239,7 @@ function createChatStore() {
1235
1239
  id: "id",
1236
1240
  label: "title",
1237
1241
  spec: "spec",
1242
+ isFavorite: "isFavorite",
1238
1243
  group: (c) => {
1239
1244
  return classifyTime(c.updatedAt);
1240
1245
  }
@@ -1319,6 +1324,45 @@ function createChatStore() {
1319
1324
  });
1320
1325
  await switchConversation(data);
1321
1326
  };
1327
+ const favorite = valtio.proxy({
1328
+ /** 收藏列表数据 */
1329
+ list: {
1330
+ items: []
1331
+ },
1332
+ /** 收藏列表的加载状态 */
1333
+ loading: false
1334
+ });
1335
+ const getConversationFavorite = async () => {
1336
+ try {
1337
+ favorite.loading = true;
1338
+ const { data } = await config.services.request.fetchConversations({
1339
+ agentId: agent.agentInfo?.id || "",
1340
+ convMeta: {
1341
+ ...config.params.convMeta,
1342
+ isFavorite: true
1343
+ }
1344
+ });
1345
+ favorite.list.items = data || [];
1346
+ } finally {
1347
+ favorite.loading = false;
1348
+ }
1349
+ };
1350
+ const collectConversation = async (conversationId, isFavorite) => {
1351
+ try {
1352
+ await config.services.request.conversationFavorite(conversationId, isFavorite);
1353
+ if (conversations.list.items.length) {
1354
+ const item = conversations.list.items.find((item2) => item2.id === conversationId);
1355
+ if (item) {
1356
+ item.isFavorite = isFavorite;
1357
+ }
1358
+ }
1359
+ if (!isFavorite && favorite.list.items.length) {
1360
+ favorite.list.items = favorite.list.items.filter((item) => item.id !== conversationId);
1361
+ }
1362
+ antd.message.success(isFavorite ? "\u6536\u85CF\u6210\u529F" : "\u5DF2\u53D6\u6D88\u6536\u85CF");
1363
+ } finally {
1364
+ }
1365
+ };
1322
1366
  const conversation = valtio.proxy({
1323
1367
  /** 当前激活的会话信息 */
1324
1368
  active: {
@@ -1623,9 +1667,7 @@ function createChatStore() {
1623
1667
  messages.push(finalMsg);
1624
1668
  } else {
1625
1669
  const contents = messages[idx].content;
1626
- let existingItemIndex = contents.findIndex(
1627
- (item) => item.type === "toolCall" && item.toolCallId === contentItem.toolCallId
1628
- );
1670
+ let existingItemIndex = contents.findIndex((item) => item.type === "toolCall" && item.toolCallId === contentItem.toolCallId);
1629
1671
  if (existingItemIndex === -1 && contentItem.toolCallId) {
1630
1672
  existingItemIndex = contents.findIndex(
1631
1673
  (item) => item.type === "toolCall" && !item.toolCallId && item._streamingIndex !== void 0
@@ -1708,9 +1750,7 @@ function createChatStore() {
1708
1750
  if (contentItem.type !== "toolCallDelta") return;
1709
1751
  let idx = -1;
1710
1752
  if (contentItem.toolCallId) {
1711
- idx = messages.findLastIndex(
1712
- (m) => m.content?.some((c) => c.type === "toolCall" && c.toolCallId === contentItem.toolCallId)
1713
- );
1753
+ idx = messages.findLastIndex((m) => m.content?.some((c) => c.type === "toolCall" && c.toolCallId === contentItem.toolCallId));
1714
1754
  }
1715
1755
  if (idx === -1 && contentItem.index !== void 0) {
1716
1756
  idx = messages.findLastIndex(
@@ -2108,7 +2148,13 @@ function createChatStore() {
2108
2148
  /** 消息反馈 */
2109
2149
  feedback,
2110
2150
  /** 设置会话用户输入 */
2111
- setConversationUserInput
2151
+ setConversationUserInput,
2152
+ /** 收藏管理 */
2153
+ favorite,
2154
+ /** 获取会话收藏列表 */
2155
+ getConversationFavorite,
2156
+ /** 收藏会话 */
2157
+ collectConversation
2112
2158
  };
2113
2159
  }
2114
2160
  var AuthImage = ({ path, size, shape = "square" }) => {
@@ -2183,6 +2229,106 @@ window._iconfont_svg_string_5021436 = '<svg><symbol id="icon-Ollama" viewBox="0
2183
2229
  // src/components/IconFont/index.ts
2184
2230
  var IconFont = icons.createFromIconfontCN({});
2185
2231
  var IconFont_default = IconFont;
2232
+
2233
+ // src/ui/common/FeatureComponents/style.module.less
2234
+ var style_module_default = {
2235
+ popover: "style_module_popover",
2236
+ resourceBtn: "style_module_resourceBtn",
2237
+ divider: "style_module_divider",
2238
+ count: "style_module_count",
2239
+ resourceBtnActive: "style_module_resourceBtnActive",
2240
+ customModal: "style_module_customModal",
2241
+ layout: "style_module_layout",
2242
+ sider: "style_module_sider",
2243
+ categoryName: "style_module_categoryName",
2244
+ siderContent: "style_module_siderContent",
2245
+ categoryItem: "style_module_categoryItem",
2246
+ categoryActive: "style_module_categoryActive",
2247
+ roundCheckbox: "style_module_roundCheckbox",
2248
+ content: "style_module_content",
2249
+ searchInput: "style_module_searchInput",
2250
+ selectedCount: "style_module_selectedCount",
2251
+ tagsArea: "style_module_tagsArea",
2252
+ tagContainer: "style_module_tagContainer",
2253
+ tag: "style_module_tag",
2254
+ expandBtnWrapper: "style_module_expandBtnWrapper",
2255
+ expandBtn: "style_module_expandBtn",
2256
+ tagsExpanded: "style_module_tagsExpanded",
2257
+ listArea: "style_module_listArea",
2258
+ listInner: "style_module_listInner",
2259
+ listItem: "style_module_listItem",
2260
+ listItemSelected: "style_module_listItemSelected",
2261
+ itemIconWrapper: "style_module_itemIconWrapper",
2262
+ itemInfo: "style_module_itemInfo",
2263
+ itemDesc: "style_module_itemDesc",
2264
+ footer: "style_module_footer",
2265
+ titleContainer: "style_module_titleContainer",
2266
+ favoriteCard: "style_module_favoriteCard",
2267
+ favoriteCardActive: "style_module_favoriteCardActive",
2268
+ favoriteCardTitle: "style_module_favoriteCardTitle",
2269
+ favoriteCardActions: "style_module_favoriteCardActions"};
2270
+ var ConversationFavoritesBtn_default = ({ icon, ...rest }) => {
2271
+ const chatStore = useChatStore();
2272
+ const conversationState = valtio.useSnapshot(chatStore.conversation);
2273
+ const favoriteState = valtio.useSnapshot(chatStore.favorite);
2274
+ const getFavoriteList = common.useDebounce(() => {
2275
+ chatStore.getConversationFavorite();
2276
+ }, 300);
2277
+ const renderFavoriteList = React10.useMemo(() => {
2278
+ return /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, gap: 4, className: classNames__default.default("height-full", "scroll-fade-in"), children: favoriteState.list.items.length ? favoriteState.list.items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
2279
+ "div",
2280
+ {
2281
+ className: classNames__default.default(style_module_default.favoriteCard, { [style_module_default.favoriteCardActive]: conversationState.active.id === item.id }),
2282
+ onClick: () => chatStore.switchConversation(item.id),
2283
+ children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 8, align: "center", children: [
2284
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { flex: 1, className: classNames__default.default(style_module_default.favoriteCardTitle, "text-ellipsis"), children: item.title }),
2285
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { gap: 8, align: "center", className: style_module_default.favoriteCardActions, children: /* @__PURE__ */ jsxRuntime.jsx(
2286
+ antd.Popconfirm,
2287
+ {
2288
+ title: "\u63D0\u793A",
2289
+ okText: "\u786E\u5B9A",
2290
+ cancelText: "\u53D6\u6D88",
2291
+ description: "\u786E\u8BA4\u53D6\u6D88\u6536\u85CF\u8BE5\u4F1A\u8BDD\u5417\uFF1F",
2292
+ onConfirm: (e) => {
2293
+ e.stopPropagation();
2294
+ chatStore.collectConversation(item.id, false);
2295
+ },
2296
+ onCancel: (e) => e.stopPropagation(),
2297
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2298
+ antd.Button,
2299
+ {
2300
+ icon: /* @__PURE__ */ jsxRuntime.jsx(icons.DeleteOutlined, {}),
2301
+ title: "\u5220\u9664",
2302
+ type: "text",
2303
+ onClick: (e) => {
2304
+ e.stopPropagation();
2305
+ }
2306
+ }
2307
+ )
2308
+ }
2309
+ ) })
2310
+ ] })
2311
+ },
2312
+ item.id
2313
+ )) : /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description: "\u6682\u65E0\u6536\u85CF", image: antd.Empty.PRESENTED_IMAGE_SIMPLE }) });
2314
+ }, [favoriteState.list.items, conversationState.active.id]);
2315
+ const handlePopoverVisibleChange = (visible) => {
2316
+ if (!visible) return;
2317
+ getFavoriteList();
2318
+ };
2319
+ return /* @__PURE__ */ jsxRuntime.jsx(
2320
+ antd.Popover,
2321
+ {
2322
+ classNames: { container: style_module_default.popover },
2323
+ getPopupContainer: (e) => e,
2324
+ placement: "bottom",
2325
+ content: renderFavoriteList,
2326
+ trigger: ["click"],
2327
+ onOpenChange: handlePopoverVisibleChange,
2328
+ children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { title: "\u6536\u85CF\u5939", type: "text", size: "large", icon: icon?.() || /* @__PURE__ */ jsxRuntime.jsx(icons.StarOutlined, {}), ...rest })
2329
+ }
2330
+ );
2331
+ };
2186
2332
  var CreateBtn_default = ({ icon, ...rest }) => {
2187
2333
  const chatStore = useChatStore();
2188
2334
  return /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { title: "\u65B0\u5EFA\u4F1A\u8BDD", size: "large", type: "text", icon: icon?.() || /* @__PURE__ */ jsxRuntime.jsx(icons.PlusOutlined, {}), onClick: () => chatStore.createConversation(), ...rest });
@@ -2223,6 +2369,11 @@ var ConversationList_default = () => {
2223
2369
  }, [conversationsState.list.items]);
2224
2370
  const menuConfig = (conversation) => ({
2225
2371
  items: [
2372
+ {
2373
+ label: `${conversation.isFavorite ? "\u53D6\u6D88\u6536\u85CF" : "\u6536\u85CF"}`,
2374
+ key: "collect",
2375
+ icon: conversation?.isFavorite ? /* @__PURE__ */ jsxRuntime.jsx(icons.StarFilled, { className: "primary-text" }) : /* @__PURE__ */ jsxRuntime.jsx(icons.StarOutlined, {})
2376
+ },
2226
2377
  {
2227
2378
  label: "\u5220\u9664",
2228
2379
  key: "deleteChat",
@@ -2234,6 +2385,8 @@ var ConversationList_default = () => {
2234
2385
  itemInfo.domEvent.stopPropagation();
2235
2386
  if (itemInfo.key === "deleteChat") {
2236
2387
  chatStore.delConversation(conversation.key);
2388
+ } else if (itemInfo.key === "collect") {
2389
+ chatStore.collectConversation(conversation.id, !conversation.isFavorite);
2237
2390
  }
2238
2391
  }
2239
2392
  });
@@ -2262,41 +2415,6 @@ var ConversationList_default = () => {
2262
2415
  }
2263
2416
  ) : /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description: "\u6682\u65E0\u4F1A\u8BDD\u8BB0\u5F55", image: antd.Empty.PRESENTED_IMAGE_SIMPLE }) }) });
2264
2417
  };
2265
-
2266
- // src/ui/common/FeatureComponents/style.module.less
2267
- var style_module_default = {
2268
- popover: "style_module_popover",
2269
- resourceBtn: "style_module_resourceBtn",
2270
- divider: "style_module_divider",
2271
- count: "style_module_count",
2272
- resourceBtnActive: "style_module_resourceBtnActive",
2273
- customModal: "style_module_customModal",
2274
- layout: "style_module_layout",
2275
- sider: "style_module_sider",
2276
- categoryName: "style_module_categoryName",
2277
- siderContent: "style_module_siderContent",
2278
- categoryItem: "style_module_categoryItem",
2279
- categoryActive: "style_module_categoryActive",
2280
- roundCheckbox: "style_module_roundCheckbox",
2281
- content: "style_module_content",
2282
- searchInput: "style_module_searchInput",
2283
- selectedCount: "style_module_selectedCount",
2284
- tagsArea: "style_module_tagsArea",
2285
- tagContainer: "style_module_tagContainer",
2286
- tag: "style_module_tag",
2287
- expandBtnWrapper: "style_module_expandBtnWrapper",
2288
- expandBtn: "style_module_expandBtn",
2289
- tagsExpanded: "style_module_tagsExpanded",
2290
- listArea: "style_module_listArea",
2291
- listInner: "style_module_listInner",
2292
- listItem: "style_module_listItem",
2293
- listItemSelected: "style_module_listItemSelected",
2294
- itemIconWrapper: "style_module_itemIconWrapper",
2295
- itemInfo: "style_module_itemInfo",
2296
- itemDesc: "style_module_itemDesc",
2297
- footer: "style_module_footer",
2298
- titleContainer: "style_module_titleContainer"
2299
- };
2300
2418
  var HistoryBtn_default = ({ icon, ...rest }) => {
2301
2419
  return /* @__PURE__ */ jsxRuntime.jsx(
2302
2420
  antd.Popover,
@@ -2310,11 +2428,18 @@ var HistoryBtn_default = ({ icon, ...rest }) => {
2310
2428
  }
2311
2429
  );
2312
2430
  };
2313
- var ChatHeader_default = ({ title = true, avatar = true, closeBtn = false, newConversationBtn = true, conversationListBtn = true }) => {
2431
+ var ChatHeader_default = ({
2432
+ title = true,
2433
+ avatar = true,
2434
+ closeBtn = false,
2435
+ newConversationBtn = true,
2436
+ conversationListBtn = true,
2437
+ conversationFavoriteBtn = true
2438
+ }) => {
2314
2439
  const chatStore = useChatStore();
2315
2440
  const agentState = valtio.useSnapshot(chatStore.agent);
2316
2441
  const configState = valtio.useSnapshot(chatStore.config);
2317
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classNames2__default.default(styles_module_default2.chatHeader, "zero-chat-header"), children: [
2442
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classNames__default.default(styles_module_default2.chatHeader, "zero-chat-header"), children: [
2318
2443
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles_module_default2.chatHeaderContent, children: [
2319
2444
  /* @__PURE__ */ jsxRuntime.jsx(
2320
2445
  common.RenderWrapper,
@@ -2329,7 +2454,8 @@ var ChatHeader_default = ({ title = true, avatar = true, closeBtn = false, newCo
2329
2454
  /* @__PURE__ */ jsxRuntime.jsxs(antd.Space, { size: 2, children: [
2330
2455
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles_module_default2.chatHeaderBtnGroup, children: [
2331
2456
  /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: newConversationBtn, DefaultComponent: CreateBtn_default }),
2332
- /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: conversationListBtn, DefaultComponent: HistoryBtn_default })
2457
+ /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: conversationListBtn, DefaultComponent: HistoryBtn_default }),
2458
+ /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: conversationFavoriteBtn, DefaultComponent: ConversationFavoritesBtn_default })
2333
2459
  ] }),
2334
2460
  /* @__PURE__ */ jsxRuntime.jsx(
2335
2461
  common.RenderWrapper,
@@ -2342,7 +2468,7 @@ var ChatHeader_default = ({ title = true, avatar = true, closeBtn = false, newCo
2342
2468
  ] }) });
2343
2469
  };
2344
2470
  var { Text } = antd.Typography;
2345
- var ConversationListHeader_default = ({ title = true, avatar = true, newConversationBtn = true }) => {
2471
+ var ConversationListHeader_default = ({ title = true, avatar = true, newConversationBtn = true, conversationFavoriteBtn = true }) => {
2346
2472
  const chatStore = useChatStore();
2347
2473
  const agentState = valtio.useSnapshot(chatStore.agent);
2348
2474
  return /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { className: "p-24", gap: 16, vertical: true, children: [
@@ -2359,8 +2485,8 @@ var ConversationListHeader_default = ({ title = true, avatar = true, newConversa
2359
2485
  {
2360
2486
  control: title,
2361
2487
  DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, gap: 4, flex: 1, style: { minWidth: 0 }, children: [
2362
- /* @__PURE__ */ jsxRuntime.jsx(Text, { strong: true, className: classNames2__default.default("fz-16"), children: agentState.agentInfo.name }),
2363
- /* @__PURE__ */ jsxRuntime.jsx(Text, { type: "secondary", ellipsis: true, className: classNames2__default.default("fz-12"), children: agentState.agentInfo.description })
2488
+ /* @__PURE__ */ jsxRuntime.jsx(Text, { strong: true, className: classNames__default.default("fz-16"), children: agentState.agentInfo.name }),
2489
+ /* @__PURE__ */ jsxRuntime.jsx(Text, { type: "secondary", ellipsis: true, className: classNames__default.default("fz-12"), children: agentState.agentInfo.description })
2364
2490
  ] }) })
2365
2491
  }
2366
2492
  )
@@ -2375,7 +2501,7 @@ var ConversationListHeader_default = ({ title = true, avatar = true, newConversa
2375
2501
  block: true,
2376
2502
  type: "primary",
2377
2503
  onClick: () => chatStore.createConversation(),
2378
- className: classNames2__default.default(styles_module_default2.createConversationButton),
2504
+ className: classNames__default.default(styles_module_default2.createConversationButton),
2379
2505
  icon: /* @__PURE__ */ jsxRuntime.jsx(icons.PlusOutlined, {}),
2380
2506
  children: "\u65B0\u5EFA\u4F1A\u8BDD"
2381
2507
  }
@@ -2385,7 +2511,7 @@ var ConversationListHeader_default = ({ title = true, avatar = true, newConversa
2385
2511
  ] });
2386
2512
  };
2387
2513
  var ConversationListPanel = ({ header }) => {
2388
- return /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: classNames2__default.default("height-full", "zero-chat-conversations", styles_module_default2.conversationListPanel), children: [
2514
+ return /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: classNames__default.default("height-full", "zero-chat-conversations", styles_module_default2.conversationListPanel), children: [
2389
2515
  /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: header, DefaultComponent: ConversationListHeader_default }),
2390
2516
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "full-scroll", children: /* @__PURE__ */ jsxRuntime.jsx(ConversationList_default, {}) })
2391
2517
  ] });
@@ -2854,7 +2980,7 @@ var CHART_COMPONENTS = Object.fromEntries(
2854
2980
  );
2855
2981
  var Charts_default = ({ data, loading }) => {
2856
2982
  const { type, config } = data;
2857
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames2__default.default(styles_module_default3.chart, "scroll-fade-in"), children: loading ? (
2983
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames__default.default(styles_module_default3.chart, "scroll-fade-in"), children: loading ? (
2858
2984
  // Antd 骨架屏
2859
2985
  /* @__PURE__ */ jsxRuntime.jsx(antd.Skeleton.Node, { active: true, className: styles_module_default3.chartSkeleton, children: /* @__PURE__ */ jsxRuntime.jsx(icons.DotChartOutlined, { className: styles_module_default3.chartSkeletonIcon }) })
2860
2986
  ) : /* @__PURE__ */ jsxRuntime.jsx(
@@ -3149,7 +3275,7 @@ var XMarkdown_default = React10.memo(({ message: message3, components = {}, cont
3149
3275
  return /* @__PURE__ */ jsxRuntime.jsx(
3150
3276
  XMarkdown__default.default,
3151
3277
  {
3152
- className: classNames2__default.default("x-markdown-light", styles_module_default4.xMarkdownStyle),
3278
+ className: classNames__default.default("x-markdown-light", styles_module_default4.xMarkdownStyle),
3153
3279
  config,
3154
3280
  ...rest,
3155
3281
  content: processedContent,
@@ -3494,7 +3620,7 @@ var Switch = ({ id, label, value, bind_path_token, onChange, onDataChange }) =>
3494
3620
  /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 13, color: "#555" }, children: label })
3495
3621
  ] });
3496
3622
  };
3497
- var Button9 = ({ label, variant = "default", onClick, action, onAction }) => {
3623
+ var Button10 = ({ label, variant = "default", onClick, action, onAction }) => {
3498
3624
  const handleClick = () => {
3499
3625
  if (onClick) {
3500
3626
  onClick();
@@ -3524,7 +3650,7 @@ var A2uiComponents = {
3524
3650
  TextField,
3525
3651
  Select,
3526
3652
  Switch,
3527
- Button: Button9,
3653
+ Button: Button10,
3528
3654
  Divider,
3529
3655
  Tag: Tag3,
3530
3656
  Progress,
@@ -4801,7 +4927,7 @@ var TextNode2 = React10__namespace.default.memo(
4801
4927
  }
4802
4928
  const markdownContent = typeof content === "string" ? transformResourceText(content) : content;
4803
4929
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4804
- !!item.reasoningContent && /* @__PURE__ */ jsxRuntime.jsx(xV2.Think, { title: "\u6DF1\u5EA6\u601D\u8003", children: item.reasoningContent }),
4930
+ !!item.reasoningContent && /* @__PURE__ */ jsxRuntime.jsx(xV2.Think, { title: "\u6DF1\u5EA6\u601D\u8003", style: { marginBottom: "16px" }, children: item.reasoningContent }),
4805
4931
  !!markdownContent && /* @__PURE__ */ jsxRuntime.jsx(XMarkdown_default, { message: message3, components: markdownComponents, content: markdownContent })
4806
4932
  ] });
4807
4933
  }
@@ -4810,15 +4936,17 @@ var TextNode2 = React10__namespace.default.memo(
4810
4936
  // src/components/CustomComponents/ToolRenders/index.module.less
4811
4937
  var index_module_default2 = {
4812
4938
  toolCollapse: "index_module_toolCollapse",
4813
- iconContainer: "index_module_iconContainer",
4939
+ toolCallItem: "index_module_toolCallItem",
4940
+ toolIcon: "index_module_toolIcon",
4814
4941
  toolName: "index_module_toolName",
4942
+ statusIcon: "index_module_statusIcon",
4943
+ duration: "index_module_duration",
4815
4944
  toolNamePending: "index_module_toolNamePending",
4816
4945
  dot: "index_module_dot",
4817
4946
  dotBlink: "index_module_dotBlink",
4818
- duration: "index_module_duration",
4819
- statusIcon: "index_module_statusIcon",
4820
4947
  expandIcon: "index_module_expandIcon",
4821
4948
  expanded: "index_module_expanded",
4949
+ contentScrollContainer: "index_module_contentScrollContainer",
4822
4950
  sectionLabel: "index_module_sectionLabel",
4823
4951
  plainTextContainer: "index_module_plainTextContainer",
4824
4952
  markdownContainer: "index_module_markdownContainer",
@@ -4841,7 +4969,6 @@ var index_module_default2 = {
4841
4969
  errorDisplay: "index_module_errorDisplay",
4842
4970
  sectionBlock: "index_module_sectionBlock",
4843
4971
  compactSectionBlock: "index_module_compactSectionBlock",
4844
- contentScrollContainer: "index_module_contentScrollContainer",
4845
4972
  subAgentContainer: "index_module_subAgentContainer",
4846
4973
  subAgentHeader: "index_module_subAgentHeader",
4847
4974
  subAgentName: "index_module_subAgentName",
@@ -5081,13 +5208,13 @@ var ToolCallItem = ({ item }) => {
5081
5208
  const displayName = item.title || (showLoading ? "" : item.toolName || "Unknown Tool");
5082
5209
  const renderIcon = () => {
5083
5210
  if (!item.toolIcon) {
5084
- return /* @__PURE__ */ jsxRuntime.jsx(icons.ToolOutlined, { style: { fontSize: 14, color: token.colorTextSecondary } });
5211
+ return /* @__PURE__ */ jsxRuntime.jsx(icons.ToolOutlined, { style: { fontSize: 14 } });
5085
5212
  }
5086
5213
  const isUrl = /^(http|\/)/.test(item.toolIcon);
5087
5214
  if (isUrl) {
5088
5215
  return /* @__PURE__ */ jsxRuntime.jsx("img", { src: item.toolIcon, alt: "tool-icon", style: { width: "100%", height: "100%", objectFit: "contain" } });
5089
5216
  }
5090
- return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 14, lineHeight: 1 }, children: item.toolIcon });
5217
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: index_module_default2.toolIcon, children: item.toolIcon });
5091
5218
  };
5092
5219
  return /* @__PURE__ */ jsxRuntime.jsx(
5093
5220
  antd.Collapse,
@@ -5098,31 +5225,18 @@ var ToolCallItem = ({ item }) => {
5098
5225
  defaultActiveKey: isDefaultExpanded && hasContent ? [item.toolCallId || "fallback-key"] : void 0,
5099
5226
  expandIconPlacement: "end",
5100
5227
  expandIcon: ({ isActive }) => hasContent ? /* @__PURE__ */ jsxRuntime.jsx(icons.RightOutlined, { className: `${index_module_default2.expandIcon} ${isActive ? index_module_default2.expanded : ""}` }) : null,
5101
- styles: {
5102
- header: {
5103
- padding: "4px 8px",
5104
- overflow: "hidden"
5105
- },
5106
- body: {
5107
- padding: "0 8px 8px"
5108
- }
5109
- },
5110
5228
  items: [
5111
5229
  {
5112
5230
  key: item.toolCallId || "fallback-key",
5113
5231
  showArrow: hasContent,
5114
- label: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { align: "center", gap: 8, style: { flex: 1, minWidth: 0 }, children: [
5115
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: index_module_default2.iconContainer, children: renderIcon() }),
5116
- displayName ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: index_module_default2.toolName, children: displayName }) : /* @__PURE__ */ jsxRuntime.jsxs("span", { className: index_module_default2.toolNamePending, children: [
5232
+ label: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: index_module_default2.toolCallItem, children: [
5233
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: renderIcon() }),
5234
+ displayName ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: `${index_module_default2.toolName} text-ellipsis`, children: displayName }) : /* @__PURE__ */ jsxRuntime.jsxs("span", { className: index_module_default2.toolNamePending, children: [
5117
5235
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: index_module_default2.dot }),
5118
5236
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: index_module_default2.dot }),
5119
5237
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: index_module_default2.dot })
5120
5238
  ] }),
5121
- showLoading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: index_module_default2.statusIcon, style: { color: token.colorPrimary }, children: /* @__PURE__ */ jsxRuntime.jsx(icons.LoadingOutlined, {}) }),
5122
- item.duration && /* @__PURE__ */ jsxRuntime.jsxs(antd.Typography.Text, { className: index_module_default2.duration, children: [
5123
- item.duration,
5124
- "ms"
5125
- ] })
5239
+ showLoading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: index_module_default2.statusIcon, style: { color: token.colorPrimary }, children: /* @__PURE__ */ jsxRuntime.jsx(icons.LoadingOutlined, {}) })
5126
5240
  ] }),
5127
5241
  children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: index_module_default2.contentScrollContainer, children: /* @__PURE__ */ jsxRuntime.jsx(
5128
5242
  CustomRender,
@@ -5209,7 +5323,7 @@ var MessageRender_default = React10__namespace.default.memo(({ role, message: me
5209
5323
  ),
5210
5324
  index === lastToolCallIndex && messageIndex >= 0 ? /* @__PURE__ */ jsxRuntime.jsx(A2uiMessageCards, { messageIndex, message: message3 }) : null
5211
5325
  ] }, `message-${index}`)),
5212
- showPending && /* @__PURE__ */ jsxRuntime.jsx(xV2.Bubble, { role: role.user, placement: role.placement, content: /* @__PURE__ */ jsxRuntime.jsx(RunStartedNode, {}) }),
5326
+ showPending && role.user === "agent" && /* @__PURE__ */ jsxRuntime.jsx(xV2.Bubble, { role: role.user, placement: role.placement, content: /* @__PURE__ */ jsxRuntime.jsx(RunStartedNode, {}) }),
5213
5327
  quoteMsg && /* @__PURE__ */ jsxRuntime.jsx(QuoteMsgNode, { quoteMsg, role })
5214
5328
  ] });
5215
5329
  });
@@ -5226,7 +5340,7 @@ var WelcomeItem_default = ({ icon = true, title = true, description = true, prom
5226
5340
  /* @__PURE__ */ jsxRuntime.jsx(
5227
5341
  xV2.Welcome,
5228
5342
  {
5229
- className: classNames2__default.default(styles_module_default2.chatWelcome, "p-t-32"),
5343
+ className: classNames__default.default(styles_module_default2.chatWelcome, "p-t-32"),
5230
5344
  variant: "borderless",
5231
5345
  icon: /* @__PURE__ */ jsxRuntime.jsx(
5232
5346
  common.RenderWrapper,
@@ -5252,7 +5366,7 @@ var WelcomeItem_default = ({ icon = true, title = true, description = true, prom
5252
5366
  DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx(
5253
5367
  xV2.Prompts,
5254
5368
  {
5255
- className: classNames2__default.default("m-t-16", styles_module_default2.promptItem),
5369
+ className: classNames__default.default("m-t-16", styles_module_default2.promptItem),
5256
5370
  wrap: true,
5257
5371
  onItemClick: (info) => chatStore.sendMessage(info.data.description),
5258
5372
  items: recommendQuestions
@@ -5461,7 +5575,7 @@ var BubbleListItems_default = ({
5461
5575
  autoScroll: false,
5462
5576
  ref: listRef,
5463
5577
  items: bubbleListItems,
5464
- className: classNames2__default.default(styles_module_default2.bubbleList, "height-full", "scroll-fade-in"),
5578
+ className: classNames__default.default(styles_module_default2.bubbleList, "height-full", "scroll-fade-in"),
5465
5579
  onScroll: handleScroll
5466
5580
  },
5467
5581
  conversationState.active.id
@@ -5612,7 +5726,7 @@ var ResourceSelectorModal_default = ({ open, type, onCancel }) => {
5612
5726
  return /* @__PURE__ */ jsxRuntime.jsxs(
5613
5727
  antd.Flex,
5614
5728
  {
5615
- className: classNames2__default.default(style_module_default.categoryItem, { [style_module_default.categoryActive]: isChecked }),
5729
+ className: classNames__default.default(style_module_default.categoryItem, { [style_module_default.categoryActive]: isChecked }),
5616
5730
  onClick: () => handleCategoryChange(cat.id, !isChecked),
5617
5731
  children: [
5618
5732
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -5647,7 +5761,7 @@ var ResourceSelectorModal_default = ({ open, type, onCancel }) => {
5647
5761
  "\u5DF2\u9009 ",
5648
5762
  selectedIds.length
5649
5763
  ] }) }),
5650
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classNames2__default.default(style_module_default.tagsArea, { [style_module_default.tagsExpanded]: tagsExpanded }), children: [
5764
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classNames__default.default(style_module_default.tagsArea, { [style_module_default.tagsExpanded]: tagsExpanded }), children: [
5651
5765
  /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 8, className: style_module_default.tagContainer, wrap: true, ref: tagsContainerRef, children: [
5652
5766
  selectedIds.map((id) => /* @__PURE__ */ jsxRuntime.jsx(
5653
5767
  antd.Tag,
@@ -5677,7 +5791,7 @@ var ResourceSelectorModal_default = ({ open, type, onCancel }) => {
5677
5791
  return /* @__PURE__ */ jsxRuntime.jsxs(
5678
5792
  "div",
5679
5793
  {
5680
- className: classNames2__default.default(style_module_default.listItem, { [style_module_default.listItemSelected]: isSelected }),
5794
+ className: classNames__default.default(style_module_default.listItem, { [style_module_default.listItemSelected]: isSelected }),
5681
5795
  onClick: () => toggleItemSelection(item.id),
5682
5796
  children: [
5683
5797
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: style_module_default.itemIconWrapper, children: /* @__PURE__ */ jsxRuntime.jsx(IconFont_default, { type: iconType }) }),
@@ -5807,7 +5921,7 @@ var ReasonBtn_default = ({}) => {
5807
5921
  return /* @__PURE__ */ jsxRuntime.jsxs(
5808
5922
  "div",
5809
5923
  {
5810
- className: classNames2__default.default(style_module_default.resourceBtn, { [style_module_default.resourceBtnActive]: agentState.model.reasoning }),
5924
+ className: classNames__default.default(style_module_default.resourceBtn, { [style_module_default.resourceBtnActive]: agentState.model.reasoning }),
5811
5925
  onClick: () => chatStore.setAgentModel({ ...agentState.model, reasoning: !agentState.model.reasoning }),
5812
5926
  children: [
5813
5927
  /* @__PURE__ */ jsxRuntime.jsx(IconFont_default, { type: "icon-reason" }),
@@ -6280,9 +6394,9 @@ var ChatMainPanel = React10.memo(
6280
6394
  );
6281
6395
  const configState = valtio.useSnapshot(chatStore.config);
6282
6396
  const agentState = valtio.useSnapshot(chatStore.agent);
6283
- return /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: classNames2__default.default("height-full"), children: [
6397
+ return /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: classNames__default.default("height-full"), children: [
6284
6398
  /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.chatHeader, DefaultComponent: ChatHeader_default }),
6285
- /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { align: "center", vertical: true, gap: 24, className: classNames2__default.default("height-full", styles_module_default5.bodyWidth), children: [
6399
+ /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { align: "center", vertical: true, gap: 24, className: classNames__default.default("height-full", styles_module_default5.bodyWidth), children: [
6286
6400
  common.shouldRender(agentState.agentInfo.userInput && agentState.agentInfo.userInput.length > 0) && /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.userInput, DefaultComponent: UserInputPanel_default }),
6287
6401
  common.shouldRender(configState.layout.messageList) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "full-scroll", style: { width: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.messageList, DefaultComponent: BubbleListItems_default }) }),
6288
6402
  /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.senderHeader, DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx(ChatSenderHeader_default, {}) }),
@@ -6317,7 +6431,7 @@ var ChatPreviewPanel = React10.memo(({ file }) => {
6317
6431
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
6318
6432
  file.fileUrl && /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: "height-full", children: [
6319
6433
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles_module_default5.previewHeader, children: [
6320
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames2__default.default(styles_module_default5.previewHeaderTitle, "text-ellipsis"), title: file.fileName, children: file.fileName }),
6434
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames__default.default(styles_module_default5.previewHeaderTitle, "text-ellipsis"), title: file.fileName, children: file.fileName }),
6321
6435
  /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 8, justify: "center", align: "center", children: [
6322
6436
  /* @__PURE__ */ jsxRuntime.jsx(
6323
6437
  antd.Button,
@@ -6453,12 +6567,12 @@ var layouts_default = React10.forwardRef(({ theme: theme5, params, hooks, layout
6453
6567
  React10.useEffect(() => {
6454
6568
  hooks?.onBeforeInit?.();
6455
6569
  }, []);
6456
- return /* @__PURE__ */ jsxRuntime.jsx(xV2.XProvider, { theme: { cssVar: {}, ...theme5 }, children: /* @__PURE__ */ jsxRuntime.jsx(ChatProvider, { store: chatStore, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { spinning: configState.loading, classNames: { root: "full-spin" }, children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: classNames2__default.default(index_module_default3.chatLayout, "zero-chat-layout", "height-full"), children: [
6570
+ return /* @__PURE__ */ jsxRuntime.jsx(xV2.XProvider, { theme: { cssVar: {}, ...theme5 }, children: /* @__PURE__ */ jsxRuntime.jsx(ChatProvider, { store: chatStore, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { spinning: configState.loading, classNames: { root: "full-spin" }, children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: classNames__default.default(index_module_default3.chatLayout, "zero-chat-layout", "height-full"), children: [
6457
6571
  /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.globalHeader, DefaultComponent: ChatHeader_default }),
6458
6572
  /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { ref: containerRef, className: "full-scroll", children: [
6459
6573
  /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.leftPanel }),
6460
6574
  /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.conversationList, DefaultComponent: ConversationListPanel_default }),
6461
- /* @__PURE__ */ jsxRuntime.jsxs(antd.Splitter, { className: classNames2__default.default("flex-1", index_module_default3.animatedSplitter, { [index_module_default3.hideSplitterBar]: !hasPreView }), children: [
6575
+ /* @__PURE__ */ jsxRuntime.jsxs(antd.Splitter, { className: classNames__default.default("flex-1", index_module_default3.animatedSplitter, { [index_module_default3.hideSplitterBar]: !hasPreView }), children: [
6462
6576
  /* @__PURE__ */ jsxRuntime.jsx(antd.Splitter.Panel, { collapsible: false, max: 800, min: 400, size: sizes[1], children: /* @__PURE__ */ jsxRuntime.jsx(ChatMainPanel_default, { ref: senderRef }) }),
6463
6577
  /* @__PURE__ */ jsxRuntime.jsx(antd.Splitter.Panel, { collapsible: false, min: 600, size: sizes[0], children: /* @__PURE__ */ jsxRuntime.jsx(ChatPreviewPanel_default, { file: configState.preview.file }) })
6464
6578
  ] })