{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "chat",
  "type": "registry:ui",
  "title": "Chat",
  "description": "Chat for accessible, provider-independent AI conversations.",
  "dependencies": [],
  "devDependencies": [],
  "registryDependencies": [
    "https://components.dethink.co.uk/r/chat-core.json",
    "https://components.dethink.co.uk/r/prompt-input.json",
    "https://components.dethink.co.uk/r/chat-message.json",
    "https://components.dethink.co.uk/r/message-scroller.json",
    "https://components.dethink.co.uk/r/live-region.json",
    "https://components.dethink.co.uk/r/chat-activity.json",
    "https://components.dethink.co.uk/r/chat-attachment.json",
    "https://components.dethink.co.uk/r/model-picker.json",
    "https://components.dethink.co.uk/r/conversation-list.json"
  ],
  "files": [
    {
      "path": "packages/components/src/components/chat/chat.tsx",
      "type": "registry:file",
      "target": "~/components/dethink/components/chat/chat.tsx",
      "content": "\"use client\";\n\nimport type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { useHydrated } from \"../../utils/use-hydrated\";\nimport { LiveRegionProvider, Announcer } from \"../live-region\";\nimport { chatRunLabel } from \"./chat-state\";\nimport {\n  MessageList,\n  MessageScroller,\n  type MessageListProps,\n  type MessageScrollerProps,\n} from \"./message-scroller\";\nimport { PromptInput, type PromptInputProps } from \"./prompt-input\";\nimport { ChatActivity, type ChatActivityProps } from \"./chat-activity\";\nimport type {\n  ChatMessageActionHandlers,\n  ChatMessageData,\n  ChatPartRenderer,\n  ChatRun,\n} from \"./types\";\n\nexport interface ChatProps extends Omit<\n  HTMLAttributes<HTMLElement>,\n  \"onSubmit\"\n> {\n  conversationId: string;\n  messages: readonly ChatMessageData[];\n  run?: ChatRun;\n  header?: ReactNode;\n  emptyState?: ReactNode;\n  composer?: ReactNode;\n  prompt?: Omit<PromptInputProps, \"conversationId\" | \"run\">;\n  renderPart?: ChatPartRenderer;\n  messageActions?: ChatMessageActionHandlers;\n  activity?: Omit<ChatActivityProps, \"run\">;\n  scroll?: Omit<MessageScrollerProps, \"children\" | \"revision\" | \"messageCount\">;\n  history?: Omit<MessageListProps, \"messages\" | \"renderPart\" | \"actions\">;\n}\nexport function Chat({\n  conversationId,\n  messages,\n  run,\n  header,\n  emptyState,\n  composer,\n  prompt,\n  renderPart,\n  messageActions,\n  activity,\n  scroll,\n  history,\n  children,\n  className,\n  \"aria-label\": label = \"AI conversation\",\n  ...props\n}: ChatProps) {\n  const status = chatRunLabel(run, activity?.items);\n  const hydrated = useHydrated();\n  return (\n    <section\n      {...props}\n      data-slot=\"chat\"\n      data-hydrated={hydrated}\n      aria-label={label}\n      className={cn(\n        \"bg-background text-foreground flex h-[640px] min-h-0 min-w-0 flex-col overflow-hidden\",\n        className,\n      )}\n    >\n      <LiveRegionProvider>\n        {header}\n        <MessageScroller\n          key={conversationId}\n          {...scroll}\n          revision={messages}\n          messageCount={messages.length}\n          lastMessageId={messages[messages.length - 1]?.id}\n        >\n          {messages.length ? (\n            <MessageList\n              {...history}\n              messages={messages}\n              renderPart={renderPart}\n              actions={messageActions}\n            />\n          ) : (\n            emptyState\n          )}\n          {run && <ChatActivity {...activity} run={run} />}\n          {children}\n        </MessageScroller>\n        <div className=\"mx-auto w-full max-w-3xl shrink-0 px-4 pt-2 pb-4 sm:px-8\">\n          {composer ??\n            (prompt && (\n              <PromptInput\n                key={conversationId}\n                {...prompt}\n                conversationId={conversationId}\n                run={run}\n              />\n            ))}\n        </div>\n        <Announcer\n          coalesceKey={`chat:${conversationId}`}\n          message={status}\n          debounceMs={180}\n        />\n      </LiveRegionProvider>\n    </section>\n  );\n}\n"
    },
    {
      "path": "packages/components/src/components/chat/index.ts",
      "type": "registry:file",
      "target": "~/components/dethink/components/chat/index.ts",
      "content": "export * from \"./types\";\nexport * from \"./chat-state\";\nexport * from \"./chat\";\nexport * from \"./prompt-input\";\nexport * from \"./chat-message\";\nexport * from \"./message-scroller\";\nexport * from \"./chat-activity\";\nexport * from \"./typing-indicator\";\nexport * from \"./chat-attachment\";\nexport * from \"./model-picker\";\nexport * from \"./conversation-list\";\n"
    }
  ]
}
