Files
kandev/backend/internal/agent/api/router.go
T
jcfs ba919305c2 Initial commit: Kandev with SQLite persistence and agent integration
Features:
- Unified Go binary running Task Service, Agent Manager, and Orchestrator
- SQLite persistence for boards, columns, and tasks
- Docker-based agent execution with ACP message streaming
- Augment Agent integration with session resumption support
- RESTful API for all operations (port 8080)
- In-memory event bus for service communication

Architecture:
- cmd/kandev: Single entry point for all services
- internal/task: Task, board, and column management
- internal/agent: Docker container lifecycle and ACP streaming
- internal/orchestrator: Agent coordination and monitoring
- internal/events: In-memory pub/sub event bus

Documentation:
- README.md: Project overview and quick start
- docs/ARCHITECTURE.md: System architecture (current + planned)
- docs/GETTING_STARTED.md: Development setup guide
- docs/IMPLEMENTATION_PLAN.md: Original microservices plan
- backend/NEXT_STEPS.md: Development roadmap
2026-01-10 01:30:24 +00:00

42 lines
1.0 KiB
Go

package api
import (
"github.com/gin-gonic/gin"
"github.com/kandev/kandev/internal/agent/lifecycle"
"github.com/kandev/kandev/internal/agent/registry"
"github.com/kandev/kandev/internal/common/logger"
)
// SetupRoutes configures the agent manager API routes
// router should be the /api/v1 group
func SetupRoutes(
router *gin.RouterGroup,
lm *lifecycle.Manager,
reg *registry.Registry,
docker DockerClient,
log *logger.Logger,
) {
handler := NewHandler(lm, reg, docker, log)
// Agent instance endpoints under /api/v1/agents
agents := router.Group("/agents")
{
// List all active agents
agents.GET("", handler.ListAgents)
// Launch a new agent
agents.POST("/launch", handler.LaunchAgent)
// Agent types endpoints
agents.GET("/types", handler.ListAgentTypes)
agents.GET("/types/:typeId", handler.GetAgentType)
// Single agent instance operations
agents.GET("/:instanceId/status", handler.GetAgentStatus)
agents.GET("/:instanceId/logs", handler.GetAgentLogs)
agents.DELETE("/:instanceId", handler.StopAgent)
}
}