Skip to main content

Crate gate4agent

Crate gate4agent 

Source
Expand description

gate4agent — Universal wrapper for CLI agents (Claude Code, Codex, Gemini).

Two transport modes:

  • PTY mirror: spawns agent in real PTY, captures raw output, vt100 parsing
  • Pipe mode: claude -p --output-format stream-json, plain OS pipes, NDJSON events

Both modes produce AgentEvent values on a tokio::sync::broadcast channel.

Re-exports§

pub use manager::MultiCliManager;
pub use manager::ManagerConfig;
pub use snapshot::AgentCli;
pub use snapshot::AgentRenderSnapshot;
pub use snapshot::AgentSnapshotMode;
pub use snapshot::BuddyArt;
pub use snapshot::ChatMessage;
pub use snapshot::ChatRole;
pub use snapshot::TermCell;
pub use snapshot::TermGrid;
pub use history::HistoryReader;
pub use history::SessionMeta;
pub use history::reader_for;

Modules§

cli
detection
history
Read-only access to CLI session history files written by the CLIs themselves.
manager
Multi-CLI agent session manager.
ndjson
parser
pipe
pty
snapshot
Snapshot types for agent rendering — no OS handles, safe to clone and send to UI.

Structs§

PtyEvent
Low-level PTY event (used internally before classification).
SessionConfig
Session configuration for spawning an agent.

Enums§

AgentError
Unified error type for all operations in this crate.
AgentEvent
Unified event type produced by both PTY and pipe transports.
CliTool
Supported CLI tools.