Documentation
¶
Index ¶
- func ResolveAll(ctx context.Context, repo Repository, ids []string) (titles map[string]string, projectIDs map[string]string)
- func ResolveProjectIDs(ctx context.Context, repo Repository, ids []string) map[string]string
- func ResolveTitles(ctx context.Context, repo Repository, ids []string) map[string]string
- type AssignmentStatus
- type CascadeDeleter
- type Repository
- type Server
- func (s *Server) ArchiveTask(ctx context.Context, req *connect.Request[taskguildv1.ArchiveTaskRequest]) (*connect.Response[taskguildv1.ArchiveTaskResponse], error)
- func (s *Server) ArchiveTerminalTasks(ctx context.Context, ...) (*connect.Response[taskguildv1.ArchiveTerminalTasksResponse], error)
- func (s *Server) CreateTask(ctx context.Context, req *connect.Request[taskguildv1.CreateTaskRequest]) (*connect.Response[taskguildv1.CreateTaskResponse], error)
- func (s *Server) DeleteTask(ctx context.Context, req *connect.Request[taskguildv1.DeleteTaskRequest]) (*connect.Response[taskguildv1.DeleteTaskResponse], error)
- func (s *Server) GetTask(ctx context.Context, req *connect.Request[taskguildv1.GetTaskRequest]) (*connect.Response[taskguildv1.GetTaskResponse], error)
- func (s *Server) ListArchivedTasks(ctx context.Context, ...) (*connect.Response[taskguildv1.ListArchivedTasksResponse], error)
- func (s *Server) ListTasks(ctx context.Context, req *connect.Request[taskguildv1.ListTasksRequest]) (*connect.Response[taskguildv1.ListTasksResponse], error)
- func (s *Server) UnarchiveTask(ctx context.Context, req *connect.Request[taskguildv1.UnarchiveTaskRequest]) (*connect.Response[taskguildv1.UnarchiveTaskResponse], error)
- func (s *Server) UpdateTask(ctx context.Context, req *connect.Request[taskguildv1.UpdateTaskRequest]) (*connect.Response[taskguildv1.UpdateTaskResponse], error)
- func (s *Server) UpdateTaskStatus(ctx context.Context, req *connect.Request[taskguildv1.UpdateTaskStatusRequest]) (*connect.Response[taskguildv1.UpdateTaskStatusResponse], error)
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveAll ¶ added in v0.0.7
func ResolveAll(ctx context.Context, repo Repository, ids []string) (titles map[string]string, projectIDs map[string]string)
ResolveAll returns both taskID → title and taskID → projectID maps with a single pass over the task IDs (avoiding duplicate lookups).
func ResolveProjectIDs ¶ added in v0.0.7
ResolveProjectIDs returns a map of taskID → projectID for the given IDs. It checks active tasks first, then falls back to archived tasks. Tasks that cannot be found are silently skipped.
func ResolveTitles ¶ added in v0.0.6
ResolveTitles returns a map of taskID → title for the given IDs. It checks active tasks first, then falls back to archived tasks. Tasks that cannot be found are silently skipped.
Types ¶
type AssignmentStatus ¶
type AssignmentStatus string
const ( AssignmentStatusUnassigned AssignmentStatus = "unassigned" AssignmentStatusPending AssignmentStatus = "pending" AssignmentStatusAssigned AssignmentStatus = "assigned" )
type CascadeDeleter ¶ added in v0.0.7
CascadeDeleter deletes all records belonging to a given task. Implemented by tasklog and interaction repositories.
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, cascadeDeleters ...CascadeDeleter) *Server
func (*Server) ArchiveTask ¶ added in v0.0.2
func (s *Server) ArchiveTask(ctx context.Context, req *connect.Request[taskguildv1.ArchiveTaskRequest]) (*connect.Response[taskguildv1.ArchiveTaskResponse], error)
func (*Server) ArchiveTerminalTasks ¶ added in v0.0.2
func (s *Server) ArchiveTerminalTasks(ctx context.Context, req *connect.Request[taskguildv1.ArchiveTerminalTasksRequest]) (*connect.Response[taskguildv1.ArchiveTerminalTasksResponse], error)
func (*Server) CreateTask ¶
func (s *Server) CreateTask(ctx context.Context, req *connect.Request[taskguildv1.CreateTaskRequest]) (*connect.Response[taskguildv1.CreateTaskResponse], error)
func (*Server) DeleteTask ¶
func (s *Server) DeleteTask(ctx context.Context, req *connect.Request[taskguildv1.DeleteTaskRequest]) (*connect.Response[taskguildv1.DeleteTaskResponse], error)
func (*Server) GetTask ¶
func (s *Server) GetTask(ctx context.Context, req *connect.Request[taskguildv1.GetTaskRequest]) (*connect.Response[taskguildv1.GetTaskResponse], error)
func (*Server) ListArchivedTasks ¶ added in v0.0.2
func (s *Server) ListArchivedTasks(ctx context.Context, req *connect.Request[taskguildv1.ListArchivedTasksRequest]) (*connect.Response[taskguildv1.ListArchivedTasksResponse], error)
func (*Server) ListTasks ¶
func (s *Server) ListTasks(ctx context.Context, req *connect.Request[taskguildv1.ListTasksRequest]) (*connect.Response[taskguildv1.ListTasksResponse], error)
func (*Server) UnarchiveTask ¶ added in v0.0.2
func (s *Server) UnarchiveTask(ctx context.Context, req *connect.Request[taskguildv1.UnarchiveTaskRequest]) (*connect.Response[taskguildv1.UnarchiveTaskResponse], error)
func (*Server) UpdateTask ¶
func (s *Server) UpdateTask(ctx context.Context, req *connect.Request[taskguildv1.UpdateTaskRequest]) (*connect.Response[taskguildv1.UpdateTaskResponse], error)
func (*Server) UpdateTaskStatus ¶
func (s *Server) UpdateTaskStatus(ctx context.Context, req *connect.Request[taskguildv1.UpdateTaskStatusRequest]) (*connect.Response[taskguildv1.UpdateTaskStatusResponse], error)
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"`
}
Click to show internal directories.
Click to hide internal directories.