import { z } from 'zod'; import { S as StageId, a as StageStatus } from '../stage-zMHyjRAs.js'; import { ValidationSummary as ValidationSummary$1 } from '../hooks/output-validator.js'; /** * Configuration type definitions and Zod schemas * With .describe() annotations for JSON Schema generation */ /** * Stage config.yaml schema */ declare const StageConfigSchema: z.ZodObject<{ stage: z.ZodObject<{ id: z.ZodEnum<["01-brainstorm", "02-research", "03-planning", "04-ui-ux", "05-task-management", "06-implementation", "07-qa", "08-deployment"]>; name: z.ZodString; description: z.ZodOptional; }, "strip", z.ZodTypeAny, { id: "01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment"; name: string; description?: string | undefined; }, { id: "01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment"; name: string; description?: string | undefined; }>; models: z.ZodObject<{ primary: z.ZodEnum<["claudecode", "claude", "gemini", "codex"]>; secondary: z.ZodOptional>; collaboration: z.ZodOptional>; }, "strip", z.ZodTypeAny, { primary: "claudecode" | "claude" | "gemini" | "codex"; secondary?: "claudecode" | "claude" | "gemini" | "codex" | undefined; collaboration?: "parallel" | "sequential" | "debate" | undefined; }, { primary: "claudecode" | "claude" | "gemini" | "codex"; secondary?: "claudecode" | "claude" | "gemini" | "codex" | undefined; collaboration?: "parallel" | "sequential" | "debate" | undefined; }>; execution: z.ZodOptional; timeout: z.ZodOptional; }, "strip", z.ZodTypeAny, { mode: "yolo" | "plan" | "plan_sandbox" | "deep_dive" | "headless" | "sandbox_playwright"; timeout?: number | undefined; }, { mode: "yolo" | "plan" | "plan_sandbox" | "deep_dive" | "headless" | "sandbox_playwright"; timeout?: number | undefined; }>>; inputs: z.ZodOptional>; optional: z.ZodOptional>; }, "strip", z.ZodTypeAny, { required?: string[] | undefined; optional?: string[] | undefined; }, { required?: string[] | undefined; optional?: string[] | undefined; }>>; outputs: z.ZodOptional>; templates: z.ZodOptional>; }, "strip", z.ZodTypeAny, { required?: string[] | undefined; templates?: string[] | undefined; }, { required?: string[] | undefined; templates?: string[] | undefined; }>>; auto_invoke: z.ZodOptional>; wrapper: z.ZodOptional; prompt_file: z.ZodOptional; fallback: z.ZodOptional>; }, "strip", z.ZodTypeAny, { enabled: boolean; model?: "claudecode" | "claude" | "gemini" | "codex" | undefined; }, { enabled: boolean; model?: "claudecode" | "claude" | "gemini" | "codex" | undefined; }>>; }, "strip", z.ZodTypeAny, { enabled: boolean; model?: "claudecode" | "claude" | "gemini" | "codex" | undefined; wrapper?: string | undefined; prompt_file?: string | undefined; fallback?: { enabled: boolean; model?: "claudecode" | "claude" | "gemini" | "codex" | undefined; } | undefined; }, { enabled: boolean; model?: "claudecode" | "claude" | "gemini" | "codex" | undefined; wrapper?: string | undefined; prompt_file?: string | undefined; fallback?: { enabled: boolean; model?: "claudecode" | "claude" | "gemini" | "codex" | undefined; } | undefined; }>>; transition: z.ZodOptional, "many">>; require_handoff: z.ZodOptional; require_checkpoint: z.ZodOptional; }, "strip", z.ZodTypeAny, { prerequisites?: ("01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment")[] | undefined; require_handoff?: boolean | undefined; require_checkpoint?: boolean | undefined; }, { prerequisites?: ("01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment")[] | undefined; require_handoff?: boolean | undefined; require_checkpoint?: boolean | undefined; }>>; mcp_servers: z.ZodOptional>; }, "strip", z.ZodTypeAny, { stage: { id: "01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment"; name: string; description?: string | undefined; }; models: { primary: "claudecode" | "claude" | "gemini" | "codex"; secondary?: "claudecode" | "claude" | "gemini" | "codex" | undefined; collaboration?: "parallel" | "sequential" | "debate" | undefined; }; execution?: { mode: "yolo" | "plan" | "plan_sandbox" | "deep_dive" | "headless" | "sandbox_playwright"; timeout?: number | undefined; } | undefined; inputs?: { required?: string[] | undefined; optional?: string[] | undefined; } | undefined; outputs?: { required?: string[] | undefined; templates?: string[] | undefined; } | undefined; auto_invoke?: { enabled: boolean; model?: "claudecode" | "claude" | "gemini" | "codex" | undefined; wrapper?: string | undefined; prompt_file?: string | undefined; fallback?: { enabled: boolean; model?: "claudecode" | "claude" | "gemini" | "codex" | undefined; } | undefined; } | undefined; transition?: { prerequisites?: ("01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment")[] | undefined; require_handoff?: boolean | undefined; require_checkpoint?: boolean | undefined; } | undefined; mcp_servers?: string[] | undefined; }, { stage: { id: "01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment"; name: string; description?: string | undefined; }; models: { primary: "claudecode" | "claude" | "gemini" | "codex"; secondary?: "claudecode" | "claude" | "gemini" | "codex" | undefined; collaboration?: "parallel" | "sequential" | "debate" | undefined; }; execution?: { mode: "yolo" | "plan" | "plan_sandbox" | "deep_dive" | "headless" | "sandbox_playwright"; timeout?: number | undefined; } | undefined; inputs?: { required?: string[] | undefined; optional?: string[] | undefined; } | undefined; outputs?: { required?: string[] | undefined; templates?: string[] | undefined; } | undefined; auto_invoke?: { enabled: boolean; model?: "claudecode" | "claude" | "gemini" | "codex" | undefined; wrapper?: string | undefined; prompt_file?: string | undefined; fallback?: { enabled: boolean; model?: "claudecode" | "claude" | "gemini" | "codex" | undefined; } | undefined; } | undefined; transition?: { prerequisites?: ("01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment")[] | undefined; require_handoff?: boolean | undefined; require_checkpoint?: boolean | undefined; } | undefined; mcp_servers?: string[] | undefined; }>; type StageConfig = z.infer; /** * Pipeline config schema */ declare const PipelineConfigSchema: z.ZodObject<{ pipeline: z.ZodObject<{ name: z.ZodString; version: z.ZodString; description: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; version: string; description?: string | undefined; }, { name: string; version: string; description?: string | undefined; }>; stages: z.ZodArray; name: z.ZodString; description: z.ZodOptional; }, "strip", z.ZodTypeAny, { id: "01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment"; name: string; description?: string | undefined; }, { id: "01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment"; name: string; description?: string | undefined; }>, "many">; sprint_mode: z.ZodOptional; }, "strip", z.ZodTypeAny, { default_sprints: number; max_sprints?: number | undefined; }, { default_sprints: number; max_sprints?: number | undefined; }>; }, "strip", z.ZodTypeAny, { enabled: boolean; sprint_config: { default_sprints: number; max_sprints?: number | undefined; }; }, { enabled: boolean; sprint_config: { default_sprints: number; max_sprints?: number | undefined; }; }>>; context_management: z.ZodOptional>; }, "strip", z.ZodTypeAny, { pipeline: { name: string; version: string; description?: string | undefined; }; stages: { id: "01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment"; name: string; description?: string | undefined; }[]; sprint_mode?: { enabled: boolean; sprint_config: { default_sprints: number; max_sprints?: number | undefined; }; } | undefined; context_management?: { warning_threshold: number; action_threshold: number; critical_threshold: number; auto_save_interval: number; } | undefined; }, { pipeline: { name: string; version: string; description?: string | undefined; }; stages: { id: "01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment"; name: string; description?: string | undefined; }[]; sprint_mode?: { enabled: boolean; sprint_config: { default_sprints: number; max_sprints?: number | undefined; }; } | undefined; context_management?: { warning_threshold: number; action_threshold: number; critical_threshold: number; auto_save_interval: number; } | undefined; }>; type PipelineConfig = z.infer; /** * Models config schema */ declare const ModelsConfigSchema: z.ZodObject<{ models: z.ZodRecord; wrapper: z.ZodOptional; modes: z.ZodOptional; }, "strip", z.ZodTypeAny, { enabled: boolean; description?: string | undefined; }, { enabled: boolean; description?: string | undefined; }>>>; fallback_to: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; wrapper?: string | undefined; cli_command?: string | undefined; modes?: Record | undefined; fallback_to?: string | undefined; }, { name: string; wrapper?: string | undefined; cli_command?: string | undefined; modes?: Record | undefined; fallback_to?: string | undefined; }>>; }, "strip", z.ZodTypeAny, { models: Record | undefined; fallback_to?: string | undefined; }>; }, { models: Record | undefined; fallback_to?: string | undefined; }>; }>; type ModelsConfig = z.infer; /** * AI collaboration config schema */ declare const AICollaborationConfigSchema: z.ZodObject<{ execution_policy: z.ZodObject<{ default_mode: z.ZodEnum<["parallel", "sequential", "debate"]>; stage_classification: z.ZodObject<{ parallel_capable: z.ZodArray, "many">; sequential_only: z.ZodArray, "many">; }, "strip", z.ZodTypeAny, { parallel_capable: ("01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment")[]; sequential_only: ("01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment")[]; }, { parallel_capable: ("01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment")[]; sequential_only: ("01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment")[]; }>; }, "strip", z.ZodTypeAny, { default_mode: "parallel" | "sequential" | "debate"; stage_classification: { parallel_capable: ("01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment")[]; sequential_only: ("01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment")[]; }; }, { default_mode: "parallel" | "sequential" | "debate"; stage_classification: { parallel_capable: ("01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment")[]; sequential_only: ("01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment")[]; }; }>; consolidation: z.ZodOptional>; }, "strip", z.ZodTypeAny, { execution_policy: { default_mode: "parallel" | "sequential" | "debate"; stage_classification: { parallel_capable: ("01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment")[]; sequential_only: ("01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment")[]; }; }; consolidation?: { default_strategy: string; quality_threshold: number; } | undefined; }, { execution_policy: { default_mode: "parallel" | "sequential" | "debate"; stage_classification: { parallel_capable: ("01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment")[]; sequential_only: ("01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment")[]; }; }; consolidation?: { default_strategy: string; quality_threshold: number; } | undefined; }>; type AICollaborationConfig = z.infer; interface ProjectPaths { root: string; config: string; stages: string; state: string; scripts: string; } /** * Get project paths from root directory */ declare function getProjectPaths(projectRoot: string): ProjectPaths; /** * Load pipeline configuration */ declare function loadPipelineConfig(projectRoot: string): Promise; /** * Load models configuration */ declare function loadModelsConfig(projectRoot: string): Promise; /** * Load AI collaboration configuration */ declare function loadAICollaborationConfig(projectRoot: string): Promise; /** * Load stage configuration */ declare function loadStageConfig(projectRoot: string, stageId: StageId): Promise; /** * Load any config file without schema validation (JSONC priority, YAML fallback) */ declare function loadConfig(projectRoot: string, configName: string): Promise; /** * Check if a config file exists (checks both .jsonc and .yaml) */ declare function configExists(projectRoot: string, configName: string): boolean; /** * Check if a stage config exists (checks both .jsonc and .yaml) */ declare function stageConfigExists(projectRoot: string, stageId: StageId): boolean; /** * Get all available config file names (supports .jsonc and .yaml) */ declare function getAvailableConfigs(projectRoot: string): string[]; /** * Config loader class for managing multiple configurations */ declare class ConfigLoader { private projectRoot; private cache; constructor(projectRoot: string); /** * Load config with caching */ load(configName: string): Promise; /** * Load pipeline config */ loadPipeline(): Promise; /** * Load models config */ loadModels(): Promise; /** * Load AI collaboration config */ loadAICollaboration(): Promise; /** * Load stage config */ loadStage(stageId: StageId): Promise; /** * Clear cache */ clearCache(): void; /** * Get project paths */ getPaths(): ProjectPaths; } /** * Validation severity levels */ type Severity = 'critical' | 'high' | 'medium'; /** * Validation result entry */ interface ValidationResult { severity: Severity; rule: string; stage?: string; message: string; fixable: boolean; fixed?: boolean; } /** * Validation summary */ interface ValidationSummary { critical: number; high: number; medium: number; passed: number; fixed: number; results: ValidationResult[]; } /** * Validator options */ interface ValidatorOptions { fix?: boolean; verbose?: boolean; stage?: string; rule?: string; } /** * Available validation rules */ declare const VALIDATION_RULES: readonly ["model_references", "parallel_alignment", "collaboration_consistency", "file_references", "auto_invoke", "execution_mode", "ai_wrapper_health", "mcp_servers", "epic_cycles", "requirements_refinement", "implementation_order", "notion_integration", "prerequisites"]; type ValidationRule = (typeof VALIDATION_RULES)[number]; /** * Configuration Validator class */ declare class ConfigValidator { private projectRoot; private configDir; private stagesDir; private options; private summary; constructor(projectRoot: string, options?: ValidatorOptions); /** * Add a validation result */ private addResult; /** * Add a pass result */ private addPass; /** * Get stages to validate */ private getStagesToValidate; /** * Get defined models from models.yaml */ private getDefinedModels; /** * Get parallel capable stages from ai_collaboration.yaml */ private getParallelStages; /** * Rule 1: Model References (CRITICAL) * Every model in stage config must exist in models.yaml */ validateModelReferences(): Promise; /** * Rule 2: Parallel Alignment (CRITICAL) * parallel_capable stages must match config.yaml collaboration settings */ validateParallelAlignment(): Promise; /** * Rule 3: Collaboration Consistency (CRITICAL) * Parallel stages need 2+ models configured */ validateCollaborationConsistency(): Promise; /** * Rule 4: File References (HIGH) * Required input/output files exist */ validateFileReferences(): Promise; /** * Rule 5: Auto-Invoke (HIGH) * Wrapper scripts exist, fallback model defined */ validateAutoInvoke(): Promise; /** * Rule 6: Execution Mode (HIGH) * Stage mode aligns with model capabilities */ validateExecutionMode(): Promise; /** * Rule 7: AI Wrapper Health (HIGH) * AI wrapper scripts are executable and functional */ validateAIWrapperHealth(): Promise; /** * Rule 8: MCP Servers (MEDIUM) * Referenced MCP servers have fallback configs */ validateMCPServers(): Promise; /** * Rule 9: Epic Cycles (MEDIUM) * Validate epic_cycles.yaml structure and settings */ validateEpicCycles(): Promise; /** * Rule 10: Requirements Refinement (MEDIUM) */ validateRequirementsRefinement(): Promise; /** * Rule 11: Implementation Order (MEDIUM) */ validateImplementationOrder(): Promise; /** * Rule 12: Notion Integration (MEDIUM) */ validateNotionIntegration(): Promise; /** * Rule 13: Prerequisites (MEDIUM) */ validatePrerequisites(): Promise; /** * Run all validations */ validate(): Promise; /** * Get exit code based on results */ getExitCode(): number; } /** * Print validation summary */ declare function printValidationSummary(summary: ValidationSummary): void; /** * Print recovery guide */ declare function printRecoveryGuide(): void; /** * Validate configuration (convenience function) */ declare function validateConfig(projectRoot: string, options?: ValidatorOptions): Promise; /** * State type definitions */ /** * Progress JSON schema */ /** * Multi-model execution tracking for a stage */ declare const MultiModelStatusSchema: z.ZodObject<{ executed: z.ZodBoolean; quality_status: z.ZodEnum<["passed", "failed", "bypassed"]>; synthesis_verified: z.ZodBoolean; }, "strip", z.ZodTypeAny, { executed: boolean; quality_status: "passed" | "failed" | "bypassed"; synthesis_verified: boolean; }, { executed: boolean; quality_status: "passed" | "failed" | "bypassed"; synthesis_verified: boolean; }>; type MultiModelStatus = z.infer; declare const ProgressSchema: z.ZodObject<{ project_name: z.ZodString; current_stage: z.ZodEnum<["01-brainstorm", "02-research", "03-planning", "04-ui-ux", "05-task-management", "06-implementation", "07-qa", "08-deployment"]>; stage_status: z.ZodEnum<["pending", "in_progress", "completed", "skipped"]>; started_at: z.ZodString; last_updated: z.ZodString; pipeline: z.ZodOptional>; stages: z.ZodRecord, z.ZodObject<{ status: z.ZodEnum<["pending", "in_progress", "completed", "skipped"]>; started_at: z.ZodNullable; completed_at: z.ZodNullable; checkpoint_id: z.ZodNullable; multi_model: z.ZodOptional; synthesis_verified: z.ZodBoolean; }, "strip", z.ZodTypeAny, { executed: boolean; quality_status: "passed" | "failed" | "bypassed"; synthesis_verified: boolean; }, { executed: boolean; quality_status: "passed" | "failed" | "bypassed"; synthesis_verified: boolean; }>>; refactoring_metrics: z.ZodOptional; violations: z.ZodRecord>; violations_fixed: z.ZodRecord>; duplication_removed: z.ZodRecord>; complexity_hotspots: z.ZodRecord>; }, "strip", z.ZodTypeAny, { files_reviewed: string[]; violations: Record; violations_fixed: Record; duplication_removed: Record; complexity_hotspots: Record; }, { files_reviewed: string[]; violations: Record; violations_fixed: Record; duplication_removed: Record; complexity_hotspots: Record; }>>; }, "strip", z.ZodTypeAny, { status: "pending" | "in_progress" | "completed" | "skipped"; checkpoint_id: string | null; started_at: string | null; completed_at: string | null; multi_model?: { executed: boolean; quality_status: "passed" | "failed" | "bypassed"; synthesis_verified: boolean; } | undefined; refactoring_metrics?: { files_reviewed: string[]; violations: Record; violations_fixed: Record; duplication_removed: Record; complexity_hotspots: Record; } | undefined; }, { status: "pending" | "in_progress" | "completed" | "skipped"; checkpoint_id: string | null; started_at: string | null; completed_at: string | null; multi_model?: { executed: boolean; quality_status: "passed" | "failed" | "bypassed"; synthesis_verified: boolean; } | undefined; refactoring_metrics?: { files_reviewed: string[]; violations: Record; violations_fixed: Record; duplication_removed: Record; complexity_hotspots: Record; } | undefined; }>>; current_iteration: z.ZodOptional>; }, "strip", z.ZodTypeAny, { current_sprint: number; total_sprints: number; epic_context?: { enabled: boolean; current_cycle: number; total_cycles: number; } | undefined; }, { current_sprint: number; total_sprints: number; epic_context?: { enabled: boolean; current_cycle: number; total_cycles: number; } | undefined; }>>; sprints: z.ZodOptional; tasks_total: z.ZodNumber; tasks_completed: z.ZodNumber; checkpoint_id: z.ZodNullable; milestones: z.ZodOptional; mid_sprint: z.ZodEnum<["pending", "done"]>; sprint_review: z.ZodEnum<["pending", "done"]>; }, "strip", z.ZodTypeAny, { pre_sprint: "pending" | "done"; mid_sprint: "pending" | "done"; sprint_review: "pending" | "done"; }, { pre_sprint: "pending" | "done"; mid_sprint: "pending" | "done"; sprint_review: "pending" | "done"; }>>; }, "strip", z.ZodTypeAny, { status: "pending" | "in_progress" | "completed"; tasks_total: number; tasks_completed: number; checkpoint_id: string | null; milestones?: { pre_sprint: "pending" | "done"; mid_sprint: "pending" | "done"; sprint_review: "pending" | "done"; } | undefined; }, { status: "pending" | "in_progress" | "completed"; tasks_total: number; tasks_completed: number; checkpoint_id: string | null; milestones?: { pre_sprint: "pending" | "done"; mid_sprint: "pending" | "done"; sprint_review: "pending" | "done"; } | undefined; }>>>; epic_cycle: z.ZodOptional; end_stage: z.ZodEnum<["01-brainstorm", "02-research", "03-planning", "04-ui-ux", "05-task-management", "06-implementation", "07-qa", "08-deployment"]>; }, "strip", z.ZodTypeAny, { start_stage: "01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment"; end_stage: "01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment"; }, { start_stage: "01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment"; end_stage: "01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment"; }>; }, "strip", z.ZodTypeAny, { enabled: boolean; current_cycle: number; total_cycles: number; scope: { start_stage: "01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment"; end_stage: "01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment"; }; }, { enabled: boolean; current_cycle: number; total_cycles: number; scope: { start_stage: "01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment"; end_stage: "01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment"; }; }>>; implementation_order: z.ZodOptional; }, "strip", z.ZodTypeAny, { selected: string | null; }, { selected: string | null; }>>; requirements_refinement: z.ZodOptional>; checkpoints: z.ZodOptional; created_at: z.ZodString; description: z.ZodOptional; }, "strip", z.ZodTypeAny, { id: string; stage: "01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment"; created_at: string; description?: string | undefined; }, { id: string; stage: "01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment"; created_at: string; description?: string | undefined; }>, "many">>; }, "strip", z.ZodTypeAny, { stages: Partial; violations_fixed: Record; duplication_removed: Record; complexity_hotspots: Record; } | undefined; }>>; project_name: string; current_stage: "01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment"; stage_status: "pending" | "in_progress" | "completed" | "skipped"; started_at: string; last_updated: string; pipeline?: { name: string; version: string; started_at: string; updated_at: string; } | undefined; requirements_refinement?: { active: boolean; } | undefined; implementation_order?: { selected: string | null; } | undefined; current_iteration?: { current_sprint: number; total_sprints: number; epic_context?: { enabled: boolean; current_cycle: number; total_cycles: number; } | undefined; } | undefined; sprints?: Record | undefined; epic_cycle?: { enabled: boolean; current_cycle: number; total_cycles: number; scope: { start_stage: "01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment"; end_stage: "01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment"; }; } | undefined; checkpoints?: { id: string; stage: "01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment"; created_at: string; description?: string | undefined; }[] | undefined; }, { stages: Partial; violations_fixed: Record; duplication_removed: Record; complexity_hotspots: Record; } | undefined; }>>; project_name: string; current_stage: "01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment"; stage_status: "pending" | "in_progress" | "completed" | "skipped"; started_at: string; last_updated: string; pipeline?: { name: string; version: string; started_at: string; updated_at: string; } | undefined; requirements_refinement?: { active: boolean; } | undefined; implementation_order?: { selected: string | null; } | undefined; current_iteration?: { current_sprint: number; total_sprints: number; epic_context?: { enabled: boolean; current_cycle: number; total_cycles: number; } | undefined; } | undefined; sprints?: Record | undefined; epic_cycle?: { enabled: boolean; current_cycle: number; total_cycles: number; scope: { start_stage: "01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment"; end_stage: "01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment"; }; } | undefined; checkpoints?: { id: string; stage: "01-brainstorm" | "02-research" | "03-planning" | "04-ui-ux" | "05-task-management" | "06-implementation" | "07-qa" | "08-deployment"; created_at: string; description?: string | undefined; }[] | undefined; }>; type Progress = z.infer; /** * Checkpoint metadata */ interface CheckpointMetadata { id: string; stage: string; createdAt: string; description?: string; files: string[]; } /** * Get the path to progress.json */ declare function getProgressPath(projectRoot: string): string; /** * Load progress from file */ declare function loadProgress(projectRoot: string): Promise; /** * Save progress to file */ declare function saveProgress(projectRoot: string, progress: Progress): Promise; /** * Initialize progress for a new project */ declare function initProgress(projectRoot: string, projectName: string): Promise; /** * Check if progress exists */ declare function progressExists(projectRoot: string): boolean; /** * Get current stage from progress */ declare function getCurrentStage(projectRoot: string): Promise; /** * Update current stage */ declare function updateCurrentStage(projectRoot: string, stageId: StageId, status?: StageStatus): Promise; /** * Mark stage as completed */ declare function completeStage(projectRoot: string, stageId: StageId, checkpointId?: string, multiModel?: MultiModelStatus): Promise; /** * Get stage status */ declare function getStageStatus(projectRoot: string, stageId: StageId): Promise; /** * Update sprint status */ declare function updateSprintStatus(projectRoot: string, sprintName: string, status: 'pending' | 'in_progress' | 'completed', tasksCompleted?: number, tasksTotal?: number): Promise; /** * Get current sprint */ declare function getCurrentSprint(projectRoot: string): Promise<{ name: string; number: number; total: number; } | null>; /** * Advance to next sprint */ declare function advanceToNextSprint(projectRoot: string): Promise; /** * Add checkpoint to progress */ declare function addCheckpointToProgress(projectRoot: string, checkpoint: { id: string; stage: StageId; description?: string; }): Promise; /** * Progress manager class */ declare class ProgressManager { private projectRoot; private progress; constructor(projectRoot: string); /** * Load progress (cached) */ load(): Promise; /** * Save progress */ save(): Promise; /** * Reload progress from disk */ reload(): Promise; /** * Get current stage */ getCurrentStage(): Promise; /** * Set current stage */ setCurrentStage(stageId: StageId, status?: StageStatus): Promise; /** * Complete current stage */ completeCurrentStage(checkpointId?: string): Promise; /** * Get the next stage after the current one. * Returns the next StageId or null if pipeline is complete. */ getNextStage(): Promise; /** * Check if all stages are completed. */ isComplete(): Promise; /** * Get all stages with their statuses. */ getStageStatuses(): Promise>; } /** * Generate checkpoint ID */ declare function generateCheckpointId(stageId: StageId): string; /** * Get checkpoints directory path */ declare function getCheckpointsDir(projectRoot: string): string; /** * Get checkpoint path */ declare function getCheckpointPath(projectRoot: string, checkpointId: string): string; /** * List all checkpoints */ declare function listCheckpoints(projectRoot: string): Promise; /** * Get checkpoint metadata */ declare function getCheckpointMetadata(projectRoot: string, checkpointId: string): Promise; /** * Create a checkpoint */ declare function createCheckpoint(projectRoot: string, stageId: StageId, options?: { description?: string; includeStages?: boolean; includeState?: boolean; includeConfig?: boolean; }): Promise; /** * Restore a checkpoint */ declare function restoreCheckpoint(projectRoot: string, checkpointId: string, options?: { restoreStages?: boolean; restoreState?: boolean; restoreConfig?: boolean; partial?: boolean; files?: string[]; }): Promise; /** * Delete a checkpoint */ declare function deleteCheckpoint(projectRoot: string, checkpointId: string): Promise; /** * Clean up old checkpoints based on retention policy */ declare function cleanupCheckpoints(projectRoot: string, maxRetention?: number, preserveMilestones?: boolean): Promise; /** * Checkpoint manager class */ declare class CheckpointManager { private projectRoot; constructor(projectRoot: string); /** * Create a checkpoint */ create(stageId: StageId, description?: string): Promise; /** * Restore a checkpoint */ restore(checkpointId: string): Promise; /** * List all checkpoints */ list(): Promise; /** * Get checkpoint metadata */ get(checkpointId: string): Promise; /** * Delete a checkpoint */ delete(checkpointId: string): Promise; /** * Clean up old checkpoints */ cleanup(maxRetention?: number): Promise; } /** * Stage persona configuration loaded from stage_personas.jsonc */ interface StagePersona { role: string; temperature: number; model: string; focus: string; } /** * Reference files found for a stage */ interface StageReferences { files: Array<{ name: string; path: string; content: string; }>; } /** * Result of a single stage execution */ interface StageExecutionResult { stageId: StageId; success: boolean; attempts: number; validationScore: number; duration_ms: number; error?: string; } /** * Pipeline execution result */ interface PipelineResult { completed: boolean; stagesRun: number; stagesCompleted: number; stagesFailed: number; results: StageExecutionResult[]; stoppedAt?: StageId; error?: string; } /** * Retry state for a stage attempt */ interface StageRetryState { stageId: StageId; attempt: number; maxAttempts: number; validationErrors: string[]; lastScore: number; } /** * Pipeline state (persisted for pause/resume) */ interface PipelineState { status: 'running' | 'paused' | 'completed' | 'failed'; currentStage: StageId | null; retryState: StageRetryState | null; startedAt: string; pausedAt?: string; } /** * Orchestrator configuration */ interface OrchestratorConfig { projectRoot: string; maxRetries: number; startFromStage?: StageId; stopAfterStage?: StageId; dryRun?: boolean; } /** * Load stage persona from config */ declare function loadStagePersona(projectRoot: string, stageId: StageId): StagePersona | null; /** * Load reference files for a stage */ declare function loadStageReferences(projectRoot: string, stageId: StageId): StageReferences; /** * Load stage CLAUDE.md instructions */ declare function loadStageInstructions(projectRoot: string, stageId: StageId): string; /** * Load previous stage HANDOFF */ declare function loadPreviousHandoff(projectRoot: string, stageId: StageId): string | null; /** * Build the prompt for a stage agent. * Combines: stage instructions + persona + previous handoff + references + project brief */ declare function buildStagePrompt(projectRoot: string, stageId: StageId): string; /** * Validate stage outputs. Returns validation summary. */ declare function validateStage(projectRoot: string, stageId: StageId): Promise; /** * Generate HANDOFF for completed stage */ declare function generateStageHandoff(projectRoot: string, _stageId: StageId): Promise; /** * Get pipeline status summary for display */ declare function getPipelineStatus(projectRoot: string): Promise<{ currentStage: StageId | null; stages: Array<{ id: StageId; name: string; status: StageStatus; }>; isComplete: boolean; progress: number; }>; /** * Run the full auto-pilot pipeline. * * Note: This function manages state transitions and validation. * The actual agent execution (Task tool calls) must be handled by * the calling context (Claude Code session via /auto-pilot command). * * This function is designed to be called step-by-step from the * auto-pilot command, not as a single blocking call. */ declare function prepareStageExecution(projectRoot: string, stageId: StageId): Promise<{ prompt: string; persona: StagePersona | null; model: string; }>; /** * Finalize a stage after agent execution. * Validates outputs, generates HANDOFF, creates checkpoint, updates progress. */ declare function finalizeStage(projectRoot: string, stageId: StageId): Promise<{ success: boolean; validation: ValidationSummary$1; nextStage: StageId | null; }>; /** * Build a retry prompt that includes validation feedback from the failed attempt. */ declare function buildRetryPrompt(projectRoot: string, stageId: StageId, retryState: StageRetryState): string; /** * Finalize a stage with retry support. * Returns updated retry state if validation fails within retry budget. */ declare function finalizeStageWithRetry(projectRoot: string, stageId: StageId, retryState: StageRetryState | null): Promise<{ success: boolean; validation: ValidationSummary$1; nextStage: StageId | null; retryState: StageRetryState | null; shouldRetry: boolean; }>; /** * Load pipeline state from disk */ declare function loadPipelineState(projectRoot: string): PipelineState | null; /** * Save pipeline state to disk */ declare function savePipelineState(projectRoot: string, state: PipelineState): void; /** * Pause the pipeline */ declare function pausePipeline(projectRoot: string): PipelineState; /** * Resume a paused pipeline */ declare function resumePipeline(projectRoot: string): PipelineState | null; /** * Skip the current stage */ declare function skipStage(projectRoot: string, stageId: StageId): Promise; /** * Built-in model registry — offline fallback when GitHub manifest is unreachable * Update these values before each npm publish to reflect the latest Claude models. */ /** User-facing model role names */ type ModelRole = 'reasoning' | 'balanced' | 'fast'; /** Internal tier names consumed by the Task tool */ type ModelTierName = 'opus' | 'sonnet' | 'haiku'; /** * Single mapping from role → tier. * Change ONLY this constant to swap every model in the pipeline. */ declare const ROLE_TO_TIER: Record; /** All valid values for a `model` field in user-facing config */ declare const MODEL_ROLES: readonly ["reasoning", "balanced", "fast", "inherit"]; /** * Resolve a user-facing role name to the Task tool tier. * Returns `undefined` for `'inherit'`, `undefined`/`null`, or unknown values. */ declare function resolveToTier(model?: string): string | undefined; interface ModelTier { id: string; available: boolean; } interface ResolvedModels { source: 'manifest' | 'builtin'; tiers: Record<'opus' | 'sonnet' | 'haiku', ModelTier>; timestamp: string; } declare const BUILTIN_MODEL_REGISTRY: ResolvedModels; /** * Model resolver with 2-tier fallback: * 1. GitHub manifest (public URL, no API key needed) — 3s timeout * 2. Built-in registry (always succeeds, offline-safe) */ /** * Resolve available models using 2-tier fallback. * Manifest failure silently falls back to the built-in registry. */ declare function resolveModels(): Promise; /** * Model assigner — maps resolved model tiers to debate roles and stage personas. * * Each role has an "ideal" tier. If that tier is unavailable, it falls back to sonnet. * Output values use user-facing role names (reasoning/balanced/fast). */ interface ModelAssignment { /** stage → role-index → user-facing role name */ stageRoles: Record>; /** stage → default_model role name */ stageDefaults: Record; /** stage → persona role name */ personas: Record; } /** * Assign optimal model tiers based on resolved availability. * Returns user-facing role names (reasoning/balanced/fast). */ declare function assignModelsToRoles(resolved: ResolvedModels): ModelAssignment; export { BUILTIN_MODEL_REGISTRY, CheckpointManager, ConfigLoader, ConfigValidator, MODEL_ROLES, type ModelAssignment, type ModelRole, type ModelTier, type OrchestratorConfig, type PipelineResult, type PipelineState, ProgressManager, type ProjectPaths, ROLE_TO_TIER, type ResolvedModels, type Severity, type StageExecutionResult, type StagePersona, type StageReferences, type StageRetryState, VALIDATION_RULES, type ValidationResult, type ValidationRule, type ValidationSummary, type ValidatorOptions, addCheckpointToProgress, advanceToNextSprint, assignModelsToRoles, buildRetryPrompt, buildStagePrompt, cleanupCheckpoints, completeStage, configExists, createCheckpoint, deleteCheckpoint, finalizeStage, finalizeStageWithRetry, generateCheckpointId, generateStageHandoff, getAvailableConfigs, getCheckpointMetadata, getCheckpointPath, getCheckpointsDir, getCurrentSprint, getCurrentStage, getPipelineStatus, getProgressPath, getProjectPaths, getStageStatus, initProgress, listCheckpoints, loadAICollaborationConfig, loadConfig, loadModelsConfig, loadPipelineConfig, loadPipelineState, loadPreviousHandoff, loadProgress, loadStageConfig, loadStageInstructions, loadStagePersona, loadStageReferences, pausePipeline, prepareStageExecution, printRecoveryGuide, printValidationSummary, progressExists, resolveModels, resolveToTier, restoreCheckpoint, resumePipeline, savePipelineState, saveProgress, skipStage, stageConfigExists, updateCurrentStage, updateSprintStatus, validateConfig, validateStage };