/** * Co-occurrence Service * * Manages local co-occurrence tracking and data persistence. * * @since v1.66.1 */ import { CooccurrenceMatrix } from '../algorithms/cooccurrence.js'; import type { CooccurrenceEntry } from '../recommendation-types.js'; import type { CommunityCooccurrenceData, PairStatistics } from './cooccurrence-types.js'; /** * Service for managing plugin co-occurrence data */ export declare class CooccurrenceService { private matrix; private localRecord; private communityData; private dataPath; private dirty; constructor(dataDir: string); /** * Initialize the service */ initialize(): void; /** * Create empty local record */ private createEmptyRecord; /** * Load local co-occurrence data from disk */ private loadLocalData; /** * Save local co-occurrence data to disk */ save(): void; /** * Record an observation of plugins installed together */ recordObservation(pluginIds: string[]): void; /** * Get the co-occurrence matrix */ getMatrix(): CooccurrenceMatrix; /** * Get probability that two plugins are used together */ getProbability(pluginA: string, pluginB: string): number; /** * Get plugins frequently used with a given plugin */ getRelatedPlugins(pluginId: string, limit?: number): Array<{ pluginId: string; probability: number; }>; /** * Get statistics for a plugin pair */ getPairStatistics(pluginA: string, pluginB: string): PairStatistics | null; /** * Get all statistics above a minimum probability */ getAllStatistics(minProbability?: number): PairStatistics[]; /** * Load community data from API response */ loadCommunityData(data: CommunityCooccurrenceData): void; /** * Get local tracking statistics */ getTrackingStats(): { totalObservations: number; uniquePairs: number; trackingDays: number; lastUpdated: number; }; /** * Export local data for anonymous reporting */ exportAnonymousData(): CooccurrenceEntry[]; /** * Clear local tracking data */ clearLocalData(): void; /** * Get top plugin pairs by co-occurrence */ getTopPairs(limit?: number): PairStatistics[]; } /** * Get or create the co-occurrence service */ export declare function getCooccurrenceService(dataDir: string): CooccurrenceService; /** * Reset the service instance (for testing) */ export declare function resetCooccurrenceService(): void; //# sourceMappingURL=cooccurrence-service.d.ts.map