{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "agent-message",
  "type": "registry:block",
  "title": "Agent Message",
  "description": "Composed Pearl assistant turn: thinking, timeline, todos, tools, task card, markdown, citations, follow-ups.",
  "registryDependencies": [
    "thinking-indicator",
    "tool-timeline",
    "todo-list",
    "tool-group",
    "tool-fallback",
    "task-card",
    "message-markdown",
    "citation",
    "follow-up-suggestions",
    "icon-button"
  ],
  "files": [
    {
      "path": "registry/tonic/blocks/agent-message/agent-message.tsx",
      "content": "\"use client\"\n\nimport { useState } from \"react\"\nimport { CopyIcon, RefreshCwIcon, ThumbsDownIcon, ThumbsUpIcon } from \"lucide-react\"\n\nimport { ThinkingIndicator } from \"@/registry/tonic/thinking-indicator/thinking-indicator\"\nimport { ToolTimeline } from \"@/registry/tonic/tool-timeline/tool-timeline\"\nimport { TodoListCard } from \"@/registry/tonic/todo-list/todo-list\"\nimport { ToolGroup } from \"@/registry/tonic/tool-group/tool-group\"\nimport { ToolFallback } from \"@/registry/tonic/tool-fallback/tool-fallback\"\nimport { TaskCard } from \"@/registry/tonic/task-card/task-card\"\nimport { MessageMarkdown } from \"@/registry/tonic/message-markdown/message-markdown\"\nimport {\n  extractCitationRefs,\n  MessageSources,\n} from \"@/registry/tonic/citation/citation\"\nimport { FollowUpSuggestions } from \"@/registry/tonic/follow-up-suggestions/follow-up-suggestions\"\nimport { IconButton } from \"@/registry/tonic/icon-button/icon-button\"\nimport { cn } from \"@/lib/utils\"\n\nconst FIXTURE_MARKDOWN = `Here's what I found after checking the deploy and patching the route.\n\n1. The preview was healthy.\n2. The failing check was a stale cache key.\n\nSee [1](https://docs.tonicagentic.com \"Tonic docs\") for the rollout notes.`\n\nconst FIXTURE_TODOS = [\n  {\n    content: \"Inspect preview deployment\",\n    status: \"completed\" as const,\n    priority: \"high\" as const,\n  },\n  {\n    content: \"Patch cache key\",\n    status: \"completed\" as const,\n    priority: \"medium\" as const,\n  },\n  {\n    content: \"Summarize findings\",\n    status: \"in_progress\" as const,\n    priority: \"high\" as const,\n  },\n]\n\nconst FIXTURE_STEPS = [\n  {\n    verb: \"Thought\",\n    chip: \"\",\n    detail: \"Check whether the preview failure is cache or route related.\",\n  },\n  { verb: \"Read\", chip: \"app/api/route.ts\", filePath: \"app/api/route.ts\" },\n  { verb: \"Edited\", chip: \"lib/cache.ts\", filePath: \"lib/cache.ts\" },\n]\n\n/** Composed Pearl-style assistant turn for docs demos. */\nexport function AgentMessage({ className }: { className?: string }) {\n  const [timelineOpen, setTimelineOpen] = useState(true)\n  const refs = extractCitationRefs(FIXTURE_MARKDOWN)\n\n  return (\n    <div\n      data-slot=\"agent-message\"\n      className={cn(\"flex w-full max-w-xl flex-col gap-3\", className)}\n    >\n      <ThinkingIndicator label=\"Thinking\" elapsed=\"2s\" />\n      <ToolTimeline\n        steps={FIXTURE_STEPS}\n        visibleSteps={FIXTURE_STEPS.length}\n        streaming={false}\n        open={timelineOpen}\n        onOpenChange={setTimelineOpen}\n        restingLabel=\"Worked 18s\"\n        activeLabel=\"Working\"\n        elapsed=\"18s\"\n        stats={[\n          { file: \"lib/cache.ts\", added: 12, removed: 3, filePath: \"lib/cache.ts\" },\n        ]}\n      />\n      <TodoListCard items={FIXTURE_TODOS} />\n      <ToolGroup count={2} toolName=\"bash\" defaultOpen>\n        <ToolFallback\n          toolName=\"bash\"\n          status={{ type: \"complete\" }}\n          elapsedMs={4200}\n          argsText={`{\\n  \"command\": \"pnpm test\"\\n}`}\n          result=\"12 passed\"\n        />\n        <ToolFallback\n          toolName=\"edit_file\"\n          status={{ type: \"complete\" }}\n          elapsedMs={1100}\n          argsText={`{\\n  \"path\": \"lib/cache.ts\"\\n}`}\n          result=\"ok\"\n        />\n      </ToolGroup>\n      <TaskCard\n        label=\"Coder\"\n        meta=\"subagent\"\n        state=\"done\"\n        elapsed=\"9s\"\n        result=\"Patched cache key and verified the preview.\"\n      >\n        <p className=\"text-muted-foreground text-xs\">\n          Delegated coding pass finished cleanly.\n        </p>\n      </TaskCard>\n      <MessageMarkdown text={FIXTURE_MARKDOWN} />\n      <MessageSources refs={refs} />\n      <div className=\"flex items-center gap-1\">\n        <IconButton label=\"Copy\">\n          <CopyIcon />\n        </IconButton>\n        <IconButton label=\"Retry\">\n          <RefreshCwIcon />\n        </IconButton>\n        <IconButton label=\"Good response\">\n          <ThumbsUpIcon />\n        </IconButton>\n        <IconButton label=\"Bad response\">\n          <ThumbsDownIcon />\n        </IconButton>\n      </div>\n      <FollowUpSuggestions\n        suggestions={[\n          { prompt: \"Show the diff\", title: \"Show the diff\" },\n          { prompt: \"Deploy to production\", title: \"Deploy to production\" },\n          { prompt: \"Open the preview\", title: \"Open the preview\" },\n        ]}\n      />\n    </div>\n  )\n}\n",
      "type": "registry:component"
    }
  ]
}