import { PrivacyEngine } from '../plugins/privacy/privacy-engine.js'; import type { KnowledgeEntry, KnowledgeCategory } from './types.js'; export interface GlobalSearchOpts { category?: KnowledgeCategory; limit?: number; } export interface GlobalKnowledgeEntry extends KnowledgeEntry { source_project: string; source_projects?: string[]; } export declare class GlobalKnowledgeStore { private db; private dbPath; private stmtCache; private privacyEngine; constructor(privacyEngine?: PrivacyEngine, dbPath?: string); open(): void; private runMigrations; /** * Promote a project-level knowledge entry to the global store. * Runs the privacy engine on content before storing. */ promote(entry: KnowledgeEntry, projectName: string): GlobalKnowledgeEntry; /** * Search the global knowledge store using FTS5 with fallback to scan. */ search(query: string, opts?: GlobalSearchOpts): GlobalKnowledgeEntry[]; /** * Remove an entry from the global store by ID. */ demote(id: string): boolean; /** * Get all global knowledge entries with optional filters. */ getAll(opts?: GlobalSearchOpts): GlobalKnowledgeEntry[]; /** * Get a single entry by ID. */ getById(id: string): GlobalKnowledgeEntry | null; /** * Find potential duplicates of a candidate entry in the global store. * Uses FTS5 for initial candidates, then Jaccard word overlap for scoring. */ findDuplicates(candidate: KnowledgeEntry): Array<{ entry: GlobalKnowledgeEntry; similarity: number; }>; /** * Auto-merge two global entries when confidence is high. * Keeps longer content as base, merges source_projects. */ autoMerge(keepId: string, mergeId: string): GlobalKnowledgeEntry | null; /** * Get merge suggestions from the global store. */ getMergeSuggestions(status?: 'pending' | 'accepted' | 'dismissed' | 'all', limit?: number): Array<{ id: string; local_id: string | null; global_id: string; similarity_score: number; strategy: string; status: string; created_at: number; }>; /** * Update a merge suggestion's status. */ updateMergeSuggestion(id: string, status: 'accepted' | 'dismissed'): boolean; /** * Insert a merge suggestion. */ addMergeSuggestion(suggestion: { localId?: string; globalId: string; similarity: number; strategy: string; }): void; private extractWords; close(): void; private searchFTS5; private searchScan; private rowToEntry; private getDb; } //# sourceMappingURL=global-store.d.ts.map