/** * L2 Progressive Disclosure — Custom Stage Registry. * * Allows users to define custom stages and insert them into the pipeline. * Custom stages are registered via configuration or API, and the * PipelineEngine recognizes them alongside built-in stages. * * (spec §FR-15, AC-15.3) */ import type { StageId, StageRecord } from '../types/index.js'; /** Where to insert a custom stage relative to an anchor stage. */ export type InsertPosition = 'before' | 'after'; /** Definition of a custom stage that can be inserted into the pipeline. */ export interface CustomStageDefinition { /** Unique identifier for this custom stage. Must not collide with built-in stage IDs. */ stageId: string; /** Human-readable name. */ name: string; /** Optional description of what this stage does. */ description?: string; /** Built-in stage to anchor insertion against. */ anchorStage: StageId; /** Insert before or after the anchor stage. */ position: InsertPosition; /** Optional custom gate rules for this stage. */ gateRules?: CustomGateRule[]; } /** A custom gate rule attached to a custom stage. */ export interface CustomGateRule { ruleId: string; severity: 'blocker' | 'warning'; /** Human-readable description of what this rule checks. */ description: string; } /** Result of registering a custom stage. */ export interface CustomStageRegistrationResult { success: boolean; stageId: string; errors: string[]; } /** * Registry for custom pipeline stages (L2 Progressive Disclosure). * * Manages registration, validation, and stage-sequence resolution * for user-defined stages. */ export declare class CustomStageRegistry { private readonly stages; /** * Register a custom stage definition. * * Validates: * - stageId is non-empty and does not collide with built-in stages * - anchorStage is a valid built-in stage * - No duplicate registration */ register(definition: CustomStageDefinition): CustomStageRegistrationResult; /** * Unregister a custom stage. * Returns true if the stage was found and removed. */ unregister(stageId: string): boolean; /** Get a registered custom stage definition. */ get(stageId: string): CustomStageDefinition | undefined; /** List all registered custom stages. */ list(): CustomStageDefinition[]; /** Check if a stage ID is a registered custom stage. */ isCustomStage(stageId: string): boolean; /** Clear all registered custom stages. */ clear(): void; /** * Resolve the full stage sequence by inserting custom stages * into the base stage list. * * Custom stages are inserted relative to their anchor stage. * Multiple custom stages anchored to the same stage are inserted * in registration order. */ resolveStageSequence(baseStages: readonly StageId[]): string[]; /** * Create a StageRecord for a custom stage (for pipeline state initialization). */ createStageRecord(stageId: string): StageRecord | undefined; } //# sourceMappingURL=custom-stage.d.ts.map