@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.esm.js CHANGED
@@ -1,7 +1,7 @@
1
- import { CloudUploadOutlined, PaperClipOutlined, createFromIconfontCN, EnterOutlined, DownloadOutlined, CloseOutlined, PlayCircleOutlined, CopyOutlined, DotChartOutlined, LoadingOutlined, RightOutlined, LikeOutlined, DislikeOutlined, ToolOutlined, SearchOutlined, UpOutlined, DownOutlined, PlusOutlined, CommentOutlined, RedoOutlined, DeleteOutlined, ClockCircleOutlined, CheckCircleOutlined, FileImageOutlined, FilePdfOutlined, FileWordOutlined, FileExcelOutlined, FilePptOutlined, FileZipOutlined, FileTextOutlined, FileUnknownOutlined } from '@ant-design/icons';
1
+ import { CloudUploadOutlined, PaperClipOutlined, createFromIconfontCN, EnterOutlined, DownloadOutlined, CloseOutlined, PlayCircleOutlined, CopyOutlined, DotChartOutlined, LoadingOutlined, RightOutlined, LikeOutlined, DislikeOutlined, ToolOutlined, SearchOutlined, UpOutlined, DownOutlined, PlusOutlined, CommentOutlined, DeleteOutlined, StarOutlined, RedoOutlined, StarFilled, ClockCircleOutlined, CheckCircleOutlined, FileImageOutlined, FilePdfOutlined, FileWordOutlined, FileExcelOutlined, FilePptOutlined, FileZipOutlined, FileTextOutlined, FileUnknownOutlined } from '@ant-design/icons';
2
2
  import { Attachments, Sender, FileCard, Bubble, Think, XProvider, Mermaid, CodeHighlighter, Welcome, Prompts, Conversations } from '@ant-design/x-v2';
3
3
  import { useRefState, useDebounce, createTokenManager, useSyncInput, isEmptyObj, markdownToText, RenderWrapper, shouldRender, isFunction, downloadFile, LuyaFilePreview, MarkdownEditor, useDeepEffect, isObject, useWebSocket, isNullOrUnDef, isNumber, getFileSuffixName, emit, FileIcon, copyText, LazyComponent, isBoolean, UserAvatar, htmlToMarkdown, buildUrlParams, isExternal, deepCopy, transforms, deepMerge, createRequest, HttpStatus, isArray, isString, isDef, isNull, transform, getWebSocketUrl, safeParseJson } from '@zero-library/common';
4
- import { App, Badge, Button, Flex, Typography, Tooltip, Layout, Tag, Spin, Splitter, Image as Image$1, Popover, Skeleton, Alert, theme, Collapse, Divider as Divider$1, Select as Select$1, Avatar, Space, Form, Drawer, Empty, Modal, Checkbox, Input, InputNumber, Switch as Switch$1, message, Upload, List, Card, Table, Progress as Progress$1 } from 'antd';
4
+ import { App, Badge, Button, Flex, Typography, Tooltip, Layout, Tag, Spin, Splitter, Image as Image$1, Popover, Skeleton, Alert, theme, Collapse, Divider as Divider$1, Select as Select$1, Avatar, Space, Form, Drawer, Empty, Modal, Checkbox, Input, Popconfirm, InputNumber, Switch as Switch$1, message, Upload, List, Card, Table, Progress as Progress$1 } from 'antd';
5
5
  import * as React10 from 'react';
6
6
  import React10__default, { createContext, forwardRef, useRef, useEffect, useImperativeHandle, useMemo, memo, useState, useContext, useCallback, useLayoutEffect } from 'react';
7
7
  import { useSnapshot, proxy } from 'valtio';
@@ -18,7 +18,7 @@ import { LexicalTypeaheadMenuPlugin, MenuOption } from '@lexical/react/LexicalTy
18
18
  import { mergeRegister } from '@lexical/utils';
19
19
  import * as ReactDOM from 'react-dom';
20
20
  import dayjs from 'dayjs';
21
- import classNames2 from 'classnames';
21
+ import classNames from 'classnames';
22
22
  import InfiniteScroll from 'react-infinite-scroll-component';
23
23
  import { XCard as XCard$1 } from '@ant-design/x-card';
24
24
  import '@ant-design/x-markdown/themes/light.css';
@@ -45,7 +45,7 @@ var styles_module_default = {
45
45
  var Attachments_default = forwardRef(({ fileUpload, fileUploadConfig, fileList = [], onChange, extraParams }, ref) => {
46
46
  const { message: message3 } = App.useApp();
47
47
  const chatStore = useChatStore();
48
- useSnapshot(chatStore.agent);
48
+ const configState = useSnapshot(chatStore.config);
49
49
  const fileListRef = useRef([]);
50
50
  const [attachedFiles, setAttachedFiles, getAttachedFiles] = useRefState([]);
51
51
  useEffect(() => {
@@ -164,8 +164,8 @@ var Attachments_default = forwardRef(({ fileUpload, fileUploadConfig, fileList =
164
164
  currentFile.abortController.abort();
165
165
  }
166
166
  setAttachedFiles(attachedFiles.filter((f) => f.uid !== file.uid));
167
- chatStore.config.params.convMeta?.libraryId;
168
- file.path;
167
+ const filePath = file.path;
168
+ configState.hooks?.onAfterRemoveFile?.(filePath);
169
169
  };
170
170
  useImperativeHandle(
171
171
  ref,
@@ -998,6 +998,9 @@ var createChatService = (request, config) => {
998
998
  const getAgentAvatar = (path) => {
999
999
  return request.get(`/files/access?path=${path}&workspaceType=${"global" /* GLOBAL */}`, void 0, { responseType: "blob" });
1000
1000
  };
1001
+ const conversationFavorite = (conversationId, isFavorite) => {
1002
+ return request.put("/agents/conversations/favorite", { conversationIds: [conversationId], favorite: isFavorite });
1003
+ };
1001
1004
  return {
1002
1005
  fetchModelList,
1003
1006
  fetchAgentInfo,
@@ -1016,7 +1019,8 @@ var createChatService = (request, config) => {
1016
1019
  listLibrarys,
1017
1020
  listDataSources,
1018
1021
  listTags,
1019
- getAgentAvatar
1022
+ getAgentAvatar,
1023
+ conversationFavorite
1020
1024
  };
1021
1025
  };
1022
1026
 
@@ -1206,6 +1210,7 @@ function createChatStore() {
1206
1210
  id: "id",
1207
1211
  label: "title",
1208
1212
  spec: "spec",
1213
+ isFavorite: "isFavorite",
1209
1214
  group: (c) => {
1210
1215
  return classifyTime(c.updatedAt);
1211
1216
  }
@@ -1290,6 +1295,45 @@ function createChatStore() {
1290
1295
  });
1291
1296
  await switchConversation(data);
1292
1297
  };
1298
+ const favorite = proxy({
1299
+ /** 收藏列表数据 */
1300
+ list: {
1301
+ items: []
1302
+ },
1303
+ /** 收藏列表的加载状态 */
1304
+ loading: false
1305
+ });
1306
+ const getConversationFavorite = async () => {
1307
+ try {
1308
+ favorite.loading = true;
1309
+ const { data } = await config.services.request.fetchConversations({
1310
+ agentId: agent.agentInfo?.id || "",
1311
+ convMeta: {
1312
+ ...config.params.convMeta,
1313
+ isFavorite: true
1314
+ }
1315
+ });
1316
+ favorite.list.items = data || [];
1317
+ } finally {
1318
+ favorite.loading = false;
1319
+ }
1320
+ };
1321
+ const collectConversation = async (conversationId, isFavorite) => {
1322
+ try {
1323
+ await config.services.request.conversationFavorite(conversationId, isFavorite);
1324
+ if (conversations.list.items.length) {
1325
+ const item = conversations.list.items.find((item2) => item2.id === conversationId);
1326
+ if (item) {
1327
+ item.isFavorite = isFavorite;
1328
+ }
1329
+ }
1330
+ if (!isFavorite && favorite.list.items.length) {
1331
+ favorite.list.items = favorite.list.items.filter((item) => item.id !== conversationId);
1332
+ }
1333
+ message.success(isFavorite ? "\u6536\u85CF\u6210\u529F" : "\u5DF2\u53D6\u6D88\u6536\u85CF");
1334
+ } finally {
1335
+ }
1336
+ };
1293
1337
  const conversation = proxy({
1294
1338
  /** 当前激活的会话信息 */
1295
1339
  active: {
@@ -1594,9 +1638,7 @@ function createChatStore() {
1594
1638
  messages.push(finalMsg);
1595
1639
  } else {
1596
1640
  const contents = messages[idx].content;
1597
- let existingItemIndex = contents.findIndex(
1598
- (item) => item.type === "toolCall" && item.toolCallId === contentItem.toolCallId
1599
- );
1641
+ let existingItemIndex = contents.findIndex((item) => item.type === "toolCall" && item.toolCallId === contentItem.toolCallId);
1600
1642
  if (existingItemIndex === -1 && contentItem.toolCallId) {
1601
1643
  existingItemIndex = contents.findIndex(
1602
1644
  (item) => item.type === "toolCall" && !item.toolCallId && item._streamingIndex !== void 0
@@ -1679,9 +1721,7 @@ function createChatStore() {
1679
1721
  if (contentItem.type !== "toolCallDelta") return;
1680
1722
  let idx = -1;
1681
1723
  if (contentItem.toolCallId) {
1682
- idx = messages.findLastIndex(
1683
- (m) => m.content?.some((c) => c.type === "toolCall" && c.toolCallId === contentItem.toolCallId)
1684
- );
1724
+ idx = messages.findLastIndex((m) => m.content?.some((c) => c.type === "toolCall" && c.toolCallId === contentItem.toolCallId));
1685
1725
  }
1686
1726
  if (idx === -1 && contentItem.index !== void 0) {
1687
1727
  idx = messages.findLastIndex(
@@ -2079,7 +2119,13 @@ function createChatStore() {
2079
2119
  /** 消息反馈 */
2080
2120
  feedback,
2081
2121
  /** 设置会话用户输入 */
2082
- setConversationUserInput
2122
+ setConversationUserInput,
2123
+ /** 收藏管理 */
2124
+ favorite,
2125
+ /** 获取会话收藏列表 */
2126
+ getConversationFavorite,
2127
+ /** 收藏会话 */
2128
+ collectConversation
2083
2129
  };
2084
2130
  }
2085
2131
  var AuthImage = ({ path, size, shape = "square" }) => {
@@ -2154,6 +2200,106 @@ window._iconfont_svg_string_5021436 = '<svg><symbol id="icon-Ollama" viewBox="0
2154
2200
  // src/components/IconFont/index.ts
2155
2201
  var IconFont = createFromIconfontCN({});
2156
2202
  var IconFont_default = IconFont;
2203
+
2204
+ // src/ui/common/FeatureComponents/style.module.less
2205
+ var style_module_default = {
2206
+ popover: "style_module_popover",
2207
+ resourceBtn: "style_module_resourceBtn",
2208
+ divider: "style_module_divider",
2209
+ count: "style_module_count",
2210
+ resourceBtnActive: "style_module_resourceBtnActive",
2211
+ customModal: "style_module_customModal",
2212
+ layout: "style_module_layout",
2213
+ sider: "style_module_sider",
2214
+ categoryName: "style_module_categoryName",
2215
+ siderContent: "style_module_siderContent",
2216
+ categoryItem: "style_module_categoryItem",
2217
+ categoryActive: "style_module_categoryActive",
2218
+ roundCheckbox: "style_module_roundCheckbox",
2219
+ content: "style_module_content",
2220
+ searchInput: "style_module_searchInput",
2221
+ selectedCount: "style_module_selectedCount",
2222
+ tagsArea: "style_module_tagsArea",
2223
+ tagContainer: "style_module_tagContainer",
2224
+ tag: "style_module_tag",
2225
+ expandBtnWrapper: "style_module_expandBtnWrapper",
2226
+ expandBtn: "style_module_expandBtn",
2227
+ tagsExpanded: "style_module_tagsExpanded",
2228
+ listArea: "style_module_listArea",
2229
+ listInner: "style_module_listInner",
2230
+ listItem: "style_module_listItem",
2231
+ listItemSelected: "style_module_listItemSelected",
2232
+ itemIconWrapper: "style_module_itemIconWrapper",
2233
+ itemInfo: "style_module_itemInfo",
2234
+ itemDesc: "style_module_itemDesc",
2235
+ footer: "style_module_footer",
2236
+ titleContainer: "style_module_titleContainer",
2237
+ favoriteCard: "style_module_favoriteCard",
2238
+ favoriteCardActive: "style_module_favoriteCardActive",
2239
+ favoriteCardTitle: "style_module_favoriteCardTitle",
2240
+ favoriteCardActions: "style_module_favoriteCardActions"};
2241
+ var ConversationFavoritesBtn_default = ({ icon, ...rest }) => {
2242
+ const chatStore = useChatStore();
2243
+ const conversationState = useSnapshot(chatStore.conversation);
2244
+ const favoriteState = useSnapshot(chatStore.favorite);
2245
+ const getFavoriteList = useDebounce(() => {
2246
+ chatStore.getConversationFavorite();
2247
+ }, 300);
2248
+ const renderFavoriteList = useMemo(() => {
2249
+ return /* @__PURE__ */ jsx(Flex, { vertical: true, gap: 4, className: classNames("height-full", "scroll-fade-in"), children: favoriteState.list.items.length ? favoriteState.list.items.map((item) => /* @__PURE__ */ jsx(
2250
+ "div",
2251
+ {
2252
+ className: classNames(style_module_default.favoriteCard, { [style_module_default.favoriteCardActive]: conversationState.active.id === item.id }),
2253
+ onClick: () => chatStore.switchConversation(item.id),
2254
+ children: /* @__PURE__ */ jsxs(Flex, { gap: 8, align: "center", children: [
2255
+ /* @__PURE__ */ jsx(Flex, { flex: 1, className: classNames(style_module_default.favoriteCardTitle, "text-ellipsis"), children: item.title }),
2256
+ /* @__PURE__ */ jsx(Flex, { gap: 8, align: "center", className: style_module_default.favoriteCardActions, children: /* @__PURE__ */ jsx(
2257
+ Popconfirm,
2258
+ {
2259
+ title: "\u63D0\u793A",
2260
+ okText: "\u786E\u5B9A",
2261
+ cancelText: "\u53D6\u6D88",
2262
+ description: "\u786E\u8BA4\u53D6\u6D88\u6536\u85CF\u8BE5\u4F1A\u8BDD\u5417\uFF1F",
2263
+ onConfirm: (e) => {
2264
+ e.stopPropagation();
2265
+ chatStore.collectConversation(item.id, false);
2266
+ },
2267
+ onCancel: (e) => e.stopPropagation(),
2268
+ children: /* @__PURE__ */ jsx(
2269
+ Button,
2270
+ {
2271
+ icon: /* @__PURE__ */ jsx(DeleteOutlined, {}),
2272
+ title: "\u5220\u9664",
2273
+ type: "text",
2274
+ onClick: (e) => {
2275
+ e.stopPropagation();
2276
+ }
2277
+ }
2278
+ )
2279
+ }
2280
+ ) })
2281
+ ] })
2282
+ },
2283
+ item.id
2284
+ )) : /* @__PURE__ */ jsx(Empty, { description: "\u6682\u65E0\u6536\u85CF", image: Empty.PRESENTED_IMAGE_SIMPLE }) });
2285
+ }, [favoriteState.list.items, conversationState.active.id]);
2286
+ const handlePopoverVisibleChange = (visible) => {
2287
+ if (!visible) return;
2288
+ getFavoriteList();
2289
+ };
2290
+ return /* @__PURE__ */ jsx(
2291
+ Popover,
2292
+ {
2293
+ classNames: { container: style_module_default.popover },
2294
+ getPopupContainer: (e) => e,
2295
+ placement: "bottom",
2296
+ content: renderFavoriteList,
2297
+ trigger: ["click"],
2298
+ onOpenChange: handlePopoverVisibleChange,
2299
+ children: /* @__PURE__ */ jsx(Button, { title: "\u6536\u85CF\u5939", type: "text", size: "large", icon: icon?.() || /* @__PURE__ */ jsx(StarOutlined, {}), ...rest })
2300
+ }
2301
+ );
2302
+ };
2157
2303
  var CreateBtn_default = ({ icon, ...rest }) => {
2158
2304
  const chatStore = useChatStore();
2159
2305
  return /* @__PURE__ */ jsx(Button, { title: "\u65B0\u5EFA\u4F1A\u8BDD", size: "large", type: "text", icon: icon?.() || /* @__PURE__ */ jsx(PlusOutlined, {}), onClick: () => chatStore.createConversation(), ...rest });
@@ -2194,6 +2340,11 @@ var ConversationList_default = () => {
2194
2340
  }, [conversationsState.list.items]);
2195
2341
  const menuConfig = (conversation) => ({
2196
2342
  items: [
2343
+ {
2344
+ label: `${conversation.isFavorite ? "\u53D6\u6D88\u6536\u85CF" : "\u6536\u85CF"}`,
2345
+ key: "collect",
2346
+ icon: conversation?.isFavorite ? /* @__PURE__ */ jsx(StarFilled, { className: "primary-text" }) : /* @__PURE__ */ jsx(StarOutlined, {})
2347
+ },
2197
2348
  {
2198
2349
  label: "\u5220\u9664",
2199
2350
  key: "deleteChat",
@@ -2205,6 +2356,8 @@ var ConversationList_default = () => {
2205
2356
  itemInfo.domEvent.stopPropagation();
2206
2357
  if (itemInfo.key === "deleteChat") {
2207
2358
  chatStore.delConversation(conversation.key);
2359
+ } else if (itemInfo.key === "collect") {
2360
+ chatStore.collectConversation(conversation.id, !conversation.isFavorite);
2208
2361
  }
2209
2362
  }
2210
2363
  });
@@ -2233,41 +2386,6 @@ var ConversationList_default = () => {
2233
2386
  }
2234
2387
  ) : /* @__PURE__ */ jsx(Empty, { description: "\u6682\u65E0\u4F1A\u8BDD\u8BB0\u5F55", image: Empty.PRESENTED_IMAGE_SIMPLE }) }) });
2235
2388
  };
2236
-
2237
- // src/ui/common/FeatureComponents/style.module.less
2238
- var style_module_default = {
2239
- popover: "style_module_popover",
2240
- resourceBtn: "style_module_resourceBtn",
2241
- divider: "style_module_divider",
2242
- count: "style_module_count",
2243
- resourceBtnActive: "style_module_resourceBtnActive",
2244
- customModal: "style_module_customModal",
2245
- layout: "style_module_layout",
2246
- sider: "style_module_sider",
2247
- categoryName: "style_module_categoryName",
2248
- siderContent: "style_module_siderContent",
2249
- categoryItem: "style_module_categoryItem",
2250
- categoryActive: "style_module_categoryActive",
2251
- roundCheckbox: "style_module_roundCheckbox",
2252
- content: "style_module_content",
2253
- searchInput: "style_module_searchInput",
2254
- selectedCount: "style_module_selectedCount",
2255
- tagsArea: "style_module_tagsArea",
2256
- tagContainer: "style_module_tagContainer",
2257
- tag: "style_module_tag",
2258
- expandBtnWrapper: "style_module_expandBtnWrapper",
2259
- expandBtn: "style_module_expandBtn",
2260
- tagsExpanded: "style_module_tagsExpanded",
2261
- listArea: "style_module_listArea",
2262
- listInner: "style_module_listInner",
2263
- listItem: "style_module_listItem",
2264
- listItemSelected: "style_module_listItemSelected",
2265
- itemIconWrapper: "style_module_itemIconWrapper",
2266
- itemInfo: "style_module_itemInfo",
2267
- itemDesc: "style_module_itemDesc",
2268
- footer: "style_module_footer",
2269
- titleContainer: "style_module_titleContainer"
2270
- };
2271
2389
  var HistoryBtn_default = ({ icon, ...rest }) => {
2272
2390
  return /* @__PURE__ */ jsx(
2273
2391
  Popover,
@@ -2281,11 +2399,18 @@ var HistoryBtn_default = ({ icon, ...rest }) => {
2281
2399
  }
2282
2400
  );
2283
2401
  };
2284
- var ChatHeader_default = ({ title = true, avatar = true, closeBtn = false, newConversationBtn = true, conversationListBtn = true }) => {
2402
+ var ChatHeader_default = ({
2403
+ title = true,
2404
+ avatar = true,
2405
+ closeBtn = false,
2406
+ newConversationBtn = true,
2407
+ conversationListBtn = true,
2408
+ conversationFavoriteBtn = true
2409
+ }) => {
2285
2410
  const chatStore = useChatStore();
2286
2411
  const agentState = useSnapshot(chatStore.agent);
2287
2412
  const configState = useSnapshot(chatStore.config);
2288
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: classNames2(styles_module_default2.chatHeader, "zero-chat-header"), children: [
2413
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: classNames(styles_module_default2.chatHeader, "zero-chat-header"), children: [
2289
2414
  /* @__PURE__ */ jsxs("div", { className: styles_module_default2.chatHeaderContent, children: [
2290
2415
  /* @__PURE__ */ jsx(
2291
2416
  RenderWrapper,
@@ -2300,7 +2425,8 @@ var ChatHeader_default = ({ title = true, avatar = true, closeBtn = false, newCo
2300
2425
  /* @__PURE__ */ jsxs(Space, { size: 2, children: [
2301
2426
  /* @__PURE__ */ jsxs("div", { className: styles_module_default2.chatHeaderBtnGroup, children: [
2302
2427
  /* @__PURE__ */ jsx(RenderWrapper, { control: newConversationBtn, DefaultComponent: CreateBtn_default }),
2303
- /* @__PURE__ */ jsx(RenderWrapper, { control: conversationListBtn, DefaultComponent: HistoryBtn_default })
2428
+ /* @__PURE__ */ jsx(RenderWrapper, { control: conversationListBtn, DefaultComponent: HistoryBtn_default }),
2429
+ /* @__PURE__ */ jsx(RenderWrapper, { control: conversationFavoriteBtn, DefaultComponent: ConversationFavoritesBtn_default })
2304
2430
  ] }),
2305
2431
  /* @__PURE__ */ jsx(
2306
2432
  RenderWrapper,
@@ -2313,7 +2439,7 @@ var ChatHeader_default = ({ title = true, avatar = true, closeBtn = false, newCo
2313
2439
  ] }) });
2314
2440
  };
2315
2441
  var { Text } = Typography;
2316
- var ConversationListHeader_default = ({ title = true, avatar = true, newConversationBtn = true }) => {
2442
+ var ConversationListHeader_default = ({ title = true, avatar = true, newConversationBtn = true, conversationFavoriteBtn = true }) => {
2317
2443
  const chatStore = useChatStore();
2318
2444
  const agentState = useSnapshot(chatStore.agent);
2319
2445
  return /* @__PURE__ */ jsxs(Flex, { className: "p-24", gap: 16, vertical: true, children: [
@@ -2330,8 +2456,8 @@ var ConversationListHeader_default = ({ title = true, avatar = true, newConversa
2330
2456
  {
2331
2457
  control: title,
2332
2458
  DefaultComponent: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(Flex, { vertical: true, gap: 4, flex: 1, style: { minWidth: 0 }, children: [
2333
- /* @__PURE__ */ jsx(Text, { strong: true, className: classNames2("fz-16"), children: agentState.agentInfo.name }),
2334
- /* @__PURE__ */ jsx(Text, { type: "secondary", ellipsis: true, className: classNames2("fz-12"), children: agentState.agentInfo.description })
2459
+ /* @__PURE__ */ jsx(Text, { strong: true, className: classNames("fz-16"), children: agentState.agentInfo.name }),
2460
+ /* @__PURE__ */ jsx(Text, { type: "secondary", ellipsis: true, className: classNames("fz-12"), children: agentState.agentInfo.description })
2335
2461
  ] }) })
2336
2462
  }
2337
2463
  )
@@ -2346,7 +2472,7 @@ var ConversationListHeader_default = ({ title = true, avatar = true, newConversa
2346
2472
  block: true,
2347
2473
  type: "primary",
2348
2474
  onClick: () => chatStore.createConversation(),
2349
- className: classNames2(styles_module_default2.createConversationButton),
2475
+ className: classNames(styles_module_default2.createConversationButton),
2350
2476
  icon: /* @__PURE__ */ jsx(PlusOutlined, {}),
2351
2477
  children: "\u65B0\u5EFA\u4F1A\u8BDD"
2352
2478
  }
@@ -2356,7 +2482,7 @@ var ConversationListHeader_default = ({ title = true, avatar = true, newConversa
2356
2482
  ] });
2357
2483
  };
2358
2484
  var ConversationListPanel = ({ header }) => {
2359
- return /* @__PURE__ */ jsxs(Flex, { vertical: true, className: classNames2("height-full", "zero-chat-conversations", styles_module_default2.conversationListPanel), children: [
2485
+ return /* @__PURE__ */ jsxs(Flex, { vertical: true, className: classNames("height-full", "zero-chat-conversations", styles_module_default2.conversationListPanel), children: [
2360
2486
  /* @__PURE__ */ jsx(RenderWrapper, { control: header, DefaultComponent: ConversationListHeader_default }),
2361
2487
  /* @__PURE__ */ jsx("div", { className: "full-scroll", children: /* @__PURE__ */ jsx(ConversationList_default, {}) })
2362
2488
  ] });
@@ -2825,7 +2951,7 @@ var CHART_COMPONENTS = Object.fromEntries(
2825
2951
  );
2826
2952
  var Charts_default = ({ data, loading }) => {
2827
2953
  const { type, config } = data;
2828
- return /* @__PURE__ */ jsx("div", { className: classNames2(styles_module_default3.chart, "scroll-fade-in"), children: loading ? (
2954
+ return /* @__PURE__ */ jsx("div", { className: classNames(styles_module_default3.chart, "scroll-fade-in"), children: loading ? (
2829
2955
  // Antd 骨架屏
2830
2956
  /* @__PURE__ */ jsx(Skeleton.Node, { active: true, className: styles_module_default3.chartSkeleton, children: /* @__PURE__ */ jsx(DotChartOutlined, { className: styles_module_default3.chartSkeletonIcon }) })
2831
2957
  ) : /* @__PURE__ */ jsx(
@@ -3120,7 +3246,7 @@ var XMarkdown_default = memo(({ message: message3, components = {}, content = ""
3120
3246
  return /* @__PURE__ */ jsx(
3121
3247
  XMarkdown,
3122
3248
  {
3123
- className: classNames2("x-markdown-light", styles_module_default4.xMarkdownStyle),
3249
+ className: classNames("x-markdown-light", styles_module_default4.xMarkdownStyle),
3124
3250
  config,
3125
3251
  ...rest,
3126
3252
  content: processedContent,
@@ -3465,7 +3591,7 @@ var Switch = ({ id, label, value, bind_path_token, onChange, onDataChange }) =>
3465
3591
  /* @__PURE__ */ jsx("span", { style: { fontSize: 13, color: "#555" }, children: label })
3466
3592
  ] });
3467
3593
  };
3468
- var Button9 = ({ label, variant = "default", onClick, action, onAction }) => {
3594
+ var Button10 = ({ label, variant = "default", onClick, action, onAction }) => {
3469
3595
  const handleClick = () => {
3470
3596
  if (onClick) {
3471
3597
  onClick();
@@ -3495,7 +3621,7 @@ var A2uiComponents = {
3495
3621
  TextField,
3496
3622
  Select,
3497
3623
  Switch,
3498
- Button: Button9,
3624
+ Button: Button10,
3499
3625
  Divider,
3500
3626
  Tag: Tag3,
3501
3627
  Progress,
@@ -4772,7 +4898,7 @@ var TextNode2 = React10__default.memo(
4772
4898
  }
4773
4899
  const markdownContent = typeof content === "string" ? transformResourceText(content) : content;
4774
4900
  return /* @__PURE__ */ jsxs(Fragment, { children: [
4775
- !!item.reasoningContent && /* @__PURE__ */ jsx(Think, { title: "\u6DF1\u5EA6\u601D\u8003", children: item.reasoningContent }),
4901
+ !!item.reasoningContent && /* @__PURE__ */ jsx(Think, { title: "\u6DF1\u5EA6\u601D\u8003", style: { marginBottom: "16px" }, children: item.reasoningContent }),
4776
4902
  !!markdownContent && /* @__PURE__ */ jsx(XMarkdown_default, { message: message3, components: markdownComponents, content: markdownContent })
4777
4903
  ] });
4778
4904
  }
@@ -4781,15 +4907,17 @@ var TextNode2 = React10__default.memo(
4781
4907
  // src/components/CustomComponents/ToolRenders/index.module.less
4782
4908
  var index_module_default2 = {
4783
4909
  toolCollapse: "index_module_toolCollapse",
4784
- iconContainer: "index_module_iconContainer",
4910
+ toolCallItem: "index_module_toolCallItem",
4911
+ toolIcon: "index_module_toolIcon",
4785
4912
  toolName: "index_module_toolName",
4913
+ statusIcon: "index_module_statusIcon",
4914
+ duration: "index_module_duration",
4786
4915
  toolNamePending: "index_module_toolNamePending",
4787
4916
  dot: "index_module_dot",
4788
4917
  dotBlink: "index_module_dotBlink",
4789
- duration: "index_module_duration",
4790
- statusIcon: "index_module_statusIcon",
4791
4918
  expandIcon: "index_module_expandIcon",
4792
4919
  expanded: "index_module_expanded",
4920
+ contentScrollContainer: "index_module_contentScrollContainer",
4793
4921
  sectionLabel: "index_module_sectionLabel",
4794
4922
  plainTextContainer: "index_module_plainTextContainer",
4795
4923
  markdownContainer: "index_module_markdownContainer",
@@ -4812,7 +4940,6 @@ var index_module_default2 = {
4812
4940
  errorDisplay: "index_module_errorDisplay",
4813
4941
  sectionBlock: "index_module_sectionBlock",
4814
4942
  compactSectionBlock: "index_module_compactSectionBlock",
4815
- contentScrollContainer: "index_module_contentScrollContainer",
4816
4943
  subAgentContainer: "index_module_subAgentContainer",
4817
4944
  subAgentHeader: "index_module_subAgentHeader",
4818
4945
  subAgentName: "index_module_subAgentName",
@@ -5052,13 +5179,13 @@ var ToolCallItem = ({ item }) => {
5052
5179
  const displayName = item.title || (showLoading ? "" : item.toolName || "Unknown Tool");
5053
5180
  const renderIcon = () => {
5054
5181
  if (!item.toolIcon) {
5055
- return /* @__PURE__ */ jsx(ToolOutlined, { style: { fontSize: 14, color: token.colorTextSecondary } });
5182
+ return /* @__PURE__ */ jsx(ToolOutlined, { style: { fontSize: 14 } });
5056
5183
  }
5057
5184
  const isUrl = /^(http|\/)/.test(item.toolIcon);
5058
5185
  if (isUrl) {
5059
5186
  return /* @__PURE__ */ jsx("img", { src: item.toolIcon, alt: "tool-icon", style: { width: "100%", height: "100%", objectFit: "contain" } });
5060
5187
  }
5061
- return /* @__PURE__ */ jsx("span", { style: { fontSize: 14, lineHeight: 1 }, children: item.toolIcon });
5188
+ return /* @__PURE__ */ jsx("span", { className: index_module_default2.toolIcon, children: item.toolIcon });
5062
5189
  };
5063
5190
  return /* @__PURE__ */ jsx(
5064
5191
  Collapse,
@@ -5069,31 +5196,18 @@ var ToolCallItem = ({ item }) => {
5069
5196
  defaultActiveKey: isDefaultExpanded && hasContent ? [item.toolCallId || "fallback-key"] : void 0,
5070
5197
  expandIconPlacement: "end",
5071
5198
  expandIcon: ({ isActive }) => hasContent ? /* @__PURE__ */ jsx(RightOutlined, { className: `${index_module_default2.expandIcon} ${isActive ? index_module_default2.expanded : ""}` }) : null,
5072
- styles: {
5073
- header: {
5074
- padding: "4px 8px",
5075
- overflow: "hidden"
5076
- },
5077
- body: {
5078
- padding: "0 8px 8px"
5079
- }
5080
- },
5081
5199
  items: [
5082
5200
  {
5083
5201
  key: item.toolCallId || "fallback-key",
5084
5202
  showArrow: hasContent,
5085
- label: /* @__PURE__ */ jsxs(Flex, { align: "center", gap: 8, style: { flex: 1, minWidth: 0 }, children: [
5086
- /* @__PURE__ */ jsx("div", { className: index_module_default2.iconContainer, children: renderIcon() }),
5087
- displayName ? /* @__PURE__ */ jsx("span", { className: index_module_default2.toolName, children: displayName }) : /* @__PURE__ */ jsxs("span", { className: index_module_default2.toolNamePending, children: [
5203
+ label: /* @__PURE__ */ jsxs("div", { className: index_module_default2.toolCallItem, children: [
5204
+ /* @__PURE__ */ jsx("div", { children: renderIcon() }),
5205
+ displayName ? /* @__PURE__ */ jsx("span", { className: `${index_module_default2.toolName} text-ellipsis`, children: displayName }) : /* @__PURE__ */ jsxs("span", { className: index_module_default2.toolNamePending, children: [
5088
5206
  /* @__PURE__ */ jsx("span", { className: index_module_default2.dot }),
5089
5207
  /* @__PURE__ */ jsx("span", { className: index_module_default2.dot }),
5090
5208
  /* @__PURE__ */ jsx("span", { className: index_module_default2.dot })
5091
5209
  ] }),
5092
- showLoading && /* @__PURE__ */ jsx("div", { className: index_module_default2.statusIcon, style: { color: token.colorPrimary }, children: /* @__PURE__ */ jsx(LoadingOutlined, {}) }),
5093
- item.duration && /* @__PURE__ */ jsxs(Typography.Text, { className: index_module_default2.duration, children: [
5094
- item.duration,
5095
- "ms"
5096
- ] })
5210
+ showLoading && /* @__PURE__ */ jsx("div", { className: index_module_default2.statusIcon, style: { color: token.colorPrimary }, children: /* @__PURE__ */ jsx(LoadingOutlined, {}) })
5097
5211
  ] }),
5098
5212
  children: /* @__PURE__ */ jsx("div", { className: index_module_default2.contentScrollContainer, children: /* @__PURE__ */ jsx(
5099
5213
  CustomRender,
@@ -5180,7 +5294,7 @@ var MessageRender_default = React10__default.memo(({ role, message: message3, me
5180
5294
  ),
5181
5295
  index === lastToolCallIndex && messageIndex >= 0 ? /* @__PURE__ */ jsx(A2uiMessageCards, { messageIndex, message: message3 }) : null
5182
5296
  ] }, `message-${index}`)),
5183
- showPending && /* @__PURE__ */ jsx(Bubble, { role: role.user, placement: role.placement, content: /* @__PURE__ */ jsx(RunStartedNode, {}) }),
5297
+ showPending && role.user === "agent" && /* @__PURE__ */ jsx(Bubble, { role: role.user, placement: role.placement, content: /* @__PURE__ */ jsx(RunStartedNode, {}) }),
5184
5298
  quoteMsg && /* @__PURE__ */ jsx(QuoteMsgNode, { quoteMsg, role })
5185
5299
  ] });
5186
5300
  });
@@ -5197,7 +5311,7 @@ var WelcomeItem_default = ({ icon = true, title = true, description = true, prom
5197
5311
  /* @__PURE__ */ jsx(
5198
5312
  Welcome,
5199
5313
  {
5200
- className: classNames2(styles_module_default2.chatWelcome, "p-t-32"),
5314
+ className: classNames(styles_module_default2.chatWelcome, "p-t-32"),
5201
5315
  variant: "borderless",
5202
5316
  icon: /* @__PURE__ */ jsx(
5203
5317
  RenderWrapper,
@@ -5223,7 +5337,7 @@ var WelcomeItem_default = ({ icon = true, title = true, description = true, prom
5223
5337
  DefaultComponent: /* @__PURE__ */ jsx(
5224
5338
  Prompts,
5225
5339
  {
5226
- className: classNames2("m-t-16", styles_module_default2.promptItem),
5340
+ className: classNames("m-t-16", styles_module_default2.promptItem),
5227
5341
  wrap: true,
5228
5342
  onItemClick: (info) => chatStore.sendMessage(info.data.description),
5229
5343
  items: recommendQuestions
@@ -5432,7 +5546,7 @@ var BubbleListItems_default = ({
5432
5546
  autoScroll: false,
5433
5547
  ref: listRef,
5434
5548
  items: bubbleListItems,
5435
- className: classNames2(styles_module_default2.bubbleList, "height-full", "scroll-fade-in"),
5549
+ className: classNames(styles_module_default2.bubbleList, "height-full", "scroll-fade-in"),
5436
5550
  onScroll: handleScroll
5437
5551
  },
5438
5552
  conversationState.active.id
@@ -5583,7 +5697,7 @@ var ResourceSelectorModal_default = ({ open, type, onCancel }) => {
5583
5697
  return /* @__PURE__ */ jsxs(
5584
5698
  Flex,
5585
5699
  {
5586
- className: classNames2(style_module_default.categoryItem, { [style_module_default.categoryActive]: isChecked }),
5700
+ className: classNames(style_module_default.categoryItem, { [style_module_default.categoryActive]: isChecked }),
5587
5701
  onClick: () => handleCategoryChange(cat.id, !isChecked),
5588
5702
  children: [
5589
5703
  /* @__PURE__ */ jsx(
@@ -5618,7 +5732,7 @@ var ResourceSelectorModal_default = ({ open, type, onCancel }) => {
5618
5732
  "\u5DF2\u9009 ",
5619
5733
  selectedIds.length
5620
5734
  ] }) }),
5621
- /* @__PURE__ */ jsxs("div", { className: classNames2(style_module_default.tagsArea, { [style_module_default.tagsExpanded]: tagsExpanded }), children: [
5735
+ /* @__PURE__ */ jsxs("div", { className: classNames(style_module_default.tagsArea, { [style_module_default.tagsExpanded]: tagsExpanded }), children: [
5622
5736
  /* @__PURE__ */ jsxs(Flex, { gap: 8, className: style_module_default.tagContainer, wrap: true, ref: tagsContainerRef, children: [
5623
5737
  selectedIds.map((id) => /* @__PURE__ */ jsx(
5624
5738
  Tag,
@@ -5648,7 +5762,7 @@ var ResourceSelectorModal_default = ({ open, type, onCancel }) => {
5648
5762
  return /* @__PURE__ */ jsxs(
5649
5763
  "div",
5650
5764
  {
5651
- className: classNames2(style_module_default.listItem, { [style_module_default.listItemSelected]: isSelected }),
5765
+ className: classNames(style_module_default.listItem, { [style_module_default.listItemSelected]: isSelected }),
5652
5766
  onClick: () => toggleItemSelection(item.id),
5653
5767
  children: [
5654
5768
  /* @__PURE__ */ jsx("div", { className: style_module_default.itemIconWrapper, children: /* @__PURE__ */ jsx(IconFont_default, { type: iconType }) }),
@@ -5778,7 +5892,7 @@ var ReasonBtn_default = ({}) => {
5778
5892
  return /* @__PURE__ */ jsxs(
5779
5893
  "div",
5780
5894
  {
5781
- className: classNames2(style_module_default.resourceBtn, { [style_module_default.resourceBtnActive]: agentState.model.reasoning }),
5895
+ className: classNames(style_module_default.resourceBtn, { [style_module_default.resourceBtnActive]: agentState.model.reasoning }),
5782
5896
  onClick: () => chatStore.setAgentModel({ ...agentState.model, reasoning: !agentState.model.reasoning }),
5783
5897
  children: [
5784
5898
  /* @__PURE__ */ jsx(IconFont_default, { type: "icon-reason" }),
@@ -6251,9 +6365,9 @@ var ChatMainPanel = memo(
6251
6365
  );
6252
6366
  const configState = useSnapshot(chatStore.config);
6253
6367
  const agentState = useSnapshot(chatStore.agent);
6254
- return /* @__PURE__ */ jsxs(Flex, { vertical: true, className: classNames2("height-full"), children: [
6368
+ return /* @__PURE__ */ jsxs(Flex, { vertical: true, className: classNames("height-full"), children: [
6255
6369
  /* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.chatHeader, DefaultComponent: ChatHeader_default }),
6256
- /* @__PURE__ */ jsxs(Flex, { align: "center", vertical: true, gap: 24, className: classNames2("height-full", styles_module_default5.bodyWidth), children: [
6370
+ /* @__PURE__ */ jsxs(Flex, { align: "center", vertical: true, gap: 24, className: classNames("height-full", styles_module_default5.bodyWidth), children: [
6257
6371
  shouldRender(agentState.agentInfo.userInput && agentState.agentInfo.userInput.length > 0) && /* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.userInput, DefaultComponent: UserInputPanel_default }),
6258
6372
  shouldRender(configState.layout.messageList) && /* @__PURE__ */ jsx("div", { className: "full-scroll", style: { width: "100%" }, children: /* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.messageList, DefaultComponent: BubbleListItems_default }) }),
6259
6373
  /* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.senderHeader, DefaultComponent: /* @__PURE__ */ jsx(ChatSenderHeader_default, {}) }),
@@ -6288,7 +6402,7 @@ var ChatPreviewPanel = memo(({ file }) => {
6288
6402
  return /* @__PURE__ */ jsxs(Fragment, { children: [
6289
6403
  file.fileUrl && /* @__PURE__ */ jsxs(Flex, { vertical: true, className: "height-full", children: [
6290
6404
  /* @__PURE__ */ jsxs("div", { className: styles_module_default5.previewHeader, children: [
6291
- /* @__PURE__ */ jsx("div", { className: classNames2(styles_module_default5.previewHeaderTitle, "text-ellipsis"), title: file.fileName, children: file.fileName }),
6405
+ /* @__PURE__ */ jsx("div", { className: classNames(styles_module_default5.previewHeaderTitle, "text-ellipsis"), title: file.fileName, children: file.fileName }),
6292
6406
  /* @__PURE__ */ jsxs(Flex, { gap: 8, justify: "center", align: "center", children: [
6293
6407
  /* @__PURE__ */ jsx(
6294
6408
  Button,
@@ -6424,12 +6538,12 @@ var layouts_default = forwardRef(({ theme: theme5, params, hooks, layout, config
6424
6538
  useEffect(() => {
6425
6539
  hooks?.onBeforeInit?.();
6426
6540
  }, []);
6427
- return /* @__PURE__ */ jsx(XProvider, { theme: { cssVar: {}, ...theme5 }, children: /* @__PURE__ */ jsx(ChatProvider, { store: chatStore, children: /* @__PURE__ */ jsx(Spin, { spinning: configState.loading, classNames: { root: "full-spin" }, children: /* @__PURE__ */ jsxs(Flex, { vertical: true, className: classNames2(index_module_default3.chatLayout, "zero-chat-layout", "height-full"), children: [
6541
+ return /* @__PURE__ */ jsx(XProvider, { theme: { cssVar: {}, ...theme5 }, children: /* @__PURE__ */ jsx(ChatProvider, { store: chatStore, children: /* @__PURE__ */ jsx(Spin, { spinning: configState.loading, classNames: { root: "full-spin" }, children: /* @__PURE__ */ jsxs(Flex, { vertical: true, className: classNames(index_module_default3.chatLayout, "zero-chat-layout", "height-full"), children: [
6428
6542
  /* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.globalHeader, DefaultComponent: ChatHeader_default }),
6429
6543
  /* @__PURE__ */ jsxs(Flex, { ref: containerRef, className: "full-scroll", children: [
6430
6544
  /* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.leftPanel }),
6431
6545
  /* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.conversationList, DefaultComponent: ConversationListPanel_default }),
6432
- /* @__PURE__ */ jsxs(Splitter, { className: classNames2("flex-1", index_module_default3.animatedSplitter, { [index_module_default3.hideSplitterBar]: !hasPreView }), children: [
6546
+ /* @__PURE__ */ jsxs(Splitter, { className: classNames("flex-1", index_module_default3.animatedSplitter, { [index_module_default3.hideSplitterBar]: !hasPreView }), children: [
6433
6547
  /* @__PURE__ */ jsx(Splitter.Panel, { collapsible: false, max: 800, min: 400, size: sizes[1], children: /* @__PURE__ */ jsx(ChatMainPanel_default, { ref: senderRef }) }),
6434
6548
  /* @__PURE__ */ jsx(Splitter.Panel, { collapsible: false, min: 600, size: sizes[0], children: /* @__PURE__ */ jsx(ChatPreviewPanel_default, { file: configState.preview.file }) })
6435
6549
  ] })