use serde::Serialize;
pub mod local;
pub mod store;
pub use local::LocalSkillSource;
pub use store::{EnabledSkillsStore, PgEnabledSkillsStore};
#[derive(Debug, Clone, Serialize)]
pub struct SkillSpec {
pub name: String,
pub description: String,
pub body: String,
pub source: SkillSource,
pub path: String,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum SkillSource {
Project,
User,
Plugin,
}
impl SkillSource {
pub fn label(self) -> &'static str {
match self {
Self::Project => "project",
Self::User => "user",
Self::Plugin => "plugin",
}
}
}
pub fn discover_all() -> Vec<SkillSpec> {
LocalSkillSource::new().discover()
}