Remove /knowledge/path; folded into /settings

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-01 20:18:44 -04:00
parent acf336c846
commit 86c85629c0
2 changed files with 8 additions and 21 deletions
-19
View File
@@ -74,7 +74,6 @@ func (s *Server) Router() *gin.Engine {
r.POST("/end", s.handleEnd)
r.POST("/refocus", s.handleRefocus)
r.POST("/ontask", s.handleOnTask)
r.POST("/knowledge/path", s.handleKnowledgePath)
r.GET("/settings", s.handleGetSettings)
r.POST("/settings", s.handlePostSettings)
r.GET("/fs/browse", s.handleBrowse)
@@ -149,24 +148,6 @@ func (s *Server) handleCommitment(c *gin.Context) {
s.respond(c, err)
}
type knowledgePathRequest struct {
Path string `json:"path"`
}
// handleKnowledgePath repoints the profile file at runtime (session-only). It
// mutates config, not commitment state, so it never returns a transition error;
// it just sets the path, re-loads, and broadcasts the refreshed state.
func (s *Server) handleKnowledgePath(c *gin.Context) {
var req knowledgePathRequest
if err := c.ShouldBindJSON(&req); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": "invalid json"})
return
}
s.ctrl.SetKnowledgePath(req.Path)
s.broadcast()
c.Data(http.StatusOK, "application/json", []byte(s.stateJSON()))
}
func (s *Server) handleComplete(c *gin.Context) {
s.cancelExpiry()
s.respond(c, s.ctrl.Complete())