{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "elements-tool-error",
  "type": "registry:component",
  "title": "Tool failure",
  "description": "One call failed. The error, the attempt count, and a retry that doesn't restart the turn.",
  "registryDependencies": [
    "https://r.assistant-ui.com/elements-surfaces.json"
  ],
  "dependencies": [
    "lucide-react"
  ],
  "files": [
    {
      "type": "registry:component",
      "path": "components/assistant-ui/elements/tool-error.tsx",
      "content": "\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport { AlertCircleIcon, Loader2Icon, RotateCwIcon } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\nimport { field, mono, paper } from \"./surfaces\";\n\nexport function ToolError({\n  name,\n  target,\n  message,\n  attempt,\n  maxAttempts,\n  retrying,\n  onRetry,\n  onSkip,\n  className,\n  ...props\n}: Omit<\n  ComponentProps<\"div\">,\n  | \"children\"\n  | \"name\"\n  | \"target\"\n  | \"message\"\n  | \"attempt\"\n  | \"maxAttempts\"\n  | \"retrying\"\n  | \"onRetry\"\n  | \"onSkip\"\n> & {\n  name: string;\n  target: string;\n  message: string;\n  attempt: number;\n  maxAttempts: number;\n  retrying: boolean;\n  onRetry?: () => void;\n  onSkip?: () => void;\n}) {\n  return (\n    <div\n      data-slot=\"tool-error\"\n      className={cn(\n        paper,\n        \"flex w-full max-w-sm flex-col gap-3 rounded-2xl p-3.5\",\n        className,\n      )}\n\n      {...props}\n    >\n      <div className=\"flex items-center gap-2.5\">\n        <AlertCircleIcon className=\"size-3.5 shrink-0 text-red-500\" />\n        <span className={cn(mono, \"text-foreground/55 shrink-0\")}>{name}</span>\n        <span className=\"text-foreground/80 min-w-0 flex-1 truncate text-[13px]\">\n          {target}\n        </span>\n        <span className={cn(mono, \"text-foreground/30 shrink-0 tabular-nums\")}>\n          {attempt}/{maxAttempts}\n        </span>\n      </div>\n\n      <div\n        className={cn(\n          field,\n          \"rounded-xl px-3 py-2 font-mono text-[11px] leading-relaxed text-red-700 dark:text-red-300\",\n        )}\n      >\n        {message}\n      </div>\n\n      <div className=\"flex items-center justify-end gap-2\">\n        <button\n          type=\"button\"\n          onClick={onSkip}\n          disabled={!onSkip}\n          className=\"text-foreground/45 hover:bg-foreground/[0.06] hover:text-foreground/90 h-7 rounded-full px-2.5 text-xs font-medium transition-[background-color,color,scale] duration-150 active:scale-[0.96] disabled:pointer-events-none disabled:opacity-30\"\n        >\n          Skip\n        </button>\n        <button\n          type=\"button\"\n          onClick={onRetry}\n          disabled={retrying}\n          className=\"text-foreground/70 hover:bg-foreground/[0.06] hover:text-foreground/95 flex h-7 items-center gap-1.5 rounded-full px-2.5 text-xs font-medium transition-[background-color,color,scale] duration-150 active:scale-[0.96] disabled:pointer-events-none\"\n        >\n          {retrying ? (\n            <Loader2Icon className=\"size-3 animate-spin motion-reduce:animate-none\" />\n          ) : (\n            <RotateCwIcon className=\"size-3\" />\n          )}\n          {retrying ? \"Retrying\" : \"Retry\"}\n        </button>\n      </div>\n    </div>\n  );\n}\n"
    }
  ]
}