@farming-labs/docs 0.2.52 → 0.2.54
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-BXvi0uhS.mjs +623 -0
- package/dist/{agent-CaOBIVFy.mjs → agent-DXkXi-pS.mjs} +765 -22
- package/dist/agent-evals-BD17jOqL.mjs +1166 -0
- package/dist/agent-export-n-a0GbeU.mjs +854 -0
- package/dist/agent-scope-B8lptqCd.mjs +283 -0
- package/dist/agent-surface-drift-LS8zQgbq.mjs +1429 -0
- package/dist/{agents-DjhjZaNP.mjs → agents-BJaRQimo.mjs} +7 -5
- package/dist/{analytics-BZEwTK-8.mjs → analytics-Bx44lg6d.mjs} +1 -1
- package/dist/cli/index.mjs +43 -28
- package/dist/client/react.d.mts +1 -1
- package/dist/client/react.mjs +1 -1
- package/dist/{cloud-C_Ok9rC5.mjs → cloud-HWFlbfLJ.mjs} +4 -4
- package/dist/{cloud-ask-ai-Cl-xaV8j.mjs → cloud-ask-ai-1k0q6OAH.mjs} +1 -1
- package/dist/{cloud-ask-ai-DcMe6xOf.d.mts → cloud-ask-ai-466g6uAi.d.mts} +1 -1
- package/dist/code-blocks-C9awWzEQ.mjs +871 -0
- package/dist/codeblocks-BzfkREEC.mjs +250 -0
- package/dist/{config-tiQCZ46q.mjs → config-CydaZ5PB.mjs} +52 -11
- package/dist/{dev-Tm9Ss4D6.mjs → dev-BA2kRuCn.mjs} +3 -3
- package/dist/docs-cloud-server.d.mts +2 -2
- package/dist/docs-cloud-server.mjs +2 -2
- package/dist/{doctor-O9o9kjN8.mjs → doctor-CQpQ2zZm.mjs} +177 -47
- package/dist/{downgrade-CYEaOctn.mjs → downgrade-BStNhyCc.mjs} +2 -2
- package/dist/i18n-CAlj1ADU.mjs +40 -0
- package/dist/index.d.mts +158 -3
- package/dist/index.mjs +7 -6
- package/dist/{init-Ch5On0zm.mjs → init-gnHQ_Pz9.mjs} +3 -3
- package/dist/{mcp-DuCPNHS-.mjs → mcp-DnxZZWpY.mjs} +10 -5
- package/dist/mcp.d.mts +122 -6
- package/dist/mcp.mjs +1943 -86
- package/dist/{package-version-C8PigBZk.mjs → package-version-DRIc08EU.mjs} +1 -1
- package/dist/{reading-time-CPAy1SWO.mjs → reading-time-BrTd3DIh.mjs} +277 -33
- package/dist/{review-lm3dt7yy.mjs → review-B6gyEFkD.mjs} +184 -14
- package/dist/{robots-DV7u4Ire.mjs → robots-4BUJxlvV.mjs} +4 -4
- package/dist/{robots-XVPs9lVz.mjs → robots-DAptQnkx.mjs} +1 -1
- package/dist/{search-BWuU70B0.mjs → search-CJIC1Cqo.mjs} +173 -79
- package/dist/{search-B6nEkx86.mjs → search-CbPm2x5g.mjs} +6 -4
- package/dist/{search-DFEhf9-s.d.mts → search-CfWvmVYA.d.mts} +3 -1
- package/dist/server.d.mts +108 -5
- package/dist/server.mjs +9 -8
- package/dist/{sitemap-BEiKy4Iy.mjs → sitemap-D6nP3J1Q.mjs} +8 -6
- package/dist/{sitemap-server-xEHtDUDB.mjs → sitemap-server-wsNLyVkb.mjs} +1 -1
- package/dist/{templates-uaauJcTO.mjs → templates-1Cod8KrJ.mjs} +11 -5
- package/dist/{types-XqGLsmOD.d.mts → types-BVgucdVm.d.mts} +194 -2
- package/dist/{upgrade-DzQtpgJM.mjs → upgrade-CXYRNV0C.mjs} +2 -2
- package/package.json +1 -1
- package/dist/agent-DXDOMJBw.mjs +0 -9
- package/dist/codeblocks-z9iT794h.mjs +0 -1713
- package/dist/review-B7goPYUb.mjs +0 -541
- /package/dist/{cloud-analytics-Dlk_byos.mjs → cloud-analytics-CSyFE6SS.mjs} +0 -0
- /package/dist/{errors-CW1LnxaQ.mjs → errors-BFUtdZfC.mjs} +0 -0
- /package/dist/{utils-D-xTRNuh.mjs → utils-DBCCkkJS.mjs} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { G as isDocsAgentsRequest, Ht as PAGE_AGENT_CONTRACT_START_MARKER, W as isDocsAgentDiscoveryRequest, Xt as upsertPageAgentContractMarkdown, Z as isDocsSkillRequest, _t as resolveDocsMarkdownRequest, ct as resolveDocsAgentFeedbackConfig, dt as resolveDocsAgentsFormat, lt as resolveDocsAgentFeedbackRequest, pt as resolveDocsLlmsTxtRequest, qt as renderPageAgentContractMarkdown, yt as resolveDocsSkillFormat, zt as PAGE_AGENT_CONTRACT_END_MARKER } from "./agent-DXkXi-pS.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/telemetry.ts
|
|
4
4
|
const DOCS_PACKAGE_NAME = "@farming-labs/docs";
|
|
@@ -413,6 +413,146 @@ function serializeGeneratedAgentDocument(content, provenance) {
|
|
|
413
413
|
].join("\n")}\n`;
|
|
414
414
|
}
|
|
415
415
|
|
|
416
|
+
//#endregion
|
|
417
|
+
//#region src/markdown-sections.ts
|
|
418
|
+
const HTML_ENTITIES = {
|
|
419
|
+
amp: "&",
|
|
420
|
+
apos: "'",
|
|
421
|
+
gt: ">",
|
|
422
|
+
lt: "<",
|
|
423
|
+
nbsp: " ",
|
|
424
|
+
quot: "\""
|
|
425
|
+
};
|
|
426
|
+
/**
|
|
427
|
+
* Reduce inline Markdown in a heading to the visible label used by search and anchors.
|
|
428
|
+
* This intentionally covers the common inline constructs without adding a Markdown parser
|
|
429
|
+
* dependency to the runtime package.
|
|
430
|
+
*/
|
|
431
|
+
function cleanDocsMarkdownHeadingLabel(value) {
|
|
432
|
+
return value.replace(/!\[([^\]]*)\]\([^)]*\)/gu, "$1").replace(/\[([^\]]+)\]\([^)]*\)/gu, "$1").replace(/!\[([^\]]*)\]\[[^\]]*\]/gu, "$1").replace(/\[([^\]]+)\]\[[^\]]*\]/gu, "$1").replace(/<((?:https?:\/\/|mailto:)[^>]+)>/giu, "$1").replace(/<[^>]+>/gu, "").replace(/`+([^`]*?)`+/gu, "$1").replace(/\\([!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~])/gu, "$1").replace(/[*_~]/gu, "").replace(/&(#(?:x[0-9a-f]+|\d+)|[a-z]+);/giu, (_match, entity) => {
|
|
433
|
+
if (entity.startsWith("#x") || entity.startsWith("#X")) {
|
|
434
|
+
const codePoint = Number.parseInt(entity.slice(2), 16);
|
|
435
|
+
return Number.isSafeInteger(codePoint) && codePoint >= 0 && codePoint <= 1114111 ? String.fromCodePoint(codePoint) : _match;
|
|
436
|
+
}
|
|
437
|
+
if (entity.startsWith("#")) {
|
|
438
|
+
const codePoint = Number.parseInt(entity.slice(1), 10);
|
|
439
|
+
return Number.isSafeInteger(codePoint) && codePoint >= 0 && codePoint <= 1114111 ? String.fromCodePoint(codePoint) : _match;
|
|
440
|
+
}
|
|
441
|
+
return HTML_ENTITIES[entity.toLowerCase()] ?? _match;
|
|
442
|
+
}).replace(/\s+/gu, " ").trim();
|
|
443
|
+
}
|
|
444
|
+
/** Keep anchors aligned with the framework's existing ASCII heading-slug behavior. */
|
|
445
|
+
function slugifyDocsMarkdownHeading(value) {
|
|
446
|
+
return cleanDocsMarkdownHeadingLabel(value).toLowerCase().replace(/[`'"‘’“”]/gu, "").replace(/&/gu, " and ").replace(/[^a-z0-9\s-]/gu, "").replace(/\s+/gu, "-").replace(/-+/gu, "-").replace(/^-|-$/gu, "");
|
|
447
|
+
}
|
|
448
|
+
function readOpeningFence(line) {
|
|
449
|
+
const match = line.match(/^ {0,3}(`{3,}|~{3,})/u);
|
|
450
|
+
if (!match) return void 0;
|
|
451
|
+
return {
|
|
452
|
+
marker: match[1][0],
|
|
453
|
+
length: match[1].length
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
function isClosingFence(line, fence) {
|
|
457
|
+
const marker = fence.marker === "`" ? "`" : "~";
|
|
458
|
+
const match = line.match(new RegExp(`^ {0,3}(${marker}{${fence.length},})[\\t ]*$`, "u"));
|
|
459
|
+
return Boolean(match);
|
|
460
|
+
}
|
|
461
|
+
function readAtxHeading(line) {
|
|
462
|
+
const match = line.match(/^ {0,3}(#{1,6})(?:[\t ]+|$)(.*)$/u);
|
|
463
|
+
if (!match) return void 0;
|
|
464
|
+
return {
|
|
465
|
+
title: cleanDocsMarkdownHeadingLabel(match[2].replace(/[\t ]+#+[\t ]*$/u, "").trim()),
|
|
466
|
+
level: match[1].length
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
function readSetextLevel(line) {
|
|
470
|
+
const match = line.match(/^ {0,3}(=+|-+)[\t ]*$/u);
|
|
471
|
+
if (!match) return void 0;
|
|
472
|
+
return match[1][0] === "=" ? 1 : 2;
|
|
473
|
+
}
|
|
474
|
+
function normalizeDocsSectionSelector(value) {
|
|
475
|
+
let selector = value.trim();
|
|
476
|
+
const hashIndex = selector.lastIndexOf("#");
|
|
477
|
+
if (hashIndex >= 0) selector = selector.slice(hashIndex + 1);
|
|
478
|
+
try {
|
|
479
|
+
selector = decodeURIComponent(selector);
|
|
480
|
+
} catch {}
|
|
481
|
+
return cleanDocsMarkdownHeadingLabel(selector.replace(/^#+/u, "")).toLowerCase();
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Parse heading sections once for search, Ask AI hydration, and MCP tools.
|
|
485
|
+
* Supports CommonMark ATX indentation, Setext headings, fenced-code exclusion,
|
|
486
|
+
* visible inline labels, and stable duplicate anchors.
|
|
487
|
+
*/
|
|
488
|
+
function parseDocsMarkdownSections(markdown) {
|
|
489
|
+
const lines = markdown.split("\n");
|
|
490
|
+
const headings = [];
|
|
491
|
+
const headingCounts = /* @__PURE__ */ new Map();
|
|
492
|
+
let openFence;
|
|
493
|
+
let setextCandidate;
|
|
494
|
+
const pushHeading = (title, level, start) => {
|
|
495
|
+
const baseAnchor = slugifyDocsMarkdownHeading(title) || `section-${headings.length}`;
|
|
496
|
+
const seen = headingCounts.get(baseAnchor) ?? 0;
|
|
497
|
+
headingCounts.set(baseAnchor, seen + 1);
|
|
498
|
+
headings.push({
|
|
499
|
+
title,
|
|
500
|
+
anchor: seen === 0 ? baseAnchor : `${baseAnchor}-${seen}`,
|
|
501
|
+
level,
|
|
502
|
+
start
|
|
503
|
+
});
|
|
504
|
+
};
|
|
505
|
+
for (let index = 0; index < lines.length; index += 1) {
|
|
506
|
+
const line = lines[index];
|
|
507
|
+
if (openFence) {
|
|
508
|
+
if (isClosingFence(line, openFence)) openFence = void 0;
|
|
509
|
+
setextCandidate = void 0;
|
|
510
|
+
continue;
|
|
511
|
+
}
|
|
512
|
+
const openingFence = readOpeningFence(line);
|
|
513
|
+
if (openingFence) {
|
|
514
|
+
openFence = openingFence;
|
|
515
|
+
setextCandidate = void 0;
|
|
516
|
+
continue;
|
|
517
|
+
}
|
|
518
|
+
const setextLevel = readSetextLevel(line);
|
|
519
|
+
if (setextLevel && setextCandidate?.index === index - 1) {
|
|
520
|
+
const title = cleanDocsMarkdownHeadingLabel(setextCandidate.value.trim());
|
|
521
|
+
if (title) pushHeading(title, setextLevel, setextCandidate.index);
|
|
522
|
+
setextCandidate = void 0;
|
|
523
|
+
continue;
|
|
524
|
+
}
|
|
525
|
+
const atxHeading = readAtxHeading(line);
|
|
526
|
+
if (atxHeading) {
|
|
527
|
+
pushHeading(atxHeading.title, atxHeading.level, index);
|
|
528
|
+
setextCandidate = void 0;
|
|
529
|
+
continue;
|
|
530
|
+
}
|
|
531
|
+
if (!line.trim() || /^ {4}|^\t/u.test(line)) {
|
|
532
|
+
setextCandidate = void 0;
|
|
533
|
+
continue;
|
|
534
|
+
}
|
|
535
|
+
setextCandidate = {
|
|
536
|
+
index,
|
|
537
|
+
value: line
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
return headings.map((heading, index) => {
|
|
541
|
+
const end = headings.slice(index + 1).find((candidate) => candidate.level <= heading.level)?.start ?? lines.length;
|
|
542
|
+
return {
|
|
543
|
+
title: heading.title,
|
|
544
|
+
anchor: heading.anchor,
|
|
545
|
+
level: heading.level,
|
|
546
|
+
content: lines.slice(heading.start, end).join("\n").trim()
|
|
547
|
+
};
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
function findDocsMarkdownSection(markdown, requestedSection) {
|
|
551
|
+
const selector = normalizeDocsSectionSelector(requestedSection);
|
|
552
|
+
if (!selector) return void 0;
|
|
553
|
+
return parseDocsMarkdownSections(markdown).find((section) => normalizeDocsSectionSelector(section.title) === selector || section.anchor === selector);
|
|
554
|
+
}
|
|
555
|
+
|
|
416
556
|
//#endregion
|
|
417
557
|
//#region src/search.ts
|
|
418
558
|
const DEFAULT_SEARCH_LIMIT = 10;
|
|
@@ -522,7 +662,10 @@ function resolveAskAIContextUrl(value, baseUrl) {
|
|
|
522
662
|
}
|
|
523
663
|
}
|
|
524
664
|
function getAskAIPageContent(page) {
|
|
525
|
-
return page.agentRawContent ?? page.agentFallbackRawContent ?? page.rawContent ?? page.content;
|
|
665
|
+
return upsertPageAgentContractMarkdown(page.agentRawContent ?? page.agentFallbackRawContent ?? page.rawContent ?? page.content, page.agent).replace(PAGE_AGENT_CONTRACT_START_MARKER, "").replace(PAGE_AGENT_CONTRACT_END_MARKER, "").replace(/^\r?\n+/, "");
|
|
666
|
+
}
|
|
667
|
+
function getPageAgentContractSearchText(page) {
|
|
668
|
+
return stripMarkdownText(renderPageAgentContractMarkdown(page.agent).replace(PAGE_AGENT_CONTRACT_START_MARKER, "").replace(PAGE_AGENT_CONTRACT_END_MARKER, ""));
|
|
526
669
|
}
|
|
527
670
|
function removeMdxModuleLinesOutsideFences(content) {
|
|
528
671
|
let inFence = false;
|
|
@@ -596,40 +739,6 @@ function clampText(value, maxChars) {
|
|
|
596
739
|
if (value.length <= maxChars) return value;
|
|
597
740
|
return `${value.slice(0, maxChars).trimEnd()}...`;
|
|
598
741
|
}
|
|
599
|
-
function extractHeadingText(line) {
|
|
600
|
-
const match = line.match(/^(#{1,6})\s+(.+?)\s*#*\s*$/);
|
|
601
|
-
if (!match) return null;
|
|
602
|
-
return {
|
|
603
|
-
level: match[1].length,
|
|
604
|
-
text: normalizeWhitespace(match[2].replace(/[`*_~]/g, ""))
|
|
605
|
-
};
|
|
606
|
-
}
|
|
607
|
-
function extractSectionMarkdown(content, section) {
|
|
608
|
-
if (!section) return content;
|
|
609
|
-
const target = normalizeWhitespace(section).toLowerCase();
|
|
610
|
-
const lines = content.split("\n");
|
|
611
|
-
let start = -1;
|
|
612
|
-
let level = 0;
|
|
613
|
-
for (let i = 0; i < lines.length; i += 1) {
|
|
614
|
-
const heading = extractHeadingText(lines[i]);
|
|
615
|
-
if (!heading) continue;
|
|
616
|
-
if (heading.text.toLowerCase() === target) {
|
|
617
|
-
start = i;
|
|
618
|
-
level = heading.level;
|
|
619
|
-
break;
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
if (start === -1) return content;
|
|
623
|
-
let end = lines.length;
|
|
624
|
-
for (let i = start + 1; i < lines.length; i += 1) {
|
|
625
|
-
const heading = extractHeadingText(lines[i]);
|
|
626
|
-
if (heading && heading.level <= level) {
|
|
627
|
-
end = i;
|
|
628
|
-
break;
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
return lines.slice(start, end).join("\n");
|
|
632
|
-
}
|
|
633
742
|
function findPageForSearchResult(pages, result) {
|
|
634
743
|
const resultPath = normalizeUrlPathname(result.url);
|
|
635
744
|
return pages.find((page) => normalizeUrlPathname(page.url) === resultPath);
|
|
@@ -642,7 +751,8 @@ function formatAskAIContextResult(options) {
|
|
|
642
751
|
const { result, page, maxChars, baseUrl } = options;
|
|
643
752
|
const title = inferResultTitle(result, page);
|
|
644
753
|
const section = result.section;
|
|
645
|
-
const
|
|
754
|
+
const sectionSelector = getSearchResultAnchor(result.url) ?? section;
|
|
755
|
+
const contextContent = clampText(cleanAskAIContextMarkdown(page ? sectionSelector ? findDocsMarkdownSection(getAskAIPageContent(page), sectionSelector)?.content ?? "" : getAskAIPageContent(page) : [result.content, result.description].filter(Boolean).join("\n\n")), maxChars);
|
|
646
756
|
return {
|
|
647
757
|
...result,
|
|
648
758
|
url: resolveAskAIContextUrl(result.url, baseUrl),
|
|
@@ -659,6 +769,20 @@ function getSearchResultKey(result) {
|
|
|
659
769
|
}
|
|
660
770
|
return `${normalizeUrlPathname(result.url)}#${normalizeWhitespace(hash || result.section || "").toLowerCase()}`;
|
|
661
771
|
}
|
|
772
|
+
function getSearchResultAnchor(value) {
|
|
773
|
+
let hash = "";
|
|
774
|
+
try {
|
|
775
|
+
hash = new URL(value, "https://docs.local").hash.replace(/^#/, "");
|
|
776
|
+
} catch {
|
|
777
|
+
hash = value.split("#")[1]?.split(/[?&]/)[0] ?? "";
|
|
778
|
+
}
|
|
779
|
+
if (!hash) return void 0;
|
|
780
|
+
try {
|
|
781
|
+
return decodeURIComponent(hash);
|
|
782
|
+
} catch {
|
|
783
|
+
return hash;
|
|
784
|
+
}
|
|
785
|
+
}
|
|
662
786
|
function mergeSearchResults(...groups) {
|
|
663
787
|
const seen = /* @__PURE__ */ new Set();
|
|
664
788
|
const results = [];
|
|
@@ -675,7 +799,7 @@ function pageToSearchDocument(page) {
|
|
|
675
799
|
id: makeDocumentId(page.url, "page"),
|
|
676
800
|
url: page.url,
|
|
677
801
|
title: page.title,
|
|
678
|
-
content: normalizeWhitespace(page.content),
|
|
802
|
+
content: normalizeWhitespace([page.content, getPageAgentContractSearchText(page)].join(" ")),
|
|
679
803
|
description: page.description,
|
|
680
804
|
type: "page",
|
|
681
805
|
locale: page.locale,
|
|
@@ -746,54 +870,24 @@ function buildAskAIContextBlock(result) {
|
|
|
746
870
|
function makeDocumentId(url, suffix) {
|
|
747
871
|
return `${url}#${suffix}`;
|
|
748
872
|
}
|
|
749
|
-
function slugifyHeading(text) {
|
|
750
|
-
return text.trim().toLowerCase().replace(/[`'"‘’“”]/g, "").replace(/&/g, " and ").replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
751
|
-
}
|
|
752
873
|
function splitPageIntoSections(page) {
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
function flush() {
|
|
760
|
-
const content = normalizeWhitespace(stripMarkdownText(currentLines.join("\n").trim()));
|
|
761
|
-
if (!content) return;
|
|
762
|
-
let url = page.url;
|
|
763
|
-
if (currentHeading) {
|
|
764
|
-
const baseSlug = slugifyHeading(currentHeading) || `section-${index}`;
|
|
765
|
-
const seen = headingCounts.get(baseSlug) ?? 0;
|
|
766
|
-
headingCounts.set(baseSlug, seen + 1);
|
|
767
|
-
const slug = seen === 0 ? baseSlug : `${baseSlug}-${seen}`;
|
|
768
|
-
url = `${page.url}#${slug}`;
|
|
769
|
-
}
|
|
770
|
-
sections.push({
|
|
771
|
-
id: makeDocumentId(page.url, currentHeading ? `section-${index}` : "page"),
|
|
772
|
-
url,
|
|
874
|
+
return parseDocsMarkdownSections(page.rawContent ?? page.content).flatMap((section, index) => {
|
|
875
|
+
const content = normalizeWhitespace(stripMarkdownText(section.content));
|
|
876
|
+
if (!content) return [];
|
|
877
|
+
return [{
|
|
878
|
+
id: makeDocumentId(page.url, `section-${index}`),
|
|
879
|
+
url: `${page.url}#${section.anchor}`,
|
|
773
880
|
title: page.title,
|
|
774
|
-
section:
|
|
881
|
+
section: section.title,
|
|
775
882
|
content,
|
|
776
883
|
description: page.description,
|
|
777
|
-
type:
|
|
884
|
+
type: "heading",
|
|
778
885
|
locale: page.locale,
|
|
779
886
|
framework: page.framework,
|
|
780
887
|
version: page.version,
|
|
781
888
|
tags: page.tags
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
}
|
|
785
|
-
for (const line of lines) {
|
|
786
|
-
const headingMatch = line.match(/^#{1,6}\s+(.+)$/);
|
|
787
|
-
if (headingMatch) {
|
|
788
|
-
flush();
|
|
789
|
-
currentHeading = normalizeWhitespace(headingMatch[1].replace(/#+$/g, ""));
|
|
790
|
-
currentLines = [];
|
|
791
|
-
continue;
|
|
792
|
-
}
|
|
793
|
-
currentLines.push(line);
|
|
794
|
-
}
|
|
795
|
-
flush();
|
|
796
|
-
return sections;
|
|
889
|
+
}];
|
|
890
|
+
});
|
|
797
891
|
}
|
|
798
892
|
function buildDocsSearchDocuments(pages, chunking = {}) {
|
|
799
893
|
const strategy = chunking.strategy ?? "section";
|
|
@@ -1490,4 +1584,4 @@ function createCustomSearchAdapter(adapter) {
|
|
|
1490
1584
|
}
|
|
1491
1585
|
|
|
1492
1586
|
//#endregion
|
|
1493
|
-
export {
|
|
1587
|
+
export { getDocsTelemetryFeatures as A, resolvePageSidebarFolderIndexBehavior as C, emitDocsTelemetryEvent as D, emitDocsTelemetryAgentSurfaceEvent as E, resolveDocsTelemetryConfig as M, emitDocsTelemetryMcpToolEvent as O, applySidebarFolderIndexBehavior as S, resolveSidebarFolderIndexBehaviorForPath as T, hashGeneratedAgentContent as _, createMcpSearchAdapter as a, serializeGeneratedAgentDocument as b, formatDocsAskAIPackageHints as c, resolveAskAISearchRequestConfig as d, resolveSearchRequestConfig as f, GENERATED_AGENT_PROVENANCE_VERSION as g, GENERATED_AGENT_PROVENANCE_MARKER as h, createCustomSearchAdapter as i, inferDocsTelemetryAgentSurface as j, emitDocsTelemetryProjectEvent as k, inferDocsAskAIPackageHints as l, parseDocsMarkdownSections as m, buildDocsSearchDocuments as n, createSimpleSearchAdapter as o, findDocsMarkdownSection as p, createAlgoliaSearchAdapter as r, createTypesenseSearchAdapter as s, buildDocsAskAIContext as t, performDocsSearch as u, normalizeGeneratedAgentContent as v, resolveSidebarFolderIndexBehavior as w, stripGeneratedAgentProvenance as x, parseGeneratedAgentDocument as y };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import "./agent-
|
|
2
|
-
import { n as buildDocsSearchDocuments, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter } from "./search-
|
|
3
|
-
import "./sitemap-server-
|
|
1
|
+
import "./agent-DXkXi-pS.mjs";
|
|
2
|
+
import { n as buildDocsSearchDocuments, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter } from "./search-CJIC1Cqo.mjs";
|
|
3
|
+
import "./sitemap-server-wsNLyVkb.mjs";
|
|
4
|
+
import "./agent-evals-BD17jOqL.mjs";
|
|
4
5
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
6
|
+
import "./code-blocks-C9awWzEQ.mjs";
|
|
5
7
|
import "./server.mjs";
|
|
6
|
-
import {
|
|
8
|
+
import { h as resolveDocsContentDir, m as resolveDocsConfigPath, o as loadProjectEnv, p as readTopLevelStringProperty } from "./config-CydaZ5PB.mjs";
|
|
7
9
|
import { readFileSync } from "node:fs";
|
|
8
10
|
import pc from "picocolors";
|
|
9
11
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $t as McpDocsSearchConfig, An as TypesenseDocsSearchConfig, At as DocsSearchDocument, D as DocsAnalyticsEventInput, Dt as DocsSearchAdapterFactory, E as DocsAnalyticsEvent, Ft as DocsSearchSourcePage, It as DocsSitemapConfig, L as DocsAskAIMcpConfig, Nt as DocsSearchResult, Ot as DocsSearchChunkingConfig, S as DocsAgentTraceEventInput, T as DocsAnalyticsConfig, Tt as DocsSearchAdapter, an as OpenDocsTarget, bn as ResolvedDocsRelatedLink, f as CustomDocsSearchConfig, ht as DocsObservabilityEventInput, kt as DocsSearchConfig, mt as DocsObservabilityEvent, nn as OpenDocsProvider, pt as DocsObservabilityConfig, r as AlgoliaDocsSearchConfig } from "./types-BVgucdVm.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/analytics.d.ts
|
|
4
4
|
declare const DOCS_AGENT_TRACE_EVENT_TYPES: readonly ["run.start", "run.end", "run.error", "user.input", "prompt.build", "retrieval.query", "retrieval.result", "retrieval.error", "model.call", "model.response", "model.stream", "model.error", "tool.call", "tool.result", "tool.error", "retry", "timeout", "error", "agent.final"];
|
|
@@ -72,6 +72,8 @@ type DocsSitemapFormat = "xml" | "markdown";
|
|
|
72
72
|
interface DocsSitemapPageInput {
|
|
73
73
|
slug?: string;
|
|
74
74
|
url: string;
|
|
75
|
+
/** Override the public Markdown representation URL when it differs from `${url}.md`. */
|
|
76
|
+
markdownUrl?: string;
|
|
75
77
|
title: string;
|
|
76
78
|
description?: string;
|
|
77
79
|
related?: ResolvedDocsRelatedLink[];
|
package/dist/server.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { i as isDocsCloudAskAIProvider, n as DocsCloudAskAIResponseOptions, r as createDocsCloudAskAIResponse, t as DocsCloudAskAIConfig } from "./cloud-ask-ai-
|
|
1
|
+
import { $t as McpDocsSearchConfig, At as DocsSearchDocument, C as DocsAgentTraceEventType, D as DocsAnalyticsEventInput, Dt as DocsSearchAdapterFactory, E as DocsAnalyticsEvent, Et as DocsSearchAdapterContext, F as DocsAskAIFeedbackMessage, Ft as DocsSearchSourcePage, I as DocsAskAIFeedbackValue, It as DocsSitemapConfig, L as DocsAskAIMcpConfig, Mt as DocsSearchQuery, N as DocsAskAIFeedbackConfig, Nt as DocsSearchResult, P as DocsAskAIFeedbackData, S as DocsAgentTraceEventInput, T as DocsAnalyticsConfig, Tt as DocsSearchAdapter, Z as DocsConfig, a as ApiReferenceRenderer, b as DocsAgentGoldenTaskExpectation, bt as DocsReviewRulesConfig, ht as DocsObservabilityEventInput, kt as DocsSearchConfig, mt as DocsObservabilityEvent, pt as DocsObservabilityConfig, v as DocsAgentGoldenExpectedExample, vt as DocsReviewCiMode, w as DocsAgentTraceStatus, x as DocsAgentGoldenTaskFilters, y as DocsAgentGoldenTask, yt as DocsReviewConfig } from "./types-BVgucdVm.mjs";
|
|
2
|
+
import { i as isDocsCloudAskAIProvider, n as DocsCloudAskAIResponseOptions, r as createDocsCloudAskAIResponse, t as DocsCloudAskAIConfig } from "./cloud-ask-ai-466g6uAi.mjs";
|
|
3
3
|
import { DocsCloudAskAIOptions, DocsCloudPublicConfig, DocsCloudRouteHandlerOptions, DocsCloudRouteHandlers, DocsCloudRuntimeEnv, DocsCloudRuntimeValue, DocsCloudServer, DocsCloudServerOptions, DocsCloudTrackEventOptions, createDocsCloudRouteHandler, createDocsCloudServer } from "./docs-cloud-server.mjs";
|
|
4
|
-
import { $ as createDocsAgentTraceId, A as resolveDocsSitemapRequest, B as normalizePromptProviderName, C as buildDocsSitemapManifest, D as renderDocsSitemapXml, E as renderDocsSitemapMarkdown, F as DEFAULT_PROMPT_PROVIDER_TEMPLATES, G as serializeDocsIconRegistry, H as resolvePromptProviderChoices, I as PromptAction, J as DOCS_AGENT_TRACE_EVENT_TYPES, K as serializeOpenDocsProvider, L as PromptProviderChoice, M as DEFAULT_OPEN_DOCS_PROMPT, N as DEFAULT_OPEN_DOCS_PROVIDER_IDS, O as resolveDocsSitemapConfig, P as DEFAULT_OPEN_DOCS_TARGET, Q as createDocsAgentTraceContext, R as SerializeOpenDocsProviderOptions, S as DocsSitemapResolvedConfig, T as readDocsSitemapManifestFromContentMap, U as sanitizePromptText, V as parsePromptStringArray, W as serializeDocsIcon, X as ResolvedDocsAnalyticsConfig, Y as DocsAgentTraceContext, Z as ResolvedDocsObservabilityConfig, _ as DEFAULT_SITEMAP_XML_ROUTE, a as createMcpSearchAdapter, at as resolveDocsObservabilityConfig, b as DocsSitemapManifestPage, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, et as emitDocsAgentTraceEvent, f as resolveSearchRequestConfig, g as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, h as DEFAULT_SITEMAP_MD_ROUTE, i as createCustomSearchAdapter, it as resolveDocsAnalyticsConfig, j as toDocsSitemapMarkdownUrl, k as resolveDocsSitemapPageLastmod, l as inferDocsAskAIPackageHints, m as DEFAULT_SITEMAP_MD_DOCS_ROUTE, n as buildDocsSearchDocuments, nt as emitDocsObservabilityEvent, o as createSimpleSearchAdapter, p as DEFAULT_SITEMAP_MANIFEST_PATH, q as serializeOpenDocsProviders, r as createAlgoliaSearchAdapter, rt as getDocsRequestAnalyticsProperties, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, tt as emitDocsAnalyticsEvent, u as performDocsSearch, v as DocsSitemapFormat, w as createDocsSitemapResponse, x as DocsSitemapPageInput, y as DocsSitemapManifest, z as SerializedOpenDocsProvider } from "./search-
|
|
5
|
-
import { DocsMcpCodeExample, DocsMcpConfigSchema, DocsMcpConfigSchemaOption, DocsMcpDocsList, DocsMcpDocsPageSummary, DocsMcpDocsSection, DocsMcpHttpHandlers, DocsMcpNavigationNode, DocsMcpNavigationTree, DocsMcpPage, DocsMcpResolvedConfig, DocsMcpSource, createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, normalizeDocsMcpRoute, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
4
|
+
import { $ as createDocsAgentTraceId, A as resolveDocsSitemapRequest, B as normalizePromptProviderName, C as buildDocsSitemapManifest, D as renderDocsSitemapXml, E as renderDocsSitemapMarkdown, F as DEFAULT_PROMPT_PROVIDER_TEMPLATES, G as serializeDocsIconRegistry, H as resolvePromptProviderChoices, I as PromptAction, J as DOCS_AGENT_TRACE_EVENT_TYPES, K as serializeOpenDocsProvider, L as PromptProviderChoice, M as DEFAULT_OPEN_DOCS_PROMPT, N as DEFAULT_OPEN_DOCS_PROVIDER_IDS, O as resolveDocsSitemapConfig, P as DEFAULT_OPEN_DOCS_TARGET, Q as createDocsAgentTraceContext, R as SerializeOpenDocsProviderOptions, S as DocsSitemapResolvedConfig, T as readDocsSitemapManifestFromContentMap, U as sanitizePromptText, V as parsePromptStringArray, W as serializeDocsIcon, X as ResolvedDocsAnalyticsConfig, Y as DocsAgentTraceContext, Z as ResolvedDocsObservabilityConfig, _ as DEFAULT_SITEMAP_XML_ROUTE, a as createMcpSearchAdapter, at as resolveDocsObservabilityConfig, b as DocsSitemapManifestPage, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, et as emitDocsAgentTraceEvent, f as resolveSearchRequestConfig, g as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, h as DEFAULT_SITEMAP_MD_ROUTE, i as createCustomSearchAdapter, it as resolveDocsAnalyticsConfig, j as toDocsSitemapMarkdownUrl, k as resolveDocsSitemapPageLastmod, l as inferDocsAskAIPackageHints, m as DEFAULT_SITEMAP_MD_DOCS_ROUTE, n as buildDocsSearchDocuments, nt as emitDocsObservabilityEvent, o as createSimpleSearchAdapter, p as DEFAULT_SITEMAP_MANIFEST_PATH, q as serializeOpenDocsProviders, r as createAlgoliaSearchAdapter, rt as getDocsRequestAnalyticsProperties, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, tt as emitDocsAnalyticsEvent, u as performDocsSearch, v as DocsSitemapFormat, w as createDocsSitemapResponse, x as DocsSitemapPageInput, y as DocsSitemapManifest, z as SerializedOpenDocsProvider } from "./search-CfWvmVYA.mjs";
|
|
5
|
+
import { CreateDocsMcpServerOptions, DEFAULT_DOCS_MCP_CORS_ALLOWED_HEADERS, DEFAULT_DOCS_MCP_CORS_EXPOSED_HEADERS, DEFAULT_DOCS_MCP_CORS_MAX_AGE_SECONDS, DEFAULT_DOCS_MCP_MAX_BODY_BYTES, DOCS_CONFIG_SCHEMA_OPTIONS, DocsMcpAgentContractSummary, DocsMcpCodeExample, DocsMcpConfigSchema, DocsMcpConfigSchemaOption, DocsMcpContextResult, DocsMcpContextSource, DocsMcpDocsList, DocsMcpDocsPageSummary, DocsMcpDocsSection, DocsMcpHttpHandlers, DocsMcpNavigationNode, DocsMcpNavigationTree, DocsMcpPage, DocsMcpRequestContext, DocsMcpResolvedConfig, DocsMcpResolvedCorsConfig, DocsMcpResolvedSecurityConfig, DocsMcpSource, DocsMcpTaskSummary, createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, getDocsConfigSchema, normalizeDocsMcpRoute, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
6
6
|
|
|
7
7
|
//#region src/code-group-mdx.d.ts
|
|
8
8
|
interface MarkdownNode {
|
|
@@ -130,7 +130,110 @@ declare function buildDocsReviewWorkflowPathFilters(options: {
|
|
|
130
130
|
configContent?: string;
|
|
131
131
|
}): string[];
|
|
132
132
|
//#endregion
|
|
133
|
+
//#region src/agent-evals.d.ts
|
|
134
|
+
type DocsGoldenEvaluationStatus = "unmeasured" | "passed" | "failed";
|
|
135
|
+
type DocsGoldenTaskFilters = DocsAgentGoldenTaskFilters;
|
|
136
|
+
type DocsGoldenExpectedExample = DocsAgentGoldenExpectedExample;
|
|
137
|
+
type DocsGoldenTaskExpectation = DocsAgentGoldenTaskExpectation;
|
|
138
|
+
type DocsGoldenTask = DocsAgentGoldenTask;
|
|
139
|
+
interface DocsGoldenRetrievedSource {
|
|
140
|
+
rank: number;
|
|
141
|
+
url: string;
|
|
142
|
+
title: string;
|
|
143
|
+
framework?: string;
|
|
144
|
+
version?: string;
|
|
145
|
+
utf8Bytes: number;
|
|
146
|
+
relevant: boolean;
|
|
147
|
+
truncated: boolean;
|
|
148
|
+
}
|
|
149
|
+
interface DocsGoldenRetrievalMetrics {
|
|
150
|
+
expectedRelevant: number;
|
|
151
|
+
retrievedRelevant: number;
|
|
152
|
+
recallAtK: number;
|
|
153
|
+
firstRelevantRank: number | null;
|
|
154
|
+
reciprocalRank: number;
|
|
155
|
+
forbiddenSources: string[];
|
|
156
|
+
passed: boolean;
|
|
157
|
+
}
|
|
158
|
+
interface DocsGoldenCitationMetrics {
|
|
159
|
+
expected: string[];
|
|
160
|
+
actual: string[];
|
|
161
|
+
missing: string[];
|
|
162
|
+
unexpected: string[];
|
|
163
|
+
precision: number;
|
|
164
|
+
recall: number;
|
|
165
|
+
/** True when every rendered Source line maps one-to-one to a returned source record. */
|
|
166
|
+
integrity: boolean;
|
|
167
|
+
passed: boolean;
|
|
168
|
+
}
|
|
169
|
+
interface DocsGoldenSelectionMetrics {
|
|
170
|
+
requestedFramework?: string;
|
|
171
|
+
requestedVersion?: string;
|
|
172
|
+
firstFrameworkMatchRank: number | null;
|
|
173
|
+
firstVersionMatchRank: number | null;
|
|
174
|
+
conflictingSources: string[];
|
|
175
|
+
ambiguousSources: string[];
|
|
176
|
+
passed: boolean;
|
|
177
|
+
}
|
|
178
|
+
interface DocsGoldenExampleResult {
|
|
179
|
+
expected: DocsGoldenExpectedExample;
|
|
180
|
+
matchedId?: string;
|
|
181
|
+
source?: string;
|
|
182
|
+
executable: boolean;
|
|
183
|
+
passed: boolean;
|
|
184
|
+
}
|
|
185
|
+
interface DocsGoldenExampleMetrics {
|
|
186
|
+
expected: number;
|
|
187
|
+
matched: number;
|
|
188
|
+
executable: number;
|
|
189
|
+
results: DocsGoldenExampleResult[];
|
|
190
|
+
passed: boolean;
|
|
191
|
+
}
|
|
192
|
+
interface DocsGoldenUsageMetrics {
|
|
193
|
+
budgetUnit: "utf8-bytes";
|
|
194
|
+
tokenBudget: number;
|
|
195
|
+
usedUtf8Bytes: number;
|
|
196
|
+
remainingUtf8Bytes: number;
|
|
197
|
+
estimatedTokens: number;
|
|
198
|
+
/** Exact conservative upper bound: one token per UTF-8 byte. */
|
|
199
|
+
conservativeTokenUpperBound: number;
|
|
200
|
+
usefulUtf8Bytes: number;
|
|
201
|
+
usefulByteRatio: number;
|
|
202
|
+
truncated: boolean;
|
|
203
|
+
withinBudget: boolean;
|
|
204
|
+
passed: boolean;
|
|
205
|
+
}
|
|
206
|
+
interface DocsGoldenTaskReport {
|
|
207
|
+
id: string;
|
|
208
|
+
query: string;
|
|
209
|
+
status: "passed" | "failed";
|
|
210
|
+
passed: boolean;
|
|
211
|
+
score: number;
|
|
212
|
+
context: string;
|
|
213
|
+
sources: DocsGoldenRetrievedSource[];
|
|
214
|
+
retrieval: DocsGoldenRetrievalMetrics;
|
|
215
|
+
citations: DocsGoldenCitationMetrics;
|
|
216
|
+
selection: DocsGoldenSelectionMetrics;
|
|
217
|
+
examples: DocsGoldenExampleMetrics;
|
|
218
|
+
usage: DocsGoldenUsageMetrics;
|
|
219
|
+
issues: string[];
|
|
220
|
+
}
|
|
221
|
+
interface DocsGoldenTasksReport {
|
|
222
|
+
status: DocsGoldenEvaluationStatus;
|
|
223
|
+
passed: boolean | null;
|
|
224
|
+
score: number | null;
|
|
225
|
+
taskCount: number;
|
|
226
|
+
passedTaskCount: number;
|
|
227
|
+
failedTaskCount: number;
|
|
228
|
+
tasks: DocsGoldenTaskReport[];
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Run deterministic, offline golden-task evaluations against MCP-ready docs pages.
|
|
232
|
+
* An empty task list is intentionally unmeasured so CI cannot turn absent coverage into a pass.
|
|
233
|
+
*/
|
|
234
|
+
declare function runDocsGoldenTasks(pages: readonly DocsMcpPage[], tasks: readonly DocsGoldenTask[] | undefined): Promise<DocsGoldenTasksReport>;
|
|
235
|
+
//#endregion
|
|
133
236
|
//#region src/sitemap-server.d.ts
|
|
134
237
|
declare function readDocsSitemapManifest(rootDir: string, sitemap?: boolean | DocsSitemapConfig): DocsSitemapManifest | null;
|
|
135
238
|
//#endregion
|
|
136
|
-
export { type ApiReferenceFramework, type ApiReferenceOpenApiDiscovery, type ApiReferenceRenderer, type ApiReferenceRoute, DEFAULT_API_REFERENCE_OPENAPI_ROUTE, DEFAULT_DOCS_REVIEW_SCORE_THRESHOLD, DEFAULT_DOCS_REVIEW_WORKFLOW_PATH, DEFAULT_OPEN_DOCS_PROMPT, DEFAULT_OPEN_DOCS_PROVIDER_IDS, DEFAULT_OPEN_DOCS_TARGET, DEFAULT_PROMPT_PROVIDER_TEMPLATES, DEFAULT_SITEMAP_MANIFEST_PATH, DEFAULT_SITEMAP_MD_DOCS_ROUTE, DEFAULT_SITEMAP_MD_ROUTE, DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, DEFAULT_SITEMAP_XML_ROUTE, DOCS_AGENT_TRACE_EVENT_TYPES, type DocsAgentTraceContext, type DocsAgentTraceEventInput, type DocsAgentTraceEventType, type DocsAgentTraceStatus, type DocsAnalyticsConfig, type DocsAnalyticsEvent, type DocsAnalyticsEventInput, type DocsAskAIFeedbackConfig, type DocsAskAIFeedbackData, type DocsAskAIFeedbackMessage, type DocsAskAIFeedbackValue, type DocsAskAIMcpConfig, type DocsCloudAskAIConfig, type DocsCloudAskAIOptions, type DocsCloudAskAIResponseOptions, type DocsCloudPublicConfig, type DocsCloudRouteHandlerOptions, type DocsCloudRouteHandlers, type DocsCloudRuntimeEnv, type DocsCloudRuntimeValue, type DocsCloudServer, type DocsCloudServerOptions, type DocsCloudTrackEventOptions, type DocsMcpCodeExample, type DocsMcpConfigSchema, type DocsMcpConfigSchemaOption, type DocsMcpDocsList, type DocsMcpDocsPageSummary, type DocsMcpDocsSection, type DocsMcpHttpHandlers, type DocsMcpNavigationNode, type DocsMcpNavigationTree, type DocsMcpPage, type DocsMcpResolvedConfig, type DocsMcpSource, type DocsObservabilityConfig, type DocsObservabilityEvent, type DocsObservabilityEventInput, type DocsSearchAdapter, type DocsSearchAdapterContext, type DocsSearchAdapterFactory, type DocsSearchConfig, type DocsSearchDocument, type DocsSearchQuery, type DocsSearchResult, type DocsSearchSourcePage, type DocsSitemapFormat, type DocsSitemapManifest, type DocsSitemapManifestPage, type DocsSitemapPageInput, type DocsSitemapResolvedConfig, type McpDocsSearchConfig, type PromptAction, type PromptProviderChoice, type ResolvedApiReferenceConfig, type ResolvedDocsAnalyticsConfig, type ResolvedDocsObservabilityConfig, type ResolvedDocsReviewConfig, type SerializeOpenDocsProviderOptions, type SerializedOpenDocsProvider, buildApiReferenceHtmlDocument, buildApiReferenceHtmlDocumentAsync, buildApiReferenceOpenApiDocument, buildApiReferenceOpenApiDocumentAsync, buildApiReferencePageTitle, buildApiReferenceScalarCss, buildDocsAskAIContext, buildDocsReviewWorkflow, buildDocsReviewWorkflowPathFilters, buildDocsSearchDocuments, buildDocsSitemapManifest, createAlgoliaSearchAdapter, createCustomSearchAdapter, createDocsAgentTraceContext, createDocsAgentTraceId, createDocsCloudAskAIResponse, createDocsCloudRouteHandler, createDocsCloudServer, createDocsMcpHttpHandler, createDocsMcpServer, createDocsSitemapResponse, createFilesystemDocsMcpSource, createMcpSearchAdapter, createSimpleSearchAdapter, createTypesenseSearchAdapter, emitDocsAgentTraceEvent, emitDocsAnalyticsEvent, emitDocsObservabilityEvent, ensureDocsReviewWorkflow, formatDocsAskAIPackageHints, getDocsRequestAnalyticsProperties, inferDocsAskAIPackageHints, isApiReferenceOpenApiRequest, isDocsCloudAskAIProvider, normalizeDocsMcpRoute, normalizePromptProviderName, parsePromptStringArray, performDocsSearch, readDocsReviewConfigFromSource, readDocsSitemapManifest, readDocsSitemapManifestFromContentMap, remarkCodeGroup, renderDocsSitemapMarkdown, renderDocsSitemapXml, resolveApiReferenceConfig, resolveApiReferenceOpenApiDiscovery, resolveApiReferenceRenderer, resolveAskAISearchRequestConfig, resolveDocsAnalyticsConfig, resolveDocsMcpConfig, resolveDocsObservabilityConfig, resolveDocsReviewConfig, resolveDocsSitemapConfig, resolveDocsSitemapPageLastmod, resolveDocsSitemapRequest, resolvePromptProviderChoices, resolveSearchRequestConfig, runDocsMcpStdio, sanitizePromptText, serializeDocsIcon, serializeDocsIconRegistry, serializeOpenDocsProvider, serializeOpenDocsProviders, toDocsSitemapMarkdownUrl };
|
|
239
|
+
export { type ApiReferenceFramework, type ApiReferenceOpenApiDiscovery, type ApiReferenceRenderer, type ApiReferenceRoute, type CreateDocsMcpServerOptions, DEFAULT_API_REFERENCE_OPENAPI_ROUTE, DEFAULT_DOCS_MCP_CORS_ALLOWED_HEADERS, DEFAULT_DOCS_MCP_CORS_EXPOSED_HEADERS, DEFAULT_DOCS_MCP_CORS_MAX_AGE_SECONDS, DEFAULT_DOCS_MCP_MAX_BODY_BYTES, DEFAULT_DOCS_REVIEW_SCORE_THRESHOLD, DEFAULT_DOCS_REVIEW_WORKFLOW_PATH, DEFAULT_OPEN_DOCS_PROMPT, DEFAULT_OPEN_DOCS_PROVIDER_IDS, DEFAULT_OPEN_DOCS_TARGET, DEFAULT_PROMPT_PROVIDER_TEMPLATES, DEFAULT_SITEMAP_MANIFEST_PATH, DEFAULT_SITEMAP_MD_DOCS_ROUTE, DEFAULT_SITEMAP_MD_ROUTE, DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, DEFAULT_SITEMAP_XML_ROUTE, DOCS_AGENT_TRACE_EVENT_TYPES, DOCS_CONFIG_SCHEMA_OPTIONS, type DocsAgentTraceContext, type DocsAgentTraceEventInput, type DocsAgentTraceEventType, type DocsAgentTraceStatus, type DocsAnalyticsConfig, type DocsAnalyticsEvent, type DocsAnalyticsEventInput, type DocsAskAIFeedbackConfig, type DocsAskAIFeedbackData, type DocsAskAIFeedbackMessage, type DocsAskAIFeedbackValue, type DocsAskAIMcpConfig, type DocsCloudAskAIConfig, type DocsCloudAskAIOptions, type DocsCloudAskAIResponseOptions, type DocsCloudPublicConfig, type DocsCloudRouteHandlerOptions, type DocsCloudRouteHandlers, type DocsCloudRuntimeEnv, type DocsCloudRuntimeValue, type DocsCloudServer, type DocsCloudServerOptions, type DocsCloudTrackEventOptions, type DocsGoldenCitationMetrics, type DocsGoldenEvaluationStatus, type DocsGoldenExampleMetrics, type DocsGoldenExampleResult, type DocsGoldenExpectedExample, type DocsGoldenRetrievalMetrics, type DocsGoldenRetrievedSource, type DocsGoldenSelectionMetrics, type DocsGoldenTask, type DocsGoldenTaskExpectation, type DocsGoldenTaskFilters, type DocsGoldenTaskReport, type DocsGoldenTasksReport, type DocsGoldenUsageMetrics, type DocsMcpAgentContractSummary, type DocsMcpCodeExample, type DocsMcpConfigSchema, type DocsMcpConfigSchemaOption, type DocsMcpContextResult, type DocsMcpContextSource, type DocsMcpDocsList, type DocsMcpDocsPageSummary, type DocsMcpDocsSection, type DocsMcpHttpHandlers, type DocsMcpNavigationNode, type DocsMcpNavigationTree, type DocsMcpPage, type DocsMcpRequestContext, type DocsMcpResolvedConfig, type DocsMcpResolvedCorsConfig, type DocsMcpResolvedSecurityConfig, type DocsMcpSource, type DocsMcpTaskSummary, type DocsObservabilityConfig, type DocsObservabilityEvent, type DocsObservabilityEventInput, type DocsSearchAdapter, type DocsSearchAdapterContext, type DocsSearchAdapterFactory, type DocsSearchConfig, type DocsSearchDocument, type DocsSearchQuery, type DocsSearchResult, type DocsSearchSourcePage, type DocsSitemapFormat, type DocsSitemapManifest, type DocsSitemapManifestPage, type DocsSitemapPageInput, type DocsSitemapResolvedConfig, type McpDocsSearchConfig, type PromptAction, type PromptProviderChoice, type ResolvedApiReferenceConfig, type ResolvedDocsAnalyticsConfig, type ResolvedDocsObservabilityConfig, type ResolvedDocsReviewConfig, type SerializeOpenDocsProviderOptions, type SerializedOpenDocsProvider, buildApiReferenceHtmlDocument, buildApiReferenceHtmlDocumentAsync, buildApiReferenceOpenApiDocument, buildApiReferenceOpenApiDocumentAsync, buildApiReferencePageTitle, buildApiReferenceScalarCss, buildDocsAskAIContext, buildDocsReviewWorkflow, buildDocsReviewWorkflowPathFilters, buildDocsSearchDocuments, buildDocsSitemapManifest, createAlgoliaSearchAdapter, createCustomSearchAdapter, createDocsAgentTraceContext, createDocsAgentTraceId, createDocsCloudAskAIResponse, createDocsCloudRouteHandler, createDocsCloudServer, createDocsMcpHttpHandler, createDocsMcpServer, createDocsSitemapResponse, createFilesystemDocsMcpSource, createMcpSearchAdapter, createSimpleSearchAdapter, createTypesenseSearchAdapter, emitDocsAgentTraceEvent, emitDocsAnalyticsEvent, emitDocsObservabilityEvent, ensureDocsReviewWorkflow, formatDocsAskAIPackageHints, getDocsConfigSchema, getDocsRequestAnalyticsProperties, inferDocsAskAIPackageHints, isApiReferenceOpenApiRequest, isDocsCloudAskAIProvider, normalizeDocsMcpRoute, normalizePromptProviderName, parsePromptStringArray, performDocsSearch, readDocsReviewConfigFromSource, readDocsSitemapManifest, readDocsSitemapManifestFromContentMap, remarkCodeGroup, renderDocsSitemapMarkdown, renderDocsSitemapXml, resolveApiReferenceConfig, resolveApiReferenceOpenApiDiscovery, resolveApiReferenceRenderer, resolveAskAISearchRequestConfig, resolveDocsAnalyticsConfig, resolveDocsMcpConfig, resolveDocsObservabilityConfig, resolveDocsReviewConfig, resolveDocsSitemapConfig, resolveDocsSitemapPageLastmod, resolveDocsSitemapRequest, resolvePromptProviderChoices, resolveSearchRequestConfig, runDocsGoldenTasks, runDocsMcpStdio, sanitizePromptText, serializeDocsIcon, serializeDocsIconRegistry, serializeOpenDocsProvider, serializeOpenDocsProviders, toDocsSitemapMarkdownUrl };
|
package/dist/server.mjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { a as emitDocsAnalyticsEvent, c as resolveDocsAnalyticsConfig, i as emitDocsAgentTraceEvent, l as resolveDocsObservabilityConfig, n as createDocsAgentTraceContext, o as emitDocsObservabilityEvent, r as createDocsAgentTraceId, s as getDocsRequestAnalyticsProperties, t as DOCS_AGENT_TRACE_EVENT_TYPES } from "./analytics-
|
|
2
|
-
import { At as
|
|
3
|
-
import { a as createMcpSearchAdapter, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, f as resolveSearchRequestConfig, i as createCustomSearchAdapter, l as inferDocsAskAIPackageHints, n as buildDocsSearchDocuments, o as createSimpleSearchAdapter, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, u as performDocsSearch } from "./search-
|
|
4
|
-
import { C as resolveApiReferenceOpenApiDiscovery, S as resolveApiReferenceConfig, T as remarkCodeGroup, _ as buildApiReferenceOpenApiDocument, a as DEFAULT_PROMPT_PROVIDER_TEMPLATES, b as buildApiReferenceScalarCss, c as resolvePromptProviderChoices, d as serializeDocsIconRegistry, f as serializeOpenDocsProvider, g as buildApiReferenceHtmlDocumentAsync, h as buildApiReferenceHtmlDocument, i as DEFAULT_OPEN_DOCS_TARGET, l as sanitizePromptText, m as DEFAULT_API_REFERENCE_OPENAPI_ROUTE, n as DEFAULT_OPEN_DOCS_PROMPT, o as normalizePromptProviderName, p as serializeOpenDocsProviders, r as DEFAULT_OPEN_DOCS_PROVIDER_IDS, s as parsePromptStringArray, t as readDocsSitemapManifest, u as serializeDocsIcon, v as buildApiReferenceOpenApiDocumentAsync, w as resolveApiReferenceRenderer, x as isApiReferenceOpenApiRequest, y as buildApiReferencePageTitle } from "./sitemap-server-
|
|
5
|
-
import { a as
|
|
6
|
-
import { createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, normalizeDocsMcpRoute, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
7
|
-
import { n as isDocsCloudAskAIProvider, t as createDocsCloudAskAIResponse } from "./cloud-ask-ai-
|
|
1
|
+
import { a as emitDocsAnalyticsEvent, c as resolveDocsAnalyticsConfig, i as emitDocsAgentTraceEvent, l as resolveDocsObservabilityConfig, n as createDocsAgentTraceContext, o as emitDocsObservabilityEvent, r as createDocsAgentTraceId, s as getDocsRequestAnalyticsProperties, t as DOCS_AGENT_TRACE_EVENT_TYPES } from "./analytics-Bx44lg6d.mjs";
|
|
2
|
+
import { At as readDocsSitemapManifestFromContentMap, Ct as DEFAULT_SITEMAP_MANIFEST_PATH, Dt as DEFAULT_SITEMAP_XML_ROUTE, Et as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, Ft as resolveDocsSitemapRequest, It as toDocsSitemapMarkdownUrl, Mt as renderDocsSitemapXml, Nt as resolveDocsSitemapConfig, Ot as buildDocsSitemapManifest, Pt as resolveDocsSitemapPageLastmod, Tt as DEFAULT_SITEMAP_MD_ROUTE, jt as renderDocsSitemapMarkdown, kt as createDocsSitemapResponse, wt as DEFAULT_SITEMAP_MD_DOCS_ROUTE } from "./agent-DXkXi-pS.mjs";
|
|
3
|
+
import { a as createMcpSearchAdapter, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, f as resolveSearchRequestConfig, i as createCustomSearchAdapter, l as inferDocsAskAIPackageHints, n as buildDocsSearchDocuments, o as createSimpleSearchAdapter, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, u as performDocsSearch } from "./search-CJIC1Cqo.mjs";
|
|
4
|
+
import { C as resolveApiReferenceOpenApiDiscovery, S as resolveApiReferenceConfig, T as remarkCodeGroup, _ as buildApiReferenceOpenApiDocument, a as DEFAULT_PROMPT_PROVIDER_TEMPLATES, b as buildApiReferenceScalarCss, c as resolvePromptProviderChoices, d as serializeDocsIconRegistry, f as serializeOpenDocsProvider, g as buildApiReferenceHtmlDocumentAsync, h as buildApiReferenceHtmlDocument, i as DEFAULT_OPEN_DOCS_TARGET, l as sanitizePromptText, m as DEFAULT_API_REFERENCE_OPENAPI_ROUTE, n as DEFAULT_OPEN_DOCS_PROMPT, o as normalizePromptProviderName, p as serializeOpenDocsProviders, r as DEFAULT_OPEN_DOCS_PROVIDER_IDS, s as parsePromptStringArray, t as readDocsSitemapManifest, u as serializeDocsIcon, v as buildApiReferenceOpenApiDocumentAsync, w as resolveApiReferenceRenderer, x as isApiReferenceOpenApiRequest, y as buildApiReferencePageTitle } from "./sitemap-server-wsNLyVkb.mjs";
|
|
5
|
+
import { a as buildDocsReviewWorkflowPathFilters, c as resolveDocsReviewConfig, i as buildDocsReviewWorkflow, n as DEFAULT_DOCS_REVIEW_SCORE_THRESHOLD, o as ensureDocsReviewWorkflow, r as DEFAULT_DOCS_REVIEW_WORKFLOW_PATH, s as readDocsReviewConfigFromSource, t as runDocsGoldenTasks } from "./agent-evals-BD17jOqL.mjs";
|
|
6
|
+
import { DEFAULT_DOCS_MCP_CORS_ALLOWED_HEADERS, DEFAULT_DOCS_MCP_CORS_EXPOSED_HEADERS, DEFAULT_DOCS_MCP_CORS_MAX_AGE_SECONDS, DEFAULT_DOCS_MCP_MAX_BODY_BYTES, DOCS_CONFIG_SCHEMA_OPTIONS, createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, getDocsConfigSchema, normalizeDocsMcpRoute, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
7
|
+
import { n as isDocsCloudAskAIProvider, t as createDocsCloudAskAIResponse } from "./cloud-ask-ai-1k0q6OAH.mjs";
|
|
8
8
|
import { createDocsCloudRouteHandler, createDocsCloudServer } from "./docs-cloud-server.mjs";
|
|
9
|
+
import "./code-blocks-C9awWzEQ.mjs";
|
|
9
10
|
|
|
10
|
-
export { DEFAULT_API_REFERENCE_OPENAPI_ROUTE, DEFAULT_DOCS_REVIEW_SCORE_THRESHOLD, DEFAULT_DOCS_REVIEW_WORKFLOW_PATH, DEFAULT_OPEN_DOCS_PROMPT, DEFAULT_OPEN_DOCS_PROVIDER_IDS, DEFAULT_OPEN_DOCS_TARGET, DEFAULT_PROMPT_PROVIDER_TEMPLATES, DEFAULT_SITEMAP_MANIFEST_PATH, DEFAULT_SITEMAP_MD_DOCS_ROUTE, DEFAULT_SITEMAP_MD_ROUTE, DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, DEFAULT_SITEMAP_XML_ROUTE, DOCS_AGENT_TRACE_EVENT_TYPES, buildApiReferenceHtmlDocument, buildApiReferenceHtmlDocumentAsync, buildApiReferenceOpenApiDocument, buildApiReferenceOpenApiDocumentAsync, buildApiReferencePageTitle, buildApiReferenceScalarCss, buildDocsAskAIContext, buildDocsReviewWorkflow, buildDocsReviewWorkflowPathFilters, buildDocsSearchDocuments, buildDocsSitemapManifest, createAlgoliaSearchAdapter, createCustomSearchAdapter, createDocsAgentTraceContext, createDocsAgentTraceId, createDocsCloudAskAIResponse, createDocsCloudRouteHandler, createDocsCloudServer, createDocsMcpHttpHandler, createDocsMcpServer, createDocsSitemapResponse, createFilesystemDocsMcpSource, createMcpSearchAdapter, createSimpleSearchAdapter, createTypesenseSearchAdapter, emitDocsAgentTraceEvent, emitDocsAnalyticsEvent, emitDocsObservabilityEvent, ensureDocsReviewWorkflow, formatDocsAskAIPackageHints, getDocsRequestAnalyticsProperties, inferDocsAskAIPackageHints, isApiReferenceOpenApiRequest, isDocsCloudAskAIProvider, normalizeDocsMcpRoute, normalizePromptProviderName, parsePromptStringArray, performDocsSearch, readDocsReviewConfigFromSource, readDocsSitemapManifest, readDocsSitemapManifestFromContentMap, remarkCodeGroup, renderDocsSitemapMarkdown, renderDocsSitemapXml, resolveApiReferenceConfig, resolveApiReferenceOpenApiDiscovery, resolveApiReferenceRenderer, resolveAskAISearchRequestConfig, resolveDocsAnalyticsConfig, resolveDocsMcpConfig, resolveDocsObservabilityConfig, resolveDocsReviewConfig, resolveDocsSitemapConfig, resolveDocsSitemapPageLastmod, resolveDocsSitemapRequest, resolvePromptProviderChoices, resolveSearchRequestConfig, runDocsMcpStdio, sanitizePromptText, serializeDocsIcon, serializeDocsIconRegistry, serializeOpenDocsProvider, serializeOpenDocsProviders, toDocsSitemapMarkdownUrl };
|
|
11
|
+
export { DEFAULT_API_REFERENCE_OPENAPI_ROUTE, DEFAULT_DOCS_MCP_CORS_ALLOWED_HEADERS, DEFAULT_DOCS_MCP_CORS_EXPOSED_HEADERS, DEFAULT_DOCS_MCP_CORS_MAX_AGE_SECONDS, DEFAULT_DOCS_MCP_MAX_BODY_BYTES, DEFAULT_DOCS_REVIEW_SCORE_THRESHOLD, DEFAULT_DOCS_REVIEW_WORKFLOW_PATH, DEFAULT_OPEN_DOCS_PROMPT, DEFAULT_OPEN_DOCS_PROVIDER_IDS, DEFAULT_OPEN_DOCS_TARGET, DEFAULT_PROMPT_PROVIDER_TEMPLATES, DEFAULT_SITEMAP_MANIFEST_PATH, DEFAULT_SITEMAP_MD_DOCS_ROUTE, DEFAULT_SITEMAP_MD_ROUTE, DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, DEFAULT_SITEMAP_XML_ROUTE, DOCS_AGENT_TRACE_EVENT_TYPES, DOCS_CONFIG_SCHEMA_OPTIONS, buildApiReferenceHtmlDocument, buildApiReferenceHtmlDocumentAsync, buildApiReferenceOpenApiDocument, buildApiReferenceOpenApiDocumentAsync, buildApiReferencePageTitle, buildApiReferenceScalarCss, buildDocsAskAIContext, buildDocsReviewWorkflow, buildDocsReviewWorkflowPathFilters, buildDocsSearchDocuments, buildDocsSitemapManifest, createAlgoliaSearchAdapter, createCustomSearchAdapter, createDocsAgentTraceContext, createDocsAgentTraceId, createDocsCloudAskAIResponse, createDocsCloudRouteHandler, createDocsCloudServer, createDocsMcpHttpHandler, createDocsMcpServer, createDocsSitemapResponse, createFilesystemDocsMcpSource, createMcpSearchAdapter, createSimpleSearchAdapter, createTypesenseSearchAdapter, emitDocsAgentTraceEvent, emitDocsAnalyticsEvent, emitDocsObservabilityEvent, ensureDocsReviewWorkflow, formatDocsAskAIPackageHints, getDocsConfigSchema, getDocsRequestAnalyticsProperties, inferDocsAskAIPackageHints, isApiReferenceOpenApiRequest, isDocsCloudAskAIProvider, normalizeDocsMcpRoute, normalizePromptProviderName, parsePromptStringArray, performDocsSearch, readDocsReviewConfigFromSource, readDocsSitemapManifest, readDocsSitemapManifestFromContentMap, remarkCodeGroup, renderDocsSitemapMarkdown, renderDocsSitemapXml, resolveApiReferenceConfig, resolveApiReferenceOpenApiDiscovery, resolveApiReferenceRenderer, resolveAskAISearchRequestConfig, resolveDocsAnalyticsConfig, resolveDocsMcpConfig, resolveDocsObservabilityConfig, resolveDocsReviewConfig, resolveDocsSitemapConfig, resolveDocsSitemapPageLastmod, resolveDocsSitemapRequest, resolvePromptProviderChoices, resolveSearchRequestConfig, runDocsGoldenTasks, runDocsMcpStdio, sanitizePromptText, serializeDocsIcon, serializeDocsIconRegistry, serializeOpenDocsProvider, serializeOpenDocsProviders, toDocsSitemapMarkdownUrl };
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./search-
|
|
3
|
-
import "./sitemap-server-
|
|
1
|
+
import { Mt as renderDocsSitemapXml, Nt as resolveDocsSitemapConfig, Ot as buildDocsSitemapManifest, jt as renderDocsSitemapMarkdown } from "./agent-DXkXi-pS.mjs";
|
|
2
|
+
import "./search-CJIC1Cqo.mjs";
|
|
3
|
+
import "./sitemap-server-wsNLyVkb.mjs";
|
|
4
|
+
import "./agent-evals-BD17jOqL.mjs";
|
|
4
5
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
6
|
+
import "./code-blocks-C9awWzEQ.mjs";
|
|
5
7
|
import "./server.mjs";
|
|
6
|
-
import {
|
|
7
|
-
import { t as detectFramework } from "./utils-
|
|
8
|
+
import { d as readStringProperty, h as resolveDocsContentDir, i as loadDocsConfigModule, l as readNavTitle, m as resolveDocsConfigPath, p as readTopLevelStringProperty, s as readBooleanProperty, t as extractNestedObjectLiteral } from "./config-CydaZ5PB.mjs";
|
|
9
|
+
import { t as detectFramework } from "./utils-DBCCkkJS.mjs";
|
|
8
10
|
import { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
|
|
9
11
|
import path from "node:path";
|
|
10
|
-
import pc from "picocolors";
|
|
11
12
|
import { execFileSync } from "node:child_process";
|
|
13
|
+
import pc from "picocolors";
|
|
12
14
|
|
|
13
15
|
//#region src/cli/sitemap.ts
|
|
14
16
|
function normalizePathSegment(value) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Nt as resolveDocsSitemapConfig } from "./agent-DXkXi-pS.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
4
4
|
import path, { basename, join, relative } from "node:path";
|