import { getCombinationId } from './WSGRZJVU.js';
import { getToolDefaultVersion, getToolSupportedVersions, findToolVersionsForCombination } from './KWRJPB5T.js';
import { init_esm_shims, __name } from './6AHA7PAZ.js';
import * as console from 'console';

// src/core/version-resolver.ts
init_esm_shims();
var resolveTypeVersions = /* @__PURE__ */ __name((context, userVersions) => {
  const versions = {};
  for (const tool of context.tools) {
    const defaultVersion = getToolDefaultVersion(context, tool.name);
    const version = userVersions[tool.name] || defaultVersion;
    if (!version) {
      continue;
    }
    versions[tool.name] = version;
    if (version === defaultVersion) {
      continue;
    }
    const supportedVersions = getToolSupportedVersions(context, tool.name);
    if (!supportedVersions.includes(version)) {
      console.warn(`\u26A0\uFE0F  Version ${version} for ${tool.name} is not in the supported list.`);
      console.warn(`   Supported versions: ${supportedVersions.join(", ")}`);
      console.warn(`   Continuing with Docker availability as final validation...`);
    }
  }
  const combination = context.versionCombinations.find((combination2) => Object.entries(findToolVersionsForCombination(context, combination2)).every(([tool, version]) => versions[tool] === version));
  if (!combination) {
    throw new Error("Compatible combination of tool versions not found");
  }
  console.info(`\u2705 ${getCombinationId(context, combination)} ${combination.description ? `(${combination.description})` : ""}`);
  return versions;
}, "resolveTypeVersions");

export { resolveTypeVersions };
//# sourceMappingURL=ZO7WI2XS.js.map
//# sourceMappingURL=ZO7WI2XS.js.map