feat(skills): reload registry on watcher change events
This commit is contained in:
@@ -9,6 +9,14 @@ import type { Skill } from './types.js';
|
||||
export class SkillRegistry {
|
||||
private skills: Map<string, Skill> = new Map();
|
||||
|
||||
/** Replace all registered skills with the provided set. */
|
||||
reset(skills: Skill[]): void {
|
||||
this.skills.clear();
|
||||
for (const skill of skills) {
|
||||
this.skills.set(skill.manifest.name, skill);
|
||||
}
|
||||
}
|
||||
|
||||
/** Register a skill. Replaces any existing skill with the same name. */
|
||||
register(skill: Skill): void {
|
||||
this.skills.set(skill.manifest.name, skill);
|
||||
|
||||
Reference in New Issue
Block a user