Registers a state field with its default value and reducer.
Adds a node to the graph. Supports optional precondition hooks (Issue #997) and verify hook (Issue #994).
Optionalopts: {Adds a fixed edge between two nodes.
Optionaloptions: { maxTraversals?: number }Adds a conditional edge with a routing function. The router inspects state and returns the target node ID. All possible targets must be declared for compile-time validation.
Compiles the graph, validating all structural invariants. Returns a CompileResult — either a validated CompiledGraph or a compile error.
Fluent builder for graph-based workflows.
Usage: