Skip to main content

Crate luft_storage

Crate luft_storage 

Source
Expand description

§luft-storage

SQLite-backed structured persistence for Luft.

Replaces the JSONL events.jsonl + checkpoint.json pair with a queryable, relational store. Provides a UI-ready query API for listing runs, inspecting agent turns, and searching event spans.

§Module Layout

ModuleResponsibility
dbConnection pool (DbPool) + schema migration
writerAgentEvent → SQL write path (EventWriter)
readerUI-ready query API: get_run_overview, get_agent_turns, etc.
errorUnified StorageError type

§Usage

use luft_storage::{open_db, EventWriter};
use std::path::Path;

let pool = open_db(Path::new("./.luft/runs/latest/luft.db")).await?;
let writer = EventWriter::new(pool.clone());
// writer.write_event(&event).await?;

Re-exports§

pub use db::open_db;
pub use db::DbPool;
pub use db::DEFAULT_DB_PATH;
pub use error::StorageError;
pub use reader::get_agent_overview;
pub use reader::get_agent_turns;
pub use reader::get_run_agents;
pub use reader::get_run_overview;
pub use reader::get_run_spans;
pub use reader::get_run_tree;
pub use reader::list_runs;
pub use reader::search_turns;
pub use reader::AgentOverview;
pub use reader::RunOverview;
pub use reader::RunSummary;
pub use reader::SpanRow;
pub use reader::TurnKindCount;
pub use reader::TurnRow;
pub use writer::EventWriter;

Modules§

db
Database connection pool + schema migration.
error
Unified error type for the storage layer.
reader
UI-ready query API.
writer
AgentEvent → SQLite write path.