feat(w4): ship v1.5.0 timeline, character arc, and compliance

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-08 17:40:42 +08:00
parent c5c0b7329b
commit cb6b4c3731
51 changed files with 1528 additions and 42 deletions
+13
View File
@@ -0,0 +1,13 @@
import { ipcMain } from 'electron'
import { IPC } from '../../../shared/ipc-channels'
import { ArcService } from '../../services/arc.service'
import type { BookRegistryService } from '../../services/book-registry'
import { wrap } from '../result'
export function registerArcHandlers(registry: BookRegistryService): void {
ipcMain.handle(
IPC.ARC_GET_FOR_CHARACTER,
(_e, { bookId, settingId }: { bookId: string; settingId: string }) =>
wrap(() => new ArcService(registry.getDb(bookId)).getForCharacter(settingId))
)
}
@@ -0,0 +1,21 @@
import { ipcMain } from 'electron'
import { IPC } from '../../../shared/ipc-channels'
import { ComplianceService } from '../../services/compliance.service'
import type { GlobalSettingsService } from '../../services/global-settings'
import { wrap } from '../result'
export function registerComplianceHandlers(settings: GlobalSettingsService): void {
const svc = new ComplianceService(settings)
ipcMain.handle(IPC.COMPLIANCE_GET_WORDS, () => wrap(() => svc.getWords()))
ipcMain.handle(IPC.COMPLIANCE_SET_WORDS, (_e, { words }: { words: string[] }) =>
wrap(() => {
svc.setWords(words)
})
)
ipcMain.handle(IPC.COMPLIANCE_CHECK_TEXT, (_e, { text }: { text: string }) =>
wrap(() => svc.scanText(text))
)
}
+28
View File
@@ -0,0 +1,28 @@
import { ipcMain } from 'electron'
import { IPC } from '../../../shared/ipc-channels'
import type { TimelineUpsertManualInput } from '../../../shared/timeline'
import { TimelineService } from '../../services/timeline.service'
import type { BookRegistryService } from '../../services/book-registry'
import { wrap } from '../result'
export function registerTimelineHandlers(registry: BookRegistryService): void {
ipcMain.handle(IPC.TIMELINE_LIST, (_e, { bookId }: { bookId: string }) =>
wrap(() => new TimelineService(registry.getDb(bookId)).list())
)
ipcMain.handle(
IPC.TIMELINE_UPSERT,
(_e, { bookId, input }: { bookId: string; input: TimelineUpsertManualInput }) =>
wrap(() => new TimelineService(registry.getDb(bookId)).upsertManual(input))
)
ipcMain.handle(IPC.TIMELINE_DELETE, (_e, { bookId, id }: { bookId: string; id: string }) =>
wrap(() => {
new TimelineService(registry.getDb(bookId)).deleteManual(id)
})
)
ipcMain.handle(IPC.TIMELINE_CONFLICTS, (_e, { bookId }: { bookId: string }) =>
wrap(() => new TimelineService(registry.getDb(bookId)).detectConflicts())
)
}