task

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssignmentStatus

type AssignmentStatus string
const (
	AssignmentStatusUnassigned AssignmentStatus = "unassigned"
	AssignmentStatusPending    AssignmentStatus = "pending"
	AssignmentStatusAssigned   AssignmentStatus = "assigned"
)

type Repository

type Repository interface {
	Create(ctx context.Context, t *Task) error
	Get(ctx context.Context, id string) (*Task, error)
	List(ctx context.Context, projectID, workflowID, statusID string, limit, offset int) ([]*Task, int, error)
	Update(ctx context.Context, t *Task) error
	Delete(ctx context.Context, id string) error
	Claim(ctx context.Context, taskID string, agentID string) (*Task, error)
	// ReleaseByAgent unassigns all tasks currently assigned to the given agent,
	// resetting them to Pending so other agents can claim them.
	ReleaseByAgent(ctx context.Context, agentID string) ([]*Task, error)
	// ReleaseByAgentExcept is like ReleaseByAgent but keeps tasks whose IDs
	// are in the keepSet. This is used during reconnection to avoid disrupting
	// tasks that are still actively running on the agent.
	ReleaseByAgentExcept(ctx context.Context, agentID string, keepSet map[string]struct{}) ([]*Task, error)

	// Archive moves a task from tasks/ to tasks/archived/.
	Archive(ctx context.Context, id string) error
	// Unarchive moves a task from tasks/archived/ back to tasks/.
	Unarchive(ctx context.Context, id string) error
	// GetArchived retrieves a single archived task by ID.
	GetArchived(ctx context.Context, id string) (*Task, error)
	// ListArchived lists archived tasks, optionally filtered by project and workflow.
	ListArchived(ctx context.Context, projectID, workflowID string, limit, offset int) ([]*Task, int, error)
}

type Server

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

func NewServer

func NewServer(repo Repository, workflowRepo workflow.Repository, eventBus *eventbus.Bus) *Server

func (*Server) ArchiveTask added in v0.0.2

type Task

type Task struct {
	ID               string            `yaml:"id"`
	ProjectID        string            `yaml:"project_id"`
	WorkflowID       string            `yaml:"workflow_id"`
	Title            string            `yaml:"title"`
	Description      string            `yaml:"description"`
	StatusID         string            `yaml:"status_id"`
	AssignedAgentID  string            `yaml:"assigned_agent_id"`
	AssignmentStatus AssignmentStatus  `yaml:"assignment_status"`
	Metadata         map[string]string `yaml:"metadata"`
	UseWorktree      bool              `yaml:"use_worktree"`
	PermissionMode   string            `yaml:"permission_mode"`
	CreatedAt        time.Time         `yaml:"created_at"`
	UpdatedAt        time.Time         `yaml:"updated_at"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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