//! First-class background task infrastructure.
//!
//! Three cohesive pieces close the B2→B8 loop:
//!
//! - [`sink`] — the durable [`BackgroundCompletionSink`], single writer between a
//!   runner completion and the ready-to-deliver signal (persist-before-signal).
//! - [`tail`] — a UTF-8-safe bounded ring buffer for stdout/stderr tails.
//! - [`runner`] — [`CommandBackgroundRunner`], the concrete
//!   [`BackgroundTaskRunner`](domain::ports::BackgroundTaskRunner) that spawns a
//!   command-backed task over a composed [`PtyPort`](domain::ports::PtyPort) and
//!   emits exactly one completion per task.

mod runner;
mod sink;
mod tail;

pub use runner::CommandBackgroundRunner;
pub use sink::{
    start_background_ready_inbox_bridge, BackgroundCompletionSink, BackgroundCompletionSinkError,
    BackgroundCompletionSinkOutcome, BackgroundReadyInboxBridgeHandle,
    BackgroundTaskReadyToDeliver,
};
pub use tail::{bounded_tail, tail_cap_bytes, BoundedTail};
