Skip to main content

Crate proto_blue_api

Crate proto_blue_api 

Source
Expand description

AT Protocol high-level API: agent, rich text, moderation, generated types.

§Examples

use proto_blue_api::rich_text::{RichText, FacetFeature};

// Create rich text with automatic facet detection
let mut rt = RichText::new(
    "Hello @alice.bsky.social! Check out https://bsky.app #atproto".to_string(),
    None,
);
rt.detect_facets();

assert_eq!(rt.facets().len(), 3);

// Iterate segments for rendering
let segments = rt.segments();
for seg in &segments {
    if let Some(facet) = &seg.facet {
        match &facet.features[0] {
            FacetFeature::Mention { did } => println!("@{}", did),
            FacetFeature::Link { uri } => println!("link: {}", uri),
            FacetFeature::Tag { tag } => println!("#{}", tag),
        }
    }
}

Re-exports§

pub use generated::app;
pub use generated::chat;
pub use generated::com;
pub use generated::tools;
pub use agent::Agent;
pub use agent::AgentError;
pub use agent::Session;
pub use moderation::ModerationDecision;
pub use moderation::ModerationOpts;
pub use moderation::ModerationUi;
pub use rich_text::ByteSlice;
pub use rich_text::Facet;
pub use rich_text::FacetFeature;
pub use rich_text::RichText;

Modules§

agent
AT Protocol Agent — high-level client wrapping XRPC.
generated
moderation
Moderation engine for AT Protocol.
rich_text
Rich text with facet annotations (mentions, links, tags).