import { getMemoryEmbeddingsProfileMetadata } from './memoryEmbeddingsProfiles.js';
const DEFAULT_BLEND = {
    ftsWeight: 0.7,
    embeddingWeight: 0.3,
};
function normalizeBlend(blend) {
    return {
        ftsWeight: typeof blend?.ftsWeight === 'number' ? blend.ftsWeight : DEFAULT_BLEND.ftsWeight,
        embeddingWeight: typeof blend?.embeddingWeight === 'number' ? blend.embeddingWeight : DEFAULT_BLEND.embeddingWeight,
    };
}
export function resolveMemoryEmbeddingsConfig(settings) {
    const blend = normalizeBlend(settings.blend);
    if (settings.mode === 'disabled') {
        return {
            enabled: false,
            mode: 'disabled',
            profile: null,
            provider: null,
            blend,
        };
    }
    if (settings.mode === 'preset') {
        const profile = getMemoryEmbeddingsProfileMetadata(settings.presetId);
        return {
            enabled: true,
            mode: 'preset',
            profile,
            provider: profile.config,
            blend,
        };
    }
    return {
        enabled: true,
        mode: 'custom',
        profile: null,
        provider: settings.custom ?? null,
        blend,
    };
}
//# sourceMappingURL=resolveMemoryEmbeddingsConfig.js.map