runtime

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2026 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, evaluator ConditionEvaluator) *Engine

NewEngine creates a new engine with dependencies. The engine is immutable after creation.

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) Navigate added in v0.3.2

func (e *Engine) Navigate(ctx context.Context, currentState *domain.State, input any) (*domain.State, error)

Navigate determines the next state based on input. Input can be a string (user text) or a domain.ToolResult (side-effect result).

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.

Jump to

Keyboard shortcuts

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