Documentation
¶
Overview ¶
Package coordinator implements coordinator mode: a top-level agent that decomposes work and delegates each unit to isolated "worker" subagents instead of doing the work itself. It offers two paths: an LLM-driven one (expose AgentTool + SystemSegment so the model spawns workers via the Agent tool) and a programmatic one (RunParallel fans tasks out to workers concurrently and returns their results).
Index ¶
Constants ¶
const DefaultWorkerPrompt = `` /* 649-byte string literal not displayed */
DefaultWorkerPrompt is the default system prompt for worker subagents.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Provider llm.Provider
WorkerTools *tool.Registry // tools available to workers (e.g. the core toolset)
WorkerPrompt []string // worker system prompt (default DefaultWorkerPrompt)
PermissionMode permission.Mode // workers' permission mode (default acceptEdits)
WorkingDir string
MaxTurns int // per-worker turn cap
MaxDepth int // subagent recursion cap (default 3)
MaxParallel int // bounded concurrency for RunParallel (default 4)
CanUseTool permission.CanUseTool
Hooks harness.HookRunner
}
Config configures coordinator mode.
func (*Config) AgentTool ¶
AgentTool returns the Agent tool the coordinator LLM uses to spawn workers. Add it (and nothing else mutating) to the coordinator session's tools.
func (*Config) RunParallel ¶
RunParallel fans tasks out to workers concurrently (bounded by MaxParallel) and returns results in task order.
func (*Config) SystemSegment ¶
SystemSegment returns coordinator guidance to append to the system prompt.