'use strict';

// src/platform/ai-services/internal/semver.ts
var SEMVER_PATTERN = /(\d+\.\d+\.\d+)/;
function extractSemver(value) {
  const match = value.match(SEMVER_PATTERN);
  return match?.[1] ?? null;
}
function isVersionOutdated(current, target) {
  const currentParts = current.split(".").map(Number);
  const targetParts = target.split(".").map(Number);
  for (let index = 0; index < Math.max(currentParts.length, targetParts.length); index += 1) {
    const currentPart = currentParts[index] ?? 0;
    const targetPart = targetParts[index] ?? 0;
    if (currentPart < targetPart) {
      return true;
    }
    if (currentPart > targetPart) {
      return false;
    }
  }
  return false;
}

exports.extractSemver = extractSemver;
exports.isVersionOutdated = isVersionOutdated;
