/** * World Rules Synchronization * Syncs world rule YAML files to database, and DB → YAML reverse sync. */ import type { MCPClient } from '../core/database.js'; export interface WorldRulesSyncOptions { /** When true, overwrite DB data from file even if a conflict is detected. */ forceFile?: boolean; } export declare class WorldRulesSync { private mcpClient; private projectId; private projectPath?; private readonly syncStateRepo; constructor(mcpClient: MCPClient, projectId: number, projectPath?: string | undefined); /** * Sync a world rule YAML file to database. * * @param filePath - absolute path to the YAML world-rule file * @param options - optional flags; set `forceFile: true` to suppress conflict errors */ syncWorldRuleFile(filePath: string, options?: WorldRulesSyncOptions): Promise; /** * Export a world rule from the database back to a YAML file (reverse sync). * Writes to `/world-rules/.yaml`. * * @param ruleId - numeric DB id of the world_rule row (as string) * @returns absolute path to the written file */ exportToYAML(ruleId: string): Promise; /** * Upsert world rule record */ private upsertWorldRule; /** * Get all world rules for project */ getWorldRules(categoryFilter?: string): Promise[]>; /** * Get world rules by category */ getRulesByCategory(category: 'magic' | 'technology' | 'physics' | 'social' | 'political'): Promise[]>; /** * Get hard rules (must never violate) */ getHardRules(): Promise; /** * Get flexible rules */ getFlexibleRules(): Promise; /** * Get established rules (have source reference) */ getEstablishedRules(): Promise; /** * Get world rules statistics */ getStats(): Promise<{ total: number; byCategory: Record; hardRules: number; flexibleRules: number; established: number; }>; /** * Sync all world rule files from a directory */ syncAllFromDirectory(worldRulesDir: string): Promise; /** * Delete a world rule */ deleteRule(ruleId: number): Promise; /** * Search world rules by keyword */ searchRules(keyword: string): Promise; } //# sourceMappingURL=world-rules-sync.d.ts.map