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