{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "launch-workflow",
  "title": "Launch Workflow",
  "description": "Scope → Planner → OG in one room. Shared ProjectBrief. Preview without keys; AI Host APIs are BYOK.",
  "dependencies": [
    "lucide-react",
    "motion",
    "next"
  ],
  "registryDependencies": [
    "@atroui/utils",
    "@atroui/project-brief",
    "@atroui/scope-chat",
    "@atroui/project-planner",
    "@atroui/og-workspace",
    "@atroui/api-scope",
    "@atroui/api-generate"
  ],
  "files": [
    {
      "path": "registry/default/blocks/launch-room.tsx",
      "content": "\"use client\"\n\n/**\n * Launch Room — Scope → Planner → Social in one frame.\n * Family Values: one step at a time; brief travels; handoff CTA is the primary.\n *\n * Install: npx shadcn@latest add @atroui/launch-workflow\n */\n\nimport { useEffect, useState } from \"react\"\nimport Link from \"next/link\"\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\"\nimport { ArrowRight, Check } from \"lucide-react\"\n\nimport {\n  PROJECT_BRIEF_STORAGE_KEY,\n  briefOgSubtitle,\n  briefOgTitle,\n  buildOgHref,\n  isProjectBrief,\n  parseProjectBrief,\n  type ProjectBrief,\n  EMPTY_PROJECT_BRIEF,\n} from \"@/lib/project-brief\"\nimport { cn } from \"@/lib/utils\"\nimport { ScopeChat } from \"./scope-chat\"\nimport { ProjectPlanner } from \"./project-planner\"\nimport { OgWorkspace } from \"./og-workspace\"\n\nconst CONTENT = {\n  ogPath: \"/og\",\n  install: \"npx shadcn@latest add @atroui/launch-workflow\",\n}\n\ntype StepId = \"scope\" | \"planner\" | \"social\"\n\nconst STEPS: { id: StepId; label: string }[] = [\n  { id: \"scope\", label: \"Scope\" },\n  { id: \"planner\", label: \"Planner\" },\n  { id: \"social\", label: \"Social\" },\n]\n\nconst layoutTween = {\n  type: \"tween\" as const,\n  duration: 0.22,\n  ease: [0.16, 1, 0.3, 1] as const,\n}\n\nconst switchLayoutTween = {\n  type: \"tween\" as const,\n  duration: 0.28,\n  ease: [0.16, 1, 0.3, 1] as const,\n}\n\nfunction readStoredBrief(): ProjectBrief | null {\n  if (typeof window === \"undefined\") return null\n  try {\n    const raw = window.localStorage.getItem(PROJECT_BRIEF_STORAGE_KEY)\n    if (!raw) return null\n    return parseProjectBrief(raw)\n  } catch {\n    return null\n  }\n}\n\nfunction writeStoredBrief(brief: ProjectBrief) {\n  if (typeof window === \"undefined\") return\n  try {\n    window.localStorage.setItem(\n      PROJECT_BRIEF_STORAGE_KEY,\n      JSON.stringify(brief),\n    )\n  } catch {\n    /* ignore quota */\n  }\n}\n\nexport function LaunchRoom() {\n  const reduce = useReducedMotion()\n  const [step, setStep] = useState<StepId>(\"scope\")\n  const [brief, setBrief] = useState<ProjectBrief>(EMPTY_PROJECT_BRIEF)\n  const [mounted, setMounted] = useState(false)\n  const [copied, setCopied] = useState(false)\n\n  useEffect(() => {\n    const stored = readStoredBrief()\n    if (stored) setBrief(stored)\n    setMounted(true)\n  }, [])\n\n  const persistBrief = (next: ProjectBrief) => {\n    setBrief(next)\n    writeStoredBrief(next)\n  }\n\n  const hasBrief =\n    mounted &&\n    isProjectBrief(brief) &&\n    Boolean(brief.name.trim() || brief.oneLiner.trim())\n\n  const reading = hasBrief\n    ? `${brief.name || \"Untitled\"}${brief.oneLiner ? ` · ${brief.oneLiner.slice(0, 48)}` : \"\"}`\n    : \"Describe a project to start\"\n\n  const stepIndex = STEPS.findIndex((s) => s.id === step)\n\n  const goPlanner = () => {\n    if (!hasBrief) return\n    setStep(\"planner\")\n  }\n\n  const goSocial = () => {\n    if (!hasBrief) return\n    setStep(\"social\")\n  }\n\n  const copyInstall = async () => {\n    try {\n      await navigator.clipboard.writeText(CONTENT.install)\n      setCopied(true)\n      window.setTimeout(() => setCopied(false), 1600)\n    } catch {\n      /* ignore */\n    }\n  }\n\n  const ogHref = buildOgHref(brief, { path: CONTENT.ogPath })\n\n  return (\n    <div className=\"overflow-hidden rounded-[var(--atro-panel-radius)] border border-border-subtle bg-background\">\n      <header className=\"flex flex-wrap items-end justify-between gap-3 border-b border-border-subtle px-4 py-3.5 @min-[40rem]:px-5\">\n        <div className=\"min-w-0\">\n          <p className=\"font-mono text-[10px] tracking-[0.16em] text-muted-foreground uppercase\">\n            Launch room\n          </p>\n          <h1 className=\"mt-1 text-[1.45rem] font-medium tracking-[-0.035em] text-foreground @min-[40rem]:text-[1.75rem]\">\n            Scope to{\" \"}\n            <em className=\"font-normal italic text-brand\">social</em>\n          </h1>\n        </div>\n        <p\n          className=\"max-w-sm font-mono text-[10px] leading-snug tracking-[0.04em] text-muted-foreground @min-[40rem]:text-right\"\n          aria-live=\"polite\"\n        >\n          {reading}\n        </p>\n      </header>\n\n      <div\n        role=\"tablist\"\n        aria-label=\"Launch steps\"\n        className=\"sticky top-0 z-10 flex gap-0.5 border-b border-border-subtle bg-background/95 px-2 py-1.5 backdrop-blur-sm\"\n      >\n        {STEPS.map((item, i) => {\n          const selected = step === item.id\n          const done = i < stepIndex\n          return (\n            <button\n              key={item.id}\n              type=\"button\"\n              role=\"tab\"\n              aria-selected={selected}\n              onClick={() => {\n                if (i === 0 || hasBrief) setStep(item.id)\n              }}\n              disabled={i > 0 && !hasBrief}\n              className={cn(\n                \"relative flex flex-1 items-center justify-center gap-1 rounded-[calc(var(--atro-control-radius)-1px)] px-1 py-1.5 text-[11px] font-medium tracking-tight outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-40\",\n                selected\n                  ? \"text-foreground\"\n                  : \"text-muted-foreground hover:text-foreground\",\n              )}\n            >\n              {selected && !reduce ? (\n                <motion.span\n                  layoutId=\"launch-room-step-pill\"\n                  className=\"absolute inset-0 rounded-[calc(var(--atro-control-radius)-1px)] bg-muted/80 ring-1 ring-border-subtle\"\n                  transition={switchLayoutTween}\n                  aria-hidden\n                />\n              ) : null}\n              {selected && reduce ? (\n                <span\n                  className=\"absolute inset-0 rounded-[calc(var(--atro-control-radius)-1px)] bg-muted/80 ring-1 ring-border-subtle\"\n                  aria-hidden\n                />\n              ) : null}\n              <span className=\"relative z-[1] inline-flex items-center gap-1\">\n                {done ? (\n                  <Check className=\"size-3 text-brand\" strokeWidth={2.5} aria-hidden />\n                ) : null}\n                {item.label}\n              </span>\n            </button>\n          )\n        })}\n      </div>\n\n      <div className=\"relative min-h-[28rem] bg-[radial-gradient(90%_60%_at_50%_0%,color-mix(in_oklch,var(--brand)_10%,transparent),transparent_55%)]\">\n        <AnimatePresence mode=\"wait\" initial={false}>\n          <motion.div\n            key={step}\n            role=\"tabpanel\"\n            className=\"p-3 @min-[40rem]:p-4\"\n            initial={reduce ? false : { opacity: 0, y: 8 }}\n            animate={{ opacity: 1, y: 0 }}\n            exit={reduce ? undefined : { opacity: 0, y: -6 }}\n            transition={layoutTween}\n          >\n            {step === \"scope\" ? (\n              <ScopeChat onBriefChange={persistBrief} />\n            ) : null}\n            {step === \"planner\" ? (\n              <ProjectPlanner onBriefChange={persistBrief} />\n            ) : null}\n            {step === \"social\" ? (\n              <OgWorkspace\n                title={briefOgTitle(brief) || undefined}\n                subtitle={briefOgSubtitle(brief) || undefined}\n              />\n            ) : null}\n          </motion.div>\n        </AnimatePresence>\n      </div>\n\n      <div className=\"sticky bottom-0 z-10 flex flex-col gap-2 border-t border-border-subtle bg-background/95 px-3 py-3 backdrop-blur-sm @min-[40rem]:flex-row @min-[40rem]:items-center @min-[40rem]:justify-between @min-[40rem]:px-4\">\n        <p className=\"font-mono text-[10px] tracking-[0.08em] text-muted-foreground\">\n          {step === \"scope\"\n            ? \"Send a message, then continue\"\n            : step === \"planner\"\n              ? \"Reach estimate, then continue — or skip to social\"\n              : \"Preview without keys · AI needs Host API env\"}\n        </p>\n        <div className=\"flex flex-wrap items-center gap-2\">\n          {step === \"scope\" ? (\n            <button\n              type=\"button\"\n              className=\"atro-btn\"\n              disabled={!hasBrief}\n              onClick={goPlanner}\n            >\n              Continue to planner\n              <ArrowRight className=\"size-4\" aria-hidden />\n            </button>\n          ) : null}\n          {step === \"planner\" ? (\n            <>\n              <button\n                type=\"button\"\n                className=\"atro-btn\"\n                disabled={!hasBrief}\n                onClick={goSocial}\n              >\n                Continue to social\n                <ArrowRight className=\"size-4\" aria-hidden />\n              </button>\n              <Link href={ogHref} className=\"atro-btn-ghost\">\n                Open full OG\n              </Link>\n            </>\n          ) : null}\n          {step === \"social\" ? (\n            <>\n              <Link href={ogHref} className=\"atro-btn\">\n                Open full OG\n                <ArrowRight className=\"size-4\" aria-hidden />\n              </Link>\n              <button type=\"button\" className=\"atro-btn-ghost\" onClick={copyInstall}>\n                {copied ? \"Copied\" : \"Copy install\"}\n              </button>\n            </>\n          ) : null}\n        </div>\n      </div>\n    </div>\n  )\n}\n",
      "type": "registry:component",
      "target": "components/blocks/launch-room.tsx"
    },
    {
      "path": "registry/default/app/launch/page.tsx",
      "content": "import { LaunchRoom } from \"@/components/blocks/launch-room\"\n\n/**\n * Consumer launch path — dropped by @atroui/launch-workflow.\n * Wire SiteHeader / layout in your app as needed.\n */\nexport default function LaunchPage() {\n  return (\n    <main className=\"mx-auto max-w-5xl px-4 py-8 @min-[40rem]:px-6 @min-[40rem]:py-10\">\n      <LaunchRoom />\n    </main>\n  )\n}\n",
      "type": "registry:file",
      "target": "app/launch/page.tsx"
    }
  ],
  "type": "registry:block"
}