/** * AstChunker — Regex-based AST-boundary chunk splitter * * Splits source files at symbol boundaries (class, function, method) rather than * fixed line counts. Each chunk carries metadata about the symbol it contains. * * Supported languages: TypeScript (.ts, .tsx), JavaScript (.js, .jsx), Python (.py), Go (.go) * Unsupported extensions fall back to fixed-size splitting. * * Design constraints: * - No native bindings (no tree-sitter, no node-gyp) * - Max chunk size: MAX_CHUNK_LINES (default 80) — always honoured * - Overlap: OVERLAP_LINES (default 3) — last N lines of prior chunk prepended to next * - Never drops lines — lineEnd of last chunk always equals file line count */ export interface CodeChunk { /** The source text of this chunk (may include overlap lines from prior chunk) */ content: string; /** 1-based line number where this chunk starts in the original file */ lineStart: number; /** 1-based line number where this chunk ends in the original file */ lineEnd: number; /** Name of the primary symbol this chunk belongs to, if detected */ symbolName?: string; /** Type of the primary symbol */ symbolType?: 'class' | 'function' | 'method' | 'unknown'; } export interface ChunkOptions { /** Maximum number of lines per chunk (default: 80) */ maxChunkLines?: number; /** Number of overlap lines carried from prior chunk (default: 3) */ overlapLines?: number; } export declare class AstChunker { chunk(source: string, extension: string, opts?: ChunkOptions): CodeChunk[]; } //# sourceMappingURL=ast-chunker.d.ts.map