import { Plugin, PluginStatus, PluginResponse, ChatMessage, GenerationOptions, TTSConfig, ImageGenConfig, ImageGenResponse, PluginType } from '../types/index.js';
declare class PluginService {
    private pluginsDir;
    private activePluginIds;
    constructor();
    private ensurePluginsDirectory;
    private loadActivePlugins;
    private saveActivePlugins;
    /**
     * Get API key for a plugin from database (per-user) or environment variable (fallback)
     * @param plugin The plugin to get the API key for
     * @param userId Optional user ID for per-user credentials
     * @returns The API key or null if not found
     */
    getApiKey(plugin: Plugin, userId?: string): string | null;
    /**
     * Get resolved variable values for a plugin (decrypted, typed).
     */
    getPluginVariables(plugin: Plugin, userId?: string): Record<string, string | number | boolean>;
    /**
     * Validate an endpoint URL for safety (SSRF protection).
     * Returns the URL string if valid, or null if invalid.
     */
    private validateEndpointUrl;
    /**
     * Attempt to auto-discover available models from a plugin's base endpoint.
     * Hits {baseUrl}/v1/models (OpenAI-compatible) and updates the plugin's model_map.
     * Falls back silently to the existing model_map if the endpoint is unavailable.
     */
    discoverModels(pluginId: string): Promise<string[]>;
    getAllPlugins(): Plugin[];
    getPlugin(id: string): Plugin | null;
    installPlugin(pluginData: Plugin): Plugin;
    deletePlugin(id: string): boolean;
    activatePlugin(id: string): boolean;
    deactivatePlugin(id?: string): boolean;
    getActivePluginForModel(model: string): Plugin | null;
    getActivePlugins(): Plugin[];
    getActivePlugin(): Plugin | null;
    getPluginStatus(): PluginStatus[];
    executePluginRequest(model: string, messages: ChatMessage[], options?: GenerationOptions): Promise<PluginResponse>;
    /**
     * Execute a streaming chat request through the active plugin.
     * Returns an async generator that yields SSE delta content strings.
     * Also collects tool_calls from the stream.
     */
    executePluginStreamRequest(model: string, messages: ChatMessage[], options?: GenerationOptions): AsyncGenerator<{
        type: 'content' | 'tool_call' | 'done';
        content?: string;
        toolCall?: {
            id: string;
            name: string;
            arguments: string;
        };
    }, void, unknown>;
    private convertAnthropicResponse;
    private convertGeminiResponse;
    private validatePlugin;
    exportPlugin(id: string): Plugin | null;
    importPlugin(pluginData: unknown): Plugin;
    getPluginForTTS(model: string): Plugin | null;
    getAvailableTTSModels(): {
        model: string;
        plugin: string;
        config?: TTSConfig;
    }[];
    executeTTSRequest(model: string, input: string, options?: {
        voice?: string;
        response_format?: 'mp3' | 'opus' | 'aac' | 'flac' | 'wav' | 'pcm';
        speed?: number;
    }): Promise<Buffer>;
    private splitTextForTTS;
    getTTSConfig(pluginId: string): TTSConfig | null;
    getPluginForImageGen(model: string): Plugin | null;
    getAvailableImageGenModels(): {
        model: string;
        plugin: string;
        config?: ImageGenConfig;
    }[];
    executeImageGenRequest(model: string, prompt: string, options?: {
        size?: string;
        quality?: string;
        style?: string;
        n?: number;
        response_format?: 'url' | 'b64_json';
    }): Promise<ImageGenResponse>;
    private executeComfyUIRequest;
    getImageGenConfig(pluginId: string): ImageGenConfig | null;
    getPluginsByCapability(capabilityType: PluginType): Plugin[];
}
declare const _default: PluginService;
export default _default;
//# sourceMappingURL=pluginService.d.ts.map