Add TUI kanban board, review workflow, and new task statuses
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
This commit is contained in:
@@ -27,12 +27,18 @@ func main() {
|
||||
var metricsAddr string
|
||||
var probeAddr string
|
||||
var leaderElect bool
|
||||
var apiURL string
|
||||
|
||||
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "metrics endpoint")
|
||||
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "health probe endpoint")
|
||||
flag.BoolVar(&leaderElect, "leader-elect", false, "enable leader election")
|
||||
flag.StringVar(&apiURL, "api-url", "", "forgebot API base URL for task completion callbacks")
|
||||
flag.Parse()
|
||||
|
||||
if v := os.Getenv("FORGEBOT_API_URL"); v != "" && apiURL == "" {
|
||||
apiURL = v
|
||||
}
|
||||
|
||||
ctrl.SetLogger(zap.New(zap.UseDevMode(false)))
|
||||
logger := ctrl.Log.WithName("setup")
|
||||
|
||||
@@ -50,7 +56,7 @@ func main() {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if err := controller.SetupAll(mgr); err != nil {
|
||||
if err := controller.SetupAll(mgr, controller.SetupOptions{APIURL: apiURL}); err != nil {
|
||||
logger.Error(err, "unable to setup controllers")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
|
||||
"git.unkin.net/unkin/forgebot/internal/tui"
|
||||
)
|
||||
|
||||
func main() {
|
||||
apiURL := flag.String("api", "http://localhost:8000", "forgebot API base URL")
|
||||
flag.Parse()
|
||||
|
||||
if v := os.Getenv("FORGEBOT_API_URL"); v != "" {
|
||||
*apiURL = v
|
||||
}
|
||||
|
||||
m := tui.NewApp(*apiURL)
|
||||
p := tea.NewProgram(m, tea.WithAltScreen())
|
||||
if _, err := p.Run(); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "error: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user