/** * Template Manifest Manager * * Manages template manifest in both database and file system. * Dual storage ensures reliability and easy inspection. */ import type { DatabaseClient } from '../db/client.js'; import type { TemplateManifest, TemplateFileEntry } from './types.js'; /** * Manages template manifest in both database and file system */ export declare class TemplateManifestManager { private db; private projectRoot; private readonly manifestPath; constructor(db: DatabaseClient, projectRoot?: string); /** * Load manifest from file system * * @returns Manifest object or null if doesn't exist */ loadManifest(): Promise; /** * Save manifest to file system * * @param manifest - Manifest to save */ saveManifest(manifest: TemplateManifest): Promise; /** * Get manifest from database * * @returns Manifest object or null if doesn't exist */ getDbManifest(): TemplateManifest | null; /** * Save manifest to database * * @param manifest - Manifest to save */ saveDbManifest(manifest: TemplateManifest): void; /** * Sync manifest between DB and file system * Uses DB as source of truth by default * * @param manifest - Manifest to sync * @param source - 'db' or 'file' to determine source of truth */ syncManifest(manifest: TemplateManifest, source?: 'db' | 'file'): Promise; /** * Load manifest from both sources and reconcile * Prefers the most recently updated version * * @returns Reconciled manifest or null */ loadReconciledManifest(): Promise; /** * Get file entry from manifest * * @param relativePath - Relative path to file * @param manifest - Optional manifest to use (otherwise loads) * @returns File entry or null */ getFileEntry(relativePath: string, manifest?: TemplateManifest): Promise; /** * Mark file as user-modified * * @param relativePath - Relative path to file * @param originalHash - Original template hash before modification */ markUserModified(relativePath: string, originalHash?: string): Promise; /** * Clear user-modified flag for a file * * @param relativePath - Relative path to file */ clearUserModified(relativePath: string): Promise; /** * Update file entry in manifest * * @param relativePath - Relative path to file * @param entry - New file entry data */ updateFileEntry(relativePath: string, entry: Partial): Promise; /** * Remove file entry from manifest * * @param relativePath - Relative path to file */ removeFileEntry(relativePath: string): Promise; /** * Get all user-modified files * * @returns Array of relative paths to user-modified files */ getUserModifiedFiles(): Promise; /** * Check if manifest needs update based on version * * @param currentVersion - Current package version * @returns true if manifest is outdated or missing */ needsUpdate(currentVersion: string): Promise; /** * Create empty manifest with current versions * * @param k0ntextVersion - k0ntext package version * @param templateVersion - Template version (usually same as k0ntext version) * @returns New empty manifest */ createEmptyManifest(k0ntextVersion?: string, templateVersion?: string): TemplateManifest; /** * Validate manifest structure * * @param manifest - Manifest to validate * @throws Error if invalid */ private validateManifest; /** * Get manifest file path for display purposes */ getManifestPath(): string; /** * Check if manifest file exists */ manifestExists(): Promise; /** * Delete manifest file (for cleanup/testing) */ deleteManifest(): Promise; } //# sourceMappingURL=manifest.d.ts.map