Skip to content

Function: resolveProviderResolution()

Makaio Framework


Makaio Framework / ai-adapters-core/config / resolveProviderResolution

resolveProviderResolution(bus, providerConfigId, protocol): Promise<ProviderResolution>

Defined in: ../../../adapters/core/src/config/resolve-provider-resolution.ts:55

Resolve a ProviderConfig to its full runtime data: config record, definition record, endpoint URL, and plaintext credentials.

Encapsulates the common lookup chain shared by the adapter config factory and the provider endpoint resolver:

  1. AdapterSubsystemSubjects.getProviderConfig for the canonical read model
  2. AdapterSubsystemSubjects.buildProviderContext for runtime credential refs and endpoint overrides
  3. ProviderStorageSubjects.get for provider-definition metadata
  4. context.endpointOverrides?.[protocol] ?? definition.endpoints?.[protocol]
  5. Opens a DirectChannel via CredentialSubjects.getChannelToken and resolves each credential ref; the channel is closed after use.

Callers keep only their differing post-resolution logic (e.g., strict baseUrl / apiKey validation for HTTP bridges vs. nullable baseUrl for adapter factories that allow env-var fallbacks).

IMakaioBus

Bus instance for storage and credential requests

string

UUID of the ProviderConfig to resolve

"anthropic" | "openai"

Wire protocol used to select the correct endpoint URL

Promise<ProviderResolution>

Fully resolved provider data

Error when the ProviderConfig or its ProviderDefinition is not found