Skip to main content

Crate agx

Crate agx 

Source
Expand description

agx — step-through debugger CLI (TUI + binary).

The pure parsers, timeline model, cost tables, corpus aggregation, export writers, annotations, semantic search, PII scanner, and notifications layer live in the companion agx-core crate. This crate is a thin TUI + CLI wrapper around it.

§Re-exports

Everything public on agx-core is re-exported here, so existing call sites that write agx::timeline::Step, agx::loader::load_session, etc. keep working unchanged. The split is purely about publish shape (Python / WASM / eval-harness consumers want the pure core without ratatui) — not about rebinding the public surface.

§TUI-only modules

tui, corpus_tui, and diff_tui live here because they depend on ratatui + crossterm + arboard, none of which belong in agx-core.

Modules§

annotations
Per-step annotations — the first persistent write-back feature.
browser
codex
corpus
Corpus-level analytics for agx corpus <dir>. Walks a directory tree, loads every session file it finds in parallel, and aggregates cross-session stats (tokens, cost, per-model / per-tool / per-format breakdowns).
corpus_tui
Interactive corpus TUI. Two-pane layout: session list on the left, selected-session summary on the right, corpus totals in the header, keybinding hints in the footer. Driven from agx corpus --tui <dir>.
debug_unknowns
Format-drift diagnostics: scan a session file and report any entry types or content-item types the typed parsers don’t recognize.
diff_align
Session-to-session alignment. Pure-algorithm module with no TUI dependencies — all rendering lives in diff_tui.rs. Kept separate so the alignment logic can be unit-tested cleanly and reused for non-TUI diff modes later.
diff_tui
Two-pane diff TUI. Consumes the pure alignment from diff_align::align and renders it as two synchronized lists with one AlignRow per display line. Color coding:
export
Session export — produces Markdown, HTML, or JSON representations of a parsed timeline. Used by the --export md|html|json flag.
format
gemini
generic
langchain
LangChain / LangSmith trace parser. Reads the single-JSON export shape that LangSmith produces via the “export run” button and that LangChain’s tracer emits when writing a full run tree to a file.
loader
Session-loading front door. Takes a path, detects the format, calls the right parser, returns Vec<Step>. Lives in its own module so both the single-session TUI/summary path (in main.rs) and the corpus subcommand (in corpus.rs) dispatch through the same function.
notify
Desktop notifications for --live mode — fires when the watched session grows with a new error tool_result, or when it stops growing for a user-specified duration. Opt-in via --features notifications.
otel_json
OpenTelemetry GenAI parser — reads OTLP-JSON trace exports produced by otel-desktop-viewer, otel-cli export, and direct application/json OTLP endpoints. Maps OTel GenAI semantic-convention attributes into the shared timeline::Step model.
otel_proto
Binary OTLP (.pb / .otlp) parser — reads protobuf-encoded OpenTelemetry trace exports.
pii
Heuristic PII / credential scanner for --scan-pii. Reports matches, does not mutate — pair with --redact when the intent is to scrub.
pricing
Per-model pricing lookup. Converts a Step’s token counters into a USD cost estimate.
replay
Phase 5.4 — experimental tool-call replay. Lives in the bin crate because replay is interactive UX (confirm prompts, live output), not pure library logic.
semantic
Semantic search over session steps — opt-in via --features embedding-search.
session
slice
Timeline slicing — parsers + application for --after / --before duration filters, --after-step / --before-step / --range index filters, and the :@<duration> TUI jump command.
timeline
tui
vercel_ai
Vercel AI SDK trace parser. Reads the single-JSON result objects that generateText / streamText produce when stringified — the shape most backends actually save to disk.