const CONSENSUS_BOOST_BY_ENGINE_COUNT = {
  1: 0,
  2: 0.05,
  3: 0.1
};
const CAP_AT_OR_ABOVE_4 = 0.12;
function applyConsensusBoost(results) {
  if (results.length === 0) return results;
  return results.map((r) => {
    const n = uniqueEngines(r.engines);
    if (n <= 1) return r;
    const boost = n >= 4 ? CAP_AT_OR_ABOVE_4 : CONSENSUS_BOOST_BY_ENGINE_COUNT[n] ?? 0;
    if (boost === 0) return r;
    return {
      ...r,
      relevance_score: Math.min(1, r.relevance_score + boost)
    };
  });
}
function uniqueEngines(engines) {
  if (!engines || engines.length === 0) return 0;
  return new Set(engines.map((e) => e.toLowerCase())).size;
}
export {
  applyConsensusBoost
};
//# sourceMappingURL=consensus-boost.js.map