Skip to main content

elizaos_plugin_msteams/
lib.rs

1//! Microsoft Teams integration plugin for elizaOS.
2//!
3//! This crate provides:
4//! - MS Teams Bot Framework integration
5//! - Proactive messaging
6//! - Adaptive Cards support
7//! - Polls
8//! - Graph API integration for user/file operations
9//!
10//! # Features
11//!
12//! - `native` (default): Enables the full service implementation with Tokio runtime
13
14#![warn(missing_docs)]
15#![deny(unsafe_code)]
16
17/// Configuration types and helpers for the MS Teams plugin.
18pub mod config;
19/// Error types returned by the MS Teams plugin.
20pub mod error;
21/// Serializable types used for events and payloads.
22pub mod types;
23
24#[cfg(feature = "native")]
25/// MS Teams Bot Framework client implementation.
26pub mod client;
27
28#[cfg(feature = "native")]
29/// Native MS Teams service implementation (requires the `native` feature).
30pub mod service;
31
32#[cfg(feature = "native")]
33/// Action interfaces and built-in actions for the native MS Teams service.
34pub mod actions;
35
36#[cfg(feature = "native")]
37/// Provider interfaces and built-in providers for the native MS Teams service.
38pub mod providers;
39
40pub use config::MSTeamsConfig;
41pub use error::{MSTeamsError, Result};
42pub use types::*;
43
44#[cfg(feature = "native")]
45pub use client::MSTeamsClient;
46
47#[cfg(feature = "native")]
48pub use service::MSTeamsService;
49
50/// Canonical plugin name.
51pub const PLUGIN_NAME: &str = "msteams";
52/// Plugin version (from Cargo package metadata).
53pub const PLUGIN_VERSION: &str = env!("CARGO_PKG_VERSION");
54/// Human-friendly plugin description.
55pub const PLUGIN_DESCRIPTION: &str = "Microsoft Teams integration for elizaOS agents via Bot Framework";
56
57/// Returns the plugin metadata used by the elizaOS plugin system.
58pub fn plugin() -> Plugin {
59    Plugin {
60        name: PLUGIN_NAME.to_string(),
61        description: PLUGIN_DESCRIPTION.to_string(),
62        version: PLUGIN_VERSION.to_string(),
63    }
64}
65
66/// Plugin metadata (name, description, and version).
67#[derive(Debug, Clone)]
68pub struct Plugin {
69    /// The plugin identifier (e.g. `"msteams"`).
70    pub name: String,
71    /// A human-friendly description of the plugin.
72    pub description: String,
73    /// The plugin version string.
74    pub version: String,
75}
76
77#[cfg(test)]
78mod tests {
79    use super::*;
80
81    #[test]
82    fn test_plugin_creation() {
83        let p = plugin();
84        assert_eq!(p.name, PLUGIN_NAME);
85        assert!(!p.description.is_empty());
86    }
87
88    #[test]
89    fn test_plugin_name() {
90        assert_eq!(PLUGIN_NAME, "msteams");
91    }
92}