Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AgentStep ¶
AgentStep is a simple agent execution step
func (*AgentStep) GetOutputName ¶
GetOutputName returns the name to store output under
type Compiler ¶
type Compiler struct {
// contains filtered or unexported fields
}
Compiler compiles AST to executable workflow
type ForeachStep ¶
type ForeachStep struct {
UsesAgent *Agent // Optional: agent to generate array
Selector cel.Program // Optional: CEL program to extract array
Job *Job // Job to execute for each item (resolved)
JobName string // Job name for resolution
OutputName string
Retry *Retry
}
ForeachStep executes a job for each item in an array
func (*ForeachStep) GetOutputName ¶
func (step *ForeachStep) GetOutputName() string
GetOutputName returns the name to store output under
type RouterStep ¶
type RouterStep struct {
Agent *Agent
OutputName string
RouteNodes []ast.RouteNode // For reference
Conditions []cel.Program // Compiled CEL expressions
Routes map[string]*Job // Resolved job references
DefaultJob string // Default job name
Default *Job // Resolved default job
Retry *Retry
}
RouterStep is a conditional routing step
func (*RouterStep) GetOutputName ¶
func (step *RouterStep) GetOutputName() string
GetOutputName returns the name to store output under
type RunStep ¶
type RunStep struct {
Command string // Compiled template for the command
Shell string // Shell to use (sh, bash, zsh, etc.)
OutputName string
Retry *Retry
}
RunStep executes a shell command
func (*RunStep) GetOutputName ¶
GetOutputName returns the name to store output under
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
active MCP server session
type Step ¶
type Step interface {
Prompt(ctx context.Context, opt ...chatter.Opt) error
GetOutputName() string
}
Step is an interface for executable steps
type Workflow ¶
type Workflow struct {
Name string
About string
Entrypoint string // Optional: default job name, or "main" if empty
Schema ast.SchemaNode
Jobs map[string]*Job
}
Workflow represents a compiled, executable workflow
type WorkflowContext ¶
type WorkflowContext struct {
// Input is the original workflow input
Input any
// State is a shared key-value store for workflow data
State map[string]any
// Steps holds named outputs from previous steps
Steps map[string]any
// Current is the most recent step output (for chaining)
Current any
}
WorkflowContext holds the execution state for a workflow
func GetWorkflowContext ¶
func GetWorkflowContext(ctx context.Context) *WorkflowContext
GetWorkflowContext extracts the workflow context from Go context
func (*WorkflowContext) Get ¶
func (c *WorkflowContext) Get(key string) (any, bool)
Get retrieves a value from the workflow state
func (*WorkflowContext) GetStepOutput ¶
func (c *WorkflowContext) GetStepOutput(name string) (any, bool)
GetStepOutput retrieves the output of a named step
func (*WorkflowContext) Set ¶
func (c *WorkflowContext) Set(key string, value any)
Set stores a value in the workflow state
func (*WorkflowContext) SetStepOutput ¶
func (c *WorkflowContext) SetStepOutput(name string, output any)
SetStepOutput stores the output of a named step
func (*WorkflowContext) ToMap ¶
func (c *WorkflowContext) ToMap() map[string]any
ToMap returns the full context as a map for template rendering