import { useState } from "react" import { Check, Copy, Cpu, Brain, Globe, FolderOpen, Laptop, ArrowRight, Info, CircleCheck, CircleX, Loader2, ChevronDown, ChevronRight, } from "lucide-react" import { useConnect, useConnectHealth } from "@/lib/queries" import type { ConnectTool, ConnectLine } from "@/lib/api" import { cn } from "@/lib/utils" // Dateiziel je Tool — nur Hinweis im Editor-Kopf, keine Logik. const FILE_NAMES: Record = { hermes_desktop: "Hermes Desktop: Browser-Login", kilo: "Kilo: Einstellungen → API Provider", claude_code: "env / Übersetzer", } function StatusBadge({ line, loading }: { line?: ConnectLine; loading: boolean }) { if (loading || !line) { return ( prüfe… ) } return line.ok ? ( {line.detail} ) : ( {line.detail} ) } // Schwarzes „Editor-Fenster" mit Ampel-Dots + Kopieren-Knopf. function CodeWindow({ tool, fileName, accent, copied, onCopy, }: { tool: ConnectTool fileName: string accent: "teal" | "violet" copied: boolean onCopy: () => void }) { return (
{fileName}
        {tool.snippet}
      
) } export function ConnectView() { const [host, setHost] = useState(localStorage.getItem("mc_host") || "192.168.178.151") const [mcpPath, setMcpPath] = useState(localStorage.getItem("mc_mcp_path") || "") // Legacy-Tools (roher /v1-Zugang) leben im Ausklapper — Hermes Desktop ist der Hauptweg. const [active, setActive] = useState("kilo") const [sonstigeOffen, setSonstigeOffen] = useState(false) const [copied, setCopied] = useState<"desktop" | "model" | "memory" | null>(null) const params = new URLSearchParams({ host }) if (mcpPath) params.set("mcp_path", mcpPath) const { data, error: dataErr } = useConnect(params.toString()) const { data: health, isLoading: healthLoading } = useConnectHealth() const error = dataErr ? String(dataErr) : "" function saveHost(v: string) { setHost(v) if (v) localStorage.setItem("mc_host", v) } function saveMcpPath(v: string) { setMcpPath(v) localStorage.setItem("mc_mcp_path", v) } const desktop = data?.tools["hermes_desktop"] const tool = data?.tools[active] async function copy(which: "desktop" | "model" | "memory", snippet?: string) { if (!snippet) return await navigator.clipboard.writeText(snippet) setCopied(which) setTimeout(() => setCopied(null), 1500) } return (
{/* Header */}

Verbindung & Integration

Hermes Desktop ist die Tür zur Box — einmal verbinden, fertig. Für Spezialfälle gibt es darunter die rohen Leitungen (Gateway /v1 + Gedächtnis-MCP) für sonstige Tools.

{/* Hero: die zwei Leitungen */}
{/* Lokaler Agent */}
Dein lokaler Agent
Hermes Desktop · Kilo Code · Claude Code …
{/* Zwei Leitungen */}
{/* Leitung 1 — Modell */}
Leitung 1 — Modell
Gateway · :9001/v1 · Lanes chat / coding
{/* Leitung 2 — Gedächtnis */}
Leitung 2 — Gedächtnis
MCP · mcp_memory.py · separat
{/* Leitung 3 — Desktop-Gateway */}
Leitung 3 — Desktop-Gateway
Desktop-Gateway · :9119 · API-Status

Der Gateway liefert nur das LLM. Das geteilte Gedächtnis läuft über einen eigenen MCP-Server und das Desktop-Gateway bietet die Agenten-Schnittstelle — alle drei Leitungen werden unabhängig eingerichtet.

{/* Gemeinsame Variablen */}
saveHost(e.target.value)} aria-label="Box LAN IP-Adresse" spellCheck={false} placeholder="z.B. 192.168.178.151" className="w-full h-9 rounded-lg border border-border/60 bg-background/40 px-3 font-mono text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground" />
saveMcpPath(e.target.value)} aria-label="Lokaler MCP-Scriptpfad" spellCheck={false} placeholder="z.B. F:\Coding Stuff\mission-control-2\mcp\mcp_memory.py" className="w-full h-9 rounded-lg border border-border/60 bg-background/40 px-3 font-mono text-xs outline-none focus:ring-1 focus:ring-violet-500/50 text-foreground" />
{error && (
Fehler beim Generieren der Snippets: {error}
)} {data && (
{/* Hauptweg — Hermes Desktop anbinden */} {desktop && (
Hermes Desktop anbinden der Hauptweg

Die Desktop-App dockt remote an die Box an — volle Agent-Oberfläche, Projekte, Review, Gedächtnis inklusive.

{desktop.note && (
{desktop.note}
)} copy("desktop", desktop.snippet)} />
)} {/* Ausklapper — Legacy: roher /v1-Zugang + Gedächtnis-MCP für sonstige Tools */}
{sonstigeOffen && (
{/* Leitung 1 — Modell anbinden */}
1 Modell anbinden

Wähle dein Tool — das Snippet zeigt auf den Gateway.

{/* Tool-Picker (ohne hermes_desktop — der hat oben seine eigene Karte) */}
{Object.entries(data.tools).filter(([key]) => key !== "hermes_desktop").map(([key, t]) => ( ))}
{tool && ( <> {tool.note && (
{tool.note}
)} copy("model", tool.snippet)} /> )}
{/* Leitung 2 — Gedächtnis anbinden */}
2 Gedächtnis anbinden optional

Ein MCP-Block — gilt zusätzlich für jedes Tool aus Schritt 1.

{data.memory.note}
copy("memory", data.memory.snippet)} />
)}
)}
) }