/**
 * Skill-name uniqueness validation (Task 2.5) — collisions across loaded
 * packs are surfaced (not auto-resolved) per design doc §"Pack validation
 * checks" + §"Conflict resolution policy". The setup UI / load orchestrator
 * presents the issue and lets the user rename or remove (UI.8).
 *
 * Imports from: runtime/types.ts (Pack).
 * Imported by: packs/ index re-export; load orchestrator (Phase 3+).
 */
// ---------------------------------------------------------------------------
// validateUniqueSkillNames — aggregate skill → packs[] map; collisions → issues.
//
// Runs at load-orchestrator time (after every pack has been loaded). Never
// short-circuits and never resolves the collision; all issues returned so the
// user fixes them in one pass.
// ---------------------------------------------------------------------------
export function validateUniqueSkillNames(packs) {
    const byName = new Map();
    for (const p of packs) {
        for (const s of p.skills) {
            const list = byName.get(s.name) ?? [];
            list.push(p.name);
            byName.set(s.name, list);
        }
    }
    const issues = [];
    for (const [skill, ownerPacks] of byName) {
        if (ownerPacks.length > 1)
            issues.push({ skill, packs: ownerPacks });
    }
    return issues;
}
//# sourceMappingURL=validate_uniqueness.js.map