resolveCliProviderSpec function
Implementation
ProviderSpec? resolveCliProviderSpec(
String kind, {
String? baseUrl,
bool honorBuildFilter = false,
}) {
// Uniform normalization: names AND kinds are lowercase in the catalog,
// so the literal special-case, the name leg, and the kind leg all
// accept case variants identically.
final key = kind.trim().toLowerCase();
if (key == 'openai-completions' || key == 'openrouter') {
return _applyBuildFilter(_legacyOpenAiSpec(baseUrl), honorBuildFilter);
}
return _applyBuildFilter(
providerCatalog[key] ?? _kindScan(key),
honorBuildFilter,
);
}