/**
 * Workflow Executor for MSSCI-12084
 *
 * Implements /workflow start, resume, and status commands for stepped workflows.
 * Coordinates step loading, session state tracking, and progress reporting.
 */
import { WorkflowState } from './session-state.js';
import { ParsedStep } from './step-parser.js';
/**
 * Workflow definition loaded from YAML
 */
export interface WorkflowDefinition {
    /** Workflow name/identifier */
    name: string;
    /** Workflow type: stepped or phased */
    type: 'stepped' | 'phased';
    /** Optional description */
    description?: string;
    /** Step file configuration */
    steps: {
        /** Base path for step files */
        path: string;
        /** Glob pattern for step files (default: step-*.md) */
        pattern?: string;
    };
    /** Tri-modal configuration */
    modes?: {
        /** Default mode when not specified */
        default?: 'create' | 'validate' | 'edit';
        /** Available modes */
        available?: ('create' | 'validate' | 'edit')[];
    };
    /** Variables for step content resolution */
    variables?: Record<string, string>;
    /** Gate configuration */
    gates?: {
        /** Step numbers after which gates occur */
        after_steps?: number[];
    };
    /** Total number of steps in workflow */
    totalSteps?: number;
}
/**
 * Result of starting a workflow
 */
export interface StartResult {
    success: boolean;
    /** Initialized workflow state */
    state?: WorkflowState;
    /** First step content (resolved) */
    step?: ParsedStep;
    /** Updated session content */
    sessionContent?: string;
    /** Error message if failed */
    error?: string;
}
/**
 * Result of resuming a workflow
 */
export interface ResumeResult {
    success: boolean;
    /** Current workflow state */
    state?: WorkflowState;
    /** Next step to execute */
    step?: ParsedStep;
    /** Whether workflow is already complete */
    isComplete?: boolean;
    /** Error message if failed */
    error?: string;
}
/**
 * Workflow status information
 */
export interface WorkflowStatus {
    /** Workflow name */
    name: string;
    /** Workflow type */
    type: 'stepped' | 'phased';
    /** Current mode if tri-modal */
    mode?: 'create' | 'validate' | 'edit';
    /** Current step number */
    currentStep: number;
    /** Total steps in workflow */
    totalSteps: number;
    /** Array of completed step numbers */
    stepsCompleted: number[];
    /** Completion percentage (0-100) */
    completionPercent: number;
    /** Workflow status */
    status: 'in_progress' | 'completed' | 'paused';
    /** When workflow started */
    started: string;
    /** Last update timestamp */
    lastUpdated: string;
}
/**
 * Result of getting workflow status
 */
export interface StatusResult {
    success: boolean;
    /** Workflow status if found */
    status?: WorkflowStatus;
    /** Error message if failed */
    error?: string;
}
/**
 * Start a new stepped workflow
 *
 * @param workflow - Workflow definition
 * @param sessionContent - Current session file content (or empty for new)
 * @param mode - Optional tri-modal mode (default: workflow default or 'create')
 * @returns StartResult with state, first step, and updated session
 */
export declare function startWorkflow(workflow: WorkflowDefinition, sessionContent: string, mode?: 'create' | 'validate' | 'edit'): Promise<StartResult>;
/**
 * Resume an existing stepped workflow from last completed step
 *
 * @param workflow - Workflow definition
 * @param sessionContent - Current session file content with state
 * @returns ResumeResult with state and next step
 */
export declare function resumeWorkflow(workflow: WorkflowDefinition, sessionContent: string): Promise<ResumeResult>;
/**
 * Get current workflow status from session
 *
 * @param sessionContent - Session file content
 * @param totalSteps - Total number of steps in workflow
 * @returns StatusResult with progress information
 */
export declare function getWorkflowStatus(sessionContent: string, totalSteps: number): StatusResult;
/**
 * Load step file for a specific step number
 *
 * @param workflow - Workflow definition
 * @param stepNumber - Step number to load
 * @param variables - Variables for content resolution
 * @returns ParsedStep with resolved content
 */
export declare function loadStep(workflow: WorkflowDefinition, stepNumber: number, variables?: Record<string, string>): Promise<ParsedStep | null>;
/**
 * Complete current step and advance workflow state
 *
 * @param sessionContent - Current session content
 * @param stepNumber - Step number being completed
 * @param nextStep - Optional specific next step (for skip scenarios)
 * @returns Updated session content
 */
export declare function completeStep(sessionContent: string, stepNumber: number, nextStep?: number): string;
/**
 * Check if workflow has an in-progress state in session
 *
 * @param sessionContent - Session file content
 * @returns true if workflow is in progress
 */
export declare function hasActiveWorkflow(sessionContent: string): boolean;
/**
 * Detect incomplete workflow from session and return name
 *
 * @param sessionContent - Session file content
 * @returns Workflow name if incomplete workflow found, undefined otherwise
 */
export declare function detectIncompleteWorkflow(sessionContent: string): string | undefined;
//# sourceMappingURL=workflow-executor.d.ts.map