@ibiz-template-plugin/ai-chat 0.0.112 → 0.0.113
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.es.js +7633 -6053
- package/dist/index.legacy.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/chat-container/chat-container.d.ts +1 -1
- package/dist/types/components/chat-group-topics/chat-group-topics.d.ts +13 -0
- package/dist/types/components/chat-messages/use-virtual-list.d.ts +5 -0
- package/dist/types/components/chat-project/chat-project.d.ts +12 -0
- package/dist/types/components/common/lazy-tree/lazy-tree.d.ts +92 -0
- package/dist/types/constants/index.d.ts +16 -0
- package/dist/types/controller/ai-chat/ai-chat.controller.d.ts +16 -0
- package/dist/types/controller/ai-topic/ai-topic.controller.d.ts +196 -22
- package/dist/types/controller/chat/chat-base.controller.d.ts +10 -0
- package/dist/types/entity/chart-topic/chart-topic.d.ts +2 -0
- package/dist/types/icons/index.d.ts +3 -0
- package/dist/types/icons/plus-svg.d.ts +1 -0
- package/dist/types/icons/solid-down-svg.d.ts +1 -0
- package/dist/types/icons/untop-svg.d.ts +1 -0
- package/dist/types/interface/i-chat-options/i-chat-options.d.ts +19 -1
- package/dist/types/interface/i-project/i-project.d.ts +14 -0
- package/dist/types/interface/i-remote-resource/i-remote-resource.d.ts +6 -0
- package/dist/types/interface/i-resource-options/i-resource-options.d.ts +21 -0
- package/dist/types/interface/i-topic-options/i-topic-options.d.ts +112 -11
- package/dist/types/interface/index.d.ts +3 -1
- package/dist/types/locale/en/index.d.ts +19 -0
- package/dist/types/locale/zh-CN/index.d.ts +19 -0
- package/package.json +1 -1
|
@@ -197,6 +197,10 @@ export declare class AiChatController {
|
|
|
197
197
|
* 选中知识库
|
|
198
198
|
*/
|
|
199
199
|
selectionKnowledgeBases: Signal<string[]>;
|
|
200
|
+
/**
|
|
201
|
+
* 选中项目
|
|
202
|
+
*/
|
|
203
|
+
selectionProject: string | undefined;
|
|
200
204
|
/**
|
|
201
205
|
* 当前可选知识库
|
|
202
206
|
*/
|
|
@@ -608,6 +612,18 @@ export declare class AiChatController {
|
|
|
608
612
|
* @returns
|
|
609
613
|
*/
|
|
610
614
|
searchAIAgent(query: string): Promise<AIAgent[]>;
|
|
615
|
+
/**
|
|
616
|
+
* @description 搜索项目
|
|
617
|
+
* @param {string} [file_path='']
|
|
618
|
+
* @param {string} [pattern='']
|
|
619
|
+
* @returns {*} {Promise<{ id: string; label: string; isLeaf: boolean }[]>}
|
|
620
|
+
* @memberof AiChatController
|
|
621
|
+
*/
|
|
622
|
+
searchProject(file_path?: string, pattern?: string): Promise<{
|
|
623
|
+
id: string;
|
|
624
|
+
label: string;
|
|
625
|
+
isLeaf: boolean;
|
|
626
|
+
}[]>;
|
|
611
627
|
/**
|
|
612
628
|
* 设置选中知识库
|
|
613
629
|
* @param ids
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Signal } from '@preact/signals';
|
|
2
2
|
import { ChatTopic } from '../../entity';
|
|
3
|
-
import { ITopic, ITopicOptions, IResourceOptions, IChatController } from '../../interface';
|
|
3
|
+
import { ITopic, ITopicOptions, IResourceOptions, IChatController, IGroupItem, IScopeItem, ITopicGroupNode } from '../../interface';
|
|
4
|
+
import { AiChatController } from '../ai-chat/ai-chat.controller';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* ai话题控制器
|
|
@@ -98,6 +99,31 @@ export declare class AiTopicController {
|
|
|
98
99
|
* @memberof AiTopicController
|
|
99
100
|
*/
|
|
100
101
|
compWrapperId: string;
|
|
102
|
+
/**
|
|
103
|
+
* @description 工作模式,默认值,会话数据以列表显示; WORKSPACE:工作区,会话数据分为域(scope)、会话分组分层显示
|
|
104
|
+
* @type {('DEFAULT' | 'WORKSPACE')}
|
|
105
|
+
* @memberof AiTopicController
|
|
106
|
+
*/
|
|
107
|
+
workMode: 'DEFAULT' | 'WORKSPACE';
|
|
108
|
+
/**
|
|
109
|
+
* @description 业务域列表(WORKSPACE 工作模式使用)
|
|
110
|
+
* @type {IScopeItem[]}
|
|
111
|
+
* @memberof AiTopicController
|
|
112
|
+
*/
|
|
113
|
+
scopeList: IScopeItem[];
|
|
114
|
+
/**
|
|
115
|
+
* @description 用户自定义分组清单(WORKSPACE 工作模式使用)
|
|
116
|
+
* @type {Signal<IGroupItem[]>}
|
|
117
|
+
* @memberof AiTopicController
|
|
118
|
+
*/
|
|
119
|
+
readonly groups: Signal<IGroupItem[]>;
|
|
120
|
+
/**
|
|
121
|
+
* @description 分组存储服务实例('aigroups',与会话数据 'aitopics' 区分)
|
|
122
|
+
* @private
|
|
123
|
+
* @type {(IConfigService | undefined)}
|
|
124
|
+
* @memberof AiTopicController
|
|
125
|
+
*/
|
|
126
|
+
private groupConfig;
|
|
101
127
|
/**
|
|
102
128
|
* Creates an instance of AiTopicController.
|
|
103
129
|
* @author tony001
|
|
@@ -123,7 +149,7 @@ export declare class AiTopicController {
|
|
|
123
149
|
* 注入组件外层容器id
|
|
124
150
|
* @param compWrapperId
|
|
125
151
|
*/
|
|
126
|
-
|
|
152
|
+
injectBasicResources(compWrapperId: string, workMode: 'DEFAULT' | 'WORKSPACE', scopeList?: IScopeItem[]): void;
|
|
127
153
|
/**
|
|
128
154
|
* 注入资源选项
|
|
129
155
|
* @param resourceOptions
|
|
@@ -161,6 +187,23 @@ export declare class AiTopicController {
|
|
|
161
187
|
* @param topicid 话题标识
|
|
162
188
|
*/
|
|
163
189
|
updateTopicChatByID(topicid: string, args: Record<string, any>): Promise<void>;
|
|
190
|
+
/**
|
|
191
|
+
* @description 构建话题远程 ui_meta 数据
|
|
192
|
+
* @private
|
|
193
|
+
* @param {ChatTopic} topic 话题数据
|
|
194
|
+
* @param {Record<string, any>} [args] 需合并进aiChat的附加数据
|
|
195
|
+
* @returns {*} {Record<string, any>}
|
|
196
|
+
* @memberof AiTopicController
|
|
197
|
+
*/
|
|
198
|
+
private buildTopicUiMeta;
|
|
199
|
+
/**
|
|
200
|
+
* @description 更新话题远程会话的 ui_meta 数据(存在真实id直接更新;否则基于sessionid查询后更新)
|
|
201
|
+
* @private
|
|
202
|
+
* @param {ChatTopic} topic 话题数据
|
|
203
|
+
* @returns {*} {Promise<void>}
|
|
204
|
+
* @memberof AiTopicController
|
|
205
|
+
*/
|
|
206
|
+
private updateTopicRemoteMeta;
|
|
164
207
|
/**
|
|
165
208
|
* 删除话题
|
|
166
209
|
*
|
|
@@ -170,10 +213,10 @@ export declare class AiTopicController {
|
|
|
170
213
|
* @param {object} context
|
|
171
214
|
* @param {object} params
|
|
172
215
|
* @param {ITopic} data
|
|
173
|
-
* @param {MouseEvent}
|
|
216
|
+
* @param {MouseEvent} _event
|
|
174
217
|
* @return {*} {Promise<void>}
|
|
175
218
|
*/
|
|
176
|
-
removeTopic(options: ITopicOptions, context: object, params: object, data: ITopic,
|
|
219
|
+
removeTopic(options: ITopicOptions, context: object, params: object, data: ITopic, _event: MouseEvent): Promise<void>;
|
|
177
220
|
/**
|
|
178
221
|
* 删除远程会话数据
|
|
179
222
|
* 存在真实id,则删除远程session数据;不存在真实id,先基于sessionid查询,如果存在则删除,不存在视为删除成功
|
|
@@ -208,14 +251,18 @@ export declare class AiTopicController {
|
|
|
208
251
|
* @date 2025-03-18 18:03:49
|
|
209
252
|
* @return {*} {Promise<void>}
|
|
210
253
|
*/
|
|
211
|
-
newTopic(topicid: string, args: Record<string, any
|
|
254
|
+
newTopic(topicid: string, args: Record<string, any>, extra?: {
|
|
255
|
+
scope?: string | number;
|
|
256
|
+
groupid?: string;
|
|
257
|
+
}): Promise<void>;
|
|
212
258
|
/**
|
|
213
259
|
* 清空话题
|
|
214
260
|
* - 当前激活项不清空
|
|
261
|
+
* @param {boolean} [clearGroups=false] 是否同时清空自定义分组数据(WORKSPACE 工作模式)
|
|
215
262
|
* @return {*} {Promise<void>}
|
|
216
263
|
* @memberof AiTopicController
|
|
217
264
|
*/
|
|
218
|
-
clearTopic(): Promise<void>;
|
|
265
|
+
clearTopic(clearGroups?: boolean): Promise<void>;
|
|
219
266
|
/**
|
|
220
267
|
* 清空远程会话数据(排除指定会话)
|
|
221
268
|
* 激活会话存在会话标识时,清空其余会话;不存在时视为成功
|
|
@@ -246,21 +293,6 @@ export declare class AiTopicController {
|
|
|
246
293
|
* @return {*} {ChatTopic[]}
|
|
247
294
|
*/
|
|
248
295
|
private getSelectedTopics;
|
|
249
|
-
/**
|
|
250
|
-
* 批量置顶
|
|
251
|
-
* 将所有选中话题统一置为置顶状态并持久化,完成后退出多选模式
|
|
252
|
-
*
|
|
253
|
-
* @return {*} {Promise<void>}
|
|
254
|
-
*/
|
|
255
|
-
batchPinTop(): Promise<void>;
|
|
256
|
-
/**
|
|
257
|
-
* 批量删除
|
|
258
|
-
* 删除前统一走一次 beforeDelete 校验(isBatch=true),完成后退出多选模式
|
|
259
|
-
*
|
|
260
|
-
* @param {MouseEvent} [_event] 触发事件
|
|
261
|
-
* @return {*} {Promise<void>}
|
|
262
|
-
*/
|
|
263
|
-
batchDeleteTopics(_event?: MouseEvent): Promise<void>;
|
|
264
296
|
/**
|
|
265
297
|
* 更新话题标题
|
|
266
298
|
* @param topicId
|
|
@@ -300,9 +332,11 @@ export declare class AiTopicController {
|
|
|
300
332
|
switchTopicSidebarCollapse(): void;
|
|
301
333
|
/**
|
|
302
334
|
* 全局新建会话
|
|
335
|
+
* @param scope 业务域标识(WORKSPACE 工作模式)
|
|
336
|
+
* @param groupid 自定义分组标识(WORKSPACE 工作模式)
|
|
303
337
|
* @returns
|
|
304
338
|
*/
|
|
305
|
-
globalNewTopic(): void;
|
|
339
|
+
globalNewTopic(scope?: string | number, groupid?: string): void;
|
|
306
340
|
/**
|
|
307
341
|
* 进入临时会话
|
|
308
342
|
*/
|
|
@@ -321,4 +355,144 @@ export declare class AiTopicController {
|
|
|
321
355
|
* @memberof AiTopicController
|
|
322
356
|
*/
|
|
323
357
|
private handleAction;
|
|
358
|
+
/**
|
|
359
|
+
* @description 批量收集话题真实id,话题存在真实id直接使用;否则基于sessionid查询,查不到则忽略该话题
|
|
360
|
+
* @private
|
|
361
|
+
* @param {ChatTopic[]} topics 话题列表
|
|
362
|
+
* @returns {*} {Promise<string[]>} 真实id列表
|
|
363
|
+
* @memberof AiTopicController
|
|
364
|
+
*/
|
|
365
|
+
private resolveTopicRealIds;
|
|
366
|
+
/**
|
|
367
|
+
* @description 批量删除会话
|
|
368
|
+
* @private
|
|
369
|
+
* @param {ChatTopic[]} selectedTopics
|
|
370
|
+
* @returns {*} {Promise<boolean>}
|
|
371
|
+
* @memberof AiTopicController
|
|
372
|
+
*/
|
|
373
|
+
private batchDeleteRemoteSession;
|
|
374
|
+
/**
|
|
375
|
+
* @description 批量置顶,将所有选中话题统一置为置顶状态并持久化,完成后退出多选模式
|
|
376
|
+
* @returns {*} {Promise<void>}
|
|
377
|
+
* @memberof AiTopicController
|
|
378
|
+
*/
|
|
379
|
+
batchPinTop(): Promise<void>;
|
|
380
|
+
/**
|
|
381
|
+
* @description 批量取消置顶,将所有选中话题统一置为未置顶状态并持久化,完成后退出多选模式
|
|
382
|
+
* @returns {*} {Promise<void>}
|
|
383
|
+
* @memberof AiTopicController
|
|
384
|
+
*/
|
|
385
|
+
batchUnPinTop(): Promise<void>;
|
|
386
|
+
/**
|
|
387
|
+
* @description 批量删除,删除前统一走一次 beforeDelete 校验,完成后退出多选模式
|
|
388
|
+
* @param {MouseEvent} [_event]
|
|
389
|
+
* @returns {*} {Promise<void>}
|
|
390
|
+
* @memberof AiTopicController
|
|
391
|
+
*/
|
|
392
|
+
batchDeleteTopics(_event?: MouseEvent): Promise<void>;
|
|
393
|
+
/**
|
|
394
|
+
* @description 批量删除话题内核:删除前统一走一次 beforeDelete 校验,真删存储数据并同步界面
|
|
395
|
+
* @private
|
|
396
|
+
* @param {ChatTopic[]} targetTopics 待删除话题
|
|
397
|
+
* @param {string} [confirmTitle] 删除确认标题,默认为批量删除文案
|
|
398
|
+
* @param {string} [confirmDescription] 删除确认描述,默认为批量删除文案
|
|
399
|
+
* @returns {*} {Promise<boolean>} 是否删除成功
|
|
400
|
+
* @memberof AiTopicController
|
|
401
|
+
*/
|
|
402
|
+
private deleteTopicsCore;
|
|
403
|
+
/**
|
|
404
|
+
* @description 获取分组存储服务实例('aigroups',与会话数据 'aitopics' 区分)
|
|
405
|
+
* @private
|
|
406
|
+
* @param {ITopicOptions} options 话题配置
|
|
407
|
+
* @returns {*} {IConfigService}
|
|
408
|
+
* @memberof AiTopicController
|
|
409
|
+
*/
|
|
410
|
+
private getGroupConfig;
|
|
411
|
+
/**
|
|
412
|
+
* @description 加载用户自定义分组数据
|
|
413
|
+
* @param {ITopicOptions} options 话题配置
|
|
414
|
+
* @returns {*} {Promise<void>}
|
|
415
|
+
* @memberof AiTopicController
|
|
416
|
+
*/
|
|
417
|
+
fetchGroups(options: ITopicOptions): Promise<void>;
|
|
418
|
+
/**
|
|
419
|
+
* @description 保存用户自定义分组数据
|
|
420
|
+
* @returns {*} {Promise<void>}
|
|
421
|
+
* @memberof AiTopicController
|
|
422
|
+
*/
|
|
423
|
+
private saveGroups;
|
|
424
|
+
/**
|
|
425
|
+
* @description 计算分组树(WORKSPACE 工作模式):业务域第一层,自定义分组第二层,其后为话题
|
|
426
|
+
* @param {string} [query] 快速搜索关键词
|
|
427
|
+
* @returns {*} {ITopicGroupNode[]}
|
|
428
|
+
* @memberof AiTopicController
|
|
429
|
+
*/
|
|
430
|
+
computeGroupTree(query?: string): ITopicGroupNode[];
|
|
431
|
+
/**
|
|
432
|
+
* @description 判断话题是否属于无分类(无scope、scope为空或scope不在scopeList中)
|
|
433
|
+
* @private
|
|
434
|
+
* @param {ChatTopic} topic 话题数据
|
|
435
|
+
* @returns {*} {boolean}
|
|
436
|
+
* @memberof AiTopicController
|
|
437
|
+
*/
|
|
438
|
+
private isUnclassifiedTopic;
|
|
439
|
+
/**
|
|
440
|
+
* @description 新增用户自定义分组
|
|
441
|
+
* @param {(string | number)} [scopeid] 所属业务域标识,不传表示无分类域(存储为NONE_SCOPE_ID标记)
|
|
442
|
+
* @returns {*} {Promise<IGroupItem | undefined>} 成功返回新建分组数据,持久化失败返回undefined
|
|
443
|
+
* @memberof AiTopicController
|
|
444
|
+
*/
|
|
445
|
+
addGroup(scopeid?: string | number): Promise<IGroupItem | undefined>;
|
|
446
|
+
/**
|
|
447
|
+
* @description 重命名用户自定义分组
|
|
448
|
+
* @param {string} groupid 分组标识
|
|
449
|
+
* @param {string} text 新分组名称
|
|
450
|
+
* @returns {*} {Promise<IGroupItem | undefined>} 成功返回更新后的分组数据,分组不存在、名称为空、未变化或持久化失败返回undefined
|
|
451
|
+
* @memberof AiTopicController
|
|
452
|
+
*/
|
|
453
|
+
renameGroup(groupid: string, text: string): Promise<IGroupItem | undefined>;
|
|
454
|
+
/**
|
|
455
|
+
* @description 切换用户自定义分组折叠状态(持久化)
|
|
456
|
+
* @param {string} groupid 分组标识
|
|
457
|
+
* @returns {*} {Promise<void>}
|
|
458
|
+
* @memberof AiTopicController
|
|
459
|
+
*/
|
|
460
|
+
toggleGroupCollapse(groupid: string): Promise<void>;
|
|
461
|
+
/**
|
|
462
|
+
* @description 删除业务域:真删该域下所有分组和会话数据;不传scopeid表示删除无分类域
|
|
463
|
+
* @param {(string | number)} [scopeid] 业务域标识
|
|
464
|
+
* @returns {*} {Promise<boolean>} 是否删除成功
|
|
465
|
+
* @memberof AiTopicController
|
|
466
|
+
*/
|
|
467
|
+
removeScope(scopeid?: string | number): Promise<boolean>;
|
|
468
|
+
/**
|
|
469
|
+
* @description 删除用户自定义分组:真删该分组下所有会话数据
|
|
470
|
+
* @param {string} groupid 分组标识
|
|
471
|
+
* @returns {*} {Promise<boolean>} 是否删除成功
|
|
472
|
+
* @memberof AiTopicController
|
|
473
|
+
*/
|
|
474
|
+
removeGroup(groupid: string): Promise<boolean>;
|
|
475
|
+
/**
|
|
476
|
+
* @description 移动话题至指定业务域或自定义分组(拖拽),并持久化
|
|
477
|
+
* @param {string} topicid 话题标识
|
|
478
|
+
* @param {(string | number)} [scope] 目标业务域标识,无分类节点传 undefined 清除归属
|
|
479
|
+
* @param {string} [groupid] 目标自定义分组标识
|
|
480
|
+
* @returns {*} {Promise<boolean>} 是否移动成功(归属未变化视为成功)
|
|
481
|
+
* @memberof AiTopicController
|
|
482
|
+
*/
|
|
483
|
+
moveTopic(topicid: string, scope?: string | number, groupid?: string): Promise<boolean>;
|
|
484
|
+
/**
|
|
485
|
+
* @description 基于归一化字符串还原scopeList中的原始scope标识(dataset取值为字符串)
|
|
486
|
+
* @private
|
|
487
|
+
* @param {(string | number)} scopeid 归一化后的业务域标识
|
|
488
|
+
* @returns {*} {(string | number)}
|
|
489
|
+
* @memberof AiTopicController
|
|
490
|
+
*/
|
|
491
|
+
private getOriginScopeId;
|
|
492
|
+
/**
|
|
493
|
+
* @description 获取聊天控制器
|
|
494
|
+
* @returns {*} {(AiChatController | undefined)}
|
|
495
|
+
* @memberof AiTopicController
|
|
496
|
+
*/
|
|
497
|
+
getAiChat(): AiChatController | undefined;
|
|
324
498
|
}
|
|
@@ -157,4 +157,14 @@ export declare abstract class ChatBaseController implements IChatController {
|
|
|
157
157
|
* @memberof ChatBaseController
|
|
158
158
|
*/
|
|
159
159
|
close(): void;
|
|
160
|
+
/**
|
|
161
|
+
* @description 组件失活事件
|
|
162
|
+
* @memberof ChatBaseController
|
|
163
|
+
*/
|
|
164
|
+
onDeactivated(): void;
|
|
165
|
+
/**
|
|
166
|
+
* @description 组件激活事件
|
|
167
|
+
* @memberof ChatBaseController
|
|
168
|
+
*/
|
|
169
|
+
onActivated(): void;
|
|
160
170
|
}
|
|
@@ -51,3 +51,6 @@ export { InputTokensSvg } from './statistics/input-tokens-svg';
|
|
|
51
51
|
export { OutputTokensSvg } from './statistics/output-tokens-svg';
|
|
52
52
|
export { ToolCallCountSvg } from './statistics/tool-call-count-svg';
|
|
53
53
|
export { ListCheckBoxSvg } from './list-checkbox-svg';
|
|
54
|
+
export { UnTopSvg } from './untop-svg';
|
|
55
|
+
export { PlusSvg } from './plus-svg';
|
|
56
|
+
export { SolidDownSvg } from './solid-down-svg';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PlusSvg: () => import("preact").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SolidDownSvg: () => import("preact").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const UnTopSvg: () => import("preact").JSX.Element;
|
|
@@ -8,6 +8,7 @@ import { IKnowledgeBase } from '../i-knowledge-base/i-knowledge-base';
|
|
|
8
8
|
import { ISpeechRecognition } from '../i-speech-recognition/i-speech-recognition';
|
|
9
9
|
import { Locale } from '../../locale';
|
|
10
10
|
import { IConfirmUtil, IMessageUtil, INotificationUtil } from '../util';
|
|
11
|
+
import { IProject } from '../i-project/i-project';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* 聊天数据
|
|
@@ -222,6 +223,12 @@ export interface IChatOptions extends IChat {
|
|
|
222
223
|
* @type {boolean}
|
|
223
224
|
*/
|
|
224
225
|
enableKnowledgeBaseSelect: boolean;
|
|
226
|
+
/**
|
|
227
|
+
* @description 是否启用AI项目功能
|
|
228
|
+
* @type {boolean}
|
|
229
|
+
* @memberof IChatOptions
|
|
230
|
+
*/
|
|
231
|
+
enableAIProject: boolean;
|
|
225
232
|
/**
|
|
226
233
|
* 话题标题计算模式
|
|
227
234
|
*
|
|
@@ -307,7 +314,7 @@ export interface IChatOptions extends IChat {
|
|
|
307
314
|
* @param {IChatMessage[]} question 提问历史内容(包含当前提问)
|
|
308
315
|
* @return {*} {Promise<boolean>} 等待回答,用于显示 loading 并获取最终成功与否
|
|
309
316
|
*/
|
|
310
|
-
question(aiChat: AiChatController, context: object, params: object, otherParams: object, question: IChatMessage[], sessionid: string, srfaiagent: string | undefined, srfmode: string | undefined, srfscope: string | undefined, srfaiknowledgebases: string | undefined, srfaiagentconfig: IAIAgentConfig | undefined, appendcurdata: object | undefined, srfmcpservers: string | undefined, srfsessionmeta: object | undefined): Promise<boolean>;
|
|
317
|
+
question(aiChat: AiChatController, context: object, params: object, otherParams: object, question: IChatMessage[], sessionid: string, srfaiagent: string | undefined, srfmode: string | undefined, srfscope: string | undefined, srfaiknowledgebases: string | undefined, srfaiagentconfig: IAIAgentConfig | undefined, appendcurdata: object | undefined, srfmcpservers: string | undefined, srfsessionmeta: object | undefined, srfproject: string | undefined): Promise<boolean>;
|
|
311
318
|
/**
|
|
312
319
|
* 中断消息
|
|
313
320
|
* @param aiChat
|
|
@@ -387,6 +394,17 @@ export interface IChatOptions extends IChat {
|
|
|
387
394
|
query?: string;
|
|
388
395
|
knowledgebases?: string;
|
|
389
396
|
}) => Promise<IKnowledgeBase[]>;
|
|
397
|
+
/**
|
|
398
|
+
* @description 查询项目
|
|
399
|
+
* @memberof IChatOptions
|
|
400
|
+
*/
|
|
401
|
+
fetchProject?: (context: object, params: object, other: {
|
|
402
|
+
srfaiagent: string;
|
|
403
|
+
sessionid: string;
|
|
404
|
+
pattern: string;
|
|
405
|
+
file_path: string;
|
|
406
|
+
max_depth: number;
|
|
407
|
+
}) => Promise<IProject[]>;
|
|
390
408
|
/**
|
|
391
409
|
* 文件上传配置
|
|
392
410
|
*
|
|
@@ -56,6 +56,27 @@ export interface IResourceOptions {
|
|
|
56
56
|
* @param excludeSessionID 排除会话的会话id
|
|
57
57
|
*/
|
|
58
58
|
clearAllSession(excludeSessionID: string): Promise<boolean>;
|
|
59
|
+
/**
|
|
60
|
+
* @description 批量删除会话
|
|
61
|
+
* @param {string[]} realIDs 会话真实id集合
|
|
62
|
+
* @returns {*} {Promise<boolean>}
|
|
63
|
+
* @memberof IResourceOptions
|
|
64
|
+
*/
|
|
65
|
+
batchDeleteSession(realIDs: string[]): Promise<boolean>;
|
|
66
|
+
/**
|
|
67
|
+
* @description 批量置顶会话
|
|
68
|
+
* @param {string[]} realIDs 会话真实id集合
|
|
69
|
+
* @returns {*} {Promise<boolean>}
|
|
70
|
+
* @memberof IResourceOptions
|
|
71
|
+
*/
|
|
72
|
+
batchTopSession(realIDs: string[]): Promise<boolean>;
|
|
73
|
+
/**
|
|
74
|
+
* @description 批量取消置顶会话
|
|
75
|
+
* @param {string[]} realIDs 会话真实id集合
|
|
76
|
+
* @returns {*} {Promise<boolean>}
|
|
77
|
+
* @memberof IResourceOptions
|
|
78
|
+
*/
|
|
79
|
+
batchUnTopSession(realIDs: string[]): Promise<boolean>;
|
|
59
80
|
/**
|
|
60
81
|
* 清空指定会话的所有消息
|
|
61
82
|
* @param realID
|
|
@@ -1,6 +1,90 @@
|
|
|
1
1
|
import { IChat } from '../i-chat-options/i-chat-options';
|
|
2
2
|
import { IConfigService } from '../i-config-service/i-config-service';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @description 业务域数据
|
|
6
|
+
* @export
|
|
7
|
+
* @interface IScopeItem
|
|
8
|
+
*/
|
|
9
|
+
export interface IScopeItem {
|
|
10
|
+
/**
|
|
11
|
+
* @description 值
|
|
12
|
+
* @type {(string | number)}
|
|
13
|
+
* @memberof IScopeItem
|
|
14
|
+
*/
|
|
15
|
+
id: string | number;
|
|
16
|
+
/**
|
|
17
|
+
* @description 文本
|
|
18
|
+
* @type {string}
|
|
19
|
+
* @memberof IScopeItem
|
|
20
|
+
*/
|
|
21
|
+
text: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 会话分组数据
|
|
25
|
+
*
|
|
26
|
+
* @export
|
|
27
|
+
* @interface IGroup
|
|
28
|
+
*/
|
|
29
|
+
export interface IGroupItem {
|
|
30
|
+
/**
|
|
31
|
+
* @description 值
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof IGroupItem
|
|
34
|
+
*/
|
|
35
|
+
id: string;
|
|
36
|
+
/**
|
|
37
|
+
* @description 文本
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof IGroupItem
|
|
40
|
+
*/
|
|
41
|
+
text: string;
|
|
42
|
+
/**
|
|
43
|
+
* @description 业务域标识
|
|
44
|
+
* @type {(string | number)}
|
|
45
|
+
* @memberof IGroupItem
|
|
46
|
+
*/
|
|
47
|
+
scopeid: string | number;
|
|
48
|
+
/**
|
|
49
|
+
* @description 是否折叠,缺省展开
|
|
50
|
+
* @type {boolean}
|
|
51
|
+
* @memberof IGroupItem
|
|
52
|
+
*/
|
|
53
|
+
collapsed?: boolean;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* 分组树节点(WORKSPACE 工作模式)
|
|
57
|
+
*
|
|
58
|
+
* @export
|
|
59
|
+
* @interface ITopicGroupNode
|
|
60
|
+
*/
|
|
61
|
+
export interface ITopicGroupNode {
|
|
62
|
+
/**
|
|
63
|
+
* 节点标识,'scope:<id>',无分类为 'scope:__NONE__'
|
|
64
|
+
*/
|
|
65
|
+
key: string;
|
|
66
|
+
/**
|
|
67
|
+
* 业务域标识,无分类虚拟节点为 undefined
|
|
68
|
+
*/
|
|
69
|
+
scopeid: string | number | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* 显示文本
|
|
72
|
+
*/
|
|
73
|
+
text: string;
|
|
74
|
+
/**
|
|
75
|
+
* 自定义分组子节点
|
|
76
|
+
*/
|
|
77
|
+
groups: Array<{
|
|
78
|
+
id: string;
|
|
79
|
+
text: string;
|
|
80
|
+
collapsed?: boolean;
|
|
81
|
+
topics: ITopic[];
|
|
82
|
+
}>;
|
|
83
|
+
/**
|
|
84
|
+
* 未归入自定义分组的话题
|
|
85
|
+
*/
|
|
86
|
+
ungroupedTopics: ITopic[];
|
|
87
|
+
}
|
|
4
88
|
/**
|
|
5
89
|
* 话题数据
|
|
6
90
|
*
|
|
@@ -93,6 +177,18 @@ export interface ITopic {
|
|
|
93
177
|
* 是否忽略显示,默认显示
|
|
94
178
|
*/
|
|
95
179
|
isShow?: boolean;
|
|
180
|
+
/**
|
|
181
|
+
* @description 所属业务域标识
|
|
182
|
+
* @type {(string | number)}
|
|
183
|
+
* @memberof ITopic
|
|
184
|
+
*/
|
|
185
|
+
scope?: string | number;
|
|
186
|
+
/**
|
|
187
|
+
* @description 所属自定义分组标识
|
|
188
|
+
* @type {string}
|
|
189
|
+
* @memberof ITopic
|
|
190
|
+
*/
|
|
191
|
+
groupid?: string;
|
|
96
192
|
/**
|
|
97
193
|
* 上下文
|
|
98
194
|
*
|
|
@@ -128,18 +224,23 @@ export interface ITopicOptions extends ITopic {
|
|
|
128
224
|
*/
|
|
129
225
|
storageMode: 'DEFAULT' | 'REMOTESESSION';
|
|
130
226
|
/**
|
|
131
|
-
*
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
* @
|
|
136
|
-
* @
|
|
137
|
-
* @
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
227
|
+
* 工作模式,默认值,会话数据以列表显示; WORKSPACE:工作区,会话数据分为域(scope)、会话分组分层显示
|
|
228
|
+
*/
|
|
229
|
+
workMode?: 'DEFAULT' | 'WORKSPACE';
|
|
230
|
+
/**
|
|
231
|
+
* @description 域列表,当工作模式为WORKSPACE时必填
|
|
232
|
+
* @type {IScopeItem[]}
|
|
233
|
+
* @memberof ITopicOptions
|
|
234
|
+
*/
|
|
235
|
+
scopeList?: IScopeItem[];
|
|
236
|
+
/**
|
|
237
|
+
* @description 删除之前提示
|
|
238
|
+
* @param {string} title
|
|
239
|
+
* @param {string} description
|
|
240
|
+
* @returns {*} {Promise<boolean>}
|
|
241
|
+
* @memberof ITopicOptions
|
|
141
242
|
*/
|
|
142
|
-
beforeDelete?(
|
|
243
|
+
beforeDelete?(title: string, description: string): Promise<boolean>;
|
|
143
244
|
/**
|
|
144
245
|
* @description 话题行为
|
|
145
246
|
* @param {string} action
|
|
@@ -3,7 +3,7 @@ export type { IChat, IChatOptions } from './i-chat-options/i-chat-options';
|
|
|
3
3
|
export type { IMessageItemProvider } from './i-message-item-provider/i-message-item-provider';
|
|
4
4
|
export type { IPortalAsyncAction } from './i-portal-async-action/i-portal-async-action';
|
|
5
5
|
export type { IChatToolbarItem } from './i-chat-toolbar-item/i-chat-toolbar-item';
|
|
6
|
-
export type { ITopic, ITopicOptions } from './i-topic-options/i-topic-options';
|
|
6
|
+
export type { ITopic, ITopicOptions, IScopeItem, IGroupItem, ITopicGroupNode, } from './i-topic-options/i-topic-options';
|
|
7
7
|
export type { IContainerOptions } from './i-container-options/i-container-options';
|
|
8
8
|
export type { IChatThink } from './i-chat-think/i-chat-think';
|
|
9
9
|
export type { IMaterial } from './i-material/i-material';
|
|
@@ -13,6 +13,7 @@ export type { IChatSuggestion } from './i-chat-suggestion/i-chat-suggestion';
|
|
|
13
13
|
export type { IChatToolCall } from './i-chat-tool-call/i-chat-tool-call';
|
|
14
14
|
export type { IAIAgent, IAIAgentConfig, IAIKnowledgeBase, } from './i-ai-agent/i-ai-agent';
|
|
15
15
|
export type { IResourceOptions } from './i-resource-options/i-resource-options';
|
|
16
|
+
export type { IConfigService } from './i-config-service/i-config-service';
|
|
16
17
|
export type { IRemoteSession, IRemoteMessage, } from './i-remote-resource/i-remote-resource';
|
|
17
18
|
export type { IChatStep } from './i-chat-step/i-chat-step';
|
|
18
19
|
export type { IChatUIAction } from './i-chat-uiaction/i-chat-uiaction';
|
|
@@ -23,4 +24,5 @@ export type { IChatController } from './i-chat-controller/i-chat-controller';
|
|
|
23
24
|
export type { IAIQuesitionItem, IAIQuesition, IAIQuesitionAnswer, } from './i-ai-quesition/i-ai-quesition';
|
|
24
25
|
export type { IExtensionOptions } from './i-extension-options/i-extension-options';
|
|
25
26
|
export type { ISpeechRecognition } from './i-speech-recognition/i-speech-recognition';
|
|
27
|
+
export type { IProject } from './i-project/i-project';
|
|
26
28
|
export * from './deep-research';
|
|
@@ -84,9 +84,27 @@ export declare const EN: {
|
|
|
84
84
|
searchTopics: string;
|
|
85
85
|
noTopic: string;
|
|
86
86
|
clearSession: string;
|
|
87
|
+
clearSessionConfirmTip: string;
|
|
88
|
+
clearSessionWithGroupConfirmTip: string;
|
|
89
|
+
deleteConversation: string;
|
|
90
|
+
deleteConversationConfirmTip: string;
|
|
91
|
+
batchDeleteConversation: string;
|
|
92
|
+
batchDeleteSession: string;
|
|
93
|
+
batchDeleteConversationConfirmTip: string;
|
|
87
94
|
multiSelect: string;
|
|
88
95
|
selectedCount: string;
|
|
89
96
|
cancelMultiSelect: string;
|
|
97
|
+
unclassifiedTopic: string;
|
|
98
|
+
newGroup: string;
|
|
99
|
+
deleteGroup: string;
|
|
100
|
+
deleteGroupConfirmTip: string;
|
|
101
|
+
deleteScope: string;
|
|
102
|
+
deleteScopeConfirmTip: string;
|
|
103
|
+
selectScope: string;
|
|
104
|
+
selectScopePlaceholder: string;
|
|
105
|
+
selectScopeTip: string;
|
|
106
|
+
searchScopePlaceholder: string;
|
|
107
|
+
confirm: string;
|
|
90
108
|
temporarySession: string;
|
|
91
109
|
like: string;
|
|
92
110
|
downvote: string;
|
|
@@ -132,4 +150,5 @@ export declare const EN: {
|
|
|
132
150
|
deepResearchReport: string;
|
|
133
151
|
noTextReportContent: string;
|
|
134
152
|
chatInputPlaceholder: string;
|
|
153
|
+
projectPlaceholder: string;
|
|
135
154
|
};
|