/**
 * Workflow State Manager - Persists and manages workflow state
 */
import type { WorkflowStatus, WorkflowState } from './types.js';
export declare class WorkflowStateManager {
    private statesDir;
    private states;
    constructor(statesDir?: string);
    /**
     * Ensure the states directory exists
     */
    private ensureDir;
    /**
     * Load existing states from disk
     */
    private loadStates;
    /**
     * Serialize state for storage
     */
    private serializeState;
    /**
     * Deserialize state from storage
     */
    private deserializeState;
    /**
     * Generate unique instance ID
     */
    generateInstanceId(): string;
    /**
     * Create a new workflow state
     */
    createState(workflowId: string, initialContext?: Record<string, unknown>): WorkflowState;
    /**
     * Get a workflow state by instance ID
     */
    getState(instanceId: string): WorkflowState | undefined;
    /**
     * Update a workflow state
     */
    updateState(instanceId: string, updates: Partial<WorkflowState>): WorkflowState | undefined;
    /**
     * Save state to disk
     */
    saveState(state: WorkflowState): void;
    /**
     * Delete a workflow state
     */
    deleteState(instanceId: string): boolean;
    /**
     * Get all states
     */
    getAllStates(): WorkflowState[];
    /**
     * Get states by workflow ID
     */
    getStatesByWorkflow(workflowId: string): WorkflowState[];
    /**
     * Get states by status
     */
    getStatesByStatus(status: WorkflowStatus): WorkflowState[];
    /**
     * Clear completed states
     */
    clearCompleted(): number;
    /**
     * Get statistics
     */
    getStats(): {
        total: number;
        pending: number;
        running: number;
        paused: number;
        completed: number;
        failed: number;
        cancelled: number;
    };
}
