Files
kandev/apps/backend/internal/orchestrator/api/router.go
T
jcfs 7faef25f3a feat: add READY status and multi-turn conversation support
- Add AgentStatusReady status for when agent finishes a prompt
- Add AgentReady event published when prompt completes
- PromptAgent accepts RUNNING/READY states, marks READY when done
- Add /complete endpoint to explicitly complete a task
- E2E test polls for READY status instead of file creation
- E2E test validates multi-turn conversation flow
2026-01-10 17:06:50 +00:00

33 lines
972 B
Go

package api
import (
"github.com/gin-gonic/gin"
"github.com/kandev/kandev/internal/common/logger"
"github.com/kandev/kandev/internal/orchestrator"
)
// SetupRoutes configures the orchestrator API routes
func SetupRoutes(router *gin.RouterGroup, service *orchestrator.Service, log *logger.Logger) {
handler := NewHandler(service, log)
// Orchestrator control
router.GET("/status", handler.GetStatus)
router.GET("/queue", handler.GetQueue)
router.POST("/trigger", handler.TriggerTask)
// Task execution control
tasks := router.Group("/tasks/:taskId")
{
tasks.POST("/start", handler.StartTask)
tasks.POST("/stop", handler.StopTask)
tasks.POST("/prompt", handler.PromptTask)
tasks.POST("/complete", handler.CompleteTask)
tasks.POST("/pause", handler.PauseTask)
tasks.POST("/resume", handler.ResumeTask)
tasks.GET("/status", handler.GetTaskStatus)
tasks.GET("/logs", handler.GetTaskLogs)
tasks.GET("/artifacts", handler.GetTaskArtifacts)
}
}