// dispatchers/distributed-dispatcher.ts — Event, Concurrency, Pact, Microservices dispatches
import { isEventProject, generateEventTestDefs, generateEventTestFiles, } from '../generators/event-test-generator.js';
import { isConcurrencyProject, isMicroserviceProject, generateConcurrencyTestDefs, generateConcurrencyTestFiles, generatePactTestDefs, generatePactTestFiles, } from '../generators/concurrency-test-generator.js';
import { isMicroservicesTestProject, generateMicroservicesTestDefs, generateMicroservicesTestFiles, } from '../generators/microservices/index.js';
export function dispatchDistributed(spec, knowledge, testDir, testFramework, slug, autoGenerate, testExt, unitTests, integrationTests, testFiles) {
    if (isEventProject(knowledge)) {
        const eventDefs = generateEventTestDefs(spec.title, testDir, knowledge);
        unitTests.push(...eventDefs.filter((d) => d.type === 'unit'));
        integrationTests.push(...eventDefs.filter((d) => d.type === 'integration'));
        testFiles.push(...generateEventTestFiles(spec, testDir, testFramework, knowledge.language, knowledge, autoGenerate));
    }
    if (isConcurrencyProject(knowledge)) {
        const concurrencyDefs = generateConcurrencyTestDefs(spec.title, testDir, knowledge.language);
        unitTests.push(...concurrencyDefs.filter((d) => d.type === 'unit'));
        integrationTests.push(...concurrencyDefs.filter((d) => d.type === 'integration'));
        testFiles.push(...generateConcurrencyTestFiles(spec, testDir, testFramework, knowledge.language, knowledge, autoGenerate));
    }
    if (isMicroserviceProject(knowledge)) {
        integrationTests.push(...generatePactTestDefs(spec.title, testDir));
        testFiles.push(...generatePactTestFiles(spec, testDir, testFramework, knowledge.language, autoGenerate));
    }
    // SPEC-058b: Microservices & Distributed Systems
    if (isMicroservicesTestProject(knowledge)) {
        const msDefs = generateMicroservicesTestDefs(spec.title, testDir, testExt, knowledge);
        integrationTests.push(...msDefs);
        testFiles.push(...generateMicroservicesTestFiles({ title: spec.title, slug }, testDir, testFramework, knowledge.language, testExt, autoGenerate, knowledge));
    }
}
//# sourceMappingURL=distributed-dispatcher.js.map