Skip to main content

av_bridge/
lib.rs

1//! The Portable Event Bridge (brief Module F).
2//!
3//! A common bus for agent events that customers own, localize, and run
4//! air-gapped. The [`EventBus`] trait is the portability boundary:
5//!
6//! - [`embedded::EmbeddedBroker`] — the reference implementation: a
7//!   file-backed, Kafka-shaped log (topics → partitions → append-only JSONL
8//!   segments with offsets), partitioned by `ai_agent.instance_uid` for
9//!   ordered per-agent replay. Zero external dependencies: this is what makes
10//!   the single-binary air-gapped deployment real.
11//! - `nats` feature — NATS JetStream connector (edge/single-node alternative).
12//! - `kafka` feature — Kafka wire protocol connector (Redpanda is the
13//!   reference self-hosted target).
14//!
15//! Provisioning is declarative: a [`manifest::BridgeManifest`] fully describes
16//! topics, partitions, retention, and schema references; `provision()` stands
17//! up an identical bridge from the manifest alone (success criterion R12/R30).
18
19pub mod bus;
20#[cfg(feature = "cold-store")]
21pub(crate) mod cold_store;
22pub mod embedded;
23pub mod manifest;
24
25pub use bus::{BusError, EventBus, PublishAck, StoredEvent};
26pub use embedded::EmbeddedBroker;
27pub use manifest::{BridgeManifest, ManifestError, RetentionSpec, TopicSpec, MANIFEST_VERSION};
28
29#[cfg(feature = "kafka")]
30pub mod kafka_bus;
31#[cfg(feature = "nats")]
32pub mod nats_bus;