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

+19 -19
View File
@@ -61,7 +61,7 @@ export async function listAgents(params: ListAgentsParams = {}): Promise<Agent[]
const data = (await res.json()) as { agents: Agent[] };
writeYLog({
optType: OptType.search,
optDetail: "B1-CM助手-智能体列表",
optDetail: "CM助手-全量-智能体列表",
url: `/api/agents${query ? `?${query}` : ""}`,
reqParam: params,
returnParam: data.agents,
@@ -92,7 +92,7 @@ export async function listAgentsPaginated(
};
writeYLog({
optType: OptType.search,
optDetail: "B1-CM助手-智能体列表",
optDetail: "CM助手-全量-智能体列表",
url: `/api/agents${query ? `?${query}` : ""}`,
reqParam: params,
returnParam: result,
@@ -109,7 +109,7 @@ export async function listAllAgentsAdmin(): Promise<Agent[]> {
const data = (await res.json()) as { agents: Agent[] };
writeYLog({
optType: OptType.search,
optDetail: "B1-CM助手-智能体列表",
optDetail: "CM助手-全量-智能体列表",
url: `/api/agents?admin=true`,
returnParam: data.agents,
});
@@ -122,7 +122,7 @@ export async function getAgent(id: string): Promise<Agent> {
const agent = (await res.json()) as Agent;
writeYLog({
optType: OptType.view,
optDetail: "B1-CM助手-智能体-查看",
optDetail: "CM助手-全量-智能体-查看",
url: `/api/agents/${id}`,
reqParam: { id },
returnParam: agent,
@@ -143,7 +143,7 @@ export async function createAgent(request: CreateAgentRequest): Promise<Agent> {
const created = (await res.json()) as Agent;
writeYLog({
optType: OptType.create,
optDetail: "B1-CM助手-智能体-新建",
optDetail: "CM助手-全量-智能体-新建",
url: `/api/agents`,
reqParam: request,
returnParam: created,
@@ -167,7 +167,7 @@ export async function updateAgent(
const updated = (await res.json()) as Agent;
writeYLog({
optType: OptType.edit,
optDetail: "B1-CM助手-智能体-修改",
optDetail: "CM助手-全量-智能体-修改",
url: `/api/agents/${id}`,
reqParam: { id, ...request },
returnParam: updated,
@@ -182,7 +182,7 @@ export async function deleteAgent(id: string): Promise<void> {
if (!res.ok) throw new Error(`Failed to delete agent: ${res.statusText}`);
writeYLog({
optType: OptType.delete,
optDetail: "B1-CM助手-智能体-删除",
optDetail: "CM助手-全量-智能体-删除",
url: `/api/agents/${id}`,
reqParam: { id },
});
@@ -194,7 +194,7 @@ export async function getAgentSelector(): Promise<AgentSelectorResponse> {
const selector = (await res.json()) as AgentSelectorResponse;
writeYLog({
optType: OptType.search,
optDetail: "B1-CM助手-智能体-选择器",
optDetail: "CM助手-全量-智能体-选择器",
url: `/api/agents/selector`,
returnParam: selector,
});
@@ -211,7 +211,7 @@ export async function favoriteAgent(id: string): Promise<void> {
}
writeYLog({
optType: OptType.edit,
optDetail: "B1-CM助手-智能体-收藏",
optDetail: "CM助手-全量-智能体-收藏",
url: `/api/agents/${id}/favorite`,
reqParam: { id },
});
@@ -227,7 +227,7 @@ export async function unfavoriteAgent(id: string): Promise<void> {
}
writeYLog({
optType: OptType.edit,
optDetail: "B1-CM助手-智能体-取消收藏",
optDetail: "CM助手-全量-智能体-取消收藏",
url: `/api/agents/${id}/favorite`,
reqParam: { id },
});
@@ -243,7 +243,7 @@ export async function pinAgent(id: string): Promise<void> {
}
writeYLog({
optType: OptType.edit,
optDetail: "B1-CM助手-智能体-置顶",
optDetail: "CM助手-全量-智能体-置顶",
url: `/api/agents/${id}/pin`,
reqParam: { id },
});
@@ -259,7 +259,7 @@ export async function unpinAgent(id: string): Promise<void> {
}
writeYLog({
optType: OptType.edit,
optDetail: "B1-CM助手-智能体-取消置顶",
optDetail: "CM助手-全量-智能体-取消置顶",
url: `/api/agents/${id}/pin`,
reqParam: { id },
});
@@ -282,7 +282,7 @@ export async function reorderFeaturedAgents(agentIds: string[]): Promise<void> {
}
writeYLog({
optType: OptType.edit,
optDetail: "B1-CM助手-智能体-精选排序",
optDetail: "CM助手-全量-智能体-精选排序",
url: `/api/agents/featured/order`,
reqParam: { agent_ids: agentIds },
});
@@ -306,7 +306,7 @@ export async function listPrivateAgents(password: string): Promise<Agent[]> {
const data = (await res.json()) as { agents: Agent[] };
writeYLog({
optType: OptType.search,
optDetail: "B1-CM助手-私有广场智能体列表",
optDetail: "CM助手-全量-私有广场智能体列表",
url: `/api/agents/private-square/list`,
returnParam: data.agents,
});
@@ -364,7 +364,7 @@ export async function listPrivateAgentsPaginated(
};
writeYLog({
optType: OptType.search,
optDetail: "B1-CM助手-私有广场智能体列表",
optDetail: "CM助手-全量-私有广场智能体列表",
url: `/api/agents/private-square/list`,
reqParam: { ...params, password: undefined },
returnParam: result,
@@ -393,7 +393,7 @@ export async function setAgentPrivate(
const updated = (await res.json()) as Agent;
writeYLog({
optType: OptType.edit,
optDetail: "B1-CM助手-智能体-设置私有",
optDetail: "CM助手-全量-智能体-设置私有",
url: `/api/agents/${id}/private`,
reqParam: { id, is_private: isPrivate },
returnParam: updated,
@@ -422,7 +422,7 @@ export async function setAgentFeatured(
const updated = (await res.json()) as Agent;
writeYLog({
optType: OptType.edit,
optDetail: "B1-CM助手-智能体-设置精选",
optDetail: "CM助手-全量-智能体-设置精选",
url: `/api/agents/${id}/featured`,
reqParam: { id, order },
returnParam: updated,
@@ -455,7 +455,7 @@ export async function adminSyncAgentSkills(): Promise<AgentSkillsSyncResult> {
const result = (await res.json()) as AgentSkillsSyncResult;
writeYLog({
optType: OptType.edit,
optDetail: "B1-CM助手-智能体-同步技能",
optDetail: "CM助手-全量-智能体-同步技能",
url: `/api/agents/admin/sync-skills`,
returnParam: result,
});
@@ -500,7 +500,7 @@ export async function publishArtifactToKnowledge(request: {
const result = (await res.json()) as KnowledgeIngestPublishResult;
writeYLog({
optType: OptType.export,
optDetail: "B1-CM助手-智能体-产物发布入库",
optDetail: "CM助手-全量-智能体-产物发布入库",
url: `/api/knowledge-ingest/publish`,
reqParam: request,
returnParam: result,