import type { McpServer, RegisteredTool } from "@modelcontextprotocol/sdk/server/mcp.js"; import type { ToolContext } from "../tool-context.js"; export interface DocSection { file: string; heading: string; line: number; text: string; } export interface DocHit extends DocSection { score: number; excerpt: string; } /** Markdown → sections, each headed by the nearest preceding heading. */ export declare function splitSections(markdown: string, file: string): DocSection[]; /** * Score a section against the query terms. * * Whole-word matches beat substrings, a hit in the heading counts for more than * one in the body, and a section that contains every term outranks one that * repeats a single term — asking about "kit load async" should not be answered * by the page that says "kit" the most times. */ export declare function scoreSection(section: DocSection, terms: string[]): number; /** A window of the section around the first hit, not the whole section. */ export declare function excerptAround(text: string, terms: string[], max?: number): string; /** Where the ecosystem's prose lives, in the order it is searched. */ export declare function docRoots(): { label: string; dir: string; }[]; export declare function searchDocs(query: string, limit: number, roots?: { label: string; dir: string; }[]): DocHit[]; export declare function registerDocsSearchTool(server: McpServer, _ctx: ToolContext): RegisteredTool;