peat-protocol 0.9.0-rc.8

Peat Coordination Protocol โ€” hierarchical capability composition over CRDTs for heterogeneous mesh networks
[package]
name = "peat-protocol"
version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
description = "Peat Coordination Protocol โ€” hierarchical capability composition over CRDTs for heterogeneous mesh networks"
homepage = "https://github.com/defenseunicorns/peat"
documentation = "https://docs.rs/peat-protocol"

[package.metadata.docs.rs]
# Build docs.rs with every feature enabled so the `relay-n0-hosted` opt-in
# (and other gated items) render. `--cfg docsrs` enables the
# `#[cfg_attr(docsrs, feature(doc_auto_cfg))]` attribute in `lib.rs`,
# which makes rustdoc emit "Available on crate feature `X` only" badges
# next to feature-gated items.
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
keywords = ["peat", "protocol", "mesh", "crdt", "coordination"]
categories = ["network-programming"]

[dependencies]
# Peat facade: peat-protocol re-exports peat-schema and peat-mesh so
# downstream consumers can depend on peat-protocol alone.
peat-schema = { path = "../peat-schema", version = "=0.9.0-rc.8" }
peat-mesh = { workspace = true }

tokio = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
uuid = { workspace = true }
thiserror = { workspace = true }
anyhow = { workspace = true }
async-trait = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
dotenvy = { workspace = true }
chrono = { workspace = true }
# geohash vendored in src/geohash.rs (supply chain audit 2026-03-26)
tempfile = "3.13"
base64 = "0.22"
prost = "0.13"
# postcard: codec-internal binary serialization between Translator
# (Rust) and OutboundSink (Kotlin/Swift via FFI). Per ADR-059 Slice 1.b
# (peat-mesh ADR-0011); chosen over ciborium for active maintenance,
# embedded-Rust ecosystem fit (embassy/esp-hal, peat-lite), and
# documented frozen v1 wire format. See ADR-059 ยง"Per-transport
# channel sizing" and Slice 1.b project-health audit notes.
postcard = { version = "1", default-features = false, features = ["alloc"] }

# Security/Crypto dependencies (ADR-006)
ed25519-dalek = { version = "2", features = ["rand_core"] }
bitflags = "2"  # Permission flags for membership certificates (ADR-048)
sha2 = "0.10"
rand_core = { version = "0.6", features = ["getrandom"] }
argon2 = "0.5"  # Password hashing (Phase 3: User Auth)
hmac = "0.12"   # TOTP implementation (Phase 3: User Auth)
# Encryption (Phase 4: Encryption & Audit)
chacha20poly1305 = "0.10"  # AEAD encryption (ChaCha20-Poly1305)
x25519-dalek = { version = "2", features = ["static_secrets"] }  # X25519 key exchange
hkdf = "0.12"              # HKDF key derivation
subtle = "2.6"             # Constant-time comparison (formation key auth)

# CRDT Backends (E8 Evaluation - ADR-007)
automerge = { version = "0.7.1", optional = true }  # Automerge CRDT library for evaluation

# AutomergeIrohBackend dependencies (ADR-011)
iroh = { version = "0.97", optional = true, features = ["address-lookup-mdns"] }  # QUIC-based P2P networking with local mDNS discovery
iroh-blobs = { version = "0.99", optional = true }  # Content-addressed blob storage (ADR-025)
redb = { version = "2.4", optional = true }  # Pure Rust embedded database (pinned to 2.x - 3.x has memory regression, Issue #446)
lru = { version = "0.16.3", optional = true }  # LRU cache for hot documents
toml = { version = "0.8", optional = true }  # Static peer configuration
hex = "0.4"  # Hex encoding for PublicKeys and encryption keys
mdns-sd = { version = "0.11", optional = true }  # mDNS service discovery (ADR-011 Phase 3)
rand = { version = "0.9", optional = true }  # Random number generation for retry jitter
futures-lite = { version = "2", optional = true }  # Minimal stream utilities (Issue #233)
negentropy = { version = "0.5", optional = true }  # Set reconciliation protocol (ADR-040, Issue #435)

# TAK/CoT Integration (ADR-020, ADR-028)
quick-xml = { version = "0.37", features = ["serialize"] }  # CoT XML encoding/decoding

# Peat-Lite transport (ADR-035)
log = { version = "0.4", optional = true }  # Logging for lite transport

# Bluetooth LE transport (ADR-032, ADR-039)
peat-btle = { workspace = true, optional = true }

[features]
default = ["automerge-backend"]
# Automerge/Iroh backend - pure Rust, works on Android
automerge-backend = ["automerge", "iroh", "iroh-blobs", "redb", "lru", "toml", "mdns-sd", "rand", "futures-lite", "negentropy", "peat-mesh/automerge-backend"]
# Peat-Lite transport - UDP-based communication with embedded devices (ADR-035)
lite-transport = ["log", "peat-mesh/lite-bridge"]
# Bluetooth LE transport - BLE mesh networking (ADR-032, ADR-039)
bluetooth = ["peat-btle", "peat-mesh/bluetooth"]
# Opt-in to n0's hosted relay pool and DNS pkarr discovery (issue #833).
# Off by default: tactical/edge builds must not phone home through n0
# infrastructure. Turn on only for environments that explicitly want
# n0-hosted NAT traversal and global discovery.
relay-n0-hosted = []

[dev-dependencies]
proptest = { workspace = true }
criterion = { workspace = true }
tokio = { workspace = true, features = ["test-util"] }
tempfile = "3.13"
serial_test = "3.1"  # Serialize tests sharing global state (iroh endpoints)

[[bench]]
name = "cap_benchmarks"
harness = false