/**
 * InteractiveOrchestrator — 대화형 병렬 서브에이전트 오케스트레이터
 *
 * Goal을 입력받아 병렬 서브에이전트를 소환하고,
 * 각 에이전트에게 skills, hooks, MCP를 부여하며 총 관리합니다.
 *
 * Pipeline:
 *   Goal → Decompose → Assign Capabilities → Confirm → Spawn Parallel → Monitor → Merge
 */
import { EventEmitter } from "events";
export type SubAgentRole = "coder" | "reviewer" | "tester" | "researcher" | "planner" | "explorer" | "security" | "architect" | "integrator" | "debugger";
export interface SubAgentSpec {
    /** 고유 에이전트 ID */
    readonly id: string;
    /** 에이전트 이름 (사람이 읽을 수 있는) */
    readonly name: string;
    /** 역할 */
    readonly role: SubAgentRole;
    /** 할당된 skills */
    readonly skills: readonly string[];
    /** 할당된 MCP servers */
    readonly mcpServers: readonly string[];
    /** 할당된 hooks */
    readonly hooks: readonly string[];
    /** 할당된 tools */
    readonly tools: readonly string[];
    /** 이 에이전트가 수행할 작업 설명 */
    readonly task: string;
    /** 의존하는 다른 에이전트 ID */
    readonly dependsOn: readonly string[];
    /** 타임아웃 (ms) */
    readonly timeoutMs?: number;
    /** 실패 시 재시도 횟수 */
    readonly maxRetries?: number;
    /** 실패 시 정책 */
    readonly failurePolicy?: "block" | "skip" | "warn";
    /** 읽기 전용 여부 */
    readonly readOnly?: boolean;
    /** provider 우선순위 */
    readonly provider?: string;
    /** 모델 지정 */
    readonly model?: string;
}
export interface OrchestratorGoal {
    /** Goal 설명 */
    readonly description: string;
    /** 성공 기준 */
    readonly successCriteria?: readonly string[];
    /** 제약 조건 */
    readonly constraints?: readonly string[];
    /** 예상 산출물 */
    readonly expectedArtifacts?: readonly string[];
    /** 최대 워커 수 */
    readonly maxWorkers?: number;
    /** 타임아웃 (ms) */
    readonly timeoutMs?: number;
    /** 실행 전략 */
    readonly strategy?: "parallel" | "sequential" | "auto";
}
export type OrchestrationPhase = "analyzing" | "decomposing" | "assigning" | "confirming" | "spawning" | "running" | "merging" | "completed" | "failed";
export interface SubAgentState {
    readonly spec: SubAgentSpec;
    status: "pending" | "running" | "done" | "failed" | "skipped";
    startedAt?: string;
    completedAt?: string;
    output?: string;
    error?: string;
    tokenUsage?: {
        input: number;
        output: number;
    };
}
export interface InteractiveOrchestrationState {
    readonly goal: OrchestratorGoal;
    phase: OrchestrationPhase;
    readonly subAgents: SubAgentState[];
    readonly runId: string;
    startedAt: string;
    completedAt?: string;
    error?: string;
    progress: {
        completed: number;
        total: number;
        percentage: number;
    };
}
export interface InteractiveOrchestratorEvents {
    phase: (phase: OrchestrationPhase) => void;
    subagent_spawned: (agent: SubAgentState) => void;
    subagent_completed: (agent: SubAgentState) => void;
    subagent_failed: (agent: SubAgentState) => void;
    progress: (state: InteractiveOrchestrationState) => void;
    log: (message: string, level: "info" | "warn" | "error") => void;
    confirm_required: (agents: readonly SubAgentSpec[]) => Promise<boolean>;
}
export declare class InteractiveOrchestrator extends EventEmitter {
    private readonly goal;
    private readonly options;
    private state;
    private dag?;
    private orchestrator?;
    constructor(goal: OrchestratorGoal, options?: {
        readonly cwd?: string;
        readonly runId?: string;
        readonly autoConfirm?: boolean;
        readonly dryRun?: boolean;
        readonly onConfirm?: (agents: readonly SubAgentSpec[]) => Promise<boolean>;
    });
    execute(): Promise<InteractiveOrchestrationState>;
    private decomposeGoal;
    private assignCapabilities;
    private confirmExecution;
    private buildDag;
    private executeParallel;
    private mergeResults;
    private setPhase;
    private defaultRoles;
    private defaultSkillsForRole;
    private defaultMcpForRole;
    private defaultHooksForRole;
    private defaultToolsForRole;
    private capabilitiesForRole;
    getState(): Readonly<InteractiveOrchestrationState>;
    getSubAgents(): readonly SubAgentState[];
    getPhase(): OrchestrationPhase;
}
export declare function createInteractiveOrchestrator(goal: OrchestratorGoal, options?: {
    readonly cwd?: string;
    readonly runId?: string;
    readonly autoConfirm?: boolean;
    readonly dryRun?: boolean;
    readonly onConfirm?: (agents: readonly SubAgentSpec[]) => Promise<boolean>;
}): InteractiveOrchestrator;
export declare function formatSubAgentPlan(specs: readonly SubAgentSpec[]): string;
