import type { TPipeline, TPipelineEvent, TPipelineResult, TProcessingFailure, TStage, TStageContext, TStageStatus } from "./types.js"; import type { TLlmProvider, TLlmTokenUsage } from "../llm/types.js"; export type TExecutePipelineDeps = { llm: TLlmProvider; generateId?: () => string; signal?: AbortSignal; onEvent?: (event: TPipelineEvent) => void; /** Default 4. */ concurrencyLimit?: number; }; export declare class PipelineConfigurationError extends Error { readonly code: "DAG_CYCLE" | "SELF_DEP" | "UNKNOWN_DEP" | "UNKNOWN_STAGE" | "DUPLICATE_STAGE_ID" | "GET_OUTSIDE_DEPS" | "STATUS_OUTSIDE_DEPS"; readonly stageId?: string; readonly depId?: string; constructor(args: { code: PipelineConfigurationError["code"]; message: string; stageId?: string; depId?: string; }); } export declare function now(): number; export declare function defaultGenerateId(): string; export declare function noopEmit(_event: TPipelineEvent): void; export type TStageRecord = { outcome: TStageStatus; output: unknown; tokenUsage?: TLlmTokenUsage; }; export type TStageRunState = { /** The inter-stage record store `ctx.get` / `ctx.stageStatus` read. */ records: Map; /** Aggregated structured failures the run produces. */ failures: TProcessingFailure[]; /** Cancellation signal threaded into each stage's `ctx.signal`. */ signal: AbortSignal; /** Observability hook for `TPipelineEvent`s. */ emit: (event: TPipelineEvent) => void; /** ID generator threaded into each stage's `ctx.generateId`. */ generateId: () => string; /** The provider every `llmStage` calls. */ llm: TLlmProvider; /** * The parsed (Default/Convert/Clean-transformed) pipeline input that * seeds every stage's `ctx.input`. */ input: unknown; /** * Disposition seam for a `PipelineConfigurationError` raised by * `ctx.get` / `ctx.stageStatus` on a non-dependency stage id (a * caller bug). The whole-DAG scheduler captures the first one and * re-throws it after emitting the bookend events; the single-stage * path supplies a callback that throws immediately (it has no * bookends to emit). One extracted body, two dispositions. */ setConfigError: (error: PipelineConfigurationError) => void; }; export declare function makeStageContext(state: TStageRunState, allowedDeps: Set, contextLabel: string): TStageContext; export declare function runOneStage(stage: TStage, ctx: TStageContext, state: TStageRunState): Promise; export declare function runFinalize(pipeline: TPipeline, ctx: TStageContext, state: TStageRunState): TOutput | null; export declare function executePipeline(pipeline: TPipeline, input: TInput, deps: TExecutePipelineDeps): Promise>; //# sourceMappingURL=scheduler.d.ts.map