/**
 * Native AI Plugin System Integration for BFUI
 *
 * This module provides integration between the Native AI plugin system
 * and the BFUI component library.
 */
import { z } from 'zod';
import { Plugin, PluginType, ProviderPlugin, ProviderCapabilities, ProviderModel } from '@bluefly/native_aijs/plugins';
/**
 * Configuration for the BFUI plugin integration
 */
export interface BFUIPluginConfig {
    /** API URL for the native AI service */
    apiUrl?: string;
    /** API key for authentication */
    apiKey?: string;
    /** Default provider to use */
    defaultProvider?: string;
    /** Enable monitoring */
    monitoring?: {
        enabled: boolean;
        serviceName?: string;
        environment?: string;
    };
    /** Caching configuration */
    caching?: {
        enabled: boolean;
        ttl?: number;
    };
    /** Retry configuration */
    retry?: {
        maxRetries?: number;
        initialDelay?: number;
        maxDelay?: number;
        factor?: number;
    };
    /** Plugin-specific configuration */
    plugins?: Record<string, any>;
}
/**
 * Schema for validating BFUI plugin configuration
 */
export declare const BFUIPluginConfigSchema: z.ZodObject<{
    apiUrl: z.ZodOptional<z.ZodString>;
    apiKey: z.ZodOptional<z.ZodString>;
    defaultProvider: z.ZodOptional<z.ZodString>;
    monitoring: z.ZodOptional<z.ZodObject<{
        enabled: z.ZodBoolean;
        serviceName: z.ZodOptional<z.ZodString>;
        environment: z.ZodOptional<z.ZodString>;
    }, "strip", z.ZodTypeAny, {
        enabled: boolean;
        environment?: string | undefined;
        serviceName?: string | undefined;
    }, {
        enabled: boolean;
        environment?: string | undefined;
        serviceName?: string | undefined;
    }>>;
    caching: z.ZodOptional<z.ZodObject<{
        enabled: z.ZodBoolean;
        ttl: z.ZodOptional<z.ZodNumber>;
    }, "strip", z.ZodTypeAny, {
        enabled: boolean;
        ttl?: number | undefined;
    }, {
        enabled: boolean;
        ttl?: number | undefined;
    }>>;
    retry: z.ZodOptional<z.ZodObject<{
        maxRetries: z.ZodOptional<z.ZodNumber>;
        initialDelay: z.ZodOptional<z.ZodNumber>;
        maxDelay: z.ZodOptional<z.ZodNumber>;
        factor: z.ZodOptional<z.ZodNumber>;
    }, "strip", z.ZodTypeAny, {
        maxRetries?: number | undefined;
        initialDelay?: number | undefined;
        maxDelay?: number | undefined;
        factor?: number | undefined;
    }, {
        maxRetries?: number | undefined;
        initialDelay?: number | undefined;
        maxDelay?: number | undefined;
        factor?: number | undefined;
    }>>;
    plugins: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
}, "strip", z.ZodTypeAny, {
    monitoring?: {
        enabled: boolean;
        environment?: string | undefined;
        serviceName?: string | undefined;
    } | undefined;
    retry?: {
        maxRetries?: number | undefined;
        initialDelay?: number | undefined;
        maxDelay?: number | undefined;
        factor?: number | undefined;
    } | undefined;
    apiUrl?: string | undefined;
    apiKey?: string | undefined;
    defaultProvider?: string | undefined;
    caching?: {
        enabled: boolean;
        ttl?: number | undefined;
    } | undefined;
    plugins?: Record<string, any> | undefined;
}, {
    monitoring?: {
        enabled: boolean;
        environment?: string | undefined;
        serviceName?: string | undefined;
    } | undefined;
    retry?: {
        maxRetries?: number | undefined;
        initialDelay?: number | undefined;
        maxDelay?: number | undefined;
        factor?: number | undefined;
    } | undefined;
    apiUrl?: string | undefined;
    apiKey?: string | undefined;
    defaultProvider?: string | undefined;
    caching?: {
        enabled: boolean;
        ttl?: number | undefined;
    } | undefined;
    plugins?: Record<string, any> | undefined;
}>;
/**
 * BFUI Plugin Manager
 *
 * This class manages the integration between BFUI and the Native AI plugin system.
 * It provides a simplified interface for BFUI components to use plugins.
 */
export declare class BFUIPluginManager {
    private static _instance;
    private registry;
    private events;
    private config;
    private initialized;
    private logger;
    /**
     * Private constructor for singleton pattern
     */
    private constructor();
    /**
     * Get the singleton instance of the plugin manager
     */
    static getInstance(config?: BFUIPluginConfig): BFUIPluginManager;
    /**
     * Initialize the plugin manager and all registered plugins
     */
    initialize(): Promise<void>;
    /**
     * Shut down the plugin manager and all registered plugins
     */
    shutdown(): Promise<void>;
    /**
     * Register a plugin with the system
     */
    registerPlugin(plugin: Plugin): void;
    /**
     * Unregister a plugin from the system
     */
    unregisterPlugin(pluginId: string): void;
    /**
     * Get a plugin by ID
     */
    getPlugin(pluginId: string): Plugin | undefined;
    /**
     * Get all plugins of a specific type
     */
    getPluginsByType(type: PluginType): Plugin[];
    /**
     * Get all provider plugins
     */
    getProviderPlugins(): ProviderPlugin[];
    /**
     * Get a provider plugin by ID
     */
    getProviderPlugin(id: string): ProviderPlugin | undefined;
    /**
     * Get the default provider plugin
     */
    getDefaultProvider(): ProviderPlugin | undefined;
    /**
     * Check if the plugin manager is initialized
     */
    isInitialized(): boolean;
    /**
     * Get all registered plugins
     */
    getAllPlugins(): Plugin[];
    /**
     * Subscribe to plugin events
     */
    on(event: string, listener: (...args: any[]) => void): void;
    /**
     * Unsubscribe from plugin events
     */
    off(event: string, listener: (...args: any[]) => void): void;
    /**
     * Emit a plugin event
     */
    emit(event: string, ...args: any[]): void;
}
/**
 * Provider Adapter Interface
 * Provides a consistent interface for different AI providers
 */
export interface ProviderAdapter {
    id: string;
    name: string;
    version: string;
    capabilities: ProviderCapabilities;
    models: ProviderModel[];
    /**
     * Initialize the provider adapter
     */
    initialize(config: any): Promise<void>;
    /**
     * Shut down the provider adapter
     */
    shutdown(): Promise<void>;
    /**
     * Check if the provider is healthy
     */
    healthCheck(): Promise<boolean>;
    /**
     * Get available models
     */
    getModels(): Promise<ProviderModel[]>;
    /**
     * Generate completion using the provider
     */
    generateCompletion(request: any): Promise<any>;
    /**
     * Stream completion using the provider
     */
    streamCompletion(request: any): AsyncGenerator<any, void, unknown>;
}
/**
 * Base Provider Adapter implementation
 */
export declare abstract class BaseProviderAdapter implements ProviderAdapter {
    abstract id: string;
    abstract name: string;
    abstract version: string;
    abstract capabilities: ProviderCapabilities;
    abstract models: ProviderModel[];
    abstract initialize(config: any): Promise<void>;
    abstract shutdown(): Promise<void>;
    abstract healthCheck(): Promise<boolean>;
    abstract getModels(): Promise<ProviderModel[]>;
    abstract generateCompletion(request: any): Promise<any>;
    abstract streamCompletion(request: any): AsyncGenerator<any, void, unknown>;
}
export declare const pluginManager: BFUIPluginManager;
//# sourceMappingURL=plugin-system.d.ts.map