feat(skills): reload registry on watcher change events

This commit is contained in:
William Valentin
2026-02-12 17:30:23 -08:00
parent b773e2bbf3
commit 2fb5c9adab
5 changed files with 90 additions and 8 deletions
+8
View File
@@ -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);