runtime

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2025 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultEvaluator added in v0.3.0

func DefaultEvaluator(ctx context.Context, condition string, input string) (bool, error)

DefaultEvaluator implements the basic "condition: input == 'value'" logic.

Types

type ConditionEvaluator added in v0.3.0

type ConditionEvaluator func(ctx context.Context, condition string, input string) (bool, error)

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) *Engine

NewEngine creates a new engine with dependencies.

func (*Engine) Inspect added in v0.3.0

func (e *Engine) Inspect() ([]domain.Node, error)

Inspect returns a structured view of the entire graph by walking all nodes.

func (*Engine) SetEvaluator added in v0.3.0

func (e *Engine) SetEvaluator(eval ConditionEvaluator)

SetEvaluator sets the condition evaluator for the engine.

func (*Engine) Step

func (e *Engine) Step(ctx context.Context, currentState *domain.State, input string) ([]domain.ActionRequest, *domain.State, error)

Step executes a single step in the state machine. It loads the current node, evaluates transitions, and returns action requests. For MVP, it doesn't persist state, just inputs state and outputs next state + actions. But wait, the Step function usually takes the current State and Input? BOOTSTRAP: "- Input: Estado Atual + Grafo de Decisão + Input do Usuário."

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL