pub struct SkillRegistry { /* private fields */ }Expand description
Registry of all loaded skills with indexes for fast lookup.
Implementations§
Source§impl SkillRegistry
impl SkillRegistry
Sourcepub fn load(skills_dir: &Path) -> Result<Self, SkillError>
pub fn load(skills_dir: &Path) -> Result<Self, SkillError>
Load all skills from a directory. Each subdirectory is a skill.
If skill.toml exists, parse it for full metadata.
Otherwise, fall back to reading SKILL.md for name + description only.
Sourcepub fn merge(&mut self, source: GcsSkillSource)
pub fn merge(&mut self, source: GcsSkillSource)
Merge skills from a remote source (e.g. GCS). Local skills take precedence on name collision.
Sourcepub fn list_skills(&self) -> &[SkillMeta]
pub fn list_skills(&self) -> &[SkillMeta]
List all loaded skills.
Sourcepub fn skills_for_tool(&self, tool_name: &str) -> Vec<&SkillMeta>
pub fn skills_for_tool(&self, tool_name: &str) -> Vec<&SkillMeta>
Skills that cover a specific tool name.
Sourcepub fn skills_for_provider(&self, provider_name: &str) -> Vec<&SkillMeta>
pub fn skills_for_provider(&self, provider_name: &str) -> Vec<&SkillMeta>
Skills that cover a specific provider name.
Sourcepub fn skills_for_category(&self, category: &str) -> Vec<&SkillMeta>
pub fn skills_for_category(&self, category: &str) -> Vec<&SkillMeta>
Skills that cover a specific category.
Sourcepub fn search(&self, query: &str) -> Vec<&SkillMeta>
pub fn search(&self, query: &str) -> Vec<&SkillMeta>
Search skills by fuzzy matching on name, description, keywords, hint, and tool names.
Sourcepub fn read_content(&self, name: &str) -> Result<String, SkillError>
pub fn read_content(&self, name: &str) -> Result<String, SkillError>
Read the SKILL.md content for a skill, stripping any YAML frontmatter. Checks the in-memory files cache first (for GCS skills), then falls back to filesystem.
Sourcepub fn list_references(&self, name: &str) -> Result<Vec<String>, SkillError>
pub fn list_references(&self, name: &str) -> Result<Vec<String>, SkillError>
List reference files for a skill. Checks files cache first (GCS), then filesystem.
Sourcepub fn read_reference(
&self,
skill_name: &str,
ref_name: &str,
) -> Result<String, SkillError>
pub fn read_reference( &self, skill_name: &str, ref_name: &str, ) -> Result<String, SkillError>
Read a specific reference file. Checks files cache first (GCS), then filesystem.
Sourcepub fn bundle_files(
&self,
name: &str,
) -> Result<HashMap<String, Vec<u8>>, SkillError>
pub fn bundle_files( &self, name: &str, ) -> Result<HashMap<String, Vec<u8>>, SkillError>
Get all files in a skill as a map of relative_path → bytes. Works for both local (filesystem) and remote (cached) skills.
Sourcepub fn skill_count(&self) -> usize
pub fn skill_count(&self) -> usize
Number of loaded skills.
Sourcepub fn validate_tool_bindings(
&self,
name: &str,
manifest_registry: &ManifestRegistry,
) -> Result<(Vec<String>, Vec<String>), SkillError>
pub fn validate_tool_bindings( &self, name: &str, manifest_registry: &ManifestRegistry, ) -> Result<(Vec<String>, Vec<String>), SkillError>
Validate a skill’s tool bindings against a ManifestRegistry. Returns (valid_tools, unknown_tools).