import type { ChildTaskRecord, Item, ThreadEvidenceRecord, Turn, TurnId, VerdictRecord, WorkflowName, WorkflowPhaseName } from "@best-agent/protocol";
import type { AgentProfile } from "../agent/profile-registry.js";
import type { ConversationMessage } from "../provider/model-provider.js";
type WorkflowPhaseDefinition = {
    name: WorkflowPhaseName;
    profile: AgentProfile;
    messages: (prompt: string, phaseOutputs: Map<WorkflowPhaseName, string>) => ConversationMessage[];
};
type WorkflowDefinition = {
    summaryPrompt: string;
    steps: Array<{
        phases: WorkflowPhaseDefinition[];
        strategy: "parallel" | "sequential";
    }>;
};
type WorkflowPhaseResult = {
    childTask: ChildTaskRecord;
    childThreadId: string;
    correlationId: string;
    output: string;
    phaseName: WorkflowPhaseName;
    phaseProfile: AgentProfile;
};
type WorkflowExecutorDeps = {
    appendUnsatisfiedRootVerdict(input: {
        graphId: string;
        summary: string;
        turn: Turn;
    }): Promise<void>;
    appendSatisfiedRootVerdict(input: {
        graphId: string;
        joinedPhaseCount: number;
        supportEvidenceIds: string[];
        turn: Turn;
        workflowName: WorkflowName;
    }): Promise<void>;
    bindWorkflowRoot(turnId: TurnId, graphId: string): Promise<void>;
    buildWorkflowPhaseMessages(turn: Turn, workflowName: WorkflowName, phase: WorkflowPhaseDefinition, prompt: string): Promise<ConversationMessage[]>;
    executeWorkflowFinalSynthesis(input: {
        activeSkillIds: string[];
        hostProfile: AgentProfile;
        turn: Turn;
        workflow: WorkflowDefinition;
        workflowName: WorkflowName;
    }): Promise<{
        joinedEvidence: ThreadEvidenceRecord[];
        output: string;
    }>;
    executeWorkflowPhase(turn: Turn, hostProfile: AgentProfile, phaseProfile: AgentProfile, activeSkillIds: string[], phaseName: WorkflowPhaseName, extraMessages: ConversationMessage[], workflowName: WorkflowName): Promise<WorkflowPhaseResult>;
    executeWorkflowPhaseGroup(turn: Turn, hostProfile: AgentProfile, activeSkillIds: string[], phases: WorkflowPhaseDefinition[], prompt: string, workflowName: WorkflowName): Promise<Array<[WorkflowPhaseName, string]>>;
    getLatestWorkflowPhaseVerdict(turn: Turn, workflowName: WorkflowName, phaseName: WorkflowPhaseName): Promise<{
        childTask: ChildTaskRecord;
        verdict: VerdictRecord;
    } | undefined>;
    isTurnTerminatedError(error: unknown): boolean;
    listWorkflowPhaseChildTaskRecords(turn: Turn, workflowName: WorkflowName, phaseName: WorkflowPhaseName): Promise<ChildTaskRecord[]>;
    maxAdvancedPhaseReopens: number;
    pushItems(items: Item[]): Promise<void>;
    requireSatisfiedRootVerdict(input: {
        fallbackMessage: string;
        turn: Turn;
    }): Promise<void>;
    resolveWorkflowDefinition(workflowName: WorkflowName): WorkflowDefinition;
    verdictClosureMode: "heuristic" | "kernel";
};
export declare class WorkflowExecutor {
    #private;
    constructor(deps: WorkflowExecutorDeps);
    execute(input: {
        activeSkillIds: string[];
        hostProfile: AgentProfile;
        prompt: string;
        turn: Turn;
        workflowName: WorkflowName;
    }): Promise<string>;
}
export {};
//# sourceMappingURL=workflow-executor.d.ts.map