feat: 新增复读分析

This commit is contained in:
digua
2025-11-27 21:58:01 +08:00
parent 84bfab0b43
commit 00eea87a11
7 changed files with 577 additions and 3 deletions
+2
View File
@@ -7,6 +7,7 @@ import type {
DailyActivity,
MessageType,
ImportProgress,
RepeatAnalysis,
} from '../../src/types/chat'
interface TimeFilter {
@@ -33,6 +34,7 @@ interface ChatApi {
getDbDirectory: () => Promise<string | null>
getSupportedFormats: () => Promise<Array<{ name: string; platform: string }>>
onImportProgress: (callback: (progress: ImportProgress) => void) => () => void
getRepeatAnalysis: (sessionId: string, filter?: TimeFilter) => Promise<RepeatAnalysis>
}
interface Api {
+8
View File
@@ -8,6 +8,7 @@ import type {
DailyActivity,
MessageType,
ImportProgress,
RepeatAnalysis,
} from '../../src/types/chat'
// Custom APIs for renderer
@@ -152,6 +153,13 @@ const chatApi = {
ipcRenderer.removeListener('chat:importProgress', handler)
}
},
/**
* 获取复读分析数据
*/
getRepeatAnalysis: (sessionId: string, filter?: { startTs?: number; endTs?: number }): Promise<RepeatAnalysis> => {
return ipcRenderer.invoke('chat:getRepeatAnalysis', sessionId, filter)
},
}
// Use `contextBridge` APIs to expose Electron APIs to