import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);

// src/adapters/codex-app-server/models.ts
var CODEX_REASONING_EFFORT_OPTIONS = [
  { value: "low", name: "Low" },
  { value: "medium", name: "Medium" },
  { value: "high", name: "High" }
];
function supportsXhighEffort(modelId) {
  const id = modelId.toLowerCase();
  return id.includes("gpt-5.5") || id.includes("gpt-5.6");
}
function supportsMaxEffort(modelId) {
  return modelId.toLowerCase().includes("gpt-5.6");
}
function getReasoningEffortOptions(modelId) {
  const options = [...CODEX_REASONING_EFFORT_OPTIONS];
  if (supportsXhighEffort(modelId)) {
    options.push({ value: "xhigh", name: "Extra High" });
  }
  if (supportsMaxEffort(modelId)) {
    options.push({ value: "max", name: "Max" });
  }
  return options;
}
function formatCodexModelName(value) {
  return value.toLowerCase();
}
function modelIdFromConfigOptions(configOptions) {
  const modelOption = configOptions?.find((o) => o.category === "model");
  return typeof modelOption?.currentValue === "string" ? modelOption.currentValue : void 0;
}
function normalizeCodexConfigOptions(configOptions) {
  if (!configOptions) return configOptions;
  const formatOption = (opt) => ({
    ...opt,
    name: formatCodexModelName(opt.value)
  });
  return configOptions.map((option) => {
    if (option.category !== "model" || option.type !== "select") return option;
    const options = option.options;
    if (options.length === 0) return option;
    const isGroup = "group" in options[0];
    return {
      ...option,
      options: isGroup ? options.map((group) => ({
        ...group,
        options: group.options.map(formatOption)
      })) : options.map(formatOption)
    };
  });
}
export {
  formatCodexModelName,
  getReasoningEffortOptions,
  modelIdFromConfigOptions,
  normalizeCodexConfigOptions,
  supportsMaxEffort,
  supportsXhighEffort
};
//# sourceMappingURL=models.js.map