/**
 * Auto-Capture Memory System
 *
 * Inspired by OpenClaw's intelligent memory capture.
 * Automatically detects and stores important information from conversations.
 *
 * Features:
 * - Pattern-based detection (remember, preferences, contacts)
 * - Deduplication with similarity threshold
 * - Lifecycle hooks for auto-recall and auto-capture
 */
import { EventEmitter } from 'events';
import { EnhancedMemory, MemoryEntry, MemoryType } from './enhanced-memory.js';
export interface CapturePattern {
    id: string;
    name: string;
    /** Regex patterns to match */
    patterns: RegExp[];
    /** Memory type to assign */
    memoryType: MemoryType;
    /** Importance score (0-1) */
    importance: number;
    /** Tags to apply */
    tags: string[];
    /** Whether to extract the matched content or the full message */
    extractMatch: boolean;
}
export interface CaptureResult {
    captured: boolean;
    memoryId?: string;
    pattern?: string;
    content?: string;
    deduplicated?: boolean;
    similarMemoryId?: string;
}
export interface AutoCaptureConfig {
    /** Enable auto-capture */
    enabled: boolean;
    /** Similarity threshold for deduplication (0-1, default 0.95) */
    deduplicationThreshold: number;
    /** Minimum content length to capture */
    minContentLength: number;
    /** Maximum content length to capture */
    maxContentLength: number;
    /** Patterns to exclude (system messages, etc.) */
    excludePatterns: RegExp[];
    /** Custom capture patterns */
    customPatterns: CapturePattern[];
}
export interface MemoryRecallResult {
    memories: MemoryEntry[];
    injectedContext: string;
    tokenCount: number;
}
/**
 * Auto-Capture Memory Manager
 *
 * Automatically captures important information from conversations.
 */
export declare class AutoCaptureManager extends EventEmitter {
    private config;
    private memory;
    private patterns;
    private recentCaptures;
    private captureHistory;
    constructor(memory: EnhancedMemory, config?: Partial<AutoCaptureConfig>);
    /**
     * Check if content matches any capture pattern
     */
    private matchPatterns;
    /**
     * Check if content should be excluded
     */
    private shouldExclude;
    /**
     * Calculate simple hash for content
     */
    private hashContent;
    /**
     * Calculate Jaccard similarity between two strings
     */
    private calculateSimilarity;
    /**
     * Check if content is duplicate of existing memory
     */
    checkDuplicate(content: string): Promise<{
        isDuplicate: boolean;
        similarMemoryId?: string;
    }>;
    /**
     * Attempt to capture important information from content
     */
    capture(content: string, context?: {
        sessionId?: string;
        projectId?: string;
    }): Promise<CaptureResult>;
    /**
     * Process a conversation message for auto-capture
     */
    processMessage(role: 'user' | 'assistant', content: string, context?: {
        sessionId?: string;
        projectId?: string;
    }): Promise<CaptureResult[]>;
    /**
     * Recall relevant memories before agent execution
     */
    recall(query: string, options?: {
        maxTokens?: number;
        projectId?: string;
        types?: MemoryType[];
    }): Promise<MemoryRecallResult>;
    /**
     * Get capture statistics
     */
    getStats(): {
        totalCaptures: number;
        deduplicated: number;
        byPattern: Record<string, number>;
        recentCaptures: number;
    };
    /**
     * Add custom capture pattern
     */
    addPattern(pattern: CapturePattern): void;
    /**
     * Remove capture pattern by ID
     */
    removePattern(patternId: string): boolean;
    /**
     * Clear recent captures cache
     */
    clearRecentCache(): void;
}
/**
 * Get auto-capture manager instance
 */
export declare function getAutoCaptureManager(memory?: EnhancedMemory): AutoCaptureManager;
/**
 * Reset auto-capture manager
 */
export declare function resetAutoCaptureManager(): void;
export default AutoCaptureManager;
