/** * @fileoverview TranslatorPipeline (SPEC Section 7) * * Main orchestrator for the translation pipeline. * * Per SPEC Section 7.1: * - Composes Decompose → Translate (parallel) → Merge * - Validates chunks and graph * - Runs plugin hooks at each phase * * @module pipeline/pipeline */ import type { IntentGraph } from "../core/types/intent-graph.js"; import type { DiagnosticsReadonly } from "../core/types/diagnostics.js"; import type { DecomposeStrategy } from "../core/interfaces/decomposer.js"; import type { TranslateStrategy } from "../core/interfaces/translator.js"; import type { MergeStrategy } from "../core/interfaces/merger.js"; import type { PipelinePlugin } from "../plugins/types.js"; /** * Pipeline configuration options. * * Per SPEC Section 7.1 */ export interface PipelineOptions { /** Concurrent chunk translation limit (default: 5) */ concurrency?: number; /** Overall timeout (ms) */ timeout?: number; /** Per-chunk timeout (ms) */ chunkTimeout?: number; /** Maximum chunk size (passed to decomposer) */ maxChunkSize?: number; /** * Enable deduplication. * Forced to true if overlap is detected. * Error if false with overlap (OVL-2). */ deduplicate?: boolean; /** Error handling policy */ errorPolicy?: "fail-fast" | "best-effort"; /** Cross-chunk linking strategy */ linkStrategy?: "conservative" | "aggressive" | "none"; } /** * Result of pipeline execution. * * Per SPEC Section 7.1 */ export interface PipelineResult { readonly graph: IntentGraph; readonly diagnostics: DiagnosticsReadonly; readonly meta: Readonly<{ chunkCount: number; nodeCount: number; processingTimeMs: number; hasOverlap: boolean; }>; } /** * Main orchestrator for the translation pipeline. * * Per SPEC Section 7.1: * - Composes DecomposeStrategy, TranslateStrategy, MergeStrategy * - Validates chunks (D-INV-*) and graph (G-INV-*) * - Runs plugin hooks at each phase (PLG-*) * - Handles overlap detection and deduplication (OVL-*) * - Executes chunk translation in parallel (PEX-*) */ export declare class TranslatorPipeline { private readonly decomposer; private readonly translator; private readonly merger; private readonly options; private readonly plugins; constructor(decomposer: DecomposeStrategy, translator: TranslateStrategy, merger: MergeStrategy, options?: PipelineOptions, plugins?: readonly PipelinePlugin[]); /** * Process input text through the full pipeline. * * @param input - Natural language input * @returns Pipeline result with graph and diagnostics */ process(input: string): Promise; /** * Run hooks for a specific phase. */ private runHooks; /** * Run chunk hooks for parallel phase. */ private runChunkHooks; /** * Run afterMerge hooks with transformer support. * PLG-3: Transformers can return modified graph. * PLG-4: Pipeline re-validates after transformer modification. * PLG-14: Inspector returning IntentGraph is an error. */ private runAfterMergeHooks; } //# sourceMappingURL=pipeline.d.ts.map