Changeset 0.27.1.1 (#168)

This commit is contained in:
2026-03-10 21:19:48 +00:00
parent 41be9d6081
commit e4efe6b934
14 changed files with 1252 additions and 13 deletions

View File

@@ -30,6 +30,7 @@ import (
"git.gobha.me/xcaliber/chat-switchboard/providers"
"git.gobha.me/xcaliber/chat-switchboard/roles"
"git.gobha.me/xcaliber/chat-switchboard/routing"
"git.gobha.me/xcaliber/chat-switchboard/scheduler"
"git.gobha.me/xcaliber/chat-switchboard/storage"
"git.gobha.me/xcaliber/chat-switchboard/store"
postgres "git.gobha.me/xcaliber/chat-switchboard/store/postgres"
@@ -215,6 +216,13 @@ func main() {
}()
}
// v0.27.1: Task scheduler — polls for due tasks every 30s
if stores.Tasks != nil {
taskSched := scheduler.New(stores)
go taskSched.Run()
log.Println(" ⏰ Task scheduler started")
}
// Bootstrap admin from env (K8s secret) — upserts on every restart
handlers.BootstrapAdmin(cfg, stores)
@@ -596,6 +604,16 @@ func main() {
protected.POST("/workflow-assignments/:id/claim", wfAssignH.Claim)
protected.POST("/workflow-assignments/:id/complete", wfAssignH.Complete)
// Tasks (v0.27.1)
taskH := handlers.NewTaskHandler(stores)
protected.GET("/tasks", taskH.ListMine)
protected.POST("/tasks", taskH.Create)
protected.GET("/tasks/:id", taskH.Get)
protected.PUT("/tasks/:id", taskH.Update)
protected.DELETE("/tasks/:id", taskH.Delete)
protected.GET("/tasks/:id/runs", taskH.ListRuns)
protected.POST("/tasks/:id/run", taskH.RunNow)
// Channel models (v0.20.0 — multi-model @mention routing)
chModelH := handlers.NewChannelModelHandler(stores)
protected.GET("/channels/:id/models", chModelH.List)
@@ -1074,6 +1092,10 @@ func main() {
admin.PUT("/surfaces/:id/enable", surfaceAdm.EnableSurface)
admin.PUT("/surfaces/:id/disable", surfaceAdm.DisableSurface)
admin.DELETE("/surfaces/:id", surfaceAdm.DeleteSurface)
// Task management — admin (v0.27.1)
taskAdm := handlers.NewTaskHandler(stores)
admin.GET("/tasks", taskAdm.ListAll)
}
}