import { CircleAlert } from "lucide-react"; import type { ManagedAgent } from "@/shared/api/types"; import { cn } from "@/shared/lib/cn"; import { Skeleton } from "@/shared/ui/skeleton"; import { CopyButton } from "./CopyButton"; import { describeLogFile } from "./agentUi"; export function ManagedAgentLogPanel({ error, isLoading, logContent, selectedAgent, variant = "section", }: { error: Error | null; isLoading: boolean; logContent: string | null; selectedAgent: ManagedAgent | null; variant?: "inline" | "section"; }) { const isInline = variant === "inline"; if (!selectedAgent && isInline) { return null; } return (

Harness log

{selectedAgent ? `${selectedAgent.name} ยท ${describeLogFile(selectedAgent.logPath)}` : "Select a local agent to inspect recent output."}

{selectedAgent ? ( ) : null}
{!selectedAgent ? (

No local agent selected

Pick a managed agent to view the latest ACP log output.

) : isLoading ? (
) : (
{selectedAgent.name} {selectedAgent.status}
            {logContent?.trim() ? logContent : "No log output yet."}
          
)} {error ? (

{error.message}

) : null}
); }