export interface ExtractionConfig {
    enabled: boolean;
    maxExtractionsPerSession: number;
    minNewMessagesForExtraction: number;
    skipIfUserWroteMemory: boolean;
}
export interface ExtractionCursor {
    lastExtractedMessageId: string | null;
    extractionCount: number;
    sessionId: string;
}
export type MemoryCategory = "fact" | "preference" | "decision" | "pattern" | "todo";
export interface ExtractedMemory {
    content: string;
    category: MemoryCategory;
    confidence: number;
    source: "auto-extraction";
}
export declare const EXTRACTION_PROMPT = "You are a memory extraction agent. Analyze the conversation below and identify\ndurable facts worth remembering across sessions. Focus on:\n- User preferences, habits, constraints\n- Decisions made and their rationale\n- Technical patterns or project details\n- Recurring topics or themes\n\nDo NOT extract:\n- Transient details (timestamps, filenames being worked on right now)\n- Things already in the existing memory\n- Obvious/generic information\n\nReturn a JSON array of objects with: content (string), category (fact|preference|decision|pattern|todo), confidence (0.0-1.0).\nReturn an empty array [] if nothing is worth extracting.";
/**
 * Evaluate five gates that must all pass before memory extraction should run.
 *
 * Gate 1: extraction is enabled in config
 * Gate 2: session extraction budget not exhausted
 * Gate 3: last turn had no tool calls (conversation is "settling")
 * Gate 4: enough new messages since last extraction
 * Gate 5: user did not manually write to memory this turn
 *
 * Returns `false` on the first gate that fails.
 */
export declare function shouldExtract(config: ExtractionConfig, cursor: ExtractionCursor, lastTurnHadToolCalls: boolean, newMessageCount: number, userWroteMemoryThisTurn: boolean): boolean;
/**
 * Build the extraction prompt with existing memory context and the new
 * messages to analyse, then parse the LLM response into validated
 * {@link ExtractedMemory} entries.
 *
 * On any error (malformed JSON, empty response, unexpected shape) this
 * function returns an empty array — it never throws.
 */
export declare function extractMemories(systemPrompt: string, messages: ReadonlyArray<{
    role: string;
    content: string;
}>, existingMemory: string): Promise<ExtractedMemory[]>;
/**
 * Parse a raw LLM response string into validated {@link ExtractedMemory}
 * entries. Returns an empty array on any parse or validation failure.
 */
export declare function parseExtractionResponse(raw: string): ExtractedMemory[];
/**
 * Advance the extraction cursor after a successful extraction round.
 * Returns a new cursor — the original is not mutated.
 */
export declare function advanceCursor(cursor: ExtractionCursor, lastMessageId: string): ExtractionCursor;
/**
 * Create a fresh extraction cursor for a new session.
 */
export declare function createCursor(sessionId: string): ExtractionCursor;
/**
 * Return the default extraction configuration.
 */
export declare function createDefaultConfig(): ExtractionConfig;
/**
 * Assemble the full prompt text sent to the LLM for memory extraction.
 * Exposed so that the runner module can call the provider with this text and
 * then feed the response into {@link parseExtractionResponse}.
 */
export declare function buildExtractionPrompt(messages: ReadonlyArray<{
    role: string;
    content: string;
}>, existingMemory: string): string;
