footprintjs - v11.2.0
    Preparing search index...

    Interface TraverserOptions<TOut, TScope>

    interface TraverserOptions<TOut = any, TScope = any> {
        buildTimeStructure?: EngineSerializedPipelineStructure;
        correlation?: RunCorrelation;
        entry?: StageNode<TOut, TScope>;
        executionCounter?: { value: number };
        executionEnv?: ExecutionEnv;
        executionRuntime: IExecutionRuntime;
        flowRecorders?: FlowRecorder[];
        logger: ILogger;
        maxDepth?: number;
        maxIterations?: number;
        narrativeEnabled?: boolean;
        narrativeGenerator?: IControlFlowNarrative;
        parentMountRuntimeStageId?: string;
        parentSubflowId?: string;
        pendingPauses?: readonly QueuedPause[];
        readOnlyContext?: unknown;
        resume?: ResumeEntry<TOut, TScope>;
        root: StageNode<TOut, TScope>;
        runId: string;
        scopeFactory: ScopeFactory<TScope>;
        scopeProtectionMode?: ScopeProtectionMode;
        signal?: AbortSignal;
        stageMap: Map<string, StageHandler<TOut, TScope>>;
        streamHandlers?: StreamHandlers;
        subflows?: Record<string, { root: StageNode<TOut, TScope> }>;
        throttlingErrorChecker?: (error: unknown) => boolean;
        visitCounts?: Map<string, number>;
    }

    Type Parameters

    • TOut = any
    • TScope = any
    Index
    correlation?: RunCorrelation

    The leg's correlation (10.1, attempt/correlation.ts · resolveCorrelation) — stamped onto every TraversalContext and the snapshot, inherited by subflow traversers BY REFERENCE. Absent when the env gave none.

    Optionalentry

    Where execute() starts when not at root — a resume's one-shot re-entry (M2): the paused stage's stand-in, or the mount of the first subflow on the pause path, each with its dispatcher's continuation attached. Visited once, first, and never registered anywhere an id can reach it, so a loop back to the paused stage finds the REAL stage. Consumed by the first execute().

    executionCounter?: { value: number }

    Shared execution counter from parent traverser. Subflows continue the parent's numbering.

    executionEnv?: ExecutionEnv

    Execution environment — propagates to subflows automatically.

    executionRuntime: IExecutionRuntime
    flowRecorders?: FlowRecorder[]

    Pre-configured FlowRecorders to attach when narrative is enabled.

    logger: ILogger
    maxDepth?: number

    Maximum nested executeNode depth (tree nesting — branch/fork dispatch and dynamic recursion, NOT linear chains or loop iterations, which run flat). Defaults to FlowchartTraverser.MAX_EXECUTE_DEPTH (500).

    maxIterations?: number

    Maximum loop iterations per node (the ContinuationResolver guard). Defaults to DEFAULT_MAX_ITERATIONS (1000). Propagated to subflow traversers. Must be >= 1.

    narrativeEnabled?: boolean
    narrativeGenerator?: IControlFlowNarrative

    Pre-configured narrative generator. If provided, takes precedence over flowRecorders and narrativeEnabled. Used by the subflow traverser factory to share the parent's narrative generator with subflow traversers.

    parentMountRuntimeStageId?: string

    When this traverser runs inside a subflow, the runtimeStageId of the subflow MOUNT stage in the parent traverser. Used as the parentRuntimeStageId fallback for stages whose StageContext has no parent (the subflow's own root context is created fresh by SubflowExecutor) so runtime ancestor chains cross subflow boundaries (RFC-003 D1).

    parentSubflowId?: string

    When this traverser runs inside a subflow, set this to the subflow's ID. Propagated to TraversalContext so narrative entries carry the correct subflowId.

    pendingPauses?: readonly QueuedPause[]

    Parallel siblings' pauses waiting at this level (a resume, 9.28.0): once entry's chain ends, execute() raises the first again (the rest wait behind it); a pause raised from inside the chain carries them all. Only with entry; consumed by the first execute(). See ResumeEntry.

    readOnlyContext?: unknown

    The resume's one-shot re-entry (M2), shared by reference with every nested traverser (the execution counter's precedent): each subflow on the pause path takes its captured state and its entry point exactly once, on its first entry. See ResumeEntry. Undefined on normal run() paths.

    The graph this traverser walks — and the graph every id resolves against (the node map behind every loopTo, the DFS fallback). execute() starts here unless entry says otherwise.

    runId: string

    Per-executor.run() identifier. Threaded into every TraversalContext this traverser produces so recorders can scope state to a single run. Subflow traversers inherit the parent's runId (the subflow is part of the same run from the consumer's POV). Required field — every event needs it. See runner/runId.ts.

    scopeFactory: ScopeFactory<TScope>
    scopeProtectionMode?: ScopeProtectionMode
    signal?: AbortSignal
    stageMap: Map<string, StageHandler<TOut, TScope>>
    streamHandlers?: StreamHandlers
    subflows?: Record<string, { root: StageNode<TOut, TScope> }>
    throttlingErrorChecker?: (error: unknown) => boolean
    visitCounts?: Map<string, number>

    Shared per-run visit-count map (keyed by stageId) from the parent traverser. Drives TraversalContext.loopIteration. Shared with subflows so a stage re-entered across a subflow re-mount keeps a correct, monotonic iteration count — the same single-map semantics the narrative recorder uses.