@blueking/chat-x 0.0.34 → 0.0.35

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.
@@ -151,12 +151,12 @@ ActivityMessage 展示活动类消息:知识检索(knowledge_rag)、引用
151
151
 
152
152
  ## FlowAgent 执行情况模式
153
153
 
154
- `activityType` 设为 `MessageContentType.FlowAgent`(`'flow_agent'`),`content` 传入 `BkFlowMessageContent` 对象。用于展示蓝鲸标准运维(BkFlow)任务的执行状态、节点列表和统计信息。
154
+ `activityType` 设为 `MessageContentType.FlowAgent`(`'flow_agent'`),`content` 传入 `BkFlowMessageContent` 任务数组。用于展示一个或多个蓝鲸标准运维(BkFlow)任务的执行状态、节点列表和统计信息。
155
155
 
156
156
  ### 核心交互
157
157
 
158
- - **标题栏**:显示「执行情况」+ 各状态计数(执行中 / 成功 / 失败 / 挂起),颜色区分
159
- - **任务组**:可折叠/展开的任务行,带状态图标和总耗时
158
+ - **标题栏**:显示「执行情况」+ 所有任务聚合后的各状态计数(执行中 / 成功 / 失败 / 挂起),颜色区分
159
+ - **任务组**:逐个展示任务行,带状态图标和总耗时
160
160
  - **节点列表**:每个节点显示状态圆点、名称和耗时;hover 时出现「详情」按钮
161
161
  - **节点详情**:点击「详情」按钮会通过 `useCustomTabConsumer` 在 `ChatContainer` 侧边栏新增自定义 Tab,展示节点配置(基础信息、输入参数、输出参数)
162
162
 
@@ -171,7 +171,7 @@ FlowAgentContent(activityType = 'flow_agent')
171
171
  │ ├── Loading / ArrowIcon(随 status 切换)
172
172
  │ └── 执行情况:执行中 N / 成功 N / 失败 N / 挂起 N
173
173
  └── #default
174
- └── TaskGroup
174
+ └── TaskGroup × N
175
175
  ├── TaskHeader(可折叠/展开)
176
176
  │ ├── 状态图标(running=Loading / success / failed / suspended)
177
177
  │ ├── task_name(HighlightKeyword 支持搜索高亮)
@@ -204,54 +204,56 @@ FlowAgentContent(activityType = 'flow_agent')
204
204
  const collapsed = ref(false);
205
205
  const status = ref(MessageStatus.Complete);
206
206
 
207
- const flowContent: BkFlowMessageContent = {
208
- task_id: 100,
209
- task_name: '数据清洗流程',
210
- task_state: 'FINISHED',
211
- task_outputs: [],
212
- statistics: {
213
- total: 3,
214
- state_counts: { FINISHED: 2, FAILED: 1 },
215
- },
216
- nodes: {
217
- node1: {
218
- id: 'node1',
219
- name: '数据拉取',
220
- state: 'FINISHED',
221
- elapsed_time: 12,
222
- start_time: '2025-01-01 10:00:00',
223
- finish_time: '2025-01-01 10:00:12',
224
- loop: 1,
225
- retry: 0,
226
- skip: false,
227
- type: 'ServiceActivity',
228
- },
229
- node2: {
230
- id: 'node2',
231
- name: '数据转换',
232
- state: 'FINISHED',
233
- elapsed_time: 45,
234
- start_time: '2025-01-01 10:00:12',
235
- finish_time: '2025-01-01 10:00:57',
236
- loop: 1,
237
- retry: 0,
238
- skip: false,
239
- type: 'ServiceActivity',
207
+ const flowContent: BkFlowMessageContent = [
208
+ {
209
+ task_id: 100,
210
+ task_name: '数据清洗流程',
211
+ task_state: 'FINISHED',
212
+ task_outputs: [],
213
+ statistics: {
214
+ total: 3,
215
+ state_counts: { FINISHED: 2, FAILED: 1 },
240
216
  },
241
- node3: {
242
- id: 'node3',
243
- name: '结果写入',
244
- state: 'FAILED',
245
- elapsed_time: 3,
246
- start_time: '2025-01-01 10:00:57',
247
- finish_time: '2025-01-01 10:01:00',
248
- loop: 1,
249
- retry: 0,
250
- skip: false,
251
- type: 'ServiceActivity',
217
+ nodes: {
218
+ node1: {
219
+ id: 'node1',
220
+ name: '数据拉取',
221
+ state: 'FINISHED',
222
+ elapsed_time: 12,
223
+ start_time: '2025-01-01 10:00:00',
224
+ finish_time: '2025-01-01 10:00:12',
225
+ loop: 1,
226
+ retry: 0,
227
+ skip: false,
228
+ type: 'ServiceActivity',
229
+ },
230
+ node2: {
231
+ id: 'node2',
232
+ name: '数据转换',
233
+ state: 'FINISHED',
234
+ elapsed_time: 45,
235
+ start_time: '2025-01-01 10:00:12',
236
+ finish_time: '2025-01-01 10:00:57',
237
+ loop: 1,
238
+ retry: 0,
239
+ skip: false,
240
+ type: 'ServiceActivity',
241
+ },
242
+ node3: {
243
+ id: 'node3',
244
+ name: '结果写入',
245
+ state: 'FAILED',
246
+ elapsed_time: 3,
247
+ start_time: '2025-01-01 10:00:57',
248
+ finish_time: '2025-01-01 10:01:00',
249
+ loop: 1,
250
+ retry: 0,
251
+ skip: false,
252
+ type: 'ServiceActivity',
253
+ },
252
254
  },
253
255
  },
254
- };
256
+ ];
255
257
  </script>
256
258
  ```
257
259
 
@@ -264,16 +266,18 @@ const messages = [
264
266
  role: 'activity',
265
267
  activityType: MessageContentType.FlowAgent, // 'flow_agent'
266
268
  status: MessageStatus.Streaming,
267
- content: {
268
- task_id: 100,
269
- task_name: '数据清洗流程',
270
- task_state: 'RUNNING',
271
- task_outputs: [],
272
- statistics: { total: 3, state_counts: { RUNNING: 1, FINISHED: 2 } },
273
- nodes: {
274
- /* ... */
269
+ content: [
270
+ {
271
+ task_id: 100,
272
+ task_name: '数据清洗流程',
273
+ task_state: 'RUNNING',
274
+ task_outputs: [],
275
+ statistics: { total: 3, state_counts: { RUNNING: 1, FINISHED: 2 } },
276
+ nodes: {
277
+ /* ... */
278
+ },
275
279
  },
276
- },
280
+ ],
277
281
  },
278
282
  ];
279
283
  ```
@@ -301,14 +305,16 @@ const messages = [
301
305
  ### 相关类型定义
302
306
 
303
307
  ```typescript
304
- import { MessageContentType, type BkFlowMessageContent, type BkFlowNode } from '@blueking/chat-x';
308
+ import { MessageContentType, type BkFlowMessageContent, type BkFlowNode, type BkFlowTask } from '@blueking/chat-x';
309
+
310
+ type BkFlowMessageContent = BkFlowTask[];
305
311
 
306
- type BkFlowMessageContent = {
312
+ type BkFlowTask = {
307
313
  nodes: Record<string, BkFlowNode>;
308
314
  statistics: { state_counts: Record<string, number>; total: number };
309
315
  task_id: number;
310
316
  task_name: string;
311
- task_outputs: unknown[];
317
+ task_outputs: unknown;
312
318
  task_state: string;
313
319
  };
314
320
 
@@ -111,7 +111,7 @@ const isExecutionMessage = (m: Message): boolean => {
111
111
  | 消息类型 | 搜索范围 |
112
112
  | ---------- | ------------------------------------------------------------ |
113
113
  | toolCall | `function.name`、`mcpName`、`description`、`arguments`、`id` |
114
- | flow_agent | `task_name`、各节点 `name` |
114
+ | flow_agent | 各任务 `task_name`、各节点 `name` |
115
115
 
116
116
  ## 分享模式
117
117
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": "2.0.0",
3
- "generatedAt": "2026-04-27T03:31:37.817Z",
3
+ "generatedAt": "2026-05-12T09:32:40.415Z",
4
4
  "domains": {
5
5
  "message": {
6
6
  "label": "消息展示",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueking/chat-x",
3
- "version": "0.0.34",
3
+ "version": "0.0.35",
4
4
  "description": "蓝鲸智云 AI Chat 组件库 —— 遵循 AG-UI,为 AI Agent 和人类开发者共同设计的对话 UI 组件库。",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -78,7 +78,7 @@
78
78
  "vitepress": "2.0.0-alpha.16",
79
79
  "vitest": "^4.0.18",
80
80
  "vue-tsc": "^3.1.4",
81
- "@blueking/chat-helper": "0.0.2"
81
+ "@blueking/chat-helper": "0.0.3"
82
82
  },
83
83
  "scripts": {
84
84
  "dev": "vite --config vite.config.ts",