{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "tool-error",
  "title": "Tool Error",
  "description": "A recoverable connection failure with a clear explanation and compact recovery actions.",
  "dependencies": [
    "@solar-icons/react@^2.2.0",
    "cn@^0.3.0"
  ],
  "registryDependencies": [
    "button",
    "https://pastaui.com/r/pastaui-styles.json"
  ],
  "files": [
    {
      "path": "src/components/ai/tool-error.tsx",
      "content": "import { DangerTriangleIcon as DangerIcon } from '@solar-icons/react/bold/danger-triangle'\nimport * as React from 'react'\n\nimport { Button } from '@/components/ui/button'\nimport { cn } from 'cn'\n\ninterface ToolErrorProps extends React.ComponentProps<'section'> {\n  attempts?: number\n  code?: string\n  title?: string\n  message: string\n  onFix?: () => void\n  onRetry?: () => void\n  fixLabel?: string\n  tool: string\n}\n\nfunction ToolError({\n  attempts,\n  className,\n  code,\n  title,\n  message,\n  onFix,\n  onRetry,\n  fixLabel = 'Fix connection',\n  tool,\n  ...props\n}: ToolErrorProps) {\n  return (\n    <section\n      data-slot=\"tool-error\"\n      className={cn(\n        'font-sans text-sm font-[450] tracking-[-0.05px] text-muted-foreground transition-[opacity,translate] duration-200 ease-[cubic-bezier(0.23,1,0.32,1)] starting:translate-y-1 starting:opacity-0 motion-reduce:starting:translate-y-0',\n        className,\n      )}\n      {...props}\n    >\n      <div className=\"mb-3 flex items-center gap-2 px-1 text-destructive\" role=\"alert\">\n        <DangerIcon aria-hidden=\"true\" className=\"size-3.5 shrink-0\" />\n        <span>Needs a fix</span>\n      </div>\n      <div className=\"rounded-[16px] bg-muted/40 p-4 shadow-card\">\n        <h3 className=\"text-sm leading-5 font-[450]\">\n          {title ?? `${tool} connection lost partway through`}\n        </h3>\n        <p className=\"mt-1 text-sm leading-5 text-foreground\">{message}</p>\n        {(code || attempts !== undefined) && (\n          <p className=\"mt-2 metadata-label break-words\">\n            {code && <code>{code}</code>}\n            {code && attempts !== undefined && ' · '}\n            {attempts !== undefined && `Attempt ${attempts}`}\n          </p>\n        )}\n        {(onFix || onRetry) && (\n          <div className=\"mt-4 flex flex-wrap items-center gap-2\">\n            {onFix && (\n              <Button\n                onClick={onFix}\n                size=\"sm\"\n                variant=\"default\"\n                className=\"h-7 rounded-md border-0 bg-primary bg-linear-to-b from-[color-mix(in_oklch,var(--primary),var(--primary-foreground)_30%)] to-primary px-3 text-sm font-[450] text-primary-foreground shadow-[inset_0_1px_0_rgba(255,255,255,0.14),0_1px_2px_rgba(0,0,0,0.18)] shadow-none hover:brightness-110 dark:bg-none\"\n              >\n                {fixLabel}\n              </Button>\n            )}\n            {onRetry && (\n              <Button\n                onClick={onRetry}\n                size=\"sm\"\n                variant=\"outline\"\n                className=\"h-7 rounded-md bg-card px-3 text-sm font-[450]\"\n              >\n                Retry\n              </Button>\n            )}\n          </div>\n        )}\n      </div>\n    </section>\n  )\n}\n\nexport { ToolError }\nexport type { ToolErrorProps }\n",
      "type": "registry:component",
      "target": "@components/ai/tool-error.tsx"
    }
  ],
  "type": "registry:component"
}