@zero-library/chat-copilot 3.1.13 → 3.1.15

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, DeleteOutlined, StarOutlined, RedoOutlined, StarFilled, 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, StarFilled, StarOutlined, RedoOutlined, DeleteOutlined, 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, Popconfirm, 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, InputNumber, Switch as Switch$1, message, Tabs, Upload, Popconfirm, 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,8 @@ 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 classNames from 'classnames';
21
+ import classNames2 from 'classnames';
22
+ import console2 from 'console';
22
23
  import InfiniteScroll from 'react-infinite-scroll-component';
23
24
  import { XCard as XCard$1 } from '@ant-design/x-card';
24
25
  import '@ant-design/x-markdown/themes/light.css';
@@ -45,7 +46,7 @@ var styles_module_default = {
45
46
  var Attachments_default = forwardRef(({ fileUpload, fileUploadConfig, fileList = [], onChange, extraParams }, ref) => {
46
47
  const { message: message3 } = App.useApp();
47
48
  const chatStore = useChatStore();
48
- useSnapshot(chatStore.agent);
49
+ const configState = useSnapshot(chatStore.config);
49
50
  const fileListRef = useRef([]);
50
51
  const [attachedFiles, setAttachedFiles, getAttachedFiles] = useRefState([]);
51
52
  useEffect(() => {
@@ -164,8 +165,8 @@ var Attachments_default = forwardRef(({ fileUpload, fileUploadConfig, fileList =
164
165
  currentFile.abortController.abort();
165
166
  }
166
167
  setAttachedFiles(attachedFiles.filter((f) => f.uid !== file.uid));
167
- chatStore.config.params.convMeta?.libraryId;
168
- file.path;
168
+ const filePath = file.path;
169
+ configState.hooks?.onAfterRemoveFile?.(filePath);
169
170
  };
170
171
  useImperativeHandle(
171
172
  ref,
@@ -1228,6 +1229,7 @@ function createChatStore() {
1228
1229
  await config.services.request.deleteConversation(conversationId);
1229
1230
  message.success("\u5220\u9664\u6210\u529F");
1230
1231
  conversations.list.items = conversations.list.items.filter((item) => item.key !== conversationId);
1232
+ favorite.list.items = favorite.list.items.filter((item) => item.id !== conversationId);
1231
1233
  delete conversation.messages[conversationId];
1232
1234
  if (conversation.active.id === conversationId) {
1233
1235
  createConversation();
@@ -1273,6 +1275,7 @@ function createChatStore() {
1273
1275
  id: "id",
1274
1276
  label: "title",
1275
1277
  spec: "spec",
1278
+ isFavorite: "isFavorite",
1276
1279
  group: (c) => {
1277
1280
  return classifyTime(c.updatedAt);
1278
1281
  }
@@ -1327,7 +1330,9 @@ function createChatStore() {
1327
1330
  item.isFavorite = isFavorite;
1328
1331
  }
1329
1332
  }
1330
- if (!isFavorite && favorite.list.items.length) {
1333
+ if (isFavorite) {
1334
+ await getConversationFavorite();
1335
+ } else if (favorite.list.items.length) {
1331
1336
  favorite.list.items = favorite.list.items.filter((item) => item.id !== conversationId);
1332
1337
  }
1333
1338
  message.success(isFavorite ? "\u6536\u85CF\u6210\u529F" : "\u5DF2\u53D6\u6D88\u6536\u85CF");
@@ -2200,109 +2205,34 @@ window._iconfont_svg_string_5021436 = '<svg><symbol id="icon-Ollama" viewBox="0
2200
2205
  // src/components/IconFont/index.ts
2201
2206
  var IconFont = createFromIconfontCN({});
2202
2207
  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
2208
  var ConversationFavoritesBtn_default = ({ icon, ...rest }) => {
2242
2209
  const chatStore = useChatStore();
2210
+ const conversationsState = useSnapshot(chatStore.conversations);
2243
2211
  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();
2212
+ const activeConversation = useMemo(() => {
2213
+ return conversationsState.list.items.find((item) => item.id === conversationState.active.id);
2214
+ }, [conversationsState.list.items, conversationState.active.id]);
2215
+ const isFavorite = Boolean(activeConversation?.isFavorite);
2216
+ const handleToggleFavorite = () => {
2217
+ if (!conversationState.active.id) return;
2218
+ chatStore.collectConversation(conversationState.active.id, !isFavorite);
2289
2219
  };
2290
2220
  return /* @__PURE__ */ jsx(
2291
- Popover,
2221
+ Button,
2292
2222
  {
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 })
2223
+ title: isFavorite ? "\u53D6\u6D88\u6536\u85CF" : "\u6536\u85CF",
2224
+ type: "text",
2225
+ size: "small",
2226
+ disabled: !conversationState.active.id,
2227
+ icon: icon?.() || (isFavorite ? /* @__PURE__ */ jsx(StarFilled, { className: "primary-text" }) : /* @__PURE__ */ jsx(StarOutlined, {})),
2228
+ onClick: handleToggleFavorite,
2229
+ ...rest
2300
2230
  }
2301
2231
  );
2302
2232
  };
2303
2233
  var CreateBtn_default = ({ icon, ...rest }) => {
2304
2234
  const chatStore = useChatStore();
2305
- return /* @__PURE__ */ jsx(Button, { title: "\u65B0\u5EFA\u4F1A\u8BDD", size: "large", type: "text", icon: icon?.() || /* @__PURE__ */ jsx(PlusOutlined, {}), onClick: () => chatStore.createConversation(), ...rest });
2235
+ return /* @__PURE__ */ jsx(Button, { title: "\u65B0\u5EFA\u4F1A\u8BDD", size: "small", type: "text", icon: icon?.() || /* @__PURE__ */ jsx(PlusOutlined, {}), onClick: () => chatStore.createConversation(), ...rest });
2306
2236
  };
2307
2237
 
2308
2238
  // src/ui/common/styles.module.less
@@ -2315,6 +2245,10 @@ var styles_module_default2 = {
2315
2245
  conversationListPanel: "styles_module_conversationListPanel",
2316
2246
  createConversationButton: "styles_module_createConversationButton",
2317
2247
  conversations: "styles_module_conversations",
2248
+ conversationTabs: "styles_module_conversationTabs",
2249
+ conversationTabPane: "styles_module_conversationTabPane",
2250
+ conversationEmpty: "styles_module_conversationEmpty",
2251
+ conversationScrollArea: "styles_module_conversationScrollArea",
2318
2252
  chatWelcomeWrap: "styles_module_chatWelcomeWrap",
2319
2253
  chatWelcome: "styles_module_chatWelcome",
2320
2254
  promptItem: "styles_module_promptItem",
@@ -2333,12 +2267,30 @@ var styles_module_default2 = {
2333
2267
  };
2334
2268
  var ConversationList_default = () => {
2335
2269
  const chatStore = useChatStore();
2270
+ const agentState = useSnapshot(chatStore.agent);
2336
2271
  const conversationsState = useSnapshot(chatStore.conversations);
2337
2272
  const conversationState = useSnapshot(chatStore.conversation);
2273
+ const favoriteState = useSnapshot(chatStore.favorite);
2274
+ const [activeTabKey, setActiveTabKey] = useState("history");
2275
+ useEffect(() => {
2276
+ if (!agentState.agentInfo.id) return;
2277
+ chatStore.getConversationFavorite();
2278
+ }, [agentState.agentInfo.id, chatStore]);
2338
2279
  const conversationList = useMemo(() => {
2339
2280
  return conversationsState.list.items.filter((item) => item.label);
2340
2281
  }, [conversationsState.list.items]);
2341
- const menuConfig = (conversation) => ({
2282
+ const favoriteConversationList = useMemo(() => {
2283
+ return favoriteState.list.items.filter((item) => item.title).map((item) => ({
2284
+ ...item,
2285
+ key: item.id,
2286
+ id: item.id,
2287
+ label: item.title,
2288
+ spec: item.spec,
2289
+ isFavorite: true,
2290
+ group: classifyTime(item.updatedAt)
2291
+ }));
2292
+ }, [favoriteState.list.items]);
2293
+ const historyMenuConfig = (conversation) => ({
2342
2294
  items: [
2343
2295
  {
2344
2296
  label: `${conversation.isFavorite ? "\u53D6\u6D88\u6536\u85CF" : "\u6536\u85CF"}`,
@@ -2361,31 +2313,135 @@ var ConversationList_default = () => {
2361
2313
  }
2362
2314
  }
2363
2315
  });
2364
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("div", { className: "height-full scroll-fade-in", id: "scrollableDiv", children: conversationList.length ? /* @__PURE__ */ jsx(
2365
- InfiniteScroll,
2316
+ const favoriteMenuConfig = (conversation) => ({
2317
+ trigger: /* @__PURE__ */ jsx(
2318
+ Popconfirm,
2319
+ {
2320
+ title: "\u63D0\u793A",
2321
+ okText: "\u786E\u5B9A",
2322
+ cancelText: "\u53D6\u6D88",
2323
+ description: "\u786E\u8BA4\u53D6\u6D88\u6536\u85CF\u8BE5\u4F1A\u8BDD\u5417\uFF1F",
2324
+ onConfirm: (e) => {
2325
+ e.stopPropagation();
2326
+ chatStore.collectConversation(conversation.id, false);
2327
+ },
2328
+ onCancel: (e) => e.stopPropagation(),
2329
+ children: /* @__PURE__ */ jsx(
2330
+ Button,
2331
+ {
2332
+ icon: /* @__PURE__ */ jsx(DeleteOutlined, {}),
2333
+ title: "\u5220\u9664",
2334
+ type: "text",
2335
+ onClick: (e) => {
2336
+ e.stopPropagation();
2337
+ }
2338
+ }
2339
+ )
2340
+ }
2341
+ ),
2342
+ items: []
2343
+ });
2344
+ return /* @__PURE__ */ jsx("div", { className: styles_module_default2.conversationTabs, children: /* @__PURE__ */ jsx(
2345
+ Tabs,
2366
2346
  {
2367
- dataLength: conversationList.length,
2368
- hasMore: false,
2369
- next: () => {
2370
- console.log("next");
2371
- },
2372
- loader: /* @__PURE__ */ jsx("div", { className: "text-center", children: /* @__PURE__ */ jsx(Spin, { indicator: /* @__PURE__ */ jsx(RedoOutlined, { spin: true }), size: "small" }) }),
2373
- style: { overflow: "hidden" },
2374
- scrollableTarget: "scrollableDiv",
2375
- children: /* @__PURE__ */ jsx(
2376
- Conversations,
2347
+ activeKey: activeTabKey,
2348
+ centered: true,
2349
+ onChange: setActiveTabKey,
2350
+ items: [
2351
+ {
2352
+ key: "history",
2353
+ label: "\u5386\u53F2\u4F1A\u8BDD",
2354
+ children: /* @__PURE__ */ jsx("div", { className: styles_module_default2.conversationTabPane, children: conversationList.length ? /* @__PURE__ */ jsx("div", { className: styles_module_default2.conversationScrollArea, id: "historyConversationScrollableDiv", children: /* @__PURE__ */ jsx(
2355
+ InfiniteScroll,
2356
+ {
2357
+ dataLength: conversationList.length,
2358
+ hasMore: false,
2359
+ next: () => {
2360
+ console2.log("next");
2361
+ },
2362
+ loader: /* @__PURE__ */ jsx("div", { className: "text-center", children: /* @__PURE__ */ jsx(Spin, { indicator: /* @__PURE__ */ jsx(RedoOutlined, { spin: true }), size: "small" }) }),
2363
+ style: { overflow: "hidden" },
2364
+ scrollableTarget: "historyConversationScrollableDiv",
2365
+ children: /* @__PURE__ */ jsx(
2366
+ Conversations,
2367
+ {
2368
+ className: styles_module_default2.conversations,
2369
+ items: conversationList,
2370
+ activeKey: conversationState.active.id,
2371
+ onActiveChange: async (id) => chatStore.switchConversation(id),
2372
+ groupable: true,
2373
+ menu: historyMenuConfig
2374
+ }
2375
+ )
2376
+ }
2377
+ ) }) : /* @__PURE__ */ jsx("div", { className: styles_module_default2.conversationEmpty, children: /* @__PURE__ */ jsx(Empty, { description: "\u6682\u65E0\u4F1A\u8BDD\u8BB0\u5F55", image: Empty.PRESENTED_IMAGE_SIMPLE }) }) })
2378
+ },
2377
2379
  {
2378
- className: styles_module_default2.conversations,
2379
- items: conversationList,
2380
- activeKey: conversationState.active.id,
2381
- onActiveChange: async (id) => chatStore.switchConversation(id),
2382
- groupable: true,
2383
- menu: menuConfig
2380
+ key: "favorite",
2381
+ label: "\u6536\u85CF\u4F1A\u8BDD",
2382
+ children: /* @__PURE__ */ jsx("div", { className: styles_module_default2.conversationTabPane, children: favoriteConversationList.length ? /* @__PURE__ */ jsx("div", { className: styles_module_default2.conversationScrollArea, id: "favoriteConversationScrollableDiv", children: /* @__PURE__ */ jsx(
2383
+ InfiniteScroll,
2384
+ {
2385
+ dataLength: favoriteConversationList.length,
2386
+ hasMore: false,
2387
+ next: () => {
2388
+ console2.log("next");
2389
+ },
2390
+ loader: /* @__PURE__ */ jsx("div", { className: "text-center", children: /* @__PURE__ */ jsx(Spin, { indicator: /* @__PURE__ */ jsx(RedoOutlined, { spin: true }), size: "small" }) }),
2391
+ style: { overflow: "hidden" },
2392
+ scrollableTarget: "favoriteConversationScrollableDiv",
2393
+ children: /* @__PURE__ */ jsx(
2394
+ Conversations,
2395
+ {
2396
+ className: styles_module_default2.conversations,
2397
+ items: favoriteConversationList,
2398
+ activeKey: conversationState.active.id,
2399
+ onActiveChange: async (id) => chatStore.switchConversation(id),
2400
+ groupable: true,
2401
+ menu: favoriteMenuConfig
2402
+ }
2403
+ )
2404
+ }
2405
+ ) }) : /* @__PURE__ */ jsx("div", { className: styles_module_default2.conversationEmpty, children: /* @__PURE__ */ jsx(Empty, { description: "\u6682\u65E0\u6536\u85CF\u4F1A\u8BDD", image: Empty.PRESENTED_IMAGE_SIMPLE }) }) })
2384
2406
  }
2385
- )
2407
+ ]
2386
2408
  }
2387
- ) : /* @__PURE__ */ jsx(Empty, { description: "\u6682\u65E0\u4F1A\u8BDD\u8BB0\u5F55", image: Empty.PRESENTED_IMAGE_SIMPLE }) }) });
2409
+ ) });
2388
2410
  };
2411
+
2412
+ // src/ui/common/FeatureComponents/style.module.less
2413
+ var style_module_default = {
2414
+ popover: "style_module_popover",
2415
+ resourceBtn: "style_module_resourceBtn",
2416
+ divider: "style_module_divider",
2417
+ count: "style_module_count",
2418
+ resourceBtnActive: "style_module_resourceBtnActive",
2419
+ customModal: "style_module_customModal",
2420
+ layout: "style_module_layout",
2421
+ sider: "style_module_sider",
2422
+ categoryName: "style_module_categoryName",
2423
+ siderContent: "style_module_siderContent",
2424
+ categoryItem: "style_module_categoryItem",
2425
+ categoryActive: "style_module_categoryActive",
2426
+ roundCheckbox: "style_module_roundCheckbox",
2427
+ content: "style_module_content",
2428
+ searchInput: "style_module_searchInput",
2429
+ selectedCount: "style_module_selectedCount",
2430
+ tagsArea: "style_module_tagsArea",
2431
+ tagContainer: "style_module_tagContainer",
2432
+ tag: "style_module_tag",
2433
+ expandBtnWrapper: "style_module_expandBtnWrapper",
2434
+ expandBtn: "style_module_expandBtn",
2435
+ tagsExpanded: "style_module_tagsExpanded",
2436
+ listArea: "style_module_listArea",
2437
+ listInner: "style_module_listInner",
2438
+ listItem: "style_module_listItem",
2439
+ listItemSelected: "style_module_listItemSelected",
2440
+ itemIconWrapper: "style_module_itemIconWrapper",
2441
+ itemInfo: "style_module_itemInfo",
2442
+ itemDesc: "style_module_itemDesc",
2443
+ footer: "style_module_footer",
2444
+ titleContainer: "style_module_titleContainer"};
2389
2445
  var HistoryBtn_default = ({ icon, ...rest }) => {
2390
2446
  return /* @__PURE__ */ jsx(
2391
2447
  Popover,
@@ -2395,7 +2451,7 @@ var HistoryBtn_default = ({ icon, ...rest }) => {
2395
2451
  classNames: { container: style_module_default.popover },
2396
2452
  content: /* @__PURE__ */ jsx(ConversationList_default, {}),
2397
2453
  trigger: ["click"],
2398
- children: /* @__PURE__ */ jsx(Button, { title: "\u5386\u53F2\u4F1A\u8BDD", size: "large", type: "text", icon: icon?.() || /* @__PURE__ */ jsx(CommentOutlined, {}), ...rest })
2454
+ children: /* @__PURE__ */ jsx(Button, { title: "\u5386\u53F2\u4F1A\u8BDD", size: "small", type: "text", icon: icon?.() || /* @__PURE__ */ jsx(CommentOutlined, {}), ...rest })
2399
2455
  }
2400
2456
  );
2401
2457
  };
@@ -2410,7 +2466,7 @@ var ChatHeader_default = ({
2410
2466
  const chatStore = useChatStore();
2411
2467
  const agentState = useSnapshot(chatStore.agent);
2412
2468
  const configState = useSnapshot(chatStore.config);
2413
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: classNames(styles_module_default2.chatHeader, "zero-chat-header"), children: [
2469
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: classNames2(styles_module_default2.chatHeader, "zero-chat-header"), children: [
2414
2470
  /* @__PURE__ */ jsxs("div", { className: styles_module_default2.chatHeaderContent, children: [
2415
2471
  /* @__PURE__ */ jsx(
2416
2472
  RenderWrapper,
@@ -2456,8 +2512,8 @@ var ConversationListHeader_default = ({ title = true, avatar = true, newConversa
2456
2512
  {
2457
2513
  control: title,
2458
2514
  DefaultComponent: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(Flex, { vertical: true, gap: 4, flex: 1, style: { minWidth: 0 }, children: [
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 })
2515
+ /* @__PURE__ */ jsx(Text, { strong: true, className: classNames2("fz-16"), children: agentState.agentInfo.name }),
2516
+ /* @__PURE__ */ jsx(Text, { type: "secondary", ellipsis: true, className: classNames2("fz-12"), children: agentState.agentInfo.description })
2461
2517
  ] }) })
2462
2518
  }
2463
2519
  )
@@ -2472,7 +2528,7 @@ var ConversationListHeader_default = ({ title = true, avatar = true, newConversa
2472
2528
  block: true,
2473
2529
  type: "primary",
2474
2530
  onClick: () => chatStore.createConversation(),
2475
- className: classNames(styles_module_default2.createConversationButton),
2531
+ className: classNames2(styles_module_default2.createConversationButton),
2476
2532
  icon: /* @__PURE__ */ jsx(PlusOutlined, {}),
2477
2533
  children: "\u65B0\u5EFA\u4F1A\u8BDD"
2478
2534
  }
@@ -2482,7 +2538,7 @@ var ConversationListHeader_default = ({ title = true, avatar = true, newConversa
2482
2538
  ] });
2483
2539
  };
2484
2540
  var ConversationListPanel = ({ header }) => {
2485
- return /* @__PURE__ */ jsxs(Flex, { vertical: true, className: classNames("height-full", "zero-chat-conversations", styles_module_default2.conversationListPanel), children: [
2541
+ return /* @__PURE__ */ jsxs(Flex, { vertical: true, className: classNames2("height-full", "zero-chat-conversations", styles_module_default2.conversationListPanel), children: [
2486
2542
  /* @__PURE__ */ jsx(RenderWrapper, { control: header, DefaultComponent: ConversationListHeader_default }),
2487
2543
  /* @__PURE__ */ jsx("div", { className: "full-scroll", children: /* @__PURE__ */ jsx(ConversationList_default, {}) })
2488
2544
  ] });
@@ -2951,7 +3007,7 @@ var CHART_COMPONENTS = Object.fromEntries(
2951
3007
  );
2952
3008
  var Charts_default = ({ data, loading }) => {
2953
3009
  const { type, config } = data;
2954
- return /* @__PURE__ */ jsx("div", { className: classNames(styles_module_default3.chart, "scroll-fade-in"), children: loading ? (
3010
+ return /* @__PURE__ */ jsx("div", { className: classNames2(styles_module_default3.chart, "scroll-fade-in"), children: loading ? (
2955
3011
  // Antd 骨架屏
2956
3012
  /* @__PURE__ */ jsx(Skeleton.Node, { active: true, className: styles_module_default3.chartSkeleton, children: /* @__PURE__ */ jsx(DotChartOutlined, { className: styles_module_default3.chartSkeletonIcon }) })
2957
3013
  ) : /* @__PURE__ */ jsx(
@@ -3246,7 +3302,7 @@ var XMarkdown_default = memo(({ message: message3, components = {}, content = ""
3246
3302
  return /* @__PURE__ */ jsx(
3247
3303
  XMarkdown,
3248
3304
  {
3249
- className: classNames("x-markdown-light", styles_module_default4.xMarkdownStyle),
3305
+ className: classNames2("x-markdown-light", styles_module_default4.xMarkdownStyle),
3250
3306
  config,
3251
3307
  ...rest,
3252
3308
  content: processedContent,
@@ -3591,7 +3647,7 @@ var Switch = ({ id, label, value, bind_path_token, onChange, onDataChange }) =>
3591
3647
  /* @__PURE__ */ jsx("span", { style: { fontSize: 13, color: "#555" }, children: label })
3592
3648
  ] });
3593
3649
  };
3594
- var Button10 = ({ label, variant = "default", onClick, action, onAction }) => {
3650
+ var Button11 = ({ label, variant = "default", onClick, action, onAction }) => {
3595
3651
  const handleClick = () => {
3596
3652
  if (onClick) {
3597
3653
  onClick();
@@ -3621,7 +3677,7 @@ var A2uiComponents = {
3621
3677
  TextField,
3622
3678
  Select,
3623
3679
  Switch,
3624
- Button: Button10,
3680
+ Button: Button11,
3625
3681
  Divider,
3626
3682
  Tag: Tag3,
3627
3683
  Progress,
@@ -4898,7 +4954,7 @@ var TextNode2 = React10__default.memo(
4898
4954
  }
4899
4955
  const markdownContent = typeof content === "string" ? transformResourceText(content) : content;
4900
4956
  return /* @__PURE__ */ jsxs(Fragment, { children: [
4901
- !!item.reasoningContent && /* @__PURE__ */ jsx(Think, { title: "\u6DF1\u5EA6\u601D\u8003", children: item.reasoningContent }),
4957
+ !!item.reasoningContent && /* @__PURE__ */ jsx(Think, { title: "\u6DF1\u5EA6\u601D\u8003", style: { marginBottom: "16px" }, children: item.reasoningContent }),
4902
4958
  !!markdownContent && /* @__PURE__ */ jsx(XMarkdown_default, { message: message3, components: markdownComponents, content: markdownContent })
4903
4959
  ] });
4904
4960
  }
@@ -4907,15 +4963,17 @@ var TextNode2 = React10__default.memo(
4907
4963
  // src/components/CustomComponents/ToolRenders/index.module.less
4908
4964
  var index_module_default2 = {
4909
4965
  toolCollapse: "index_module_toolCollapse",
4910
- iconContainer: "index_module_iconContainer",
4966
+ toolCallItem: "index_module_toolCallItem",
4967
+ toolIcon: "index_module_toolIcon",
4911
4968
  toolName: "index_module_toolName",
4969
+ statusIcon: "index_module_statusIcon",
4970
+ duration: "index_module_duration",
4912
4971
  toolNamePending: "index_module_toolNamePending",
4913
4972
  dot: "index_module_dot",
4914
4973
  dotBlink: "index_module_dotBlink",
4915
- duration: "index_module_duration",
4916
- statusIcon: "index_module_statusIcon",
4917
4974
  expandIcon: "index_module_expandIcon",
4918
4975
  expanded: "index_module_expanded",
4976
+ contentScrollContainer: "index_module_contentScrollContainer",
4919
4977
  sectionLabel: "index_module_sectionLabel",
4920
4978
  plainTextContainer: "index_module_plainTextContainer",
4921
4979
  markdownContainer: "index_module_markdownContainer",
@@ -4938,7 +4996,6 @@ var index_module_default2 = {
4938
4996
  errorDisplay: "index_module_errorDisplay",
4939
4997
  sectionBlock: "index_module_sectionBlock",
4940
4998
  compactSectionBlock: "index_module_compactSectionBlock",
4941
- contentScrollContainer: "index_module_contentScrollContainer",
4942
4999
  subAgentContainer: "index_module_subAgentContainer",
4943
5000
  subAgentHeader: "index_module_subAgentHeader",
4944
5001
  subAgentName: "index_module_subAgentName",
@@ -5178,13 +5235,13 @@ var ToolCallItem = ({ item }) => {
5178
5235
  const displayName = item.title || (showLoading ? "" : item.toolName || "Unknown Tool");
5179
5236
  const renderIcon = () => {
5180
5237
  if (!item.toolIcon) {
5181
- return /* @__PURE__ */ jsx(ToolOutlined, { style: { fontSize: 14, color: token.colorTextSecondary } });
5238
+ return /* @__PURE__ */ jsx(ToolOutlined, { style: { fontSize: 14 } });
5182
5239
  }
5183
5240
  const isUrl = /^(http|\/)/.test(item.toolIcon);
5184
5241
  if (isUrl) {
5185
5242
  return /* @__PURE__ */ jsx("img", { src: item.toolIcon, alt: "tool-icon", style: { width: "100%", height: "100%", objectFit: "contain" } });
5186
5243
  }
5187
- return /* @__PURE__ */ jsx("span", { style: { fontSize: 14, lineHeight: 1 }, children: item.toolIcon });
5244
+ return /* @__PURE__ */ jsx("span", { className: index_module_default2.toolIcon, children: item.toolIcon });
5188
5245
  };
5189
5246
  return /* @__PURE__ */ jsx(
5190
5247
  Collapse,
@@ -5195,31 +5252,18 @@ var ToolCallItem = ({ item }) => {
5195
5252
  defaultActiveKey: isDefaultExpanded && hasContent ? [item.toolCallId || "fallback-key"] : void 0,
5196
5253
  expandIconPlacement: "end",
5197
5254
  expandIcon: ({ isActive }) => hasContent ? /* @__PURE__ */ jsx(RightOutlined, { className: `${index_module_default2.expandIcon} ${isActive ? index_module_default2.expanded : ""}` }) : null,
5198
- styles: {
5199
- header: {
5200
- padding: "4px 8px",
5201
- overflow: "hidden"
5202
- },
5203
- body: {
5204
- padding: "0 8px 8px"
5205
- }
5206
- },
5207
5255
  items: [
5208
5256
  {
5209
5257
  key: item.toolCallId || "fallback-key",
5210
5258
  showArrow: hasContent,
5211
- label: /* @__PURE__ */ jsxs(Flex, { align: "center", gap: 8, style: { flex: 1, minWidth: 0 }, children: [
5212
- /* @__PURE__ */ jsx("div", { className: index_module_default2.iconContainer, children: renderIcon() }),
5213
- displayName ? /* @__PURE__ */ jsx("span", { className: index_module_default2.toolName, children: displayName }) : /* @__PURE__ */ jsxs("span", { className: index_module_default2.toolNamePending, children: [
5259
+ label: /* @__PURE__ */ jsxs("div", { className: index_module_default2.toolCallItem, children: [
5260
+ /* @__PURE__ */ jsx("div", { children: renderIcon() }),
5261
+ displayName ? /* @__PURE__ */ jsx("span", { className: `${index_module_default2.toolName} text-ellipsis`, children: displayName }) : /* @__PURE__ */ jsxs("span", { className: index_module_default2.toolNamePending, children: [
5214
5262
  /* @__PURE__ */ jsx("span", { className: index_module_default2.dot }),
5215
5263
  /* @__PURE__ */ jsx("span", { className: index_module_default2.dot }),
5216
5264
  /* @__PURE__ */ jsx("span", { className: index_module_default2.dot })
5217
5265
  ] }),
5218
- showLoading && /* @__PURE__ */ jsx("div", { className: index_module_default2.statusIcon, style: { color: token.colorPrimary }, children: /* @__PURE__ */ jsx(LoadingOutlined, {}) }),
5219
- item.duration && /* @__PURE__ */ jsxs(Typography.Text, { className: index_module_default2.duration, children: [
5220
- item.duration,
5221
- "ms"
5222
- ] })
5266
+ showLoading && /* @__PURE__ */ jsx("div", { className: index_module_default2.statusIcon, style: { color: token.colorPrimary }, children: /* @__PURE__ */ jsx(LoadingOutlined, {}) })
5223
5267
  ] }),
5224
5268
  children: /* @__PURE__ */ jsx("div", { className: index_module_default2.contentScrollContainer, children: /* @__PURE__ */ jsx(
5225
5269
  CustomRender,
@@ -5306,7 +5350,7 @@ var MessageRender_default = React10__default.memo(({ role, message: message3, me
5306
5350
  ),
5307
5351
  index === lastToolCallIndex && messageIndex >= 0 ? /* @__PURE__ */ jsx(A2uiMessageCards, { messageIndex, message: message3 }) : null
5308
5352
  ] }, `message-${index}`)),
5309
- showPending && /* @__PURE__ */ jsx(Bubble, { role: role.user, placement: role.placement, content: /* @__PURE__ */ jsx(RunStartedNode, {}) }),
5353
+ showPending && role.user === "agent" && /* @__PURE__ */ jsx(Bubble, { role: role.user, placement: role.placement, content: /* @__PURE__ */ jsx(RunStartedNode, {}) }),
5310
5354
  quoteMsg && /* @__PURE__ */ jsx(QuoteMsgNode, { quoteMsg, role })
5311
5355
  ] });
5312
5356
  });
@@ -5323,7 +5367,7 @@ var WelcomeItem_default = ({ icon = true, title = true, description = true, prom
5323
5367
  /* @__PURE__ */ jsx(
5324
5368
  Welcome,
5325
5369
  {
5326
- className: classNames(styles_module_default2.chatWelcome, "p-t-32"),
5370
+ className: classNames2(styles_module_default2.chatWelcome, "p-t-32"),
5327
5371
  variant: "borderless",
5328
5372
  icon: /* @__PURE__ */ jsx(
5329
5373
  RenderWrapper,
@@ -5349,7 +5393,7 @@ var WelcomeItem_default = ({ icon = true, title = true, description = true, prom
5349
5393
  DefaultComponent: /* @__PURE__ */ jsx(
5350
5394
  Prompts,
5351
5395
  {
5352
- className: classNames("m-t-16", styles_module_default2.promptItem),
5396
+ className: classNames2("m-t-16", styles_module_default2.promptItem),
5353
5397
  wrap: true,
5354
5398
  onItemClick: (info) => chatStore.sendMessage(info.data.description),
5355
5399
  items: recommendQuestions
@@ -5558,7 +5602,7 @@ var BubbleListItems_default = ({
5558
5602
  autoScroll: false,
5559
5603
  ref: listRef,
5560
5604
  items: bubbleListItems,
5561
- className: classNames(styles_module_default2.bubbleList, "height-full", "scroll-fade-in"),
5605
+ className: classNames2(styles_module_default2.bubbleList, "height-full", "scroll-fade-in"),
5562
5606
  onScroll: handleScroll
5563
5607
  },
5564
5608
  conversationState.active.id
@@ -5709,7 +5753,7 @@ var ResourceSelectorModal_default = ({ open, type, onCancel }) => {
5709
5753
  return /* @__PURE__ */ jsxs(
5710
5754
  Flex,
5711
5755
  {
5712
- className: classNames(style_module_default.categoryItem, { [style_module_default.categoryActive]: isChecked }),
5756
+ className: classNames2(style_module_default.categoryItem, { [style_module_default.categoryActive]: isChecked }),
5713
5757
  onClick: () => handleCategoryChange(cat.id, !isChecked),
5714
5758
  children: [
5715
5759
  /* @__PURE__ */ jsx(
@@ -5744,7 +5788,7 @@ var ResourceSelectorModal_default = ({ open, type, onCancel }) => {
5744
5788
  "\u5DF2\u9009 ",
5745
5789
  selectedIds.length
5746
5790
  ] }) }),
5747
- /* @__PURE__ */ jsxs("div", { className: classNames(style_module_default.tagsArea, { [style_module_default.tagsExpanded]: tagsExpanded }), children: [
5791
+ /* @__PURE__ */ jsxs("div", { className: classNames2(style_module_default.tagsArea, { [style_module_default.tagsExpanded]: tagsExpanded }), children: [
5748
5792
  /* @__PURE__ */ jsxs(Flex, { gap: 8, className: style_module_default.tagContainer, wrap: true, ref: tagsContainerRef, children: [
5749
5793
  selectedIds.map((id) => /* @__PURE__ */ jsx(
5750
5794
  Tag,
@@ -5774,7 +5818,7 @@ var ResourceSelectorModal_default = ({ open, type, onCancel }) => {
5774
5818
  return /* @__PURE__ */ jsxs(
5775
5819
  "div",
5776
5820
  {
5777
- className: classNames(style_module_default.listItem, { [style_module_default.listItemSelected]: isSelected }),
5821
+ className: classNames2(style_module_default.listItem, { [style_module_default.listItemSelected]: isSelected }),
5778
5822
  onClick: () => toggleItemSelection(item.id),
5779
5823
  children: [
5780
5824
  /* @__PURE__ */ jsx("div", { className: style_module_default.itemIconWrapper, children: /* @__PURE__ */ jsx(IconFont_default, { type: iconType }) }),
@@ -5904,7 +5948,7 @@ var ReasonBtn_default = ({}) => {
5904
5948
  return /* @__PURE__ */ jsxs(
5905
5949
  "div",
5906
5950
  {
5907
- className: classNames(style_module_default.resourceBtn, { [style_module_default.resourceBtnActive]: agentState.model.reasoning }),
5951
+ className: classNames2(style_module_default.resourceBtn, { [style_module_default.resourceBtnActive]: agentState.model.reasoning }),
5908
5952
  onClick: () => chatStore.setAgentModel({ ...agentState.model, reasoning: !agentState.model.reasoning }),
5909
5953
  children: [
5910
5954
  /* @__PURE__ */ jsx(IconFont_default, { type: "icon-reason" }),
@@ -6377,9 +6421,9 @@ var ChatMainPanel = memo(
6377
6421
  );
6378
6422
  const configState = useSnapshot(chatStore.config);
6379
6423
  const agentState = useSnapshot(chatStore.agent);
6380
- return /* @__PURE__ */ jsxs(Flex, { vertical: true, className: classNames("height-full"), children: [
6424
+ return /* @__PURE__ */ jsxs(Flex, { vertical: true, className: classNames2("height-full"), children: [
6381
6425
  /* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.chatHeader, DefaultComponent: ChatHeader_default }),
6382
- /* @__PURE__ */ jsxs(Flex, { align: "center", vertical: true, gap: 24, className: classNames("height-full", styles_module_default5.bodyWidth), children: [
6426
+ /* @__PURE__ */ jsxs(Flex, { align: "center", vertical: true, gap: 24, className: classNames2("height-full", styles_module_default5.bodyWidth), children: [
6383
6427
  shouldRender(agentState.agentInfo.userInput && agentState.agentInfo.userInput.length > 0) && /* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.userInput, DefaultComponent: UserInputPanel_default }),
6384
6428
  shouldRender(configState.layout.messageList) && /* @__PURE__ */ jsx("div", { className: "full-scroll", style: { width: "100%" }, children: /* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.messageList, DefaultComponent: BubbleListItems_default }) }),
6385
6429
  /* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.senderHeader, DefaultComponent: /* @__PURE__ */ jsx(ChatSenderHeader_default, {}) }),
@@ -6414,7 +6458,7 @@ var ChatPreviewPanel = memo(({ file }) => {
6414
6458
  return /* @__PURE__ */ jsxs(Fragment, { children: [
6415
6459
  file.fileUrl && /* @__PURE__ */ jsxs(Flex, { vertical: true, className: "height-full", children: [
6416
6460
  /* @__PURE__ */ jsxs("div", { className: styles_module_default5.previewHeader, children: [
6417
- /* @__PURE__ */ jsx("div", { className: classNames(styles_module_default5.previewHeaderTitle, "text-ellipsis"), title: file.fileName, children: file.fileName }),
6461
+ /* @__PURE__ */ jsx("div", { className: classNames2(styles_module_default5.previewHeaderTitle, "text-ellipsis"), title: file.fileName, children: file.fileName }),
6418
6462
  /* @__PURE__ */ jsxs(Flex, { gap: 8, justify: "center", align: "center", children: [
6419
6463
  /* @__PURE__ */ jsx(
6420
6464
  Button,
@@ -6550,12 +6594,12 @@ var layouts_default = forwardRef(({ theme: theme5, params, hooks, layout, config
6550
6594
  useEffect(() => {
6551
6595
  hooks?.onBeforeInit?.();
6552
6596
  }, []);
6553
- 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: [
6597
+ 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: [
6554
6598
  /* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.globalHeader, DefaultComponent: ChatHeader_default }),
6555
6599
  /* @__PURE__ */ jsxs(Flex, { ref: containerRef, className: "full-scroll", children: [
6556
6600
  /* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.leftPanel }),
6557
6601
  /* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.conversationList, DefaultComponent: ConversationListPanel_default }),
6558
- /* @__PURE__ */ jsxs(Splitter, { className: classNames("flex-1", index_module_default3.animatedSplitter, { [index_module_default3.hideSplitterBar]: !hasPreView }), children: [
6602
+ /* @__PURE__ */ jsxs(Splitter, { className: classNames2("flex-1", index_module_default3.animatedSplitter, { [index_module_default3.hideSplitterBar]: !hasPreView }), children: [
6559
6603
  /* @__PURE__ */ jsx(Splitter.Panel, { collapsible: false, max: 800, min: 400, size: sizes[1], children: /* @__PURE__ */ jsx(ChatMainPanel_default, { ref: senderRef }) }),
6560
6604
  /* @__PURE__ */ jsx(Splitter.Panel, { collapsible: false, min: 600, size: sizes[0], children: /* @__PURE__ */ jsx(ChatPreviewPanel_default, { file: configState.preview.file }) })
6561
6605
  ] })