/** * PipelineEngine — Event-driven async extraction pipeline. * * Orchestrates the pipeline-filter flow (ADR-001): * intake → extraction → analysis_artifact → classification → conflict_detection → merge_detection → quality_gate → persistence → complete * * Async extraction does not block the caller (NFR-4.2). * Each stage emits events through EventBus for observability and loose coupling. */ import type { ExtractionTask, KnowledgeEntry, KnowledgeSource, PipelineStage } from '../types/index.js'; import { EventBus } from './event-bus.js'; import { Classifier } from './classifier.js'; import { type ExtractorOptions } from './extractor.js'; import type { ConflictDetector } from '../conflict/index.js'; import type { KnowledgeRepository } from '../repository/knowledge-repository.js'; import { AnalysisArtifactStore, type AnalysisArtifact } from './analysis-artifact-store.js'; import type { DomainGoal } from '../domain-goal/domain-goal-types.js'; export interface PipelineContext { task: ExtractionTask; entries: KnowledgeEntry[]; activeEntries: KnowledgeEntry[]; artifact?: AnalysisArtifact; routeSummary?: Record; } export interface RegisteredPipelineStage { name: PipelineStage; run: (context: PipelineContext) => Promise | void>; after?: PipelineStage; } export interface PipelineEngineOptions { extractor?: ExtractorOptions; classifier?: Classifier; conflictDetector?: ConflictDetector; repository?: KnowledgeRepository; confidenceThreshold?: number; analysisArtifactStore?: AnalysisArtifactStore; qualityGateEnabled?: boolean; domainGoals?: DomainGoal[] | (() => DomainGoal[]); } export declare class PipelineEngine { readonly bus: EventBus; private extractor; private classifier; private conflictDetector?; private repository?; private confidenceThreshold; private artifactStore?; private qualityGateEnabled; private domainGoals?; private tasks; private readonly customStages; constructor(options?: PipelineEngineOptions); /** * Submit raw text for async extraction. * Returns immediately with task id — extraction runs in background. */ submit(input: string, source: KnowledgeSource): string; /** Get task by id */ getTask(taskId: string): ExtractionTask | undefined; /** Get all extracted entries from a completed task */ getResults(taskId: string): KnowledgeEntry[]; /** Register a custom stage without modifying existing stage logic */ registerStage(stage: RegisteredPipelineStage): void; private runPipeline; private runExtractionStage; private runAnalysisArtifactStage; private runClassificationStage; private runConflictStage; private runMergeDetectionStage; private runQualityGateStage; private runPersistenceStage; private runCustomStagesAfter; private runCustomStage; private buildArtifactInput; private getDomainGoals; private routeForEntry; private failTask; private enterStage; private completeStage; private skipStage; private emitEvent; /** Cleanup: remove all listeners */ destroy(): void; } //# sourceMappingURL=engine.d.ts.map