/**
 * Implicit Memory Extraction — CC extractMemories lightweight port.
 *
 * Architecture:
 *   Layer 1: Zero-cost signal detection (regex) — decides if turn has extractable content
 *   Layer 2: Lightweight LLM pass (async, non-blocking) — extracts structured facts
 *
 * This runs AFTER turn.end, so the user already has their response.
 * Layer 2 only fires for ~10-20% of turns (those with detectable signals).
 *
 * Reference: claude-code src/services/extractMemories/extractMemories.ts
 */
import type { MemoryWriter } from "../ports/memory-writer.js";
export interface ExtractedFact {
    text: string;
    category: "personal_fact" | "preference" | "event" | "lesson" | "pattern" | "decision";
    importance: number;
    eventDate?: string;
}
export interface ImplicitExtractionDeps {
    /** Local memory provider for writing extracted facts. */
    localProvider: MemoryWriter;
    /** User ID. */
    userId: string;
    /** Logger. */
    log: {
        debug(msg: string): void;
        warn(msg: string): void;
    };
    /**
     * LLM invocation function (uses background/cheap model).
     * Returns structured JSON string or null if unavailable.
     */
    llmExtract?: (prompt: string) => Promise<string | null>;
}
export interface TurnPair {
    userMessage: string;
    assistantMessage: string;
}
/**
 * Layer 1: Detect if a user message contains signals worth extracting.
 * Zero LLM cost — pure regex scanning.
 *
 * @returns true if the message likely contains extractable personal facts/events
 */
export declare function hasExtractionSignal(userMessage: string): boolean;
/**
 * Layer 2: Use a lightweight LLM to extract structured facts from a turn pair.
 * Only called when Layer 1 signals are detected.
 */
export declare function extractFactsViaLlm(turn: TurnPair, llmExtract: (prompt: string) => Promise<string | null>, today: string): Promise<ExtractedFact[]>;
/**
 * Run the full implicit extraction pipeline for a completed turn.
 * This is async and non-blocking — call it after turn.end.
 *
 * @returns Number of facts extracted and stored
 */
export declare function runImplicitExtraction(turn: TurnPair, deps: ImplicitExtractionDeps): Promise<number>;
