/**
 * AnalyticsTracker — Singleton analytics engine for NodeBench MCP
 *
 * Owns the full lifecycle: DB open, tool-call recording, project context,
 * session stats, retention cleanup, and graceful shutdown.
 * index.ts calls tracker.record() instead of inline SQL.
 */
import Database from 'better-sqlite3';
export interface TrackerConfig {
    projectPath: string;
    preset: string;
    toolCount: number;
    /** tool name → toolset name lookup */
    toolToToolset: Map<string, string>;
    /** Tools to skip tracking (avoid recursion) */
    skipTools?: Set<string>;
    /** Days to keep analytics data (default 90) */
    retentionDays?: number;
}
export interface SessionStats {
    totalCalls: number;
    successCount: number;
    failureCount: number;
    totalDuration: number;
    uniqueTools: number;
    topTools: Array<{
        name: string;
        count: number;
    }>;
    errorRate: number;
}
export declare class AnalyticsTracker {
    private db;
    private projectPath;
    private preset;
    private toolToToolset;
    private skipTools;
    private sessionStart;
    private _callCount;
    private _insertStmt;
    private constructor();
    /** Get or create the singleton tracker */
    static init(config: TrackerConfig): AnalyticsTracker;
    /** Get existing instance (returns null if not initialized) */
    static get(): AnalyticsTracker | null;
    /** Underlying DB handle (for stats queries that need it) */
    getDb(): Database.Database;
    /**
     * Record a tool call outcome. Called from the CallToolRequestSchema handler.
     * Returns silently on any error — analytics must never break tool dispatch.
     */
    record(toolName: string, startMs: number, success: boolean, errorMsg: string | null, args?: Record<string, unknown>): void;
    getSessionStats(): SessionStats;
    get callCount(): number;
    close(): void;
    private _initProjectContext;
}
/** @deprecated Use AnalyticsTracker.init() instead */
export declare function initializeProjectContext(db: Database.Database, projectPath: string | undefined, preset: string, toolCount?: number): void;
