mirror of
https://github.com/tiennm99/ccs.git
synced 2026-08-05 20:22:03 +00:00
fix(profile): handle km compatibility for legacy kimi api users
This commit is contained in:
@@ -26,6 +26,9 @@ export interface ProviderPreset {
|
||||
}
|
||||
|
||||
export const OPENROUTER_BASE_URL = 'https://openrouter.ai/api';
|
||||
const LEGACY_PRESET_ALIASES: Readonly<Record<string, string>> = Object.freeze({
|
||||
kimi: 'km',
|
||||
});
|
||||
|
||||
/**
|
||||
* Provider presets available via CLI and UI
|
||||
@@ -169,7 +172,9 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [
|
||||
|
||||
/** Get preset by ID */
|
||||
export function getPresetById(id: string): ProviderPreset | undefined {
|
||||
return PROVIDER_PRESETS.find((p) => p.id === id.toLowerCase());
|
||||
const normalized = id.toLowerCase();
|
||||
const canonical = LEGACY_PRESET_ALIASES[normalized] || normalized;
|
||||
return PROVIDER_PRESETS.find((p) => p.id === canonical);
|
||||
}
|
||||
|
||||
/** Get all preset IDs */
|
||||
|
||||
Reference in New Issue
Block a user