worker

package
v0.3.0-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package worker provides process-isolated task execution for Drover

Index

Constants

View Source
const DefaultTimeout = 30 * time.Minute

DefaultTimeout is the default task execution timeout

View Source
const HeartbeatInterval = 10 * time.Second

HeartbeatInterval is how often to send heartbeats

View Source
const SlowThreshold = 10 * time.Second

SlowThreshold is the response time threshold for slow response detection

Variables

This section is empty.

Functions

This section is empty.

Types

type CLI

type CLI struct {
	// contains filtered or unexported fields
}

CLI represents the worker command-line interface

func NewCLI

func NewCLI() *CLI

NewCLI creates a new CLI instance

func (*CLI) Execute

func (cli *CLI) Execute() error

Execute runs the CLI

type DebugMessage

type DebugMessage struct {
	Type    string `json:"type"`
	Message string `json:"message"`
}

DebugMessage is sent to stderr in verbose mode

type Executor

type Executor struct {
	// contains filtered or unexported fields
}

Executor handles the actual task execution

func NewExecutor

func NewExecutor(claudePath string, timeout time.Duration, verbose bool) *Executor

NewExecutor creates a new worker executor

func (*Executor) Execute

func (e *Executor) Execute(input *TaskInput) *TaskResult

Execute runs a task and returns the result

type HeartbeatMessage

type HeartbeatMessage struct {
	Type      string `json:"type"`
	TaskID    string `json:"task_id"`
	Timestamp int64  `json:"timestamp"`
}

HeartbeatMessage is sent periodically to stderr for crash recovery

type ProgressMessage

type ProgressMessage struct {
	Type    string `json:"type"`
	TaskID  string `json:"task_id"`
	Message string `json:"message"`
}

ProgressMessage is sent to stderr for progress updates

type TaskInput

type TaskInput struct {
	ID          string   `json:"id"`
	Title       string   `json:"title"`
	Description string   `json:"description"`
	EpicID      string   `json:"epic_id,omitempty"`
	Worktree    string   `json:"worktree"`
	Guidance    []string `json:"guidance,omitempty"`
	Timeout     string   `json:"timeout,omitempty"`
	ClaudePath  string   `json:"claude_path,omitempty"`
	Verbose     bool     `json:"verbose,omitempty"`
	MemoryLimit string   `json:"memory_limit,omitempty"`
}

TaskInput represents the input for a worker task execution

type TaskResult

type TaskResult struct {
	Success       bool         `json:"success"`
	TaskID        string       `json:"task_id"`
	Output        string       `json:"output"`
	Error         string       `json:"error,omitempty"`
	DurationMs    int64        `json:"duration_ms"`
	Signal        WorkerSignal `json:"signal"`
	Verdict       string       `json:"verdict,omitempty"`
	VerdictReason string       `json:"verdict_reason,omitempty"`
}

TaskResult represents the output of a worker task execution

type WorkerSignal

type WorkerSignal = backpressure.WorkerSignal

WorkerSignal is an alias for backpressure.WorkerSignal

Signal constants are re-exported from backpressure package

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL