openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
3 lines • 1.48 kB
JavaScript
import{s as normalizeStaticProviderModelId}from"./model-ref-shared-T-aCqInj.mjs";import{r as normalizeProviderId}from"./provider-id-A-8WTtLA.mjs";
//!src/commands/doctor/shared/legacy-runtime-model-providers.ts
const LEGACY_RUNTIME_MODEL_PROVIDER_ALIASES=[{legacyProvider:`codex`,provider:`openai`,runtime:`codex`,cli:false},{legacyProvider:`codex-cli`,provider:`openai`,runtime:`codex`,cli:false},{legacyProvider:`claude-cli`,provider:`anthropic`,runtime:`claude-cli`,cli:true},{legacyProvider:`google-gemini-cli`,provider:`google`,runtime:`google-gemini-cli`,cli:true}];function normalizeLegacyRuntimeProviderId(e){const t=e.trim().toLowerCase();return t===`anthropic-cli`?`claude-cli`:normalizeProviderId(t)}const LEGACY_ALIAS_BY_PROVIDER=new Map(LEGACY_RUNTIME_MODEL_PROVIDER_ALIASES.map(e=>[normalizeLegacyRuntimeProviderId(e.legacyProvider),e]));function resolveLegacyRuntimeModelProviderAlias(e){return LEGACY_ALIAS_BY_PROVIDER.get(normalizeLegacyRuntimeProviderId(e))}function migrateLegacyRuntimeModelRef(e){const t=e.trim();const n=t.indexOf(`/`);if(n<=0||n>=t.length-1)return null;const r=resolveLegacyRuntimeModelProviderAlias(t.slice(0,n));if(!r)return null;const i=t.slice(n+1).trim();const a=normalizeStaticProviderModelId(r.provider,i);if(!a)return null;return{ref:`${r.provider}/${a}`,legacyProvider:r.legacyProvider,provider:r.provider,model:a,runtime:r.runtime,cli:r.cli}}export{resolveLegacyRuntimeModelProviderAlias as n,migrateLegacyRuntimeModelRef as t};