- 添加MinIO用户文件系统配置选项(BEAVER_MINIO_ROOT_USER等) - 更新外部连接器配置结构,包括BASE_URL和认证令牌设置 - 改进connector provider支持更多类型(official, feishu_bot等) - 实现Mistral模型推理模式支持reasoning_effort参数 - 增强外部连接器策略配置和运行时配置管理 - 添加connector bridge事件验证和安全保护机制 - 优化任务路由逻辑,区分simple_chat和new_task场景 - 更新初始技能工具提示配置,分离authoring admin功能
53 lines
1.4 KiB
TypeScript
53 lines
1.4 KiB
TypeScript
import { describe, expect, it } from 'vitest';
|
|
|
|
import { buildTaskTimelineView } from '@/lib/task-timeline-view';
|
|
import type { BackendTask, ProcessEvent } from '@/types';
|
|
|
|
function task(): BackendTask {
|
|
return {
|
|
task_id: 'task-1',
|
|
session_id: 'web:default',
|
|
description: 'Build report',
|
|
goal: 'Build report',
|
|
constraints: [],
|
|
priority: 0,
|
|
status: 'running',
|
|
creator: 'user',
|
|
created_at: '2026-06-04T00:00:00.000Z',
|
|
updated_at: '2026-06-04T00:01:00.000Z',
|
|
run_ids: ['main-run'],
|
|
skill_names: [],
|
|
feedback: [],
|
|
metadata: {},
|
|
};
|
|
}
|
|
|
|
describe('buildTaskTimelineView', () => {
|
|
it('builds canonical task timeline cards from matching live process data', () => {
|
|
const liveEvents: ProcessEvent[] = [
|
|
{
|
|
event_id: 'plan',
|
|
run_id: 'main-run',
|
|
kind: 'task_planned',
|
|
actor_type: 'system',
|
|
actor_id: 'planner',
|
|
actor_name: 'Planner',
|
|
text: 'Plan created',
|
|
created_at: '2026-06-04T00:00:10.000Z',
|
|
},
|
|
];
|
|
|
|
const view = buildTaskTimelineView({
|
|
task: task(),
|
|
liveEvents,
|
|
});
|
|
|
|
expect(view?.cards.map((card) => card.type)).toEqual(['task_created', 'plan']);
|
|
expect(view?.process.events.map((event) => event.event_id)).toEqual(['plan']);
|
|
});
|
|
|
|
it('returns null when there is no active task to display', () => {
|
|
expect(buildTaskTimelineView({ task: null })).toBeNull();
|
|
});
|
|
});
|