{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "command-launcher",
  "title": "Desk command launcher",
  "description": "Tune a relay, mute alerts, or print a status report from a searchable command palette.",
  "dependencies": [
    "lucide-react@1.73.0"
  ],
  "registryDependencies": [
    "https://www.cyberspec.dev/r/recipe-layout.json",
    "https://www.cyberspec.dev/r/badge.json",
    "https://www.cyberspec.dev/r/command-palette.json",
    "https://www.cyberspec.dev/r/terminal.json"
  ],
  "files": [
    {
      "path": "registry/cyber/recipes/command-launcher.tsx",
      "content": "\"use client\"\n\nimport { useRef, useState } from \"react\"\nimport { BellRing, ClipboardList, RadioTower } from \"lucide-react\"\nimport { Badge } from \"@/registry/cyber/ui/badge\"\nimport { CommandPalette } from \"@/registry/cyber/ui/command-palette\"\nimport { Terminal, type TerminalLine } from \"@/registry/cyber/ui/terminal\"\nimport \"./recipe-layout.css\"\n\nconst channels = [\"Glasswater\", \"Lowtide\", \"Cinder Row\"]\n\nexport default function CommandLauncher() {\n  const [channelIndex, setChannelIndex] = useState(0)\n  const [muted, setMuted] = useState(false)\n  const [lines, setLines] = useState<TerminalLine[]>([\n    { id: \"boot\", kind: \"sys\", text: \"Night desk connected to Glasswater.\" },\n  ])\n  const sequence = useRef(0)\n  const channel = channels[channelIndex]\n\n  function run(command: string) {\n    let text: string\n    if (command === \"tune\") {\n      const next = (channelIndex + 1) % channels.length\n      setChannelIndex(next)\n      text = `Tuned to ${channels[next]}.`\n    } else if (command === \"alerts\") {\n      setMuted(!muted)\n      text = muted ? \"Desk alerts enabled.\" : \"Desk alerts muted.\"\n    } else {\n      text = `${channel} relay online. Desk alerts ${muted ? \"muted\" : \"enabled\"}.`\n    }\n    const line: TerminalLine = { id: String(++sequence.current), kind: \"ok\", text }\n    setLines(previous => [...previous.slice(-11), line])\n  }\n\n  return (\n    <div className=\"sink-stack\">\n      <div className=\"sink-row\">\n        <Badge tone=\"signal\" status>{channel}</Badge>\n        <Badge tone={muted ? \"mute\" : \"ok\"}>Alerts {muted ? \"off\" : \"on\"}</Badge>\n      </div>\n      <Terminal label=\"Night desk log\" lines={lines} height={138} />\n      <CommandPalette trigger=\"Open desk commands\" title=\"Night desk commands\" placeholder=\"Find a desk command\"\n        empty=\"No matching desk commands.\" shortcut={null} rankResults onAction={run} commands={[\n          { value: \"tune\", label: \"Tune to next relay\", keywords: [\"channel\", \"station\"], icon: <RadioTower aria-hidden /> },\n          { value: \"alerts\", label: muted ? \"Enable desk alerts\" : \"Mute desk alerts\", icon: <BellRing aria-hidden /> },\n          { value: \"status\", label: \"Print relay status\", keywords: [\"summary\"], icon: <ClipboardList aria-hidden /> },\n        ]} />\n    </div>\n  )\n}\n",
      "type": "registry:component",
      "target": "@components/recipes/command-launcher.tsx"
    }
  ],
  "categories": [
    "recipe",
    "workspace"
  ],
  "type": "registry:component"
}
