import type { ChildTaskId, ChildTaskRecord, TurnId, VerdictRecord, WorkflowName, WorkflowNode, WorkflowPhaseName } from "@best-agent/protocol";
export type WorkflowGraphEdge = {
    from: WorkflowPhaseName;
    to: WorkflowPhaseName;
};
export declare function resolveWorkflowPhaseLayers(workflowName: WorkflowName): Array<Array<WorkflowPhaseName>>;
export declare function inferWorkflowNameFromPhaseResults(phaseResults: Partial<Record<WorkflowPhaseName, string>>): WorkflowName;
export declare function buildWorkflowPhaseDependencies(workflowLayers: Array<Array<WorkflowPhaseName>>): Map<WorkflowPhaseName, WorkflowPhaseName[]>;
export declare function buildWorkflowPhaseEdges(workflowLayers: Array<Array<WorkflowPhaseName>>): WorkflowGraphEdge[];
export declare function resolveReadyWorkflowPhases(input: {
    completedPhases: ReadonlySet<WorkflowPhaseName>;
    pendingPhases: ReadonlySet<WorkflowPhaseName>;
    workflowLayers: Array<Array<WorkflowPhaseName>>;
}): WorkflowPhaseName[];
export declare function resolveWorkflowNodeAllowedTools(input: {
    fallbackPhaseName: WorkflowPhaseName;
    profileName?: string;
    readProfileAllowedTools: (profileName: string) => string[] | undefined;
}): string[];
export declare function buildWorkflowChildTaskGraphNodes(input: {
    effectiveVerdicts?: ReadonlyMap<string, VerdictRecord>;
    phases: ReadonlyMap<WorkflowPhaseName, ChildTaskRecord & {
        phaseName: WorkflowPhaseName;
        workflowName: WorkflowName;
    }>;
    readProfileAllowedTools: (profileName: string) => string[] | undefined;
    statusForRecord?: (record: (ChildTaskRecord & {
        phaseName: WorkflowPhaseName;
        workflowName: WorkflowName;
    }) | undefined) => WorkflowNode["status"];
    workflowName: WorkflowName;
}): WorkflowNode[];
export declare function buildWorkflowChildTaskGraph(input: {
    effectiveVerdicts?: ReadonlyMap<string, VerdictRecord>;
    phases: ReadonlyMap<WorkflowPhaseName, ChildTaskRecord & {
        phaseName: WorkflowPhaseName;
        workflowName: WorkflowName;
    }>;
    readProfileAllowedTools: (profileName: string) => string[] | undefined;
    statusForRecord?: (record: (ChildTaskRecord & {
        phaseName: WorkflowPhaseName;
        workflowName: WorkflowName;
    }) | undefined) => WorkflowNode["status"];
    workflowName: WorkflowName;
}): {
    edges: WorkflowGraphEdge[];
    nodes: WorkflowNode[];
};
export declare function buildWorkflowPhaseResultGraph(input: {
    phaseResults: Partial<Record<WorkflowPhaseName, string>>;
    readProfileAllowedTools: (profileName: string) => string[] | undefined;
    workflowName: WorkflowName;
}): {
    edges: WorkflowGraphEdge[];
    nodes: WorkflowNode[];
};
export declare function groupWorkflowPhaseRecordsByTurn(records: ReadonlyArray<ChildTaskRecord>): Map<TurnId, Map<WorkflowPhaseName, ChildTaskRecord & {
    phaseName: WorkflowPhaseName;
    workflowName: WorkflowName;
}>>;
export declare function listWorkflowVerifyChildTaskIds(phases: ReadonlyMap<WorkflowPhaseName, ChildTaskRecord & {
    phaseName: WorkflowPhaseName;
    workflowName: WorkflowName;
}>): ChildTaskId[];
export declare function collectChildTaskEffectiveVerdicts(input: {
    childTaskIds: ReadonlyArray<ChildTaskId>;
    effectiveVerdicts: ReadonlyMap<string, VerdictRecord>;
}): Promise<Map<string, VerdictRecord>>;
export declare function collectWorkflowVerifyVerdicts(input: {
    effectiveVerdicts: ReadonlyMap<string, VerdictRecord>;
    phases: ReadonlyMap<WorkflowPhaseName, ChildTaskRecord & {
        phaseName: WorkflowPhaseName;
        workflowName: WorkflowName;
    }>;
}): Promise<Map<string, VerdictRecord>>;
export declare function collectWorkflowTurnStates(input: {
    effectiveVerdicts: ReadonlyMap<string, VerdictRecord>;
    records: ReadonlyArray<ChildTaskRecord>;
}): Promise<Array<{
    effectiveVerdicts: Map<string, VerdictRecord>;
    phases: Map<WorkflowPhaseName, ChildTaskRecord & {
        phaseName: WorkflowPhaseName;
        workflowName: WorkflowName;
    }>;
    turnId: TurnId;
    workflowName: WorkflowName;
}>>;
//# sourceMappingURL=workflow-graph.d.ts.map