feat: 工具/技能调用统计 + 用户活动审计 + 标签多选筛选
- 任务1: 用户管理/定时任务管理移入左下角菜单, 从侧边栏删除原入口
- 任务2: 管理员查看用户问答(读 LangGraph checkpoint)与记忆, 新增 admin_users 路由与审计页
- 任务3: 标签筛选改为顶部多选标签栏(OR), agents/skills/scheduled_tasks 三端
- 任务4: 新增 tool_call_metrics 表 + ToolMetricsMiddleware + tool-metrics 路由,
工具/技能调用统计并入大模型统计页, 含错误分类
- 技能识别: lead agent 经 read_file 加载 /mnt/skills/<cat>/<name>/SKILL.md 调用技能,
中间件扫描工具参数里的 skills/{public,custom}/{name}/ 路径还原 skill_name
- 单元测试 tests/test_tool_metrics_middleware.py (18 项全过)
- 附: SQLite->MySQL 切换后清理脚本
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
e3cde9be25
commit
4940e0d8ed
46 files changed
+3299
-315
No files matched your search
@@ -0,0 +1,33 @@
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
import { getUserMemory, listUserThreadMessages, listUserThreads } from "./api";
|
||||
|
||||
/** Threads owned by a given user. Disabled until a user is picked. */
|
||||
export function useUserThreads(userId: string | null) {
|
||||
return useQuery({
|
||||
queryKey: ["admin-activity", "threads", userId],
|
||||
queryFn: () => listUserThreads(userId!),
|
||||
enabled: !!userId,
|
||||
});
|
||||
}
|
||||
|
||||
/** Messages of a given thread. Disabled until a thread is picked. */
|
||||
export function useUserThreadMessages(
|
||||
userId: string | null,
|
||||
threadId: string | null,
|
||||
) {
|
||||
return useQuery({
|
||||
queryKey: ["admin-activity", "messages", userId, threadId],
|
||||
queryFn: () => listUserThreadMessages(userId!, threadId!),
|
||||
enabled: !!userId && !!threadId,
|
||||
});
|
||||
}
|
||||
|
||||
/** All memory buckets of a given user. Disabled until a user is picked. */
|
||||
export function useUserMemory(userId: string | null) {
|
||||
return useQuery({
|
||||
queryKey: ["admin-activity", "memory", userId],
|
||||
queryFn: () => getUserMemory(userId!),
|
||||
enabled: !!userId,
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user