/**
 * Analytics Collector
 *
 * Core class for collecting and storing usage analytics events.
 * Implements append-only JSONL storage with automatic rotation.
 */
import { AnalyticsEvent, AnalyticsEventType, AnalyticsConfig } from './types.js';
/**
 * Singleton analytics collector for tracking SpecWeave usage
 */
export declare class AnalyticsCollector {
    private static instances;
    private config;
    private analyticsDir;
    private eventsFile;
    private initialized;
    private constructor();
    /**
     * Get or create an instance for the given project root
     */
    static getInstance(projectRoot?: string, config?: Partial<AnalyticsConfig>): AnalyticsCollector;
    /**
     * Reset all instances (for testing)
     */
    static reset(): void;
    /**
     * Initialize the analytics directory
     */
    private ensureInitialized;
    /**
     * Track a command invocation
     */
    trackCommand(name: string, options?: {
        plugin?: string;
        increment?: string;
        duration?: number;
        success?: boolean;
        error?: string;
        args?: string[];
    }): void;
    /**
     * Track a skill activation
     */
    trackSkill(name: string, options?: {
        plugin?: string;
        increment?: string;
        duration?: number;
        success?: boolean;
        error?: string;
    }): void;
    /**
     * Track an agent spawn
     */
    trackAgent(name: string, options?: {
        plugin?: string;
        increment?: string;
        duration?: number;
        success?: boolean;
        error?: string;
        description?: string;
    }): void;
    /**
     * Track a generic event
     */
    track(event: Omit<AnalyticsEvent, 'timestamp'>): void;
    /**
     * Append an event to the JSONL file
     */
    private appendEvent;
    /**
     * Check if log rotation is needed
     */
    private checkRotation;
    /**
     * Rotate the log file, keeping only recent events
     */
    private rotateLog;
    /**
     * Read all events from the log
     */
    readEvents(): AnalyticsEvent[];
    /**
     * Read events filtered by date range and type
     */
    readEventsFiltered(options: {
        since?: string;
        until?: string;
        type?: AnalyticsEventType;
        plugin?: string;
    }): AnalyticsEvent[];
    /**
     * Get the analytics directory path
     */
    getAnalyticsDir(): string;
    /**
     * Check if analytics is enabled
     */
    isEnabled(): boolean;
    /**
     * Disable analytics collection
     */
    disable(): void;
    /**
     * Enable analytics collection
     */
    enable(): void;
}
/**
 * Convenience function to track a command
 */
export declare function trackCommand(name: string, options?: Parameters<AnalyticsCollector['trackCommand']>[1]): void;
/**
 * Convenience function to track a skill
 */
export declare function trackSkill(name: string, options?: Parameters<AnalyticsCollector['trackSkill']>[1]): void;
/**
 * Convenience function to track an agent
 */
export declare function trackAgent(name: string, options?: Parameters<AnalyticsCollector['trackAgent']>[1]): void;
//# sourceMappingURL=analytics-collector.d.ts.map