@blueking/chat-x 0.0.48-beta.1 → 0.0.49-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ag-ui/types/file.d.ts +23 -0
- package/dist/ag-ui/types/index.d.ts +1 -0
- package/dist/ag-ui/types/messages.d.ts +2 -0
- package/dist/components/chat-message/assistant-message/message-artifacts/artifact-file-card.vue.d.ts +14 -0
- package/dist/components/chat-message/assistant-message/message-artifacts/artifact-preview/artifact-preview-host.vue.d.ts +8 -0
- package/dist/components/chat-message/assistant-message/message-artifacts/artifact-preview/preview-strategy.d.ts +9 -0
- package/dist/components/chat-message/assistant-message/message-artifacts/artifact-preview/renderers/html-preview.vue.d.ts +6 -0
- package/dist/components/chat-message/assistant-message/message-artifacts/artifact-preview/renderers/markdown-preview.vue.d.ts +6 -0
- package/dist/components/chat-message/assistant-message/message-artifacts/artifact-preview/renderers/txt-preview.vue.d.ts +6 -0
- package/dist/components/chat-message/assistant-message/message-artifacts/artifact-preview/renderers/url-iframe-preview.vue.d.ts +6 -0
- package/dist/components/chat-message/assistant-message/message-artifacts/artifact-preview/use-artifact-preview-loader.d.ts +21 -0
- package/dist/components/chat-message/assistant-message/message-artifacts/file-artifact-panel.vue.d.ts +12 -0
- package/dist/components/chat-message/assistant-message/message-artifacts/file-icon.d.ts +29 -0
- package/dist/components/chat-message/assistant-message/message-artifacts/message-artifacts.vue.d.ts +10 -0
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/use-artifact-preview.d.ts +59 -0
- package/dist/composables/use-message-group.d.ts +434 -0
- package/dist/icons/file.d.ts +24 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/index.css +1 -1
- package/dist/index.js +2083 -1600
- package/dist/index.js.map +1 -1
- package/dist/lang/lang.d.ts +6 -1
- package/dist/mcp/generated/docs/activity-message.md +122 -97
- package/dist/mcp/generated/docs/assistant-message.md +125 -62
- package/dist/mcp/generated/docs/chat-container.md +94 -16
- package/dist/mcp/generated/docs/file-artifact-panel.md +279 -0
- package/dist/mcp/generated/docs/info-message.md +23 -7
- package/dist/mcp/generated/docs/loading-message.md +36 -17
- package/dist/mcp/generated/docs/message-render.md +44 -33
- package/dist/mcp/generated/docs/reasoning-message.md +15 -11
- package/dist/mcp/generated/docs/tool-message.md +61 -45
- package/dist/mcp/generated/docs/use-artifact-preview.md +237 -0
- package/dist/mcp/generated/docs/use-message-group.md +24 -0
- package/dist/mcp/generated/docs/user-message.md +185 -121
- package/dist/mcp/generated/index.json +79 -9
- package/dist/mcp/index.js +0 -0
- package/package.json +20 -21
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
<!-- AI SUMMARY -->
|
|
2
2
|
## 快速了解
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
渲染用户消息:纯文本(非 Markdown)、键值引用、二进制附件与编辑态 ChatInput / ShortcutRender; 工具栏含 copy / cite / edit / delete。源码位置:src/components/chat-message/user-message/user-message.vue。
|
|
5
5
|
|
|
6
6
|
### 关联组件
|
|
7
7
|
- **message-render** — 由 MessageRender 在 role 为 user 时创建
|
|
8
8
|
- **message-tools** — 消息工具栏交互与状态由 MessageTools 体系承载
|
|
9
9
|
- **message-container** — 嵌入列表时由 MessageContainer 管理分组与多选
|
|
10
|
+
- **chat-input** — 编辑态普通消息使用 ChatInput
|
|
10
11
|
|
|
11
12
|
---
|
|
12
13
|
<!-- FULL DOC -->
|
|
13
14
|
|
|
14
15
|
# UserMessage 用户消息
|
|
16
|
+
|
|
15
17
|
## 源码事实
|
|
16
18
|
|
|
17
19
|
- **源码位置**:`src/components/chat-message/user-message/user-message.vue`
|
|
18
20
|
- **能力域**:消息系统
|
|
19
|
-
-
|
|
21
|
+
- **能力说明**:渲染用户消息:纯文本、键值引用、文件附件与编辑态输入(**不**渲染 Markdown)。
|
|
20
22
|
|
|
21
|
-
>
|
|
23
|
+
> **导出说明**:`UserMessage` **未**从 `@blueking/chat-x` 包入口导出(入口同名是 TS interface)。消费方请用 `MessageRender` / `MessageContainer`。下文 `UserMessageComp` 为文档站内部相对路径示例。
|
|
22
24
|
|
|
23
|
-
|
|
25
|
+
用户消息展示组件,右对齐。支持纯文本、多媒体(图片/文件)、文本引用、结构化引用、快捷指令,以及内联编辑。
|
|
24
26
|
|
|
25
27
|
## 组件结构
|
|
26
28
|
|
|
@@ -44,7 +46,7 @@
|
|
|
44
46
|
└── MessageTools(.ai-user-message-tools)
|
|
45
47
|
v-if: messageToolsStatus !== 'hidden'
|
|
46
48
|
visibility: hidden(默认)→ visible(:hover 时)
|
|
47
|
-
tools: [copy, cite, edit],updateTools: []
|
|
49
|
+
tools: [copy, cite, edit, delete],updateTools: []
|
|
48
50
|
```
|
|
49
51
|
|
|
50
52
|
**编辑模式**(点击 `edit` 按钮后 `isEdit=true`)
|
|
@@ -67,28 +69,35 @@
|
|
|
67
69
|
|
|
68
70
|
## 基础用法
|
|
69
71
|
|
|
70
|
-
`content` 为字符串时,通过 `TextContent`
|
|
72
|
+
`content` 为字符串时,通过 `TextContent` 以**纯文本**插值渲染(`{{ content }}`),**不**走 Markdown。
|
|
71
73
|
|
|
72
74
|
```vue
|
|
73
75
|
<template>
|
|
74
|
-
<
|
|
75
|
-
:
|
|
76
|
+
<MessageRender
|
|
77
|
+
:message="message"
|
|
76
78
|
:on-action="handleAction"
|
|
77
79
|
/>
|
|
78
80
|
</template>
|
|
79
81
|
|
|
80
82
|
<script setup lang="ts">
|
|
81
|
-
import {
|
|
82
|
-
|
|
83
|
-
const
|
|
83
|
+
import { MessageRender, MessageRole, MessageStatus, type IToolBtn } from '@blueking/chat-x';
|
|
84
|
+
|
|
85
|
+
const message = {
|
|
86
|
+
id: '1',
|
|
87
|
+
messageId: '1',
|
|
88
|
+
role: MessageRole.User,
|
|
89
|
+
content: '你好,请帮我分析以下这段 Python 代码的性能瓶颈。',
|
|
90
|
+
status: MessageStatus.Complete,
|
|
91
|
+
};
|
|
84
92
|
|
|
85
93
|
const handleAction = async (tool: IToolBtn) => {
|
|
94
|
+
// copy / edit 有内置行为;cite / delete 需业务侧处理
|
|
86
95
|
console.log('工具操作:', tool.id);
|
|
87
96
|
};
|
|
88
97
|
</script>
|
|
89
98
|
```
|
|
90
99
|
|
|
91
|
-
>
|
|
100
|
+
> **工具栏**:悬停时显示「复制」「引用」「编辑」「删除」(CSS `visibility`,始终占位)。
|
|
92
101
|
|
|
93
102
|
## 多媒体消息
|
|
94
103
|
|
|
@@ -101,20 +110,26 @@
|
|
|
101
110
|
|
|
102
111
|
```vue
|
|
103
112
|
<script setup lang="ts">
|
|
104
|
-
import {
|
|
105
|
-
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
113
|
+
import { MessageRender, MessageContentType, MessageRole, MessageStatus } from '@blueking/chat-x';
|
|
114
|
+
|
|
115
|
+
const message = {
|
|
116
|
+
id: '1',
|
|
117
|
+
messageId: '1',
|
|
118
|
+
role: MessageRole.User,
|
|
119
|
+
status: MessageStatus.Complete,
|
|
120
|
+
content: [
|
|
121
|
+
{
|
|
122
|
+
type: MessageContentType.Binary,
|
|
123
|
+
url: 'https://example.com/screenshot.png',
|
|
124
|
+
mimeType: 'image/png',
|
|
125
|
+
filename: 'screenshot.png',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
type: MessageContentType.Text,
|
|
129
|
+
text: '请帮我分析这张架构图,指出其中的问题。',
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
};
|
|
118
133
|
</script>
|
|
119
134
|
```
|
|
120
135
|
|
|
@@ -133,12 +148,14 @@
|
|
|
133
148
|
|
|
134
149
|
```vue
|
|
135
150
|
<script setup lang="ts">
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
151
|
+
// 消费方将 property 挂在 message 上,经 MessageRender 透传
|
|
152
|
+
const message = {
|
|
153
|
+
role: 'user',
|
|
154
|
+
content: '这段代码每次循环都发起请求,应该如何优化?',
|
|
155
|
+
property: {
|
|
156
|
+
extra: {
|
|
157
|
+
cite: '// 原始代码\nfor (let i = 0; i < arr.length; i++) {\n fetch(`/api/${arr[i]}`)\n}',
|
|
158
|
+
},
|
|
142
159
|
},
|
|
143
160
|
};
|
|
144
161
|
</script>
|
|
@@ -150,18 +167,20 @@
|
|
|
150
167
|
|
|
151
168
|
```vue
|
|
152
169
|
<script setup lang="ts">
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
170
|
+
const message = {
|
|
171
|
+
role: 'user',
|
|
172
|
+
content: '请帮我分析这份报表的数据趋势。',
|
|
173
|
+
property: {
|
|
174
|
+
extra: {
|
|
175
|
+
cite: {
|
|
176
|
+
title: '销售数据分析',
|
|
177
|
+
type: 'structured',
|
|
178
|
+
data: [
|
|
179
|
+
{ key: '报表名称', value: '2024 年 Q4 销售报表' },
|
|
180
|
+
{ key: '时间范围', value: '2024年10月 - 12月' },
|
|
181
|
+
{ key: '数据量', value: '12,580 条' },
|
|
182
|
+
],
|
|
183
|
+
},
|
|
165
184
|
},
|
|
166
185
|
},
|
|
167
186
|
};
|
|
@@ -182,34 +201,35 @@
|
|
|
182
201
|
|
|
183
202
|
```vue
|
|
184
203
|
<script setup lang="ts">
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
204
|
+
const message = {
|
|
205
|
+
role: 'user',
|
|
206
|
+
content: '请帮我翻译这段文字',
|
|
207
|
+
property: {
|
|
208
|
+
extra: {
|
|
209
|
+
shortcut: {
|
|
210
|
+
id: 'translate',
|
|
211
|
+
name: '翻译',
|
|
212
|
+
components: [
|
|
213
|
+
{
|
|
214
|
+
type: 'select',
|
|
215
|
+
key: 'targetLang',
|
|
216
|
+
name: '目标语言',
|
|
217
|
+
default: 'en',
|
|
218
|
+
options: [
|
|
219
|
+
{ label: '英文', value: 'en' },
|
|
220
|
+
{ label: '中文', value: 'zh' },
|
|
221
|
+
],
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
type: 'textarea',
|
|
225
|
+
key: 'content',
|
|
226
|
+
name: '翻译内容',
|
|
227
|
+
fillBack: true,
|
|
228
|
+
default: '请帮我翻译这段文字',
|
|
229
|
+
},
|
|
230
|
+
],
|
|
231
|
+
formModel: { targetLang: 'en', content: '请帮我翻译这段文字' },
|
|
232
|
+
},
|
|
213
233
|
},
|
|
214
234
|
},
|
|
215
235
|
};
|
|
@@ -236,8 +256,8 @@ binaryFiles 有值 → 进入编辑模式(editContent 可为空)
|
|
|
236
256
|
|
|
237
257
|
```vue
|
|
238
258
|
<template>
|
|
239
|
-
<
|
|
240
|
-
:
|
|
259
|
+
<MessageRender
|
|
260
|
+
:message="message"
|
|
241
261
|
:on-action="handleAction"
|
|
242
262
|
:on-input-confirm="handleInputConfirm"
|
|
243
263
|
:on-shortcut-confirm="handleShortcutConfirm"
|
|
@@ -245,25 +265,35 @@ binaryFiles 有值 → 进入编辑模式(editContent 可为空)
|
|
|
245
265
|
</template>
|
|
246
266
|
|
|
247
267
|
<script setup lang="ts">
|
|
248
|
-
import {
|
|
249
|
-
|
|
250
|
-
|
|
268
|
+
import {
|
|
269
|
+
MessageRender,
|
|
270
|
+
MessageRole,
|
|
271
|
+
MessageStatus,
|
|
272
|
+
type IToolBtn,
|
|
273
|
+
type TagSchema,
|
|
274
|
+
type UserMessage,
|
|
275
|
+
} from '@blueking/chat-x';
|
|
276
|
+
|
|
277
|
+
const message = {
|
|
278
|
+
id: '1',
|
|
279
|
+
messageId: '1',
|
|
280
|
+
role: MessageRole.User,
|
|
281
|
+
content: '请帮我优化这段代码',
|
|
282
|
+
status: MessageStatus.Complete,
|
|
283
|
+
};
|
|
251
284
|
|
|
252
285
|
const handleAction = async (tool: IToolBtn) => {
|
|
253
|
-
//
|
|
254
|
-
//
|
|
255
|
-
// tool.id === 'cite' → 由外部 onAction 处理(组件内无内置行为)
|
|
286
|
+
// edit → 组件内切编辑态;copy → 组件内复制
|
|
287
|
+
// cite / delete → 无内置行为,业务侧处理(如删除会话消息)
|
|
256
288
|
console.log('工具:', tool.id);
|
|
257
289
|
};
|
|
258
290
|
|
|
259
|
-
const handleInputConfirm = async (content:
|
|
260
|
-
console.log('编辑后内容:', content);
|
|
261
|
-
// 重新发送消息
|
|
291
|
+
const handleInputConfirm = async (content: UserMessage['content'], docSchema: TagSchema) => {
|
|
292
|
+
console.log('编辑后内容:', content, docSchema);
|
|
262
293
|
};
|
|
263
294
|
|
|
264
295
|
const handleShortcutConfirm = async (formModel: Record<string, unknown>) => {
|
|
265
296
|
console.log('快捷指令表单:', formModel);
|
|
266
|
-
// 重新发送快捷指令
|
|
267
297
|
};
|
|
268
298
|
</script>
|
|
269
299
|
```
|
|
@@ -274,50 +304,85 @@ binaryFiles 有值 → 进入编辑模式(editContent 可为空)
|
|
|
274
304
|
|
|
275
305
|
**内置工具列表(`CONST_USER_MESSAGE_TOOLS`)**
|
|
276
306
|
|
|
277
|
-
| 工具 ID
|
|
278
|
-
|
|
|
279
|
-
| `copy`
|
|
280
|
-
| `cite`
|
|
281
|
-
| `edit`
|
|
307
|
+
| 工具 ID | 名称 | 内置行为 |
|
|
308
|
+
| -------- | ---- | -------------------------------------------- |
|
|
309
|
+
| `copy` | 复制 | 字符串直接复制;数组 `JSON.stringify` 后复制 |
|
|
310
|
+
| `cite` | 引用 | 无内置行为,需通过 `onAction` 外部处理 |
|
|
311
|
+
| `edit` | 编辑 | 切换 `isEdit=true`,进入编辑模式 |
|
|
312
|
+
| `delete` | 删除 | 无内置行为,需通过 `onAction` 外部处理 |
|
|
282
313
|
|
|
283
314
|
```vue
|
|
284
|
-
<!--
|
|
285
|
-
<
|
|
315
|
+
<!-- 经 MessageRender 控制工具栏状态 -->
|
|
316
|
+
<MessageRender
|
|
317
|
+
:message="message"
|
|
318
|
+
message-tools-status="hidden"
|
|
319
|
+
/>
|
|
320
|
+
<MessageRender
|
|
321
|
+
:message="message"
|
|
322
|
+
message-tools-status="disabled"
|
|
323
|
+
/>
|
|
324
|
+
```
|
|
286
325
|
|
|
287
|
-
|
|
288
|
-
|
|
326
|
+
## supportUpload 透传
|
|
327
|
+
|
|
328
|
+
编辑态 `ChatInput` 的上传能力来自 `injectGlobalConfig().supportUpload`(通常由 `ChatContainer` 的 `supportUpload` prop 注册)。自定义 `#message` 插槽时须把同一配置链路保留,否则编辑态会与主输入区不一致。
|
|
329
|
+
|
|
330
|
+
```vue
|
|
331
|
+
<template>
|
|
332
|
+
<ChatContainer
|
|
333
|
+
:messages="messages"
|
|
334
|
+
:support-upload="true"
|
|
335
|
+
:on-agent-action="handleAgentAction"
|
|
336
|
+
:on-user-action="handleUserAction"
|
|
337
|
+
>
|
|
338
|
+
<template #message="{ message, messageToolsStatus, onInterruptResume }">
|
|
339
|
+
<MessageRender
|
|
340
|
+
:message="message"
|
|
341
|
+
:message-tools-status="messageToolsStatus"
|
|
342
|
+
:on-action="handleUserAction"
|
|
343
|
+
:on-input-confirm="(content, docSchema) => handleUserInputConfirm(message, content, docSchema)"
|
|
344
|
+
:on-shortcut-confirm="formModel => handleUserShortcutConfirm(message, formModel)"
|
|
345
|
+
:on-interrupt-resume="onInterruptResume"
|
|
346
|
+
/>
|
|
347
|
+
</template>
|
|
348
|
+
</ChatContainer>
|
|
349
|
+
</template>
|
|
289
350
|
```
|
|
290
351
|
|
|
291
352
|
## API
|
|
292
353
|
|
|
293
354
|
### Props
|
|
294
355
|
|
|
295
|
-
| 属性名 | 类型
|
|
296
|
-
| ------------------ |
|
|
297
|
-
| content | `string \| InputContent[]`
|
|
298
|
-
| property | `{ extra?: MessageExtra }`
|
|
299
|
-
| messageToolsStatus | `MessageToolsStatus`
|
|
300
|
-
| onAction | `
|
|
301
|
-
| onInputConfirm | `(content:
|
|
302
|
-
| onShortcutConfirm | `(formModel: Record<string, unknown>) => Promise<void>`
|
|
303
|
-
| tippyOptions | `Partial<Omit<TippyOptions, 'getReferenceClientRect' \| 'triggerTarget'>>`
|
|
356
|
+
| 属性名 | 类型 | 说明 |
|
|
357
|
+
| ------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------- |
|
|
358
|
+
| content | `string \| InputContent[]` | 消息内容,字符串或含 text/binary 的数组 |
|
|
359
|
+
| property | `{ extra?: MessageExtra; artifacts?: AIFileInfo[] }` | 附加属性;本组件消费 `extra.cite` / `shortcut` / `context` |
|
|
360
|
+
| messageToolsStatus | `MessageToolsStatus` | 工具按钮状态,`disabled` 禁用、`hidden` 从 DOM 移除 |
|
|
361
|
+
| onAction | `MessageToolsProps['onAction']` | 工具回调;`copy`/`edit` 有内置行为,`cite`/`delete` 需外部处理 |
|
|
362
|
+
| onInputConfirm | `(content: UserMessage['content'], docSchema: TagSchema) => Promise<void>` | 普通消息编辑确认回调 |
|
|
363
|
+
| onShortcutConfirm | `(formModel: Record<string, unknown>) => Promise<void>` | 快捷指令消息编辑确认回调 |
|
|
364
|
+
| tippyOptions | `Partial<Omit<TippyOptions, 'getReferenceClientRect' \| 'triggerTarget'>>` | 自定义工具栏 Tippy 配置,透传给内部 `MessageTools` |
|
|
365
|
+
|
|
366
|
+
### Events / Slots / Expose
|
|
367
|
+
|
|
368
|
+
无。
|
|
304
369
|
|
|
305
370
|
### 全局配置依赖
|
|
306
371
|
|
|
307
|
-
|
|
372
|
+
编辑态 `ChatInput` 通过 `injectGlobalConfig()` 读取 `supportUpload`。祖先需已 `useGlobalConfig()`(通常由 `ChatContainer` 注册)。
|
|
308
373
|
|
|
309
374
|
## 类型定义
|
|
310
375
|
|
|
311
376
|
```typescript
|
|
312
377
|
// 文本内容项
|
|
313
378
|
interface TextInputContent {
|
|
314
|
-
type: 'text';
|
|
379
|
+
type: 'text';
|
|
315
380
|
text: string;
|
|
316
381
|
}
|
|
317
382
|
|
|
318
383
|
// 二进制内容项(图片、文件)
|
|
319
384
|
interface BinaryContent {
|
|
320
|
-
type: 'binary';
|
|
385
|
+
type: 'binary';
|
|
321
386
|
url?: string;
|
|
322
387
|
mimeType?: string;
|
|
323
388
|
filename?: string;
|
|
@@ -325,28 +390,27 @@ interface BinaryContent {
|
|
|
325
390
|
|
|
326
391
|
type InputContent = TextInputContent | BinaryContent;
|
|
327
392
|
|
|
328
|
-
//
|
|
329
|
-
|
|
330
|
-
//
|
|
331
|
-
cite?:
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
shortcut?: Shortcut
|
|
341
|
-
|
|
342
|
-
// 上下文变量:与结构化 cite 配合,在编辑模式下动态构建 ShortcutComponent[]
|
|
393
|
+
// property.extra(与源码 BaseMessage.property.extra 对齐)
|
|
394
|
+
type MessageExtra = {
|
|
395
|
+
// 文本引用 或 结构化引用(互斥 union,不是两个同名字段)
|
|
396
|
+
cite?:
|
|
397
|
+
| string
|
|
398
|
+
| {
|
|
399
|
+
title: string;
|
|
400
|
+
type: 'structured';
|
|
401
|
+
data: Array<{ key: string; value: string }>;
|
|
402
|
+
};
|
|
403
|
+
command?: string;
|
|
404
|
+
pause?: boolean;
|
|
405
|
+
shortcut?: Partial<Shortcut>;
|
|
343
406
|
context?: Array<{
|
|
344
407
|
__key: string;
|
|
345
408
|
__label: string;
|
|
346
409
|
__value: string;
|
|
347
410
|
fillBack?: boolean;
|
|
411
|
+
context_type?: string;
|
|
348
412
|
}>;
|
|
349
|
-
}
|
|
413
|
+
};
|
|
350
414
|
```
|
|
351
415
|
|
|
352
416
|
## 关联组件
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "2.0.0",
|
|
3
|
-
"generatedAt": "2026-07-
|
|
3
|
+
"generatedAt": "2026-07-29T07:29:01.699Z",
|
|
4
4
|
"domains": {
|
|
5
5
|
"setup": {
|
|
6
6
|
"label": "对话搭建",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"components": [
|
|
15
15
|
"activity-message",
|
|
16
16
|
"assistant-message",
|
|
17
|
+
"file-artifact-panel",
|
|
17
18
|
"info-message",
|
|
18
19
|
"loading-message",
|
|
19
20
|
"message-render",
|
|
@@ -1063,8 +1064,20 @@
|
|
|
1063
1064
|
"relation": "由 MessageRender 在 role 为 activity 时创建"
|
|
1064
1065
|
},
|
|
1065
1066
|
{
|
|
1066
|
-
"slug": "
|
|
1067
|
-
"relation": "
|
|
1067
|
+
"slug": "flow-agent-content",
|
|
1068
|
+
"relation": "activityType 为 flow_agent 时渲染"
|
|
1069
|
+
},
|
|
1070
|
+
{
|
|
1071
|
+
"slug": "knowledge-rag-content",
|
|
1072
|
+
"relation": "activityType 为 knowledge_rag 时渲染"
|
|
1073
|
+
},
|
|
1074
|
+
{
|
|
1075
|
+
"slug": "reference-doc-content",
|
|
1076
|
+
"relation": "activityType 为 reference_document 时渲染"
|
|
1077
|
+
},
|
|
1078
|
+
{
|
|
1079
|
+
"slug": "chat-container",
|
|
1080
|
+
"relation": "uid / onInterruptResume / 侧栏 Tab 与 ChatContainer 联动"
|
|
1068
1081
|
}
|
|
1069
1082
|
],
|
|
1070
1083
|
"docFile": "docs/activity-message.md",
|
|
@@ -1074,8 +1087,8 @@
|
|
|
1074
1087
|
"name": "AssistantMessage AI 助手消息",
|
|
1075
1088
|
"slug": "assistant-message",
|
|
1076
1089
|
"kind": "component",
|
|
1077
|
-
"description": "
|
|
1078
|
-
"aiSummary": "
|
|
1090
|
+
"description": "渲染助手消息主体、工具调用与文件产物,默认插槽可覆盖正文渲染。",
|
|
1091
|
+
"aiSummary": "渲染助手 Markdown 正文、ToolCallRender 工具调用列表,以及 property.artifacts 文件卡片; 默认插槽仅覆盖正文。源码位置:src/components/chat-message/assistant-message/assistant-message.vue。",
|
|
1079
1092
|
"relatedComponents": [
|
|
1080
1093
|
{
|
|
1081
1094
|
"slug": "message-render",
|
|
@@ -1088,11 +1101,42 @@
|
|
|
1088
1101
|
{
|
|
1089
1102
|
"slug": "toolcall-render",
|
|
1090
1103
|
"relation": "多条工具调用由 ToolcallRender 统一渲染"
|
|
1104
|
+
},
|
|
1105
|
+
{
|
|
1106
|
+
"slug": "file-artifact-panel",
|
|
1107
|
+
"relation": "property.artifacts 文件产物点击后在侧栏预览"
|
|
1091
1108
|
}
|
|
1092
1109
|
],
|
|
1093
1110
|
"docFile": "docs/assistant-message.md",
|
|
1094
1111
|
"domain": "message"
|
|
1095
1112
|
},
|
|
1113
|
+
{
|
|
1114
|
+
"name": "FileArtifactPanel 文件产物预览",
|
|
1115
|
+
"slug": "file-artifact-panel",
|
|
1116
|
+
"kind": "component",
|
|
1117
|
+
"description": "汇总当前会话全部文件产物,支持搜索、选中与分类型预览,挂载在 ChatContainer 侧栏「文件产物」Tab。",
|
|
1118
|
+
"aiSummary": "汇总当前会话所有 AssistantMessage 的 artifacts,支持关键词搜索、列表选中与下载; 预览区委托 ArtifactPreviewHost:按类型走 text_from_download(html / markdown / md / txt / json) 或 preview_url_iframe(其余类型);download_url / preview_url 经 onArtifactClick 异步获取。 源码位置:src/components/chat-message/assistant-message/message-artifacts/file-artifact-panel.vue。",
|
|
1119
|
+
"relatedComponents": [
|
|
1120
|
+
{
|
|
1121
|
+
"slug": "assistant-message",
|
|
1122
|
+
"relation": "文件产物来源于 AssistantMessage.property.artifacts"
|
|
1123
|
+
},
|
|
1124
|
+
{
|
|
1125
|
+
"slug": "chat-container",
|
|
1126
|
+
"relation": "面板挂载在侧栏「文件产物」Tab(固定、不可关闭),并通过 onArtifactClick 异步取链"
|
|
1127
|
+
},
|
|
1128
|
+
{
|
|
1129
|
+
"slug": "execution-summary",
|
|
1130
|
+
"relation": "同为 ChatContainer 侧栏 Tab 面板,交互形态一致"
|
|
1131
|
+
},
|
|
1132
|
+
{
|
|
1133
|
+
"slug": "message-loading",
|
|
1134
|
+
"relation": "ArtifactPreviewHost 取链 / 拉取正文过程使用 MessageLoading"
|
|
1135
|
+
}
|
|
1136
|
+
],
|
|
1137
|
+
"docFile": "docs/file-artifact-panel.md",
|
|
1138
|
+
"domain": "message"
|
|
1139
|
+
},
|
|
1096
1140
|
{
|
|
1097
1141
|
"name": "InfoMessage 信息消息",
|
|
1098
1142
|
"slug": "info-message",
|
|
@@ -1189,8 +1233,8 @@
|
|
|
1189
1233
|
"name": "ToolMessage 工具消息",
|
|
1190
1234
|
"slug": "tool-message",
|
|
1191
1235
|
"kind": "component",
|
|
1192
|
-
"description": "渲染工具返回内容,JSON 场景交给 DescPanel 展示。",
|
|
1193
|
-
"aiSummary": "
|
|
1236
|
+
"description": "渲染工具返回内容,JSON 场景交给 DescPanel + HighlightKeyword 展示。",
|
|
1237
|
+
"aiSummary": "渲染工具返回内容;DescPanel 解析 JSON 为 key-value,嵌套值 JSON.stringify 后经 HighlightKeyword 展示。 源码位置:src/components/chat-message/tool-message/tool-message.vue。",
|
|
1194
1238
|
"relatedComponents": [
|
|
1195
1239
|
{
|
|
1196
1240
|
"slug": "assistant-message",
|
|
@@ -1212,8 +1256,8 @@
|
|
|
1212
1256
|
"name": "UserMessage 用户消息",
|
|
1213
1257
|
"slug": "user-message",
|
|
1214
1258
|
"kind": "component",
|
|
1215
|
-
"description": "
|
|
1216
|
-
"aiSummary": "
|
|
1259
|
+
"description": "渲染用户消息,支持纯文本、键值引用、文件附件和编辑态输入。",
|
|
1260
|
+
"aiSummary": "渲染用户消息:纯文本(非 Markdown)、键值引用、二进制附件与编辑态 ChatInput / ShortcutRender; 工具栏含 copy / cite / edit / delete。源码位置:src/components/chat-message/user-message/user-message.vue。",
|
|
1217
1261
|
"relatedComponents": [
|
|
1218
1262
|
{
|
|
1219
1263
|
"slug": "message-render",
|
|
@@ -1226,6 +1270,10 @@
|
|
|
1226
1270
|
{
|
|
1227
1271
|
"slug": "message-container",
|
|
1228
1272
|
"relation": "嵌入列表时由 MessageContainer 管理分组与多选"
|
|
1273
|
+
},
|
|
1274
|
+
{
|
|
1275
|
+
"slug": "chat-input",
|
|
1276
|
+
"relation": "编辑态普通消息使用 ChatInput"
|
|
1229
1277
|
}
|
|
1230
1278
|
],
|
|
1231
1279
|
"docFile": "docs/user-message.md",
|
|
@@ -1533,6 +1581,28 @@
|
|
|
1533
1581
|
],
|
|
1534
1582
|
"docFile": "docs/use-animation-text.md"
|
|
1535
1583
|
},
|
|
1584
|
+
{
|
|
1585
|
+
"name": "useArtifactPreview",
|
|
1586
|
+
"slug": "use-artifact-preview",
|
|
1587
|
+
"kind": "composable",
|
|
1588
|
+
"description": "Provider/Consumer 模式的文件产物预览状态管理,用于 ChatContainer 侧栏「文件产物」Tab 的命中与切换。 Provider 在 ChatContainer 中创建,Consumer 在深层文件卡片中注入使用。",
|
|
1589
|
+
"aiSummary": "useArtifactPreviewProvider 维护 activeArtifactId,openPreview 命中文件并触发 onOpen 打开侧栏 Tab; 并通过 getOnArtifactClick 封装 resolveArtifactUrls(按 outputId 缓存 download_url / preview_url); useArtifactPreviewConsumer 在后代注入同一套 API。buildArtifactId 用 messageUid#index#outputId 生成唯一 id。 正文加载与分类型渲染不在本 composable,由 FileArtifactPanel 内 ArtifactPreviewHost 完成。 FILE_ARTIFACT_TAB_NAME 标识固定「文件产物」Tab。",
|
|
1590
|
+
"relatedComponents": [
|
|
1591
|
+
{
|
|
1592
|
+
"slug": "chat-container",
|
|
1593
|
+
"relation": "Provider 主场景,聚合 sessionArtifacts 并挂载 FileArtifactPanel"
|
|
1594
|
+
},
|
|
1595
|
+
{
|
|
1596
|
+
"slug": "file-artifact-panel",
|
|
1597
|
+
"relation": "侧栏面板消费 activeArtifactId 与 setActiveArtifactId;预览加载在面板内 Host"
|
|
1598
|
+
},
|
|
1599
|
+
{
|
|
1600
|
+
"slug": "assistant-message",
|
|
1601
|
+
"relation": "文件产物来源 property.artifacts"
|
|
1602
|
+
}
|
|
1603
|
+
],
|
|
1604
|
+
"docFile": "docs/use-artifact-preview.md"
|
|
1605
|
+
},
|
|
1536
1606
|
{
|
|
1537
1607
|
"name": "useClipboard",
|
|
1538
1608
|
"slug": "use-clipboard",
|
package/dist/mcp/index.js
CHANGED
|
File without changes
|