import type { Entry, MemoryProfile } from './EntrySchema.js'; import type { Clock } from '../shared/Clock.js'; /** Categories whose entries are permanently protected from auto-pruning. */ export declare const PROTECTED_CATEGORIES: Set; /** Maximum number of unprotected active entries before compact prunes oldest. */ export declare const MAX_UNPROTECTED_ENTRIES = 500; export declare class ProfileManager { private mutex; private clock; private profilePath; private deviceId; private cachedProfile; constructor(profilePath: string, clock: Clock, deviceId?: string); /** Force read from disk (internal). */ private loadFromDisk; load(): Promise; save(entries: Entry[]): Promise; getAll(): Promise; getById(id: string): Promise; upsert(partial: Partial & { id?: string; category: string; content: string; source: string; }): Promise; /** Batch upsert — single read + N mutations + single write. */ upsertBatch(items: Array & { id?: string; category: string; content: string; source: string; }>): Promise; softDelete(id: string): Promise; /** Invalidate in-memory cache (call after external file changes, e.g. git pull). */ invalidateCache(): void; /** * Compact: remove tombstones + prune excess unprotected entries. * Protected categories (preference/identity/skill/habit) are NEVER auto-removed. * Unprotected entries beyond MAX_UNPROTECTED_ENTRIES are pruned: oldest + lowest confidence first. */ compact(): Promise<{ removed: number; remaining: number; }>; private pruneExpiredTombstones; /** * Prune unprotected active entries beyond MAX_UNPROTECTED_ENTRIES. * Sort by (updated ASC, confidence ASC) — oldest + lowest confidence removed first. * Protected category entries and tombstones are never touched. */ private pruneExcessUnprotected; getProfilePath(): string; getDeviceId(): string; }