import { Bot, Brain, ChevronDown, Radio, TerminalSquare } from "lucide-react";
import { cn } from "@/shared/lib/cn";
import { Markdown } from "@/shared/ui/markdown";
import type { TranscriptItem } from "./agentSessionTypes";
import { ToolItem } from "./AgentSessionToolItem";
export function AgentSessionTranscriptList({
agentName,
emptyDescription,
items,
}: {
agentName: string;
emptyDescription: string;
items: TranscriptItem[];
}) {
if (items.length === 0) {
return (
No ACP activity yet
{emptyDescription}
);
}
return (
{items.map((item) => (
))}
);
}
function TranscriptItemView({
agentName,
item,
}: {
agentName: string;
item: TranscriptItem;
}) {
if (item.type === "message") {
return ;
}
if (item.type === "tool") {
return ;
}
if (item.type === "thought") {
return ;
}
if (item.type === "metadata") {
return ;
}
return ;
}
function MessageItem({
agentName,
item,
}: {
agentName: string;
item: Extract;
}) {
const isAssistant = item.role === "assistant";
const text = item.text.trim();
return (
{isAssistant ? (
{agentName}
) : null}
{isAssistant ? (
) : (
{text}
)}
);
}
function ThoughtItem({
item,
}: {
item: Extract;
}) {
return (
{item.title}
);
}
function MetadataItem({
item,
}: {
item: Extract;
}) {
return (
{item.title}
{item.sections.length} section{item.sections.length === 1 ? "" : "s"}
{item.sections.map((section) => (
{section.title}
{section.body.trim() || "No metadata."}
))}
);
}
function LifecycleItem({
item,
}: {
item: Extract;
}) {
const isError = item.title.toLowerCase().includes("error");
return (
{item.title}
{item.text ? - {item.text} : null}
);
}