@blueking/chat-x 0.0.33 → 0.0.34
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.
|
@@ -160,6 +160,8 @@ ActivityMessage 展示活动类消息:知识检索(knowledge_rag)、引用
|
|
|
160
160
|
- **节点列表**:每个节点显示状态圆点、名称和耗时;hover 时出现「详情」按钮
|
|
161
161
|
- **节点详情**:点击「详情」按钮会通过 `useCustomTabConsumer` 在 `ChatContainer` 侧边栏新增自定义 Tab,展示节点配置(基础信息、输入参数、输出参数)
|
|
162
162
|
|
|
163
|
+
> `FlowAgentContent` 会读取 `ChatContainer` 注入的 `renderMode`。当 `renderMode === RenderMode.Share` 时,节点列表仅展示状态和名称,不展示节点耗时与「详情」按钮,避免分享预览中出现可交互的节点详情入口。独立使用 `ActivityMessage` 且没有上层 Provider 时,默认按 `Chat` 模式渲染。
|
|
164
|
+
|
|
163
165
|
### 内部渲染结构
|
|
164
166
|
|
|
165
167
|
```
|
|
@@ -286,6 +288,7 @@ const messages = [
|
|
|
286
288
|
| `success` | FINISHED | #18B456 |
|
|
287
289
|
| `failed` | FAILED / REVOKED / ROLL_BACK_FAILED | #EA3636 |
|
|
288
290
|
| `suspended` | SUSPENDED | #F59500 |
|
|
291
|
+
| `pending` | PENDING | #DCDEE5 |
|
|
289
292
|
|
|
290
293
|
### 节点详情 Tab
|
|
291
294
|
|
|
@@ -377,7 +380,7 @@ enum MessageContentType {
|
|
|
377
380
|
| ------------ | --------------------------------------------------------------------------- | ------ | --------------------------------------------------------- |
|
|
378
381
|
| content | `ReferenceDocumentContent[] \| KnowledgeRagContent \| BkFlowMessageContent` | - | 内容数据,格式随 `activityType` 不同 |
|
|
379
382
|
| activityType | `'knowledge_rag' \| 'flow_agent' \| 'reference_document' \| string` | - | 活动类型,决定渲染模式(知识检索 / FlowAgent / 引用文档) |
|
|
380
|
-
| status | `MessageStatus` | - |
|
|
383
|
+
| status | `MessageStatus` | - | 消息状态;在 `knowledge_rag` 模式下影响标题和图标,在 `flow_agent` 模式下影响标题 Loading 状态 |
|
|
381
384
|
| id | `string \| number` | - | 消息 ID |
|
|
382
385
|
| messageId | `string \| number` | - | 消息唯一标识 |
|
|
383
386
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!-- AI SUMMARY -->
|
|
2
2
|
## 快速了解
|
|
3
3
|
|
|
4
|
-
ChatContainer 提供完整 AI 对话布局:分栏(ResizeLayout)、消息列表(MessageContainer)、输入(ChatInput)、执行摘要(ExecutionSummary)、快捷表单(ShortcutRender)与多选栏(SelectionFooter)。 内置 useMessageGroup、分享与自定义 Tab 等能力;对 MessageContainer/ChatInput 下推 inputStatus(末尾 Loading 占位时推导 Fetching),适合一站式接入。 通过 props 传入 messages、shortcuts 等,事件与 ChatInput/MessageContainer
|
|
4
|
+
ChatContainer 提供完整 AI 对话布局:分栏(ResizeLayout)、消息列表(MessageContainer)、输入(ChatInput)、执行摘要(ExecutionSummary)、快捷表单(ShortcutRender)与多选栏(SelectionFooter)。 内置 useMessageGroup、分享与自定义 Tab 等能力;对 MessageContainer/ChatInput 下推 inputStatus(末尾 Loading 占位时推导 Fetching),适合一站式接入。 通过 props 传入 messages、shortcuts 等,事件与 ChatInput/MessageContainer 对齐;renderMode 会通过内部 provide 下传给子内容组件。
|
|
5
5
|
|
|
6
6
|
### 关联组件
|
|
7
7
|
- **message-container** — 消息列表与滚动区域
|
|
@@ -27,6 +27,7 @@ ChatContainer 提供完整 AI 对话布局:分栏(ResizeLayout)、消息
|
|
|
27
27
|
- **执行摘要**:侧边栏展示工具调用 / FlowAgent 执行记录,支持关键词搜索和对话定位
|
|
28
28
|
- **自定义 Tab**:通过 `useCustomTabProvider` 支持动态添加自定义 Tab(如节点详情)
|
|
29
29
|
- **分享模式**:内置消息多选分享流程,选中用户消息后确认分享
|
|
30
|
+
- **渲染模式注入**:`renderMode` 会通过内部 Provider 下传给后代内容组件;例如 FlowAgent 节点在 `Share` 模式下隐藏耗时和「详情」入口
|
|
30
31
|
- **空状态欢迎页**:无消息时展示欢迎语和开场白
|
|
31
32
|
|
|
32
33
|
## 组件结构
|
|
@@ -366,7 +367,7 @@ ChatContainer 的 Props 继承自 `ChatInputProps` 和 `MessageContainerProps`
|
|
|
366
367
|
| confirmShare | `(messages: Message[])` | 确认分享,携带选中的消息 |
|
|
367
368
|
| collapseChange | `(isCollapse: boolean, width: number)` | 侧边栏折叠/展开状态变化 |
|
|
368
369
|
| selectShortcut | `(shortcut: Shortcut)` | 选择快捷指令(继承自 ChatInput) |
|
|
369
|
-
| deleteShortcut |
|
|
370
|
+
| deleteShortcut | — | 删除已选快捷指令(继承自 ChatInput) |
|
|
370
371
|
|
|
371
372
|
### Slots
|
|
372
373
|
|
|
@@ -385,15 +386,17 @@ ChatContainer 的 Props 继承自 `ChatInputProps` 和 `MessageContainerProps`
|
|
|
385
386
|
| addCustomTab | `(tab: CustomTab) => void` | 添加自定义 Tab |
|
|
386
387
|
| removeCustomTab | `(tabName: string) => void` | 移除自定义 Tab |
|
|
387
388
|
| selectCustomTab | `(tab: CustomTab) => void` | 切换到指定 Tab |
|
|
389
|
+
| enterShareMode | `() => void` | 手动进入分享多选模式 |
|
|
390
|
+
| exitShareMode | `() => void` | 退出分享多选模式,并清空已选消息 |
|
|
388
391
|
|
|
389
392
|
## 渲染模式
|
|
390
393
|
|
|
391
|
-
通过 `v-model:render-mode`
|
|
394
|
+
通过 `v-model:render-mode` 控制容器的渲染行为。`ChatContainer` 会把当前 `renderMode` 注入给后代组件,供内容渲染根据场景收敛交互能力。
|
|
392
395
|
|
|
393
396
|
| `renderMode` | 侧边栏 Tab / 折叠按钮 | 底部输入区域 | MessageTools 工具栏 | 说明 |
|
|
394
397
|
| ------------ | ---------------------- | --------------------------------- | --------------------- | -------------------------------- |
|
|
395
398
|
| `Chat` | 正常显示 | 正常显示(ChatInput / ShortcutRender / SelectionFooter) | 全部工具按钮 | 默认对话模式 |
|
|
396
|
-
| `Share` | **隐藏** | **隐藏** | **隐藏**(多选模式) |
|
|
399
|
+
| `Share` | **隐藏** | **隐藏** | **隐藏**(多选模式) | 分享预览模式,仅展示消息;FlowAgent 节点会隐藏耗时和「详情」入口 |
|
|
397
400
|
| `Test` | 正常显示 | 正常显示 | 过滤掉「分享」按钮 | 测试/嵌入模式,隐藏分享入口 |
|
|
398
401
|
|
|
399
402
|
```vue
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "2.0.0",
|
|
3
|
-
"generatedAt": "2026-04-
|
|
3
|
+
"generatedAt": "2026-04-27T03:31:37.817Z",
|
|
4
4
|
"domains": {
|
|
5
5
|
"message": {
|
|
6
6
|
"label": "消息展示",
|
|
@@ -538,7 +538,7 @@
|
|
|
538
538
|
"slug": "chat-container",
|
|
539
539
|
"category": "molecular",
|
|
540
540
|
"description": "顶层聊天容器组件,整合了 `MessageContainer`(消息列表)、`ChatInput`(输入框)、`ExecutionSummary`(执行摘要面板)、`ShortcutRender`(快捷指令表单)和 `SelectionFooter`(多选操作栏)。提供完整的 AI 对话界面布局能力。",
|
|
541
|
-
"aiSummary": "ChatContainer 提供完整 AI 对话布局:分栏(ResizeLayout)、消息列表(MessageContainer)、输入(ChatInput)、执行摘要(ExecutionSummary)、快捷表单(ShortcutRender)与多选栏(SelectionFooter)。 内置 useMessageGroup、分享与自定义 Tab 等能力;对 MessageContainer/ChatInput 下推 inputStatus(末尾 Loading 占位时推导 Fetching),适合一站式接入。 通过 props 传入 messages、shortcuts 等,事件与 ChatInput/MessageContainer
|
|
541
|
+
"aiSummary": "ChatContainer 提供完整 AI 对话布局:分栏(ResizeLayout)、消息列表(MessageContainer)、输入(ChatInput)、执行摘要(ExecutionSummary)、快捷表单(ShortcutRender)与多选栏(SelectionFooter)。 内置 useMessageGroup、分享与自定义 Tab 等能力;对 MessageContainer/ChatInput 下推 inputStatus(末尾 Loading 占位时推导 Fetching),适合一站式接入。 通过 props 传入 messages、shortcuts 等,事件与 ChatInput/MessageContainer 对齐;renderMode 会通过内部 provide 下传给子内容组件。",
|
|
542
542
|
"relatedComponents": [
|
|
543
543
|
{
|
|
544
544
|
"slug": "message-container",
|