/**
 * AWS Bedrock Provider Configuration
 *
 * Supports two authentication modes:
 * 1. API Key (Bearer token) - Simplest, for long-term API keys
 * 2. SigV4 (IAM credentials) - For EC2/ECS/Lambda with IAM roles
 */
/**
 * Validates the configuration and determines the auth mode.
 */
export function validateBedrockConfig(config) {
    if (!config.region) {
        throw new Error("BedrockConfig: region is required");
    }
    const hasApiKey = !!config.apiKey;
    const hasSigV4 = !!(config.accessKeyId && config.secretAccessKey);
    if (hasApiKey && hasSigV4) {
        throw new Error("BedrockConfig: provide either apiKey OR accessKeyId/secretAccessKey, not both");
    }
    if (hasApiKey) {
        return "apiKey";
    }
    if (hasSigV4) {
        return "sigv4";
    }
    throw new Error("BedrockConfig: provide either apiKey OR accessKeyId/secretAccessKey");
}
/**
 * Build the Bedrock Runtime endpoint URL for a given region.
 */
export function getBedrockEndpoint(region) {
    return `https://bedrock-runtime.${region}.amazonaws.com`;
}
