Files
backend_fiesta/routes/assistantroutes.go
2026-09-23 17:26:13 +05:30

26 lines
898 B
Go

package routes
import (
"nearle/facade"
"github.com/gofiber/fiber/v2"
)
// Nearle Buddy. See controllers/assistantController.go for the two calls and
// services/assistantService.go for the loop behind them.
//
// Under `/v1/web`, so it inherits `middleware.WebAuth` along with every other
// console route — which is the point. The assistant reads the same data the
// console does, and it must read it as the same person.
func RegisterAssistantRoutes(api fiber.Router, f *facade.Facade) {
assistant := api.Group("/v1/web/assistant")
assistant.Get("/status", f.AssistantController.Status)
assistant.Post("/ask", f.AssistantController.Ask)
assistant.Post("/approve", f.AssistantController.Approve)
// The MCP door, under the same group so it inherits the same session guard.
// One endpoint: JSON-RPC carries the method in the body.
assistant.Post("/mcp", f.MCPController.Handle)
}