import type { PipelineStep, RetryConfig, PipelineContext } from './steps'; import type { PipelineConfigV2 } from './pipeline'; import type { HookHandler } from '../hooks/types'; /** * Step options for builder methods */ export interface StepOptions { name?: string; retry?: RetryConfig; contextView?: 'accumulated' | 'isolated'; } /** * Fluent builder for constructing PipelineConfigV2. * * @example * ```typescript * const pipeline = new PipelineBuilder('data-processing') * .addAgentStep('validator') * .addFunctionStep('transform', async (ctx) => transformData(ctx.input)) * .addConditionalStep('check-complete', { * condition: (ctx) => !ctx.outputs['validator']?.incomplete, * whenTrue: [{ type: 'agent', agentId: 'enricher', name: 'enrich' }], * }) * .build(); * ``` */ export declare class PipelineBuilder { private id; private steps; private description?; private utterances?; private hooks; private failFast; private stepNames; constructor(id: string); /** * Set pipeline description. */ setDescription(description: string): this; /** * Add utterances for intent matching. */ addUtterances(utterances: string[]): this; /** * Set fail-fast behavior (default: true). */ setFailFast(failFast: boolean): this; /** * Add an agent step. */ addAgentStep(agentId: string, options?: StepOptions): this; /** * Add a function step. */ addFunctionStep(nameOrFn: string | ((ctx: PipelineContext) => unknown | Promise), fnOrOptions?: ((ctx: PipelineContext) => unknown | Promise) | StepOptions, options?: StepOptions): this; /** * Add a conditional step. */ addConditionalStep(name: string, config: { condition: (ctx: PipelineContext) => boolean | Promise; whenTrue: PipelineStep[]; whenFalse?: PipelineStep[]; }, options?: Omit): this; /** * Add a nested pipeline step. */ addPipelineStep(pipelineId: string, options?: StepOptions): this; /** * Add a raw step (for advanced use cases). */ addStep(step: PipelineStep): this; /** * Register a hook for this pipeline. */ addHook(type: 'beforePipeline' | 'afterPipeline' | 'beforeStep' | 'afterStep' | 'onStepError', handler: HookHandler): this; /** * Build the pipeline configuration. */ build(): PipelineConfigV2; /** * Resolve step name, ensuring uniqueness. */ private resolveName; /** * Validate step name is unique. */ private validateStepName; } //# sourceMappingURL=builder.d.ts.map