{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "checkpoint-demo",
  "type": "registry:block",
  "title": "Checkpoint: Agent Guardrails",
  "description": "Approval Flow Animation example, Agent Guardrails: A plant shop's support agent: reading a ticket clears, a $1,240 refund waits for finance, and deleting a customer is blocked by its scope. A take on the flow diagram (flowchart). Fits features sections.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "features",
    "flow-diagram",
    "steps",
    "ai",
    "interaction",
    "data"
  ],
  "docs": "Live preview, examples and props: https://keyframeui.com/components/checkpoint#checkpoint-demo",
  "registryDependencies": [
    "https://keyframeui.com/r/checkpoint.json"
  ],
  "files": [
    {
      "path": "components/checkpoint-demo.tsx",
      "type": "registry:component",
      "content": "import * as React from \"react\";\n\nimport { Checkpoint, type CheckpointRequest, type CheckpointRule } from \"@/components/ui/checkpoint\";\n\nfunction Glyph({ children }: { children: React.ReactNode }) {\n  return (\n    <svg\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth=\"1.8\"\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n      aria-hidden\n    >\n      {children}\n    </svg>\n  );\n}\n\n// Fernway, a plant delivery shop, and the rules its support agent runs under. Names are made up.\nconst RULES: CheckpointRule[] = [\n  {\n    id: \"role\",\n    label: \"Role\",\n    detail: \"Acts as a support teammate\",\n    value: \"Support\",\n    icon: (\n      <Glyph>\n        <circle cx=\"12\" cy=\"8.5\" r=\"3.5\" />\n        <path d=\"M5 20c.8-3.6 3.6-5.5 7-5.5s6.2 1.9 7 5.5\" />\n      </Glyph>\n    ),\n  },\n  {\n    id: \"scope\",\n    label: \"Scope\",\n    detail: \"Read orders, issue refunds\",\n    value: \"Read · Refund\",\n    icon: (\n      <Glyph>\n        <circle cx=\"8\" cy=\"15\" r=\"4\" />\n        <path d=\"M11 12l8-8M16 7l2.5 2.5M14 9l2 2\" />\n      </Glyph>\n    ),\n  },\n  {\n    id: \"amount\",\n    label: \"Amount\",\n    detail: \"Refunds over $500 need finance\",\n    value: \"≤ $500\",\n    icon: (\n      <Glyph>\n        <circle cx=\"12\" cy=\"12\" r=\"8.5\" />\n        <path d=\"M14.8 9.2c-.5-.9-1.6-1.4-2.8-1.4-1.6 0-2.8.8-2.8 2.1 0 2.9 5.8 1.4 5.8 4.3 0 1.3-1.3 2.2-3 2.2-1.3 0-2.4-.5-2.9-1.5M12 6.3v1.5M12 16.9v1.2\" />\n      </Glyph>\n    ),\n  },\n  {\n    id: \"audit\",\n    label: \"Audit\",\n    detail: \"Every call lands in the trail\",\n    value: \"Logged\",\n    icon: (\n      <Glyph>\n        <path d=\"M7 3.5h7l4 4V20a.5.5 0 0 1-.5.5h-10A.5.5 0 0 1 7 20z\" />\n        <path d=\"M14 3.5V8h4M10 12.5h5M10 16h5\" />\n      </Glyph>\n    ),\n  },\n];\n\nconst REQUESTS: CheckpointRequest[] = [\n  {\n    id: \"read\",\n    label: \"read_ticket\",\n    meta: \"#4821 · Monstera arrived with a cracked pot\",\n    icon: (\n      <Glyph>\n        <path d=\"M4 6.5h16v11H4z\" />\n        <path d=\"M4 7l8 6 8-6\" />\n      </Glyph>\n    ),\n  },\n  {\n    id: \"refund\",\n    label: \"refund_order\",\n    meta: \"$1,240.00 · order #88213, 14 olive trees\",\n    verdicts: { amount: \"hold\" },\n    icon: (\n      <Glyph>\n        <path d=\"M4 12a8 8 0 1 0 2.4-5.7L4 8.6\" />\n        <path d=\"M4 4v4.6h4.6\" />\n      </Glyph>\n    ),\n  },\n  {\n    id: \"delete\",\n    label: \"delete_customer\",\n    meta: \"cus_19F4 · asked by the chat, not the customer\",\n    verdicts: { scope: \"block\" },\n    reason: \"No delete scope\",\n    icon: (\n      <Glyph>\n        <path d=\"M5 7h14M9.5 7V4.5h5V7M7 7l1 13h8l1-13\" />\n      </Glyph>\n    ),\n  },\n];\n\nexport function CheckpointDemo() {\n  return (\n    <div className=\"w-full max-w-xl rounded-[26px] border border-zinc-950/[0.08] bg-white p-1.5 shadow-[0_1px_2px_rgba(0,0,0,0.04)] dark:border-white/10 dark:bg-zinc-950\">\n      <div className=\"rounded-[20px] bg-zinc-50 bg-[radial-gradient(120%_70%_at_50%_0%,rgba(255,59,31,0.07),transparent_70%)] p-4 sm:p-5 dark:bg-white/[0.03] dark:bg-[radial-gradient(120%_70%_at_50%_0%,rgba(255,90,60,0.1),transparent_70%)]\">\n        <div className=\"mb-4 flex items-baseline justify-between gap-4 px-0.5\">\n          <p className=\"text-[13px] font-semibold tracking-tight text-zinc-950 dark:text-zinc-100\">\n            Guardrails <span className=\"font-normal text-zinc-500 dark:text-zinc-400\">· Fernway support agent</span>\n          </p>\n          <p className=\"hidden items-center gap-1.5 text-[12px] text-zinc-500 sm:flex dark:text-zinc-400\">\n            <span className=\"size-1.5 rounded-full bg-[#ff3b1f] dark:bg-[#ff5a3c]\" />\n            Enforced on every call\n          </p>\n        </div>\n        <Checkpoint rules={RULES} requests={REQUESTS} approver=\"Dana in finance\" />\n      </div>\n    </div>\n  );\n}\n"
    }
  ]
}