@farming-labs/docs 0.1.53 → 0.1.56
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-C3rj3o1l.mjs → agent-DBaFbcEF.mjs} +92 -6
- package/dist/{agent-Xh0UaY5I.mjs → agent-WrorbwIf.mjs} +56 -1
- package/dist/cli/index.mjs +4 -3
- package/dist/{doctor-B0xEGzBU.mjs → doctor-CWUYMwIQ.mjs} +2 -2
- package/dist/index.d.mts +14 -3
- package/dist/index.mjs +2 -2
- package/dist/mcp.d.mts +1 -1
- package/dist/{search-KMMtXPTi.d.mts → search-MhRnNSQX.d.mts} +1 -1
- package/dist/server.d.mts +2 -2
- package/dist/{types-Cl6WPIHa.d.mts → types-bOtKcSW8.d.mts} +35 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as renderDocsMarkdownDocument, g as findDocsMarkdownPage } from "./agent-
|
|
1
|
+
import { C as renderDocsMarkdownDocument, g as findDocsMarkdownPage } from "./agent-WrorbwIf.mjs";
|
|
2
2
|
import { d as hashGeneratedAgentContent, m as serializeGeneratedAgentDocument, p as parseGeneratedAgentDocument, u as GENERATED_AGENT_PROVENANCE_VERSION } from "./search-Cu_pxL8o.mjs";
|
|
3
3
|
import "./index.mjs";
|
|
4
4
|
import "./api-reference-GDAEzQn1.mjs";
|
|
@@ -9,6 +9,7 @@ import matter from "gray-matter";
|
|
|
9
9
|
import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
10
10
|
import path from "node:path";
|
|
11
11
|
import pc from "picocolors";
|
|
12
|
+
import { execFileSync } from "node:child_process";
|
|
12
13
|
|
|
13
14
|
//#region src/cli/agent.ts
|
|
14
15
|
const DEFAULT_TTC_BASE_URL = "https://api.thetokencompany.com";
|
|
@@ -50,6 +51,10 @@ function parseAgentCompactArgs(argv) {
|
|
|
50
51
|
parsed.dryRun = true;
|
|
51
52
|
continue;
|
|
52
53
|
}
|
|
54
|
+
if (arg === "--changed") {
|
|
55
|
+
parsed.changed = true;
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
53
58
|
if (arg === "--stale") {
|
|
54
59
|
parsed.stale = true;
|
|
55
60
|
continue;
|
|
@@ -175,6 +180,62 @@ function resolveCompressionEndpoint(rawBaseUrl) {
|
|
|
175
180
|
if (/\/v1\/compress\/?$/i.test(baseUrl)) return baseUrl.replace(/\/+$/, "");
|
|
176
181
|
return `${baseUrl.replace(/\/+$/, "")}/v1/compress`;
|
|
177
182
|
}
|
|
183
|
+
function runGitCommand(rootDir, args) {
|
|
184
|
+
return execFileSync("git", args, {
|
|
185
|
+
cwd: rootDir,
|
|
186
|
+
encoding: "utf-8"
|
|
187
|
+
}).trim();
|
|
188
|
+
}
|
|
189
|
+
function normalizeGitRelativePath(value) {
|
|
190
|
+
return value.replace(/\\/g, "/").replace(/^\.\/+/, "").replace(/^\/+/, "");
|
|
191
|
+
}
|
|
192
|
+
function listGitChangedFiles(rootDir, contentDir) {
|
|
193
|
+
let gitRoot;
|
|
194
|
+
try {
|
|
195
|
+
gitRoot = runGitCommand(rootDir, ["rev-parse", "--show-toplevel"]);
|
|
196
|
+
} catch {
|
|
197
|
+
throw new Error("Use --changed inside a git repository.");
|
|
198
|
+
}
|
|
199
|
+
const contentDirAbs = path.resolve(rootDir, contentDir);
|
|
200
|
+
const relativeContentDir = normalizeGitRelativePath(path.relative(gitRoot, contentDirAbs));
|
|
201
|
+
if (relativeContentDir.startsWith("../")) throw new Error("Configured contentDir must live inside the current git repository for --changed.");
|
|
202
|
+
const pathspec = relativeContentDir || ".";
|
|
203
|
+
const changedFiles = /* @__PURE__ */ new Set();
|
|
204
|
+
const commands = [
|
|
205
|
+
[
|
|
206
|
+
"diff",
|
|
207
|
+
"--name-only",
|
|
208
|
+
"--",
|
|
209
|
+
pathspec
|
|
210
|
+
],
|
|
211
|
+
[
|
|
212
|
+
"diff",
|
|
213
|
+
"--name-only",
|
|
214
|
+
"--cached",
|
|
215
|
+
"--",
|
|
216
|
+
pathspec
|
|
217
|
+
],
|
|
218
|
+
[
|
|
219
|
+
"ls-files",
|
|
220
|
+
"--others",
|
|
221
|
+
"--exclude-standard",
|
|
222
|
+
"--",
|
|
223
|
+
pathspec
|
|
224
|
+
]
|
|
225
|
+
];
|
|
226
|
+
for (const args of commands) {
|
|
227
|
+
const output = runGitCommand(gitRoot, args);
|
|
228
|
+
if (!output) continue;
|
|
229
|
+
for (const line of output.split("\n")) {
|
|
230
|
+
const normalized = normalizeGitRelativePath(line.trim());
|
|
231
|
+
if (!normalized) continue;
|
|
232
|
+
const absolutePath = path.resolve(gitRoot, normalized);
|
|
233
|
+
const relativeToRoot = normalizeGitRelativePath(path.relative(rootDir, absolutePath));
|
|
234
|
+
if (relativeToRoot && !relativeToRoot.startsWith("../")) changedFiles.add(relativeToRoot);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
return changedFiles;
|
|
238
|
+
}
|
|
178
239
|
function resolveCompressionApiKey(explicitApiKey, explicitApiKeyEnv) {
|
|
179
240
|
const candidateKeys = [
|
|
180
241
|
explicitApiKeyEnv,
|
|
@@ -261,6 +322,13 @@ function readCurrentAgentDocument(target) {
|
|
|
261
322
|
if (!target.hasAgentFile || !existsSync(target.agentPath)) return void 0;
|
|
262
323
|
return parseGeneratedAgentDocument(readFileSync(target.agentPath, "utf-8"));
|
|
263
324
|
}
|
|
325
|
+
function shouldCompactChangedAgentFile(target) {
|
|
326
|
+
const currentDocument = readCurrentAgentDocument(target);
|
|
327
|
+
if (!currentDocument) return false;
|
|
328
|
+
if (!currentDocument.provenance) return true;
|
|
329
|
+
if (currentDocument.provenance.sourceKind !== "agent-md") return false;
|
|
330
|
+
return hashGeneratedAgentContent(currentDocument.content) !== currentDocument.provenance.outputHash;
|
|
331
|
+
}
|
|
264
332
|
function resolveSourceKindForCompaction(target, currentDocument) {
|
|
265
333
|
if (!target.hasAgentFile) return "resolved-page";
|
|
266
334
|
if (currentDocument?.provenance?.sourceKind === "resolved-page") return "resolved-page";
|
|
@@ -397,6 +465,15 @@ function resolveSelectedPages(pages, targets, entry, requested, includeAll) {
|
|
|
397
465
|
}
|
|
398
466
|
return resolved;
|
|
399
467
|
}
|
|
468
|
+
function filterChangedPages(rootDir, contentDir, selectedPages) {
|
|
469
|
+
const changedFiles = listGitChangedFiles(rootDir, contentDir);
|
|
470
|
+
return selectedPages.filter(({ target }) => {
|
|
471
|
+
const relativePagePath = normalizeGitRelativePath(path.relative(rootDir, target.pagePath));
|
|
472
|
+
if (changedFiles.has(relativePagePath)) return true;
|
|
473
|
+
const relativeAgentPath = normalizeGitRelativePath(path.relative(rootDir, target.agentPath));
|
|
474
|
+
return changedFiles.has(relativeAgentPath) && shouldCompactChangedAgentFile(target);
|
|
475
|
+
});
|
|
476
|
+
}
|
|
400
477
|
async function compactAgentDocs(options = {}) {
|
|
401
478
|
const rootDir = process.cwd();
|
|
402
479
|
const loadedEnv = loadProjectEnv(rootDir);
|
|
@@ -410,7 +487,7 @@ async function compactAgentDocs(options = {}) {
|
|
|
410
487
|
if (resolvedOptions.all && resolvedOptions.pages && resolvedOptions.pages.length > 0) throw new Error("Use either --all or specific page arguments, not both.");
|
|
411
488
|
if (resolvedOptions.includeMissing && !resolvedOptions.stale) throw new Error("Use --include-missing together with --stale.");
|
|
412
489
|
const requestedPages = resolvedOptions.pages?.filter((value) => value.trim().length > 0) ?? [];
|
|
413
|
-
if (!resolvedOptions.all && requestedPages.length === 0 && !resolvedOptions.stale) throw new Error("Pass --all, --stale, or at least one docs page slug/path to compact.");
|
|
490
|
+
if (!resolvedOptions.all && requestedPages.length === 0 && !resolvedOptions.stale && !resolvedOptions.changed) throw new Error("Pass --all, --changed, --stale, or at least one docs page slug/path to compact.");
|
|
414
491
|
const pages = await createFilesystemDocsMcpSource({
|
|
415
492
|
rootDir,
|
|
416
493
|
entry,
|
|
@@ -418,8 +495,15 @@ async function compactAgentDocs(options = {}) {
|
|
|
418
495
|
siteTitle
|
|
419
496
|
}).getPages();
|
|
420
497
|
if (pages.length === 0) throw new Error(`No docs content was found under ${contentDir}.`);
|
|
421
|
-
const selectedPages = resolveSelectedPages(pages, scanDocsPageTargets(rootDir, contentDir, entry), entry, requestedPages, resolvedOptions.all === true || resolvedOptions.stale === true && requestedPages.length === 0);
|
|
422
|
-
|
|
498
|
+
const selectedPages = resolveSelectedPages(pages, scanDocsPageTargets(rootDir, contentDir, entry), entry, requestedPages, resolvedOptions.all === true || resolvedOptions.stale === true && requestedPages.length === 0 || resolvedOptions.changed === true && requestedPages.length === 0);
|
|
499
|
+
const filteredPages = resolvedOptions.changed ? filterChangedPages(rootDir, contentDir, selectedPages) : selectedPages;
|
|
500
|
+
if (filteredPages.length === 0) {
|
|
501
|
+
if (resolvedOptions.changed) {
|
|
502
|
+
console.log(pc.green("No changed docs pages needed compaction."));
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
throw new Error("No compactable docs pages matched the request.");
|
|
506
|
+
}
|
|
423
507
|
let created = 0;
|
|
424
508
|
let overwritten = 0;
|
|
425
509
|
let processed = 0;
|
|
@@ -428,7 +512,7 @@ async function compactAgentDocs(options = {}) {
|
|
|
428
512
|
let skippedUnknown = 0;
|
|
429
513
|
let skippedMissing = 0;
|
|
430
514
|
const requestedExplicitPages = requestedPages.length > 0;
|
|
431
|
-
for (const { page, target } of
|
|
515
|
+
for (const { page, target } of filteredPages) {
|
|
432
516
|
const state = inspectAgentCompactionState(page, target, resolvedOptions);
|
|
433
517
|
if (resolvedOptions.stale) {
|
|
434
518
|
if (state.status === "fresh") {
|
|
@@ -461,7 +545,7 @@ async function compactAgentDocs(options = {}) {
|
|
|
461
545
|
else created += 1;
|
|
462
546
|
processed += 1;
|
|
463
547
|
}
|
|
464
|
-
if (resolvedOptions.dryRun) processed =
|
|
548
|
+
if (resolvedOptions.dryRun) processed = filteredPages.length - skippedFresh - skippedModified - skippedUnknown - skippedMissing;
|
|
465
549
|
if (resolvedOptions.stale && processed === 0) {
|
|
466
550
|
console.log(pc.green("No stale generated agent.md files needed updates."));
|
|
467
551
|
if (skippedFresh + skippedModified + skippedUnknown + skippedMissing > 0) console.log(pc.dim(`Skipped ${skippedFresh} fresh, ${skippedModified} modified, ${skippedUnknown} unknown, and ${skippedMissing} missing page${skippedFresh + skippedModified + skippedUnknown + skippedMissing === 1 ? "" : "s"}.`));
|
|
@@ -483,6 +567,7 @@ ${pc.dim("Examples:")}
|
|
|
483
567
|
${pc.cyan("npx @farming-labs/docs@latest agent compact /docs/installation")}
|
|
484
568
|
${pc.cyan("npx @farming-labs/docs@latest agent compact --page installation --page configuration")}
|
|
485
569
|
${pc.cyan("npx @farming-labs/docs@latest agent compact --all")}
|
|
570
|
+
${pc.cyan("npx @farming-labs/docs@latest agent compact --changed")}
|
|
486
571
|
${pc.cyan("npx @farming-labs/docs@latest agent compact --stale")}
|
|
487
572
|
${pc.cyan("npx @farming-labs/docs@latest agent compact --stale --include-missing")}
|
|
488
573
|
|
|
@@ -492,6 +577,7 @@ ${pc.dim("Per-page override:")}
|
|
|
492
577
|
${pc.dim("Options:")}
|
|
493
578
|
${pc.cyan("--all")} Compact every folder-based docs page under the configured contentDir
|
|
494
579
|
${pc.cyan("--page <slug|path>")} Add a page explicitly (repeatable); positional page args work too
|
|
580
|
+
${pc.cyan("--changed")} Compact only docs pages changed in the current git working tree
|
|
495
581
|
${pc.cyan("--stale")} Re-compact only stale generated agent.md files
|
|
496
582
|
${pc.cyan("--include-missing")} With ${pc.cyan("--stale")}, also create missing agent.md files for explicit pages or pages that define ${pc.cyan("agent.tokenBudget")}
|
|
497
583
|
${pc.cyan("--config <path>")} Use a custom docs config path instead of ${pc.dim("docs.config.ts[x]")}
|
|
@@ -308,6 +308,61 @@ function resolveReadingTimeFromSource(source, wordsPerMinute) {
|
|
|
308
308
|
return resolveReadingTimeFromContent(data, content, wordsPerMinute);
|
|
309
309
|
}
|
|
310
310
|
|
|
311
|
+
//#endregion
|
|
312
|
+
//#region src/sidebar.ts
|
|
313
|
+
function normalizeSidebarFolderBehaviorPath(path) {
|
|
314
|
+
if (!path) return void 0;
|
|
315
|
+
let value = path.trim();
|
|
316
|
+
if (!value) return void 0;
|
|
317
|
+
if (/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(value)) try {
|
|
318
|
+
value = new URL(value).pathname;
|
|
319
|
+
} catch {
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
else value = value.split("#", 1)[0]?.split("?", 1)[0] ?? value;
|
|
323
|
+
if (!value.startsWith("/")) value = `/${value}`;
|
|
324
|
+
return value.replace(/\/$/, "") || "/";
|
|
325
|
+
}
|
|
326
|
+
function resolveSidebarFolderIndexBehavior(sidebar, defaultBehavior = "link") {
|
|
327
|
+
if (sidebar === void 0 || sidebar === true || sidebar === false) return defaultBehavior;
|
|
328
|
+
if (sidebar.folderIndexBehavior === "toggle") return "toggle";
|
|
329
|
+
if (sidebar.folderIndexBehavior === "link") return "link";
|
|
330
|
+
return defaultBehavior;
|
|
331
|
+
}
|
|
332
|
+
function resolveSidebarFolderIndexBehaviorForPath(sidebar, folderPath, defaultBehavior = "link") {
|
|
333
|
+
const fallback = resolveSidebarFolderIndexBehavior(sidebar, defaultBehavior);
|
|
334
|
+
if (!sidebar || typeof sidebar !== "object") return fallback;
|
|
335
|
+
const normalizedPath = normalizeSidebarFolderBehaviorPath(folderPath);
|
|
336
|
+
if (!normalizedPath) return fallback;
|
|
337
|
+
for (const [rawPath, override] of Object.entries(sidebar.folderIndexBehaviorOverrides ?? {})) if (normalizeSidebarFolderBehaviorPath(rawPath) === normalizedPath) return override === "link" || override === "toggle" ? override : fallback;
|
|
338
|
+
return fallback;
|
|
339
|
+
}
|
|
340
|
+
function applySidebarFolderIndexBehavior(tree, behaviorOrOptions) {
|
|
341
|
+
const resolveBehavior = typeof behaviorOrOptions === "string" ? () => behaviorOrOptions : (folderPath) => resolveSidebarFolderIndexBehaviorForPath(behaviorOrOptions.sidebar, folderPath, behaviorOrOptions.defaultBehavior);
|
|
342
|
+
function mapNode(node) {
|
|
343
|
+
if (!node || typeof node !== "object") return node;
|
|
344
|
+
const candidate = node;
|
|
345
|
+
if (candidate.type !== "folder" || !Array.isArray(candidate.children)) return node;
|
|
346
|
+
const children = candidate.children.map(mapNode);
|
|
347
|
+
const index = candidate.index ? mapNode(candidate.index) : void 0;
|
|
348
|
+
if (resolveBehavior((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)) !== "toggle") return {
|
|
349
|
+
...candidate,
|
|
350
|
+
index,
|
|
351
|
+
children
|
|
352
|
+
};
|
|
353
|
+
return {
|
|
354
|
+
...candidate,
|
|
355
|
+
index: void 0,
|
|
356
|
+
url: void 0,
|
|
357
|
+
children: index ? [index, ...children] : children
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
return {
|
|
361
|
+
...tree,
|
|
362
|
+
children: tree.children.map(mapNode)
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
|
|
311
366
|
//#endregion
|
|
312
367
|
//#region src/agent.ts
|
|
313
368
|
const DEFAULT_DOCS_API_ROUTE = "/api/docs";
|
|
@@ -627,4 +682,4 @@ function toYamlString(value) {
|
|
|
627
682
|
}
|
|
628
683
|
|
|
629
684
|
//#endregion
|
|
630
|
-
export {
|
|
685
|
+
export { resolveSidebarFolderIndexBehavior as A, resolveTitle as B, renderDocsMarkdownDocument as C, resolveDocsMarkdownRequest as D, resolveDocsLlmsTxtFormat as E, resolveReadingTimeFromSource as F, extendTheme as G, resolveDocsLocale as H, resolveReadingTimeOptions as I, defineDocs as J, deepMerge as K, buildPageOpenGraph as L, estimateReadingTimeMinutes as M, resolvePageReadingTime as N, resolveDocsSkillFormat as O, resolveReadingTimeFromContent as P, buildPageTwitter as R, normalizeDocsUrlPath as S, resolveDocsAgentMdxContent as T, resolveDocsPath as U, resolveDocsI18n as V, createTheme as W, isDocsAgentDiscoveryRequest as _, DEFAULT_DOCS_API_ROUTE as a, isDocsSkillRequest as b, DEFAULT_LLMS_TXT_ROUTE as c, DEFAULT_MCP_ROUTE as d, DEFAULT_MCP_WELL_KNOWN_ROUTE as f, findDocsMarkdownPage as g, buildDocsAgentDiscoverySpec as h, DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE as i, resolveSidebarFolderIndexBehaviorForPath as j, applySidebarFolderIndexBehavior as k, DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE as l, DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE as m, DEFAULT_AGENT_SPEC_ROUTE as n, DEFAULT_LLMS_FULL_TXT_ROUTE as o, DEFAULT_SKILL_MD_ROUTE as p, resolveChangelogConfig as q, DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE as r, DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE as s, DEFAULT_AGENT_FEEDBACK_ROUTE as t, DEFAULT_MCP_PUBLIC_ROUTE as u, isDocsMcpRequest as v, renderDocsSkillDocument as w, normalizeDocsPathSegment as x, isDocsPublicGetRequest as y, resolveOGImage as z };
|
package/dist/cli/index.mjs
CHANGED
|
@@ -75,7 +75,7 @@ async function main() {
|
|
|
75
75
|
const { runMcp } = await import("../mcp-C-TmMrdw.mjs");
|
|
76
76
|
await runMcp(mcpOptions);
|
|
77
77
|
} else if (parsedCommand.command === "agent" && subcommand === "compact") {
|
|
78
|
-
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent-
|
|
78
|
+
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent-DBaFbcEF.mjs");
|
|
79
79
|
const agentCompactOptions = parseAgentCompactArgs(args.slice(2));
|
|
80
80
|
if (agentCompactOptions.help) {
|
|
81
81
|
printAgentCompactHelp();
|
|
@@ -85,11 +85,11 @@ async function main() {
|
|
|
85
85
|
} else if (parsedCommand.command === "agent") {
|
|
86
86
|
console.error(pc.red(`Unknown agent subcommand: ${subcommand ?? "(missing)"}`));
|
|
87
87
|
console.error();
|
|
88
|
-
const { printAgentCompactHelp } = await import("../agent-
|
|
88
|
+
const { printAgentCompactHelp } = await import("../agent-DBaFbcEF.mjs");
|
|
89
89
|
printAgentCompactHelp();
|
|
90
90
|
process.exit(1);
|
|
91
91
|
} else if (parsedCommand.command === "doctor") {
|
|
92
|
-
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-
|
|
92
|
+
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-CWUYMwIQ.mjs");
|
|
93
93
|
const doctorOptions = parseDoctorArgs(args.slice(1));
|
|
94
94
|
if (doctorOptions.help) {
|
|
95
95
|
printDoctorHelp();
|
|
@@ -152,6 +152,7 @@ ${pc.dim("Options for mcp:")}
|
|
|
152
152
|
${pc.dim("Options for agent compact:")}
|
|
153
153
|
${pc.cyan("agent compact <page...>")} Compact pages and write sibling ${pc.dim("agent.md")} files
|
|
154
154
|
${pc.cyan("agent compact --all")} Compact every folder-based docs page
|
|
155
|
+
${pc.cyan("agent compact --changed")} Compact only docs pages changed in the current git working tree
|
|
155
156
|
${pc.cyan("agent compact --stale")} Refresh only stale generated ${pc.dim("agent.md")} files
|
|
156
157
|
${pc.cyan("--page <slug|path>")} Repeatable explicit page flag; positional page args work too
|
|
157
158
|
${pc.cyan("--include-missing")} With ${pc.cyan("--stale")}, also create explicit or token-budget pages missing ${pc.dim("agent.md")}
|
|
@@ -1,9 +1,9 @@
|
|
|
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-WrorbwIf.mjs";
|
|
2
2
|
import "./api-reference-GDAEzQn1.mjs";
|
|
3
3
|
import { createFilesystemDocsMcpSource, resolveDocsMcpConfig } from "./mcp.mjs";
|
|
4
4
|
import "./server.mjs";
|
|
5
5
|
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";
|
|
6
|
-
import { inspectAgentCompactionState, scanDocsPageTargets } from "./agent-
|
|
6
|
+
import { inspectAgentCompactionState, scanDocsPageTargets } from "./agent-DBaFbcEF.mjs";
|
|
7
7
|
import { t as detectFramework } from "./utils-CpTFbAiS.mjs";
|
|
8
8
|
import { existsSync, lstatSync, readFileSync, readdirSync } from "node:fs";
|
|
9
9
|
import path from "node:path";
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as SidebarConfig, A as DocsSearchQuery, B as McpDocsSearchConfig, C as DocsSearchAdapter, D as DocsSearchConfig, E as DocsSearchChunkingConfig, F as FeedbackConfig, G as OrderingItem, H as OpenDocsConfig, I as FontStyle, J as PageOpenGraph, K as PageActionsConfig, L as GithubConfig, M as DocsSearchResultType, N as DocsSearchSourcePage, O as DocsSearchDocument, P as DocsTheme, Q as SidebarComponentProps, R as LastUpdatedConfig, S as DocsRelatedItem, T as DocsSearchAdapterFactory, U as OpenDocsProvider, V as OGConfig, W as OpenGraphImage, X as ReadingTimeConfig, Y as PageTwitter, Z as ResolvedDocsRelatedLink, _ as DocsI18nConfig, a as ApiReferenceRenderer, at as
|
|
1
|
+
import { $ as SidebarConfig, A as DocsSearchQuery, B as McpDocsSearchConfig, C as DocsSearchAdapter, D as DocsSearchConfig, E as DocsSearchChunkingConfig, F as FeedbackConfig, G as OrderingItem, H as OpenDocsConfig, I as FontStyle, J as PageOpenGraph, K as PageActionsConfig, L as GithubConfig, M as DocsSearchResultType, N as DocsSearchSourcePage, O as DocsSearchDocument, P as DocsTheme, Q as SidebarComponentProps, R as LastUpdatedConfig, S as DocsRelatedItem, T as DocsSearchAdapterFactory, U as OpenDocsProvider, V as OGConfig, W as OpenGraphImage, X as ReadingTimeConfig, Y as PageTwitter, Z as ResolvedDocsRelatedLink, _ as DocsI18nConfig, a as ApiReferenceRenderer, at as SimpleDocsSearchConfig, b as DocsMetadata, c as ChangelogFrontmatter, ct as TypographyConfig, d as CustomDocsSearchConfig, et as SidebarFolderIndexBehavior, f as DocsAgentFeedbackContext, g as DocsFeedbackValue, h as DocsFeedbackData, i as ApiReferenceConfig, it as SidebarTree, j as DocsSearchResult, k as DocsSearchEmbeddingsConfig, l as CodeBlockCopyData, lt as UIConfig, m as DocsConfig, n as AgentFeedbackConfig, nt as SidebarNode, o as BreadcrumbConfig, ot as ThemeToggleConfig, p as DocsAgentFeedbackData, q as PageFrontmatter, r as AlgoliaDocsSearchConfig, rt as SidebarPageNode, s as ChangelogConfig, st as TypesenseDocsSearchConfig, t as AIConfig, tt as SidebarFolderNode, u as CopyMarkdownConfig, v as DocsMcpConfig, w as DocsSearchAdapterContext, x as DocsNav, y as DocsMcpToolsConfig, z as LlmsTxtConfig } from "./types-bOtKcSW8.mjs";
|
|
2
2
|
import { DocsMcpPage, DocsMcpResolvedConfig } from "./mcp.mjs";
|
|
3
|
-
import { a as createSimpleSearchAdapter, c as resolveSearchRequestConfig, i as createMcpSearchAdapter, n as createAlgoliaSearchAdapter, o as createTypesenseSearchAdapter, r as createCustomSearchAdapter, s as performDocsSearch, t as buildDocsSearchDocuments } from "./search-
|
|
3
|
+
import { a as createSimpleSearchAdapter, c as resolveSearchRequestConfig, i as createMcpSearchAdapter, n as createAlgoliaSearchAdapter, o as createTypesenseSearchAdapter, r as createCustomSearchAdapter, s as performDocsSearch, t as buildDocsSearchDocuments } from "./search-MhRnNSQX.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/define-docs.d.ts
|
|
6
6
|
/**
|
|
@@ -134,6 +134,17 @@ declare function resolveReadingTimeFromSource(source: string, wordsPerMinute?: n
|
|
|
134
134
|
declare function normalizeDocsRelated(value: unknown): ResolvedDocsRelatedLink[];
|
|
135
135
|
declare function renderDocsRelatedMarkdownLines(related: ResolvedDocsRelatedLink[] | undefined): string[];
|
|
136
136
|
//#endregion
|
|
137
|
+
//#region src/sidebar.d.ts
|
|
138
|
+
interface SidebarFolderIndexBehaviorOptions {
|
|
139
|
+
sidebar: boolean | SidebarConfig | undefined;
|
|
140
|
+
defaultBehavior?: SidebarFolderIndexBehavior;
|
|
141
|
+
}
|
|
142
|
+
declare function resolveSidebarFolderIndexBehavior(sidebar: boolean | SidebarConfig | undefined, defaultBehavior?: SidebarFolderIndexBehavior): SidebarFolderIndexBehavior;
|
|
143
|
+
declare function resolveSidebarFolderIndexBehaviorForPath(sidebar: boolean | SidebarConfig | undefined, folderPath: string | undefined, defaultBehavior?: SidebarFolderIndexBehavior): SidebarFolderIndexBehavior;
|
|
144
|
+
declare function applySidebarFolderIndexBehavior<TTree extends {
|
|
145
|
+
children: unknown[];
|
|
146
|
+
}>(tree: TTree, behaviorOrOptions: SidebarFolderIndexBehavior | SidebarFolderIndexBehaviorOptions): TTree;
|
|
147
|
+
//#endregion
|
|
137
148
|
//#region src/agent-provenance.d.ts
|
|
138
149
|
declare const GENERATED_AGENT_PROVENANCE_MARKER = "@farming-labs/docs:generated";
|
|
139
150
|
declare const GENERATED_AGENT_PROVENANCE_VERSION = 1;
|
|
@@ -360,4 +371,4 @@ declare function buildDocsAgentDiscoverySpec({
|
|
|
360
371
|
};
|
|
361
372
|
};
|
|
362
373
|
//#endregion
|
|
363
|
-
export { type AIConfig, type AgentFeedbackConfig, type AlgoliaDocsSearchConfig, type ApiReferenceConfig, type ApiReferenceRenderer, type BreadcrumbConfig, type ChangelogConfig, type ChangelogEntrySummary, type ChangelogFrontmatter, type CodeBlockCopyData, type CopyMarkdownConfig, type CustomDocsSearchConfig, 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, type DocsAgentDiscoverySpecOptions, type DocsAgentFeedbackContext, type DocsAgentFeedbackData, type DocsAgentFeedbackDiscoveryConfig, type DocsConfig, type DocsFeedbackData, type DocsFeedbackValue, type DocsI18nConfig, type DocsLlmsDiscoveryConfig, type DocsMarkdownPage, type DocsMcpConfig, type DocsMcpToolsConfig, type DocsMetadata, type DocsNav, type DocsPathMatch, type DocsRelatedItem, type DocsSearchAdapter, type DocsSearchAdapterContext, type DocsSearchAdapterFactory, type DocsSearchChunkingConfig, type DocsSearchConfig, type DocsSearchDocument, type DocsSearchEmbeddingsConfig, type DocsSearchQuery, type DocsSearchResult, type DocsSearchResultType, type DocsSearchSourcePage, type DocsSkillDocumentOptions, type DocsTheme, type FeedbackConfig, type FontStyle, GENERATED_AGENT_PROVENANCE_MARKER, GENERATED_AGENT_PROVENANCE_VERSION, type GeneratedAgentProvenance, type GeneratedAgentSourceKind, type GithubConfig, type LastUpdatedConfig, type LlmsTxtConfig, type McpDocsSearchConfig, type OGConfig, type OpenDocsConfig, type OpenDocsProvider, type OpenGraphImage, type OrderingItem, type PageActionsConfig, type PageFrontmatter, type PageOpenGraph, type PageTwitter, type ReadingTimeConfig, type ResolvedChangelogConfig, type ResolvedDocsI18n, type ResolvedDocsRelatedLink, type SidebarComponentProps, type SidebarConfig, type SidebarFolderNode, type SidebarNode, type SidebarPageNode, type SidebarTree, type SimpleDocsSearchConfig, type ThemeToggleConfig, type TypesenseDocsSearchConfig, type TypographyConfig, type UIConfig, buildDocsAgentDiscoverySpec, buildDocsSearchDocuments, buildPageOpenGraph, buildPageTwitter, createAlgoliaSearchAdapter, createCustomSearchAdapter, createMcpSearchAdapter, createSimpleSearchAdapter, createTheme, createTypesenseSearchAdapter, deepMerge, defineDocs, estimateReadingTimeMinutes, extendTheme, findDocsMarkdownPage, hashGeneratedAgentContent, isDocsAgentDiscoveryRequest, isDocsMcpRequest, isDocsPublicGetRequest, isDocsSkillRequest, normalizeDocsPathSegment, normalizeDocsRelated, normalizeDocsUrlPath, normalizeGeneratedAgentContent, parseGeneratedAgentDocument, performDocsSearch, renderDocsMarkdownDocument, renderDocsRelatedMarkdownLines, renderDocsSkillDocument, resolveChangelogConfig, resolveDocsAgentMdxContent, resolveDocsI18n, resolveDocsLlmsTxtFormat, resolveDocsLocale, resolveDocsMarkdownRequest, resolveDocsPath, resolveDocsSkillFormat, resolveOGImage, resolvePageReadingTime, resolveReadingTimeFromContent, resolveReadingTimeFromSource, resolveReadingTimeOptions, resolveSearchRequestConfig, resolveTitle, serializeGeneratedAgentDocument, stripGeneratedAgentProvenance };
|
|
374
|
+
export { type AIConfig, type AgentFeedbackConfig, type AlgoliaDocsSearchConfig, type ApiReferenceConfig, type ApiReferenceRenderer, type BreadcrumbConfig, type ChangelogConfig, type ChangelogEntrySummary, type ChangelogFrontmatter, type CodeBlockCopyData, type CopyMarkdownConfig, type CustomDocsSearchConfig, 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, type DocsAgentDiscoverySpecOptions, type DocsAgentFeedbackContext, type DocsAgentFeedbackData, type DocsAgentFeedbackDiscoveryConfig, type DocsConfig, type DocsFeedbackData, type DocsFeedbackValue, type DocsI18nConfig, type DocsLlmsDiscoveryConfig, type DocsMarkdownPage, type DocsMcpConfig, type DocsMcpToolsConfig, type DocsMetadata, type DocsNav, type DocsPathMatch, type DocsRelatedItem, type DocsSearchAdapter, type DocsSearchAdapterContext, type DocsSearchAdapterFactory, type DocsSearchChunkingConfig, type DocsSearchConfig, type DocsSearchDocument, type DocsSearchEmbeddingsConfig, type DocsSearchQuery, type DocsSearchResult, type DocsSearchResultType, type DocsSearchSourcePage, type DocsSkillDocumentOptions, type DocsTheme, type FeedbackConfig, type FontStyle, GENERATED_AGENT_PROVENANCE_MARKER, GENERATED_AGENT_PROVENANCE_VERSION, type GeneratedAgentProvenance, type GeneratedAgentSourceKind, type GithubConfig, type LastUpdatedConfig, type LlmsTxtConfig, type McpDocsSearchConfig, type OGConfig, type OpenDocsConfig, type OpenDocsProvider, type OpenGraphImage, type OrderingItem, type PageActionsConfig, type PageFrontmatter, type PageOpenGraph, type PageTwitter, type ReadingTimeConfig, type ResolvedChangelogConfig, type ResolvedDocsI18n, type ResolvedDocsRelatedLink, type SidebarComponentProps, type SidebarConfig, type SidebarFolderIndexBehavior, type SidebarFolderNode, type SidebarNode, type SidebarPageNode, type SidebarTree, type SimpleDocsSearchConfig, type ThemeToggleConfig, type TypesenseDocsSearchConfig, type TypographyConfig, type UIConfig, applySidebarFolderIndexBehavior, buildDocsAgentDiscoverySpec, buildDocsSearchDocuments, buildPageOpenGraph, buildPageTwitter, createAlgoliaSearchAdapter, createCustomSearchAdapter, createMcpSearchAdapter, createSimpleSearchAdapter, createTheme, createTypesenseSearchAdapter, deepMerge, defineDocs, estimateReadingTimeMinutes, extendTheme, findDocsMarkdownPage, hashGeneratedAgentContent, isDocsAgentDiscoveryRequest, isDocsMcpRequest, isDocsPublicGetRequest, isDocsSkillRequest, normalizeDocsPathSegment, normalizeDocsRelated, normalizeDocsUrlPath, normalizeGeneratedAgentContent, parseGeneratedAgentDocument, performDocsSearch, renderDocsMarkdownDocument, renderDocsRelatedMarkdownLines, renderDocsSkillDocument, resolveChangelogConfig, resolveDocsAgentMdxContent, resolveDocsI18n, resolveDocsLlmsTxtFormat, resolveDocsLocale, resolveDocsMarkdownRequest, resolveDocsPath, resolveDocsSkillFormat, resolveOGImage, resolvePageReadingTime, resolveReadingTimeFromContent, resolveReadingTimeFromSource, resolveReadingTimeOptions, resolveSearchRequestConfig, resolveSidebarFolderIndexBehavior, resolveSidebarFolderIndexBehaviorForPath, resolveTitle, serializeGeneratedAgentDocument, stripGeneratedAgentProvenance };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as resolveSidebarFolderIndexBehavior, B as resolveTitle, C as renderDocsMarkdownDocument, D as resolveDocsMarkdownRequest, E as resolveDocsLlmsTxtFormat, F as resolveReadingTimeFromSource, G as extendTheme, H as resolveDocsLocale, I as resolveReadingTimeOptions, J as defineDocs, K as deepMerge, L as buildPageOpenGraph, M as estimateReadingTimeMinutes, N as resolvePageReadingTime, O as resolveDocsSkillFormat, P as resolveReadingTimeFromContent, R as buildPageTwitter, S as normalizeDocsUrlPath, T as resolveDocsAgentMdxContent, U as resolveDocsPath, V as resolveDocsI18n, W as createTheme, _ 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 resolveSidebarFolderIndexBehaviorForPath, 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 resolveChangelogConfig, 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 resolveOGImage } from "./agent-WrorbwIf.mjs";
|
|
2
2
|
import { _ as renderDocsRelatedMarkdownLines, a as createSimpleSearchAdapter, 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 } from "./search-Cu_pxL8o.mjs";
|
|
3
3
|
|
|
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, buildDocsAgentDiscoverySpec, buildDocsSearchDocuments, buildPageOpenGraph, buildPageTwitter, createAlgoliaSearchAdapter, createCustomSearchAdapter, createMcpSearchAdapter, createSimpleSearchAdapter, createTheme, createTypesenseSearchAdapter, deepMerge, defineDocs, estimateReadingTimeMinutes, extendTheme, findDocsMarkdownPage, hashGeneratedAgentContent, isDocsAgentDiscoveryRequest, isDocsMcpRequest, isDocsPublicGetRequest, isDocsSkillRequest, normalizeDocsPathSegment, normalizeDocsRelated, normalizeDocsUrlPath, normalizeGeneratedAgentContent, parseGeneratedAgentDocument, performDocsSearch, renderDocsMarkdownDocument, renderDocsRelatedMarkdownLines, renderDocsSkillDocument, resolveChangelogConfig, resolveDocsAgentMdxContent, resolveDocsI18n, resolveDocsLlmsTxtFormat, resolveDocsLocale, resolveDocsMarkdownRequest, resolveDocsPath, resolveDocsSkillFormat, resolveOGImage, resolvePageReadingTime, resolveReadingTimeFromContent, resolveReadingTimeFromSource, resolveReadingTimeOptions, resolveSearchRequestConfig, resolveTitle, serializeGeneratedAgentDocument, stripGeneratedAgentProvenance };
|
|
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, createMcpSearchAdapter, createSimpleSearchAdapter, createTheme, createTypesenseSearchAdapter, deepMerge, defineDocs, estimateReadingTimeMinutes, extendTheme, findDocsMarkdownPage, hashGeneratedAgentContent, isDocsAgentDiscoveryRequest, isDocsMcpRequest, isDocsPublicGetRequest, isDocsSkillRequest, normalizeDocsPathSegment, normalizeDocsRelated, normalizeDocsUrlPath, normalizeGeneratedAgentContent, parseGeneratedAgentDocument, performDocsSearch, renderDocsMarkdownDocument, renderDocsRelatedMarkdownLines, renderDocsSkillDocument, resolveChangelogConfig, resolveDocsAgentMdxContent, resolveDocsI18n, resolveDocsLlmsTxtFormat, resolveDocsLocale, resolveDocsMarkdownRequest, resolveDocsPath, resolveDocsSkillFormat, resolveOGImage, resolvePageReadingTime, resolveReadingTimeFromContent, resolveReadingTimeFromSource, resolveReadingTimeOptions, resolveSearchRequestConfig, resolveSidebarFolderIndexBehavior, resolveSidebarFolderIndexBehaviorForPath, resolveTitle, serializeGeneratedAgentDocument, stripGeneratedAgentProvenance };
|
package/dist/mcp.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DocsSearchConfig, G as OrderingItem, N as DocsSearchSourcePage, v as DocsMcpConfig } from "./types-
|
|
1
|
+
import { D as DocsSearchConfig, G as OrderingItem, N as DocsSearchSourcePage, v as DocsMcpConfig } from "./types-bOtKcSW8.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 { B as McpDocsSearchConfig, C as DocsSearchAdapter, D as DocsSearchConfig, E as DocsSearchChunkingConfig, N as DocsSearchSourcePage, O as DocsSearchDocument, T as DocsSearchAdapterFactory, d as CustomDocsSearchConfig, j as DocsSearchResult,
|
|
1
|
+
import { B as McpDocsSearchConfig, C as DocsSearchAdapter, D as DocsSearchConfig, E as DocsSearchChunkingConfig, N as DocsSearchSourcePage, O as DocsSearchDocument, T as DocsSearchAdapterFactory, d as CustomDocsSearchConfig, j as DocsSearchResult, r as AlgoliaDocsSearchConfig, st as TypesenseDocsSearchConfig } from "./types-bOtKcSW8.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/search.d.ts
|
|
4
4
|
declare function buildDocsSearchDocuments(pages: DocsSearchSourcePage[], chunking?: DocsSearchChunkingConfig): DocsSearchDocument[];
|
package/dist/server.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as DocsSearchQuery, B as McpDocsSearchConfig, C as DocsSearchAdapter, D as DocsSearchConfig, N as DocsSearchSourcePage, O as DocsSearchDocument, T as DocsSearchAdapterFactory, a as ApiReferenceRenderer, j as DocsSearchResult, m as DocsConfig, w as DocsSearchAdapterContext } from "./types-
|
|
1
|
+
import { A as DocsSearchQuery, B as McpDocsSearchConfig, C as DocsSearchAdapter, D as DocsSearchConfig, N as DocsSearchSourcePage, O as DocsSearchDocument, T as DocsSearchAdapterFactory, a as ApiReferenceRenderer, j as DocsSearchResult, m as DocsConfig, w as DocsSearchAdapterContext } from "./types-bOtKcSW8.mjs";
|
|
2
2
|
import { DocsMcpHttpHandlers, DocsMcpNavigationNode, DocsMcpNavigationTree, DocsMcpPage, DocsMcpResolvedConfig, DocsMcpSource, createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, normalizeDocsMcpRoute, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
3
|
-
import { a as createSimpleSearchAdapter, c as resolveSearchRequestConfig, i as createMcpSearchAdapter, n as createAlgoliaSearchAdapter, o as createTypesenseSearchAdapter, r as createCustomSearchAdapter, s as performDocsSearch, t as buildDocsSearchDocuments } from "./search-
|
|
3
|
+
import { a as createSimpleSearchAdapter, c as resolveSearchRequestConfig, i as createMcpSearchAdapter, n as createAlgoliaSearchAdapter, o as createTypesenseSearchAdapter, r as createCustomSearchAdapter, s as performDocsSearch, t as buildDocsSearchDocuments } from "./search-MhRnNSQX.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/api-reference.d.ts
|
|
6
6
|
type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD";
|
|
@@ -385,6 +385,15 @@ interface SidebarComponentProps {
|
|
|
385
385
|
/** Whether folders are rendered flat (Mintlify-style). */
|
|
386
386
|
flat: boolean;
|
|
387
387
|
}
|
|
388
|
+
/**
|
|
389
|
+
* Controls how folders with their own landing page behave in the default sidebar.
|
|
390
|
+
*
|
|
391
|
+
* - `"link"` — clicking the parent row navigates to the folder landing page
|
|
392
|
+
* - `"toggle"` — clicking the parent row only expands/collapses children, and the
|
|
393
|
+
* landing page is rendered as the first child item instead
|
|
394
|
+
*/
|
|
395
|
+
type SidebarFolderIndexBehavior = "link" | "toggle";
|
|
396
|
+
type SidebarFolderIndexBehaviorOverrides = Record<string, SidebarFolderIndexBehavior>;
|
|
388
397
|
interface SidebarConfig {
|
|
389
398
|
/**
|
|
390
399
|
* Whether to show the sidebar.
|
|
@@ -456,6 +465,31 @@ interface SidebarConfig {
|
|
|
456
465
|
* @default false
|
|
457
466
|
*/
|
|
458
467
|
flat?: boolean;
|
|
468
|
+
/**
|
|
469
|
+
* How folders with their own `page.mdx` / `page.md` behave in the default sidebar.
|
|
470
|
+
*
|
|
471
|
+
* - `"link"` — clicking the parent row navigates to the folder landing page
|
|
472
|
+
* - `"toggle"` — clicking the parent row only expands/collapses children, and the
|
|
473
|
+
* folder landing page appears as the first child item instead
|
|
474
|
+
*
|
|
475
|
+
* When omitted, each adapter keeps its existing folder-parent behavior. Set this
|
|
476
|
+
* explicitly if you want the same sidebar interaction across frameworks.
|
|
477
|
+
*/
|
|
478
|
+
folderIndexBehavior?: SidebarFolderIndexBehavior;
|
|
479
|
+
/**
|
|
480
|
+
* Selective per-folder overrides keyed by the folder landing-page URL.
|
|
481
|
+
*
|
|
482
|
+
* ```ts
|
|
483
|
+
* sidebar: {
|
|
484
|
+
* folderIndexBehavior: "link",
|
|
485
|
+
* folderIndexBehaviorOverrides: {
|
|
486
|
+
* "/docs/components": "toggle",
|
|
487
|
+
* "/docs/guides": "toggle",
|
|
488
|
+
* },
|
|
489
|
+
* }
|
|
490
|
+
* ```
|
|
491
|
+
*/
|
|
492
|
+
folderIndexBehaviorOverrides?: SidebarFolderIndexBehaviorOverrides;
|
|
459
493
|
}
|
|
460
494
|
/**
|
|
461
495
|
* A single "Open in …" provider shown in the Open dropdown.
|
|
@@ -1911,4 +1945,4 @@ interface DocsConfig {
|
|
|
1911
1945
|
og?: OGConfig;
|
|
1912
1946
|
}
|
|
1913
1947
|
//#endregion
|
|
1914
|
-
export { SidebarConfig as $, DocsSearchQuery as A, McpDocsSearchConfig as B, DocsSearchAdapter as C, DocsSearchConfig as D, DocsSearchChunkingConfig as E, FeedbackConfig as F, OrderingItem as G, OpenDocsConfig as H, FontStyle as I, PageOpenGraph as J, PageActionsConfig as K, GithubConfig as L, DocsSearchResultType as M, DocsSearchSourcePage as N, DocsSearchDocument as O, DocsTheme as P, SidebarComponentProps as Q, LastUpdatedConfig as R, DocsRelatedItem as S, DocsSearchAdapterFactory as T, OpenDocsProvider as U, OGConfig as V, OpenGraphImage as W, ReadingTimeConfig as X, PageTwitter as Y, ResolvedDocsRelatedLink as Z, DocsI18nConfig as _, ApiReferenceRenderer as a,
|
|
1948
|
+
export { SidebarConfig as $, DocsSearchQuery as A, McpDocsSearchConfig as B, DocsSearchAdapter as C, DocsSearchConfig as D, DocsSearchChunkingConfig as E, FeedbackConfig as F, OrderingItem as G, OpenDocsConfig as H, FontStyle as I, PageOpenGraph as J, PageActionsConfig as K, GithubConfig as L, DocsSearchResultType as M, DocsSearchSourcePage as N, DocsSearchDocument as O, DocsTheme as P, SidebarComponentProps as Q, LastUpdatedConfig as R, DocsRelatedItem as S, DocsSearchAdapterFactory as T, OpenDocsProvider as U, OGConfig as V, OpenGraphImage as W, ReadingTimeConfig as X, PageTwitter as Y, ResolvedDocsRelatedLink as Z, DocsI18nConfig as _, ApiReferenceRenderer as a, SimpleDocsSearchConfig as at, DocsMetadata as b, ChangelogFrontmatter as c, TypographyConfig as ct, CustomDocsSearchConfig as d, SidebarFolderIndexBehavior as et, DocsAgentFeedbackContext as f, DocsFeedbackValue as g, DocsFeedbackData as h, ApiReferenceConfig as i, SidebarTree as it, DocsSearchResult as j, DocsSearchEmbeddingsConfig as k, CodeBlockCopyData as l, UIConfig as lt, DocsConfig as m, AgentFeedbackConfig as n, SidebarNode as nt, BreadcrumbConfig as o, ThemeToggleConfig as ot, DocsAgentFeedbackData as p, PageFrontmatter as q, AlgoliaDocsSearchConfig as r, SidebarPageNode as rt, ChangelogConfig as s, TypesenseDocsSearchConfig as st, AIConfig as t, SidebarFolderNode as tt, CopyMarkdownConfig as u, DocsMcpConfig as v, DocsSearchAdapterContext as w, DocsNav as x, DocsMcpToolsConfig as y, LlmsTxtConfig as z };
|