Architecture
Frontend, Tauri shell, and Rust backend.
Layers
- Frontend — React / Next.js App Router, static export for production (
out/). - Tauri shell — OS windows, menus, deep links, asset protocol, process lifecycle.
- Rust backend — commands, agent, PTY, Git, filesystem, LSP adapters.
Secondary windows (settings, agent, branch, popout editor) load their own routes from the same static export. Production routes use trailing slashes so assets resolve from /_next/....
Data flow
UI actions go through typed wrappers in lib/backend, which invoke Tauri commands. Rust does privileged work and emits events the frontend listens for (chat chunks, PTY output, Git refresh, and similar).
AI chat does not call model providers from the browser. The Rust agent attaches the Shape OAuth token and posts to the website completions proxy. Usage and entitlements are decided on that server. See Client trust.