/**
 * Options Enhancement Utilities
 * Provides intelligent enhancement of GenerateOptions with factory patterns
 * Supports domain configuration, streaming optimization, and MCP integration
 */
import type { GenerateOptions, UnifiedGenerationOptions, StreamOptions, ConflictDetectionPlugin, EnhancementOptions, EnhancementResult, EnhancementType } from "../types/index.js";
/**
 * Options Enhancement Utility Class
 * Main utility for enhancing GenerateOptions with factory patterns
 */
export declare class OptionsEnhancer {
    /**
     * Thread-safe enhancement counter using SharedArrayBuffer and Atomics
     *
     * NOTE ON THREAD-SAFETY:
     * JavaScript's main execution is single-threaded. Thread-safety using SharedArrayBuffer and Atomics
     * is only relevant in environments that support multi-threading, such as web workers (in browsers)
     * or worker threads (in Node.js).
     *
     * RATIONALE FOR THREAD-SAFETY:
     * OptionsEnhancer is used across multiple worker threads in high-performance scenarios:
     * - Parallel batch processing (batchEnhanceParallel function)
     * - Streaming operations with concurrent enhancements
     * - Factory pattern implementations that may run in web workers
     * - Analytics tracking requires accurate counts across all threads
     *
     * SharedArrayBuffer + Atomics ensures accurate statistics without race conditions
     * when enhancement operations occur simultaneously across multiple contexts.
     *
     * NOTE: SharedArrayBuffer requires cross-origin isolation headers in browsers:
     *   - Cross-Origin-Opener-Policy: same-origin
     *   - Cross-Origin-Embedder-Policy: require-corp
     * Without these, SharedArrayBuffer will be unavailable and thread-safety will be disabled.
     * In Node.js, SharedArrayBuffer is available in worker threads.
     */
    private static enhancementCountBuffer;
    private static enhancementCountArray;
    private static fallbackEnhancementCount;
    private static get enhancementCount();
    private static incrementEnhancementCount;
    /**
     * Enhance GenerateOptions with factory patterns
     * Primary method for applying enhancements
     */
    static enhance(options: GenerateOptions, enhancementOptions: EnhancementOptions): EnhancementResult;
    /**
     * Enhance options for streaming optimization
     * Specialized method for streaming enhancements
     */
    static enhanceForStreaming(options: GenerateOptions, streamingConfig?: {
        chunkSize?: number;
        bufferSize?: number;
        enableProgress?: boolean;
    }): EnhancementResult;
    /**
     * Convert legacy business context to factory options
     * Migration utility for existing business-specific code
     */
    static migrateFromLegacy(options: GenerateOptions, legacyContext: Record<string, unknown>, domainType: string): EnhancementResult;
    /**
     * Create unified options from separate generation and streaming options
     * Utility for combining different option types
     */
    static createUnified(generateOptions: GenerateOptions, streamOptions?: Partial<StreamOptions>): UnifiedGenerationOptions;
    /**
     * Enhance GenerateOptions with domain configuration
     * Convenience method for domain-specific enhancements
     */
    static enhanceWithDomain(options: GenerateOptions, domainConfig: {
        domainType: string;
        keyTerms?: string[];
        failurePatterns?: string[];
        successPatterns?: string[];
        evaluationCriteria?: Record<string, unknown>;
    }): EnhancementResult;
    /**
     * Validate enhancement compatibility
     * Check if enhancement options are compatible with base options
     */
    static validateEnhancement(options: GenerateOptions, enhancementOptions: EnhancementOptions): {
        valid: boolean;
        warnings: string[];
        recommendations: string[];
    };
    private static applyEnhancement;
    private static applyStreamingOptimization;
    private static applyMcpIntegration;
    private static applyLegacyMigration;
    private static applyContextConversion;
    private static applyDomainConfiguration;
    private static createErrorResult;
    /**
     * Get enhancement statistics
     * Utility for monitoring enhancement usage
     */
    static getStatistics(): {
        enhancementCount: number;
        lastReset: number;
    };
    /**
     * Reset enhancement statistics
     * Utility for clearing counters
     */
    static resetStatistics(): void;
}
/**
 * Convenience functions for common enhancement patterns
 */
/**
 * Quick streaming enhancement
 * Simplified interface for streaming optimization
 */
export declare function enhanceForStreaming(options: GenerateOptions, chunkSize?: number): EnhancementResult;
/**
 * Quick legacy migration
 * Simplified interface for legacy context migration
 */
export declare function migrateLegacyContext(options: GenerateOptions, legacyContext: Record<string, unknown>, domainType: string): EnhancementResult;
/**
 * Batch enhancement utility with intelligent parallel processing
 * Automatically detects independent enhancements for parallel processing
 */
export declare function batchEnhance(options: GenerateOptions, enhancements: EnhancementOptions[]): EnhancementResult;
/**
 * Plugin registry for managing conflict detection plugins
 */
declare class ConflictDetectionRegistry {
    private plugins;
    private activePlugins;
    constructor();
    /**
     * Register a new conflict detection plugin
     */
    registerPlugin(plugin: ConflictDetectionPlugin): void;
    /**
     * Set active plugins (in order of priority)
     */
    setActivePlugins(pluginNames: string[]): void;
    /**
     * Detect conflicts using active plugins
     */
    detectConflicts(enhancementA: EnhancementType, enhancementB: EnhancementType, optionsA?: EnhancementOptions, optionsB?: EnhancementOptions): {
        hasConflict: boolean;
        severity: "low" | "medium" | "high";
        detectedBy: string[];
        suggestions: string[];
    };
    /**
     * Get information about registered plugins
     */
    getPluginInfo(): Array<{
        name: string;
        version: string;
        active: boolean;
    }>;
}
/**
 * Get the global conflict detection registry for plugin management
 * Allows external systems to register custom conflict detection plugins
 */
export declare function getConflictDetectionRegistry(): ConflictDetectionRegistry;
/**
 * Parallel batch enhancement utility
 * Apply multiple independent enhancements in parallel for better performance
 * Note: Only use for independent enhancements that don't depend on each other
 */
export declare function batchEnhanceParallel(baseOptions: GenerateOptions[], enhancements: EnhancementOptions[]): Promise<EnhancementResult[]>;
/**
 * Batch enhancement with dependency handling
 * Apply enhancements with proper dependency resolution
 */
export declare function batchEnhanceWithDependencies(options: GenerateOptions, enhancements: (EnhancementOptions & {
    dependsOn?: number[];
})[]): EnhancementResult;
export {};
