Skip to main content

agx_core/
lib.rs

1//! agx-core — pure parsers, timeline model, and analytics for the
2//! agx step-through-debugger CLI.
3//!
4//! This crate is the TUI-free half of the agx repo. It ships the
5//! parsers for every supported agent-trace format (Claude Code,
6//! Codex, Gemini, OpenAI-compatible, LangChain, Vercel AI SDK,
7//! OpenTelemetry GenAI — JSON + optional binary), the shared
8//! [`timeline::Step`] model, cost estimation, corpus aggregation,
9//! export writers, annotation storage, and the PII scanner.
10//!
11//! The TUI layer lives in the top-level `agx` crate, which consumes
12//! this library. Integrators who want to drive agx's parsers
13//! programmatically — eval harnesses, custom CI guards, lightweight
14//! dashboards — can depend on `agx-core` without pulling in ratatui /
15//! crossterm / arboard.
16//!
17//! # Stability
18//!
19//! Public API tracks the stepwise-suite conventions in
20//! [`docs/suite-conventions.md`](https://github.com/brevity1swos/agx/blob/main/docs/suite-conventions.md)
21//! §5. Schema-breaking changes to [`timeline::Step`] field names,
22//! [`format::Format`] variants, or the `--export json` shape
23//! (mirrored here through [`export::json`]) require a minor-version
24//! bump and a note in the main crate's README compat table. New
25//! fields may appear; removals or renames are breaking.
26//!
27//! # Entry point
28//!
29//! ```no_run
30//! use agx_core::loader::load_session;
31//! # use std::path::Path;
32//! # fn main() -> anyhow::Result<()> {
33//! let steps = load_session(Path::new("session.jsonl"))?;
34//! for step in &steps {
35//!     println!("{:?} {}", step.kind, step.label);
36//! }
37//! # Ok(())
38//! # }
39//! ```
40
41pub mod annotations;
42pub mod browser;
43pub mod codex;
44pub mod corpus;
45pub mod debug_unknowns;
46pub mod diff_align;
47pub mod export;
48pub mod format;
49pub mod gemini;
50pub mod generic;
51pub mod langchain;
52pub mod loader;
53pub mod notify;
54pub mod otel_json;
55pub mod otel_proto;
56pub mod pii;
57pub mod pricing;
58pub mod semantic;
59pub mod session;
60pub mod slice;
61pub mod timeline;
62pub mod vercel_ai;