import type { NodeStatus } from '../types/dag.js';
export type RunStatus = 'running' | 'completed' | 'failed' | 'paused';
export interface NodeResult {
    status: NodeStatus;
    output?: string;
    structuredOutput?: Record<string, unknown>;
    durationMs?: number;
    error?: string;
    startedAt?: string;
    completedAt?: string;
}
export interface WorkflowRun {
    runId: string;
    workflow: string;
    workflowYaml?: string;
    status: RunStatus;
    args: string;
    workspacePath: string;
    artifactsPath: string;
    projectPath: string;
    branchName?: string;
    startedAt: string;
    completedAt?: string;
    nodes: Record<string, NodeResult>;
}
export interface HistoryEntry {
    runId: string;
    workflow: string;
    status: RunStatus;
    args: string;
    startedAt: string;
    completedAt: string;
    durationMs: number;
    nodeCount: number;
    failedNodes: string[];
}
export type WALEventType = 'run:create' | 'node:start' | 'node:complete' | 'node:fail' | 'node:skip' | 'node:reset' | 'run:complete' | 'run:fail';
export interface WALEvent {
    seq: number;
    ts: string;
    type: WALEventType;
    nodeId?: string;
    data?: {
        output?: string | {
            __vsaf_ref: string;
        } | {
            ref: string;
        };
        structuredOutput?: Record<string, unknown> | {
            __vsaf_ref: string;
        } | {
            ref: string;
        };
        error?: string;
        status?: NodeStatus;
        retryCount?: number;
        args?: string;
        workflow?: string;
        workflowYaml?: string;
        workspacePath?: string;
        artifactsPath?: string;
        projectPath?: string;
        branchName?: string;
        startedAt?: string;
        completedAt?: string;
        durationMs?: number;
    };
}
export interface CompactSnapshot {
    runId: string;
    workflow: string;
    workflowYaml?: string;
    status: RunStatus;
    walSeq: number;
    args: string;
    workspacePath: string;
    artifactsPath: string;
    projectPath: string;
    branchName?: string;
    startedAt: string;
    completedAt?: string;
    nodes: Record<string, {
        status: NodeStatus;
        outputRef?: string | {
            __vsaf_ref: string;
        } | {
            ref: string;
        };
        structuredOutputRef?: Record<string, unknown> | {
            __vsaf_ref: string;
        } | {
            ref: string;
        };
        startedAt?: string;
        completedAt?: string;
        error?: string;
        retryCount?: number;
    }>;
}
export declare class StorageError extends Error {
    readonly code: 'CORRUPT' | 'DISK_FULL' | 'PERMISSION' | 'NOT_FOUND';
    readonly path: string;
    readonly cause?: Error | undefined;
    constructor(message: string, code: 'CORRUPT' | 'DISK_FULL' | 'PERMISSION' | 'NOT_FOUND', path: string, cause?: Error | undefined);
}
export interface RecoveredState {
    runId: string;
    workflow: string;
    workflowYaml: string;
    args: string;
    workspacePath: string;
    artifactsPath: string;
    projectPath: string;
    branchName?: string;
    startedAt: string;
    completedAt?: string;
    runStatus?: RunStatus;
    pending: Set<string>;
    completed: Set<string>;
    failed: Set<string>;
    skipped: Set<string>;
    nodeResults: Record<string, NodeResult>;
    retryCounts: Map<string, number>;
    walSeq: number;
}
//# sourceMappingURL=types.d.ts.map