"use client"; import { BotIcon, PenToolIcon, PlayIcon, SearchIcon } from "lucide-react"; import type { JobKind, JobRecord } from "@/src/core"; /** * The sub-agents sidebar section (vision §2.5 live observability): what the * teacher's background fleet is doing RIGHT NOW in this session — one card * per running sub-agent with its live activity line (current tool + args) * and elapsed time, fed by the central jobs poll. * * Renders nothing when the fleet is idle (zero clutter); finished jobs * vanish from the list — their artifacts live in the transcript. Sits at * the top of the right sidebar, above the plan-tree panel. */ const KIND_META: Record = { research: { label: "Researcher", Icon: SearchIcon }, demo: { label: "Demo builder", Icon: PlayIcon }, visual: { label: "Figure maker", Icon: PenToolIcon }, }; export function SubAgentsPanel({ jobs }: { jobs: JobRecord[] }) { const running = jobs.filter((j) => j.status === "running"); if (running.length === 0) return null; return ( ); } function elapsedOf(job: JobRecord): string { if (!job.createdAt) return ""; const seconds = Math.max(0, Math.round((Date.now() - Date.parse(job.createdAt)) / 1000)); return seconds < 60 ? `${seconds}s` : `${Math.floor(seconds / 60)}m ${seconds % 60}s`; }