@ibiz-template-plugin/ai-chat 0.0.115 → 0.0.117

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/index.es.js +40981 -24965
  2. package/dist/index.legacy.js +28 -1
  3. package/dist/polyfills.legacy.js +2 -2
  4. package/dist/style.css +26 -1
  5. package/dist/types/components/chat-container/chat-container.d.ts +33 -25
  6. package/dist/types/components/chat-file-preview/chat-file-preview.d.ts +18 -0
  7. package/dist/types/components/chat-group-topics/components/selected-mode-topic/selected-mode-topic.d.ts +21 -0
  8. package/dist/types/components/chat-group-topics/components/show-hidden-setting/show-hidden-setting.d.ts +17 -0
  9. package/dist/types/components/chat-group-topics/components/topic-batch-action/topic-batch-action.d.ts +21 -0
  10. package/dist/types/components/chat-net-disk/chat-net-disk.d.ts +2 -2
  11. package/dist/types/components/common/breadcrumb/breadcrumb.d.ts +8 -1
  12. package/dist/types/components/common/drawer/drawer.d.ts +28 -0
  13. package/dist/types/components/common/lazy-list-tree/lazy-list-tree.d.ts +11 -1
  14. package/dist/types/components/common/lazy-tree/lazy-tree.d.ts +6 -0
  15. package/dist/types/components/flat-chat-container/flat-chat-container.d.ts +1 -0
  16. package/dist/types/constants/index.d.ts +4 -0
  17. package/dist/types/controller/ai-action-panel/ai-action-panel.controller.d.ts +18 -1
  18. package/dist/types/controller/ai-chat/ai-chat.controller.d.ts +39 -13
  19. package/dist/types/controller/ai-topic/ai-topic.controller.d.ts +83 -5
  20. package/dist/types/controller/file-system/file-system.controller.d.ts +85 -0
  21. package/dist/types/controller/index.d.ts +3 -0
  22. package/dist/types/controller/overlay/drawer-overlay.controller.d.ts +36 -0
  23. package/dist/types/controller/overlay/index.d.ts +1 -0
  24. package/dist/types/controller/overlay/overlay.controller.d.ts +67 -0
  25. package/dist/types/controller/tiptap/config/file-node-config.d.ts +3 -0
  26. package/dist/types/controller/tiptap/tiptap.controller.d.ts +50 -0
  27. package/dist/types/entity/chart-topic/chart-topic.d.ts +1 -0
  28. package/dist/types/entity/chat-message/chat-message.d.ts +1 -0
  29. package/dist/types/icons/eye-svg.d.ts +1 -0
  30. package/dist/types/icons/index.d.ts +2 -0
  31. package/dist/types/icons/new-folder-svg.d.ts +1 -0
  32. package/dist/types/icons/system-file/archive.d.ts +1 -0
  33. package/dist/types/icons/system-file/audio.d.ts +1 -0
  34. package/dist/types/icons/system-file/excel.d.ts +4 -0
  35. package/dist/types/icons/system-file/image.d.ts +1 -0
  36. package/dist/types/icons/system-file/index.d.ts +10 -0
  37. package/dist/types/icons/system-file/other.d.ts +2 -0
  38. package/dist/types/icons/system-file/ppt.d.ts +5 -0
  39. package/dist/types/icons/system-file/program.d.ts +1 -0
  40. package/dist/types/icons/system-file/text.d.ts +17 -0
  41. package/dist/types/icons/system-file/video.d.ts +5 -0
  42. package/dist/types/icons/system-file/word.d.ts +1 -0
  43. package/dist/types/interface/i-chat-message/i-chat-message.d.ts +6 -0
  44. package/dist/types/interface/i-chat-options/i-chat-options.d.ts +5 -11
  45. package/dist/types/interface/i-file-item/i-file-item.d.ts +67 -0
  46. package/dist/types/interface/i-file-system-options/i-file-system-options.d.ts +61 -0
  47. package/dist/types/interface/i-remote-resource/i-remote-resource.d.ts +6 -0
  48. package/dist/types/interface/i-tiptap/i-tiptap.d.ts +51 -0
  49. package/dist/types/interface/i-topic-options/i-topic-options.d.ts +50 -5
  50. package/dist/types/interface/index.d.ts +4 -2
  51. package/dist/types/locale/en/index.d.ts +8 -2
  52. package/dist/types/locale/zh-CN/index.d.ts +8 -2
  53. package/dist/types/utils/index.d.ts +1 -0
  54. package/dist/types/utils/util/system-file.d.ts +10 -0
  55. package/dist/types/utils/util/util.d.ts +2 -1
  56. package/package.json +2 -1
  57. package/dist/types/components/chat-editor/node/mention-node.d.ts +0 -3
  58. package/dist/types/interface/i-project/i-project.d.ts +0 -40
@@ -210,7 +210,6 @@ export declare class ChatContainer extends Component<ChatContainerProps, ChatCon
210
210
  fitPanelToViewport(panel: AiActionPanelController): void;
211
211
  ns: Namespace;
212
212
  containerRef: import('preact').RefObject<HTMLDivElement>;
213
- dragHandle: import('preact').RefObject<HTMLDivElement>;
214
213
  /**
215
214
  * 输入区容器(用于高度分隔条)
216
215
  */
@@ -237,13 +236,6 @@ export declare class ChatContainer extends Component<ChatContainerProps, ChatCon
237
236
  minHeight: number;
238
237
  showMode: string;
239
238
  };
240
- /**
241
- * 是否禁止拖动
242
- * - 拖拽边时应禁止拖动
243
- * @type {boolean}
244
- * @memberof ChatContainer
245
- */
246
- disabled: boolean;
247
239
  /**
248
240
  * 最小化是否在拖拽中
249
241
  * - 在拖拽时不应触发点击事件
@@ -255,13 +247,6 @@ export declare class ChatContainer extends Component<ChatContainerProps, ChatCon
255
247
  * 侧栏宽度拖动起始值(px)
256
248
  */
257
249
  sidebarDragStartWidth: number;
258
- /**
259
- * 拖拽容器边框时的方向标记(左右=宽、上下=高)
260
- */
261
- resizing: {
262
- width: boolean;
263
- height: boolean;
264
- };
265
250
  /**
266
251
  * 输入区高度拖动起始值(px)
267
252
  */
@@ -290,6 +275,13 @@ export declare class ChatContainer extends Component<ChatContainerProps, ChatCon
290
275
  * @type {ContainerContext}
291
276
  */
292
277
  containerContext: ContainerContext;
278
+ /**
279
+ * 同步 props 到容器上下文(引用仅在值变化时替换,保证消费者按需重渲染)
280
+ *
281
+ * @return {*}
282
+ * @memberof ChatContainer
283
+ */
284
+ syncContainerContext(): void;
293
285
  /**
294
286
  * 计算AI窗口样式
295
287
  *
@@ -326,18 +318,12 @@ export declare class ChatContainer extends Component<ChatContainerProps, ChatCon
326
318
  * @memberof ChatContainer
327
319
  */
328
320
  snapToEdge(): void;
329
- /**
330
- * 注册对话框拖拽
331
- *
332
- * @memberof ChatContainer
333
- */
334
- registerDragDialog(): void;
335
321
  /**
336
322
  * 注册对话框边界拖拽
337
323
  *
338
324
  * @memberof ChatContainer
339
325
  */
340
- registerDragDialogBorder(): void;
326
+ registerDrag(): void;
341
327
  /**
342
328
  * 处理全屏改变
343
329
  *
@@ -394,6 +380,24 @@ export declare class ChatContainer extends Component<ChatContainerProps, ChatCon
394
380
  * 右侧聊天区宽度
395
381
  */
396
382
  getRightWidth(): string;
383
+ /**
384
+ * @description 获取宽度
385
+ * @returns {*} {{
386
+ * centreMinWidth: number;
387
+ * leftWidth: number;
388
+ * rightWidth: number;
389
+ * leftMinWidth: number;
390
+ * rightMinWidth: number;
391
+ * }}
392
+ * @memberof ChatContainer
393
+ */
394
+ getWidth(): {
395
+ centreMinWidth: number;
396
+ leftWidth: number;
397
+ rightWidth: number;
398
+ leftMinWidth: number;
399
+ rightMinWidth: number;
400
+ };
397
401
  /**
398
402
  * 侧栏宽度拖动开始
399
403
  */
@@ -407,13 +411,17 @@ export declare class ChatContainer extends Component<ChatContainerProps, ChatCon
407
411
  */
408
412
  handleSidebarResizeEnd: () => void;
409
413
  /**
410
- * 将侧栏宽度校正到合理区间 [200, 容器宽度/2, 右侧最小宽]
414
+ * 将侧栏宽度校正到合理区间 [200, 容器宽度/3, 容器宽度-右侧最小宽]
411
415
  */
412
416
  clampSidebarWidth(width: number): number;
413
417
  /**
414
- * 拖动容器左右边框时实时校正侧栏宽度
418
+ * @description 拖动容器左右边框时实时校正侧栏宽度
419
+ * - 中间宽度已到最小宽度时缩小对应边的侧边栏
420
+ * @param {('left' | 'right')} direction
421
+ * @param {number} width
422
+ * @memberof ChatContainer
415
423
  */
416
- syncSidebarWidth: () => void;
424
+ syncSidebarWidth: (direction: "left" | "right", width: number) => void;
417
425
  /**
418
426
  * 拖动容器左右边框结束后提交侧栏宽度
419
427
  */
@@ -0,0 +1,18 @@
1
+ import { FileSystemController } from '../../controller';
2
+
3
+ interface ChatFilePreviewProps {
4
+ /**
5
+ * @description 文件路径
6
+ * @type {IFile}
7
+ * @memberof ChatFilePreviewProps
8
+ */
9
+ filePath?: string;
10
+ /**
11
+ * @description 系统文件控制器
12
+ * @type {FileSystemController}
13
+ * @memberof ChatFilePreviewProps
14
+ */
15
+ controller: FileSystemController;
16
+ }
17
+ export declare const ChatFilePreview: (props: ChatFilePreviewProps) => import("preact").JSX.Element;
18
+ export {};
@@ -0,0 +1,21 @@
1
+ import { AiTopicController } from '../../../../controller';
2
+
3
+ export interface SelectedModeTopicProps {
4
+ /**
5
+ * 话题控制器
6
+ *
7
+ * @author tony001
8
+ * @date 2025-02-20 17:02:49
9
+ * @type {AiTopicController}
10
+ */
11
+ controller: AiTopicController;
12
+ /**
13
+ * 进入多选模式时默认选中的话题id
14
+ */
15
+ defaultSelectedTopicId?: string;
16
+ /**
17
+ * 抽屉关闭回调(由 Drawer 自动注入)
18
+ */
19
+ onClose?: () => void;
20
+ }
21
+ export declare const SelectedModeTopic: (props: SelectedModeTopicProps) => import("preact").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { AiTopicController } from '../../../../controller';
2
+
3
+ export interface ShowHiddenSettingProps {
4
+ /**
5
+ * 话题控制器
6
+ *
7
+ * @author tony001
8
+ * @date 2025-02-20 17:02:49
9
+ * @type {AiTopicController}
10
+ */
11
+ controller: AiTopicController;
12
+ /**
13
+ * 抽屉关闭回调(由 Drawer 自动注入)
14
+ */
15
+ onClose?: () => void;
16
+ }
17
+ export declare const ShowHiddenSetting: (props: ShowHiddenSettingProps) => import("preact").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { AiTopicController } from '../../../../controller';
2
+
3
+ export interface TopicBatchActionProps {
4
+ /**
5
+ * 话题控制器
6
+ *
7
+ * @author tony001
8
+ * @date 2025-02-20 17:02:49
9
+ * @type {AiTopicController}
10
+ */
11
+ controller: AiTopicController;
12
+ /**
13
+ * 进入批量管理时默认选中的目录key
14
+ */
15
+ defaultSelectedScopeKey?: string;
16
+ /**
17
+ * 抽屉关闭回调(由 Drawer 自动注入)
18
+ */
19
+ onClose?: () => void;
20
+ }
21
+ export declare const TopicBatchAction: (props: TopicBatchActionProps) => import("preact").JSX.Element;
@@ -1,7 +1,7 @@
1
- import { AiChatController } from '../../controller';
1
+ import { FileSystemController } from '../../controller';
2
2
 
3
3
  interface ChatNetDiskProps {
4
- controller: AiChatController;
4
+ controller: FileSystemController;
5
5
  }
6
6
  export declare const ChatNetDisk: (props: ChatNetDiskProps) => import("preact").JSX.Element;
7
7
  export {};
@@ -1,12 +1,19 @@
1
1
 
2
2
  interface BreadcrumbProps {
3
3
  /**
4
- * 当前路径(根 -> 当前层)
4
+ * 当前路径(非根 -> 当前层)
5
5
  */
6
6
  path: {
7
7
  id: string;
8
8
  label: string;
9
9
  }[];
10
+ /**
11
+ * 根节点
12
+ */
13
+ root?: {
14
+ id: string;
15
+ label: string;
16
+ };
10
17
  /**
11
18
  * 点击某一层跳转,-1 表示回到根
12
19
  */
@@ -0,0 +1,28 @@
1
+ import { h } from 'preact';
2
+
3
+ interface DrawerProps {
4
+ /** 抽屉内容组件(函数组件 / 类组件) */
5
+ content: any;
6
+ /** 传递给内容组件的参数(onClose 会被自动注入) */
7
+ contentProps?: Record<string, any>;
8
+ /** 弹出方向 */
9
+ placement?: 'left' | 'right' | 'top' | 'bottom';
10
+ /** 宽(左右)/ 高(上下),number(px) 或 字符串(如 '50%') */
11
+ size?: number | string;
12
+ /** 指定容器(DOM 元素),不传则默认 body */
13
+ container?: HTMLElement;
14
+ /** 关闭回调(由 DrawerManager 注入) */
15
+ onClose?: () => void;
16
+ /** 是否显示遮罩,默认 true */
17
+ mask?: boolean;
18
+ /** 是否显示右上角关闭按钮,默认 true */
19
+ showClose?: boolean;
20
+ /** 点击遮罩是否关闭,默认 true */
21
+ maskClosable?: boolean;
22
+ /** 外部扩展类名 */
23
+ className?: string;
24
+ /** 标题 */
25
+ title?: string;
26
+ }
27
+ export declare const Drawer: (props: DrawerProps) => h.JSX.Element;
28
+ export {};
@@ -55,5 +55,15 @@ interface LazyListTreeProps {
55
55
  */
56
56
  draggable?: boolean;
57
57
  }
58
- export declare const LazyListTree: (props: LazyListTreeProps) => import("preact").JSX.Element;
58
+ export interface LazyListTreeRef {
59
+ /**
60
+ * 重载节点
61
+ * @param node
62
+ * @returns
63
+ */
64
+ overloadNode: (node: LazyTreeNode) => Promise<void>;
65
+ }
66
+ export declare const LazyListTree: import('preact').FunctionalComponent<import('preact/compat').PropsWithoutRef<LazyListTreeProps> & {
67
+ ref?: import('preact').Ref<LazyListTreeRef> | undefined;
68
+ }>;
59
69
  export {};
@@ -44,6 +44,12 @@ export interface LazyTreeNode {
44
44
  * 原始数据
45
45
  */
46
46
  data: Record<string, any>;
47
+ /**
48
+ * @description 根节点标识
49
+ * @type {string}
50
+ * @memberof LazyTreeNode
51
+ */
52
+ rootId: string;
47
53
  }
48
54
  interface LazyTreeProps {
49
55
  /**
@@ -65,6 +65,7 @@ export interface FlatChatContainerProps {
65
65
  interface FlatContainerContext {
66
66
  enableBackFill: boolean;
67
67
  }
68
+ export declare const DEFAULT_FLAT_CONTAINER_CONTEXT: FlatContainerContext;
68
69
  export declare const FlatContainerContext: import('preact').Context<FlatContainerContext>;
69
70
  /**
70
71
  * 平铺聊天容器,无拖拽/缩放/全屏/最小化,铺满外部容器
@@ -26,6 +26,10 @@ export declare enum AIChatConst {
26
26
  * 操作区面板默认宽度(px)
27
27
  */
28
28
  ACTION_PANEL_DEFAULT_WIDTH = 380,
29
+ /**
30
+ * 话题侧边栏默认宽度(px)
31
+ */
32
+ TOPIC_SIDEBAR_DEFAULT_WIDTH = 200,
29
33
  /**
30
34
  * 数据库名称
31
35
  */
@@ -38,6 +38,10 @@ export declare class AiActionPanelController {
38
38
  * 内容组件额外参数
39
39
  */
40
40
  readonly params: Signal<Record<string, any> | undefined>;
41
+ /**
42
+ * 当前业务域key(渲染内容组件时作为key传入,不同业务域切换时强制重挂载)
43
+ */
44
+ readonly key: Signal<string>;
41
45
  /**
42
46
  * 组件外层容器id(用于宽度缓存隔离)
43
47
  */
@@ -50,9 +54,22 @@ export declare class AiActionPanelController {
50
54
  * @param {string} caption 标题
51
55
  * @param {TActionPanelComponent} component 内容组件
52
56
  * @param {Record<string, any>} [params] 额外参数(作为内容组件props传入)
57
+ * @param {string} [key] 业务域key(内容组件渲染key,不同业务域切换时强制重挂载)
58
+ * @memberof AiActionPanelController
59
+ */
60
+ open(caption: string, component: TActionPanelComponent, params?: Record<string, any>, key?: string): void;
61
+ /**
62
+ * 刷新面板内容(会话切换时调用)
63
+ * - 面板未打开时不做处理(下次 open 会生成全新参数)
64
+ * - 新旧 key 一致时跳过刷新(同一业务域无需重挂载)
65
+ * - params 中包含 controller 时替换为激活会话的控制器
66
+ * - 重置 key 强制内容组件重挂载并重新加载数据
67
+ *
68
+ * @param {string} [key] 业务域key(未传时生成 uuid 强制刷新)
69
+ * @param {unknown} [controller] 激活会话的聊天控制器
53
70
  * @memberof AiActionPanelController
54
71
  */
55
- open(caption: string, component: TActionPanelComponent, params?: Record<string, any>): void;
72
+ refresh(key?: string, controller?: unknown): void;
56
73
  /**
57
74
  * 关闭操作区面板(收起动画由容器 CSS 过渡完成)
58
75
  *
@@ -1,9 +1,10 @@
1
1
  import { Signal } from '@preact/signals';
2
2
  import { QXEvent } from 'qx-util';
3
3
  import { AIAgent, ChatMessage, KnowledgeBase } from '../../entity';
4
- import { ITopic, IProject, IMaterial, IChatMessage, IChatOptions, IChatUIAction, IAIAgentConfig, IProjectParams, IChatSuggestion, IResourceOptions, IChatMessageUsage, ITopicOptions } from '../../interface';
4
+ import { ITopic, IMaterial, IChatMessage, IChatOptions, IChatUIAction, IAIAgentConfig, IChatSuggestion, IResourceOptions, IChatMessageUsage, ITopicOptions } from '../../interface';
5
5
  import { AiTopicController } from '../ai-topic/ai-topic.controller';
6
6
  import { AiActionPanelController } from '../ai-action-panel/ai-action-panel.controller';
7
+ import { FileSystemController } from '../file-system/file-system.controller';
7
8
 
8
9
  /**
9
10
  * 聊天逻辑控制器
@@ -232,6 +233,12 @@ export declare class AiChatController {
232
233
  * @memberof AiChatController
233
234
  */
234
235
  inited: Signal<boolean>;
236
+ /**
237
+ * @description 系统文件控制器
238
+ * @type {FileSystemController}
239
+ * @memberof AiChatController
240
+ */
241
+ fileSystem: FileSystemController;
235
242
  /**
236
243
  * @description 增强提问配置
237
244
  * @type {Signal<{ enable: boolean; message: string }>}
@@ -392,6 +399,18 @@ export declare class AiChatController {
392
399
  * @memberof AiChatController
393
400
  */
394
401
  attachMessageAgentID(data: IChatMessage): void;
402
+ /**
403
+ * @description 新增等待回复消息(与后续流式推送共用同一消息标识,首条内容到达时原地更新该消息)
404
+ * @param {string} messageid 消息标识
405
+ * @memberof AiChatController
406
+ */
407
+ addWaitingMessage(messageid: string): void;
408
+ /**
409
+ * @description 移除等待回复状态:未收到任何内容则删除占位消息(中断、超时、无推送场景);已有内容则仅清除等待标记
410
+ * @param {string} messageid 消息标识
411
+ * @memberof AiChatController
412
+ */
413
+ removeWaitingMessage(messageid: string): void;
395
414
  /**
396
415
  * @description 新增聊天记录
397
416
  * @param {IChatMessage} data
@@ -423,6 +442,13 @@ export declare class AiChatController {
423
442
  * @memberof AiChatController
424
443
  */
425
444
  updateMsgUsage(messageid: string, usage: IChatMessageUsage): void;
445
+ /**
446
+ * @description 基于消息ID更新消息的远程消息标识
447
+ * @param {string} messageid 本地消息ID
448
+ * @param {string} realmessageid 远程消息ID
449
+ * @memberof AiChatController
450
+ */
451
+ updateMsgRealMessageID(messageid: string, realmessageid: string): void;
426
452
  /**
427
453
  * 终止消息
428
454
  *
@@ -500,16 +526,23 @@ export declare class AiChatController {
500
526
  */
501
527
  backfill(message: IChatMessage): void;
502
528
  /**
503
- *
504
- * 删除指定消息,如果是用户提问的刷新调用的删除,则需要删除从问题开始到最后的所有记录
529
+ * @description 远程模式批量删除消息
530
+ * @param {IChatMessage[]} msgs 待删除的消息
531
+ * @return {*} {Promise<void>}
532
+ * @memberof AiChatController
533
+ */
534
+ private deleteRemoteMessages;
535
+ /**
536
+ * @description 删除消息
505
537
  * @param {IChatMessage} message
506
- * @param {boolean} [isuser=false]
538
+ * @return {*} {Promise<void>}
507
539
  * @memberof AiChatController
508
540
  */
509
541
  deleteMessage(message: IChatMessage): Promise<void>;
510
542
  /**
511
- * 刷新当前消息
512
- *
543
+ * @description 刷新当前消息
544
+ * @param {IChatMessage} message
545
+ * @param {boolean} [isuser=false] 是否是用户消息刷新
513
546
  * @memberof AiChatController
514
547
  */
515
548
  refreshMessage(message: IChatMessage, isuser?: boolean): Promise<void>;
@@ -634,13 +667,6 @@ export declare class AiChatController {
634
667
  * @returns
635
668
  */
636
669
  searchAIAgent(query: string): Promise<AIAgent[]>;
637
- /**
638
- * @description 搜索项目
639
- * @param {IProjectParams} params 查询参数
640
- * @returns {*} {Promise<IProject[]>}
641
- * @memberof AiChatController
642
- */
643
- searchProject(params: IProjectParams): Promise<IProject[]>;
644
670
  /**
645
671
  * @description 设置选中项目目录
646
672
  * @param {(string | undefined)} id
@@ -1,6 +1,6 @@
1
1
  import { Signal } from '@preact/signals';
2
2
  import { ChatTopic } from '../../entity';
3
- import { ITopic, ITopicOptions, IResourceOptions, IChatController, IGroupItem, IScopeItem, ITopicGroupNode } from '../../interface';
3
+ import { ITopic, ITopicOptions, IResourceOptions, IChatController, IGroupItem, IScopeOption, IScopeItem, ITopicGroupNode } from '../../interface';
4
4
  import { AiChatController } from '../ai-chat/ai-chat.controller';
5
5
 
6
6
  /**
@@ -113,16 +113,22 @@ export declare class AiTopicController {
113
113
  disableSelectScope: boolean;
114
114
  /**
115
115
  * @description 业务域列表(WORKSPACE 工作模式使用)
116
- * @type {IScopeItem[]}
116
+ * @type {IScopeOption[]}
117
117
  * @memberof AiTopicController
118
118
  */
119
- scopeList: IScopeItem[];
119
+ scopeList: IScopeOption[];
120
120
  /**
121
121
  * @description 用户自定义分组清单(WORKSPACE 工作模式使用)
122
122
  * @type {Signal<IGroupItem[]>}
123
123
  * @memberof AiTopicController
124
124
  */
125
125
  readonly groups: Signal<IGroupItem[]>;
126
+ /**
127
+ * @description 业务域界面数据清单(WORKSPACE 工作模式,存储于 'aiscopes')
128
+ * @type {Signal<IScopeItem[]>}
129
+ * @memberof AiTopicController
130
+ */
131
+ readonly scopes: Signal<IScopeItem[]>;
126
132
  /**
127
133
  * @description 分组存储服务实例('aigroups',与会话数据 'aitopics' 区分)
128
134
  * @private
@@ -130,6 +136,13 @@ export declare class AiTopicController {
130
136
  * @memberof AiTopicController
131
137
  */
132
138
  private groupConfig;
139
+ /**
140
+ * @description 业务域存储服务实例('aiscopes',与会话数据 'aitopics' 区分)
141
+ * @private
142
+ * @type {(IConfigService | undefined)}
143
+ * @memberof AiTopicController
144
+ */
145
+ private scopeConfig;
133
146
  /**
134
147
  * Creates an instance of AiTopicController.
135
148
  * @author tony001
@@ -156,10 +169,10 @@ export declare class AiTopicController {
156
169
  * @param {string} compWrapperId
157
170
  * @param {('DEFAULT' | 'WORKSPACE')} workMode
158
171
  * @param {boolean} [disableSelectScope]
159
- * @param {IScopeItem[]} [scopeList]
172
+ * @param {IScopeOption[]} [scopeList]
160
173
  * @memberof AiTopicController
161
174
  */
162
- injectBasicResources(compWrapperId: string, workMode: 'DEFAULT' | 'WORKSPACE', disableSelectScope?: boolean, scopeList?: IScopeItem[]): void;
175
+ injectBasicResources(compWrapperId: string, workMode: 'DEFAULT' | 'WORKSPACE', disableSelectScope?: boolean, scopeList?: IScopeOption[]): void;
163
176
  /**
164
177
  * 注入资源选项
165
178
  * @param resourceOptions
@@ -317,6 +330,12 @@ export declare class AiTopicController {
317
330
  * @memberof AiTopicController
318
331
  */
319
332
  updateTopicConfig(options: ITopicOptions): Promise<void>;
333
+ /**
334
+ * @description 获取侧边栏默认宽度
335
+ * @returns {*} {number}
336
+ * @memberof AiTopicController
337
+ */
338
+ getDefaultWidth(): number;
320
339
  /**
321
340
  * 计算话题侧边栏宽度
322
341
  */
@@ -431,6 +450,35 @@ export declare class AiTopicController {
431
450
  * @memberof AiTopicController
432
451
  */
433
452
  private saveGroups;
453
+ /**
454
+ * @description 获取业务域存储服务实例('aiscopes',与会话数据 'aitopics' 区分)
455
+ * @private
456
+ * @param {ITopicOptions} options 话题配置
457
+ * @returns {*} {IConfigService}
458
+ * @memberof AiTopicController
459
+ */
460
+ private getScopeConfig;
461
+ /**
462
+ * @description 加载业务域界面数据
463
+ * @param {ITopicOptions} options 话题配置
464
+ * @returns {*} {Promise<void>}
465
+ * @memberof AiTopicController
466
+ */
467
+ fetchScopes(options: ITopicOptions): Promise<void>;
468
+ /**
469
+ * @description 保存业务域界面数据
470
+ * @returns {*} {Promise<void>}
471
+ * @memberof AiTopicController
472
+ */
473
+ private saveScopes;
474
+ /**
475
+ * @description 获取业务域界面数据,无存储记录时返回默认值(显示、不置顶)
476
+ * @private
477
+ * @param {(string | number)} scopeid 业务域标识
478
+ * @returns {*} {IScopeItem}
479
+ * @memberof AiTopicController
480
+ */
481
+ private getScopeItemConfig;
434
482
  /**
435
483
  * @description 计算分组树(WORKSPACE 工作模式):业务域第一层,自定义分组第二层,其后为话题
436
484
  * @param {string} [query] 快速搜索关键词
@@ -468,6 +516,28 @@ export declare class AiTopicController {
468
516
  * @memberof AiTopicController
469
517
  */
470
518
  toggleGroupCollapse(groupid: string): Promise<void>;
519
+ /**
520
+ * @description 更新业务域界面数据(visible/istop)并持久化,scopeid不传表示无分类节点;
521
+ * 归一化后与默认值一致(visible为true且istop为false)时移除存储记录,默认值数据不落存储
522
+ * @param {(string | number)} [scopeid] 业务域标识
523
+ * @param {Partial<Pick<IScopeItem, 'visible' | 'istop'>>} partial 更新数据
524
+ * @returns {*} {Promise<IScopeItem | undefined>} 成功返回归一化后的数据,持久化失败返回undefined
525
+ * @memberof AiTopicController
526
+ */
527
+ updateScopeItem(scopeid: string | number | undefined, partial: Partial<Pick<IScopeItem, 'visible' | 'istop'>>): Promise<IScopeItem | undefined>;
528
+ /**
529
+ * @description 批量更新业务域界面数据(visible/istop),内部合并处理scopes数据,最终一次持久化;
530
+ * scopeid不传表示无分类节点,未传字段保留原值(缺省visible视为true、istop视为false),
531
+ * 归一化后与默认值一致(visible为true且istop为false)时移除存储记录,默认值数据不落存储
532
+ * @param {Array<{ scopeid: string | number | undefined; visible?: boolean; istop?: boolean }>} updates 更新数据集合
533
+ * @returns {*} {Promise<boolean>} 是否全部更新成功
534
+ * @memberof AiTopicController
535
+ */
536
+ batchUpdateScopeItems(updates: Array<{
537
+ scopeid: string | number | undefined;
538
+ visible?: boolean;
539
+ istop?: boolean;
540
+ }>): Promise<boolean>;
471
541
  /**
472
542
  * @description 删除业务域:真删该域下所有分组和会话数据;不传scopeid表示删除无分类域
473
543
  * @param {(string | number)} [scopeid] 业务域标识
@@ -475,6 +545,14 @@ export declare class AiTopicController {
475
545
  * @memberof AiTopicController
476
546
  */
477
547
  removeScope(scopeid?: string | number): Promise<boolean>;
548
+ /**
549
+ * @description 批量删除业务域:一次性归集所有待删域的会话数据,统一走一次 beforeDelete
550
+ * 确认后真删(含域下分组和会话),域界面数据与分组数据各持久化一次;不传scopeid表示无分类域
551
+ * @param {Array<string | number | undefined>} scopeids 业务域标识集合
552
+ * @returns {*} {Promise<boolean>} 是否删除成功(确认取消或持久化失败返回false)
553
+ * @memberof AiTopicController
554
+ */
555
+ batchRemoveScopes(scopeids: Array<string | number | undefined>): Promise<boolean>;
478
556
  /**
479
557
  * @description 删除用户自定义分组:真删该分组下所有会话数据
480
558
  * @param {string} groupid 分组标识