/** * AST-aware Chunker for Codebase RAG (v2.0.0) * * Intelligently chunks source code by semantic boundaries (classes, functions, interfaces) * rather than arbitrary line counts, maximizing the relevance of context given to the LLM. */ export type ChunkType = 'class' | 'function' | 'interface' | 'variable' | 'unknown'; export interface CodeChunk { /** Absolute or relative path to the file */ filePath: string; /** Semantic type of the chunk */ type: ChunkType; /** Name of the extracted symbol (e.g., class name or function name) */ name: string; /** Raw source code content of the chunk */ content: string; /** 1-indexed starting line number */ startLine: number; /** 1-indexed ending line number */ endLine: number; } export declare class ASTChunker { /** * Chunk a file into semantic pieces. * Uses TypeScript AST for .ts/.js files if installed, otherwise uses basic line-based chunking. */ chunkFile(filePath: string, content: string): Promise; private chunkTypeScript; private createChunkFromNode; /** * Fallback naive chunking mechanism (splits every ~100 lines) * Useful for unparseable files or text documents. */ private naiveChunk; } //# sourceMappingURL=astChunker.d.ts.map