{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "reasoning-vue",
  "title": "Reasoning (Vue)",
  "description": "The model's thinking as a step, with its thoughts streamed as markdown.",
  "dependencies": [
    "@kind-ui/agent-ui@0.9.0",
    "@ui-sdk/core@0.1.0-beta.17",
    "@ui-sdk/vue@0.1.0-beta.17"
  ],
  "registryDependencies": [
    "@kind-ui/agent-ui-setup",
    "@kind-ui/markdown-vue"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/vue/reasoning.ts",
      "content": "import { reasoningPrimitive } from \"@kind-ui/agent-ui/core\";\nimport { createParts } from \"@ui-sdk/vue/primitive\";\nimport { type Component, defineComponent, h, type Slot, type VNodeChild } from \"vue\";\nimport { Markdown } from \"./markdown\";\n\nconst parts = createParts(reasoningPrimitive, {\n  root: \"div\",\n  trigger: \"button\",\n  icon: \"span\",\n  title: \"span\",\n  content: \"div\",\n});\n\n// A part whose default slot falls back to `fallback`, as React's default `children` do.\nconst withDefault = <State, Part extends Component = Component>(\n  part: Part,\n  name: string,\n  fallback: (scope: { state: State }) => VNodeChild,\n): Part =>\n  defineComponent({\n    name,\n    inheritAttrs: false,\n    setup(_, { attrs, slots }) {\n      return () => h(part as Component, attrs, { ...slots, default: slots.default ?? (fallback as Slot) });\n    },\n  }) as unknown as Part;\n\nexport const ReasoningTrigger = parts.Trigger;\nexport const ReasoningIcon = parts.Icon;\n\n/** \"Thinking\", \"Thought for N s\" or the `label`, unless you fill the slot. */\nexport const ReasoningTitle = withDefault<{ title: string }>(\n  parts.Title,\n  \"ReasoningTitle\",\n  ({ state }) => state.title,\n);\n\n/** The `text` as markdown, streaming while the step runs, unless you fill the slot. */\nexport const ReasoningContent = withDefault<{ text: string; streaming: boolean }>(\n  parts.Content,\n  \"ReasoningContent\",\n  ({ state }) => h(Markdown, { source: state.text, streaming: state.streaming }),\n);\n\nconst defaultParts = () => [\n  h(ReasoningTrigger, null, () => [h(ReasoningIcon), h(ReasoningTitle)]),\n  h(ReasoningContent),\n];\n\n/**\n * The model's thinking as a step: \"Thinking\" while it runs, \"Thought for N s\" once done, and its `text` as streamed\n * markdown. A default slot replaces the default trigger and content.\n */\nexport const Reasoning = withDefault(parts.Root, \"Reasoning\", defaultParts);\n",
      "type": "registry:ui",
      "target": "@ui/vue/reasoning.ts"
    }
  ],
  "meta": {
    "layer": "vue"
  },
  "type": "registry:ui"
}
