import type { WorkflowDefinition } from '../domain/definition.js';
import type { WorkflowEventEnvelope } from '../domain/event.js';
import type { WorkflowRunSource, WorkflowRunView } from '../domain/run.js';
import { WorkflowEventStore } from '../store/event-store.js';
import { WorkflowRunStore } from '../store/run-store.js';
import type { Api, Model } from '@earendil-works/pi-ai';
import type { WorkflowScriptSubagentRunner } from '../runtime/script-runtime.js';
export interface WorkflowEngineOptions {
    cwd: string;
    eventStore: WorkflowEventStore;
    runStore: WorkflowRunStore;
    runner: WorkflowScriptSubagentRunner;
    onEventAppended?: (event: WorkflowEventEnvelope) => void;
    onRunViewUpdated?: (view: WorkflowRunView) => void;
    resolveModelId?: (modelId: string) => Model<Api>;
}
export interface StartWorkflowRunOptions {
    input?: unknown;
    source: WorkflowRunSource;
    goal?: string;
    runId?: string;
    signal?: AbortSignal;
    concurrency?: number;
    maxSubagents?: number;
    tokenBudget?: number | null;
}
export declare class WorkflowEngine {
    private readonly options;
    constructor(options: WorkflowEngineOptions);
    startRun(definition: WorkflowDefinition, options: StartWorkflowRunOptions): Promise<WorkflowRunView>;
}
