fix: use openclaw.json as single source of truth for provider list (#649)

This commit is contained in:
paisley
2026-03-24 15:21:37 +08:00
committed by GitHub
Unverified
parent 859e3fd6c5
commit 05ae404dee
5 changed files with 268 additions and 193 deletions

View File

@@ -25,6 +25,16 @@ export function getOpenClawProviderKeyForType(type: string, providerId: string):
return PROVIDER_KEY_ALIASES[type] ?? type;
}
/**
* Get all vendorId values that map to the given openclaw.json key via alias.
* e.g. getAliasSourceTypes('minimax-portal') → ['minimax-portal-cn']
*/
export function getAliasSourceTypes(openClawKey: string): string[] {
return Object.entries(PROVIDER_KEY_ALIASES)
.filter(([, target]) => target === openClawKey)
.map(([source]) => source);
}
export function isOAuthProviderType(type: string): boolean {
return OAUTH_PROVIDER_TYPE_SET.has(type);
}