/** * Dependency-free HTML → readable Markdown-ish text (RCL-01). * * WHY NO DEPENDENCY — the capture path has to work in an `npx monomind` * install with nothing extra resolved, and the extension already runs * Readability against the live DOM. What lands here is the fallback for an * archive nobody cleaned: a small, predictable extractor beats a large one we * cannot install. * * WHY BOILERPLATE STRIPPING IS THE POINT — a site's nav, header, footer and * cookie banner are byte-identical on every page. Leave them in and every * document from that site chunks into near-identical text, so their embeddings * cluster on the chrome rather than the article and recall collapses. Dropping * a little real content is a far cheaper error than keeping the chrome. * * @module v1/cli/knowledge/html-extract */ import { decodeEntities } from './html-tags.js'; export { decodeEntities }; export interface HtmlExtractOptions { /** Drop nav/header/footer/aside/cookie-banner containers. Default true. */ stripBoilerplate?: boolean; } export interface ExtractedHtml { /** `