import { GithubCodeEngine } from "../../engines/github-code.js";
import { StackOverflowEngine } from "../../engines/stackoverflow.js";
import { MdnEngine } from "../../engines/mdn.js";
import { DevDocsEngine } from "../../engines/devdocs.js";
import { DuckDuckGoEngine } from "../../engines/duckduckgo.js";
import { BraveEngine } from "../../engines/brave.js";
import { wrapWithRetryAndBreaker } from "../engine-base.js";
import { getConfig } from "../../../config.js";
let cached = null;
function getCodeEngines() {
  if (cached) return cached;
  const entries = [
    {
      engine: wrapWithRetryAndBreaker(new GithubCodeEngine()),
      weight: 1.2,
      supportsDateFilter: false,
      quality: "medium"
    },
    {
      engine: wrapWithRetryAndBreaker(new StackOverflowEngine()),
      weight: 1,
      supportsDateFilter: true,
      quality: "high"
    },
    {
      engine: wrapWithRetryAndBreaker(new DevDocsEngine()),
      weight: 0.6,
      supportsDateFilter: false,
      quality: "low"
    },
    {
      engine: wrapWithRetryAndBreaker(new DuckDuckGoEngine()),
      weight: 0.8,
      supportsDateFilter: false,
      quality: "medium"
    }
  ];
  if (getConfig().braveApiKey) {
    entries.push({
      engine: wrapWithRetryAndBreaker(new BraveEngine()),
      weight: 1,
      supportsDateFilter: false,
      quality: "medium"
    });
  }
  entries.push({
    engine: wrapWithRetryAndBreaker(new MdnEngine()),
    weight: 0.3,
    supportsDateFilter: false,
    secondary: true,
    quality: "high"
  });
  cached = entries;
  return cached;
}
function _resetCodeEnginesForTest() {
  cached = null;
}
export {
  _resetCodeEnginesForTest,
  getCodeEngines
};
//# sourceMappingURL=code.js.map