Add usage commands, a vendor-neutral usage format and a knowledge base

This commit is contained in:
Ian Gulliver
2026-10-19 15:08:57 -07:00
parent 912225cbd1
commit 8a395d4d6e
17 changed files with 1010 additions and 403 deletions
+18
View File
@@ -632,6 +632,24 @@ func (s *Server) CheckPermissions(w http.ResponseWriter, r *http.Request) {
writeJSON(w, http.StatusOK, perms)
}
func (s *Server) GetUsageCommands(w http.ResponseWriter, r *http.Request) {
writeJSON(w, http.StatusOK, s.agents.UsageCommands())
}
func (s *Server) UpdateUsageCommands(w http.ResponseWriter, r *http.Request) {
req := api.UsageCommands{}
if !readJSON(w, r, &req) {
return
}
err := s.agents.SetUsageCommands(r.Context(), actor(r), req)
if err != nil {
writeStoreError(w, err)
return
}
writeJSON(w, http.StatusOK, s.agents.UsageCommands())
}
func (s *Server) status(ctx context.Context) (api.Status, error) {
c, err := s.store.Counts(ctx)
if err != nil {