/**
 * 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 */
        type?: string;
        /** Gate file path (relative, no traversal) */
        file?: string;
        /** Additional condition description (optional) */
        condition?: string;
    };
    /** Tandem backseat observer configuration (optional) */
    tandem?: {
        /** Agent name to run as backseat observer */
        partner: string;
        /** Observation scope(s): file-watch, tool-watch, context-watch */
        scope?: string | string[];
    };
    /** Native team configuration for phase-scoped collaboration (optional) */
    team?: TeamConfig;
    /** Explicit next phase name for non-linear routing (optional) */
    next?: string;
    /** Freeform instructions for the agent in this phase (optional) */
    instructions?: string;
}
/**
 * Teammate entry within a team configuration
 */
export interface TeamMember {
    /** Agent name (must be a valid agent from the registry) */
    agent: string;
    /** Description of the teammate's task/role in this phase */
    task?: string;
}
/**
 * Native team configuration for a workflow phase.
 * Enables phase-scoped parallel collaboration via Claude Code Agent Teams.
 */
export interface TeamConfig {
    /** List of teammate agents for this phase */
    teammates: TeamMember[];
    /** Model selection for teammate agents */
    model?: string;
    /** Display mode for team execution */
    display?: string;
}
/**
 * Valid agent names for teammate validation.
 * These are the main agents that can participate in team collaboration.
 */
export declare const VALID_AGENT_NAMES: readonly ["sm", "tea", "dev", "reviewer", "architect", "pm", "tech-writer", "ux-designer", "devops", "ba", "orchestrator"];
/**
 * 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