import type { BookConfig } from "../models/book.js"; import type { ChapterMeta } from "../models/chapter.js"; export declare class StateManager { private readonly projectRoot; constructor(projectRoot: string); private static defaultAuthorIntent; private static defaultCurrentFocus; ensureControlDocuments(bookId: string, authorIntent?: string): Promise; ensureControlDocumentsAt(bookDir: string, language: "zh" | "en", authorIntent?: string): Promise; loadControlDocuments(bookId: string): Promise<{ authorIntent: string; currentFocus: string; runtimeDir: string; }>; private resolveControlDocumentLanguage; acquireBookLock(bookId: string): Promise<() => Promise>; private extractLockPid; private isProcessAlive; get booksDir(): string; bookDir(bookId: string): string; stateDir(bookId: string): string; loadProjectConfig(): Promise>; saveProjectConfig(config: Record): Promise; loadBookConfig(bookId: string): Promise; saveBookConfig(bookId: string, config: BookConfig): Promise; saveBookConfigAt(bookDir: string, config: BookConfig): Promise; ensureRuntimeState(bookId: string, fallbackChapter?: number): Promise; listBooks(): Promise>; getNextChapterNumber(bookId: string): Promise; getPersistedChapterCount(bookId: string): Promise; loadChapterIndex(bookId: string): Promise>; saveChapterIndex(bookId: string, index: ReadonlyArray): Promise; saveChapterIndexAt(bookDir: string, index: ReadonlyArray): Promise; snapshotState(bookId: string, chapterNumber: number): Promise; snapshotStateAt(bookDir: string, chapterNumber: number): Promise; isCompleteBookDirectory(bookDir: string): Promise; restoreState(bookId: string, chapterNumber: number): Promise; /** * Roll back state to the snapshot at `targetChapter`, removing all chapters * after it and their associated files (chapter markdown, snapshots, runtime). * Used by review reject to undo a bad chapter and everything that followed. * * Returns the list of chapter numbers that were discarded. */ rollbackToChapter(bookId: string, targetChapter: number): Promise>; private writeIfMissing; } //# sourceMappingURL=manager.d.ts.map