Skip to main content

elizaos_plugin_nextcloud_talk/
lib.rs

1//! Nextcloud Talk integration plugin for elizaOS.
2//!
3//! This crate contains:
4//! - Shared data types used by the Nextcloud Talk plugin
5//! - Configuration and error types
6//! - A native (`tokio` + webhook server) service implementation when the `native` feature is enabled
7
8#![warn(missing_docs)]
9#![deny(unsafe_code)]
10
11/// Configuration types and helpers for the Nextcloud Talk plugin.
12pub mod config;
13/// Error types returned by the Nextcloud Talk plugin.
14pub mod error;
15/// Serializable types used for events and payloads.
16pub mod types;
17/// HTTP client for Nextcloud Talk API.
18pub mod client;
19
20#[cfg(feature = "native")]
21/// Native Nextcloud Talk service implementation (requires the `native` feature).
22pub mod service;
23
24#[cfg(feature = "native")]
25/// Action interfaces and built-in actions for the native Nextcloud Talk service.
26pub mod actions;
27
28#[cfg(feature = "native")]
29/// Provider interfaces and built-in providers for the native Nextcloud Talk service.
30pub mod providers;
31
32pub use config::NextcloudTalkConfig;
33pub use error::{NextcloudTalkError, Result};
34pub use types::*;
35
36#[cfg(feature = "native")]
37pub use service::NextcloudTalkService;
38
39/// Canonical plugin name.
40pub const PLUGIN_NAME: &str = "nextcloud-talk";
41/// Plugin version (from Cargo package metadata).
42pub const PLUGIN_VERSION: &str = env!("CARGO_PKG_VERSION");
43/// Human-friendly plugin description.
44pub const PLUGIN_DESCRIPTION: &str = "Nextcloud Talk integration for elizaOS agents";
45
46/// Returns the plugin metadata used by the elizaOS plugin system.
47pub fn plugin() -> Plugin {
48    Plugin {
49        name: PLUGIN_NAME.to_string(),
50        description: PLUGIN_DESCRIPTION.to_string(),
51        version: PLUGIN_VERSION.to_string(),
52    }
53}
54
55#[derive(Debug, Clone)]
56/// Plugin metadata (name, description, and version).
57pub struct Plugin {
58    /// The plugin identifier (e.g. `"nextcloud-talk"`).
59    pub name: String,
60    /// A human-friendly description of the plugin.
61    pub description: String,
62    /// The plugin version string.
63    pub version: String,
64}
65
66#[cfg(test)]
67mod tests {
68    use super::*;
69
70    #[test]
71    fn test_plugin_creation() {
72        let p = plugin();
73        assert_eq!(p.name, PLUGIN_NAME);
74        assert!(!p.description.is_empty());
75    }
76}