//! PTY runner — spawns agent processes in pseudo-terminals and streams their output. mod events; mod runner; mod types; pub(in crate::agents) use events::emit_event; pub(in crate::agents) use runner::run_agent_pty_streaming; #[cfg(test)] mod tests { use super::events::handle_agent_stream_event; use super::*; use crate::agents::AgentEvent; use crate::io::watcher::WatcherEvent; use std::sync::{Arc, Mutex}; use tokio::sync::broadcast; // ── AC1: pty detects rate_limit_event and emits RateLimitWarning ───────── /// Verify that when a `rate_limit_event` JSON line appears in PTY output, /// `run_agent_pty_streaming` sends a `WatcherEvent::RateLimitWarning` with /// the correct story_id and agent_name. /// /// The command invoked is: `sh -p --