Documentation
¶
Index ¶
- Variables
- type CreateRunCmd
- type CreateTaskCmd
- type QuotaChecker
- type QuotaExceededError
- type StartBackgroundTaskResult
- type TaskService
- func (s *TaskService) CreateRun(ctx context.Context, cmd CreateRunCmd) (*model.TaskRun, error)
- func (s *TaskService) CreateTask(ctx context.Context, cmd CreateTaskCmd) (*model.Task, error)
- func (s *TaskService) StartBackgroundTask(ctx context.Context, cmd CreateTaskCmd) (*StartBackgroundTaskResult, error)
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.