// engine/plugin-installer/conflict-checker.ts — Bidirectional plugin conflict detection (SPEC-604)
/**
 * Checks for bidirectional conflicts between a plugin to install and currently installed plugins.
 *
 * Bidirectional means:
 * - toInstall.conflicts lists an installed plugin id, OR
 * - any installed plugin's conflicts list includes toInstall.id
 */
export function checkPluginConflicts(toInstall, installed) {
    const conflictingPlugins = [];
    for (const installedPlugin of installed) {
        const toInstallConflictsWithInstalled = toInstall.conflicts?.includes(installedPlugin.id) ?? false;
        const installedConflictsWithToInstall = installedPlugin.conflicts?.includes(toInstall.id) ?? false;
        if (toInstallConflictsWithInstalled || installedConflictsWithToInstall) {
            conflictingPlugins.push(installedPlugin.id);
        }
    }
    return {
        hasConflict: conflictingPlugins.length > 0,
        conflictingPlugins,
    };
}
//# sourceMappingURL=conflict-checker.js.map