Documentation
¶
Overview ¶
Package orchestrator coordinates agent tasks and dependencies.
Index ¶
- type Config
- type Orchestrator
- func (o *Orchestrator) ACPSessionControl(taskID, action, message, mode string) (interface{}, error)
- func (o *Orchestrator) Cancel(taskID string) error
- func (o *Orchestrator) Delete(taskID string) error
- func (o *Orchestrator) GetStats() Stats
- func (o *Orchestrator) GetTask(taskID string) (*models.Task, error)
- func (o *Orchestrator) ListPersonas() []string
- func (o *Orchestrator) ListTasks(req models.ListRequest) ([]*models.Task, error)
- func (o *Orchestrator) Pause(taskID string) (*models.Task, error)
- func (o *Orchestrator) Purge(taskID string) error
- func (o *Orchestrator) Resume(ctx context.Context, taskID string, opts ResumeOptions) (*models.Task, error)
- func (o *Orchestrator) Retry(ctx context.Context, taskID string, opts RetryOptions) (*models.Task, error)
- func (o *Orchestrator) SetProgress(taskID string, percentage int, description string) error
- func (o *Orchestrator) Shutdown() error
- func (o *Orchestrator) Spawn(ctx context.Context, req models.SpawnRequest) (*models.Task, error)
- func (o *Orchestrator) Wait(ctx context.Context, taskID string, timeout time.Duration) (*models.Task, error)
- func (o *Orchestrator) WaitMultiple(ctx context.Context, taskIDs []string, waitAll bool, timeout time.Duration) (map[string]*models.Task, error)
- type ResumeOptions
- type RetryOptions
- type Stats
- type TaskProgressInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
StorePath string
LogDir string
MaxParallel int
DefaultMCPConfig string
DefaultEngine string
PersonaPath string
AppConfig *mesnadaconfig.Config // Full app config for passing to managers
}
Config holds orchestrator configuration.
type Orchestrator ¶
type Orchestrator struct {
// contains filtered or unexported fields
}
Orchestrator coordinates the execution of CLI agents.
func (*Orchestrator) ACPSessionControl ¶
func (o *Orchestrator) ACPSessionControl(taskID, action, message, mode string) (interface{}, error)
ACPSessionControl sends a control command to an active ACP session. This delegates to the agent manager's ACP session control.
func (*Orchestrator) Cancel ¶
func (o *Orchestrator) Cancel(taskID string) error
Cancel cancels a running task.
func (*Orchestrator) Delete ¶
func (o *Orchestrator) Delete(taskID string) error
Delete removes a task from the store. If the task is running, it will attempt to cancel it first. If the process is already dead or doesn't exist, the task will be deleted anyway.
func (*Orchestrator) GetStats ¶
func (o *Orchestrator) GetStats() Stats
GetStats returns orchestrator statistics.
func (*Orchestrator) GetTask ¶
func (o *Orchestrator) GetTask(taskID string) (*models.Task, error)
GetTask retrieves a task by ID.
func (*Orchestrator) ListPersonas ¶
func (o *Orchestrator) ListPersonas() []string
ListPersonas returns a list of available persona names.
func (*Orchestrator) ListTasks ¶
func (o *Orchestrator) ListTasks(req models.ListRequest) ([]*models.Task, error)
ListTasks lists tasks matching the filter.
func (*Orchestrator) Pause ¶
func (o *Orchestrator) Pause(taskID string) (*models.Task, error)
Pause pauses a running or pending task. Pausing stops the underlying Copilot process (if any) and marks the task as paused.
func (*Orchestrator) Purge ¶
func (o *Orchestrator) Purge(taskID string) error
Purge stops a running task (if needed), deletes its log file (if any), and removes it from the store. This operation is intentionally idempotent: purging a missing task returns nil.
func (*Orchestrator) Resume ¶
func (o *Orchestrator) Resume(ctx context.Context, taskID string, opts ResumeOptions) (*models.Task, error)
Resume creates a new task to continue work from a previously paused task.
func (*Orchestrator) Retry ¶
func (o *Orchestrator) Retry(ctx context.Context, taskID string, opts RetryOptions) (*models.Task, error)
Retry relaunches a failed task or reactivates a pending task. For failed tasks, it creates a new task reusing the same log file (append mode) with the original prompt plus a retry notice. For pending tasks, it checks dependencies and starts the task if ready.
func (*Orchestrator) SetProgress ¶
func (o *Orchestrator) SetProgress(taskID string, percentage int, description string) error
SetProgress updates the progress of a running task.
func (*Orchestrator) Shutdown ¶
func (o *Orchestrator) Shutdown() error
Shutdown gracefully shuts down the orchestrator.
func (*Orchestrator) Spawn ¶
func (o *Orchestrator) Spawn(ctx context.Context, req models.SpawnRequest) (*models.Task, error)
Spawn creates and optionally starts a new agent task.
type ResumeOptions ¶
type ResumeOptions struct {
Prompt string
Model string
Background bool
Timeout string
Tags *[]string
}
ResumeOptions controls how a paused task is resumed.
type RetryOptions ¶
type RetryOptions struct {
Background bool
}
RetryOptions controls how a failed or pending task is retried.
type Stats ¶
type Stats struct {
Total int `json:"total"`
Pending int `json:"pending"`
Running int `json:"running"`
Paused int `json:"paused"`
Completed int `json:"completed"`
Failed int `json:"failed"`
Cancelled int `json:"cancelled"`
RunningProgress map[string]TaskProgressInfo `json:"running_progress,omitempty"`
}
Stats holds orchestrator statistics.