export type WorkflowStepStatus = "pending" | "running" | "success" | "failed";
export type WorkflowStatus = "pending" | "running" | "success" | "failed";
export interface WorkflowTokenUsage {
    source: "measured" | "estimated" | "mixed" | "none";
    measuredTokens: number | null;
    estimatedTokens: number | null;
    note: string;
}
export interface WorkflowStepResult {
    ok: boolean | null;
    summary: string | null;
    validation: string | null;
    failureReason: string | null;
    suggestedFix: string | null;
    retryCommand: string | null;
}
export interface WorkflowStep {
    stepId: string;
    action: string;
    status: WorkflowStepStatus;
    input: string | null;
    expectedOutput: string | null;
    output: string | null;
    validation: string | null;
    failureReason: string | null;
    attemptCount: number;
    retryCount: number;
    files: string[];
    skillsApplied: string[];
    tokenUsage: WorkflowTokenUsage;
    result: WorkflowStepResult;
    updatedAt: string | null;
}
export interface WorkflowState {
    artifactType: "kiwi-control/workflow";
    version: 3;
    timestamp: string;
    task: string | null;
    status: WorkflowStatus;
    currentStepId: string | null;
    steps: WorkflowStep[];
}
export interface WorkflowProgressEntry {
    task: string | null;
    eventType: string;
    status: "ok" | "warn" | "error";
    summary: string;
    input?: string | null;
    expectedOutput?: string | null;
    validation?: string | null;
    failureReason?: string | null;
    files?: string[];
    skillsApplied?: string[];
    measuredTokens?: number | null;
    estimatedTokens?: number | null;
}
export interface WorkflowExecutionOptions<Result> {
    task: string | null;
    stepId: WorkflowStep["stepId"];
    input: string | null;
    expectedOutput: string | null;
    run: () => Promise<Result>;
    validate: (result: Result) => Promise<{
        ok: boolean;
        validation: string;
        failureReason?: string | null;
        suggestedFix?: string | null;
    }> | {
        ok: boolean;
        validation: string;
        failureReason?: string | null;
        suggestedFix?: string | null;
    };
    summarize: (result: Result) => {
        summary: string;
        files?: string[];
        skillsApplied?: string[];
        measuredTokens?: number | null;
        estimatedTokens?: number | null;
    };
}
export declare function loadWorkflowState(targetRoot: string): Promise<WorkflowState>;
export declare function initializeWorkflow(targetRoot: string, task: string | null): Promise<WorkflowState>;
export declare function startWorkflowStep(targetRoot: string, options: {
    task: string | null;
    stepId: WorkflowStep["stepId"];
    input: string | null;
    expectedOutput?: string | null;
}): Promise<WorkflowState>;
export declare function completeWorkflowStep(targetRoot: string, options: {
    task: string | null;
    stepId: WorkflowStep["stepId"];
    output: string;
    validation: string;
    files?: string[];
    skillsApplied?: string[];
    measuredTokens?: number | null;
    estimatedTokens?: number | null;
}): Promise<WorkflowState>;
export declare function failWorkflowStep(targetRoot: string, options: {
    task: string | null;
    stepId: WorkflowStep["stepId"];
    failureReason: string;
    validation: string;
    suggestedFix?: string | null;
    files?: string[];
    skillsApplied?: string[];
    measuredTokens?: number | null;
    estimatedTokens?: number | null;
}): Promise<WorkflowState>;
export declare function executeWorkflowStep<Result>(targetRoot: string, options: WorkflowExecutionOptions<Result>): Promise<{
    ok: boolean;
    result: Result | null;
    state: WorkflowState;
    validation: string;
    failureReason: string | null;
    suggestedFix: string | null;
    retryCommand: string | null;
}>;
export declare function recordWorkflowProgress(targetRoot: string, entry: WorkflowProgressEntry): Promise<WorkflowState>;
export declare function persistWorkflowState(targetRoot: string, state: WorkflowState): Promise<string>;
//# sourceMappingURL=workflow-engine.d.ts.map