//! gate4agent — Universal wrapper for CLI agents (Claude Code, Codex, Gemini, OpenCode).
//!
//! Three transport modes:
//! - Pipe mode: NDJSON-streaming pipe sessions (Claude, Codex, Gemini, OpenCode)
//! - PTY mirror: spawns agent in real PTY, captures raw output, vt100 parsing
//! - ACP mode: bidirectional JSON-RPC 2.0 over stdio (Gemini, OpenCode, Claude ACP adapter)
//!
//! All modes produce `AgentEvent` values on a `tokio::sync::broadcast` channel.
//!
//! # Entry points
//!
//! - [`TransportSession`] — thin dispatch router: pipe or PTY
//! - [`PipeSession`] — direct pipe session entry point (restored for 0.1.x compatibility)
//! - [`pty::PtySession::spawn`] — PTY mirror mode (unchanged)
//! - [`AcpSession`] — ACP transport (multi-turn JSON-RPC 2.0, Gemini/OpenCode/Claude)
//! - [`MultiCliManager`] — high-level session manager for the chart app

pub use core::capabilities::{CliCapabilities, CliFeatures, ModelInfo, PermissionModeInfo};
pub use core::error::AgentError;
pub use core::types::{AgentEvent, CliTool, SessionConfig};
pub use transport::{SpawnOptions, TransportSession};
pub use pipe::{PipeSession, PipeProcessOptions, ClaudeOptions};

pub mod acp;
pub mod context;
pub mod core;
pub mod transport;
pub mod pty;
pub mod pipe;
pub mod rpc;
pub mod history;
pub mod manager;
pub mod daemon;

pub use acp::{AcpSession, AcpSessionOptions, AcpError, AcpHostHandler, DefaultAcpHandler};
pub use rpc::{
    HostHandler, RejectAllHandler, MethodRouter,
    RpcId, RpcRequest, RpcResponse, RpcError, RpcNotification,
    classify_line,
};
pub use manager::{MultiCliManager, ManagerConfig, InstanceId, InstanceMode};
pub use pty::snapshot::{
    AgentCli, AgentRenderSnapshot, AgentSnapshotMode, BuddyArt, ChatMessage, ChatRole, TermCell, TermGrid,
};
pub use history::{HistoryReader, SessionMeta, reader_for};

pub(crate) mod utils;

pub use daemon::{DaemonSession, DaemonConfig, DaemonType, DaemonAuth};

pub mod probe;
pub use probe::{probe_all, probe_force, load_cached_probe, ProbeResult, CliProbe};

pub use context::{ContextTracker, TurnCompleteData};
