proto_blue_api/lib.rs
1#![cfg_attr(test, allow(clippy::pedantic, clippy::nursery))]
2
3//! AT Protocol high-level API: agent, rich text, moderation, generated types.
4//!
5//! # Examples
6//!
7//! ```
8//! use proto_blue_api::rich_text::{RichText, FacetFeature};
9//!
10//! // Create rich text with automatic facet detection
11//! let mut rt = RichText::new(
12//! "Hello @alice.bsky.social! Check out https://bsky.app #atproto".to_string(),
13//! None,
14//! );
15//! rt.detect_facets();
16//!
17//! assert_eq!(rt.facets().len(), 3);
18//!
19//! // Iterate segments for rendering
20//! let segments = rt.segments();
21//! for seg in &segments {
22//! if let Some(facet) = &seg.facet {
23//! match &facet.features[0] {
24//! FacetFeature::Mention { did } => println!("@{}", did),
25//! FacetFeature::Link { uri } => println!("link: {}", uri),
26//! FacetFeature::Tag { tag } => println!("#{}", tag),
27//! }
28//! }
29//! }
30//! ```
31
32pub mod agent;
33pub mod moderation;
34pub mod rich_text;
35
36pub mod generated;
37
38// Re-export generated namespaces at crate root for cross-module references
39pub use generated::app;
40pub use generated::chat;
41pub use generated::com;
42pub use generated::tools;
43
44// Re-export key types
45pub use agent::{Agent, AgentError, Session};
46pub use moderation::{ModerationDecision, ModerationOpts, ModerationUi};
47pub use rich_text::{ByteSlice, Facet, FacetFeature, RichText};