/** * Database initialization and management * Uses MCP SQLite server for all database operations */ export interface DatabaseConfig { dbPath: string; projectPath: string; } export declare class DatabaseManager { private config; private mcpClient; constructor(config: DatabaseConfig, mcpClient: MCPClient); /** * Initialize the database with schema if it doesn't exist */ initialize(): Promise; /** * Check if database needs initialization by querying for projects table */ private needsInitialization; /** * Run the schema.sql file to initialize all tables */ private runSchema; /** * Split SQL file into individual statements * Handles multi-line statements, comments, and BEGIN...END blocks */ private splitSQLStatements; /** * Create a new project entry */ createProject(options: { title: string; author?: string; genre?: string; targetWordCount?: number; currentPhase?: string; }): Promise; /** * Get project configuration */ getProject(projectId: number): Promise | null>; /** * Get project health dashboard */ getProjectHealth(projectId: number): Promise | null>; /** * Get all open consistency issues */ getConsistencyIssues(projectId: number, severity?: 'info' | 'warning' | 'error'): Promise[]>; /** * Get active plot threads */ getActivePlotThreads(projectId: number): Promise[]>; /** * Get writing streak information */ getWritingStreak(projectId: number): Promise | null>; } /** * MCP Client interface for SQLite operations * This abstracts the MCP server communication */ export interface MCPClient { readQuery>(sql: string, values?: unknown[]): Promise; writeQuery(sql: string, values?: unknown[]): Promise<{ affected_rows: number; }>; listTables(): Promise; describeTable(tableName: string): Promise[]>; } /** * MCP Client implementation for use inside Claude Code's extension runtime. * callMCPTool() is intentionally left as a stub — it must be overridden or * replaced at runtime by the Claude Code host (which injects MCP tool access). * * For standalone CLI use, prefer DirectSQLiteClient instead. */ export declare class MCPSQLiteClient implements MCPClient { private serverName; constructor(serverName?: string); readQuery>(sql: string, values?: unknown[]): Promise; writeQuery(sql: string, values?: unknown[]): Promise<{ affected_rows: number; }>; listTables(): Promise; describeTable(tableName: string): Promise[]>; protected callMCPTool(toolName: string, args: Record): Promise; } /** * Standalone SQLite client using better-sqlite3. * Used by the novel-writer CLI when running outside Claude Code. */ export declare class DirectSQLiteClient implements MCPClient { private db; private dbPath; constructor(dbPath: string); private getDb; readQuery>(sql: string, values?: unknown[]): Promise; writeQuery(sql: string, values?: unknown[]): Promise<{ affected_rows: number; }>; listTables(): Promise; describeTable(tableName: string): Promise[]>; close(): void; } //# sourceMappingURL=database.d.ts.map