@farming-labs/docs 0.2.71 → 0.2.73
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-bof3qzKZ.mjs → agent-ClRpctMG.mjs} +3 -2
- package/dist/{agent-evals-Cr9TAkmB.mjs → agent-evals-BFHGypqh.mjs} +116 -20
- package/dist/{agent-export-7Ws4KqDE.mjs → agent-export-B9bah0AV.mjs} +9 -8
- package/dist/{agent-FIyl4-Oa.mjs → agent-o9OTadrf.mjs} +607 -769
- package/dist/agent-skills-bundle.d.mts +1 -1
- package/dist/{agent-skills-server-DTwblsLu.d.mts → agent-skills-server-DCbAx5WU.d.mts} +2 -2
- package/dist/{agent-skills-server-B4u3qy-1.mjs → agent-skills-server-noFn1l_p.mjs} +1 -1
- package/dist/agent-skills-vite.d.mts +3 -3
- package/dist/agent-skills-vite.mjs +2 -2
- package/dist/{agents-Be2ntaFr.mjs → agents-CR-Uasbc.mjs} +7 -6
- package/dist/cli/index.mjs +14 -14
- package/dist/client/react.d.mts +1 -1
- package/dist/{cloud-ask-ai-BfnX18rI.d.mts → cloud-ask-ai-yR9vZmSG.d.mts} +1 -1
- package/dist/docs-cloud-server.d.mts +2 -2
- package/dist/{doctor-DoPAofVP.mjs → doctor-BeyN3Ljh.mjs} +12 -11
- package/dist/{golden-evaluations-CPGGnXOV.mjs → golden-evaluations-CloP0pAe.mjs} +23 -2
- package/dist/index.d.mts +93 -6
- package/dist/index.mjs +9 -8
- package/dist/markdown-rendering.d.mts +75 -0
- package/dist/markdown-rendering.mjs +618 -0
- package/dist/markdown-sections-7OoA7ylx.mjs +1492 -0
- package/dist/{mcp-BLynUzE7.mjs → mcp-BLLXvEXB.mjs} +7 -6
- package/dist/mcp.d.mts +7 -2
- package/dist/mcp.mjs +130 -25
- package/dist/{metadata-bw8k-9x-.mjs → metadata-N252j5_a.mjs} +1 -1
- package/dist/{reading-time-DtNegNiq.mjs → prompt-references-Cz35rlOa.mjs} +158 -4
- package/dist/{review-NFnYbMRI.mjs → review-DaJLdPLh.mjs} +7 -6
- package/dist/{robots-DOqBwQw8.mjs → robots-BcuxnZqZ.mjs} +2 -2
- package/dist/{robots-B3e-aWPy.mjs → robots-DI-9MZz1.mjs} +4 -3
- package/dist/{search-CozHzW7v.d.mts → search-D1n8Sf25.d.mts} +45 -9
- package/dist/{search-DOGUUZvs.mjs → search-DeOJiMAy.mjs} +7 -6
- package/dist/{search-x5O0-9X3.mjs → search-RfPcG1if.mjs} +742 -42
- package/dist/server.d.mts +13 -5
- package/dist/server.mjs +8 -7
- package/dist/{sitemap-BpMKdDUd.mjs → sitemap-BGGbX_KE.mjs} +7 -6
- package/dist/{sitemap-server-D_hayOp6.mjs → sitemap-server-VefDnzEB.mjs} +1 -1
- package/dist/{standards-discovery-C0CIC4QI.d.mts → standards-discovery-83lp1lew.d.mts} +5 -4
- package/dist/{standards-discovery-CYfiQE13.mjs → standards-discovery-BwL5ffGx.mjs} +4 -3
- package/dist/{types-BQC05SQm.d.mts → types-_HCPD4wc.d.mts} +49 -1
- package/package.json +9 -1
- package/dist/agent-scope-C_U--OZ7.mjs +0 -283
- /package/dist/{i18n-CCaFUnAN.mjs → i18n-hHVWcflJ.mjs} +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { B as findDocsMarkdownPage,
|
|
2
|
-
import {
|
|
1
|
+
import { B as findDocsMarkdownPage, at as renderDocsMarkdownDocument } from "./agent-o9OTadrf.mjs";
|
|
2
|
+
import { v as normalizePageAgentFrontmatter, x as stripGeneratedPageAgentContractMarkdown } from "./markdown-sections-7OoA7ylx.mjs";
|
|
3
|
+
import { E as hashGeneratedAgentContent, O as parseGeneratedAgentDocument, T as GENERATED_AGENT_PROVENANCE_VERSION, k as serializeGeneratedAgentDocument } from "./search-RfPcG1if.mjs";
|
|
3
4
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
4
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-Wcdj-D0a.mjs";
|
|
5
6
|
import { createRequire } from "node:module";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { a as normalizeAgentScopeValues, i as normalizeAgentLocale, n as agentVersionConstraintsOverlap, o as normalizeAgentVersion, r as normalizeAgentFramework, t as agentVersionConstraintMatches } from "./agent-scope-C_U--OZ7.mjs";
|
|
1
|
+
import { S as upsertPageAgentContractMarkdown, l as stripDocsGeneratedAgentContractMarkers, o as findDocsMarkdownSection } from "./markdown-sections-7OoA7ylx.mjs";
|
|
2
|
+
import { C as normalizeAgentVersion, S as normalizeAgentScopeValues, _ as resolveSearchRequestConfig, b as normalizeAgentFramework, d as performDocsSearch, t as buildDocsAskAIContext, u as normalizeDocsSearchFilters, v as agentVersionConstraintMatches, x as normalizeAgentLocale, y as agentVersionConstraintsOverlap } from "./search-RfPcG1if.mjs";
|
|
4
3
|
import { buildDocsMcpContext } from "./mcp.mjs";
|
|
5
4
|
import { i as validateCodeBlockPlans, n as planCodeBlockTargets, r as resolveDocsCodeBlocksValidateConfig, t as extractCodeBlocksFromMarkdown } from "./code-blocks-DnNVNK2M.mjs";
|
|
6
5
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
@@ -631,13 +630,33 @@ function normalizeRuntimeFilters(value, path, issues) {
|
|
|
631
630
|
}
|
|
632
631
|
const framework = normalizeRuntimeString(value.framework, `${path}.framework`, issues);
|
|
633
632
|
const version = normalizeRuntimeString(value.version, `${path}.version`, issues);
|
|
633
|
+
const packageName = normalizeRuntimeFilterValue(value.package, `${path}.package`, issues);
|
|
634
|
+
const tags = normalizeRuntimeFilterValue(value.tags, `${path}.tags`, issues);
|
|
634
635
|
const locale = normalizeRuntimeString(value.locale, `${path}.locale`, issues);
|
|
635
|
-
return framework || version || locale ? {
|
|
636
|
+
return framework || version || packageName || tags || locale ? {
|
|
636
637
|
framework,
|
|
637
638
|
version,
|
|
639
|
+
package: packageName,
|
|
640
|
+
tags,
|
|
638
641
|
locale
|
|
639
642
|
} : void 0;
|
|
640
643
|
}
|
|
644
|
+
function normalizeRuntimeFilterValue(value, path, issues) {
|
|
645
|
+
if (value === void 0) return void 0;
|
|
646
|
+
if (typeof value === "string") return normalizeRuntimeString(value, path, issues);
|
|
647
|
+
if (!Array.isArray(value)) {
|
|
648
|
+
issues.push(`${path} must be a non-empty string or string array.`);
|
|
649
|
+
return;
|
|
650
|
+
}
|
|
651
|
+
const normalized = value.filter((item) => typeof item === "string" && Boolean(item.trim())).map((item) => item.trim()).filter((item, index, items) => items.indexOf(item) === index);
|
|
652
|
+
const hasInvalidItem = value.some((item) => typeof item !== "string" || !item.trim());
|
|
653
|
+
if (hasInvalidItem) issues.push(`${path} must contain only non-empty strings.`);
|
|
654
|
+
if (normalized.length === 0) {
|
|
655
|
+
if (!hasInvalidItem) issues.push(`${path} must contain at least one non-empty string.`);
|
|
656
|
+
return;
|
|
657
|
+
}
|
|
658
|
+
return normalized;
|
|
659
|
+
}
|
|
641
660
|
function normalizeRuntimeEnum(value, path, issues, allowed) {
|
|
642
661
|
if (value === void 0) return void 0;
|
|
643
662
|
if (typeof value !== "string" || !allowed.includes(value)) {
|
|
@@ -810,14 +829,17 @@ function canonicalizeSource(value, baseUrl) {
|
|
|
810
829
|
if ((explicitlySchemed && (parsed.protocol === "http:" || parsed.protocol === "https:") || /^[\\/]{2}/u.test(rawValue)) && (!configuredBase || parsed.origin !== configuredBase.origin)) origin = parsed.origin;
|
|
811
830
|
if (explicitlySchemed && parsed.protocol !== "http:" && parsed.protocol !== "https:") origin = `${parsed.protocol}//${parsed.host}`;
|
|
812
831
|
} catch {
|
|
813
|
-
const
|
|
832
|
+
const hashIndex = rawValue.indexOf("#");
|
|
833
|
+
const pathAndQuery = hashIndex >= 0 ? rawValue.slice(0, hashIndex) : rawValue || "/";
|
|
834
|
+
const fragment = hashIndex >= 0 ? rawValue.slice(hashIndex + 1) : "";
|
|
814
835
|
pathname = pathAndQuery.split("?", 1)[0] || "/";
|
|
815
836
|
hash = fragment ? `#${fragment}` : "";
|
|
816
837
|
}
|
|
817
838
|
pathname = pathname.replace(/\/{2,}/gu, "/").replace(/\.md$/iu, "");
|
|
818
839
|
if (pathname !== "/") pathname = pathname.replace(/\/+$/gu, "");
|
|
819
840
|
if (!pathname.startsWith("/")) pathname = `/${pathname}`;
|
|
820
|
-
const
|
|
841
|
+
const decodedHash = hash ? safeDecode(hash.slice(1)).trim() : "";
|
|
842
|
+
const normalizedHash = decodedHash ? `#${encodeURIComponent(decodedHash)}` : "";
|
|
821
843
|
return `${origin}${pathname || "/"}${normalizedHash === "#" ? "" : normalizedHash}`;
|
|
822
844
|
}
|
|
823
845
|
function sourcePage(value) {
|
|
@@ -839,10 +861,14 @@ function getPageScope(page) {
|
|
|
839
861
|
const contractFramework = normalizeAgentScopeValues(page.agent?.appliesTo?.framework).map(normalizeAgentFramework);
|
|
840
862
|
const topVersion = normalizeAgentScopeValues(page.version).map(normalizeAgentVersion);
|
|
841
863
|
const contractVersion = normalizeAgentScopeValues(page.agent?.appliesTo?.version).map(normalizeAgentVersion);
|
|
864
|
+
const packageValues = normalizeDocsSearchFilters({ package: page.agent?.appliesTo?.package }).package ?? [];
|
|
865
|
+
const tags = normalizeDocsSearchFilters({ tags: page.tags }).tags ?? [];
|
|
842
866
|
const locale = normalizeAgentScopeValues(page.locale).map(normalizeAgentLocale);
|
|
843
867
|
return {
|
|
844
868
|
framework: Array.from(new Set([...topFramework, ...contractFramework])),
|
|
845
869
|
version: Array.from(new Set([...topVersion, ...contractVersion])),
|
|
870
|
+
package: packageValues,
|
|
871
|
+
tags,
|
|
846
872
|
locale,
|
|
847
873
|
frameworkAmbiguous: topFramework.length > 0 && contractFramework.length > 0 && !valuesOverlap(topFramework, contractFramework, (left, right) => left === right),
|
|
848
874
|
versionAmbiguous: topVersion.length > 0 && contractVersion.length > 0 && !valuesOverlap(topVersion, contractVersion, agentVersionConstraintsOverlap)
|
|
@@ -859,6 +885,8 @@ function toGoldenSources(sources, relevantSources, baseUrl) {
|
|
|
859
885
|
title: source.section ?? source.title,
|
|
860
886
|
framework: source.framework,
|
|
861
887
|
version: source.version,
|
|
888
|
+
package: source.package,
|
|
889
|
+
tags: source.tags,
|
|
862
890
|
utf8Bytes: source.utf8Bytes,
|
|
863
891
|
relevant: relevantSources.some((expected) => sourceMatches(source.url, expected, baseUrl)),
|
|
864
892
|
truncated: source.truncated
|
|
@@ -909,22 +937,36 @@ function extractRenderedCitations(context, sources) {
|
|
|
909
937
|
blockUtf8Bytes
|
|
910
938
|
};
|
|
911
939
|
}
|
|
940
|
+
function getPageAgentSectionMarkdown(page) {
|
|
941
|
+
return upsertPageAgentContractMarkdown(page.agentRawContent ?? page.agentFallbackRawContent ?? page.agentContent ?? page.agentFallbackContent ?? page.rawContent ?? page.content, page.agent);
|
|
942
|
+
}
|
|
943
|
+
function cleanPageAgentContractMarkers(markdown, sourceMarkdown, startLine) {
|
|
944
|
+
return sourceMarkdown && startLine ? stripDocsGeneratedAgentContractMarkers(markdown, {
|
|
945
|
+
sourceMarkdown,
|
|
946
|
+
startLine
|
|
947
|
+
}) : stripDocsGeneratedAgentContractMarkers(markdown);
|
|
948
|
+
}
|
|
912
949
|
function getPageAgentMarkdown(page) {
|
|
913
|
-
return page
|
|
950
|
+
return cleanPageAgentContractMarkers(getPageAgentSectionMarkdown(page));
|
|
914
951
|
}
|
|
915
952
|
function findPageForSource(pagesByUrl, value) {
|
|
916
953
|
return pagesByUrl.get(sourcePage(value));
|
|
917
954
|
}
|
|
918
955
|
function getResultAnchor(value) {
|
|
919
|
-
|
|
956
|
+
const canonical = canonicalizeSource(value);
|
|
957
|
+
const hashIndex = canonical.indexOf("#");
|
|
958
|
+
return (hashIndex >= 0 ? canonical.slice(hashIndex + 1) : "") || void 0;
|
|
920
959
|
}
|
|
921
|
-
|
|
960
|
+
/** @internal */
|
|
961
|
+
function hydrateDocsEvaluationSearchSource(result, index, pagesByUrl, contentMode, baseUrl) {
|
|
922
962
|
const normalizedResultUrl = canonicalizeSource(result.url, baseUrl);
|
|
923
963
|
const page = findPageForSource(pagesByUrl, normalizedResultUrl);
|
|
924
964
|
const anchor = getResultAnchor(result.url);
|
|
925
965
|
const section = anchor ?? result.section;
|
|
926
|
-
const
|
|
927
|
-
const
|
|
966
|
+
const sectionMarkdown = page ? getPageAgentSectionMarkdown(page) : void 0;
|
|
967
|
+
const pageSection = sectionMarkdown && section ? findDocsMarkdownSection(sectionMarkdown, section) : void 0;
|
|
968
|
+
if (contentMode === "page-section" && page && section && !pageSection) return void 0;
|
|
969
|
+
const content = contentMode === "page-section" && page ? cleanPageAgentContractMarkers(pageSection?.content ?? getPageAgentMarkdown(page), pageSection ? sectionMarkdown : void 0, pageSection?.startLine).trim() : [result.content, result.description].filter(Boolean).join("\n\n").trim();
|
|
928
970
|
const scope = page ? getPageScope(page) : void 0;
|
|
929
971
|
const url = normalizedResultUrl;
|
|
930
972
|
return {
|
|
@@ -939,7 +981,8 @@ function hydrateSearchSource(result, index, pagesByUrl, contentMode, baseUrl) {
|
|
|
939
981
|
locale: scope?.locale[0],
|
|
940
982
|
framework: scope?.framework[0],
|
|
941
983
|
version: scope?.version[0],
|
|
942
|
-
|
|
984
|
+
package: scope?.package.length ? [...scope.package] : void 0,
|
|
985
|
+
tags: scope?.tags.length ? [...scope.tags] : void 0,
|
|
943
986
|
score: result.score,
|
|
944
987
|
content,
|
|
945
988
|
chars: content.length,
|
|
@@ -979,11 +1022,17 @@ function buildContextFromSources(options) {
|
|
|
979
1022
|
}
|
|
980
1023
|
const context = blocks.join(CONTEXT_SEPARATOR);
|
|
981
1024
|
usedUtf8Bytes = Buffer.byteLength(context, "utf8");
|
|
1025
|
+
const normalizedFilters = normalizeDocsSearchFilters({
|
|
1026
|
+
package: options.filters?.package,
|
|
1027
|
+
tags: options.filters?.tags
|
|
1028
|
+
});
|
|
982
1029
|
return {
|
|
983
1030
|
query: options.query,
|
|
984
1031
|
filters: {
|
|
985
1032
|
framework: options.filters?.framework,
|
|
986
1033
|
version: options.filters?.version,
|
|
1034
|
+
package: normalizedFilters.package,
|
|
1035
|
+
tags: normalizedFilters.tags,
|
|
987
1036
|
locale: options.filters?.locale
|
|
988
1037
|
},
|
|
989
1038
|
budget: {
|
|
@@ -1078,11 +1127,17 @@ function createContextShell(options) {
|
|
|
1078
1127
|
const context = options.context ?? "";
|
|
1079
1128
|
const sources = options.sources ?? [];
|
|
1080
1129
|
const usedUtf8Bytes = Buffer.byteLength(context, "utf8");
|
|
1130
|
+
const normalizedFilters = normalizeDocsSearchFilters({
|
|
1131
|
+
package: options.filters?.package,
|
|
1132
|
+
tags: options.filters?.tags
|
|
1133
|
+
});
|
|
1081
1134
|
return {
|
|
1082
1135
|
query: options.query,
|
|
1083
1136
|
filters: {
|
|
1084
1137
|
framework: options.filters?.framework,
|
|
1085
1138
|
version: options.filters?.version,
|
|
1139
|
+
package: normalizedFilters.package,
|
|
1140
|
+
tags: normalizedFilters.tags,
|
|
1086
1141
|
locale: options.filters?.locale
|
|
1087
1142
|
},
|
|
1088
1143
|
budget: {
|
|
@@ -1160,6 +1215,8 @@ async function buildGoldenSurface(options) {
|
|
|
1160
1215
|
query: options.task.query,
|
|
1161
1216
|
framework: options.task.filters?.framework,
|
|
1162
1217
|
version: options.task.filters?.version,
|
|
1218
|
+
package: options.task.filters?.package,
|
|
1219
|
+
tags: options.task.filters?.tags,
|
|
1163
1220
|
locale: options.task.filters?.locale,
|
|
1164
1221
|
maxResults: options.topK
|
|
1165
1222
|
};
|
|
@@ -1199,6 +1256,12 @@ async function buildGoldenSurface(options) {
|
|
|
1199
1256
|
search: surfaceSearch,
|
|
1200
1257
|
audience: "agent",
|
|
1201
1258
|
locale: options.task.filters?.locale,
|
|
1259
|
+
filters: {
|
|
1260
|
+
framework: options.task.filters?.framework,
|
|
1261
|
+
version: options.task.filters?.version,
|
|
1262
|
+
package: options.task.filters?.package,
|
|
1263
|
+
tags: options.task.filters?.tags
|
|
1264
|
+
},
|
|
1202
1265
|
siteTitle: options.runOptions.siteTitle,
|
|
1203
1266
|
baseUrl: options.runOptions.baseUrl,
|
|
1204
1267
|
limit: options.topK,
|
|
@@ -1208,7 +1271,7 @@ async function buildGoldenSurface(options) {
|
|
|
1208
1271
|
signal
|
|
1209
1272
|
})
|
|
1210
1273
|
});
|
|
1211
|
-
const rankedSources = results.slice(0, options.topK).map((result, index) =>
|
|
1274
|
+
const rankedSources = results.slice(0, options.topK).map((result, index) => hydrateDocsEvaluationSearchSource(result, index, pagesByUrl, "result", options.runOptions.baseUrl)).filter((source) => Boolean(source));
|
|
1212
1275
|
return {
|
|
1213
1276
|
surface,
|
|
1214
1277
|
provider,
|
|
@@ -1239,6 +1302,12 @@ async function buildGoldenSurface(options) {
|
|
|
1239
1302
|
query: options.task.query,
|
|
1240
1303
|
search: surfaceSearch,
|
|
1241
1304
|
locale: options.task.filters?.locale,
|
|
1305
|
+
filters: {
|
|
1306
|
+
framework: options.task.filters?.framework,
|
|
1307
|
+
version: options.task.filters?.version,
|
|
1308
|
+
package: options.task.filters?.package,
|
|
1309
|
+
tags: options.task.filters?.tags
|
|
1310
|
+
},
|
|
1242
1311
|
siteTitle: options.runOptions.siteTitle,
|
|
1243
1312
|
baseUrl: options.runOptions.baseUrl,
|
|
1244
1313
|
limit: options.topK,
|
|
@@ -1248,8 +1317,8 @@ async function buildGoldenSurface(options) {
|
|
|
1248
1317
|
signal
|
|
1249
1318
|
})
|
|
1250
1319
|
});
|
|
1251
|
-
const rankedSources = askAI.searchResults.slice(0, options.topK).map((result, index) =>
|
|
1252
|
-
const resultSources = askAI.results.map((result, index) =>
|
|
1320
|
+
const rankedSources = askAI.searchResults.slice(0, options.topK).map((result, index) => hydrateDocsEvaluationSearchSource(result, index, pagesByUrl, "result", options.runOptions.baseUrl)).filter((source) => Boolean(source));
|
|
1321
|
+
const resultSources = askAI.results.map((result, index) => hydrateDocsEvaluationSearchSource(result, index, pagesByUrl, "page-section", options.runOptions.baseUrl));
|
|
1253
1322
|
const parsed = parseAskAIContextSources({
|
|
1254
1323
|
context: askAI.context,
|
|
1255
1324
|
blocks: askAI.blocks.map((block) => block.text),
|
|
@@ -1879,17 +1948,27 @@ async function runAnswerProvider(options) {
|
|
|
1879
1948
|
function buildSelectionMetrics(task, sources, pagesByUrl) {
|
|
1880
1949
|
const requestedFramework = task.filters?.framework;
|
|
1881
1950
|
const requestedVersion = task.filters?.version;
|
|
1951
|
+
const requestedPackage = task.filters?.package;
|
|
1952
|
+
const requestedTags = task.filters?.tags;
|
|
1882
1953
|
const requestedLocale = task.filters?.locale;
|
|
1883
1954
|
const expectedFramework = task.expect.scope?.framework ?? requestedFramework;
|
|
1884
1955
|
const expectedVersion = task.expect.scope?.version ?? requestedVersion;
|
|
1956
|
+
const expectedPackage = task.expect.scope?.package ?? requestedPackage;
|
|
1957
|
+
const expectedTags = task.expect.scope?.tags ?? requestedTags;
|
|
1885
1958
|
const expectedLocale = task.expect.scope?.locale ?? requestedLocale;
|
|
1886
1959
|
const framework = expectedFramework ? normalizeAgentFramework(expectedFramework) : void 0;
|
|
1960
|
+
const expectedSearchScope = normalizeDocsSearchFilters({
|
|
1961
|
+
package: expectedPackage,
|
|
1962
|
+
tags: expectedTags
|
|
1963
|
+
});
|
|
1887
1964
|
const locale = expectedLocale ? normalizeAgentLocale(expectedLocale) : void 0;
|
|
1888
1965
|
const candidates = sources.map((source) => {
|
|
1889
1966
|
const page = findPageForSource(pagesByUrl, source.pageUrl || source.url);
|
|
1890
1967
|
const scope = page ? getPageScope(page) : {
|
|
1891
1968
|
framework: normalizeAgentScopeValues(source.framework).map(normalizeAgentFramework),
|
|
1892
1969
|
version: normalizeAgentScopeValues(source.version).map(normalizeAgentVersion),
|
|
1970
|
+
package: normalizeDocsSearchFilters({ package: source.package }).package ?? [],
|
|
1971
|
+
tags: normalizeDocsSearchFilters({ tags: source.tags }).tags ?? [],
|
|
1893
1972
|
locale: normalizeAgentScopeValues(source.locale).map(normalizeAgentLocale),
|
|
1894
1973
|
frameworkAmbiguous: false,
|
|
1895
1974
|
versionAmbiguous: false
|
|
@@ -1901,22 +1980,34 @@ function buildSelectionMetrics(task, sources, pagesByUrl) {
|
|
|
1901
1980
|
});
|
|
1902
1981
|
const firstFrameworkMatchRank = framework ? candidates.findIndex((candidate) => candidate.scope.framework.includes(framework)) + 1 || null : null;
|
|
1903
1982
|
const firstVersionMatchRank = expectedVersion ? candidates.findIndex((candidate) => candidate.scope.version.some((version) => agentVersionConstraintMatches(expectedVersion, version))) + 1 || null : null;
|
|
1983
|
+
const firstPackageMatchRank = expectedSearchScope.package ? candidates.findIndex((candidate) => valuesOverlap(expectedSearchScope.package ?? [], candidate.scope.package, (left, right) => left === right)) + 1 || null : null;
|
|
1984
|
+
const firstTagsMatchRank = expectedSearchScope.tags ? candidates.findIndex((candidate) => valuesOverlap(expectedSearchScope.tags ?? [], candidate.scope.tags, (left, right) => left === right)) + 1 || null : null;
|
|
1904
1985
|
const firstLocaleMatchRank = locale ? candidates.findIndex((candidate) => candidate.scope.locale.includes(locale)) + 1 || null : null;
|
|
1905
|
-
const conflictingSources = candidates.filter((candidate) => framework && candidate.scope.framework.length > 0 && !candidate.scope.framework.includes(framework) || expectedVersion && candidate.scope.version.length > 0 && !candidate.scope.version.some((version) => agentVersionConstraintMatches(expectedVersion, version)) || locale && candidate.scope.locale.length > 0 && !candidate.scope.locale.includes(locale)).map((candidate) => candidate.source);
|
|
1906
|
-
const ambiguousSources = candidates.filter((candidate) => candidate.scope.frameworkAmbiguous || candidate.scope.versionAmbiguous || Boolean(framework && candidate.scope.framework.length === 0) || Boolean(expectedVersion && candidate.scope.version.length === 0) || Boolean(locale && candidate.scope.locale.length === 0)).map((candidate) => candidate.source);
|
|
1986
|
+
const conflictingSources = candidates.filter((candidate) => framework && candidate.scope.framework.length > 0 && !candidate.scope.framework.includes(framework) || expectedVersion && candidate.scope.version.length > 0 && !candidate.scope.version.some((version) => agentVersionConstraintMatches(expectedVersion, version)) || expectedSearchScope.package && candidate.scope.package.length > 0 && !valuesOverlap(expectedSearchScope.package, candidate.scope.package, (left, right) => left === right) || expectedSearchScope.tags && candidate.scope.tags.length > 0 && !valuesOverlap(expectedSearchScope.tags, candidate.scope.tags, (left, right) => left === right) || locale && candidate.scope.locale.length > 0 && !candidate.scope.locale.includes(locale)).map((candidate) => candidate.source);
|
|
1987
|
+
const ambiguousSources = candidates.filter((candidate) => candidate.scope.frameworkAmbiguous || candidate.scope.versionAmbiguous || Boolean(framework && candidate.scope.framework.length === 0) || Boolean(expectedVersion && candidate.scope.version.length === 0) || Boolean(expectedSearchScope.package && candidate.scope.package.length === 0) || Boolean(expectedSearchScope.tags && candidate.scope.tags.length === 0) || Boolean(locale && candidate.scope.locale.length === 0)).map((candidate) => candidate.source);
|
|
1988
|
+
const frameworkPassed = !framework || firstFrameworkMatchRank !== null;
|
|
1989
|
+
const versionPassed = !expectedVersion || firstVersionMatchRank !== null;
|
|
1990
|
+
const packagePassed = !expectedSearchScope.package || firstPackageMatchRank !== null;
|
|
1991
|
+
const tagsPassed = !expectedSearchScope.tags || firstTagsMatchRank !== null;
|
|
1907
1992
|
return {
|
|
1908
1993
|
requestedFramework,
|
|
1909
1994
|
requestedVersion,
|
|
1995
|
+
requestedPackage,
|
|
1996
|
+
requestedTags,
|
|
1910
1997
|
requestedLocale,
|
|
1911
1998
|
expectedFramework,
|
|
1912
1999
|
expectedVersion,
|
|
2000
|
+
expectedPackage,
|
|
2001
|
+
expectedTags,
|
|
1913
2002
|
expectedLocale,
|
|
1914
2003
|
firstFrameworkMatchRank,
|
|
1915
2004
|
firstVersionMatchRank,
|
|
2005
|
+
firstPackageMatchRank,
|
|
2006
|
+
firstTagsMatchRank,
|
|
1916
2007
|
firstLocaleMatchRank,
|
|
1917
2008
|
conflictingSources,
|
|
1918
2009
|
ambiguousSources,
|
|
1919
|
-
passed:
|
|
2010
|
+
passed: frameworkPassed && versionPassed && packagePassed && tagsPassed && (!locale || firstLocaleMatchRank !== null) && conflictingSources.length === 0 && ambiguousSources.length === 0
|
|
1920
2011
|
};
|
|
1921
2012
|
}
|
|
1922
2013
|
function buildUsageMetrics(task, tokenBudget, context, relevantSources, attributionUtf8Bytes, baseUrl) {
|
|
@@ -2056,6 +2147,8 @@ async function evaluateTask(pages, task, configurationIssues = [], runOptions =
|
|
|
2056
2147
|
title: source.title,
|
|
2057
2148
|
framework: source.framework,
|
|
2058
2149
|
version: source.version,
|
|
2150
|
+
package: source.package,
|
|
2151
|
+
tags: source.tags,
|
|
2059
2152
|
locale: source.locale
|
|
2060
2153
|
}))
|
|
2061
2154
|
}
|
|
@@ -2070,7 +2163,10 @@ async function evaluateTask(pages, task, configurationIssues = [], runOptions =
|
|
|
2070
2163
|
if (!citations.passed) issues.push(`${citations.evidence === "results" ? "Search-result" : "Context"} citations are missing, unexpected, or do not match source records.`);
|
|
2071
2164
|
if (task.expect.answer && !runOptions.answer) issues.push("Answer expectations require agent.evaluations.answer to be configured.");
|
|
2072
2165
|
if (!answer.passed) issues.push("The actual answer is missing required text/citations or contains invalid evidence.");
|
|
2073
|
-
if (!selection.passed)
|
|
2166
|
+
if (!selection.passed) {
|
|
2167
|
+
const checksPackageOrTags = Boolean(task.expect.scope?.package || task.expect.scope?.tags || task.filters?.package || task.filters?.tags);
|
|
2168
|
+
issues.push(checksPackageOrTags ? "Retrieved sources are ambiguous or do not explicitly match the expected framework/version/package/tags/locale." : "Retrieved sources are ambiguous or do not explicitly match the expected framework/version/locale.");
|
|
2169
|
+
}
|
|
2074
2170
|
if (!examples.passed) issues.push("One or more expected examples did not meet the requested verification level.");
|
|
2075
2171
|
if (!usage.passed) issues.push("Context exceeded its budget or did not meet the configured useful-byte ratio.");
|
|
2076
2172
|
const passed = configurationIssues.length === 0 && !surfaceError && !answerError && relevantSources.length > 0 && retrieval.passed && citations.passed && answer.passed && selection.passed && examples.passed && usage.passed;
|
|
@@ -2081,7 +2177,7 @@ async function evaluateTask(pages, task, configurationIssues = [], runOptions =
|
|
|
2081
2177
|
selection,
|
|
2082
2178
|
examples,
|
|
2083
2179
|
usage,
|
|
2084
|
-
hasSelectionExpectation: Boolean(task.expect.scope?.framework || task.expect.scope?.version || task.expect.scope?.locale || task.filters?.framework || task.filters?.version || task.filters?.locale),
|
|
2180
|
+
hasSelectionExpectation: Boolean(task.expect.scope?.framework || task.expect.scope?.version || task.expect.scope?.package || task.expect.scope?.tags || task.expect.scope?.locale || task.filters?.framework || task.filters?.version || task.filters?.package || task.filters?.tags || task.filters?.locale),
|
|
2085
2181
|
hasExampleExpectation: (task.expect.examples?.length ?? 0) > 0,
|
|
2086
2182
|
hasAnswerExpectation: Boolean(task.expect.answer)
|
|
2087
2183
|
});
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { A as buildDocsAgentDiscoverySpec, Bt as
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
1
|
+
import { A as buildDocsAgentDiscoverySpec, Bt as renderDocsSitemapMarkdown, Ht as resolveDocsSitemapConfig, Lt as buildDocsSitemapManifest, S as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, Vt as renderDocsSitemapXml, a as DEFAULT_AGENT_MD_ROUTE, at as renderDocsMarkdownDocument, c as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, g as DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE, h as DEFAULT_LLMS_FULL_TXT_ROUTE, it as renderDocsLlmsTxt, l as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, lt as resolveDocsAgentFeedbackConfig, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, o as DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE, rt as renderDocsAgentsDocument, st as renderDocsSkillDocument, t as DEFAULT_AGENTS_MD_ROUTE, v as DEFAULT_LLMS_TXT_ROUTE, wt as toDocsMarkdownUrl, x as DEFAULT_SKILL_MD_ROUTE, y as DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE } from "./agent-o9OTadrf.mjs";
|
|
2
|
+
import "./markdown-sections-7OoA7ylx.mjs";
|
|
3
|
+
import { A as buildDocsLegacySkillsIndex, D as buildDocsA2AAgentCard, L as resolveDocsPublishedAgentSkill, O as buildDocsAgentSkillsIndex, 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-BwL5ffGx.mjs";
|
|
4
|
+
import "./search-RfPcG1if.mjs";
|
|
5
|
+
import { t as resolveDocsI18n } from "./i18n-hHVWcflJ.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-BcuxnZqZ.mjs";
|
|
7
|
+
import "./sitemap-server-VefDnzEB.mjs";
|
|
8
|
+
import "./agent-evals-BFHGypqh.mjs";
|
|
8
9
|
import { createFilesystemDocsMcpSource, resolveDocsMcpConfig } from "./mcp.mjs";
|
|
9
10
|
import "./code-blocks-DnNVNK2M.mjs";
|
|
10
|
-
import { t as resolveConfiguredAgentSkills } from "./agent-skills-server-
|
|
11
|
+
import { t as resolveConfiguredAgentSkills } from "./agent-skills-server-noFn1l_p.mjs";
|
|
11
12
|
import "./server.mjs";
|
|
12
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-Wcdj-D0a.mjs";
|
|
13
14
|
import { t as detectFramework } from "./utils-DpiIioYb.mjs";
|