AAI SDK
    Preparing search index...

    Function withHostCredentialFallback

    • Return env with any missing provider credential filled in from hostEnv (defaults to process.env).

      Values already present in env always win — an explicit .env entry or aai secret put value is never overridden by the shell. Only names in PROVIDER_CREDENTIAL_ENVS are copied, so unrelated host variables never reach ctx.env. process.env is not mutated.

      The return type is the HostCredentialEnv brand — this is the one function that mints it. The result satisfies RuntimeOptions.providerEnv but not RuntimeOptions.env, so host credentials cannot silently become ctx.env (see sdk/env-types.ts).

      Parameters

      • env: Record<string, string>
      • OptionalhostEnv: Record<string, string | undefined>

      Returns HostCredentialEnv