"use strict";
var import_vitest = require("vitest");
var import_agent_management = require("@dexto/agent-management");
var import_provider_config = require("./provider-config.js");
import_vitest.vi.mock("@dexto/agent-management", async (importOriginal) => {
  const actual = await importOriginal();
  return {
    ...actual,
    isDextoAuthEnabled: import_vitest.vi.fn()
  };
});
const mockIsDextoAuthEnabled = import_vitest.vi.mocked(import_agent_management.isDextoAuthEnabled);
(0, import_vitest.describe)("custom-model-wizard provider ordering", () => {
  (0, import_vitest.it)("puts dexto-nova first when enabled", () => {
    mockIsDextoAuthEnabled.mockReturnValue(true);
    const expected = [
      "dexto-nova",
      ...import_agent_management.CUSTOM_MODEL_PROVIDERS.filter((p) => p !== "dexto-nova")
    ];
    (0, import_vitest.expect)((0, import_provider_config.getAvailableProviders)()).toEqual(expected);
    (0, import_vitest.expect)((0, import_provider_config.getProviderByMenuIndex)(0)).toBe("dexto-nova");
    (0, import_vitest.expect)((0, import_provider_config.getProviderByMenuIndex)(2)).toBe(expected[2]);
  });
  (0, import_vitest.it)("hides dexto-nova when disabled", () => {
    mockIsDextoAuthEnabled.mockReturnValue(false);
    const expected = import_agent_management.CUSTOM_MODEL_PROVIDERS.filter((p) => p !== "dexto-nova");
    (0, import_vitest.expect)((0, import_provider_config.getAvailableProviders)()).toEqual(expected);
    (0, import_vitest.expect)((0, import_provider_config.getProviderByMenuIndex)(0)).toBe(expected[0]);
    (0, import_vitest.expect)((0, import_provider_config.getProviderByMenuIndex)(999)).toBeUndefined();
  });
});
