import { useState } from "react"; import { cn } from "@/lib/utils"; import { ChevronRight } from "lucide-react"; import type { TaskChatThinkingItem } from "./task-chat-model"; import { statusLabelIcon } from "./tool-taxonomy"; /** * Chain-of-thought (ACP agent_thought_chunk) in nested tool-row grammar * (PAP-359): a Brain-led header at the same level as tool rows — no rail or * extra indent on the header itself — whose label shimmers while streaming * ("Thinking…") and settles to "Thought for Ns". Clicking toggles the recessed * pre-wrap thought body (left-rail inset, like tool detail). Streams open; * settled history arrives collapsed and re-expands on click. No card chrome — * thinking is activity metadata, subordinate to real content. */ export function TaskChatThinkingBlock({ item }: { item: TaskChatThinkingItem }) { const [open, setOpen] = useState(!item.collapsed); const settledLabel = item.summaryLabel ?? "Thought process"; const BrainIcon = statusLabelIcon("Thinking"); return (
{line}
))} {item.streaming ? ( ) : null}