Seven crates, one binary.

A Rust workspace with one job per crate. Dependencies point one way, down to the wire schema, and the tests replay recorded behavior instead of trusting it. The source is public; every line here is something you can read.

The crates.

From the binary you run down to the schema every other crate speaks.

  • alforria

    The binary. It parses your command and routes it to the terminal UI, the local server, the web client, or a run mode that streams JSON events and exits with the right code.

  • alforria-tui

    The terminal UI: a ratatui chat view with markdown and diff rendering, 30+ dialogs and 33 bundled themes, built as an HTTP and SSE client of the server. It never touches the engine directly.

  • alforria-server

    The HTTP surface: v1 and v2 routers, the SSE stream, PTY websockets, auth and origin checks, OpenAPI export, and the embedded web client, all from one process.

  • alforria-core

    The session engine. It owns the agent loop and the built-in tools, plus permissions, snapshots, config discovery, the model catalog, MCP, SQLite storage and the event bus the rest of the workspace speaks through.

  • alforria-ui

    The web client, built from the SolidJS source in web/, packed into a deterministic zstd tarball and embedded in the binary. Decompressed once, on first use.

  • alforria-llm

    The model layer: six protocol adapters that stream each response as events, report token usage, and handle retries and the prompt-cache policy.

  • alforria-schema

    The wire contract: DTOs for sessions, events and the server API. It depends on no other crate, which is what makes the contract enforceable everywhere above it.

Dependencies point one way.

Read across: a dot means the row's crate depends on the column's. Every dot sits above the diagonal, so nothing depends on a crate listed above it. Select a crate to trace it.

Crate dependency matrix. Rows depend on columns.
alforria tui server core ui llm schema
depends on alforria-tuidepends on alforria-serverdepends on alforria-coredepends on alforria-llmdepends on alforria-schema
depends on alforria-schema
depends on alforria-coredepends on alforria-uidepends on alforria-llmdepends on alforria-schema
depends on alforria-llmdepends on alforria-schema
depends on alforria-schema

What the selected crate depends onWhat depends on it

Behavior you can check.

Recorded behavior is frozen first and the code is written to replay it. Where the checks stop, this page says so.

  • Golden fixtures first

    Recorded API traffic, event manifests and LLM protocol streams are frozen into fixtures, and the code is checked against them.

  • Wire compatibility

    Schema golden tests compare parsed JSON values, including field names, union tagging, and omitted versus null fields. Float formatting and key order may differ. Separate tests check byte-identical OpenAPI documents.

  • A deterministic agent loop

    A scripted model drives the full agent loop end to end through the real server and wire protocol, so sessions, retries and tool calls are covered by tests that run the same way every time. The home page replay uses a scripted model in the same way.

  • Rendered frames and real browsers

    Headless ratatui buffer assertions check content in real rendered frames, including dialogs at 80 and 140 columns. The web client has an end-to-end suite that drives a real server in Chromium, plus a reducer scale test over 20 sessions of 2,000 parts.

Build it, or just run it.

Release binaries carry a SHA-256 sidecar; cargo install builds from source.

curl -fsSL https://raw.githubusercontent.com/alforria-ai/alforria/main/packaging/install.sh | sh