acdp_primitives/lib.rs
1//! # acdp-primitives — foundational types for the Agent Context Distribution Protocol
2//!
3//! The bottom layer of the `acdp` crate family: the typed error
4//! vocabulary ([`error::AcdpError`]), the opaque identifier/enum
5//! primitives ([`primitives`]), the wire error envelope
6//! ([`wire_error`]), and small shared utilities (`limits`, `time`,
7//! `serde_helpers`). It has no cryptography and makes no network calls.
8//!
9//! Most users should depend on the umbrella [`acdp`](https://docs.rs/acdp)
10//! crate, which re-exports everything here.
11
12pub mod error;
13pub mod limits;
14pub mod primitives;
15pub mod serde_helpers;
16pub mod time;
17pub mod wire_error;
18
19pub use error::{AcdpError, SupersessionReason};
20pub use primitives::{AgentDid, ContentHash, ContextType, CtxId, LineageId, Status, Visibility};
21pub use wire_error::{WireError, WireErrorBody};
22
23// ── Protocol version ──────────────────────────────────────────────────────────
24
25/// The ACDP protocol version this library implements.
26///
27/// `0.2.0` carries the Trust & Hardening amendments (registry receipts
28/// — RFC-ACDP-0010, `did:key` producers, mandatory explicit
29/// `acdp_version`, lineage anchoring). Every v0.1.0 body, signature, and
30/// `content_hash` remains valid. An absent `acdp_version` field on a
31/// publish request is interpreted as `0.1.0` by the protocol; 0.2.0
32/// builders MUST emit the field explicitly (RFC-ACDP-0001 §6).
33pub const ACDP_VERSION: &str = "0.2.0";
34
35/// The JSON Schema namespace (`$id` prefix) for this protocol version,
36/// e.g. `<ACDP_SCHEMA_NAMESPACE>/acdp-error.schema.json`.
37pub const ACDP_SCHEMA_NAMESPACE: &str = "https://schemas.acdp.io/v0.1.0";