/**
 * Usage Analytics Schema for NodeBench MCP
 *
 * Tracks tool usage, project context, and generates smart preset recommendations.
 * All data stored locally in SQLite at ~/.nodebench/analytics.db
 */
import Database from 'better-sqlite3';
export interface ToolUsageRecord {
    id?: number;
    toolName: string;
    toolset: string;
    timestamp: number;
    duration: number;
    success: boolean;
    errorMessage?: string;
    projectPath: string;
    preset: string;
    args?: string;
}
export interface ProjectContextRecord {
    id?: number;
    projectPath: string;
    projectType: string;
    detectedAt: number;
    lastSeen: number;
    language: string;
    framework?: string;
    hasTests: boolean;
    hasCI: boolean;
    hasDocs: boolean;
    fileCount: number;
}
export interface PresetHistoryRecord {
    id?: number;
    projectPath: string;
    preset: string;
    toolsetCount: number;
    selectedAt: number;
    selectionReason: 'manual' | 'smart' | 'default';
}
export interface UsageStatsCacheRecord {
    id?: number;
    projectPath: string;
    cacheKey: string;
    stats: string;
    computedAt: number;
    ttl: number;
}
export declare function initAnalyticsDb(): Database.Database;
export declare function getAnalyticsDb(): Database.Database;
export declare function closeAnalyticsDb(db: Database.Database): void;
export declare function recordToolUsage(db: Database.Database, record: Omit<ToolUsageRecord, 'id'>): void;
export declare function updateProjectContext(db: Database.Database, context: Omit<ProjectContextRecord, 'id'>): void;
export declare function recordPresetSelection(db: Database.Database, record: Omit<PresetHistoryRecord, 'id'>): void;
export declare function getCachedStats(db: Database.Database, projectPath: string, cacheKey: string): string | null;
export declare function setCachedStats(db: Database.Database, record: Omit<UsageStatsCacheRecord, 'id'>): void;
export declare function clearOldRecords(db: Database.Database, daysToKeep?: number): void;
