const PROVIDER_TO_RUNTIME = {
    kimi: "kimi-api",
    deepseek: "deepseek-api",
    codex: "codex-cli",
    qwen: "qwen-api",
    openrouter: "openrouter-api",
    gemini: "gemini-cli",
    claude: "claude-code",
};
export function providerToRuntimeId(provider) {
    return PROVIDER_TO_RUNTIME[provider] ?? `${provider}-adapter`;
}
export function runtimeIdToProvider(runtimeId) {
    const entry = Object.entries(PROVIDER_TO_RUNTIME).find(([, rid]) => rid === runtimeId);
    return entry?.[0] ?? runtimeId.replace(/-adapter$/, "").replace(/-cli$/, "").replace(/-api$/, "");
}
export function legacyProviderToRuntimeIds(decision) {
    const selectedRuntime = providerToRuntimeId(decision.provider);
    const fallbackChain = decision.fallbackProvider
        ? [providerToRuntimeId(decision.fallbackProvider)]
        : [];
    return {
        selectedRuntime,
        candidateRuntimes: [selectedRuntime, ...fallbackChain],
        fallbackChain,
    };
}
