Rust API
Flow’s engine is a Rust workspace. Every shell drives the same core through the same public APIs. This includes the desktop app, the HTTP server, the CLI, and the TUI. Anything documented here behaves identically across editions.
Crate map
Section titled “Crate map”| Crate | Role |
|---|---|
flow-domain | Pure types: FlowGraph, FlowNode, FlowEdge, the AI node contract. No I/O. |
flow-security | Keyring access, PII sanitizer, path confinement, sandbox profiles. |
flow-storage | SQLite store: runs, steps, AI audit records, schedules, templates index. |
flow-execution | The executor: scheduling, adapters registry, event stream, AI tool loop, staging. |
flow-adapter-ai | AI provider registry (local llama-server + cloud providers) behind one request type. |
flow-adapter-shell / -fs / -cli / -utility | Action adapters: sandboxed shell, jailed filesystem, vendor-neutral CLI tools, utilities. |
flow-application | FlowApp, the orchestrator facade every host embeds. Owns settings, storage, models, runs. |
flow-dsl | The Flow DSL parser and serializer. Pure, no I/O. |
flow-models-server | Managed llama-server subprocess lifecycle (fetch, start, stop, status). |
flow-server | The HTTP/SSE host exposing FlowApp for the browser edition. |
flow-cli | The flow binary: headless runs, generation, and the full-screen TUI. |
Layering
Section titled “Layering”Dependencies point strictly downward:
flow-domain -> flow-security, flow-storage -> flow-execution, flow-adapter-ai -> flow-adapter-{shell, fs, cli, utility} -> flow-application (FlowApp) -> hosts: flow-desktop (Tauri), flow-server, flow-cliflow-dsl is independent of the stack and is a pure parser. flow-spec is
build-time only and feeds the generated DSL spec.
Where to start
Section titled “Where to start”- To embed the engine, start with flow-application.
One struct,
FlowApp, is the entire integration surface. - To watch or drive runs, start with flow-execution. It covers events, run control, and the AI tool loop.
- For graph and contract types, see flow-domain and flow-dsl.
- To add an action adapter, see adapters.
- For storage, the HTTP host, and the model server, see services.
The deeper, exhaustive reference is the generated rustdoc (cargo doc --workspace).
These pages curate the surfaces hosts actually use.