import { resolveClaudeEffortLevelsForModelId } from './providers/claude/effort.js';
function toTitleCase(value) {
    if (!value)
        return value;
    return value.slice(0, 1).toUpperCase() + value.slice(1);
}
function withClaudeEffortModelOptions(model) {
    const levels = resolveClaudeEffortLevelsForModelId(model.id);
    if (levels.length === 0)
        return model;
    const options = levels.map((level) => ({ value: level, name: toTitleCase(level) }));
    return {
        ...model,
        modelOptions: [{
                id: 'reasoning_effort',
                name: 'Thinking',
                type: 'select',
                // Claude defaults to high effort when unset; reflect that as the baseline UI value.
                currentValue: 'high',
                options,
            }],
    };
}
const CLAUDE_STATIC_MODELS = Object.freeze([
    {
        id: 'claude-opus-4-6',
        name: 'Opus 4.6',
        description: 'Highest-capability Claude model for the hardest coding and reasoning tasks.',
    },
    {
        id: 'claude-sonnet-4-6',
        name: 'Sonnet 4.6',
        description: 'Balanced Claude model for everyday coding, editing, and analysis.',
    },
    {
        id: 'claude-haiku-4-5',
        name: 'Haiku 4.5',
        description: 'Fastest Claude option for lighter tasks and lower-latency replies.',
    },
    {
        id: 'claude-opus-4-5',
        name: 'Opus 4.5',
        description: 'Prior Opus generation alias for compatibility with existing Claude setups.',
    },
    {
        id: 'claude-sonnet-4-5',
        name: 'Sonnet 4.5',
        description: 'Prior Sonnet generation alias for compatibility with existing Claude setups.',
    },
].map(withClaudeEffortModelOptions));
const GEMINI_STATIC_MODELS = Object.freeze([
    {
        id: 'gemini-2.5-pro',
        name: 'Gemini 2.5 Pro',
        description: 'Best for complex reasoning, coding, and longer-running tasks.',
    },
    {
        id: 'gemini-2.5-flash',
        name: 'Gemini 2.5 Flash',
        description: 'Fast, balanced Gemini model for general-purpose work.',
    },
    {
        id: 'gemini-2.5-flash-lite',
        name: 'Gemini 2.5 Flash Lite',
        description: 'Lowest-latency Gemini 2.5 option for lightweight prompts.',
    },
    {
        id: 'gemini-3-flash-preview',
        name: 'Gemini 3 Flash Preview',
        description: 'Preview flash model from the Gemini 3 generation.',
    },
    {
        id: 'gemini-3-pro-preview',
        name: 'Gemini 3 Pro Preview',
        description: 'Preview pro model with stronger reasoning and coding depth.',
    },
    {
        id: 'gemini-3.1-pro-preview',
        name: 'Gemini 3.1 Pro Preview',
        description: 'Latest Gemini 3.1 preview with the strongest reasoning in this static list.',
    },
]);
const CODEX_STATIC_MODELS = Object.freeze([
    {
        id: 'gpt-5.4',
        name: 'GPT 5.4',
        description: 'Latest frontier agentic coding model.',
    },
    {
        id: 'gpt-5.4-mini',
        name: 'GPT 5.4 Mini',
        description: 'Smaller frontier agentic coding model.',
    },
    {
        id: 'gpt-5.3-codex',
        name: 'GPT 5.3 Codex',
        description: 'Frontier Codex-optimized agentic coding model.',
    },
    {
        id: 'gpt-5.3-codex-spark',
        name: 'GPT 5.3 Codex Spark',
        description: 'Ultra-fast coding model.',
    },
    {
        id: 'gpt-5.2-codex',
        name: 'GPT 5.2 Codex',
        description: 'Frontier agentic coding model.',
    },
    {
        id: 'gpt-5.2',
        name: 'GPT 5.2',
        description: 'Optimized for professional work and long-running agents.',
    },
    {
        id: 'gpt-5.1-codex-max',
        name: 'GPT 5.1 Codex Max',
        description: 'Codex-optimized model for deep and fast reasoning.',
    },
    {
        id: 'gpt-5.1-codex-mini',
        name: 'GPT 5.1 Codex Mini',
        description: 'Optimized for codex. Cheaper, faster, but less capable.',
    },
]);
export const AGENT_MODEL_CONFIG = Object.freeze({
    claude: {
        supportsSelection: true,
        supportsFreeform: true,
        nonAcpApplyScope: 'next_prompt',
        dynamicProbe: 'static-only',
        defaultMode: 'default',
        allowedModes: [
            ...CLAUDE_STATIC_MODELS.map((model) => model.id),
        ],
        staticModels: CLAUDE_STATIC_MODELS,
    },
    codex: {
        supportsSelection: true,
        nonAcpApplyScope: 'spawn_only',
        acpModelConfigOptionId: 'model',
        defaultMode: 'default',
        allowedModes: [
            ...CODEX_STATIC_MODELS.map((model) => model.id),
        ],
        staticModels: CODEX_STATIC_MODELS,
    },
    opencode: {
        supportsSelection: true,
        supportsFreeform: true,
        nonAcpApplyScope: 'next_prompt',
        acpModelConfigOptionId: 'model',
        defaultMode: 'default',
        allowedModes: ['default'],
    },
    gemini: {
        supportsSelection: true,
        supportsFreeform: true,
        nonAcpApplyScope: 'next_prompt',
        acpApplyBehavior: 'restart_session',
        acpModelConfigOptionId: 'model',
        defaultMode: 'gemini-2.5-pro',
        allowedModes: [
            ...GEMINI_STATIC_MODELS.map((model) => model.id),
        ],
        staticModels: GEMINI_STATIC_MODELS,
    },
    auggie: {
        supportsSelection: true,
        nonAcpApplyScope: 'next_prompt',
        acpModelConfigOptionId: 'model',
        defaultMode: 'default',
        allowedModes: ['default'],
    },
    qwen: {
        supportsSelection: true,
        nonAcpApplyScope: 'next_prompt',
        acpModelConfigOptionId: 'model',
        dynamicProbe: 'static-only',
        defaultMode: 'default',
        allowedModes: ['default'],
    },
    kimi: {
        supportsSelection: true,
        nonAcpApplyScope: 'next_prompt',
        acpModelConfigOptionId: 'model',
        dynamicProbe: 'static-only',
        defaultMode: 'default',
        allowedModes: ['default'],
    },
    kilo: {
        supportsSelection: true,
        supportsFreeform: true,
        nonAcpApplyScope: 'next_prompt',
        acpModelConfigOptionId: 'model',
        defaultMode: 'default',
        allowedModes: ['default'],
    },
    kiro: {
        supportsSelection: true,
        supportsFreeform: true,
        nonAcpApplyScope: 'next_prompt',
        acpApplyBehavior: 'set_model',
        acpModelConfigOptionId: 'model',
        dynamicProbe: 'static-only',
        defaultMode: 'default',
        allowedModes: ['default'],
    },
    customAcp: {
        supportsSelection: true,
        supportsFreeform: true,
        nonAcpApplyScope: 'next_prompt',
        acpApplyBehavior: 'set_model',
        acpModelConfigOptionId: 'model',
        dynamicProbe: 'auto',
        defaultMode: 'default',
        allowedModes: ['default'],
    },
    pi: {
        supportsSelection: true,
        supportsFreeform: true,
        nonAcpApplyScope: 'next_prompt',
        defaultMode: 'default',
        allowedModes: ['default'],
    },
    copilot: {
        supportsSelection: true,
        nonAcpApplyScope: 'next_prompt',
        acpModelConfigOptionId: 'model',
        defaultMode: 'default',
        allowedModes: ['default'],
    },
});
export function getAgentModelConfig(agentId) {
    return AGENT_MODEL_CONFIG[agentId];
}
export function getAgentStaticModels(agentId) {
    const config = getAgentModelConfig(agentId);
    const staticModels = Array.isArray(config.staticModels) && config.staticModels.length > 0
        ? config.staticModels
        : config.allowedModes.map((id) => ({ id, name: id }));
    const seen = new Set();
    return staticModels.filter((model) => {
        const id = typeof model.id === 'string' ? model.id.trim() : '';
        if (!id || seen.has(id))
            return false;
        seen.add(id);
        return true;
    });
}
//# sourceMappingURL=models.js.map