import { EventEmitter } from 'events';
import { AgentPhase, StateEvent, Checkpoint, StateMachineConfig, StageResult, Finding } from '../types';
/**
 * Agent 状态机实现
 *
 * 核心职责：
 * - 状态转换管理和验证
 * - 检查点创建和恢复
 * - 持久化存储
 * - 事件钩子
 *
 * @deprecated This class is no longer used in the Agent-Driven architecture (v5.0).
 * The new architecture uses AgentRuntime with strategy/hypothesis executors
 * which manage their own lifecycle internally. Retained for potential future integration
 * with session persistence. Will be removed in v6.0.
 */
export declare class AgentStateMachine extends EventEmitter {
    private state;
    private config;
    private autoSaveTimer?;
    constructor(config: StateMachineConfig);
    get sessionId(): string;
    get traceId(): string;
    get phase(): AgentPhase;
    get currentStageIndex(): number;
    get isCompleted(): boolean;
    get isFailed(): boolean;
    get isAwaitingUser(): boolean;
    get canResume(): boolean;
    /**
     * 触发状态转换
     */
    transition(event: StateEvent): void;
    /**
     * 根据事件类型确定下一个状态
     */
    private getNextPhase;
    /**
     * 验证状态转换是否合法
     */
    private isValidTransition;
    /**
     * 创建检查点
     */
    checkpoint(stageId: string, stageResult: StageResult, findings?: Finding[]): Checkpoint;
    /**
     * 获取最新的检查点
     */
    getLatestCheckpoint(): Checkpoint | undefined;
    /**
     * 获取指定检查点
     */
    getCheckpoint(checkpointId: string): Checkpoint | undefined;
    /**
     * 从检查点恢复
     */
    restoreFromCheckpoint(checkpoint: Checkpoint): void;
    private getStageIndexFromId;
    /**
     * 增加迭代计数
     */
    incrementIteration(key: string): number;
    /**
     * 获取迭代计数
     */
    getIterationCount(key: string): number;
    /**
     * 重置迭代计数
     */
    resetIterationCount(key: string): void;
    /**
     * 序列化当前状态
     */
    private serializeState;
    /**
     * 获取总迭代次数
     */
    private getTotalIterations;
    /**
     * 持久化状态到磁盘
     */
    persist(): Promise<void>;
    /**
     * 从磁盘恢复状态
     */
    restore(): Promise<boolean>;
    /**
     * 删除持久化状态
     */
    cleanup(): Promise<void>;
    /**
     * 获取状态文件路径
     */
    private getStatePath;
    /**
     * 确保持久化目录存在
     */
    private ensurePersistPath;
    private startAutoSave;
    private stopAutoSave;
    /**
     * 获取事件历史
     */
    getEventHistory(): StateEvent[];
    /**
     * 获取阶段结果
     */
    getStageResults(): StageResult[];
    /**
     * 获取指定阶段结果
     */
    getStageResult(stageId: string): StageResult | undefined;
    /**
     * 重置状态机
     */
    reset(): void;
    /**
     * 销毁状态机
     */
    destroy(): void;
    /**
     * 创建新的状态机
     */
    static create(sessionId: string, traceId: string): AgentStateMachine;
    /**
     * 从持久化恢复状态机
     */
    static load(sessionId: string, traceId: string, persistPath?: string): Promise<AgentStateMachine | null>;
    /**
     * 列出所有可恢复的会话
     */
    static listRecoverableSessions(persistPath?: string): Promise<string[]>;
}
export default AgentStateMachine;
//# sourceMappingURL=stateMachine.d.ts.map