@farming-labs/docs 0.2.58 → 0.2.59
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-CxDzPqtl.mjs → agent-BFqyqEnC.mjs} +557 -71
- package/dist/{agent-BFtIbSyJ.mjs → agent-DlxriaTs.mjs} +2 -2
- package/dist/{agent-evals-BW0vEc-F.mjs → agent-evals-kJs2Y9xR.mjs} +1 -1
- package/dist/{agent-export-vsdq0Huq.mjs → agent-export-BgUaiW8f.mjs} +17 -7
- package/dist/{agents-ChKj-VYw.mjs → agents-Djh-HXih.mjs} +12 -4
- package/dist/cli/index.mjs +14 -14
- package/dist/client/react.d.mts +1 -1
- package/dist/{cloud-ask-ai-a5Juvlvh.d.mts → cloud-ask-ai-B2WnG4fF.d.mts} +1 -1
- package/dist/docs-cloud-server.d.mts +2 -2
- package/dist/{doctor-H8gilyTg.mjs → doctor-CO1VMcF_.mjs} +181 -17
- package/dist/{golden-evaluations-BiUg5Xe_.mjs → golden-evaluations-BN9u2wxw.mjs} +1 -1
- package/dist/index.d.mts +98 -20
- package/dist/index.mjs +6 -6
- package/dist/{mcp-CiNww-Wu.mjs → mcp-BAJr3wC2.mjs} +4 -4
- package/dist/mcp.d.mts +1 -1
- package/dist/mcp.mjs +2 -2
- package/dist/{metadata-3ljRN9MM.mjs → metadata-BDuewuzq.mjs} +1 -1
- package/dist/{reading-time-EaVom2cl.mjs → reading-time-BkEft6SD.mjs} +307 -18
- package/dist/{review-BEgX7ey7.mjs → review-NC-sOdXn.mjs} +20 -9
- package/dist/{robots-CFlsfYdA.mjs → robots-DskPvGPw.mjs} +2 -2
- package/dist/{robots-DRpoiYAV.mjs → robots-ltltiLJF.mjs} +4 -1
- package/dist/{search-BblemZl4.d.mts → search-C1JitPwi.d.mts} +129 -4
- package/dist/{search-Bo9ubPVO.mjs → search-D57JXQLj.mjs} +1 -1
- package/dist/{search-CoajN9X1.mjs → search-o4Ud6OXv.mjs} +4 -4
- package/dist/server.d.mts +4 -3
- package/dist/server.mjs +4 -4
- package/dist/{sitemap-D_aXWPdJ.mjs → sitemap-Cq-Yj_iA.mjs} +4 -4
- package/dist/{sitemap-server-BYwE0zXs.mjs → sitemap-server-C1ibVKOy.mjs} +2 -1
- package/dist/{types-C1nPRXqo.d.mts → types-XHABMh_f.d.mts} +6 -0
- package/package.json +1 -1
|
@@ -637,6 +637,325 @@ function normalizeInlineText(value) {
|
|
|
637
637
|
return value.replace(/\s+/g, " ").trim();
|
|
638
638
|
}
|
|
639
639
|
|
|
640
|
+
//#endregion
|
|
641
|
+
//#region src/standards-discovery.ts
|
|
642
|
+
const DEFAULT_API_CATALOG_ROUTE = "/.well-known/api-catalog";
|
|
643
|
+
const DEFAULT_API_CATALOG_FORMAT = "api-catalog";
|
|
644
|
+
const API_CATALOG_PROFILE_URI = "https://www.rfc-editor.org/info/rfc9727";
|
|
645
|
+
const API_CATALOG_MEDIA_TYPE = "application/linkset+json";
|
|
646
|
+
const DEFAULT_AGENT_SKILLS_INDEX_ROUTE = "/.well-known/agent-skills/index.json";
|
|
647
|
+
const DEFAULT_AGENT_SKILLS_ROUTE_PREFIX = "/.well-known/agent-skills";
|
|
648
|
+
const DEFAULT_AGENT_SKILLS_ROUTE_PATTERN = `${DEFAULT_AGENT_SKILLS_ROUTE_PREFIX}/{name}/SKILL.md`;
|
|
649
|
+
const DEFAULT_AGENT_SKILLS_INDEX_FORMAT = "agent-skills";
|
|
650
|
+
const DEFAULT_AGENT_SKILL_FORMAT = "agent-skill";
|
|
651
|
+
const AGENT_SKILLS_DISCOVERY_SCHEMA_URI = "https://schemas.agentskills.io/discovery/0.2.0/schema.json";
|
|
652
|
+
const DEFAULT_DOCS_API_ROUTE$1 = "/api/docs";
|
|
653
|
+
const DEFAULT_AGENT_MANIFEST_ROUTE = "/.well-known/agent.json";
|
|
654
|
+
const AGENT_SKILL_NAME_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
655
|
+
const AGENT_SKILL_NAME_MAX_LENGTH = 64;
|
|
656
|
+
const AGENT_SKILL_DESCRIPTION_MAX_LENGTH = 1024;
|
|
657
|
+
const DISCOVERY_CACHE_CONTROL = "public, max-age=0, s-maxage=3600";
|
|
658
|
+
function normalizeDocsRoute(value) {
|
|
659
|
+
const normalized = `/${value.trim()}`.replace(/\/{2,}/g, "/");
|
|
660
|
+
return normalized === "/" ? normalized : normalized.replace(/\/+$/, "");
|
|
661
|
+
}
|
|
662
|
+
/** Resolve the same-origin Docs API pathname used by query-form discovery routes. */
|
|
663
|
+
function resolveDocsDiscoveryApiRoute(apiRoute) {
|
|
664
|
+
const candidate = apiRoute?.trim().split(/[?#]/, 1)[0];
|
|
665
|
+
return normalizeDocsRoute(candidate || DEFAULT_DOCS_API_ROUTE$1);
|
|
666
|
+
}
|
|
667
|
+
function resolveHttpUrl(value, origin) {
|
|
668
|
+
if (!value) return null;
|
|
669
|
+
try {
|
|
670
|
+
const base = new URL(origin);
|
|
671
|
+
const resolved = new URL(value, `${base.origin}/`);
|
|
672
|
+
if (resolved.protocol !== "http:" && resolved.protocol !== "https:") return null;
|
|
673
|
+
return resolved.toString();
|
|
674
|
+
} catch {
|
|
675
|
+
return null;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
function compactUniqueTargets(targets) {
|
|
679
|
+
const seen = /* @__PURE__ */ new Set();
|
|
680
|
+
return targets.filter((target) => {
|
|
681
|
+
if (!target) return false;
|
|
682
|
+
const key = `${target.href}\u0000${target.type ?? ""}\u0000${target.title ?? ""}`;
|
|
683
|
+
if (seen.has(key)) return false;
|
|
684
|
+
seen.add(key);
|
|
685
|
+
return true;
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
function toTarget(route, origin, type, title) {
|
|
689
|
+
const href = resolveHttpUrl(route, origin);
|
|
690
|
+
return href ? {
|
|
691
|
+
href,
|
|
692
|
+
...type ? { type } : {},
|
|
693
|
+
...title ? { title } : {}
|
|
694
|
+
} : null;
|
|
695
|
+
}
|
|
696
|
+
/** Build an RFC 9727 API Catalog using the RFC 9264 JSON Linkset representation. */
|
|
697
|
+
function buildDocsApiCatalog(options) {
|
|
698
|
+
const catalogUrl = resolveHttpUrl(DEFAULT_API_CATALOG_ROUTE, options.origin);
|
|
699
|
+
if (!catalogUrl) throw new Error(`Invalid HTTP(S) docs origin for API catalog: ${options.origin}`);
|
|
700
|
+
const apiRoute = options.apiRoute === null ? null : resolveDocsDiscoveryApiRoute(options.apiRoute);
|
|
701
|
+
const agentManifestRoute = options.agentManifestRoute === void 0 ? DEFAULT_AGENT_MANIFEST_ROUTE : options.agentManifestRoute;
|
|
702
|
+
const agentSkillsIndexRoute = options.agentSkillsIndexRoute === void 0 ? DEFAULT_AGENT_SKILLS_INDEX_ROUTE : options.agentSkillsIndexRoute;
|
|
703
|
+
const apiTargets = compactUniqueTargets([
|
|
704
|
+
toTarget(apiRoute, options.origin, "application/json", "Documentation API"),
|
|
705
|
+
...(options.apiRoutes ?? []).map((target) => toTarget(target.route, options.origin, target.type, target.title)),
|
|
706
|
+
toTarget(options.mcpRoute, options.origin, "application/json", "Documentation MCP endpoint"),
|
|
707
|
+
...(options.feedbackRoutes ?? []).map((route, index) => toTarget(route, options.origin, index === 0 ? "application/json" : "application/schema+json", index === 0 ? "Agent feedback endpoint" : "Agent feedback schema"))
|
|
708
|
+
]);
|
|
709
|
+
const serviceDocs = compactUniqueTargets([
|
|
710
|
+
toTarget(options.docsRoute ?? "/docs", options.origin, "text/html", "Documentation"),
|
|
711
|
+
toTarget(options.markdownRootRoute, options.origin, "text/markdown", "Documentation Markdown"),
|
|
712
|
+
toTarget(options.agentsRoute, options.origin, "text/markdown", "Agent instructions"),
|
|
713
|
+
toTarget(options.skillRoute, options.origin, "text/markdown", "Site skill"),
|
|
714
|
+
...(options.llmsRoutes ?? []).map((route) => toTarget(route, options.origin, "text/plain", "LLM documentation index")),
|
|
715
|
+
...(options.sitemapRoutes ?? []).map((route) => toTarget(route, options.origin, route.endsWith(".xml") ? "application/xml" : "text/markdown", "Documentation sitemap")),
|
|
716
|
+
toTarget(options.apiReferenceRoute, options.origin, "text/html", "API reference")
|
|
717
|
+
]);
|
|
718
|
+
const serviceMetadata = compactUniqueTargets([
|
|
719
|
+
toTarget(agentManifestRoute, options.origin, "application/json", "Agent discovery manifest"),
|
|
720
|
+
toTarget(agentSkillsIndexRoute, options.origin, "application/json", "Agent Skills discovery index"),
|
|
721
|
+
toTarget(options.configRoute, options.origin, "application/json", "Docs configuration map"),
|
|
722
|
+
toTarget(options.diagnosticsRoute, options.origin, "application/json", "Docs diagnostics"),
|
|
723
|
+
toTarget(options.robotsRoute, options.origin, "text/plain", "Robots policy")
|
|
724
|
+
]);
|
|
725
|
+
const serviceDescriptions = compactUniqueTargets([toTarget(options.openapiRoute, options.origin, "application/vnd.oai.openapi+json;version=3.1", "OpenAPI schema")]);
|
|
726
|
+
const catalogContext = {
|
|
727
|
+
anchor: catalogUrl,
|
|
728
|
+
"api-catalog": [{
|
|
729
|
+
href: catalogUrl,
|
|
730
|
+
type: API_CATALOG_MEDIA_TYPE,
|
|
731
|
+
title: "API catalog"
|
|
732
|
+
}]
|
|
733
|
+
};
|
|
734
|
+
if (apiTargets.length > 0) catalogContext.item = apiTargets;
|
|
735
|
+
if (serviceDocs.length > 0) catalogContext["service-doc"] = serviceDocs;
|
|
736
|
+
if (serviceMetadata.length > 0) catalogContext["service-meta"] = serviceMetadata;
|
|
737
|
+
if (serviceDescriptions.length > 0) catalogContext["service-desc"] = serviceDescriptions;
|
|
738
|
+
const linkset = [catalogContext];
|
|
739
|
+
for (const target of apiTargets) {
|
|
740
|
+
const context = { anchor: target.href };
|
|
741
|
+
if (serviceDocs.length > 0) context["service-doc"] = serviceDocs;
|
|
742
|
+
if (serviceMetadata.length > 0) context["service-meta"] = serviceMetadata;
|
|
743
|
+
if (serviceDescriptions.length > 0 && target.href === resolveHttpUrl(apiRoute, options.origin)) context["service-desc"] = serviceDescriptions;
|
|
744
|
+
linkset.push(context);
|
|
745
|
+
}
|
|
746
|
+
return { linkset };
|
|
747
|
+
}
|
|
748
|
+
function unquoteFrontmatterScalar(value) {
|
|
749
|
+
const trimmed = value.trim();
|
|
750
|
+
if (!trimmed || trimmed === ">" || trimmed === "|" || trimmed.startsWith("[") || trimmed.startsWith("{")) return null;
|
|
751
|
+
if (trimmed.startsWith("\"") && trimmed.endsWith("\"")) try {
|
|
752
|
+
const parsed = JSON.parse(trimmed);
|
|
753
|
+
return typeof parsed === "string" ? parsed.trim() : null;
|
|
754
|
+
} catch {
|
|
755
|
+
return null;
|
|
756
|
+
}
|
|
757
|
+
if (trimmed.startsWith("'") && trimmed.endsWith("'")) return trimmed.slice(1, -1).replace(/''/g, "'").trim();
|
|
758
|
+
return trimmed.replace(/\s+#.*$/, "").trim();
|
|
759
|
+
}
|
|
760
|
+
function readAgentSkillFrontmatter(document) {
|
|
761
|
+
const match = (document.startsWith("") ? document.slice(1) : document).match(/^---[\t ]*\r?\n([\s\S]*?)\r?\n---(?:[\t ]*\r?\n|$)/);
|
|
762
|
+
if (!match) return null;
|
|
763
|
+
const values = /* @__PURE__ */ new Map();
|
|
764
|
+
for (const line of match[1].split(/\r?\n/)) {
|
|
765
|
+
const field = line.match(/^([A-Za-z][A-Za-z0-9_-]*):\s*(.*?)\s*$/);
|
|
766
|
+
if (!field) continue;
|
|
767
|
+
const value = unquoteFrontmatterScalar(field[2]);
|
|
768
|
+
if (value !== null) values.set(field[1], value);
|
|
769
|
+
}
|
|
770
|
+
const name = values.get("name") ?? "";
|
|
771
|
+
const description = values.get("description") ?? "";
|
|
772
|
+
if (!name || name.length > AGENT_SKILL_NAME_MAX_LENGTH || !AGENT_SKILL_NAME_PATTERN.test(name) || !description || description.length > AGENT_SKILL_DESCRIPTION_MAX_LENGTH) return null;
|
|
773
|
+
return {
|
|
774
|
+
name,
|
|
775
|
+
description
|
|
776
|
+
};
|
|
777
|
+
}
|
|
778
|
+
async function sha256DocsDiscoveryContent(content) {
|
|
779
|
+
const subtle = globalThis.crypto?.subtle;
|
|
780
|
+
if (!subtle) throw new Error("Web Crypto SHA-256 support is required for Agent Skills discovery.");
|
|
781
|
+
const digest = await subtle.digest("SHA-256", new TextEncoder().encode(content));
|
|
782
|
+
return [...new Uint8Array(digest)].map((value) => value.toString(16).padStart(2, "0")).join("");
|
|
783
|
+
}
|
|
784
|
+
/** Select a valid public skill and hash the exact bytes returned by its standards route. */
|
|
785
|
+
async function resolveDocsPublishedAgentSkill({ preferredDocument, fallbackDocument }) {
|
|
786
|
+
const preferredMetadata = preferredDocument ? readAgentSkillFrontmatter(preferredDocument) : null;
|
|
787
|
+
const fallbackMetadata = readAgentSkillFrontmatter(fallbackDocument);
|
|
788
|
+
const content = preferredMetadata ? preferredDocument : fallbackDocument;
|
|
789
|
+
const metadata = preferredMetadata ?? fallbackMetadata;
|
|
790
|
+
if (!metadata) throw new Error("The generated Agent Skills fallback must contain valid name and description frontmatter.");
|
|
791
|
+
const sha256 = await sha256DocsDiscoveryContent(content);
|
|
792
|
+
return {
|
|
793
|
+
name: metadata.name,
|
|
794
|
+
type: "skill-md",
|
|
795
|
+
description: metadata.description,
|
|
796
|
+
url: `${DEFAULT_AGENT_SKILLS_ROUTE_PREFIX}/${metadata.name}/SKILL.md`,
|
|
797
|
+
digest: `sha256:${sha256}`,
|
|
798
|
+
content,
|
|
799
|
+
sha256
|
|
800
|
+
};
|
|
801
|
+
}
|
|
802
|
+
function buildDocsAgentSkillsIndex(skills) {
|
|
803
|
+
return {
|
|
804
|
+
$schema: AGENT_SKILLS_DISCOVERY_SCHEMA_URI,
|
|
805
|
+
skills: (Array.isArray(skills) ? skills : [skills]).map(({ name, type, description, url, digest }) => ({
|
|
806
|
+
name,
|
|
807
|
+
type,
|
|
808
|
+
description,
|
|
809
|
+
url,
|
|
810
|
+
digest
|
|
811
|
+
})).sort((left, right) => left.name.localeCompare(right.name))
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
function resolveDocsStandardsDiscoveryRequest(url, options = {}) {
|
|
815
|
+
const pathname = normalizeDocsRoute(url.pathname);
|
|
816
|
+
if (pathname === DEFAULT_API_CATALOG_ROUTE) return { kind: "api-catalog" };
|
|
817
|
+
if (pathname === DEFAULT_AGENT_SKILLS_INDEX_ROUTE) return { kind: "agent-skills-index" };
|
|
818
|
+
const artifactMatch = pathname.match(/^\/\.well-known\/agent-skills\/([^/]+)\/SKILL\.md$/);
|
|
819
|
+
if (artifactMatch) try {
|
|
820
|
+
return {
|
|
821
|
+
kind: "agent-skill",
|
|
822
|
+
name: decodeURIComponent(artifactMatch[1])
|
|
823
|
+
};
|
|
824
|
+
} catch {
|
|
825
|
+
return {
|
|
826
|
+
kind: "agent-skill",
|
|
827
|
+
name: ""
|
|
828
|
+
};
|
|
829
|
+
}
|
|
830
|
+
if (pathname !== resolveDocsDiscoveryApiRoute(options.apiRoute)) return null;
|
|
831
|
+
const format = url.searchParams.get("format")?.trim();
|
|
832
|
+
if (format === DEFAULT_API_CATALOG_FORMAT) return { kind: "api-catalog" };
|
|
833
|
+
if (format === DEFAULT_AGENT_SKILLS_INDEX_FORMAT) return { kind: "agent-skills-index" };
|
|
834
|
+
if (format === DEFAULT_AGENT_SKILL_FORMAT) return {
|
|
835
|
+
kind: "agent-skill",
|
|
836
|
+
name: url.searchParams.get("name")?.trim() ?? ""
|
|
837
|
+
};
|
|
838
|
+
return null;
|
|
839
|
+
}
|
|
840
|
+
function isDocsStandardsDiscoveryRequest(url, options = {}) {
|
|
841
|
+
return resolveDocsStandardsDiscoveryRequest(url, options) !== null;
|
|
842
|
+
}
|
|
843
|
+
function formatLinkTarget(href, relation, options = {}) {
|
|
844
|
+
return [
|
|
845
|
+
`<${href}>`,
|
|
846
|
+
`rel="${relation}"`,
|
|
847
|
+
...options.type ? [`type="${options.type}"`] : [],
|
|
848
|
+
...options.profile ? [`profile="${options.profile}"`] : []
|
|
849
|
+
].join("; ");
|
|
850
|
+
}
|
|
851
|
+
/** Cross-link the standards endpoints without replacing an existing canonical Link value. */
|
|
852
|
+
function getDocsDiscoveryLinkHeader(options = {}) {
|
|
853
|
+
return [
|
|
854
|
+
...options.includeApiCatalog === false ? [] : [formatLinkTarget(DEFAULT_API_CATALOG_ROUTE, "api-catalog", {
|
|
855
|
+
type: API_CATALOG_MEDIA_TYPE,
|
|
856
|
+
profile: API_CATALOG_PROFILE_URI
|
|
857
|
+
})],
|
|
858
|
+
...options.includeManifest === false ? [] : [formatLinkTarget(DEFAULT_AGENT_MANIFEST_ROUTE, "service-meta", { type: "application/json" })],
|
|
859
|
+
...options.includeSkills === false ? [] : [formatLinkTarget(DEFAULT_AGENT_SKILLS_INDEX_ROUTE, "service-meta", { type: "application/json" })]
|
|
860
|
+
].join(", ");
|
|
861
|
+
}
|
|
862
|
+
function appendDocsDiscoveryLinkHeader(headers, value) {
|
|
863
|
+
const next = new Headers(headers);
|
|
864
|
+
const discoveryLinks = value ?? getDocsDiscoveryLinkHeader();
|
|
865
|
+
const existing = next.get("Link");
|
|
866
|
+
next.set("Link", existing ? `${existing}, ${discoveryLinks}` : discoveryLinks);
|
|
867
|
+
return next;
|
|
868
|
+
}
|
|
869
|
+
function requestMatchesEtag(request, etag) {
|
|
870
|
+
const value = request.headers.get("if-none-match");
|
|
871
|
+
if (!value) return false;
|
|
872
|
+
if (value.trim() === "*") return true;
|
|
873
|
+
return value.split(",").some((candidate) => candidate.trim().replace(/^W\//i, "") === etag);
|
|
874
|
+
}
|
|
875
|
+
async function createHashedDiscoveryResponse(options) {
|
|
876
|
+
const etag = `"${options.sha256 ?? await sha256DocsDiscoveryContent(options.content)}"`;
|
|
877
|
+
const headers = {
|
|
878
|
+
"Access-Control-Allow-Origin": "*",
|
|
879
|
+
"Access-Control-Expose-Headers": "ETag, Link",
|
|
880
|
+
Allow: "GET, HEAD",
|
|
881
|
+
"Cache-Control": DISCOVERY_CACHE_CONTROL,
|
|
882
|
+
"Content-Type": options.contentType,
|
|
883
|
+
ETag: etag,
|
|
884
|
+
Link: options.linkHeader,
|
|
885
|
+
"X-Robots-Tag": "noindex"
|
|
886
|
+
};
|
|
887
|
+
if (requestMatchesEtag(options.request, etag)) {
|
|
888
|
+
const { "Content-Type": _contentType, ...notModifiedHeaders } = headers;
|
|
889
|
+
return new Response(null, {
|
|
890
|
+
status: 304,
|
|
891
|
+
headers: notModifiedHeaders
|
|
892
|
+
});
|
|
893
|
+
}
|
|
894
|
+
return new Response(options.request.method.toUpperCase() === "HEAD" ? null : options.content, { headers });
|
|
895
|
+
}
|
|
896
|
+
function standardsNotFoundResponse(request, linkHeader) {
|
|
897
|
+
return new Response(request.method.toUpperCase() === "HEAD" ? null : "Not Found", {
|
|
898
|
+
status: 404,
|
|
899
|
+
headers: {
|
|
900
|
+
"Access-Control-Allow-Origin": "*",
|
|
901
|
+
"Access-Control-Expose-Headers": "Link",
|
|
902
|
+
"Cache-Control": "no-store",
|
|
903
|
+
"Content-Type": "text/plain; charset=utf-8",
|
|
904
|
+
Link: linkHeader,
|
|
905
|
+
"X-Robots-Tag": "noindex"
|
|
906
|
+
}
|
|
907
|
+
});
|
|
908
|
+
}
|
|
909
|
+
function standardsMethodNotAllowedResponse(linkHeader) {
|
|
910
|
+
return new Response("Method Not Allowed", {
|
|
911
|
+
status: 405,
|
|
912
|
+
headers: {
|
|
913
|
+
"Access-Control-Allow-Origin": "*",
|
|
914
|
+
"Access-Control-Expose-Headers": "Link",
|
|
915
|
+
Allow: "GET, HEAD",
|
|
916
|
+
"Cache-Control": "no-store",
|
|
917
|
+
"Content-Type": "text/plain; charset=utf-8",
|
|
918
|
+
Link: linkHeader,
|
|
919
|
+
"X-Robots-Tag": "noindex"
|
|
920
|
+
}
|
|
921
|
+
});
|
|
922
|
+
}
|
|
923
|
+
/** Return one RFC 9727 or Agent Skills discovery response, or null for unrelated requests. */
|
|
924
|
+
async function createDocsStandardsResponse({ request, apiCatalog, apiCatalogEnabled = true, apiRoute, preferredSkillDocument, fallbackSkillDocument }) {
|
|
925
|
+
const resolved = resolveDocsStandardsDiscoveryRequest(new URL(request.url), { apiRoute });
|
|
926
|
+
if (!resolved) return null;
|
|
927
|
+
const linkHeader = getDocsDiscoveryLinkHeader({ includeApiCatalog: apiCatalogEnabled });
|
|
928
|
+
if (resolved.kind === "api-catalog" && (!apiCatalogEnabled || !apiCatalog)) return standardsNotFoundResponse(request, linkHeader);
|
|
929
|
+
const method = request.method.toUpperCase();
|
|
930
|
+
if (method !== "GET" && method !== "HEAD") return standardsMethodNotAllowedResponse(linkHeader);
|
|
931
|
+
if (resolved.kind === "api-catalog") return createHashedDiscoveryResponse({
|
|
932
|
+
request,
|
|
933
|
+
content: `${JSON.stringify(apiCatalog, null, 2)}\n`,
|
|
934
|
+
contentType: `${API_CATALOG_MEDIA_TYPE}; profile="${API_CATALOG_PROFILE_URI}"; charset=utf-8`,
|
|
935
|
+
linkHeader
|
|
936
|
+
});
|
|
937
|
+
const skill = await resolveDocsPublishedAgentSkill({
|
|
938
|
+
preferredDocument: preferredSkillDocument,
|
|
939
|
+
fallbackDocument: fallbackSkillDocument
|
|
940
|
+
});
|
|
941
|
+
if (resolved.kind === "agent-skill") {
|
|
942
|
+
if (resolved.name !== skill.name) return standardsNotFoundResponse(request, linkHeader);
|
|
943
|
+
return createHashedDiscoveryResponse({
|
|
944
|
+
request,
|
|
945
|
+
content: skill.content,
|
|
946
|
+
contentType: "text/markdown; charset=utf-8",
|
|
947
|
+
sha256: skill.sha256,
|
|
948
|
+
linkHeader: [linkHeader, formatLinkTarget(DEFAULT_AGENT_SKILLS_INDEX_ROUTE, "collection", { type: "application/json" })].join(", ")
|
|
949
|
+
});
|
|
950
|
+
}
|
|
951
|
+
return createHashedDiscoveryResponse({
|
|
952
|
+
request,
|
|
953
|
+
content: `${JSON.stringify(buildDocsAgentSkillsIndex(skill), null, 2)}\n`,
|
|
954
|
+
contentType: "application/json; charset=utf-8",
|
|
955
|
+
linkHeader: [linkHeader, formatLinkTarget(skill.url, "item", { type: "text/markdown" })].join(", ")
|
|
956
|
+
});
|
|
957
|
+
}
|
|
958
|
+
|
|
640
959
|
//#endregion
|
|
641
960
|
//#region src/sitemap.ts
|
|
642
961
|
const DEFAULT_SITEMAP_XML_ROUTE = "/sitemap.xml";
|
|
@@ -705,10 +1024,10 @@ function resolveDocsSitemapConfig(sitemap, defaults = {}) {
|
|
|
705
1024
|
}
|
|
706
1025
|
};
|
|
707
1026
|
}
|
|
708
|
-
function resolveDocsSitemapRequest(url, sitemap) {
|
|
1027
|
+
function resolveDocsSitemapRequest(url, sitemap, options = {}) {
|
|
709
1028
|
const pathname = normalizeUrlPath(url.pathname);
|
|
710
1029
|
const format = url.searchParams.get("format")?.trim();
|
|
711
|
-
if (pathname ===
|
|
1030
|
+
if (pathname === resolveDocsDiscoveryApiRoute(options.apiRoute)) {
|
|
712
1031
|
if (format === "sitemap-xml") return "xml";
|
|
713
1032
|
if (format === "sitemap-md" || format === "sitemap-markdown") return "markdown";
|
|
714
1033
|
}
|
|
@@ -850,9 +1169,9 @@ function resolveDocsSitemapPageLastmod(manifest, url) {
|
|
|
850
1169
|
const normalizedUrl = normalizeUrlPath(url);
|
|
851
1170
|
return normalizeDateOnly(manifest.pages.find((entry) => normalizeUrlPath(entry.url) === normalizedUrl)?.lastmod);
|
|
852
1171
|
}
|
|
853
|
-
function createDocsSitemapResponse({ request, sitemap, entry = "docs", siteTitle, baseUrl, pages, manifest }) {
|
|
1172
|
+
function createDocsSitemapResponse({ request, apiRoute, sitemap, entry = "docs", siteTitle, baseUrl, pages, manifest }) {
|
|
854
1173
|
const url = new URL(request.url);
|
|
855
|
-
const format = resolveDocsSitemapRequest(url, sitemap);
|
|
1174
|
+
const format = resolveDocsSitemapRequest(url, sitemap, { apiRoute });
|
|
856
1175
|
if (!format) return null;
|
|
857
1176
|
const resolved = resolveDocsSitemapConfig(sitemap, { baseUrl });
|
|
858
1177
|
if (!resolved.enabled) return null;
|
|
@@ -2228,6 +2547,16 @@ function isDocsConfigRequest(url) {
|
|
|
2228
2547
|
function isDocsDiagnosticsRequest(url) {
|
|
2229
2548
|
return url.searchParams.get("format")?.trim() === "diagnostics";
|
|
2230
2549
|
}
|
|
2550
|
+
/** Prefer an explicitly configured API route; otherwise infer a query-form route from the request. */
|
|
2551
|
+
function resolveDocsRequestApiRoute(url, configuredApiRoute) {
|
|
2552
|
+
const configured = configuredApiRoute?.trim();
|
|
2553
|
+
if (configured) return resolveDocsDiscoveryApiRoute(configured);
|
|
2554
|
+
const fallback = resolveDocsDiscoveryApiRoute();
|
|
2555
|
+
const pathname = normalizeDocsUrlPath(url.pathname);
|
|
2556
|
+
const hasPublicRepresentationSuffix = /\.(?:md|txt|xml)$/i.test(pathname);
|
|
2557
|
+
if (pathname.startsWith("/.well-known/") || hasPublicRepresentationSuffix) return fallback;
|
|
2558
|
+
return Boolean(url.searchParams.get("format")?.trim()) || url.searchParams.get("agent")?.trim() === "spec" || url.searchParams.has("query") || url.searchParams.get("feedback")?.trim() === "agent" ? resolveDocsDiscoveryApiRoute(pathname) : fallback;
|
|
2559
|
+
}
|
|
2231
2560
|
function buildDocsConfigMap(config, options = {}) {
|
|
2232
2561
|
const pointers = {};
|
|
2233
2562
|
const values = serializeDocsConfigMapValue(pickDocsConfigMapValues(config), [], /* @__PURE__ */ new WeakSet(), pointers);
|
|
@@ -2253,15 +2582,20 @@ function buildDocsDiagnostics(config, options = {}) {
|
|
|
2253
2582
|
const input = config;
|
|
2254
2583
|
const entry = normalizeDocsPathSegment(stringConfigValue(input.entry) ?? options.entry ?? "docs");
|
|
2255
2584
|
const docsRoute = routeFromConfigPath(stringConfigValue(input.docsPath) ?? entry);
|
|
2585
|
+
const cloud = isPlainObject(input.cloud) ? input.cloud : void 0;
|
|
2586
|
+
const apiRoute = resolveDocsDiscoveryApiRoute(options.apiRoute ?? stringConfigValue(cloud?.apiRoute));
|
|
2587
|
+
const apiQueryRoute = (query) => `${apiRoute}?${query}`;
|
|
2256
2588
|
const staticExport = input.staticExport === true;
|
|
2257
2589
|
const i18n = options.i18n ?? null;
|
|
2258
2590
|
const localesEnabled = Boolean(i18n?.locales.length);
|
|
2259
2591
|
const search = resolveDocsDiagnosticsSearch(input.search, staticExport);
|
|
2260
2592
|
const ai = resolveDocsDiagnosticsAi(input.ai, staticExport);
|
|
2261
2593
|
const llms = resolveDocsDiagnosticsLlms(input.llmsTxt);
|
|
2594
|
+
const apiCatalog = resolveDocsDiagnosticsApiCatalog(input.llmsTxt, staticExport, options.apiCatalog);
|
|
2262
2595
|
const sitemapConfig = resolveDocsSitemapConfig(input.sitemap);
|
|
2263
2596
|
const robotsEnabled = isRobotsDiscoveryEnabled(input.robots);
|
|
2264
2597
|
const openapiConfig = resolveDocsOpenApiDiscoveryConfig(options.openapi ?? input.apiReference);
|
|
2598
|
+
const openapiUrl = resolveDocsOpenApiDiscoveryUrl(openapiConfig, apiRoute);
|
|
2265
2599
|
const apiReferenceRoute = resolveDocsDiagnosticsApiReferenceRoute(input.apiReference);
|
|
2266
2600
|
const mcp = options.mcp ?? resolveDocsDiagnosticsMcp(input.mcp);
|
|
2267
2601
|
const feedback = options.feedback ?? resolveDocsAgentFeedbackConfig(input.feedback);
|
|
@@ -2275,13 +2609,13 @@ function buildDocsDiagnostics(config, options = {}) {
|
|
|
2275
2609
|
severity: "warning",
|
|
2276
2610
|
code: "static-export-runtime-api",
|
|
2277
2611
|
path: "/staticExport",
|
|
2278
|
-
message:
|
|
2612
|
+
message: `staticExport is enabled; runtime API-backed capabilities at ${apiRoute} are unavailable in production static export builds.`
|
|
2279
2613
|
});
|
|
2280
2614
|
if (staticExport && ai.configured) errors.push({
|
|
2281
2615
|
severity: "error",
|
|
2282
2616
|
code: "ai-static-export",
|
|
2283
2617
|
path: "/ai/enabled",
|
|
2284
|
-
message:
|
|
2618
|
+
message: `Ask AI requires the runtime ${apiRoute} POST handler and will not run in static export builds.`
|
|
2285
2619
|
});
|
|
2286
2620
|
if (ai.enabled && !search.enabled) warnings.push({
|
|
2287
2621
|
severity: "warning",
|
|
@@ -2312,44 +2646,53 @@ function buildDocsDiagnostics(config, options = {}) {
|
|
|
2312
2646
|
adapter,
|
|
2313
2647
|
routes: {
|
|
2314
2648
|
docs: docsRoute,
|
|
2315
|
-
api:
|
|
2316
|
-
config:
|
|
2317
|
-
diagnostics:
|
|
2318
|
-
agentSpec: DEFAULT_AGENT_SPEC_ROUTE,
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2649
|
+
api: apiRoute,
|
|
2650
|
+
config: apiQueryRoute("format=config"),
|
|
2651
|
+
diagnostics: apiQueryRoute("format=diagnostics"),
|
|
2652
|
+
agentSpec: apiRoute === DEFAULT_DOCS_API_ROUTE ? DEFAULT_AGENT_SPEC_ROUTE : apiQueryRoute("agent=spec"),
|
|
2653
|
+
apiCatalog: apiCatalog.enabled ? DEFAULT_API_CATALOG_ROUTE : null,
|
|
2654
|
+
agentSkillsIndex: DEFAULT_AGENT_SKILLS_INDEX_ROUTE,
|
|
2655
|
+
agentSkillsArtifact: DEFAULT_AGENT_SKILLS_ROUTE_PATTERN,
|
|
2656
|
+
agents: apiQueryRoute("format=agents"),
|
|
2657
|
+
skill: apiQueryRoute("format=skill"),
|
|
2658
|
+
search: search.enabled ? apiQueryRoute("query={query}") : null,
|
|
2659
|
+
askAi: ai.enabled ? apiRoute : null,
|
|
2323
2660
|
mcp: mcp.enabled ? mcp.route : null,
|
|
2324
2661
|
llmsTxt: llms.enabled ? DEFAULT_LLMS_TXT_ROUTE : null,
|
|
2325
2662
|
llmsFullTxt: llms.enabled ? DEFAULT_LLMS_FULL_TXT_ROUTE : null,
|
|
2326
2663
|
sitemapXml: sitemapConfig.enabled && sitemapConfig.xml.enabled ? sitemapConfig.xml.route : null,
|
|
2327
2664
|
sitemapMarkdown: sitemapConfig.enabled && sitemapConfig.markdown.enabled ? sitemapConfig.markdown.route : null,
|
|
2328
2665
|
robots: robotsEnabled ? DEFAULT_AGENT_DISCOVERY_ROBOTS_TXT_ROUTE : null,
|
|
2329
|
-
openapi: openapiConfig.enabled ?
|
|
2666
|
+
openapi: openapiConfig.enabled ? openapiUrl ?? apiQueryRoute("format=openapi") : null,
|
|
2330
2667
|
apiReference: openapiConfig.enabled ? apiReferenceRoute : null
|
|
2331
2668
|
},
|
|
2332
2669
|
features: {
|
|
2333
2670
|
staticExport: { status: staticExport ? "enabled" : "disabled" },
|
|
2334
2671
|
config: {
|
|
2335
2672
|
status: "enabled",
|
|
2336
|
-
route:
|
|
2673
|
+
route: apiQueryRoute("format=config")
|
|
2337
2674
|
},
|
|
2338
2675
|
diagnostics: {
|
|
2339
2676
|
status: "enabled",
|
|
2340
|
-
route:
|
|
2677
|
+
route: apiQueryRoute("format=diagnostics")
|
|
2678
|
+
},
|
|
2679
|
+
apiCatalog: {
|
|
2680
|
+
status: apiCatalog.enabled ? "enabled" : "disabled",
|
|
2681
|
+
reason: apiCatalog.reason,
|
|
2682
|
+
route: apiCatalog.enabled ? DEFAULT_API_CATALOG_ROUTE : null,
|
|
2683
|
+
transport: "GET/HEAD"
|
|
2341
2684
|
},
|
|
2342
2685
|
search: {
|
|
2343
2686
|
status: search.enabled ? "enabled" : "disabled",
|
|
2344
2687
|
reason: search.reason,
|
|
2345
|
-
route: search.enabled ?
|
|
2688
|
+
route: search.enabled ? apiQueryRoute("query={query}") : null,
|
|
2346
2689
|
provider: search.provider,
|
|
2347
2690
|
transport: "GET"
|
|
2348
2691
|
},
|
|
2349
2692
|
ai: {
|
|
2350
2693
|
status: ai.enabled ? "enabled" : "disabled",
|
|
2351
2694
|
reason: ai.reason,
|
|
2352
|
-
route: ai.enabled ?
|
|
2695
|
+
route: ai.enabled ? apiRoute : null,
|
|
2353
2696
|
mode: ai.mode,
|
|
2354
2697
|
transport: "POST"
|
|
2355
2698
|
},
|
|
@@ -2394,7 +2737,7 @@ function buildDocsDiagnostics(config, options = {}) {
|
|
|
2394
2737
|
apiReference: {
|
|
2395
2738
|
status: openapiConfig.enabled ? "enabled" : "disabled",
|
|
2396
2739
|
route: openapiConfig.enabled ? apiReferenceRoute : null,
|
|
2397
|
-
routes: { openapi: openapiConfig.enabled ?
|
|
2740
|
+
routes: { openapi: openapiConfig.enabled ? openapiUrl ?? apiQueryRoute("format=openapi") : null },
|
|
2398
2741
|
provider: openapiConfig.source
|
|
2399
2742
|
},
|
|
2400
2743
|
agents: {
|
|
@@ -2402,15 +2745,18 @@ function buildDocsDiagnostics(config, options = {}) {
|
|
|
2402
2745
|
routes: {
|
|
2403
2746
|
default: DEFAULT_AGENTS_MD_ROUTE,
|
|
2404
2747
|
wellKnown: DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE,
|
|
2405
|
-
api:
|
|
2748
|
+
api: apiQueryRoute("format=agents")
|
|
2406
2749
|
}
|
|
2407
2750
|
},
|
|
2408
2751
|
skills: {
|
|
2409
2752
|
status: "enabled",
|
|
2753
|
+
transport: "GET/HEAD",
|
|
2410
2754
|
routes: {
|
|
2411
2755
|
default: DEFAULT_SKILL_MD_ROUTE,
|
|
2412
2756
|
wellKnown: DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE,
|
|
2413
|
-
api:
|
|
2757
|
+
api: apiQueryRoute("format=skill"),
|
|
2758
|
+
index: DEFAULT_AGENT_SKILLS_INDEX_ROUTE,
|
|
2759
|
+
artifact: DEFAULT_AGENT_SKILLS_ROUTE_PATTERN
|
|
2414
2760
|
}
|
|
2415
2761
|
},
|
|
2416
2762
|
locales: {
|
|
@@ -2619,6 +2965,21 @@ function resolveDocsDiagnosticsLlms(llmsTxt) {
|
|
|
2619
2965
|
reason: "configured-disabled"
|
|
2620
2966
|
};
|
|
2621
2967
|
}
|
|
2968
|
+
function resolveDocsDiagnosticsApiCatalog(llmsTxt, staticExport, explicit) {
|
|
2969
|
+
if (staticExport) return {
|
|
2970
|
+
enabled: false,
|
|
2971
|
+
reason: "static-export"
|
|
2972
|
+
};
|
|
2973
|
+
if (explicit !== void 0) return explicit ? { enabled: true } : {
|
|
2974
|
+
enabled: false,
|
|
2975
|
+
reason: "configured-disabled"
|
|
2976
|
+
};
|
|
2977
|
+
if (isPlainObject(llmsTxt) && llmsTxt.apiCatalog === false) return {
|
|
2978
|
+
enabled: false,
|
|
2979
|
+
reason: "llms-txt-api-catalog-disabled"
|
|
2980
|
+
};
|
|
2981
|
+
return { enabled: true };
|
|
2982
|
+
}
|
|
2622
2983
|
function resolveDocsDiagnosticsMcp(mcp) {
|
|
2623
2984
|
const config = isPlainObject(mcp) ? mcp : {};
|
|
2624
2985
|
const tools = isPlainObject(config.tools) ? config.tools : {};
|
|
@@ -2933,8 +3294,9 @@ function matchesDocsLlmsTxtSection(pageUrl, section) {
|
|
|
2933
3294
|
return pathname === normalized;
|
|
2934
3295
|
});
|
|
2935
3296
|
}
|
|
2936
|
-
function resolveDocsLlmsTxtRequest(url, llms, basePath) {
|
|
3297
|
+
function resolveDocsLlmsTxtRequest(url, llms, basePath, options = {}) {
|
|
2937
3298
|
const pathname = normalizeDocsUrlPath(url.pathname);
|
|
3299
|
+
const apiRoute = resolveDocsDiscoveryApiRoute(options.apiRoute);
|
|
2938
3300
|
const sections = resolveDocsLlmsTxtSections(llms);
|
|
2939
3301
|
for (const section of sections) {
|
|
2940
3302
|
if (pathname === section.route) return {
|
|
@@ -2947,7 +3309,7 @@ function resolveDocsLlmsTxtRequest(url, llms, basePath) {
|
|
|
2947
3309
|
};
|
|
2948
3310
|
}
|
|
2949
3311
|
const format = url.searchParams.get("format");
|
|
2950
|
-
if (pathname ===
|
|
3312
|
+
if (pathname === apiRoute && (format === "llms" || format === "llms-full")) {
|
|
2951
3313
|
const sectionRoute = url.searchParams.get("section")?.trim();
|
|
2952
3314
|
const normalizedSectionRoute = sectionRoute ? normalizeDocsUrlPath(sectionRoute) : void 0;
|
|
2953
3315
|
return {
|
|
@@ -2996,8 +3358,10 @@ function renderDocsLlmsTxt(pages, options = {}) {
|
|
|
2996
3358
|
const siteDescription = options.siteDescription;
|
|
2997
3359
|
const baseUrl = options.baseUrl ?? "";
|
|
2998
3360
|
const maxChars = normalizeLlmsTxtMaxChars(options.maxChars);
|
|
3361
|
+
const apiCatalogEnabled = options.apiCatalog ?? true;
|
|
2999
3362
|
const sections = resolveDocsLlmsTxtSections(options);
|
|
3000
3363
|
const openapi = resolveDocsOpenApiDiscoveryConfig(options.openapi);
|
|
3364
|
+
const openapiUrl = resolveDocsOpenApiDiscoveryUrl(openapi, resolveDocsDiscoveryApiRoute(options.apiRoute));
|
|
3001
3365
|
const matchedPageUrls = /* @__PURE__ */ new Set();
|
|
3002
3366
|
const generatedSections = sections.map((section) => {
|
|
3003
3367
|
const sectionPages = pages.filter((page) => matchesDocsLlmsTxtSection(page.url, section));
|
|
@@ -3020,6 +3384,10 @@ function renderDocsLlmsTxt(pages, options = {}) {
|
|
|
3020
3384
|
const rootPages = generatedSections.length > 0 ? pages.filter((page) => !matchedPageUrls.has(normalizeDocsUrlPath(page.url))) : pages;
|
|
3021
3385
|
let llmsTxt = `# ${siteTitle}\n\n`;
|
|
3022
3386
|
if (siteDescription) llmsTxt += `> ${siteDescription}\n\n`;
|
|
3387
|
+
llmsTxt += "## Agent Discovery\n\n";
|
|
3388
|
+
llmsTxt += `- [Agent manifest](${resolveDocsResourceUrl(baseUrl, DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE)}): Farming Labs discovery manifest\n`;
|
|
3389
|
+
if (apiCatalogEnabled) llmsTxt += `- [API catalog](${resolveDocsResourceUrl(baseUrl, DEFAULT_API_CATALOG_ROUTE)}): RFC 9727 API catalog\n`;
|
|
3390
|
+
llmsTxt += `- [Agent Skills index](${resolveDocsResourceUrl(baseUrl, DEFAULT_AGENT_SKILLS_INDEX_ROUTE)}): Hashed Agent Skills discovery\n\n`;
|
|
3023
3391
|
if (generatedSections.length > 0) {
|
|
3024
3392
|
llmsTxt += "## Sections\n\n";
|
|
3025
3393
|
for (const section of generatedSections) {
|
|
@@ -3029,9 +3397,9 @@ function renderDocsLlmsTxt(pages, options = {}) {
|
|
|
3029
3397
|
}
|
|
3030
3398
|
llmsTxt += "\n";
|
|
3031
3399
|
}
|
|
3032
|
-
if (openapi.enabled &&
|
|
3400
|
+
if (openapi.enabled && openapiUrl) {
|
|
3033
3401
|
llmsTxt += "## API Schemas\n\n";
|
|
3034
|
-
llmsTxt += `- [OpenAPI schema](${resolveDocsResourceUrl(baseUrl,
|
|
3402
|
+
llmsTxt += `- [OpenAPI schema](${resolveDocsResourceUrl(baseUrl, openapiUrl)}): Machine-readable API schema for tool use and API clients`;
|
|
3035
3403
|
if (openapi.apiReferencePath) llmsTxt += `; rendered API reference at ${resolveDocsResourceUrl(baseUrl, openapi.apiReferencePath)}`;
|
|
3036
3404
|
llmsTxt += "\n\n";
|
|
3037
3405
|
}
|
|
@@ -3081,9 +3449,75 @@ function getDocsLlmsTxtMaxCharsIssue(label, content, maxChars) {
|
|
|
3081
3449
|
message: `${label} is ${content.length.toLocaleString()} chars, above the configured ${maxChars.chars.toLocaleString()} char llms.txt budget.`
|
|
3082
3450
|
};
|
|
3083
3451
|
}
|
|
3084
|
-
function
|
|
3452
|
+
function resolveDocsStandardsOrigin(preferred, fallback) {
|
|
3453
|
+
for (const candidate of [preferred, fallback]) {
|
|
3454
|
+
if (!candidate) continue;
|
|
3455
|
+
try {
|
|
3456
|
+
const url = new URL(candidate);
|
|
3457
|
+
if (url.protocol === "http:" || url.protocol === "https:") return url.origin;
|
|
3458
|
+
} catch {}
|
|
3459
|
+
}
|
|
3460
|
+
return new URL(fallback).origin;
|
|
3461
|
+
}
|
|
3462
|
+
/** Build and serve standards-based discovery without replacing the custom agent manifest. */
|
|
3463
|
+
async function createDocsStandardsDiscoveryResponse({ request, preferredSkillDocument, fallbackSkillDocument, origin, entry = "docs", docsPath, apiCatalog: explicitApiCatalog, apiRoute, i18n: _i18n, search: _search, mcp, feedback, llms, sitemap, robots, openapi, markdown: _markdown }) {
|
|
3464
|
+
const url = new URL(request.url);
|
|
3465
|
+
const resolvedApiRoute = resolveDocsDiscoveryApiRoute(apiRoute);
|
|
3466
|
+
if (!isDocsStandardsDiscoveryRequest(url, { apiRoute: resolvedApiRoute })) return null;
|
|
3467
|
+
const normalizedEntry = normalizeDocsPathSegment(entry) || "docs";
|
|
3468
|
+
const normalizedDocsPath = normalizeDocsPathSegment(docsPath ?? normalizedEntry);
|
|
3469
|
+
const apiCatalogEnabled = explicitApiCatalog ?? llms?.apiCatalog ?? true;
|
|
3470
|
+
const catalogOrigin = resolveDocsStandardsOrigin(llms?.baseUrl, origin || url.origin);
|
|
3471
|
+
const sitemapConfig = resolveDocsSitemapConfig(sitemap, { baseUrl: llms?.baseUrl });
|
|
3472
|
+
const openapiConfig = resolveDocsOpenApiDiscoveryConfig(openapi);
|
|
3473
|
+
const openapiUrl = resolveDocsOpenApiDiscoveryUrl(openapiConfig, resolvedApiRoute);
|
|
3474
|
+
const feedbackRoute = feedback?.route ?? DEFAULT_AGENT_FEEDBACK_ROUTE;
|
|
3475
|
+
const feedbackSchemaRoute = feedback?.schemaRoute ?? `${feedbackRoute}/schema`;
|
|
3476
|
+
const llmsEnabled = llms?.enabled ?? true;
|
|
3477
|
+
const robotsEnabled = isRobotsDiscoveryEnabled(robots);
|
|
3478
|
+
const llmsSections = resolveDocsLlmsTxtSections(llms);
|
|
3479
|
+
const llmsRoutes = llmsEnabled ? [
|
|
3480
|
+
DEFAULT_LLMS_TXT_ROUTE,
|
|
3481
|
+
DEFAULT_LLMS_FULL_TXT_ROUTE,
|
|
3482
|
+
DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE,
|
|
3483
|
+
DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE,
|
|
3484
|
+
...llmsSections.flatMap((section) => [section.route, section.fullRoute])
|
|
3485
|
+
] : [];
|
|
3486
|
+
const sitemapRoutes = sitemapConfig.enabled ? [...sitemapConfig.xml.enabled ? [sitemapConfig.xml.route] : [], ...sitemapConfig.markdown.enabled ? [
|
|
3487
|
+
sitemapConfig.markdown.route,
|
|
3488
|
+
sitemapConfig.markdown.docsRoute,
|
|
3489
|
+
sitemapConfig.markdown.wellKnownRoute
|
|
3490
|
+
].filter((route) => Boolean(route)) : []] : [];
|
|
3491
|
+
return createDocsStandardsResponse({
|
|
3492
|
+
request,
|
|
3493
|
+
apiCatalogEnabled,
|
|
3494
|
+
apiRoute: resolvedApiRoute,
|
|
3495
|
+
preferredSkillDocument,
|
|
3496
|
+
fallbackSkillDocument,
|
|
3497
|
+
apiCatalog: apiCatalogEnabled ? buildDocsApiCatalog({
|
|
3498
|
+
origin: catalogOrigin,
|
|
3499
|
+
docsRoute: normalizedDocsPath ? `/${normalizedDocsPath}` : "/",
|
|
3500
|
+
apiRoute: resolvedApiRoute,
|
|
3501
|
+
configRoute: `${resolvedApiRoute}?format=config`,
|
|
3502
|
+
diagnosticsRoute: `${resolvedApiRoute}?format=diagnostics`,
|
|
3503
|
+
agentManifestRoute: DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE,
|
|
3504
|
+
agentSkillsIndexRoute: DEFAULT_AGENT_SKILLS_INDEX_ROUTE,
|
|
3505
|
+
agentsRoute: DEFAULT_AGENTS_MD_ROUTE,
|
|
3506
|
+
skillRoute: DEFAULT_SKILL_MD_ROUTE,
|
|
3507
|
+
markdownRootRoute: `/${normalizedEntry}.md`,
|
|
3508
|
+
llmsRoutes,
|
|
3509
|
+
sitemapRoutes,
|
|
3510
|
+
robotsRoute: robotsEnabled ? DEFAULT_AGENT_DISCOVERY_ROBOTS_TXT_ROUTE : null,
|
|
3511
|
+
mcpRoute: mcp.enabled ? mcp.route : null,
|
|
3512
|
+
feedbackRoutes: feedback?.enabled ? [feedbackRoute, feedbackSchemaRoute] : [],
|
|
3513
|
+
openapiRoute: openapiConfig.enabled ? openapiUrl ?? `${resolvedApiRoute}?format=openapi` : null,
|
|
3514
|
+
apiReferenceRoute: openapiConfig.enabled && openapiConfig.apiReferencePath ? openapiConfig.apiReferencePath : null
|
|
3515
|
+
}) : void 0
|
|
3516
|
+
});
|
|
3517
|
+
}
|
|
3518
|
+
function isDocsAgentDiscoveryRequest(url, options = {}) {
|
|
3085
3519
|
const pathname = normalizeDocsUrlPath(url.pathname);
|
|
3086
|
-
if (pathname ===
|
|
3520
|
+
if (pathname === resolveDocsDiscoveryApiRoute(options.apiRoute) && url.searchParams.get("agent")?.trim() === "spec") return true;
|
|
3087
3521
|
return pathname === DEFAULT_AGENT_SPEC_ROUTE || pathname === DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE || pathname === DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE;
|
|
3088
3522
|
}
|
|
3089
3523
|
function isDocsMcpRequest(url) {
|
|
@@ -3169,10 +3603,10 @@ function getDocsMcpRootDomainCandidates(hostname) {
|
|
|
3169
3603
|
function isDocsIpHostname(hostname) {
|
|
3170
3604
|
return /^(\d{1,3}\.){3}\d{1,3}$/.test(hostname) || hostname.includes(":");
|
|
3171
3605
|
}
|
|
3172
|
-
function isDocsSkillRequest(url) {
|
|
3606
|
+
function isDocsSkillRequest(url, options = {}) {
|
|
3173
3607
|
const pathname = normalizeDocsUrlPath(url.pathname);
|
|
3174
3608
|
if (pathname === DEFAULT_SKILL_MD_ROUTE || pathname === DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE) return true;
|
|
3175
|
-
return pathname ===
|
|
3609
|
+
return pathname === resolveDocsDiscoveryApiRoute(options.apiRoute) && resolveDocsSkillFormat(url) === "skill";
|
|
3176
3610
|
}
|
|
3177
3611
|
function resolveDocsSkillFormat(url) {
|
|
3178
3612
|
return url.searchParams.get("format")?.trim() === "skill" ? "skill" : null;
|
|
@@ -3180,29 +3614,32 @@ function resolveDocsSkillFormat(url) {
|
|
|
3180
3614
|
function isDocsAgentsPath(pathname) {
|
|
3181
3615
|
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;
|
|
3182
3616
|
}
|
|
3183
|
-
function isDocsAgentsRequest(url) {
|
|
3617
|
+
function isDocsAgentsRequest(url, options = {}) {
|
|
3184
3618
|
const pathname = normalizeDocsUrlPath(url.pathname);
|
|
3185
3619
|
if (isDocsAgentsPath(pathname)) return true;
|
|
3186
|
-
return pathname ===
|
|
3620
|
+
return pathname === resolveDocsDiscoveryApiRoute(options.apiRoute) && resolveDocsAgentsFormat(url) === "agents";
|
|
3187
3621
|
}
|
|
3188
3622
|
function resolveDocsAgentsFormat(url) {
|
|
3189
3623
|
return url.searchParams.get("format")?.trim() === "agents" ? "agents" : null;
|
|
3190
3624
|
}
|
|
3191
3625
|
function isDocsPublicGetRequest(entry, url, request, options = {}) {
|
|
3192
3626
|
const pathname = normalizeDocsUrlPath(url.pathname);
|
|
3193
|
-
|
|
3194
|
-
|
|
3627
|
+
const apiRoute = resolveDocsDiscoveryApiRoute(options.apiRoute);
|
|
3628
|
+
if (pathname === apiRoute || pathname === DEFAULT_MCP_ROUTE) return false;
|
|
3629
|
+
return isDocsStandardsDiscoveryRequest(url, { apiRoute }) || isDocsAgentDiscoveryRequest(url, { apiRoute }) || isDocsAgentsRequest(url, { apiRoute }) || isDocsSkillRequest(url, { apiRoute }) || pathname === DEFAULT_AGENT_DISCOVERY_ROBOTS_TXT_ROUTE && isRobotsDiscoveryEnabled(options.robots) || resolveDocsLlmsTxtRequest(url, options.llms, entry, { apiRoute }) !== null || resolveDocsSitemapRequest(url, options.sitemap, { apiRoute }) !== null || resolveDocsMarkdownRequest(entry, url, request, { apiRoute }) !== null;
|
|
3195
3630
|
}
|
|
3196
|
-
function isDocsLlmsTxtPublicRequest(url, llms, basePath) {
|
|
3197
|
-
|
|
3631
|
+
function isDocsLlmsTxtPublicRequest(url, llms, basePath, options = {}) {
|
|
3632
|
+
const pathname = normalizeDocsUrlPath(url.pathname);
|
|
3633
|
+
const apiRoute = resolveDocsDiscoveryApiRoute(options.apiRoute);
|
|
3634
|
+
return pathname !== apiRoute && resolveDocsLlmsTxtRequest(url, llms, basePath, { apiRoute }) !== null;
|
|
3198
3635
|
}
|
|
3199
|
-
function resolveDocsLlmsTxtFormat(url, basePath) {
|
|
3200
|
-
return resolveDocsLlmsTxtRequest(url, void 0, basePath)?.format ?? null;
|
|
3636
|
+
function resolveDocsLlmsTxtFormat(url, basePath, options = {}) {
|
|
3637
|
+
return resolveDocsLlmsTxtRequest(url, void 0, basePath, options)?.format ?? null;
|
|
3201
3638
|
}
|
|
3202
|
-
function resolveDocsMarkdownRequest(entry, url, request) {
|
|
3639
|
+
function resolveDocsMarkdownRequest(entry, url, request, options = {}) {
|
|
3203
3640
|
const pathname = normalizeDocsUrlPath(url.pathname);
|
|
3204
3641
|
const format = url.searchParams.get("format")?.trim();
|
|
3205
|
-
if (pathname ===
|
|
3642
|
+
if (pathname === resolveDocsDiscoveryApiRoute(options.apiRoute) && format === "markdown") return { requestedPath: url.searchParams.get("path")?.trim() ?? "" };
|
|
3206
3643
|
const normalizedEntry = `/${normalizeDocsPathSegment(entry) || "docs"}`;
|
|
3207
3644
|
if (pathname === `${normalizedEntry}.md`) return { requestedPath: "" };
|
|
3208
3645
|
const slugPrefix = `${normalizedEntry}/`;
|
|
@@ -3418,14 +3855,16 @@ function resolveDocsMarkdownPageMetadata(page, options) {
|
|
|
3418
3855
|
agent: page.agent
|
|
3419
3856
|
};
|
|
3420
3857
|
}
|
|
3421
|
-
function renderDocsMarkdownNotFound({ entry = "docs", requestedPath, origin, pages, sitemap }) {
|
|
3858
|
+
function renderDocsMarkdownNotFound({ entry = "docs", apiRoute, requestedPath, origin, pages, sitemap }) {
|
|
3422
3859
|
const normalizedEntry = normalizeDocsPathSegment(entry) || "docs";
|
|
3860
|
+
const resolvedApiRoute = resolveDocsDiscoveryApiRoute(apiRoute);
|
|
3861
|
+
const agentSpecApiRoute = resolvedApiRoute === DEFAULT_DOCS_API_ROUTE ? DEFAULT_AGENT_SPEC_ROUTE : `${resolvedApiRoute}?agent=spec`;
|
|
3423
3862
|
const normalizedRequest = normalizeRequestedMarkdownPath(normalizedEntry, requestedPath);
|
|
3424
3863
|
const slugPrefix = `/${normalizedEntry}/`;
|
|
3425
3864
|
const requestedSlug = normalizedRequest === `/${normalizedEntry}` ? "" : normalizedRequest.slice(slugPrefix.length);
|
|
3426
3865
|
const encodedRequestedSlug = requestedSlug.split("/").map(encodeURIComponent).join("/");
|
|
3427
3866
|
const requestedMarkdownRoute = toDocsMarkdownUrl(normalizedRequest);
|
|
3428
|
-
const requestedApiRoute = requestedSlug ? `${
|
|
3867
|
+
const requestedApiRoute = requestedSlug ? `${resolvedApiRoute}?format=markdown&path=${encodedRequestedSlug}` : `${resolvedApiRoute}?format=markdown`;
|
|
3429
3868
|
const sitemapConfig = resolveDocsSitemapConfig(sitemap);
|
|
3430
3869
|
const recovery = resolveDocsMarkdownRecovery({
|
|
3431
3870
|
entry: normalizedEntry,
|
|
@@ -3444,7 +3883,7 @@ function renderDocsMarkdownNotFound({ entry = "docs", requestedPath, origin, pag
|
|
|
3444
3883
|
lines.push(`- [${match.title}](${match.markdownUrl}) (${confidence} confidence)${match.description ? ` - ${match.description}` : ""}`);
|
|
3445
3884
|
}
|
|
3446
3885
|
}
|
|
3447
|
-
lines.push("", "## Recovery", "", "- If a closest match looks right, fetch that markdown URL directly.", "- If the match is uncertain, search the docs first and then fetch the smallest page that answers the task.", "- Use the sitemap routes below to browse the full docs index before guessing another slug.", "", "## Discovery Routes", "", "Use these discovery routes to find the right page:", "", `- Agent discovery spec: \`${DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE}\``, `- Agent discovery fallback: \`${DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE}\``, `- Agent discovery API: \`${
|
|
3886
|
+
lines.push("", "## Recovery", "", "- If a closest match looks right, fetch that markdown URL directly.", "- If the match is uncertain, search the docs first and then fetch the smallest page that answers the task.", "- Use the sitemap routes below to browse the full docs index before guessing another slug.", "", "## Discovery Routes", "", "Use these discovery routes to find the right page:", "", `- Agent discovery spec: \`${DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE}\``, `- Agent discovery fallback: \`${DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE}\``, `- Agent discovery API: \`${agentSpecApiRoute}\``, `- API catalog: \`${DEFAULT_API_CATALOG_ROUTE}\``, `- Agent Skills index: \`${DEFAULT_AGENT_SKILLS_INDEX_ROUTE}\``, `- Agent instructions: \`${DEFAULT_AGENTS_MD_ROUTE}\``, `- Search endpoint: \`${resolvedApiRoute}?query={query}\``, `- Docs index markdown: \`/${normalizedEntry}.md\``, `- Requested markdown API route: \`${requestedApiRoute}\``);
|
|
3448
3887
|
if (sitemapConfig.enabled) {
|
|
3449
3888
|
if (sitemapConfig.markdown.enabled) {
|
|
3450
3889
|
lines.push(`- Semantic sitemap: \`${sitemapConfig.markdown.route}\``);
|
|
@@ -3545,6 +3984,7 @@ function createDocsMarkdownResponse(options) {
|
|
|
3545
3984
|
});
|
|
3546
3985
|
return new Response(renderDocsMarkdownNotFound({
|
|
3547
3986
|
entry,
|
|
3987
|
+
apiRoute: options.apiRoute,
|
|
3548
3988
|
requestedPath,
|
|
3549
3989
|
origin,
|
|
3550
3990
|
pages,
|
|
@@ -3588,9 +4028,12 @@ function shouldRenderLlmsDirective(options) {
|
|
|
3588
4028
|
if (options?.llms && typeof options.llms === "object" && options.llms.enabled === false) return false;
|
|
3589
4029
|
return true;
|
|
3590
4030
|
}
|
|
3591
|
-
function resolveDocsAgentDocumentContext({ entry = "docs", search, mcp, feedback, llms, sitemap, robots, openapi, markdown }) {
|
|
4031
|
+
function resolveDocsAgentDocumentContext({ entry = "docs", apiRoute, apiCatalog: explicitApiCatalog, search, mcp, feedback, llms, sitemap, robots, openapi, markdown }) {
|
|
3592
4032
|
const feedbackRoute = feedback?.route ?? DEFAULT_AGENT_FEEDBACK_ROUTE;
|
|
4033
|
+
const resolvedApiRoute = resolveDocsDiscoveryApiRoute(apiRoute);
|
|
4034
|
+
const openapiConfig = resolveDocsOpenApiDiscoveryConfig(openapi);
|
|
3593
4035
|
return {
|
|
4036
|
+
apiRoute: resolvedApiRoute,
|
|
3594
4037
|
normalizedEntry: normalizeDocsPathSegment(entry) || "docs",
|
|
3595
4038
|
siteTitle: compactSkillText(llms?.siteTitle ?? "Documentation"),
|
|
3596
4039
|
siteDescription: llms?.siteDescription ? compactSkillText(llms.siteDescription) : void 0,
|
|
@@ -3600,12 +4043,16 @@ function resolveDocsAgentDocumentContext({ entry = "docs", search, mcp, feedback
|
|
|
3600
4043
|
feedbackEnabled: feedback?.enabled ?? false,
|
|
3601
4044
|
sitemapConfig: resolveDocsSitemapConfig(sitemap),
|
|
3602
4045
|
robotsEnabled: isRobotsDiscoveryEnabled(robots),
|
|
3603
|
-
openapiConfig:
|
|
4046
|
+
openapiConfig: {
|
|
4047
|
+
...openapiConfig,
|
|
4048
|
+
url: resolveDocsOpenApiDiscoveryUrl(openapiConfig, resolvedApiRoute)
|
|
4049
|
+
},
|
|
3604
4050
|
feedbackRoute,
|
|
3605
4051
|
feedbackSchemaRoute: feedback?.schemaRoute ?? `${feedbackRoute}/schema`,
|
|
3606
4052
|
llmsSections: resolveDocsLlmsTxtSections(llms),
|
|
3607
4053
|
markdownAcceptHeader: markdown?.acceptHeader === false ? null : "text/markdown",
|
|
3608
|
-
markdownSignatureAgentHeader: markdown?.signatureAgentHeader === false ? null : DOCS_MARKDOWN_SIGNATURE_AGENT_HEADER
|
|
4054
|
+
markdownSignatureAgentHeader: markdown?.signatureAgentHeader === false ? null : DOCS_MARKDOWN_SIGNATURE_AGENT_HEADER,
|
|
4055
|
+
apiCatalogEnabled: explicitApiCatalog ?? llms?.apiCatalog ?? true
|
|
3609
4056
|
};
|
|
3610
4057
|
}
|
|
3611
4058
|
function appendDocsMarkdownNegotiationStartLines(lines, context, variant) {
|
|
@@ -3614,7 +4061,7 @@ function appendDocsMarkdownNegotiationStartLines(lines, context, variant) {
|
|
|
3614
4061
|
}
|
|
3615
4062
|
function appendDocsSearchStartLine(lines, context, variant) {
|
|
3616
4063
|
if (!context.searchEnabled) return;
|
|
3617
|
-
lines.push(variant === "skill" ? `- Search with ${
|
|
4064
|
+
lines.push(variant === "skill" ? `- Search with ${context.apiRoute}?query={query} when you do not know the page.` : `- Search with ${context.apiRoute}?query={query} when the route is unknown.`);
|
|
3618
4065
|
}
|
|
3619
4066
|
function appendDocsOpenApiStartLine(lines, context, variant) {
|
|
3620
4067
|
if (!context.openapiConfig.enabled || !context.openapiConfig.url) return;
|
|
@@ -3648,7 +4095,10 @@ function appendDocsFeedbackStartLine(lines, context, variant) {
|
|
|
3648
4095
|
lines.push(variant === "skill" ? `- Read ${context.feedbackSchemaRoute} before posting agent feedback to ${context.feedbackRoute}.` : `- Read ${context.feedbackSchemaRoute} before posting feedback to ${context.feedbackRoute}.`);
|
|
3649
4096
|
}
|
|
3650
4097
|
function appendDocsAgentStartHereLines(lines, context, variant) {
|
|
3651
|
-
|
|
4098
|
+
const agentSpecFallback = context.apiRoute === DEFAULT_DOCS_API_ROUTE ? DEFAULT_AGENT_SPEC_ROUTE : `${context.apiRoute}?agent=spec`;
|
|
4099
|
+
lines.push(variant === "skill" ? `- Fetch ${DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE}; fall back to ${DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE} or ${agentSpecFallback}.` : `- Read ${DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE} first; fall back to ${DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE} or ${agentSpecFallback}.`);
|
|
4100
|
+
if (context.apiCatalogEnabled) lines.push(variant === "skill" ? `- Use ${DEFAULT_API_CATALOG_ROUTE} for standards-based API discovery.` : `- Use ${DEFAULT_API_CATALOG_ROUTE} for RFC 9727 API discovery.`);
|
|
4101
|
+
lines.push(variant === "skill" ? `- Use ${DEFAULT_AGENT_SKILLS_INDEX_ROUTE} for hashed skill discovery.` : `- Use ${DEFAULT_AGENT_SKILLS_INDEX_ROUTE} for integrity-checked skills.`, 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.`);
|
|
3652
4102
|
if (variant === "skill") {
|
|
3653
4103
|
appendDocsMarkdownNegotiationStartLines(lines, context, variant);
|
|
3654
4104
|
appendDocsSearchStartLine(lines, context, variant);
|
|
@@ -3693,7 +4143,9 @@ function appendDocsMcpRouteLines(lines, context) {
|
|
|
3693
4143
|
}
|
|
3694
4144
|
function appendDocsAgentPublicRouteLines(lines, context, variant) {
|
|
3695
4145
|
if (variant === "skill") {
|
|
3696
|
-
lines.push(`- Agent instructions: ${DEFAULT_AGENTS_MD_ROUTE}`, `- Agent instructions well-known alias: ${DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE}`, `- Agent instructions API format: ${
|
|
4146
|
+
lines.push(`- Agent instructions: ${DEFAULT_AGENTS_MD_ROUTE}`, `- Agent instructions well-known alias: ${DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE}`, `- Agent instructions API format: ${context.apiRoute}?format=agents`, `- Skill document: ${DEFAULT_SKILL_MD_ROUTE}`, `- Skill well-known alias: ${DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE}`, `- Skill API format: ${context.apiRoute}?format=skill`, `- Agent discovery: ${DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE}`, `- Agent discovery fallback: ${DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE}`);
|
|
4147
|
+
if (context.apiCatalogEnabled) lines.push(`- API catalog (RFC 9727): ${DEFAULT_API_CATALOG_ROUTE}`);
|
|
4148
|
+
lines.push(`- Agent Skills index: ${DEFAULT_AGENT_SKILLS_INDEX_ROUTE}`, `- Agent Skills artifacts: ${DEFAULT_AGENT_SKILLS_ROUTE_PATTERN}`, `- Markdown root: /${context.normalizedEntry}.md`, `- Markdown pages: /${context.normalizedEntry}/{slug}.md`);
|
|
3697
4149
|
if (context.robotsEnabled) lines.push(`- Robots policy: ${DEFAULT_AGENT_DISCOVERY_ROBOTS_TXT_ROUTE}`);
|
|
3698
4150
|
appendDocsLlmsRouteLines(lines, context);
|
|
3699
4151
|
appendDocsOpenApiRouteLines(lines, context);
|
|
@@ -3701,7 +4153,9 @@ function appendDocsAgentPublicRouteLines(lines, context, variant) {
|
|
|
3701
4153
|
appendDocsMcpRouteLines(lines, context);
|
|
3702
4154
|
return;
|
|
3703
4155
|
}
|
|
3704
|
-
lines.push(`- Agent instructions: ${DEFAULT_AGENTS_MD_ROUTE}`, `- Agent instructions well-known alias: ${DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE}`, `- Agent instructions API format: ${
|
|
4156
|
+
lines.push(`- Agent instructions: ${DEFAULT_AGENTS_MD_ROUTE}`, `- Agent instructions well-known alias: ${DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE}`, `- Agent instructions API format: ${context.apiRoute}?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: ${context.apiRoute}?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}`);
|
|
4157
|
+
if (context.apiCatalogEnabled) lines.push(`- API catalog (RFC 9727): ${DEFAULT_API_CATALOG_ROUTE}`);
|
|
4158
|
+
lines.push(`- Agent Skills index: ${DEFAULT_AGENT_SKILLS_INDEX_ROUTE}`, `- Agent Skills artifacts: ${DEFAULT_AGENT_SKILLS_ROUTE_PATTERN}`);
|
|
3705
4159
|
appendDocsLlmsRouteLines(lines, context);
|
|
3706
4160
|
if (context.robotsEnabled) lines.push(`- Robots policy: ${DEFAULT_AGENT_DISCOVERY_ROBOTS_TXT_ROUTE}`);
|
|
3707
4161
|
appendDocsSitemapRouteLines(lines, context);
|
|
@@ -3765,8 +4219,10 @@ function resolveDocsAgentContractMcpTools(mcp) {
|
|
|
3765
4219
|
if (mcp.tools.readTask !== false) tools.read = "read_task";
|
|
3766
4220
|
return tools.list || tools.read ? tools : void 0;
|
|
3767
4221
|
}
|
|
3768
|
-
function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, search, mcp, feedback, llms, sitemap, robots, openapi, markdown }) {
|
|
4222
|
+
function buildDocsAgentDiscoverySpec({ origin, entry = "docs", apiRoute, apiCatalog: explicitApiCatalog, i18n = null, search, mcp, feedback, llms, sitemap, robots, openapi, markdown }) {
|
|
3769
4223
|
const normalizedEntry = normalizeDocsPathSegment(entry) || "docs";
|
|
4224
|
+
const resolvedApiRoute = resolveDocsDiscoveryApiRoute(apiRoute);
|
|
4225
|
+
const apiQueryRoute = (query) => `${resolvedApiRoute}?${query}`;
|
|
3770
4226
|
const localesEnabled = i18n !== null;
|
|
3771
4227
|
const searchEnabled = isSearchEnabled(search);
|
|
3772
4228
|
const feedbackRoute = feedback?.route ?? DEFAULT_AGENT_FEEDBACK_ROUTE;
|
|
@@ -3776,7 +4232,10 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, sear
|
|
|
3776
4232
|
const sitemapConfig = resolveDocsSitemapConfig(sitemap, { baseUrl: llms?.baseUrl });
|
|
3777
4233
|
const robotsEnabled = isRobotsDiscoveryEnabled(robots);
|
|
3778
4234
|
const openapiConfig = resolveDocsOpenApiDiscoveryConfig(openapi);
|
|
4235
|
+
const defaultOpenapiRoute = apiQueryRoute("format=openapi");
|
|
4236
|
+
const openapiUrl = resolveDocsOpenApiDiscoveryUrl(openapiConfig, resolvedApiRoute);
|
|
3779
4237
|
const agentContractMcpTools = resolveDocsAgentContractMcpTools(mcp);
|
|
4238
|
+
const apiCatalogEnabled = explicitApiCatalog ?? llms?.apiCatalog ?? true;
|
|
3780
4239
|
return {
|
|
3781
4240
|
version: "1",
|
|
3782
4241
|
name: "@farming-labs/docs",
|
|
@@ -3802,6 +4261,8 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, sear
|
|
|
3802
4261
|
agents: true,
|
|
3803
4262
|
llms: llmsEnabled,
|
|
3804
4263
|
skills: true,
|
|
4264
|
+
apiCatalog: apiCatalogEnabled,
|
|
4265
|
+
agentSkillsDiscovery: true,
|
|
3805
4266
|
mcp: mcp.enabled,
|
|
3806
4267
|
search: searchEnabled,
|
|
3807
4268
|
sitemap: sitemapConfig.enabled,
|
|
@@ -3813,21 +4274,33 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, sear
|
|
|
3813
4274
|
locales: localesEnabled
|
|
3814
4275
|
},
|
|
3815
4276
|
api: {
|
|
3816
|
-
docs:
|
|
3817
|
-
config:
|
|
3818
|
-
diagnostics:
|
|
3819
|
-
agentSpec: DEFAULT_AGENT_SPEC_ROUTE,
|
|
4277
|
+
docs: resolvedApiRoute,
|
|
4278
|
+
config: apiQueryRoute("format=config"),
|
|
4279
|
+
diagnostics: apiQueryRoute("format=diagnostics"),
|
|
4280
|
+
agentSpec: resolvedApiRoute === DEFAULT_DOCS_API_ROUTE ? DEFAULT_AGENT_SPEC_ROUTE : apiQueryRoute("agent=spec"),
|
|
3820
4281
|
agentSpecDefault: DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE,
|
|
3821
4282
|
agentSpecFallback: DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE,
|
|
3822
4283
|
agentSpecWellKnown: DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE,
|
|
3823
4284
|
agentSpecWellKnownJson: DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE,
|
|
3824
|
-
agentSpecQuery:
|
|
3825
|
-
agents:
|
|
3826
|
-
|
|
4285
|
+
agentSpecQuery: apiQueryRoute("agent=spec"),
|
|
4286
|
+
agents: apiQueryRoute("format=agents"),
|
|
4287
|
+
...apiCatalogEnabled ? {
|
|
4288
|
+
apiCatalog: DEFAULT_API_CATALOG_ROUTE,
|
|
4289
|
+
apiCatalogQuery: apiQueryRoute(`format=${DEFAULT_API_CATALOG_FORMAT}`)
|
|
4290
|
+
} : {},
|
|
4291
|
+
agentSkillsIndex: DEFAULT_AGENT_SKILLS_INDEX_ROUTE,
|
|
4292
|
+
openapi: defaultOpenapiRoute
|
|
4293
|
+
},
|
|
4294
|
+
apiCatalog: {
|
|
4295
|
+
enabled: apiCatalogEnabled,
|
|
4296
|
+
route: apiCatalogEnabled ? DEFAULT_API_CATALOG_ROUTE : null,
|
|
4297
|
+
api: apiCatalogEnabled ? apiQueryRoute(`format=${DEFAULT_API_CATALOG_FORMAT}`) : null,
|
|
4298
|
+
mediaType: API_CATALOG_MEDIA_TYPE,
|
|
4299
|
+
profile: API_CATALOG_PROFILE_URI
|
|
3827
4300
|
},
|
|
3828
4301
|
config: {
|
|
3829
4302
|
format: DEFAULT_DOCS_CONFIG_FORMAT,
|
|
3830
|
-
endpoint:
|
|
4303
|
+
endpoint: apiQueryRoute("format=config")
|
|
3831
4304
|
},
|
|
3832
4305
|
markdown: {
|
|
3833
4306
|
enabled: true,
|
|
@@ -3835,7 +4308,7 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, sear
|
|
|
3835
4308
|
signatureAgentHeader: markdown?.signatureAgentHeader === false ? null : DOCS_MARKDOWN_SIGNATURE_AGENT_HEADER,
|
|
3836
4309
|
pagePattern: `/${normalizedEntry}/{slug}.md`,
|
|
3837
4310
|
rootPage: `/${normalizedEntry}.md`,
|
|
3838
|
-
apiPattern:
|
|
4311
|
+
apiPattern: apiQueryRoute("format=markdown&path={slug}"),
|
|
3839
4312
|
resolutionOrder: [
|
|
3840
4313
|
"agent.md",
|
|
3841
4314
|
"agent audience projection",
|
|
@@ -3857,8 +4330,8 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, sear
|
|
|
3857
4330
|
enabled: llmsEnabled,
|
|
3858
4331
|
defaultTxt: DEFAULT_LLMS_TXT_ROUTE,
|
|
3859
4332
|
defaultFull: DEFAULT_LLMS_FULL_TXT_ROUTE,
|
|
3860
|
-
txt:
|
|
3861
|
-
full:
|
|
4333
|
+
txt: apiQueryRoute("format=llms"),
|
|
4334
|
+
full: apiQueryRoute("format=llms-full"),
|
|
3862
4335
|
publicTxt: DEFAULT_LLMS_TXT_ROUTE,
|
|
3863
4336
|
publicFull: DEFAULT_LLMS_FULL_TXT_ROUTE,
|
|
3864
4337
|
wellKnownTxt: DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE,
|
|
@@ -3876,7 +4349,7 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, sear
|
|
|
3876
4349
|
xml: {
|
|
3877
4350
|
enabled: sitemapConfig.xml.enabled,
|
|
3878
4351
|
route: sitemapConfig.xml.route,
|
|
3879
|
-
api:
|
|
4352
|
+
api: apiQueryRoute("format=sitemap-xml"),
|
|
3880
4353
|
defaultRoute: DEFAULT_SITEMAP_XML_ROUTE
|
|
3881
4354
|
},
|
|
3882
4355
|
markdown: {
|
|
@@ -3884,7 +4357,7 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, sear
|
|
|
3884
4357
|
route: sitemapConfig.markdown.route,
|
|
3885
4358
|
docsRoute: sitemapConfig.markdown.docsRoute,
|
|
3886
4359
|
wellKnownRoute: sitemapConfig.markdown.wellKnownRoute,
|
|
3887
|
-
api:
|
|
4360
|
+
api: apiQueryRoute("format=sitemap-md"),
|
|
3888
4361
|
defaultRoute: DEFAULT_SITEMAP_MD_ROUTE,
|
|
3889
4362
|
defaultDocsRoute: DEFAULT_SITEMAP_MD_DOCS_ROUTE,
|
|
3890
4363
|
defaultWellKnownRoute: DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE
|
|
@@ -3913,7 +4386,7 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, sear
|
|
|
3913
4386
|
},
|
|
3914
4387
|
openapi: {
|
|
3915
4388
|
enabled: openapiConfig.enabled,
|
|
3916
|
-
url:
|
|
4389
|
+
url: openapiUrl ?? null,
|
|
3917
4390
|
source: openapiConfig.source ?? null,
|
|
3918
4391
|
specUrl: openapiConfig.specUrl ?? null,
|
|
3919
4392
|
apiReferencePath: openapiConfig.apiReferencePath ?? null,
|
|
@@ -3921,7 +4394,7 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, sear
|
|
|
3921
4394
|
},
|
|
3922
4395
|
search: {
|
|
3923
4396
|
enabled: searchEnabled,
|
|
3924
|
-
endpoint:
|
|
4397
|
+
endpoint: apiQueryRoute("query={query}"),
|
|
3925
4398
|
method: "GET",
|
|
3926
4399
|
queryParam: "query",
|
|
3927
4400
|
localeParam: "lang"
|
|
@@ -3931,7 +4404,7 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, sear
|
|
|
3931
4404
|
file: "AGENTS.md",
|
|
3932
4405
|
route: DEFAULT_AGENTS_MD_ROUTE,
|
|
3933
4406
|
wellKnown: DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE,
|
|
3934
|
-
api:
|
|
4407
|
+
api: apiQueryRoute("format=agents"),
|
|
3935
4408
|
generatedFallback: true,
|
|
3936
4409
|
aliases: [DEFAULT_AGENT_MD_ROUTE, DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE]
|
|
3937
4410
|
},
|
|
@@ -3940,10 +4413,18 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, sear
|
|
|
3940
4413
|
file: "skill.md",
|
|
3941
4414
|
route: DEFAULT_SKILL_MD_ROUTE,
|
|
3942
4415
|
wellKnown: DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE,
|
|
3943
|
-
api:
|
|
4416
|
+
api: apiQueryRoute("format=skill"),
|
|
3944
4417
|
generatedFallback: true,
|
|
3945
4418
|
registry: "skills.sh",
|
|
3946
4419
|
install: "npx skills add farming-labs/docs",
|
|
4420
|
+
discovery: {
|
|
4421
|
+
schema: AGENT_SKILLS_DISCOVERY_SCHEMA_URI,
|
|
4422
|
+
index: DEFAULT_AGENT_SKILLS_INDEX_ROUTE,
|
|
4423
|
+
artifact: DEFAULT_AGENT_SKILLS_ROUTE_PATTERN,
|
|
4424
|
+
apiIndex: apiQueryRoute(`format=${DEFAULT_AGENT_SKILLS_INDEX_FORMAT}`),
|
|
4425
|
+
apiArtifact: apiQueryRoute("format=agent-skill&name={name}"),
|
|
4426
|
+
digest: "sha256"
|
|
4427
|
+
},
|
|
3947
4428
|
recommended: [{
|
|
3948
4429
|
name: "getting-started",
|
|
3949
4430
|
description: "Use for installation, init, framework setup, theme CSS, and first docs.config wiring."
|
|
@@ -3965,8 +4446,8 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, sear
|
|
|
3965
4446
|
enabled: feedback?.enabled ?? false,
|
|
3966
4447
|
schema: feedbackSchemaRoute,
|
|
3967
4448
|
submit: feedbackRoute,
|
|
3968
|
-
schemaQuery:
|
|
3969
|
-
submitQuery:
|
|
4449
|
+
schemaQuery: apiQueryRoute("feedback=agent&schema=1"),
|
|
4450
|
+
submitQuery: apiQueryRoute("feedback=agent")
|
|
3970
4451
|
},
|
|
3971
4452
|
instructions: {
|
|
3972
4453
|
preferMarkdownRoutes: true,
|
|
@@ -4034,17 +4515,22 @@ function resolveDocsOpenApiDiscoveryConfig(openapi) {
|
|
|
4034
4515
|
if (openapi === true) return {
|
|
4035
4516
|
enabled: true,
|
|
4036
4517
|
url: DEFAULT_OPENAPI_SCHEMA_ROUTE,
|
|
4518
|
+
urlSource: "default",
|
|
4037
4519
|
source: "generated"
|
|
4038
4520
|
};
|
|
4039
4521
|
if (openapi.enabled === false) return { enabled: false };
|
|
4040
4522
|
return {
|
|
4041
4523
|
enabled: true,
|
|
4042
4524
|
url: openapi.url ?? DEFAULT_OPENAPI_SCHEMA_ROUTE,
|
|
4525
|
+
urlSource: openapi.urlSource ?? (openapi.url === void 0 ? "default" : "configured"),
|
|
4043
4526
|
source: openapi.source ?? "generated",
|
|
4044
4527
|
specUrl: openapi.specUrl,
|
|
4045
4528
|
apiReferencePath: openapi.apiReferencePath
|
|
4046
4529
|
};
|
|
4047
4530
|
}
|
|
4531
|
+
function resolveDocsOpenApiDiscoveryUrl(openapi, apiRoute) {
|
|
4532
|
+
return openapi.urlSource === "default" && openapi.url === DEFAULT_OPENAPI_SCHEMA_ROUTE ? `${apiRoute}?format=openapi` : openapi.url;
|
|
4533
|
+
}
|
|
4048
4534
|
function compactSkillText(value) {
|
|
4049
4535
|
return value.replace(/\s+/g, " ").trim();
|
|
4050
4536
|
}
|
|
@@ -4058,4 +4544,4 @@ function toYamlString(value) {
|
|
|
4058
4544
|
}
|
|
4059
4545
|
|
|
4060
4546
|
//#endregion
|
|
4061
|
-
export {
|
|
4547
|
+
export { matchesDocsLlmsTxtSection as $, appendDocsDiscoveryLinkHeader as $t, DOCS_TRADITIONAL_BOT_USER_AGENT_HEADER_PATTERN as A, DEFAULT_SITEMAP_MD_DOCS_ROUTE as At, findDocsMarkdownPage as B, resolveDocsSitemapPageLastmod as Bt, DEFAULT_OPENAPI_SCHEMA_ROUTE as C, validateDocsAgentFeedbackPayload as Ct, DOCS_BOT_LIKE_USER_AGENT_HEADER_PATTERN as D, resolveDocsAudienceExposure as Dt, DOCS_AI_AGENT_USER_AGENT_HEADER_PATTERN as E, resolveDocsAgentMdxContent as Et, buildDocsDiagnostics as F, createDocsSitemapResponse as Ft, isDocsAgentDiscoveryRequest as G, API_CATALOG_PROFILE_URI as Gt, getDocsMarkdownCanonicalLinkHeader as H, toDocsSitemapMarkdownUrl as Ht, buildDocsMcpEndpointCandidates as I, readDocsSitemapManifestFromContentMap as It, isDocsDiagnosticsRequest as J, DEFAULT_AGENT_SKILLS_ROUTE_PATTERN as Jt, isDocsAgentsRequest as K, DEFAULT_AGENT_SKILLS_INDEX_FORMAT as Kt, createDocsMarkdownResponse as L, renderDocsSitemapMarkdown as Lt, buildDocsAgentDiscoverySpec as M, DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE as Mt, buildDocsAgentFeedbackSchema as N, DEFAULT_SITEMAP_XML_ROUTE as Nt, DOCS_CONFIG_MAP_TOP_LEVEL_KEYS as O, resolveDocsAudienceMdxContent as Ot, buildDocsConfigMap as P, buildDocsSitemapManifest as Pt, isDocsSkillRequest as Q, DEFAULT_API_CATALOG_ROUTE as Qt, createDocsStandardsDiscoveryResponse as R, renderDocsSitemapXml as Rt, DEFAULT_MCP_WELL_KNOWN_ROUTE as S, upsertPageAgentContractMarkdown as Sn, toDocsMarkdownUrl as St, DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE as T, findDocsAudienceMdxTags as Tt, getDocsMarkdownVaryHeader as U, AGENT_SKILLS_DISCOVERY_SCHEMA_URI as Ut, getDocsLlmsTxtMaxCharsIssue as V, resolveDocsSitemapRequest as Vt, hasDocsMarkdownSignatureAgent as W, API_CATALOG_MEDIA_TYPE as Wt, isDocsMcpRequest as X, DEFAULT_AGENT_SKILL_FORMAT as Xt, isDocsLlmsTxtPublicRequest as Y, DEFAULT_AGENT_SKILLS_ROUTE_PREFIX as Yt, isDocsPublicGetRequest as Z, DEFAULT_API_CATALOG_FORMAT as Zt, DEFAULT_LLMS_TXT_MAX_CHARS as _, hasStructuredPageAgentContract as _n, resolveDocsMarkdownRequest as _t, DEFAULT_AGENT_MD_ROUTE as a, resolveDocsDiscoveryApiRoute as an, renderDocsMarkdownDocument as at, DEFAULT_MCP_PUBLIC_ROUTE as b, renderPageAgentFrontmatterYamlLines as bn, resolveDocsSkillFormat as bt, DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE as c, sha256DocsDiscoveryContent as cn, resolveDocsAgentContractMcpTools as ct, DEFAULT_DOCS_CONFIG_FORMAT as d, PAGE_AGENT_CONTRACT_END_MARKER as dn, resolveDocsAgentsFormat as dt, buildDocsAgentSkillsIndex as en, normalizeDocsPathSegment as et, DEFAULT_DOCS_CONFIG_ROUTE as f, PAGE_AGENT_CONTRACT_FIELDS as fn, resolveDocsLlmsTxtFormat as ft, DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE as g, getPageAgentFrontmatterIssues as gn, resolveDocsMarkdownRecovery as gt, DEFAULT_LLMS_FULL_TXT_ROUTE as h, PAGE_AGENT_STRUCTURED_CONTRACT_FIELDS as hn, resolveDocsMarkdownCanonicalUrl as ht, DEFAULT_AGENT_FEEDBACK_ROUTE as i, isDocsStandardsDiscoveryRequest as in, renderDocsLlmsTxt as it, acceptsDocsMarkdown as j, DEFAULT_SITEMAP_MD_ROUTE as jt, DOCS_MARKDOWN_SIGNATURE_AGENT_HEADER as k, DEFAULT_SITEMAP_MANIFEST_PATH as kt, DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE as l, normalizeDocsRelated as ln, resolveDocsAgentFeedbackConfig as lt, DEFAULT_DOCS_DIAGNOSTICS_ROUTE as m, PAGE_AGENT_CONTRACT_START_MARKER as mn, resolveDocsLlmsTxtSections as mt, DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE as n, createDocsStandardsResponse as nn, parseDocsAgentFeedbackData as nt, DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE as o, resolveDocsPublishedAgentSkill as on, renderDocsMarkdownNotFound as ot, DEFAULT_DOCS_DIAGNOSTICS_FORMAT as p, PAGE_AGENT_CONTRACT_FIELD_SCHEMA as pn, resolveDocsLlmsTxtRequest as pt, isDocsConfigRequest as q, DEFAULT_AGENT_SKILLS_INDEX_ROUTE as qt, DEFAULT_AGENT_FEEDBACK_PAYLOAD_SCHEMA as r, getDocsDiscoveryLinkHeader as rn, renderDocsAgentsDocument as rt, DEFAULT_AGENT_SPEC_ROUTE as s, resolveDocsStandardsDiscoveryRequest as sn, renderDocsSkillDocument as st, DEFAULT_AGENTS_MD_ROUTE as t, buildDocsApiCatalog as tn, normalizeDocsUrlPath as tt, DEFAULT_DOCS_API_ROUTE as u, renderDocsRelatedMarkdownLines as un, resolveDocsAgentFeedbackRequest as ut, DEFAULT_LLMS_TXT_ROUTE as v, normalizePageAgentFrontmatter as vn, resolveDocsOpenApiDiscoveryConfig as vt, DEFAULT_SKILL_MD_ROUTE as w, findDocsAudienceMdxIssues as wt, DEFAULT_MCP_ROUTE as x, stripGeneratedPageAgentContractMarkdown as xn, selectDocsLlmsTxtContent as xt, DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE as y, renderPageAgentContractMarkdown as yn, resolveDocsRequestApiRoute as yt, detectDocsMarkdownAgentRequest as z, resolveDocsSitemapConfig as zt };
|