Skip to main content

fetchium_core/plugin/
mod.rs

1//! Plugin system — manifest-based registry + CLI lifecycle (PRD §29).
2//!
3//! Supports 6 plugin types: Backend, Extractor, Ranker, Formatter, Validator, AiProvider.
4//! Plugins are discovered from `~/.fetchium/plugins/` via `plugin.toml` manifests.
5//! Native (.so/.dylib) and WASM loading are planned but currently handled through the
6//! manifest/registry layer only.
7
8pub mod loader;
9pub mod manifest;
10pub mod registry;
11pub mod traits;
12
13pub use manifest::PluginManifest;
14pub use registry::{PluginEntry, PluginRegistry, PluginStatus};
15pub use traits::PluginType;
16
17#[cfg(test)]
18mod tests {
19    use super::*;
20
21    #[test]
22    fn registry_starts_empty() {
23        let reg = PluginRegistry::new();
24        assert!(reg.all().is_empty());
25    }
26
27    #[test]
28    fn plugin_type_display() {
29        assert_eq!(PluginType::Backend.to_string(), "backend");
30        assert_eq!(PluginType::AiProvider.to_string(), "ai_provider");
31    }
32}