1use crate::format::{self, Format};
7use crate::timeline::Step;
8use crate::{
9 codex, gemini, generic, langchain, otel_json, otel_proto, session, timeline, vercel_ai,
10};
11use anyhow::Result;
12use std::path::Path;
13
14pub fn load_session(path: &Path) -> Result<Vec<Step>> {
19 let fmt = format::detect(path)?;
20 let steps = match fmt {
21 Format::ClaudeCode => {
22 let entries = session::load(path)?;
23 timeline::build(&entries)
24 }
25 Format::Codex => codex::load(path)?,
26 Format::Gemini => gemini::load(path)?,
27 Format::Generic => generic::load(path)?,
28 Format::Langchain => langchain::load(path)?,
29 Format::OtelJson => otel_json::load(path)?,
30 Format::OtelProto => otel_proto::load(path)?,
31 Format::VercelAi => vercel_ai::load(path)?,
32 };
33 Ok(steps)
34}