crates/nornir-wire/src/lib.rs
//! # nornir-wire
//!
//! The **wire / transport contract** for the nornir gRPC surface. It owns
//! `proto/nornir.proto` and its generated `nornir.v1` prost + tonic bindings, and
//! it re-exports them as [`pb`]. This is the ONE home for the codegen that used to
//! live in `nornir/build.rs`: `nornir-server` (the producer) and the read-client(s)
//! + MCP/CLI (the consumers) now both reach the generated client/server stubs
//! through `nornir_wire::pb` instead of each carrying a private
//! `mod pb { tonic::include_proto!("nornir.v1"); }`.
//!
//! ## No edge back to nornir
//!
//! The whole point of the leaf is that it has **no dependency on `nornir`** — a
//! consumer (a future `facett-nornir-viz` read-client, or nornir-server itself)
//! depends on `nornir-wire`, never the reverse, so there is no cycle. Its only
//! sibling edge is to [`nornir_service`] for the shared client-side bearer stamper.
//!
//! ## `view` — the serde view-model DTOs
//!
//! [`view`] owns the serde OUTPUT view-model types (the structs the client
//! deserializes server JSON into) — the wire-stable shapes for the `Viz.*` /
//! `Workspaces.*` payloads. A fresh on-disk audit showed the live wire-crossing
//! types are NOT warehouse-welded: `Timeline`'s one non-scalar field is a
//! [`nornir_depgraph::DepGraphSnapshot`] (already a leaf — `warehouse::dep_graph`
//! merely re-exports it), and the row DTOs are plain serde structs with no
//! inherent Arrow impls. So they are **relocated** here whole (the design's
//! tactic-1) and `nornir` re-exports each from its original path — the producers
//! and panes compile unchanged, and a read-client can now reach every payload
//! shape through `nornir_wire::view` with no `nornir` edge. See [`view`] for the
//! per-type relocate-vs-mirror reasoning.
/// The generated `nornir.v1` prost + tonic bindings — every message type plus the
/// client stubs (feature `client`) and server service traits (feature `server`).
///
/// Replaces the private `mod pb { tonic::include_proto!("nornir.v1"); }` copies
/// that were scattered across `nornir/src` (server_grpc, saga_grpc, warehouse
/// remote, the viz remote client, and the two bins). A consumer writes
/// `use nornir_wire::pb;` and reaches, e.g., `pb::mimir_client::MimirClient` or
/// `pb::viz_server::VizServer`.
pub mod pb {
tonic::include_proto!("nornir.v1");
}
pub mod view;
/// The shared client-side bearer stamper, re-exported so a consumer that builds a
/// `pb` client has the ONE outbound `authorization: Bearer <token>` builder to
/// hand without a second `nornir-service` import. See
/// [`nornir_service::client::bearer`].
pub use nornir_service::client::bearer;