/** * `loopOver` / `loopVar` / `loopState` fan-out. * * Port of the loop branch in * `praisonaiagents/workflows/workflows.py::_run_step_loop`: when a step names a * `loop_over` variable holding a list, the step runs once per item with * `all_variables[loop_var]` bound to that item and `_loop_index` to its * position. Here the fan-out is materialised as one child task per item so the * runner can execute them like any other tasks; each child records where it sat * in the loop on `loopState` (Python surfaces `loop_state` in the callback * metadata). * * Returns `TaskConfig` values rather than `Task` instances so the module never * imports the `Task` class at run time. */ import type { Task, TaskConfig } from '../types'; /** Python's `_loop_index` key. */ export declare const LOOP_INDEX_VAR = "_loop_index"; /** * The execution-affecting settings a fan-out child inherits from its parent, so * a task that combines `loopOver` / `inputFile` with a handler, output shaping, * retries, hooks, memory, knowledge or caching keeps those behaviours on every * iteration. Per-item fields (`description`, `name`, `nextTasks`, `isStart`, * `variables`, `loopState`, and — for the input-file path — `taskType` / * `condition`) are set by the caller and deliberately not copied here. */ export declare function inheritedExecutionConfig(task: Task): Partial; /** * Expand `task` into one config per item of `variables[task.loopOver]`. * * @returns `[]` when the task has no `loopOver`, when the named variable is * missing, or when it does not hold a list (Python logs * "loop_over variable '' is not iterable" and runs the step once). */ export declare function loopTaskConfigs(task: Task, variables?: Record): TaskConfig[]; /** * Whether `task` asks for a loop fan-out at all — true even when the variable * turns out to be missing, so a runner can tell "no loop" from "empty loop". */ export declare function isLoopTask(task: Task): boolean;