task

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handoff

type Handoff struct {
	ID          int       `json:"id"`
	FromSession string    `json:"from_session"`
	ToSession   string    `json:"to_session,omitempty"`
	Summary     string    `json:"summary"`
	Context     string    `json:"context"`
	CreatedAt   time.Time `json:"created_at"`
}

type JudgeFunc

type JudgeFunc func(task *Task) (passed bool, reason string)

type PlanStep

type PlanStep struct {
	Name        string     `json:"name"`
	Description string     `json:"description"`
	State       TaskState  `json:"state"`
	Outcome     string     `json:"outcome,omitempty"`
	CompletedAt *time.Time `json:"completed_at,omitempty"`
}

type Store

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

func NewStore

func NewStore(judge JudgeFunc) *Store

func (*Store) Activate

func (s *Store) Activate(id string) error

func (*Store) AddHandoff

func (s *Store) AddHandoff(taskID string, handoff Handoff) error

func (*Store) Complete

func (s *Store) Complete(taskID string) error

func (*Store) CompleteStep

func (s *Store) CompleteStep(taskID string, stepIdx int, outcome string) error

func (*Store) Create

func (s *Store) Create(id, name, description string, plan []PlanStep, maxWakeups int) (*Task, error)

func (*Store) Get

func (s *Store) Get(id string) *Task

func (*Store) List

func (s *Store) List() []*Task

func (*Store) ListActive

func (s *Store) ListActive() []*Task

type Task

type Task struct {
	ID            string     `json:"id"`
	Name          string     `json:"name"`
	Description   string     `json:"description"`
	State         TaskState  `json:"state"`
	Plan          []PlanStep `json:"plan"`
	Handoffs      []Handoff  `json:"handoffs"`
	CreatedAt     time.Time  `json:"created_at"`
	CompletedAt   *time.Time `json:"completed_at,omitempty"`
	WakeupCount   int        `json:"wakeup_count"`
	MaxWakeups    int        `json:"max_wakeups"`
	JudgeVerified bool       `json:"judge_verified"`
	JudgeResult   string     `json:"judge_result,omitempty"`
	CheckpointRef string     `json:"checkpoint_ref,omitempty"`
}

type TaskState

type TaskState string
const (
	StatePending   TaskState = "pending"
	StateActive    TaskState = "active"
	StateWaiting   TaskState = "waiting"
	StateCompleted TaskState = "completed"
	StateFailed    TaskState = "failed"
	StateAbandoned TaskState = "abandoned"
)

Jump to

Keyboard shortcuts

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