/** * Markdown chunker — splits Markdown documents at heading boundaries. * * Strategy: * - Split at #/##/### headings (top-level becomes the section anchor). * - Sections larger than MAX_CHARS are further split into overlapping * chunks so big README sections stay searchable without dilution. * - Code fences (```...```) are kept intact — never split mid-fence. * - The document title (first H1, if any) is prepended to each chunk * as context — readers retrieve "Auth: token rotation" not just * "token rotation". */ export interface MarkdownSection { heading: string; level: number; body: string; startLine: number; } export interface DocChunkInput { docTitle: string | null; section: MarkdownSection; /** Index within a section that's been split — 0 if not split. */ partIndex?: number; partCount?: number; } export interface ChunkOutput { text: string; contentHash: string; } /** * Split a Markdown document into sections at heading boundaries. * Heading lines inside code fences are ignored. */ export declare function splitMarkdown(source: string): MarkdownSection[]; /** Extract the document's first H1 title, or null if none. */ export declare function findDocTitle(sections: MarkdownSection[]): string | null; /** * Split a long section into overlapping windows, never breaking inside code fences. */ export declare function splitLargeSection(body: string, maxChars?: number, overlap?: number): string[]; export declare function buildDocChunk(input: DocChunkInput): ChunkOutput; export interface DocChunk { /** Heading + part suffix, e.g. "## Architecture" or "## Architecture (part 2/3)" */ anchor: string; /** First non-empty line of the chunk (for display). */ snippetSource: string; text: string; contentHash: string; line: number; } /** * Chunk an entire Markdown source into ready-to-embed pieces. * The preamble (text before any heading) gets a synthetic anchor "preamble". */ export declare function chunkMarkdown(source: string): DocChunk[]; //# sourceMappingURL=chunker-docs.d.ts.map