Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionRequest ¶
type ActionRequest struct {
Type string // e.g., "CLI_PRINT", "HTTP_GET"
Payload any // The data needed to perform the action
}
ActionRequest represents a side-effect that the engine requests the host to perform.
type ActionResponse ¶
ActionResponse represents the result of an ActionRequest.
type Node ¶
type Node struct {
ID string
Type string // e.g., "text", "question", "logic"
// Content holds the raw data for this node.
// For a text node, it might be the markdown content.
// For a logic node, it might be the script or parameters.
Content []byte
// Metadata allows for extensible key-value pairs.
Metadata map[string]string
// Transitions defines the possible paths from this node.
Transitions []Transition
}
Node represents a logical unit in the graph. It can contain text content (for Wiki-style) or logic instructions (for Logic-style).
type State ¶
type State struct {
// CurrentNodeID is the identifier of the active node.
CurrentNodeID string
// Memory holds variable state for the session.
Memory map[string]any
// History could track the path taken (optional for now, but good for debugging)
History []string
}
State represents the current snapshot of the execution.
type Transition ¶
type Transition struct {
FromNodeID string `json:"from_node_id,omitempty"`
ToNodeID string `json:"to_node_id"`
// Condition is a simple expression string that must evaluate to true
// for this transition to be valid. e.g., "user_age >= 18"
// If empty, it's considered an "always" transition (default).
Condition string `json:"condition,omitempty"`
}
Transition defines a rule to move from one node to another.
Click to show internal directories.
Click to hide internal directories.