@farming-labs/docs 0.2.50 → 0.2.53
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-2t4kZLGo.mjs +10 -0
- package/dist/{agent-CaOBIVFy.mjs → agent-BMxMpEa0.mjs} +194 -22
- package/dist/agent-contract-b0akaPcg.mjs +573 -0
- package/dist/agent-export--X9Go-wj.mjs +853 -0
- package/dist/{agents-DjhjZaNP.mjs → agents-CW-zTNKP.mjs} +6 -5
- package/dist/cli/index.mjs +43 -28
- package/dist/client/react.d.mts +1 -1
- package/dist/{cloud-ask-ai-DcMe6xOf.d.mts → cloud-ask-ai-CMzYVzVX.d.mts} +1 -1
- package/dist/{cloud-C_Ok9rC5.mjs → cloud-zs0qAnKJ.mjs} +3 -3
- package/dist/{codeblocks-z9iT794h.mjs → codeblocks-DWM4IJPL.mjs} +9 -12
- package/dist/{dev-Tm9Ss4D6.mjs → dev-DFeVU2Ui.mjs} +2 -2
- package/dist/docs-cloud-server.d.mts +2 -2
- package/dist/docs-cloud-server.mjs +1 -1
- package/dist/{doctor-O9o9kjN8.mjs → doctor-CkM5tKdD.mjs} +36 -24
- package/dist/{downgrade-CYEaOctn.mjs → downgrade-Dj_KXV11.mjs} +2 -2
- package/dist/i18n-CAlj1ADU.mjs +40 -0
- package/dist/index.d.mts +139 -3
- package/dist/index.mjs +7 -5
- package/dist/{init-Ch5On0zm.mjs → init-Cmz-oqnp.mjs} +3 -3
- package/dist/{mcp-DuCPNHS-.mjs → mcp-B4Q1PN93.mjs} +9 -5
- package/dist/mcp.d.mts +102 -4
- package/dist/mcp.mjs +1446 -66
- package/dist/{package-version-C8PigBZk.mjs → package-version-DxnTZH4m.mjs} +1 -1
- package/dist/{reading-time-CPAy1SWO.mjs → reading-time-BuK2YL23.mjs} +278 -33
- package/dist/{review-lm3dt7yy.mjs → review-BEsbm0l2.mjs} +38 -3
- package/dist/{robots-DV7u4Ire.mjs → robots-BOwkq9du.mjs} +5 -4
- package/dist/{robots-XVPs9lVz.mjs → robots-C6uQG-fS.mjs} +1 -1
- package/dist/{search-BWuU70B0.mjs → search-CJNLkdjX.mjs} +174 -79
- package/dist/{search-DFEhf9-s.d.mts → search-CTu6Bvq-.d.mts} +3 -1
- package/dist/{search-B6nEkx86.mjs → search-CtAXkk_J.mjs} +5 -4
- package/dist/server.d.mts +5 -5
- package/dist/server.mjs +8 -7
- package/dist/{sitemap-BEiKy4Iy.mjs → sitemap-OPb8EdNe.mjs} +6 -5
- package/dist/{sitemap-server-xEHtDUDB.mjs → sitemap-server-DnilMEiZ.mjs} +1 -1
- package/dist/{templates-uaauJcTO.mjs → templates-Bty9M6lA.mjs} +11 -5
- package/dist/{types-XqGLsmOD.d.mts → types-CdKu8KmO.d.mts} +118 -2
- package/dist/{upgrade-DzQtpgJM.mjs → upgrade-BNdBB9tQ.mjs} +2 -2
- package/package.json +1 -1
- package/dist/agent-DXDOMJBw.mjs +0 -9
- /package/dist/{cloud-ask-ai-Cl-xaV8j.mjs → cloud-ask-ai-BFlx8VMO.mjs} +0 -0
- /package/dist/{config-tiQCZ46q.mjs → config-DhIyFsy9.mjs} +0 -0
- /package/dist/{errors-CW1LnxaQ.mjs → errors-BxfYhp1L.mjs} +0 -0
- /package/dist/{review-B7goPYUb.mjs → review-BHdy75TE.mjs} +0 -0
- /package/dist/{utils-D-xTRNuh.mjs → utils-CMZTjRQT.mjs} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { l as upsertPageAgentContractMarkdown, n as PAGE_AGENT_CONTRACT_START_MARKER, o as renderPageAgentContractMarkdown, t as PAGE_AGENT_CONTRACT_END_MARKER } from "./agent-contract-b0akaPcg.mjs";
|
|
2
|
+
import { U as isDocsAgentDiscoveryRequest, W as isDocsAgentsRequest, X as isDocsSkillRequest, ct as resolveDocsAgentFeedbackRequest, ft as resolveDocsLlmsTxtRequest, gt as resolveDocsMarkdownRequest, st as resolveDocsAgentFeedbackConfig, ut as resolveDocsAgentsFormat, vt as resolveDocsSkillFormat } from "./agent-BMxMpEa0.mjs";
|
|
2
3
|
|
|
3
4
|
//#region src/telemetry.ts
|
|
4
5
|
const DOCS_PACKAGE_NAME = "@farming-labs/docs";
|
|
@@ -413,6 +414,146 @@ function serializeGeneratedAgentDocument(content, provenance) {
|
|
|
413
414
|
].join("\n")}\n`;
|
|
414
415
|
}
|
|
415
416
|
|
|
417
|
+
//#endregion
|
|
418
|
+
//#region src/markdown-sections.ts
|
|
419
|
+
const HTML_ENTITIES = {
|
|
420
|
+
amp: "&",
|
|
421
|
+
apos: "'",
|
|
422
|
+
gt: ">",
|
|
423
|
+
lt: "<",
|
|
424
|
+
nbsp: " ",
|
|
425
|
+
quot: "\""
|
|
426
|
+
};
|
|
427
|
+
/**
|
|
428
|
+
* Reduce inline Markdown in a heading to the visible label used by search and anchors.
|
|
429
|
+
* This intentionally covers the common inline constructs without adding a Markdown parser
|
|
430
|
+
* dependency to the runtime package.
|
|
431
|
+
*/
|
|
432
|
+
function cleanDocsMarkdownHeadingLabel(value) {
|
|
433
|
+
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) => {
|
|
434
|
+
if (entity.startsWith("#x") || entity.startsWith("#X")) {
|
|
435
|
+
const codePoint = Number.parseInt(entity.slice(2), 16);
|
|
436
|
+
return Number.isSafeInteger(codePoint) && codePoint >= 0 && codePoint <= 1114111 ? String.fromCodePoint(codePoint) : _match;
|
|
437
|
+
}
|
|
438
|
+
if (entity.startsWith("#")) {
|
|
439
|
+
const codePoint = Number.parseInt(entity.slice(1), 10);
|
|
440
|
+
return Number.isSafeInteger(codePoint) && codePoint >= 0 && codePoint <= 1114111 ? String.fromCodePoint(codePoint) : _match;
|
|
441
|
+
}
|
|
442
|
+
return HTML_ENTITIES[entity.toLowerCase()] ?? _match;
|
|
443
|
+
}).replace(/\s+/gu, " ").trim();
|
|
444
|
+
}
|
|
445
|
+
/** Keep anchors aligned with the framework's existing ASCII heading-slug behavior. */
|
|
446
|
+
function slugifyDocsMarkdownHeading(value) {
|
|
447
|
+
return cleanDocsMarkdownHeadingLabel(value).toLowerCase().replace(/[`'"‘’“”]/gu, "").replace(/&/gu, " and ").replace(/[^a-z0-9\s-]/gu, "").replace(/\s+/gu, "-").replace(/-+/gu, "-").replace(/^-|-$/gu, "");
|
|
448
|
+
}
|
|
449
|
+
function readOpeningFence(line) {
|
|
450
|
+
const match = line.match(/^ {0,3}(`{3,}|~{3,})/u);
|
|
451
|
+
if (!match) return void 0;
|
|
452
|
+
return {
|
|
453
|
+
marker: match[1][0],
|
|
454
|
+
length: match[1].length
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
function isClosingFence(line, fence) {
|
|
458
|
+
const marker = fence.marker === "`" ? "`" : "~";
|
|
459
|
+
const match = line.match(new RegExp(`^ {0,3}(${marker}{${fence.length},})[\\t ]*$`, "u"));
|
|
460
|
+
return Boolean(match);
|
|
461
|
+
}
|
|
462
|
+
function readAtxHeading(line) {
|
|
463
|
+
const match = line.match(/^ {0,3}(#{1,6})(?:[\t ]+|$)(.*)$/u);
|
|
464
|
+
if (!match) return void 0;
|
|
465
|
+
return {
|
|
466
|
+
title: cleanDocsMarkdownHeadingLabel(match[2].replace(/[\t ]+#+[\t ]*$/u, "").trim()),
|
|
467
|
+
level: match[1].length
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
function readSetextLevel(line) {
|
|
471
|
+
const match = line.match(/^ {0,3}(=+|-+)[\t ]*$/u);
|
|
472
|
+
if (!match) return void 0;
|
|
473
|
+
return match[1][0] === "=" ? 1 : 2;
|
|
474
|
+
}
|
|
475
|
+
function normalizeDocsSectionSelector(value) {
|
|
476
|
+
let selector = value.trim();
|
|
477
|
+
const hashIndex = selector.lastIndexOf("#");
|
|
478
|
+
if (hashIndex >= 0) selector = selector.slice(hashIndex + 1);
|
|
479
|
+
try {
|
|
480
|
+
selector = decodeURIComponent(selector);
|
|
481
|
+
} catch {}
|
|
482
|
+
return cleanDocsMarkdownHeadingLabel(selector.replace(/^#+/u, "")).toLowerCase();
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Parse heading sections once for search, Ask AI hydration, and MCP tools.
|
|
486
|
+
* Supports CommonMark ATX indentation, Setext headings, fenced-code exclusion,
|
|
487
|
+
* visible inline labels, and stable duplicate anchors.
|
|
488
|
+
*/
|
|
489
|
+
function parseDocsMarkdownSections(markdown) {
|
|
490
|
+
const lines = markdown.split("\n");
|
|
491
|
+
const headings = [];
|
|
492
|
+
const headingCounts = /* @__PURE__ */ new Map();
|
|
493
|
+
let openFence;
|
|
494
|
+
let setextCandidate;
|
|
495
|
+
const pushHeading = (title, level, start) => {
|
|
496
|
+
const baseAnchor = slugifyDocsMarkdownHeading(title) || `section-${headings.length}`;
|
|
497
|
+
const seen = headingCounts.get(baseAnchor) ?? 0;
|
|
498
|
+
headingCounts.set(baseAnchor, seen + 1);
|
|
499
|
+
headings.push({
|
|
500
|
+
title,
|
|
501
|
+
anchor: seen === 0 ? baseAnchor : `${baseAnchor}-${seen}`,
|
|
502
|
+
level,
|
|
503
|
+
start
|
|
504
|
+
});
|
|
505
|
+
};
|
|
506
|
+
for (let index = 0; index < lines.length; index += 1) {
|
|
507
|
+
const line = lines[index];
|
|
508
|
+
if (openFence) {
|
|
509
|
+
if (isClosingFence(line, openFence)) openFence = void 0;
|
|
510
|
+
setextCandidate = void 0;
|
|
511
|
+
continue;
|
|
512
|
+
}
|
|
513
|
+
const openingFence = readOpeningFence(line);
|
|
514
|
+
if (openingFence) {
|
|
515
|
+
openFence = openingFence;
|
|
516
|
+
setextCandidate = void 0;
|
|
517
|
+
continue;
|
|
518
|
+
}
|
|
519
|
+
const setextLevel = readSetextLevel(line);
|
|
520
|
+
if (setextLevel && setextCandidate?.index === index - 1) {
|
|
521
|
+
const title = cleanDocsMarkdownHeadingLabel(setextCandidate.value.trim());
|
|
522
|
+
if (title) pushHeading(title, setextLevel, setextCandidate.index);
|
|
523
|
+
setextCandidate = void 0;
|
|
524
|
+
continue;
|
|
525
|
+
}
|
|
526
|
+
const atxHeading = readAtxHeading(line);
|
|
527
|
+
if (atxHeading) {
|
|
528
|
+
pushHeading(atxHeading.title, atxHeading.level, index);
|
|
529
|
+
setextCandidate = void 0;
|
|
530
|
+
continue;
|
|
531
|
+
}
|
|
532
|
+
if (!line.trim() || /^ {4}|^\t/u.test(line)) {
|
|
533
|
+
setextCandidate = void 0;
|
|
534
|
+
continue;
|
|
535
|
+
}
|
|
536
|
+
setextCandidate = {
|
|
537
|
+
index,
|
|
538
|
+
value: line
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
return headings.map((heading, index) => {
|
|
542
|
+
const end = headings.slice(index + 1).find((candidate) => candidate.level <= heading.level)?.start ?? lines.length;
|
|
543
|
+
return {
|
|
544
|
+
title: heading.title,
|
|
545
|
+
anchor: heading.anchor,
|
|
546
|
+
level: heading.level,
|
|
547
|
+
content: lines.slice(heading.start, end).join("\n").trim()
|
|
548
|
+
};
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
function findDocsMarkdownSection(markdown, requestedSection) {
|
|
552
|
+
const selector = normalizeDocsSectionSelector(requestedSection);
|
|
553
|
+
if (!selector) return void 0;
|
|
554
|
+
return parseDocsMarkdownSections(markdown).find((section) => normalizeDocsSectionSelector(section.title) === selector || section.anchor === selector);
|
|
555
|
+
}
|
|
556
|
+
|
|
416
557
|
//#endregion
|
|
417
558
|
//#region src/search.ts
|
|
418
559
|
const DEFAULT_SEARCH_LIMIT = 10;
|
|
@@ -522,7 +663,10 @@ function resolveAskAIContextUrl(value, baseUrl) {
|
|
|
522
663
|
}
|
|
523
664
|
}
|
|
524
665
|
function getAskAIPageContent(page) {
|
|
525
|
-
return page.agentRawContent ?? page.agentFallbackRawContent ?? page.rawContent ?? page.content;
|
|
666
|
+
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+/, "");
|
|
667
|
+
}
|
|
668
|
+
function getPageAgentContractSearchText(page) {
|
|
669
|
+
return stripMarkdownText(renderPageAgentContractMarkdown(page.agent).replace(PAGE_AGENT_CONTRACT_START_MARKER, "").replace(PAGE_AGENT_CONTRACT_END_MARKER, ""));
|
|
526
670
|
}
|
|
527
671
|
function removeMdxModuleLinesOutsideFences(content) {
|
|
528
672
|
let inFence = false;
|
|
@@ -596,40 +740,6 @@ function clampText(value, maxChars) {
|
|
|
596
740
|
if (value.length <= maxChars) return value;
|
|
597
741
|
return `${value.slice(0, maxChars).trimEnd()}...`;
|
|
598
742
|
}
|
|
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
743
|
function findPageForSearchResult(pages, result) {
|
|
634
744
|
const resultPath = normalizeUrlPathname(result.url);
|
|
635
745
|
return pages.find((page) => normalizeUrlPathname(page.url) === resultPath);
|
|
@@ -642,7 +752,8 @@ function formatAskAIContextResult(options) {
|
|
|
642
752
|
const { result, page, maxChars, baseUrl } = options;
|
|
643
753
|
const title = inferResultTitle(result, page);
|
|
644
754
|
const section = result.section;
|
|
645
|
-
const
|
|
755
|
+
const sectionSelector = getSearchResultAnchor(result.url) ?? section;
|
|
756
|
+
const contextContent = clampText(cleanAskAIContextMarkdown(page ? sectionSelector ? findDocsMarkdownSection(getAskAIPageContent(page), sectionSelector)?.content ?? "" : getAskAIPageContent(page) : [result.content, result.description].filter(Boolean).join("\n\n")), maxChars);
|
|
646
757
|
return {
|
|
647
758
|
...result,
|
|
648
759
|
url: resolveAskAIContextUrl(result.url, baseUrl),
|
|
@@ -659,6 +770,20 @@ function getSearchResultKey(result) {
|
|
|
659
770
|
}
|
|
660
771
|
return `${normalizeUrlPathname(result.url)}#${normalizeWhitespace(hash || result.section || "").toLowerCase()}`;
|
|
661
772
|
}
|
|
773
|
+
function getSearchResultAnchor(value) {
|
|
774
|
+
let hash = "";
|
|
775
|
+
try {
|
|
776
|
+
hash = new URL(value, "https://docs.local").hash.replace(/^#/, "");
|
|
777
|
+
} catch {
|
|
778
|
+
hash = value.split("#")[1]?.split(/[?&]/)[0] ?? "";
|
|
779
|
+
}
|
|
780
|
+
if (!hash) return void 0;
|
|
781
|
+
try {
|
|
782
|
+
return decodeURIComponent(hash);
|
|
783
|
+
} catch {
|
|
784
|
+
return hash;
|
|
785
|
+
}
|
|
786
|
+
}
|
|
662
787
|
function mergeSearchResults(...groups) {
|
|
663
788
|
const seen = /* @__PURE__ */ new Set();
|
|
664
789
|
const results = [];
|
|
@@ -675,7 +800,7 @@ function pageToSearchDocument(page) {
|
|
|
675
800
|
id: makeDocumentId(page.url, "page"),
|
|
676
801
|
url: page.url,
|
|
677
802
|
title: page.title,
|
|
678
|
-
content: normalizeWhitespace(page.content),
|
|
803
|
+
content: normalizeWhitespace([page.content, getPageAgentContractSearchText(page)].join(" ")),
|
|
679
804
|
description: page.description,
|
|
680
805
|
type: "page",
|
|
681
806
|
locale: page.locale,
|
|
@@ -746,54 +871,24 @@ function buildAskAIContextBlock(result) {
|
|
|
746
871
|
function makeDocumentId(url, suffix) {
|
|
747
872
|
return `${url}#${suffix}`;
|
|
748
873
|
}
|
|
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
874
|
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,
|
|
875
|
+
return parseDocsMarkdownSections(page.rawContent ?? page.content).flatMap((section, index) => {
|
|
876
|
+
const content = normalizeWhitespace(stripMarkdownText(section.content));
|
|
877
|
+
if (!content) return [];
|
|
878
|
+
return [{
|
|
879
|
+
id: makeDocumentId(page.url, `section-${index}`),
|
|
880
|
+
url: `${page.url}#${section.anchor}`,
|
|
773
881
|
title: page.title,
|
|
774
|
-
section:
|
|
882
|
+
section: section.title,
|
|
775
883
|
content,
|
|
776
884
|
description: page.description,
|
|
777
|
-
type:
|
|
885
|
+
type: "heading",
|
|
778
886
|
locale: page.locale,
|
|
779
887
|
framework: page.framework,
|
|
780
888
|
version: page.version,
|
|
781
889
|
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;
|
|
890
|
+
}];
|
|
891
|
+
});
|
|
797
892
|
}
|
|
798
893
|
function buildDocsSearchDocuments(pages, chunking = {}) {
|
|
799
894
|
const strategy = chunking.strategy ?? "section";
|
|
@@ -1490,4 +1585,4 @@ function createCustomSearchAdapter(adapter) {
|
|
|
1490
1585
|
}
|
|
1491
1586
|
|
|
1492
1587
|
//#endregion
|
|
1493
|
-
export {
|
|
1588
|
+
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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as DocsAskAIMcpConfig, Cn as TypesenseDocsSearchConfig, Ct as DocsSearchDocument, Et as DocsSearchResult, Kt as McpDocsSearchConfig, Ot as DocsSearchSourcePage, Qt as OpenDocsTarget, St as DocsSearchConfig, Yt as OpenDocsProvider, b as DocsAnalyticsEventInput, bt as DocsSearchAdapterFactory, ct as DocsObservabilityEventInput, f as CustomDocsSearchConfig, h as DocsAgentTraceEventInput, kt as DocsSitemapConfig, ot as DocsObservabilityConfig, pn as ResolvedDocsRelatedLink, r as AlgoliaDocsSearchConfig, st as DocsObservabilityEvent, v as DocsAnalyticsConfig, vt as DocsSearchAdapter, xt as DocsSearchChunkingConfig, y as DocsAnalyticsEvent } from "./types-CdKu8KmO.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[];
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import "./agent-
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
1
|
+
import "./agent-contract-b0akaPcg.mjs";
|
|
2
|
+
import "./agent-BMxMpEa0.mjs";
|
|
3
|
+
import { n as buildDocsSearchDocuments, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter } from "./search-CJNLkdjX.mjs";
|
|
4
|
+
import "./sitemap-server-DnilMEiZ.mjs";
|
|
4
5
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
5
6
|
import "./server.mjs";
|
|
6
|
-
import { a as loadProjectEnv, f as readTopLevelStringProperty, m as resolveDocsContentDir, p as resolveDocsConfigPath } from "./config-
|
|
7
|
+
import { a as loadProjectEnv, f as readTopLevelStringProperty, m as resolveDocsContentDir, p as resolveDocsConfigPath } from "./config-DhIyFsy9.mjs";
|
|
7
8
|
import { readFileSync } from "node:fs";
|
|
8
9
|
import pc from "picocolors";
|
|
9
10
|
|
package/dist/server.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as isDocsCloudAskAIProvider, n as DocsCloudAskAIResponseOptions, r as createDocsCloudAskAIResponse, t as DocsCloudAskAIConfig } from "./cloud-ask-ai-
|
|
1
|
+
import { A as DocsAskAIMcpConfig, Ct as DocsSearchDocument, D as DocsAskAIFeedbackData, E as DocsAskAIFeedbackConfig, Et as DocsSearchResult, Kt as McpDocsSearchConfig, O as DocsAskAIFeedbackMessage, Ot as DocsSearchSourcePage, St as DocsSearchConfig, Tt as DocsSearchQuery, W as DocsConfig, _ as DocsAgentTraceStatus, a as ApiReferenceRenderer, b as DocsAnalyticsEventInput, bt as DocsSearchAdapterFactory, ct as DocsObservabilityEventInput, dt as DocsReviewCiMode, ft as DocsReviewConfig, g as DocsAgentTraceEventType, h as DocsAgentTraceEventInput, k as DocsAskAIFeedbackValue, kt as DocsSitemapConfig, ot as DocsObservabilityConfig, pt as DocsReviewRulesConfig, st as DocsObservabilityEvent, v as DocsAnalyticsConfig, vt as DocsSearchAdapter, y as DocsAnalyticsEvent, yt as DocsSearchAdapterContext } from "./types-CdKu8KmO.mjs";
|
|
2
|
+
import { i as isDocsCloudAskAIProvider, n as DocsCloudAskAIResponseOptions, r as createDocsCloudAskAIResponse, t as DocsCloudAskAIConfig } from "./cloud-ask-ai-CMzYVzVX.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-CTu6Bvq-.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, DocsMcpAgentContractSummary, DocsMcpCodeExample, DocsMcpConfigSchema, DocsMcpConfigSchemaOption, DocsMcpContextResult, DocsMcpContextSource, DocsMcpDocsList, DocsMcpDocsPageSummary, DocsMcpDocsSection, DocsMcpHttpHandlers, DocsMcpNavigationNode, DocsMcpNavigationTree, DocsMcpPage, DocsMcpRequestContext, DocsMcpResolvedConfig, DocsMcpResolvedCorsConfig, DocsMcpResolvedSecurityConfig, DocsMcpSource, DocsMcpTaskSummary, createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, normalizeDocsMcpRoute, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
6
6
|
|
|
7
7
|
//#region src/code-group-mdx.d.ts
|
|
8
8
|
interface MarkdownNode {
|
|
@@ -133,4 +133,4 @@ declare function buildDocsReviewWorkflowPathFilters(options: {
|
|
|
133
133
|
//#region src/sitemap-server.d.ts
|
|
134
134
|
declare function readDocsSitemapManifest(rootDir: string, sitemap?: boolean | DocsSitemapConfig): DocsSitemapManifest | null;
|
|
135
135
|
//#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 };
|
|
136
|
+
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, 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 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, 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 };
|
package/dist/server.mjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
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-BZEwTK-8.mjs";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { a as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
2
|
+
import "./agent-contract-b0akaPcg.mjs";
|
|
3
|
+
import { At as renderDocsSitemapMarkdown, Ct as DEFAULT_SITEMAP_MD_DOCS_ROUTE, Dt as buildDocsSitemapManifest, Et as DEFAULT_SITEMAP_XML_ROUTE, Ft as toDocsSitemapMarkdownUrl, Mt as resolveDocsSitemapConfig, Nt as resolveDocsSitemapPageLastmod, Ot as createDocsSitemapResponse, Pt as resolveDocsSitemapRequest, St as DEFAULT_SITEMAP_MANIFEST_PATH, Tt as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, jt as renderDocsSitemapXml, kt as readDocsSitemapManifestFromContentMap, wt as DEFAULT_SITEMAP_MD_ROUTE } from "./agent-BMxMpEa0.mjs";
|
|
4
|
+
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-CJNLkdjX.mjs";
|
|
5
|
+
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-DnilMEiZ.mjs";
|
|
6
|
+
import { a as ensureDocsReviewWorkflow, i as buildDocsReviewWorkflowPathFilters, n as DEFAULT_DOCS_REVIEW_WORKFLOW_PATH, o as readDocsReviewConfigFromSource, r as buildDocsReviewWorkflow, s as resolveDocsReviewConfig, t as DEFAULT_DOCS_REVIEW_SCORE_THRESHOLD } from "./review-BHdy75TE.mjs";
|
|
7
|
+
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, createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, normalizeDocsMcpRoute, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
8
|
+
import { n as isDocsCloudAskAIProvider, t as createDocsCloudAskAIResponse } from "./cloud-ask-ai-BFlx8VMO.mjs";
|
|
8
9
|
import { createDocsCloudRouteHandler, createDocsCloudServer } from "./docs-cloud-server.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, 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 };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "./
|
|
3
|
-
import "./
|
|
1
|
+
import "./agent-contract-b0akaPcg.mjs";
|
|
2
|
+
import { At as renderDocsSitemapMarkdown, Dt as buildDocsSitemapManifest, Mt as resolveDocsSitemapConfig, jt as renderDocsSitemapXml } from "./agent-BMxMpEa0.mjs";
|
|
3
|
+
import "./search-CJNLkdjX.mjs";
|
|
4
|
+
import "./sitemap-server-DnilMEiZ.mjs";
|
|
4
5
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
5
6
|
import "./server.mjs";
|
|
6
|
-
import { c as readNavTitle, f as readTopLevelStringProperty, i as loadDocsConfigModule, m as resolveDocsContentDir, o as readBooleanProperty, p as resolveDocsConfigPath, t as extractNestedObjectLiteral, u as readStringProperty } from "./config-
|
|
7
|
-
import { t as detectFramework } from "./utils-
|
|
7
|
+
import { c as readNavTitle, f as readTopLevelStringProperty, i as loadDocsConfigModule, m as resolveDocsContentDir, o as readBooleanProperty, p as resolveDocsConfigPath, t as extractNestedObjectLiteral, u as readStringProperty } from "./config-DhIyFsy9.mjs";
|
|
8
|
+
import { t as detectFramework } from "./utils-CMZTjRQT.mjs";
|
|
8
9
|
import { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
|
|
9
10
|
import path from "node:path";
|
|
10
11
|
import pc from "picocolors";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Mt as resolveDocsSitemapConfig } from "./agent-BMxMpEa0.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";
|
|
@@ -894,12 +894,13 @@ async function handlePublicDocsRequest(request: Request) {
|
|
|
894
894
|
const method = request.method.toUpperCase();
|
|
895
895
|
|
|
896
896
|
if (isDocsMcpRequest(url)) {
|
|
897
|
+
if (method === "OPTIONS") return docsServer.MCP.OPTIONS({ request });
|
|
897
898
|
if (method === "POST") return docsServer.MCP.POST({ request });
|
|
898
899
|
if (method === "DELETE") return docsServer.MCP.DELETE({ request });
|
|
899
900
|
if (method === "GET" || method === "HEAD") return docsServer.MCP.GET({ request });
|
|
900
901
|
return new Response("Method Not Allowed", {
|
|
901
902
|
status: 405,
|
|
902
|
-
headers: { Allow: "GET, HEAD, POST, DELETE" },
|
|
903
|
+
headers: { Allow: "GET, HEAD, POST, DELETE, OPTIONS" },
|
|
903
904
|
});
|
|
904
905
|
}
|
|
905
906
|
|
|
@@ -916,6 +917,7 @@ export const Route = createFileRoute("/$")({
|
|
|
916
917
|
GET: async ({ request }) => handlePublicDocsRequest(request),
|
|
917
918
|
POST: async ({ request }) => handlePublicDocsRequest(request),
|
|
918
919
|
DELETE: async ({ request }) => handlePublicDocsRequest(request),
|
|
920
|
+
OPTIONS: async ({ request }) => handlePublicDocsRequest(request),
|
|
919
921
|
},
|
|
920
922
|
},
|
|
921
923
|
});
|
|
@@ -1313,12 +1315,13 @@ export const handle: Handle = async ({ event, resolve }) => {
|
|
|
1313
1315
|
const method = event.request.method.toUpperCase();
|
|
1314
1316
|
|
|
1315
1317
|
if (isDocsMcpRequest(event.url)) {
|
|
1318
|
+
if (method === "OPTIONS") return MCP.OPTIONS({ request: event.request });
|
|
1316
1319
|
if (method === "POST") return MCP.POST({ request: event.request });
|
|
1317
1320
|
if (method === "DELETE") return MCP.DELETE({ request: event.request });
|
|
1318
1321
|
if (method === "GET" || method === "HEAD") return MCP.GET({ request: event.request });
|
|
1319
1322
|
return new Response("Method Not Allowed", {
|
|
1320
1323
|
status: 405,
|
|
1321
|
-
headers: { Allow: "GET, HEAD, POST, DELETE" },
|
|
1324
|
+
headers: { Allow: "GET, HEAD, POST, DELETE, OPTIONS" },
|
|
1322
1325
|
});
|
|
1323
1326
|
}
|
|
1324
1327
|
|
|
@@ -1366,12 +1369,13 @@ const docsPublicHandle: Handle = async ({ event, resolve }) => {
|
|
|
1366
1369
|
const method = event.request.method.toUpperCase();
|
|
1367
1370
|
|
|
1368
1371
|
if (isDocsMcpRequest(event.url)) {
|
|
1372
|
+
if (method === "OPTIONS") return docsMCP.OPTIONS({ request: event.request });
|
|
1369
1373
|
if (method === "POST") return docsMCP.POST({ request: event.request });
|
|
1370
1374
|
if (method === "DELETE") return docsMCP.DELETE({ request: event.request });
|
|
1371
1375
|
if (method === "GET" || method === "HEAD") return docsMCP.GET({ request: event.request });
|
|
1372
1376
|
return new Response("Method Not Allowed", {
|
|
1373
1377
|
status: 405,
|
|
1374
|
-
headers: { Allow: "GET, HEAD, POST, DELETE" },
|
|
1378
|
+
headers: { Allow: "GET, HEAD, POST, DELETE, OPTIONS" },
|
|
1375
1379
|
});
|
|
1376
1380
|
}
|
|
1377
1381
|
|
|
@@ -1787,12 +1791,13 @@ export const onRequest: MiddlewareHandler = async (context, next) => {
|
|
|
1787
1791
|
const method = context.request.method.toUpperCase();
|
|
1788
1792
|
|
|
1789
1793
|
if (isDocsMcpRequest(context.url)) {
|
|
1794
|
+
if (method === "OPTIONS") return MCP.OPTIONS({ request: context.request });
|
|
1790
1795
|
if (method === "POST") return MCP.POST({ request: context.request });
|
|
1791
1796
|
if (method === "DELETE") return MCP.DELETE({ request: context.request });
|
|
1792
1797
|
if (method === "GET" || method === "HEAD") return MCP.GET({ request: context.request });
|
|
1793
1798
|
return new Response("Method Not Allowed", {
|
|
1794
1799
|
status: 405,
|
|
1795
|
-
headers: { Allow: "GET, HEAD, POST, DELETE" },
|
|
1800
|
+
headers: { Allow: "GET, HEAD, POST, DELETE, OPTIONS" },
|
|
1796
1801
|
});
|
|
1797
1802
|
}
|
|
1798
1803
|
|
|
@@ -1840,12 +1845,13 @@ const docsPublicMiddleware: MiddlewareHandler = async (context, next) => {
|
|
|
1840
1845
|
const method = context.request.method.toUpperCase();
|
|
1841
1846
|
|
|
1842
1847
|
if (isDocsMcpRequest(context.url)) {
|
|
1848
|
+
if (method === "OPTIONS") return docsMCP.OPTIONS({ request: context.request });
|
|
1843
1849
|
if (method === "POST") return docsMCP.POST({ request: context.request });
|
|
1844
1850
|
if (method === "DELETE") return docsMCP.DELETE({ request: context.request });
|
|
1845
1851
|
if (method === "GET" || method === "HEAD") return docsMCP.GET({ request: context.request });
|
|
1846
1852
|
return new Response("Method Not Allowed", {
|
|
1847
1853
|
status: 405,
|
|
1848
|
-
headers: { Allow: "GET, HEAD, POST, DELETE" },
|
|
1854
|
+
headers: { Allow: "GET, HEAD, POST, DELETE, OPTIONS" },
|
|
1849
1855
|
});
|
|
1850
1856
|
}
|
|
1851
1857
|
|