Private Readonly _agentPrivate Readonly _createPrivate Readonly _nodesReadonly enabledPrivate _reachableReachable set from root plus deterministic discovery order (BFS following declared edge order, root first). Used as a tie-break for topological traversal.
Returns a new LDGraphTracker for a fresh graph run.
Call this once per graph run. Each call produces a tracker with a fresh runId
that groups all events for that run.
Returns the children of the node identified by nodeKey.
The agent config key of the parent node.
Returns the underlying raw graph configuration from LaunchDarkly.
Returns the node with the given key, or null if not found.
The agent config key to look up.
Returns all nodes that have a direct edge to the node identified by nodeKey.
The agent config key of the child node.
Traverses the graph in reverse topological order (descendants-first).
A node is visited only after every reachable descendant has been visited. The root is always visited last. When multiple nodes are simultaneously eligible, they are visited in graph-discovery order for determinism. Cyclic graphs are cycle-safe — each reachable node is visited exactly once (including graphs with no terminal nodes).
Each call to fn receives a fresh context containing the caller-provided
initialExecutionContext plus the return values of exactly that node's
reachable descendants — not results from unrelated parallel-branch nodes.
Callback invoked for each node. Its return value is stored under the node's config key for use by dependent nodes.
Optional initial context visible to every node.
Returns the root node of the graph.
Returns all terminal nodes (nodes with no outgoing edges).
Traverses the graph in topological order from the root (predecessors-first).
A node is visited only after every reachable predecessor has been visited. The root is visited first. When multiple nodes are simultaneously eligible, they are visited in graph-discovery order (BFS from root following declared edge order) for determinism. Cyclic graphs are cycle-safe — each reachable node is visited exactly once.
Each call to fn receives a fresh context containing the caller-provided
initialExecutionContext plus the return values of exactly that node's
reachable predecessors — not results from unrelated parallel-branch nodes.
Callback invoked for each node. Its return value is stored under the node's config key for use by dependent nodes.
Optional initial context visible to every node.
Static buildBuilds a node map from a raw agent graph flag value and a map of pre-fetched agent configs.
Raw graph flag value from LaunchDarkly.
Map of agent config key to resolved LDAIAgentConfig.
Record mapping agent config keys to AgentGraphNode instances.
Static collectCollects every unique node key referenced in the graph (root + all edge sources and targets).
Generated using TypeDoc
Encapsulates an agent graph configuration and its pre-built node collection.
Provides graph-level orchestration including relationship queries (parent/child), topological traversal in both forward and reverse directions, and graph tracker creation.
Obtain an instance via LDAIClient.agentGraph. When the graph is disabled or invalid, the returned instance has enabled set to
falseand an empty node collection.