@farming-labs/docs 0.1.68 → 0.1.70
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-3gq3PEVa.mjs → agent-BMOtZLMC.mjs} +12 -3
- package/dist/{agent-ChUBdqLo.mjs → agent-Pbf5iqr6.mjs} +1 -1
- package/dist/cli/index.mjs +3 -3
- package/dist/{doctor-DrZM2dke.mjs → doctor-CndGrKwy.mjs} +237 -4
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/mcp.d.mts +1 -1
- package/dist/{search-6P9iaMYq.d.mts → search-Gvi81BSo.d.mts} +1 -1
- package/dist/server.d.mts +2 -2
- package/dist/{types-DfiAeeHu.d.mts → types-BXgTvFFE.d.mts} +4 -2
- package/package.json +1 -1
|
@@ -314,7 +314,7 @@ function resolveReadingTimeFromSource(source, wordsPerMinute) {
|
|
|
314
314
|
function resolvePageSidebarFolderIndexBehavior(sidebar) {
|
|
315
315
|
if (!sidebar || typeof sidebar !== "object") return void 0;
|
|
316
316
|
const value = sidebar.folderIndexBehavior;
|
|
317
|
-
return value === "link" || value === "toggle" ? value : void 0;
|
|
317
|
+
return value === "link" || value === "toggle" || value === "hidden" ? value : void 0;
|
|
318
318
|
}
|
|
319
319
|
function normalizeSidebarFolderBehaviorPath(path) {
|
|
320
320
|
if (!path) return void 0;
|
|
@@ -332,6 +332,7 @@ function normalizeSidebarFolderBehaviorPath(path) {
|
|
|
332
332
|
function resolveSidebarFolderIndexBehavior(sidebar, defaultBehavior = "link") {
|
|
333
333
|
if (sidebar === void 0 || sidebar === true || sidebar === false) return defaultBehavior;
|
|
334
334
|
if (sidebar.folderIndexBehavior === "toggle") return "toggle";
|
|
335
|
+
if (sidebar.folderIndexBehavior === "hidden") return "hidden";
|
|
335
336
|
if (sidebar.folderIndexBehavior === "link") return "link";
|
|
336
337
|
return defaultBehavior;
|
|
337
338
|
}
|
|
@@ -340,7 +341,7 @@ function resolveSidebarFolderIndexBehaviorForPath(sidebar, folderPath, defaultBe
|
|
|
340
341
|
if (!sidebar || typeof sidebar !== "object") return fallback;
|
|
341
342
|
const normalizedPath = normalizeSidebarFolderBehaviorPath(folderPath);
|
|
342
343
|
if (!normalizedPath) return fallback;
|
|
343
|
-
for (const [rawPath, override] of Object.entries(sidebar.folderIndexBehaviorOverrides ?? {})) if (normalizeSidebarFolderBehaviorPath(rawPath) === normalizedPath) return override === "link" || override === "toggle" ? override : fallback;
|
|
344
|
+
for (const [rawPath, override] of Object.entries(sidebar.folderIndexBehaviorOverrides ?? {})) if (normalizeSidebarFolderBehaviorPath(rawPath) === normalizedPath) return override === "link" || override === "toggle" || override === "hidden" ? override : fallback;
|
|
344
345
|
return fallback;
|
|
345
346
|
}
|
|
346
347
|
function applySidebarFolderIndexBehavior(tree, behaviorOrOptions) {
|
|
@@ -352,12 +353,20 @@ function applySidebarFolderIndexBehavior(tree, behaviorOrOptions) {
|
|
|
352
353
|
const children = candidate.children.map(mapNode);
|
|
353
354
|
const index = candidate.index ? mapNode(candidate.index) : void 0;
|
|
354
355
|
const folderPath = (typeof candidate.url === "string" ? candidate.url : void 0) || (candidate.index && typeof candidate.index === "object" && "url" in candidate.index && typeof candidate.index.url === "string" ? candidate.index.url ?? void 0 : void 0);
|
|
355
|
-
|
|
356
|
+
const behavior = (candidate.folderIndexBehavior === "link" || candidate.folderIndexBehavior === "toggle" || candidate.folderIndexBehavior === "hidden" ? candidate.folderIndexBehavior : void 0) ?? resolveBehavior(folderPath);
|
|
357
|
+
if (behavior === "link") return {
|
|
356
358
|
...candidate,
|
|
357
359
|
folderIndexBehavior: void 0,
|
|
358
360
|
index,
|
|
359
361
|
children
|
|
360
362
|
};
|
|
363
|
+
if (behavior === "hidden") return {
|
|
364
|
+
...candidate,
|
|
365
|
+
folderIndexBehavior: void 0,
|
|
366
|
+
index: void 0,
|
|
367
|
+
url: void 0,
|
|
368
|
+
children
|
|
369
|
+
};
|
|
361
370
|
return {
|
|
362
371
|
...candidate,
|
|
363
372
|
folderIndexBehavior: void 0,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as renderDocsMarkdownDocument, g as findDocsMarkdownPage } from "./agent-
|
|
1
|
+
import { C as renderDocsMarkdownDocument, g as findDocsMarkdownPage } from "./agent-BMOtZLMC.mjs";
|
|
2
2
|
import { d as hashGeneratedAgentContent, m as serializeGeneratedAgentDocument, p as parseGeneratedAgentDocument, u as GENERATED_AGENT_PROVENANCE_VERSION } from "./search-BhXicuww.mjs";
|
|
3
3
|
import "./index.mjs";
|
|
4
4
|
import "./prompt-utils-8nmFLQVH.mjs";
|
package/dist/cli/index.mjs
CHANGED
|
@@ -86,7 +86,7 @@ async function main() {
|
|
|
86
86
|
const { runMcp } = await import("../mcp-vNQt0NUC.mjs");
|
|
87
87
|
await runMcp(mcpOptions);
|
|
88
88
|
} else if (parsedCommand.command === "agent" && subcommand === "compact") {
|
|
89
|
-
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent-
|
|
89
|
+
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent-Pbf5iqr6.mjs");
|
|
90
90
|
const agentCompactOptions = parseAgentCompactArgs(args.slice(2));
|
|
91
91
|
if (agentCompactOptions.help) {
|
|
92
92
|
printAgentCompactHelp();
|
|
@@ -96,11 +96,11 @@ async function main() {
|
|
|
96
96
|
} else if (parsedCommand.command === "agent") {
|
|
97
97
|
console.error(pc.red(`Unknown agent subcommand: ${subcommand ?? "(missing)"}`));
|
|
98
98
|
console.error();
|
|
99
|
-
const { printAgentCompactHelp } = await import("../agent-
|
|
99
|
+
const { printAgentCompactHelp } = await import("../agent-Pbf5iqr6.mjs");
|
|
100
100
|
printAgentCompactHelp();
|
|
101
101
|
process.exit(1);
|
|
102
102
|
} else if (parsedCommand.command === "doctor") {
|
|
103
|
-
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-
|
|
103
|
+
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-CndGrKwy.mjs");
|
|
104
104
|
const doctorOptions = parseDoctorArgs(args.slice(1));
|
|
105
105
|
if (doctorOptions.help) {
|
|
106
106
|
printDoctorHelp();
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { c as DEFAULT_LLMS_TXT_ROUTE, f as DEFAULT_MCP_WELL_KNOWN_ROUTE, i as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, m as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, o as DEFAULT_LLMS_FULL_TXT_ROUTE, p as DEFAULT_SKILL_MD_ROUTE, r as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, t as DEFAULT_AGENT_FEEDBACK_ROUTE, u as DEFAULT_MCP_PUBLIC_ROUTE } from "./agent-
|
|
1
|
+
import { c as DEFAULT_LLMS_TXT_ROUTE, f as DEFAULT_MCP_WELL_KNOWN_ROUTE, i as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, m as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, o as DEFAULT_LLMS_FULL_TXT_ROUTE, p as DEFAULT_SKILL_MD_ROUTE, r as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, t as DEFAULT_AGENT_FEEDBACK_ROUTE, u as DEFAULT_MCP_PUBLIC_ROUTE } from "./agent-BMOtZLMC.mjs";
|
|
2
2
|
import "./search-BhXicuww.mjs";
|
|
3
3
|
import "./prompt-utils-8nmFLQVH.mjs";
|
|
4
4
|
import { createFilesystemDocsMcpSource, resolveDocsMcpConfig } from "./mcp.mjs";
|
|
5
5
|
import "./server.mjs";
|
|
6
6
|
import { a as loadProjectEnv, c as readNavTitle, d as readTopLevelStringProperty, f as resolveDocsConfigPath, i as loadDocsConfigModule, o as readBooleanProperty, p as resolveDocsContentDir, r as extractTopLevelConfigObject, t as extractNestedObjectLiteral } from "./config-Si-yUfM_.mjs";
|
|
7
|
-
import { inspectAgentCompactionState, scanDocsPageTargets } from "./agent-
|
|
7
|
+
import { inspectAgentCompactionState, scanDocsPageTargets } from "./agent-Pbf5iqr6.mjs";
|
|
8
8
|
import { t as detectFramework } from "./utils-DSMXVnEu.mjs";
|
|
9
9
|
import { existsSync, lstatSync, readFileSync, readdirSync } from "node:fs";
|
|
10
10
|
import path from "node:path";
|
|
11
11
|
import pc from "picocolors";
|
|
12
|
+
import { LATEST_PROTOCOL_VERSION } from "@modelcontextprotocol/sdk/types";
|
|
12
13
|
|
|
13
14
|
//#region src/cli/doctor.ts
|
|
14
15
|
const NEXT_CONFIG_PATTERN = /^next\.config\.(?:[cm]?js|[cm]?ts)$/;
|
|
@@ -60,6 +61,19 @@ function parseDoctorArgs(argv) {
|
|
|
60
61
|
parsed.configPath = value;
|
|
61
62
|
continue;
|
|
62
63
|
}
|
|
64
|
+
if (arg.startsWith("--url=")) {
|
|
65
|
+
const value = parseInlineFlag(arg).value;
|
|
66
|
+
if (!value) throw new Error("Missing value for --url.");
|
|
67
|
+
parsed.url = value;
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
if (arg === "--url") {
|
|
71
|
+
const value = argv[index + 1];
|
|
72
|
+
if (!value || value.startsWith("--")) throw new Error("Missing value for --url.");
|
|
73
|
+
parsed.url = value;
|
|
74
|
+
index += 1;
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
63
77
|
if (arg === "--config") {
|
|
64
78
|
const value = argv[index + 1];
|
|
65
79
|
if (!value || value.startsWith("--")) throw new Error("Missing value for --config.");
|
|
@@ -89,6 +103,7 @@ ${pc.dim("Options:")}
|
|
|
89
103
|
${pc.cyan("--site")} Score reader-facing docs quality for the current docs app
|
|
90
104
|
${pc.cyan("--human")} Alias for ${pc.cyan("--site")}
|
|
91
105
|
${pc.cyan("--json")} Print the report as JSON for CI, scripts, and other agents
|
|
106
|
+
${pc.cyan("--url <url>")} Probe hosted agent surfaces, e.g. ${pc.dim("https://docs.example.com")}
|
|
92
107
|
${pc.cyan("--config <path>")} Use a custom docs config path instead of ${pc.dim("docs.config.ts[x]")}
|
|
93
108
|
${pc.cyan("-h, --help")} Show this help message
|
|
94
109
|
`);
|
|
@@ -466,6 +481,10 @@ function gradeForHumanScore(score) {
|
|
|
466
481
|
if (score >= 60) return "Promising";
|
|
467
482
|
return "Needs work";
|
|
468
483
|
}
|
|
484
|
+
function percentageScore(score, maxScore) {
|
|
485
|
+
if (maxScore <= 0) return 0;
|
|
486
|
+
return Math.round(score / maxScore * 100);
|
|
487
|
+
}
|
|
469
488
|
function formatStatus(status) {
|
|
470
489
|
if (status === "pass") return pc.green("PASS");
|
|
471
490
|
if (status === "warn") return pc.yellow("WARN");
|
|
@@ -611,6 +630,216 @@ function buildHumanCoverage(pages, navigationPages) {
|
|
|
611
630
|
navigationPages
|
|
612
631
|
};
|
|
613
632
|
}
|
|
633
|
+
function normalizeDoctorBaseUrl(value) {
|
|
634
|
+
const url = new URL(value);
|
|
635
|
+
if (url.protocol !== "http:" && url.protocol !== "https:") throw new Error("URL must use http or https.");
|
|
636
|
+
url.hash = "";
|
|
637
|
+
url.search = "";
|
|
638
|
+
url.pathname = url.pathname.replace(/\/+$/, "");
|
|
639
|
+
return url.toString().replace(/\/+$/, "");
|
|
640
|
+
}
|
|
641
|
+
function joinDoctorUrl(baseUrl, route) {
|
|
642
|
+
const base = new URL(baseUrl);
|
|
643
|
+
const basePath = base.pathname.replace(/\/+$/, "");
|
|
644
|
+
const routePath = route.startsWith("/") ? route : `/${route}`;
|
|
645
|
+
return new URL(`${basePath}${routePath}`, base.origin).toString();
|
|
646
|
+
}
|
|
647
|
+
function toMarkdownRoute(pageUrl) {
|
|
648
|
+
if (!pageUrl) return void 0;
|
|
649
|
+
const normalized = pageUrl === "/" ? "/index" : pageUrl.replace(/\/+$/, "");
|
|
650
|
+
return normalized.endsWith(".md") ? normalized : `${normalized}.md`;
|
|
651
|
+
}
|
|
652
|
+
async function fetchWithTimeout(url, init = {}, timeoutMs = 8e3) {
|
|
653
|
+
const controller = new AbortController();
|
|
654
|
+
const timeout = setTimeout(() => controller.abort(), timeoutMs);
|
|
655
|
+
try {
|
|
656
|
+
return await fetch(url, {
|
|
657
|
+
...init,
|
|
658
|
+
signal: controller.signal
|
|
659
|
+
});
|
|
660
|
+
} finally {
|
|
661
|
+
clearTimeout(timeout);
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
async function probeTextRoute(baseUrl, route) {
|
|
665
|
+
const url = joinDoctorUrl(baseUrl, route);
|
|
666
|
+
try {
|
|
667
|
+
const response = await fetchWithTimeout(url, { headers: { Accept: "text/plain, text/markdown, */*" } });
|
|
668
|
+
const body = await response.text().catch(() => "");
|
|
669
|
+
if (!response.ok) return {
|
|
670
|
+
ok: false,
|
|
671
|
+
status: response.status,
|
|
672
|
+
detail: `${route} returned HTTP ${response.status}.`
|
|
673
|
+
};
|
|
674
|
+
if (body.trim().length === 0) return {
|
|
675
|
+
ok: false,
|
|
676
|
+
status: response.status,
|
|
677
|
+
detail: `${route} returned an empty body.`
|
|
678
|
+
};
|
|
679
|
+
return {
|
|
680
|
+
ok: true,
|
|
681
|
+
status: response.status,
|
|
682
|
+
detail: `${route} returned HTTP ${response.status} with ${body.length} characters.`
|
|
683
|
+
};
|
|
684
|
+
} catch (error) {
|
|
685
|
+
return {
|
|
686
|
+
ok: false,
|
|
687
|
+
detail: `${route} failed: ${error instanceof Error ? error.message : String(error)}.`
|
|
688
|
+
};
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
async function probeJsonRoute(baseUrl, route) {
|
|
692
|
+
const url = joinDoctorUrl(baseUrl, route);
|
|
693
|
+
try {
|
|
694
|
+
const response = await fetchWithTimeout(url, { headers: { Accept: "application/json" } });
|
|
695
|
+
const text = await response.text().catch(() => "");
|
|
696
|
+
if (!response.ok) return {
|
|
697
|
+
ok: false,
|
|
698
|
+
status: response.status,
|
|
699
|
+
detail: `${route} returned HTTP ${response.status}.`
|
|
700
|
+
};
|
|
701
|
+
try {
|
|
702
|
+
const body = JSON.parse(text);
|
|
703
|
+
return {
|
|
704
|
+
ok: true,
|
|
705
|
+
status: response.status,
|
|
706
|
+
detail: `${route} returned valid JSON.`,
|
|
707
|
+
body
|
|
708
|
+
};
|
|
709
|
+
} catch {
|
|
710
|
+
return {
|
|
711
|
+
ok: false,
|
|
712
|
+
status: response.status,
|
|
713
|
+
detail: `${route} did not return valid JSON.`
|
|
714
|
+
};
|
|
715
|
+
}
|
|
716
|
+
} catch (error) {
|
|
717
|
+
return {
|
|
718
|
+
ok: false,
|
|
719
|
+
detail: `${route} failed: ${error instanceof Error ? error.message : String(error)}.`
|
|
720
|
+
};
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
async function parseMcpResponse(response) {
|
|
724
|
+
const contentType = response.headers.get("content-type") ?? "";
|
|
725
|
+
const body = await response.text();
|
|
726
|
+
if (contentType.includes("application/json")) return JSON.parse(body);
|
|
727
|
+
const data = body.split("\n").map((line) => line.trim()).filter((line) => line.startsWith("data:")).map((line) => line.slice(5).trimStart()).filter(Boolean).at(-1);
|
|
728
|
+
if (!data) throw new Error(`Expected MCP JSON-RPC payload, got ${body.slice(0, 120) || "empty body"}.`);
|
|
729
|
+
return JSON.parse(data);
|
|
730
|
+
}
|
|
731
|
+
async function postMcpJson(baseUrl, route, body, sessionId) {
|
|
732
|
+
return fetchWithTimeout(joinDoctorUrl(baseUrl, route), {
|
|
733
|
+
method: "POST",
|
|
734
|
+
headers: {
|
|
735
|
+
"Content-Type": "application/json",
|
|
736
|
+
Accept: "application/json, text/event-stream",
|
|
737
|
+
"mcp-protocol-version": LATEST_PROTOCOL_VERSION,
|
|
738
|
+
...sessionId ? { "mcp-session-id": sessionId } : {}
|
|
739
|
+
},
|
|
740
|
+
body: JSON.stringify(body)
|
|
741
|
+
});
|
|
742
|
+
}
|
|
743
|
+
async function probeMcpRoute(baseUrl, route) {
|
|
744
|
+
try {
|
|
745
|
+
const initializeResponse = await postMcpJson(baseUrl, route, {
|
|
746
|
+
jsonrpc: "2.0",
|
|
747
|
+
id: "doctor-initialize",
|
|
748
|
+
method: "initialize",
|
|
749
|
+
params: {
|
|
750
|
+
protocolVersion: LATEST_PROTOCOL_VERSION,
|
|
751
|
+
capabilities: {},
|
|
752
|
+
clientInfo: {
|
|
753
|
+
name: "@farming-labs/docs doctor",
|
|
754
|
+
version: "0.0.0"
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
});
|
|
758
|
+
const initializePayload = await parseMcpResponse(initializeResponse);
|
|
759
|
+
if (!initializeResponse.ok || initializePayload.error) return {
|
|
760
|
+
ok: false,
|
|
761
|
+
detail: `${route} initialize returned HTTP ${initializeResponse.status}: ${String(initializePayload.error?.message ?? "unknown MCP error")}.`
|
|
762
|
+
};
|
|
763
|
+
const sessionId = initializeResponse.headers.get("mcp-session-id");
|
|
764
|
+
if (!sessionId) return {
|
|
765
|
+
ok: false,
|
|
766
|
+
detail: `${route} initialize did not return mcp-session-id.`
|
|
767
|
+
};
|
|
768
|
+
await postMcpJson(baseUrl, route, {
|
|
769
|
+
jsonrpc: "2.0",
|
|
770
|
+
method: "notifications/initialized",
|
|
771
|
+
params: {}
|
|
772
|
+
}, sessionId).catch(() => void 0);
|
|
773
|
+
const toolsResponse = await postMcpJson(baseUrl, route, {
|
|
774
|
+
jsonrpc: "2.0",
|
|
775
|
+
id: "doctor-tools-list",
|
|
776
|
+
method: "tools/list",
|
|
777
|
+
params: {}
|
|
778
|
+
}, sessionId);
|
|
779
|
+
const toolsPayload = await parseMcpResponse(toolsResponse);
|
|
780
|
+
await fetchWithTimeout(joinDoctorUrl(baseUrl, route), {
|
|
781
|
+
method: "DELETE",
|
|
782
|
+
headers: {
|
|
783
|
+
"mcp-protocol-version": LATEST_PROTOCOL_VERSION,
|
|
784
|
+
"mcp-session-id": sessionId
|
|
785
|
+
}
|
|
786
|
+
}).catch(() => void 0);
|
|
787
|
+
if (!toolsResponse.ok || toolsPayload.error) return {
|
|
788
|
+
ok: false,
|
|
789
|
+
detail: `${route} tools/list returned HTTP ${toolsResponse.status}: ${String(toolsPayload.error?.message ?? "unknown MCP error")}.`
|
|
790
|
+
};
|
|
791
|
+
const tools = toolsPayload.result?.tools;
|
|
792
|
+
const toolNames = Array.isArray(tools) ? tools.map((tool) => tool.name).filter((name) => typeof name === "string") : [];
|
|
793
|
+
const missingTools = [
|
|
794
|
+
"list_pages",
|
|
795
|
+
"get_navigation",
|
|
796
|
+
"search_docs",
|
|
797
|
+
"read_page"
|
|
798
|
+
].filter((tool) => !toolNames.includes(tool));
|
|
799
|
+
if (missingTools.length > 0) return {
|
|
800
|
+
ok: false,
|
|
801
|
+
detail: `${route} connected but is missing tools: ${missingTools.join(", ")}.`
|
|
802
|
+
};
|
|
803
|
+
return {
|
|
804
|
+
ok: true,
|
|
805
|
+
detail: `${route} initialized and exposed ${toolNames.length} MCP tool${toolNames.length === 1 ? "" : "s"}.`
|
|
806
|
+
};
|
|
807
|
+
} catch (error) {
|
|
808
|
+
return {
|
|
809
|
+
ok: false,
|
|
810
|
+
detail: `${route} failed: ${error instanceof Error ? error.message : String(error)}.`
|
|
811
|
+
};
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
async function buildHostedAgentChecks(url, pages) {
|
|
815
|
+
let baseUrl;
|
|
816
|
+
try {
|
|
817
|
+
baseUrl = normalizeDoctorBaseUrl(url);
|
|
818
|
+
} catch (error) {
|
|
819
|
+
return { checks: [makeCheck("hosted-url", "Hosted URL", "fail", 0, 5, `Could not parse --url "${url}": ${error instanceof Error ? error.message : String(error)}`, "Pass a full hosted URL such as https://docs.example.com.")] };
|
|
820
|
+
}
|
|
821
|
+
const checks = [];
|
|
822
|
+
const discovery = await probeJsonRoute(baseUrl, DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE);
|
|
823
|
+
checks.push(makeCheck("hosted-agent-discovery", "Hosted agent discovery", discovery.ok ? "pass" : "fail", discovery.ok ? 5 : 0, 5, `${baseUrl}: ${discovery.detail}`, discovery.ok ? void 0 : `Make sure ${DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE} is routed to the shared docs API on the deployed site.`));
|
|
824
|
+
const llms = await Promise.all([probeTextRoute(baseUrl, DEFAULT_LLMS_TXT_ROUTE), probeTextRoute(baseUrl, DEFAULT_LLMS_FULL_TXT_ROUTE)]);
|
|
825
|
+
const llmsPassed = llms.filter((result) => result.ok).length;
|
|
826
|
+
checks.push(makeCheck("hosted-llms", "Hosted llms.txt", llmsPassed === llms.length ? "pass" : llmsPassed > 0 ? "warn" : "fail", llmsPassed === llms.length ? 5 : llmsPassed > 0 ? 3 : 0, 5, llms.map((result) => result.detail).join(" "), llmsPassed === llms.length ? void 0 : "Verify deployed /llms.txt and /llms-full.txt routes return non-empty text."));
|
|
827
|
+
const skill = await Promise.all([probeTextRoute(baseUrl, DEFAULT_SKILL_MD_ROUTE), probeTextRoute(baseUrl, DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE)]);
|
|
828
|
+
const skillPassed = skill.filter((result) => result.ok).length;
|
|
829
|
+
checks.push(makeCheck("hosted-skill", "Hosted skill.md", skillPassed === skill.length ? "pass" : skillPassed > 0 ? "warn" : "fail", skillPassed === skill.length ? 5 : skillPassed > 0 ? 3 : 0, 5, skill.map((result) => result.detail).join(" "), skillPassed === skill.length ? void 0 : "Verify deployed /skill.md and /.well-known/skill.md routes return non-empty markdown."));
|
|
830
|
+
const markdownRoute = toMarkdownRoute(pages[0]?.url);
|
|
831
|
+
if (markdownRoute) {
|
|
832
|
+
const markdown = await probeTextRoute(baseUrl, markdownRoute);
|
|
833
|
+
checks.push(makeCheck("hosted-markdown", "Hosted markdown route", markdown.ok ? "pass" : "fail", markdown.ok ? 5 : 0, 5, markdown.detail, markdown.ok ? void 0 : `Verify deployed markdown routes are forwarded, starting with ${markdownRoute}.`));
|
|
834
|
+
} else checks.push(makeCheck("hosted-markdown", "Hosted markdown route", "warn", 0, 5, "No local docs page was available to choose a sample .md route.", "Add docs pages so the hosted doctor can probe a representative .md route."));
|
|
835
|
+
const mcp = await Promise.all([probeMcpRoute(baseUrl, DEFAULT_MCP_PUBLIC_ROUTE), probeMcpRoute(baseUrl, DEFAULT_MCP_WELL_KNOWN_ROUTE)]);
|
|
836
|
+
const mcpPassed = mcp.filter((result) => result.ok).length;
|
|
837
|
+
checks.push(makeCheck("hosted-mcp", "Hosted MCP handshake", mcpPassed === mcp.length ? "pass" : mcpPassed > 0 ? "warn" : "fail", mcpPassed === mcp.length ? 10 : mcpPassed > 0 ? 5 : 0, 10, mcp.map((result) => result.detail).join(" "), mcpPassed === mcp.length ? void 0 : `Verify deployed ${DEFAULT_MCP_PUBLIC_ROUTE} and ${DEFAULT_MCP_WELL_KNOWN_ROUTE} support Streamable HTTP initialize and tools/list.`));
|
|
838
|
+
return {
|
|
839
|
+
baseUrl,
|
|
840
|
+
checks
|
|
841
|
+
};
|
|
842
|
+
}
|
|
614
843
|
async function loadDocsConfigModuleWithProjectEnv(rootDir, explicitPath) {
|
|
615
844
|
const env = loadProjectEnv(rootDir);
|
|
616
845
|
const injectedKeys = Object.entries(env).filter(([key]) => process.env[key] === void 0).map(([key, value]) => {
|
|
@@ -717,6 +946,8 @@ async function inspectAgentReadiness(options = {}) {
|
|
|
717
946
|
const coverageResult = coverageScore(coverage.explicitCoverage);
|
|
718
947
|
checks.push(makeCheck("coverage", "Explicit page optimization", coverageResult.status, coverageResult.score, 10, coverage.totalPages > 0 ? `${coverage.explicitPages}/${coverage.totalPages} pages define explicit machine-only context (${coverage.pagesWithAgentFiles} agent.md, ${coverage.pagesWithAgentBlocks} Agent blocks, ${coverage.explicitCoverage}% of pages).` : "No docs pages were available to score explicit page optimization.", coverage.explicitCoverage >= 50 ? void 0 : "Add agent.md files or <Agent> blocks to more pages, or run docs agent compact to create page-level machine docs."));
|
|
719
948
|
checks.push(makeCheck("compact", "Agent compaction freshness", compactionResult.status, compactionResult.score, 5, `${compactionCoverage.freshGeneratedPages} fresh, ${compactionCoverage.staleGeneratedPages} stale, ${compactionCoverage.modifiedGeneratedPages} modified, ${compactionCoverage.unknownGeneratedPages} unknown, ${compactionCoverage.tokenBudgetMissingPages} token-budget missing, and ${compactionCoverage.otherMissingPages} other missing page${compactionCoverage.otherMissingPages === 1 ? "" : "s"} across compactable docs pages.` + (compactConfigured ? " agent.compact defaults are configured." : " No agent.compact defaults were found in docs config."), compactionResult.recommendation));
|
|
949
|
+
const hosted = options.url ? await buildHostedAgentChecks(options.url, pages) : void 0;
|
|
950
|
+
if (hosted) checks.push(...hosted.checks);
|
|
720
951
|
const score = checks.reduce((total, check) => total + check.score, 0);
|
|
721
952
|
const maxScore = checks.reduce((total, check) => total + check.maxScore, 0);
|
|
722
953
|
return {
|
|
@@ -725,9 +956,10 @@ async function inspectAgentReadiness(options = {}) {
|
|
|
725
956
|
configPath: path.relative(rootDir, configPath).replace(/\\/g, "/"),
|
|
726
957
|
entry,
|
|
727
958
|
contentDir,
|
|
959
|
+
url: hosted?.baseUrl,
|
|
728
960
|
score,
|
|
729
961
|
maxScore,
|
|
730
|
-
grade: gradeForAgentScore(score),
|
|
962
|
+
grade: gradeForAgentScore(percentageScore(score, maxScore)),
|
|
731
963
|
checks,
|
|
732
964
|
coverage,
|
|
733
965
|
recommendations: checks.map((check) => check.recommendation).filter((recommendation) => Boolean(recommendation)).slice(0, 3)
|
|
@@ -808,7 +1040,7 @@ async function inspectHumanReadiness(options = {}) {
|
|
|
808
1040
|
contentDir,
|
|
809
1041
|
score,
|
|
810
1042
|
maxScore,
|
|
811
|
-
grade: gradeForHumanScore(score),
|
|
1043
|
+
grade: gradeForHumanScore(percentageScore(score, maxScore)),
|
|
812
1044
|
checks,
|
|
813
1045
|
coverage,
|
|
814
1046
|
recommendations: checks.map((check) => check.recommendation).filter((recommendation) => Boolean(recommendation)).slice(0, 3)
|
|
@@ -819,6 +1051,7 @@ function printAgentDoctorReport(report) {
|
|
|
819
1051
|
console.log();
|
|
820
1052
|
console.log(`${pc.bold("Score:")} ${pc.cyan(`${report.score}/${report.maxScore}`)} ${pc.dim(`(${report.grade})`)}`);
|
|
821
1053
|
console.log(`${pc.bold("Framework:")} ${report.framework} ${pc.dim("•")} ${pc.bold("Entry:")} ${report.entry ?? "docs"} ${pc.dim("•")} ${pc.bold("Content:")} ${report.contentDir ?? "-"}`);
|
|
1054
|
+
if (report.url) console.log(`${pc.bold("Hosted URL:")} ${report.url}`);
|
|
822
1055
|
console.log(`${pc.bold("Explicit agent-friendly pages:")} ${report.coverage.explicitPages}/${report.coverage.totalPages} pages ${pc.dim(`(${report.coverage.explicitCoverage}%)`)}`);
|
|
823
1056
|
console.log(`${pc.bold("Generated agent.md freshness:")} ${report.coverage.compaction.freshGeneratedPages} fresh ${pc.dim("•")} ${report.coverage.compaction.staleGeneratedPages} stale ${pc.dim("•")} ${report.coverage.compaction.modifiedGeneratedPages} modified ${pc.dim("•")} ${report.coverage.compaction.tokenBudgetMissingPages} token-budget missing`);
|
|
824
1057
|
console.log();
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as PageFrontmatter, A as DocsSearchAdapterContext, B as DocsTheme, C as DocsI18nConfig, D as DocsNav, E as DocsMetadata, F as DocsSearchEmbeddingsConfig, G as LlmsTxtConfig, H as FontStyle, I as DocsSearchQuery, J as OpenDocsConfig, K as McpDocsSearchConfig, L as DocsSearchResult, M as DocsSearchChunkingConfig, N as DocsSearchConfig, O as DocsRelatedItem, P as DocsSearchDocument, Q as PageActionsConfig, R as DocsSearchResultType, S as DocsFeedbackValue, T as DocsMcpToolsConfig, U as GithubConfig, V as FeedbackConfig, W as LastUpdatedConfig, X as OpenGraphImage, Y as OpenDocsProvider, Z as OrderingItem, _ as DocsAnalyticsEventType, a as ApiReferenceRenderer, at as SidebarComponentProps, b as DocsConfig, c as ChangelogFrontmatter, ct as SidebarFolderNode, d as CustomDocsSearchConfig, dt as SidebarTree, et as PageOpenGraph, f as DocsAgentFeedbackContext, ft as SimpleDocsSearchConfig, g as DocsAnalyticsEventInput, gt as UIConfig, h as DocsAnalyticsEvent, ht as TypographyConfig, i as ApiReferenceConfig, it as ResolvedDocsRelatedLink, j as DocsSearchAdapterFactory, k as DocsSearchAdapter, l as CodeBlockCopyData, lt as SidebarNode, m as DocsAnalyticsConfig, mt as TypesenseDocsSearchConfig, n as AgentFeedbackConfig, nt as PageTwitter, o as BreadcrumbConfig, ot as SidebarConfig, p as DocsAgentFeedbackData, pt as ThemeToggleConfig, q as OGConfig, r as AlgoliaDocsSearchConfig, rt as ReadingTimeConfig, s as ChangelogConfig, st as SidebarFolderIndexBehavior, t as AIConfig, tt as PageSidebarFrontmatter, u as CopyMarkdownConfig, ut as SidebarPageNode, v as DocsAnalyticsInput, w as DocsMcpConfig, x as DocsFeedbackData, y as DocsAnalyticsSource, z as DocsSearchSourcePage } from "./types-
|
|
2
|
-
import { a as createSimpleSearchAdapter, c as resolveSearchRequestConfig, d as resolveDocsAnalyticsConfig, f as DocsCloudAnalyticsOptions, i as createMcpSearchAdapter, l as ResolvedDocsAnalyticsConfig, n as createAlgoliaSearchAdapter, o as createTypesenseSearchAdapter, p as createDocsCloudAnalytics, r as createCustomSearchAdapter, s as performDocsSearch, t as buildDocsSearchDocuments, u as emitDocsAnalyticsEvent } from "./search-
|
|
1
|
+
import { $ as PageFrontmatter, A as DocsSearchAdapterContext, B as DocsTheme, C as DocsI18nConfig, D as DocsNav, E as DocsMetadata, F as DocsSearchEmbeddingsConfig, G as LlmsTxtConfig, H as FontStyle, I as DocsSearchQuery, J as OpenDocsConfig, K as McpDocsSearchConfig, L as DocsSearchResult, M as DocsSearchChunkingConfig, N as DocsSearchConfig, O as DocsRelatedItem, P as DocsSearchDocument, Q as PageActionsConfig, R as DocsSearchResultType, S as DocsFeedbackValue, T as DocsMcpToolsConfig, U as GithubConfig, V as FeedbackConfig, W as LastUpdatedConfig, X as OpenGraphImage, Y as OpenDocsProvider, Z as OrderingItem, _ as DocsAnalyticsEventType, a as ApiReferenceRenderer, at as SidebarComponentProps, b as DocsConfig, c as ChangelogFrontmatter, ct as SidebarFolderNode, d as CustomDocsSearchConfig, dt as SidebarTree, et as PageOpenGraph, f as DocsAgentFeedbackContext, ft as SimpleDocsSearchConfig, g as DocsAnalyticsEventInput, gt as UIConfig, h as DocsAnalyticsEvent, ht as TypographyConfig, i as ApiReferenceConfig, it as ResolvedDocsRelatedLink, j as DocsSearchAdapterFactory, k as DocsSearchAdapter, l as CodeBlockCopyData, lt as SidebarNode, m as DocsAnalyticsConfig, mt as TypesenseDocsSearchConfig, n as AgentFeedbackConfig, nt as PageTwitter, o as BreadcrumbConfig, ot as SidebarConfig, p as DocsAgentFeedbackData, pt as ThemeToggleConfig, q as OGConfig, r as AlgoliaDocsSearchConfig, rt as ReadingTimeConfig, s as ChangelogConfig, st as SidebarFolderIndexBehavior, t as AIConfig, tt as PageSidebarFrontmatter, u as CopyMarkdownConfig, ut as SidebarPageNode, v as DocsAnalyticsInput, w as DocsMcpConfig, x as DocsFeedbackData, y as DocsAnalyticsSource, z as DocsSearchSourcePage } from "./types-BXgTvFFE.mjs";
|
|
2
|
+
import { a as createSimpleSearchAdapter, c as resolveSearchRequestConfig, d as resolveDocsAnalyticsConfig, f as DocsCloudAnalyticsOptions, i as createMcpSearchAdapter, l as ResolvedDocsAnalyticsConfig, n as createAlgoliaSearchAdapter, o as createTypesenseSearchAdapter, p as createDocsCloudAnalytics, r as createCustomSearchAdapter, s as performDocsSearch, t as buildDocsSearchDocuments, u as emitDocsAnalyticsEvent } from "./search-Gvi81BSo.mjs";
|
|
3
3
|
import { DocsMcpPage, DocsMcpResolvedConfig } from "./mcp.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/define-docs.d.ts
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as resolvePageSidebarFolderIndexBehavior, B as resolveOGImage, C as renderDocsMarkdownDocument, D as resolveDocsMarkdownRequest, E as resolveDocsLlmsTxtFormat, F as resolveReadingTimeFromContent, G as createTheme, H as resolveDocsI18n, I as resolveReadingTimeFromSource, J as resolveChangelogConfig, K as extendTheme, L as resolveReadingTimeOptions, M as resolveSidebarFolderIndexBehaviorForPath, N as estimateReadingTimeMinutes, O as resolveDocsSkillFormat, P as resolvePageReadingTime, R as buildPageOpenGraph, S as normalizeDocsUrlPath, T as resolveDocsAgentMdxContent, U as resolveDocsLocale, V as resolveTitle, W as resolveDocsPath, Y as defineDocs, _ as isDocsAgentDiscoveryRequest, a as DEFAULT_DOCS_API_ROUTE, b as isDocsSkillRequest, c as DEFAULT_LLMS_TXT_ROUTE, d as DEFAULT_MCP_ROUTE, f as DEFAULT_MCP_WELL_KNOWN_ROUTE, g as findDocsMarkdownPage, h as buildDocsAgentDiscoverySpec, i as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, j as resolveSidebarFolderIndexBehavior, k as applySidebarFolderIndexBehavior, l as DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE, m as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, n as DEFAULT_AGENT_SPEC_ROUTE, o as DEFAULT_LLMS_FULL_TXT_ROUTE, p as DEFAULT_SKILL_MD_ROUTE, q as deepMerge, r as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, s as DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE, t as DEFAULT_AGENT_FEEDBACK_ROUTE, u as DEFAULT_MCP_PUBLIC_ROUTE, v as isDocsMcpRequest, w as renderDocsSkillDocument, x as normalizeDocsPathSegment, y as isDocsPublicGetRequest, z as buildPageTwitter } from "./agent-
|
|
1
|
+
import { A as resolvePageSidebarFolderIndexBehavior, B as resolveOGImage, C as renderDocsMarkdownDocument, D as resolveDocsMarkdownRequest, E as resolveDocsLlmsTxtFormat, F as resolveReadingTimeFromContent, G as createTheme, H as resolveDocsI18n, I as resolveReadingTimeFromSource, J as resolveChangelogConfig, K as extendTheme, L as resolveReadingTimeOptions, M as resolveSidebarFolderIndexBehaviorForPath, N as estimateReadingTimeMinutes, O as resolveDocsSkillFormat, P as resolvePageReadingTime, R as buildPageOpenGraph, S as normalizeDocsUrlPath, T as resolveDocsAgentMdxContent, U as resolveDocsLocale, V as resolveTitle, W as resolveDocsPath, Y as defineDocs, _ as isDocsAgentDiscoveryRequest, a as DEFAULT_DOCS_API_ROUTE, b as isDocsSkillRequest, c as DEFAULT_LLMS_TXT_ROUTE, d as DEFAULT_MCP_ROUTE, f as DEFAULT_MCP_WELL_KNOWN_ROUTE, g as findDocsMarkdownPage, h as buildDocsAgentDiscoverySpec, i as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, j as resolveSidebarFolderIndexBehavior, k as applySidebarFolderIndexBehavior, l as DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE, m as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, n as DEFAULT_AGENT_SPEC_ROUTE, o as DEFAULT_LLMS_FULL_TXT_ROUTE, p as DEFAULT_SKILL_MD_ROUTE, q as deepMerge, r as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, s as DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE, t as DEFAULT_AGENT_FEEDBACK_ROUTE, u as DEFAULT_MCP_PUBLIC_ROUTE, v as isDocsMcpRequest, w as renderDocsSkillDocument, x as normalizeDocsPathSegment, y as isDocsPublicGetRequest, z as buildPageTwitter } from "./agent-BMOtZLMC.mjs";
|
|
2
2
|
import { _ as renderDocsRelatedMarkdownLines, a as createSimpleSearchAdapter, b as createDocsCloudAnalytics, c as resolveSearchRequestConfig, d as hashGeneratedAgentContent, f as normalizeGeneratedAgentContent, g as normalizeDocsRelated, h as stripGeneratedAgentProvenance, i as createMcpSearchAdapter, l as GENERATED_AGENT_PROVENANCE_MARKER, m as serializeGeneratedAgentDocument, n as createAlgoliaSearchAdapter, o as createTypesenseSearchAdapter, p as parseGeneratedAgentDocument, r as createCustomSearchAdapter, s as performDocsSearch, t as buildDocsSearchDocuments, u as GENERATED_AGENT_PROVENANCE_VERSION, v as emitDocsAnalyticsEvent, y as resolveDocsAnalyticsConfig } from "./search-BhXicuww.mjs";
|
|
3
3
|
|
|
4
4
|
export { DEFAULT_AGENT_FEEDBACK_ROUTE, DEFAULT_AGENT_SPEC_ROUTE, DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, DEFAULT_DOCS_API_ROUTE, DEFAULT_LLMS_FULL_TXT_ROUTE, DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE, DEFAULT_LLMS_TXT_ROUTE, DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE, DEFAULT_MCP_PUBLIC_ROUTE, DEFAULT_MCP_ROUTE, DEFAULT_MCP_WELL_KNOWN_ROUTE, DEFAULT_SKILL_MD_ROUTE, DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, GENERATED_AGENT_PROVENANCE_MARKER, GENERATED_AGENT_PROVENANCE_VERSION, applySidebarFolderIndexBehavior, buildDocsAgentDiscoverySpec, buildDocsSearchDocuments, buildPageOpenGraph, buildPageTwitter, createAlgoliaSearchAdapter, createCustomSearchAdapter, createDocsCloudAnalytics, createMcpSearchAdapter, createSimpleSearchAdapter, createTheme, createTypesenseSearchAdapter, deepMerge, defineDocs, emitDocsAnalyticsEvent, estimateReadingTimeMinutes, extendTheme, findDocsMarkdownPage, hashGeneratedAgentContent, isDocsAgentDiscoveryRequest, isDocsMcpRequest, isDocsPublicGetRequest, isDocsSkillRequest, normalizeDocsPathSegment, normalizeDocsRelated, normalizeDocsUrlPath, normalizeGeneratedAgentContent, parseGeneratedAgentDocument, performDocsSearch, renderDocsMarkdownDocument, renderDocsRelatedMarkdownLines, renderDocsSkillDocument, resolveChangelogConfig, resolveDocsAgentMdxContent, resolveDocsAnalyticsConfig, resolveDocsI18n, resolveDocsLlmsTxtFormat, resolveDocsLocale, resolveDocsMarkdownRequest, resolveDocsPath, resolveDocsSkillFormat, resolveOGImage, resolvePageReadingTime, resolvePageSidebarFolderIndexBehavior, resolveReadingTimeFromContent, resolveReadingTimeFromSource, resolveReadingTimeOptions, resolveSearchRequestConfig, resolveSidebarFolderIndexBehavior, resolveSidebarFolderIndexBehaviorForPath, resolveTitle, serializeGeneratedAgentDocument, stripGeneratedAgentProvenance };
|
package/dist/mcp.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as DocsSearchConfig, Z as OrderingItem, m as DocsAnalyticsConfig, w as DocsMcpConfig, z as DocsSearchSourcePage } from "./types-
|
|
1
|
+
import { N as DocsSearchConfig, Z as OrderingItem, m as DocsAnalyticsConfig, w as DocsMcpConfig, z as DocsSearchSourcePage } from "./types-BXgTvFFE.mjs";
|
|
2
2
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
3
|
|
|
4
4
|
//#region src/mcp.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { K as McpDocsSearchConfig, L as DocsSearchResult, M as DocsSearchChunkingConfig, N as DocsSearchConfig, P as DocsSearchDocument, d as CustomDocsSearchConfig, g as DocsAnalyticsEventInput, h as DocsAnalyticsEvent, j as DocsSearchAdapterFactory, k as DocsSearchAdapter, m as DocsAnalyticsConfig, mt as TypesenseDocsSearchConfig, r as AlgoliaDocsSearchConfig, z as DocsSearchSourcePage } from "./types-
|
|
1
|
+
import { K as McpDocsSearchConfig, L as DocsSearchResult, M as DocsSearchChunkingConfig, N as DocsSearchConfig, P as DocsSearchDocument, d as CustomDocsSearchConfig, g as DocsAnalyticsEventInput, h as DocsAnalyticsEvent, j as DocsSearchAdapterFactory, k as DocsSearchAdapter, m as DocsAnalyticsConfig, mt as TypesenseDocsSearchConfig, r as AlgoliaDocsSearchConfig, z as DocsSearchSourcePage } from "./types-BXgTvFFE.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/cloud-analytics.d.ts
|
|
4
4
|
interface DocsCloudAnalyticsOptions {
|
package/dist/server.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as DocsSearchAdapterContext, I as DocsSearchQuery, K as McpDocsSearchConfig, L as DocsSearchResult, N as DocsSearchConfig, P as DocsSearchDocument, Y as OpenDocsProvider, a as ApiReferenceRenderer, b as DocsConfig, g as DocsAnalyticsEventInput, h as DocsAnalyticsEvent, j as DocsSearchAdapterFactory, k as DocsSearchAdapter, m as DocsAnalyticsConfig, z as DocsSearchSourcePage } from "./types-
|
|
2
|
-
import { a as createSimpleSearchAdapter, c as resolveSearchRequestConfig, d as resolveDocsAnalyticsConfig, f as DocsCloudAnalyticsOptions, i as createMcpSearchAdapter, l as ResolvedDocsAnalyticsConfig, n as createAlgoliaSearchAdapter, o as createTypesenseSearchAdapter, p as createDocsCloudAnalytics, r as createCustomSearchAdapter, s as performDocsSearch, t as buildDocsSearchDocuments, u as emitDocsAnalyticsEvent } from "./search-
|
|
1
|
+
import { A as DocsSearchAdapterContext, I as DocsSearchQuery, K as McpDocsSearchConfig, L as DocsSearchResult, N as DocsSearchConfig, P as DocsSearchDocument, Y as OpenDocsProvider, a as ApiReferenceRenderer, b as DocsConfig, g as DocsAnalyticsEventInput, h as DocsAnalyticsEvent, j as DocsSearchAdapterFactory, k as DocsSearchAdapter, m as DocsAnalyticsConfig, z as DocsSearchSourcePage } from "./types-BXgTvFFE.mjs";
|
|
2
|
+
import { a as createSimpleSearchAdapter, c as resolveSearchRequestConfig, d as resolveDocsAnalyticsConfig, f as DocsCloudAnalyticsOptions, i as createMcpSearchAdapter, l as ResolvedDocsAnalyticsConfig, n as createAlgoliaSearchAdapter, o as createTypesenseSearchAdapter, p as createDocsCloudAnalytics, r as createCustomSearchAdapter, s as performDocsSearch, t as buildDocsSearchDocuments, u as emitDocsAnalyticsEvent } from "./search-Gvi81BSo.mjs";
|
|
3
3
|
import { DocsMcpHttpHandlers, DocsMcpNavigationNode, DocsMcpNavigationTree, DocsMcpPage, DocsMcpResolvedConfig, DocsMcpSource, createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, normalizeDocsMcpRoute, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/api-reference.d.ts
|
|
@@ -407,7 +407,7 @@ interface SidebarComponentProps {
|
|
|
407
407
|
* - `"toggle"` — clicking the parent row only expands/collapses children, and the
|
|
408
408
|
* landing page is rendered as the first child item instead
|
|
409
409
|
*/
|
|
410
|
-
type SidebarFolderIndexBehavior = "link" | "toggle";
|
|
410
|
+
type SidebarFolderIndexBehavior = "link" | "toggle" | "hidden";
|
|
411
411
|
type SidebarFolderIndexBehaviorOverrides = Record<string, SidebarFolderIndexBehavior>;
|
|
412
412
|
interface SidebarConfig {
|
|
413
413
|
/**
|
|
@@ -486,6 +486,8 @@ interface SidebarConfig {
|
|
|
486
486
|
* - `"link"` — clicking the parent row navigates to the folder landing page
|
|
487
487
|
* - `"toggle"` — clicking the parent row only expands/collapses children, and the
|
|
488
488
|
* folder landing page appears as the first child item instead
|
|
489
|
+
* - `"hidden"` — the folder landing page route still exists, but the parent row
|
|
490
|
+
* becomes a plain label and only the child pages appear in the sidebar
|
|
489
491
|
*
|
|
490
492
|
* This is the global default. Individual folder pages can still override it with
|
|
491
493
|
* page frontmatter:
|
|
@@ -493,7 +495,7 @@ interface SidebarConfig {
|
|
|
493
495
|
* ```mdx
|
|
494
496
|
* ---
|
|
495
497
|
* sidebar:
|
|
496
|
-
* folderIndexBehavior: "
|
|
498
|
+
* folderIndexBehavior: "hidden"
|
|
497
499
|
* ---
|
|
498
500
|
* ```
|
|
499
501
|
*
|