@blueking/chat-x 0.0.19 → 0.0.21

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 (27) hide show
  1. package/dist/components/ai-buttons/scroll-btn/scroll-btn.vue.d.ts +3 -3
  2. package/dist/components/ai-shortcut/shortcut-btn/shortcut-btn.vue.d.ts +2 -2
  3. package/dist/components/chat-content/activity-layout/activity-layout.vue.d.ts +2 -2
  4. package/dist/components/chat-content/content-render/content-render.vue.d.ts +7 -5
  5. package/dist/components/chat-input/chat-input.vue.d.ts +3 -3
  6. package/dist/components/chat-message/message-container/message-container.vue.d.ts +2 -2
  7. package/dist/components/image-preview/image-preview-group.vue.d.ts +2 -2
  8. package/dist/components/image-preview/image-preview.vue.d.ts +2 -2
  9. package/dist/components/image-preview/image.vue.d.ts +3 -3
  10. package/dist/components/image-preview/preview-toolbar.vue.d.ts +2 -2
  11. package/dist/components/message-loading/message-loading.vue.d.ts +2 -2
  12. package/dist/composables/use-custom-tab.d.ts +1 -0
  13. package/dist/index.css +1 -1
  14. package/dist/index.js +3436 -7286
  15. package/dist/index.js.map +1 -1
  16. package/dist/mcp/generated/docs/chat-container.md +1 -1
  17. package/dist/mcp/generated/docs/markdown-content.md +5 -0
  18. package/dist/mcp/generated/docs/use-custom-tab.md +5 -1
  19. package/dist/plugins/markdown-container.d.ts +25 -0
  20. package/dist/utils/tokens-to-vnodes.d.ts +8 -2
  21. package/package.json +9 -3
  22. package/dist/mcp/generated/docs/constants.md +0 -216
  23. package/dist/mcp/generated/docs/markdown-latex.md +0 -208
  24. package/dist/mcp/generated/docs/markdown-mermaid.md +0 -250
  25. package/dist/mcp/generated/docs/messages.md +0 -472
  26. package/dist/mcp/generated/docs/theme.md +0 -388
  27. package/dist/mcp/generated/index.json +0 -1279
@@ -1,1279 +0,0 @@
1
- {
2
- "version": "2.0.0",
3
- "generatedAt": "2026-04-09T03:21:33.152Z",
4
- "domains": {
5
- "message": {
6
- "label": "消息展示",
7
- "components": [
8
- "activity-message",
9
- "assistant-message",
10
- "info-message",
11
- "loading-message",
12
- "message-container",
13
- "message-render",
14
- "reasoning-message",
15
- "tool-message",
16
- "user-message"
17
- ]
18
- },
19
- "input": {
20
- "label": "输入交互",
21
- "components": [
22
- "shortcut-btn",
23
- "shortcut-btns",
24
- "ai-selection",
25
- "chat-container",
26
- "chat-input",
27
- "shortcut-render"
28
- ]
29
- },
30
- "content": {
31
- "label": "内容渲染",
32
- "components": [
33
- "animation-text",
34
- "code-content",
35
- "latex-content",
36
- "markdown-content",
37
- "mermaid-content",
38
- "content-render"
39
- ]
40
- },
41
- "media": {
42
- "label": "文件与图片",
43
- "components": [
44
- "ai-image",
45
- "file-upload-btn",
46
- "image-content",
47
- "file-content",
48
- "image-preview-group",
49
- "image-preview"
50
- ]
51
- },
52
- "tools": {
53
- "label": "工具与反馈",
54
- "components": [
55
- "tool-btn",
56
- "delete-tool",
57
- "message-tools",
58
- "toolcall-render",
59
- "user-feedback"
60
- ]
61
- },
62
- "helper": {
63
- "label": "辅助组件",
64
- "components": [
65
- "ai-loading",
66
- "cite-content",
67
- "common-error-content",
68
- "desc-panel",
69
- "highlight-keyword",
70
- "key-value-content",
71
- "reference-content",
72
- "scroll-btn",
73
- "selection-footer",
74
- "text-content",
75
- "execution-summary"
76
- ]
77
- }
78
- },
79
- "components": [
80
- {
81
- "name": "AiImage 图片展示",
82
- "slug": "ai-image",
83
- "category": "atomic",
84
- "description": "图片展示组件,支持加载状态、加载失败重试、懒加载、点击预览等功能。可独立使用(单图预览),也可配合 `ImagePreviewGroup` 实现多图预览。",
85
- "aiSummary": "AiImage 负责缩略图展示,并处理加载中、失败重试与懒加载;无 ImagePreviewGroup 上下文时可内嵌 ImagePreview 做全屏预览。 在 Group 内通过 inject 注册子图,点击时参与多图集合预览;支持自定义下载与 preview 事件。 与 ImagePreview、ImagePreviewGroup 共同构成对话内图片展示与预览链路。",
86
- "relatedComponents": [
87
- {
88
- "slug": "image-preview",
89
- "relation": "独立模式下内嵌全屏预览,单图预览入口"
90
- },
91
- {
92
- "slug": "image-preview-group",
93
- "relation": "组内注册子图并统一打开多图预览"
94
- }
95
- ],
96
- "docFile": "docs/ai-image.md",
97
- "domain": "media"
98
- },
99
- {
100
- "name": "AiLoading AI 加载动画",
101
- "slug": "ai-loading",
102
- "category": "atomic",
103
- "description": "AI 加载动画原子组件。由两层 SVG 叠加构成:外层旋转光环(带渐变弧线)+ 内层脉冲星形图标,两者共用同一套蓝→紫→粉渐变色。",
104
- "aiSummary": "AiLoading 使用纯 CSS/SVG 动画(旋转环与脉冲星形)展示加载中,不依赖 bkui Loading。 多实例时需用 cloneVNode 等为渐变 id 加前缀避免冲突;支持 stopLoading 暂停动画。",
105
- "relatedComponents": [
106
- {
107
- "slug": "loading-message",
108
- "relation": "列表末尾加载占位"
109
- },
110
- {
111
- "slug": "reasoning-message",
112
- "relation": "推理进行中的加载指示"
113
- },
114
- {
115
- "slug": "activity-message",
116
- "relation": "活动消息加载态指示"
117
- }
118
- ],
119
- "docFile": "docs/ai-loading.md",
120
- "domain": "helper"
121
- },
122
- {
123
- "name": "AnimationText 动画文本",
124
- "slug": "animation-text",
125
- "category": "atomic",
126
- "description": "动画文本原子组件,将文本以**淡入(fade-in)**方式渐显。内部由 `useAnimationText` composable 驱动,核心能力是将增量文本拆分为独立 chunk,每个 chunk 单独触发一次淡入动画,适用于流式文本的逐段渐显效果。",
127
- "aiSummary": "AnimationText 将文本拆成 chunk 并以淡入 keyframes 逐段显示,适合短文案一次性展示。 props.text 仅在挂载时参与动画;持续流式场景应直接使用 useAnimationText 或自行 watch Ref。 与 Markdown 流式渐显等场景可组合使用。",
128
- "relatedComponents": [
129
- {
130
- "slug": "use-animation-text",
131
- "relation": "提供 chunk 拆分与 animationStyle 的 composable"
132
- },
133
- {
134
- "slug": "markdown-content",
135
- "relation": "流式 Markdown 中可与渐显策略配合"
136
- }
137
- ],
138
- "docFile": "docs/animation-text.md",
139
- "domain": "content"
140
- },
141
- {
142
- "name": "CiteContent 引用内容",
143
- "slug": "cite-content",
144
- "category": "atomic",
145
- "description": "展示被引用文本片段的紧凑条带组件。固定高度 28px,左侧引用图标 + 单行截断文本 + 可选关闭图标,背景灰色(`#f5f7fa`)。",
146
- "aiSummary": "CiteContent 在输入区上方以紧凑条带展示被引用文本片段,单行截断并可选关闭按钮移除引用。 常与 ChatInput 的引用预览区配合,不执行 HTML 渲染。",
147
- "relatedComponents": [
148
- {
149
- "slug": "chat-input",
150
- "relation": "输入区展示待发送引用内容"
151
- }
152
- ],
153
- "docFile": "docs/cite-content.md",
154
- "domain": "helper"
155
- },
156
- {
157
- "name": "CodeContent 代码块渲染",
158
- "slug": "code-content",
159
- "category": "atomic",
160
- "description": "代码块渲染原子组件,专为 **Markdown 流式输出**设计。接收 `markdown-it` token 数组,基于 `highlight.js`(github-dark 主题)实现逐行语法高亮,顶部固定深色头部展示语言名和复制按钮。",
161
- "aiSummary": "CodeContent 接收 markdown-it 的 fence/code_block token,按行 highlight.js 高亮并带语言标签与复制。 必填 props 为 token 数组;mounted 事件用于滚动联动等。 由 MarkdownContent 在解析代码块时挂载,面向流式增量更新。",
162
- "relatedComponents": [
163
- {
164
- "slug": "markdown-content",
165
- "relation": "解析 Markdown 后生成 fence token 并渲染本组件"
166
- }
167
- ],
168
- "docFile": "docs/code-content.md",
169
- "domain": "content"
170
- },
171
- {
172
- "name": "CommonErrorContent 通用错误内容",
173
- "slug": "common-error-content",
174
- "category": "atomic",
175
- "description": "错误状态消息渲染原子组件。红色 `ErrorIcon`(14×14px,绝对定位)+ 文本区域,`display: flex` 水平排列。",
176
- "aiSummary": "CommonErrorContent 以红色错误图标加文案展示失败态,布局为 flex 横排,文本为纯文本插值。 在 MarkdownContent、ReasoningMessage 等链路上当 status 为 error 时自动替换内容区。",
177
- "relatedComponents": [
178
- {
179
- "slug": "markdown-content",
180
- "relation": "Markdown 渲染错误态展示"
181
- },
182
- {
183
- "slug": "reasoning-message",
184
- "relation": "推理消息错误态展示"
185
- }
186
- ],
187
- "docFile": "docs/common-error-content.md",
188
- "domain": "helper"
189
- },
190
- {
191
- "name": "DescPanel 描述面板",
192
- "slug": "desc-panel",
193
- "category": "atomic",
194
- "description": "工具调用(ToolCall)详情面板的描述区域组件,主要用于 `ToolcallRender` 内部的折叠面板中。",
195
- "aiSummary": "DescPanel 将描述字符串尝试 JSON 解析为键值列表展示,否则按纯文本输出,用于工具调用详情折叠区。 内部对键与值使用 HighlightKeyword 支持搜索高亮。",
196
- "relatedComponents": [
197
- {
198
- "slug": "toolcall-render",
199
- "relation": "工具调用详情中渲染描述与参数"
200
- },
201
- {
202
- "slug": "highlight-keyword",
203
- "relation": "键值与文本匹配关键词高亮"
204
- }
205
- ],
206
- "docFile": "docs/desc-panel.md",
207
- "domain": "helper"
208
- },
209
- {
210
- "name": "FileUploadBtn 文件上传按钮",
211
- "slug": "file-upload-btn",
212
- "category": "atomic",
213
- "description": "聊天输入框内置的文件上传触发按钮,点击后弹出系统文件选择框。内部包含隐藏的 `<input type=\"file\">` 与可见的图标按钮,并内置文件数量及大小校验逻辑。",
214
- "aiSummary": "FileUploadBtn 提供隐藏 file input 与图标按钮,选择文件后 emit upload,并内置数量与单文件大小上限校验。 常用于 ChatInput 工具条;与 FileContent 等展示列表配合形成「选择 → 展示 → 发送」链路。",
215
- "relatedComponents": [
216
- {
217
- "slug": "chat-input",
218
- "relation": "输入区附件上传按钮常见挂载位置"
219
- },
220
- {
221
- "slug": "file-content",
222
- "relation": "选中文件常以列表形式展示待发送内容"
223
- }
224
- ],
225
- "docFile": "docs/file-upload-btn.md",
226
- "domain": "media"
227
- },
228
- {
229
- "name": "HighlightKeyword 关键词高亮",
230
- "slug": "highlight-keyword",
231
- "category": "atomic",
232
- "description": "函数式组件,用于在文本中高亮匹配的搜索关键词。通过 `useKeywordInject` 从上层注入关键词,自动将匹配部分包裹在带高亮样式的 `<span>` 中。",
233
- "aiSummary": "HighlightKeyword 为函数式组件,从 inject 读取关键词并将匹配片段包在带样式 span 中,用于对话内搜索与列表过滤高亮。 ToolcallRender、DescPanel、FlowAgent 等场景组合使用。",
234
- "relatedComponents": [
235
- {
236
- "slug": "toolcall-render",
237
- "relation": "工具调用标题与状态文案高亮"
238
- },
239
- {
240
- "slug": "desc-panel",
241
- "relation": "工具详情键值与描述文本高亮"
242
- },
243
- {
244
- "slug": "execution-summary",
245
- "relation": "执行摘要搜索过滤与列表高亮"
246
- }
247
- ],
248
- "docFile": "docs/highlight-keyword.md",
249
- "domain": "helper"
250
- },
251
- {
252
- "name": "ImageContent 图片渲染",
253
- "slug": "image-content",
254
- "category": "atomic",
255
- "description": "Markdown Token 层的图片渲染原子组件,被 `MarkdownContent` 在解析到图片 token 时自动调用,通常无需手动引入。",
256
- "aiSummary": "ImageContent 在 Markdown 解析到图片 token 时渲染,对流式拼接中的 URL 做防抖与预加载,并用模块级缓存避免重复闪烁。 三态展示加载中、成功与失败,通常由 MarkdownContent 自动挂载而非业务直接引用。",
257
- "relatedComponents": [
258
- {
259
- "slug": "markdown-content",
260
- "relation": "解析图片 token 后挂载本组件"
261
- }
262
- ],
263
- "docFile": "docs/image-content.md",
264
- "domain": "media"
265
- },
266
- {
267
- "name": "KeyValueContent 键值对内容",
268
- "slug": "key-value-content",
269
- "category": "atomic",
270
- "description": "键值对列表展示原子组件,每行以 `key : value` 格式渲染一条数据,支持可选标题栏(带 `ThinkingIcon`)。",
271
- "aiSummary": "KeyValueContent 以多行 key : value 形式展示结构化数据,可选标题栏与 ThinkingIcon。 常见于用户消息等需要表格化键值的气泡展示。",
272
- "relatedComponents": [
273
- {
274
- "slug": "user-message",
275
- "relation": "用户消息内展示结构化附加信息"
276
- }
277
- ],
278
- "docFile": "docs/key-value-content.md",
279
- "domain": "helper"
280
- },
281
- {
282
- "name": "LatexContent LaTeX 公式渲染",
283
- "slug": "latex-content",
284
- "category": "atomic",
285
- "description": "Markdown Token 层的 LaTeX 公式渲染原子组件,基于 **KaTeX** 实现。被 `MarkdownContent` 在解析到数学公式 token 时自动调用,通常无需手动引入。",
286
- "aiSummary": "LatexContent 使用 KaTeX 渲染 math_block / math_inline 等 token,支持行内块级混排与流式防抖。 必填 props 为 token 数组;失败时静默降级展示原始 LaTeX 文本。 由 MarkdownContent 在数学插件解析后自动调用。",
287
- "relatedComponents": [
288
- {
289
- "slug": "markdown-content",
290
- "relation": "插件解析 $...$ / $$...$$ 后生成数学 token 并挂载本组件"
291
- }
292
- ],
293
- "docFile": "docs/latex-content.md",
294
- "domain": "content"
295
- },
296
- {
297
- "name": "MarkdownContent Markdown 内容渲染",
298
- "slug": "markdown-content",
299
- "category": "atomic",
300
- "description": "AI 消息内容渲染的核心原子组件,集成代码高亮、LaTeX 公式、Mermaid 图表等能力,内置流式渲染优化(5ms throttle + 语法补全 + 防闪烁)。",
301
- "aiSummary": "MarkdownContent 将 Markdown 字符串解析为 token 并渲染,集成代码块、公式、Mermaid 等子渲染器。 核心 props 为 content 与 status;内置流式节流、语法补全与 DOMPurify 安全策略。 通常由 ContentRender、AssistantMessage 等间接使用,无需业务直接挂载。",
302
- "relatedComponents": [
303
- {
304
- "slug": "code-content",
305
- "relation": "fence 代码块语法高亮与复制"
306
- },
307
- {
308
- "slug": "latex-content",
309
- "relation": "数学公式 token 的 KaTeX 渲染"
310
- },
311
- {
312
- "slug": "mermaid-content",
313
- "relation": "mermaid 代码块的图表渲染"
314
- },
315
- {
316
- "slug": "content-render",
317
- "relation": "上层按类型分发到本组件渲染 Markdown 字符串"
318
- }
319
- ],
320
- "docFile": "docs/markdown-content.md",
321
- "domain": "content"
322
- },
323
- {
324
- "name": "MermaidContent Mermaid 图表渲染",
325
- "slug": "mermaid-content",
326
- "category": "atomic",
327
- "description": "Markdown Token 层的 Mermaid 图表渲染原子组件,被 `MarkdownContent` 在检测到 mermaid fence token 时自动调用,通常无需手动引入。",
328
- "aiSummary": "MermaidContent 将 info 为 mermaid 的 fence token 渲染为 SVG,模块级懒加载单例 Mermaid。 具备流式 throttle、错误静默与 SVG ID 随机化,避免多实例冲突。 由 MarkdownContent 在解析 mermaid 代码块时调用。",
329
- "relatedComponents": [
330
- {
331
- "slug": "markdown-content",
332
- "relation": "解析 mermaid 类型 fence 代码块后传入 token"
333
- }
334
- ],
335
- "docFile": "docs/mermaid-content.md",
336
- "domain": "content"
337
- },
338
- {
339
- "name": "ReferenceContent 引用文档内容",
340
- "slug": "reference-content",
341
- "category": "atomic",
342
- "description": "引用文档列表渲染原子组件,用于展示 AI 回复中引用的参考文档,每项包含文档图标、标题、预览与跳转操作。",
343
- "aiSummary": "ReferenceContent 以列表形式展示 AI 回复引用的参考文档:图标、标题、摘要与外链跳转。 由 ContentRender、ActivityMessage 等按消息类型分发时挂载。",
344
- "relatedComponents": [
345
- {
346
- "slug": "content-render",
347
- "relation": "ReferenceDocument 类型内容路由到本组件"
348
- },
349
- {
350
- "slug": "activity-message",
351
- "relation": "知识库等活动场景内嵌引用列表"
352
- }
353
- ],
354
- "docFile": "docs/reference-content.md",
355
- "domain": "helper"
356
- },
357
- {
358
- "name": "ScrollBtn 滚动按钮",
359
- "slug": "scroll-btn",
360
- "category": "atomic",
361
- "description": "聊天容器底部浮动操作按钮的外壳组件,提供统一的胶囊样式(圆角 26px、高 24px、阴影),内容完全由插槽定制。",
362
- "aiSummary": "ScrollBtn 为底部浮动操作提供统一胶囊外壳(圆角、阴影),具体图标与行为由插槽与父级决定。 常由 MessageContainer 用于「返回底部」与「停止生成」等场景。",
363
- "relatedComponents": [
364
- {
365
- "slug": "message-container",
366
- "relation": "消息列表底部固定区挂载滚动与停止按钮"
367
- }
368
- ],
369
- "docFile": "docs/scroll-btn.md",
370
- "domain": "helper"
371
- },
372
- {
373
- "name": "SelectionFooter 选择操作栏",
374
- "slug": "selection-footer",
375
- "category": "atomic",
376
- "description": "消息多选模式下的底部操作栏,提供全选、取消和确认操作。由 `ChatContainer` 在分享模式下自动渲染,通常不需要单独使用。",
377
- "aiSummary": "SelectionFooter 为消息多选(如分享)提供底部操作栏:全选、取消与确认,并反映选中数量与 loading。 由 ChatContainer 在对应模式下自动挂载,业务一般无需单独引用。",
378
- "relatedComponents": [
379
- {
380
- "slug": "chat-container",
381
- "relation": "多选/分享模式由容器渲染底部栏"
382
- },
383
- {
384
- "slug": "message-container",
385
- "relation": "与消息列表勾选状态联动"
386
- }
387
- ],
388
- "docFile": "docs/selection-footer.md",
389
- "domain": "helper"
390
- },
391
- {
392
- "name": "ShortcutBtn 快捷指令按钮",
393
- "slug": "shortcut-btn",
394
- "category": "atomic",
395
- "description": "单个快捷指令的渲染单元,封装图标选择逻辑和两种布局模式(按钮 / 菜单项)。",
396
- "aiSummary": "ShortcutBtn 渲染单个快捷指令入口,封装图标解析与「按钮 / 下拉菜单项」两种布局,并暴露根元素供父级测量。 由 ShortcutBtns、AiSelection、ChatInput 内部复用;含 components 的快捷指令可无默认图标。 通过 click 事件传出当前 Shortcut,append 槽常用于关闭按钮。",
397
- "relatedComponents": [
398
- {
399
- "slug": "shortcut-btns",
400
- "relation": "快捷指令横向列表中作为单项渲染"
401
- },
402
- {
403
- "slug": "ai-selection",
404
- "relation": "划词浮窗内展示快捷操作按钮或溢出菜单项"
405
- },
406
- {
407
- "slug": "chat-input",
408
- "relation": "已选快捷指令在输入框底部以单按钮展示"
409
- }
410
- ],
411
- "docFile": "docs/shortcut-btn.md",
412
- "domain": "input"
413
- },
414
- {
415
- "name": "ShortcutBtns 快捷指令按钮组",
416
- "slug": "shortcut-btns",
417
- "category": "atomic",
418
- "description": "快捷指令按钮列表,内置**响应式溢出收起**:根据容器实际宽度动态计算可见数量,超出部分自动收入\"更多\"下拉菜单。",
419
- "aiSummary": "ShortcutBtns 横向展示快捷指令按钮组,按容器宽度动态计算可见数量,溢出收入「更多」下拉。 默认由 ChatInput 嵌入附件槽;选中含 components 的指令后需配合 ShortcutRender 展示表单。 通过 selectShortcut 等与外层同步当前快捷指令。",
420
- "relatedComponents": [
421
- {
422
- "slug": "shortcut-btn",
423
- "relation": "列表中每一项由 ShortcutBtn 渲染"
424
- },
425
- {
426
- "slug": "chat-input",
427
- "relation": "默认嵌入输入框底部附件区"
428
- },
429
- {
430
- "slug": "shortcut-render",
431
- "relation": "表单类快捷指令选中后的表单渲染"
432
- }
433
- ],
434
- "docFile": "docs/shortcut-btns.md",
435
- "domain": "input"
436
- },
437
- {
438
- "name": "TextContent 文本内容",
439
- "slug": "text-content",
440
- "category": "atomic",
441
- "description": "纯文本气泡组件,使用 Vue 文本插值渲染 `content`,天然防 XSS。",
442
- "aiSummary": "TextContent 用 Vue 文本插值渲染纯文本气泡,不解析 HTML,适合简单提示与用户/助手纯文案。 需要 Markdown、代码块或公式时应改用 MarkdownContent 等富文本组件。",
443
- "relatedComponents": [
444
- {
445
- "slug": "markdown-content",
446
- "relation": "需要富文本时的替代方案"
447
- },
448
- {
449
- "slug": "user-message",
450
- "relation": "用户消息中纯文本内容展示"
451
- }
452
- ],
453
- "docFile": "docs/text-content.md",
454
- "domain": "helper"
455
- },
456
- {
457
- "name": "ToolBtn 工具按钮",
458
- "slug": "tool-btn",
459
- "category": "atomic",
460
- "description": "消息工具栏中的单个操作按钮,内置 SVG 图标映射、Tippy 悬浮提示、激活态与禁用态,通常由 `MessageTools` 管理,一般不需要手动使用。",
461
- "aiSummary": "ToolBtn 为消息工具栏提供单个操作入口:内置常用 id 与 SVG 图标映射、Tippy 提示、激活与禁用态。 通常由 MessageTools 遍历配置渲染;DeleteTool 也可将其作为删除触发的视觉入口。",
462
- "relatedComponents": [
463
- {
464
- "slug": "message-tools",
465
- "relation": "父级组装多个工具按钮与交互"
466
- },
467
- {
468
- "slug": "delete-tool",
469
- "relation": "删除确认场景内嵌为触发控件"
470
- }
471
- ],
472
- "docFile": "docs/tool-btn.md",
473
- "domain": "tools"
474
- },
475
- {
476
- "name": "ActivityMessage 活动消息",
477
- "slug": "activity-message",
478
- "category": "molecular",
479
- "description": "活动消息组件,用于展示 AI 的知识检索(Knowledge RAG)过程、参考文档引用列表和 FlowAgent 流程执行情况。通过 `activityType` 切换三种工作模式,点击标题栏可折叠/展开内容区域。",
480
- "aiSummary": "ActivityMessage 展示活动类消息:知识检索(knowledge_rag)、引用文档列表、FlowAgent 执行(activityType 区分),标题可折叠。 content 结构随模式变化。由 MessageRender 在 activity 角色下渲染,用于 RAG/引用/流程执行过程可视化。",
481
- "relatedComponents": [
482
- {
483
- "slug": "message-render",
484
- "relation": "由 MessageRender 在 role 为 activity 时创建"
485
- },
486
- {
487
- "slug": "assistant-message",
488
- "relation": "常与助手回复相邻,描述检索或执行背景"
489
- }
490
- ],
491
- "docFile": "docs/activity-message.md",
492
- "domain": "message"
493
- },
494
- {
495
- "name": "AiSelection AI 划词选择弹窗",
496
- "slug": "ai-selection",
497
- "category": "molecular",
498
- "description": "AI 划词选择组件,监听用户在页面中的文本选区,在选区附近弹出快捷操作菜单。支持自定义快捷指令列表、数量限制、垂直偏移以及完全自定义插槽内容。",
499
- "aiSummary": "AiSelection 在 document 级监听文本选区,在选区附近弹出快捷操作菜单;每页建议只挂载一个实例。 通过 shortcuts、maxShortcutCount、offset 等配置菜单内容与布局,支持完全自定义 default 插槽与 Shadow DOM 场景。 常与 ChatInput 或业务侧联动,将选中文本作为追问上下文。",
500
- "relatedComponents": [
501
- {
502
- "slug": "shortcut-btn",
503
- "relation": "弹窗内快捷指令按钮/菜单项由该原子组件渲染"
504
- },
505
- {
506
- "slug": "chat-input",
507
- "relation": "划词结果常回填或触发与输入框联动的快捷指令"
508
- }
509
- ],
510
- "docFile": "docs/ai-selection.md",
511
- "domain": "input"
512
- },
513
- {
514
- "name": "AssistantMessage AI 助手消息",
515
- "slug": "assistant-message",
516
- "category": "molecular",
517
- "description": "AI 助手消息展示组件,负责渲染 AI 回复的文本内容和工具调用(Tool Calls)结果。",
518
- "aiSummary": "AssistantMessage 渲染 AI 助手回复:正文由 ContentRender(可被默认插槽替换)与 ToolCallRender 展示工具调用及 MCP 标记。 toolCalls[].toolMessage 可内联工具执行结果。用于 MessageRender 分发的 assistant 角色,流式场景配合 streaming 状态更新。",
519
- "relatedComponents": [
520
- {
521
- "slug": "message-render",
522
- "relation": "由 MessageRender 在 role 为 assistant 时创建"
523
- },
524
- {
525
- "slug": "tool-message",
526
- "relation": "工具结果通过 toolCall.toolMessage 内联或独立 tool 消息关联展示"
527
- },
528
- {
529
- "slug": "toolcall-render",
530
- "relation": "多条工具调用由 ToolcallRender 统一渲染"
531
- }
532
- ],
533
- "docFile": "docs/assistant-message.md",
534
- "domain": "message"
535
- },
536
- {
537
- "name": "ChatContainer 聊天容器",
538
- "slug": "chat-container",
539
- "category": "molecular",
540
- "description": "顶层聊天容器组件,整合了 `MessageContainer`(消息列表)、`ChatInput`(输入框)、`ExecutionSummary`(执行摘要面板)、`ShortcutRender`(快捷指令表单)和 `SelectionFooter`(多选操作栏)。提供完整的 AI 对话界面布局能力。",
541
- "aiSummary": "ChatContainer 提供完整 AI 对话布局:分栏(ResizeLayout)、消息列表(MessageContainer)、输入(ChatInput)、执行摘要(ExecutionSummary)、快捷表单(ShortcutRender)与多选栏(SelectionFooter)。 内置 useMessageGroup、分享与自定义 Tab 等能力,适合一站式接入。 通过 props 传入 messages、shortcuts 等,事件与 ChatInput/MessageContainer 对齐。",
542
- "relatedComponents": [
543
- {
544
- "slug": "message-container",
545
- "relation": "消息列表与滚动区域"
546
- },
547
- {
548
- "slug": "chat-input",
549
- "relation": "对话输入与快捷指令入口"
550
- },
551
- {
552
- "slug": "shortcut-render",
553
- "relation": "快捷指令表单浮层"
554
- },
555
- {
556
- "slug": "execution-summary",
557
- "relation": "执行摘要侧栏与定位"
558
- },
559
- {
560
- "slug": "selection-footer",
561
- "relation": "多选分享底部操作栏"
562
- }
563
- ],
564
- "docFile": "docs/chat-container.md",
565
- "domain": "input"
566
- },
567
- {
568
- "name": "ChatInput 聊天输入框",
569
- "slug": "chat-input",
570
- "category": "molecular",
571
- "description": "聊天消息输入框组件,支持快捷指令选择、资源 `@` 引用、Prompt `/` 模板、消息引用、文件上传(拖拽/粘贴/点击)等功能。",
572
- "aiSummary": "ChatInput 是聊天主输入区,集成富文本编辑(/ 提示词模板、@ 资源引用)、消息引用、附件上传与快捷指令入口。 通过 prompts、resources、shortcuts 等 props 配置能力,配合 messageStatus 控制发送、流式与停止。 内部组合 ShortcutBtns、FileUploadBtn 等,与 ShortcutRender 联动完成含表单的快捷指令流程。",
573
- "relatedComponents": [
574
- {
575
- "slug": "shortcut-btns",
576
- "relation": "底部附件区默认展示的快捷指令列表"
577
- },
578
- {
579
- "slug": "shortcut-btn",
580
- "relation": "已选快捷指令以单按钮形式展示并可关闭"
581
- },
582
- {
583
- "slug": "shortcut-render",
584
- "relation": "快捷指令含 components 时由外层唤起表单渲染"
585
- },
586
- {
587
- "slug": "chat-container",
588
- "relation": "顶层聊天布局中作为输入区子组件"
589
- },
590
- {
591
- "slug": "cite-content",
592
- "relation": "消息引用区展示选中的上下文片段"
593
- }
594
- ],
595
- "docFile": "docs/chat-input.md",
596
- "domain": "input"
597
- },
598
- {
599
- "name": "ContentRender 内容渲染器",
600
- "slug": "content-render",
601
- "category": "molecular",
602
- "description": "消息内容渲染分发组件,根据 `content` 的 JavaScript 类型自动选择渲染方式:字符串 → `MarkdownContent`(Markdown 渲染),数组 → `ReferenceContent`(引用列表)。",
603
- "aiSummary": "ContentRender 按消息 content 类型分发:字符串走 Markdown 管线,数组可走引用文档等;可扩展自定义 slot。 主要 props 为 content、status,与 MessageRender、AssistantMessage 等配合使用。 内置与 MarkdownContent、ReferenceContent 等原子/分子组件衔接。",
604
- "relatedComponents": [
605
- {
606
- "slug": "markdown-content",
607
- "relation": "文本类 Markdown 正文的默认渲染实现"
608
- },
609
- {
610
- "slug": "reference-content",
611
- "relation": "引用文档数组类型的列表渲染"
612
- },
613
- {
614
- "slug": "assistant-message",
615
- "relation": "AI 回复中默认通过本组件渲染正文"
616
- }
617
- ],
618
- "docFile": "docs/content-render.md",
619
- "domain": "content"
620
- },
621
- {
622
- "name": "DeleteTool 删除确认按钮",
623
- "slug": "delete-tool",
624
- "category": "molecular",
625
- "description": "删除操作的二次确认组件。点击删除图标后弹出确认弹窗,用户需再次点击\"删除\"按钮才会触发 `confirm` 事件,防止误删。内部由 `ToolBtn`(触发按钮)+ `Tippy`(确认弹窗)组合实现。",
626
- "aiSummary": "DeleteTool 在点击删除图标后弹出 Tippy 确认层,需再次点击「删除」才 emit confirm,避免误删。 触发器为 ToolBtn;MessageTools 在工具 id 为 delete 时用本组件替换普通 ToolBtn。",
627
- "relatedComponents": [
628
- {
629
- "slug": "tool-btn",
630
- "relation": "删除图标与触发入口"
631
- },
632
- {
633
- "slug": "message-tools",
634
- "relation": "delete 工具 id 时自动采用本组件"
635
- }
636
- ],
637
- "docFile": "docs/delete-tool.md",
638
- "domain": "tools"
639
- },
640
- {
641
- "name": "ExecutionSummary 执行摘要",
642
- "slug": "execution-summary",
643
- "category": "molecular",
644
- "description": "执行摘要面板组件,以时间线形式展示对话中的工具调用和 FlowAgent 活动记录。支持关键词搜索过滤和点击定位到对话中的消息位置。",
645
- "aiSummary": "ExecutionSummary 以时间线汇总工具调用与 FlowAgent 等活动记录,支持关键词过滤与 HighlightKeyword 高亮。 点击可 emit 定位到会话中对应消息;内部用 MessageRender 渲染摘要条目中的消息片段。",
646
- "relatedComponents": [
647
- {
648
- "slug": "message-render",
649
- "relation": "摘要列表内渲染消息内容"
650
- },
651
- {
652
- "slug": "highlight-keyword",
653
- "relation": "搜索关键词注入与高亮"
654
- },
655
- {
656
- "slug": "chat-container",
657
- "relation": "常与侧栏「执行情况」Tab 组合"
658
- }
659
- ],
660
- "docFile": "docs/execution-summary.md",
661
- "domain": "helper"
662
- },
663
- {
664
- "name": "FileContent 文件内容展示",
665
- "slug": "file-content",
666
- "category": "molecular",
667
- "description": "文件列表展示组件,支持图片缩略图预览、点击图片全屏预览(`ImagePreview`)、文档卡片展示(文件名/扩展名/文件大小)、图片加载失败占位和删除操作。",
668
- "aiSummary": "FileContent 展示消息或输入区附件列表:图片显示缩略图并可进入 ImagePreview,文档以卡片展示文件名、类型与大小。 支持删除、图片加载失败占位及仅有远端文件名的降级展示。",
669
- "relatedComponents": [
670
- {
671
- "slug": "image-preview",
672
- "relation": "点击图片缩略图打开全屏预览"
673
- },
674
- {
675
- "slug": "user-message",
676
- "relation": "用户消息只读展示附件列表"
677
- }
678
- ],
679
- "docFile": "docs/file-content.md",
680
- "domain": "media"
681
- },
682
- {
683
- "name": "ImagePreviewGroup 图片预览组",
684
- "slug": "image-preview-group",
685
- "category": "molecular",
686
- "description": "多图预览管理容器。通过 `provide/inject` + `Map<symbol>` 模式管理子级 `AiImage` 的注册与预览状态,点击任意子图片时自动收集所有已注册图片并打开多图预览。",
687
- "aiSummary": "ImagePreviewGroup 通过 provide/inject 与子级 symbol 注册表管理多个 AiImage,点击任一子图时聚合已注册图片并打开内置全屏预览。 解决同屏多缩略图统一多图浏览与索引切换的需求。",
688
- "relatedComponents": [
689
- {
690
- "slug": "ai-image",
691
- "relation": "子级注册并参与多图预览集合"
692
- },
693
- {
694
- "slug": "image-preview",
695
- "relation": "内置实例承载多图切换与工具栏"
696
- }
697
- ],
698
- "docFile": "docs/image-preview-group.md",
699
- "domain": "media"
700
- },
701
- {
702
- "name": "ImagePreview 图片预览",
703
- "slug": "image-preview",
704
- "category": "molecular",
705
- "description": "全屏图片预览组件,通过 `Teleport` 渲染到 `body`,支持缩放、旋转、拖拽、下载、键盘导航等功能。`images` 支持传入 URL 字符串、`ImageItem` 对象或 `File` 对象,File 对象会自动通过 `URL.createObjectURL` 生成预览并在关闭/卸载时回收。通常不直接使用,而是配合 `AiImage`、`ImagePreviewGroup` 或 `FileContent` 自动触发。",
706
- "aiSummary": "ImagePreview 通过 Teleport 提供全屏图片预览,支持缩放、旋转、拖拽、下载、键盘与多图切换。 数据源可为 URL 字符串、ImageItem 或 File(自动 ObjectURL 并在关闭时回收)。 通常由 AiImage、ImagePreviewGroup、FileContent 等触发,业务较少直接单独挂载。",
707
- "relatedComponents": [
708
- {
709
- "slug": "ai-image",
710
- "relation": "独立模式下由 AiImage 打开预览"
711
- },
712
- {
713
- "slug": "image-preview-group",
714
- "relation": "组内容器内持有一个实例做多图切换"
715
- },
716
- {
717
- "slug": "file-content",
718
- "relation": "文件列表点击缩略图触发预览"
719
- }
720
- ],
721
- "docFile": "docs/image-preview.md",
722
- "domain": "media"
723
- },
724
- {
725
- "name": "InfoMessage 信息消息",
726
- "slug": "info-message",
727
- "category": "molecular",
728
- "description": "系统信息分隔组件,在聊天消息列表中以**居中虚线分隔条**的形式展示非对话类信息(会话重置、时间节点、状态变更等)。",
729
- "aiSummary": "InfoMessage 以居中虚线分隔条展示系统提示、会话重置、时间戳等非对话信息;content 可为字符串或字符串数组。 由 MessageRender 在 info 角色下渲染,不承载用户与助手轮次内容。",
730
- "relatedComponents": [
731
- {
732
- "slug": "message-render",
733
- "relation": "由 MessageRender 在 role 为 info 时创建"
734
- },
735
- {
736
- "slug": "message-container",
737
- "relation": "嵌入消息列表时由 MessageContainer 统一布局与滚动"
738
- }
739
- ],
740
- "docFile": "docs/info-message.md",
741
- "domain": "message"
742
- },
743
- {
744
- "name": "LoadingMessage 加载中消息",
745
- "slug": "loading-message",
746
- "category": "molecular",
747
- "description": "加载等待状态组件,展示 AI 正在处理请求时的过渡动画。由旋转渐变环 + 脉冲星形图标(蓝→紫→粉渐变)和\"请求中...\"文案组成。支持通过默认插槽自定义加载文案。",
748
- "aiSummary": "LoadingMessage 展示等待 AI 响应的加载动画(内部 AiLoading),无必填 Props,默认插槽可自定义「请求中」文案。 典型用法是由 MessageContainer 在末尾为用户消息时自动注入 Loading 组;也可在自定义布局中手动放置。",
749
- "relatedComponents": [
750
- {
751
- "slug": "message-container",
752
- "relation": "在消息列表末尾自动追加 Loading 消息组"
753
- },
754
- {
755
- "slug": "message-render",
756
- "relation": "role 为 loading 时由 MessageRender 渲染"
757
- },
758
- {
759
- "slug": "ai-loading",
760
- "relation": "内部使用 AiLoading 原子组件"
761
- }
762
- ],
763
- "docFile": "docs/loading-message.md",
764
- "domain": "message"
765
- },
766
- {
767
- "name": "MessageContainer 消息容器",
768
- "slug": "message-container",
769
- "category": "molecular",
770
- "description": "消息列表容器组件,负责将原始的 `Message[]` 数组渲染为结构化的对话界面。核心能力:",
771
- "aiSummary": "MessageContainer 是消息列表的核心容器。接收父组件用 useMessageGroup 生成的 messageGroups 与 messageStatus, 内部通过 MessageRender 按组渲染消息。支持流式停止、自动滚动与返回底部、多选与工具栏,需配置 onAgentAction 处理复制/重试等;点赞点踩通过 onAgentFeedback 回传原因。通常与 ChatInput 组合成完整对话区。",
772
- "relatedComponents": [
773
- {
774
- "slug": "message-render",
775
- "relation": "按组渲染每条消息时委托 MessageRender"
776
- },
777
- {
778
- "slug": "chat-input",
779
- "relation": "常与 ChatInput 组合构成完整对话界面"
780
- },
781
- {
782
- "slug": "loading-message",
783
- "relation": "末尾为用户消息时自动追加 Loading 消息组"
784
- }
785
- ],
786
- "docFile": "docs/message-container.md",
787
- "domain": "message"
788
- },
789
- {
790
- "name": "MessageRender 消息渲染器",
791
- "slug": "message-render",
792
- "category": "molecular",
793
- "description": "统一的消息渲染入口,通过 `message.role` 字段自动派发到对应的子组件。整个渲染过程由一个 `computed` 属性完成,无额外状态。",
794
- "aiSummary": "MessageRender 是单条消息的渲染入口,根据 message.role 派发到 UserMessage、AssistantMessage、ReasoningMessage、 ToolMessage、ActivityMessage、InfoMessage、LoadingMessage 等。Assistant 默认通过插槽用 ContentRender 渲染正文,可被默认插槽覆盖。 无独立状态,通常由 MessageContainer 内部调用而非业务直接挂载。",
795
- "relatedComponents": [
796
- {
797
- "slug": "message-container",
798
- "relation": "在 MessageContainer 中按组调用以渲染每条消息"
799
- },
800
- {
801
- "slug": "assistant-message",
802
- "relation": "role 为 assistant 时渲染 AI 回复与工具调用"
803
- },
804
- {
805
- "slug": "user-message",
806
- "relation": "role 为 user 时渲染用户消息"
807
- }
808
- ],
809
- "docFile": "docs/message-render.md",
810
- "domain": "message"
811
- },
812
- {
813
- "name": "MessageTools 消息工具栏",
814
- "slug": "message-tools",
815
- "category": "molecular",
816
- "description": "AI 消息的操作工具栏组件,由**左侧消息工具区**和**右侧更新工具区**两部分组成,中间以分隔线分隔。仅 `like` / `unlike` 按钮会弹出反馈表单(`UserFeedback`),其余按钮直接触发 `onAction`。",
817
- "aiSummary": "MessageTools 渲染 AI 消息底部工具区:左侧消息工具(复制、引用、重建等),右侧更新工具;点赞/踩会弹出 UserFeedback 收集原因。 工具 id 为 delete 时用 DeleteTool 替代普通 ToolBtn 做二次确认;其余操作通过 onAction 异步解析或直出。",
818
- "relatedComponents": [
819
- {
820
- "slug": "tool-btn",
821
- "relation": "普通工具项由 ToolBtn 渲染"
822
- },
823
- {
824
- "slug": "user-feedback",
825
- "relation": "like/unlike 时弹出反馈表单"
826
- },
827
- {
828
- "slug": "delete-tool",
829
- "relation": "id 为 delete 时替换为带确认的删除按钮"
830
- }
831
- ],
832
- "docFile": "docs/message-tools.md",
833
- "domain": "tools"
834
- },
835
- {
836
- "name": "ReasoningMessage 推理消息",
837
- "slug": "reasoning-message",
838
- "category": "molecular",
839
- "description": "AI 思维链(Chain-of-Thought)推理过程展示组件。由**可点击标题栏**和**内容区域**组成,内容区支持 Markdown 渲染。`duration` 传入后自动折叠一次,用户可随时点击标题展开/收起。",
840
- "aiSummary": "ReasoningMessage 展示 AI 思维链(Chain-of-Thought)推理过程,含可折叠标题与 Markdown 内容区;可传入 duration 并在结束后自动折叠。 content 为字符串数组(或兼容字符串)。由 MessageRender 在 reasoning 角色下使用,常出现在用户消息与正式回答之间。",
841
- "relatedComponents": [
842
- {
843
- "slug": "message-render",
844
- "relation": "由 MessageRender 在 role 为 reasoning 时创建"
845
- },
846
- {
847
- "slug": "assistant-message",
848
- "relation": "推理结束后通常紧跟 Assistant 的正式回复"
849
- },
850
- {
851
- "slug": "markdown-content",
852
- "relation": "内容区通过 Markdown 渲染推理文本"
853
- }
854
- ],
855
- "docFile": "docs/reasoning-message.md",
856
- "domain": "message"
857
- },
858
- {
859
- "name": "ShortcutRender 快捷指令渲染器",
860
- "slug": "shortcut-render",
861
- "category": "molecular",
862
- "description": "快捷指令表单渲染组件,将 `Shortcut.components` 配置自动渲染为可交互表单(基于 bkui-vue 的 `Form`),支持 8 种控件类型、两列网格布局、必填校验和内置提交/取消操作。",
863
- "aiSummary": "ShortcutRender 将 Shortcut.components 声明渲染为 bkui-vue Form,支持多种控件与两列网格、必填校验及提交/取消。 通常由 ChatContainer 等布局挂载在输入区旁,formModel 与快捷指令回填联动。 与 Shortcut、ShortcutBtn 等共享同一套快捷指令数据模型。",
864
- "relatedComponents": [
865
- {
866
- "slug": "shortcut-btn",
867
- "relation": "与快捷指令 Shortcut 元数据一致,表单提交前在列表中选中入口"
868
- },
869
- {
870
- "slug": "chat-input",
871
- "relation": "提交或取消后与输入框内容与状态联动"
872
- },
873
- {
874
- "slug": "chat-container",
875
- "relation": "顶层聊天布局中承载快捷表单区域"
876
- }
877
- ],
878
- "docFile": "docs/shortcut-render.md",
879
- "domain": "input"
880
- },
881
- {
882
- "name": "ToolMessage 工具消息",
883
- "slug": "tool-message",
884
- "category": "molecular",
885
- "description": "工具(Function Call)执行结果展示组件。内部通过 `DescPanel` 渲染,标题固定为\"返回内容\",支持将 JSON 自动解析为 key-value 列表。",
886
- "aiSummary": "ToolMessage 展示工具(Function Call)执行返回,内部用 DescPanel 将 JSON 解析为 key-value 或纯文本。通常不单独使用: ToolcallRender 在 toolCall.toolMessage 有值时内联渲染;独立 role 为 tool 的消息由 MessageRender 统一渲染。核心关注 content 与 error。",
887
- "relatedComponents": [
888
- {
889
- "slug": "assistant-message",
890
- "relation": "结果常作为 assistant 消息中 toolCall.toolMessage 内联展示"
891
- },
892
- {
893
- "slug": "message-render",
894
- "relation": "独立 tool 角色消息由 MessageRender 渲染为 ToolMessage"
895
- },
896
- {
897
- "slug": "desc-panel",
898
- "relation": "内部使用 DescPanel 展示「返回内容」"
899
- }
900
- ],
901
- "docFile": "docs/tool-message.md",
902
- "domain": "message"
903
- },
904
- {
905
- "name": "ToolcallRender 工具调用渲染器",
906
- "slug": "toolcall-render",
907
- "category": "molecular",
908
- "description": "展示 AI 调用外部工具/函数过程与结果的渲染组件。由**可折叠头部**和**详情面板**组成,根据 `status` 自动切换颜色和状态文案,支持 MCP 调用识别和内联结果展示。",
909
- "aiSummary": "ToolcallRender 折叠展示一次工具/MCP 调用:头部显示名称、状态色、耗时与 MCP 标识,展开区展示参数与返回。 内部组合 DescPanel 与 HighlightKeyword;可在详情底部内联 ToolMessage 结果。",
910
- "relatedComponents": [
911
- {
912
- "slug": "desc-panel",
913
- "relation": "详情区展示参数与描述文本"
914
- },
915
- {
916
- "slug": "highlight-keyword",
917
- "relation": "标题与状态文案关键词高亮"
918
- },
919
- {
920
- "slug": "tool-message",
921
- "relation": "详情底部可内联工具返回消息"
922
- }
923
- ],
924
- "docFile": "docs/toolcall-render.md",
925
- "domain": "tools"
926
- },
927
- {
928
- "name": "MessageUserFeedback 用户反馈",
929
- "slug": "user-feedback",
930
- "category": "molecular",
931
- "description": "AI 消息点赞/踩后收集用户具体反馈原因的弹出面板。支持多选预设原因标签、补充文字说明(textarea)、异步加载原因列表(骨架屏)。",
932
- "aiSummary": "UserFeedback 在点赞或踩之后展示原因收集面板:多选预设标签、补充说明与异步加载原因列表(骨架屏)。 由 MessageTools 在 like/unlike 流程中挂载,提交后向父级回传原因列表与备注。",
933
- "relatedComponents": [
934
- {
935
- "slug": "message-tools",
936
- "relation": "点赞/踩操作触发并收集反馈"
937
- }
938
- ],
939
- "docFile": "docs/user-feedback.md",
940
- "domain": "tools"
941
- },
942
- {
943
- "name": "UserMessage 用户消息",
944
- "slug": "user-message",
945
- "category": "molecular",
946
- "description": "用户消息展示组件,右对齐显示用户发送的消息内容。支持纯文本、多媒体(图片/文件)、文本引用、结构化引用、快捷指令等多种内容形式,以及消息的内联编辑功能。",
947
- "aiSummary": "UserMessage 渲染右对齐用户消息,支持文本、附件、文本/结构化引用、快捷指令与内联编辑。需处理 onAction、onInputConfirm、 onShortcutConfirm 等回调;messageToolsStatus 控制工具栏。由 MessageRender 在 user 角色下使用,常与多选联动。",
948
- "relatedComponents": [
949
- {
950
- "slug": "message-render",
951
- "relation": "由 MessageRender 在 role 为 user 时创建"
952
- },
953
- {
954
- "slug": "message-tools",
955
- "relation": "消息工具栏交互与状态由 MessageTools 体系承载"
956
- },
957
- {
958
- "slug": "message-container",
959
- "relation": "嵌入列表时由 MessageContainer 管理分组与多选"
960
- }
961
- ],
962
- "docFile": "docs/user-message.md",
963
- "domain": "message"
964
- }
965
- ],
966
- "composables": [
967
- {
968
- "name": "useAnimationText",
969
- "slug": "use-animation-text",
970
- "category": "composable",
971
- "description": "文本淡入动画的组合式函数。将响应式文本按**增量**拆分为独立 chunk,每个新增 chunk 对应一次淡入动画,适用于 AI 流式输出的逐段渐显效果。",
972
- "aiSummary": "useAnimationText 接收 MaybeRef<string> 与可选 AnimationConfig(fadeDuration、easing),返回 chunks 与 animationStyle。 监听文本变化:前缀追加则增量拆分为新 chunk 并触发动画,否则重置为单 chunk,适合流式输出逐段淡入。 全局样式已含 ai-markdown-fade-in。AnimationText 原子组件内部封装同一逻辑。",
973
- "relatedComponents": [
974
- {
975
- "slug": "animation-text",
976
- "relation": "封装 chunks 与样式渲染"
977
- },
978
- {
979
- "slug": "markdown-content",
980
- "relation": "流式 Markdown 文本展示场景可组合使用"
981
- }
982
- ],
983
- "docFile": "docs/use-animation-text.md"
984
- },
985
- {
986
- "name": "useClipboard",
987
- "slug": "use-clipboard",
988
- "category": "composable",
989
- "description": "复制文本到剪贴板的组合式函数。内置两级降级策略,并自动通过 bkui-vue `Message` 提示复制结果,调用方无需关心成功/失败处理。",
990
- "aiSummary": "useClipboard 返回 { copy },copy(text) 将字符串写入剪贴板,返回 Promise<void>。 优先使用 navigator.clipboard.writeText,失败或不支持时降级为隐藏 textarea + execCommand('copy')。 成功/失败均通过 bkui-vue Message 提示,调用方无需处理结果。CodeContent、MessageContainer、UserMessage 的复制能力内部使用。",
991
- "relatedComponents": [
992
- {
993
- "slug": "code-content",
994
- "relation": "复制代码块时取 innerText 后调用 copy"
995
- },
996
- {
997
- "slug": "message-container",
998
- "relation": "AI 消息复制工具回调"
999
- },
1000
- {
1001
- "slug": "user-message",
1002
- "relation": "用户消息复制工具回调"
1003
- }
1004
- ],
1005
- "docFile": "docs/use-clipboard.md"
1006
- },
1007
- {
1008
- "name": "useCommandSelection",
1009
- "slug": "use-command-selection",
1010
- "category": "composable",
1011
- "description": "为 `edix` 富文本编辑器提供光标位置追踪能力的组合式函数。内部封装一个 `EditorCommand`,由编辑器调用后将光标的行列信息存入响应式变量,供后续编辑命令(如插入 tag、删除关键词)精确定位。",
1012
- "aiSummary": "useCommandSelection 无参数,返回 commandSelection(ShallowRef 行列)与 GetCursorPosition(edix EditorCommand)。 在 editor.command(GetCursorPosition) 时把焦点端写入 commandSelection,供后续 DeleteTag、InsertTag 等命令计算范围。 仅在 AiSlashInput(@ 菜单插入)内部使用。",
1013
- "relatedComponents": [
1014
- {
1015
- "slug": "chat-input",
1016
- "relation": "AiSlashInput 内部使用"
1017
- }
1018
- ],
1019
- "docFile": "docs/use-command-selection.md"
1020
- },
1021
- {
1022
- "name": "useContainerScroll",
1023
- "slug": "use-container-scroll",
1024
- "category": "composable",
1025
- "description": "为消息容器提供滚动控制的组合式函数对,通过 **Provider/Consumer** 模式在父子组件间共享滚动状态。",
1026
- "aiSummary": "useContainerScrollProvider 在滚动容器与底部锚点上绑定 IntersectionObserver、scroll、wheel,提供 isScrollBottom、scrollBottomHeight、autoScrollEnabled、toScrollBottom/toScrollTop 及防抖「返回底部」按钮状态。 useContainerScrollConsumer 通过 inject 在子组件中获取同一套控制,无需 props 透传。 典型用于流式输出时仅在用户位于底部时自动滚底。MessageContainer 与 ScrollBtn 配合使用。",
1027
- "relatedComponents": [
1028
- {
1029
- "slug": "message-container",
1030
- "relation": "Provider 挂载于消息列表滚动区域"
1031
- },
1032
- {
1033
- "slug": "scroll-btn",
1034
- "relation": "使用 debouncedShowScrollBottomBtn 与 toScrollBottom"
1035
- },
1036
- {
1037
- "slug": "chat-container",
1038
- "relation": "组合消息区与输入区时的整体布局上下文"
1039
- }
1040
- ],
1041
- "docFile": "docs/use-container-scroll.md"
1042
- },
1043
- {
1044
- "name": "useCustomTab",
1045
- "slug": "use-custom-tab",
1046
- "category": "composable",
1047
- "description": "Provider/Consumer 模式的自定义 Tab 管理,用于 `ChatContainer` 侧边栏的 Tab 动态管理。Provider 在 `ChatContainer` 中创建,Consumer 在任意后代组件中注入使用。",
1048
- "aiSummary": "useCustomTabProvider 返回 tabs、selectedTab、isCollapse 及 add/remove/selectCustomTab,并通过 provide 共享;可选 onTabChange 在切换时拉取数据。 useCustomTabConsumer 在后代注入同一套 API,常用于侧栏动态节点详情等。EXECUTION_TAB_NAME 标识默认「执行情况」Tab。 ChatContainer 侧栏集成 Provider 与 Tab UI。",
1049
- "relatedComponents": [
1050
- {
1051
- "slug": "chat-container",
1052
- "relation": "Provider 与侧栏 Tab 主场景"
1053
- }
1054
- ],
1055
- "docFile": "docs/use-custom-tab.md"
1056
- },
1057
- {
1058
- "name": "useGlobalConfig",
1059
- "slug": "use-global-config",
1060
- "category": "composable",
1061
- "description": "在聊天根容器与子组件之间通过 provide/inject 共享全局展示配置(如是否支持上传)。",
1062
- "aiSummary": "useGlobalConfig 接收 GlobalConfig(含 supportUpload: ComputedRef<boolean>),以 GLOBAL_CONFIG_TOKEN provide 给后代; injectGlobalConfig 在子组件中取出配置,无 Provider 时返回 undefined。ChatContainer 在 setup 中调用 useGlobalConfig; UserMessage 等通过 injectGlobalConfig 读取 supportUpload。",
1063
- "relatedComponents": [
1064
- {
1065
- "slug": "chat-container",
1066
- "relation": "根容器调用 useGlobalConfig 注入 supportUpload"
1067
- }
1068
- ],
1069
- "docFile": "docs/use-global-config.md"
1070
- },
1071
- {
1072
- "name": "useMenuKeydown",
1073
- "slug": "use-menu-keydown",
1074
- "category": "composable",
1075
- "description": "为弹出菜单提供键盘导航能力的组合式函数。在 `onMounted` 时于 **`window` 捕获阶段**注册 `keydown` 监听,在 `onScopeDispose` 时自动移除,通过 `menuRef.offsetParent` 检测菜单可见性来决定是否响应按键。",
1076
- "aiSummary": "useMenuKeydown 接收 items、menuRef、onSelect,在 window 捕获阶段监听 keydown;菜单不可见(offsetParent 为空)或列表为空时不响应。 维护 activeIndex,处理 ArrowUp/ArrowDown 循环与 Enter 选中,并 scrollIntoView 当前 .is-active 项。 AiSlashMenu、AiPromptList(ChatInput 子模块)内部使用。",
1077
- "relatedComponents": [
1078
- {
1079
- "slug": "chat-input",
1080
- "relation": "AiSlashMenu / AiPromptList 键盘导航"
1081
- }
1082
- ],
1083
- "docFile": "docs/use-menu-keydown.md"
1084
- },
1085
- {
1086
- "name": "useMessageGroup",
1087
- "slug": "use-message-group",
1088
- "category": "composable",
1089
- "description": "核心消息分组逻辑,将原始 `Message[]` 数组转换为结构化的 `MessageGroup[]`。处理 Tool 消息合并、Loading 自动注入、执行摘要过滤和消息多选/分享等逻辑。",
1090
- "aiSummary": "useMessageGroup 接收 keyword、messages、selectedUserMessages,通过 watchEffect 产出 messageGroups(User/Assistant/Tool 合并、末尾 Loading 注入、pause 与分享勾选等)。 executionGroups 供侧边执行摘要过滤,并暴露 isShareMode、全选与 onConfirmShare。 ChatContainer 组装后传给 MessageContainer;ExecutionSummary 消费 executionGroups。",
1091
- "relatedComponents": [
1092
- {
1093
- "slug": "chat-container",
1094
- "relation": "调用并传入 MessageContainer"
1095
- },
1096
- {
1097
- "slug": "message-container",
1098
- "relation": "必填 messageGroups 数据源"
1099
- },
1100
- {
1101
- "slug": "execution-summary",
1102
- "relation": "使用 executionGroups 与定位"
1103
- }
1104
- ],
1105
- "docFile": "docs/use-message-group.md"
1106
- },
1107
- {
1108
- "name": "useObserverVisibleList",
1109
- "slug": "use-observer-visible-list",
1110
- "category": "composable",
1111
- "description": "基于 `ResizeObserver` 的容器宽度感知组合式函数:遍历列表项的实际 `offsetWidth`,使用贪心算法计算在容器中能完整显示的项目子集,并为\"更多\"按钮动态预留空间。",
1112
- "aiSummary": "useObserverVisibleList 根据 containerRef、itemRefs、gap、ComputedRef items 与可选 moreItemRef,用 ResizeObserver + 贪心算法得到 visibleItems。 依赖每项真实 offsetWidth,隐藏项需仍挂载于 DOM。返回 calculateVisibleMenuItems 供必要时手动触发。 ShortcutBtns 内部用于快捷指令溢出收入「更多」菜单。",
1113
- "relatedComponents": [
1114
- {
1115
- "slug": "shortcut-btns",
1116
- "relation": "唯一内置使用方"
1117
- }
1118
- ],
1119
- "docFile": "docs/use-observer-visible-list.md"
1120
- },
1121
- {
1122
- "name": "useParentScrolling",
1123
- "slug": "use-parent-scrolling",
1124
- "category": "composable",
1125
- "description": "向上递归查找**最近可滚动祖先**,监听其 `scroll` / `scrollend` 事件,提供 `isScrolling` 状态。常用于滚动时自动关闭浮层、禁用交互等场景。",
1126
- "aiSummary": "useParentScrolling(domRef) 在挂载后通过 getScrollParent 找到最近可滚动祖先,监听 scroll 与 scrollend,返回 isScrolling 与 scrollParent。 scroll 时将 isScrolling 置 true,300ms 无滚动或 scrollend 时置 false,适合滚动时隐藏浮层等交互。getScrollParent 可单独导出使用。 当前源码无组件内引用,供业务或后续浮层组件按需集成。",
1127
- "relatedComponents": [],
1128
- "docFile": "docs/use-parent-scrolling.md"
1129
- }
1130
- ],
1131
- "types": [
1132
- {
1133
- "name": "常量枚举",
1134
- "slug": "constants",
1135
- "category": "type",
1136
- "description": "`@blueking/chat-x` 导出的常量和枚举类型。",
1137
- "aiSummary": "汇总 MessageRole、MessageStatus、MessageContentType、MessageToolsStatus、MessageState、Z-Index 与 CONST_MESSAGE_TOOLS 等导出常量。 用于构造消息、配置 MessageContainer 工具栏与输入态,以及层级与默认快捷指令。与类型 messages 配套使用。",
1138
- "relatedComponents": [
1139
- {
1140
- "slug": "message-tools",
1141
- "relation": "默认工具 ID 与展示"
1142
- },
1143
- {
1144
- "slug": "chat-input",
1145
- "relation": "MessageState 与快捷指令"
1146
- },
1147
- {
1148
- "slug": "message-container",
1149
- "relation": "工具栏与消息态"
1150
- }
1151
- ],
1152
- "docFile": "docs/constants.md"
1153
- },
1154
- {
1155
- "name": "消息类型",
1156
- "slug": "messages",
1157
- "category": "type",
1158
- "description": "`@blueking/chat-x` 提供了完整的消息类型定义,用于构建 AI 对话消息。",
1159
- "aiSummary": "文档说明 Message 联合类型、BaseMessage、MessageRole、MessageStatus、User/Assistant/Tool/Activity/Reasoning 等具体形态及 MessageContentType。 业务构造 messages 数组供 ChatContainer/MessageContainer 渲染;Tool 消息经 useMessageGroup 注入 Assistant。可声明合并扩展 AIBluekingMessageMap。",
1160
- "relatedComponents": [
1161
- {
1162
- "slug": "message-container",
1163
- "relation": "列表渲染与工具栏"
1164
- },
1165
- {
1166
- "slug": "message-render",
1167
- "relation": "按 role 分发渲染"
1168
- },
1169
- {
1170
- "slug": "chat-container",
1171
- "relation": "数据源与交互入口"
1172
- }
1173
- ],
1174
- "docFile": "docs/messages.md"
1175
- }
1176
- ],
1177
- "directives": [
1178
- {
1179
- "name": "OverflowTips",
1180
- "slug": "overflow-tips",
1181
- "category": "directive",
1182
- "description": "当元素文本**水平溢出**(`scrollWidth > clientWidth`)时,鼠标悬停自动弹出 Tippy tooltip 显示完整内容;未溢出时不创建实例,零性能损耗。",
1183
- "aiSummary": "v-overflow-tips 在元素水平溢出(scrollWidth > clientWidth)时于 mouseenter 懒创建 Tippy,展示完整文本或自定义 text/content。 结合 IntersectionObserver 仅在可见时绑定悬停;隐藏时销毁实例。指令值为 Partial<TippyProps> 与 disabled 等。 DescPanel、ExecutionSummary、ToolcallRender、AiSlashMenu 等用于标题或列表溢出提示。",
1184
- "relatedComponents": [
1185
- {
1186
- "slug": "desc-panel",
1187
- "relation": "工具描述面板溢出"
1188
- },
1189
- {
1190
- "slug": "execution-summary",
1191
- "relation": "执行摘要标签溢出"
1192
- },
1193
- {
1194
- "slug": "toolcall-render",
1195
- "relation": "工具标题行溢出"
1196
- },
1197
- {
1198
- "slug": "chat-input",
1199
- "relation": "AiSlashMenu 资源项(侧栏子模块)"
1200
- }
1201
- ],
1202
- "docFile": "docs/overflow-tips.md"
1203
- }
1204
- ],
1205
- "plugins": [
1206
- {
1207
- "name": "markdownItLatex",
1208
- "slug": "markdown-latex",
1209
- "category": "plugin",
1210
- "description": "Markdown-it LaTeX 解析插件,用于解析 LaTeX 数学公式语法。",
1211
- "aiSummary": "markdownItLatex 为 markdown-it 插件,解析 $...$、$$...$$、\\\\(...\\\\)、\\\\[...\\\\] 为 math_inline / math_block token,可选 LatexOption.replaceAlignStart。 不负责渲染,KaTeX 在 LatexContent 中异步渲染。与 Markdown 管道、ContentRender 中的公式展示链路配合。",
1212
- "relatedComponents": [
1213
- {
1214
- "slug": "latex-content",
1215
- "relation": "消费 math token 并 KaTeX 渲染"
1216
- },
1217
- {
1218
- "slug": "markdown-content",
1219
- "relation": "Markdown 渲染管线"
1220
- },
1221
- {
1222
- "slug": "content-render",
1223
- "relation": "消息内容统一渲染入口"
1224
- }
1225
- ],
1226
- "docFile": "docs/markdown-latex.md"
1227
- },
1228
- {
1229
- "name": "markdownItMermaid",
1230
- "slug": "markdown-mermaid",
1231
- "category": "plugin",
1232
- "description": "Markdown-it Mermaid 解析插件,用于解析 Mermaid 图表代码块。",
1233
- "aiSummary": "markdownItMermaid 为 markdown-it 插件,将 ```mermaid 代码块转为带 data-mermaid-code、data-mermaid-idx 的占位 DOM,便于前端挂载渲染。 实际绘图由 Mermaid 动态导入在 MermaidContent 中完成,支持流式场景节流与缓存。ContentRender 驱动完整消息 Markdown 流程。",
1234
- "relatedComponents": [
1235
- {
1236
- "slug": "mermaid-content",
1237
- "relation": "解析占位并渲染图表"
1238
- },
1239
- {
1240
- "slug": "markdown-content",
1241
- "relation": "Markdown fence 管线"
1242
- },
1243
- {
1244
- "slug": "content-render",
1245
- "relation": "消息块级内容渲染"
1246
- }
1247
- ],
1248
- "docFile": "docs/markdown-mermaid.md"
1249
- }
1250
- ],
1251
- "utils": [],
1252
- "edix": [],
1253
- "i18n": [],
1254
- "icons": [],
1255
- "theme": [
1256
- {
1257
- "name": "主题配置",
1258
- "slug": "theme",
1259
- "category": "theme",
1260
- "description": "`@blueking/chat-x` 使用 SCSS 变量和 CSS 类来控制样式,支持通过覆盖变量或样式来自定义主题。",
1261
- "aiSummary": "说明通过 SCSS 变量(尺寸、颜色、z-index)与 CSS 类覆盖(chat-input、用户/助手消息、shortcut-btns、ai-markdown-body、tool-btn 等)自定义主题。 含渐变边框 mixin、ai-markdown-fade-in 与弹窗过渡。暗色示例通过根 class 切换。组件随包引入样式,业务侧按需覆写。",
1262
- "relatedComponents": [
1263
- {
1264
- "slug": "chat-container",
1265
- "relation": "整体布局与侧栏"
1266
- },
1267
- {
1268
- "slug": "chat-input",
1269
- "relation": "输入区与渐变边框"
1270
- },
1271
- {
1272
- "slug": "message-container",
1273
- "relation": "消息区样式上下文"
1274
- }
1275
- ],
1276
- "docFile": "docs/theme.md"
1277
- }
1278
- ]
1279
- }