/** * Semantic diff between two versions of a captured page (RCL-08). * * A character diff of a re-captured page is noise: the byline date moved, an * ad slot re-rendered, the markdown re-wrapped. What a watcher actually wants * to be told is WHICH SECTIONS changed and roughly how much — "Pricing gained * a paragraph, Changelog got three new entries, everything else is the same". * * So the unit here is the markdown section (heading + body), keyed by its * full heading path, and the measure is words and sentences rather than * characters. Sentences are also what gives a change its sample line: the * first sentence that is in the new version and was not in the old one is the * most useful single thing to print. * * No dependency, no LLM: heading paths and sentence sets are enough to say * what moved. * * @module v1/cli/knowledge/section-diff */ export interface Section { /** Full heading path, e.g. `Pricing > Enterprise`. `(intro)` for text * before the first heading. */ key: string; heading: string; level: number; body: string; } export interface SectionChange { key: string; addedWords: number; removedWords: number; /** First sentence present in the new version and absent from the old. */ sample?: string; } export interface SectionDiff { added: string[]; removed: string[]; changed: SectionChange[]; unchanged: number; /** One line, ready to print or to put in a notification. */ summary: string; } /** Split markdown into sections keyed by heading path. Duplicate paths get a * `#2` suffix so two "Notes" sections never collapse into one. */ export declare function splitSections(text: string): Section[]; /** What changed between two versions of the same page. */ export declare function diffSections(oldText: string, newText: string): SectionDiff; //# sourceMappingURL=section-diff.d.ts.map