/** * Source discovery for football data providers. * * Given a provider's known URLs, discovers the best documentation source * to crawl. Checks for llms.txt, ReadTheDocs structure, GitHub docs, etc. * * Usage: * import { discoverBestSource } from "./discover.js"; * const result = await discoverBestSource(provider); */ export interface ProviderSource { url: string; type: "llms_txt" | "readthedocs" | "github_docs" | "api_docs" | "openapi" | "curated"; note?: string; } export interface DiscoveryResult { provider: string; /** The best source found, or null if only curated content is available */ source: ProviderSource | null; /** All sources that were checked and what was found */ checked: Array<{ url: string; found: string | null; error?: string; }>; } export interface ProbeResult { url: string; sourceType: ProviderSource["type"]; llmsTxt: { url: string; content: string; } | null; isReadTheDocs: boolean; isReachable: boolean; } /** * A site whose router answers every unknown path with its own shell returns the * documentation page's HTML for /llms-full.txt, with a 200 and no redirect. * TheSportsDB and FMDB Pro both do this. Crawling that as llms.txt writes a doc * that is markup rather than documentation, so reject anything that opens like * an HTML document. */ export declare function looksLikeHtml(content: string): boolean; /** * Choose the best source to crawl from probe results. * * Scoring: llms-full.txt (>1000 chars) = 100, llms.txt (>1000 chars) = 90, * ReadTheDocs/Sphinx = 70, short llms.txt = 50, reachable = 40, unreachable = 0. * * @param probeResults - What was actually found at each URL * @returns The best source to crawl, or null if only curated content is available */ export declare function chooseBestSource(probeResults: ProbeResult[]): ProviderSource | null; /** * Discover the best documentation source for a provider. * * Probes all configured URLs for llms.txt, ReadTheDocs markers, and * basic reachability, then uses chooseBestSource() to pick the winner. */ export declare function discoverBestSource(provider: string, sources: ProviderSource[]): Promise;