export type PipelineMode = 'steps' | 'project';
export type OnFail = 'abort' | 'skip' | {
    retry: number;
} | {
    goto: string;
};
export interface StepConfig {
    /** Step name (unique within pipeline) */
    name: string;
    /** Agent step: kept for backward-compat (claude is the only supported CLI; value ignored). */
    agent?: string;
    /** Agent step: profile to load */
    profile?: string;
    /** Agent step: daemon session name (for context reuse across steps) */
    session?: string;
    /** Agent step: prompt text (supports ${VAR} substitution) */
    prompt?: string;
    /** Agent step: load prompt from file */
    prompt_file?: string;
    /** Shell step: command to execute */
    run?: string;
    /** Failure handling */
    on_fail?: string;
    /** Timeout for this step */
    timeout?: string;
    /** Mark as final step — output goes directly to user */
    final?: boolean;
}
export interface StepsPipelineConfig {
    name: string;
    description?: string;
    mode: 'steps';
    steps: StepConfig[];
}
export interface ProjectPipelineConfig {
    name: string;
    description?: string;
    mode: 'project';
    pm?: {
        provider?: string;
        card_states?: Record<string, string>;
    };
    stages?: Array<{
        name: string;
        trigger?: string;
        agent?: string;
        profile?: string;
        card_state?: string;
        prompt?: string;
        completion?: string;
        git?: {
            branch?: boolean;
            worktree?: string;
        };
        queue?: string;
        on_complete?: Record<string, string> | string;
        on_fail?: Record<string, string> | string;
        timeout?: string;
    }>;
    workers?: {
        max?: number;
        restart_limit?: number;
    };
    notifications?: {
        matrix?: boolean;
    };
}
export type PipelineConfig = StepsPipelineConfig | ProjectPipelineConfig;
export interface PipelineInfo {
    name: string;
    description: string;
    mode: PipelineMode;
    filePath: string;
}
/**
 * Parse on_fail string into structured OnFail type.
 * Formats: "abort", "skip", "retry 3", "goto step_name"
 */
export declare function parseOnFail(raw?: string): OnFail;
/**
 * Parse timeout string (e.g., "30m", "2h", "300s") into milliseconds.
 */
export declare function parseTimeout(raw?: string): number | undefined;
/**
 * Get the pipelines directory path for a project.
 * Pipeline YAML files live in ~/.coral/projects/<name>/pipelines/.
 * Falls back to <cwd>/.sps/pipelines/ for legacy compatibility.
 */
export declare function getPipelinesDir(projectOrCwd?: string): string;
/**
 * List all available pipelines across all projects (or for a specific project).
 */
export declare function listPipelines(projectName?: string): PipelineInfo[];
/**
 * Load and validate a pipeline by name.
 * Searches .sps/pipelines/ for a matching YAML file.
 */
export declare function loadPipelineConfig(name: string, cwd?: string): PipelineConfig;
//# sourceMappingURL=pipelineConfig.d.ts.map