{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "agent-session-locale-demo",
  "type": "registry:block",
  "title": "Agent Session: Localized Checkout",
  "description": "AI Agent Terminal Demo example, Localized Checkout: A checkout translated into German one label at a time, each English label as the `fallback` that its German line replaces. A teal accent through `--agent-session-accent`. A take on the terminal (cli) and product demo (interactive demo). Fits hero and features sections.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "hero",
    "features",
    "terminal",
    "product-demo",
    "code-block",
    "ai",
    "code",
    "developer"
  ],
  "docs": "Live preview, examples and props: https://keyframeui.com/components/agent-session#agent-session-locale-demo",
  "registryDependencies": [
    "https://keyframeui.com/r/agent-session.json"
  ],
  "files": [
    {
      "path": "components/agent-session-locale-demo.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport { AgentSession, AgentSessionTarget, type AgentSessionStep } from \"@/components/ui/agent-session\";\n\nconst script: AgentSessionStep[] = [\n  { prompt: \"Translate the checkout into German, with prices in euros\" },\n  {\n    run: \"npx glossa extract app/checkout\",\n    ms: 800,\n    output: [\"14 strings in 3 files\", \"2 prices · 1 date format\"],\n  },\n  {\n    run: \"npx glossa translate de --glossary brand.json\",\n    ms: 1300,\n    output: [{ text: \"+ messages/de.json   14 strings · reviewed against glossary\", tone: \"added\" }],\n  },\n  {\n    run: \"app/checkout/page.tsx\",\n    tool: \"Update\",\n    ms: 600,\n    pace: 300,\n    output: [\n      { text: '~ \"Contact\" → \"Kontakt\"', effect: \"contact\" },\n      { text: '~ \"Email\" → \"E-Mail\"', effect: \"email\" },\n      { text: '~ \"Shipping\" → \"Versand\"', effect: \"shipping\" },\n      { text: '~ \"3–5 days\" → \"3–5 Werktage\"', effect: \"days\" },\n      { text: '~ \"$128.00\" → \"118,00 €\"', effect: \"total\" },\n      { text: '~ \"Pay now\" → \"Jetzt bezahlen\"', effect: \"pay\" },\n    ],\n  },\n  {\n    say: \"The checkout reads in German now, with euro prices from your price list. Delivery says Werktage, business days, which is how German shops write it.\",\n  },\n];\n\n/** The English label until its line lands, then the German one. */\nfunction Swap({ effect, from, to, className }: { effect: string; from: string; to: string; className?: string }) {\n  return (\n    <AgentSessionTarget effect={effect} fallback={<span className={className}>{from}</span>} className=\"justify-items-start\">\n      <span className={className}>{to}</span>\n    </AgentSessionTarget>\n  );\n}\n\nexport function AgentSessionLocaleDemo() {\n  return (\n    <AgentSession\n      script={script}\n      title=\"field-and-fold — agent\"\n      url=\"localhost:3000/de/checkout\"\n      className=\"max-w-5xl [--agent-session-accent:#0d9488] dark:[--agent-session-accent:#2dd4bf]\"\n    >\n      <div className=\"flex h-full items-start justify-center overflow-hidden bg-stone-50 p-4 text-stone-900 dark:bg-stone-950/40 dark:text-stone-100\">\n        <div className=\"w-full max-w-xs\">\n          <div className=\"mb-3 flex items-center justify-between\">\n            <p className=\"font-serif text-base tracking-tight\">Field &amp; Fold</p>\n            <p className=\"text-[11px] text-stone-500\">1 item</p>\n          </div>\n\n          <div className=\"flex flex-col gap-3 rounded-2xl bg-white p-3.5 ring-1 ring-stone-950/[0.07] shadow-sm dark:bg-white/[0.04] dark:ring-white/10\">\n            <section className=\"flex flex-col gap-1.5\">\n              <Swap effect=\"contact\" from=\"Contact\" to=\"Kontakt\" className=\"text-xs font-semibold\" />\n              <div className=\"flex h-8 items-center rounded-lg px-2.5 ring-1 ring-stone-950/10 dark:ring-white/10\">\n                <Swap effect=\"email\" from=\"Email\" to=\"E-Mail\" className=\"text-[11px] text-stone-400\" />\n                <span className=\"ml-auto text-[11px] text-stone-600 dark:text-stone-300\">lena@posteo.de</span>\n              </div>\n            </section>\n\n            <section className=\"flex flex-col gap-1.5\">\n              <Swap effect=\"shipping\" from=\"Shipping\" to=\"Versand\" className=\"text-xs font-semibold\" />\n              <div className=\"flex items-center justify-between rounded-lg bg-stone-50 px-2.5 py-2 ring-1 ring-stone-950/10 dark:bg-white/[0.03] dark:ring-white/10\">\n                <div className=\"flex flex-col\">\n                  <span className=\"text-[11px] font-medium\">Standard</span>\n                  <Swap effect=\"days\" from=\"3–5 days\" to=\"3–5 Werktage\" className=\"text-[11px] text-stone-500\" />\n                </div>\n                <span className=\"text-[11px] text-stone-500\">0,00 €</span>\n              </div>\n            </section>\n\n            <div className=\"flex items-baseline justify-between border-t border-stone-950/[0.06] pt-3 dark:border-white/10\">\n              <span className=\"text-xs text-stone-500\">Wool overshirt, oat</span>\n              <Swap effect=\"total\" from=\"$128.00\" to=\"118,00 €\" className=\"text-sm font-semibold tabular-nums\" />\n            </div>\n\n            <AgentSessionTarget\n              effect=\"pay\"\n              className=\"[--agent-session-ring-radius:999px]\"\n              fallback={<PayButton label=\"Pay now\" />}\n            >\n              <PayButton label=\"Jetzt bezahlen\" />\n            </AgentSessionTarget>\n          </div>\n        </div>\n      </div>\n    </AgentSession>\n  );\n}\n\nfunction PayButton({ label }: { label: string }) {\n  return (\n    <span className=\"flex h-9 w-full items-center justify-center rounded-full bg-stone-900 text-xs font-medium text-white dark:bg-stone-100 dark:text-stone-900\">\n      {label}\n    </span>\n  );\n}\n"
    }
  ]
}