/** * SeriesManager — PROC-11 * * Groups multiple novel projects into a series, with a shared bible and * cross-book thread tracking. All persistence is via MCPClient SQL queries * against the `series`, `series_books`, and `series_bible` tables created by * migration 014_series. */ import type { MCPClient } from '../core/database.js'; export interface Series { id: string; title: string; description?: string; createdAt: string; updatedAt: string; } export interface SeriesBook { seriesId: string; projectId: string; bookNumber: number; title: string; } export interface SeriesBibleEntry { id: string; seriesId: string; /** e.g. 'character' | 'world' | 'timeline' | 'theme' | 'other' */ category: string; entryKey: string; value: string; notes?: string; /** book numbers the entry applies to; empty array = all books */ appliesToBooks: number[]; createdAt: string; updatedAt: string; } export interface CrossBookThread { threadTitle: string; openedInBook: number; openedInProject: string; resolvedInBook?: number; /** true when the promise is open across > 1 book with no resolution */ isOrphan: boolean; } export declare class SeriesManager { private readonly client; constructor(client: MCPClient); /** * Create a new series record. * * @param title - Series title (required) * @param description - Optional description / elevator pitch * @returns The persisted Series record */ createSeries(title: string, description?: string): Promise; /** * Associate a novel project with a series at a specific book number. * * @param seriesId - The owning series id * @param projectId - The novel project id to attach * @param bookNumber - Ordinal position within the series (1-based) * @param title - Display title for this book entry */ addBook(seriesId: string, projectId: string, bookNumber: number, title: string): Promise; /** * Return all series records, ordered by title. */ listSeries(): Promise; /** * Return all books belonging to a series, ordered by book number. * * @param seriesId - The target series id */ getSeriesBooks(seriesId: string): Promise; /** * Add a series-bible entry. If an entry with the same (series_id, category, * entry_key) already exists it is replaced via INSERT OR REPLACE. * * @param seriesId - Owning series id * @param category - Logical grouping: 'character' | 'world' | 'timeline' | 'theme' | 'other' * @param entryKey - Dotted key, e.g. "Mira.age_in_book_1" * @param value - The canonical value string * @param opts - Optional notes and book-number applicability list * @returns The persisted SeriesBibleEntry */ addBibleEntry(seriesId: string, category: string, entryKey: string, value: string, opts?: { notes?: string; appliesToBooks?: number[]; }): Promise; /** * List series-bible entries, optionally filtered by category. * * @param seriesId - Owning series id * @param category - Optional category filter * @returns Matching entries ordered by category, entry_key */ listBibleEntries(seriesId: string, category?: string): Promise; /** * Return cross-book threads: narrative promises that remain open across books. * * Algorithm: * 1. Load all books for the series ordered by book_number. * 2. For each book, query `narrative_promises` for open/developing promises. * 3. A promise is a cross-book thread if its title also appeared as open/developing * in the previous book (title-based heuristic). * 4. Promises that appear open in book N but were also open in book N-1 are flagged * as "orphan" threads. * * @param seriesId - The target series id * @returns Array of cross-book threads (may be empty) */ trackCrossBookThreads(seriesId: string): Promise; /** * Compare series-bible entries against each book's `canon_items` to flag * contradictions: same key, different value. * * The comparison key is derived from the `subject` field of each canon item. * A contradiction is raised when `canon_items.subject` === `series_bible.entry_key` * and the canon item's description does not include the bible value. * * @param seriesId - The target series id * @returns Array of consistency issues (may be empty) */ checkSeriesConsistency(seriesId: string): Promise>; } //# sourceMappingURL=series-manager.d.ts.map