Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result struct {
Outputs map[string]string // role name → final assistant text
Last string // output of the last 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]*llm.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
Transcripts *tools.Transcripts // optional; captures per-role histories
Writer *session.Writer // optional; persists per-role messages with role's agent id
GitAttribution string
GitAttributionName string
WebFetchAllowHosts []string
RestrictedRoots []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)
- ~/.enso/workflows/<name>.md (user)