Skip to main content

txcript/
lib.rs

1//! Typed conversion for coding-agent session transcripts.
2//!
3//! Claude Code, Codex, `OpenCode`, pi, Campfire, Cursor, and Grok record
4//! similar conversation data in different on-disk formats. This crate maps
5//! each format through [`Transcript<Common>`] and converts with
6//! [`convert::<A, B>`](convert): `A` -> [`Common`] -> `B`.
7//!
8//! # Fidelity
9//!
10//! Stores preserve native disk shape. [`Common`] preserves resumable
11//! conversation semantics, not byte identity.
12//!
13//! # Shape
14//!
15//! - [`common`] — the canonical model ([`common::Message`], [`common::Block`],
16//!   [`common::Tool`], …).
17//! - [`Transcript`], [`Harness`], [`Codec`], [`Store`] — the generic type and
18//!   the traits over it.
19//! - [`harness`] — one module per implemented harness.
20
21pub mod common;
22pub mod error;
23pub mod harness;
24#[cfg(not(target_arch = "wasm32"))]
25pub mod local;
26#[cfg(feature = "search")]
27pub mod search;
28pub mod text;
29mod transcript;
30
31#[cfg(feature = "wasm")]
32mod wasm;
33
34// The core generic API lives in the private `transcript` module, so the crate
35// root is its canonical home. The concrete model and per-harness types keep
36// their own module homes — reach them through [`common`] and [`harness`]
37// rather than flattened at the root.
38pub use error::{Error, Result};
39pub use transcript::{
40    Codec, Common, Discovered, Harness, HarnessId, Saved, Span, Store, TextCodec, Transcript,
41    convert,
42};