"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateProfileName = exports.isWindowsReservedName = exports.isReservedName = exports.WINDOWS_RESERVED_NAMES = exports.RESERVED_PROFILE_NAMES = void 0;
/**
 * Reserved profile names that cannot be used for user-defined profiles.
 * These names are reserved for CLIProxy providers and CLI commands.
 */
exports.RESERVED_PROFILE_NAMES = [
    // CLIProxy providers (built-in OAuth)
    'gemini',
    'codex',
    'agy',
    'qwen',
    'iflow',
    'kiro',
    'ghcp',
    'claude',
    'kimi',
    'gitlab',
    'codebuddy',
    'kilo',
    // Copilot API (GitHub Copilot proxy)
    'copilot',
    // Cursor IDE (Cursor proxy daemon)
    'cursor',
    'legacy-cursor',
    'legacy',
    // CLI commands and special names
    'default',
    'config',
    'cliproxy',
    'proxy',
];
/**
 * Windows reserved device names - cannot be used as filenames on Windows.
 * Case-insensitive on Windows filesystem.
 */
exports.WINDOWS_RESERVED_NAMES = [
    'CON',
    'PRN',
    'AUX',
    'NUL',
    'COM1',
    'COM2',
    'COM3',
    'COM4',
    'COM5',
    'COM6',
    'COM7',
    'COM8',
    'COM9',
    'LPT1',
    'LPT2',
    'LPT3',
    'LPT4',
    'LPT5',
    'LPT6',
    'LPT7',
    'LPT8',
    'LPT9',
];
/**
 * Check if a name is reserved and cannot be used for user profiles.
 * @param name - The profile name to check
 * @returns true if the name is reserved
 */
function isReservedName(name) {
    return exports.RESERVED_PROFILE_NAMES.includes(name.toLowerCase());
}
exports.isReservedName = isReservedName;
/**
 * Check if a name is a Windows reserved device name.
 * These cause filesystem errors on Windows systems.
 * @param name - The name to check
 * @returns true if the name is a Windows reserved name
 */
function isWindowsReservedName(name) {
    return exports.WINDOWS_RESERVED_NAMES.includes(name.toUpperCase());
}
exports.isWindowsReservedName = isWindowsReservedName;
/**
 * Validate a profile name and throw if reserved.
 * @param name - The profile name to validate
 * @throws Error if the name is reserved
 */
function validateProfileName(name) {
    if (isReservedName(name)) {
        throw new Error(`Profile name '${name}' is reserved. Reserved names: ${exports.RESERVED_PROFILE_NAMES.join(', ')}`);
    }
}
exports.validateProfileName = validateProfileName;
//# sourceMappingURL=reserved-names.js.map