openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
3 lines • 805 B
JavaScript
import{c as normalizeOptionalLowercaseString}from"./string-coerce-CpTFcSwY.mjs";import{i as resolveProviderMatch}from"./provider-auth-choice-helpers-DVN0Uqx5.mjs";import{t as resolvePluginProviders}from"./provider-auth-choice.runtime-DydyzZcI.mjs";
//!src/commands/auth-choice.apply.api-providers.ts
function normalizeApiKeyTokenProviderAuthChoice(e){const t=normalizeOptionalLowercaseString(e.tokenProvider);if(!t)return e.authChoice;const n=e.authChoice===`apiKey`?`api_key`:e.authChoice===`token`||e.authChoice===`setup-token`?`token`:void 0;if(!n)return e.authChoice;return resolveProviderMatch(resolvePluginProviders({config:e.config,workspaceDir:e.workspaceDir,env:e.env,mode:`setup`}),t)?.auth.find(e=>e.kind===n)?.wizard?.choiceId??e.authChoice}export{normalizeApiKeyTokenProviderAuthChoice as t};