featherbit UI
    Preparing search index...

    Function policyToEdges

    • Converts a gateway Policy's edges into styled ReactFlow edges.

      Each node_id.port endpoint is split with splitEdge. A source port of out is normalized to the success handle (PluginNode renders no out handle). Each edge's color/animation is driven by its source port's declared PortDecl.kind (via portKindFor): error → red (var(--error)) and animated, outcome → accent (var(--accent)), success (or an unknown port/type) → green (var(--success)). Edge ids are positional (e-<index>).

      Parameters

      • policy: Policy

        Policy whose edges use the node_id.port endpoint format.

      • portSpecs: PortSpecLookup

        Catalog-derived lookup used to resolve each source port's kind.

      • supernodes: Supernode[] = []

        Resolved supernode definitions, used to derive a supernode source node's actual ports via supernodePortSpec rather than the (non-existent) catalog entry for the supernode type.

      Returns Edge[]

      ReactFlow edges targeting each node's in handle.

      The endpoint format mirrors what the Rust engine parses in src/graph/engine.rs (parse_edge_endpoint), where error-port edges feed the error-routing table used by CompiledGraph::execute and outcome-port edges feed the named-port routing table.