/**
 * SwarmVector PostgreSQL Bridge Plugin
 *
 * Production-ready plugin for SwarmVector PostgreSQL integration providing:
 * - Connection management with pooling
 * - Vector similarity search (HNSW, IVF)
 * - Batch operations
 * - Index management
 * - MCP tool integration
 * - Event emission and metrics
 *
 * @module @swarmdo/plugins/integrations/swarmvector
 * @version 1.0.0
 */
import { BasePlugin } from '../../core/base-plugin.js';
import type { MCPToolDefinition } from '../../types/index.js';
import type { SwarmVectorConfig, VectorSearchOptions, VectorSearchResult, VectorInsertOptions, VectorUpdateOptions, VectorIndexOptions, BatchVectorOptions, IndexStats, BatchResult, BulkSearchResult, SwarmVectorStats } from './types.js';
/**
 * Metrics collected by the SwarmVector Bridge.
 */
interface SwarmVectorMetrics {
    queriesTotal: number;
    queriesSucceeded: number;
    queriesFailed: number;
    slowQueries: number;
    avgQueryTimeMs: number;
    vectorsInserted: number;
    vectorsUpdated: number;
    vectorsDeleted: number;
    searchesPerformed: number;
    cacheHits: number;
    cacheMisses: number;
    connectionAcquires: number;
    connectionReleases: number;
    connectionErrors: number;
    lastQueryTime: number;
    uptime: number;
}
/**
 * SwarmVector PostgreSQL Bridge Plugin for Swarmdo v3.
 *
 * Provides comprehensive vector database integration with:
 * - Connection pooling and management
 * - Vector similarity search (HNSW, IVF)
 * - Batch operations for high throughput
 * - Index creation and management
 * - MCP tool integration
 * - Event-driven architecture
 * - Production-ready error handling and metrics
 *
 * @example
 * ```typescript
 * const bridge = new SwarmVectorBridge({
 *   host: 'localhost',
 *   port: 5432,
 *   database: 'vectors',
 *   user: 'postgres',
 *   password: 'password',
 *   poolSize: 10,
 * });
 *
 * await bridge.initialize(context);
 *
 * const results = await bridge.vectorSearch({
 *   query: [0.1, 0.2, 0.3, ...],
 *   k: 10,
 *   metric: 'cosine',
 *   tableName: 'embeddings',
 * });
 * ```
 */
export declare class SwarmVectorBridge extends BasePlugin {
    private readonly swarmVectorConfig;
    private connectionManager;
    private vectorOps;
    private metrics;
    private initTime;
    constructor(config: SwarmVectorConfig);
    /**
     * Initialize the plugin and establish database connection.
     */
    protected onInitialize(): Promise<void>;
    /**
     * Shutdown the plugin and close database connections.
     */
    protected onShutdown(): Promise<void>;
    /**
     * Perform health check.
     */
    protected onHealthCheck(): Promise<Record<string, {
        healthy: boolean;
        message?: string;
        latencyMs?: number;
    }>>;
    /**
     * Register MCP tools for vector operations.
     */
    registerMCPTools(): MCPToolDefinition[];
    /**
     * Perform vector similarity search.
     */
    vectorSearch(options: VectorSearchOptions): Promise<VectorSearchResult[]>;
    /**
     * Perform batch vector search.
     */
    vectorBatchSearch(options: BatchVectorOptions): Promise<BulkSearchResult>;
    /**
     * Insert vectors.
     */
    vectorInsert(options: VectorInsertOptions): Promise<BatchResult<string>>;
    /**
     * Update a vector.
     */
    vectorUpdate(options: VectorUpdateOptions): Promise<boolean>;
    /**
     * Delete a vector.
     */
    vectorDelete(tableName: string, id: string | number): Promise<boolean>;
    /**
     * Bulk delete vectors.
     */
    vectorBulkDelete(tableName: string, ids: Array<string | number>): Promise<BatchResult>;
    /**
     * Create a vector index.
     */
    createIndex(options: VectorIndexOptions): Promise<void>;
    /**
     * Drop an index.
     */
    dropIndex(indexName: string): Promise<void>;
    /**
     * Rebuild an index.
     */
    rebuildIndex(indexName: string): Promise<void>;
    /**
     * Get index statistics.
     */
    getIndexStats(indexName: string): Promise<IndexStats>;
    /**
     * List all indices.
     */
    listIndices(tableName?: string): Promise<IndexStats[]>;
    /**
     * Get SwarmVector statistics.
     */
    getStats(): Promise<SwarmVectorStats>;
    /**
     * Ensure the plugin is initialized.
     */
    private ensureInitialized;
    /**
     * Ensure pgvector extension is installed.
     */
    private ensureExtension;
    /**
     * Forward connection manager events to plugin event bus.
     */
    private forwardConnectionEvents;
    /**
     * Update metrics from events.
     */
    private updateMetricsFromEvent;
    /**
     * Update query metrics.
     */
    private updateQueryMetrics;
    /**
     * Create initial metrics object.
     */
    private createInitialMetrics;
    /**
     * Create error result for MCP tools.
     */
    private createErrorResult;
    /**
     * Get plugin uptime.
     */
    getUptime(): number;
    /**
     * Get current metrics.
     */
    getMetrics(): SwarmVectorMetrics;
}
/**
 * Create a new SwarmVector Bridge plugin instance.
 *
 * @example
 * ```typescript
 * const bridge = createSwarmVectorBridge({
 *   host: 'localhost',
 *   port: 5432,
 *   database: 'vectors',
 *   user: 'postgres',
 *   password: 'password',
 * });
 * ```
 */
export declare function createSwarmVectorBridge(config: SwarmVectorConfig): SwarmVectorBridge;
export default SwarmVectorBridge;
//# sourceMappingURL=swarmvector-bridge.d.ts.map