feat(y-log/knowledge): 日志前缀改 CM助手-全量 + 入库 nodeName 按标题去时间戳保持一致

1. Y-Log 上报 optDetail 前缀 B1-CM助手 → CM助手-全量(全量替换 44 个前端文件 + 文档)
2. 知识库入库 nodeName 改为只取 md5(标题).md(去掉时间戳),同一篇 md 每次入库一致,避免重复记录

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
吉鑫升andClaude Opus 4.8 committed 2026-06-24 15:46:51 +08:00
1 parent 3e68260afa
commit 5ecf28e60c
46 files changed
+307 -301

No files matched your search

+16 -16
View File
@@ -177,7 +177,7 @@ export async function listUserThreads(userId: string): Promise<AdminThread[]> {
const result = await parse<AdminThread[]>(await apiFetch(url), "Failed to load threads");
writeYLog({
optType: OptType.search,
optDetail: "B1-CM助手-管理后台-查询用户会话列表",
optDetail: "CM助手-全量-管理后台-查询用户会话列表",
url,
reqParam: { userId },
returnParam: { count: result.length },
@@ -193,7 +193,7 @@ export async function listUserThreadMessages(
const result = await parse<AdminMessage[]>(await apiFetch(url), "Failed to load messages");
writeYLog({
optType: OptType.view,
optDetail: "B1-CM助手-管理后台-查看会话消息",
optDetail: "CM助手-全量-管理后台-查看会话消息",
url,
reqParam: { userId, threadId },
returnParam: { count: result.length },
@@ -215,7 +215,7 @@ export async function listUserQa(
const result = await parse<AdminUserQaPageResponse>(await apiFetch(url), "Failed to load user Q&A");
writeYLog({
optType: OptType.search,
optDetail: "B1-CM助手-管理后台-查询用户问答",
optDetail: "CM助手-全量-管理后台-查询用户问答",
url,
reqParam: { userId, ...params },
returnParam: { total: result.total, count: result.items.length },
@@ -230,7 +230,7 @@ export async function getUserMemory(
const result = await parse<AdminMemoryResponse>(await apiFetch(url), "Failed to load memory");
writeYLog({
optType: OptType.view,
optDetail: "B1-CM助手-管理后台-查看用户记忆",
optDetail: "CM助手-全量-管理后台-查看用户记忆",
url,
reqParam: { userId },
});
@@ -255,7 +255,7 @@ export async function getUserLeaderboard(
const result = await parse<AdminLeaderboardResponse>(await apiFetch(url), "Failed to load leaderboard");
writeYLog({
optType: OptType.search,
optDetail: "B1-CM助手-管理后台-查询用户排行榜",
optDetail: "CM助手-全量-管理后台-查询用户排行榜",
url,
reqParam: { ...range, limit },
});
@@ -287,7 +287,7 @@ export async function refreshTodayLeaderboard(
);
writeYLog({
optType: OptType.other,
optDetail: "B1-CM助手-管理后台-刷新今日排行榜",
optDetail: "CM助手-全量-管理后台-刷新今日排行榜",
url,
reqParam: { ...range, limit },
});
@@ -309,7 +309,7 @@ export async function getUserAnalytics(
const result = await parse<AdminUserAnalyticsResponse>(await apiFetch(url), "Failed to load user analytics");
writeYLog({
optType: OptType.view,
optDetail: "B1-CM助手-管理后台-查看用户分析",
optDetail: "CM助手-全量-管理后台-查看用户分析",
url,
reqParam: { userId, ...range, limit },
});
@@ -335,7 +335,7 @@ export async function generateUserLeaderboardReport(
);
writeYLog({
optType: OptType.other,
optDetail: "B1-CM助手-管理后台-生成排行榜报告",
optDetail: "CM助手-全量-管理后台-生成排行榜报告",
url,
reqParam: { ...range, limit, modelName },
returnParam: { generated_at: result.generated_at, model_name: result.model_name },
@@ -414,7 +414,7 @@ export async function streamUserLeaderboardReport({
}
writeYLog({
optType: OptType.other,
optDetail: "B1-CM助手-管理后台-流式生成排行榜报告",
optDetail: "CM助手-全量-管理后台-流式生成排行榜报告",
url,
reqParam: { ...range, limit, modelName },
});
@@ -436,7 +436,7 @@ export async function addAdminMemoryEntry(
);
writeYLog({
optType: OptType.create,
optDetail: "B1-CM助手-管理后台-新增记忆条目",
optDetail: "CM助手-全量-管理后台-新增记忆条目",
url,
reqParam: { userId, content, agent },
});
@@ -460,7 +460,7 @@ export async function replaceAdminMemoryEntry(
);
writeYLog({
optType: OptType.edit,
optDetail: "B1-CM助手-管理后台-编辑记忆条目",
optDetail: "CM助手-全量-管理后台-编辑记忆条目",
url,
reqParam: { userId, old_text: oldText, content, agent },
});
@@ -481,7 +481,7 @@ export async function deleteAdminMemoryEntry(
);
writeYLog({
optType: OptType.delete,
optDetail: "B1-CM助手-管理后台-删除记忆条目",
optDetail: "CM助手-全量-管理后台-删除记忆条目",
url,
reqParam: { userId, old_text: oldText, agent },
});
@@ -508,7 +508,7 @@ export async function updateAdminV1Section(
);
writeYLog({
optType: OptType.edit,
optDetail: "B1-CM助手-管理后台-编辑记忆段落",
optDetail: "CM助手-全量-管理后台-编辑记忆段落",
url,
reqParam: { userId, section_type: sectionType, field, summary, agent },
});
@@ -533,7 +533,7 @@ export async function addAdminV1Fact(
);
writeYLog({
optType: OptType.create,
optDetail: "B1-CM助手-管理后台-新增记忆事实",
optDetail: "CM助手-全量-管理后台-新增记忆事实",
url,
reqParam: { userId, content, category, confidence, agent },
});
@@ -557,7 +557,7 @@ export async function updateAdminV1Fact(
);
writeYLog({
optType: OptType.edit,
optDetail: "B1-CM助手-管理后台-编辑记忆事实",
optDetail: "CM助手-全量-管理后台-编辑记忆事实",
url,
reqParam: { userId, factId, ...updates, agent },
});
@@ -579,7 +579,7 @@ export async function deleteAdminV1Fact(
);
writeYLog({
optType: OptType.delete,
optDetail: "B1-CM助手-管理后台-删除记忆事实",
optDetail: "CM助手-全量-管理后台-删除记忆事实",
url,
reqParam: { userId, factId, agent },
});