import { CodeBuddyToolCall } from "../codebuddy/client.js";
import { EventEmitter } from "events";
import { ToolResult } from "../types/index.js";
export interface SubagentConfig {
    name: string;
    description: string;
    systemPrompt: string;
    tools?: string[];
    model?: string;
    maxRounds?: number;
    timeout?: number;
}
export interface SubagentResult {
    success: boolean;
    output: string;
    toolsUsed: string[];
    rounds: number;
    duration: number;
}
export declare const PREDEFINED_SUBAGENTS: Record<string, SubagentConfig>;
export declare class Subagent extends EventEmitter {
    private client;
    private config;
    private isRunning;
    private startTime;
    constructor(apiKey: string, config: SubagentConfig, baseURL?: string);
    run(task: string, context?: string, tools?: import("../codebuddy/client.js").CodeBuddyTool[], executeTool?: (toolCall: CodeBuddyToolCall) => Promise<ToolResult>, options?: {
        progressCallback?: (round: number, maxRounds: number) => void;
        sharedContext?: Map<string, string>;
    }): Promise<SubagentResult>;
    stop(): void;
    getConfig(): SubagentConfig;
}
export declare class SubagentManager {
    private apiKey;
    private baseURL?;
    private runningAgents;
    private customConfigs;
    constructor(apiKey: string, baseURL?: string);
    registerSubagent(config: SubagentConfig): void;
    getAvailableSubagents(): string[];
    getSubagentConfig(name: string): SubagentConfig | null;
    createSubagent(name: string): Subagent | null;
    spawn(name: string, task: string, options?: {
        context?: string;
        tools?: import("../codebuddy/client.js").CodeBuddyTool[];
        executeTool?: (toolCall: CodeBuddyToolCall) => Promise<ToolResult>;
    }): Promise<SubagentResult>;
    stopAll(): void;
    formatAvailableSubagents(): string;
}
export interface ParallelTask {
    id: string;
    agentType: string;
    task: string;
    context?: string;
    priority?: number;
}
export interface ParallelExecutionOptions {
    maxConcurrent?: number;
    batchSize?: number;
    stopOnFirstError?: boolean;
    timeout?: number;
    onProgress?: (completed: number, total: number, result: SubagentResult) => void;
}
export interface ParallelExecutionResult {
    success: boolean;
    results: Map<string, SubagentResult>;
    totalDuration: number;
    completedCount: number;
    failedCount: number;
    errors: string[];
}
/**
 * Parallel Subagent Runner - Execute multiple subagents concurrently
 * Inspired by Claude Code's parallel subagent execution (max 10 concurrent)
 */
export declare class ParallelSubagentRunner extends EventEmitter {
    private manager;
    private maxConcurrent;
    private queue;
    private isRunning;
    constructor(manager: SubagentManager, maxConcurrent?: number);
    /**
     * Run multiple subagents in parallel with batching
     */
    runParallel(tasks: ParallelTask[], options?: ParallelExecutionOptions, sharedOptions?: {
        tools?: import("../codebuddy/client.js").CodeBuddyTool[];
        executeTool?: (toolCall: CodeBuddyToolCall) => Promise<ToolResult>;
    }): Promise<ParallelExecutionResult>;
    /**
     * Run tasks with different agent types exploring different aspects
     * Useful for codebase exploration with multiple specialized agents
     */
    exploreParallel(baseTask: string, agentTypes: string[], options?: ParallelExecutionOptions, sharedOptions?: {
        tools?: import("../codebuddy/client.js").CodeBuddyTool[];
        executeTool?: (toolCall: CodeBuddyToolCall) => Promise<ToolResult>;
    }): Promise<ParallelExecutionResult>;
    /**
     * Stop all running tasks
     */
    stop(): void;
    /**
     * Get current status
     */
    getStatus(): {
        isRunning: boolean;
        queueLength: number;
    };
    private chunk;
    formatResults(result: ParallelExecutionResult): string;
}
export declare function getSubagentManager(apiKey: string, baseURL?: string): SubagentManager;
export declare function getParallelSubagentRunner(apiKey: string, baseURL?: string, maxConcurrent?: number): ParallelSubagentRunner;
export declare function resetParallelRunner(): void;
