@blueking/chat-x 0.0.49-beta.7 → 0.0.50

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 (25) hide show
  1. package/dist/ag-ui/types/file.d.ts +1 -11
  2. package/dist/components/chat-message/assistant-message/message-artifacts/artifact-preview/artifact-preview-host.vue.d.ts +5 -1
  3. package/dist/components/chat-message/assistant-message/message-artifacts/artifact-preview/preview-strategy.d.ts +4 -5
  4. package/dist/components/chat-message/assistant-message/message-artifacts/artifact-preview/renderers/code-preview.vue.d.ts +8 -0
  5. package/dist/components/chat-message/assistant-message/message-artifacts/artifact-preview/renderers/image-preview.vue.d.ts +7 -0
  6. package/dist/components/chat-message/assistant-message/message-artifacts/artifact-preview/use-artifact-preview-loader.d.ts +1 -0
  7. package/dist/components/chat-message/assistant-message/message-artifacts/file-artifact-panel.vue.d.ts +1 -0
  8. package/dist/components/file-icon/file-icon.vue.d.ts +7 -0
  9. package/dist/components/index.d.ts +2 -1
  10. package/dist/composables/use-message-group.d.ts +72 -72
  11. package/dist/icons/file-icons.d.ts +4 -0
  12. package/dist/icons/file.d.ts +0 -18
  13. package/dist/icons/index.d.ts +1 -0
  14. package/dist/index.css +1 -1
  15. package/dist/index.js +2122 -1952
  16. package/dist/index.js.map +1 -1
  17. package/dist/mcp/generated/docs/assistant-message.md +12 -8
  18. package/dist/mcp/generated/docs/file-artifact-panel.md +27 -11
  19. package/dist/mcp/generated/docs/file-icon.md +111 -0
  20. package/dist/mcp/generated/index.json +22 -2
  21. package/dist/mcp/index.js +0 -0
  22. package/dist/utils/file-type.d.ts +14 -0
  23. package/dist/utils/index.d.ts +1 -0
  24. package/package.json +21 -20
  25. package/dist/components/chat-message/assistant-message/message-artifacts/file-icon.d.ts +0 -29
@@ -378,14 +378,18 @@ AI 可在一次回复中发起多个工具调用,组件依次渲染:
378
378
 
379
379
  `AIFileInfo` 仅含元信息(`name` / `outputId` / `size` / `type`);`download_url` / `preview_url` 由容器 `onArtifactClick` 异步获取。命中唯一文件依赖 `messageUid = uid ?? String(id)` + 卡片下标 + `outputId`。
380
380
 
381
- 侧栏预览由面板内 `ArtifactPreviewHost` 按类型分派(详见面板文档「预览机制」):
382
-
383
- | type | 预览依赖 | 渲染 |
384
- | ---- | -------- | ---- |
385
- | `html` / `markdown` / `md` / `txt` / `json` | `download_url` | 正文直渲染(srcdoc / MarkdownContent / `<pre>`) |
386
- | `pdf` / `jpg` | `preview_url` | iframe(一般为后台转好的 PDF) |
387
-
388
- `md` `markdown` 等价(见 `AIFileType.Md` / `AIFileType.Markdown`)。预览重载、重试与取链约定见 [FileArtifactPanel 预览机制](/components/message/file-artifact-panel#预览机制)。
381
+ 侧栏预览由面板内 `ArtifactPreviewHost` 按**文件分类**分派(详见面板文档「预览机制」):
382
+
383
+ | 分类 | 典型 type | 预览依赖 | 渲染 |
384
+ | ---- | --------- | -------- | ---- |
385
+ | 源码 / 配置 | `py` / `ts` / `json` / `yaml` / `Dockerfile` | `download_url` | highlight.js 高亮 |
386
+ | Markdown | `md` / `markdown` | `download_url` | MarkdownContent 富文本 |
387
+ | HTML | `html` / `htm` | `download_url` | `<iframe srcdoc>` 真实渲染 |
388
+ | 纯文本 | `txt` / `rst` | `download_url` | `<pre>` |
389
+ | 图片 | `png` / `jpg` / `svg` | `preview_url` | `<img>` |
390
+ | 其余(含未知类型) | `pdf` / `docx` / `xlsx` | `preview_url` | iframe(一般为后台转好的 PDF) |
391
+
392
+ `type` 为扩展名字符串(大小写不敏感),缺省时回退文件名推断;`md` 与 `markdown` 等价。预览重载、重试与取链约定见 [FileArtifactPanel 预览机制](/components/message/file-artifact-panel#预览机制)。
389
393
 
390
394
  ```vue
391
395
  <template>
@@ -1,7 +1,7 @@
1
1
  <!-- AI SUMMARY -->
2
2
  ## 快速了解
3
3
 
4
- 汇总当前会话所有 AssistantMessage 的 artifacts(按 outputId 去重),支持关键词搜索、列表选中与下载; 预览区委托 ArtifactPreviewHost:按类型走 text_from_download(html / markdown / md / txt / json) preview_url_iframe(其余类型);download_url / preview_url 经 onArtifactClick 每次异步获取(无 URL 缓存,并发去重); 预览重载键为 outputId:type;重试再次调用 load() 重新取链。 源码位置:src/components/chat-message/assistant-message/message-artifacts/file-artifact-panel.vue。
4
+ 汇总当前会话所有 AssistantMessage 的 artifacts(按 outputId 去重),支持关键词搜索、列表选中与下载; 预览区委托 ArtifactPreviewHost:由 resolveFileKind 把扩展名归入 code / markdown / html / text / image / binary 六类, 前四类走 text_from_download 拉正文(code 交给 highlight.js 高亮),image / binary 走 preview_url; download_url / preview_url 经 onArtifactClick 每次异步获取(无 URL 缓存,并发去重); 预览重载键为 outputId:type;重试再次调用 load() 重新取链。 源码位置:src/components/chat-message/assistant-message/message-artifacts/file-artifact-panel.vue。
5
5
 
6
6
  ### 关联组件
7
7
  - **assistant-message** — 文件产物来源于 AssistantMessage.property.artifacts
@@ -183,16 +183,25 @@ sessionArtifacts 有产物时
183
183
 
184
184
  ## 预览机制
185
185
 
186
- 预览由内部 `getArtifactPreviewStrategy(type)` 决定 **加载方式** 与 **渲染器**;面板不直接写死类型分支。
186
+ 预览分两步:先由 `resolveFileKind(type, name)`(`src/utils/file-type.ts`)把扩展名归入六个**分类**,再由 `getArtifactPreviewStrategy` 查表得到 **加载方式** 与 **渲染器**。面板与 Host 都不写死具体扩展名分支,后台新增文件类型时只需在分类表里补一行。
187
187
 
188
- | 文件类型 | load | 取链字段 | renderer |
189
- | -------- | ---- | -------- | -------- |
190
- | `html` | `text_from_download` | `download_url` → `fetch` 正文 | `HtmlPreview`(`<iframe srcdoc>`) |
191
- | `markdown` / `md` | `text_from_download` | 同上 | `MarkdownPreview`(`MarkdownContent`) |
192
- | `txt` / `json` | `text_from_download` | 同上 | `TxtPreview`(`<pre>`) |
193
- | 其余(如 `pdf` / `jpg`) | `preview_url_iframe` | `preview_url` | `UrlIframePreview`(`<iframe src>`,一般为后台转好的 PDF) |
188
+ | 分类 | 覆盖扩展名 | load | 取链字段 | renderer |
189
+ | ---- | ---------- | ---- | -------- | -------- |
190
+ | `code` | `py` `js` `mjs` `cjs` `ts` `tsx` `jsx` `vue` `go` `rs` `rb` `java` `kt` `swift` `c` `h` `cpp` `hpp` `cs` `php` `lua` `r` `scala` `dart` `sh` `bash` `zsh` `ps1` `sql` `css` `scss` `less` `json` `jsonc` `yaml` `yml` `toml` `ini` `cfg` `conf` `env` `xml` `tex` `Dockerfile` `Makefile` `gitignore` `dockerignore` `editorconfig` | `text_from_download` | `download_url` → `fetch` 正文 | `CodePreview`(highlight.js 高亮) |
191
+ | `markdown` | `md` `markdown` | `text_from_download` | 同上 | `MarkdownPreview`(`MarkdownContent`) |
192
+ | `html` | `html` `htm` | `text_from_download` | 同上 | `HtmlPreview`(`<iframe srcdoc>`) |
193
+ | `text` | `txt` `rst` | `text_from_download` | 同上 | `TxtPreview`(`<pre>`) |
194
+ | `image` | `png` `jpg` `jpeg` `svg` | `preview_url` | `preview_url` | `ImagePreview`(`<img>`,`object-fit: contain`) |
195
+ | `binary` | `pdf` `docx` `xlsx` `xlsm` `xls` `pptx` `csv` `tsv`,以及**所有未登记的扩展名** | `preview_url` | `preview_url` | `UrlIframePreview`(`<iframe src>`,一般为后台转好的 PDF) |
194
196
 
195
- > `md`(`AIFileType.Md`)为后台扩展名别名,与 `markdown`(`AIFileType.Markdown`)等价,共用 Markdown 直渲染。
197
+ 关于类型解析:
198
+
199
+ - `AIFileInfo.type` 为**扩展名字符串**(如 `'pdf'` / `'py'`)或无扩展名的文件名(如 `'Dockerfile'`),大小写不敏感
200
+ - `type` 缺省时回退 `name` 推断;`报告.final.xlsx` 取 `xlsx`,`.gitignore` 取 `gitignore`
201
+ - `md` 为后台扩展名别名,与 `markdown` 等价,共用 Markdown 直渲染
202
+ - 未登记的扩展名一律落入 `binary` 走后台预览,前端不会因为新类型报错
203
+
204
+ `CodePreview` 的语言由扩展名映射到 highlight.js(`vue → xml`、`tsx → typescript`、`env / cfg / conf → ini` 等,其余交给 hljs 自身别名表,识别不了则按 `plaintext` 转义输出)。单文件超过 300KB 时跳过高亮直接转义,避免同步解析阻塞主线程。
196
205
 
197
206
  ### 加载态
198
207
 
@@ -219,15 +228,19 @@ message-artifacts/
219
228
  ├── file-artifact-panel.vue # 列表 + 下载头 + 挂载 Host
220
229
  └── artifact-preview/
221
230
  ├── artifact-preview-host.vue # 状态机 UI + 分派 renderer
222
- ├── preview-strategy.ts # getArtifactPreviewStrategy
231
+ ├── preview-strategy.ts # getArtifactPreviewStrategy(分类 → 策略查表)
223
232
  ├── use-artifact-preview-loader.ts
224
233
  └── renderers/
234
+ ├── code-preview.vue
225
235
  ├── html-preview.vue
236
+ ├── image-preview.vue
226
237
  ├── markdown-preview.vue
227
238
  ├── txt-preview.vue
228
239
  └── url-iframe-preview.vue
229
240
  ```
230
241
 
242
+ 分类表与扩展名归一化在 `src/utils/file-type.ts`(导出 `AIFileKind` / `resolveFileKind` / `normalizeFileExtension`),与[文件图标](/components/helper/file-icon)共用同一份解析入口。
243
+
231
244
  ## API
232
245
 
233
246
  ### Props
@@ -259,10 +272,13 @@ type AIFileInfo = {
259
272
  name: string;
260
273
  outputId: string;
261
274
  size: number;
262
- type: AIFileType;
275
+ /** 扩展名(如 'pdf' / 'py')或无扩展名文件名(如 'Dockerfile'),大小写不敏感 */
276
+ type: string;
263
277
  };
264
278
  ```
265
279
 
280
+ > **破坏性变更**:原 `AIFileType` 枚举已移除,`AIFileInfo.type` 改为 `string`。此前写 `type: AIFileType.Pdf` 的代码改为 `type: 'pdf'` 即可;枚举成员的值与新字符串一一对应,运行时数据无需迁移。
281
+
266
282
  ## 关联 Composable
267
283
 
268
284
  预览**命中与取链**由 [useArtifactPreview](/composables/use-artifact-preview) 提供(Provider / Consumer + `ARTIFACT_PREVIEW_TOKEN`)。**正文加载与渲染**由内部 `useArtifactPreviewLoader` + `ArtifactPreviewHost` 完成,不在该 composable 内。
@@ -0,0 +1,111 @@
1
+ <!-- AI SUMMARY -->
2
+ ## 快速了解
3
+
4
+ 按扩展名渲染文件类型图标:内联 svg,尺寸用 1em 跟随外层 font-size; 扩展名解析走 normalizeFileExtension(优先 fileType,缺省回退 fileName,大小写不敏感, 支持 Dockerfile / .gitignore 这类无扩展名或点号开头的文件);未登记类型返回 unknown 兜底图标。 源码位置:src/components/file-icon/file-icon.vue,图标注册表在 src/icons/file-icons.ts。
5
+
6
+ ### 关联组件
7
+ - **file-artifact-panel** — 文件产物列表与预览头使用该组件展示类型图标
8
+ - **assistant-message** — 消息内的文件产物卡片使用该组件
9
+
10
+ ---
11
+ <!-- FULL DOC -->
12
+
13
+ # FileIcon 文件类型图标
14
+
15
+ > **能力域**:辅助能力
16
+
17
+ `FileIcon` 按文件扩展名渲染对应的类型图标,用于文件列表、附件卡片、产物预览头等需要「一眼看出这是什么文件」的场景。图标以内联 svg 形式打进包内,不产生额外网络请求,也不需要消费方配置静态资源路径。
18
+
19
+ ## 源码事实
20
+
21
+ - **源码位置**:`src/components/file-icon/file-icon.vue`
22
+ - **图标注册表**:`src/icons/file-icons.ts`(导出 `getFileIconSvg` / `UNKNOWN_FILE_ICON_SVG`)
23
+ - **扩展名解析**:`src/utils/file-type.ts` 的 `normalizeFileExtension`
24
+
25
+ ## 核心能力
26
+
27
+ - **扩展名驱动**:优先取 `fileType`,缺省时回退 `fileName` 推断;大小写不敏感
28
+ - **特殊文件名**:`Dockerfile` / `Makefile` 这类无扩展名文件,以及 `.gitignore` / `.editorconfig` 这类点号开头的文件都能正确命中
29
+ - **多扩展名共用图标**:如 `xlsx` / `xls` / `csv` / `tsv` 共用表格图标,`tsx` / `jsx` 共用 React 图标
30
+ - **兜底不报错**:未登记的扩展名返回 `unknown` 图标,后台新增文件类型时前端不会缺图
31
+ - **尺寸自适应**:内部 svg 固定为 `1em`,直接用外层 `font-size` 控制大小
32
+
33
+ ## 基础用法
34
+
35
+ ```vue
36
+ <template>
37
+ <FileIcon file-type="pdf" />
38
+ </template>
39
+
40
+ <script setup lang="ts">
41
+ import { FileIcon } from '@blueking/chat-x';
42
+ </script>
43
+ ```
44
+
45
+ **渲染效果**
46
+
47
+ ## 从文件名推断
48
+
49
+ 后台未下发 `type` 时传 `fileName` 即可,组件会取最后一段扩展名:
50
+
51
+ ```vue
52
+ <template>
53
+ <!-- 取 xlsx -->
54
+ <FileIcon file-name="季度报告.final.xlsx" />
55
+ <!-- 取 gitignore -->
56
+ <FileIcon file-name=".gitignore" />
57
+ </template>
58
+ ```
59
+
60
+ 两者同时传入时以 `fileType` 优先。
61
+
62
+ ## 控制尺寸
63
+
64
+ 图标宽高为 `1em`,用外层 `font-size` 控制即可,无需改 svg:
65
+
66
+ ```vue
67
+ <template>
68
+ <span style="font-size: 16px"><FileIcon file-type="py" /></span>
69
+ <span style="font-size: 32px"><FileIcon file-type="py" /></span>
70
+ </template>
71
+ ```
72
+
73
+ ## API
74
+
75
+ ### Props
76
+
77
+ | 属性名 | 类型 | 必填 | 默认值 | 说明 |
78
+ | -------- | -------- | ---- | ----------- | -------------------------------------------------------- |
79
+ | fileType | `string` | 否 | `undefined` | 文件类型:扩展名(如 `pdf` / `py`)或无扩展名文件名(如 `Dockerfile`) |
80
+ | fileName | `string` | 否 | `undefined` | 文件名,`fileType` 缺省时用于推断扩展名 |
81
+
82
+ 两者都不传时渲染兜底图标。
83
+
84
+ ### Emits / Slots / Expose
85
+
86
+ - 无。
87
+
88
+ ## 图标覆盖范围
89
+
90
+ | 图标 | 覆盖扩展名 |
91
+ | ---- | ---------- |
92
+ | 文档类 | `pptx` / `docx` / `pdf` / `txt` / `rst` / `md` / `markdown` / `tex` |
93
+ | 表格类 | `xlsx` / `xlsm` / `xls` / `csv` / `tsv` |
94
+ | 前端 | `html` / `htm` / `css` / `scss` / `less` / `js` / `mjs` / `cjs` / `ts` / `tsx` / `jsx` / `vue` / `xml` |
95
+ | 后端 / 系统 | `py` / `go` / `rs` / `rb` / `java` / `kt` / `swift` / `c` / `h` / `cpp` / `hpp` / `cs` / `php` / `lua` / `r` / `scala` / `dart` / `sql` / `sh` / `bash` / `zsh` / `ps1` |
96
+ | 配置 | `json` / `jsonc` / `yaml` / `yml` / `toml` / `ini` / `cfg` / `conf` / `env` / `editorconfig` / `Makefile` |
97
+ | 工具链 | `Dockerfile` / `dockerignore` / `gitignore` |
98
+ | 图片 | `png` / `jpg` / `jpeg` / `svg` |
99
+ | 兜底 | 以上之外的所有类型 |
100
+
101
+ 新增类型时在 `src/icons/file-icons.ts` 的 `FILE_ICON_GROUPS` 里补一行即可;对应 svg 需先放进 `src/svgs/` 并按需 `?raw` 引入(只引实际用到的,避免把整个图标库打进产物)。
102
+
103
+ ## 使用建议
104
+
105
+ - 图标颜色由 svg 自带,不继承 `currentColor`,不要试图用 `color` 覆盖
106
+ - 需要与文件名同行展示时,给父容器设 `display: flex` + `gap`,组件本身已是 `inline-flex` 且 `flex-shrink: 0`
107
+
108
+ ## 关联组件
109
+
110
+ - [FileArtifactPanel](../message/file-artifact-panel.md) — 文件产物列表与预览头使用该组件。
111
+ - [AssistantMessage](../message/assistant-message.md) — 消息内文件产物卡片的图标来源。
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": "2.0.0",
3
- "generatedAt": "2026-08-11T09:05:16.821Z",
3
+ "generatedAt": "2026-08-13T08:24:18.572Z",
4
4
  "domains": {
5
5
  "setup": {
6
6
  "label": "对话搭建",
@@ -98,6 +98,7 @@
98
98
  "components": [
99
99
  "activity-layout",
100
100
  "ai-loading",
101
+ "file-icon",
101
102
  "highlight-keyword",
102
103
  "message-loading",
103
104
  "questions-container",
@@ -555,6 +556,25 @@
555
556
  "docFile": "docs/ai-loading.md",
556
557
  "domain": "helper"
557
558
  },
559
+ {
560
+ "name": "FileIcon 文件类型图标",
561
+ "slug": "file-icon",
562
+ "kind": "component",
563
+ "description": "按文件扩展名渲染对应类型图标,尺寸随外层 font-size 自适应。",
564
+ "aiSummary": "按扩展名渲染文件类型图标:内联 svg,尺寸用 1em 跟随外层 font-size; 扩展名解析走 normalizeFileExtension(优先 fileType,缺省回退 fileName,大小写不敏感, 支持 Dockerfile / .gitignore 这类无扩展名或点号开头的文件);未登记类型返回 unknown 兜底图标。 源码位置:src/components/file-icon/file-icon.vue,图标注册表在 src/icons/file-icons.ts。",
565
+ "relatedComponents": [
566
+ {
567
+ "slug": "file-artifact-panel",
568
+ "relation": "文件产物列表与预览头使用该组件展示类型图标"
569
+ },
570
+ {
571
+ "slug": "assistant-message",
572
+ "relation": "消息内的文件产物卡片使用该组件"
573
+ }
574
+ ],
575
+ "docFile": "docs/file-icon.md",
576
+ "domain": "helper"
577
+ },
558
578
  {
559
579
  "name": "HighlightKeyword 关键词高亮",
560
580
  "slug": "highlight-keyword",
@@ -1115,7 +1135,7 @@
1115
1135
  "slug": "file-artifact-panel",
1116
1136
  "kind": "component",
1117
1137
  "description": "汇总当前会话全部文件产物,支持搜索、选中与分类型预览,挂载在 ChatContainer 侧栏「文件产物」Tab。",
1118
- "aiSummary": "汇总当前会话所有 AssistantMessage 的 artifacts(按 outputId 去重),支持关键词搜索、列表选中与下载; 预览区委托 ArtifactPreviewHost:按类型走 text_from_download(html / markdown / md / txt / json) preview_url_iframe(其余类型);download_url / preview_url 经 onArtifactClick 每次异步获取(无 URL 缓存,并发去重); 预览重载键为 outputId:type;重试再次调用 load() 重新取链。 源码位置:src/components/chat-message/assistant-message/message-artifacts/file-artifact-panel.vue。",
1138
+ "aiSummary": "汇总当前会话所有 AssistantMessage 的 artifacts(按 outputId 去重),支持关键词搜索、列表选中与下载; 预览区委托 ArtifactPreviewHost:由 resolveFileKind 把扩展名归入 code / markdown / html / text / image / binary 六类, 前四类走 text_from_download 拉正文(code 交给 highlight.js 高亮),image / binary 走 preview_url; download_url / preview_url 经 onArtifactClick 每次异步获取(无 URL 缓存,并发去重); 预览重载键为 outputId:type;重试再次调用 load() 重新取链。 源码位置:src/components/chat-message/assistant-message/message-artifacts/file-artifact-panel.vue。",
1119
1139
  "relatedComponents": [
1120
1140
  {
1121
1141
  "slug": "assistant-message",
package/dist/mcp/index.js CHANGED
File without changes
@@ -0,0 +1,14 @@
1
+ /**
2
+ * 文件分类:图标兜底与预览渲染策略的共同依据。
3
+ * - code:可交给 highlight.js 渲染的源码 / 配置文件
4
+ * - text:纯文本,直接按原文展示
5
+ * - binary:无法在前端直接解析,统一交由后端 preview_url 预览
6
+ */
7
+ export type AIFileKind = 'binary' | 'code' | 'html' | 'image' | 'markdown' | 'text';
8
+ /**
9
+ * 归一化文件类型标识:优先取后台下发的 type,缺省时回退文件名。
10
+ * 统一转小写并截取最后一段扩展名;无扩展名的文件(Dockerfile / Makefile)直接返回文件名本身。
11
+ */
12
+ export declare const normalizeFileExtension: (type?: string, name?: string) => string;
13
+ /** 解析文件分类;未登记的扩展名按 binary 兜底 */
14
+ export declare const resolveFileKind: (type?: string, name?: string) => AIFileKind;
@@ -1,4 +1,5 @@
1
1
  export * from './file';
2
+ export * from './file-type';
2
3
  export * from './markdown-completer';
3
4
  export { completeMarkdownSyntax } from './stream-markdown-completer';
4
5
  export * from './utils';
package/package.json CHANGED
@@ -1,8 +1,26 @@
1
1
  {
2
2
  "name": "@blueking/chat-x",
3
- "version": "0.0.49-beta.7",
3
+ "version": "0.0.50",
4
4
  "description": "蓝鲸智云 AI Chat 组件库 —— 遵循 AG-UI,为 AI Agent 和人类开发者共同设计的对话 UI 组件库。",
5
5
  "main": "index.js",
6
+ "scripts": {
7
+ "prepublishOnly": "vite --config vite.config.ts build && pnpm dts && pnpm mcp:build",
8
+ "dev": "vite --config vite.config.ts",
9
+ "dts": "vue-tsc --project tsconfig.dts.json",
10
+ "build": "vitest && vite --config vite.config.ts build && pnpm dts",
11
+ "preview": "vite --config vite.config.ts build --mode preview && pnpm dts",
12
+ "lint:script": "eslint . --ext .vue,.ts --fix",
13
+ "lint:style": "stylelint \"**/*.{scss,css,vue}\" --fix",
14
+ "lint:all": "pnpm lint:script && pnpm lint:style",
15
+ "test": "vitest",
16
+ "test:coverage": "vitest run --coverage",
17
+ "wiki:dev": "vitepress dev wikis",
18
+ "wiki:build": "vitepress build wikis",
19
+ "mcp:build:index": "tsx mcp/scripts/build-index.ts",
20
+ "mcp:build": "tsc -p mcp/tsconfig.json && pnpm mcp:build:index",
21
+ "mcp:start": "node dist/mcp/index.js",
22
+ "mcp:dev": "tsx mcp/src/index.ts"
23
+ },
6
24
  "bin": {
7
25
  "chat-x-mcp": "dist/mcp/index.js"
8
26
  },
@@ -50,6 +68,7 @@
50
68
  "zod": "^4.3.6"
51
69
  },
52
70
  "devDependencies": {
71
+ "@blueking/chat-helper": "workspace:*",
53
72
  "@types/katex": "^0.16.7",
54
73
  "@types/lodash": "^4.17.23",
55
74
  "@types/markdown-it": "^14.1.2",
@@ -78,24 +97,6 @@
78
97
  "vite-bundle-analyzer": "^1.3.2",
79
98
  "vitepress": "2.0.0-alpha.16",
80
99
  "vitest": "^4.0.18",
81
- "vue-tsc": "^3.1.4",
82
- "@blueking/chat-helper": "0.0.12-beta.19"
83
- },
84
- "scripts": {
85
- "dev": "vite --config vite.config.ts",
86
- "dts": "vue-tsc --project tsconfig.dts.json",
87
- "build": "vitest && vite --config vite.config.ts build && pnpm dts",
88
- "preview": "vite --config vite.config.ts build --mode preview && pnpm dts",
89
- "lint:script": "eslint . --ext .vue,.ts --fix",
90
- "lint:style": "stylelint \"**/*.{scss,css,vue}\" --fix",
91
- "lint:all": "pnpm lint:script && pnpm lint:style",
92
- "test": "vitest",
93
- "test:coverage": "vitest run --coverage",
94
- "wiki:dev": "vitepress dev wikis",
95
- "wiki:build": "vitepress build wikis",
96
- "mcp:build:index": "tsx mcp/scripts/build-index.ts",
97
- "mcp:build": "tsc -p mcp/tsconfig.json && pnpm mcp:build:index",
98
- "mcp:start": "node dist/mcp/index.js",
99
- "mcp:dev": "tsx mcp/src/index.ts"
100
+ "vue-tsc": "^3.1.4"
100
101
  }
101
102
  }
@@ -1,29 +0,0 @@
1
- import { AIFileType } from '../../../../ag-ui/types/file';
2
- /** 文件类型 → 图标映射;未命中类型兜底用文本图标 */
3
- export declare const FILE_ICON_MAP: {
4
- readonly html: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
5
- [key: string]: any;
6
- }>;
7
- readonly jpg: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
8
- [key: string]: any;
9
- }>;
10
- readonly json: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
11
- [key: string]: any;
12
- }>;
13
- readonly md: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
14
- [key: string]: any;
15
- }>;
16
- readonly markdown: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
17
- [key: string]: any;
18
- }>;
19
- readonly pdf: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
20
- [key: string]: any;
21
- }>;
22
- readonly txt: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
23
- [key: string]: any;
24
- }>;
25
- };
26
- /** 图标为共享 VNode,克隆后再渲染,避免同类型多处复用同一实例 */
27
- export declare const getFileIcon: (type: AIFileType) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
28
- [key: string]: any;
29
- }>;