"use client"; import type React from "react"; import { StatusBadge } from "@/components/ui"; import { TimelineEvent } from "@/components/TaskLiveStatus"; import { humanToolName, TaskEvent } from "@/lib/task-types"; export type LlmUsage = { step: string; provider: string; backend: string; model: string; display: string; input_tokens: number; output_tokens: number; cost_usd: number; }; export type RunHistory = { run_number: number; follow_up?: string | null; summary?: string; resolved?: boolean; run_cost_usd?: number; llm_usage?: LlmUsage[]; }; export function formatCost(usd: number | undefined | null) { if (usd === undefined || usd === null) return "$0.0000"; if (usd === 0) return "$0.00 (local)"; return `$${usd.toFixed(4)}`; } export function TaskScopeCard({ task, report }: { task: any; report: any }) { const rule = report?.matched_rule; const checked = report?.devices_checked || []; return (
{task.issue}
{rule.name || rule.id}
Plain-language progress; expand events only when evidence is needed.
| {cell} | ))}
|---|
| {cell} | ))}
{text}
)}
{summary}
{finding.description}
}{report.root_cause || report.resolution || "No notable finding recorded."}
| Step | Type | Model | Cost |
|---|---|---|---|
| {u.step} | {providerLabel(u.provider)} | {u.display || u.model} | {formatCost(u.cost_usd)} |
No LLM usage recorded.
)}Follow-up: {r.follow_up}
} {r.summary &&{r.summary}
}