"use client"; import { useEffect, useRef } from "react"; import type { LogEntry, LogLevel } from "@/lib/types"; const LEVEL_CFG: Record< LogLevel, { tag: string; tagCls: string; msgCls: string } > = { init: { tag: "INIT", tagCls: "border-cyan-400/30 bg-cyan-400/10 text-cyan-400", msgCls: "text-slate-200" }, info: { tag: "INFO", tagCls: "border-slate-500/30 bg-slate-500/10 text-slate-400", msgCls: "text-slate-300" }, success: { tag: "DONE", tagCls: "border-emerald-400/30 bg-emerald-400/10 text-emerald-400", msgCls: "text-slate-100" }, warn: { tag: "WARN", tagCls: "border-amber-400/30 bg-amber-400/10 text-amber-400", msgCls: "text-amber-100" }, error: { tag: "ERR", tagCls: "border-red-400/30 bg-red-400/10 text-red-400", msgCls: "text-red-100" }, stream: { tag: "STRM", tagCls: "border-violet-400/30 bg-violet-400/10 text-violet-400", msgCls: "text-slate-200" } }; type TerminalLogProps = { entries: LogEntry[]; isStreaming?: boolean; }; export function TerminalLog({ entries, isStreaming = false }: TerminalLogProps) { const endRef = useRef(null); useEffect(() => { endRef.current?.scrollIntoView({ behavior: "smooth" }); }, [entries]); return (

Agent Activity

{entries.length} events
    {entries.map((entry) => { const cfg = LEVEL_CFG[entry.level]; // Slice UTC ISO string to "HH:MM:SS" — timezone-stable, no locale divergence. const time = entry.timestamp ? new Date(entry.timestamp).toISOString().slice(11, 19) : ""; return (
  • {cfg.tag} {entry.message} {time}
  • ); })} {isStreaming && (
  • STRM Processing...
  • )}
); }