{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "agent-session-hero",
  "type": "registry:block",
  "title": "Agent Session Hero",
  "description": "Hero Section built with Agent Session (AI agent terminal demo), Glyph Field (ASCII art effect), Handoff Nav (sticky navbar on scroll) and Release Pill (hover changelog badge): a coding agent builds a dashboard live. A take on the terminal (cli), product demo (interactive demo), ASCII art (monospace), animated background (backdrop), navbar (nav bar) and badge (pill). A hero for a developer tool that coding agents use. Under the headline an Agent Session plays: the agent adds a signup funnel to a live dashboard, each bar filling as its tracking call is written. Your mark's orbit is printed in glyphs around the headline and inks under the pointer, a Release Pill sits above it, and the nav docks into a pill that catches the hero's button as you scroll.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "blocks",
    "hero-sections",
    "hero",
    "terminal",
    "product-demo",
    "ascii-art",
    "animated-background",
    "navbar",
    "badge"
  ],
  "docs": "Live preview and the components it's built with: https://keyframeui.com/blocks/hero-sections/agent-session-hero",
  "dependencies": [
    "motion"
  ],
  "registryDependencies": [
    "https://keyframeui.com/r/agent-session.json",
    "https://keyframeui.com/r/glyph-field.json",
    "https://keyframeui.com/r/handoff-nav.json",
    "https://keyframeui.com/r/release-pill.json"
  ],
  "files": [
    {
      "path": "components/agent-session-hero.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { motion, useReducedMotion } from \"motion/react\";\n\nimport {\n  AgentSession,\n  AgentSessionTarget,\n  useAgentSessionEffect,\n  type AgentSessionStep,\n} from \"@/components/ui/agent-session\";\nimport { GlyphField } from \"@/components/ui/glyph-field\";\nimport { HandoffNav, HandoffNavCta, HandoffNavProvider } from \"@/components/ui/handoff-nav\";\nimport { ReleasePill, type Release } from \"@/components/ui/release-pill\";\n\n/* ── Content ─────────────────────────────────────────────────\n * Everything you'd change to make the hero yours: the nav, the\n * release notes in the pill, the copy, and the script the agent\n * runs under the headline. The dashboard it changes is plain\n * markup further down; its numbers are here too.\n * ─────────────────────────────────────────────────────────── */\n\n/** The one accent: glyph ink, the session's glow and rings, and the dashboard's highlights. */\nconst ACCENT = { light: \"#ea580c\", dark: \"#fb923c\" };\n\nconst BRAND = { name: \"Tern\", href: \"#\" };\n\nconst NAV_LINKS = [\n  { label: \"Product\", href: \"#product\" },\n  { label: \"Docs\", href: \"#docs\" },\n  { label: \"Pricing\", href: \"#pricing\" },\n  { label: \"Changelog\", href: \"#changelog\" },\n];\nconst SIGN_IN = { label: \"Log in\", href: \"#login\" };\n\nconst RELEASES: Release[] = [\n  {\n    version: \"v2.4\",\n    title: \"Funnels from a prompt\",\n    date: \"Oct 28\",\n    href: \"#changelog-v2-4\",\n    summary: \"Ask your agent for a funnel and it writes the chart and every tracking call behind it.\",\n  },\n  { version: \"v2.3\", title: \"Slack alerts on any event\", date: \"Oct 14\", href: \"#changelog-v2-3\" },\n  { version: \"v2.2\", title: \"Weekly retention cohorts\", date: \"Sep 30\", href: \"#changelog-v2-2\" },\n  { version: \"v2.1\", title: \"Keys stay in your terminal\", date: \"Sep 16\", href: \"#changelog-v2-1\" },\n];\nconst CHANGELOG_HREF = \"#changelog\";\n\nconst HEADLINE = \"Ship the feature.\";\nconst HEADLINE_QUIET = \"Your agent tracks it.\";\nconst SUBLINE =\n  \"Tern is product analytics for teams that build with coding agents. Ask in a sentence: the agent finds the events, writes the tracking code and puts the chart on your dashboard.\";\nconst PRIMARY_CTA = { label: \"Start free\", href: \"#start\" };\nconst SECONDARY_CTA = { label: \"Set up your agent\", href: \"#agent-setup\" };\nconst FOOTNOTE = \"Free up to 10,000 events a month. Works with any agent that can run a command.\";\n\n/** Under the session: who uses it. Wordmarks set in type; swap in your customers' logos. */\nconst CUSTOMERS_LABEL = \"Teams that ship with their agents\";\nconst CUSTOMERS: { name: string; className: string }[] = [\n  { name: \"Kiln\", className: \"font-semibold tracking-tight\" },\n  { name: \"Ferngrove\", className: \"font-serif italic\" },\n  { name: \"LUMENHAUS\", className: \"font-mono text-[13px] tracking-[0.2em]\" },\n  { name: \"Okto\", className: \"font-bold tracking-[-0.04em]\" },\n  { name: \"Field & Fold\", className: \"font-serif\" },\n  { name: \"harbor\", className: \"font-medium lowercase tracking-wide\" },\n];\n\n/* The session under the headline, and the dashboard it changes. */\n\nconst TERMINAL_TITLE = \"web — agent\";\nconst APP_URL = \"localhost:3000/dashboard\";\n\nconst SCRIPT: AgentSessionStep[] = [\n  { prompt: \"Add a signup funnel to the dashboard and track each step\" },\n  {\n    run: \"npx tern events list --match signup\",\n    ms: 900,\n    output: [\n      \"signup_viewed      page     /signup\",\n      \"signup_submitted   form     #signup-form\",\n      \"email_verified     server   POST /api/verify\",\n    ],\n    more: 4,\n  },\n  {\n    run: \"npx tern add funnel signup --to app/dashboard\",\n    ms: 1100,\n    output: [\n      { text: \"+ app/dashboard/signup-funnel.tsx   SignupFunnel\", tone: \"added\", effect: \"funnel\" },\n      { text: \"~ app/dashboard/layout.tsx          Funnels (1)\", effect: \"nav\" },\n    ],\n  },\n  {\n    run: \"npx tern track signup_viewed signup_submitted email_verified\",\n    ms: 1200,\n    pace: 420,\n    output: [\n      { text: '+ app/signup/page.tsx       track(\"signup_viewed\")', tone: \"added\", effect: \"step-1\" },\n      { text: '+ app/signup/form.tsx       track(\"signup_submitted\")', tone: \"added\", effect: \"step-2\" },\n      { text: '+ app/api/verify/route.ts   track(\"email_verified\")', tone: \"added\", effect: \"step-3\" },\n    ],\n  },\n  {\n    say: \"Added a three-step signup funnel. Last week 1,204 of 12,480 visitors finished, and most of the drop happens before the form is sent.\",\n  },\n];\n\nconst DASHBOARD_NAV = [\"Overview\", \"Funnels\", \"Events\", \"Retention\", \"Alerts\"];\nconst STATS = [\n  { label: \"Visitors\", value: \"12,480\", delta: \"+8.2%\" },\n  { label: \"Signups\", value: \"1,204\", delta: \"+3.1%\" },\n  { label: \"Active today\", value: \"3,906\", delta: \"+1.4%\" },\n];\nconst FUNNEL = [\n  { effect: \"step-1\", label: \"Viewed signup\", count: \"12,480\", share: 1 },\n  { effect: \"step-2\", label: \"Sent the form\", count: \"2,911\", share: 0.233 },\n  { effect: \"step-3\", label: \"Verified email\", count: \"1,204\", share: 0.096 },\n];\n\n/* ── Hero ────────────────────────────────────────────────── */\n\nconst focusRing =\n  \"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-zinc-950 dark:focus-visible:outline-white\";\n\nexport function AgentSessionHero() {\n  return (\n    <section\n      style={{ \"--accent-light\": ACCENT.light, \"--accent-dark\": ACCENT.dark } as React.CSSProperties}\n      // The Release Pill draws with the shadcn theme colors; point them at this palette.\n      className=\"relative isolate overflow-x-clip bg-zinc-50 text-zinc-950 [--accent:var(--accent-light)] [--background:#fafafa] [--foreground:#09090b] [--muted-foreground:#71717a] dark:bg-zinc-950 dark:text-white dark:[--accent:var(--accent-dark)] dark:[--background:#09090b] dark:[--foreground:#fafafa] dark:[--muted-foreground:#a1a1aa]\"\n    >\n      <HandoffNavProvider>\n        <HandoffNav\n          logo={\n            <a href={BRAND.href} className={`flex items-center gap-2 rounded-md text-[15px] font-semibold tracking-tight ${focusRing}`}>\n              <TernMark className=\"size-5 text-(--accent)\" />\n              {BRAND.name}\n            </a>\n          }\n          links={NAV_LINKS}\n          action={SIGN_IN}\n          className=\"[--handoff-nav-width:72rem]\"\n        />\n\n        {/* \"cover\" sizes the orbit to the width, so its band sweeps around the copy, not through it. */}\n        <GlyphField\n          fit=\"cover\"\n          glyphClassName=\"text-zinc-300 dark:text-zinc-700\"\n          accentClassName=\"text-(--accent)\"\n          canvasClassName=\"opacity-60 sm:opacity-100\"\n          className=\"px-6 pt-10 pb-12 text-center sm:pt-14\"\n        >\n          <ReleasePill releases={RELEASES} changelogHref={CHANGELOG_HREF} />\n          <h1 className=\"mx-auto mt-6 max-w-[15ch] text-[2.75rem]/[1.02] font-semibold tracking-[-0.04em] text-balance sm:text-6xl/[1] lg:text-7xl/[0.98]\">\n            {HEADLINE} <span className=\"block text-zinc-400 dark:text-zinc-500\">{HEADLINE_QUIET}</span>\n          </h1>\n          <p className=\"mx-auto mt-6 max-w-xl text-base/7 text-pretty text-zinc-600 sm:text-lg/8 dark:text-zinc-400\">\n            {SUBLINE}\n          </p>\n          <div className=\"mt-8 flex flex-wrap items-center justify-center gap-x-6 gap-y-3\">\n            <a\n              href={SECONDARY_CTA.href}\n              className={`group inline-flex items-center gap-1 rounded-md text-sm font-medium text-zinc-700 transition-colors hover:text-zinc-950 dark:text-zinc-300 dark:hover:text-white ${focusRing}`}\n            >\n              {SECONDARY_CTA.label}\n              <ArrowIcon className=\"size-3.5 transition-transform duration-200 group-hover:translate-x-0.5\" />\n            </a>\n            <HandoffNavCta href={PRIMARY_CTA.href}>\n              {PRIMARY_CTA.label}\n              <ArrowIcon className=\"size-3.5\" />\n            </HandoffNavCta>\n          </div>\n          <p className=\"mt-5 text-sm text-zinc-500\">{FOOTNOTE}</p>\n        </GlyphField>\n\n        <div className=\"mx-auto max-w-6xl px-6 pb-20 sm:pb-24\">\n          <AgentSession\n            script={SCRIPT}\n            title={TERMINAL_TITLE}\n            url={APP_URL}\n            className=\"[--agent-session-accent:var(--accent)] [--agent-session-height:22rem] [--agent-session-preview-height:20.5rem] sm:[--agent-session-height:26rem] dark:[--agent-session-accent:var(--accent)]\"\n          >\n            <Dashboard />\n          </AgentSession>\n\n          <div className=\"mt-14 text-center sm:mt-16\">\n            <p className=\"text-sm text-zinc-500\">{CUSTOMERS_LABEL}</p>\n            <ul className=\"mt-5 flex flex-wrap items-center justify-center gap-x-10 gap-y-4 text-lg text-zinc-400 dark:text-zinc-500\">\n              {CUSTOMERS.map((customer) => (\n                <li key={customer.name} className={customer.className}>\n                  {customer.name}\n                </li>\n              ))}\n            </ul>\n          </div>\n        </div>\n      </HandoffNavProvider>\n    </section>\n  );\n}\n\n/* ── The dashboard the agent changes ─────────────────────── */\n\nfunction Dashboard() {\n  return (\n    <div className=\"@container/app flex h-full text-zinc-900 dark:text-zinc-100\">\n      <aside className=\"hidden w-36 shrink-0 flex-col gap-0.5 border-r border-zinc-950/[0.06] bg-zinc-50/70 p-2.5 @[28rem]/app:flex dark:border-white/[0.06] dark:bg-white/[0.02]\">\n        <div className=\"mb-3 flex items-center gap-1.5 px-1.5 pt-1 text-[13px] font-semibold tracking-tight\">\n          <TernMark className=\"size-3.5 text-(--accent)\" />\n          {BRAND.name}\n        </div>\n        {DASHBOARD_NAV.map((item, i) => (\n          <div\n            key={item}\n            className={\n              i === 0\n                ? \"flex items-center justify-between rounded-md bg-white px-2 py-1.5 text-xs font-medium shadow-sm ring-1 ring-zinc-950/5 dark:bg-white/10 dark:ring-white/5\"\n                : \"flex items-center justify-between rounded-md px-2 py-1.5 text-xs text-zinc-500 dark:text-zinc-400\"\n            }\n          >\n            {item}\n            {item === \"Funnels\" && (\n              <AgentSessionTarget effect=\"nav\" className=\"[--agent-session-ring-radius:999px]\">\n                <span className=\"rounded-full bg-(--accent) px-1.5 text-[10px] leading-4 font-semibold text-white tabular-nums dark:text-zinc-950\">\n                  1\n                </span>\n              </AgentSessionTarget>\n            )}\n          </div>\n        ))}\n      </aside>\n\n      <div className=\"flex min-w-0 flex-1 flex-col gap-3 p-4\">\n        <div className=\"flex items-baseline justify-between\">\n          <h3 className=\"text-sm font-semibold tracking-tight\">Overview</h3>\n          <span className=\"text-[11px] text-zinc-400\">Last 7 days</span>\n        </div>\n        <div className=\"grid grid-cols-2 gap-2 @[34rem]/app:grid-cols-3\">\n          {STATS.map((stat, i) => (\n            <div\n              key={stat.label}\n              className={`rounded-xl bg-white p-2.5 ring-1 ring-zinc-950/[0.08] dark:bg-white/[0.04] dark:ring-white/10 ${i === 2 ? \"hidden @[34rem]/app:block\" : \"\"}`}\n            >\n              <p className=\"text-[11px] text-zinc-500 dark:text-zinc-400\">{stat.label}</p>\n              <p className=\"mt-0.5 flex items-baseline gap-1.5\">\n                <span className=\"text-base font-semibold tracking-tight tabular-nums\">{stat.value}</span>\n                <span className=\"text-[10px] font-medium text-emerald-600 dark:text-emerald-400\">{stat.delta}</span>\n              </p>\n            </div>\n          ))}\n        </div>\n\n        <AgentSessionTarget\n          effect=\"funnel\"\n          className=\"[--agent-session-ring-radius:14px]\"\n          fallback={\n            <div className=\"flex h-full min-h-36 flex-col items-center justify-center gap-1 rounded-xl border border-dashed border-zinc-950/15 text-center dark:border-white/15\">\n              <p className=\"text-xs font-medium\">No funnels yet</p>\n              <p className=\"text-[11px] text-zinc-400\">Ask your agent for one.</p>\n            </div>\n          }\n        >\n          <div className=\"rounded-xl bg-white p-3 shadow-sm ring-1 ring-zinc-950/[0.08] dark:bg-white/[0.04] dark:ring-white/10\">\n            <div className=\"mb-2.5 flex items-baseline justify-between\">\n              <p className=\"text-xs font-semibold\">Signup funnel</p>\n              <p className=\"text-[11px] text-zinc-400 tabular-nums\">9.6% convert</p>\n            </div>\n            <div className=\"flex flex-col gap-2\">\n              {FUNNEL.map((step) => (\n                <FunnelRow key={step.effect} {...step} />\n              ))}\n            </div>\n          </div>\n        </AgentSessionTarget>\n      </div>\n    </div>\n  );\n}\n\n// Each bar fills once the tracking call for its step is written.\nfunction FunnelRow({ effect, label, count, share }: (typeof FUNNEL)[number]) {\n  const landed = useAgentSessionEffect(effect);\n  const reduced = useReducedMotion();\n  return (\n    <AgentSessionTarget effect={effect} enter=\"none\" className=\"[--agent-session-ring-radius:8px]\">\n      <div className=\"flex flex-col gap-1\">\n        <div className=\"flex items-baseline justify-between text-[11px]\">\n          <span className=\"text-zinc-600 dark:text-zinc-300\">{label}</span>\n          <span className={`font-medium tabular-nums ${landed ? \"\" : \"text-zinc-300 dark:text-zinc-600\"}`}>\n            {landed ? count : \"—\"}\n          </span>\n        </div>\n        <div className=\"h-1.5 overflow-hidden rounded-full bg-zinc-100 dark:bg-white/[0.07]\">\n          <motion.div\n            initial={false}\n            animate={{ transform: `scaleX(${landed ? share : 0})` }}\n            transition={reduced ? { duration: 0 } : { type: \"spring\", visualDuration: 0.6, bounce: 0 }}\n            className=\"h-full origin-left rounded-full bg-(--accent)\"\n          />\n        </div>\n      </div>\n    </AgentSessionTarget>\n  );\n}\n\n/* ── Icons ───────────────────────────────────────────────── */\n\nfunction TernMark({ className }: { className?: string }) {\n  return (\n    <svg viewBox=\"0 0 24 24\" className={className} aria-hidden>\n      <path d=\"M1 7.5c4.2-.9 8 1.2 11 5 3-3.8 6.8-5.9 11-5-4.4 1.4-8.1 5-11 10.5C9.1 12.5 5.4 8.9 1 7.5Z\" fill=\"currentColor\" />\n    </svg>\n  );\n}\n\nfunction ArrowIcon({ className }: { className?: string }) {\n  return (\n    <svg viewBox=\"0 0 16 16\" className={className} fill=\"none\" stroke=\"currentColor\" strokeWidth={1.6} aria-hidden>\n      <path d=\"M3.5 8h9m-3.5-3.5L12.5 8 9 11.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n    </svg>\n  );\n}\n"
    }
  ]
}