Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConditionEvaluator ¶ added in v0.3.0
ConditionEvaluator is a function that determines if a transition condition is met.
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine is the core state machine runner.
func NewEngine ¶
func NewEngine(loader ports.GraphLoader, evaluator ConditionEvaluator) *Engine
NewEngine creates a new engine with dependencies. The engine is immutable after creation.
func (*Engine) Inspect ¶ added in v0.3.0
Inspect returns a structured view of the entire graph by walking all nodes.
func (*Engine) Navigate ¶ added in v0.3.2
func (e *Engine) Navigate(ctx context.Context, currentState *domain.State, input string) (*domain.State, error)
Navigate determines the next state based on input.
func (*Engine) Render ¶ added in v0.3.2
func (e *Engine) Render(ctx context.Context, currentState *domain.State) ([]domain.ActionRequest, bool, error)
Render calculates the presentation for the current state. It loads the node and generates actions (e.g. print text) but does NOT change state. It returns actions, isTerminal (true if no transitions), and error.
Click to show internal directories.
Click to hide internal directories.