import { useState } from "react" import { CheckCircle2, CircleSlash, Cloud, Cpu, Loader2, Save, ShieldCheck, Sparkles, Trash2, Wand2, } from "lucide-react" import { useDashboard } from "@/lib/dashboard" import { Button } from "@/components/ui/button" import { Textarea } from "@/components/ui/textarea" import { Badge } from "@/components/ui/badge" import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" import { Label } from "@/components/ui/label" import { Switch } from "@/components/ui/switch" import { cn } from "@/lib/utils" export function RuleStudioPanel() { const { rulesText, setRulesText, validate, validation, save, setRuleEnabled, deleteRule, compilerProvider, setCompilerProvider, compile, compiling, } = useDashboard() const [instruction, setInstruction] = useState( "If a person is near the steering wheel, turn on the PC. Don't repeat for five minutes.", ) const [armedDelete, setArmedDelete] = useState(null) return (
Compose Source Rules {validation?.ok && ( {validation.rules.length} )} {validation && (validation.ok ? ( valid ) : ( invalid ))}
{/* Compose: NL → rules */}

Describe the automation in plain language. It compiles to validated rules through{" "} {compilerProvider === "cloud" ? "Replicate" : "llama.cpp"} — never executable code.

{compilerProvider === "cloud" ? ( ) : ( )} setCompilerProvider(checked ? "cloud" : "local")} />