import { UsageError } from "./cli-contract.js";
export function parseRuntimeScopeOption(value, fallback, optionName = "--mcp-scope") {
    const normalized = value?.trim().toLowerCase();
    if (!normalized)
        return fallback;
    if (normalized === "none" || normalized === "off" || normalized === "disabled")
        return "none";
    if (normalized === "project" || normalized === "local")
        return "project";
    if (normalized === "all" ||
        normalized === "global" ||
        normalized === "local-user" ||
        normalized === "local_user" ||
        normalized === "personal" ||
        normalized === "user") {
        return "all";
    }
    throw new UsageError(`Invalid ${optionName}: ${value}. Use all, project, or none.`);
}
