pub struct SkillStore { /* private fields */ }Expand description
Every skill on the machine, in a stable order.
Implementations§
Source§impl SkillStore
impl SkillStore
Sourcepub fn default_dir() -> Result<PathBuf>
pub fn default_dir() -> Result<PathBuf>
~/.mecha/skills.
Sourcepub fn load(dir: &Path) -> (SkillStore, Vec<SkillError>)
pub fn load(dir: &Path) -> (SkillStore, Vec<SkillError>)
Read every <dir>/*/SKILL.md.
Best-effort per skill, like every other reader over a store here: one unparseable skill is a finding, not a crash, and never suppresses the ones beside it. Read-only — a missing directory is an empty store, because an agent that has been given no skills must not create state by starting.
pub fn all(&self) -> &[Skill]
pub fn get(&self, name: &str) -> Option<&Skill>
pub fn is_empty(&self) -> bool
Sourcepub fn select(&self, enabled: &[String], disabled: &[String]) -> Vec<Skill>
pub fn select(&self, enabled: &[String], disabled: &[String]) -> Vec<Skill>
The skills a run actually carries.
enabled empty means all of them; disabled is applied after, so it
wins. Order is preserved, which is to say still sorted.
Sourcepub fn unknown_names<'a>(&self, names: &'a [String]) -> Vec<&'a str>
pub fn unknown_names<'a>(&self, names: &'a [String]) -> Vec<&'a str>
Names in enabled/disabled that match no skill on disk.
Worth saying at startup for the reason a routed outbox name matching no tool is: a typo’d enable is indistinguishable from a skill the model never chose, and both look like nothing happening.
Trait Implementations§
Source§impl Clone for SkillStore
impl Clone for SkillStore
Source§fn clone(&self) -> SkillStore
fn clone(&self) -> SkillStore
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more