/** * Ingest provider documentation into the SQLite FTS5 index. * * Reads markdown files from docs/{provider}/*.md and chunks them * by heading (## or ###), storing each chunk with provenance metadata. * * Each markdown file can include a YAML frontmatter block with provenance: * --- * source_url: https://example.com/docs * source_type: readthedocs * upstream_version: 1.8.8 * crawled_at: 2026-03-26T00:00:00Z * --- * * Files without frontmatter default to source_type: "curated". * * Usage: * npm run ingest # ingest all providers * npm run ingest -- --provider opta # ingest one provider */ import { SCHEMA_SQL } from "./data-format.js"; interface Frontmatter { source_url: string | null; source_type: string; upstream_version: string | null; crawled_at: string | null; } interface DocChunk { provider: string; category: string; title: string; content: string; source_url: string | null; source_type: string; upstream_version: string | null; crawled_at: string | null; } /** Parse optional YAML frontmatter from a markdown file. */ export declare function parseFrontmatter(raw: string): { frontmatter: Frontmatter; body: string; }; /** Split a markdown file into chunks by ## or ### headings. */ export declare function chunkMarkdown(text: string, provider: string, category: string): DocChunk[]; export { SCHEMA_SQL };