/** * product-kb/loader — walks a directory tree of mkdocs markdown files * and assembles a Page[] corpus. * * Derived fields per file: * * topic — path relative to docs root, sans .md * category — first segment of topic (faq / apps / engine / api / …) * canonical_url — https://doc.log10x.com// * summary — first non-empty prose paragraph from the body * last_reviewed — frontmatter `last_reviewed:` if present, else file mtime * chunks — chunker output * * Frontmatter overrides: * * mcp_qa: false → exclude this page from the corpus * mcp_qa: true → force-include even when outside the default rule * * The default include rule is "anything under the docs root". The * `mcp_qa: true` override exists so a page that sits outside the docs * root (e.g. a top-level README copied into a special folder) can still * be force-included by the loader. */ import type { Page } from './types.js'; /** * Options for loadCorpus(). * * docsRoot — absolute path to the mksite/docs root. Walked * recursively; only .md files are considered. * extraIncludes — optional absolute paths to .md files OUTSIDE the * docsRoot that should still be included (frontmatter * `mcp_qa: true` is the in-file equivalent). */ export interface LoadCorpusOptions { docsRoot: string; extraIncludes?: string[]; } /** * Load and parse every page in the corpus. * * Pages with `mcp_qa: false` in their frontmatter are silently dropped. * Pages with `mcp_qa: true` are force-included even when their file * path is outside docsRoot (and so will only be reached via * `extraIncludes`). */ export declare function loadCorpus(opts: LoadCorpusOptions): Page[]; /** * Load a single page from disk. Returns null when the page is excluded * by `mcp_qa: false` or cannot be read. * * Exported so callers (and tests) can inspect a single file without * walking a tree. */ export declare function loadPage(absPath: string, docsRoot: string): Page | null;