Skip to main content

gate4agent/
lib.rs

1//! gate4agent — Universal wrapper for CLI agents (Claude Code, Codex, Gemini).
2//!
3//! Two transport modes:
4//! - PTY mirror: spawns agent in real PTY, captures raw output, vt100 parsing
5//! - Pipe mode: `claude -p --output-format stream-json`, plain OS pipes, NDJSON events
6//!
7//! Both modes produce `AgentEvent` values on a `tokio::sync::broadcast` channel.
8
9pub use error::AgentError;
10pub use types::{AgentEvent, CliTool, PtyEvent, SessionConfig};
11
12pub mod pty;
13pub mod pipe;
14pub mod parser;
15pub mod ndjson;
16pub mod detection;
17pub mod cli;
18pub mod snapshot;
19pub mod history;
20pub mod manager;
21
22pub use manager::{MultiCliManager, ManagerConfig};
23pub use snapshot::{
24    AgentCli, AgentRenderSnapshot, AgentSnapshotMode, BuddyArt, ChatMessage, ChatRole, TermCell, TermGrid,
25};
26pub use history::{HistoryReader, SessionMeta, reader_for};
27
28pub(crate) mod error;
29pub(crate) mod types;
30pub(crate) mod utils;