/** * Helpers for making the per-page Markdown (createMarkdownRenderer) discoverable * and negotiable, so AI agents reliably find and read it. * * Two mechanisms: * - `markdownHref` — the `` href a * page advertises, so an agent fetching the HTML sees there's a Markdown * version and can switch to it. * - `prefersMarkdown` — reads the Accept header, so the same URL can serve * Markdown when asked (content negotiation via a proxy rewrite). */ /** Default URL prefix the Markdown route is mounted at (see createMarkdownRenderer). */ export declare const MARKDOWN_PREFIX = "/md"; /** * The Markdown URL for a given page path. Keeps the `/md` prefix in ONE place so * the discovery link and the route agree. * * markdownHref('/pl/o-nas') // '/md/pl/o-nas' * markdownHref('/pl/o-nas', '/ai') // '/ai/pl/o-nas' * * Advertise it from Next metadata so every page's points to its Markdown: * * // generateMetadata * return { ...meta, alternates: { ...meta.alternates, types: { 'text/markdown': markdownHref(path) } } } */ export declare function markdownHref(pathname: string, prefix?: string): string; /** * True when the client asked for Markdown via the Accept header (q-values * respected: a higher-weighted text/html wins). Accepts a header string, a * Headers object, or a Request. Use it in proxy.ts to serve the same URL as * Markdown when an agent negotiates for it: * * // proxy.ts * if (prefersMarkdown(request)) { * return NextResponse.rewrite(new URL(markdownHref(request.nextUrl.pathname), request.url)) * } */ export declare function prefersMarkdown(input: Headers | null | Request | string | undefined): boolean;