import type { NodeOutput } from "@skaile/workspaces/types"; import type { FlowDefinition, FlowNode, NodeExecutionSnapshot } from "./types.js"; /** One deterministic router choice being settled in the current atomic batch. */ export interface RouterSettlement { routerNodeId: string; selectedTarget: string | null; } /** Internal result of evaluating one already-admitted router. */ export type RouterSelection = { selectedTarget: string | null; } | { unresolved: "not-ready" | "no-match"; }; /** Evaluate ordered routes for a router whose availability was already established. */ export declare function evaluateRouterSelection(flow: FlowDefinition, router: FlowNode, snapshots: Map): RouterSelection; /** Encode a router choice in the existing durable node-output envelope. */ export declare function routerSelectionOutput(selectedTarget: string | null): NodeOutput; /** Decode and validate a completed router's engine-owned selection summary. */ export declare function persistedRouterSelection(router: FlowNode, snapshot: NodeExecutionSnapshot | undefined): { selectedTarget: string | null; } | undefined; /** * Plan exclusive branch skips for all known router choices as one coordinated settlement. * * Only hard `flow` edges participate. The graph is indexed once, then each distinct losing * target performs a linear adjacency walk; optional and parallel edges can neither spread nor * preserve exclusivity. A selected route, a still-live unsettled router, shared convergence, or * an incoming hard predecessor outside the losing region protects that node and its descendants. */ export declare function planRouterSkips(flow: FlowDefinition, snapshots: Map, settlements: readonly RouterSettlement[]): string[]; /** * Return every possible target branch gated by an unsettled router. * * Gating follows hard `flow` descendants only. A selected route, shared convergence, or another * live hard predecessor protects a node, matching settlement pruning without mutating snapshots. */ export declare function unsettledRouterBranchIds(flow: FlowDefinition, snapshots: Map): Set; /** * Return one actually available, decidable router per source ownership component. * * Every source-component member remains ungated for normal admission. Within a settlement wave, * definition order chooses the first member that is both available and decidable; unresolved or * blocked peers cannot starve it. Limiting each component to one choice prevents a router from * completing atomically after that same wave makes its branch losing. Independent source * components can still settle together. */ export declare function availableRouterFrontier(flow: FlowDefinition, snapshots: Map): FlowNode[]; //# sourceMappingURL=router-settlement.d.ts.map