@ibiz-template-plugin/ai-chat 0.0.125 → 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.
Files changed (37) hide show
  1. package/dist/index.es.js +24368 -23786
  2. package/dist/index.legacy.js +2 -2
  3. package/dist/style.css +2 -2
  4. package/dist/types/components/chat-file-preview/chat-file-preview.d.ts +26 -3
  5. package/dist/types/components/chat-message-item/chat-message-item.d.ts +5 -1
  6. package/dist/types/components/chat-message-item/error-message/error-message.d.ts +4 -0
  7. package/dist/types/components/chat-message-item/markdown-message/markdown-message.d.ts +4 -0
  8. package/dist/types/components/chat-message-item/user-message/user-message.d.ts +4 -0
  9. package/dist/types/components/chat-messages/chat-messages.d.ts +4 -0
  10. package/dist/types/components/chat-net-disk/chat-net-disk.d.ts +4 -0
  11. package/dist/types/components/chat-output-files/chat-output-files.d.ts +17 -0
  12. package/dist/types/components/chat-output-files/deliverable-role-files/deliverable-role-files.d.ts +18 -0
  13. package/dist/types/components/chat-output-files/evidence-role-files/evidence-role-files.d.ts +18 -0
  14. package/dist/types/components/chat-output-files/util.d.ts +29 -0
  15. package/dist/types/components/common/lazy-level-list/lazy-level-list.d.ts +4 -0
  16. package/dist/types/components/index.d.ts +1 -0
  17. package/dist/types/components/readonly-chat-container/readonly-chat-container.d.ts +29 -0
  18. package/dist/types/controller/ai-action-panel/ai-action-panel.controller.d.ts +1 -1
  19. package/dist/types/controller/ai-chat/ai-chat.controller.d.ts +13 -1
  20. package/dist/types/controller/chat/readonly-chat.controller.d.ts +64 -0
  21. package/dist/types/controller/file-system/file-system.controller.d.ts +20 -4
  22. package/dist/types/controller/index.d.ts +1 -0
  23. package/dist/types/entity/chat-message/chat-message.d.ts +2 -1
  24. package/dist/types/hook/fullscreen.d.ts +8 -0
  25. package/dist/types/hook/index.d.ts +1 -0
  26. package/dist/types/icons/download.d.ts +1 -0
  27. package/dist/types/icons/index.d.ts +1 -1
  28. package/dist/types/index.d.ts +1 -1
  29. package/dist/types/interface/i-chat-message/i-chat-message.d.ts +7 -0
  30. package/dist/types/interface/i-chat-output-file/i-chat-output-file.d.ts +55 -0
  31. package/dist/types/interface/i-file-item/i-file-item.d.ts +17 -2
  32. package/dist/types/interface/i-file-system-options/i-file-system-options.d.ts +7 -7
  33. package/dist/types/interface/i-remote-resource/i-remote-resource.d.ts +4 -0
  34. package/dist/types/interface/index.d.ts +3 -2
  35. package/dist/types/locale/en/index.d.ts +4 -0
  36. package/dist/types/locale/zh-CN/index.d.ts +4 -0
  37. 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 {IFile}
6
+ * @description 传入资源类型,工作空间 | oss | skill
7
+ * @type {('workspace' | 'oss' | 'skill')}
7
8
  * @memberof ChatFilePreviewProps
8
9
  */
9
- filePath?: string;
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: VNode;
29
+ children?: VNode;
30
+ /**
31
+ * 只读
32
+ */
33
+ readonly?: boolean;
30
34
  }
31
35
  export declare const ChatMessageItem: (props: ChatMessageItemProps) => h.JSX.Element;
@@ -27,5 +27,9 @@ export interface ErrorMessageProps {
27
27
  * @memberof ErrorMessageProps
28
28
  */
29
29
  children: VNode;
30
+ /**
31
+ * 只读
32
+ */
33
+ readonly?: boolean;
30
34
  }
31
35
  export declare const ErrorMessage: (props: ErrorMessageProps) => import("preact").JSX.Element;
@@ -34,5 +34,9 @@ export interface MarkdownMessageProps {
34
34
  * @memberof MarkdownMessageProps
35
35
  */
36
36
  children: VNode;
37
+ /**
38
+ * 只读
39
+ */
40
+ readonly?: boolean;
37
41
  }
38
42
  export declare const MarkdownMessage: (props: MarkdownMessageProps) => import("preact").JSX.Element;
@@ -20,5 +20,9 @@ export interface UserMessageProps {
20
20
  * @memberof UserMessageProps
21
21
  */
22
22
  children: VNode;
23
+ /**
24
+ * 只读
25
+ */
26
+ readonly?: boolean;
23
27
  }
24
28
  export declare const UserMessage: (props: UserMessageProps) => import("preact").JSX.Element;
@@ -22,6 +22,10 @@ export interface ChatMessageProps {
22
22
  * 悬浮于消息区底部的插槽(如 footer 工具栏)
23
23
  */
24
24
  children?: ComponentChildren;
25
+ /**
26
+ * 只读
27
+ */
28
+ readonly?: boolean;
25
29
  }
26
30
  /**
27
31
  * 聊天消息列表组件
@@ -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;
@@ -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;
@@ -86,6 +86,10 @@ interface LazyLevelListProps {
86
86
  * @returns
87
87
  */
88
88
  filterNodeMethod?: (node: ITreeNode) => boolean;
89
+ /**
90
+ * 是否加载中
91
+ */
92
+ isLoading?: boolean;
89
93
  }
90
94
  export interface LazyLevelListRef {
91
95
  /**
@@ -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';
@@ -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(未传时生成 uuid 强制刷新)
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: AiChatController;
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<IFile | undefined>)}
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
- uploadSystemFile(params: IFileUploadPrams): Promise<IFile | undefined>;
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,8 @@
1
+ export declare const useFullscreen: (targetRef?: {
2
+ current: HTMLElement | null;
3
+ }) => {
4
+ isFullscreen: boolean;
5
+ enter: () => Promise<boolean>;
6
+ exit: () => Promise<boolean>;
7
+ toggle: () => Promise<void>;
8
+ };
@@ -0,0 +1 @@
1
+ export { useFullscreen } from './fullscreen';
@@ -1 +1,2 @@
1
1
  export declare const DownLoadSvg: () => import("preact").JSX.Element;
2
+ export declare const DownLoad2Svg: () => import("preact").JSX.Element;
@@ -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';
@@ -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
- cat: string;
79
+ id?: string;
80
+ cat?: string;
81
+ content?: string;
67
82
  }
@@ -91,9 +91,10 @@ interface IFileSystemDeleteParams {
91
91
  * @description 读取文件参数
92
92
  * @interface IFileSystemReadParams
93
93
  */
94
- interface IFileSystemReadParams {
94
+ export interface IFileSystemReadParams {
95
95
  sessionid: string;
96
96
  file_path: string;
97
+ skill_id?: string;
97
98
  srfaiagent?: string;
98
99
  srfscope?: string;
99
100
  offset?: number;
@@ -105,13 +106,16 @@ interface IFileSystemReadParams {
105
106
  * @description 文件操作结果对象
106
107
  * @interface IFileSystemResult
107
108
  */
108
- interface IFileSystemResult {
109
+ export interface IFileSystemResult {
109
110
  ok: boolean;
110
111
  action: 'MKDIR' | 'WRITE' | 'MOVE' | 'DELETE' | 'READ';
111
112
  path: string;
112
113
  transport: 'native' | 'command';
113
114
  content?: string;
114
115
  content_length?: number;
116
+ id?: string;
117
+ name?: string;
118
+ folder?: string;
115
119
  error?: {
116
120
  code: string;
117
121
  message: string;
@@ -151,11 +155,7 @@ export interface IFileSystemOptions {
151
155
  * @description 上传文件
152
156
  * @memberof IFileSystemOptions
153
157
  */
154
- uploadFile: (ctx: object, param: object, other: IFileSystemUploadParams) => Promise<{
155
- id: string;
156
- name: string;
157
- folder: string;
158
- } | undefined>;
158
+ uploadFile: (ctx: object, param: object, other: IFileSystemUploadParams) => Promise<IFileSystemResult | undefined>;
159
159
  /**
160
160
  * @description 下载文件
161
161
  * @memberof IFileSystemOptions
@@ -113,4 +113,8 @@ export interface IRemoteMessage {
113
113
  * 工具调用数
114
114
  */
115
115
  tool_calls: number | undefined;
116
+ /**
117
+ * 消息交付文件
118
+ */
119
+ files?: string;
116
120
  }
@@ -25,8 +25,9 @@ export type { IAIQuesitionItem, IAIQuesition, IAIQuesitionAnswer, } from './i-ai
25
25
  export type { IExtensionOptions } from './i-extension-options/i-extension-options';
26
26
  export type { IActionPanelContentProps, TActionPanelComponent, } from './i-action-panel/i-action-panel';
27
27
  export type { ISpeechRecognition } from './i-speech-recognition/i-speech-recognition';
28
- export type { IFile, IFileItem, IFileItemParams, IFileUploadPrams, } from './i-file-item/i-file-item';
29
- export type { IFileSystemOptions } from './i-file-system-options/i-file-system-options';
28
+ export type { IFile, IFileItem, IFileItemParams, IFileUploadPrams, IFileReadPrams, } from './i-file-item/i-file-item';
29
+ export type { IFileSystemOptions, IFileSystemResult, } from './i-file-system-options/i-file-system-options';
30
30
  export { TipTapNodeType, type ITipTapDropData, type TipTapNodeConfig, } from './i-tiptap/i-tiptap';
31
31
  export * from './deep-research';
32
32
  export type { ITreeNode } from './i-tree-node/i-tree-node';
33
+ export type { IChatOutPutFile } from './i-chat-output-file/i-chat-output-file';
@@ -31,8 +31,12 @@ export declare const EN: {
31
31
  uploadSuccess: string;
32
32
  uploading: string;
33
33
  uploadFailed: string;
34
+ loadFailed: string;
34
35
  unknownState: string;
35
36
  download: string;
37
+ filePreview: string;
38
+ evidenceCount: string;
39
+ skill: string;
36
40
  thinkThrough: string;
37
41
  stopThinking: string;
38
42
  thinking: string;
@@ -31,8 +31,12 @@ export declare const ZH_CN: {
31
31
  uploadSuccess: string;
32
32
  uploading: string;
33
33
  uploadFailed: string;
34
+ loadFailed: string;
34
35
  unknownState: string;
35
36
  download: string;
37
+ filePreview: string;
38
+ evidenceCount: string;
39
+ skill: string;
36
40
  thinkThrough: string;
37
41
  stopThinking: string;
38
42
  thinking: string;