MCPcopy Create free account
hub / github.com/ForestHubAI/edge-agents / Next

Method Next

go/engine/node.go:111–120  ·  view source on GitHub ↗

Next applies the outgoing transition's side effects (e.g. AgentTask prompt evaluation) against the scope and returns the target node ID. Returns StateIdle with a nil error when no transition is wired to the port.

(port string, scope *Scope)

Source from the content-addressed store, hash-verified

109// evaluation) against the scope and returns the target node ID. Returns
110// StateIdle with a nil error when no transition is wired to the port.
111func (b *LinearNode) Next(port string, scope *Scope) (string, error) {
112 tr, ok := b.transitions[port]
113 if !ok {
114 return StateIdle, nil
115 }
116 if err := tr.Apply(scope); err != nil {
117 return "", fmt.Errorf("node %s port %s: %w", b.id, port, err)
118 }
119 return tr.TargetID, nil
120}
121
122// BranchingNode is a base for a node that can decide between multiple
123// state transitions per port (e.g. LLM agent)

Callers 11

TestLinearNode_NextFunction · 0.95
ExecuteMethod · 0.80
ExecuteMethod · 0.80
ExecuteMethod · 0.80
ExecuteMethod · 0.80
ExecuteMethod · 0.80
ExecuteMethod · 0.80
ExecuteMethod · 0.80
ExecuteMethod · 0.80
ExecuteMethod · 0.80
ExecuteMethod · 0.80

Calls 1

ApplyMethod · 0.80

Tested by 1

TestLinearNode_NextFunction · 0.76