'use client';
import { FileJson, FileOutput, FolderSearch, Image as ImageIcon, Link2, MessagesSquare } from 'lucide-react';
import type { ProcessArtifact, ProcessEvent, ProcessRun } from '@/types';
import { Badge } from '@/components/ui/badge';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
import { ScrollArea } from '@/components/ui/scroll-area';
import { Separator } from '@/components/ui/separator';
function statusLabel(status: string) {
if (status === 'done') return '已完成';
if (status === 'error') return '失败';
if (status === 'cancelled') return '已取消';
if (status === 'waiting') return '等待中';
if (status === 'running') return '运行中';
if (status === 'queued') return '排队中';
return status;
}
function actorTypeLabel(actorType: string) {
if (actorType === 'mcp') return 'MCP';
if (actorType === 'system') return '系统';
if (actorType === 'agent') return '智能体';
return actorType;
}
function eventKindLabel(kind: string) {
if (kind === 'run_started') return '已启动';
if (kind === 'run_progress') return '进行中';
if (kind === 'run_status') return '状态更新';
if (kind === 'run_artifact') return '产物';
if (kind === 'run_finished') return '已结束';
if (kind === 'run_cancelled') return '已取消';
return kind;
}
function artifactIcon(type: ProcessArtifact['artifact_type']) {
if (type === 'json') return
{JSON.stringify(artifact.data, null, 2)}
);
}
if (artifact.artifact_type === 'link' && artifact.url) {
return (
{artifact.url}
);
}
return (
{selectedRun ? `当前选中: ${selectedRun.actor_name}` : '选择一个任务查看详细过程与产物'}