@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.
Files changed (43) hide show
  1. package/dist/index.es.js +21227 -20644
  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/actions/actions.d.ts +4 -2
  16. package/dist/types/components/common/context-menu/context-menu.d.ts +0 -1
  17. package/dist/types/components/common/lazy-level-list/lazy-level-list.d.ts +4 -0
  18. package/dist/types/components/index.d.ts +1 -0
  19. package/dist/types/components/popup/popup.d.ts +13 -9
  20. package/dist/types/components/readonly-chat-container/readonly-chat-container.d.ts +29 -0
  21. package/dist/types/controller/ai-action-panel/ai-action-panel.controller.d.ts +1 -1
  22. package/dist/types/controller/ai-chat/ai-chat.controller.d.ts +13 -1
  23. package/dist/types/controller/chat/readonly-chat.controller.d.ts +64 -0
  24. package/dist/types/controller/file-system/file-system.controller.d.ts +20 -4
  25. package/dist/types/controller/index.d.ts +1 -0
  26. package/dist/types/entity/chat-message/chat-message.d.ts +2 -1
  27. package/dist/types/hook/fullscreen.d.ts +8 -0
  28. package/dist/types/hook/index.d.ts +1 -0
  29. package/dist/types/icons/download.d.ts +1 -0
  30. package/dist/types/icons/index.d.ts +1 -1
  31. package/dist/types/index.d.ts +1 -1
  32. package/dist/types/interface/i-chat-message/i-chat-message.d.ts +7 -0
  33. package/dist/types/interface/i-chat-output-file/i-chat-output-file.d.ts +55 -0
  34. package/dist/types/interface/i-chat-toolbar-item/i-chat-toolbar-item.d.ts +1 -1
  35. package/dist/types/interface/i-file-item/i-file-item.d.ts +17 -2
  36. package/dist/types/interface/i-file-system-options/i-file-system-options.d.ts +7 -7
  37. package/dist/types/interface/i-remote-resource/i-remote-resource.d.ts +4 -0
  38. package/dist/types/interface/index.d.ts +3 -2
  39. package/dist/types/locale/en/index.d.ts +6 -0
  40. package/dist/types/locale/zh-CN/index.d.ts +6 -0
  41. package/dist/types/utils/index.d.ts +1 -0
  42. package/dist/types/utils/markdown-preview.d.ts +47 -0
  43. package/package.json +2 -2
@@ -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;
@@ -182,4 +186,6 @@ export declare const EN: {
182
186
  clear: string;
183
187
  backPrevious: string;
184
188
  fileExists: string;
189
+ moveToGroup: string;
190
+ moveToDir: string;
185
191
  };
@@ -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;
@@ -182,4 +186,6 @@ export declare const ZH_CN: {
182
186
  clear: string;
183
187
  backPrevious: string;
184
188
  fileExists: string;
189
+ moveToGroup: string;
190
+ moveToDir: string;
185
191
  };
@@ -11,5 +11,6 @@ export { ChatToolCallParser } from './util/chat-tool-call-parser';
11
11
  export { ChatStepParser } from './util/chat-step-parser';
12
12
  export { ChatUIActionParser } from './util/chat-ui-action-parser';
13
13
  export { ContentProtector } from './util/content-protector';
14
+ export { MarkdownPreview } from './markdown-preview';
14
15
  export { TextUtil } from './util/util';
15
16
  export { FileIcon, FolderIcon } from './util/system-file';
@@ -0,0 +1,47 @@
1
+ /**
2
+ * 消息 markdown 预览渲染器
3
+ *
4
+ * ## 为什么不直接用 `new Cherry({ defaultModel: 'previewOnly' })` + setMarkdown
5
+ * previewOnly 模式的 Cherry 仍会创建 CodeMirror、工具栏、内部 ResizeObserver 等完整
6
+ * 编辑器 DOM,而 cherry 0.8.58 的 destroy() 仅移除容器与清空事件总线,不销毁编辑器、
7
+ * 不断开内部观察器;消息列表滚出视口→卸载、滚回→重建的机制下,被销毁实例的整棵 DOM
8
+ * 会持续滞留在堆上(内存泄露)。消息预览只需要 markdown→HTML。
9
+ *
10
+ * ## 为什么主入口 Cherry 还要「无 el」实例化
11
+ * 主入口 default 导出的是完整编辑器类 Cherry(引擎类 CherryEngine 仅在
12
+ * dist/cherry-markdown.engine.core.esm.js 子路径导出,无法被宿主 external 复用)。
13
+ * Cherry 不传 el 且不强制挂载(forceAppend 默认 false)时,init() 在创建编辑区/
14
+ * 工具栏之前即返回,不产生任何编辑器 DOM;此时仅借用实例内部的 Engine 完成
15
+ * markdown→HTML(Engine 构造与 makeHtml 均不依赖编辑器 DOM)。
16
+ */
17
+ export interface IMarkdownPreviewTheme {
18
+ /**
19
+ * 主题(cherry themeSettings.mainTheme),默认 light
20
+ */
21
+ mainTheme?: string;
22
+ /**
23
+ * 代码块主题(cherry themeSettings.codeBlockTheme),默认 default
24
+ */
25
+ codeBlockTheme?: string;
26
+ }
27
+ /**
28
+ * markdown 预览渲染器实例:每个消息组件持有一个,
29
+ * render 可反复调用(流式更新),容器被卸载重建后会自动重建骨架
30
+ */
31
+ export declare class MarkdownPreview {
32
+ private wrapper;
33
+ private previewer;
34
+ /**
35
+ * 渲染 markdown 到容器:首次构建 cherry 预览骨架(class/主题属性与
36
+ * cherry previewOnly 结构一致,保证样式不变),后续调用仅更新内容
37
+ */
38
+ render(container: HTMLElement, md: string, theme?: IMarkdownPreviewTheme): void;
39
+ /**
40
+ * 预览内容容器(如外部 ResizeObserver 需要测量内容高度)
41
+ */
42
+ getPreviewerDom(): HTMLDivElement | null;
43
+ /**
44
+ * 卸载骨架(无实例资源,仅移除 DOM)
45
+ */
46
+ destroy(): void;
47
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibiz-template-plugin/ai-chat",
3
- "version": "0.0.124",
3
+ "version": "0.0.126",
4
4
  "description": "iBiz AI交互框插件",
5
5
  "type": "module",
6
6
  "main": "dist/index.es.js",
@@ -29,7 +29,7 @@
29
29
  "publish:local": "npm run build && npm publish --access public --registry=http://172.16.240.221:8081/repository/local/"
30
30
  },
31
31
  "dependencies": {
32
- "@ibiz-template-plugin/ibiz-file-previewer": "^0.0.28",
32
+ "@ibiz-template-plugin/ibiz-file-previewer": "^0.0.29",
33
33
  "@ibiz-template/scss-utils": "^0.0.2",
34
34
  "@preact/signals": "^1.2.1",
35
35
  "@tiptap/core": "^3.11.1",