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
@@ -3,16 +3,65 @@
|
||||
import type { BaseStream } from "@langchain/langgraph-sdk/react";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { Loader2 } from "lucide-react";
|
||||
import { useMemo } from "react";
|
||||
import { useEffect, useMemo } from "react";
|
||||
import { useParams } from "react-router-dom";
|
||||
|
||||
import { ArtifactsProvider } from "@/components/workspace/artifacts";
|
||||
import {
|
||||
ArtifactFileDetail,
|
||||
ArtifactsProvider,
|
||||
useArtifacts,
|
||||
} from "@/components/workspace/artifacts";
|
||||
import { MessageList } from "@/components/workspace/messages";
|
||||
import { ThreadContext } from "@/components/workspace/messages/context";
|
||||
import { SubtasksProvider } from "@/core/tasks/context";
|
||||
import { getPublicShareSnapshot } from "@/core/thread-shares/api";
|
||||
import type { AgentThreadState } from "@/core/threads";
|
||||
|
||||
/**
|
||||
* Conversation + artifact split shown inside the share's providers.
|
||||
*
|
||||
* The public page has no workspace layout, so it renders its own artifact
|
||||
* panel: clicking a file in the conversation selects it via `ArtifactsProvider`
|
||||
* and the detail view appears on the right.
|
||||
*/
|
||||
function PublicShareBody({
|
||||
thread,
|
||||
shareCode,
|
||||
artifacts,
|
||||
}: {
|
||||
thread: BaseStream<AgentThreadState>;
|
||||
shareCode?: string;
|
||||
artifacts: string[];
|
||||
}) {
|
||||
const { selectedArtifact, open, setArtifacts } = useArtifacts();
|
||||
const threadId = shareCode ?? "public-share";
|
||||
|
||||
// Feed the snapshot's artifact list to the provider so the detail view's
|
||||
// file switcher works.
|
||||
useEffect(() => {
|
||||
setArtifacts(artifacts);
|
||||
}, [artifacts, setArtifacts]);
|
||||
|
||||
const showArtifact = open && !!selectedArtifact;
|
||||
|
||||
return (
|
||||
<div className="flex size-full min-h-0">
|
||||
<div className="min-h-0 min-w-0 flex-1">
|
||||
<MessageList threadId={threadId} thread={thread} paddingBottom={48} />
|
||||
</div>
|
||||
{showArtifact && (
|
||||
<div className="flex min-h-0 w-1/2 min-w-0 shrink-0 flex-col border-l bg-[#fffdfa] p-4">
|
||||
<ArtifactFileDetail
|
||||
className="size-full"
|
||||
filepath={selectedArtifact}
|
||||
threadId={threadId}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Public, read-only conversation viewer.
|
||||
*
|
||||
@@ -91,10 +140,10 @@ export default function PublicSharePage() {
|
||||
<ThreadContext.Provider
|
||||
value={{ thread, isMock: true, publicShareCode: shareCode }}
|
||||
>
|
||||
<MessageList
|
||||
threadId={shareCode ?? "public-share"}
|
||||
<PublicShareBody
|
||||
thread={thread}
|
||||
paddingBottom={48}
|
||||
shareCode={shareCode}
|
||||
artifacts={data.artifacts ?? []}
|
||||
/>
|
||||
</ThreadContext.Provider>
|
||||
</ArtifactsProvider>
|
||||
|
||||
Reference in new issue
Block a user