/**
 * Pre-defined orchestration strategies for common development tasks
 */
export class OrchestrationStrategies {
    static FEATURE_DEVELOPMENT = {
        name: 'Feature Development',
        description: 'Complete feature development with TDD approach',
        applicableFor: ['new-feature', 'enhancement', 'bug-fix'],
        steps: [
            {
                name: 'Requirements Analysis',
                agents: ['primary', 'researcher'],
                parallel: false,
                actions: [
                    'analyze_requirements',
                    'identify_dependencies',
                    'create_technical_spec',
                ],
            },
            {
                name: 'Test Design',
                agents: ['tester', 'coder'],
                parallel: false,
                actions: [
                    'design_test_cases',
                    'write_failing_tests',
                    'validate_test_coverage',
                ],
            },
            {
                name: 'Implementation',
                agents: ['coder'],
                parallel: false,
                actions: [
                    'implement_feature',
                    'run_tests',
                    'fix_failing_tests',
                ],
            },
            {
                name: 'Review and Documentation',
                agents: ['reviewer', 'documenter'],
                parallel: true,
                actions: [
                    'review_code',
                    'suggest_improvements',
                    'write_documentation',
                    'create_examples',
                ],
            },
        ],
    };
    static CODE_REFACTORING = {
        name: 'Code Refactoring',
        description: 'Safely refactor code with comprehensive testing',
        applicableFor: ['refactor', 'optimization', 'cleanup'],
        steps: [
            {
                name: 'Analysis',
                agents: ['researcher', 'reviewer'],
                parallel: true,
                actions: [
                    'analyze_current_code',
                    'identify_code_smells',
                    'measure_complexity',
                    'find_duplications',
                ],
            },
            {
                name: 'Test Coverage',
                agents: ['tester'],
                parallel: false,
                actions: [
                    'check_existing_tests',
                    'write_missing_tests',
                    'ensure_full_coverage',
                ],
            },
            {
                name: 'Refactoring',
                agents: ['coder', 'reviewer'],
                parallel: false,
                actions: [
                    'plan_refactoring_steps',
                    'refactor_incrementally',
                    'run_tests_after_each_change',
                    'review_changes',
                ],
            },
            {
                name: 'Validation',
                agents: ['tester', 'reviewer'],
                parallel: true,
                actions: [
                    'run_full_test_suite',
                    'performance_comparison',
                    'final_review',
                ],
            },
        ],
    };
    static BUG_INVESTIGATION = {
        name: 'Bug Investigation',
        description: 'Systematic bug investigation and fixing',
        applicableFor: ['bug', 'issue', 'error'],
        steps: [
            {
                name: 'Reproduction',
                agents: ['researcher', 'tester'],
                parallel: false,
                actions: [
                    'understand_bug_report',
                    'reproduce_issue',
                    'document_steps_to_reproduce',
                ],
            },
            {
                name: 'Root Cause Analysis',
                agents: ['coder', 'researcher'],
                parallel: true,
                actions: [
                    'trace_execution_path',
                    'analyze_logs',
                    'identify_root_cause',
                    'check_related_code',
                ],
            },
            {
                name: 'Fix Development',
                agents: ['tester', 'coder'],
                parallel: false,
                actions: [
                    'write_failing_test',
                    'implement_fix',
                    'verify_test_passes',
                    'check_no_regressions',
                ],
            },
            {
                name: 'Verification',
                agents: ['tester', 'reviewer', 'documenter'],
                parallel: true,
                actions: [
                    'test_edge_cases',
                    'review_fix',
                    'update_documentation',
                    'document_root_cause',
                ],
            },
        ],
    };
    static API_DESIGN = {
        name: 'API Design',
        description: 'Design and implement a new API endpoint',
        applicableFor: ['api', 'endpoint', 'interface'],
        steps: [
            {
                name: 'Design Phase',
                agents: ['primary', 'researcher'],
                parallel: false,
                actions: [
                    'gather_requirements',
                    'design_api_contract',
                    'plan_data_models',
                    'consider_security',
                ],
            },
            {
                name: 'Contract Testing',
                agents: ['tester'],
                parallel: false,
                actions: [
                    'write_contract_tests',
                    'test_request_validation',
                    'test_response_format',
                ],
            },
            {
                name: 'Implementation',
                agents: ['coder', 'tester'],
                parallel: false,
                actions: [
                    'implement_endpoint',
                    'implement_validation',
                    'implement_business_logic',
                    'run_contract_tests',
                ],
            },
            {
                name: 'Documentation and Review',
                agents: ['documenter', 'reviewer'],
                parallel: true,
                actions: [
                    'generate_api_docs',
                    'create_usage_examples',
                    'security_review',
                    'performance_review',
                ],
            },
        ],
    };
    static PERFORMANCE_OPTIMIZATION = {
        name: 'Performance Optimization',
        description: 'Identify and fix performance bottlenecks',
        applicableFor: ['performance', 'optimization', 'speed'],
        steps: [
            {
                name: 'Profiling',
                agents: ['researcher', 'coder'],
                parallel: true,
                actions: [
                    'profile_application',
                    'identify_bottlenecks',
                    'measure_baseline_metrics',
                    'analyze_resource_usage',
                ],
            },
            {
                name: 'Test Setup',
                agents: ['tester'],
                parallel: false,
                actions: [
                    'write_performance_tests',
                    'setup_benchmarks',
                    'document_current_performance',
                ],
            },
            {
                name: 'Optimization',
                agents: ['coder', 'reviewer'],
                parallel: false,
                actions: [
                    'implement_optimizations',
                    'measure_improvements',
                    'ensure_correctness',
                    'review_changes',
                ],
            },
            {
                name: 'Validation',
                agents: ['tester', 'documenter'],
                parallel: true,
                actions: [
                    'run_regression_tests',
                    'compare_performance_metrics',
                    'document_improvements',
                    'update_performance_guidelines',
                ],
            },
        ],
    };
    static SECURITY_AUDIT = {
        name: 'Security Audit',
        description: 'Comprehensive security review and fixes',
        applicableFor: ['security', 'audit', 'vulnerability'],
        steps: [
            {
                name: 'Security Scan',
                agents: ['researcher', 'reviewer'],
                parallel: true,
                actions: [
                    'run_security_scanners',
                    'check_dependencies',
                    'review_auth_mechanisms',
                    'check_data_validation',
                ],
            },
            {
                name: 'Vulnerability Analysis',
                agents: ['reviewer', 'coder'],
                parallel: false,
                actions: [
                    'analyze_findings',
                    'prioritize_vulnerabilities',
                    'plan_fixes',
                    'assess_impact',
                ],
            },
            {
                name: 'Security Fixes',
                agents: ['coder', 'tester'],
                parallel: false,
                actions: [
                    'write_security_tests',
                    'implement_fixes',
                    'verify_vulnerabilities_fixed',
                    'test_no_functionality_broken',
                ],
            },
            {
                name: 'Documentation',
                agents: ['documenter', 'reviewer'],
                parallel: true,
                actions: [
                    'document_security_measures',
                    'update_security_guidelines',
                    'create_security_checklist',
                    'final_security_review',
                ],
            },
        ],
    };
    /**
     * Get a strategy by name
     */
    static getStrategy(name) {
        const strategies = [
            this.FEATURE_DEVELOPMENT,
            this.CODE_REFACTORING,
            this.BUG_INVESTIGATION,
            this.API_DESIGN,
            this.PERFORMANCE_OPTIMIZATION,
            this.SECURITY_AUDIT,
        ];
        return strategies.find(s => s.name.toLowerCase() === name.toLowerCase());
    }
    /**
     * Get strategies applicable for a given task type
     */
    static getApplicableStrategies(taskType) {
        const strategies = [
            this.FEATURE_DEVELOPMENT,
            this.CODE_REFACTORING,
            this.BUG_INVESTIGATION,
            this.API_DESIGN,
            this.PERFORMANCE_OPTIMIZATION,
            this.SECURITY_AUDIT,
        ];
        return strategies.filter(s => s.applicableFor.some(type => taskType.toLowerCase().includes(type.toLowerCase())));
    }
}
//# sourceMappingURL=strategies.js.map