@farming-labs/docs 0.1.101 → 0.1.103
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/{robots-D8IQoKv1.mjs → agent-BK7q65dn.mjs} +176 -238
- package/dist/agent-sUT6Bsop.mjs +9 -0
- package/dist/{agent-BG9YfbHr.mjs → agents-B04j1KsE.mjs} +203 -6
- package/dist/cli/index.mjs +27 -12
- package/dist/{dev-HW5Op4My.mjs → dev-CpvDdmY3.mjs} +1 -1
- package/dist/{doctor-C8NWuL1m.mjs → doctor-DPFrn2se.mjs} +14 -8
- package/dist/index.d.mts +23 -15
- package/dist/index.mjs +3 -2
- package/dist/{init-BXZa9OiZ.mjs → init-BJbBtnBz.mjs} +1 -1
- package/dist/{mcp-D0LCSSaq.mjs → mcp-B-zWyAlw.mjs} +2 -2
- package/dist/mcp.d.mts +1 -1
- package/dist/robots-DDrj6Cpo.mjs +192 -0
- package/dist/{robots-B9RIhGtT.mjs → robots-HU8yTWZv.mjs} +3 -2
- package/dist/{search-jAlynFl1.mjs → search-0H8jdm8S.mjs} +2 -2
- package/dist/{search-DfcI-2-D.d.mts → search-BlXlCmne.d.mts} +1 -1
- package/dist/server.d.mts +2 -2
- package/dist/server.mjs +1 -1
- package/dist/{sitemap-BYVaRIsO.mjs → sitemap-DqzvA3BI.mjs} +2 -2
- package/dist/{templates-Bq8X1qEd.mjs → templates-BpSkUico.mjs} +2 -2
- package/dist/{types-CAxzjKQR.d.mts → types-BSnCAFHc.d.mts} +1 -1
- package/package.json +1 -1
- /package/dist/{config-UI31_wlO.mjs → config-Cio3byUJ.mjs} +0 -0
- /package/dist/{sitemap-server-C4TbbCmY.mjs → sitemap-server-DJvxOqX2.mjs} +0 -0
- /package/dist/{upgrade-D9c60phM.mjs → upgrade-Nh6Jn6Kk.mjs} +0 -0
|
@@ -17,6 +17,10 @@ const DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE = "/.well-known/llms-full.txt";
|
|
|
17
17
|
const DEFAULT_LLMS_TXT_MAX_CHARS = 5e4;
|
|
18
18
|
const DEFAULT_SKILL_MD_ROUTE = "/skill.md";
|
|
19
19
|
const DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE = "/.well-known/skill.md";
|
|
20
|
+
const DEFAULT_AGENTS_MD_ROUTE = "/AGENTS.md";
|
|
21
|
+
const DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE = "/.well-known/AGENTS.md";
|
|
22
|
+
const DEFAULT_AGENT_MD_ROUTE = "/AGENT.md";
|
|
23
|
+
const DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE = "/.well-known/AGENT.md";
|
|
20
24
|
const DEFAULT_AGENT_DISCOVERY_ROBOTS_TXT_ROUTE = "/robots.txt";
|
|
21
25
|
const DEFAULT_AGENT_FEEDBACK_ROUTE = "/api/docs/agent/feedback";
|
|
22
26
|
const DEFAULT_AGENT_FEEDBACK_PAYLOAD_SCHEMA = {
|
|
@@ -580,10 +584,21 @@ function isDocsSkillRequest(url) {
|
|
|
580
584
|
function resolveDocsSkillFormat(url) {
|
|
581
585
|
return url.searchParams.get("format")?.trim() === "skill" ? "skill" : null;
|
|
582
586
|
}
|
|
587
|
+
function isDocsAgentsPath(pathname) {
|
|
588
|
+
return pathname === DEFAULT_AGENTS_MD_ROUTE || pathname === DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE || pathname === DEFAULT_AGENT_MD_ROUTE || pathname === DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE;
|
|
589
|
+
}
|
|
590
|
+
function isDocsAgentsRequest(url) {
|
|
591
|
+
const pathname = normalizeDocsUrlPath(url.pathname);
|
|
592
|
+
if (isDocsAgentsPath(pathname)) return true;
|
|
593
|
+
return pathname === DEFAULT_DOCS_API_ROUTE && resolveDocsAgentsFormat(url) === "agents";
|
|
594
|
+
}
|
|
595
|
+
function resolveDocsAgentsFormat(url) {
|
|
596
|
+
return url.searchParams.get("format")?.trim() === "agents" ? "agents" : null;
|
|
597
|
+
}
|
|
583
598
|
function isDocsPublicGetRequest(entry, url, request, options = {}) {
|
|
584
599
|
const pathname = normalizeDocsUrlPath(url.pathname);
|
|
585
600
|
if (pathname === DEFAULT_DOCS_API_ROUTE || pathname === DEFAULT_MCP_ROUTE) return false;
|
|
586
|
-
return isDocsAgentDiscoveryRequest(url) || isDocsSkillRequest(url) || pathname === DEFAULT_AGENT_DISCOVERY_ROBOTS_TXT_ROUTE && isRobotsDiscoveryEnabled(options.robots) || resolveDocsLlmsTxtRequest(url, options.llms) !== null || resolveDocsSitemapRequest(url, options.sitemap) !== null || resolveDocsMarkdownRequest(entry, url, request) !== null;
|
|
601
|
+
return isDocsAgentDiscoveryRequest(url) || isDocsAgentsRequest(url) || isDocsSkillRequest(url) || pathname === DEFAULT_AGENT_DISCOVERY_ROBOTS_TXT_ROUTE && isRobotsDiscoveryEnabled(options.robots) || resolveDocsLlmsTxtRequest(url, options.llms) !== null || resolveDocsSitemapRequest(url, options.sitemap) !== null || resolveDocsMarkdownRequest(entry, url, request) !== null;
|
|
587
602
|
}
|
|
588
603
|
function isDocsLlmsTxtPublicRequest(url, llms) {
|
|
589
604
|
return normalizeDocsUrlPath(url.pathname) !== DEFAULT_DOCS_API_ROUTE && resolveDocsLlmsTxtRequest(url, llms) !== null;
|
|
@@ -631,6 +646,7 @@ function renderDocsMarkdownNotFound({ entry = "docs", requestedPath, sitemap })
|
|
|
631
646
|
`- Agent discovery spec: \`${DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE}\``,
|
|
632
647
|
`- Agent discovery fallback: \`${DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE}\``,
|
|
633
648
|
`- Agent discovery API: \`${DEFAULT_AGENT_SPEC_ROUTE}\``,
|
|
649
|
+
`- Agent instructions: \`${DEFAULT_AGENTS_MD_ROUTE}\``,
|
|
634
650
|
`- Search endpoint: \`${DEFAULT_DOCS_API_ROUTE}?query={query}\``,
|
|
635
651
|
`- Docs index markdown: \`/${normalizedEntry}.md\``,
|
|
636
652
|
`- Requested markdown API route: \`${requestedApiRoute}\``
|
|
@@ -657,6 +673,126 @@ function shouldRenderLlmsDirective(options) {
|
|
|
657
673
|
if (options?.llms && typeof options.llms === "object" && options.llms.enabled === false) return false;
|
|
658
674
|
return true;
|
|
659
675
|
}
|
|
676
|
+
function resolveDocsAgentDocumentContext({ entry = "docs", search, mcp, feedback, llms, sitemap, robots, openapi, markdown }) {
|
|
677
|
+
const feedbackRoute = feedback?.route ?? DEFAULT_AGENT_FEEDBACK_ROUTE;
|
|
678
|
+
return {
|
|
679
|
+
normalizedEntry: normalizeDocsPathSegment(entry) || "docs",
|
|
680
|
+
siteTitle: compactSkillText(llms?.siteTitle ?? "Documentation"),
|
|
681
|
+
siteDescription: llms?.siteDescription ? compactSkillText(llms.siteDescription) : void 0,
|
|
682
|
+
llmsEnabled: llms?.enabled ?? true,
|
|
683
|
+
searchEnabled: isSearchEnabled(search),
|
|
684
|
+
mcpEnabled: mcp.enabled,
|
|
685
|
+
feedbackEnabled: feedback?.enabled ?? false,
|
|
686
|
+
sitemapConfig: resolveDocsSitemapConfig(sitemap),
|
|
687
|
+
robotsEnabled: isRobotsDiscoveryEnabled(robots),
|
|
688
|
+
openapiConfig: resolveDocsOpenApiDiscoveryConfig(openapi),
|
|
689
|
+
feedbackRoute,
|
|
690
|
+
feedbackSchemaRoute: feedback?.schemaRoute ?? `${feedbackRoute}/schema`,
|
|
691
|
+
llmsSections: resolveDocsLlmsTxtSections(llms),
|
|
692
|
+
markdownAcceptHeader: markdown?.acceptHeader === false ? null : "text/markdown",
|
|
693
|
+
markdownSignatureAgentHeader: markdown?.signatureAgentHeader === false ? null : DOCS_MARKDOWN_SIGNATURE_AGENT_HEADER
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
function appendDocsMarkdownNegotiationStartLines(lines, context, variant) {
|
|
697
|
+
if (context.markdownAcceptHeader) lines.push(variant === "skill" ? `- You can also request ${context.markdownAcceptHeader} from normal page URLs.` : `- Normal docs pages can return markdown with Accept: ${context.markdownAcceptHeader}.`);
|
|
698
|
+
if (context.markdownSignatureAgentHeader) lines.push(variant === "skill" ? `- Requests with ${context.markdownSignatureAgentHeader} on normal page URLs receive markdown automatically.` : `- Normal docs pages can also return markdown when ${context.markdownSignatureAgentHeader} is present.`);
|
|
699
|
+
}
|
|
700
|
+
function appendDocsSearchStartLine(lines, context, variant) {
|
|
701
|
+
if (!context.searchEnabled) return;
|
|
702
|
+
lines.push(variant === "skill" ? `- Search with ${DEFAULT_DOCS_API_ROUTE}?query={query} when you do not know the page.` : `- Search with ${DEFAULT_DOCS_API_ROUTE}?query={query} when the route is unknown.`);
|
|
703
|
+
}
|
|
704
|
+
function appendDocsOpenApiStartLine(lines, context, variant) {
|
|
705
|
+
if (!context.openapiConfig.enabled || !context.openapiConfig.url) return;
|
|
706
|
+
lines.push(variant === "skill" ? `- Fetch ${context.openapiConfig.url} for the machine-readable OpenAPI schema before scraping API reference pages.` : `- Fetch ${context.openapiConfig.url} before scraping API reference pages; prefer schemas over prose.`);
|
|
707
|
+
}
|
|
708
|
+
function appendDocsLlmsStartLines(lines, context, variant) {
|
|
709
|
+
if (!context.llmsEnabled) return;
|
|
710
|
+
lines.push(variant === "skill" ? `- Use ${DEFAULT_LLMS_TXT_ROUTE} for a compact docs index.` : `- Use ${DEFAULT_LLMS_TXT_ROUTE} as the compact docs map.`, variant === "skill" ? `- Use ${DEFAULT_LLMS_FULL_TXT_ROUTE} for full markdown context.` : `- Use ${DEFAULT_LLMS_FULL_TXT_ROUTE} when you need the full markdown bundle.`);
|
|
711
|
+
for (const section of context.llmsSections) lines.push(variant === "skill" ? `- Use ${section.route} for the ${section.title} llms.txt section.` : `- Use ${section.route} for the ${section.title} section map.`);
|
|
712
|
+
}
|
|
713
|
+
function appendDocsSitemapStartLines(lines, context, variant) {
|
|
714
|
+
if (!context.sitemapConfig.enabled) return;
|
|
715
|
+
if (variant === "skill") {
|
|
716
|
+
if (context.sitemapConfig.xml.enabled) lines.push(`- Use ${context.sitemapConfig.xml.route} to check canonical page freshness.`);
|
|
717
|
+
if (context.sitemapConfig.markdown.enabled) lines.push(`- Use ${context.sitemapConfig.markdown.route} for a semantic docs map.`);
|
|
718
|
+
return;
|
|
719
|
+
}
|
|
720
|
+
if (context.sitemapConfig.markdown.enabled) lines.push(`- Use ${context.sitemapConfig.markdown.route} for a semantic sitemap with sections.`);
|
|
721
|
+
if (context.sitemapConfig.xml.enabled) lines.push(`- Use ${context.sitemapConfig.xml.route} for canonical URLs and freshness metadata.`);
|
|
722
|
+
}
|
|
723
|
+
function appendDocsRobotsStartLine(lines, context, variant) {
|
|
724
|
+
if (!context.robotsEnabled) return;
|
|
725
|
+
lines.push(variant === "skill" ? `- Check ${DEFAULT_AGENT_DISCOVERY_ROBOTS_TXT_ROUTE} for crawler and AI-agent access policy.` : `- Check ${DEFAULT_AGENT_DISCOVERY_ROBOTS_TXT_ROUTE} before crawling broadly.`);
|
|
726
|
+
}
|
|
727
|
+
function appendDocsMcpStartLine(lines, context, variant) {
|
|
728
|
+
if (!context.mcpEnabled) return;
|
|
729
|
+
lines.push(variant === "skill" ? `- Use ${DEFAULT_MCP_WELL_KNOWN_ROUTE} or ${DEFAULT_MCP_PUBLIC_ROUTE} for MCP tools when your environment supports MCP.` : `- Use MCP at ${DEFAULT_MCP_PUBLIC_ROUTE} or ${DEFAULT_MCP_WELL_KNOWN_ROUTE} when your environment supports MCP tools.`);
|
|
730
|
+
}
|
|
731
|
+
function appendDocsFeedbackStartLine(lines, context, variant) {
|
|
732
|
+
if (!context.feedbackEnabled) return;
|
|
733
|
+
lines.push(variant === "skill" ? `- Read ${context.feedbackSchemaRoute} before posting agent feedback to ${context.feedbackRoute}.` : `- Read ${context.feedbackSchemaRoute} before posting feedback to ${context.feedbackRoute}.`);
|
|
734
|
+
}
|
|
735
|
+
function appendDocsAgentStartHereLines(lines, context, variant) {
|
|
736
|
+
lines.push(variant === "skill" ? `- Fetch ${DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE}; fall back to ${DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE} or ${DEFAULT_AGENT_SPEC_ROUTE}.` : `- Read ${DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE} first; fall back to ${DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE} or ${DEFAULT_AGENT_SPEC_ROUTE}.`, variant === "skill" ? `- Fetch /${context.normalizedEntry}.md for the root docs page.` : `- Read /${context.normalizedEntry}.md for the root docs page.`, variant === "skill" ? `- Fetch /${context.normalizedEntry}/{slug}.md for page-specific context.` : `- Read /${context.normalizedEntry}/{slug}.md for page-specific context.`);
|
|
737
|
+
if (variant === "skill") {
|
|
738
|
+
appendDocsMarkdownNegotiationStartLines(lines, context, variant);
|
|
739
|
+
appendDocsSearchStartLine(lines, context, variant);
|
|
740
|
+
appendDocsOpenApiStartLine(lines, context, variant);
|
|
741
|
+
appendDocsLlmsStartLines(lines, context, variant);
|
|
742
|
+
appendDocsSitemapStartLines(lines, context, variant);
|
|
743
|
+
appendDocsRobotsStartLine(lines, context, variant);
|
|
744
|
+
appendDocsMcpStartLine(lines, context, variant);
|
|
745
|
+
appendDocsFeedbackStartLine(lines, context, variant);
|
|
746
|
+
return;
|
|
747
|
+
}
|
|
748
|
+
appendDocsLlmsStartLines(lines, context, variant);
|
|
749
|
+
appendDocsSitemapStartLines(lines, context, variant);
|
|
750
|
+
appendDocsRobotsStartLine(lines, context, variant);
|
|
751
|
+
appendDocsSearchStartLine(lines, context, variant);
|
|
752
|
+
appendDocsOpenApiStartLine(lines, context, variant);
|
|
753
|
+
appendDocsMcpStartLine(lines, context, variant);
|
|
754
|
+
appendDocsFeedbackStartLine(lines, context, variant);
|
|
755
|
+
appendDocsMarkdownNegotiationStartLines(lines, context, variant);
|
|
756
|
+
}
|
|
757
|
+
function appendDocsLlmsRouteLines(lines, context) {
|
|
758
|
+
if (!context.llmsEnabled) return;
|
|
759
|
+
lines.push(`- llms.txt: ${DEFAULT_LLMS_TXT_ROUTE}`, `- llms-full.txt: ${DEFAULT_LLMS_FULL_TXT_ROUTE}`, `- llms well-known aliases: ${DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE}, ${DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE}`);
|
|
760
|
+
for (const section of context.llmsSections) {
|
|
761
|
+
lines.push(`- ${section.title} llms.txt: ${section.route}`);
|
|
762
|
+
lines.push(`- ${section.title} llms-full.txt: ${section.fullRoute}`);
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
function appendDocsOpenApiRouteLines(lines, context) {
|
|
766
|
+
if (!context.openapiConfig.enabled || !context.openapiConfig.url) return;
|
|
767
|
+
lines.push(`- OpenAPI schema: ${context.openapiConfig.url}`);
|
|
768
|
+
if (context.openapiConfig.apiReferencePath) lines.push(`- API reference: ${context.openapiConfig.apiReferencePath}`);
|
|
769
|
+
}
|
|
770
|
+
function appendDocsSitemapRouteLines(lines, context) {
|
|
771
|
+
if (!context.sitemapConfig.enabled) return;
|
|
772
|
+
if (context.sitemapConfig.xml.enabled) lines.push(`- Sitemap XML: ${context.sitemapConfig.xml.route}`);
|
|
773
|
+
if (context.sitemapConfig.markdown.enabled) lines.push(`- Sitemap Markdown: ${context.sitemapConfig.markdown.route}`, `- Sitemap well-known alias: ${context.sitemapConfig.markdown.wellKnownRoute}`);
|
|
774
|
+
}
|
|
775
|
+
function appendDocsMcpRouteLines(lines, context) {
|
|
776
|
+
if (!context.mcpEnabled) return;
|
|
777
|
+
lines.push(`- MCP: ${DEFAULT_MCP_PUBLIC_ROUTE}, ${DEFAULT_MCP_WELL_KNOWN_ROUTE}`);
|
|
778
|
+
}
|
|
779
|
+
function appendDocsAgentPublicRouteLines(lines, context, variant) {
|
|
780
|
+
if (variant === "skill") {
|
|
781
|
+
lines.push(`- Agent instructions: ${DEFAULT_AGENTS_MD_ROUTE}`, `- Agent instructions well-known alias: ${DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE}`, `- Agent instructions API format: ${DEFAULT_DOCS_API_ROUTE}?format=agents`, `- Skill document: ${DEFAULT_SKILL_MD_ROUTE}`, `- Skill well-known alias: ${DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE}`, `- Skill API format: ${DEFAULT_DOCS_API_ROUTE}?format=skill`, `- Agent discovery: ${DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE}`, `- Agent discovery fallback: ${DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE}`, `- Markdown root: /${context.normalizedEntry}.md`, `- Markdown pages: /${context.normalizedEntry}/{slug}.md`);
|
|
782
|
+
if (context.robotsEnabled) lines.push(`- Robots policy: ${DEFAULT_AGENT_DISCOVERY_ROBOTS_TXT_ROUTE}`);
|
|
783
|
+
appendDocsLlmsRouteLines(lines, context);
|
|
784
|
+
appendDocsOpenApiRouteLines(lines, context);
|
|
785
|
+
appendDocsSitemapRouteLines(lines, context);
|
|
786
|
+
appendDocsMcpRouteLines(lines, context);
|
|
787
|
+
return;
|
|
788
|
+
}
|
|
789
|
+
lines.push(`- Agent instructions: ${DEFAULT_AGENTS_MD_ROUTE}`, `- Agent instructions well-known alias: ${DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE}`, `- Agent instructions API format: ${DEFAULT_DOCS_API_ROUTE}?format=agents`, `- Agent instructions aliases: ${DEFAULT_AGENT_MD_ROUTE}, ${DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE}`, `- Site skill: ${DEFAULT_SKILL_MD_ROUTE}`, `- Site skill well-known alias: ${DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE}`, `- Site skill API format: ${DEFAULT_DOCS_API_ROUTE}?format=skill`, `- Markdown root: /${context.normalizedEntry}.md`, `- Markdown pages: /${context.normalizedEntry}/{slug}.md`, `- Agent discovery: ${DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE}`, `- Agent discovery fallback: ${DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE}`);
|
|
790
|
+
appendDocsLlmsRouteLines(lines, context);
|
|
791
|
+
if (context.robotsEnabled) lines.push(`- Robots policy: ${DEFAULT_AGENT_DISCOVERY_ROBOTS_TXT_ROUTE}`);
|
|
792
|
+
appendDocsSitemapRouteLines(lines, context);
|
|
793
|
+
appendDocsOpenApiRouteLines(lines, context);
|
|
794
|
+
appendDocsMcpRouteLines(lines, context);
|
|
795
|
+
}
|
|
660
796
|
function renderDocsMarkdownDocument(page, options) {
|
|
661
797
|
if (page.agentRawContent !== void 0) return page.agentRawContent;
|
|
662
798
|
const relatedLines = renderDocsRelatedMarkdownLines(page.related);
|
|
@@ -667,70 +803,44 @@ function renderDocsMarkdownDocument(page, options) {
|
|
|
667
803
|
lines.push("", page.agentFallbackRawContent ?? page.rawContent ?? page.content);
|
|
668
804
|
return lines.join("\n");
|
|
669
805
|
}
|
|
670
|
-
function renderDocsSkillDocument(
|
|
671
|
-
const
|
|
672
|
-
const
|
|
673
|
-
const siteDescription = llms?.siteDescription ? compactSkillText(llms.siteDescription) : void 0;
|
|
674
|
-
const llmsEnabled = llms?.enabled ?? true;
|
|
675
|
-
const searchEnabled = isSearchEnabled(search);
|
|
676
|
-
const feedbackEnabled = feedback?.enabled ?? false;
|
|
677
|
-
const sitemapConfig = resolveDocsSitemapConfig(sitemap);
|
|
678
|
-
const robotsEnabled = isRobotsDiscoveryEnabled(robots);
|
|
679
|
-
const openapiConfig = resolveDocsOpenApiDiscoveryConfig(openapi);
|
|
680
|
-
const feedbackRoute = feedback?.route ?? DEFAULT_AGENT_FEEDBACK_ROUTE;
|
|
681
|
-
const feedbackSchemaRoute = feedback?.schemaRoute ?? `${feedbackRoute}/schema`;
|
|
682
|
-
const llmsSections = resolveDocsLlmsTxtSections(llms);
|
|
683
|
-
const description = truncateSkillDescription(`Use ${siteTitle} through markdown routes, llms.txt, robots.txt, agent discovery, search, and MCP when available.`);
|
|
684
|
-
const markdownAcceptHeader = markdown?.acceptHeader === false ? null : "text/markdown";
|
|
685
|
-
const markdownSignatureAgentHeader = markdown?.signatureAgentHeader === false ? null : DOCS_MARKDOWN_SIGNATURE_AGENT_HEADER;
|
|
806
|
+
function renderDocsSkillDocument(options) {
|
|
807
|
+
const { origin } = options;
|
|
808
|
+
const context = resolveDocsAgentDocumentContext(options);
|
|
686
809
|
const lines = [
|
|
687
810
|
"---",
|
|
688
811
|
"name: docs",
|
|
689
|
-
`description: ${toYamlString(
|
|
812
|
+
`description: ${toYamlString(truncateSkillDescription(`Use ${context.siteTitle} through markdown routes, llms.txt, robots.txt, agent discovery, search, and MCP when available.`))}`,
|
|
690
813
|
"---",
|
|
691
814
|
"",
|
|
692
|
-
`# ${siteTitle} Skill`,
|
|
815
|
+
`# ${context.siteTitle} Skill`,
|
|
693
816
|
"",
|
|
694
817
|
`Base URL: ${origin}`
|
|
695
818
|
];
|
|
696
|
-
if (siteDescription) lines.push(`Description: ${siteDescription}`);
|
|
697
|
-
lines.push("", "## When To Use", "Use this skill when you need to read or implement against this documentation site.", "", "## Start Here"
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
if (openapiConfig.enabled && openapiConfig.url) lines.push(`- Fetch ${openapiConfig.url} for the machine-readable OpenAPI schema before scraping API reference pages.`);
|
|
702
|
-
if (llmsEnabled) {
|
|
703
|
-
lines.push(`- Use ${DEFAULT_LLMS_TXT_ROUTE} for a compact docs index.`, `- Use ${DEFAULT_LLMS_FULL_TXT_ROUTE} for full markdown context.`);
|
|
704
|
-
for (const section of llmsSections) lines.push(`- Use ${section.route} for the ${section.title} llms.txt section.`);
|
|
705
|
-
}
|
|
706
|
-
if (sitemapConfig.enabled) {
|
|
707
|
-
if (sitemapConfig.xml.enabled) lines.push(`- Use ${sitemapConfig.xml.route} to check canonical page freshness.`);
|
|
708
|
-
if (sitemapConfig.markdown.enabled) lines.push(`- Use ${sitemapConfig.markdown.route} for a semantic docs map.`);
|
|
709
|
-
}
|
|
710
|
-
if (robotsEnabled) lines.push(`- Check ${DEFAULT_AGENT_DISCOVERY_ROBOTS_TXT_ROUTE} for crawler and AI-agent access policy.`);
|
|
711
|
-
if (mcp.enabled) lines.push(`- Use ${DEFAULT_MCP_WELL_KNOWN_ROUTE} or ${DEFAULT_MCP_PUBLIC_ROUTE} for MCP tools when your environment supports MCP.`);
|
|
712
|
-
if (feedbackEnabled) lines.push(`- Read ${feedbackSchemaRoute} before posting agent feedback to ${feedbackRoute}.`);
|
|
713
|
-
lines.push("", "## Routes", `- Skill document: ${DEFAULT_SKILL_MD_ROUTE}`, `- Skill well-known alias: ${DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE}`, `- Skill API format: ${DEFAULT_DOCS_API_ROUTE}?format=skill`, `- Agent discovery: ${DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE}`, `- Agent discovery fallback: ${DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE}`, `- Markdown root: /${normalizedEntry}.md`, `- Markdown pages: /${normalizedEntry}/{slug}.md`);
|
|
714
|
-
if (robotsEnabled) lines.push(`- Robots policy: ${DEFAULT_AGENT_DISCOVERY_ROBOTS_TXT_ROUTE}`);
|
|
715
|
-
if (llmsEnabled) {
|
|
716
|
-
lines.push(`- llms.txt: ${DEFAULT_LLMS_TXT_ROUTE}`, `- llms-full.txt: ${DEFAULT_LLMS_FULL_TXT_ROUTE}`, `- llms well-known aliases: ${DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE}, ${DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE}`);
|
|
717
|
-
for (const section of llmsSections) {
|
|
718
|
-
lines.push(`- ${section.title} llms.txt: ${section.route}`);
|
|
719
|
-
lines.push(`- ${section.title} llms-full.txt: ${section.fullRoute}`);
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
if (openapiConfig.enabled && openapiConfig.url) {
|
|
723
|
-
lines.push(`- OpenAPI schema: ${openapiConfig.url}`);
|
|
724
|
-
if (openapiConfig.apiReferencePath) lines.push(`- API reference: ${openapiConfig.apiReferencePath}`);
|
|
725
|
-
}
|
|
726
|
-
if (sitemapConfig.enabled) {
|
|
727
|
-
if (sitemapConfig.xml.enabled) lines.push(`- Sitemap XML: ${sitemapConfig.xml.route}`);
|
|
728
|
-
if (sitemapConfig.markdown.enabled) lines.push(`- Sitemap Markdown: ${sitemapConfig.markdown.route}`, `- Sitemap well-known alias: ${sitemapConfig.markdown.wellKnownRoute}`);
|
|
729
|
-
}
|
|
730
|
-
if (mcp.enabled) lines.push(`- MCP: ${DEFAULT_MCP_PUBLIC_ROUTE}, ${DEFAULT_MCP_WELL_KNOWN_ROUTE}`);
|
|
819
|
+
if (context.siteDescription) lines.push(`Description: ${context.siteDescription}`);
|
|
820
|
+
lines.push("", "## When To Use", "Use this skill when you need to read or implement against this documentation site.", "", "## Start Here");
|
|
821
|
+
appendDocsAgentStartHereLines(lines, context, "skill");
|
|
822
|
+
lines.push("", "## Routes");
|
|
823
|
+
appendDocsAgentPublicRouteLines(lines, context, "skill");
|
|
731
824
|
lines.push("", "## Reusable Framework Skills", "For framework setup, CLI, page actions, Ask AI, or configuration work, install the reusable Farming Labs skills:", "", "```sh", "npx skills add farming-labs/docs", "```");
|
|
732
825
|
return lines.join("\n");
|
|
733
826
|
}
|
|
827
|
+
function renderDocsAgentsDocument(options) {
|
|
828
|
+
const { origin } = options;
|
|
829
|
+
const context = resolveDocsAgentDocumentContext(options);
|
|
830
|
+
const lines = [
|
|
831
|
+
"# Agent Instructions",
|
|
832
|
+
"",
|
|
833
|
+
`Site: ${context.siteTitle}`,
|
|
834
|
+
`Base URL: ${origin}`
|
|
835
|
+
];
|
|
836
|
+
if (context.siteDescription) lines.push(`Description: ${context.siteDescription}`);
|
|
837
|
+
lines.push("", "## Start Here");
|
|
838
|
+
appendDocsAgentStartHereLines(lines, context, "agents");
|
|
839
|
+
lines.push("", "## Working Rules", "- Prefer markdown routes, llms.txt, sitemap.md, OpenAPI schemas, and MCP tools over scraping rendered HTML.", "- Treat generated context files as discovery aids, then fetch the smallest page or section that answers the task.", "- Preserve canonical docs URLs when citing pages back to humans.", "- If a route returns a markdown 404, use the sitemap and discovery spec before guessing a slug.", "", "## Public Routes");
|
|
840
|
+
appendDocsAgentPublicRouteLines(lines, context, "agents");
|
|
841
|
+
lines.push("", "## Framework Maintenance", "- For @farming-labs/docs projects, keep the framework package current before debugging missing agent surfaces.", "", "```sh", "npx @farming-labs/docs@latest upgrade --latest", "```", "", "- For framework setup, configuration, CLI, Ask AI, page actions, or theme work, install the reusable Skills pack:", "", "```sh", "npx skills add farming-labs/docs", "```");
|
|
842
|
+
return lines.join("\n");
|
|
843
|
+
}
|
|
734
844
|
function resolveDocsAgentMdxContent(content, audience) {
|
|
735
845
|
const lines = content.split("\n");
|
|
736
846
|
const output = [];
|
|
@@ -810,6 +920,7 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, sear
|
|
|
810
920
|
markdownRoutes: true,
|
|
811
921
|
agentMdOverrides: true,
|
|
812
922
|
agentBlocks: true,
|
|
923
|
+
agents: true,
|
|
813
924
|
llms: llmsEnabled,
|
|
814
925
|
skills: true,
|
|
815
926
|
mcp: mcp.enabled,
|
|
@@ -830,6 +941,7 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, sear
|
|
|
830
941
|
agentSpecWellKnown: DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE,
|
|
831
942
|
agentSpecWellKnownJson: DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE,
|
|
832
943
|
agentSpecQuery: `${DEFAULT_DOCS_API_ROUTE}?agent=spec`,
|
|
944
|
+
agents: `${DEFAULT_DOCS_API_ROUTE}?format=agents`,
|
|
833
945
|
openapi: DEFAULT_OPENAPI_SCHEMA_ROUTE
|
|
834
946
|
},
|
|
835
947
|
markdown: {
|
|
@@ -914,6 +1026,15 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, sear
|
|
|
914
1026
|
queryParam: "query",
|
|
915
1027
|
localeParam: "lang"
|
|
916
1028
|
},
|
|
1029
|
+
agents: {
|
|
1030
|
+
enabled: true,
|
|
1031
|
+
file: "AGENTS.md",
|
|
1032
|
+
route: DEFAULT_AGENTS_MD_ROUTE,
|
|
1033
|
+
wellKnown: DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE,
|
|
1034
|
+
api: `${DEFAULT_DOCS_API_ROUTE}?format=agents`,
|
|
1035
|
+
generatedFallback: true,
|
|
1036
|
+
aliases: [DEFAULT_AGENT_MD_ROUTE, DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE]
|
|
1037
|
+
},
|
|
917
1038
|
skills: {
|
|
918
1039
|
enabled: true,
|
|
919
1040
|
file: "skill.md",
|
|
@@ -1017,187 +1138,4 @@ function toYamlString(value) {
|
|
|
1017
1138
|
}
|
|
1018
1139
|
|
|
1019
1140
|
//#endregion
|
|
1020
|
-
|
|
1021
|
-
const DEFAULT_ROBOTS_TXT_ROUTE = "/robots.txt";
|
|
1022
|
-
const DOCS_ROBOTS_GENERATED_BLOCK_START = "# BEGIN @farming-labs/docs robots";
|
|
1023
|
-
const DOCS_ROBOTS_GENERATED_BLOCK_END = "# END @farming-labs/docs robots";
|
|
1024
|
-
const DEFAULT_DOCS_AI_ROBOTS_USER_AGENTS = [
|
|
1025
|
-
"GPTBot",
|
|
1026
|
-
"ChatGPT-User",
|
|
1027
|
-
"OAI-SearchBot",
|
|
1028
|
-
"ClaudeBot",
|
|
1029
|
-
"Claude-User",
|
|
1030
|
-
"anthropic-ai",
|
|
1031
|
-
"CCBot",
|
|
1032
|
-
"Google-Extended"
|
|
1033
|
-
];
|
|
1034
|
-
function normalizeRoute(value) {
|
|
1035
|
-
const trimmed = value.trim();
|
|
1036
|
-
if (!trimmed) return "/";
|
|
1037
|
-
return trimmed.startsWith("/") ? trimmed.replace(/\/{2,}/g, "/") : `/${trimmed}`;
|
|
1038
|
-
}
|
|
1039
|
-
function normalizeBaseUrl(value) {
|
|
1040
|
-
if (!value) return void 0;
|
|
1041
|
-
try {
|
|
1042
|
-
const url = new URL(value);
|
|
1043
|
-
url.pathname = url.pathname.replace(/\/+$/, "");
|
|
1044
|
-
url.search = "";
|
|
1045
|
-
url.hash = "";
|
|
1046
|
-
return url.toString().replace(/\/+$/, "");
|
|
1047
|
-
} catch {
|
|
1048
|
-
return;
|
|
1049
|
-
}
|
|
1050
|
-
}
|
|
1051
|
-
function normalizeStringArray(value) {
|
|
1052
|
-
if (Array.isArray(value)) return value;
|
|
1053
|
-
return value ? [value] : [];
|
|
1054
|
-
}
|
|
1055
|
-
function normalizeAiPolicy(value) {
|
|
1056
|
-
return value === false || value === "disallow" ? "disallow" : "allow";
|
|
1057
|
-
}
|
|
1058
|
-
function unique(values) {
|
|
1059
|
-
return [...new Set(values.filter(Boolean))];
|
|
1060
|
-
}
|
|
1061
|
-
function resolveDocsRobotsConfig(input, options = {}) {
|
|
1062
|
-
if (input === false) return {
|
|
1063
|
-
enabled: false,
|
|
1064
|
-
ai: "allow",
|
|
1065
|
-
userAgents: [...DEFAULT_DOCS_AI_ROBOTS_USER_AGENTS],
|
|
1066
|
-
extraRules: []
|
|
1067
|
-
};
|
|
1068
|
-
const config = typeof input === "object" ? input : {};
|
|
1069
|
-
return {
|
|
1070
|
-
enabled: config.enabled ?? true,
|
|
1071
|
-
path: config.path,
|
|
1072
|
-
baseUrl: normalizeBaseUrl(config.baseUrl) ?? normalizeBaseUrl(options.baseUrl),
|
|
1073
|
-
ai: normalizeAiPolicy(config.ai),
|
|
1074
|
-
userAgents: unique([...DEFAULT_DOCS_AI_ROBOTS_USER_AGENTS, ...normalizeStringArray(config.aiUserAgents)]),
|
|
1075
|
-
extraRules: config.extraRules ?? []
|
|
1076
|
-
};
|
|
1077
|
-
}
|
|
1078
|
-
function getDocsRobotsAllowRoutes(options = {}) {
|
|
1079
|
-
const normalizedEntry = normalizeDocsPathSegment(options.entry ?? "docs") || "docs";
|
|
1080
|
-
const sitemapConfig = resolveDocsSitemapConfig(options.sitemap);
|
|
1081
|
-
const routes = [
|
|
1082
|
-
"/",
|
|
1083
|
-
`/${normalizedEntry}`,
|
|
1084
|
-
`/${normalizedEntry}/`,
|
|
1085
|
-
`/${normalizedEntry}.md`,
|
|
1086
|
-
`/${normalizedEntry}/*.md`,
|
|
1087
|
-
DEFAULT_LLMS_TXT_ROUTE,
|
|
1088
|
-
DEFAULT_LLMS_FULL_TXT_ROUTE,
|
|
1089
|
-
DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE,
|
|
1090
|
-
DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE,
|
|
1091
|
-
DEFAULT_SKILL_MD_ROUTE,
|
|
1092
|
-
DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE,
|
|
1093
|
-
DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE,
|
|
1094
|
-
DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE,
|
|
1095
|
-
DEFAULT_MCP_PUBLIC_ROUTE,
|
|
1096
|
-
DEFAULT_MCP_WELL_KNOWN_ROUTE
|
|
1097
|
-
];
|
|
1098
|
-
if (sitemapConfig.enabled) {
|
|
1099
|
-
if (sitemapConfig.xml.enabled) routes.push(sitemapConfig.xml.route);
|
|
1100
|
-
if (sitemapConfig.markdown.enabled) routes.push(sitemapConfig.markdown.route, sitemapConfig.markdown.wellKnownRoute);
|
|
1101
|
-
}
|
|
1102
|
-
return unique(routes.map(normalizeRoute));
|
|
1103
|
-
}
|
|
1104
|
-
function sitemapUrls(robots, sitemap) {
|
|
1105
|
-
const sitemapConfig = resolveDocsSitemapConfig(sitemap, { baseUrl: robots.baseUrl });
|
|
1106
|
-
if (!robots.baseUrl || !sitemapConfig.enabled || !sitemapConfig.xml.enabled) return [];
|
|
1107
|
-
try {
|
|
1108
|
-
return [new URL(sitemapConfig.xml.route, `${robots.baseUrl}/`).toString()];
|
|
1109
|
-
} catch {
|
|
1110
|
-
return [];
|
|
1111
|
-
}
|
|
1112
|
-
}
|
|
1113
|
-
function appendRule(lines, rule) {
|
|
1114
|
-
const userAgents = normalizeStringArray(rule.userAgent);
|
|
1115
|
-
if (userAgents.length === 0) return;
|
|
1116
|
-
lines.push("");
|
|
1117
|
-
for (const userAgent of userAgents) lines.push(`User-agent: ${userAgent}`);
|
|
1118
|
-
for (const route of normalizeStringArray(rule.allow)) lines.push(`Allow: ${normalizeRoute(route)}`);
|
|
1119
|
-
for (const route of normalizeStringArray(rule.disallow)) lines.push(`Disallow: ${normalizeRoute(route)}`);
|
|
1120
|
-
if (typeof rule.crawlDelay === "number" && Number.isFinite(rule.crawlDelay)) lines.push(`Crawl-delay: ${rule.crawlDelay}`);
|
|
1121
|
-
}
|
|
1122
|
-
function renderDocsRobotsTxt(options = {}) {
|
|
1123
|
-
const robots = resolveDocsRobotsConfig(options.robots, { baseUrl: options.baseUrl });
|
|
1124
|
-
if (!robots.enabled) return "";
|
|
1125
|
-
const lines = [
|
|
1126
|
-
"# Generated by @farming-labs/docs.",
|
|
1127
|
-
"# Edit docs.config or rerun `docs robots generate --append` / `--force`.",
|
|
1128
|
-
"",
|
|
1129
|
-
"User-agent: *"
|
|
1130
|
-
];
|
|
1131
|
-
for (const route of getDocsRobotsAllowRoutes(options)) lines.push(`Allow: ${route}`);
|
|
1132
|
-
for (const userAgent of robots.userAgents) {
|
|
1133
|
-
lines.push("", `User-agent: ${userAgent}`);
|
|
1134
|
-
lines.push(robots.ai === "allow" ? "Allow: /" : "Disallow: /");
|
|
1135
|
-
}
|
|
1136
|
-
for (const rule of robots.extraRules) appendRule(lines, rule);
|
|
1137
|
-
const sitemap = sitemapUrls(robots, options.sitemap);
|
|
1138
|
-
if (sitemap.length > 0) {
|
|
1139
|
-
lines.push("");
|
|
1140
|
-
for (const url of sitemap) lines.push(`Sitemap: ${url}`);
|
|
1141
|
-
}
|
|
1142
|
-
return `${lines.join("\n")}\n`;
|
|
1143
|
-
}
|
|
1144
|
-
function resolveDocsRobotsRequest(url, robots) {
|
|
1145
|
-
const pathname = normalizeRoute(url.pathname);
|
|
1146
|
-
const format = url.searchParams.get("format")?.trim();
|
|
1147
|
-
if (pathname === "/api/docs" && format === "robots") return "robots";
|
|
1148
|
-
if (!resolveDocsRobotsConfig(robots).enabled) return null;
|
|
1149
|
-
return pathname === DEFAULT_ROBOTS_TXT_ROUTE ? "robots" : null;
|
|
1150
|
-
}
|
|
1151
|
-
function createDocsRobotsResponse({ request, ...options }) {
|
|
1152
|
-
const url = new URL(request.url);
|
|
1153
|
-
if (!resolveDocsRobotsRequest(url, options.robots)) return null;
|
|
1154
|
-
const content = renderDocsRobotsTxt({
|
|
1155
|
-
...options,
|
|
1156
|
-
baseUrl: options.baseUrl ?? url.origin
|
|
1157
|
-
});
|
|
1158
|
-
if (!content) return null;
|
|
1159
|
-
return new Response(content, { headers: {
|
|
1160
|
-
"Content-Type": "text/plain; charset=utf-8",
|
|
1161
|
-
"Cache-Control": "public, max-age=0, s-maxage=3600"
|
|
1162
|
-
} });
|
|
1163
|
-
}
|
|
1164
|
-
function renderDocsRobotsGeneratedBlock(options = {}) {
|
|
1165
|
-
return `${DOCS_ROBOTS_GENERATED_BLOCK_START}\n${renderDocsRobotsTxt(options).trimEnd()}\n${DOCS_ROBOTS_GENERATED_BLOCK_END}\n`;
|
|
1166
|
-
}
|
|
1167
|
-
function upsertDocsRobotsGeneratedBlock(existing, block) {
|
|
1168
|
-
const escapedStart = DOCS_ROBOTS_GENERATED_BLOCK_START.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1169
|
-
const escapedEnd = DOCS_ROBOTS_GENERATED_BLOCK_END.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1170
|
-
const pattern = new RegExp(`${escapedStart}[\\s\\S]*?${escapedEnd}\\n?`);
|
|
1171
|
-
if (pattern.test(existing)) return existing.replace(pattern, block);
|
|
1172
|
-
const prefix = existing.trimEnd();
|
|
1173
|
-
return `${prefix}${prefix ? "\n\n" : ""}${block}`;
|
|
1174
|
-
}
|
|
1175
|
-
function blockForUserAgent(content, userAgent) {
|
|
1176
|
-
const escaped = userAgent.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1177
|
-
return content.match(new RegExp(`(?:^|\\n)\\s*User-agent:\\s*${escaped}\\s*(?:\\n[ \\t]*(?!User-agent:).*)*`, "i"))?.[0] ?? "";
|
|
1178
|
-
}
|
|
1179
|
-
function disallowsRoute(content, route) {
|
|
1180
|
-
const escapedRoute = route.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1181
|
-
return new RegExp(`^\\s*Disallow:\\s*${escapedRoute}(?:\\s|$)`, "im").test(content);
|
|
1182
|
-
}
|
|
1183
|
-
function analyzeDocsRobotsTxt(content, options = {}) {
|
|
1184
|
-
const expectedRoutes = getDocsRobotsAllowRoutes(options).filter((route) => [
|
|
1185
|
-
DEFAULT_LLMS_TXT_ROUTE,
|
|
1186
|
-
DEFAULT_LLMS_FULL_TXT_ROUTE,
|
|
1187
|
-
DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE,
|
|
1188
|
-
DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE,
|
|
1189
|
-
DEFAULT_SKILL_MD_ROUTE,
|
|
1190
|
-
DEFAULT_MCP_PUBLIC_ROUTE
|
|
1191
|
-
].includes(route) || route.includes("sitemap"));
|
|
1192
|
-
const missingRoutes = expectedRoutes.filter((route) => !content.includes(route));
|
|
1193
|
-
return {
|
|
1194
|
-
blocksAgentRoutes: /Disallow:\s*\/(?:\s|$)/i.test(blockForUserAgent(content, "*")) || expectedRoutes.some((route) => disallowsRoute(content, route)),
|
|
1195
|
-
blocksAiAgents: DEFAULT_DOCS_AI_ROBOTS_USER_AGENTS.some((userAgent) => /Disallow:\s*\/(?:\s|$)/i.test(blockForUserAgent(content, userAgent))),
|
|
1196
|
-
hasAgentRoutes: missingRoutes.length === 0,
|
|
1197
|
-
hasAiPolicy: DEFAULT_DOCS_AI_ROBOTS_USER_AGENTS.some((userAgent) => content.includes(userAgent)),
|
|
1198
|
-
missingRoutes
|
|
1199
|
-
};
|
|
1200
|
-
}
|
|
1201
|
-
|
|
1202
|
-
//#endregion
|
|
1203
|
-
export { resolveDocsAgentFeedbackRequest as $, DOCS_MARKDOWN_SIGNATURE_AGENT_HEADER as A, isDocsLlmsTxtPublicRequest as B, DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE as C, DEFAULT_OPENAPI_SCHEMA_ROUTE as D, DEFAULT_MCP_WELL_KNOWN_ROUTE as E, getDocsLlmsTxtMaxCharsIssue as F, normalizeDocsPathSegment as G, isDocsPublicGetRequest as H, getDocsMarkdownCanonicalLinkHeader as I, renderDocsLlmsTxt as J, normalizeDocsUrlPath as K, getDocsMarkdownVaryHeader as L, buildDocsAgentFeedbackSchema as M, buildDocsMcpEndpointCandidates as N, DEFAULT_SKILL_MD_ROUTE as O, findDocsMarkdownPage as P, resolveDocsAgentFeedbackConfig as Q, hasDocsMarkdownSignatureAgent as R, DEFAULT_LLMS_TXT_ROUTE as S, DEFAULT_MCP_ROUTE as T, isDocsSkillRequest as U, isDocsMcpRequest as V, matchesDocsLlmsTxtSection as W, renderDocsMarkdownNotFound as X, renderDocsMarkdownDocument as Y, renderDocsSkillDocument as Z, DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE as _, analyzeDocsRobotsTxt as a, resolveDocsMarkdownRequest as at, DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE as b, renderDocsRobotsGeneratedBlock as c, selectDocsLlmsTxtContent as ct, resolveDocsRobotsRequest as d, resolveDocsAgentMdxContent as et, upsertDocsRobotsGeneratedBlock as f, DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE as g, DEFAULT_AGENT_SPEC_ROUTE as h, DOCS_ROBOTS_GENERATED_BLOCK_START as i, resolveDocsMarkdownCanonicalUrl as it, buildDocsAgentDiscoverySpec as j, DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE as k, renderDocsRobotsTxt as l, toDocsMarkdownUrl as lt, DEFAULT_AGENT_FEEDBACK_ROUTE as m, DEFAULT_ROBOTS_TXT_ROUTE as n, resolveDocsLlmsTxtRequest as nt, createDocsRobotsResponse as o, resolveDocsOpenApiDiscoveryConfig as ot, DEFAULT_AGENT_FEEDBACK_PAYLOAD_SCHEMA as p, parseDocsAgentFeedbackData as q, DOCS_ROBOTS_GENERATED_BLOCK_END as r, resolveDocsLlmsTxtSections as rt, getDocsRobotsAllowRoutes as s, resolveDocsSkillFormat as st, DEFAULT_DOCS_AI_ROBOTS_USER_AGENTS as t, resolveDocsLlmsTxtFormat as tt, resolveDocsRobotsConfig as u, validateDocsAgentFeedbackPayload as ut, DEFAULT_DOCS_API_ROUTE as v, DEFAULT_MCP_PUBLIC_ROUTE as w, DEFAULT_LLMS_TXT_MAX_CHARS as x, DEFAULT_LLMS_FULL_TXT_ROUTE as y, isDocsAgentDiscoveryRequest as z };
|
|
1141
|
+
export { resolveDocsMarkdownCanonicalUrl as $, hasDocsMarkdownSignatureAgent as A, parseDocsAgentFeedbackData as B, buildDocsAgentDiscoverySpec as C, getDocsLlmsTxtMaxCharsIssue as D, findDocsMarkdownPage as E, isDocsPublicGetRequest as F, renderDocsSkillDocument as G, renderDocsLlmsTxt as H, isDocsSkillRequest as I, resolveDocsAgentMdxContent as J, resolveDocsAgentFeedbackConfig as K, matchesDocsLlmsTxtSection as L, isDocsAgentsRequest as M, isDocsLlmsTxtPublicRequest as N, getDocsMarkdownCanonicalLinkHeader as O, isDocsMcpRequest as P, resolveDocsLlmsTxtSections as Q, normalizeDocsPathSegment as R, DOCS_MARKDOWN_SIGNATURE_AGENT_HEADER as S, buildDocsMcpEndpointCandidates as T, renderDocsMarkdownDocument as U, renderDocsAgentsDocument as V, renderDocsMarkdownNotFound as W, resolveDocsLlmsTxtFormat as X, resolveDocsAgentsFormat as Y, resolveDocsLlmsTxtRequest as Z, DEFAULT_MCP_ROUTE as _, DEFAULT_AGENT_MD_ROUTE as a, validateDocsAgentFeedbackPayload as at, DEFAULT_SKILL_MD_ROUTE as b, DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE as c, DEFAULT_LLMS_FULL_TXT_ROUTE as d, resolveDocsMarkdownRequest as et, DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE as f, DEFAULT_MCP_PUBLIC_ROUTE as g, DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE as h, DEFAULT_AGENT_FEEDBACK_ROUTE as i, toDocsMarkdownUrl as it, isDocsAgentDiscoveryRequest as j, getDocsMarkdownVaryHeader as k, DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE as l, DEFAULT_LLMS_TXT_ROUTE as m, DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE as n, resolveDocsSkillFormat as nt, DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE as o, DEFAULT_LLMS_TXT_MAX_CHARS as p, resolveDocsAgentFeedbackRequest as q, DEFAULT_AGENT_FEEDBACK_PAYLOAD_SCHEMA as r, selectDocsLlmsTxtContent as rt, DEFAULT_AGENT_SPEC_ROUTE as s, DEFAULT_AGENTS_MD_ROUTE as t, resolveDocsOpenApiDiscoveryConfig as tt, DEFAULT_DOCS_API_ROUTE as u, DEFAULT_MCP_WELL_KNOWN_ROUTE as v, buildDocsAgentFeedbackSchema as w, DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE as x, DEFAULT_OPENAPI_SCHEMA_ROUTE as y, normalizeDocsUrlPath as z };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "./reading-time-CbbHNg9V.mjs";
|
|
2
|
+
import "./search-BL7o2rXk.mjs";
|
|
3
|
+
import "./agent-BK7q65dn.mjs";
|
|
4
|
+
import "./robots-DDrj6Cpo.mjs";
|
|
5
|
+
import "./sitemap-server-DJvxOqX2.mjs";
|
|
6
|
+
import "./config-Cio3byUJ.mjs";
|
|
7
|
+
import { a as readPageTokenBudget, i as printAgentCompactHelp, n as inspectAgentCompactionState, o as scanDocsPageTargets, r as parseAgentCompactArgs, t as compactAgentDocs } from "./agents-B04j1KsE.mjs";
|
|
8
|
+
|
|
9
|
+
export { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp };
|