// engine/resilience-detector/validation-detector.ts — Validation library detection (SPEC-034)
/**
 * Detects validation library in use for the given language and dependency set.
 */
export function detectValidationLibrary(deps, language) {
    const depsLower = deps.map((d) => d.toLowerCase());
    const patterns = {
        typescript: ['zod', 'joi', 'yup', 'valibot', 'ajv', 'class-validator'],
        javascript: ['zod', 'joi', 'yup', 'valibot', 'ajv'],
        python: ['pydantic', 'marshmallow', 'cerberus', 'voluptuous'],
        java: ['jakarta.validation', 'javax.validation', 'hibernate-validator', 'spring-validation'],
        go: ['go-playground/validator', 'go-ozzo/ozzo-validation', 'asaskevich/govalidator'],
        dotnet: ['FluentValidation', 'MiniValidation'],
        rust: ['validator', 'serde_valid'],
        php: ['symfony/validator', 'laravel/framework'],
    };
    const langPatterns = patterns[language] ?? patterns.typescript ?? [];
    for (const pattern of langPatterns) {
        const patternLower = pattern.toLowerCase();
        const found = depsLower.some((d) => d.includes(patternLower));
        if (found) {
            const isPydanticMigration = language === 'python' &&
                pattern === 'pydantic' &&
                depsLower.some((d) => d.includes('pydantic.v1') || d.includes('pydantic-v1'));
            return { library: pattern, version: null, isPydanticMigration };
        }
    }
    return { library: null, version: null, isPydanticMigration: false };
}
//# sourceMappingURL=validation-detector.js.map