Versions in this module Expand all Collapse all v0 v0.1.0 Jul 11, 2026 Changes in this version + const ErrCodeCancelled + const ErrCodeExecution + const ErrCodeInternal + const ErrCodeLLM + const ErrCodeNotFound + const ErrCodeRateLimited + const ErrCodeTimeout + const ErrCodeUnauthorized + const ErrCodeUnavailable + const ErrCodeValidation + const HealthStatusDegraded + const HealthStatusHealthy + const HealthStatusUnhealthy + func IsWorkerError(err error) bool + type AgentOpsConfig struct + Enabled bool + Store agentops.Store + type BaseWorker struct + func NewBaseWorker(cfg WorkerConfig) BaseWorker + func (b *BaseWorker) AgentOps() agentops.Store + func (b *BaseWorker) Config() WorkerConfig + func (b *BaseWorker) Execute(ctx context.Context, req *Request) (*Response, error) + func (b *BaseWorker) Health(ctx context.Context) HealthStatus + func (b *BaseWorker) ID() string + func (b *BaseWorker) Init(ctx context.Context) error + func (b *BaseWorker) Logger() *slog.Logger + func (b *BaseWorker) Shutdown(ctx context.Context) error + func (b *BaseWorker) Type() string + func (b *BaseWorker) Version() string + type ClientOption func(*WorkerClient) + func WithHTTPClient(client *http.Client) ClientOption + func WithHeader(key, value string) ClientOption + func WithTimeout(d time.Duration) ClientOption + type Coordinator struct + func NewCoordinator(cfg CoordinatorConfig) *Coordinator + func (c *Coordinator) AddRemote(id, url string, opts ...ClientOption) + func (c *Coordinator) Execute(ctx context.Context, req *CoordinatorRequest) (*CoordinatorResponse, error) + func (c *Coordinator) Health(ctx context.Context) HealthStatus + func (c *Coordinator) ID() string + func (c *Coordinator) Init(ctx context.Context) error + func (c *Coordinator) Pool() *Pool + func (c *Coordinator) RemoveRemote(id string) + func (c *Coordinator) Shutdown(ctx context.Context) error + type CoordinatorConfig struct + AgentOps *AgentOpsConfig + ID string + Logger *slog.Logger + MaxRetries int + Timeout time.Duration + Workflow WorkflowExecutor + func (c *CoordinatorConfig) Defaults() + type CoordinatorRequest struct + Input map[string]any + WorkflowID string + type CoordinatorResponse struct + Error *WorkerError + Output map[string]any + Stats WorkflowStats + WorkflowID string + type HealthStatus struct + Details map[string]string + Status string + type LLMConfig struct + APIKey string + BaseURL string + MaxTokens int + Model string + Provider string + Temperature float64 + type Pool struct + func NewPool() *Pool + func (p *Pool) Execute(ctx context.Context, workerID string, req *Request) (*Response, error) + func (p *Pool) Get(id string) (Worker, bool) + func (p *Pool) Health(ctx context.Context) HealthStatus + func (p *Pool) IDs() []string + func (p *Pool) Init(ctx context.Context) error + func (p *Pool) List() []Worker + func (p *Pool) Register(w Worker) error + func (p *Pool) Shutdown(ctx context.Context) error + func (p *Pool) Size() int + func (p *Pool) Unregister(id string) error + type Request struct + ID string + Input map[string]any + TaskID string + WorkflowID string + func NewRequest(input map[string]any) *Request + type Response struct + Error *WorkerError + Output map[string]any + RequestID string + func NewErrorResponse(requestID string, err *WorkerError) *Response + func NewResponse(requestID string, output map[string]any) *Response + type SequentialWorkflow struct + InputMapper func(workerID string, workflowInput, previousOutput map[string]any) map[string]any + WorkerIDs []string + func (w *SequentialWorkflow) Execute(ctx context.Context, input map[string]any, dispatcher WorkerDispatcher) (map[string]any, error) + type Worker interface + Execute func(ctx context.Context, req *Request) (*Response, error) + Health func(ctx context.Context) HealthStatus + ID func() string + Init func(ctx context.Context) error + Shutdown func(ctx context.Context) error + Type func() string + Version func() string + type WorkerClient struct + func NewWorkerClient(baseURL string, opts ...ClientOption) *WorkerClient + func (c *WorkerClient) Execute(ctx context.Context, req *Request) (*Response, error) + func (c *WorkerClient) Health(ctx context.Context) (HealthStatus, error) + type WorkerConfig struct + AgentOps *AgentOpsConfig + ID string + LLM *LLMConfig + Logger *slog.Logger + Timeout time.Duration + Type string + Version string + func (c *WorkerConfig) Defaults() + type WorkerDispatcher interface + Dispatch func(ctx context.Context, workerID string, req *Request) (*Response, error) + type WorkerError struct + Cause error + Code string + Details any + Message string + func AsWorkerError(err error) *WorkerError + func NewError(code, message string) *WorkerError + func NewErrorWithCause(code, message string, cause error) *WorkerError + func NewExecutionError(message string, cause error) *WorkerError + func NewLLMError(message string, cause error) *WorkerError + func NewNotFoundError(message string) *WorkerError + func NewTimeoutError(message string) *WorkerError + func NewValidationError(message string) *WorkerError + func (e *WorkerError) Error() string + func (e *WorkerError) Unwrap() error + type WorkflowExecutor interface + Execute func(ctx context.Context, input map[string]any, dispatcher WorkerDispatcher) (map[string]any, error) + type WorkflowFunc func(ctx context.Context, input map[string]any, dispatcher WorkerDispatcher) (map[string]any, error) + func (f WorkflowFunc) Execute(ctx context.Context, input map[string]any, dispatcher WorkerDispatcher) (map[string]any, error) + type WorkflowStats struct + Duration time.Duration + FailureCount int + RetryCount int + SuccessCount int + TaskCount int