import type { ApprovalPolicy, RunResult, RunState, TaskResult, TaskRunner } from "../contracts/orchestration.js";
import type { OmkRuntimeScope } from "../contracts/worker-context.js";
import { type HarnessTaskRunnerMode, type HarnessTaskRunnerOptions, type HarnessTaskRunnerProviderOptions } from "../harness/create-harness-task-runner.js";
import type { InputEnvelope } from "../input/input-envelope.js";
import type { ProviderPolicy } from "../providers/types.js";
import type { EnsemblePolicy } from "./ensemble.js";
import type { DagNode } from "./dag.js";
import type { DagCompileResult } from "./dag-compiler-types.js";
import { type PersistLoopArtifactsResult } from "./loop-artifacts.js";
import type { LoopDecision, OrchestrationLoopState } from "./loop-state.js";
export interface ExecuteCompiledDagLoopOptions {
    persist?: boolean;
    requestedAction?: "continue" | "replan" | "verify";
    iteration?: number;
    maxIterations?: number;
    parentRunId?: string;
    nextInputEnvelope?: InputEnvelope;
    now?: () => Date;
}
export interface ExecuteCompiledDagInput {
    root: string;
    compiled: DagCompileResult;
    runId?: string;
    providerPolicy?: ProviderPolicy;
    model?: string;
    mcpScope?: OmkRuntimeScope;
    skillsScope?: OmkRuntimeScope;
    hooksScope?: OmkRuntimeScope;
    env?: Record<string, string>;
    mode?: HarnessTaskRunnerMode;
    approvalPolicy?: ApprovalPolicy;
    timeoutPreset?: string;
    nodeTimeoutMs?: number;
    runTimeoutMs?: number;
    heartbeatIntervalMs?: number;
    signal?: AbortSignal;
    eventRunDir?: string;
    ensemble?: false | EnsemblePolicy;
    resumeFromState?: RunState;
    useRuntimeBacked?: boolean;
    runner?: TaskRunner;
    providerOptions?: HarnessTaskRunnerProviderOptions;
    runtimeOptions?: HarnessTaskRunnerOptions["runtimeOptions"];
    factories?: HarnessTaskRunnerOptions["factories"];
    loop?: ExecuteCompiledDagLoopOptions;
    onStateChange?: (state: RunState) => void;
    onNodeStart?: (node: DagNode) => void;
    onNodeComplete?: (node: DagNode, result: TaskResult) => void;
}
export interface ExecuteCompiledDagResult {
    run: RunResult;
    loopDecision: LoopDecision;
    loopState: OrchestrationLoopState;
    loopArtifacts?: PersistLoopArtifactsResult;
}
export declare function executeCompiledDag(input: ExecuteCompiledDagInput): Promise<ExecuteCompiledDagResult>;
