/**
 * Reflect Handler - Reflection system with semantic deduplication
 *
 * ARCHITECTURE (v4.0):
 * - PRIMARY: .specweave/skill-memories/{skill}.md (for KNOWN_SKILLS)
 * - OVERFLOW: CLAUDE.md Skill Memories section (for unknown skills only)
 * - LLM-based semantic deduplication (existing memories in extraction prompt)
 * - Auto-pruning of old learnings
 *
 * WHAT IT REMEMBERS:
 * - SpecWeave workflow preferences (how user uses SpecWeave)
 * - Skill-specific learnings (how to improve skill behavior)
 * - Project-specific context (tech stack preferences, conventions)
 *
 * WHAT IT DOES NOT REMEMBER:
 * - Generic coding patterns (use Zustand, prefer hooks, etc.)
 * - Implementation details unrelated to SpecWeave
 *
 * @module core/reflection/reflect-handler
 */
import { type ClaudeModel } from '../../utils/claude-cli-runner.js';
/**
 * Configuration for reflection
 */
export interface ReflectConfig {
    /** Master switch for reflection */
    enabled: boolean;
    /** Model to use for extraction (default: haiku) */
    model: ClaudeModel;
    /** Maximum learnings per session */
    maxLearningsPerSession: number;
    /** Session-end nudge on /sw:done close (default: true). Set false to disable. */
    autoNudge: boolean;
}
/**
 * Default configuration
 */
export declare const DEFAULT_REFLECT_CONFIG: ReflectConfig;
/**
 * A single learning extracted by LLM
 */
export interface SkillLearning {
    /** Skill this learning applies to (e.g., "mobile", "frontend", "architect") */
    skill: string;
    /** The actual learning content */
    learning: string;
}
/**
 * LLM extraction result
 */
export interface LLMExtractionResult {
    /** Learnings organized by skill */
    skillLearnings: SkillLearning[];
}
/**
 * Result of the reflect operation
 */
export interface ReflectResult {
    /** Whether reflect ran */
    ran: boolean;
    /** Why it didn't run (if !ran) */
    reason?: string;
    /** Model used */
    model?: ClaudeModel;
    /** Input summary */
    inputSummary: {
        transcriptLines: number;
    };
    /** What was extracted */
    extracted: {
        skillLearnings: SkillLearning[];
    };
    /** What was written */
    written: {
        learningsAdded: number;
        learningsSkippedDuplicate: number;
        claudeMdPath?: string;
    };
    /** Duration in ms */
    durationMs: number;
}
/**
 * Read reflect configuration from project config
 */
export declare function readReflectConfig(projectRoot: string): ReflectConfig;
/**
 * Main reflect handler - called at session end
 *
 * ARCHITECTURE (v4.0):
 * 1. Check config (enabled?)
 * 2. Read existing memories for LLM context (semantic dedup)
 * 3. Read transcript
 * 4. Extract learnings via LLM (with existing memories for dedup)
 * 5. Write KNOWN skills to .specweave/skill-memories/ (primary storage)
 * 6. Write UNKNOWN skills to CLAUDE.md (overflow only)
 */
export declare function handleReflectStop(transcriptPath: string, projectRoot: string): Promise<ReflectResult>;
/**
 * Format reflect result for console output
 */
export declare function formatReflectResult(result: ReflectResult): string;
/**
 * Migrate old memory files to CLAUDE.md
 *
 * This migrates content from:
 * - .specweave/memory/*.md
 * - ~/.specweave/memory/*.md
 *
 * Into the CLAUDE.md Skill Memories section.
 *
 * IMPORTANT: Always cleans up the deprecated memory directories,
 * even if no learnings were migrated (best-effort migration).
 */
export declare function migrateOldMemoryFiles(projectRoot: string): {
    migrated: number;
    deleted: string[];
};
/**
 * Force cleanup of deprecated .specweave/memory/ directory
 *
 * This is a simpler, more aggressive cleanup that doesn't attempt migration.
 * Use this when you just want to ensure the deprecated directory is gone.
 *
 * @param projectRoot - Project root path
 * @returns Number of files/directories removed
 */
export declare function cleanupDeprecatedMemoryDirectory(projectRoot: string): number;
//# sourceMappingURL=reflect-handler.d.ts.map