import { defineConfig } from "vitest/config";
import {
  resolveDefaultVitestPool,
  resolveLocalVitestMaxWorkers,
  resolveLocalVitestScheduling,
  nonIsolatedRunnerPath,
  sharedVitestConfig,
} from "./vitest.shared.config.ts";

export { resolveDefaultVitestPool, resolveLocalVitestMaxWorkers, resolveLocalVitestScheduling };

export const rootVitestProjects = [
  "test/vitest/vitest.unit.config.ts",
  "test/vitest/vitest.infra.config.ts",
  "test/vitest/vitest.boundary.config.ts",
  "test/vitest/vitest.contracts.config.ts",
  "test/vitest/vitest.bundled.config.ts",
  "test/vitest/vitest.gateway-core.config.ts",
  "test/vitest/vitest.gateway-client.config.ts",
  "test/vitest/vitest.gateway-methods.config.ts",
  "test/vitest/vitest.gateway-server.config.ts",
  "test/vitest/vitest.hooks.config.ts",
  "test/vitest/vitest.acp.config.ts",
  "test/vitest/vitest.runtime-config.config.ts",
  "test/vitest/vitest.secrets.config.ts",
  "test/vitest/vitest.cli.config.ts",
  "test/vitest/vitest.commands-light.config.ts",
  "test/vitest/vitest.commands.config.ts",
  "test/vitest/vitest.auto-reply.config.ts",
  "test/vitest/vitest.agents.config.ts",
  "test/vitest/vitest.daemon.config.ts",
  "test/vitest/vitest.media.config.ts",
  "test/vitest/vitest.unit-fast.config.ts",
  "test/vitest/vitest.plugin-sdk-light.config.ts",
  "test/vitest/vitest.plugin-sdk.config.ts",
  "test/vitest/vitest.plugins.config.ts",
  "test/vitest/vitest.logging.config.ts",
  "test/vitest/vitest.process.config.ts",
  "test/vitest/vitest.cron.config.ts",
  "test/vitest/vitest.media-understanding.config.ts",
  "test/vitest/vitest.shared-core.config.ts",
  "test/vitest/vitest.tasks.config.ts",
  "test/vitest/vitest.tooling.config.ts",
  "test/vitest/vitest.tui.config.ts",
  "test/vitest/vitest.ui.config.ts",
  "test/vitest/vitest.utils.config.ts",
  "test/vitest/vitest.wizard.config.ts",
  "test/vitest/vitest.channels.config.ts",
  "test/vitest/vitest.extension-acpx.config.ts",
  "test/vitest/vitest.extension-bluebubbles.config.ts",
  "test/vitest/vitest.extension-channels.config.ts",
  "test/vitest/vitest.extension-diffs.config.ts",
  "test/vitest/vitest.extension-feishu.config.ts",
  "test/vitest/vitest.extension-irc.config.ts",
  "test/vitest/vitest.extension-mattermost.config.ts",
  "test/vitest/vitest.extension-matrix.config.ts",
  "test/vitest/vitest.extension-memory.config.ts",
  "test/vitest/vitest.extension-msteams.config.ts",
  "test/vitest/vitest.extension-messaging.config.ts",
  "test/vitest/vitest.extension-providers.config.ts",
  "test/vitest/vitest.extension-telegram.config.ts",
  "test/vitest/vitest.extension-voice-call.config.ts",
  "test/vitest/vitest.extension-whatsapp.config.ts",
  "test/vitest/vitest.extension-zalo.config.ts",
  "test/vitest/vitest.extensions.config.ts",
] as const;

export default defineConfig({
  ...sharedVitestConfig,
  test: {
    ...sharedVitestConfig.test,
    runner: nonIsolatedRunnerPath,
    projects: [...rootVitestProjects],
  },
});
