dag

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusPending    = "pending"
	StatusInProgress = "in_progress"
	StatusCompleted  = "completed"
	StatusFailed     = "failed"
	StatusOnHold     = "on_hold"
)

Variables

This section is empty.

Functions

func NewTaskID

func NewTaskID(name string) string

func ValidateTask

func ValidateTask(task *Task, existing []*Task) error

Types

type DAG

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

func NewDAG

func NewDAG(tasks []*Task) *DAG

func (*DAG) AddTask

func (d *DAG) AddTask(task *Task) error

func (*DAG) AllTasks

func (d *DAG) AllTasks() []*Task

func (*DAG) GetAncestors added in v0.1.1

func (d *DAG) GetAncestors(id string) []*Task

func (*DAG) GetReadyTasks

func (d *DAG) GetReadyTasks() []*Task

func (*DAG) GetTask

func (d *DAG) GetTask(id string) *Task

func (*DAG) GetTree

func (d *DAG) GetTree(rootID string) *TreeNode

func (*DAG) HasCycle

func (d *DAG) HasCycle() bool

func (*DAG) RemoveTask

func (d *DAG) RemoveTask(id string) error

func (*DAG) RestoreTask

func (d *DAG) RestoreTask(id string) error

func (*DAG) Search

func (d *DAG) Search(query, statusFilter string, limit, offset int, includeArchived bool) []*Task

func (*DAG) UpdateTask

func (d *DAG) UpdateTask(task *Task) error

type DocReference

type DocReference struct {
	File      string `json:"file"`
	StartLine int    `json:"start_line"`
	EndLine   int    `json:"end_line"`
}

type Task

type Task struct {
	ID             string         `json:"id"`
	Name           string         `json:"name"`
	Description    string         `json:"description,omitempty"`
	Status         string         `json:"status"`
	Archived       bool           `json:"archived"`
	Dependencies   []string       `json:"dependencies"`
	DocReferences  []DocReference `json:"doc_references,omitempty"`
	PromptTemplate string         `json:"prompt_template,omitempty"`
	ResultSummary  string         `json:"result_summary,omitempty"`
	CreatedAt      *time.Time     `json:"created_at,omitempty"`
	UpdatedAt      *time.Time     `json:"updated_at,omitempty"`
}

type TreeNode

type TreeNode struct {
	Task     *Task       `json:"task"`
	Children []*TreeNode `json:"children,omitempty"`
}

Jump to

Keyboard shortcuts

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