@farming-labs/docs 0.1.54 → 0.1.57
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-Xh0UaY5I.mjs → agent-CCznWtjf.mjs} +64 -1
- package/dist/{agent-B-6iQbS2.mjs → agent-DBVNPqFU.mjs} +1 -1
- package/dist/cli/index.mjs +3 -3
- package/dist/{doctor-BiY_aSS1.mjs → doctor-k6ouCFXp.mjs} +2 -2
- package/dist/index.d.mts +15 -3
- package/dist/index.mjs +2 -2
- package/dist/mcp.d.mts +1 -1
- package/dist/{search-KMMtXPTi.d.mts → search-B6aum8AJ.d.mts} +1 -1
- package/dist/server.d.mts +2 -2
- package/dist/{types-Cl6WPIHa.d.mts → types-ClMUaY9I.d.mts} +61 -1
- package/package.json +1 -1
|
@@ -308,6 +308,69 @@ function resolveReadingTimeFromSource(source, wordsPerMinute) {
|
|
|
308
308
|
return resolveReadingTimeFromContent(data, content, wordsPerMinute);
|
|
309
309
|
}
|
|
310
310
|
|
|
311
|
+
//#endregion
|
|
312
|
+
//#region src/sidebar.ts
|
|
313
|
+
function resolvePageSidebarFolderIndexBehavior(sidebar) {
|
|
314
|
+
if (!sidebar || typeof sidebar !== "object") return void 0;
|
|
315
|
+
const value = sidebar.folderIndexBehavior;
|
|
316
|
+
return value === "link" || value === "toggle" ? value : void 0;
|
|
317
|
+
}
|
|
318
|
+
function normalizeSidebarFolderBehaviorPath(path) {
|
|
319
|
+
if (!path) return void 0;
|
|
320
|
+
let value = path.trim();
|
|
321
|
+
if (!value) return void 0;
|
|
322
|
+
if (/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(value)) try {
|
|
323
|
+
value = new URL(value).pathname;
|
|
324
|
+
} catch {
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
else value = value.split("#", 1)[0]?.split("?", 1)[0] ?? value;
|
|
328
|
+
if (!value.startsWith("/")) value = `/${value}`;
|
|
329
|
+
return value.replace(/\/$/, "") || "/";
|
|
330
|
+
}
|
|
331
|
+
function resolveSidebarFolderIndexBehavior(sidebar, defaultBehavior = "link") {
|
|
332
|
+
if (sidebar === void 0 || sidebar === true || sidebar === false) return defaultBehavior;
|
|
333
|
+
if (sidebar.folderIndexBehavior === "toggle") return "toggle";
|
|
334
|
+
if (sidebar.folderIndexBehavior === "link") return "link";
|
|
335
|
+
return defaultBehavior;
|
|
336
|
+
}
|
|
337
|
+
function resolveSidebarFolderIndexBehaviorForPath(sidebar, folderPath, defaultBehavior = "link") {
|
|
338
|
+
const fallback = resolveSidebarFolderIndexBehavior(sidebar, defaultBehavior);
|
|
339
|
+
if (!sidebar || typeof sidebar !== "object") return fallback;
|
|
340
|
+
const normalizedPath = normalizeSidebarFolderBehaviorPath(folderPath);
|
|
341
|
+
if (!normalizedPath) return fallback;
|
|
342
|
+
for (const [rawPath, override] of Object.entries(sidebar.folderIndexBehaviorOverrides ?? {})) if (normalizeSidebarFolderBehaviorPath(rawPath) === normalizedPath) return override === "link" || override === "toggle" ? override : fallback;
|
|
343
|
+
return fallback;
|
|
344
|
+
}
|
|
345
|
+
function applySidebarFolderIndexBehavior(tree, behaviorOrOptions) {
|
|
346
|
+
const resolveBehavior = typeof behaviorOrOptions === "string" ? () => behaviorOrOptions : (folderPath) => resolveSidebarFolderIndexBehaviorForPath(behaviorOrOptions.sidebar, folderPath, behaviorOrOptions.defaultBehavior);
|
|
347
|
+
function mapNode(node) {
|
|
348
|
+
if (!node || typeof node !== "object") return node;
|
|
349
|
+
const candidate = node;
|
|
350
|
+
if (candidate.type !== "folder" || !Array.isArray(candidate.children)) return node;
|
|
351
|
+
const children = candidate.children.map(mapNode);
|
|
352
|
+
const index = candidate.index ? mapNode(candidate.index) : void 0;
|
|
353
|
+
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);
|
|
354
|
+
if (((candidate.folderIndexBehavior === "link" || candidate.folderIndexBehavior === "toggle" ? candidate.folderIndexBehavior : void 0) ?? resolveBehavior(folderPath)) !== "toggle") return {
|
|
355
|
+
...candidate,
|
|
356
|
+
folderIndexBehavior: void 0,
|
|
357
|
+
index,
|
|
358
|
+
children
|
|
359
|
+
};
|
|
360
|
+
return {
|
|
361
|
+
...candidate,
|
|
362
|
+
folderIndexBehavior: void 0,
|
|
363
|
+
index: void 0,
|
|
364
|
+
url: void 0,
|
|
365
|
+
children: index ? [index, ...children] : children
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
return {
|
|
369
|
+
...tree,
|
|
370
|
+
children: tree.children.map(mapNode)
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
|
|
311
374
|
//#endregion
|
|
312
375
|
//#region src/agent.ts
|
|
313
376
|
const DEFAULT_DOCS_API_ROUTE = "/api/docs";
|
|
@@ -627,4 +690,4 @@ function toYamlString(value) {
|
|
|
627
690
|
}
|
|
628
691
|
|
|
629
692
|
//#endregion
|
|
630
|
-
export {
|
|
693
|
+
export { resolvePageSidebarFolderIndexBehavior as A, resolveOGImage as B, renderDocsMarkdownDocument as C, resolveDocsMarkdownRequest as D, resolveDocsLlmsTxtFormat as E, resolveReadingTimeFromContent as F, createTheme as G, resolveDocsI18n as H, resolveReadingTimeFromSource as I, resolveChangelogConfig as J, extendTheme as K, resolveReadingTimeOptions as L, resolveSidebarFolderIndexBehaviorForPath as M, estimateReadingTimeMinutes as N, resolveDocsSkillFormat as O, resolvePageReadingTime as P, buildPageOpenGraph as R, normalizeDocsUrlPath as S, resolveDocsAgentMdxContent as T, resolveDocsLocale as U, resolveTitle as V, resolveDocsPath as W, defineDocs as Y, 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, resolveSidebarFolderIndexBehavior 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, deepMerge 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, buildPageTwitter as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as renderDocsMarkdownDocument, g as findDocsMarkdownPage } from "./agent-
|
|
1
|
+
import { C as renderDocsMarkdownDocument, g as findDocsMarkdownPage } from "./agent-CCznWtjf.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";
|
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-DBVNPqFU.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-DBVNPqFU.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-k6ouCFXp.mjs");
|
|
93
93
|
const doctorOptions = parseDoctorArgs(args.slice(1));
|
|
94
94
|
if (doctorOptions.help) {
|
|
95
95
|
printDoctorHelp();
|
|
@@ -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-CCznWtjf.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-DBVNPqFU.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
|
|
1
|
+
import { $ as SidebarComponentProps, 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 ResolvedDocsRelatedLink, R as LastUpdatedConfig, S as DocsRelatedItem, T as DocsSearchAdapterFactory, U as OpenDocsProvider, V as OGConfig, W as OpenGraphImage, X as PageTwitter, Y as PageSidebarFrontmatter, Z as ReadingTimeConfig, _ as DocsI18nConfig, a as ApiReferenceRenderer, at as SidebarTree, b as DocsMetadata, c as ChangelogFrontmatter, ct as TypesenseDocsSearchConfig, d as CustomDocsSearchConfig, et as SidebarConfig, f as DocsAgentFeedbackContext, g as DocsFeedbackValue, h as DocsFeedbackData, i as ApiReferenceConfig, it as SidebarPageNode, j as DocsSearchResult, k as DocsSearchEmbeddingsConfig, l as CodeBlockCopyData, lt as TypographyConfig, m as DocsConfig, n as AgentFeedbackConfig, nt as SidebarFolderNode, o as BreadcrumbConfig, ot as SimpleDocsSearchConfig, p as DocsAgentFeedbackData, q as PageFrontmatter, r as AlgoliaDocsSearchConfig, rt as SidebarNode, s as ChangelogConfig, st as ThemeToggleConfig, t as AIConfig, tt as SidebarFolderIndexBehavior, u as CopyMarkdownConfig, ut as UIConfig, v as DocsMcpConfig, w as DocsSearchAdapterContext, x as DocsNav, y as DocsMcpToolsConfig, z as LlmsTxtConfig } from "./types-ClMUaY9I.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-B6aum8AJ.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/define-docs.d.ts
|
|
6
6
|
/**
|
|
@@ -134,6 +134,18 @@ 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 resolvePageSidebarFolderIndexBehavior(sidebar: unknown): SidebarFolderIndexBehavior | undefined;
|
|
143
|
+
declare function resolveSidebarFolderIndexBehavior(sidebar: boolean | SidebarConfig | undefined, defaultBehavior?: SidebarFolderIndexBehavior): SidebarFolderIndexBehavior;
|
|
144
|
+
declare function resolveSidebarFolderIndexBehaviorForPath(sidebar: boolean | SidebarConfig | undefined, folderPath: string | undefined, defaultBehavior?: SidebarFolderIndexBehavior): SidebarFolderIndexBehavior;
|
|
145
|
+
declare function applySidebarFolderIndexBehavior<TTree extends {
|
|
146
|
+
children: unknown[];
|
|
147
|
+
}>(tree: TTree, behaviorOrOptions: SidebarFolderIndexBehavior | SidebarFolderIndexBehaviorOptions): TTree;
|
|
148
|
+
//#endregion
|
|
137
149
|
//#region src/agent-provenance.d.ts
|
|
138
150
|
declare const GENERATED_AGENT_PROVENANCE_MARKER = "@farming-labs/docs:generated";
|
|
139
151
|
declare const GENERATED_AGENT_PROVENANCE_VERSION = 1;
|
|
@@ -360,4 +372,4 @@ declare function buildDocsAgentDiscoverySpec({
|
|
|
360
372
|
};
|
|
361
373
|
};
|
|
362
374
|
//#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 };
|
|
375
|
+
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 PageSidebarFrontmatter, 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, resolvePageSidebarFolderIndexBehavior, 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 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-CCznWtjf.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, resolvePageSidebarFolderIndexBehavior, 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-ClMUaY9I.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,
|
|
1
|
+
import { B as McpDocsSearchConfig, C as DocsSearchAdapter, D as DocsSearchConfig, E as DocsSearchChunkingConfig, N as DocsSearchSourcePage, O as DocsSearchDocument, T as DocsSearchAdapterFactory, ct as TypesenseDocsSearchConfig, d as CustomDocsSearchConfig, j as DocsSearchResult, r as AlgoliaDocsSearchConfig } from "./types-ClMUaY9I.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-ClMUaY9I.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-B6aum8AJ.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/api-reference.d.ts
|
|
6
6
|
type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD";
|
|
@@ -253,6 +253,14 @@ interface PageAgentFrontmatter {
|
|
|
253
253
|
*/
|
|
254
254
|
tokenBudget?: number;
|
|
255
255
|
}
|
|
256
|
+
interface PageSidebarFrontmatter {
|
|
257
|
+
/**
|
|
258
|
+
* Override how this folder page behaves in the default sidebar when it has children.
|
|
259
|
+
*
|
|
260
|
+
* This is only read from folder landing pages such as `page.mdx` / `index.md`.
|
|
261
|
+
*/
|
|
262
|
+
folderIndexBehavior?: SidebarFolderIndexBehavior;
|
|
263
|
+
}
|
|
256
264
|
interface PageFrontmatter {
|
|
257
265
|
title: string;
|
|
258
266
|
description?: string;
|
|
@@ -260,6 +268,8 @@ interface PageFrontmatter {
|
|
|
260
268
|
related?: DocsRelatedItem[];
|
|
261
269
|
/** Per-page agent-oriented metadata used by machine-readable docs features. */
|
|
262
270
|
agent?: PageAgentFrontmatter;
|
|
271
|
+
/** Per-page sidebar metadata used when building the docs navigation tree. */
|
|
272
|
+
sidebar?: PageSidebarFrontmatter;
|
|
263
273
|
/** Override or disable the estimated reading time for this page. */
|
|
264
274
|
readingTime?: boolean | number;
|
|
265
275
|
tags?: string[];
|
|
@@ -356,6 +366,11 @@ interface SidebarFolderNode {
|
|
|
356
366
|
icon?: unknown;
|
|
357
367
|
/** Index page for this folder (the folder's own landing page). */
|
|
358
368
|
index?: SidebarPageNode;
|
|
369
|
+
/**
|
|
370
|
+
* Optional per-folder override read from the folder page frontmatter before the
|
|
371
|
+
* tree is normalized for the default sidebar.
|
|
372
|
+
*/
|
|
373
|
+
folderIndexBehavior?: SidebarFolderIndexBehavior;
|
|
359
374
|
/** Child pages and sub-folders. */
|
|
360
375
|
children: SidebarNode[];
|
|
361
376
|
/** Whether this folder section is collapsible. */
|
|
@@ -385,6 +400,15 @@ interface SidebarComponentProps {
|
|
|
385
400
|
/** Whether folders are rendered flat (Mintlify-style). */
|
|
386
401
|
flat: boolean;
|
|
387
402
|
}
|
|
403
|
+
/**
|
|
404
|
+
* Controls how folders with their own landing page behave in the default sidebar.
|
|
405
|
+
*
|
|
406
|
+
* - `"link"` — clicking the parent row navigates to the folder landing page
|
|
407
|
+
* - `"toggle"` — clicking the parent row only expands/collapses children, and the
|
|
408
|
+
* landing page is rendered as the first child item instead
|
|
409
|
+
*/
|
|
410
|
+
type SidebarFolderIndexBehavior = "link" | "toggle";
|
|
411
|
+
type SidebarFolderIndexBehaviorOverrides = Record<string, SidebarFolderIndexBehavior>;
|
|
388
412
|
interface SidebarConfig {
|
|
389
413
|
/**
|
|
390
414
|
* Whether to show the sidebar.
|
|
@@ -456,6 +480,42 @@ interface SidebarConfig {
|
|
|
456
480
|
* @default false
|
|
457
481
|
*/
|
|
458
482
|
flat?: boolean;
|
|
483
|
+
/**
|
|
484
|
+
* How folders with their own `page.mdx` / `page.md` behave in the default sidebar.
|
|
485
|
+
*
|
|
486
|
+
* - `"link"` — clicking the parent row navigates to the folder landing page
|
|
487
|
+
* - `"toggle"` — clicking the parent row only expands/collapses children, and the
|
|
488
|
+
* folder landing page appears as the first child item instead
|
|
489
|
+
*
|
|
490
|
+
* This is the global default. Individual folder pages can still override it with
|
|
491
|
+
* page frontmatter:
|
|
492
|
+
*
|
|
493
|
+
* ```mdx
|
|
494
|
+
* ---
|
|
495
|
+
* sidebar:
|
|
496
|
+
* folderIndexBehavior: "toggle"
|
|
497
|
+
* ---
|
|
498
|
+
* ```
|
|
499
|
+
*
|
|
500
|
+
* When omitted, each adapter keeps its existing folder-parent behavior. Set this
|
|
501
|
+
* explicitly if you want the same sidebar interaction across frameworks.
|
|
502
|
+
*/
|
|
503
|
+
folderIndexBehavior?: SidebarFolderIndexBehavior;
|
|
504
|
+
/**
|
|
505
|
+
* Selective per-folder overrides keyed by the folder landing-page URL.
|
|
506
|
+
* Folder page frontmatter still wins when both are present.
|
|
507
|
+
*
|
|
508
|
+
* ```ts
|
|
509
|
+
* sidebar: {
|
|
510
|
+
* folderIndexBehavior: "link",
|
|
511
|
+
* folderIndexBehaviorOverrides: {
|
|
512
|
+
* "/docs/components": "toggle",
|
|
513
|
+
* "/docs/guides": "toggle",
|
|
514
|
+
* },
|
|
515
|
+
* }
|
|
516
|
+
* ```
|
|
517
|
+
*/
|
|
518
|
+
folderIndexBehaviorOverrides?: SidebarFolderIndexBehaviorOverrides;
|
|
459
519
|
}
|
|
460
520
|
/**
|
|
461
521
|
* A single "Open in …" provider shown in the Open dropdown.
|
|
@@ -1911,4 +1971,4 @@ interface DocsConfig {
|
|
|
1911
1971
|
og?: OGConfig;
|
|
1912
1972
|
}
|
|
1913
1973
|
//#endregion
|
|
1914
|
-
export {
|
|
1974
|
+
export { SidebarComponentProps 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, ResolvedDocsRelatedLink as Q, LastUpdatedConfig as R, DocsRelatedItem as S, DocsSearchAdapterFactory as T, OpenDocsProvider as U, OGConfig as V, OpenGraphImage as W, PageTwitter as X, PageSidebarFrontmatter as Y, ReadingTimeConfig as Z, DocsI18nConfig as _, ApiReferenceRenderer as a, SidebarTree as at, DocsMetadata as b, ChangelogFrontmatter as c, TypesenseDocsSearchConfig as ct, CustomDocsSearchConfig as d, SidebarConfig as et, DocsAgentFeedbackContext as f, DocsFeedbackValue as g, DocsFeedbackData as h, ApiReferenceConfig as i, SidebarPageNode as it, DocsSearchResult as j, DocsSearchEmbeddingsConfig as k, CodeBlockCopyData as l, TypographyConfig as lt, DocsConfig as m, AgentFeedbackConfig as n, SidebarFolderNode as nt, BreadcrumbConfig as o, SimpleDocsSearchConfig as ot, DocsAgentFeedbackData as p, PageFrontmatter as q, AlgoliaDocsSearchConfig as r, SidebarNode as rt, ChangelogConfig as s, ThemeToggleConfig as st, AIConfig as t, SidebarFolderIndexBehavior as tt, CopyMarkdownConfig as u, UIConfig as ut, DocsMcpConfig as v, DocsSearchAdapterContext as w, DocsNav as x, DocsMcpToolsConfig as y, LlmsTxtConfig as z };
|