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
34#[allow(
35 non_snake_case,
36 non_upper_case_globals,
37 unused_imports,
38 clippy::redundant_field_names
39)]
40pub mod generated;
41
42// Re-export generated namespaces at crate root for cross-module references
43pub use generated::app;
44pub use generated::chat;
45pub use generated::com;
46pub use generated::tools;
47
48// Re-export key types
49pub use agent::{Agent, AgentError, Session};
50pub use moderation::{ModerationDecision, ModerationOpts, ModerationUi};
51pub use rich_text::{ByteSlice, Facet, FacetFeature, RichText};