@farming-labs/docs 0.2.55 → 0.2.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-BOOcHVDL.mjs → agent-3IpxY9F6.mjs} +3 -2
- package/dist/{agent-DXkXi-pS.mjs → agent-CxDzPqtl.mjs} +1121 -53
- package/dist/{agent-export-BYznnYed.mjs → agent-export-BtlITzt3.mjs} +10 -5
- package/dist/{agent-surface-drift-LS8zQgbq.mjs → agent-surface-drift-rGFS38Ak.mjs} +61 -63
- package/dist/{agents-BHzeeY45.mjs → agents-BguzxLhO.mjs} +3 -3
- package/dist/cli/index.mjs +14 -14
- package/dist/{doctor-CNIPJdxN.mjs → doctor-Cra5qEEi.mjs} +11 -11
- package/dist/index.d.mts +7 -3
- package/dist/index.mjs +5 -5
- package/dist/{mcp-F9zkBHrU.mjs → mcp-BwYAu9DJ.mjs} +3 -3
- package/dist/mcp.mjs +16 -59
- package/dist/{reading-time-BrTd3DIh.mjs → reading-time-W_Id2ayC.mjs} +2 -2
- package/dist/{review-Dlb8dRRx.mjs → review-x3zV5jZp.mjs} +14 -6
- package/dist/{robots-4BUJxlvV.mjs → robots-BSPfXA3J.mjs} +2 -2
- package/dist/{robots-DAptQnkx.mjs → robots-DRpoiYAV.mjs} +1 -1
- package/dist/{search-BnQKgDbk.d.mts → search-9uEaC23e.d.mts} +28 -3
- package/dist/{search-CEg1omHv.mjs → search-OHp36znm.mjs} +49 -33
- package/dist/{search-B8cF77_i.mjs → search-vG59kGqo.mjs} +3 -3
- package/dist/server.d.mts +1 -1
- package/dist/server.mjs +3 -3
- package/dist/{sitemap-D9ivTLm8.mjs → sitemap-DqxsKlvI.mjs} +3 -3
- package/dist/{sitemap-server-wsNLyVkb.mjs → sitemap-server-zFYctvCa.mjs} +1 -1
- package/package.json +2 -1
package/dist/mcp.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as emitDocsAnalyticsEvent, i as emitDocsAgentTraceEvent, n as createDocsAgentTraceContext, r as createDocsAgentTraceId } from "./analytics-Bx44lg6d.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { C as resolvePageSidebarFolderIndexBehavior, E as emitDocsTelemetryAgentSurfaceEvent, O as emitDocsTelemetryMcpToolEvent, k as emitDocsTelemetryProjectEvent, m as parseDocsMarkdownSections, p as findDocsMarkdownSection, u as performDocsSearch, x as stripGeneratedAgentProvenance } from "./search-
|
|
2
|
+
import { Et as resolveDocsAudienceMdxContent, Ht as renderDocsRelatedMarkdownLines, Vt as normalizeDocsRelated, Xt as normalizePageAgentFrontmatter, Yt as hasStructuredPageAgentContract, en as upsertPageAgentContractMarkdown } from "./agent-CxDzPqtl.mjs";
|
|
3
|
+
import { C as resolvePageSidebarFolderIndexBehavior, E as emitDocsTelemetryAgentSurfaceEvent, O as emitDocsTelemetryMcpToolEvent, k as emitDocsTelemetryProjectEvent, m as parseDocsMarkdownSections, p as findDocsMarkdownSection, u as performDocsSearch, x as stripGeneratedAgentProvenance } from "./search-OHp36znm.mjs";
|
|
4
4
|
import { a as normalizeAgentScopeValues, i as normalizeAgentLocale, n as agentVersionConstraintsOverlap, r as normalizeAgentFramework, t as agentVersionConstraintMatches } from "./agent-scope-B8lptqCd.mjs";
|
|
5
5
|
import matter from "gray-matter";
|
|
6
6
|
import fs from "node:fs";
|
|
@@ -2134,6 +2134,7 @@ async function createDocsMcpServer(options) {
|
|
|
2134
2134
|
pages: toSearchSourcePages(dedupePages(await getSourcePages(locale))),
|
|
2135
2135
|
query,
|
|
2136
2136
|
search: toolSearchConfig ?? true,
|
|
2137
|
+
audience: "agent",
|
|
2137
2138
|
locale,
|
|
2138
2139
|
siteTitle: options.source.siteTitle,
|
|
2139
2140
|
limit: resolvedLimit
|
|
@@ -2974,53 +2975,6 @@ function normalizePathSegment(value) {
|
|
|
2974
2975
|
function titleize(value) {
|
|
2975
2976
|
return value.replace(/-/g, " ").replace(/\b\w/g, (char) => char.toUpperCase());
|
|
2976
2977
|
}
|
|
2977
|
-
function resolveAgentMdxContent(content, audience) {
|
|
2978
|
-
const lines = content.split("\n");
|
|
2979
|
-
const output = [];
|
|
2980
|
-
let fenceMarker = null;
|
|
2981
|
-
let agentDepth = 0;
|
|
2982
|
-
for (const line of lines) {
|
|
2983
|
-
const trimmed = line.trim();
|
|
2984
|
-
const fenceMatch = trimmed.match(/^(`{3,}|~{3,})/);
|
|
2985
|
-
if (fenceMatch) {
|
|
2986
|
-
if (!fenceMarker) fenceMarker = fenceMatch[1];
|
|
2987
|
-
else if (trimmed.startsWith(fenceMarker)) fenceMarker = null;
|
|
2988
|
-
if (audience === "agent" || agentDepth === 0) output.push(line);
|
|
2989
|
-
continue;
|
|
2990
|
-
}
|
|
2991
|
-
if (!fenceMarker) {
|
|
2992
|
-
if (/^<Agent(?:\s[^>]*)?\/>$/.test(trimmed)) continue;
|
|
2993
|
-
const singleLineMatch = line.match(/^(\s*)<Agent(?:\s[^>]*)?>([\s\S]*?)<\/Agent>\s*$/);
|
|
2994
|
-
if (singleLineMatch) {
|
|
2995
|
-
if (audience === "agent" && singleLineMatch[2]) output.push(`${singleLineMatch[1]}${singleLineMatch[2]}`);
|
|
2996
|
-
continue;
|
|
2997
|
-
}
|
|
2998
|
-
if (line.match(/^(\s*)<Agent(?:\s[^>]*)?>\s*$/)) {
|
|
2999
|
-
agentDepth += 1;
|
|
3000
|
-
continue;
|
|
3001
|
-
}
|
|
3002
|
-
const openWithContentMatch = line.match(/^(\s*)<Agent(?:\s[^>]*)?>(.*)$/);
|
|
3003
|
-
if (openWithContentMatch) {
|
|
3004
|
-
agentDepth += 1;
|
|
3005
|
-
if (audience === "agent" && openWithContentMatch[2]) output.push(`${openWithContentMatch[1]}${openWithContentMatch[2]}`);
|
|
3006
|
-
continue;
|
|
3007
|
-
}
|
|
3008
|
-
const closeWithContentMatch = line.match(/^(.*)<\/Agent>\s*$/);
|
|
3009
|
-
if (closeWithContentMatch && agentDepth > 0) {
|
|
3010
|
-
if (audience === "agent" && closeWithContentMatch[1]) output.push(closeWithContentMatch[1]);
|
|
3011
|
-
agentDepth = Math.max(0, agentDepth - 1);
|
|
3012
|
-
continue;
|
|
3013
|
-
}
|
|
3014
|
-
if (/^<\/Agent>\s*$/.test(trimmed) && agentDepth > 0) {
|
|
3015
|
-
agentDepth = Math.max(0, agentDepth - 1);
|
|
3016
|
-
continue;
|
|
3017
|
-
}
|
|
3018
|
-
}
|
|
3019
|
-
if (agentDepth > 0 && audience === "human") continue;
|
|
3020
|
-
output.push(line);
|
|
3021
|
-
}
|
|
3022
|
-
return output.join("\n").replace(/\n{3,}/g, "\n\n").trim();
|
|
3023
|
-
}
|
|
3024
2978
|
function stripMarkdownForMcp(content) {
|
|
3025
2979
|
return content.replace(/^(import|export)\s.*$/gm, "").replace(/<[^>]+\/>/g, "").replace(/<\/?[A-Z][^>]*>/g, "").replace(/<\/?[a-z][^>]*>/g, "").replace(/!\[([^\]]*)\]\([^)]+\)/g, "$1").replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/^#{1,6}\s+/gm, "").replace(/(\*{1,3}|_{1,3})(.*?)\1/g, "$2").replace(/```[\s\S]*?```/g, "").replace(/`([^`]+)`/g, "$1").replace(/^>\s+/gm, "").replace(/^[-*_]{3,}\s*$/gm, "").replace(/\n{3,}/g, "\n\n").trim();
|
|
3026
2980
|
}
|
|
@@ -3075,8 +3029,8 @@ function scanFilesystemDocsPages(contentDirAbs, entry, rootDir) {
|
|
|
3075
3029
|
const baseName = name.replace(/\.(md|mdx|svx)$/, "");
|
|
3076
3030
|
const isIndex = baseName === "index" || baseName === "page" || baseName === "+page";
|
|
3077
3031
|
if (isIndex && resolvePageSidebarFolderIndexBehavior(data.sidebar) === "hidden" && hasVisibleDescendantFilesystemDocsPage(dir)) continue;
|
|
3078
|
-
const humanRawContent =
|
|
3079
|
-
const pageAgentRawContent =
|
|
3032
|
+
const humanRawContent = resolveDocsAudienceMdxContent(content, "human");
|
|
3033
|
+
const pageAgentRawContent = resolveDocsAudienceMdxContent(content, "agent");
|
|
3080
3034
|
const pageAgentContent = pageAgentRawContent !== humanRawContent ? stripMarkdownForMcp(pageAgentRawContent) : void 0;
|
|
3081
3035
|
const slug = isIndex ? slugParts.join("/") : [...slugParts, baseName].join("/");
|
|
3082
3036
|
const url = slug ? `/${entry}/${slug}` : `/${entry}`;
|
|
@@ -3112,9 +3066,10 @@ function readFilesystemAgentDoc(dir) {
|
|
|
3112
3066
|
const agentPath = path.join(dir, "agent.md");
|
|
3113
3067
|
if (!fs.existsSync(agentPath)) return void 0;
|
|
3114
3068
|
const { content } = matter(stripGeneratedAgentProvenance(fs.readFileSync(agentPath, "utf-8")));
|
|
3069
|
+
const agentContent = resolveDocsAudienceMdxContent(content, "agent");
|
|
3115
3070
|
return {
|
|
3116
|
-
agentContent: stripMarkdownForMcp(
|
|
3117
|
-
agentRawContent:
|
|
3071
|
+
agentContent: stripMarkdownForMcp(agentContent),
|
|
3072
|
+
agentRawContent: agentContent
|
|
3118
3073
|
};
|
|
3119
3074
|
}
|
|
3120
3075
|
function resolveRelatedForMcpPages(pages) {
|
|
@@ -3233,8 +3188,8 @@ function toSearchSourcePages(pages) {
|
|
|
3233
3188
|
return pages.map((page) => ({
|
|
3234
3189
|
title: page.title,
|
|
3235
3190
|
url: page.url,
|
|
3236
|
-
content: page.
|
|
3237
|
-
rawContent: page.
|
|
3191
|
+
content: page.content,
|
|
3192
|
+
rawContent: page.rawContent,
|
|
3238
3193
|
sourcePath: page.sourcePath,
|
|
3239
3194
|
lastModified: page.lastModified,
|
|
3240
3195
|
locale: page.locale,
|
|
@@ -3573,7 +3528,7 @@ function countDocsSections(sections) {
|
|
|
3573
3528
|
return sections.reduce((total, section) => total + 1 + countDocsSections(section.sections), 0);
|
|
3574
3529
|
}
|
|
3575
3530
|
function extractDocsMcpCodeExamples(page) {
|
|
3576
|
-
const source = page.agentRawContent ?? page.agentFallbackRawContent ?? page.rawContent;
|
|
3531
|
+
const source = page.agentRawContent ?? page.agentFallbackRawContent ?? page.agentContent ?? page.agentFallbackContent ?? page.rawContent ?? page.content;
|
|
3577
3532
|
if (!source) return [];
|
|
3578
3533
|
const examples = [];
|
|
3579
3534
|
const lines = source.split("\n");
|
|
@@ -3796,7 +3751,7 @@ function toStructuredDocsMcpPage(page) {
|
|
|
3796
3751
|
};
|
|
3797
3752
|
}
|
|
3798
3753
|
function getDocsMcpSourceMarkdown(page) {
|
|
3799
|
-
return page.agentRawContent ?? page.agentFallbackRawContent ?? page.
|
|
3754
|
+
return page.agentRawContent ?? page.agentFallbackRawContent ?? page.agentContent ?? page.agentFallbackContent ?? page.rawContent ?? page.content;
|
|
3800
3755
|
}
|
|
3801
3756
|
function resolveDocsMcpScopeField(pageValue, contractValue, filter, overlaps, matchesFilter) {
|
|
3802
3757
|
const pageValues = normalizeAgentScopeValues(pageValue);
|
|
@@ -3860,6 +3815,7 @@ async function buildDocsMcpContext(options) {
|
|
|
3860
3815
|
maxResults: 50,
|
|
3861
3816
|
chunking: { strategy: "section" }
|
|
3862
3817
|
},
|
|
3818
|
+
audience: "agent",
|
|
3863
3819
|
locale: options.locale,
|
|
3864
3820
|
siteTitle: options.siteTitle,
|
|
3865
3821
|
limit: 50
|
|
@@ -3999,12 +3955,13 @@ function normalizeUrlPath(value) {
|
|
|
3999
3955
|
return normalized.replace(/\/+$/, "");
|
|
4000
3956
|
}
|
|
4001
3957
|
function renderPageDocument(page) {
|
|
4002
|
-
|
|
3958
|
+
const explicitAgentContent = page.agentRawContent ?? page.agentContent;
|
|
3959
|
+
if (explicitAgentContent !== void 0) return upsertPageAgentContractMarkdown(explicitAgentContent, page.agent);
|
|
4003
3960
|
const relatedLines = renderDocsRelatedMarkdownLines(page.related);
|
|
4004
3961
|
const lines = [`# ${page.title}`, `URL: ${page.url}`];
|
|
4005
3962
|
if (page.description) lines.push(`Description: ${page.description}`);
|
|
4006
3963
|
lines.push(...relatedLines);
|
|
4007
|
-
lines.push("", upsertPageAgentContractMarkdown(page.agentFallbackRawContent ?? page.rawContent ?? page.content, page.agent));
|
|
3964
|
+
lines.push("", upsertPageAgentContractMarkdown(page.agentFallbackRawContent ?? page.agentFallbackContent ?? page.rawContent ?? page.content, page.agent));
|
|
4008
3965
|
return lines.join("\n");
|
|
4009
3966
|
}
|
|
4010
3967
|
function renderNavigationTree(tree) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as DEFAULT_ROBOTS_TXT_ROUTE } from "./robots-
|
|
1
|
+
import { S as DEFAULT_MCP_WELL_KNOWN_ROUTE, Xt as normalizePageAgentFrontmatter, Yt as hasStructuredPageAgentContract, c as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, f as DEFAULT_DOCS_CONFIG_ROUTE, h as DEFAULT_LLMS_FULL_TXT_ROUTE, i as DEFAULT_AGENT_FEEDBACK_ROUTE, jt as DEFAULT_SITEMAP_XML_ROUTE, kt as DEFAULT_SITEMAP_MD_ROUTE, m as DEFAULT_DOCS_DIAGNOSTICS_ROUTE, t as DEFAULT_AGENTS_MD_ROUTE, v as DEFAULT_LLMS_TXT_ROUTE, w as DEFAULT_SKILL_MD_ROUTE } from "./agent-CxDzPqtl.mjs";
|
|
2
|
+
import { n as DEFAULT_ROBOTS_TXT_ROUTE } from "./robots-DRpoiYAV.mjs";
|
|
3
3
|
import matter from "gray-matter";
|
|
4
4
|
|
|
5
5
|
//#region src/define-docs.ts
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./search-
|
|
1
|
+
import { Jt as getPageAgentFrontmatterIssues, M as buildDocsAgentDiscoverySpec, O as DOCS_CONFIG_MAP_TOP_LEVEL_KEYS, P as buildDocsConfigMap, St as findDocsAudienceMdxIssues, Wt as PAGE_AGENT_CONTRACT_FIELDS, Xt as normalizePageAgentFrontmatter, Yt as hasStructuredPageAgentContract, f as DEFAULT_DOCS_CONFIG_ROUTE, u as DEFAULT_DOCS_API_ROUTE } from "./agent-CxDzPqtl.mjs";
|
|
2
|
+
import "./search-OHp36znm.mjs";
|
|
3
3
|
import { c as resolveDocsReviewConfig, o as ensureDocsReviewWorkflow, s as readDocsReviewConfigFromSource, t as runDocsGoldenTasks } from "./agent-evals-BD17jOqL.mjs";
|
|
4
4
|
import { createFilesystemDocsMcpSource, getDocsConfigSchema, resolveDocsMcpConfig } from "./mcp.mjs";
|
|
5
5
|
import "./code-blocks-C9awWzEQ.mjs";
|
|
6
6
|
import { a as loadDocsConfigModuleResultWithProjectEnv, h as resolveDocsContentDir, m as resolveDocsConfigPath, p as readTopLevelStringProperty } from "./config-CydaZ5PB.mjs";
|
|
7
7
|
import { t as detectFramework } from "./utils-DBCCkkJS.mjs";
|
|
8
|
-
import { n as analyzeAgentUsefulness, r as createAgentUsefulnessPagesFromMcp, t as analyzeAgentSurfaceDrift } from "./agent-surface-drift-
|
|
8
|
+
import { i as extractAgentBlocks, n as analyzeAgentUsefulness, r as createAgentUsefulnessPagesFromMcp, t as analyzeAgentSurfaceDrift } from "./agent-surface-drift-rGFS38Ak.mjs";
|
|
9
9
|
import matter from "gray-matter";
|
|
10
10
|
import { existsSync, lstatSync, readFileSync, readdirSync } from "node:fs";
|
|
11
11
|
import path from "node:path";
|
|
@@ -415,6 +415,14 @@ function checkCodeFences(findings, review, options) {
|
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
417
|
function checkAgentContext(findings, review, options) {
|
|
418
|
+
for (const issue of findDocsAudienceMdxIssues(options.source)) pushFinding(findings, review, {
|
|
419
|
+
rule: "agentContext",
|
|
420
|
+
code: `audience-${issue.code}`,
|
|
421
|
+
severity: issue.code === "dynamic-only" ? "error" : "warn",
|
|
422
|
+
file: options.file,
|
|
423
|
+
line: lineForIndex(options.source, issue.index),
|
|
424
|
+
message: issue.message
|
|
425
|
+
});
|
|
418
426
|
for (const issue of getPageAgentFrontmatterIssues(options.agent)) pushFinding(findings, review, {
|
|
419
427
|
rule: "agentContext",
|
|
420
428
|
severity: "warn",
|
|
@@ -448,7 +456,7 @@ function checkAgentContext(findings, review, options) {
|
|
|
448
456
|
});
|
|
449
457
|
if (agent?.task && agent.outcome) return;
|
|
450
458
|
}
|
|
451
|
-
if (options.source
|
|
459
|
+
if (extractAgentBlocks(options.source, { sourcePath: options.file }).length > 0) return;
|
|
452
460
|
if (existsSync(path.join(path.dirname(path.join(options.rootDir, options.file)), "agent.md"))) return;
|
|
453
461
|
if (!/\b(install|configure|setup|implement|defineDocs|docs\.config|MCP|agent)\b/i.test(options.source)) return;
|
|
454
462
|
pushFinding(findings, review, {
|
|
@@ -456,7 +464,7 @@ function checkAgentContext(findings, review, options) {
|
|
|
456
464
|
severity: "suggestion",
|
|
457
465
|
file: options.file,
|
|
458
466
|
line: 1,
|
|
459
|
-
message: "Implementation-heavy docs page could use an <Agent> block or sibling agent.md."
|
|
467
|
+
message: "Implementation-heavy docs page could use an <Agent> block, <Audience only=\"agent\"> block, or sibling agent.md."
|
|
460
468
|
});
|
|
461
469
|
}
|
|
462
470
|
function pushFinding(findings, review, finding) {
|
|
@@ -486,7 +494,7 @@ function printReviewReport(report) {
|
|
|
486
494
|
console.log(`Changed files: ${report.changedFiles.length}`);
|
|
487
495
|
console.log(`Reviewed docs files: ${report.reviewedFiles.length}`);
|
|
488
496
|
console.log(`Findings: ${counts.error} error${counts.error === 1 ? "" : "s"}, ${counts.warn} warning${counts.warn === 1 ? "" : "s"}, ${counts.suggestion} suggestion${counts.suggestion === 1 ? "" : "s"}`);
|
|
489
|
-
if (report.usefulness) console.log(`Useful
|
|
497
|
+
if (report.usefulness) console.log(`Useful agent-only blocks: ${report.usefulness.agentBlocks.useful}/${report.usefulness.agentBlocks.total}; task-complete pages: ${report.usefulness.taskCompleteness.completePages}/${report.usefulness.actionablePages}`);
|
|
490
498
|
if (report.evaluations) console.log(`Golden tasks: ${report.evaluations.status === "unmeasured" ? "unmeasured" : `${report.evaluations.passedTaskCount}/${report.evaluations.taskCount} passed (${report.evaluations.score}/100)`}`);
|
|
491
499
|
if (report.reviewedFiles.length === 0 && report.findings.length === 0) {
|
|
492
500
|
console.log("");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./agent-
|
|
2
|
-
import { c as renderDocsRobotsGeneratedBlock, f as upsertDocsRobotsGeneratedBlock, i as DOCS_ROBOTS_GENERATED_BLOCK_START, r as DOCS_ROBOTS_GENERATED_BLOCK_END, u as resolveDocsRobotsConfig } from "./robots-
|
|
1
|
+
import "./agent-CxDzPqtl.mjs";
|
|
2
|
+
import { c as renderDocsRobotsGeneratedBlock, f as upsertDocsRobotsGeneratedBlock, i as DOCS_ROBOTS_GENERATED_BLOCK_START, r as DOCS_ROBOTS_GENERATED_BLOCK_END, u as resolveDocsRobotsConfig } from "./robots-DRpoiYAV.mjs";
|
|
3
3
|
import { d as readStringProperty, i as loadDocsConfigModule, m as resolveDocsConfigPath, p as readTopLevelStringProperty, s as readBooleanProperty, t as extractNestedObjectLiteral } from "./config-CydaZ5PB.mjs";
|
|
4
4
|
import { t as detectFramework } from "./utils-DBCCkkJS.mjs";
|
|
5
5
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as normalizeDocsPathSegment,
|
|
1
|
+
import { $ as normalizeDocsPathSegment, Lt as resolveDocsSitemapConfig, S as DEFAULT_MCP_WELL_KNOWN_ROUTE, T as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, a as DEFAULT_AGENT_MD_ROUTE, b as DEFAULT_MCP_PUBLIC_ROUTE, c as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, g as DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE, h as DEFAULT_LLMS_FULL_TXT_ROUTE, l as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, o as DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE, t as DEFAULT_AGENTS_MD_ROUTE, v as DEFAULT_LLMS_TXT_ROUTE, w as DEFAULT_SKILL_MD_ROUTE, y as DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE } from "./agent-CxDzPqtl.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/robots.ts
|
|
4
4
|
const DEFAULT_ROBOTS_TXT_ROUTE = "/robots.txt";
|
|
@@ -29,6 +29,30 @@ declare function emitDocsAnalyticsEvent(analytics: boolean | DocsAnalyticsConfig
|
|
|
29
29
|
declare function emitDocsObservabilityEvent(observability: boolean | DocsObservabilityConfig | undefined, event: DocsObservabilityEventInput): Promise<void>;
|
|
30
30
|
declare function emitDocsAgentTraceEvent(observability: boolean | DocsObservabilityConfig | undefined, event: DocsAgentTraceEventInput): Promise<void>;
|
|
31
31
|
//#endregion
|
|
32
|
+
//#region src/audience.d.ts
|
|
33
|
+
/** The two content projections emitted by the docs framework. */
|
|
34
|
+
type DocsContentAudience = "human" | "agent";
|
|
35
|
+
/** Resolve whether content with an optional audience restriction is visible. */
|
|
36
|
+
declare function resolveDocsAudienceExposure(only: unknown, audience: DocsContentAudience): boolean;
|
|
37
|
+
interface DocsAudienceMdxIssue {
|
|
38
|
+
code: "missing-only" | "invalid-only" | "dynamic-only" | "ignored-agent-only" | "ignored-human-only";
|
|
39
|
+
index: number;
|
|
40
|
+
message: string;
|
|
41
|
+
}
|
|
42
|
+
/** Find audience declarations that cannot be projected consistently at build time. */
|
|
43
|
+
declare function findDocsAudienceMdxIssues(content: string): DocsAudienceMdxIssue[];
|
|
44
|
+
/**
|
|
45
|
+
* Resolve MDX into its human or agent projection.
|
|
46
|
+
*
|
|
47
|
+
* `<Agent>` is shorthand for `<Audience only="agent">`, while `<Human>` is
|
|
48
|
+
* shorthand for `<Audience only="human">`. Unknown `Audience.only` values are
|
|
49
|
+
* treated as shared content so an authoring typo never silently deletes content.
|
|
50
|
+
* These primitives shape content for each surface; they are not an access-control boundary.
|
|
51
|
+
*/
|
|
52
|
+
declare function resolveDocsAudienceMdxContent(content: string, audience: DocsContentAudience): string;
|
|
53
|
+
/** Backwards-compatible name retained for existing integrations. */
|
|
54
|
+
declare function resolveDocsAgentMdxContent(content: string, audience: DocsContentAudience): string;
|
|
55
|
+
//#endregion
|
|
32
56
|
//#region src/prompt-utils.d.ts
|
|
33
57
|
type PromptAction = "copy" | "open";
|
|
34
58
|
interface SerializedOpenDocsProvider {
|
|
@@ -185,7 +209,7 @@ interface DocsAskAIPackageHints {
|
|
|
185
209
|
}
|
|
186
210
|
declare function inferDocsAskAIPackageHints(content: string): DocsAskAIPackageHints;
|
|
187
211
|
declare function formatDocsAskAIPackageHints(hints: DocsAskAIPackageHints, packageName?: string): string | undefined;
|
|
188
|
-
declare function buildDocsSearchDocuments(pages: DocsSearchSourcePage[], chunking?: DocsSearchChunkingConfig): DocsSearchDocument[];
|
|
212
|
+
declare function buildDocsSearchDocuments(pages: DocsSearchSourcePage[], chunking?: DocsSearchChunkingConfig, audience?: DocsContentAudience): DocsSearchDocument[];
|
|
189
213
|
declare function createSimpleSearchAdapter(): DocsSearchAdapter;
|
|
190
214
|
declare function createTypesenseSearchAdapter(config: TypesenseDocsSearchConfig): DocsSearchAdapter;
|
|
191
215
|
declare function resolveSearchRequestConfig(search: boolean | DocsSearchConfig | undefined, requestUrl?: string): boolean | DocsSearchConfig | undefined;
|
|
@@ -202,7 +226,8 @@ declare function createAlgoliaSearchAdapter(config: AlgoliaDocsSearchConfig): Do
|
|
|
202
226
|
declare function performDocsSearch(options: {
|
|
203
227
|
pages: DocsSearchSourcePage[];
|
|
204
228
|
query: string;
|
|
205
|
-
search?: boolean | DocsSearchConfig;
|
|
229
|
+
search?: boolean | DocsSearchConfig; /** Selects which audience projection is searchable. Public site search defaults to human. */
|
|
230
|
+
audience?: DocsContentAudience;
|
|
206
231
|
locale?: string;
|
|
207
232
|
pathname?: string;
|
|
208
233
|
siteTitle?: string;
|
|
@@ -222,4 +247,4 @@ declare function buildDocsAskAIContext(options: {
|
|
|
222
247
|
}): Promise<DocsAskAIContext>;
|
|
223
248
|
declare function createCustomSearchAdapter(adapter: DocsSearchAdapter | DocsSearchAdapterFactory): CustomDocsSearchConfig;
|
|
224
249
|
//#endregion
|
|
225
|
-
export {
|
|
250
|
+
export { resolveDocsAudienceMdxContent as $, resolveDocsSitemapRequest as A, normalizePromptProviderName as B, buildDocsSitemapManifest as C, renderDocsSitemapXml as D, renderDocsSitemapMarkdown as E, DEFAULT_PROMPT_PROVIDER_TEMPLATES as F, serializeDocsIconRegistry as G, resolvePromptProviderChoices as H, PromptAction as I, DocsAudienceMdxIssue as J, serializeOpenDocsProvider as K, PromptProviderChoice as L, DEFAULT_OPEN_DOCS_PROMPT as M, DEFAULT_OPEN_DOCS_PROVIDER_IDS as N, resolveDocsSitemapConfig as O, DEFAULT_OPEN_DOCS_TARGET as P, resolveDocsAudienceExposure as Q, SerializeOpenDocsProviderOptions as R, DocsSitemapResolvedConfig as S, readDocsSitemapManifestFromContentMap as T, sanitizePromptText as U, parsePromptStringArray as V, serializeDocsIcon as W, findDocsAudienceMdxIssues as X, DocsContentAudience as Y, resolveDocsAgentMdxContent as Z, DEFAULT_SITEMAP_XML_ROUTE as _, createMcpSearchAdapter as a, createDocsAgentTraceId as at, DocsSitemapManifestPage as b, formatDocsAskAIPackageHints as c, emitDocsObservabilityEvent as ct, resolveAskAISearchRequestConfig as d, resolveDocsObservabilityConfig as dt, DOCS_AGENT_TRACE_EVENT_TYPES as et, resolveSearchRequestConfig as f, DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE as g, DEFAULT_SITEMAP_MD_ROUTE as h, createCustomSearchAdapter as i, createDocsAgentTraceContext as it, toDocsSitemapMarkdownUrl as j, resolveDocsSitemapPageLastmod as k, inferDocsAskAIPackageHints as l, getDocsRequestAnalyticsProperties as lt, DEFAULT_SITEMAP_MD_DOCS_ROUTE as m, buildDocsSearchDocuments as n, ResolvedDocsAnalyticsConfig as nt, createSimpleSearchAdapter as o, emitDocsAgentTraceEvent as ot, DEFAULT_SITEMAP_MANIFEST_PATH as p, serializeOpenDocsProviders as q, createAlgoliaSearchAdapter as r, ResolvedDocsObservabilityConfig as rt, createTypesenseSearchAdapter as s, emitDocsAnalyticsEvent as st, buildDocsAskAIContext as t, DocsAgentTraceContext as tt, performDocsSearch as u, resolveDocsAnalyticsConfig as ut, DocsSitemapFormat as v, createDocsSitemapResponse as w, DocsSitemapPageInput as x, DocsSitemapManifest as y, SerializedOpenDocsProvider as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { G as isDocsAgentsRequest,
|
|
1
|
+
import { G as isDocsAgentsRequest, Kt as PAGE_AGENT_CONTRACT_START_MARKER, Ut as PAGE_AGENT_CONTRACT_END_MARKER, W as isDocsAgentDiscoveryRequest, Z as isDocsSkillRequest, Zt as renderPageAgentContractMarkdown, ct as resolveDocsAgentFeedbackConfig, en as upsertPageAgentContractMarkdown, ft as resolveDocsLlmsTxtRequest, gt as resolveDocsMarkdownRequest, lt as resolveDocsAgentFeedbackRequest, ut as resolveDocsAgentsFormat, vt as resolveDocsSkillFormat } from "./agent-CxDzPqtl.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/telemetry.ts
|
|
4
4
|
const DOCS_PACKAGE_NAME = "@farming-labs/docs";
|
|
@@ -706,7 +706,7 @@ function resolveAskAIContextUrl(value, baseUrl) {
|
|
|
706
706
|
}
|
|
707
707
|
}
|
|
708
708
|
function getAskAIPageContent(page) {
|
|
709
|
-
return upsertPageAgentContractMarkdown(page.agentRawContent ?? page.agentFallbackRawContent ?? page.rawContent ?? page.content, page.agent).replace(PAGE_AGENT_CONTRACT_START_MARKER, "").replace(PAGE_AGENT_CONTRACT_END_MARKER, "").replace(/^\r?\n+/, "");
|
|
709
|
+
return upsertPageAgentContractMarkdown(page.agentRawContent ?? page.agentFallbackRawContent ?? page.agentContent ?? page.agentFallbackContent ?? page.rawContent ?? page.content, page.agent).replace(PAGE_AGENT_CONTRACT_START_MARKER, "").replace(PAGE_AGENT_CONTRACT_END_MARKER, "").replace(/^\r?\n+/, "");
|
|
710
710
|
}
|
|
711
711
|
function getPageAgentContractSearchText(page) {
|
|
712
712
|
return stripMarkdownText(renderPageAgentContractMarkdown(page.agent).replace(PAGE_AGENT_CONTRACT_START_MARKER, "").replace(PAGE_AGENT_CONTRACT_END_MARKER, ""));
|
|
@@ -838,12 +838,37 @@ function mergeSearchResults(...groups) {
|
|
|
838
838
|
}
|
|
839
839
|
return results;
|
|
840
840
|
}
|
|
841
|
-
function
|
|
841
|
+
function sanitizeExternalAgentSearchResults(results, localAgentResults, preserveUnmatched) {
|
|
842
|
+
const localByKey = new Map(localAgentResults.map((result) => [getSearchResultKey(result), result]));
|
|
843
|
+
const localPageResults = /* @__PURE__ */ new Map();
|
|
844
|
+
for (const result of localAgentResults) {
|
|
845
|
+
const pageUrl = normalizeUrlPathname(result.url);
|
|
846
|
+
if (!localPageResults.get(pageUrl) || result.type === "page") localPageResults.set(pageUrl, result);
|
|
847
|
+
}
|
|
848
|
+
return results.flatMap((result) => {
|
|
849
|
+
const local = localByKey.get(getSearchResultKey(result)) ?? localPageResults.get(normalizeUrlPathname(result.url));
|
|
850
|
+
if (!local) return preserveUnmatched?.(result) ? [result] : [];
|
|
851
|
+
return [{
|
|
852
|
+
...local,
|
|
853
|
+
id: result.id,
|
|
854
|
+
score: result.score ?? local.score
|
|
855
|
+
}];
|
|
856
|
+
});
|
|
857
|
+
}
|
|
858
|
+
function getPageAudienceRawContent(page, audience) {
|
|
859
|
+
if (audience === "agent") return page.agentRawContent ?? page.agentFallbackRawContent ?? page.agentContent ?? page.agentFallbackContent ?? page.rawContent ?? page.content;
|
|
860
|
+
return page.rawContent ?? page.content;
|
|
861
|
+
}
|
|
862
|
+
function getPageAudienceSearchText(page, audience) {
|
|
863
|
+
if (audience === "agent") return page.agentContent ?? page.agentFallbackContent ?? stripMarkdownText(getPageAudienceRawContent(page, audience));
|
|
864
|
+
return page.content || stripMarkdownText(getPageAudienceRawContent(page, audience));
|
|
865
|
+
}
|
|
866
|
+
function pageToSearchDocument(page, audience = "human") {
|
|
842
867
|
return {
|
|
843
868
|
id: makeDocumentId(page.url, "page"),
|
|
844
869
|
url: page.url,
|
|
845
870
|
title: page.title,
|
|
846
|
-
content: normalizeWhitespace([page
|
|
871
|
+
content: normalizeWhitespace([getPageAudienceSearchText(page, audience), getPageAgentContractSearchText(page)].join(" ")),
|
|
847
872
|
description: page.description,
|
|
848
873
|
type: "page",
|
|
849
874
|
locale: page.locale,
|
|
@@ -852,12 +877,12 @@ function pageToSearchDocument(page) {
|
|
|
852
877
|
tags: page.tags
|
|
853
878
|
};
|
|
854
879
|
}
|
|
855
|
-
function buildExactPageSearchResults(query, pages) {
|
|
880
|
+
function buildExactPageSearchResults(query, pages, audience = "human") {
|
|
856
881
|
const normalizedQuery = normalizeSearchPhrase(query);
|
|
857
882
|
if (!normalizedQuery) return [];
|
|
858
883
|
const results = [];
|
|
859
884
|
for (const page of pages) {
|
|
860
|
-
const document = pageToSearchDocument(page);
|
|
885
|
+
const document = pageToSearchDocument(page, audience);
|
|
861
886
|
const title = normalizeSearchPhrase(page.title);
|
|
862
887
|
const urlSegments = getUrlSearchSegments(page.url);
|
|
863
888
|
if (!(title === normalizedQuery || urlSegments.includes(normalizedQuery))) continue;
|
|
@@ -890,9 +915,6 @@ function prioritizeLiteralInsideResults(query, results) {
|
|
|
890
915
|
return 0;
|
|
891
916
|
});
|
|
892
917
|
}
|
|
893
|
-
function shouldSupplementAskAIWithSimpleSearch(search) {
|
|
894
|
-
return search.enabled && search.provider !== "simple";
|
|
895
|
-
}
|
|
896
918
|
function rankAskAIContextResult(query, result) {
|
|
897
919
|
return scoreDocument(query, {
|
|
898
920
|
id: result.id,
|
|
@@ -914,8 +936,8 @@ function buildAskAIContextBlock(result) {
|
|
|
914
936
|
function makeDocumentId(url, suffix) {
|
|
915
937
|
return `${url}#${suffix}`;
|
|
916
938
|
}
|
|
917
|
-
function splitPageIntoSections(page) {
|
|
918
|
-
return parseDocsMarkdownSections(page
|
|
939
|
+
function splitPageIntoSections(page, audience = "human") {
|
|
940
|
+
return parseDocsMarkdownSections(getPageAudienceRawContent(page, audience)).flatMap((section, index) => {
|
|
919
941
|
const content = normalizeWhitespace(stripMarkdownText(section.content));
|
|
920
942
|
if (!content) return [];
|
|
921
943
|
return [{
|
|
@@ -933,12 +955,12 @@ function splitPageIntoSections(page) {
|
|
|
933
955
|
}];
|
|
934
956
|
});
|
|
935
957
|
}
|
|
936
|
-
function buildDocsSearchDocuments(pages, chunking = {}) {
|
|
958
|
+
function buildDocsSearchDocuments(pages, chunking = {}, audience = "human") {
|
|
937
959
|
const strategy = chunking.strategy ?? "section";
|
|
938
960
|
return pages.flatMap((page) => {
|
|
939
|
-
const base = pageToSearchDocument(page);
|
|
961
|
+
const base = pageToSearchDocument(page, audience);
|
|
940
962
|
if (strategy === "page") return [base];
|
|
941
|
-
const sections = splitPageIntoSections(page);
|
|
963
|
+
const sections = splitPageIntoSections(page, audience);
|
|
942
964
|
if (sections.length === 0) return [base];
|
|
943
965
|
return [...base.content ? [base] : [], ...sections];
|
|
944
966
|
});
|
|
@@ -1522,7 +1544,8 @@ async function maybeSyncSearchIndex(adapter, search, context) {
|
|
|
1522
1544
|
async function performDocsSearch(options) {
|
|
1523
1545
|
const search = normalizeDocsSearchConfig(options.search);
|
|
1524
1546
|
if (!search.enabled) return [];
|
|
1525
|
-
const
|
|
1547
|
+
const audience = options.audience ?? "human";
|
|
1548
|
+
const documents = buildDocsSearchDocuments(options.pages, search.chunking, audience);
|
|
1526
1549
|
const context = {
|
|
1527
1550
|
pages: options.pages,
|
|
1528
1551
|
documents,
|
|
@@ -1538,10 +1561,16 @@ async function performDocsSearch(options) {
|
|
|
1538
1561
|
};
|
|
1539
1562
|
try {
|
|
1540
1563
|
const adapter = await resolveSearchAdapter(search, context);
|
|
1541
|
-
await maybeSyncSearchIndex(adapter, search,
|
|
1564
|
+
await maybeSyncSearchIndex(adapter, search, audience === "agent" ? {
|
|
1565
|
+
...context,
|
|
1566
|
+
documents: buildDocsSearchDocuments(options.pages, search.chunking, "human")
|
|
1567
|
+
} : context);
|
|
1542
1568
|
const results = await adapter.search(query, context);
|
|
1543
1569
|
if (search.provider === "simple") return results;
|
|
1544
|
-
|
|
1570
|
+
const localAudienceResults = audience === "agent" ? await createSimpleSearchAdapter().search(query, context) : [];
|
|
1571
|
+
const localPagePaths = new Set(options.pages.map((page) => normalizeUrlPathname(page.url)));
|
|
1572
|
+
const safeAdapterResults = audience !== "agent" ? results : sanitizeExternalAgentSearchResults(results, localAudienceResults, search.provider === "mcp" ? (result) => !localPagePaths.has(normalizeUrlPathname(result.url)) : void 0);
|
|
1573
|
+
return prioritizeLiteralInsideResults(options.query, mergeSearchResults(buildExactPageSearchResults(options.query, options.pages, audience), safeAdapterResults, localAudienceResults)).slice(0, query.limit ?? search.maxResults ?? DEFAULT_SEARCH_LIMIT);
|
|
1545
1574
|
} catch {
|
|
1546
1575
|
return createSimpleSearchAdapter().search(query, context);
|
|
1547
1576
|
}
|
|
@@ -1551,29 +1580,16 @@ async function buildDocsAskAIContext(options) {
|
|
|
1551
1580
|
const searchLimit = Math.max(limit * 2, limit);
|
|
1552
1581
|
const initialSearch = options.search === false ? true : options.search;
|
|
1553
1582
|
const primarySearch = normalizeDocsSearchConfig(initialSearch).enabled ? initialSearch : true;
|
|
1554
|
-
const
|
|
1555
|
-
const searchResults = mergeSearchResults(await performDocsSearch({
|
|
1583
|
+
const searchResults = await performDocsSearch({
|
|
1556
1584
|
pages: options.pages,
|
|
1557
1585
|
query: options.query,
|
|
1558
1586
|
search: primarySearch,
|
|
1587
|
+
audience: "agent",
|
|
1559
1588
|
locale: options.locale,
|
|
1560
1589
|
pathname: options.pathname,
|
|
1561
1590
|
siteTitle: options.siteTitle,
|
|
1562
1591
|
limit: searchLimit
|
|
1563
|
-
})
|
|
1564
|
-
pages: options.pages,
|
|
1565
|
-
query: options.query,
|
|
1566
|
-
search: {
|
|
1567
|
-
provider: "simple",
|
|
1568
|
-
enabled: true,
|
|
1569
|
-
chunking: primarySearchConfig.chunking,
|
|
1570
|
-
maxResults: searchLimit
|
|
1571
|
-
},
|
|
1572
|
-
locale: options.locale,
|
|
1573
|
-
pathname: options.pathname,
|
|
1574
|
-
siteTitle: options.siteTitle,
|
|
1575
|
-
limit: searchLimit
|
|
1576
|
-
}) : []);
|
|
1592
|
+
});
|
|
1577
1593
|
const seen = /* @__PURE__ */ new Set();
|
|
1578
1594
|
const maxResultChars = options.maxResultChars ?? DEFAULT_ASK_AI_RESULT_CHARS;
|
|
1579
1595
|
const rankedResults = searchResults.map((result, index) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./agent-
|
|
2
|
-
import { n as buildDocsSearchDocuments, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter } from "./search-
|
|
3
|
-
import "./sitemap-server-
|
|
1
|
+
import "./agent-CxDzPqtl.mjs";
|
|
2
|
+
import { n as buildDocsSearchDocuments, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter } from "./search-OHp36znm.mjs";
|
|
3
|
+
import "./sitemap-server-zFYctvCa.mjs";
|
|
4
4
|
import "./agent-evals-BD17jOqL.mjs";
|
|
5
5
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
6
6
|
import "./code-blocks-C9awWzEQ.mjs";
|
package/dist/server.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $t as McpDocsSearchConfig, At as DocsSearchDocument, C as DocsAgentTraceEventType, D as DocsAnalyticsEventInput, Dt as DocsSearchAdapterFactory, E as DocsAnalyticsEvent, Et as DocsSearchAdapterContext, F as DocsAskAIFeedbackMessage, Ft as DocsSearchSourcePage, I as DocsAskAIFeedbackValue, It as DocsSitemapConfig, L as DocsAskAIMcpConfig, Mt as DocsSearchQuery, N as DocsAskAIFeedbackConfig, Nt as DocsSearchResult, P as DocsAskAIFeedbackData, S as DocsAgentTraceEventInput, T as DocsAnalyticsConfig, Tt as DocsSearchAdapter, Z as DocsConfig, a as ApiReferenceRenderer, b as DocsAgentGoldenTaskExpectation, bt as DocsReviewRulesConfig, ht as DocsObservabilityEventInput, kt as DocsSearchConfig, mt as DocsObservabilityEvent, pt as DocsObservabilityConfig, v as DocsAgentGoldenExpectedExample, vt as DocsReviewCiMode, w as DocsAgentTraceStatus, x as DocsAgentGoldenTaskFilters, y as DocsAgentGoldenTask, yt as DocsReviewConfig } from "./types-R-DN23yw.mjs";
|
|
2
2
|
import { i as isDocsCloudAskAIProvider, n as DocsCloudAskAIResponseOptions, r as createDocsCloudAskAIResponse, t as DocsCloudAskAIConfig } from "./cloud-ask-ai-CvRVnwdK.mjs";
|
|
3
3
|
import { DocsCloudAskAIOptions, DocsCloudPublicConfig, DocsCloudRouteHandlerOptions, DocsCloudRouteHandlers, DocsCloudRuntimeEnv, DocsCloudRuntimeValue, DocsCloudServer, DocsCloudServerOptions, DocsCloudTrackEventOptions, createDocsCloudRouteHandler, createDocsCloudServer } from "./docs-cloud-server.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { A as resolveDocsSitemapRequest, B as normalizePromptProviderName, C as buildDocsSitemapManifest, D as renderDocsSitemapXml, E as renderDocsSitemapMarkdown, F as DEFAULT_PROMPT_PROVIDER_TEMPLATES, G as serializeDocsIconRegistry, H as resolvePromptProviderChoices, I as PromptAction, K as serializeOpenDocsProvider, L as PromptProviderChoice, M as DEFAULT_OPEN_DOCS_PROMPT, N as DEFAULT_OPEN_DOCS_PROVIDER_IDS, O as resolveDocsSitemapConfig, P as DEFAULT_OPEN_DOCS_TARGET, R as SerializeOpenDocsProviderOptions, S as DocsSitemapResolvedConfig, T as readDocsSitemapManifestFromContentMap, U as sanitizePromptText, V as parsePromptStringArray, W as serializeDocsIcon, _ as DEFAULT_SITEMAP_XML_ROUTE, a as createMcpSearchAdapter, at as createDocsAgentTraceId, b as DocsSitemapManifestPage, c as formatDocsAskAIPackageHints, ct as emitDocsObservabilityEvent, d as resolveAskAISearchRequestConfig, dt as resolveDocsObservabilityConfig, et as DOCS_AGENT_TRACE_EVENT_TYPES, f as resolveSearchRequestConfig, g as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, h as DEFAULT_SITEMAP_MD_ROUTE, i as createCustomSearchAdapter, it as createDocsAgentTraceContext, j as toDocsSitemapMarkdownUrl, k as resolveDocsSitemapPageLastmod, l as inferDocsAskAIPackageHints, lt as getDocsRequestAnalyticsProperties, m as DEFAULT_SITEMAP_MD_DOCS_ROUTE, n as buildDocsSearchDocuments, nt as ResolvedDocsAnalyticsConfig, o as createSimpleSearchAdapter, ot as emitDocsAgentTraceEvent, p as DEFAULT_SITEMAP_MANIFEST_PATH, q as serializeOpenDocsProviders, r as createAlgoliaSearchAdapter, rt as ResolvedDocsObservabilityConfig, s as createTypesenseSearchAdapter, st as emitDocsAnalyticsEvent, t as buildDocsAskAIContext, tt as DocsAgentTraceContext, u as performDocsSearch, ut as resolveDocsAnalyticsConfig, v as DocsSitemapFormat, w as createDocsSitemapResponse, x as DocsSitemapPageInput, y as DocsSitemapManifest, z as SerializedOpenDocsProvider } from "./search-9uEaC23e.mjs";
|
|
5
5
|
import { CreateDocsMcpServerOptions, DEFAULT_DOCS_MCP_CORS_ALLOWED_HEADERS, DEFAULT_DOCS_MCP_CORS_EXPOSED_HEADERS, DEFAULT_DOCS_MCP_CORS_MAX_AGE_SECONDS, DEFAULT_DOCS_MCP_MAX_BODY_BYTES, DOCS_CONFIG_SCHEMA_OPTIONS, DocsMcpAgentContractSummary, DocsMcpCodeExample, DocsMcpConfigSchema, DocsMcpConfigSchemaOption, DocsMcpContextResult, DocsMcpContextSource, DocsMcpDocsList, DocsMcpDocsPageSummary, DocsMcpDocsSection, DocsMcpHttpHandlers, DocsMcpNavigationNode, DocsMcpNavigationTree, DocsMcpPage, DocsMcpRequestContext, DocsMcpResolvedConfig, DocsMcpResolvedCorsConfig, DocsMcpResolvedSecurityConfig, DocsMcpSource, DocsMcpTaskSummary, createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, getDocsConfigSchema, normalizeDocsMcpRoute, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
6
6
|
|
|
7
7
|
//#region src/code-group-mdx.d.ts
|
package/dist/server.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as emitDocsAnalyticsEvent, c as resolveDocsAnalyticsConfig, i as emitDocsAgentTraceEvent, l as resolveDocsObservabilityConfig, n as createDocsAgentTraceContext, o as emitDocsObservabilityEvent, r as createDocsAgentTraceId, s as getDocsRequestAnalyticsProperties, t as DOCS_AGENT_TRACE_EVENT_TYPES } from "./analytics-Bx44lg6d.mjs";
|
|
2
|
-
import { At as
|
|
3
|
-
import { a as createMcpSearchAdapter, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, f as resolveSearchRequestConfig, i as createCustomSearchAdapter, l as inferDocsAskAIPackageHints, n as buildDocsSearchDocuments, o as createSimpleSearchAdapter, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, u as performDocsSearch } from "./search-
|
|
4
|
-
import { C as resolveApiReferenceOpenApiDiscovery, S as resolveApiReferenceConfig, T as remarkCodeGroup, _ as buildApiReferenceOpenApiDocument, a as DEFAULT_PROMPT_PROVIDER_TEMPLATES, b as buildApiReferenceScalarCss, c as resolvePromptProviderChoices, d as serializeDocsIconRegistry, f as serializeOpenDocsProvider, g as buildApiReferenceHtmlDocumentAsync, h as buildApiReferenceHtmlDocument, i as DEFAULT_OPEN_DOCS_TARGET, l as sanitizePromptText, m as DEFAULT_API_REFERENCE_OPENAPI_ROUTE, n as DEFAULT_OPEN_DOCS_PROMPT, o as normalizePromptProviderName, p as serializeOpenDocsProviders, r as DEFAULT_OPEN_DOCS_PROVIDER_IDS, s as parsePromptStringArray, t as readDocsSitemapManifest, u as serializeDocsIcon, v as buildApiReferenceOpenApiDocumentAsync, w as resolveApiReferenceRenderer, x as isApiReferenceOpenApiRequest, y as buildApiReferencePageTitle } from "./sitemap-server-
|
|
2
|
+
import { At as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, Bt as toDocsSitemapMarkdownUrl, Dt as DEFAULT_SITEMAP_MANIFEST_PATH, Ft as renderDocsSitemapMarkdown, It as renderDocsSitemapXml, Lt as resolveDocsSitemapConfig, Mt as buildDocsSitemapManifest, Nt as createDocsSitemapResponse, Ot as DEFAULT_SITEMAP_MD_DOCS_ROUTE, Pt as readDocsSitemapManifestFromContentMap, Rt as resolveDocsSitemapPageLastmod, jt as DEFAULT_SITEMAP_XML_ROUTE, kt as DEFAULT_SITEMAP_MD_ROUTE, zt as resolveDocsSitemapRequest } from "./agent-CxDzPqtl.mjs";
|
|
3
|
+
import { a as createMcpSearchAdapter, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, f as resolveSearchRequestConfig, i as createCustomSearchAdapter, l as inferDocsAskAIPackageHints, n as buildDocsSearchDocuments, o as createSimpleSearchAdapter, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, u as performDocsSearch } from "./search-OHp36znm.mjs";
|
|
4
|
+
import { C as resolveApiReferenceOpenApiDiscovery, S as resolveApiReferenceConfig, T as remarkCodeGroup, _ as buildApiReferenceOpenApiDocument, a as DEFAULT_PROMPT_PROVIDER_TEMPLATES, b as buildApiReferenceScalarCss, c as resolvePromptProviderChoices, d as serializeDocsIconRegistry, f as serializeOpenDocsProvider, g as buildApiReferenceHtmlDocumentAsync, h as buildApiReferenceHtmlDocument, i as DEFAULT_OPEN_DOCS_TARGET, l as sanitizePromptText, m as DEFAULT_API_REFERENCE_OPENAPI_ROUTE, n as DEFAULT_OPEN_DOCS_PROMPT, o as normalizePromptProviderName, p as serializeOpenDocsProviders, r as DEFAULT_OPEN_DOCS_PROVIDER_IDS, s as parsePromptStringArray, t as readDocsSitemapManifest, u as serializeDocsIcon, v as buildApiReferenceOpenApiDocumentAsync, w as resolveApiReferenceRenderer, x as isApiReferenceOpenApiRequest, y as buildApiReferencePageTitle } from "./sitemap-server-zFYctvCa.mjs";
|
|
5
5
|
import { a as buildDocsReviewWorkflowPathFilters, c as resolveDocsReviewConfig, i as buildDocsReviewWorkflow, n as DEFAULT_DOCS_REVIEW_SCORE_THRESHOLD, o as ensureDocsReviewWorkflow, r as DEFAULT_DOCS_REVIEW_WORKFLOW_PATH, s as readDocsReviewConfigFromSource, t as runDocsGoldenTasks } from "./agent-evals-BD17jOqL.mjs";
|
|
6
6
|
import { DEFAULT_DOCS_MCP_CORS_ALLOWED_HEADERS, DEFAULT_DOCS_MCP_CORS_EXPOSED_HEADERS, DEFAULT_DOCS_MCP_CORS_MAX_AGE_SECONDS, DEFAULT_DOCS_MCP_MAX_BODY_BYTES, DOCS_CONFIG_SCHEMA_OPTIONS, createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, getDocsConfigSchema, normalizeDocsMcpRoute, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
7
7
|
import { n as isDocsCloudAskAIProvider, t as createDocsCloudAskAIResponse } from "./cloud-ask-ai-1k0q6OAH.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./search-
|
|
3
|
-
import "./sitemap-server-
|
|
1
|
+
import { Ft as renderDocsSitemapMarkdown, It as renderDocsSitemapXml, Lt as resolveDocsSitemapConfig, Mt as buildDocsSitemapManifest } from "./agent-CxDzPqtl.mjs";
|
|
2
|
+
import "./search-OHp36znm.mjs";
|
|
3
|
+
import "./sitemap-server-zFYctvCa.mjs";
|
|
4
4
|
import "./agent-evals-BD17jOqL.mjs";
|
|
5
5
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
6
6
|
import "./code-blocks-C9awWzEQ.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Lt as resolveDocsSitemapConfig } from "./agent-CxDzPqtl.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
4
4
|
import path, { basename, join, relative } from "node:path";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farming-labs/docs",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.56",
|
|
4
4
|
"description": "Modern, flexible MDX-based docs framework — core types, config, and CLI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"docs",
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@clack/prompts": "^0.9.1",
|
|
51
|
+
"@mdx-js/mdx": "^3.1.1",
|
|
51
52
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
52
53
|
"@scalar/core": "^0.4.3",
|
|
53
54
|
"@vercel/sandbox": "^2.0.0",
|