/** * NodeResolver — DFS node lookup + subflow reference resolution. * * Responsibilities: * - Find nodes by ID via recursive depth-first search (for back-edge/loop support) * - Resolve subflow reference nodes to actual subflow structures * - Evaluate deciders to determine next node in branching scenarios */ import type { StageNode } from '../graph/StageNode.js'; import type { HandlerDeps } from '../types.js'; export declare class NodeResolver { private deps; private readonly nodeIdMap; private readonly getEffectiveChildren?; constructor(deps: HandlerDeps, nodeIdMap?: Map>, /** * Overlay-aware children accessor injected by the traverser. The DFS * fallback resolves loop targets against the LIVE runtime shape — a node * patched by a dynamic StageNode return carries its children in the * traverser-local overlay, not on the shared built-chart node. */ getEffectiveChildren?: (node: StageNode) => StageNode[] | undefined); /** * O(1) node lookup via pre-built ID map. * Falls back to DFS from startNode (for dynamic nodes added at runtime * or subflow-local lookups that use an explicit startNode). */ findNodeById(nodeId: string, startNode?: StageNode): StageNode | undefined; /** * DFS search for a node by ID. * Used as fallback when the node is not in the pre-built map. */ private _dfs; /** * Resolve a subflow reference node to its actual structure. * * Reference nodes are lightweight placeholders (isSubflowRoot but no fn/children). * The actual structure lives in the subflows dictionary. */ resolveSubflowReference(node: StageNode): StageNode; }