/**
 * Advanced Parallel Executor
 *
 * Supports up to 8+ agents running simultaneously with:
 * - Git worktree isolation
 * - Remote machine execution
 * - Automatic conflict prevention
 * - Intelligent result merging
 *
 * Inspired by Cursor 2.0's parallel agent system.
 */
import { EventEmitter } from 'events';
export interface ParallelAgentConfig {
    id: string;
    name: string;
    task: string;
    workdir?: string;
    model?: string;
    maxTokens?: number;
    timeout?: number;
    isolated?: boolean;
    priority?: number;
}
export interface AgentResult {
    agentId: string;
    task: string;
    success: boolean;
    output: string;
    error?: string;
    duration: number;
    tokensUsed: number;
    filesModified: string[];
    worktree?: string;
}
export interface ParallelExecutionConfig {
    maxConcurrent: number;
    useWorktrees: boolean;
    useRemoteMachines: boolean;
    remoteMachines?: string[];
    conflictResolution: 'first' | 'merge' | 'manual' | 'smart';
    timeout: number;
    workspaceRoot: string;
}
export interface WorktreeInfo {
    path: string;
    branch: string;
    agentId: string;
    created: Date;
}
/**
 * Advanced Parallel Agent Executor
 */
export declare class AdvancedParallelExecutor extends EventEmitter {
    private config;
    private activeAgents;
    private worktrees;
    private results;
    private agentCounter;
    constructor(config?: Partial<ParallelExecutionConfig>);
    /**
     * Execute multiple agents in parallel
     */
    executeParallel(tasks: ParallelAgentConfig[]): Promise<AgentResult[]>;
    /**
     * Execute a batch of agents
     */
    private executeBatch;
    /**
     * Execute a single agent
     */
    private executeAgent;
    /**
     * Run agent task (mock implementation - integrate with actual agent)
     */
    private runAgentTask;
    /**
     * Prepare git worktrees for isolated execution
     */
    private prepareWorktrees;
    /**
     * Cleanup worktrees after execution
     */
    private cleanupWorktrees;
    /**
     * Resolve conflicts between agent results
     */
    private resolveConflicts;
    /**
     * Resolve conflicts by taking first agent's changes
     */
    private resolveByFirst;
    /**
     * Resolve conflicts by merging changes
     */
    private resolveByMerge;
    /**
     * Smart conflict resolution
     */
    private resolveSmartly;
    /**
     * Execute a shell command
     */
    private executeCommand;
    /**
     * Create batches of tasks
     */
    private createBatches;
    /**
     * Get active agents
     */
    getActiveAgents(): string[];
    /**
     * Get results
     */
    getResults(): Map<string, AgentResult>;
    /**
     * Cancel an agent
     */
    cancelAgent(agentId: string): boolean;
    /**
     * Cancel all agents
     */
    cancelAll(): number;
    /**
     * Format results for display
     */
    formatResults(results: AgentResult[]): string;
    /**
     * Update configuration
     */
    updateConfig(config: Partial<ParallelExecutionConfig>): void;
    /**
     * Get configuration
     */
    getConfig(): ParallelExecutionConfig;
}
export declare function getAdvancedParallelExecutor(config?: Partial<ParallelExecutionConfig>): AdvancedParallelExecutor;
export declare function resetAdvancedParallelExecutor(): void;
