oxide_mesh/lib.rs
1//! # `oxide-mesh` — Inter-Agent Communication
2//!
3//! Lightweight, transport-agnostic peer-to-peer fabric for Rust Oxide agents.
4//! Two transports ship today:
5//!
6//! * [`local`] — in-process `tokio::sync::mpsc` channels. Used by tests and
7//! embedded multi-agent setups where every peer shares the same Tokio
8//! runtime.
9//! * [`tcp`] — JSON-line framed TCP. Used for cross-process / cross-host
10//! peers. The wire format is one [`PeerMessage`] per line, so it inter-
11//! operates with hand-rolled clients (netcat for debugging is fine).
12//!
13//! The protocol is intentionally small — five message kinds — and is
14//! deliberately *not* libp2p. Future federated-learning work will pile gossip
15//! and CRDT primitives on top of this base layer rather than adopting a
16//! whole networking stack.
17//!
18//! [`MeshModule`] exposes the mesh on the `oxide-k` bus so agents can send
19//! broadcasts, direct messages, and task assignments through standard kernel
20//! plumbing.
21
22#![deny(rust_2018_idioms)]
23#![warn(missing_docs)]
24
25pub mod bus_bridge;
26pub mod crdt;
27pub mod error;
28pub mod kernel;
29pub mod local;
30pub mod message;
31pub mod tcp;
32
33pub use bus_bridge::BusBridge;
34pub use crdt::{GSet, LwwRegister, PnCounter};
35pub use error::{MeshError, Result};
36pub use kernel::MeshModule;
37pub use local::{LocalMesh, MeshHandle, PeerHandle};
38pub use message::{PeerCapability, PeerId, PeerMessage};
39pub use tcp::TcpMesh;