8f48dd838b
Replace task statuses (pending/running/succeeded/failed/cancelled) with
a kanban workflow: todo → in_progress → in_review → done/wontdo.
When a non-review agent task completes, the API auto-creates a child
review task and moves the parent to in_review. Only humans can move
tasks from in_review to done/wontdo via the TUI.
New components:
- cmd/tui: bubbletea kanban board with $EDITOR integration
- POST /api/v1/tasks/{id}/complete: agent completion callback
- Operator --api-url flag for completion callbacks
- ProviderQueue sets tasks to in_progress on pickup
- AgentTask reconciler calls /complete on job finish
68 lines
2.3 KiB
Go
68 lines
2.3 KiB
Go
package models
|
|
|
|
import "time"
|
|
|
|
type TaskStatus string
|
|
|
|
const (
|
|
StatusTodo TaskStatus = "todo"
|
|
StatusInProgress TaskStatus = "in_progress"
|
|
StatusInReview TaskStatus = "in_review"
|
|
StatusDone TaskStatus = "done"
|
|
StatusWontdo TaskStatus = "wontdo"
|
|
)
|
|
|
|
type Task struct {
|
|
ID string `json:"id"`
|
|
ParentTaskID string `json:"parentTaskId,omitempty"`
|
|
Command string `json:"command"`
|
|
Skill string `json:"skill,omitempty"`
|
|
Repository string `json:"repository"`
|
|
Ref string `json:"ref"`
|
|
IssueNumber int `json:"issueNumber,omitempty"`
|
|
PRNumber int `json:"prNumber,omitempty"`
|
|
CommentID int64 `json:"commentId,omitempty"`
|
|
Body string `json:"body,omitempty"`
|
|
Author string `json:"author"`
|
|
ExtraTools []string `json:"extraTools,omitempty"`
|
|
Status TaskStatus `json:"status"`
|
|
PoolRef string `json:"poolRef,omitempty"`
|
|
JobName string `json:"jobName,omitempty"`
|
|
Result string `json:"result,omitempty"`
|
|
ErrorMessage string `json:"errorMessage,omitempty"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
StartedAt *time.Time `json:"startedAt,omitempty"`
|
|
CompletedAt *time.Time `json:"completedAt,omitempty"`
|
|
}
|
|
|
|
type CreateTaskRequest struct {
|
|
Command string `json:"command"`
|
|
Skill string `json:"skill,omitempty"`
|
|
Repository string `json:"repository"`
|
|
Ref string `json:"ref"`
|
|
IssueNumber int `json:"issueNumber,omitempty"`
|
|
PRNumber int `json:"prNumber,omitempty"`
|
|
CommentID int64 `json:"commentId,omitempty"`
|
|
Body string `json:"body,omitempty"`
|
|
Author string `json:"author"`
|
|
ExtraTools []string `json:"extraTools,omitempty"`
|
|
ParentTaskID string `json:"parentTaskId,omitempty"`
|
|
PoolRef string `json:"poolRef,omitempty"`
|
|
}
|
|
|
|
type UpdateTaskRequest struct {
|
|
Status TaskStatus `json:"status,omitempty"`
|
|
Message string `json:"message,omitempty"`
|
|
JobName string `json:"jobName,omitempty"`
|
|
ErrorMessage string `json:"errorMessage,omitempty"`
|
|
}
|
|
|
|
type CommentRequest struct {
|
|
Body string `json:"body"`
|
|
}
|
|
|
|
type CompleteTaskRequest struct {
|
|
Result string `json:"result"`
|
|
ErrorMessage string `json:"errorMessage,omitempty"`
|
|
}
|