// engine/resilience-detector.ts — Orchestrator for validation, resilience, middleware & concurrency
// detection (SPEC-034). Delegates to sub-modules in ./resilience-detector/
import { detectValidationLibrary } from './resilience-detector/validation-detector.js';
import { detectConcurrencyModel, detectResilienceLibraries, } from './resilience-detector/concurrency-detector.js';
import { detectRateLimitMechanism } from './resilience-detector/ratelimit-detector.js';
import { detectMicroserviceConfig } from './resilience-detector/microservice-detector.js';
import { detectMiddlewareFrameworks } from './resilience-detector/middleware-detector.js';
export { detectValidationLibrary } from './resilience-detector/validation-detector.js';
export { detectConcurrencyModel, detectResilienceLibraries, } from './resilience-detector/concurrency-detector.js';
export { detectRateLimitMechanism } from './resilience-detector/ratelimit-detector.js';
export { detectMicroserviceConfig } from './resilience-detector/microservice-detector.js';
export { detectMiddlewareFrameworks } from './resilience-detector/middleware-detector.js';
/**
 * Main scan function: runs all detectors and returns the full profile.
 */
export async function scanResilienceProfile(projectPath, language, deps) {
    const validationResult = detectValidationLibrary(deps, language);
    const resilienceLibs = detectResilienceLibraries(deps, language);
    const concurrencyModel = detectConcurrencyModel(language, deps);
    const rateLimitResult = await detectRateLimitMechanism(projectPath, deps);
    const middlewareResult = detectMiddlewareFrameworks(deps, language);
    const microserviceResult = await detectMicroserviceConfig(projectPath, deps);
    return {
        validationLibrary: validationResult.library,
        validationLibraryVersion: validationResult.version,
        concurrencyModel,
        resilienceLibraries: resilienceLibs.map((l) => l.name),
        rateLimitMechanism: rateLimitResult.mechanism,
        rateLimitAlgorithm: rateLimitResult.algorithm,
        rateLimitDistributed: rateLimitResult.distributed,
        middlewareFrameworks: middlewareResult.frameworks,
        middlewareChain: middlewareResult.typicalChain,
        ...microserviceResult,
    };
}
//# sourceMappingURL=resilience-detector.js.map