/**
 * Sleep-Time Consolidation — LLM-driven background memory hygiene for CLEO BRAIN.
 *
 * Implements the "sleep-time compute" pattern inspired by Letta OS: after a
 * session ends, a cheap LLM pass runs in the background to:
 *   1. Merge near-duplicate entries (embedding similarity > 0.85)
 *   2. Prune short-tier stale entries with low quality (7d old, quality < 0.4)
 *   3. Synthesize frequently-cited learnings into higher-quality patterns
 *   4. Extract cross-cutting insights from clusters of related observations
 *
 * All LLM calls use `claude-haiku-4-5-20251001` (cheapest available model).
 * No API key = silent no-op for LLM steps; structural steps still run.
 * All errors are caught and logged — nothing here may block session end.
 *
 * ## Configuration
 *
 * Add to `config.json` under `brain.sleepConsolidation`:
 * ```json
 * {
 *   "brain": {
 *     "sleepConsolidation": {
 *       "enabled": true
 *     }
 *   }
 * }
 * ```
 *
 * @task T555
 * @epic T549
 * @see packages/core/src/memory/observer-reflector.ts (Observer/Reflector pattern)
 * @see packages/core/src/memory/brain-lifecycle.ts (runConsolidation)
 */
/** Count of changes from the merge-duplicates step. */
export interface MergeDuplicatesResult {
    /** Number of duplicate entries merged (soft-evicted clones). */
    merged: number;
    /** Number of LLM merge decisions made. */
    llmDecisions: number;
}
/** Count of changes from the prune-stale step. */
export interface PruneStaleResult {
    /** Number of entries soft-evicted. */
    pruned: number;
    /** Number of entries the LLM decided to preserve. */
    preserved: number;
}
/** Count of changes from the strengthen-patterns step. */
export interface StrengthenPatternsResult {
    /** Number of high-citation learnings synthesized. */
    synthesized: number;
    /** Number of new patterns generated. */
    patternsGenerated: number;
}
/** Count of changes from the generate-insights step. */
export interface GenerateInsightsResult {
    /** Number of observation clusters processed. */
    clustersProcessed: number;
    /** Number of new insight observations stored. */
    insightsStored: number;
}
/** Aggregated result from the full sleep consolidation run. */
export interface SleepConsolidationResult {
    /** Whether the run was enabled and fully attempted. */
    ran: boolean;
    /** Step 1: merge duplicates. */
    mergeDuplicates: MergeDuplicatesResult;
    /** Step 2: prune stale entries. */
    pruneStale: PruneStaleResult;
    /** Step 3: strengthen frequently-cited patterns. */
    strengthenPatterns: StrengthenPatternsResult;
    /** Step 4: generate cross-cutting insights. */
    generateInsights: GenerateInsightsResult;
}
/** Sleep consolidation configuration resolved from config.json. */
export interface SleepConsolidationConfig {
    enabled: boolean;
}
/**
 * Run the full sleep-time consolidation pipeline for CLEO BRAIN.
 *
 * This is the main entry point for LLM-driven background memory hygiene.
 * It is designed to run after session end (via setImmediate) and must never
 * throw — all errors are caught and logged.
 *
 * Steps (in order):
 *   1. Merge duplicates — embedding-similarity-based dedup with LLM confirmation
 *   2. Prune stale — evict low-quality short-tier entries; LLM may preserve some
 *   3. Strengthen patterns — synthesize frequently-cited learnings into patterns
 *   4. Generate insights — extract cross-cutting insights from observation clusters
 *
 * Graceful degradation: when no Anthropic API key is available, LLM steps
 * silently skip their LLM call and fall back to structural heuristics.
 *
 * @param projectRoot - Project root directory for brain.db resolution.
 * @returns Aggregated result counts from each step.
 */
export declare function runSleepConsolidation(projectRoot: string): Promise<SleepConsolidationResult>;
//# sourceMappingURL=sleep-consolidation.d.ts.map