export class SkillRegistry {
    skills = new Map();
    register(skill) {
        if (this.skills.has(skill.name)) {
            throw new Error(`Skill already registered: ${skill.name}`);
        }
        this.skills.set(skill.name, skill);
    }
    unregister(name) {
        return this.skills.delete(name);
    }
    get(name) {
        return this.skills.get(name);
    }
    list() {
        return Array.from(this.skills.values());
    }
    has(name) {
        return this.skills.has(name);
    }
    async execute(name, params) {
        const skill = this.skills.get(name);
        if (!skill) {
            throw new Error(`Skill not found: ${name}`);
        }
        return skill.execute(params);
    }
}
