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
| Module | Responsibility |
|---|---|
[db] |
Connection pool (DbPool) + schema migration |
[writer] |
AgentEvent → SQL write path ([EventWriter]) |
[reader] |
UI-ready query API: [get_run_overview], [get_agent_turns], etc. |
[error] |
Unified [StorageError] type |
Usage
use luft_storage::{open_db, EventWriter};
use std::path::Path;
# tokio::runtime::Runtime::new().unwrap().block_on(async {
let pool = open_db(Path::new("./.luft/runs/latest/luft.db")).await?;
let writer = EventWriter::new(pool.clone());
// writer.write_event(&event).await?;
# Ok::<(), Box<dyn std::error::Error>>(())
# });