{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "chain-of-thought",
  "title": "Chain of Thought",
  "description": "A summary of the steps an agent took, which opens into each step's details.",
  "dependencies": [
    "@kind-ui/agent-ui@0.9.0",
    "@ui-sdk/core@0.1.0-beta.17",
    "@ui-sdk/react@0.1.0-beta.17"
  ],
  "registryDependencies": [
    "@kind-ui/agent-ui-setup"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/react/chain-of-thought.tsx",
      "content": "\"use client\";\n\nimport { chainOfThoughtPrimitive } from \"@kind-ui/agent-ui/core\";\nimport { createParts } from \"@ui-sdk/react/primitive\";\nimport type { ComponentProps } from \"react\";\n\nconst parts = createParts(chainOfThoughtPrimitive, {\n  root: \"div\",\n  trigger: \"button\",\n  icon: \"span\",\n  title: \"span\",\n  meta: \"span\",\n  content: \"div\",\n  list: \"ol\",\n  item: \"li\",\n  \"item-trigger\": \"button\",\n  \"item-icon\": \"span\",\n  \"item-title\": \"span\",\n  \"item-meta\": \"span\",\n  \"item-content\": \"div\",\n});\n\nexport type ChainOfThoughtProps = ComponentProps<typeof parts.Root>;\n\n/**\n * A summary of the steps an agent took, which expands into them. Any `children` replace the default trigger and\n * content.\n */\nexport function ChainOfThought({ children, ...props }: ChainOfThoughtProps) {\n  return <parts.Root {...props}>{children !== undefined ? children : DEFAULT_PARTS}</parts.Root>;\n}\n\nexport const ChainOfThoughtTrigger = parts.Trigger;\nexport const ChainOfThoughtIcon = parts.Icon;\nexport const ChainOfThoughtContent = parts.Content;\nexport const ChainOfThoughtItemIcon = parts.ItemIcon;\nexport const ChainOfThoughtItemContent = parts.ItemContent;\n\nexport type ChainOfThoughtTitleProps = ComponentProps<typeof parts.Title>;\n\n/** The `label`, else \"N steps\", unless you pass children. */\nexport function ChainOfThoughtTitle({ children = ({ title }) => title, ...props }: ChainOfThoughtTitleProps) {\n  return <parts.Title {...props}>{children}</parts.Title>;\n}\n\nexport type ChainOfThoughtMetaProps = ComponentProps<typeof parts.Meta>;\n\n/** The `durationSeconds`, as \"N s\", unless you pass children. */\nexport function ChainOfThoughtMeta({\n  children = ({ duration }) => duration,\n  ...props\n}: ChainOfThoughtMetaProps) {\n  return <parts.Meta {...props}>{children}</parts.Meta>;\n}\n\nexport type ChainOfThoughtListProps = ComponentProps<typeof parts.List>;\n\n/** An item for each step, unless you pass children. */\nexport function ChainOfThoughtList({\n  children = ({ steps }) => steps.map((step) => <ChainOfThoughtItem key={step.id} value={step.id} />),\n  ...props\n}: ChainOfThoughtListProps) {\n  return <parts.List {...props}>{children}</parts.List>;\n}\n\nexport type ChainOfThoughtItemProps = ComponentProps<typeof parts.Item>;\n\n/** The step whose `id` is `value`. Without children, it shows the step's trigger. */\nexport function ChainOfThoughtItem({ children, ...props }: ChainOfThoughtItemProps) {\n  return <parts.Item {...props}>{children !== undefined ? children : DEFAULT_ITEM_PARTS}</parts.Item>;\n}\n\nexport type ChainOfThoughtItemTriggerProps = ComponentProps<typeof parts.ItemTrigger>;\n\n/** Opens and closes the step's content. Without children, it shows the step's icon, title and duration. */\nexport function ChainOfThoughtItemTrigger({\n  children = DEFAULT_ITEM_TRIGGER_PARTS,\n  ...props\n}: ChainOfThoughtItemTriggerProps) {\n  return <parts.ItemTrigger {...props}>{children}</parts.ItemTrigger>;\n}\n\nexport type ChainOfThoughtItemTitleProps = ComponentProps<typeof parts.ItemTitle>;\n\n/** The step's `title`, unless you pass children. */\nexport function ChainOfThoughtItemTitle({\n  children = ({ title }) => title,\n  ...props\n}: ChainOfThoughtItemTitleProps) {\n  return <parts.ItemTitle {...props}>{children}</parts.ItemTitle>;\n}\n\nexport type ChainOfThoughtItemMetaProps = ComponentProps<typeof parts.ItemMeta>;\n\n/** The step's `durationSeconds`, as \"N s\", unless you pass children. */\nexport function ChainOfThoughtItemMeta({\n  children = ({ duration }) => duration,\n  ...props\n}: ChainOfThoughtItemMetaProps) {\n  return <parts.ItemMeta {...props}>{children}</parts.ItemMeta>;\n}\n\n// Shared, so an update to the steps doesn't render the default parts' wrappers again.\nconst DEFAULT_ITEM_TRIGGER_PARTS = (\n  <>\n    <ChainOfThoughtItemIcon />\n    <ChainOfThoughtItemTitle />\n    <ChainOfThoughtItemMeta />\n  </>\n);\n\nconst DEFAULT_ITEM_PARTS = <ChainOfThoughtItemTrigger />;\n\nconst DEFAULT_PARTS = (\n  <>\n    <ChainOfThoughtTrigger>\n      <ChainOfThoughtIcon />\n      <ChainOfThoughtTitle />\n      <ChainOfThoughtMeta />\n    </ChainOfThoughtTrigger>\n    <ChainOfThoughtContent>\n      <ChainOfThoughtList />\n    </ChainOfThoughtContent>\n  </>\n);\n",
      "type": "registry:ui",
      "target": "@ui/chain-of-thought.tsx"
    }
  ],
  "meta": {
    "layer": "react"
  },
  "type": "registry:ui"
}
