/** * Pipeline From — FR-27 Flexible Stage Entry. * * Allows users to start a pipeline from any valid stage, skipping * all preceding stages. Reuses FR-12 pipeline creation logic. * * Entry points: * - CLI: `sevo from ` * - Plugin: label containing `from:` * - Programmatic: `createPipelineFromStage()` */ import type { PipelineInstance, PipelineTask, StageId, SkippedStage, Result } from '../types/index.js'; import type { PipelineCreateError } from '../types/index.js'; import { type InstanceStore } from './pipeline-create.js'; /** Stages that are valid entry points for flexible stage entry. */ export declare const VALID_ENTRY_STAGES: readonly StageId[]; /** Gate stages that cannot be used as entry points. */ export declare const GATE_STAGES: readonly StageId[]; /** Auxiliary stages that cannot be used as entry points. */ export declare const AUXILIARY_STAGES: readonly StageId[]; export type PipelineFromErrorCode = 'INVALID_STAGE' | 'GATE_STAGE_NOT_ALLOWED' | 'PROJECT_NOT_FOUND' | 'SPEC_FILE_MISSING' | 'STAGE_NOT_IN_TIER' | PipelineCreateError['code']; export interface PipelineFromError { code: PipelineFromErrorCode; message: string; activeInstanceId?: string; } export interface PipelineFromRequest { projectSlug: string; stage: string; task: PipelineTask; } export interface PipelineFromOptions { store: InstanceStore; workspaceRoot: string; /** Check if project directory exists. */ projectExists?: (workspaceRoot: string, projectSlug: string) => boolean; /** Check if spec file exists for the project. */ specFileExists?: (workspaceRoot: string, projectSlug: string) => boolean; /** Check if architecture/contract file exists. */ contractFileExists?: (workspaceRoot: string, projectSlug: string) => boolean; /** Get the tier's valid stages (for AC-27.9). Returns null if no tier restriction. */ getTierStages?: (task: PipelineTask) => StageId[] | null; /** Override current date for testing. */ now?: Date; /** Callback for warnings (e.g., missing contract file). */ onWarning?: (message: string) => void; } /** Check if a stage identifier is a valid entry point. */ export declare function isValidEntryStage(stage: string): stage is StageId; /** Check if a stage identifier is a gate stage. */ export declare function isGateStage(stage: string): boolean; /** * Parse `from:` from a label string. * Returns the stage identifier or null if not found. */ export declare function parseFromLabel(label: string): string | null; /** * Parse `sevo:from ` command format. * Returns { projectSlug, stage } or null if format doesn't match. */ export declare function parseSevoFromCommand(input: string): { projectSlug: string; stage: string; } | null; /** * Compute which stages to skip when entering from a given stage. * Returns all stages in ALL_STAGES that come before the target stage. */ export declare function computeSkippedStages(entryStage: StageId): SkippedStage[]; /** * Create a Pipeline Instance starting from a specific stage (FR-27). * * AC-27.7: If stage is 'spec', delegates directly to FR-12 createPipelineInstance. * AC-27.2: Stages before the entry point are marked as skipped. * AC-27.3: Subsequent stages proceed normally via FR-12 pipeline engine. */ export declare function createPipelineFromStage(request: PipelineFromRequest, options: PipelineFromOptions): Result; //# sourceMappingURL=pipeline-from.d.ts.map