feat(knowledge): index note relationships and maintain moved links

This commit is contained in:
eezd committed 2026-10-22 14:52:37 +08:00
1 parent d34d1f2183
commit a923c2dfb9
19 files changed
+545 -79

No files matched your search

+10
View File
@@ -76,6 +76,7 @@ func (s *Server) routes() []route {
{"POST /api/v1/auth/password", sessionOnly, s.changePassword},
{"GET /api/v1/tree", authed, s.tree},
{"GET /api/v1/metadata", authed, s.metadata},
{"POST /api/v1/export", authed, s.export},
{"GET /api/v1/files/{path...}", authed, s.readFile},
{"PUT /api/v1/files/{path...}", authed, s.writeFile},
@@ -522,3 +523,12 @@ func vaultError(w http.ResponseWriter, r *http.Request, err error) {
internalError(w, r, err)
}
}
func (s *Server) metadata(w http.ResponseWriter, r *http.Request) {
notes, ready, err := s.index.Metadata()
if err != nil {
internalError(w, r, err)
return
}
writeJSON(w, 200, map[string]any{"notes": notes, "ready": ready})
}