// Planu — Multi-Agent Review Orchestrator (SPEC-483)
// Runs 3 rule-based analyzers in parallel via Promise.all, merges and ranks findings.
import { runDesignAnalyzer } from '../../engine/multi-agent-review/design-analyzer.js';
import { runSecurityAnalyzer } from '../../engine/multi-agent-review/security-analyzer.js';
import { runTestingAnalyzer } from '../../engine/multi-agent-review/testing-analyzer.js';
import { mergeFindings } from '../../engine/multi-agent-review/finding-merger.js';
import { rankFindings, buildReport } from '../../engine/multi-agent-review/severity-ranker.js';
/**
 * Orchestrates the three internal analyzers, merges their findings,
 * and returns a ranked MARReport ready for rendering.
 */
export async function runMultiAgentReview(input) {
    const { projectPath, files } = input;
    // Run all three analyzers in parallel
    const [designResult, securityResult, testingResult] = await Promise.all([
        runDesignAnalyzer(projectPath, files),
        runSecurityAnalyzer(projectPath, files),
        runTestingAnalyzer(projectPath, files),
    ]);
    const merged = mergeFindings([designResult, securityResult, testingResult]);
    const ranked = rankFindings(merged);
    // Collect scanned files (unique, from all domains)
    const scannedSet = new Set(ranked.map((f) => f.file));
    const scannedFiles = [...scannedSet].sort();
    return buildReport(ranked, scannedFiles);
}
//# sourceMappingURL=orchestrator.js.map