feat: add vertex provider, oauth model mappings, and routing/log settings

This commit is contained in:
Supra4E8C
2026-01-05 19:03:05 +08:00
parent 71556a51c5
commit 8dca670358
18 changed files with 1313 additions and 113 deletions

View File

@@ -38,12 +38,16 @@ const SECTION_KEYS: RawConfigSection[] = [
'usage-statistics-enabled',
'request-log',
'logging-to-file',
'logs-max-total-size-mb',
'ws-auth',
'force-model-prefix',
'routing/strategy',
'api-keys',
'ampcode',
'gemini-api-key',
'codex-api-key',
'claude-api-key',
'vertex-api-key',
'openai-compatibility',
'oauth-excluded-models'
];
@@ -65,8 +69,14 @@ const extractSectionValue = (config: Config | null, section?: RawConfigSection)
return config.requestLog;
case 'logging-to-file':
return config.loggingToFile;
case 'logs-max-total-size-mb':
return config.logsMaxTotalSizeMb;
case 'ws-auth':
return config.wsAuth;
case 'force-model-prefix':
return config.forceModelPrefix;
case 'routing/strategy':
return config.routingStrategy;
case 'api-keys':
return config.apiKeys;
case 'ampcode':
@@ -77,6 +87,8 @@ const extractSectionValue = (config: Config | null, section?: RawConfigSection)
return config.codexApiKeys;
case 'claude-api-key':
return config.claudeApiKeys;
case 'vertex-api-key':
return config.vertexApiKeys;
case 'openai-compatibility':
return config.openaiCompatibility;
case 'oauth-excluded-models':
@@ -194,9 +206,18 @@ export const useConfigStore = create<ConfigState>((set, get) => ({
case 'logging-to-file':
nextConfig.loggingToFile = value;
break;
case 'logs-max-total-size-mb':
nextConfig.logsMaxTotalSizeMb = value;
break;
case 'ws-auth':
nextConfig.wsAuth = value;
break;
case 'force-model-prefix':
nextConfig.forceModelPrefix = value;
break;
case 'routing/strategy':
nextConfig.routingStrategy = value;
break;
case 'api-keys':
nextConfig.apiKeys = value;
break;
@@ -212,6 +233,9 @@ export const useConfigStore = create<ConfigState>((set, get) => ({
case 'claude-api-key':
nextConfig.claudeApiKeys = value;
break;
case 'vertex-api-key':
nextConfig.vertexApiKeys = value;
break;
case 'openai-compatibility':
nextConfig.openaiCompatibility = value;
break;