Skip to main content

proto_blue/
lib.rs

1//! # proto-blue
2//!
3//! Full-stack AT Protocol SDK for Rust.
4//!
5//! This crate re-exports the individual proto-blue modules so downstream code
6//! can depend on a single crate:
7//!
8//! ```toml
9//! [dependencies]
10//! proto-blue = "0.2"
11//! ```
12//!
13//! ```rust,no_run
14//! use proto_blue::api::Agent;
15//! use proto_blue::syntax::Did;
16//! ```
17//!
18//! ## Feature flags
19//!
20//! The default feature set is **`full`** — everything on, matching the
21//! pre-0.2.2 API surface. For constrained targets (most importantly
22//! `wasm32-unknown-unknown`) turn defaults off and opt into only what you
23//! need:
24//!
25//! ```toml
26//! [dependencies]
27//! proto-blue = { version = "0.2", default-features = false }
28//! ```
29//!
30//! Available features:
31//!
32//! | Feature    | Re-exports                             | WASM? |
33//! |------------|----------------------------------------|-------|
34//! | (none)     | `syntax`, `crypto`, `lex_data`, `lex_cbor`, `lex_json`, `common`, `lexicon`, `repo` | ✅ |
35//! | `net`      | `xrpc`                                 | 🚧 (issue #25) |
36//! | `ws`       | `ws`, enables `repo::Firehose`         | 🚧 (issue #27) |
37//! | `resolver` | `identity`                             | 🚧 (issue #26) |
38//! | `oauth`    | `oauth`                                | 🚧 |
39//! | `api`      | `api`                                  | 🚧 |
40//! | `full`     | everything                             | ❌ (default — native only) |
41
42/// AT Protocol identifier types: DID, Handle, NSID, AT-URI, TID, `RecordKey`, Datetime.
43pub use proto_blue_syntax as syntax;
44
45/// Cryptographic primitives: P-256/K-256 key pairs, signing, did:key, SHA-256.
46pub use proto_blue_crypto as crypto;
47
48/// Core Lexicon data model: `LexValue`, `BlobRef`, `Cid`.
49pub use proto_blue_lex_data as lex_data;
50
51/// DAG-CBOR encoding and decoding with deterministic map ordering.
52pub use proto_blue_lex_cbor as lex_cbor;
53
54/// JSON ↔ Lexicon value conversion with `$link`/`$bytes` encoding.
55pub use proto_blue_lex_json as lex_json;
56
57/// Shared utilities: DID document parsing, TID generation, retry helpers.
58pub use proto_blue_common as common;
59
60/// Lexicon schema types, registry, and validation engine.
61pub use proto_blue_lexicon as lexicon;
62
63/// Repository primitives: Merkle Search Tree, CAR files, block storage.
64///
65/// When the top-level `ws` feature is enabled, `repo::Firehose` (a
66/// live-connection firehose client) is also available.
67pub use proto_blue_repo as repo;
68
69/// XRPC HTTP client for AT Protocol queries and procedures.
70#[cfg(feature = "net")]
71pub use proto_blue_xrpc as xrpc;
72
73/// Auto-reconnecting WebSocket client for event streams.
74#[cfg(feature = "ws")]
75pub use proto_blue_ws as ws;
76
77/// DID and handle resolution with caching.
78#[cfg(feature = "resolver")]
79pub use proto_blue_identity as identity;
80
81/// High-level API: Agent, rich text, moderation, session management.
82#[cfg(feature = "api")]
83pub use proto_blue_api as api;
84
85/// OAuth 2.0 client: `DPoP`, PKCE, PAR, token management.
86#[cfg(feature = "oauth")]
87pub use proto_blue_oauth as oauth;