plan/10: Add /api/stats endpoint and dashboard stats badge

- Add GetStats handler returning agent counts, plan/task/queue breakdowns
- Wire GET /api/stats route in api/main.go
- Add stats_test.go with handler unit tests
- Add StatsWidget.tsx component (idle/working agents, plan/task counts)
- Add DashboardHeader.tsx displaying stats badge in the dashboard header
This commit is contained in:
2026-04-08 10:04:25 -05:00
parent 3a64d8fb8e
commit ec3108125d
5 changed files with 220 additions and 0 deletions

View File

@@ -73,6 +73,7 @@ func main() {
// Agents
api.GET("/agents", h.ListAgents)
api.PATCH("/agents/:id", h.UpdateAgent)
api.GET("/agents/:id/next-task", h.NextTask)
// Director Queue
api.GET("/queue", h.ListQueue)
@@ -91,6 +92,12 @@ func main() {
// System / Settings
api.GET("/system/claude-mode", h.GetClaudeMode)
api.POST("/system/claude-mode", h.SetClaudeMode)
api.GET("/system/claude-usage", h.GetClaudeUsage)
api.POST("/system/claude-usage", h.SetClaudeUsage)
api.POST("/system/claude-kill-switch", h.ClaudeKillSwitch)
// Stats
api.GET("/stats", h.GetStats)
}
// WebSocket