{
  "component": {
    "id": "tool-call-card",
    "name": "Tool call card",
    "tier": "pro",
    "exampleId": "tool-call-card",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/tool-call-card-demo.tsx",
    "exportName": "ToolCallCardDemo",
    "sha256": "4a77ae901bbf7f27a3ed388689ceb84228eb5890b1e2da0a0944c99c832588ae",
    "helperImports": [],
    "directComponentImports": [
      "tool-call-card"
    ],
    "sampleBoundary": "Existing local demo fixture with fictional data and callbacks. No live service, customer data, access key, or Pro source is included."
  },
  "install": {
    "command": "npx shadcn@latest add @tidal-pro/tool-call-card",
    "registryUrl": "https://tidalui.com/r/pro/tool-call-card.json",
    "namespace": "@tidal-pro",
    "access": "pro",
    "sourceDelivery": "server-gated",
    "requiresAuthorization": true,
    "tokenSource": "local-env",
    "tokenEnvName": "TIDALUI_TOKEN",
    "cli": {
      "package": "shadcn",
      "requested": "latest"
    }
  },
  "installPlan": [
    {
      "order": 1,
      "kind": "primary",
      "dependency": "@tidal-pro/tool-call-card",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/tool-call-card",
      "registryUrl": "https://tidalui.com/r/pro/tool-call-card.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/tool-call-card.tsx",
    "exports": [
      "TidalToolCallAction",
      "TidalToolCallCard",
      "TidalToolCallStatus"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/tool-call-card.css",
      "components/ui/status-badge.css",
      "components/ui/collapsible-panel.css",
      "components/ui/code-block.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [],
    "registry": [
      "https://tidalui.com/r/status-badge.json",
      "@tidal-pro/collapsible-panel",
      "@tidal-pro/code-block"
    ],
    "additionalRegistry": [],
    "installClosure": [
      "code-block",
      "collapsible-panel",
      "status-badge",
      "tool-call-card"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/tool-call-card.css",
      "components/ui/status-badge.css",
      "components/ui/collapsible-panel.css",
      "components/ui/code-block.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/tool-call-card.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/tool-call-card-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "import \"./components/ui/tidal.css\";\n\nimport { useLayoutEffect, useRef, useState } from \"react\";\n\nimport { TidalToolCallCard, type TidalToolCallStatus, type TidalToolCallAction } from \"./components/ui/tool-call-card\";\n\nimport \"./components/ui/tool-call-card.css\";\n\nimport \"./components/ui/status-badge.css\";\n\nimport \"./components/ui/collapsible-panel.css\";\n\nimport \"./components/ui/code-block.css\";\n\n\n\nconst tidalExampleStyles = \".tidal-scope .tool-call-demo {\\n  width: min(100%, 640px);\\n  min-width: 0;\\n}\\n.tidal-scope .tool-call-demo-state {\\n  display: flex;\\n  align-items: center;\\n  justify-content: flex-end;\\n  gap: 10px;\\n  margin-bottom: 14px;\\n  color: var(--t-muted);\\n  font-size: 12px;\\n}\\n.tidal-scope .tool-call-demo-state select {\\n  max-width: 100%;\\n  min-height: 44px;\\n  padding: 8px 34px 8px 12px;\\n  border: 1px solid var(--t-border);\\n  border-radius: var(--t-radius-control);\\n  color: var(--t-ink);\\n  background: var(--t-surface);\\n  font-size: 16px;\\n}\";\n\nconst argumentsText = JSON.stringify(\n  { query: \"Install TidalUI in a React app\", limit: 3 },\n  null,\n  2,\n);\n\nconst resultText = JSON.stringify(\n  { matches: [{ title: \"Installation\", path: \"/docs\" }] },\n  null,\n  2,\n);\n\nexport function ToolCallCardDemo() {\n  const [status, setStatus] = useState<TidalToolCallStatus>(\"needs-approval\");\n  const [open, setOpen] = useState(true);\n  const card = useRef<HTMLElement>(null);\n  const firstAction = useRef<HTMLButtonElement>(null);\n  const restoreActionFocus = useRef<\"action\" | \"result\" | null>(null);\n  function changeFromAction(next: TidalToolCallStatus) {\n    restoreActionFocus.current = next === \"succeeded\" ? \"result\" : \"action\";\n    if (next === \"succeeded\") setOpen(true);\n    setStatus(next);\n  }\n  useLayoutEffect(() => {\n    if (!restoreActionFocus.current) return;\n    const requested = restoreActionFocus.current;\n    restoreActionFocus.current = null;\n    if (document.activeElement !== document.body) return;\n    const target = requested === \"result\" ? card.current : firstAction.current;\n    target?.focus({ preventScroll: true });\n  }, [status]);\n  const actions: TidalToolCallAction[] =\n    status === \"needs-approval\"\n      ? [\n          {\n            actionId: \"approve\",\n            label: \"Approve\",\n            emphasis: \"primary\",\n            onAction: () => changeFromAction(\"running\"),\n          },\n          {\n            actionId: \"decline\",\n            label: \"Decline\",\n            onAction: () => changeFromAction(\"cancelled\"),\n          },\n        ]\n      : status === \"running\"\n        ? [\n            {\n              actionId: \"finish\",\n              label: \"Complete sample\",\n              emphasis: \"primary\",\n              onAction: () => changeFromAction(\"succeeded\"),\n            },\n            {\n              actionId: \"stop\",\n              label: \"Stop\",\n              onAction: () => changeFromAction(\"cancelled\"),\n            },\n          ]\n        : [\n            {\n              actionId: \"reset\",\n              label: \"Reset sample\",\n              onAction: () => changeFromAction(\"needs-approval\"),\n            },\n          ];\n  return (\n    <div className=\"tool-call-demo\">\n      <label className=\"tool-call-demo-state\">\n        State{\" \"}\n        <select\n          value={status}\n          onChange={(event) =>\n            setStatus(event.currentTarget.value as TidalToolCallStatus)\n          }\n        >\n          <option value=\"needs-approval\">Needs approval</option>\n          <option value=\"queued\">Queued</option>\n          <option value=\"running\">Running</option>\n          <option value=\"succeeded\">Completed</option>\n          <option value=\"failed\">Failed</option>\n          <option value=\"cancelled\">Cancelled</option>\n        </select>\n      </label>\n      <TidalToolCallCard\n        ref={card}\n        tabIndex={-1}\n        aria-label=\"Search documentation\"\n        title=\"Search documentation\"\n        toolName=\"search_docs\"\n        status={status}\n        announceStatus\n        summary=\"Find installation instructions for a React project.\"\n        argumentsText={argumentsText}\n        resultText={status === \"succeeded\" ? resultText : undefined}\n        error={\n          status === \"failed\"\n            ? \"Example error: the search provider did not respond.\"\n            : undefined\n        }\n        detailsOpen={open}\n        onDetailsOpenChange={setOpen}\n        actions={actions.map((action, index) => ({\n          ...action,\n          buttonRef: index === 0 ? firstAction : undefined,\n        }))}\n        footer=\"Local sample. No tool is run.\"\n      />\n    </div>\n  );\n}\n\nexport default function AgentExample() {\n  return (\n    <div className=\"tidal-scope\" data-theme=\"light\" dir=\"ltr\">\n      <style>{tidalExampleStyles}</style>\n      <ToolCallCardDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/tool-call-card.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "value",
      "type": "inferred-from-existing-demo",
      "initial": "\"needs-approval\"",
      "setter": "setStatus",
      "proposalCanBeRejected": false
    },
    {
      "prop": "status",
      "type": "inferred-from-existing-demo",
      "initial": "\"needs-approval\"",
      "setter": "setStatus",
      "proposalCanBeRejected": false
    },
    {
      "prop": "detailsOpen",
      "type": "inferred-from-existing-demo",
      "initial": "true",
      "setter": "setOpen",
      "proposalCanBeRejected": false
    }
  ],
  "events": [
    {
      "name": "onChange",
      "nativeType": "React synthetic event or native callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onDetailsOpenChange",
      "nativeType": "component callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    }
  ],
  "nativeForm": {
    "participates": true,
    "names": [],
    "expectedFormData": {},
    "submitBehavior": "The existing demo's native form callback receives the submit event.",
    "resetBehavior": "Native reset behavior remains available where the demo renders a resettable control.",
    "disabledBehavior": "Disabled controls remain excluded from successful native form submission.",
    "readOnlyBehavior": "Read-only controls retain their value and remain inspectable by the consumer."
  },
  "accessibility": {
    "labelSource": "Existing demo label or ARIA prop",
    "semantics": "Preserve the component's native element and the semantics demonstrated by the source fixture.",
    "keyboard": [
      "Tab and Shift+Tab",
      "Enter or Space for native activation",
      "Arrow keys where the component exposes a composite control"
    ],
    "focusReturn": "Preserve browser focus order and visible focus.",
    "errorAnnouncement": "The existing error or alert path remains consumer-owned and should be announced by the rendered semantics.",
    "reducedMotion": "Verify prefers-reduced-motion with the existing component transition path.",
    "forcedColors": "Verify visible borders, text, and focus in forced-colors mode."
  },
  "responsive": {
    "widths": [
      320,
      390,
      768,
      1260
    ],
    "shortViewport": "Check the example at a 300px viewport height with keyboard or portal content visible.",
    "overflow": "The page should not gain horizontal overflow; component-local scrolling must remain intentional.",
    "touchTargetMinPx": 44,
    "coarseInputFontPx": 16
  },
  "errors": [
    {
      "fixture": "Exercise the existing demo's error, empty, loading, or invalid fixture.",
      "visibleResult": "The consumer-visible result must remain explicit and must not be replaced by a silent console error.",
      "focusResult": "Focus must remain on the triggering control or move to the announced error according to the native pattern.",
      "ownership": "Consumer-owned sample state only; no network request or customer data is used."
    }
  ],
  "verification": {
    "commands": [
      "npx tsc --noEmit",
      "npx vite build"
    ],
    "lockfile": "Use the consumer project's committed lockfile.",
    "browser": [
      "Chromium 1260x800",
      "Chromium 390x844",
      "Keyboard and reduced-motion pass"
    ]
  },
  "validation": {
    "consumerFixture": {
      "tsc": "pass",
      "viteBuild": "pass",
      "resourceModel": "Generated usage plus only the component files and CSS delivered by the primary item and listed registry dependencies."
    },
    "registryArtifact": "server-gated"
  },
  "exceptions": []
}
