/**
 * Core Memory Store - Independent storage system for core memories
 * Provides persistent storage for high-level architectural and strategic context
 */
export interface CoreMemory {
    id: string;
    content: string;
    summary: string;
    raw_output?: string;
    created_at: string;
    updated_at: string;
    archived: boolean;
    metadata?: string;
}
export interface SessionCluster {
    id: string;
    name: string;
    description?: string;
    intent?: string;
    created_at: string;
    updated_at: string;
    status: 'active' | 'archived' | 'merged';
    metadata?: string;
}
export interface ClusterMember {
    cluster_id: string;
    session_id: string;
    session_type: 'core_memory' | 'workflow' | 'cli_history' | 'native';
    sequence_order: number;
    added_at: string;
    relevance_score: number;
}
export interface ClusterRelation {
    source_cluster_id: string;
    target_cluster_id: string;
    relation_type: 'depends_on' | 'extends' | 'conflicts_with' | 'related_to';
    created_at: string;
}
export interface SessionMetadataCache {
    session_id: string;
    session_type: string;
    title?: string;
    summary?: string;
    keywords?: string[];
    token_estimate?: number;
    file_patterns?: string[];
    created_at?: string;
    last_accessed?: string;
    access_count: number;
}
export interface MemoryChunk {
    id?: number;
    source_id: string;
    source_type: 'core_memory' | 'workflow' | 'cli_history';
    chunk_index: number;
    content: string;
    embedding?: Buffer;
    metadata?: string;
    created_at: string;
}
export interface ClaudeUpdateRecord {
    id?: number;
    file_path: string;
    file_level: 'user' | 'project' | 'module';
    module_path?: string;
    updated_at: string;
    update_source: 'manual' | 'cli_sync' | 'dashboard' | 'api';
    git_commit_hash?: string;
    files_changed_before_update: number;
    metadata?: string;
}
/**
 * Core Memory Store using SQLite
 */
export declare class CoreMemoryStore {
    private db;
    private dbPath;
    private projectPath;
    constructor(projectPath: string);
    /**
     * Initialize database schema
     */
    private initDatabase;
    /**
     * Migrate database by removing old tables, views, and triggers
     */
    private migrateDatabase;
    /**
     * Generate timestamp-based ID for core memory
     */
    private generateId;
    /**
     * Generate cluster ID
     */
    generateClusterId(): string;
    /**
     * Upsert a core memory
     */
    upsertMemory(memory: Partial<CoreMemory> & {
        content: string;
    }): CoreMemory;
    /**
     * Get memory by ID
     */
    getMemory(id: string): CoreMemory | null;
    /**
     * Get all memories
     */
    getMemories(options?: {
        archived?: boolean;
        limit?: number;
        offset?: number;
    }): CoreMemory[];
    /**
     * Archive a memory
     */
    archiveMemory(id: string): void;
    /**
     * Delete a memory
     */
    deleteMemory(id: string): void;
    /**
     * Generate summary for a memory using CLI tool
     */
    generateSummary(memoryId: string, tool?: 'gemini' | 'qwen'): Promise<string>;
    /**
     * Create a new session cluster
     */
    createCluster(cluster: Partial<SessionCluster> & {
        name: string;
    }): SessionCluster;
    /**
     * Get cluster by ID
     */
    getCluster(id: string): SessionCluster | null;
    /**
     * List all clusters
     */
    listClusters(status?: string): SessionCluster[];
    /**
     * Update cluster
     */
    updateCluster(id: string, updates: Partial<SessionCluster>): SessionCluster | null;
    /**
     * Delete cluster
     */
    deleteCluster(id: string): boolean;
    /**
     * Merge multiple clusters into one
     * Keeps the first cluster and moves all members from others into it
     * @param targetClusterId The cluster to keep
     * @param sourceClusterIds The clusters to merge into target (will be deleted)
     * @returns Number of members moved
     */
    mergeClusters(targetClusterId: string, sourceClusterIds: string[]): number;
    /**
     * Add member to cluster
     */
    addClusterMember(member: Omit<ClusterMember, 'added_at'>): ClusterMember;
    /**
     * Remove member from cluster
     */
    removeClusterMember(clusterId: string, sessionId: string): boolean;
    /**
     * Get all members of a cluster
     */
    getClusterMembers(clusterId: string): ClusterMember[];
    /**
     * Get all clusters that contain a session
     */
    getSessionClusters(sessionId: string): SessionCluster[];
    /**
     * Add relation between clusters
     */
    addClusterRelation(relation: Omit<ClusterRelation, 'created_at'>): ClusterRelation;
    /**
     * Remove relation between clusters
     */
    removeClusterRelation(sourceId: string, targetId: string): boolean;
    /**
     * Get all relations for a cluster
     */
    getClusterRelations(clusterId: string): ClusterRelation[];
    /**
     * Upsert session metadata
     */
    upsertSessionMetadata(metadata: SessionMetadataCache): SessionMetadataCache;
    /**
     * Get session metadata
     */
    getSessionMetadata(sessionId: string): SessionMetadataCache | null;
    /**
     * Search sessions by keyword
     */
    searchSessionsByKeyword(keyword: string): SessionMetadataCache[];
    /**
     * Chunk content into smaller pieces for embedding
     * @param content Content to chunk
     * @param sourceId Source identifier (e.g., memory ID)
     * @param sourceType Type of source
     * @returns Array of chunk content strings
     */
    chunkContent(content: string, sourceId: string, sourceType: string): string[];
    /**
     * Insert a single chunk
     */
    insertChunk(chunk: Omit<MemoryChunk, 'id'>): number;
    /**
     * Insert multiple chunks in a batch
     */
    insertChunksBatch(chunks: Omit<MemoryChunk, 'id'>[]): void;
    /**
     * Get all chunks for a source
     */
    getChunks(sourceId: string): MemoryChunk[];
    /**
     * Get chunks by source type
     */
    getChunksByType(sourceType: string): MemoryChunk[];
    /**
     * Get chunks without embeddings
     */
    getUnembeddedChunks(limit?: number): MemoryChunk[];
    /**
     * Update embedding for a chunk
     */
    updateChunkEmbedding(chunkId: number, embedding: Buffer): void;
    /**
     * Update embeddings for multiple chunks in a batch
     */
    updateChunkEmbeddingsBatch(updates: {
        id: number;
        embedding: Buffer;
    }[]): void;
    /**
     * Delete all chunks for a source
     */
    deleteChunks(sourceId: string): void;
    /**
     * Insert a CLAUDE.md update record
     */
    insertClaudeUpdateRecord(record: Omit<ClaudeUpdateRecord, 'id'>): ClaudeUpdateRecord;
    /**
     * Get the last update record for a file
     */
    getLastClaudeUpdate(filePath: string): ClaudeUpdateRecord | null;
    /**
     * Get update history for a file
     */
    getClaudeUpdateHistory(filePath: string, limit?: number): ClaudeUpdateRecord[];
    /**
     * Get all CLAUDE.md update records for freshness calculation
     */
    getAllClaudeUpdateRecords(): ClaudeUpdateRecord[];
    /**
     * Delete update records for a file
     */
    deleteClaudeUpdateRecords(filePath: string): number;
    /**
     * Close database connection
     */
    close(): void;
}
/**
 * Get or create a store instance for a project
 */
export declare function getCoreMemoryStore(projectPath: string): CoreMemoryStore;
export interface ProjectInfo {
    id: string;
    path: string;
    memoriesCount: number;
    clustersCount: number;
    lastUpdated?: string;
}
export interface ExportedMemory {
    version: string;
    exportedAt: string;
    sourceProject: string;
    memories: CoreMemory[];
}
/**
 * List all projects with their memory counts
 */
export declare function listAllProjects(): ProjectInfo[];
/**
 * Get memories from another project by ID
 */
export declare function getMemoriesFromProject(projectId: string): CoreMemory[];
/**
 * Find a memory by ID across all projects
 * Searches through all project databases to locate a specific memory
 */
export declare function findMemoryAcrossProjects(memoryId: string): {
    memory: CoreMemory;
    projectId: string;
} | null;
/**
 * Export memories to a JSON file
 */
export declare function exportMemories(projectPath: string, outputPath: string, options?: {
    ids?: string[];
    includeArchived?: boolean;
}): number;
/**
 * Import memories from a JSON file or another project
 */
export declare function importMemories(targetProjectPath: string, source: string, // File path or project ID
options?: {
    overwrite?: boolean;
    prefix?: string;
}): {
    imported: number;
    skipped: number;
};
/**
 * Close all store instances
 */
export declare function closeAllStores(): void;
export default CoreMemoryStore;
//# sourceMappingURL=core-memory-store.d.ts.map