elizaos_plugin_github/
lib.rs1#![allow(missing_docs)]
2#![allow(clippy::result_large_err)]
3#![deny(unsafe_code)]
4
5pub mod config;
6pub mod error;
7pub mod types;
8
9#[cfg(feature = "native")]
10pub mod service;
11
12#[cfg(feature = "native")]
13pub mod actions;
14
15#[cfg(feature = "native")]
16pub mod providers;
17
18pub use config::GitHubConfig;
20pub use error::{GitHubError, Result};
21pub use types::*;
22
23#[cfg(feature = "native")]
24pub use service::GitHubService;
25
26#[cfg(feature = "native")]
27pub use actions::{
28 ActionContext, CreateBranchAction, CreateCommentAction, CreateIssueAction,
29 CreatePullRequestAction, GitHubAction, MergePullRequestAction, PushCodeAction,
30 ReviewPullRequestAction,
31};
32
33#[cfg(feature = "native")]
34pub use providers::{
35 GitHubIssueContextProvider, GitHubProvider, GitHubRepositoryStateProvider,
36 IssueContextProvider, ProviderContext, ProviderResult, RepositoryStateProvider,
37};
38
39pub const PLUGIN_NAME: &str = "github";
40pub const PLUGIN_VERSION: &str = env!("CARGO_PKG_VERSION");
41pub const PLUGIN_DESCRIPTION: &str = "GitHub integration for elizaOS agents";
42
43#[derive(Debug, Clone)]
44pub struct Plugin {
45 pub name: String,
46 pub description: String,
47 pub version: String,
48}
49
50pub fn plugin() -> Plugin {
51 Plugin {
52 name: PLUGIN_NAME.to_string(),
53 description: PLUGIN_DESCRIPTION.to_string(),
54 version: PLUGIN_VERSION.to_string(),
55 }
56}
57
58#[cfg(test)]
59mod tests {
60 use super::*;
61
62 #[test]
63 fn test_plugin_creation() {
64 let p = plugin();
65 assert_eq!(p.name, PLUGIN_NAME);
66 assert!(!p.description.is_empty());
67 }
68}