import { normalizeProviderConfig } from "./provider-metadata.js";
export function sanitizeProviderReplayConfig(config) {
    if (!config)
        return undefined;
    const safe = { ...normalizeProviderConfig(config) };
    delete safe.apiKey;
    return safe;
}
export function toProviderReplayConfig(config) {
    return sanitizeProviderReplayConfig(config);
}
export function providerReplayIdentity(config) {
    const safe = sanitizeProviderReplayConfig(config);
    if (!safe)
        return "";
    return JSON.stringify({
        baseURL: safe.baseURL,
        compatibilityMode: safe.compatibilityMode,
        decisionTransport: safe.decisionTransport,
        kind: safe.kind,
        model: safe.model,
    });
}
export function sameProviderReplayIdentity(left, right) {
    return providerReplayIdentity(left) === providerReplayIdentity(right);
}
export function providerConfigKey(config) {
    const normalized = normalizeProviderConfig(config);
    return JSON.stringify({
        apiKey: normalized.apiKey,
        baseURL: normalized.baseURL,
        compatibilityMode: normalized.compatibilityMode,
        decisionTransport: normalized.decisionTransport,
        kind: normalized.kind,
        maxInputTokens: normalized.maxInputTokens,
        maxOutputTokens: normalized.maxOutputTokens,
        model: normalized.model,
        reasoningEffort: normalized.reasoningEffort,
        systemPrompt: normalized.systemPrompt,
        timeoutMs: normalized.timeoutMs,
    });
}
//# sourceMappingURL=provider-replay-config.js.map