import type { AgentConfig } from '../types/agentConfig.js'; import type { ChannelDriver } from '../types/channel.js'; import type { Flow } from '../types/flow.js'; import type { RunContext } from '../types/run-context.js'; import type { RunState } from '../runtime/durable/types.js'; export type FlowResult = { kind: 'ended'; reason: string; } | { kind: 'handoff'; to: string; reason?: string; } | { kind: 'awaitingUser'; }; export declare class FlowOscillationError extends Error { constructor(from: string, to: string); } /** * Drop everything a previous run of `flow` collected. Namespaced cache keys AND the * un-namespaced copies `reduceTransition` promotes onto `run.state` via Object.assign. * * Clearing only the cache was not enough. The promoted fields are a plain merge, and * `projectCollectData` omits any field the new extraction did not supply — so an optional * field answered on report #1 (say `accessNotes: "key under the mat"`) and left blank on * report #2 survives the merge and is read by the next action node as if it belonged to * report #2. A work order then ships another unit's access instructions. */ export declare function clearFlowCollectCache(state: Record, flow: Flow): void; export declare function runFlow(flow: Flow, run: RunState, driver: ChannelDriver, ctx: RunContext, agent?: AgentConfig): Promise;