import { BingEngine } from "../../engines/bing.js";
import { DuckDuckGoEngine } from "../../engines/duckduckgo.js";
import { StartpageEngine } from "../../engines/startpage.js";
import { WikipediaEngine } from "../../engines/wikipedia.js";
import { BraveEngine } from "../../engines/brave.js";
import { MojeekEngine } from "../../engines/mojeek.js";
import { MarginaliaEngine } from "../../engines/marginalia.js";
import { wrapWithRetryAndBreaker } from "../engine-base.js";
import { getConfig } from "../../../config.js";
let cached = null;
function getGeneralEngines() {
  if (cached) return cached;
  const entries = [
    { engine: wrapWithRetryAndBreaker(new BingEngine()), weight: 1, supportsDateFilter: false, quality: "medium" },
    { engine: wrapWithRetryAndBreaker(new DuckDuckGoEngine()), weight: 1, supportsDateFilter: false, quality: "medium" },
    { engine: wrapWithRetryAndBreaker(new StartpageEngine()), weight: 1, supportsDateFilter: false, quality: "medium" },
    { engine: wrapWithRetryAndBreaker(new WikipediaEngine()), weight: 0.6, supportsDateFilter: false, quality: "high" },
    // Slice S11a: Mojeek runs its own independent web index (no Bing/Google
    // reliance), adding a real lexical signal that dilutes brand-collision
    // outcomes from the existing major-engine pool. Weight stays low and the
    // engine is marked `secondary` so it cannot dominate consensus when its
    // alignment with the query is weak. Quality tier `low` matches the
    // long-tail role from the S11b registry convention.
    { engine: wrapWithRetryAndBreaker(new MojeekEngine()), weight: 0.8, supportsDateFilter: false, secondary: true, quality: "low" },
    // Slice S11a: Marginalia indexes the long-tail small web that the major
    // engines deprioritize. Same `secondary` rule as Mojeek — adds a niche
    // signal without dominating consensus.
    { engine: wrapWithRetryAndBreaker(new MarginaliaEngine()), weight: 0.6, supportsDateFilter: false, secondary: true, quality: "low" }
  ];
  if (getConfig().braveApiKey) {
    entries.push({ engine: wrapWithRetryAndBreaker(new BraveEngine()), weight: 1.1, supportsDateFilter: false, quality: "medium" });
  }
  cached = entries;
  return cached;
}
function _resetGeneralEnginesForTest() {
  cached = null;
}
export {
  _resetGeneralEnginesForTest,
  getGeneralEngines
};
//# sourceMappingURL=general.js.map