microsandbox_agent_client/lib.rs
1//! Transport-agnostic client for the microsandbox agent protocol.
2//!
3//! This crate owns the low-level client layer: handshakes, correlation IDs,
4//! request/stream routing, message encoding, and transport adapters. High-level
5//! SDK crates remain responsible for sandbox lifecycle and name resolution.
6//!
7//! No transport is enabled by default. Enable `uds` for local microsandbox relay
8//! sockets on Unix, `named-pipe` for local relay pipes on Windows, or `stream`
9//! to drive the client over any `AsyncRead + AsyncWrite` byte stream (e.g. a
10//! caller-owned, pre-authenticated transport adapted to bytes).
11
12#![warn(missing_docs)]
13
14pub mod client;
15pub mod error;
16pub mod message;
17pub mod stream;
18pub mod transport;
19
20/// Transport adapters that can be enabled with crate features.
21pub mod transports {
22 /// Windows named-pipe transport support.
23 #[cfg(all(feature = "named-pipe", windows))]
24 pub mod named_pipe;
25
26 /// Unix domain socket transport support.
27 #[cfg(all(feature = "uds", unix))]
28 pub mod uds;
29}
30
31//--------------------------------------------------------------------------------------------------
32// Re-Exports
33//--------------------------------------------------------------------------------------------------
34
35pub use client::{AgentClient, AgentProtocol};
36pub use error::{AgentClientError, AgentClientResult};
37pub use message::{EncodedMessage, IntoOutboundMessage, OutboundMessage, TypedMessage};
38pub use stream::AgentStream;
39pub use transport::{AgentTransport, TransportPacket};