/** * Higher-order composition patterns. * * Mirrors Python's `adk_fluent._patterns`. Each function takes builders * and returns a new builder describing a common multi-agent topology. * * reviewLoop, mapReduce, cascade, fanOutMerge, chain, conditional, supervised */ import { type BuilderBase } from "../core/builder-base.js"; import type { StatePredicate } from "../core/types.js"; /** * Worker / reviewer loop. The worker produces a draft (writes to * ``draft_key``); the reviewer scores it on ``quality_key``. Loops until * the score reaches ``target`` or ``maxRounds`` iterations elapse. */ export interface ReviewLoopOptions { qualityKey?: string; draftKey?: string; target?: number; maxRounds?: number; name?: string; } export declare function reviewLoop(worker: BuilderBase, reviewer: BuilderBase, opts?: ReviewLoopOptions): BuilderBase; /** * Map-reduce pattern. ``mapper`` is applied to each item in * ``state[itemsKey]``; ``reducer`` aggregates the results into * ``state[resultKey]``. */ export interface MapReduceOptions { itemsKey?: string; resultKey?: string; name?: string; } export declare function mapReduce(mapper: BuilderBase, reducer: BuilderBase, opts?: MapReduceOptions): BuilderBase; /** * Cascade: try ``agents[0]`` first, fall back to ``agents[1]``, then * ``agents[2]``, and so on. Equivalent to a Fallback chain. */ export declare function cascade(...agents: BuilderBase[]): BuilderBase; /** * Fan-out to multiple agents in parallel, then merge the results into a * single state key. */ export declare function fanOutMerge(agents: BuilderBase[], opts?: { mergeKey?: string; name?: string; }): BuilderBase; /** * Sequential pipeline shorthand. Equivalent to chaining ``.then()``. */ export declare function chain(...agents: BuilderBase[]): BuilderBase; /** * Conditional execution. Runs ``thenAgent`` when the predicate returns * true; runs ``elseAgent`` otherwise. ``elseAgent`` is optional. */ export declare function conditional(pred: StatePredicate, thenAgent: BuilderBase, elseAgent?: BuilderBase): BuilderBase; /** * Supervised execution. The supervisor reviews the worker's output and may * cause a re-run by writing a falsy ``approved`` flag to state. */ export declare function supervised(worker: BuilderBase, supervisor: BuilderBase, opts?: { approvedKey?: string; maxRounds?: number; name?: string; }): BuilderBase; //# sourceMappingURL=index.d.ts.map