use crate::format::{self, Format};
use crate::timeline::Step;
use crate::{
codex, gemini, generic, langchain, otel_json, otel_proto, session, timeline, vercel_ai,
};
use anyhow::Result;
use std::path::Path;
pub fn load_session(path: &Path) -> Result<Vec<Step>> {
let fmt = format::detect(path)?;
let steps = match fmt {
Format::ClaudeCode => {
let entries = session::load(path)?;
timeline::build(&entries)
}
Format::Codex => codex::load(path)?,
Format::Gemini => gemini::load(path)?,
Format::Generic => generic::load(path)?,
Format::Langchain => langchain::load(path)?,
Format::OtelJson => otel_json::load(path)?,
Format::OtelProto => otel_proto::load(path)?,
Format::VercelAi => vercel_ai::load(path)?,
};
Ok(steps)
}