/** * Cross-file batching for embeddings and storage * Optimizes by batching operations across multiple files instead of per-file */ import type { EmbeddingProvider } from '../embeddings/base.js'; import type { Storage } from '../storage/index.js'; import type { CodeBlock } from '../types/models.js'; interface BatchResult { totalBlocks: number; files: Set; duration: number; } export interface CrossFileBatcherConfig { embedder: EmbeddingProvider; storage: Storage; collectionName: string; maxBlocksPerBatch: number; maxPointsPerUpsert: number; enableQualityFilter?: boolean; enableEnrichment?: boolean; } /** * Batches embedding and storage operations across multiple files * to reduce API overhead and improve throughput */ export declare class CrossFileBatcher { private pendingBlocks; private config; private stats; constructor(config: CrossFileBatcherConfig); /** * Add blocks from a file to the pending batch * Filters out low-quality chunks if enabled */ addBlocks(file: string, blocks: CodeBlock[]): void; /** * Check if batch should be flushed */ shouldFlush(): boolean; /** * Get number of pending blocks */ getPendingCount(): number; /** * Flush pending blocks - embed and store them */ flush(): Promise; /** * Clear all pending blocks without processing */ clear(): void; /** * Reset cumulative statistics * Call this when starting a new indexing session to reset lifetime counters */ resetStats(): void; /** * Get statistics about pending batch and filtering * Note: totalProcessed, filteredBlocks, and enrichedBlocks are cumulative lifetime statistics * Call resetStats() to reset these counters for a new indexing session */ getStats(): { pendingBlocks: number; pendingFiles: number; totalProcessed: number; filteredBlocks: number; enrichedBlocks: number; filterRate: number; }; } export {}; //# sourceMappingURL=cross-file-batcher.d.ts.map