{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "conductor",
  "type": "registry:block",
  "title": "Conductor",
  "description": "Chat with a lead agent while it works: it streams its replies, hands tasks to helpers whose progress ticks along in a side panel and writes what it learns straight into a launch brief you can edit beside the chat.",
  "categories": [
    "screen",
    "AI"
  ],
  "dependencies": [
    "motion",
    "lucide-react"
  ],
  "registryDependencies": [
    "utils",
    "https://coss.com/ui/r/button.json"
  ],
  "files": [
    {
      "path": "registry/devl/conductor.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport { AnimatePresence, LayoutGroup, MotionConfig, motion, useReducedMotion } from \"motion/react\";\nimport {\n  ArrowUpIcon,\n  CalendarIcon,\n  CheckIcon,\n  CircleDashedIcon,\n  FileTextIcon,\n  GaugeIcon,\n  HandIcon,\n  LoaderCircleIcon,\n  MegaphoneIcon,\n  MessageSquareQuoteIcon,\n  RotateCcwIcon,\n  SendIcon,\n  SparklesIcon,\n  UsersIcon,\n  WalletIcon,\n  WorkflowIcon,\n} from \"lucide-react\";\nimport { type ComponentType, type KeyboardEvent, type ReactNode, useEffect, useId, useReducer, useRef, useState } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils\";\n\nexport type AgentTone = \"orange\" | \"teal\" | \"violet\" | \"info\" | \"rose\";\n\nexport interface SubAgent {\n  id: string;\n  name: string;\n  role: string;\n  tone: AgentTone;\n  actions: string[];\n  result?: string;\n}\n\nexport interface BriefField {\n  key: string;\n  label: string;\n  kind: \"text\" | \"textarea\" | \"chips\";\n  placeholder?: string;\n}\n\nexport interface ConductorProps {\n  agentName?: string;\n  briefTitle?: string;\n  fields?: BriefField[];\n  agents?: SubAgent[];\n  channelOptions?: string[];\n  autoPlay?: boolean;\n  className?: string;\n}\n\ntype Status = \"queued\" | \"working\" | \"waiting\" | \"done\";\n\ninterface Msg {\n  id: string;\n  role: \"user\" | \"agent\";\n  text: string;\n  shown: number;\n  spawned?: string[];\n  updated?: number;\n  ask?: boolean;\n}\n\ninterface FieldState {\n  value: string | string[];\n  target?: string;\n  by?: \"agent\" | \"you\";\n  flash?: number;\n}\n\ninterface AgentState {\n  status: Status;\n  progress: number;\n  step: number;\n}\n\ninterface State {\n  msgs: Msg[];\n  fields: Record<string, FieldState>;\n  agents: Record<string, AgentState>;\n  cue: number;\n  seq: number;\n  waiting: boolean;\n  done: boolean;\n}\n\nconst tone: Record<AgentTone, { dot: string; soft: string; stroke: string }> = {\n  orange: { dot: \"bg-orange-500\", soft: \"bg-orange-500/14 text-orange-700 dark:text-orange-300\", stroke: \"stroke-orange-500\" },\n  teal: { dot: \"bg-teal-500\", soft: \"bg-teal-500/14 text-teal-700 dark:text-teal-300\", stroke: \"stroke-teal-500\" },\n  violet: { dot: \"bg-violet-500\", soft: \"bg-violet-500/16 text-violet-700 dark:text-violet-300\", stroke: \"stroke-violet-500\" },\n  rose: { dot: \"bg-rose-500\", soft: \"bg-rose-500/14 text-rose-700 dark:text-rose-300\", stroke: \"stroke-rose-500\" },\n  info: { dot: \"bg-info\", soft: \"bg-info/14 text-info-foreground\", stroke: \"stroke-info\" },\n};\n\nconst fieldIcons: Record<string, ComponentType<{ className?: string }>> = {\n  date: CalendarIcon,\n  audience: UsersIcon,\n  budget: WalletIcon,\n  metric: GaugeIcon,\n  tone: MessageSquareQuoteIcon,\n  channels: MegaphoneIcon,\n};\n\nconst defaultAgents: SubAgent[] = [\n  { id: \"scout\", name: \"Scout\", role: \"Research\", tone: \"teal\", actions: [\"Reading 12 agency launch posts\", \"Comparing 4 calendar tools\", \"Summarising what worked\"], result: \"3 launch patterns from 12 posts\" },\n  { id: \"ledger\", name: \"Ledger\", role: \"Budget\", tone: \"violet\", actions: [\"Splitting $40k across channels\", \"Checking cost-per-trial benchmarks\", \"Drafting the budget table\"], result: \"Budget table, $18 per trial\" },\n  { id: \"quill\", name: \"Quill\", role: \"Copy\", tone: \"orange\", actions: [\"Drafting six taglines\", \"Writing launch email v1\", \"Needs channels to finish\"], result: \"6 taglines and launch email v1\" },\n  { id: \"iris\", name: \"Iris\", role: \"Design\", tone: \"info\", actions: [\"Sizing assets per channel\", \"Pulling a warm palette\", \"Exporting the moodboard\"], result: \"14 assets sized for 2 channels\" },\n];\n\nconst defaultFields: BriefField[] = [\n  { key: \"project\", label: \"Project\", kind: \"text\", placeholder: \"Untitled launch\" },\n  { key: \"date\", label: \"Launch date\", kind: \"text\", placeholder: \"Empty\" },\n  { key: \"audience\", label: \"Audience\", kind: \"chips\" },\n  { key: \"budget\", label: \"Budget\", kind: \"text\", placeholder: \"Empty\" },\n  { key: \"goal\", label: \"Goal\", kind: \"textarea\", placeholder: \"One sentence on why this matters\" },\n  { key: \"metric\", label: \"Target\", kind: \"text\", placeholder: \"Empty\" },\n  { key: \"tone\", label: \"Voice\", kind: \"text\", placeholder: \"Empty\" },\n  { key: \"channels\", label: \"Channels\", kind: \"chips\" },\n];\n\nconst defaultChannels = [\"Newsletter\", \"Product Hunt\", \"LinkedIn\", \"Partner agencies\", \"Podcasts\"];\n\ntype Cue =\n  | { wait: number; user: string }\n  | { wait: number; agent: string; spawned?: string[]; updated?: number; ask?: boolean }\n  | { wait: number; fill: Record<string, string | string[]> }\n  | { wait: number; start: string[] };\n\nconst script: Cue[] = [\n  { wait: 500, user: \"We're launching Orbit Calendar on Nov 18. Need a launch plan aimed at small agencies, budget around $40k.\" },\n  { wait: 900, agent: \"On it. I've opened a brief and filled in what you gave me. Scout is reading how similar tools launched, and Ledger is sketching a budget split.\", spawned: [\"scout\", \"ledger\"], updated: 4 },\n  { wait: 200, fill: { project: \"Orbit Calendar launch\", date: \"Nov 18, 2026\", audience: [\"Small agencies\", \"Freelance studios\"], budget: \"$40,000\" } },\n  { wait: 300, start: [\"scout\", \"ledger\"] },\n  { wait: 4200, user: \"Main goal is 2,000 trial signups in the first month. Keep it warm, not salesy.\" },\n  { wait: 900, agent: \"Got it. Goal, metric and voice are in. Quill is drafting taglines in that tone.\", spawned: [\"quill\"], updated: 3 },\n  { wait: 200, fill: { goal: \"Get small agencies to try Orbit Calendar as the one planner the whole team shares.\", metric: \"2,000 trial signups in 30 days\", tone: \"Warm and plain-spoken, no hype\" } },\n  { wait: 300, start: [\"quill\"] },\n  { wait: 4800, agent: \"Scout found that agency tools do best through partner referrals and a short newsletter run. Which channels should we commit to?\", ask: true },\n];\n\nconst finish: Cue[] = [\n  { wait: 700, agent: \"Perfect. Channels are set, Iris is sizing assets for each, and Quill can finish the copy. The brief is complete whenever you are.\", spawned: [\"iris\"], updated: 1 },\n  { wait: 200, start: [\"iris\"] },\n];\n\ntype Action =\n  | { type: \"cue\"; cue: Cue }\n  | { type: \"tick\"; agents: SubAgent[] }\n  | { type: \"type\" }\n  | { type: \"edit\"; key: string; value: string | string[] }\n  | { type: \"say\"; text: string }\n  | { type: \"channels\"; picks: string[] }\n  | { type: \"reset\"; fields: BriefField[]; agents: SubAgent[] };\n\nconst ease = [0.23, 1, 0.32, 1] as const;\n\nfunction initial(fields: BriefField[], agents: SubAgent[]): State {\n  return {\n    msgs: [],\n    fields: Object.fromEntries(fields.map((f) => [f.key, { value: f.kind === \"chips\" ? [] : \"\" }])),\n    agents: Object.fromEntries(agents.map((a) => [a.id, { status: \"queued\" as Status, progress: 0, step: 0 }])),\n    cue: 0,\n    seq: 0,\n    waiting: false,\n    done: false,\n  };\n}\n\nfunction apply(state: State, cue: Cue): State {\n  const seq = state.seq + 1;\n  const id = `m${seq}`;\n  if (\"user\" in cue) {\n    return { ...state, seq, msgs: [...state.msgs, { id, role: \"user\", text: cue.user, shown: cue.user.length }] };\n  }\n  if (\"agent\" in cue) {\n    const msg: Msg = { id, role: \"agent\", text: cue.agent, shown: 0, spawned: cue.spawned, updated: cue.updated, ask: cue.ask };\n    return { ...state, seq, msgs: [...state.msgs, msg], waiting: Boolean(cue.ask) };\n  }\n  if (\"fill\" in cue) {\n    const fields = { ...state.fields };\n    for (const [k, v] of Object.entries(cue.fill)) {\n      fields[k] = Array.isArray(v)\n        ? { value: v, by: \"agent\", flash: seq }\n        : { value: \"\", target: v, by: \"agent\", flash: seq };\n    }\n    return { ...state, seq, fields };\n  }\n  const agents = { ...state.agents };\n  for (const aid of cue.start) agents[aid] = { ...agents[aid], status: \"working\" };\n  return { ...state, agents };\n}\n\nfunction reducer(state: State, action: Action): State {\n  switch (action.type) {\n    case \"cue\":\n      return { ...apply(state, action.cue), cue: state.cue + 1 };\n    case \"type\": {\n      let changed = false;\n      const msgs = state.msgs.map((m) => {\n        if (m.shown >= m.text.length) return m;\n        changed = true;\n        return { ...m, shown: Math.min(m.text.length, m.shown + 3) };\n      });\n      const fields = { ...state.fields };\n      for (const [k, f] of Object.entries(fields)) {\n        if (f.target && typeof f.value === \"string\" && f.value.length < f.target.length) {\n          changed = true;\n          fields[k] = { ...f, value: f.target.slice(0, f.value.length + 2) };\n        }\n      }\n      return changed ? { ...state, msgs, fields } : state;\n    }\n    case \"tick\": {\n      let changed = false;\n      const agents = { ...state.agents };\n      for (const a of action.agents) {\n        const s = agents[a.id];\n        if (!s || s.status !== \"working\") continue;\n        changed = true;\n        const progress = Math.min(100, s.progress + 3 + ((s.progress * 7 + a.id.length) % 5));\n        const step = Math.min(a.actions.length - 1, Math.floor((progress / 100) * a.actions.length));\n        const needsChannels = a.id === \"quill\" && (state.fields.channels?.value as string[]).length === 0;\n        if (needsChannels && progress >= 78) {\n          agents[a.id] = { status: \"waiting\", progress: 78, step: a.actions.length - 1 };\n        } else {\n          agents[a.id] = { status: progress >= 100 ? \"done\" : \"working\", progress, step };\n        }\n      }\n      return changed ? { ...state, agents } : state;\n    }\n    case \"edit\":\n      return { ...state, fields: { ...state.fields, [action.key]: { value: action.value, by: \"you\" } } };\n    case \"say\":\n      return {\n        ...state,\n        seq: state.seq + 2,\n        msgs: [\n          ...state.msgs,\n          { id: `m${state.seq + 1}`, role: \"user\", text: action.text, shown: action.text.length },\n          {\n            id: `m${state.seq + 2}`,\n            role: \"agent\",\n            text: \"Noted. I'll pass that to the helpers so they pick it up on their next pass.\",\n            shown: 0,\n          },\n        ],\n      };\n    case \"channels\": {\n      const agents = { ...state.agents };\n      if (agents.quill?.status === \"waiting\") agents.quill = { ...agents.quill, status: \"working\" };\n      const text = action.picks.join(\", \");\n      const seq = state.seq + 1;\n      return {\n        ...state,\n        seq,\n        waiting: false,\n        done: true,\n        agents,\n        msgs: [...state.msgs, { id: `m${seq}`, role: \"user\", text, shown: text.length }],\n        fields: { ...state.fields, channels: { value: action.picks, by: \"agent\", flash: seq } },\n      };\n    }\n    case \"reset\":\n      return initial(action.fields, action.agents);\n  }\n}\n\nfunction statusLabel(s: AgentState, a: SubAgent) {\n  if (s.status === \"done\") return a.result ?? \"Finished\";\n  if (s.status === \"queued\") return \"Queued\";\n  return a.actions[s.step];\n}\n\nfunction AgentMark({ agent, state, size = \"md\" }: { agent: SubAgent; state: AgentState; size?: \"sm\" | \"md\" }) {\n  const reduce = useReducedMotion();\n  const t = tone[agent.tone];\n  const sm = size === \"sm\";\n  return (\n    <span className={cn(\"relative shrink-0\", sm ? \"size-6\" : \"size-8\")}>\n      {!sm && (\n        <svg aria-hidden className=\"absolute inset-0 size-8 -rotate-90\" viewBox=\"0 0 32 32\">\n          <circle className=\"stroke-border\" cx=\"16\" cy=\"16\" fill=\"none\" r=\"15\" strokeWidth=\"1.5\" />\n          <motion.circle\n            animate={{ pathLength: state.status === \"queued\" ? 0 : state.progress / 100 }}\n            className={cn(\"transition-colors duration-300\", state.status === \"done\" ? \"stroke-success\" : state.status === \"waiting\" ? \"stroke-warning\" : t.stroke)}\n            cx=\"16\"\n            cy=\"16\"\n            fill=\"none\"\n            initial={false}\n            r=\"15\"\n            strokeLinecap=\"round\"\n            strokeWidth=\"1.5\"\n            transition={reduce ? { duration: 0 } : { type: \"spring\", stiffness: 120, damping: 24 }}\n          />\n        </svg>\n      )}\n      <span\n        className={cn(\n          \"absolute flex items-center justify-center rounded-full font-semibold\",\n          sm ? \"inset-0 text-[10px]\" : \"inset-[4px] text-[11px]\",\n          t.soft,\n        )}\n      >\n        {agent.name[0]}\n      </span>\n      <AnimatePresence>\n        {!sm && state.status === \"done\" && (\n          <motion.span\n            animate={{ opacity: 1, scale: 1 }}\n            className=\"absolute -right-0.5 -bottom-0.5 flex size-3.5 items-center justify-center rounded-full bg-success text-white ring-2 ring-background\"\n            initial={{ opacity: 0, scale: 0.6 }}\n            transition={{ type: \"spring\", stiffness: 500, damping: 28 }}\n          >\n            <CheckIcon className=\"size-2.5\" strokeWidth={3} />\n          </motion.span>\n        )}\n      </AnimatePresence>\n    </span>\n  );\n}\n\nfunction AgentPanel({ agents, state }: { agents: SubAgent[]; state: State }) {\n  const active = agents.filter((a) => state.agents[a.id]?.status !== \"queued\" || state.msgs.some((m) => m.spawned?.includes(a.id)));\n  const working = agents.filter((a) => state.agents[a.id]?.status === \"working\").length;\n  const waiting = agents.filter((a) => state.agents[a.id]?.status === \"waiting\").length;\n  const done = active.length > 0 && active.every((a) => state.agents[a.id]?.status === \"done\");\n  const summary = working ? `${working} working` : waiting ? `${waiting} needs you` : done ? `All ${active.length} done` : active.length ? \"Idle\" : \"None yet\";\n  return (\n    <div className=\"flex h-full min-h-0 flex-col\">\n      <div className=\"flex h-11 shrink-0 items-center gap-2 px-4\">\n        <span className=\"font-medium\">Helpers</span>\n        <span className=\"ms-auto flex items-center gap-1.5 text-muted-foreground text-xs tabular-nums\" aria-live=\"polite\">\n          <span\n            className={cn(\n              \"size-1.5 rounded-full transition-colors\",\n              working ? \"animate-pulse bg-info motion-reduce:animate-none\" : waiting ? \"bg-warning\" : done ? \"bg-success\" : \"bg-muted-foreground/40\",\n            )}\n          />\n          {summary}\n        </span>\n      </div>\n      <div className=\"min-h-0 flex-1 overflow-y-auto px-2 pb-3\">\n        {active.length === 0 ? (\n          <div className=\"mx-2 mt-1 flex flex-col items-center gap-2 rounded-xl border border-dashed px-4 py-8 text-center text-muted-foreground text-xs\">\n            <CircleDashedIcon className=\"size-4\" />\n            Helpers show up here as work is handed out.\n          </div>\n        ) : (\n          <ul className=\"flex flex-col\">\n            <AnimatePresence initial={false}>\n              {active.map((a) => {\n                const s = state.agents[a.id];\n                return (\n                  <motion.li\n                    animate={{ opacity: 1, y: 0 }}\n                    className=\"flex gap-3 rounded-lg px-2 py-2.5\"\n                    initial={{ opacity: 0, y: 6 }}\n                    key={a.id}\n                    layout=\"position\"\n                    transition={{ duration: 0.24, ease }}\n                  >\n                    <AgentMark agent={a} state={s} />\n                    <div className=\"min-w-0 flex-1\">\n                      <div className=\"flex items-baseline gap-1.5\">\n                        <span className=\"font-medium\">{a.name}</span>\n                        <span className=\"truncate text-muted-foreground text-xs\">{a.role}</span>\n                        <span\n                          className={cn(\n                            \"ms-auto shrink-0 text-xs tabular-nums\",\n                            s.status === \"waiting\" ? \"font-medium text-warning-foreground\" : \"text-muted-foreground\",\n                          )}\n                        >\n                          {s.status === \"waiting\" ? \"Needs you\" : s.status === \"done\" ? \"Done\" : s.status === \"queued\" ? \"\" : `${s.progress}%`}\n                        </span>\n                      </div>\n                      <div className={cn(\"relative mt-0.5 h-4 overflow-hidden text-xs\", s.status === \"done\" ? \"text-foreground/80\" : \"text-muted-foreground\")}>\n                        <AnimatePresence initial={false} mode=\"popLayout\">\n                          <motion.span\n                            animate={{ y: 0, opacity: 1 }}\n                            className=\"block truncate\"\n                            exit={{ y: -10, opacity: 0 }}\n                            initial={{ y: 10, opacity: 0 }}\n                            key={s.status === \"done\" ? \"done\" : s.step}\n                            transition={{ duration: 0.22, ease }}\n                          >\n                            {statusLabel(s, a)}\n                          </motion.span>\n                        </AnimatePresence>\n                      </div>\n                    </div>\n                  </motion.li>\n                );\n              })}\n            </AnimatePresence>\n          </ul>\n        )}\n      </div>\n    </div>\n  );\n}\n\nfunction Flash({ seq }: { seq?: number }) {\n  const mounted = useRef(seq);\n  return (\n    <AnimatePresence>\n      {seq && seq !== mounted.current ? (\n        <motion.span\n          animate={{ opacity: 0 }}\n          aria-hidden\n          className=\"pointer-events-none absolute inset-0 rounded-md bg-info/14\"\n          initial={{ opacity: 1 }}\n          key={seq}\n          transition={{ duration: 1.4, ease: \"easeOut\" }}\n        />\n      ) : null}\n    </AnimatePresence>\n  );\n}\n\nfunction Provenance({ by, agentName }: { by?: \"agent\" | \"you\"; agentName: string }) {\n  if (by !== \"agent\") return null;\n  return (\n    <span className=\"ms-auto inline-flex shrink-0 items-center text-info\" title={`Filled by ${agentName}`}>\n      <SparklesIcon aria-hidden className=\"size-3\" />\n      <span className=\"sr-only\">Filled by {agentName}</span>\n    </span>\n  );\n}\n\nfunction BriefDoc({\n  title,\n  fields,\n  state,\n  onEdit,\n  agentName,\n}: {\n  title: string;\n  fields: BriefField[];\n  state: State;\n  onEdit: (key: string, value: string | string[]) => void;\n  agentName: string;\n}) {\n  const id = useId();\n  const filled = fields.filter((f) => {\n    const v = state.fields[f.key]?.value;\n    return Array.isArray(v) ? v.length > 0 : Boolean(v);\n  }).length;\n  const pct = filled / fields.length;\n  const head = fields.find((f) => f.kind === \"text\");\n  const props = fields.filter((f) => f !== head && f.kind !== \"textarea\");\n  const sections = fields.filter((f) => f.kind === \"textarea\");\n  const headState = head ? state.fields[head.key] : undefined;\n\n  return (\n    <div className=\"flex h-full min-h-0 flex-col\">\n      <div className=\"flex h-11 shrink-0 items-center gap-2 px-5\">\n        <FileTextIcon className=\"size-4 text-muted-foreground\" />\n        <span className=\"min-w-0 flex-1 truncate font-medium\">{title}</span>\n        <span className=\"text-muted-foreground text-xs tabular-nums\">\n          {filled} of {fields.length}\n        </span>\n        <span className=\"h-1 w-12 overflow-hidden rounded-full bg-muted\">\n          <motion.span\n            animate={{ scaleX: pct }}\n            className={cn(\"block h-full origin-left rounded-full transition-colors duration-300\", pct === 1 ? \"bg-success\" : \"bg-primary\")}\n            initial={false}\n            transition={{ type: \"spring\", stiffness: 160, damping: 26 }}\n          />\n        </span>\n      </div>\n      <form className=\"min-h-0 flex-1 overflow-y-auto px-5 pt-3 pb-6\" onSubmit={(e) => e.preventDefault()}>\n        {head && (\n          <div className=\"relative -mx-2\">\n            <label className=\"sr-only\" htmlFor={`${id}-${head.key}`}>\n              {head.label}\n            </label>\n            <input\n              className=\"h-10 w-full rounded-md bg-transparent px-2 font-semibold text-xl tracking-tight outline-none transition-colors placeholder:text-muted-foreground/56 hover:bg-accent/50 focus-visible:bg-accent/60\"\n              id={`${id}-${head.key}`}\n              onChange={(e) => onEdit(head.key, e.target.value)}\n              placeholder={head.placeholder}\n              value={(headState?.value as string) ?? \"\"}\n            />\n            <Flash seq={headState?.flash} />\n          </div>\n        )}\n        <p className=\"mt-1 text-pretty text-muted-foreground text-xs\">\n          {agentName} fills this in as you talk. Anything you edit stays yours.\n        </p>\n\n        <dl className=\"mt-5 flex flex-col gap-0.5\">\n          {props.map((f) => {\n            const s = state.fields[f.key] ?? { value: \"\" };\n            const fid = `${id}-${f.key}`;\n            const Icon = fieldIcons[f.key] ?? CircleDashedIcon;\n            return (\n              <div className=\"grid min-h-8 grid-cols-[6.25rem_minmax(0,1fr)] items-start gap-1.5 @md:grid-cols-[7rem_minmax(0,1fr)]\" key={f.key}>\n                <dt className=\"flex h-8 items-center gap-2 text-muted-foreground\">\n                  <Icon className={cn(\"size-3.5 shrink-0 transition-colors duration-300\", s.by === \"agent\" && \"text-info\")} />\n                  <label className=\"truncate\" htmlFor={fid}>\n                    {f.label}\n                  </label>\n                  {s.by === \"agent\" && <span className=\"sr-only\">, filled by {agentName}</span>}\n                </dt>\n                <dd className=\"relative\">\n                  {f.kind === \"chips\" ? (\n                    <ChipsField\n                      id={fid}\n                      onChange={(v) => onEdit(f.key, v)}\n                      placeholder={f.key === \"channels\" ? \"Waiting on your pick\" : \"Add and press Enter\"}\n                      value={Array.isArray(s.value) ? s.value : []}\n                    />\n                  ) : (\n                    <div className=\"flex h-8 items-center gap-2 rounded-md px-2 transition-colors focus-within:bg-accent/60 hover:bg-accent/50\">\n                      <input\n                        className=\"h-full min-w-0 flex-1 bg-transparent outline-none placeholder:text-muted-foreground/56\"\n                        id={fid}\n                        onChange={(e) => onEdit(f.key, e.target.value)}\n                        placeholder={f.placeholder ?? \"Empty\"}\n                        value={s.value as string}\n                      />\n                    </div>\n                  )}\n                  <Flash seq={s.flash} />\n                </dd>\n              </div>\n            );\n          })}\n        </dl>\n\n        {sections.map((f) => {\n          const s = state.fields[f.key] ?? { value: \"\" };\n          const fid = `${id}-${f.key}`;\n          return (\n            <div className=\"mt-5 border-t pt-4\" key={f.key}>\n              <div className=\"flex items-center gap-2\">\n                <label className=\"font-medium text-xs\" htmlFor={fid}>\n                  {f.label}\n                </label>\n                <Provenance agentName={agentName} by={s.by} />\n              </div>\n              <div className=\"relative -mx-2 mt-1\">\n                <textarea\n                  className=\"field-sizing-content min-h-16 w-full resize-none rounded-md bg-transparent px-2 py-1.5 leading-relaxed outline-none transition-colors placeholder:text-muted-foreground/56 hover:bg-accent/50 focus-visible:bg-accent/60\"\n                  id={fid}\n                  onChange={(e) => onEdit(f.key, e.target.value)}\n                  placeholder={f.placeholder}\n                  value={s.value as string}\n                />\n                <Flash seq={s.flash} />\n              </div>\n            </div>\n          );\n        })}\n      </form>\n    </div>\n  );\n}\n\nfunction ChipsField({\n  id,\n  value,\n  onChange,\n  placeholder,\n}: {\n  id: string;\n  value: string[];\n  onChange: (v: string[]) => void;\n  placeholder: string;\n}) {\n  const [draft, setDraft] = useState(\"\");\n  const onKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n    if (e.key === \"Enter\" && draft.trim()) {\n      e.preventDefault();\n      if (!value.includes(draft.trim())) onChange([...value, draft.trim()]);\n      setDraft(\"\");\n    } else if (e.key === \"Backspace\" && !draft && value.length) {\n      onChange(value.slice(0, -1));\n    }\n  };\n  return (\n    <div className=\"flex min-h-8 flex-wrap items-center gap-1 rounded-md px-1.5 py-1 transition-colors focus-within:bg-accent/60 hover:bg-accent/50\">\n      <AnimatePresence initial={false} mode=\"popLayout\">\n        {value.map((v) => (\n          <motion.span\n            animate={{ opacity: 1, scale: 1 }}\n            className=\"inline-flex h-6 items-center gap-0.5 rounded-md border bg-background ps-2 pe-0.5 text-xs shadow-xs/5 dark:bg-input/40\"\n            exit={{ opacity: 0, scale: 0.9 }}\n            initial={{ opacity: 0, scale: 0.9 }}\n            key={v}\n            layout\n            transition={{ type: \"spring\", stiffness: 500, damping: 34 }}\n          >\n            {v}\n            <button\n              aria-label={`Remove ${v}`}\n              className=\"relative flex size-4 cursor-pointer items-center justify-center rounded text-muted-foreground outline-none after:absolute after:-inset-1.5 hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring\"\n              onClick={() => onChange(value.filter((x) => x !== v))}\n              type=\"button\"\n            >\n              ×\n            </button>\n          </motion.span>\n        ))}\n      </AnimatePresence>\n      <input\n        className=\"h-6 min-w-12 flex-1 bg-transparent px-0.5 text-base outline-none placeholder:text-muted-foreground/56 sm:text-sm\"\n        id={id}\n        onChange={(e) => setDraft(e.target.value)}\n        onKeyDown={onKeyDown}\n        placeholder={value.length ? \"\" : placeholder}\n        value={draft}\n      />\n    </div>\n  );\n}\n\nfunction ActivityRows({\n  msg,\n  agents,\n  state,\n  briefTitle,\n  onOpen,\n}: {\n  msg: Msg;\n  agents: SubAgent[];\n  state: State;\n  briefTitle: string;\n  onOpen: (pane: \"brief\" | \"agents\") => void;\n}) {\n  const rows: { key: string; pane: \"brief\" | \"agents\"; icon: ReactNode; label: ReactNode; meta: ReactNode }[] = [];\n  if (msg.updated) {\n    rows.push({\n      key: \"brief\",\n      pane: \"brief\",\n      icon: <FileTextIcon className=\"size-3.5 text-muted-foreground\" />,\n      label: (\n        <>\n          Filled {msg.updated} {msg.updated === 1 ? \"field\" : \"fields\"} in <span className=\"font-medium text-foreground\">{briefTitle}</span>\n        </>\n      ),\n      meta: <SparklesIcon className=\"size-3 text-info\" />,\n    });\n  }\n  for (const sid of msg.spawned ?? []) {\n    const a = agents.find((x) => x.id === sid);\n    const s = state.agents[sid];\n    if (!a || !s) continue;\n    rows.push({\n      key: sid,\n      pane: \"agents\",\n      icon: <AgentMark agent={a} size=\"sm\" state={s} />,\n      label: (\n        <>\n          Asked <span className=\"font-medium text-foreground\">{a.name}</span> to help with {a.role.toLowerCase()}\n        </>\n      ),\n      meta:\n        s.status === \"done\" ? (\n          <span className=\"inline-flex items-center gap-1 text-success-foreground\">\n            <CheckIcon className=\"size-3\" />\n            Done\n          </span>\n        ) : s.status === \"waiting\" ? (\n          <span className=\"inline-flex items-center gap-1 text-warning-foreground\">\n            <HandIcon className=\"size-3\" />\n            Needs you\n          </span>\n        ) : s.status === \"working\" ? (\n          <span className=\"inline-flex items-center gap-1 tabular-nums\">\n            <LoaderCircleIcon className=\"size-3 animate-spin motion-reduce:animate-none\" />\n            {s.progress}%\n          </span>\n        ) : (\n          \"Queued\"\n        ),\n    });\n  }\n  if (!rows.length) return null;\n  return (\n    <motion.div\n      animate={{ opacity: 1, y: 0 }}\n      className=\"overflow-hidden rounded-xl border bg-card shadow-xs/5\"\n      initial={{ opacity: 0, y: 4 }}\n      transition={{ duration: 0.22, ease }}\n    >\n      {rows.map((r) => (\n        <button\n          className=\"flex h-9 w-full cursor-pointer items-center gap-2.5 border-b px-3 text-start text-muted-foreground text-xs outline-none transition-colors last:border-b-0 hover:bg-accent/50 focus-visible:bg-accent/60\"\n          key={r.key}\n          onClick={() => onOpen(r.pane)}\n          type=\"button\"\n        >\n          <span className=\"flex size-6 shrink-0 items-center justify-center\">{r.icon}</span>\n          <span className=\"min-w-0 flex-1 truncate\">{r.label}</span>\n          <span className=\"shrink-0 text-muted-foreground\">{r.meta}</span>\n        </button>\n      ))}\n    </motion.div>\n  );\n}\n\nexport function Conductor({\n  agentName = \"Conductor\",\n  briefTitle = \"Launch brief\",\n  fields = defaultFields,\n  agents = defaultAgents,\n  channelOptions = defaultChannels,\n  autoPlay = true,\n  className,\n}: ConductorProps) {\n  const [state, dispatch] = useReducer(reducer, undefined, () => initial(fields, agents));\n  const [picks, setPicks] = useState<string[]>([]);\n  const [draft, setDraft] = useState(\"\");\n  const [mode, setMode] = useState<\"narrow\" | \"mid\" | \"wide\">(\"wide\");\n  const [pane, setPane] = useState<\"chat\" | \"brief\" | \"agents\">(\"chat\");\n  const [side, setSide] = useState<\"brief\" | \"agents\">(\"brief\");\n  const [finishing, setFinishing] = useState(-1);\n  const [handedOff, setHandedOff] = useState(false);\n  const rootRef = useRef<HTMLDivElement>(null);\n  const scrollRef = useRef<HTMLDivElement>(null);\n  const reduce = useReducedMotion();\n  const group = useId();\n\n  useEffect(() => {\n    const el = rootRef.current;\n    if (!el) return;\n    const ro = new ResizeObserver(([e]) => {\n      const w = e.contentRect.width;\n      setMode(w < 768 ? \"narrow\" : w < 1100 ? \"mid\" : \"wide\");\n    });\n    ro.observe(el);\n    return () => ro.disconnect();\n  }, []);\n\n  useEffect(() => {\n    if (!autoPlay || state.cue >= script.length) return;\n    const t = setTimeout(() => dispatch({ type: \"cue\", cue: script[state.cue] }), reduce ? 150 : script[state.cue].wait);\n    return () => clearTimeout(t);\n  }, [autoPlay, state.cue, reduce]);\n\n  useEffect(() => {\n    if (finishing < 0 || finishing >= finish.length) return;\n    const t = setTimeout(() => {\n      dispatch({ type: \"cue\", cue: finish[finishing] });\n      setFinishing((f) => f + 1);\n    }, finish[finishing].wait);\n    return () => clearTimeout(t);\n  }, [finishing]);\n\n  const streaming = state.msgs.some((m) => m.shown < m.text.length) || Object.values(state.fields).some((f) => f.target && typeof f.value === \"string\" && f.value.length < f.target.length);\n  useEffect(() => {\n    if (!streaming) return;\n    const t = setInterval(() => dispatch({ type: \"type\" }), reduce ? 5 : 28);\n    return () => clearInterval(t);\n  }, [streaming, reduce]);\n\n  const working = Object.values(state.agents).some((a) => a.status === \"working\");\n  useEffect(() => {\n    if (!working) return;\n    const t = setInterval(() => dispatch({ type: \"tick\", agents }), 420);\n    return () => clearInterval(t);\n  }, [working, agents]);\n\n  const lastAgent = [...state.msgs].reverse().find((m) => m.role === \"agent\");\n  const asking = Boolean(state.waiting && lastAgent?.ask && lastAgent.shown >= lastAgent.text.length);\n\n  const msgCount = state.msgs.length;\n  const lastShown = state.msgs.at(-1)?.shown ?? 0;\n  useEffect(() => {\n    const el = scrollRef.current;\n    if (!el) return;\n    const toBottom = () => el.scrollTo({ top: el.scrollHeight, behavior: reduce ? \"auto\" : \"smooth\" });\n    toBottom();\n    // The channel picker grows the footer; follow it so the question stays in view.\n    const t = setTimeout(toBottom, 260);\n    return () => clearTimeout(t);\n  }, [msgCount, lastShown, asking, reduce]);\n\n  const reset = () => {\n    dispatch({ type: \"reset\", fields, agents });\n    setPicks([]);\n    setFinishing(-1);\n    setHandedOff(false);\n  };\n\n  const sendChannels = () => {\n    if (!picks.length) return;\n    dispatch({ type: \"channels\", picks });\n    setPicks([]);\n    setFinishing(0);\n  };\n\n  const send = () => {\n    const text = draft.trim();\n    if (!text) return;\n    if (asking) {\n      dispatch({ type: \"channels\", picks: text.split(/,|\\band\\b/).map((x) => x.trim()).filter(Boolean) });\n      setPicks([]);\n      setFinishing(0);\n    } else {\n      dispatch({ type: \"say\", text });\n    }\n    setDraft(\"\");\n  };\n\n  const allDone = state.done && Object.values(state.agents).every((a) => a.status === \"done\" || a.status === \"queued\") && !working;\n  const anyWorking = Object.values(state.agents).filter((a) => a.status === \"working\").length;\n  const needsYou = Object.values(state.agents).some((a) => a.status === \"waiting\");\n  const active = agents.filter((a) => state.agents[a.id]?.status !== \"queued\");\n  const project = state.fields.project?.value;\n  const threadTitle = state.fields.project?.target ?? (typeof project === \"string\" && project ? project : \"New plan\");\n\n  const openPane = (p: \"brief\" | \"agents\") => (mode === \"narrow\" ? setPane(p) : mode === \"mid\" ? setSide(p) : undefined);\n\n  const status = needsYou\n    ? { dot: \"bg-warning\", text: \"Waiting on you\" }\n    : anyWorking\n      ? { dot: \"bg-info animate-pulse motion-reduce:animate-none\", text: `${anyWorking} ${anyWorking === 1 ? \"helper\" : \"helpers\"} working` }\n      : allDone\n        ? { dot: \"bg-success\", text: handedOff ? \"Handed off to #launch-orbit\" : \"Brief complete\" }\n        : { dot: \"bg-muted-foreground/40\", text: \"Listening\" };\n\n  const chat = (\n    <div className=\"flex h-full min-h-0 flex-col\">\n      <div ref={scrollRef} className=\"min-h-0 flex-1 overflow-y-auto\">\n        <div className=\"mx-auto flex max-w-[40rem] flex-col gap-6 px-4 py-6 @3xl:px-8\">\n          {state.msgs.length === 0 && (\n            <div className=\"flex flex-col items-center gap-2 py-16 text-center text-muted-foreground\">\n              <LoaderCircleIcon className=\"size-4 animate-spin motion-reduce:animate-none\" />\n              Starting a session…\n            </div>\n          )}\n          <AnimatePresence initial={false}>\n            {state.msgs.map((m) => (\n              <motion.div\n                animate={{ opacity: 1, y: 0 }}\n                className={cn(\"flex\", m.role === \"user\" ? \"justify-end\" : \"gap-3\")}\n                initial={{ opacity: 0, y: 6 }}\n                key={m.id}\n                transition={{ duration: 0.26, ease }}\n              >\n                {m.role === \"agent\" && (\n                  <span className=\"mt-px flex size-6 shrink-0 items-center justify-center rounded-md bg-foreground text-background\">\n                    <WorkflowIcon className=\"size-3.5\" />\n                  </span>\n                )}\n                {m.role === \"user\" ? (\n                  <div className=\"max-w-[85%] rounded-2xl bg-muted px-3.5 py-2 leading-relaxed\">{m.text}</div>\n                ) : (\n                  <div className=\"flex min-w-0 flex-1 flex-col gap-3\">\n                    <p className=\"text-pretty leading-relaxed\">\n                      {m.text.slice(0, m.shown)}\n                      {m.shown < m.text.length && (\n                        <span className=\"ms-0.5 inline-block h-3.5 w-1.5 translate-y-0.5 animate-pulse rounded-sm bg-foreground/50 motion-reduce:animate-none\" />\n                      )}\n                    </p>\n                    {m.shown >= m.text.length && (\n                      <ActivityRows agents={agents} briefTitle={briefTitle} msg={m} onOpen={openPane} state={state} />\n                    )}\n                  </div>\n                )}\n              </motion.div>\n            ))}\n          </AnimatePresence>\n        </div>\n      </div>\n\n      <div className=\"px-4 pb-4 @3xl:px-8\">\n        <div className=\"mx-auto max-w-[40rem]\">\n          <div className=\"rounded-2xl border bg-card shadow-xs/5 transition-shadow focus-within:border-ring/64 focus-within:ring-[3px] focus-within:ring-ring/16\">\n            <AnimatePresence initial={false}>\n              {asking && (\n                <motion.div\n                  animate={{ opacity: 1, height: \"auto\" }}\n                  className=\"overflow-hidden\"\n                  exit={{ opacity: 0, height: 0 }}\n                  initial={{ opacity: 0, height: 0 }}\n                  transition={{ duration: 0.24, ease }}\n                >\n                  <div className=\"border-b px-3 pt-3 pb-3\">\n                    <div className=\"mb-2 flex items-center gap-2 text-muted-foreground text-xs\">\n                      <MegaphoneIcon className=\"size-3.5\" />\n                      Pick the channels to commit to\n                      <span className=\"ms-auto tabular-nums\">{picks.length ? `${picks.length} selected` : \"Any number\"}</span>\n                    </div>\n                    <div aria-label=\"Pick channels\" className=\"flex flex-wrap items-center gap-1.5\" role=\"group\">\n                      {channelOptions.map((c) => {\n                        const on = picks.includes(c);\n                        return (\n                          <button\n                            aria-pressed={on}\n                            className={cn(\n                              \"inline-flex h-7 cursor-pointer items-center gap-1 rounded-full border px-2.5 text-xs outline-none transition-[background-color,color,border-color,scale] duration-150 ease-out focus-visible:ring-2 focus-visible:ring-ring active:scale-[0.97]\",\n                              on ? \"border-primary bg-primary text-primary-foreground\" : \"bg-background hover:bg-accent dark:bg-input/32\",\n                            )}\n                            key={c}\n                            onClick={() => setPicks((p) => (on ? p.filter((x) => x !== c) : [...p, c]))}\n                            type=\"button\"\n                          >\n                            {on && <CheckIcon className=\"size-3\" />}\n                            {c}\n                          </button>\n                        );\n                      })}\n                      <Button className=\"ms-auto\" disabled={!picks.length} onClick={sendChannels} size=\"xs\">\n                        Use {picks.length ? picks.length : \"\"}\n                      </Button>\n                    </div>\n                  </div>\n                </motion.div>\n              )}\n            </AnimatePresence>\n            <form\n              className=\"flex items-end gap-2 p-2\"\n              onSubmit={(e) => {\n                e.preventDefault();\n                send();\n              }}\n            >\n              <label className=\"sr-only\" htmlFor={`${group}-msg`}>\n                Message {agentName}\n              </label>\n              <textarea\n                className=\"field-sizing-content max-h-28 min-h-8 flex-1 resize-none bg-transparent px-2 py-1.5 text-base outline-none placeholder:text-muted-foreground/72 sm:text-sm\"\n                id={`${group}-msg`}\n                onChange={(e) => setDraft(e.target.value)}\n                onKeyDown={(e) => {\n                  if (e.key === \"Enter\" && !e.shiftKey && !e.nativeEvent.isComposing) {\n                    e.preventDefault();\n                    send();\n                  }\n                }}\n                placeholder={asking ? \"Or type the channels…\" : `Reply to ${agentName}…`}\n                rows={1}\n                value={draft}\n              />\n              <Button aria-label=\"Send\" className=\"rounded-full\" disabled={!draft.trim()} size=\"icon-sm\" type=\"submit\">\n                <ArrowUpIcon />\n              </Button>\n            </form>\n          </div>\n        </div>\n      </div>\n    </div>\n  );\n\n  const brief = (\n    <BriefDoc\n      agentName={agentName}\n      fields={fields}\n      onEdit={(key, value) => dispatch({ type: \"edit\", key, value })}\n      state={state}\n      title={briefTitle}\n    />\n  );\n  const panel = <AgentPanel agents={agents} state={state} />;\n\n  const segmented = (options: { id: string; label: string; badge?: number | boolean }[], value: string, onChange: (v: string) => void, layoutKey: string) => (\n    <LayoutGroup id={`${group}-${layoutKey}`}>\n      <div className=\"flex rounded-lg bg-muted p-0.5\" role=\"tablist\">\n        {options.map((o) => (\n          <button\n            aria-selected={value === o.id}\n            className={cn(\n              \"relative flex h-7 flex-1 cursor-pointer items-center justify-center gap-1.5 rounded-md px-3 font-medium text-xs outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n              value === o.id ? \"text-foreground\" : \"text-muted-foreground hover:text-foreground\",\n            )}\n            key={o.id}\n            onClick={() => onChange(o.id)}\n            role=\"tab\"\n            type=\"button\"\n          >\n            {value === o.id && (\n              <motion.span className=\"absolute inset-0 rounded-md bg-background shadow-xs/5 dark:bg-input\" layoutId=\"seg\" transition={{ type: \"spring\", stiffness: 500, damping: 38 }} />\n            )}\n            <span className=\"relative\">{o.label}</span>\n            {typeof o.badge === \"number\" && o.badge > 0 && (\n              <span className=\"relative rounded-full bg-info/14 px-1.5 text-[10px] text-info-foreground tabular-nums\">{o.badge}</span>\n            )}\n            {o.badge === true && <span className=\"relative size-1.5 rounded-full bg-warning\" />}\n          </button>\n        ))}\n      </div>\n    </LayoutGroup>\n  );\n\n  return (\n    <MotionConfig reducedMotion=\"user\">\n      <div\n        className={cn(\n          \"@container relative flex h-[760px] w-full flex-col overflow-hidden bg-background text-foreground text-sm\",\n          className,\n        )}\n        ref={rootRef}\n      >\n        <header className=\"flex h-12 shrink-0 items-center gap-3 border-b px-4\">\n          <div className=\"flex min-w-0 flex-1 items-center gap-2\">\n            <span className=\"flex size-6 shrink-0 items-center justify-center rounded-md bg-foreground text-background\">\n              <WorkflowIcon className=\"size-3.5\" />\n            </span>\n            <span className=\"hidden shrink-0 text-muted-foreground @md:inline\">{agentName}</span>\n            <span className=\"hidden text-muted-foreground/48 @md:inline\">/</span>\n            <span className=\"truncate font-medium\">{threadTitle}</span>\n            <span className=\"ms-1 hidden shrink-0 items-center gap-1.5 rounded-full border px-2 py-0.5 text-muted-foreground text-xs @lg:inline-flex\" aria-live=\"polite\">\n              <span className={cn(\"size-1.5 rounded-full\", status.dot)} />\n              {status.text}\n            </span>\n          </div>\n          {active.length > 0 && (\n            <button\n              aria-label={`${active.length} helpers`}\n              className=\"hidden cursor-pointer items-center -space-x-1.5 rounded-full outline-none focus-visible:ring-2 focus-visible:ring-ring @md:flex\"\n              onClick={() => openPane(\"agents\")}\n              type=\"button\"\n            >\n              <AnimatePresence initial={false}>\n                {active.map((a) => (\n                  <motion.span\n                    animate={{ opacity: 1, scale: 1 }}\n                    className=\"flex rounded-full ring-2 ring-background\"\n                    initial={{ opacity: 0, scale: 0.9 }}\n                    key={a.id}\n                    transition={{ duration: 0.2, ease }}\n                  >\n                    <AgentMark agent={a} size=\"sm\" state={state.agents[a.id]} />\n                  </motion.span>\n                ))}\n              </AnimatePresence>\n            </button>\n          )}\n          <AnimatePresence initial={false}>\n            {allDone && (\n              <motion.div\n                animate={{ opacity: 1, scale: 1 }}\n                exit={{ opacity: 0, scale: 0.95 }}\n                initial={{ opacity: 0, scale: 0.95 }}\n                transition={{ duration: 0.2, ease }}\n              >\n                <Button\n                  disabled={handedOff}\n                  onClick={() => setHandedOff(true)}\n                  size=\"sm\"\n                  variant={handedOff ? \"outline\" : \"default\"}\n                >\n                  {handedOff ? <CheckIcon /> : <SendIcon />}\n                  {handedOff ? \"Handed off\" : \"Hand off\"}\n                </Button>\n              </motion.div>\n            )}\n          </AnimatePresence>\n          <Button aria-label=\"Replay conversation\" onClick={reset} size=\"icon-sm\" variant=\"ghost\">\n            <RotateCcwIcon />\n          </Button>\n        </header>\n\n        {mode === \"narrow\" && (\n          <div className=\"border-b px-4 py-2\">\n            {segmented(\n              [\n                { id: \"chat\", label: \"Chat\" },\n                { id: \"brief\", label: \"Brief\" },\n                { id: \"agents\", label: \"Helpers\", badge: needsYou || anyWorking },\n              ],\n              pane,\n              (v) => setPane(v as typeof pane),\n              \"pane\",\n            )}\n          </div>\n        )}\n\n        <div className=\"flex min-h-0 flex-1\">\n          {(mode !== \"narrow\" || pane === \"chat\") && <section aria-label=\"Conversation\" className=\"min-w-0 flex-1\">{chat}</section>}\n\n          {mode === \"wide\" && (\n            <>\n              <section aria-label=\"Helpers\" className=\"w-60 shrink-0 border-s bg-muted/32 dark:bg-muted/16\">\n                {panel}\n              </section>\n              <section aria-label=\"Brief\" className=\"w-[25rem] shrink-0 border-s\">\n                {brief}\n              </section>\n            </>\n          )}\n\n          {mode === \"mid\" && (\n            <section aria-label=\"Brief and helpers\" className=\"flex w-[22rem] shrink-0 flex-col border-s\">\n              <div className=\"px-4 pt-3\">\n                {segmented(\n                  [\n                    { id: \"brief\", label: \"Brief\" },\n                    { id: \"agents\", label: \"Helpers\", badge: needsYou || anyWorking },\n                  ],\n                  side,\n                  (v) => setSide(v as typeof side),\n                  \"side\",\n                )}\n              </div>\n              <div className=\"min-h-0 flex-1\">{side === \"brief\" ? brief : panel}</div>\n            </section>\n          )}\n\n          {mode === \"narrow\" && pane === \"brief\" && <section className=\"min-w-0 flex-1\">{brief}</section>}\n          {mode === \"narrow\" && pane === \"agents\" && <section className=\"min-w-0 flex-1\">{panel}</section>}\n        </div>\n      </div>\n    </MotionConfig>\n  );\n}\n"
    }
  ]
}