feat(admin): add LLM call logs, system info, plugin list pages

- ai-core/llm: ring-buffer call logger with stats
- Gateway: /api/v1/admin/llm-calls, /system, /plugins, /sessions endpoints
- Frontend: LLMCallsPage (table + stats), SystemPage (version/plugins/sessions)
- Admin nav expanded to 7 items
This commit is contained in:
Aska committed 2026-08-12 16:56:52 +08:00
1 parent 8bfda096f7
commit 1a80ac2a00
7 files changed
+318 -1

No files matched your search

+17 -1
View File
@@ -32,6 +32,7 @@ import (
websearch "git.yeij.top/AskaEth/Cyrene_v2/plugins/web-search"
"git.yeij.top/AskaEth/Cyrene_v2/services/ai-core/llm"
llmlog "git.yeij.top/AskaEth/Cyrene_v2/services/ai-core/llm"
aiCoreCtx "git.yeij.top/AskaEth/Cyrene_v2/services/ai-core/context"
"git.yeij.top/AskaEth/Cyrene_v2/services/ai-core/orchestrator"
"git.yeij.top/AskaEth/Cyrene_v2/services/ai-core/persona"
@@ -231,9 +232,12 @@ func main() {
authMgr := api.NewRealAuthManager(cfg.JWTSecret, cfg.JWTExpiryHours, userStore)
// Build dependencies for gateway handlers
llmLogger := llmlog.NewLogger(200)
gwDeps := api.Dependencies{
AuthMgr: authMgr,
Orchestrator: orch,
LLMLogger: &llmLoggerAdapter{Logger: llmLogger},
PluginList: pluginNamesToMap(reg.ListNames()),
}
if memSvc != nil {
gwDeps.MemorySvc = memory.NewAPIAdapter(memSvc)
@@ -276,4 +280,16 @@ func main() {
_ = voiceSvc
_ = memSvc
_ = orch
}
}
// llmLoggerAdapter adapts llm.Logger to api.LLMCallLogger interface.
type llmLoggerAdapter struct{ *llmlog.Logger }
func (a *llmLoggerAdapter) Recent(n int) []map[string]any { return a.Logger.RecentMaps(n) }
func pluginNamesToMap(names []string) []map[string]string {
result := make([]map[string]string, len(names))
for i, n := range names {
result[i] = map[string]string{"name": n, "enabled": "true"}
}
return result
}