feat: init sproutclaw-web — Go+Gin backend + React frontend

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-13 20:16:09 +08:00
commit c33b143176
109 changed files with 18773 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
package handlers
import (
"net/http"
"github.com/gin-gonic/gin"
"sproutclaw-web/internal/models"
"sproutclaw-web/internal/rpc"
)
// RegisterExtensionUI registers the extension UI response route.
func RegisterExtensionUI(r *gin.RouterGroup, piClient *rpc.Client) {
r.POST("/extension-ui-response", func(c *gin.Context) {
var req models.ExtensionUIResponseRequest
if err := c.ShouldBindJSON(&req); err != nil {
c.JSON(http.StatusBadRequest, models.ErrorResponse{Error: err.Error()})
return
}
if err := piClient.SendExtensionUIResponse(req.ID, req.Response); err != nil {
c.JSON(http.StatusInternalServerError, models.ErrorResponse{Error: err.Error()})
return
}
c.JSON(http.StatusOK, models.OKResponse{OK: true})
})
}