/** * Scene Context Assembly * Loads relevant story context for AI when writing a scene */ import type { MCPClient } from '../core/database.js'; import type { SceneContext } from '../types/novel.js'; export interface ContextOptions { /** * Number of recent chapters to include summaries for */ recentChapterCount?: number; /** * Maximum word count for context (to fit in AI window) */ maxTokenBudget?: number; /** * Include full character details or just names */ detailedCharacters?: boolean; /** * Include world rules relevant to location */ includeWorldRules?: boolean; } export declare class SceneContextAssembler { private mcpClient; private projectId; constructor(mcpClient: MCPClient, projectId: number); /** * Assemble complete context for writing a scene */ assembleContext(sceneId: number, options?: ContextOptions): Promise; /** * Prune low-priority context blocks until the assembled context fits within the token budget. * Pruning order (lowest priority first): * 1. Oldest chapter summaries (keep most recent) * 2. Inactive plot threads * 3. Non-hard world rules * 4. Timeline events */ pruneToTokenBudget(context: SceneContext, budget: number): SceneContext; /** * Load scene details */ private loadScene; /** * Load chapter for a scene */ private loadChapterForScene; /** * Load characters appearing in scene */ private loadSceneCharacters; /** * Load location details */ private loadLocation; /** * Load world rules relevant to the scene */ private loadRelevantWorldRules; /** * Load plot threads active in this scene */ private loadRelevantPlotThreads; /** * Load summaries of recent chapters for continuity */ private loadRecentChapterSummaries; /** * Load timeline events relevant to current point in story */ private loadRelevantTimelineEvents; /** * Format context as markdown for AI prompt */ formatContextAsMarkdown(context: SceneContext): string; /** * Get estimated token count for context */ estimateTokenCount(context: SceneContext): number; } //# sourceMappingURL=scene-context.d.ts.map