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:
1 parent
3e68260afa
commit
5ecf28e60c
46 files changed
+307
-301
No files matched your search
@@ -47,7 +47,7 @@ export async function listKnowledgeNotes(params: KnowledgeListParams = {}) {
|
||||
);
|
||||
writeYLog({
|
||||
optType: OptType.search,
|
||||
optDetail: "B1-CM助手-知识库-检索",
|
||||
optDetail: "CM助手-全量-知识库-检索",
|
||||
url: `${baseUrl()}/notes?${qs.toString()}`,
|
||||
reqParam: params,
|
||||
returnParam: result,
|
||||
@@ -61,7 +61,7 @@ export async function getKnowledgeNote(noteId: string) {
|
||||
);
|
||||
writeYLog({
|
||||
optType: OptType.view,
|
||||
optDetail: "B1-CM助手-知识库-查看",
|
||||
optDetail: "CM助手-全量-知识库-查看",
|
||||
url: `${baseUrl()}/notes/${encodeURIComponent(noteId)}`,
|
||||
reqParam: { noteId },
|
||||
returnParam: result,
|
||||
@@ -86,7 +86,7 @@ export async function createKnowledgeNote(data: {
|
||||
);
|
||||
writeYLog({
|
||||
optType: OptType.create,
|
||||
optDetail: "B1-CM助手-知识库-新建",
|
||||
optDetail: "CM助手-全量-知识库-新建",
|
||||
url: `${baseUrl()}/notes`,
|
||||
reqParam: data,
|
||||
returnParam: res.note,
|
||||
@@ -114,7 +114,7 @@ export async function updateKnowledgeNote(
|
||||
);
|
||||
writeYLog({
|
||||
optType: OptType.edit,
|
||||
optDetail: "B1-CM助手-知识库-修改",
|
||||
optDetail: "CM助手-全量-知识库-修改",
|
||||
url: `${baseUrl()}/notes/${encodeURIComponent(noteId)}`,
|
||||
reqParam: { noteId, data },
|
||||
returnParam: result,
|
||||
@@ -131,7 +131,7 @@ export async function deleteKnowledgeNote(noteId: string, hard = false) {
|
||||
);
|
||||
writeYLog({
|
||||
optType: OptType.delete,
|
||||
optDetail: "B1-CM助手-知识库-删除",
|
||||
optDetail: "CM助手-全量-知识库-删除",
|
||||
url: `${baseUrl()}/notes/${encodeURIComponent(noteId)}${hard ? "?hard=true" : ""}`,
|
||||
reqParam: { noteId, hard },
|
||||
returnParam: result,
|
||||
@@ -149,7 +149,7 @@ export async function searchKnowledge(query: string, limit = 8) {
|
||||
);
|
||||
writeYLog({
|
||||
optType: OptType.search,
|
||||
optDetail: "B1-CM助手-知识库-检索",
|
||||
optDetail: "CM助手-全量-知识库-检索",
|
||||
url: `${baseUrl()}/search`,
|
||||
reqParam: { query, mode: "keyword", limit },
|
||||
returnParam: res.items,
|
||||
@@ -171,7 +171,7 @@ export async function ingestThread(threadId: string, payload: IngestThreadPayloa
|
||||
);
|
||||
writeYLog({
|
||||
optType: OptType.import,
|
||||
optDetail: "B1-CM助手-知识库-导入",
|
||||
optDetail: "CM助手-全量-知识库-导入",
|
||||
url: `${baseUrl()}/ingest/thread/${encodeURIComponent(threadId)}`,
|
||||
reqParam: { threadId, payload },
|
||||
returnParam: result,
|
||||
@@ -189,7 +189,7 @@ export async function ingestThreadsBatch(payload: BatchIngestPayload = {}) {
|
||||
);
|
||||
writeYLog({
|
||||
optType: OptType.import,
|
||||
optDetail: "B1-CM助手-知识库-导入",
|
||||
optDetail: "CM助手-全量-知识库-导入",
|
||||
url: `${baseUrl()}/ingest/threads/batch`,
|
||||
reqParam: payload,
|
||||
returnParam: result,
|
||||
@@ -230,7 +230,7 @@ export async function ingestKnowledgeFile(
|
||||
);
|
||||
writeYLog({
|
||||
optType: OptType.import,
|
||||
optDetail: "B1-CM助手-知识库-导入",
|
||||
optDetail: "CM助手-全量-知识库-导入",
|
||||
url: `${baseUrl()}/ingest/file`,
|
||||
reqParam: { fileName: file.name, ...opts },
|
||||
returnParam: result,
|
||||
@@ -267,7 +267,7 @@ export async function fetchVaultPage(path: string) {
|
||||
);
|
||||
writeYLog({
|
||||
optType: OptType.view,
|
||||
optDetail: "B1-CM助手-知识库-Vault页面查看",
|
||||
optDetail: "CM助手-全量-知识库-Vault页面查看",
|
||||
url: `${baseUrl()}/vault-page?path=${encodeURIComponent(path)}`,
|
||||
reqParam: { path },
|
||||
returnParam: result,
|
||||
@@ -281,7 +281,7 @@ export async function exportKnowledgeGraph() {
|
||||
);
|
||||
writeYLog({
|
||||
optType: OptType.export,
|
||||
optDetail: "B1-CM助手-知识库-导出",
|
||||
optDetail: "CM助手-全量-知识库-导出",
|
||||
url: `${baseUrl()}/export/graph`,
|
||||
returnParam: result,
|
||||
});
|
||||
@@ -313,7 +313,7 @@ export async function listNoteVersions(noteId: string) {
|
||||
);
|
||||
writeYLog({
|
||||
optType: OptType.search,
|
||||
optDetail: "B1-CM助手-知识库-历史版本列表",
|
||||
optDetail: "CM助手-全量-知识库-历史版本列表",
|
||||
url: `${baseUrl()}/notes/${encodeURIComponent(noteId)}/versions`,
|
||||
reqParam: { noteId },
|
||||
returnParam: res.items,
|
||||
@@ -332,7 +332,7 @@ export async function listDuplicates() {
|
||||
);
|
||||
writeYLog({
|
||||
optType: OptType.search,
|
||||
optDetail: "B1-CM助手-知识库-重复项列表",
|
||||
optDetail: "CM助手-全量-知识库-重复项列表",
|
||||
url: `${baseUrl()}/duplicates`,
|
||||
returnParam: res.groups,
|
||||
});
|
||||
@@ -349,7 +349,7 @@ export async function mergeKnowledgeNotes(primaryId: string, duplicateIds: strin
|
||||
);
|
||||
writeYLog({
|
||||
optType: OptType.edit,
|
||||
optDetail: "B1-CM助手-知识库-合并",
|
||||
optDetail: "CM助手-全量-知识库-合并",
|
||||
url: `${baseUrl()}/merge`,
|
||||
reqParam: { primary_id: primaryId, duplicate_ids: duplicateIds },
|
||||
returnParam: result,
|
||||
@@ -363,7 +363,7 @@ export async function reindexKnowledge() {
|
||||
);
|
||||
writeYLog({
|
||||
optType: OptType.other,
|
||||
optDetail: "B1-CM助手-知识库-重建索引",
|
||||
optDetail: "CM助手-全量-知识库-重建索引",
|
||||
url: `${baseUrl()}/reindex`,
|
||||
returnParam: result,
|
||||
});
|
||||
@@ -379,7 +379,7 @@ export async function getKnowledgeGraph() {
|
||||
const result = await parseResponse<KnowledgeGraph>(await apiFetch(`${baseUrl()}/graph`));
|
||||
writeYLog({
|
||||
optType: OptType.search,
|
||||
optDetail: "B1-CM助手-知识库-图谱查看",
|
||||
optDetail: "CM助手-全量-知识库-图谱查看",
|
||||
url: `${baseUrl()}/graph`,
|
||||
returnParam: result,
|
||||
});
|
||||
@@ -401,7 +401,7 @@ export async function getGraphBlacklist() {
|
||||
);
|
||||
writeYLog({
|
||||
optType: OptType.search,
|
||||
optDetail: "B1-CM助手-知识库-图谱黑名单列表",
|
||||
optDetail: "CM助手-全量-知识库-图谱黑名单列表",
|
||||
url: `${baseUrl()}/graph/blacklist`,
|
||||
returnParam: res.items,
|
||||
});
|
||||
@@ -419,7 +419,7 @@ export async function addGraphBlacklist(labels: string[]) {
|
||||
);
|
||||
writeYLog({
|
||||
optType: OptType.create,
|
||||
optDetail: "B1-CM助手-知识库-图谱黑名单新增",
|
||||
optDetail: "CM助手-全量-知识库-图谱黑名单新增",
|
||||
url: `${baseUrl()}/graph/blacklist`,
|
||||
reqParam: { labels },
|
||||
returnParam: result,
|
||||
@@ -435,7 +435,7 @@ export async function removeGraphBlacklist(entryId: string) {
|
||||
);
|
||||
writeYLog({
|
||||
optType: OptType.delete,
|
||||
optDetail: "B1-CM助手-知识库-图谱黑名单删除",
|
||||
optDetail: "CM助手-全量-知识库-图谱黑名单删除",
|
||||
url: `${baseUrl()}/graph/blacklist/${encodeURIComponent(entryId)}`,
|
||||
reqParam: { entryId },
|
||||
returnParam: result,
|
||||
@@ -451,7 +451,7 @@ export async function listKnowledgeFolders() {
|
||||
);
|
||||
writeYLog({
|
||||
optType: OptType.search,
|
||||
optDetail: "B1-CM助手-知识库-目录列表",
|
||||
optDetail: "CM助手-全量-知识库-目录列表",
|
||||
url: `${baseUrl()}/folders`,
|
||||
returnParam: res.items,
|
||||
});
|
||||
@@ -468,7 +468,7 @@ export async function createKnowledgeFolder(path: string) {
|
||||
);
|
||||
writeYLog({
|
||||
optType: OptType.create,
|
||||
optDetail: "B1-CM助手-知识库-目录新建",
|
||||
optDetail: "CM助手-全量-知识库-目录新建",
|
||||
url: `${baseUrl()}/folders`,
|
||||
reqParam: { path },
|
||||
returnParam: res.folder,
|
||||
@@ -486,7 +486,7 @@ export async function renameKnowledgeFolder(folderId: string, path: string) {
|
||||
);
|
||||
writeYLog({
|
||||
optType: OptType.edit,
|
||||
optDetail: "B1-CM助手-知识库-目录重命名",
|
||||
optDetail: "CM助手-全量-知识库-目录重命名",
|
||||
url: `${baseUrl()}/folders/${encodeURIComponent(folderId)}`,
|
||||
reqParam: { folderId, path },
|
||||
returnParam: res.folder,
|
||||
@@ -503,7 +503,7 @@ export async function deleteKnowledgeFolder(folderId: string, reassignTo?: strin
|
||||
);
|
||||
writeYLog({
|
||||
optType: OptType.delete,
|
||||
optDetail: "B1-CM助手-知识库-目录删除",
|
||||
optDetail: "CM助手-全量-知识库-目录删除",
|
||||
url: `${baseUrl()}/folders/${encodeURIComponent(folderId)}${qs}`,
|
||||
reqParam: { folderId, reassignTo },
|
||||
returnParam: result,
|
||||
@@ -523,7 +523,7 @@ export async function listExtractTemplates(scope?: ExtractTemplateScope, enabled
|
||||
);
|
||||
writeYLog({
|
||||
optType: OptType.search,
|
||||
optDetail: "B1-CM助手-知识库-抽取模板列表",
|
||||
optDetail: "CM助手-全量-知识库-抽取模板列表",
|
||||
url: `${baseUrl()}/extract-templates${q ? `?${q}` : ""}`,
|
||||
reqParam: { scope, enabledOnly },
|
||||
returnParam: res.items,
|
||||
@@ -550,7 +550,7 @@ export async function createExtractTemplate(data: ExtractTemplateInput) {
|
||||
);
|
||||
writeYLog({
|
||||
optType: OptType.create,
|
||||
optDetail: "B1-CM助手-知识库-抽取模板新建",
|
||||
optDetail: "CM助手-全量-知识库-抽取模板新建",
|
||||
url: `${baseUrl()}/extract-templates`,
|
||||
reqParam: data,
|
||||
returnParam: res.template,
|
||||
@@ -571,7 +571,7 @@ export async function updateExtractTemplate(
|
||||
);
|
||||
writeYLog({
|
||||
optType: OptType.edit,
|
||||
optDetail: "B1-CM助手-知识库-抽取模板修改",
|
||||
optDetail: "CM助手-全量-知识库-抽取模板修改",
|
||||
url: `${baseUrl()}/extract-templates/${encodeURIComponent(templateId)}`,
|
||||
reqParam: { templateId, data },
|
||||
returnParam: res.template,
|
||||
@@ -587,7 +587,7 @@ export async function deleteExtractTemplate(templateId: string) {
|
||||
);
|
||||
writeYLog({
|
||||
optType: OptType.delete,
|
||||
optDetail: "B1-CM助手-知识库-抽取模板删除",
|
||||
optDetail: "CM助手-全量-知识库-抽取模板删除",
|
||||
url: `${baseUrl()}/extract-templates/${encodeURIComponent(templateId)}`,
|
||||
reqParam: { templateId },
|
||||
returnParam: result,
|
||||
|
||||
Reference in new issue
Block a user