/**
 * Workflow Schema Validation
 *
 * Defines types and validation for workflow definitions.
 * See pennyfarthing-dist/guides/workflow-schema.md for spec.
 */
/**
 * Error details for validation failures
 */
export interface WorkflowValidationError {
    /** Field path that failed validation (e.g., "workflow.phases[0].agent") */
    field: string;
    /** Human-readable error message */
    message: string;
}
/**
 * Phase definition within a workflow
 */
export interface WorkflowPhase {
    /** Unique name for this phase */
    name: string;
    /** Agent to invoke (sm, tea, dev, reviewer, etc.) */
    agent: string;
    /** What this phase receives from previous phases (optional) */
    input?: string[];
    /** What this phase produces for next phases (optional) */
    output?: string[];
    /** Conditions to proceed to next phase (optional) */
    gate?: {
        /** Gate type: tests_pass, tests_fail, approval, manual, etc. */
        type: string;
        /** Additional condition description (optional) */
        condition?: string;
    };
}
/**
 * Trigger rules for automatic workflow selection
 */
export interface WorkflowTriggers {
    /** Story tags that match this workflow */
    tags?: string[];
    /** Story types that match (feature, bug, chore, docs) */
    types?: string[];
    /** Point-based routing */
    points?: {
        min?: number;
        max?: number;
    };
    /** Use as fallback when no other workflow matches */
    default?: boolean;
}
/**
 * Permission preset required by a workflow
 */
export interface WorkflowPermissionPreset {
    /** Tool name (e.g., "Bash", "Read", "WebFetch") */
    tool: string;
    /** Scope pattern for the permission */
    scope: string;
    /** Human-readable reason shown when prompting for permission */
    reason: string;
}
/**
 * Steps configuration for stepped workflows
 */
export interface WorkflowSteps {
    /** Directory containing step files */
    path: string;
    /** Naming pattern for step files (e.g., "step-{nn}-*.md") */
    pattern: string;
}
/**
 * Tri-modal configuration for stepped workflows
 */
export interface WorkflowModes {
    /** Default mode: 'create' | 'validate' | 'edit' */
    default: 'create' | 'validate' | 'edit';
    /** Path to create mode steps */
    create?: string;
    /** Path to validate mode steps */
    validate?: string;
    /** Path to edit mode steps */
    edit?: string;
}
/**
 * Gate configuration for stepped workflows
 */
export interface WorkflowSteppedGates {
    /** Step numbers after which to pause for user approval */
    after_steps?: number[];
    /** Marker string to detect gates in step file content */
    gate_marker?: string;
}
/**
 * Complete workflow definition
 * Supports both phased (traditional) and stepped (BMAD-style) workflows
 */
export interface WorkflowDefinition {
    /** Unique workflow identifier */
    name: string;
    /** Human-readable description (optional) */
    description?: string;
    /** Semver version for tracking changes (optional) */
    version?: string;
    /** Workflow type: 'phased' (default) or 'stepped' */
    type?: 'phased' | 'stepped';
    /** Ordered list of phases (required for phased workflows) */
    phases?: WorkflowPhase[];
    /** Primary agent for stepped workflows */
    agent?: string;
    /** Steps configuration (required for stepped workflows) */
    steps?: WorkflowSteps;
    /** Tri-modal configuration (optional, stepped only) */
    modes?: WorkflowModes;
    /** Variable definitions for stepped workflows */
    variables?: Record<string, unknown>;
    /** Gate configuration for stepped workflows */
    gates?: WorkflowSteppedGates;
    /** Output template path for stepped workflows */
    template?: string;
    /** Rules for automatic workflow selection (optional) */
    triggers?: WorkflowTriggers;
    /** Permission presets required by this workflow (optional) */
    permissions?: WorkflowPermissionPreset[];
}
/**
 * Result of workflow validation
 */
export interface WorkflowValidationResult {
    /** Whether the workflow is valid */
    valid: boolean;
    /** Parsed workflow (only present if valid) */
    workflow?: WorkflowDefinition;
    /** Validation errors (only present if invalid) */
    errors?: WorkflowValidationError[];
}
/**
 * Validates a workflow definition object
 *
 * @param input - Raw workflow object (e.g., parsed from YAML)
 * @returns Validation result with parsed workflow or errors
 *
 * @example
 * ```typescript
 * const yaml = fs.readFileSync('workflow.yaml', 'utf-8');
 * const parsed = YAML.parse(yaml);
 * const result = validateWorkflow(parsed);
 *
 * if (result.valid) {
 *   console.log(`Workflow "${result.workflow.name}" is valid`);
 * } else {
 *   console.error('Validation errors:', result.errors);
 * }
 * ```
 */
export declare function validateWorkflow(input: unknown): WorkflowValidationResult;
//# sourceMappingURL=workflow-schema.d.ts.map