@ibiz-template-plugin/ai-chat 0.0.124 → 0.0.126
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 +21227 -20644
- package/dist/index.legacy.js +2 -2
- package/dist/style.css +2 -2
- package/dist/types/components/chat-file-preview/chat-file-preview.d.ts +26 -3
- package/dist/types/components/chat-message-item/chat-message-item.d.ts +5 -1
- package/dist/types/components/chat-message-item/error-message/error-message.d.ts +4 -0
- package/dist/types/components/chat-message-item/markdown-message/markdown-message.d.ts +4 -0
- package/dist/types/components/chat-message-item/user-message/user-message.d.ts +4 -0
- package/dist/types/components/chat-messages/chat-messages.d.ts +4 -0
- package/dist/types/components/chat-net-disk/chat-net-disk.d.ts +4 -0
- package/dist/types/components/chat-output-files/chat-output-files.d.ts +17 -0
- package/dist/types/components/chat-output-files/deliverable-role-files/deliverable-role-files.d.ts +18 -0
- package/dist/types/components/chat-output-files/evidence-role-files/evidence-role-files.d.ts +18 -0
- package/dist/types/components/chat-output-files/util.d.ts +29 -0
- package/dist/types/components/common/actions/actions.d.ts +4 -2
- package/dist/types/components/common/context-menu/context-menu.d.ts +0 -1
- package/dist/types/components/common/lazy-level-list/lazy-level-list.d.ts +4 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/popup/popup.d.ts +13 -9
- package/dist/types/components/readonly-chat-container/readonly-chat-container.d.ts +29 -0
- package/dist/types/controller/ai-action-panel/ai-action-panel.controller.d.ts +1 -1
- package/dist/types/controller/ai-chat/ai-chat.controller.d.ts +13 -1
- package/dist/types/controller/chat/readonly-chat.controller.d.ts +64 -0
- package/dist/types/controller/file-system/file-system.controller.d.ts +20 -4
- package/dist/types/controller/index.d.ts +1 -0
- package/dist/types/entity/chat-message/chat-message.d.ts +2 -1
- package/dist/types/hook/fullscreen.d.ts +8 -0
- package/dist/types/hook/index.d.ts +1 -0
- package/dist/types/icons/download.d.ts +1 -0
- package/dist/types/icons/index.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/interface/i-chat-message/i-chat-message.d.ts +7 -0
- package/dist/types/interface/i-chat-output-file/i-chat-output-file.d.ts +55 -0
- package/dist/types/interface/i-chat-toolbar-item/i-chat-toolbar-item.d.ts +1 -1
- package/dist/types/interface/i-file-item/i-file-item.d.ts +17 -2
- package/dist/types/interface/i-file-system-options/i-file-system-options.d.ts +7 -7
- package/dist/types/interface/i-remote-resource/i-remote-resource.d.ts +4 -0
- package/dist/types/interface/index.d.ts +3 -2
- package/dist/types/locale/en/index.d.ts +6 -0
- package/dist/types/locale/zh-CN/index.d.ts +6 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/markdown-preview.d.ts +47 -0
- package/package.json +2 -2
|
@@ -1,18 +1,41 @@
|
|
|
1
1
|
import { FileSystemController } from '../../controller';
|
|
2
|
+
import { IFile } from '../../interface';
|
|
2
3
|
|
|
3
4
|
interface ChatFilePreviewProps {
|
|
4
5
|
/**
|
|
5
|
-
* @description
|
|
6
|
-
* @type {
|
|
6
|
+
* @description 传入资源类型,工作空间 | oss | skill
|
|
7
|
+
* @type {('workspace' | 'oss' | 'skill')}
|
|
7
8
|
* @memberof ChatFilePreviewProps
|
|
8
9
|
*/
|
|
9
|
-
|
|
10
|
+
type: 'WORKSPACE' | 'OSS' | 'SKILL';
|
|
10
11
|
/**
|
|
11
12
|
* @description 系统文件控制器
|
|
12
13
|
* @type {FileSystemController}
|
|
13
14
|
* @memberof ChatFilePreviewProps
|
|
14
15
|
*/
|
|
15
16
|
controller: FileSystemController;
|
|
17
|
+
/**
|
|
18
|
+
* @description skill文件信息,skill 类型文件预览必传
|
|
19
|
+
* @type {{ name: string; skill_id: string; filePath: string }}
|
|
20
|
+
* @memberof ChatFilePreviewProps
|
|
21
|
+
*/
|
|
22
|
+
skillFile?: {
|
|
23
|
+
name: string;
|
|
24
|
+
skill_id: string;
|
|
25
|
+
filePath: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* @description 文件路径,workspace类型必传
|
|
29
|
+
* @type {IFile}
|
|
30
|
+
* @memberof ChatFilePreviewProps
|
|
31
|
+
*/
|
|
32
|
+
filePath?: string;
|
|
33
|
+
/**
|
|
34
|
+
* @description 文件对象,oss类型必传
|
|
35
|
+
* @type {IFile}
|
|
36
|
+
* @memberof ChatFilePreviewProps
|
|
37
|
+
*/
|
|
38
|
+
ossFile?: IFile;
|
|
16
39
|
}
|
|
17
40
|
export declare const ChatFilePreview: (props: ChatFilePreviewProps) => import("preact").JSX.Element;
|
|
18
41
|
export {};
|
|
@@ -26,6 +26,10 @@ export interface ChatMessageItemProps {
|
|
|
26
26
|
* @type {VNode}
|
|
27
27
|
* @memberof ChatMessageItemProps
|
|
28
28
|
*/
|
|
29
|
-
children
|
|
29
|
+
children?: VNode;
|
|
30
|
+
/**
|
|
31
|
+
* 只读
|
|
32
|
+
*/
|
|
33
|
+
readonly?: boolean;
|
|
30
34
|
}
|
|
31
35
|
export declare const ChatMessageItem: (props: ChatMessageItemProps) => h.JSX.Element;
|
|
@@ -7,6 +7,10 @@ interface ChatNetDiskProps {
|
|
|
7
7
|
* @memberof ChatNetDiskProps
|
|
8
8
|
*/
|
|
9
9
|
controller: FileSystemController;
|
|
10
|
+
/**
|
|
11
|
+
* 默认展开id
|
|
12
|
+
*/
|
|
13
|
+
defaultExpandId?: string;
|
|
10
14
|
}
|
|
11
15
|
export declare const ChatNetDisk: (props: ChatNetDiskProps) => import("preact").JSX.Element;
|
|
12
16
|
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IChatOutPutFile } from '../../interface';
|
|
2
|
+
import { AiChatController } from '../../controller';
|
|
3
|
+
|
|
4
|
+
export type { ChatOutputFileAction } from './util';
|
|
5
|
+
export interface ChatOutputFilesProps {
|
|
6
|
+
/**
|
|
7
|
+
* @description 消息输出文件列表
|
|
8
|
+
* @type {IChatOutPutFile[]}
|
|
9
|
+
* @memberof ChatOutputFilesProps
|
|
10
|
+
*/
|
|
11
|
+
files: IChatOutPutFile[];
|
|
12
|
+
/**
|
|
13
|
+
* @description 聊天控制器
|
|
14
|
+
*/
|
|
15
|
+
controller: AiChatController;
|
|
16
|
+
}
|
|
17
|
+
export declare const ChatOutputFiles: (props: ChatOutputFilesProps) => import("preact").JSX.Element | null;
|
package/dist/types/components/chat-output-files/deliverable-role-files/deliverable-role-files.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IChatOutPutFile } from '../../../interface';
|
|
2
|
+
import { ChatOutputFileActionHandler } from '../util';
|
|
3
|
+
|
|
4
|
+
export interface DeliverableRoleFilesProps {
|
|
5
|
+
/**
|
|
6
|
+
* @description 交付物文件列表(仅 role=deliverable)
|
|
7
|
+
* @type {IChatOutPutFile[]}
|
|
8
|
+
* @memberof DeliverableRoleFilesProps
|
|
9
|
+
*/
|
|
10
|
+
files: IChatOutPutFile[];
|
|
11
|
+
/**
|
|
12
|
+
* @description 文件行为上抛(预览/下载/跳转,具体实现由父组件处理)
|
|
13
|
+
* @type {ChatOutputFileActionHandler}
|
|
14
|
+
* @memberof DeliverableRoleFilesProps
|
|
15
|
+
*/
|
|
16
|
+
onAction: ChatOutputFileActionHandler;
|
|
17
|
+
}
|
|
18
|
+
export declare const DeliverableRoleFiles: (props: DeliverableRoleFilesProps) => import("preact").JSX.Element | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IChatOutPutFile } from '../../../interface';
|
|
2
|
+
import { ChatOutputFileActionHandler } from '../util';
|
|
3
|
+
|
|
4
|
+
export interface EvidenceRoleFilesProps {
|
|
5
|
+
/**
|
|
6
|
+
* @description 佐证文件列表(仅 role=evidence)
|
|
7
|
+
* @type {IChatOutPutFile[]}
|
|
8
|
+
* @memberof EvidenceRoleFilesProps
|
|
9
|
+
*/
|
|
10
|
+
files: IChatOutPutFile[];
|
|
11
|
+
/**
|
|
12
|
+
* @description 文件行为上抛(预览,具体实现由父组件处理)
|
|
13
|
+
* @type {ChatOutputFileActionHandler}
|
|
14
|
+
* @memberof EvidenceRoleFilesProps
|
|
15
|
+
*/
|
|
16
|
+
onAction: ChatOutputFileActionHandler;
|
|
17
|
+
}
|
|
18
|
+
export declare const EvidenceRoleFiles: (props: EvidenceRoleFilesProps) => import("preact").JSX.Element | null;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { IChatOutPutFile } from '../../interface';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 输出文件行为
|
|
5
|
+
*
|
|
6
|
+
* @author tony001
|
|
7
|
+
* @date 2025-11-03 15:11:36
|
|
8
|
+
* @type {('preview' | 'download')}
|
|
9
|
+
*/
|
|
10
|
+
export type ChatOutputFileAction = 'preview' | 'download';
|
|
11
|
+
/**
|
|
12
|
+
* 输出文件行为处理
|
|
13
|
+
*
|
|
14
|
+
* @author tony001
|
|
15
|
+
* @date 2025-11-03 15:11:52
|
|
16
|
+
*/
|
|
17
|
+
export type ChatOutputFileActionHandler = (action: ChatOutputFileAction, file: IChatOutPutFile, event: MouseEvent) => void;
|
|
18
|
+
/**
|
|
19
|
+
* @description 格式化文件大小
|
|
20
|
+
* @param {number} bytes 字节数
|
|
21
|
+
* @return {*} {string}
|
|
22
|
+
*/
|
|
23
|
+
export declare const formatFileSize: (bytes: number) => string;
|
|
24
|
+
/**
|
|
25
|
+
* @description 提取文件后缀显示文本
|
|
26
|
+
* @param {string} name 文件名
|
|
27
|
+
* @return {*} {string}
|
|
28
|
+
*/
|
|
29
|
+
export declare const getFileExt: (name: string) => string;
|
|
@@ -2,10 +2,12 @@ import { VNode } from 'preact';
|
|
|
2
2
|
|
|
3
3
|
export interface IAction {
|
|
4
4
|
id: string;
|
|
5
|
-
icon
|
|
5
|
+
icon?: VNode;
|
|
6
6
|
caption: string;
|
|
7
|
-
visible?: (data?: any) => boolean
|
|
7
|
+
visible?: boolean | ((data?: any) => boolean);
|
|
8
|
+
disabled?: boolean | ((data?: any) => boolean);
|
|
8
9
|
onClick?: (event: MouseEvent, data?: any) => void;
|
|
10
|
+
clickClose?: boolean;
|
|
9
11
|
}
|
|
10
12
|
interface ActionsProps {
|
|
11
13
|
/**
|
|
@@ -3,3 +3,4 @@ export { FlatChatContainer } from './flat-chat-container/flat-chat-container';
|
|
|
3
3
|
export { ChatActionPanel } from './chat-action-panel/chat-action-panel';
|
|
4
4
|
export { SimpleChatContainer } from './simple-chat-container/simple-chat-container';
|
|
5
5
|
export { ChatQuesition } from './chat-quesition/chat-quesition';
|
|
6
|
+
export { ReadonlyChatContainer } from './readonly-chat-container/readonly-chat-container';
|
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentChildren } from 'preact';
|
|
2
|
+
import { IAction } from '../common/actions/actions';
|
|
2
3
|
|
|
3
4
|
type Position = 'top' | 'bottom' | 'left' | 'right' | 'top-left';
|
|
4
|
-
interface
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
interface IActionItem extends IAction {
|
|
6
|
+
position?: Position;
|
|
7
|
+
children?: IActionItem[];
|
|
8
|
+
triggerMode?: 'click' | 'hover';
|
|
9
|
+
content?: ComponentChildren;
|
|
10
|
+
popupClassName?: string;
|
|
8
11
|
}
|
|
9
|
-
export declare const Popup: ({ triggerMode, children, actions, content, disabled, position, isOpen: isOpenProp, onToggleOpen, popupClassName, onAction, }: {
|
|
12
|
+
export declare const Popup: ({ data, triggerMode, children, actions, content, disabled, position, isOpen: isOpenProp, onToggleOpen, popupClassName, onAction, }: {
|
|
10
13
|
triggerMode: "click" | "hover";
|
|
11
|
-
children:
|
|
12
|
-
actions?:
|
|
13
|
-
content?:
|
|
14
|
+
children: ComponentChildren;
|
|
15
|
+
actions?: IActionItem[];
|
|
16
|
+
content?: ComponentChildren;
|
|
14
17
|
position?: Position;
|
|
15
18
|
isOpen?: boolean;
|
|
16
19
|
popupClassName?: string;
|
|
17
20
|
disabled?: boolean;
|
|
21
|
+
data?: any;
|
|
18
22
|
onToggleOpen?: (isOpen: boolean) => void;
|
|
19
23
|
onAction?: (actionId: string, event: MouseEvent) => void;
|
|
20
24
|
}) => import("preact").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Component } from 'preact';
|
|
2
|
+
import { Namespace } from '../../utils';
|
|
3
|
+
import { AiChatController } from '../../controller';
|
|
4
|
+
|
|
5
|
+
export interface ReadonlyChatContainerProps {
|
|
6
|
+
/**
|
|
7
|
+
* @description 是否加载中
|
|
8
|
+
* @type {boolean}
|
|
9
|
+
* @memberof ReadonlyChatContainerProps
|
|
10
|
+
*/
|
|
11
|
+
isLoading: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* @description 聊天控制器
|
|
14
|
+
* @type {AiChatController}
|
|
15
|
+
* @memberof ReadonlyChatContainerProps
|
|
16
|
+
*/
|
|
17
|
+
aiChat?: AiChatController;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 只读聊天容器
|
|
21
|
+
*
|
|
22
|
+
* @export
|
|
23
|
+
* @class ReadonlyChatContainer
|
|
24
|
+
* @extends {Component<ReadonlyChatContainerProps>}
|
|
25
|
+
*/
|
|
26
|
+
export declare class ReadonlyChatContainer extends Component<ReadonlyChatContainerProps> {
|
|
27
|
+
ns: Namespace;
|
|
28
|
+
render(): import("preact").JSX.Element;
|
|
29
|
+
}
|
|
@@ -57,7 +57,7 @@ export declare class AiActionPanelController {
|
|
|
57
57
|
* - params 中包含 controller 时替换为激活会话的控制器
|
|
58
58
|
* - 重置 key 强制内容组件重挂载并重新加载数据
|
|
59
59
|
*
|
|
60
|
-
* @param {string} [key] 业务域key
|
|
60
|
+
* @param {string} [key] 业务域key(未传时刷新参数, 传递时强制重绘)
|
|
61
61
|
* @param {unknown} [controller] 激活会话的聊天控制器
|
|
62
62
|
* @memberof AiActionPanelController
|
|
63
63
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
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, IMaterial, IChatMessage, IChatOptions, IChatUIAction, IAIAgentConfig, IChatSuggestion, IResourceOptions, IChatMessageUsage, ITopicOptions } from '../../interface';
|
|
4
|
+
import { ITopic, IMaterial, IChatMessage, IChatOptions, IChatUIAction, IAIAgentConfig, IChatSuggestion, IResourceOptions, IChatMessageUsage, ITopicOptions, IChatOutPutFile } 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
7
|
import { FileSystemController } from '../file-system/file-system.controller';
|
|
@@ -442,6 +442,13 @@ export declare class AiChatController {
|
|
|
442
442
|
* @memberof AiChatController
|
|
443
443
|
*/
|
|
444
444
|
updateMsgUsage(messageid: string, usage: IChatMessageUsage): void;
|
|
445
|
+
/**
|
|
446
|
+
* @description 更新消息的输出文件列表
|
|
447
|
+
* @param {string} messageid 消息ID
|
|
448
|
+
* @param {IChatOutPutFile[]} files 消息输出文件列表
|
|
449
|
+
* @memberof AiChatController
|
|
450
|
+
*/
|
|
451
|
+
updateMsgOutputFiles(messageid: string, files: IChatOutPutFile[]): void;
|
|
445
452
|
/**
|
|
446
453
|
* @description 基于消息ID更新消息的远程消息标识
|
|
447
454
|
* @param {string} messageid 本地消息ID
|
|
@@ -705,6 +712,11 @@ export declare class AiChatController {
|
|
|
705
712
|
* @returns
|
|
706
713
|
*/
|
|
707
714
|
handlePredefinedClick(type: 'chunkview' | 'view' | 'action', url: string, message: IChatMessage, event: MouseEvent): Promise<void>;
|
|
715
|
+
/**
|
|
716
|
+
* 打开输出文件预览
|
|
717
|
+
* @param file
|
|
718
|
+
*/
|
|
719
|
+
openOutputFilePreview(file: IChatOutPutFile): void;
|
|
708
720
|
/**
|
|
709
721
|
* 处理预定义视图跳转点击
|
|
710
722
|
* @param url
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { IContainerOptions } from '../../interface';
|
|
2
|
+
import { AiChatController } from '../ai-chat/ai-chat.controller';
|
|
3
|
+
import { ChatBaseController } from './chat-base.controller';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @description 只读聊天控制器
|
|
7
|
+
* @export
|
|
8
|
+
* @class ReadonlyChatController
|
|
9
|
+
* @extends {ChatBaseController}
|
|
10
|
+
*/
|
|
11
|
+
export declare class ReadonlyChatController extends ChatBaseController {
|
|
12
|
+
/**
|
|
13
|
+
* @description 挂载容器
|
|
14
|
+
* @protected
|
|
15
|
+
* @type {HTMLElement}
|
|
16
|
+
* @memberof ReadonlyChatController
|
|
17
|
+
*/
|
|
18
|
+
protected container?: HTMLElement;
|
|
19
|
+
/**
|
|
20
|
+
* @description 创建只读聊天
|
|
21
|
+
* @param {IContainerOptions} opts
|
|
22
|
+
* @returns {*} {Promise<AiChatController>}
|
|
23
|
+
* @memberof ReadonlyChatController
|
|
24
|
+
*/
|
|
25
|
+
create(opts: IContainerOptions): Promise<AiChatController>;
|
|
26
|
+
/**
|
|
27
|
+
* @description 创建容器,渲染loading状态
|
|
28
|
+
* @protected
|
|
29
|
+
* @param {IContainerOptions} opts
|
|
30
|
+
* @param {Record<string, any>} chatOptions
|
|
31
|
+
* @returns {*} {void}
|
|
32
|
+
* @memberof ReadonlyChatController
|
|
33
|
+
*/
|
|
34
|
+
protected setupContainer(_opts: IContainerOptions, _chatOptions: Record<string, any>): void;
|
|
35
|
+
/**
|
|
36
|
+
* @description 渲染正式聊天内容
|
|
37
|
+
* @protected
|
|
38
|
+
* @param {IContainerOptions} _opts
|
|
39
|
+
* @param {Record<string, any>} _chatOptions
|
|
40
|
+
* @param {AiChatController} aiChat
|
|
41
|
+
* @returns {*} {void}
|
|
42
|
+
* @memberof ReadonlyChatController
|
|
43
|
+
*/
|
|
44
|
+
protected renderChatContent(_opts: IContainerOptions, _chatOptions: Record<string, any>, aiChat: AiChatController): void;
|
|
45
|
+
/**
|
|
46
|
+
* @description 渲染切换聊天后的内容
|
|
47
|
+
* @protected
|
|
48
|
+
* @param {Record<string, any>} _opts
|
|
49
|
+
* @param {AiChatController} _aiChat
|
|
50
|
+
* @memberof ReadonlyChatController
|
|
51
|
+
*/
|
|
52
|
+
protected renderSwitchedContent(_opts: Record<string, any>, _aiChat: AiChatController): void;
|
|
53
|
+
/**
|
|
54
|
+
* @description 关闭
|
|
55
|
+
* @memberof ReadonlyChatController
|
|
56
|
+
*/
|
|
57
|
+
close(): void;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* @description 创建只读聊天实例
|
|
61
|
+
* @export
|
|
62
|
+
* @returns {*} {ReadonlyChatController}
|
|
63
|
+
*/
|
|
64
|
+
export declare function createReadonlyChat(): ReadonlyChatController;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IFile, IFileItem, ITreeNode, IMessageUtil, IConfirmUtil, IFileItemParams, IFileUploadPrams, IFileSystemOptions, FileUploaderOptions } from '../../interface';
|
|
1
|
+
import { IFile, IFileItem, ITreeNode, IMessageUtil, IConfirmUtil, IFileItemParams, IFileUploadPrams, IFileSystemOptions, FileUploaderOptions, IFileReadPrams, IFileSystemResult } from '../../interface';
|
|
2
2
|
import { AiChatController } from '../ai-chat/ai-chat.controller';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -9,7 +9,7 @@ import { AiChatController } from '../ai-chat/ai-chat.controller';
|
|
|
9
9
|
export declare class FileSystemController {
|
|
10
10
|
private opts;
|
|
11
11
|
private uploader;
|
|
12
|
-
aiChat
|
|
12
|
+
private aiChat;
|
|
13
13
|
/**
|
|
14
14
|
* Creates an instance of FileSystemController.
|
|
15
15
|
* @param {IFileSystemOptions} opts
|
|
@@ -31,6 +31,13 @@ export declare class FileSystemController {
|
|
|
31
31
|
* @memberof FileSystemController
|
|
32
32
|
*/
|
|
33
33
|
private params;
|
|
34
|
+
/**
|
|
35
|
+
* @description 选中项目
|
|
36
|
+
* @readonly
|
|
37
|
+
* @type {(string | undefined)}
|
|
38
|
+
* @memberof FileSystemController
|
|
39
|
+
*/
|
|
40
|
+
get activeAIProjectId(): string | undefined;
|
|
34
41
|
/**
|
|
35
42
|
* @description 消息
|
|
36
43
|
* @readonly
|
|
@@ -76,10 +83,19 @@ export declare class FileSystemController {
|
|
|
76
83
|
/**
|
|
77
84
|
* @description 系统文件上传
|
|
78
85
|
* @param {IFileUploadPrams} params
|
|
79
|
-
* @returns {*} {(Promise<
|
|
86
|
+
* @returns {*} {(Promise<(IFileSystemResult & { cat: string }) | undefined>)}
|
|
87
|
+
* @memberof FileSystemController
|
|
88
|
+
*/
|
|
89
|
+
uploadSystemFile(params: IFileUploadPrams): Promise<(IFileSystemResult & {
|
|
90
|
+
cat: string;
|
|
91
|
+
}) | undefined>;
|
|
92
|
+
/**
|
|
93
|
+
* @description 读取系统文件
|
|
94
|
+
* @param {IFileReadPrams} params
|
|
95
|
+
* @returns {*} {(Promise<IFileSystemResult | undefined>)}
|
|
80
96
|
* @memberof FileSystemController
|
|
81
97
|
*/
|
|
82
|
-
|
|
98
|
+
readSystemFile(params: IFileReadPrams): Promise<IFileSystemResult | undefined>;
|
|
83
99
|
/**
|
|
84
100
|
* @description 获取文件内容
|
|
85
101
|
* @param {string} id
|
|
@@ -7,3 +7,4 @@ export { FlatChatController, createFlatChat, } from './chat/flat-chat.controller
|
|
|
7
7
|
export { drawerController } from './overlay';
|
|
8
8
|
export { FileSystemController } from './file-system/file-system.controller';
|
|
9
9
|
export { tipTapController } from './tiptap/tiptap.controller';
|
|
10
|
+
export { createReadonlyChat, ReadonlyChatController, } from './chat/readonly-chat.controller';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IChatMessage, IChatThink, IChatMessageUsage } from '../../interface';
|
|
1
|
+
import { IChatMessage, IChatThink, IChatMessageUsage, IChatOutPutFile } from '../../interface';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* 消息实体
|
|
@@ -17,6 +17,7 @@ export declare class ChatMessage implements IChatMessage {
|
|
|
17
17
|
chatuiactions: IChatMessage['chatuiactions'];
|
|
18
18
|
think: IChatThink | undefined;
|
|
19
19
|
usage: IChatMessageUsage | undefined;
|
|
20
|
+
files: IChatOutPutFile[] | undefined;
|
|
20
21
|
/**
|
|
21
22
|
* @description 是否为重新编辑状态,为重新编辑状态为true/不为重新编辑状态为false
|
|
22
23
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useFullscreen } from './fullscreen';
|
|
@@ -34,7 +34,7 @@ export { LikeSvg } from './like-svg';
|
|
|
34
34
|
export { DislikeSvg } from './dislike-svg';
|
|
35
35
|
export { TopSvg } from './top-svg';
|
|
36
36
|
export { NoTopSvg } from './no-top-svg';
|
|
37
|
-
export { DownLoadSvg } from './download';
|
|
37
|
+
export { DownLoadSvg, DownLoad2Svg } from './download';
|
|
38
38
|
export { WarningSvg } from './warning-svg';
|
|
39
39
|
export { ImageSvg, ErrorSvg, ExpandSvg, EmptySvg, CopyingSvg, CopyPasteSvg, KnowledgeSvg, } from './tool-call-svg';
|
|
40
40
|
export { FailSvg } from './fail-svg';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
2
|
export { ChatContainer, FlatChatContainer } from './components';
|
|
3
|
-
export { chat, createFlatChat } from './controller';
|
|
3
|
+
export { chat, createFlatChat, createReadonlyChat } from './controller';
|
|
4
4
|
export type { IChatToolbarItem, IActionPanelContentProps, TActionPanelComponent, } from './interface';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IChatMessageUsage } from '../i-chat-message-usage/i-chat-message-usage';
|
|
2
|
+
import { IChatOutPutFile } from '../i-chat-output-file/i-chat-output-file';
|
|
2
3
|
import { IChatStep } from '../i-chat-step/i-chat-step';
|
|
3
4
|
import { IChatSuggestion } from '../i-chat-suggestion/i-chat-suggestion';
|
|
4
5
|
import { IChatThink } from '../i-chat-think/i-chat-think';
|
|
@@ -201,4 +202,10 @@ export interface IChatMessage {
|
|
|
201
202
|
* @memberof IChatMessage
|
|
202
203
|
*/
|
|
203
204
|
iswaiting?: boolean;
|
|
205
|
+
/**
|
|
206
|
+
* @description 聊天输出文件
|
|
207
|
+
* @type {IChatOutPutFile[]}
|
|
208
|
+
* @memberof IChatMessage
|
|
209
|
+
*/
|
|
210
|
+
files?: IChatOutPutFile[];
|
|
204
211
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description 聊天输出文件接口
|
|
3
|
+
* @export
|
|
4
|
+
* @interface IChatOutPutFile
|
|
5
|
+
*/
|
|
6
|
+
export interface IChatOutPutFile {
|
|
7
|
+
/**
|
|
8
|
+
* @description 文件来源,智能体工作区 | 对象存储(OSS) | 技能目录(技能静态资产,如 SKILL.md / references / scripts / templates)
|
|
9
|
+
* @type {('skills_workspace' | 'oss' | 'skill')}
|
|
10
|
+
* @memberof IChatOutPutFile
|
|
11
|
+
*/
|
|
12
|
+
source: 'skills_workspace' | 'oss' | 'skill';
|
|
13
|
+
/**
|
|
14
|
+
* @description 路径(工作区相对路径,OSS 的 folder/id,或技能目录内相对路径)
|
|
15
|
+
* @type {string}
|
|
16
|
+
* @memberof IChatOutPutFile
|
|
17
|
+
*/
|
|
18
|
+
path: string;
|
|
19
|
+
/**
|
|
20
|
+
* @description 显示名称
|
|
21
|
+
* @type {string}
|
|
22
|
+
* @memberof IChatOutPutFile
|
|
23
|
+
*/
|
|
24
|
+
name: string;
|
|
25
|
+
/**
|
|
26
|
+
* @description 角色,交付物(用户需要打开) | 佐证(仅支撑结论)
|
|
27
|
+
* @type {('deliverable' | 'evidence')}
|
|
28
|
+
* @memberof IChatOutPutFile
|
|
29
|
+
*/
|
|
30
|
+
role: 'deliverable' | 'evidence';
|
|
31
|
+
/**
|
|
32
|
+
* @description 说明
|
|
33
|
+
* @type {string}
|
|
34
|
+
* @memberof IChatOutPutFile
|
|
35
|
+
*/
|
|
36
|
+
description: string;
|
|
37
|
+
/**
|
|
38
|
+
* @description 大小(字节)
|
|
39
|
+
* @type {number}
|
|
40
|
+
* @memberof IChatOutPutFile
|
|
41
|
+
*/
|
|
42
|
+
size?: number;
|
|
43
|
+
/**
|
|
44
|
+
* @description 下载地址(OSS)
|
|
45
|
+
* @type {string}
|
|
46
|
+
* @memberof IChatOutPutFile
|
|
47
|
+
*/
|
|
48
|
+
url?: string;
|
|
49
|
+
/**
|
|
50
|
+
* @description 技能ID(技能目录内的文件才有)
|
|
51
|
+
* @type {string}
|
|
52
|
+
* @memberof IChatOutPutFile
|
|
53
|
+
*/
|
|
54
|
+
skill_id?: string;
|
|
55
|
+
}
|
|
@@ -60,8 +60,23 @@ export interface IFileUploadPrams {
|
|
|
60
60
|
*/
|
|
61
61
|
file_path: string;
|
|
62
62
|
}
|
|
63
|
+
export interface IFileReadPrams {
|
|
64
|
+
/**
|
|
65
|
+
* @description 文件路径
|
|
66
|
+
* @type {string}
|
|
67
|
+
* @memberof IFileReadPrams
|
|
68
|
+
*/
|
|
69
|
+
file_path: string;
|
|
70
|
+
/**
|
|
71
|
+
* @description 技能id
|
|
72
|
+
* @type {string}
|
|
73
|
+
* @memberof IFileReadPrams
|
|
74
|
+
*/
|
|
75
|
+
skill_id?: string;
|
|
76
|
+
}
|
|
63
77
|
export interface IFile {
|
|
64
|
-
id: string;
|
|
65
78
|
name: string;
|
|
66
|
-
|
|
79
|
+
id?: string;
|
|
80
|
+
cat?: string;
|
|
81
|
+
content?: string;
|
|
67
82
|
}
|