import { EventEmitter } from 'events';
import { ASTNode, PlanState, NodeRecord, PlanConfig } from './types';
interface ExecutorDeps {
    /** Write text to the project's PTY stdin. */
    writeToPty: (text: string) => void;
    /** Get the PTY's last activity timestamp (epoch ms). */
    getLastActivity: () => number | null;
    /** Broadcast a WS event to all project clients. */
    broadcast: (event: Record<string, unknown>) => void;
}
export declare class PlanExecutor extends EventEmitter {
    private projectPath;
    private pcDir;
    private deps;
    private config;
    private state;
    private ast;
    private funcs;
    private flatNodes;
    private machineState;
    private nodeCounter;
    private currentNodeId;
    private fileWatcher;
    private pollTimer;
    private nudgeTimer;
    private idleWaitTimer;
    private nudgeCount;
    private preReplanLines;
    private pendingPause;
    /** Track if-chain matched state per chain (keyed by the `if` node's line number). */
    private ifChainMatched;
    constructor(projectPath: string, deps: ExecutorDeps, config?: Partial<PlanConfig>);
    checkSyntax(): {
        errors: {
            line: number;
            message: string;
        }[];
        ast: ASTNode[];
    };
    start(): void;
    resume(): void;
    pause(): void;
    stop(): void;
    getState(): PlanState | null;
    getNodes(): NodeRecord[];
    getNode(nodeId: string): NodeRecord | null;
    isInitialized(): boolean;
    hasMainPc(): boolean;
    private tick;
    private dispatchTask;
    private processControlFlow;
    private startFileWatch;
    private checkNodeResult;
    private processResult;
    private startNudgeTimer;
    private enterReplanning;
    private handleReplanComplete;
    tryRecoverState(): void;
    private readMainPc;
    private saveState;
    private nextNodeId;
    private getEffectiveVariables;
    private setVariable;
    private evaluateCondition;
    private findNodeAtLine;
    private flattenAst;
    private findFirstExecutableLine;
    private advanceLine;
    private checkLoopEnd;
    /** Implicit return: if current_line left the function body, pop the call frame. */
    private checkCallEnd;
    private isLoopDone;
    private updateLoopVar;
    private skipBlock;
    /** Skip to the next elif/else sibling after a failed if/elif condition. */
    private skipToNextBranch;
    private skipIfChain;
    /** Schedule cleanup of ifChainMatched entry after the if-block's last branch ends. */
    private scheduleIfChainCleanup;
    /** Find the `if` node's line that starts the chain containing this elif/else node. */
    private findChainIfLine;
    private findSiblings;
    private findBlockEndLine;
    private findNextLineAfter;
    private processInitialVarAssigns;
    private waitForIdle;
    private buildPrompt;
    private enterPaused;
    private cleanup;
    private broadcastStatus;
}
export {};
//# sourceMappingURL=executor.d.ts.map