/** * Inter-task context assembly (Python `Process._build_task_context`). * * `retainFullContext` is the switch: with it every upstream result is folded * into the prompt; without it only the most recent one is, which is the whole * point of the flag (Python's comment calls it "Original behavior" vs "New * behavior"). Validation feedback from a failed guardrail is prepended so a * retry sees why the last attempt was rejected. */ import type { Task } from '../types'; /** One upstream result, in run order. */ export interface PreviousOutput { name: string; raw: string; } export declare const CONTEXT_HEADER = "\nInput data from previous tasks:"; /** * The results the task's own `context` list contributes, in declaration order. * String context items are literal input; Task items contribute their result. */ export declare function contextOutputs(task: Task): PreviousOutput[]; /** Render `validationFeedback` the way Python's retry prompt does. */ export declare function renderValidationFeedback(feedback: unknown): string | undefined; /** * Build the context block for `task`. * * @param task - the task about to run. * @param previous - upstream results in run order (workflow `nextTasks` edges). * The runner supplies these; the task's own `context` list is read from the * task itself. * * Consuming `validationFeedback` clears it, matching Python, so the feedback is * injected exactly once. */ export declare function buildTaskContext(task: Task, previous?: readonly PreviousOutput[]): string;