/** * Workflow builders — Pipeline, FanOut, Loop, Fallback. * * These wrap @google/adk's SequentialAgent, ParallelAgent, and LoopAgent. */ import { BuilderBase } from "../core/builder-base.js"; import type { StatePredicate } from "../core/types.js"; /** * Sequential pipeline: runs agents in order. * * Usage: * const pipeline = new Pipeline("flow") * .step(new Agent("a").instruct("Step 1").writes("result")) * .step(new Agent("b").instruct("Step 2 using {result}")) * .build(); */ export declare class Pipeline extends BuilderBase { constructor(name: string); /** Append an agent (or builder) as the next step. */ step(agent: BuilderBase | unknown): this; build(): unknown; } /** * Parallel fan-out: runs agents concurrently. * * Usage: * const fanout = new FanOut("parallel") * .branch(new Agent("web").instruct("Search web.")) * .branch(new Agent("papers").instruct("Search papers.")) * .build(); */ export declare class FanOut extends BuilderBase { constructor(name: string); /** Add an agent (or builder) as a parallel branch. */ branch(agent: BuilderBase | unknown): this; build(): unknown; } /** * Loop: repeats a workflow up to N times or until a predicate is satisfied. * * Usage: * const loop = new Loop("refine") * .step(new Agent("writer").instruct("Write.")) * .step(new Agent("critic").instruct("Critique.")) * .maxIterations(3) * .build(); */ export declare class Loop extends BuilderBase { constructor(name: string); /** Append an agent (or builder) as a step in the loop body. */ step(agent: BuilderBase | unknown): this; /** Set maximum number of iterations. */ maxIterations(n: number): this; /** Set a termination predicate: stop looping when predicate returns true. */ until(predicate: StatePredicate): this; build(): unknown; } /** * Fallback chain: tries agents in order, first success wins. * * Usage: * const fallback = new Fallback("resilient", [fastAgent, strongAgent]); */ export declare class Fallback extends BuilderBase { private _children; constructor(name: string, children?: BuilderBase[]); /** Add a fallback alternative. */ attempt(agent: BuilderBase): this; protected _clone(): this; build(): unknown; } //# sourceMappingURL=workflow.d.ts.map