MCPcopy Create free account
hub / github.com/oboard/claude-code-rev / getProviderConfigById

Function getProviderConfigById

src/utils/model/providerConfig.ts:260–304  ·  view source on GitHub ↗
(
  providerId: string | undefined,
)

Source from the content-addressed store, hash-verified

258}
259
260export function getProviderConfigById(
261 providerId: string | undefined,
262): ActiveProviderConfig {
263 if (!providerId) {
264 return getBuiltinProviderConfig('firstParty')
265 }
266
267 const configuredProviders = getConfiguredProviders()
268
269 if (isBuiltinProviderId(providerId)) {
270 const builtin = getBuiltinProviderConfig(providerId)
271 const configured = configuredProviders[providerId]
272 return configured
273 ? {
274 ...builtin,
275 ...configured,
276 id: providerId,
277 type: resolveConfiguredProviderType(providerId, configured),
278 name: configured.name ?? builtin.name,
279 isCustom: false,
280 }
281 : builtin
282 }
283
284 const configured = configuredProviders[providerId]
285 if (!configured) {
286 return getBuiltinProviderConfig('firstParty')
287 }
288
289 return {
290 id: providerId,
291 type: resolveConfiguredProviderType(providerId, configured),
292 name: configured.name ?? providerId,
293 baseURL: configured.baseURL,
294 apiKeyEnv: configured.apiKeyEnv,
295 authTokenEnv: configured.authTokenEnv,
296 defaultModel: configured.defaultModel,
297 models: configured.models,
298 smallFastModel: configured.smallFastModel,
299 region: configured.region,
300 projectId: configured.projectId,
301 resource: configured.resource,
302 isCustom: true,
303 }
304}
305
306export function getAllProviderConfigs(): ActiveProviderConfig[] {
307 const customProviderIds = Object.keys(getConfiguredProviders())

Callers 7

ProviderPickerFunction · 0.85
ProviderSelectionFlowFunction · 0.85
getAllProviderConfigsFunction · 0.85
getActiveProviderConfigFunction · 0.85
ShowProviderAndCloseFunction · 0.85
SetProviderAndCloseFunction · 0.85

Calls 4

getBuiltinProviderConfigFunction · 0.85
getConfiguredProvidersFunction · 0.85
isBuiltinProviderIdFunction · 0.85

Tested by

no test coverage detected