feat(w2): add PackService for .novel and .novel-all export/import

Introduce pack-bootstrap chunk, ZipArchive-based PackService with progress IPC,
book registry import helpers, and IT-PACK-01 / IT-ALL-02 integration tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-08 15:36:47 +08:00
parent 9f2b1ae3e0
commit a4412793f4
12 changed files with 1563 additions and 73 deletions
+40
View File
@@ -0,0 +1,40 @@
export const NOVEL_FORMAT_VERSION = 1
export const NOVEL_ALL_FORMAT_VERSION = 1
export interface NovelManifest {
formatVersion: number
appVersion: string
exportedAt: string
bookId: string
bookName: string
}
export interface NovelAllManifest {
formatVersion: number
appVersion: string
exportedAt: string
bookCount: number
}
export type PackImportStrategy = 'skip' | 'overwrite' | 'new'
export interface PackImportBookResult {
sourceBookId: string
targetBookId: string | null
bookName: string
action: 'imported' | 'skipped' | 'overwritten'
}
export interface PackImportReport {
imported: number
skipped: number
overwritten: number
books: PackImportBookResult[]
}
export interface PackProgressEvent {
current: number
total: number
phase: 'export' | 'import' | 'estimate'
message?: string
}