feat: enhance knowledge workflows and refresh interface
This commit is contained in:
@@ -520,6 +520,20 @@ function getKnowledgeSnapshot(
|
||||
documentsById.get(item.documentId)?.title ?? '未知文档',
|
||||
excerpt: item.quote ?? '',
|
||||
location: item.location
|
||||
})),
|
||||
tasks: snapshot.tasks.map((task) => ({
|
||||
id: task.id,
|
||||
libraryId: task.libraryId,
|
||||
sourceId: task.sourceId,
|
||||
documentId: task.documentId,
|
||||
documentName: task.documentName,
|
||||
kind: task.kind,
|
||||
status: task.status,
|
||||
progress: task.progress,
|
||||
message: task.message,
|
||||
createdAt: task.createdAt,
|
||||
startedAt: task.startedAt,
|
||||
completedAt: task.completedAt
|
||||
}))
|
||||
}
|
||||
}
|
||||
@@ -3515,12 +3529,22 @@ export function registerIpcHandlers(
|
||||
assertTrustedSender(event, window)
|
||||
const value = knowledgeUpdateLibrarySchema.parse(input)
|
||||
knowledgeService.database.updateKnowledgeBase(value.libraryId, {
|
||||
name: value.name,
|
||||
description: value.description,
|
||||
graphEnabled: value.graphEnabled,
|
||||
graphStrategy: value.graphStrategy
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
ipcMain.handle(
|
||||
ipcChannels.knowledgeReextractGraph,
|
||||
async (event, input: unknown) => {
|
||||
assertTrustedSender(event, window)
|
||||
return knowledgeService.reextractGraph(knowledgeIdSchema.parse(input))
|
||||
}
|
||||
)
|
||||
|
||||
ipcMain.handle(
|
||||
ipcChannels.knowledgeSelectFiles,
|
||||
async (event, input: unknown) => {
|
||||
|
||||
Reference in New Issue
Block a user