elizaos_plugin_bluebubbles/
lib.rs1pub mod actions;
6pub mod client;
7pub mod config;
8pub mod error;
9pub mod providers;
10pub mod service;
11pub mod types;
12
13pub use client::BlueBubblesClient;
14pub use config::BlueBubblesConfig;
15pub use error::{BlueBubblesError, Result};
16pub use service::BlueBubblesService;
17pub use types::*;
18
19use elizaos::Plugin;
20use std::sync::Arc;
21
22pub const BLUEBUBBLES_SERVICE_NAME: &str = "bluebubbles";
24
25pub fn create_plugin() -> Plugin {
27 let service = Arc::new(BlueBubblesService::new());
28
29 Plugin::new(
30 BLUEBUBBLES_SERVICE_NAME,
31 "BlueBubbles iMessage bridge plugin for ElizaOS agents",
32 )
33 .with_action(Arc::new(actions::SendMessageAction::new(service.clone())))
34 .with_action(Arc::new(actions::SendReactionAction::new(service.clone())))
35 .with_provider(Arc::new(providers::ChatStateProvider::new(service)))
36}
37
38#[cfg(test)]
39mod tests {
40 use super::*;
41
42 #[test]
43 fn test_create_plugin() {
44 let plugin = create_plugin();
45 assert_eq!(plugin.name(), BLUEBUBBLES_SERVICE_NAME);
46 assert!(!plugin.description().is_empty());
47 assert_eq!(plugin.action_handlers.len(), 2);
48 assert_eq!(plugin.provider_handlers.len(), 1);
49 }
50}