import { EventEmitter } from 'events';
import type { FlowDef, FlowState } from './types';
/** Injector signature — provided by the host (index.ts wires this to
 *  writeTerminalInputSplit so the runner stays decoupled from PTY plumbing). */
export type PromptInjector = (projectId: string, brackedPastePayload: string) => void;
export declare class FlowRunner extends EventEmitter {
    private active;
    private injector;
    setPromptInjector(fn: PromptInjector): void;
    start(projectId: string, folderPath: string, flowDef: FlowDef, flowFilename: string): {
        ok: boolean;
        reason?: string;
        state?: FlowState;
    };
    resume(projectId: string): boolean;
    abort(projectId: string): boolean;
    /** Resolves any pending user-input wait with the submitted form data. */
    submitUserInput(projectId: string, data: Record<string, string>): boolean;
    getState(projectId: string): FlowState | null;
    isRunning(projectId: string): boolean;
    private lastFolderPath;
    private runLoop;
    private executeNode;
    private executeUserInput;
    private executeLlm;
    private executeSystemLogic;
    /** Watch workflow_data.json for `task_progress[index].finish = true`. The
     *  LLM is told to flip this flag when its work is done. Any other write to
     *  workflow_data (variable updates, etc.) also triggers the watcher; the
     *  50ms debounce + finish-check makes that cheap. */
    private waitForTaskFinish;
    private clearWaiters;
    private persist;
    private finalize;
}
export declare const flowRunner: FlowRunner;
//# sourceMappingURL=runner.d.ts.map