Skip to content

systems tauri command bridge

factory-droid[bot] edited this page Jul 5, 2026 · 1 revision

Tauri command bridge

Active contributors: Douwe de Vries, vriesd

Purpose

The Tauri bridge exposes Rust operations to the React renderer through typed commands and generated TypeScript bindings. It keeps persistence and provider process logic out of the frontend.

Key source files

File Purpose
src-tauri/src/commands.rs Command module registry.
src-tauri/src/commands/sessions.rs Session command handlers.
src-tauri/src/commands/entries.rs Entry command handlers.
src-tauri/src/commands/findings.rs Finding command handlers.
src-tauri/src/commands/generation.rs Generation context and AI action commands.
src-tauri/src/commands/files.rs Managed file and clipboard commands.
src-tauri/src/commands/error.rs Structured command error mapping.
src-tauri/src/specta_bindings.rs Command/type registration and TypeScript export.
frontend/src/tauri.ts Frontend wrapper over generated invoke functions.
frontend/src/tauriCommands.ts Stable frontend command helpers.

How it works

Command handlers call AppState::with_service from src-tauri/src/settings.rs, which locks the core SessionService. Results are serialized back through Tauri and typed on the frontend through frontend/src/bindings.ts.

graph LR
    View[React view] --> Wrapper[frontend/src/tauri.ts]
    Wrapper --> Bindings[frontend/src/bindings.ts]
    Bindings --> Command[src-tauri commands]
    Command --> State[AppState::with_service]
    State --> Core[SessionService]
Loading

Integration points

The bridge connects Frontend shell to Rust core. Generation commands also start Generation jobs, and provider commands use Provider detection.

Entry points for modification

When adding a command, register it in src-tauri/src/specta_bindings.rs, implement it under src-tauri/src/commands, update frontend wrappers in frontend/src/tauri.ts if needed, and run bun run bindings:check or bun run bindings:generate.

Clone this wiki locally