@knath2000/codebase-indexing-mcp
Version:
MCP server for codebase indexing with Voyage AI embeddings and Qdrant vector storage
91 lines (90 loc) • 2.3 kB
TypeScript
import { EventEmitter } from 'events';
import { WorkspaceManager } from './workspace-manager.js';
import { Config, CodeChunk, IndexingProgress, IndexStats } from '../types.js';
export declare class IndexingService extends EventEmitter {
private voyageClient;
private qdrantClient;
private codeParser;
private config;
private progress;
private stats;
private workspaceManager;
private currentWorkspace;
constructor(config: Config, workspaceManager?: WorkspaceManager);
/**
* Initialize the indexing service with enhanced workspace detection
*/
initialize(): Promise<void>;
/**
* Update Qdrant client for workspace-specific collection
*/
private updateQdrantClientForWorkspace;
/**
* Index a directory recursively
*/
indexDirectory(directoryPath: string): Promise<IndexStats>;
/**
* Index a single file
*/
indexFile(filePath: string): Promise<CodeChunk[]>;
/**
* Re-index a file (force update)
*/
reindexFile(filePath: string): Promise<CodeChunk[]>;
/**
* Remove a file from the index
*/
removeFile(filePath: string): Promise<void>;
/**
* Clear entire index
*/
clearIndex(): Promise<void>;
/**
* Get indexing progress
*/
getProgress(): IndexingProgress;
/**
* Get indexing statistics
*/
getStats(): IndexStats;
/**
* Get collection info from Qdrant
*/
getCollectionInfo(): Promise<any>;
/**
* Count total indexed chunks
*/
countIndexedChunks(): Promise<number>;
/**
* Find files to index
*/
private findFiles;
/**
* Process a batch of files
*/
private processBatch;
/**
* Generate embeddings and store in Qdrant
*/
private embedAndStore;
/**
* Check if file should be skipped
*/
private shouldSkipFile;
/**
* Check if file is binary by examining its content
*/
private isBinaryFile;
/**
* Estimate token count for content (rough approximation)
*/
private estimateTokenCount;
/**
* Determines if a file contains implementation code or documentation
*/
private getFileKind;
/**
* Update statistics
*/
private updateStats;
}