Skip to main content

pixie_pi/compat/
mod.rs

1//! Claude Code `stream-json` compatibility layer.
2//!
3//! Maps pixie-pi's [`AgentEvent`](crate::agent::context::AgentEvent) stream to
4//! the NDJSON wire format Claude Code emits under `--output-format stream-json`,
5//! so callers that spawn the `claude` CLI (e.g. [Pixie]) can drive pixie-pi as a
6//! drop-in replacement.
7//!
8//! The mapper is intentionally **pure** (no I/O): [`map_events`] turns a single
9//! event into zero or more [`ClaudeLine`]s, and [`to_ndjson`] serializes one.
10//! SDK users and unit tests reuse it directly. The binary's
11//! `modes::stream_json` driver is what wires stdin/stdout around it.
12//!
13//! [Pixie]: https://github.com/white1or1black/pixie
14
15pub mod claude;
16
17pub use claude::{map_events, system_init, to_ndjson, ClaudeLine, MapCtx};