@farming-labs/docs 0.2.82 → 0.2.84
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-Dze2Cy5B.mjs → agent-D68WI6-N.mjs} +308 -51
- package/dist/{agent-Biyd8A98.mjs → agent-DuwSq3C7.mjs} +2 -2
- package/dist/{agent-evals-Burrzyam.mjs → agent-evals-CEvUQb_Z.mjs} +1 -1
- package/dist/{agent-export-whKAZQUI.mjs → agent-export-BMljO4ll.mjs} +5 -5
- package/dist/{agent-WS4GXGh6.d.mts → agent-qJNbZUCZ.d.mts} +14 -2
- package/dist/agent-skills-bundle.d.mts +1 -1
- package/dist/{agent-skills-server-q4B9kRGg.d.mts → agent-skills-server-aKgt9CR9.d.mts} +2 -2
- package/dist/agent-skills-vite.d.mts +3 -3
- package/dist/{agents-B_980VCs.mjs → agents-D1j3fKjv.mjs} +4 -4
- package/dist/cli/index.mjs +14 -14
- package/dist/client/react.d.mts +1 -1
- package/dist/{cloud-ask-ai-BQAeHkpZ.d.mts → cloud-ask-ai-Bx-qtqHL.d.mts} +1 -1
- package/dist/{content-change-hydration-DpQ0KdAD.mjs → content-change-hydration-CiMxs3LF.mjs} +1 -1
- package/dist/docs-cloud-server.d.mts +2 -2
- package/dist/{doctor-WjuyRWYT.mjs → doctor-DaZp33gE.mjs} +8 -8
- package/dist/{golden-evaluations-B2GHnoFa.mjs → golden-evaluations-BKxcJ1qw.mjs} +7 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +4 -4
- package/dist/{mcp-bhIsgqxy.mjs → mcp-CwTbgrZm.mjs} +4 -4
- package/dist/mcp.d.mts +3 -3
- package/dist/mcp.mjs +95 -5
- package/dist/{prompt-references-embiJdYt.mjs → prompt-references-ClTizbsa.mjs} +2 -2
- package/dist/{retrieval-digest-DRRHA1B3.d.mts → retrieval-digest-CG9QWgw-.d.mts} +2 -2
- package/dist/{review-2e4TXoGS.mjs → review-BMO-4X_5.mjs} +4 -4
- package/dist/{robots-BIySk2gE.mjs → robots-CLtbWSEJ.mjs} +2 -2
- package/dist/{robots-D96X6eVX.mjs → robots-HWKsiZQS.mjs} +1 -1
- package/dist/{search-DfB3LQ4s.mjs → search-ZY4rf1fy.mjs} +4 -4
- package/dist/server.d.mts +6 -6
- package/dist/server.mjs +4 -4
- package/dist/{sitemap-AcwP8jIo.mjs → sitemap-CAzZFDic.mjs} +4 -4
- package/dist/{sitemap-server-BefXEox6.mjs → sitemap-server-_AeFxJQB.mjs} +1 -1
- package/dist/{standards-discovery-DPUEcUmb.d.mts → standards-discovery-UdXpOfmN.d.mts} +1 -1
- package/dist/{types-lGEHcx_6.d.mts → types-DQl2dvDl.d.mts} +66 -1
- package/package.json +1 -1
|
@@ -2408,6 +2408,8 @@ const MAX_SEARCH_WARNINGS = 16;
|
|
|
2408
2408
|
const MAX_SEARCH_WARNING_VALUES = 16;
|
|
2409
2409
|
const MAX_SEARCH_WARNING_PAGE_URLS = 8;
|
|
2410
2410
|
const MAX_SEARCH_FACET_VALUES = 100;
|
|
2411
|
+
const MAX_SEARCH_EXPLANATION_TERMS = 32;
|
|
2412
|
+
const MAX_SEARCH_EXPLANATION_TERM_CHARS = 128;
|
|
2411
2413
|
const RETRIEVAL_INDEX_FORMAT = "docs-retrieval-index.v1";
|
|
2412
2414
|
const MAX_RETRIEVAL_SOURCE_URL_CHARS = 4096;
|
|
2413
2415
|
const MAX_RETRIEVAL_SOURCE_VALUE_CHARS = 256;
|
|
@@ -2522,6 +2524,9 @@ function resolveDocsSearchRequest(searchParams) {
|
|
|
2522
2524
|
const response = searchParams.get("response");
|
|
2523
2525
|
const structured = response === "structured";
|
|
2524
2526
|
const facets = response === "facets";
|
|
2527
|
+
const rawExplain = searchParams.get("explain");
|
|
2528
|
+
if (rawExplain !== null && rawExplain !== "true" && rawExplain !== "false") throw new DocsSearchRequestError("Search explain must be `true` or `false`.");
|
|
2529
|
+
const explain = rawExplain === "true";
|
|
2525
2530
|
const rawFacet = searchParams.get("facet");
|
|
2526
2531
|
let facet;
|
|
2527
2532
|
if (rawFacet !== null) {
|
|
@@ -2543,6 +2548,7 @@ function resolveDocsSearchRequest(searchParams) {
|
|
|
2543
2548
|
return {
|
|
2544
2549
|
filters: resolveDocsSearchFilters(searchParams),
|
|
2545
2550
|
structured,
|
|
2551
|
+
...explain ? { explain: true } : {},
|
|
2546
2552
|
...facets ? { facets: true } : {},
|
|
2547
2553
|
...facet !== void 0 ? { facet } : {},
|
|
2548
2554
|
...cursor !== void 0 ? { cursor } : {},
|
|
@@ -3703,9 +3709,14 @@ function buildDocsSearchDocuments(pages, chunking = {}, audience = "human") {
|
|
|
3703
3709
|
return [...base.content ? [base] : [], ...sections];
|
|
3704
3710
|
});
|
|
3705
3711
|
}
|
|
3706
|
-
function
|
|
3712
|
+
function analyzeDocsSearchDocument(query, document, explain = false) {
|
|
3707
3713
|
const q = normalizeSearchPhrase(query);
|
|
3708
|
-
if (!q) return
|
|
3714
|
+
if (!q) return {
|
|
3715
|
+
score: 0,
|
|
3716
|
+
matchedTerms: [],
|
|
3717
|
+
matchedTermsTruncated: false,
|
|
3718
|
+
rankingReasons: []
|
|
3719
|
+
};
|
|
3709
3720
|
const words = tokenizeSearchQuery(q);
|
|
3710
3721
|
const title = normalizeSearchPhrase(document.title);
|
|
3711
3722
|
const section = document.section ? normalizeSearchPhrase(document.section) : "";
|
|
@@ -3718,65 +3729,248 @@ function scoreDocument(query, document) {
|
|
|
3718
3729
|
const titleTokens = tokenizeSearchQuery(title);
|
|
3719
3730
|
const sectionTokens = tokenizeSearchQuery(section);
|
|
3720
3731
|
let score = 0;
|
|
3732
|
+
const reasonContributions = explain ? /* @__PURE__ */ new Map() : void 0;
|
|
3733
|
+
const addScore = (contribution, code, description) => {
|
|
3734
|
+
score += contribution;
|
|
3735
|
+
if (!reasonContributions) return;
|
|
3736
|
+
const current = reasonContributions.get(code);
|
|
3737
|
+
reasonContributions.set(code, {
|
|
3738
|
+
contribution: (current?.contribution ?? 0) + contribution,
|
|
3739
|
+
description: current?.description ?? description
|
|
3740
|
+
});
|
|
3741
|
+
};
|
|
3721
3742
|
const insideLiteralPriority = document.type !== "page" && hasDistinctSection && isLiteralLookupQuery(q) ? Math.max(literalMatchPriority(q, section), literalMatchPriority(q, description), literalMatchPriority(q, content)) : 0;
|
|
3722
|
-
if (insideLiteralPriority > 0)
|
|
3723
|
-
if (title === q)
|
|
3724
|
-
else if (title.startsWith(q))
|
|
3725
|
-
else if (title.includes(q))
|
|
3743
|
+
if (insideLiteralPriority > 0) addScore(insideLiteralPriority * 2250, "literal_match", "A short literal lookup matched this section or its searchable text.");
|
|
3744
|
+
if (title === q) addScore(1120, "title_phrase", "The normalized query exactly matches the page title.");
|
|
3745
|
+
else if (title.startsWith(q)) addScore(70, "title_phrase", "The page title starts with the normalized query.");
|
|
3746
|
+
else if (title.includes(q)) addScore(45, "title_phrase", "The page title contains the normalized query.");
|
|
3726
3747
|
if (hasDistinctSection) {
|
|
3727
|
-
if (section === q)
|
|
3728
|
-
else if (section.startsWith(q))
|
|
3729
|
-
else if (section.includes(q))
|
|
3730
|
-
if (titleSection === q)
|
|
3731
|
-
else if (titleSection.startsWith(q))
|
|
3732
|
-
else if (titleSection.includes(q))
|
|
3733
|
-
}
|
|
3734
|
-
if (urlSegments.includes(q))
|
|
3735
|
-
if (url.includes(q))
|
|
3736
|
-
if (description.includes(q))
|
|
3737
|
-
if (content.includes(q))
|
|
3748
|
+
if (section === q) addScore(1080, "section_phrase", "The normalized query exactly matches the section title.");
|
|
3749
|
+
else if (section.startsWith(q)) addScore(55, "section_phrase", "The section title starts with the normalized query.");
|
|
3750
|
+
else if (section.includes(q)) addScore(30, "section_phrase", "The section title contains the normalized query.");
|
|
3751
|
+
if (titleSection === q) addScore(1e3, "title_section_phrase", "The normalized query exactly matches the combined page and section title.");
|
|
3752
|
+
else if (titleSection.startsWith(q)) addScore(50, "title_section_phrase", "The combined page and section title starts with the normalized query.");
|
|
3753
|
+
else if (titleSection.includes(q)) addScore(28, "title_section_phrase", "The combined page and section title contains the normalized query.");
|
|
3754
|
+
}
|
|
3755
|
+
if (urlSegments.includes(q)) addScore(950, "url_phrase", "The normalized query exactly matches a URL segment.");
|
|
3756
|
+
if (url.includes(q)) addScore(12, "url_phrase", "The result URL contains the normalized query.");
|
|
3757
|
+
if (description.includes(q)) addScore(18, "description_phrase", "The page description contains the normalized query.");
|
|
3758
|
+
if (content.includes(q)) addScore(12, "content_phrase", "The searchable content contains the normalized query.");
|
|
3738
3759
|
let matchedWords = 0;
|
|
3739
3760
|
for (const word of words) {
|
|
3740
3761
|
let matched = false;
|
|
3741
3762
|
if (title === word) {
|
|
3742
|
-
|
|
3763
|
+
addScore(28, "title_terms", "Normalized query terms match the page title.");
|
|
3743
3764
|
matched = true;
|
|
3744
3765
|
} else if (title.startsWith(word)) {
|
|
3745
|
-
|
|
3766
|
+
addScore(20, "title_terms", "Normalized query terms match the page title.");
|
|
3746
3767
|
matched = true;
|
|
3747
3768
|
} else if (title.includes(word)) {
|
|
3748
|
-
|
|
3769
|
+
addScore(12, "title_terms", "Normalized query terms match the page title.");
|
|
3749
3770
|
matched = true;
|
|
3750
3771
|
}
|
|
3751
3772
|
if (hasDistinctSection) {
|
|
3752
3773
|
if (section === word) {
|
|
3753
|
-
|
|
3774
|
+
addScore(22, "section_terms", "Normalized query terms match the section title.");
|
|
3754
3775
|
matched = true;
|
|
3755
3776
|
} else if (section.startsWith(word)) {
|
|
3756
|
-
|
|
3777
|
+
addScore(16, "section_terms", "Normalized query terms match the section title.");
|
|
3757
3778
|
matched = true;
|
|
3758
3779
|
} else if (section.includes(word)) {
|
|
3759
|
-
|
|
3780
|
+
addScore(10, "section_terms", "Normalized query terms match the section title.");
|
|
3760
3781
|
matched = true;
|
|
3761
3782
|
}
|
|
3762
3783
|
}
|
|
3763
3784
|
if (description.includes(word)) {
|
|
3764
|
-
|
|
3785
|
+
addScore(6, "description_terms", "Normalized query terms match the page description.");
|
|
3765
3786
|
matched = true;
|
|
3766
3787
|
}
|
|
3767
3788
|
if (content.includes(word)) {
|
|
3768
|
-
|
|
3789
|
+
addScore(4, "content_terms", "Normalized query terms match the searchable content.");
|
|
3769
3790
|
matched = true;
|
|
3770
3791
|
}
|
|
3771
3792
|
if (matched) matchedWords += 1;
|
|
3772
3793
|
}
|
|
3773
3794
|
if (words.length > 1) {
|
|
3774
|
-
if (hasDistinctSection && sectionTokens.length > 0 && words.every((word) => sectionTokens.includes(word)))
|
|
3775
|
-
if (document.type === "page" && titleTokens.length > 0 && words.every((word) => titleTokens.includes(word)))
|
|
3795
|
+
if (hasDistinctSection && sectionTokens.length > 0 && words.every((word) => sectionTokens.includes(word))) addScore(30, "all_terms_in_section", "Every normalized query term occurs in the section title.");
|
|
3796
|
+
if (document.type === "page" && titleTokens.length > 0 && words.every((word) => titleTokens.includes(word))) addScore(24, "all_terms_in_title", "Every normalized query term occurs in the page title.");
|
|
3797
|
+
}
|
|
3798
|
+
if (matchedWords === words.length && words.length > 1) addScore(20, "all_query_terms", "Every normalized query term matched a searchable field.");
|
|
3799
|
+
if (score > 0 && document.type === "heading" && hasDistinctSection) addScore(6, "heading_boost", "A distinct matching section is preferred over a page-only hit.");
|
|
3800
|
+
const matchedTerms = [];
|
|
3801
|
+
let matchedTermCount = 0;
|
|
3802
|
+
let matchedTermCharactersTruncated = false;
|
|
3803
|
+
if (explain) {
|
|
3804
|
+
const candidateTerms = words.length > 0 ? words : [q];
|
|
3805
|
+
const fields = [
|
|
3806
|
+
["title", title],
|
|
3807
|
+
["section", section],
|
|
3808
|
+
["description", description],
|
|
3809
|
+
["content", content],
|
|
3810
|
+
["url", url]
|
|
3811
|
+
];
|
|
3812
|
+
for (const term of candidateTerms) {
|
|
3813
|
+
const matchingFields = fields.flatMap(([field, value]) => value.includes(term) ? [field] : []);
|
|
3814
|
+
if (matchingFields.length === 0) continue;
|
|
3815
|
+
matchedTermCount += 1;
|
|
3816
|
+
if (matchedTerms.length < MAX_SEARCH_EXPLANATION_TERMS) {
|
|
3817
|
+
matchedTermCharactersTruncated ||= term.length > MAX_SEARCH_EXPLANATION_TERM_CHARS;
|
|
3818
|
+
matchedTerms.push({
|
|
3819
|
+
term: term.slice(0, MAX_SEARCH_EXPLANATION_TERM_CHARS),
|
|
3820
|
+
fields: matchingFields
|
|
3821
|
+
});
|
|
3822
|
+
}
|
|
3823
|
+
}
|
|
3776
3824
|
}
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3825
|
+
return {
|
|
3826
|
+
score,
|
|
3827
|
+
matchedTerms,
|
|
3828
|
+
matchedTermsTruncated: matchedTermCount > matchedTerms.length || matchedTermCharactersTruncated,
|
|
3829
|
+
rankingReasons: reasonContributions ? [...reasonContributions.entries()].map(([code, value]) => ({
|
|
3830
|
+
code,
|
|
3831
|
+
...value
|
|
3832
|
+
})).sort((left, right) => right.contribution - left.contribution || left.code.localeCompare(right.code)) : []
|
|
3833
|
+
};
|
|
3834
|
+
}
|
|
3835
|
+
function scoreDocument(query, document) {
|
|
3836
|
+
return analyzeDocsSearchDocument(query, document).score;
|
|
3837
|
+
}
|
|
3838
|
+
function getDocsSearchExplanationResultIdentity(result) {
|
|
3839
|
+
return JSON.stringify([
|
|
3840
|
+
result.id,
|
|
3841
|
+
result.url,
|
|
3842
|
+
result.section ?? null
|
|
3843
|
+
]);
|
|
3844
|
+
}
|
|
3845
|
+
function getDocsSearchExplanationDocumentIdentity(document) {
|
|
3846
|
+
return getSearchResultKey({
|
|
3847
|
+
id: document.id,
|
|
3848
|
+
url: document.url,
|
|
3849
|
+
content: document.title,
|
|
3850
|
+
type: document.type,
|
|
3851
|
+
section: document.section
|
|
3852
|
+
});
|
|
3853
|
+
}
|
|
3854
|
+
function resolveDocsSearchExplanationDocument(result, documentsById, documentsByResultKey) {
|
|
3855
|
+
const local = documentsById.get(result.id) ?? documentsByResultKey.get(getSearchResultKey(result));
|
|
3856
|
+
if (local) return local;
|
|
3857
|
+
return {
|
|
3858
|
+
id: result.id,
|
|
3859
|
+
url: result.url,
|
|
3860
|
+
title: inferResultTitle(result),
|
|
3861
|
+
content: result.content,
|
|
3862
|
+
description: result.description,
|
|
3863
|
+
section: result.section,
|
|
3864
|
+
type: result.type
|
|
3865
|
+
};
|
|
3866
|
+
}
|
|
3867
|
+
function buildDocsSearchFilterDecisions(filters, scope) {
|
|
3868
|
+
return SEARCH_FILTER_FIELDS.map((field) => {
|
|
3869
|
+
const requestedValues = filters[field] ?? [];
|
|
3870
|
+
const selectedValues = scope?.[field] ?? [];
|
|
3871
|
+
if (requestedValues.length === 0) return {
|
|
3872
|
+
field,
|
|
3873
|
+
requestedValues: [],
|
|
3874
|
+
selectedValues: [...selectedValues],
|
|
3875
|
+
matchedValues: [],
|
|
3876
|
+
outcome: "not_requested"
|
|
3877
|
+
};
|
|
3878
|
+
const matchedValues = requestedValues.filter((requested) => selectedValues.some((selected) => docsSearchScopeValueMatches(field, requested, selected)));
|
|
3879
|
+
const versionGroupsMatch = field !== "version" || !scope?.versionGroups?.length || agentVersionConstraintGroupsOverlap([requestedValues, ...scope.versionGroups]);
|
|
3880
|
+
const verifiable = Boolean(scope) && !scope?.conflicts?.includes(field) && !scope?.truncated?.includes(field) && selectedValues.length > 0;
|
|
3881
|
+
return {
|
|
3882
|
+
field,
|
|
3883
|
+
requestedValues: [...requestedValues],
|
|
3884
|
+
selectedValues: [...selectedValues],
|
|
3885
|
+
matchedValues,
|
|
3886
|
+
outcome: verifiable && matchedValues.length > 0 && versionGroupsMatch ? "matched" : "not_verifiable"
|
|
3887
|
+
};
|
|
3888
|
+
});
|
|
3889
|
+
}
|
|
3890
|
+
function buildDocsSearchAmbiguityResolution(filters, scope, warnings, unverifiableFields) {
|
|
3891
|
+
const decisions = SEARCH_AMBIGUITY_FIELDS.map((field) => {
|
|
3892
|
+
const selectedValues = [...scope?.[field] ?? []];
|
|
3893
|
+
const requestedValues = filters[field];
|
|
3894
|
+
if (requestedValues?.length) return {
|
|
3895
|
+
field,
|
|
3896
|
+
status: "resolved_by_filter",
|
|
3897
|
+
selectedValues,
|
|
3898
|
+
candidateValues: [...requestedValues],
|
|
3899
|
+
reason: `The explicit ${field} filter constrained the result set.`
|
|
3900
|
+
};
|
|
3901
|
+
const warning = warnings.find((candidate) => candidate.code === "ambiguous_scope" && candidate.field === field);
|
|
3902
|
+
if (warning) return {
|
|
3903
|
+
field,
|
|
3904
|
+
status: "requires_filter",
|
|
3905
|
+
selectedValues,
|
|
3906
|
+
...warning.values ? { candidateValues: [...warning.values] } : {},
|
|
3907
|
+
reason: `Results span multiple ${field} scopes; select a ${field} filter before acting on scope-specific guidance.`
|
|
3908
|
+
};
|
|
3909
|
+
const hasConflictingMetadata = warnings.some((candidate) => candidate.code === "conflicting_scope_metadata" && candidate.field === field);
|
|
3910
|
+
if (selectedValues.length === 0 || unverifiableFields.has(field) || hasConflictingMetadata) return {
|
|
3911
|
+
field,
|
|
3912
|
+
status: "not_verifiable",
|
|
3913
|
+
selectedValues,
|
|
3914
|
+
reason: `No trusted ${field} scope is available for this result.`
|
|
3915
|
+
};
|
|
3916
|
+
return {
|
|
3917
|
+
field,
|
|
3918
|
+
status: "unambiguous",
|
|
3919
|
+
selectedValues,
|
|
3920
|
+
reason: `The matching result set does not contain conflicting ${field} choices.`
|
|
3921
|
+
};
|
|
3922
|
+
});
|
|
3923
|
+
const hasUnresolved = decisions.some((decision) => decision.status === "requires_filter");
|
|
3924
|
+
const isNotVerifiable = decisions.some((decision) => decision.status === "not_verifiable");
|
|
3925
|
+
const hasResolved = decisions.some((decision) => decision.status === "resolved_by_filter");
|
|
3926
|
+
return {
|
|
3927
|
+
status: hasUnresolved ? "unresolved" : isNotVerifiable ? "not_verifiable" : hasResolved ? "resolved" : "unambiguous",
|
|
3928
|
+
decisions
|
|
3929
|
+
};
|
|
3930
|
+
}
|
|
3931
|
+
function explainDocsSearchResults(options) {
|
|
3932
|
+
const documentsById = new Map(options.documents.map((document) => [document.id, document]));
|
|
3933
|
+
const documentsByResultKey = new Map(options.documents.map((document) => [getDocsSearchExplanationDocumentIdentity(document), document]));
|
|
3934
|
+
return options.results.map((result, index, results) => {
|
|
3935
|
+
const document = resolveDocsSearchExplanationDocument(result, documentsById, documentsByResultKey);
|
|
3936
|
+
const analysis = analyzeDocsSearchDocument(options.query, document, true);
|
|
3937
|
+
const rankingStrategy = options.resolveRankingStrategy(result);
|
|
3938
|
+
const rankingReasons = rankingStrategy === "provider" ? [{
|
|
3939
|
+
code: "provider_order",
|
|
3940
|
+
description: `The ${options.provider} search adapter supplied this result order; provider-internal ranking details are not available to the shared pipeline.`
|
|
3941
|
+
}] : [...analysis.rankingReasons];
|
|
3942
|
+
if (rankingStrategy === "exact") rankingReasons.unshift({
|
|
3943
|
+
code: "exact_page_boost",
|
|
3944
|
+
contribution: 2e3,
|
|
3945
|
+
description: "An exact normalized page-title or URL-segment match was promoted."
|
|
3946
|
+
});
|
|
3947
|
+
if (rankingStrategy === "provider" && insideLiteralResultPriority(options.query, result) > 0) rankingReasons.push({
|
|
3948
|
+
code: "literal_result_priority",
|
|
3949
|
+
description: "The shared pipeline promoted this distinct section because it matched a short literal lookup."
|
|
3950
|
+
});
|
|
3951
|
+
const resultScore = result.score;
|
|
3952
|
+
const previousScore = index > 0 ? results[index - 1]?.score : void 0;
|
|
3953
|
+
const nextScore = index + 1 < results.length ? results[index + 1]?.score : void 0;
|
|
3954
|
+
if (rankingStrategy !== "provider" && resultScore !== void 0 && (resultScore === previousScore || resultScore === nextScore)) rankingReasons.push({
|
|
3955
|
+
code: "stable_url_tiebreak",
|
|
3956
|
+
description: "A stable URL comparison resolved an equal lexical score."
|
|
3957
|
+
});
|
|
3958
|
+
const selectedScope = result.source?.scope;
|
|
3959
|
+
return {
|
|
3960
|
+
...result,
|
|
3961
|
+
explanation: {
|
|
3962
|
+
format: "docs-search-explanation.v1",
|
|
3963
|
+
rank: options.rankOffset + index + 1,
|
|
3964
|
+
rankingStrategy,
|
|
3965
|
+
matchedTerms: analysis.matchedTerms,
|
|
3966
|
+
matchedTermsTruncated: analysis.matchedTermsTruncated,
|
|
3967
|
+
selectedScope: selectedScope ? { ...selectedScope } : null,
|
|
3968
|
+
filterDecisions: buildDocsSearchFilterDecisions(options.filters, selectedScope),
|
|
3969
|
+
ambiguityResolution: buildDocsSearchAmbiguityResolution(options.filters, selectedScope, options.warnings, options.unverifiableAmbiguityFields),
|
|
3970
|
+
rankingReasons
|
|
3971
|
+
}
|
|
3972
|
+
};
|
|
3973
|
+
});
|
|
3780
3974
|
}
|
|
3781
3975
|
function buildSnippet(document, query) {
|
|
3782
3976
|
const q = query.trim().toLowerCase();
|
|
@@ -4568,6 +4762,7 @@ function createMcpSearchAdapter(config) {
|
|
|
4568
4762
|
query: query.query,
|
|
4569
4763
|
limit: pageSize,
|
|
4570
4764
|
locale: query.locale,
|
|
4765
|
+
...query.explain ? { explain: true } : {},
|
|
4571
4766
|
...providerCursor !== void 0 ? { cursor: providerCursor } : {},
|
|
4572
4767
|
...forwardAudience ? { audience } : {},
|
|
4573
4768
|
...query.filters?.framework ? { framework: query.filters.framework } : {},
|
|
@@ -4994,7 +5189,8 @@ async function performDocsSearchInternal(options) {
|
|
|
4994
5189
|
locale: options.locale,
|
|
4995
5190
|
pathname: options.pathname,
|
|
4996
5191
|
audience,
|
|
4997
|
-
...hasFilters ? { filters } : {}
|
|
5192
|
+
...hasFilters ? { filters } : {},
|
|
5193
|
+
...options.explain ? { explain: true } : {}
|
|
4998
5194
|
};
|
|
4999
5195
|
let currentIndexGeneration;
|
|
5000
5196
|
const getCurrentIndexGeneration = () => {
|
|
@@ -5017,24 +5213,64 @@ async function performDocsSearchInternal(options) {
|
|
|
5017
5213
|
});
|
|
5018
5214
|
return hostedIndexGeneration;
|
|
5019
5215
|
};
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
}
|
|
5216
|
+
let explanationWarnings;
|
|
5217
|
+
const getExplanationWarnings = () => {
|
|
5218
|
+
explanationWarnings ??= buildDocsSearchWarnings({
|
|
5219
|
+
pages: corpusPages,
|
|
5220
|
+
results: [],
|
|
5221
|
+
filters,
|
|
5222
|
+
query: options.query,
|
|
5223
|
+
audience,
|
|
5224
|
+
baseUrl: options.baseUrl,
|
|
5225
|
+
completeResultSet: true
|
|
5226
|
+
});
|
|
5227
|
+
return explanationWarnings;
|
|
5228
|
+
};
|
|
5229
|
+
let explanationUnverifiableAmbiguityFields;
|
|
5230
|
+
const getExplanationUnverifiableAmbiguityFields = () => {
|
|
5231
|
+
explanationUnverifiableAmbiguityFields ??= new Set(SEARCH_AMBIGUITY_FIELDS.filter((field) => corpusPages.some((page) => {
|
|
5232
|
+
if (scoreDocument(options.query, pageToSearchDocument(page, audience)) <= 0) return false;
|
|
5233
|
+
const scope = resolveDocsSearchPageScope(page);
|
|
5234
|
+
if (hasFilters && !docsSearchPageMatchesFilters(scope, filters)) return false;
|
|
5235
|
+
return scope.conflicts.includes(field) || scope.declarations[field].length === 0;
|
|
5236
|
+
})));
|
|
5237
|
+
return explanationUnverifiableAmbiguityFields;
|
|
5238
|
+
};
|
|
5239
|
+
const finalizeResults = async (results, ranking = "lexical") => {
|
|
5240
|
+
const enriched = await enrichDocsSearchResultsWithSources({
|
|
5241
|
+
results,
|
|
5242
|
+
pages: scopedPages,
|
|
5243
|
+
generationPages: options.generationPages ?? options.pages,
|
|
5244
|
+
audience,
|
|
5245
|
+
chunking: search.chunking,
|
|
5246
|
+
locale: options.locale,
|
|
5247
|
+
baseUrl: options.baseUrl,
|
|
5248
|
+
indexGeneration: options.indexGeneration,
|
|
5249
|
+
strictExternalOrigins: options.strictExternalOrigins,
|
|
5250
|
+
filters,
|
|
5251
|
+
requireCurrentIndexGeneration
|
|
5252
|
+
});
|
|
5253
|
+
if (!options.explain) return enriched.map((result) => {
|
|
5254
|
+
const { explanation: _explanation, ...resultWithoutExplanation } = result;
|
|
5255
|
+
return resultWithoutExplanation;
|
|
5256
|
+
});
|
|
5257
|
+
return explainDocsSearchResults({
|
|
5258
|
+
results: enriched,
|
|
5259
|
+
documents: getDocuments(),
|
|
5260
|
+
query: options.query,
|
|
5261
|
+
filters,
|
|
5262
|
+
warnings: getExplanationWarnings(),
|
|
5263
|
+
unverifiableAmbiguityFields: getExplanationUnverifiableAmbiguityFields(),
|
|
5264
|
+
provider: search.provider,
|
|
5265
|
+
rankOffset: options.offset ?? 0,
|
|
5266
|
+
resolveRankingStrategy: typeof ranking === "function" ? ranking : () => ranking
|
|
5267
|
+
});
|
|
5268
|
+
};
|
|
5033
5269
|
const createLocalPage = async () => {
|
|
5034
5270
|
const fallback = options.paginated ? await createSimpleSearchAdapter().searchPage(query, context) : normalizeDocsSearchAdapterPage(await createSimpleSearchAdapter().search(query, context));
|
|
5035
5271
|
if (options.expectedTotal !== void 0 && fallback.total !== options.expectedTotal) throw new DocsPaginationCursorError();
|
|
5036
5272
|
return {
|
|
5037
|
-
results: await finalizeResults(fallback.results),
|
|
5273
|
+
results: await finalizeResults(fallback.results, "lexical"),
|
|
5038
5274
|
total: options.paginated ? fallback.total : fallback.results.length,
|
|
5039
5275
|
paginationMode: "local"
|
|
5040
5276
|
};
|
|
@@ -5084,7 +5320,7 @@ async function performDocsSearchInternal(options) {
|
|
|
5084
5320
|
if (search.provider === "simple") {
|
|
5085
5321
|
if (options.expectedTotal !== void 0 && adapterPage.total !== options.expectedTotal) throw new DocsPaginationCursorError();
|
|
5086
5322
|
return {
|
|
5087
|
-
results: await finalizeResults(results),
|
|
5323
|
+
results: await finalizeResults(results, "lexical"),
|
|
5088
5324
|
total: options.paginated ? adapterPage.total : results.length,
|
|
5089
5325
|
paginationMode: "local"
|
|
5090
5326
|
};
|
|
@@ -5116,7 +5352,7 @@ async function performDocsSearchInternal(options) {
|
|
|
5116
5352
|
const endOffset = (query.offset ?? 0) + safeAdapterResults.length;
|
|
5117
5353
|
if (safeAdapterResults.length !== results.length || safeAdapterResults.length > (query.limit ?? search.maxResults) || endOffset > adapterPage.total || requireCurrentIndexGeneration && adapterPage.total === 0 && localAudienceProjectionResults.length > 0 || endOffset < adapterPage.total && safeAdapterResults.length === 0 || adapterPage.nextCursor !== void 0 && options.providerCursor !== void 0 && adapterPage.nextCursor === options.providerCursor || adapterPage.nextCursor !== void 0 && endOffset >= adapterPage.total || options.expectedTotal !== void 0 && adapterPage.total !== options.expectedTotal) return fallBackFromProvider();
|
|
5118
5354
|
return {
|
|
5119
|
-
results: await finalizeResults(safeAdapterResults),
|
|
5355
|
+
results: await finalizeResults(safeAdapterResults, "provider"),
|
|
5120
5356
|
total: adapterPage.total,
|
|
5121
5357
|
...adapterPage.nextCursor !== void 0 ? { nextCursor: adapterPage.nextCursor } : {},
|
|
5122
5358
|
paginationMode: "provider"
|
|
@@ -5125,20 +5361,30 @@ async function performDocsSearchInternal(options) {
|
|
|
5125
5361
|
if (options.supplementExternalResults === false) {
|
|
5126
5362
|
const bounded = safeAdapterResults.slice(0, query.limit ?? search.maxResults ?? DEFAULT_SEARCH_LIMIT);
|
|
5127
5363
|
return {
|
|
5128
|
-
results: await finalizeResults(bounded),
|
|
5364
|
+
results: await finalizeResults(bounded, "provider"),
|
|
5129
5365
|
total: bounded.length,
|
|
5130
5366
|
paginationMode: "provider"
|
|
5131
5367
|
};
|
|
5132
5368
|
}
|
|
5133
5369
|
const simpleAudienceResults = audience === "agent" || results.length === 0 || safeAdapterResults.length < results.length ? await createSimpleSearchAdapter().search(query, context) : [];
|
|
5370
|
+
const exactPageResults = buildExactPageSearchResults(options.query, scopedPages, audience);
|
|
5371
|
+
const rankingStrategyByResult = /* @__PURE__ */ new Map();
|
|
5372
|
+
for (const [group, strategy] of [
|
|
5373
|
+
[exactPageResults, "exact"],
|
|
5374
|
+
[safeAdapterResults, "provider"],
|
|
5375
|
+
[simpleAudienceResults, "lexical"]
|
|
5376
|
+
]) for (const result of group) {
|
|
5377
|
+
const identity = getDocsSearchExplanationResultIdentity(result);
|
|
5378
|
+
if (!rankingStrategyByResult.has(identity)) rankingStrategyByResult.set(identity, strategy);
|
|
5379
|
+
}
|
|
5134
5380
|
const combinedResults = mergeSearchResults([
|
|
5135
|
-
|
|
5381
|
+
exactPageResults,
|
|
5136
5382
|
safeAdapterResults,
|
|
5137
5383
|
simpleAudienceResults
|
|
5138
5384
|
], audience === "agent" ? (result) => getAskAIResultKey(result, options.baseUrl, options.strictExternalOrigins) : void 0);
|
|
5139
5385
|
const bounded = prioritizeLiteralInsideResults(options.query, combinedResults).slice(0, query.limit ?? search.maxResults ?? DEFAULT_SEARCH_LIMIT);
|
|
5140
5386
|
return {
|
|
5141
|
-
results: await finalizeResults(bounded),
|
|
5387
|
+
results: await finalizeResults(bounded, (result) => rankingStrategyByResult.get(getDocsSearchExplanationResultIdentity(result)) ?? "provider"),
|
|
5142
5388
|
total: bounded.length,
|
|
5143
5389
|
paginationMode: "provider"
|
|
5144
5390
|
};
|
|
@@ -6350,10 +6596,12 @@ function buildDocsDiagnostics(config, options = {}) {
|
|
|
6350
6596
|
human: search.enabled ? apiQueryRoute("query={query}") : null,
|
|
6351
6597
|
agent: search.enabled ? apiQueryRoute("query={query}&audience=agent") : null,
|
|
6352
6598
|
structuredAgent: search.enabled ? apiQueryRoute("query={query}&audience=agent&response=structured") : null,
|
|
6599
|
+
explainedAgent: search.enabled ? apiQueryRoute("query={query}&audience=agent&response=structured&explain=true") : null,
|
|
6353
6600
|
facets: search.enabled ? apiQueryRoute("audience=agent&response=facets") : null
|
|
6354
6601
|
},
|
|
6355
6602
|
agentEndpoint: search.enabled ? apiQueryRoute("query={query}&audience=agent") : null,
|
|
6356
6603
|
structuredAgentEndpoint: search.enabled ? apiQueryRoute("query={query}&audience=agent&response=structured") : null,
|
|
6604
|
+
explainedAgentEndpoint: search.enabled ? apiQueryRoute("query={query}&audience=agent&response=structured&explain=true") : null,
|
|
6357
6605
|
facetsEndpoint: search.enabled ? apiQueryRoute("audience=agent&response=facets") : null,
|
|
6358
6606
|
audienceParam: "audience",
|
|
6359
6607
|
defaultAudience: "human",
|
|
@@ -6365,6 +6613,10 @@ function buildDocsDiagnostics(config, options = {}) {
|
|
|
6365
6613
|
tags: "tags"
|
|
6366
6614
|
},
|
|
6367
6615
|
responseFormat: "docs-search.v1",
|
|
6616
|
+
explainParam: "explain",
|
|
6617
|
+
explainValue: "true",
|
|
6618
|
+
explanationField: "explanation",
|
|
6619
|
+
explanationFormat: "docs-search-explanation.v1",
|
|
6368
6620
|
facetsResponseFormat: "docs-search-facets.v1",
|
|
6369
6621
|
warningsField: "warnings",
|
|
6370
6622
|
facetParam: "facet",
|
|
@@ -8118,7 +8370,7 @@ function appendDocsMarkdownNegotiationStartLines(lines, context, variant) {
|
|
|
8118
8370
|
}
|
|
8119
8371
|
function appendDocsSearchStartLine(lines, context, variant) {
|
|
8120
8372
|
if (!context.searchEnabled) return;
|
|
8121
|
-
lines.push(`- Discover valid search filters with ${context.apiRoute}?audience=agent&response=facets before choosing framework, version, package, or tags values; continue a large field with facet={field}, limit={limit}, and its nextCursor.`, variant === "skill" ? `- Search with ${context.apiRoute}?query={query}&audience=agent&response=structured when you do not know the page; optionally repeat framework, version, package, or tags filters.` : `- Search with ${context.apiRoute}?query={query}&audience=agent&response=structured when the route is unknown; optionally repeat framework, version, package, or tags filters.`);
|
|
8373
|
+
lines.push(`- Discover valid search filters with ${context.apiRoute}?audience=agent&response=facets before choosing framework, version, package, or tags values; continue a large field with facet={field}, limit={limit}, and its nextCursor.`, variant === "skill" ? `- Search with ${context.apiRoute}?query={query}&audience=agent&response=structured when you do not know the page; optionally repeat framework, version, package, or tags filters and add explain=true for retrieval evidence.` : `- Search with ${context.apiRoute}?query={query}&audience=agent&response=structured when the route is unknown; optionally repeat framework, version, package, or tags filters and add explain=true for retrieval evidence.`);
|
|
8122
8374
|
}
|
|
8123
8375
|
function appendDocsContentChangesStartLine(lines, context) {
|
|
8124
8376
|
if (!context.contentChangesEnabled) return;
|
|
@@ -8489,6 +8741,7 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", apiRoute, apiCata
|
|
|
8489
8741
|
endpoint: apiQueryRoute("query={query}"),
|
|
8490
8742
|
agentEndpoint: apiQueryRoute("query={query}&audience=agent"),
|
|
8491
8743
|
structuredAgentEndpoint: apiQueryRoute("query={query}&audience=agent&response=structured"),
|
|
8744
|
+
explainedAgentEndpoint: apiQueryRoute("query={query}&audience=agent&response=structured&explain=true"),
|
|
8492
8745
|
facetsEndpoint: apiQueryRoute("audience=agent&response=facets"),
|
|
8493
8746
|
method: "GET",
|
|
8494
8747
|
queryParam: "query",
|
|
@@ -8500,6 +8753,10 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", apiRoute, apiCata
|
|
|
8500
8753
|
structuredResponseValue: "structured",
|
|
8501
8754
|
facetsResponseValue: "facets",
|
|
8502
8755
|
responseFormat: "docs-search.v1",
|
|
8756
|
+
explainParam: "explain",
|
|
8757
|
+
explainValue: "true",
|
|
8758
|
+
explanationField: "explanation",
|
|
8759
|
+
explanationFormat: "docs-search-explanation.v1",
|
|
8503
8760
|
facetsResponseFormat: "docs-search-facets.v1",
|
|
8504
8761
|
filterParams: {
|
|
8505
8762
|
framework: "framework",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as findDocsMarkdownPage, at as renderDocsMarkdownDocument } from "./agent-
|
|
1
|
+
import { B as findDocsMarkdownPage, at as renderDocsMarkdownDocument } from "./agent-D68WI6-N.mjs";
|
|
2
2
|
import { v as normalizePageAgentFrontmatter, x as stripGeneratedPageAgentContractMarkdown } from "./markdown-sections-7OoA7ylx.mjs";
|
|
3
|
-
import { c as hashGeneratedAgentContent, d as serializeGeneratedAgentDocument, s as GENERATED_AGENT_PROVENANCE_VERSION, u as parseGeneratedAgentDocument } from "./content-change-hydration-
|
|
3
|
+
import { c as hashGeneratedAgentContent, d as serializeGeneratedAgentDocument, s as GENERATED_AGENT_PROVENANCE_VERSION, u as parseGeneratedAgentDocument } from "./content-change-hydration-CiMxs3LF.mjs";
|
|
4
4
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
5
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";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { An as normalizeAgentFramework, Dn as agentVersionConstraintGroupsOverlap, Mn as normalizeAgentScopeValues, Nn as normalizeAgentVersion, On as agentVersionConstraintMatches, Zt as buildDocsAskAIContext, bn as resolveSearchRequestConfig, dn as performDocsSearch, jn as normalizeAgentLocale, kn as agentVersionConstraintsOverlap, un as normalizeDocsSearchFilters } from "./agent-
|
|
1
|
+
import { An as normalizeAgentFramework, Dn as agentVersionConstraintGroupsOverlap, Mn as normalizeAgentScopeValues, Nn as normalizeAgentVersion, On as agentVersionConstraintMatches, Zt as buildDocsAskAIContext, bn as resolveSearchRequestConfig, dn as performDocsSearch, jn as normalizeAgentLocale, kn as agentVersionConstraintsOverlap, un as normalizeDocsSearchFilters } from "./agent-D68WI6-N.mjs";
|
|
2
2
|
import { S as upsertPageAgentContractMarkdown, l as stripDocsGeneratedAgentContractMarkers, o as findDocsMarkdownSection } from "./markdown-sections-7OoA7ylx.mjs";
|
|
3
3
|
import { t as getDocsAgentSkillsConfiguredPaths } from "./agent-skills-server-D5qYU19g.mjs";
|
|
4
4
|
import { buildDocsMcpContext } from "./mcp.mjs";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { A as buildDocsAgentDiscoverySpec, Ft as renderDocsSitemapXml, It as resolveDocsSitemapConfig, Pt as renderDocsSitemapMarkdown, S as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, 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, jt as buildDocsSitemapManifest, 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-
|
|
1
|
+
import { A as buildDocsAgentDiscoverySpec, Ft as renderDocsSitemapXml, It as resolveDocsSitemapConfig, Pt as renderDocsSitemapMarkdown, S as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, 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, jt as buildDocsSitemapManifest, 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-D68WI6-N.mjs";
|
|
2
2
|
import "./markdown-sections-7OoA7ylx.mjs";
|
|
3
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-BKlEnK_H.mjs";
|
|
4
|
-
import "./content-change-hydration-
|
|
4
|
+
import "./content-change-hydration-CiMxs3LF.mjs";
|
|
5
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-
|
|
7
|
-
import "./sitemap-server-
|
|
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-HWKsiZQS.mjs";
|
|
7
|
+
import "./sitemap-server-_AeFxJQB.mjs";
|
|
8
8
|
import { r as resolveConfiguredAgentSkills } from "./agent-skills-server-D5qYU19g.mjs";
|
|
9
|
-
import "./agent-evals-
|
|
9
|
+
import "./agent-evals-CEvUQb_Z.mjs";
|
|
10
10
|
import { createFilesystemDocsMcpSource, resolveDocsMcpConfig } from "./mcp.mjs";
|
|
11
11
|
import "./code-blocks-0wjOsqdJ.mjs";
|
|
12
12
|
import "./server.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { O as DocsA2AAgentCardOptions, R as DocsDiscoveryApiRouteOptions, z as DocsPublishedAgentSkill } from "./standards-discovery-
|
|
1
|
+
import { Dn as DocsSearchDocument, Dr as PageAgentFrontmatter, En as DocsSearchConfig, F as DocsAgentContentChangesConfig, Fn as DocsSearchFilterField, Fr as ResolvedDocsRelatedLink, Gr as TypesenseDocsSearchConfig, In as DocsSearchFilterInput, Jn as DocsSearchSourcePage, K as DocsAgentFeedbackData, Kn as DocsSearchResult, Ln as DocsSearchFilters, Mn as DocsSearchFacetsResponse, Mt as DocsConfig, Rt as DocsContentChangesResponse, Tn as DocsSearchChunkingConfig, Ut as DocsI18nConfig, Wn as DocsSearchRequest, Yt as DocsMcpConfig, Zn as DocsSitemapConfig, bn as DocsSearchAdapterFactory, dr as LlmsTxtMaxCharsConfig, f as CustomDocsSearchConfig, fr as LlmsTxtMaxCharsMode, gn as DocsRobotsConfig, mr as McpDocsSearchConfig, on as DocsPaginatedSearchResponse, or as FeedbackConfig, pr as LlmsTxtSectionConfig, r as AlgoliaDocsSearchConfig, ur as LlmsTxtConfig, vn as DocsSearchAdapter, vt as DocsAskAIMcpConfig, zt as DocsContentSnapshot } from "./types-DQl2dvDl.mjs";
|
|
2
|
+
import { O as DocsA2AAgentCardOptions, R as DocsDiscoveryApiRouteOptions, z as DocsPublishedAgentSkill } from "./standards-discovery-UdXpOfmN.mjs";
|
|
3
3
|
import { DocsMcpPage, DocsMcpResolvedConfig } from "./mcp.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/i18n.d.ts
|
|
@@ -197,6 +197,8 @@ interface PerformDocsSearchOptions {
|
|
|
197
197
|
cursor?: string;
|
|
198
198
|
/** Optional framework, version, package, and tag constraints. */
|
|
199
199
|
filters?: DocsSearchFilterInput;
|
|
200
|
+
/** Include bounded explanations for the final ranked results. Defaults to false. */
|
|
201
|
+
explain?: boolean;
|
|
200
202
|
/**
|
|
201
203
|
* Controls provider failures. Runtime search keeps the resilient `fallback` default;
|
|
202
204
|
* diagnostics can request `throw` so a broken configured provider cannot be scored as
|
|
@@ -529,6 +531,7 @@ interface DocsDiagnosticsFeature {
|
|
|
529
531
|
routes?: Record<string, string | null>;
|
|
530
532
|
agentEndpoint?: string | null;
|
|
531
533
|
structuredAgentEndpoint?: string | null;
|
|
534
|
+
explainedAgentEndpoint?: string | null;
|
|
532
535
|
facetsEndpoint?: string | null;
|
|
533
536
|
audienceParam?: string;
|
|
534
537
|
defaultAudience?: "human" | "agent";
|
|
@@ -540,6 +543,10 @@ interface DocsDiagnosticsFeature {
|
|
|
540
543
|
tags: "tags";
|
|
541
544
|
};
|
|
542
545
|
responseFormat?: "docs-search.v1";
|
|
546
|
+
explainParam?: "explain";
|
|
547
|
+
explainValue?: "true";
|
|
548
|
+
explanationField?: "explanation";
|
|
549
|
+
explanationFormat?: "docs-search-explanation.v1";
|
|
543
550
|
facetsResponseFormat?: "docs-search-facets.v1";
|
|
544
551
|
format?: string;
|
|
545
552
|
sinceParam?: string;
|
|
@@ -1162,6 +1169,7 @@ declare function buildDocsAgentDiscoverySpec({
|
|
|
1162
1169
|
endpoint: string;
|
|
1163
1170
|
agentEndpoint: string;
|
|
1164
1171
|
structuredAgentEndpoint: string;
|
|
1172
|
+
explainedAgentEndpoint: string;
|
|
1165
1173
|
facetsEndpoint: string;
|
|
1166
1174
|
method: string;
|
|
1167
1175
|
queryParam: string;
|
|
@@ -1173,6 +1181,10 @@ declare function buildDocsAgentDiscoverySpec({
|
|
|
1173
1181
|
structuredResponseValue: string;
|
|
1174
1182
|
facetsResponseValue: string;
|
|
1175
1183
|
responseFormat: string;
|
|
1184
|
+
explainParam: string;
|
|
1185
|
+
explainValue: string;
|
|
1186
|
+
explanationField: string;
|
|
1187
|
+
explanationFormat: string;
|
|
1176
1188
|
facetsResponseFormat: string;
|
|
1177
1189
|
filterParams: {
|
|
1178
1190
|
framework: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { tt as DocsAgentSkillsInput } from "./types-
|
|
2
|
-
import { z as DocsPublishedAgentSkill } from "./standards-discovery-
|
|
1
|
+
import { tt as DocsAgentSkillsInput } from "./types-DQl2dvDl.mjs";
|
|
2
|
+
import { z as DocsPublishedAgentSkill } from "./standards-discovery-UdXpOfmN.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/agent-skills-server.d.ts
|
|
5
5
|
interface ResolveConfiguredAgentSkillsOptions {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { tt as DocsAgentSkillsInput } from "./types-
|
|
2
|
-
import { z as DocsPublishedAgentSkill } from "./standards-discovery-
|
|
3
|
-
import { t as ResolveConfiguredAgentSkillsOptions } from "./agent-skills-server-
|
|
1
|
+
import { tt as DocsAgentSkillsInput } from "./types-DQl2dvDl.mjs";
|
|
2
|
+
import { z as DocsPublishedAgentSkill } from "./standards-discovery-UdXpOfmN.mjs";
|
|
3
|
+
import { t as ResolveConfiguredAgentSkillsOptions } from "./agent-skills-server-aKgt9CR9.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/agent-skills-vite.d.ts
|
|
6
6
|
declare const DOCS_AGENT_SKILLS_BUNDLE_MODULE = "@farming-labs/docs/agent-skills-bundle";
|