@farming-labs/docs 0.2.103 → 0.2.105
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-BLHMoVId.mjs → agent-CaCWThBY.mjs} +4 -4
- package/dist/{agent-CFqECAG0.mjs → agent-DCTGj6J7.mjs} +212 -19
- package/dist/{agent-evals-GpcaCbRb.mjs → agent-evals-D-sPJfXz.mjs} +5 -5
- package/dist/{agent-export-oiWxB5aX.mjs → agent-export-GcTZPLfB.mjs} +30 -17
- package/dist/agent-feedback-evaluations-DQCTFegz.mjs +240 -0
- package/dist/agent-feedback-loop-vaC-M1sx.mjs +196 -0
- package/dist/agent-maintenance-CuZ7iAKq.mjs +289 -0
- package/dist/agent-skills-bundle.d.mts +1 -1
- package/dist/{agent-skills-progressive-disclosure-Da9LKEKv.mjs → agent-skills-progressive-disclosure-DL-q4JZo.mjs} +1 -1
- package/dist/{agent-skills-server-CICMh0zv.d.mts → agent-skills-server-D34054x5.d.mts} +2 -2
- package/dist/{agent-skills-server-DFqQyO_V.mjs → agent-skills-server-Ddbf15pY.mjs} +1 -1
- package/dist/agent-skills-vite.d.mts +3 -3
- package/dist/agent-skills-vite.mjs +2 -2
- package/dist/{agents-CtqIUW5I.mjs → agents-e1SYT64z.mjs} +11 -10
- package/dist/{analytics-Bx44lg6d.mjs → analytics-CqfcIBdg.mjs} +1 -1
- package/dist/{analytics-C75BnTEW.d.mts → analytics-aeXwEvQX.d.mts} +1 -1
- package/dist/authoring-Do87QzBd.mjs +41 -0
- package/dist/authoring-mcp-Be7quE5R.mjs +380 -0
- package/dist/browser.d.mts +3 -3
- package/dist/browser.mjs +2 -2
- package/dist/cli/index.mjs +103 -35
- package/dist/client/react.d.mts +1 -1
- package/dist/client/react.mjs +1 -1
- package/dist/{cloud-FNfcbfli.mjs → cloud-Bvof6mET.mjs} +3 -3
- package/dist/{cloud-ask-ai-BmbZVAT5.d.mts → cloud-ask-ai-BqfiQaNZ.d.mts} +1 -1
- package/dist/{cloud-ask-ai-CkCYjf2N.mjs → cloud-ask-ai-CK2qlNns.mjs} +1 -1
- package/dist/{code-blocks-Bel6vDqI.mjs → code-blocks-D90CCJFs.mjs} +1 -1
- package/dist/{codeblocks-jbWuvtJQ.mjs → codeblocks-C911CdyJ.mjs} +2 -2
- package/dist/{agent-lWTq6pgr.d.mts → content-change-hydration-CoYRs3pC.d.mts} +707 -675
- package/dist/{dev-BvbYmTLz.mjs → dev-Bx0JNglW.mjs} +3 -3
- package/dist/docs-cloud-server.d.mts +2 -2
- package/dist/docs-cloud-server.mjs +2 -2
- package/dist/{doctor-Bmm0uY98.mjs → doctor-CtK1CRPj.mjs} +20 -16
- package/dist/{downgrade-Dqm0rJMy.mjs → downgrade-BXmQMkMy.mjs} +2 -2
- package/dist/feedback-DWVUMrxy.mjs +72 -0
- package/dist/feedback-evals-k0sFDdms.mjs +146 -0
- package/dist/{golden-evaluations-K45fcWGW.mjs → golden-evaluations-De4KwoYr.mjs} +3 -3
- package/dist/index.d.mts +236 -9
- package/dist/index.mjs +14 -11
- package/dist/{init-jDQSo-Or.mjs → init-CCV2eRNB.mjs} +3 -3
- package/dist/markdown-rendering.mjs +1 -1
- package/dist/{markdown-sections-7OoA7ylx.mjs → markdown-sections-BKy4labo.mjs} +110 -2
- package/dist/{mcp-CwgKlbIz.mjs → mcp-DsjWxF7g.mjs} +11 -10
- package/dist/mcp.d.mts +20 -5
- package/dist/mcp.mjs +538 -56
- package/dist/{metadata-D4v_R1t5.mjs → metadata-7htr-Xj_.mjs} +1 -1
- package/dist/{content-change-hydration-BsbBXAUi.mjs → openapi-mcp-DQ3xptKo.mjs} +182 -4
- package/dist/openapi-mcp-node-vO3IXVGI.mjs +43 -0
- package/dist/{package-version--oQiHwZj.mjs → package-version-Ci99L0yo.mjs} +1 -1
- package/dist/{prompt-references-DW5vG5zs.mjs → prompt-references-1Wce71c7.mjs} +3 -3
- package/dist/propose-DJOiHu9Y.mjs +73 -0
- package/dist/retrieval-digest-B-SgtXKK.mjs +177 -0
- package/dist/retrieval-digest-DyNRD-mt.d.mts +467 -0
- package/dist/{review-C_5wB0rR.mjs → review-XI9FXeos.mjs} +12 -12
- package/dist/{robots-NQesPX5L.mjs → robots-BOjWB1ky.mjs} +2 -2
- package/dist/{robots-BQ42Y84a.mjs → robots-CzKesbdX.mjs} +6 -6
- package/dist/{search-B5etKU-v.mjs → search-DwAoC9X7.mjs} +12 -11
- package/dist/server.d.mts +47 -264
- package/dist/server.mjs +14 -11
- package/dist/{sidebar-CwZlgyAz.d.mts → sidebar-CJze8SBi.d.mts} +1 -1
- package/dist/{sitemap-DjhxvQP1.mjs → sitemap-DOaJIKJf.mjs} +11 -10
- package/dist/{sitemap-server-B0SiREN0.mjs → sitemap-server-NeVu8W38.mjs} +11 -1
- package/dist/{skills-BFang8vF.mjs → skills-BILSESek.mjs} +11 -10
- package/dist/{standards-discovery-Ckx0tN7B.mjs → standards-discovery-Bpz90VYq.mjs} +2 -177
- package/dist/{standards-discovery-D1Ys4J3h.d.mts → standards-discovery-Xm84bS4M.d.mts} +1 -1
- package/dist/{types-DLLefoU5.d.mts → types-QhYMnKvb.d.mts} +148 -2
- package/dist/{upgrade-kj2crJSk.mjs → upgrade-B92U83xo.mjs} +2 -2
- package/package.json +1 -1
- package/dist/retrieval-digest-DYEsIeCE.d.mts +0 -164
- /package/dist/{audience-exposure-Cw3SA4WE.d.mts → audience-exposure-CkNZNeVX.d.mts} +0 -0
- /package/dist/{cloud-analytics-CSyFE6SS.mjs → cloud-analytics-Ci1yiwD8.mjs} +0 -0
- /package/dist/{config-BaTmjDqD.mjs → config-DrZ3fXgf.mjs} +0 -0
- /package/dist/{errors-DZiNXv5c.mjs → errors-BDmra6mz.mjs} +0 -0
- /package/dist/{i18n-B3BIxShC.mjs → i18n-B1gJ9EW0.mjs} +0 -0
- /package/dist/{sidebar-IcpElOVH.mjs → sidebar-3W51s2sF.mjs} +0 -0
- /package/dist/{templates-kc7jxspR.mjs → templates-DdB4BBGq.mjs} +0 -0
- /package/dist/{utils-DOMeZW9V.mjs → utils-Cc1SrVza.mjs} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { v as normalizePageAgentFrontmatter, x as stripGeneratedPageAgentContractMarkdown } from "./markdown-sections-BKy4labo.mjs";
|
|
2
|
+
import { V as findDocsMarkdownPage, ot as renderDocsMarkdownDocument } from "./agent-DCTGj6J7.mjs";
|
|
3
|
+
import { d as GENERATED_AGENT_PROVENANCE_VERSION, f as hashGeneratedAgentContent, h as serializeGeneratedAgentDocument, m as parseGeneratedAgentDocument } from "./openapi-mcp-DQ3xptKo.mjs";
|
|
4
4
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
5
|
-
import { _ as resolveDocsContentDir, a as loadDocsConfigModule, c as loadProjectEnv, d as readNavTitle, f as readNumberProperty, g as resolveDocsConfigPath, h as readTopLevelStringProperty, l as readBooleanProperty, p as readStringProperty, t as extractNestedObjectLiteral, u as readEnvReferenceProperty } from "./config-
|
|
5
|
+
import { _ as resolveDocsContentDir, a as loadDocsConfigModule, c as loadProjectEnv, d as readNavTitle, f as readNumberProperty, g as resolveDocsConfigPath, h as readTopLevelStringProperty, l as readBooleanProperty, p as readStringProperty, t as extractNestedObjectLiteral, u as readEnvReferenceProperty } from "./config-DrZ3fXgf.mjs";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
7
7
|
import matter from "gray-matter";
|
|
8
8
|
import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
@@ -1,8 +1,153 @@
|
|
|
1
|
-
import { S as upsertPageAgentContractMarkdown, a as findDocsGeneratedAgentContractRanges, b as renderPageAgentFrontmatterYamlLines, d as PAGE_AGENT_CONTRACT_END_MARKER, l as stripDocsGeneratedAgentContractMarkers, m as PAGE_AGENT_CONTRACT_START_MARKER, o as findDocsMarkdownSection, p as PAGE_AGENT_CONTRACT_FIELD_SCHEMA, s as parseDocsMarkdownSections, y as renderPageAgentContractMarkdown } from "./markdown-sections-
|
|
2
|
-
import {
|
|
1
|
+
import { C as filterDocsPagesByAccess, S as upsertPageAgentContractMarkdown, T as isDocsPageAccessAllowed, a as findDocsGeneratedAgentContractRanges, b as renderPageAgentFrontmatterYamlLines, d as PAGE_AGENT_CONTRACT_END_MARKER, l as stripDocsGeneratedAgentContractMarkers, m as PAGE_AGENT_CONTRACT_START_MARKER, o as findDocsMarkdownSection, p as PAGE_AGENT_CONTRACT_FIELD_SCHEMA, s as parseDocsMarkdownSections, y as renderPageAgentContractMarkdown } from "./markdown-sections-BKy4labo.mjs";
|
|
2
|
+
import { n as digestDocsRetrievalContent, r as isDocsRetrievalCanonicalUrl } from "./retrieval-digest-B-SgtXKK.mjs";
|
|
3
3
|
import { t as resolveDocsAudienceExposure } from "./audience-exposure-DVsfT9Sx.mjs";
|
|
4
|
+
import { B as createDocsCacheableResponse, F as isDocsStandardsDiscoveryRequest, I as resolveDocsDiscoveryApiRoute, M as createDocsStandardsResponse, S as DOCS_AGENT_MANIFEST_FORMAT, T as DOCS_AGENT_MANIFEST_VERSION, W as resolveDocsHttpDate, _ as DEFAULT_API_CATALOG_FORMAT, a as DEFAULT_A2A_AGENT_CARD_ROUTE, b as DEFAULT_LEGACY_SKILLS_INDEX_ROUTE, c as DEFAULT_AGENT_SKILLS_ARCHIVE_ROUTE_PATTERN, d as DEFAULT_AGENT_SKILLS_ROUTE_PATTERN, k as buildDocsApiCatalog, l as DEFAULT_AGENT_SKILLS_INDEX_FORMAT, n as API_CATALOG_MEDIA_TYPE, r as API_CATALOG_PROFILE_URI, t as AGENT_SKILLS_DISCOVERY_SCHEMA_URI, u as DEFAULT_AGENT_SKILLS_INDEX_ROUTE, v as DEFAULT_API_CATALOG_ROUTE, w as DOCS_AGENT_MANIFEST_SCHEMA_URI } from "./standards-discovery-Bpz90VYq.mjs";
|
|
4
5
|
import { createProcessor } from "@mdx-js/mdx";
|
|
5
6
|
|
|
7
|
+
//#region src/okf.ts
|
|
8
|
+
const DOCS_OKF_VERSION = "0.2";
|
|
9
|
+
const DOCS_OKF_BUNDLE_FORMAT = "open-knowledge-format.v0.2";
|
|
10
|
+
const DEFAULT_DOCS_OKF_ROUTE = "/.well-known/okf.json";
|
|
11
|
+
function cleanString$1(value) {
|
|
12
|
+
if (typeof value !== "string") return void 0;
|
|
13
|
+
return value.trim() || void 0;
|
|
14
|
+
}
|
|
15
|
+
function normalizeDate(value) {
|
|
16
|
+
if (value instanceof Date && Number.isFinite(value.getTime())) return value.toISOString();
|
|
17
|
+
const stringValue = cleanString$1(value);
|
|
18
|
+
if (!stringValue) return void 0;
|
|
19
|
+
const parsed = new Date(stringValue);
|
|
20
|
+
return Number.isFinite(parsed.getTime()) ? parsed.toISOString() : void 0;
|
|
21
|
+
}
|
|
22
|
+
function normalizeDateOnly$1(value) {
|
|
23
|
+
return normalizeDate(value)?.slice(0, 10);
|
|
24
|
+
}
|
|
25
|
+
function normalizeStatus(value) {
|
|
26
|
+
return value === "draft" || value === "stable" || value === "deprecated" ? value : void 0;
|
|
27
|
+
}
|
|
28
|
+
function normalizeActorTimestamp(value) {
|
|
29
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
|
|
30
|
+
const record = value;
|
|
31
|
+
const by = cleanString$1(record.by);
|
|
32
|
+
const at = normalizeDate(record.at);
|
|
33
|
+
return by && at ? {
|
|
34
|
+
by,
|
|
35
|
+
at
|
|
36
|
+
} : void 0;
|
|
37
|
+
}
|
|
38
|
+
function normalizeSource(value) {
|
|
39
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
|
|
40
|
+
const record = value;
|
|
41
|
+
const resource = cleanString$1(record.resource);
|
|
42
|
+
if (!resource) return void 0;
|
|
43
|
+
const usageCount = typeof record.usage_count === "number" && Number.isInteger(record.usage_count) ? Math.max(0, record.usage_count) : void 0;
|
|
44
|
+
const usageWindowRecord = record.usage_window && typeof record.usage_window === "object" && !Array.isArray(record.usage_window) ? record.usage_window : void 0;
|
|
45
|
+
const usageWindow = usageWindowRecord ? {
|
|
46
|
+
...normalizeDate(usageWindowRecord.start) ? { start: normalizeDate(usageWindowRecord.start) } : {},
|
|
47
|
+
...normalizeDate(usageWindowRecord.end) ? { end: normalizeDate(usageWindowRecord.end) } : {}
|
|
48
|
+
} : void 0;
|
|
49
|
+
return {
|
|
50
|
+
resource,
|
|
51
|
+
...cleanString$1(record.id) ? { id: cleanString$1(record.id) } : {},
|
|
52
|
+
...cleanString$1(record.title) ? { title: cleanString$1(record.title) } : {},
|
|
53
|
+
...cleanString$1(record.author) ? { author: cleanString$1(record.author) } : {},
|
|
54
|
+
...usageCount !== void 0 ? { usage_count: usageCount } : {},
|
|
55
|
+
...normalizeDate(record.last_modified) ? { last_modified: normalizeDate(record.last_modified) } : {},
|
|
56
|
+
...usageWindow && Object.keys(usageWindow).length > 0 ? { usage_window: usageWindow } : {}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function normalizeDocsOkfTrustMetadataInput(value) {
|
|
60
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
|
|
61
|
+
const record = value;
|
|
62
|
+
const sources = Array.isArray(record.sources) ? record.sources.flatMap((source) => {
|
|
63
|
+
const normalized = normalizeSource(source);
|
|
64
|
+
return normalized ? [normalized] : [];
|
|
65
|
+
}) : void 0;
|
|
66
|
+
const verified = Array.isArray(record.verified) ? record.verified.flatMap((entry) => {
|
|
67
|
+
const normalized = normalizeActorTimestamp(entry);
|
|
68
|
+
return normalized ? [normalized] : [];
|
|
69
|
+
}) : void 0;
|
|
70
|
+
const generated = normalizeActorTimestamp(record.generated);
|
|
71
|
+
const status = normalizeStatus(record.status);
|
|
72
|
+
const staleAfter = normalizeDateOnly$1(record.stale_after);
|
|
73
|
+
const result = {
|
|
74
|
+
...sources && sources.length > 0 ? { sources } : {},
|
|
75
|
+
...generated ? { generated } : {},
|
|
76
|
+
...verified && verified.length > 0 ? { verified } : {},
|
|
77
|
+
...status ? { status } : {},
|
|
78
|
+
...staleAfter ? { stale_after: staleAfter } : {}
|
|
79
|
+
};
|
|
80
|
+
return Object.keys(result).length > 0 ? result : void 0;
|
|
81
|
+
}
|
|
82
|
+
function resolveDocsOkfConfig(value) {
|
|
83
|
+
const config = value && typeof value === "object" ? value : {};
|
|
84
|
+
return {
|
|
85
|
+
enabled: value === true || typeof value === "object" && value !== null && value.enabled !== false,
|
|
86
|
+
route: cleanString$1(config.route) ?? DEFAULT_DOCS_OKF_ROUTE,
|
|
87
|
+
generatedBy: cleanString$1(config.generatedBy) ?? "software:@farming-labs/docs",
|
|
88
|
+
...Number.isInteger(config.staleAfterDays) && (config.staleAfterDays ?? 0) > 0 ? { staleAfterDays: config.staleAfterDays } : {},
|
|
89
|
+
...normalizeDocsOkfTrustMetadataInput(config)
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
function addDays(value, days) {
|
|
93
|
+
const parsed = new Date(value);
|
|
94
|
+
if (!Number.isFinite(parsed.getTime())) return void 0;
|
|
95
|
+
parsed.setUTCDate(parsed.getUTCDate() + days);
|
|
96
|
+
return parsed.toISOString().slice(0, 10);
|
|
97
|
+
}
|
|
98
|
+
function trustTier(verified) {
|
|
99
|
+
if (verified.some((entry) => entry.by.toLowerCase().startsWith("human:"))) return "human-reviewed";
|
|
100
|
+
return verified.length > 0 ? "machine-confirmed" : "unverified";
|
|
101
|
+
}
|
|
102
|
+
function resolveDocsOkfTrustMetadata(page, value, now = /* @__PURE__ */ new Date()) {
|
|
103
|
+
const config = resolveDocsOkfConfig(value);
|
|
104
|
+
const authored = normalizeDocsOkfTrustMetadataInput(page.okf) ?? {};
|
|
105
|
+
const bestTimestamp = normalizeDate(page.lastmod) ?? normalizeDate(page.lastModified);
|
|
106
|
+
const generated = authored.generated ?? config.generated ?? {
|
|
107
|
+
by: config.generatedBy,
|
|
108
|
+
at: bestTimestamp ?? "1970-01-01T00:00:00.000Z"
|
|
109
|
+
};
|
|
110
|
+
const sources = [...authored.sources ?? config.sources ?? []];
|
|
111
|
+
if (sources.length === 0) sources.push({
|
|
112
|
+
resource: page.canonicalUrl ?? page.url,
|
|
113
|
+
...page.sourcePath ? { id: page.sourcePath } : {},
|
|
114
|
+
title: page.title,
|
|
115
|
+
...bestTimestamp ? { last_modified: bestTimestamp } : {}
|
|
116
|
+
});
|
|
117
|
+
const verified = [...authored.verified ?? config.verified ?? []];
|
|
118
|
+
const staleAfter = authored.stale_after ?? config.stale_after ?? (config.staleAfterDays && bestTimestamp ? addDays(bestTimestamp, config.staleAfterDays) : void 0);
|
|
119
|
+
return {
|
|
120
|
+
sources,
|
|
121
|
+
generated,
|
|
122
|
+
verified,
|
|
123
|
+
status: authored.status ?? config.status ?? "stable",
|
|
124
|
+
...staleAfter ? { stale_after: staleAfter } : {},
|
|
125
|
+
trust_tier: trustTier(verified),
|
|
126
|
+
stale: staleAfter ? now.getTime() > (/* @__PURE__ */ new Date(`${staleAfter}T23:59:59.999Z`)).getTime() : false
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function buildDocsOkfBundle(pages, value) {
|
|
130
|
+
const config = resolveDocsOkfConfig(value);
|
|
131
|
+
const documents = pages.map((page) => ({
|
|
132
|
+
id: page.sourcePath ?? page.url,
|
|
133
|
+
url: page.canonicalUrl ?? page.url,
|
|
134
|
+
title: page.title,
|
|
135
|
+
...page.content ? { content: page.content } : {},
|
|
136
|
+
trust: resolveDocsOkfTrustMetadata(page, config)
|
|
137
|
+
})).sort((left, right) => left.url.localeCompare(right.url));
|
|
138
|
+
const generatedAt = documents.reduce((latest, document) => document.trust.generated.at > latest ? document.trust.generated.at : latest, "1970-01-01T00:00:00.000Z");
|
|
139
|
+
return {
|
|
140
|
+
format: DOCS_OKF_BUNDLE_FORMAT,
|
|
141
|
+
spec_version: DOCS_OKF_VERSION,
|
|
142
|
+
generated: {
|
|
143
|
+
by: config.generatedBy,
|
|
144
|
+
at: generatedAt
|
|
145
|
+
},
|
|
146
|
+
documents
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
//#endregion
|
|
6
151
|
//#region src/mcp-auth.ts
|
|
7
152
|
const DEFAULT_MCP_ROUTE = "/api/docs/mcp";
|
|
8
153
|
const DEFAULT_MCP_PUBLIC_ROUTE = "/mcp";
|
|
@@ -2990,17 +3135,18 @@ async function buildDocsSearchIndexGeneration(pages, options) {
|
|
|
2990
3135
|
* locale, base URL, and chunking policy.
|
|
2991
3136
|
*/
|
|
2992
3137
|
async function buildDocsContentSnapshot(options) {
|
|
3138
|
+
const pages = filterDocsPagesByAccess(options.pages, options.principal);
|
|
2993
3139
|
const audience = resolveDocsSearchAudience(options.audience);
|
|
2994
3140
|
const search = normalizeDocsSearchConfig(options.search);
|
|
2995
3141
|
const digestCache = /* @__PURE__ */ new Map();
|
|
2996
|
-
const indexGeneration = options.indexGeneration ?? await buildDocsSearchIndexGeneration(
|
|
3142
|
+
const indexGeneration = options.indexGeneration ?? await buildDocsSearchIndexGeneration(pages, {
|
|
2997
3143
|
audience,
|
|
2998
3144
|
chunking: search.chunking,
|
|
2999
3145
|
locale: options.locale,
|
|
3000
3146
|
baseUrl: options.baseUrl,
|
|
3001
3147
|
digestCache
|
|
3002
3148
|
});
|
|
3003
|
-
const documents = await Promise.all(
|
|
3149
|
+
const documents = await Promise.all(pages.map(async (page) => {
|
|
3004
3150
|
const localizedPage = localizeDocsSearchPage(page, options.locale);
|
|
3005
3151
|
const source = await buildDocsRetrievalSource(page, localizedPage.url, {
|
|
3006
3152
|
audience,
|
|
@@ -3315,6 +3461,7 @@ async function enrichDocsSearchResultsWithSources(options) {
|
|
|
3315
3461
|
const page = findPageForSearchResult(localizedPages, result, options.baseUrl, pagesByRoute);
|
|
3316
3462
|
if (page) return {
|
|
3317
3463
|
...resultWithoutSource,
|
|
3464
|
+
trust: resolveDocsOkfTrustMetadata(page),
|
|
3318
3465
|
source: await buildDocsRetrievalSource(page, result.url, {
|
|
3319
3466
|
audience: options.audience,
|
|
3320
3467
|
chunking: options.chunking,
|
|
@@ -4986,7 +5133,9 @@ async function performDocsSearchInternal(options) {
|
|
|
4986
5133
|
const audience = resolveDocsSearchAudience(options.audience);
|
|
4987
5134
|
const filters = normalizeDocsSearchFilters(options.filters);
|
|
4988
5135
|
const hasFilters = hasDocsSearchFilters(filters);
|
|
4989
|
-
const
|
|
5136
|
+
const accessiblePages = filterDocsPagesByAccess(options.pages, options.principal);
|
|
5137
|
+
const accessibleGenerationPages = filterDocsPagesByAccess(options.generationPages ?? options.pages, options.principal);
|
|
5138
|
+
const corpusPages = accessiblePages.map((page) => localizeDocsSearchPage(page, options.locale));
|
|
4990
5139
|
const indexBaseUrl = options.syncBaseUrl === null ? void 0 : options.syncBaseUrl ?? options.baseUrl;
|
|
4991
5140
|
const scopedPages = hasFilters ? corpusPages.filter((page) => docsSearchPageMatchesFilters(resolveDocsSearchPageScope(page), filters)) : corpusPages;
|
|
4992
5141
|
let resolvedDocuments;
|
|
@@ -5025,7 +5174,7 @@ async function performDocsSearchInternal(options) {
|
|
|
5025
5174
|
};
|
|
5026
5175
|
let currentIndexGeneration;
|
|
5027
5176
|
const getCurrentIndexGeneration = () => {
|
|
5028
|
-
currentIndexGeneration ??= options.indexGeneration ? Promise.resolve(options.indexGeneration) : buildDocsSearchIndexGeneration(
|
|
5177
|
+
currentIndexGeneration ??= options.indexGeneration ? Promise.resolve(options.indexGeneration) : buildDocsSearchIndexGeneration(accessibleGenerationPages, {
|
|
5029
5178
|
audience,
|
|
5030
5179
|
chunking: search.chunking,
|
|
5031
5180
|
locale: options.locale,
|
|
@@ -5036,7 +5185,7 @@ async function performDocsSearchInternal(options) {
|
|
|
5036
5185
|
const requireCurrentIndexGeneration = search.provider === "algolia" || search.provider === "typesense";
|
|
5037
5186
|
let hostedIndexGeneration;
|
|
5038
5187
|
const getHostedIndexGeneration = () => {
|
|
5039
|
-
hostedIndexGeneration ??= audience === "human" ? getCurrentIndexGeneration() : buildDocsSearchIndexGeneration(
|
|
5188
|
+
hostedIndexGeneration ??= audience === "human" ? getCurrentIndexGeneration() : buildDocsSearchIndexGeneration(accessibleGenerationPages, {
|
|
5040
5189
|
audience: "human",
|
|
5041
5190
|
chunking: search.chunking,
|
|
5042
5191
|
locale: options.locale,
|
|
@@ -5290,8 +5439,9 @@ async function buildDocsSearchFacets(options) {
|
|
|
5290
5439
|
const requestedLimit = options.limit ?? MAX_SEARCH_FACET_VALUES;
|
|
5291
5440
|
if (!Number.isSafeInteger(requestedLimit) || requestedLimit < 1 || requestedLimit > MAX_SEARCH_FACET_VALUES) throw new DocsSearchRequestError("Search limit must be an integer between 1 and 100.");
|
|
5292
5441
|
if (options.cursor !== void 0 && options.facet === void 0) throw new DocsSearchRequestError("Facet continuation cursors require a `facet` field.");
|
|
5293
|
-
const
|
|
5294
|
-
const
|
|
5442
|
+
const accessiblePages = filterDocsPagesByAccess(options.pages, options.principal);
|
|
5443
|
+
const pages = accessiblePages.map((page) => localizeDocsSearchPage(page, options.locale)).map((page) => ({ scope: resolveDocsSearchPageScope(page) }));
|
|
5444
|
+
const indexGeneration = options.indexGeneration ?? await buildDocsSearchIndexGeneration(accessiblePages, {
|
|
5295
5445
|
audience,
|
|
5296
5446
|
chunking: search.chunking,
|
|
5297
5447
|
locale: options.locale,
|
|
@@ -5436,7 +5586,7 @@ async function performDocsSearchWithMetadata(options) {
|
|
|
5436
5586
|
const search = normalizeDocsSearchConfig(options.search);
|
|
5437
5587
|
const requestedLimit = options.limit ?? search.maxResults ?? DEFAULT_SEARCH_LIMIT;
|
|
5438
5588
|
const limit = Number.isFinite(requestedLimit) && requestedLimit > 0 ? Math.max(1, Math.floor(requestedLimit)) : DEFAULT_SEARCH_LIMIT;
|
|
5439
|
-
const indexGeneration = options.indexGeneration ?? await buildDocsSearchIndexGeneration(options.generationPages ?? options.pages, {
|
|
5589
|
+
const indexGeneration = options.indexGeneration ?? await buildDocsSearchIndexGeneration(filterDocsPagesByAccess(options.generationPages ?? options.pages, options.principal), {
|
|
5440
5590
|
audience,
|
|
5441
5591
|
chunking: search.chunking,
|
|
5442
5592
|
locale: options.locale,
|
|
@@ -6123,6 +6273,8 @@ const DEFAULT_DOCS_DIAGNOSTICS_MCP_TOOLS = {
|
|
|
6123
6273
|
listPages: true,
|
|
6124
6274
|
listPageSections: true,
|
|
6125
6275
|
readPage: true,
|
|
6276
|
+
readPages: true,
|
|
6277
|
+
submitFeedback: true,
|
|
6126
6278
|
listTasks: true,
|
|
6127
6279
|
readTask: true,
|
|
6128
6280
|
searchDocs: true,
|
|
@@ -7152,6 +7304,7 @@ function renderLlmsFullTxtPages(pages, baseUrl) {
|
|
|
7152
7304
|
return content;
|
|
7153
7305
|
}
|
|
7154
7306
|
function renderDocsLlmsTxt(pages, options = {}) {
|
|
7307
|
+
pages = filterDocsPagesByAccess(pages);
|
|
7155
7308
|
const siteTitle = options.siteTitle ?? "Documentation";
|
|
7156
7309
|
const siteDescription = options.siteDescription;
|
|
7157
7310
|
const baseUrl = options.baseUrl ?? "";
|
|
@@ -7633,7 +7786,7 @@ function resolveDocsMarkdownMetadataUrl(value, origin) {
|
|
|
7633
7786
|
return value;
|
|
7634
7787
|
}
|
|
7635
7788
|
}
|
|
7636
|
-
function renderDocsMarkdownFrontmatter({ title, description, canonicalUrl, markdownUrl, lastUpdated, agent, generatedPreamble }) {
|
|
7789
|
+
function renderDocsMarkdownFrontmatter({ title, description, canonicalUrl, markdownUrl, lastUpdated, trust, agent, generatedPreamble }) {
|
|
7637
7790
|
return [
|
|
7638
7791
|
"---",
|
|
7639
7792
|
`title: ${toYamlString(title)}`,
|
|
@@ -7641,6 +7794,7 @@ function renderDocsMarkdownFrontmatter({ title, description, canonicalUrl, markd
|
|
|
7641
7794
|
`canonical_url: ${toYamlString(canonicalUrl)}`,
|
|
7642
7795
|
`markdown_url: ${toYamlString(markdownUrl)}`,
|
|
7643
7796
|
...lastUpdated ? [`last_updated: ${toYamlString(lastUpdated)}`] : [],
|
|
7797
|
+
...trust ? [`okf: ${JSON.stringify(trust)}`] : [],
|
|
7644
7798
|
...generatedPreamble ? [`${DOCS_MARKDOWN_GENERATED_PREAMBLE_FIELD}: true`] : [],
|
|
7645
7799
|
...renderPageAgentFrontmatterYamlLines(agent),
|
|
7646
7800
|
"---"
|
|
@@ -7914,13 +8068,19 @@ function selectDocsMarkdownSection(document, request) {
|
|
|
7914
8068
|
};
|
|
7915
8069
|
}
|
|
7916
8070
|
function resolveDocsMarkdownPageMetadata(page, options) {
|
|
8071
|
+
const canonicalUrl = resolveDocsMarkdownMetadataUrl(page.url, options?.origin);
|
|
8072
|
+
const okfEnabled = resolveDocsOkfConfig(options?.okf).enabled || page.okf !== void 0;
|
|
7917
8073
|
return {
|
|
7918
8074
|
title: page.title,
|
|
7919
8075
|
description: page.description,
|
|
7920
|
-
canonicalUrl
|
|
8076
|
+
canonicalUrl,
|
|
7921
8077
|
markdownUrl: resolveDocsMarkdownMetadataUrl(page.markdownUrl ?? toDocsMarkdownUrl(page.url), options?.origin),
|
|
7922
8078
|
lastUpdated: normalizeDocsMarkdownLastUpdated(page.lastmod ?? page.lastModified),
|
|
7923
|
-
agent: page.agent
|
|
8079
|
+
agent: page.agent,
|
|
8080
|
+
...okfEnabled ? { trust: resolveDocsOkfTrustMetadata({
|
|
8081
|
+
...page,
|
|
8082
|
+
canonicalUrl
|
|
8083
|
+
}, options?.okf) } : {}
|
|
7924
8084
|
};
|
|
7925
8085
|
}
|
|
7926
8086
|
function renderDocsMarkdownNotFound({ entry = "docs", apiRoute, requestedPath, origin, pages, sitemap }) {
|
|
@@ -7994,7 +8154,7 @@ function appendDocsMarkdownSectionQuery(value, sectionRequest) {
|
|
|
7994
8154
|
}
|
|
7995
8155
|
/** Build one standards-aware Markdown response for every framework adapter. */
|
|
7996
8156
|
function createDocsMarkdownResponse(options) {
|
|
7997
|
-
const { request, document, entry = "docs", requestedPath, origin = new URL(request.url).origin, pages, sitemap, locale } = options;
|
|
8157
|
+
const { request, document, entry = "docs", requestedPath, origin = new URL(request.url).origin, pages: rawPages, sitemap, locale } = options;
|
|
7998
8158
|
const canonicalUrl = options.canonicalUrl ?? resolveDocsMarkdownCanonicalUrl({
|
|
7999
8159
|
origin,
|
|
8000
8160
|
entry,
|
|
@@ -8003,11 +8163,23 @@ function createDocsMarkdownResponse(options) {
|
|
|
8003
8163
|
});
|
|
8004
8164
|
const contentLocation = options.contentLocation ?? resolveDocsMarkdownContentLocation(canonicalUrl);
|
|
8005
8165
|
const varyHeader = getDocsMarkdownVaryHeader(request);
|
|
8166
|
+
const llmsTxtUrl = new URL(DEFAULT_LLMS_TXT_ROUTE, origin).toString();
|
|
8167
|
+
const discoveryLink = `<${llmsTxtUrl}>; rel="describedby"; type="text/plain"`;
|
|
8006
8168
|
const baseSharedHeaders = {
|
|
8007
8169
|
"X-Robots-Tag": "noindex",
|
|
8170
|
+
"X-Llms-Txt": llmsTxtUrl,
|
|
8008
8171
|
...locale ? { "Content-Language": locale } : {},
|
|
8009
8172
|
...varyHeader ? { Vary: varyHeader } : {}
|
|
8010
8173
|
};
|
|
8174
|
+
const pages = rawPages ? filterDocsPagesByAccess(rawPages, options.principal) : void 0;
|
|
8175
|
+
if (!isDocsPageAccessAllowed(options.access, options.principal)) return new Response("Not Found", {
|
|
8176
|
+
status: 404,
|
|
8177
|
+
headers: {
|
|
8178
|
+
...baseSharedHeaders,
|
|
8179
|
+
"Cache-Control": "private, no-store",
|
|
8180
|
+
"Content-Type": "text/plain; charset=utf-8"
|
|
8181
|
+
}
|
|
8182
|
+
});
|
|
8011
8183
|
if (!document) {
|
|
8012
8184
|
const recovery = resolveDocsMarkdownRecovery({
|
|
8013
8185
|
entry,
|
|
@@ -8020,7 +8192,7 @@ function createDocsMarkdownResponse(options) {
|
|
|
8020
8192
|
headers: {
|
|
8021
8193
|
...baseSharedHeaders,
|
|
8022
8194
|
"Content-Location": contentLocation,
|
|
8023
|
-
Link: `<${canonicalUrl}>; rel="canonical"`,
|
|
8195
|
+
Link: `<${canonicalUrl}>; rel="canonical", ${discoveryLink}`,
|
|
8024
8196
|
"Cache-Control": "no-store",
|
|
8025
8197
|
Location: new URL(recovery.redirect.markdownUrl, request.url).toString()
|
|
8026
8198
|
}
|
|
@@ -8037,7 +8209,7 @@ function createDocsMarkdownResponse(options) {
|
|
|
8037
8209
|
headers: {
|
|
8038
8210
|
...baseSharedHeaders,
|
|
8039
8211
|
"Content-Location": contentLocation,
|
|
8040
|
-
Link: `<${canonicalUrl}>; rel="canonical"`,
|
|
8212
|
+
Link: `<${canonicalUrl}>; rel="canonical", ${discoveryLink}`,
|
|
8041
8213
|
"Cache-Control": "no-store",
|
|
8042
8214
|
"Content-Type": "text/markdown; charset=utf-8"
|
|
8043
8215
|
}
|
|
@@ -8064,7 +8236,7 @@ function createDocsMarkdownResponse(options) {
|
|
|
8064
8236
|
headers: {
|
|
8065
8237
|
...baseSharedHeaders,
|
|
8066
8238
|
"Content-Location": sectionIndexContentLocation,
|
|
8067
|
-
Link: `<${canonicalUrl}>; rel="canonical", <${contentLocation}>; rel="alternate"; type="text/markdown"`,
|
|
8239
|
+
Link: `<${canonicalUrl}>; rel="canonical", <${contentLocation}>; rel="alternate"; type="text/markdown", ${discoveryLink}`,
|
|
8068
8240
|
"Cache-Control": options.cacheControl ?? "public, max-age=0, s-maxage=3600",
|
|
8069
8241
|
"Content-Type": "application/json; charset=utf-8",
|
|
8070
8242
|
"X-Docs-Markdown-Section-Index": DOCS_MARKDOWN_SECTION_INDEX_FORMAT,
|
|
@@ -8096,7 +8268,7 @@ function createDocsMarkdownResponse(options) {
|
|
|
8096
8268
|
const responseHeaders = {
|
|
8097
8269
|
...baseSharedHeaders,
|
|
8098
8270
|
"Content-Location": sectionContentLocation,
|
|
8099
|
-
Link: `<${sectionCanonicalUrl}>; rel="canonical"`,
|
|
8271
|
+
Link: `<${sectionCanonicalUrl}>; rel="canonical", ${discoveryLink}`,
|
|
8100
8272
|
"Cache-Control": sectionResult?.found === false ? "no-store" : options.cacheControl ?? "public, max-age=0, s-maxage=3600",
|
|
8101
8273
|
"Content-Type": "text/markdown; charset=utf-8",
|
|
8102
8274
|
...sectionHeaders,
|
|
@@ -8355,6 +8527,12 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", apiRoute, apiCata
|
|
|
8355
8527
|
format: DOCS_AGENT_MANIFEST_FORMAT,
|
|
8356
8528
|
version: DOCS_AGENT_MANIFEST_VERSION,
|
|
8357
8529
|
name: "@farming-labs/docs",
|
|
8530
|
+
profile: "full",
|
|
8531
|
+
profiles: {
|
|
8532
|
+
default: "full",
|
|
8533
|
+
full: DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE,
|
|
8534
|
+
compact: `${DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE}?profile=compact`
|
|
8535
|
+
},
|
|
8358
8536
|
baseUrl: origin,
|
|
8359
8537
|
site: {
|
|
8360
8538
|
title: llms?.siteTitle ?? "Documentation",
|
|
@@ -8672,6 +8850,21 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", apiRoute, apiCata
|
|
|
8672
8850
|
}
|
|
8673
8851
|
};
|
|
8674
8852
|
}
|
|
8853
|
+
/** Remove first-hop file inventories while retaining every discovery route and capability. */
|
|
8854
|
+
function compactDocsAgentDiscoverySpec(spec) {
|
|
8855
|
+
return {
|
|
8856
|
+
...spec,
|
|
8857
|
+
profile: "compact",
|
|
8858
|
+
skills: {
|
|
8859
|
+
...spec.skills,
|
|
8860
|
+
published: spec.skills.published.map((skill) => ({
|
|
8861
|
+
...skill,
|
|
8862
|
+
fileCount: skill.files.length,
|
|
8863
|
+
files: []
|
|
8864
|
+
}))
|
|
8865
|
+
}
|
|
8866
|
+
};
|
|
8867
|
+
}
|
|
8675
8868
|
function acceptsDocsMarkdown(request) {
|
|
8676
8869
|
const accept = request.headers.get("accept");
|
|
8677
8870
|
if (!accept) return false;
|
|
@@ -8764,4 +8957,4 @@ function toYamlString(value) {
|
|
|
8764
8957
|
}
|
|
8765
8958
|
|
|
8766
8959
|
//#endregion
|
|
8767
|
-
export {
|
|
8960
|
+
export { isDocsSkillRequest as $, normalizeDocsMcpEndpointPath as $n, buildDocsContentSnapshot as $t, buildDocsAgentDiscoverySpec as A, normalizeAgentFramework as An, DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE as At, detectDocsMarkdownAgentRequest as B, DEFAULT_MCP_PROTECTED_RESOURCE_METADATA_ROUTE as Bn, toDocsSitemapMarkdownUrl as Bt, DOCS_AI_AGENT_USER_AGENT_HEADER_PATTERN as C, findDocsAudienceMdxIssues as Cn, selectDocsLlmsTxtContent as Ct, DOCS_MARKDOWN_SIGNATURE_AGENT_HEADER as D, agentVersionConstraintGroupsOverlap as Dn, DEFAULT_SITEMAP_MANIFEST_PATH as Dt, DOCS_MARKDOWN_SECTION_INDEX_FORMAT as E, resolveDocsAudienceMdxContent as En, validateDocsAgentFeedbackPayload as Et, buildDocsMcpEndpointCandidates as F, createDocsPaginationCursor as Fn, renderDocsSitemapMarkdown as Ft, hasDocsMarkdownSignatureAgent as G, getDocsMcpProtectedResourceMetadataRoutes as Gn, createDocsContentChangeFeed as Gt, getDocsLlmsTxtMaxCharsIssue as H, DEFAULT_MCP_ROUTE as Hn, DOCS_CONTENT_CHANGES_RESPONSE_VALUE as Ht, collectDocsMarkdownSections as I, paginateDocsItems as In, renderDocsSitemapXml as It, isDocsConfigRequest as J, isDocsMcpOAuthScopeToken as Jn, isDocsContentChangesRequest as Jt, isDocsAgentDiscoveryRequest as K, getDocsMcpResourcePaths as Kn, createDocsContentChangesHttpResponse as Kt, compactDocsAgentDiscoverySpec as L, resolveDocsPaginationOffset as Ln, resolveDocsSitemapConfig as Lt, buildDocsConfigMap as M, normalizeAgentScopeValues as Mn, buildDocsSitemapManifest as Mt, buildDocsDiagnostics as N, normalizeAgentVersion as Nn, createDocsSitemapResponse as Nt, DOCS_TRADITIONAL_BOT_USER_AGENT_HEADER_PATTERN as O, agentVersionConstraintMatches as On, DEFAULT_SITEMAP_MD_DOCS_ROUTE as Ot, buildDocsMarkdownSectionIndex as P, DocsPaginationCursorError as Pn, readDocsSitemapManifestFromContentMap as Pt, isDocsPublicGetRequest as Q, normalizeDocsMcpAuthorizationServerUrls as Qn, buildDocsAskAIContext as Qt, createDocsMarkdownResponse as R, normalizeDocsRelated as Rn, resolveDocsSitemapPageLastmod as Rt, DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE as S, extractDocsMarkdownPromptBlocks as Sn, resolveDocsSkillFormat as St, DOCS_CONFIG_MAP_TOP_LEVEL_KEYS as T, resolveDocsAgentMdxContent as Tn, toDocsMarkdownUrl as Tt, getDocsMarkdownCanonicalLinkHeader as U, DEFAULT_MCP_WELL_KNOWN_ROUTE as Un, DOCS_CONTENT_SNAPSHOT_FORMAT as Ut, findDocsMarkdownPage as V, DEFAULT_MCP_PUBLIC_ROUTE as Vn, DOCS_CONTENT_CHANGES_FORMAT as Vt, getDocsMarkdownVaryHeader as W, buildDocsMcpProtectedResourceMetadataRoute as Wn, DocsContentChangesRequestError as Wt, isDocsLlmsTxtPublicRequest as X, isDocsMcpRequest as Xn, resolveDocsContentChangesRequest as Xt, isDocsDiagnosticsRequest as Y, isDocsMcpProtectedResourceMetadataPath as Yn, resolveDocsContentChangesConfig as Yt, isDocsMarkdownSectionIndexRequest as Z, isDocsMcpResourcePath as Zn, DocsSearchRequestError as Zt, DEFAULT_LLMS_TXT_MAX_CHARS as _, resolveDocsSearchError as _n, resolveDocsMarkdownRecovery as _t, DEFAULT_AGENT_MD_ROUTE as a, createMcpSearchAdapter as an, buildDocsOkfBundle as ar, renderDocsLlmsTxt as at, DEFAULT_OPENAPI_SCHEMA_ROUTE as b, resolveLocalDocsMcpSearchConfig as bn, resolveDocsOpenApiDiscoveryConfig as bt, DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE as c, enrichDocsSearchDocumentsWithProvenance as cn, resolveDocsOkfTrustMetadata as cr, renderDocsSkillDocument as ct, DEFAULT_DOCS_CONFIG_FORMAT as d, normalizeDocsSearchFilters as dn, resolveDocsAgentFeedbackRequest as dt, buildDocsRetrievalDigestProjection as en, resolveDocsMcpProtectedResourceMetadataLocation as er, matchesDocsLlmsTxtSection as et, DEFAULT_DOCS_CONFIG_ROUTE as f, performDocsSearch as fn, resolveDocsAgentsFormat as ft, DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE as g, resolveDocsSearchAudience as gn, resolveDocsMarkdownCanonicalUrl as gt, DEFAULT_LLMS_FULL_TXT_ROUTE as h, resolveDocsRetrievalLastModified as hn, resolveDocsLlmsTxtSections as ht, DEFAULT_AGENT_FEEDBACK_ROUTE as i, createCustomSearchAdapter as in, DOCS_OKF_VERSION as ir, renderDocsAgentsDocument as it, buildDocsAgentFeedbackSchema as j, normalizeAgentLocale as jn, DEFAULT_SITEMAP_XML_ROUTE as jt, acceptsDocsMarkdown as k, agentVersionConstraintsOverlap as kn, DEFAULT_SITEMAP_MD_ROUTE as kt, DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE as l, formatDocsAskAIPackageHints as ln, resolveDocsAgentContractMcpTools as lt, DEFAULT_DOCS_DIAGNOSTICS_ROUTE as m, resolveAskAISearchRequestConfig as mn, resolveDocsLlmsTxtRequest as mt, DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE as n, buildDocsSearchFacets as nn, DEFAULT_DOCS_OKF_ROUTE as nr, normalizeDocsUrlPath as nt, DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE as o, createSimpleSearchAdapter as on, normalizeDocsOkfTrustMetadataInput as or, renderDocsMarkdownDocument as ot, DEFAULT_DOCS_DIAGNOSTICS_FORMAT as p, performDocsSearchWithMetadata as pn, resolveDocsLlmsTxtFormat as pt, isDocsAgentsRequest as q, hasDocsMcpProtectedResourceConfig as qn, isDocsContentChangeGeneration as qt, DEFAULT_AGENT_FEEDBACK_PAYLOAD_SCHEMA as r, createAlgoliaSearchAdapter as rn, DOCS_OKF_BUNDLE_FORMAT as rr, parseDocsAgentFeedbackData as rt, DEFAULT_AGENT_SPEC_ROUTE as s, createTypesenseSearchAdapter as sn, resolveDocsOkfConfig as sr, renderDocsMarkdownNotFound as st, DEFAULT_AGENTS_MD_ROUTE as t, buildDocsSearchDocuments as tn, resolveDocsMcpResourceLocation as tr, normalizeDocsPathSegment as tt, DEFAULT_DOCS_API_ROUTE as u, inferDocsAskAIPackageHints as un, resolveDocsAgentFeedbackConfig as ut, DEFAULT_LLMS_TXT_ROUTE as v, resolveDocsSearchFilters as vn, resolveDocsMarkdownRequest as vt, DOCS_BOT_LIKE_USER_AGENT_HEADER_PATTERN as w, findDocsAudienceMdxTags as wn, selectDocsMarkdownSection as wt, DEFAULT_SKILL_MD_ROUTE as x, resolveSearchRequestConfig as xn, resolveDocsRequestApiRoute as xt, DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE as y, resolveDocsSearchRequest as yn, resolveDocsMarkdownSectionRequest as yt, createDocsStandardsDiscoveryResponse as z, renderDocsRelatedMarkdownLines as zn, resolveDocsSitemapRequest as zt };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as getDocsAgentSkillsConfiguredPaths } from "./agent-skills-server-
|
|
1
|
+
import { S as upsertPageAgentContractMarkdown, l as stripDocsGeneratedAgentContractMarkers, o as findDocsMarkdownSection } from "./markdown-sections-BKy4labo.mjs";
|
|
2
|
+
import { An as normalizeAgentFramework, Dn as agentVersionConstraintGroupsOverlap, Mn as normalizeAgentScopeValues, Nn as normalizeAgentVersion, On as agentVersionConstraintMatches, Qt as buildDocsAskAIContext, dn as normalizeDocsSearchFilters, en as buildDocsRetrievalDigestProjection, fn as performDocsSearch, jn as normalizeAgentLocale, kn as agentVersionConstraintsOverlap, xn as resolveSearchRequestConfig } from "./agent-DCTGj6J7.mjs";
|
|
3
|
+
import { n as digestDocsRetrievalContent } from "./retrieval-digest-B-SgtXKK.mjs";
|
|
4
|
+
import { t as getDocsAgentSkillsConfiguredPaths } from "./agent-skills-server-Ddbf15pY.mjs";
|
|
5
5
|
import { buildDocsMcpContext } from "./mcp.mjs";
|
|
6
|
-
import { i as validateCodeBlockPlans, n as planCodeBlockTargets, r as resolveDocsCodeBlocksValidateConfig, t as extractCodeBlocksFromMarkdown } from "./code-blocks-
|
|
6
|
+
import { i as validateCodeBlockPlans, n as planCodeBlockTargets, r as resolveDocsCodeBlocksValidateConfig, t as extractCodeBlocksFromMarkdown } from "./code-blocks-D90CCJFs.mjs";
|
|
7
7
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
8
8
|
import { dirname, isAbsolute, join, relative } from "node:path";
|
|
9
9
|
import { createJiti } from "jiti";
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
import { A as buildDocsLegacySkillsIndex, D as buildDocsA2AAgentCard, L as resolveDocsPublishedAgentSkill, O as buildDocsAgentSkillsIndex, V as formatDocsContentDigest, W as resolveDocsHttpDate, a as DEFAULT_A2A_AGENT_CARD_ROUTE, b as DEFAULT_LEGACY_SKILLS_INDEX_ROUTE, f as DEFAULT_AGENT_SKILLS_ROUTE_PREFIX, u as DEFAULT_AGENT_SKILLS_INDEX_ROUTE, x as DEFAULT_LEGACY_SKILLS_ROUTE_PREFIX } from "./standards-discovery-
|
|
4
|
-
import "./
|
|
5
|
-
import { t as resolveDocsI18n } from "./i18n-
|
|
6
|
-
import { c as renderDocsRobotsGeneratedBlock, f as upsertDocsRobotsGeneratedBlock, i as DOCS_ROBOTS_GENERATED_BLOCK_START, r as DOCS_ROBOTS_GENERATED_BLOCK_END, u as resolveDocsRobotsConfig } from "./robots-
|
|
7
|
-
import "./sitemap-server-
|
|
8
|
-
import { r as resolveConfiguredAgentSkills } from "./agent-skills-server-
|
|
9
|
-
import "./agent-evals-
|
|
1
|
+
import { w as isDocsAgentPageAccessible } from "./markdown-sections-BKy4labo.mjs";
|
|
2
|
+
import { A as buildDocsAgentDiscoverySpec, Ft as renderDocsSitemapMarkdown, It as renderDocsSitemapXml, Lt as resolveDocsSitemapConfig, Mt as buildDocsSitemapManifest, S as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, Tt as toDocsMarkdownUrl, a as DEFAULT_AGENT_MD_ROUTE, ar as buildDocsOkfBundle, at as renderDocsLlmsTxt, c as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, ct as renderDocsSkillDocument, g as DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE, h as DEFAULT_LLMS_FULL_TXT_ROUTE, it as renderDocsAgentsDocument, l as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, o as DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE, ot as renderDocsMarkdownDocument, sr as resolveDocsOkfConfig, t as DEFAULT_AGENTS_MD_ROUTE, ut as resolveDocsAgentFeedbackConfig, v as DEFAULT_LLMS_TXT_ROUTE, x as DEFAULT_SKILL_MD_ROUTE, y as DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE } from "./agent-DCTGj6J7.mjs";
|
|
3
|
+
import { A as buildDocsLegacySkillsIndex, D as buildDocsA2AAgentCard, L as resolveDocsPublishedAgentSkill, O as buildDocsAgentSkillsIndex, V as formatDocsContentDigest, W as resolveDocsHttpDate, a as DEFAULT_A2A_AGENT_CARD_ROUTE, b as DEFAULT_LEGACY_SKILLS_INDEX_ROUTE, f as DEFAULT_AGENT_SKILLS_ROUTE_PREFIX, u as DEFAULT_AGENT_SKILLS_INDEX_ROUTE, x as DEFAULT_LEGACY_SKILLS_ROUTE_PREFIX } from "./standards-discovery-Bpz90VYq.mjs";
|
|
4
|
+
import "./openapi-mcp-DQ3xptKo.mjs";
|
|
5
|
+
import { t as resolveDocsI18n } from "./i18n-B1gJ9EW0.mjs";
|
|
6
|
+
import { c as renderDocsRobotsGeneratedBlock, f as upsertDocsRobotsGeneratedBlock, i as DOCS_ROBOTS_GENERATED_BLOCK_START, r as DOCS_ROBOTS_GENERATED_BLOCK_END, u as resolveDocsRobotsConfig } from "./robots-BOjWB1ky.mjs";
|
|
7
|
+
import "./sitemap-server-NeVu8W38.mjs";
|
|
8
|
+
import { r as resolveConfiguredAgentSkills } from "./agent-skills-server-Ddbf15pY.mjs";
|
|
9
|
+
import "./agent-evals-D-sPJfXz.mjs";
|
|
10
10
|
import { createFilesystemDocsMcpSource, resolveDocsMcpConfig } from "./mcp.mjs";
|
|
11
|
-
import "./
|
|
11
|
+
import "./authoring-mcp-Be7quE5R.mjs";
|
|
12
|
+
import "./code-blocks-D90CCJFs.mjs";
|
|
12
13
|
import "./server.mjs";
|
|
13
|
-
import { _ as resolveDocsContentDir, a as loadDocsConfigModule, d as readNavTitle, g as resolveDocsConfigPath, h as readTopLevelStringProperty, l as readBooleanProperty, m as readTopLevelBooleanProperty, p as readStringProperty, r as extractTopLevelConfigObject, t as extractNestedObjectLiteral } from "./config-
|
|
14
|
-
import { t as detectFramework } from "./utils-
|
|
14
|
+
import { _ as resolveDocsContentDir, a as loadDocsConfigModule, d as readNavTitle, g as resolveDocsConfigPath, h as readTopLevelStringProperty, l as readBooleanProperty, m as readTopLevelBooleanProperty, p as readStringProperty, r as extractTopLevelConfigObject, t as extractNestedObjectLiteral } from "./config-DrZ3fXgf.mjs";
|
|
15
|
+
import { t as detectFramework } from "./utils-Cc1SrVza.mjs";
|
|
15
16
|
import { existsSync, lstatSync, mkdirSync, readFileSync, realpathSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
16
17
|
import path from "node:path";
|
|
17
18
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -443,7 +444,8 @@ function resolveUserOwnedOverrides(outputs, previous) {
|
|
|
443
444
|
"page",
|
|
444
445
|
"llms",
|
|
445
446
|
"discovery",
|
|
446
|
-
"skill"
|
|
447
|
+
"skill",
|
|
448
|
+
"okf"
|
|
447
449
|
]);
|
|
448
450
|
const previousByPath = new Map(previous?.files.map((file) => [file.path, file]) ?? []);
|
|
449
451
|
return outputs.map((output) => {
|
|
@@ -683,7 +685,9 @@ async function exportAgentBundle(options = {}) {
|
|
|
683
685
|
};
|
|
684
686
|
});
|
|
685
687
|
if (localizedPages.length === 0) throw new Error(`No docs content was found under ${contentDir}.`);
|
|
686
|
-
const
|
|
688
|
+
const publishablePages = localizedPages.filter(({ page }) => isDocsAgentPageAccessible(page));
|
|
689
|
+
const pages = publishablePages.map(({ page }) => page);
|
|
690
|
+
const okfConfig = resolveDocsOkfConfig(config?.agent?.okf);
|
|
687
691
|
const sitemap = resolveDocsSitemapConfig(sitemapInput, { baseUrl });
|
|
688
692
|
const robots = resolveDocsRobotsConfig(robotsInput, { baseUrl: typeof robotsInput === "object" ? robotsInput.baseUrl ?? sitemap.baseUrl : sitemap.baseUrl });
|
|
689
693
|
const mcp = resolveDocsMcpConfig(false, { defaultName: resolvedSiteTitle });
|
|
@@ -725,17 +729,25 @@ async function exportAgentBundle(options = {}) {
|
|
|
725
729
|
const configuredAgentSkills = await resolveConfiguredAgentSkills(config?.agent?.skills, { rootDir });
|
|
726
730
|
let outputs = [];
|
|
727
731
|
const internalOutputs = [];
|
|
728
|
-
for (const { page } of
|
|
732
|
+
for (const { page } of publishablePages) {
|
|
729
733
|
const output = addOutput(outputs, publicDir, staticMarkdownRoute(page, sourceEntry, routeEntry), "page", "text/markdown", renderDocsMarkdownDocument({
|
|
730
734
|
...page,
|
|
731
735
|
markdownUrl: staticMarkdownRoute(page, sourceEntry, routeEntry)
|
|
732
736
|
}, {
|
|
733
737
|
llms,
|
|
738
|
+
okf: config?.agent?.okf,
|
|
734
739
|
origin: baseUrl,
|
|
735
740
|
sitemap: sitemapInput
|
|
736
741
|
}));
|
|
737
742
|
output.lastModified = resolveDocsHttpDate(page.lastModified);
|
|
738
743
|
}
|
|
744
|
+
if (okfConfig.enabled) {
|
|
745
|
+
const okfBundle = buildDocsOkfBundle(pages.map((page) => ({
|
|
746
|
+
...page,
|
|
747
|
+
canonicalUrl: baseUrl ? new URL(page.url, baseUrl).toString() : page.url
|
|
748
|
+
})), okfConfig);
|
|
749
|
+
addOutput(outputs, publicDir, okfConfig.route, "okf", "application/json", JSON.stringify(okfBundle, null, 2));
|
|
750
|
+
}
|
|
739
751
|
if (llmsEnabled) {
|
|
740
752
|
const llmsContent = renderDocsLlmsTxt(pages.map((page) => ({
|
|
741
753
|
url: page.url,
|
|
@@ -747,7 +759,8 @@ async function exportAgentBundle(options = {}) {
|
|
|
747
759
|
agentContent: page.agentContent,
|
|
748
760
|
agentRawContent: page.agentRawContent,
|
|
749
761
|
agentFallbackContent: page.agentFallbackContent,
|
|
750
|
-
agentFallbackRawContent: page.agentFallbackRawContent
|
|
762
|
+
agentFallbackRawContent: page.agentFallbackRawContent,
|
|
763
|
+
agent: page.agent
|
|
751
764
|
})), llms);
|
|
752
765
|
for (const route of [DEFAULT_LLMS_TXT_ROUTE, DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE]) addOutput(outputs, publicDir, route, "llms", "text/plain", llmsContent.llmsTxt);
|
|
753
766
|
for (const route of [DEFAULT_LLMS_FULL_TXT_ROUTE, DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE]) addOutput(outputs, publicDir, route, "llms", "text/plain", llmsContent.llmsFullTxt);
|
|
@@ -877,7 +890,7 @@ async function exportAgentBundle(options = {}) {
|
|
|
877
890
|
internalOutputs,
|
|
878
891
|
orphanedFiles,
|
|
879
892
|
orphanedInternalFiles,
|
|
880
|
-
pages:
|
|
893
|
+
pages: publishablePages
|
|
881
894
|
});
|
|
882
895
|
const manifestJson = `${JSON.stringify(manifest, null, 2)}\n`;
|
|
883
896
|
const changed = changedOutputs(outputs);
|