Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindSource ¶
FindSource resolves a workflow by name (same search order as LoadByName) and returns its RAW markdown source plus the path it was found at. The raw bytes are what crosses the Backend seam: an isolated worker may share no filesystem with the host, so it re-parses the shipped source instead of reading any file itself.
Types ¶
type Edge ¶
Edge is a directed dependency: From's output is fed to To's prompt context. Cond is an optional `if` guard; when non-nil the edge only "fires" (counts toward To's readiness) if the predicate evaluates truthy at runtime. A nil Cond is an unconditional edge.
type Predicate ¶
type Predicate struct {
Src string // original source incl. quotes — for validate + errors
// contains filtered or unexported fields
}
Predicate is a compiled edge guard. Compilation happens at parse time so template-syntax and unknown-func errors surface in `/workflow validate` rather than mid-run.
type Result ¶
type Result struct {
Outputs map[string]string // role name → final assistant text ("" for skipped)
Fields map[string]map[string]string // role name → parsed structured fields
Skipped map[string]bool // role name → true if a conditional edge skipped it
Last string // output of the last non-skipped role in topological order
}
Result is the outcome of a workflow run.
func Run ¶
Run executes the workflow with sibling parallelism. Roles whose dependencies have all completed launch concurrently; their child agents share the parent Provider's Pool, which is what actually serialises inflight LLM calls when the configured concurrency is 1.
On the first role error the run-context is cancelled and the runner drains. The first error is returned; later errors are logged.
type Role ¶
type Role struct {
Name string
Model string // optional override; "" = inherit parent
AllowedTools []string // optional restriction
PromptTemplate *template.Template
}
Role describes one agent in the workflow.
type RunDeps ¶
type RunDeps struct {
// Providers is the full set of configured LLM endpoints, keyed by
// the user-facing label (e.g. "qwen-fast"). Per-role `model:` in
// the YAML names a key here. Must be non-empty.
Providers map[string]*provider.Provider
// DefaultProvider is the provider name a role falls back to when
// its `model:` field is empty. Empty string = alphabetical-first.
DefaultProvider string
Bus *bus.Bus
Registry *tools.Registry
Perms *permissions.Checker
Cwd string
MaxTurns int
GlobalAgents *atomic.Int64
MaxAgents int
MaxDepth int
Depth int
Writer tools.SessionWriter // optional; persists per-role messages with role's agent id
GitAttribution string
GitAttributionName string
WebFetchAllowHosts []string
ToolTimeouts tools.ToolTimeouts // bash execution budget, forwarded to each role agent
RestrictedRoots []string
// Capabilities is the tier-3 broker handle. Non-nil only when the
// engine runs inside a network-sealed worker, so role agents broker
// web egress exactly like the interactive agent (nil keeps today's
// direct-dial behavior on the local backend).
Capabilities tools.CapabilityRequester
// IsolationNote is the honest # Environment sentence describing the
// box the roles run in, forwarded verbatim to each role agent.
IsolationNote string
}
RunDeps is what the runner needs from the surrounding agent stack.
type Workflow ¶
type Workflow struct {
Name string
Roles map[string]Role
Edges []Edge
RoleOrder []string // topological order; populated by topoSort()
}
Workflow is a parsed declarative agent workflow.
func LoadByName ¶
LoadByName resolves a workflow by name. Search order:
- ./.enso/workflows/<name>.md (project)
- $XDG_CONFIG_HOME/enso/workflows/<name>.md (user)