Architecture
Two processes, one dispatcher, no server of ours.
kdashboard is an Electron app: a sandboxed Svelte 5 renderer, a TypeScript main process holding the Kubernetes client, and a single IPC channel between them. The AI agent re-enters the same dispatcher instead of getting a path of its own.
Renderer Svelte 5 with runes, Tailwind 4, bits-ui primitives, TanStack Virtual for large lists, wterm for terminals and CodeMirror 6 for YAML. It never touches Node or Electron APIs directly. src/
Main process TypeScript on @kubernetes/client-node. Handler modules register commands into one dispatcher; shared watchers stream resource deltas, and logs, exec, port-forwards and watch events are pushed over named event channels. electron/handlers/ · electron/dispatch.ts
IPC A single k8s:invoke channel through the preload contextBridge, plus event channels for streams. The only HTTP listeners on the host are the loopback MCP endpoints of the AI agent. electron/preload
AI agent Spawns the agent CLI in a local PTY and serves it MCP from the main process — random port, per-session token, pinned to the kube context it started on. Tools re-enter the same dispatcher; the four Safe Mutations block on approval. electron/agent/ · ADR 0001
Kind registry One source of truth for API coordinates, scope, aliases and the per-kind list projection. Adding a built-in kind is one row. electron/k8s/kinds.ts
Built with
Electron 43Svelte 5TypeScript 5Vite 7 · electron-viteTailwind 4bits-uiTanStack VirtualCodeMirror 6wterm@kubernetes/client-nodeBunelectron-builder
Testing Unitfrontend + Electron suites
Integrationnode:test against a real cluster
End to endPlaywright, mocked IPC
BenchmarksPlaywright, scripts/bench
Typestsc on electron/ · svelte-check