"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.uniqueStrings = exports.getPublicRootCommandTokens = exports.getAllRootCommandTokens = exports.getPublicRootCommands = exports.COPILOT_COMPLETION_SUBCOMMANDS = exports.CURSOR_COMPLETION_SUBCOMMANDS = exports.COMMAND_FLAG_SUGGESTIONS = exports.PROVIDER_FLAGS = exports.CLEANUP_FLAGS = exports.MIGRATE_FLAGS = exports.TOKENS_FLAGS = exports.PROXY_SUBCOMMANDS = exports.DOCKER_SUBCOMMANDS = exports.CONFIG_SUBCOMMANDS = exports.CLIPROXY_SUBCOMMANDS = exports.API_SUBCOMMANDS = exports.AUTH_SUBCOMMANDS = exports.ROOT_COMMAND_FLAGS = exports.ROOT_COMPATIBLE_ALIAS_EXAMPLES = exports.ROOT_PROFILE_EXAMPLES = exports.BUILTIN_PROVIDER_SHORTCUTS = exports.ROOT_COMMAND_CATALOG = exports.ROOT_HELP_TOPICS = void 0;
const constants_1 = require("../copilot/constants");
const provider_capabilities_1 = require("../cliproxy/provider-capabilities");
exports.ROOT_HELP_TOPICS = [
    { name: 'profiles', summary: 'Account profiles, API profiles, and CLIProxy variants' },
    { name: 'providers', summary: 'Built-in OAuth providers and runtime shortcuts' },
    { name: 'kiro', summary: 'Kiro auth methods, IDC flags, and callback guidance' },
    { name: 'browser', summary: 'Claude Browser Attach and Codex Browser Tools guidance' },
    { name: 'completion', summary: 'Shell completion install, refresh, and testing' },
    { name: 'targets', summary: 'Claude, Droid, and Codex target routing' },
];
exports.ROOT_COMMAND_CATALOG = [
    {
        name: 'help',
        summary: 'Show root help or help for a topic/command',
        group: 'start',
        aliases: ['--help', '-h'],
        visibility: 'public',
    },
    {
        name: 'version',
        summary: 'Show version and install details',
        group: 'start',
        aliases: ['--version', '-v'],
        visibility: 'public',
    },
    {
        name: 'setup',
        summary: 'Run the first-time setup wizard',
        group: 'start',
        aliases: ['--setup'],
        visibility: 'public',
    },
    {
        name: 'config',
        summary: 'Open the dashboard and config subcommands',
        group: 'start',
        visibility: 'public',
    },
    {
        name: 'doctor',
        summary: 'Run health checks and diagnostics',
        group: 'start',
        aliases: ['--doctor'],
        visibility: 'public',
    },
    {
        name: 'auth',
        summary: 'Manage concurrent Claude accounts',
        group: 'manage',
        visibility: 'public',
    },
    {
        name: 'api',
        summary: 'Create, discover, copy, export, and import API profiles',
        group: 'manage',
        visibility: 'public',
    },
    {
        name: 'cliproxy',
        summary: 'Manage CLIProxy variants, quota, and local lifecycle',
        group: 'manage',
        visibility: 'public',
    },
    {
        name: 'env',
        summary: 'Export profile env for third-party tools',
        group: 'manage',
        visibility: 'public',
    },
    {
        name: 'persist',
        summary: 'Write profile setup to ~/.claude/settings.json',
        group: 'manage',
        visibility: 'public',
    },
    { name: 'tokens', summary: 'Manage CLIProxy auth tokens', group: 'manage', visibility: 'public' },
    {
        name: 'migrate',
        summary: 'Move legacy JSON config to unified YAML config',
        group: 'manage',
        aliases: ['--migrate'],
        visibility: 'public',
    },
    {
        name: 'cursor',
        summary: 'Run Cursor via CLIProxy or manage Cursor provider auth',
        group: 'runtime',
        visibility: 'public',
    },
    {
        name: 'proxy',
        summary: 'Start or inspect the OpenAI-compatible local proxy',
        group: 'runtime',
        visibility: 'public',
    },
    {
        name: 'browser',
        summary: 'Set up, inspect, and control Claude Browser Attach and Codex Browser Tools',
        group: 'runtime',
        visibility: 'public',
    },
    {
        name: 'copilot',
        summary: 'Run or manage the deprecated GitHub Copilot bridge',
        group: 'runtime',
        visibility: 'public',
    },
    {
        name: 'docker',
        summary: 'Deploy or operate the bundled Docker stack',
        group: 'operations',
        visibility: 'public',
    },
    {
        name: 'sync',
        summary: 'Sync delegation commands and skills',
        group: 'operations',
        aliases: ['--sync'],
        visibility: 'public',
    },
    {
        name: 'update',
        summary: 'Update CCS to the latest version',
        group: 'operations',
        aliases: ['--update'],
        visibility: 'public',
    },
    {
        name: 'cleanup',
        summary: 'Remove old CCS and CLIProxy logs',
        group: 'operations',
        aliases: ['--cleanup'],
        visibility: 'public',
    },
    {
        name: '--shell-completion',
        summary: 'Install shell completion',
        group: 'operations',
        aliases: ['-sc'],
        visibility: 'hidden',
    },
    {
        name: '--install',
        summary: 'Post-install bootstrap hook',
        group: 'operations',
        visibility: 'hidden',
    },
    {
        name: '--uninstall',
        summary: 'Post-uninstall cleanup hook',
        group: 'operations',
        visibility: 'hidden',
    },
    {
        name: '__complete',
        summary: 'Hidden shell completion backend',
        group: 'operations',
        visibility: 'hidden',
    },
];
exports.BUILTIN_PROVIDER_SHORTCUTS = provider_capabilities_1.CLIPROXY_PROVIDER_IDS.map((name) => ({
    name,
    summary: {
        gemini: 'Google Gemini via CLIProxy OAuth',
        codex: 'OpenAI Codex via CLIProxy OAuth',
        agy: 'Antigravity via CLIProxy OAuth',
        qwen: 'Qwen Code via CLIProxy OAuth',
        iflow: 'iFlow via CLIProxy OAuth',
        kiro: 'Kiro via CLIProxy OAuth',
        ghcp: 'Deprecated GitHub Copilot via CLIProxy OAuth',
        claude: 'Claude via CLIProxy OAuth',
        kimi: 'Kimi via CLIProxy OAuth',
        cursor: 'Cursor via CLIProxy OAuth',
        gitlab: 'GitLab Duo via CLIProxy OAuth',
        codebuddy: 'CodeBuddy via CLIProxy OAuth',
        kilo: 'Kilo AI via CLIProxy OAuth',
    }[name] || 'CLIProxy OAuth provider',
}));
exports.ROOT_PROFILE_EXAMPLES = [
    { name: 'ccs auth create work', summary: 'Create a concurrent Claude account profile' },
    {
        name: 'ccs --effort high "debug this"',
        summary: 'Use a native Claude effort override for one session',
    },
    { name: 'ccs api create --preset glm', summary: 'Create a GLM-backed API profile' },
    {
        name: 'ccs api create --preset anthropic --1m',
        summary: 'Create a Claude API profile with explicit [1m]',
    },
    {
        name: 'ccs env <profile> --format claude-extension --ide vscode',
        summary: 'Export IDE extension settings',
    },
];
exports.ROOT_COMPATIBLE_ALIAS_EXAMPLES = [
    { name: '--target claude|droid|codex', summary: 'Route a profile to the target runtime' },
    { name: 'ccs-droid / ccsd', summary: 'Explicit Droid runtime aliases' },
    {
        name: 'ccs-codex / ccsx / ccsxp',
        summary: 'Codex runtime aliases plus the cliproxy shortcut',
    },
];
exports.ROOT_COMMAND_FLAGS = [
    '--help',
    '-h',
    '--version',
    '-v',
    '--shell-completion',
    '-sc',
];
exports.AUTH_SUBCOMMANDS = [
    'create',
    'backup',
    'list',
    'show',
    'resources',
    'remove',
    'default',
    'reset-default',
];
exports.API_SUBCOMMANDS = [
    'create',
    'list',
    'discover',
    'copy',
    'export',
    'import',
    'remove',
];
exports.CLIPROXY_SUBCOMMANDS = [
    'create',
    'edit',
    'list',
    'remove',
    'routing',
    'catalog',
    'sync',
    'quota',
    'start',
    'restart',
    'status',
    'stop',
    'doctor',
    'default',
    'pause',
    'resume',
];
exports.CONFIG_SUBCOMMANDS = ['auth', 'channels', 'image-analysis', 'thinking'];
exports.DOCKER_SUBCOMMANDS = [
    'up',
    'down',
    'status',
    'update',
    'logs',
    'config',
    'show-key',
    'finalize-key-rotation',
];
exports.PROXY_SUBCOMMANDS = ['start', 'stop', 'status', 'activate'];
exports.TOKENS_FLAGS = [
    '--show',
    '--api-key',
    '--secret',
    '--regenerate-secret',
    '--variant',
    '--reset',
    '--help',
    '-h',
];
exports.MIGRATE_FLAGS = ['--dry-run', '--rollback', '--list-backups', '--help'];
exports.CLEANUP_FLAGS = [
    '--errors',
    '--days=',
    '--dry-run',
    '--force',
    '--help',
    '-h',
];
exports.PROVIDER_FLAGS = [
    '--auth',
    '--add',
    '--paste-callback',
    '--accounts',
    '--use',
    '--config',
    '--thinking',
    '--effort',
    '--1m',
    '--no-1m',
    '--browser',
    '--no-browser',
    '--logout',
    '--headless',
    '--port-forward',
    '--help',
    '-h',
];
exports.COMMAND_FLAG_SUGGESTIONS = {
    '--shell-completion': ['--bash', '--zsh', '--fish', '--powershell', '--force', '-f'],
    auth: ['--help', '-h'],
    api: ['--help', '-h'],
    cleanup: exports.CLEANUP_FLAGS,
    config: ['--help', '-h', '--port', '-p', '--host', '-H', '--dev'],
    cursor: ['--help', '-h'],
    doctor: ['--fix', '-f', '--help', '-h'],
    browser: ['setup', 'status', 'doctor', 'policy', 'enable', 'disable', '--help', '-h'],
    docker: ['--help', '-h', '--host'],
    env: ['--format', '--shell', '--ide', '--help', '-h'],
    migrate: exports.MIGRATE_FLAGS,
    tokens: exports.TOKENS_FLAGS,
    update: ['--force', '--beta', '--dev', '--help', '-h'],
};
exports.CURSOR_COMPLETION_SUBCOMMANDS = [
    '--auth',
    '--accounts',
    '--config',
    '--logout',
    '--help',
    '-h',
];
exports.COPILOT_COMPLETION_SUBCOMMANDS = [...constants_1.COPILOT_SUBCOMMANDS, 'help'];
function getPublicRootCommands() {
    return exports.ROOT_COMMAND_CATALOG.filter((entry) => entry.visibility === 'public');
}
exports.getPublicRootCommands = getPublicRootCommands;
function getAllRootCommandTokens() {
    return uniqueStrings(exports.ROOT_COMMAND_CATALOG.flatMap((entry) => [entry.name, ...(entry.aliases || [])]));
}
exports.getAllRootCommandTokens = getAllRootCommandTokens;
function getPublicRootCommandTokens() {
    return uniqueStrings(exports.ROOT_COMMAND_CATALOG.filter((entry) => entry.visibility === 'public').flatMap((entry) => [
        entry.name,
        ...(entry.aliases || []),
    ]));
}
exports.getPublicRootCommandTokens = getPublicRootCommandTokens;
function uniqueStrings(values) {
    return [...new Set(values.filter(Boolean))].sort((left, right) => left.localeCompare(right));
}
exports.uniqueStrings = uniqueStrings;
//# sourceMappingURL=command-catalog.js.map