/** * Semantic Source Indexer * * Responsible for: * 1. Discovering files in a project (respecting .gitignore) * 2. Chunking code into semantic units (functions, classes) * 3. Hashing and staleness detection * 4. Vectorizing chunks via Jina */ export interface SourceChunk { filePath: string; content: string; type: 'function' | 'class' | 'block'; startLine: number; endLine: number; hash: string; } export interface SourceFileMetadata { hash: string; chunks: SourceChunk[]; lastIndexed: string; } export interface SourceManifest { version: number; project: string; gitHead?: string; files: Record; } /** * Walk project directory using git ls-files for efficient filtering */ export declare function getProjectFiles(dir: string, extensions?: string[]): string[]; /** * Calculate file hash used for staleness detection */ export declare function calculateFileHash(content: string): string; /** * Split code into semantic chunks (Initial version: Regex-based) */ export declare function chunkCode(filePath: string, content: string): SourceChunk[]; /** * Get current Git HEAD hash */ export declare function getGitHead(dir: string): string | undefined; /** * Orchestrate the source indexing process */ export declare function indexProjectSource(projectName: string, dir: string, apiKey: string): Promise<{ filesIndexed: number; chunksCreated: number; tokensUsed: number; }>; //# sourceMappingURL=source-indexer.d.ts.map