task

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInputRequired         = errors.New("input required")
	ErrAgentsNotConfigured   = errors.New("agents not configured")
	ErrTasksNotConfigured    = errors.New("tasks not configured")
	ErrTaskRunsNotConfigured = errors.New("task runs not configured")
	ErrAgentNotFound         = errors.New("agent not found or not owned by team")
)

Functions

This section is empty.

Types

type CreateRunCmd

type CreateRunCmd struct {
	UserID        string
	TaskID        string
	Input         string
	CreatedByType string
	TriggerSource string
}

CreateRunCmd creates a new run on an existing task.

type CreateTaskCmd

type CreateTaskCmd struct {
	ConversationID string
	UserID         string
	TeamID         string
	Input          string
	AgentID        *string
	IssueID        *string
	CreatedByType  string
	TriggerSource  string
}

CreateTaskCmd creates a new task and its first run.

type QuotaChecker

type QuotaChecker interface {
	Check(ctx context.Context, teamID string, runsToAdd, tokensToAdd int) (allowed bool, reason string)
}

QuotaChecker is the narrow quota surface needed by task workflows.

type QuotaExceededError

type QuotaExceededError struct {
	Reason string
}

QuotaExceededError is returned when quota blocks a task operation.

func (*QuotaExceededError) Error

func (e *QuotaExceededError) Error() string

type StartBackgroundTaskResult

type StartBackgroundTaskResult struct {
	TaskID string
	RunID  string
}

StartBackgroundTaskResult is returned when a background task is created.

type TaskService

type TaskService struct {
	Agents         model.AgentStore
	Tasks          model.TaskStore
	TaskRuns       model.TaskRunStore
	QuotaChecker   QuotaChecker
	TitleGenerator llm.TitleGenerator
}

TaskService owns task-related application workflows.

func (*TaskService) CreateRun

func (s *TaskService) CreateRun(ctx context.Context, cmd CreateRunCmd) (*model.TaskRun, error)

CreateRun enforces basic run creation rules and delegates to TaskRunStore.

func (*TaskService) CreateTask

func (s *TaskService) CreateTask(ctx context.Context, cmd CreateTaskCmd) (*model.Task, error)

CreateTask resolves input, applies title/quota rules, and persists a new task.

func (*TaskService) StartBackgroundTask

func (s *TaskService) StartBackgroundTask(ctx context.Context, cmd CreateTaskCmd) (*StartBackgroundTaskResult, error)

StartBackgroundTask creates a task and returns its task/run ids.

Jump to

Keyboard shortcuts

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