@farming-labs/docs 0.1.116 → 0.1.117
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/cli/index.mjs +2 -2
- package/dist/{doctor-Cey7sqh9.mjs → doctor-CaDyUn0F.mjs} +2 -1
- package/dist/index.d.mts +3 -2
- package/dist/{mcp-aGYzIAb_.mjs → mcp-BUf-9KXn.mjs} +2 -1
- package/dist/mcp.d.mts +28 -2
- package/dist/mcp.mjs +547 -2
- package/dist/{search-DYPyHTz_.d.mts → search-Dlwp88qb.d.mts} +1 -1
- package/dist/server.d.mts +4 -4
- package/dist/{types-qqx8SjH4.d.mts → types-D-cNOo-t.d.mts} +2 -0
- package/package.json +1 -1
package/dist/cli/index.mjs
CHANGED
|
@@ -83,7 +83,7 @@ async function main() {
|
|
|
83
83
|
const { dev } = await import("../dev-FC6Fh7nT.mjs");
|
|
84
84
|
await dev(devOptions);
|
|
85
85
|
} else if (parsedCommand.command === "mcp") {
|
|
86
|
-
const { runMcp } = await import("../mcp-
|
|
86
|
+
const { runMcp } = await import("../mcp-BUf-9KXn.mjs");
|
|
87
87
|
await runMcp(mcpOptions);
|
|
88
88
|
} else if (parsedCommand.command === "agent" && subcommand === "compact") {
|
|
89
89
|
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent-D8DpCgt_.mjs");
|
|
@@ -114,7 +114,7 @@ async function main() {
|
|
|
114
114
|
printAgentsGenerateHelp();
|
|
115
115
|
process.exit(1);
|
|
116
116
|
} else if (parsedCommand.command === "doctor") {
|
|
117
|
-
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-
|
|
117
|
+
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-CaDyUn0F.mjs");
|
|
118
118
|
const doctorOptions = parseDoctorArgs(args.slice(1));
|
|
119
119
|
if (doctorOptions.help) {
|
|
120
120
|
printDoctorHelp();
|
|
@@ -956,7 +956,8 @@ async function probeMcpRoute(baseUrl, route) {
|
|
|
956
956
|
"get_navigation",
|
|
957
957
|
"search_docs",
|
|
958
958
|
"read_page",
|
|
959
|
-
"get_code_examples"
|
|
959
|
+
"get_code_examples",
|
|
960
|
+
"get_config_schema"
|
|
960
961
|
].filter((tool) => !toolNames.includes(tool));
|
|
961
962
|
if (missingTools.length > 0) return {
|
|
962
963
|
ok: false,
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as DocsSearchResultType, A as DocsConfig, At as SidebarFolderNode, B as DocsObservabilityEventInput, C as DocsAskAIActionData, Ct as PageSidebarFrontmatter, D as DocsAskAIFeedbackMessage, Dt as SidebarComponentProps, E as DocsAskAIFeedbackData, Et as ResolvedDocsRelatedLink, F as DocsMcpToolsConfig, Ft as ThemeToggleConfig, G as DocsSearchAdapterContext, H as DocsRobotsConfig, I as DocsMetadata, It as TypesenseDocsSearchConfig, J as DocsSearchConfig, K as DocsSearchAdapterFactory, L as DocsNav, Lt as TypographyConfig, M as DocsFeedbackValue, Mt as SidebarPageNode, N as DocsI18nConfig, Nt as SidebarTree, O as DocsAskAIFeedbackValue, Ot as SidebarConfig, P as DocsMcpConfig, Pt as SimpleDocsSearchConfig, Q as DocsSearchResult, R as DocsObservabilityConfig, Rt as UIConfig, S as DocsAnalyticsSource, St as PageOpenGraph, T as DocsAskAIFeedbackConfig, Tt as ReadingTimeConfig, U as DocsRobotsRule, V as DocsRelatedItem, W as DocsSearchAdapter, X as DocsSearchEmbeddingsConfig, Y as DocsSearchDocument, Z as DocsSearchQuery, _ as DocsAnalyticsConfig, _t as OpenDocsTarget, a as ApiReferenceRenderer, at as GithubConfig, b as DocsAnalyticsEventType, bt as PageActionsConfig, c as ChangelogFrontmatter, ct as LlmsTxtMaxCharsConfig, d as CustomDocsSearchConfig, dt as McpDocsSearchConfig, et as DocsSearchSourcePage, f as DocsAgentFeedbackContext, ft as OGConfig, g as DocsAgentTraceStatus, gt as OpenDocsProviderId, h as DocsAgentTraceEventType, ht as OpenDocsProviderConfig, i as ApiReferenceConfig, it as FontStyle, j as DocsFeedbackData, jt as SidebarNode, k as DocsAskAIMcpConfig, kt as SidebarFolderIndexBehavior, l as CodeBlockCopyData, lt as LlmsTxtMaxCharsMode, m as DocsAgentTraceEventInput, mt as OpenDocsProvider, n as AgentFeedbackConfig, nt as DocsTheme, o as BreadcrumbConfig, ot as LastUpdatedConfig, p as DocsAgentFeedbackData, pt as OpenDocsConfig, q as DocsSearchChunkingConfig, r as AlgoliaDocsSearchConfig, rt as FeedbackConfig, s as ChangelogConfig, st as LlmsTxtConfig, t as AIConfig, tt as DocsSitemapConfig, u as CopyMarkdownConfig, ut as LlmsTxtSectionConfig, v as DocsAnalyticsEvent, vt as OpenGraphImage, w as DocsAskAIActionType, wt as PageTwitter, x as DocsAnalyticsInput, xt as PageFrontmatter, y as DocsAnalyticsEventInput, yt as OrderingItem, z as DocsObservabilityEvent } from "./types-
|
|
2
|
-
import { $ as emitDocsAgentTraceEvent, A as toDocsSitemapMarkdownUrl, C as createDocsSitemapResponse, D as resolveDocsSitemapConfig, E as renderDocsSitemapXml, F as PromptAction, I as PromptProviderChoice, J as DocsAgentTraceContext, L as SerializeOpenDocsProviderOptions, O as resolveDocsSitemapPageLastmod, Q as createDocsAgentTraceId, R as SerializedOpenDocsProvider, S as buildDocsSitemapManifest, T as renderDocsSitemapMarkdown, X as ResolvedDocsObservabilityConfig, Y as ResolvedDocsAnalyticsConfig, Z as createDocsAgentTraceContext, _ as DocsSitemapFormat, a as createMcpSearchAdapter, at as createDocsCloudAnalytics, b as DocsSitemapPageInput, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, et as emitDocsAnalyticsEvent, f as resolveSearchRequestConfig, g as DEFAULT_SITEMAP_XML_ROUTE, h as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, i as createCustomSearchAdapter, it as DocsCloudAnalyticsOptions, k as resolveDocsSitemapRequest, l as inferDocsAskAIPackageHints, m as DEFAULT_SITEMAP_MD_ROUTE, n as buildDocsSearchDocuments, nt as resolveDocsAnalyticsConfig, o as createSimpleSearchAdapter, p as DEFAULT_SITEMAP_MANIFEST_PATH, q as DOCS_AGENT_TRACE_EVENT_TYPES, r as createAlgoliaSearchAdapter, rt as resolveDocsObservabilityConfig, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, tt as emitDocsObservabilityEvent, u as performDocsSearch, v as DocsSitemapManifest, w as readDocsSitemapManifestFromContentMap, x as DocsSitemapResolvedConfig, y as DocsSitemapManifestPage } from "./search-
|
|
1
|
+
import { $ as DocsSearchResultType, A as DocsConfig, At as SidebarFolderNode, B as DocsObservabilityEventInput, C as DocsAskAIActionData, Ct as PageSidebarFrontmatter, D as DocsAskAIFeedbackMessage, Dt as SidebarComponentProps, E as DocsAskAIFeedbackData, Et as ResolvedDocsRelatedLink, F as DocsMcpToolsConfig, Ft as ThemeToggleConfig, G as DocsSearchAdapterContext, H as DocsRobotsConfig, I as DocsMetadata, It as TypesenseDocsSearchConfig, J as DocsSearchConfig, K as DocsSearchAdapterFactory, L as DocsNav, Lt as TypographyConfig, M as DocsFeedbackValue, Mt as SidebarPageNode, N as DocsI18nConfig, Nt as SidebarTree, O as DocsAskAIFeedbackValue, Ot as SidebarConfig, P as DocsMcpConfig, Pt as SimpleDocsSearchConfig, Q as DocsSearchResult, R as DocsObservabilityConfig, Rt as UIConfig, S as DocsAnalyticsSource, St as PageOpenGraph, T as DocsAskAIFeedbackConfig, Tt as ReadingTimeConfig, U as DocsRobotsRule, V as DocsRelatedItem, W as DocsSearchAdapter, X as DocsSearchEmbeddingsConfig, Y as DocsSearchDocument, Z as DocsSearchQuery, _ as DocsAnalyticsConfig, _t as OpenDocsTarget, a as ApiReferenceRenderer, at as GithubConfig, b as DocsAnalyticsEventType, bt as PageActionsConfig, c as ChangelogFrontmatter, ct as LlmsTxtMaxCharsConfig, d as CustomDocsSearchConfig, dt as McpDocsSearchConfig, et as DocsSearchSourcePage, f as DocsAgentFeedbackContext, ft as OGConfig, g as DocsAgentTraceStatus, gt as OpenDocsProviderId, h as DocsAgentTraceEventType, ht as OpenDocsProviderConfig, i as ApiReferenceConfig, it as FontStyle, j as DocsFeedbackData, jt as SidebarNode, k as DocsAskAIMcpConfig, kt as SidebarFolderIndexBehavior, l as CodeBlockCopyData, lt as LlmsTxtMaxCharsMode, m as DocsAgentTraceEventInput, mt as OpenDocsProvider, n as AgentFeedbackConfig, nt as DocsTheme, o as BreadcrumbConfig, ot as LastUpdatedConfig, p as DocsAgentFeedbackData, pt as OpenDocsConfig, q as DocsSearchChunkingConfig, r as AlgoliaDocsSearchConfig, rt as FeedbackConfig, s as ChangelogConfig, st as LlmsTxtConfig, t as AIConfig, tt as DocsSitemapConfig, u as CopyMarkdownConfig, ut as LlmsTxtSectionConfig, v as DocsAnalyticsEvent, vt as OpenGraphImage, w as DocsAskAIActionType, wt as PageTwitter, x as DocsAnalyticsInput, xt as PageFrontmatter, y as DocsAnalyticsEventInput, yt as OrderingItem, z as DocsObservabilityEvent } from "./types-D-cNOo-t.mjs";
|
|
2
|
+
import { $ as emitDocsAgentTraceEvent, A as toDocsSitemapMarkdownUrl, C as createDocsSitemapResponse, D as resolveDocsSitemapConfig, E as renderDocsSitemapXml, F as PromptAction, I as PromptProviderChoice, J as DocsAgentTraceContext, L as SerializeOpenDocsProviderOptions, O as resolveDocsSitemapPageLastmod, Q as createDocsAgentTraceId, R as SerializedOpenDocsProvider, S as buildDocsSitemapManifest, T as renderDocsSitemapMarkdown, X as ResolvedDocsObservabilityConfig, Y as ResolvedDocsAnalyticsConfig, Z as createDocsAgentTraceContext, _ as DocsSitemapFormat, a as createMcpSearchAdapter, at as createDocsCloudAnalytics, b as DocsSitemapPageInput, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, et as emitDocsAnalyticsEvent, f as resolveSearchRequestConfig, g as DEFAULT_SITEMAP_XML_ROUTE, h as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, i as createCustomSearchAdapter, it as DocsCloudAnalyticsOptions, k as resolveDocsSitemapRequest, l as inferDocsAskAIPackageHints, m as DEFAULT_SITEMAP_MD_ROUTE, n as buildDocsSearchDocuments, nt as resolveDocsAnalyticsConfig, o as createSimpleSearchAdapter, p as DEFAULT_SITEMAP_MANIFEST_PATH, q as DOCS_AGENT_TRACE_EVENT_TYPES, r as createAlgoliaSearchAdapter, rt as resolveDocsObservabilityConfig, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, tt as emitDocsObservabilityEvent, u as performDocsSearch, v as DocsSitemapManifest, w as readDocsSitemapManifestFromContentMap, x as DocsSitemapResolvedConfig, y as DocsSitemapManifestPage } from "./search-Dlwp88qb.mjs";
|
|
3
3
|
import { DocsMcpPage, DocsMcpResolvedConfig } from "./mcp.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/define-docs.d.ts
|
|
@@ -602,6 +602,7 @@ declare function buildDocsAgentDiscoverySpec({
|
|
|
602
602
|
searchDocs: boolean;
|
|
603
603
|
getNavigation: boolean;
|
|
604
604
|
getCodeExamples: boolean;
|
|
605
|
+
getConfigSchema: boolean;
|
|
605
606
|
};
|
|
606
607
|
};
|
|
607
608
|
feedback: {
|
|
@@ -39,7 +39,8 @@ function readMcpConfig(content) {
|
|
|
39
39
|
readPage: readBooleanProperty(block, "readPage"),
|
|
40
40
|
searchDocs: readBooleanProperty(block, "searchDocs"),
|
|
41
41
|
getNavigation: readBooleanProperty(block, "getNavigation"),
|
|
42
|
-
getCodeExamples: readBooleanProperty(block, "getCodeExamples")
|
|
42
|
+
getCodeExamples: readBooleanProperty(block, "getCodeExamples"),
|
|
43
|
+
getConfigSchema: readBooleanProperty(block, "getConfigSchema")
|
|
43
44
|
}
|
|
44
45
|
};
|
|
45
46
|
}
|
package/dist/mcp.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { J as DocsSearchConfig, P as DocsMcpConfig, R as DocsObservabilityConfig, _ as DocsAnalyticsConfig, et as DocsSearchSourcePage, yt as OrderingItem } from "./types-
|
|
1
|
+
import { J as DocsSearchConfig, P as DocsMcpConfig, R as DocsObservabilityConfig, _ as DocsAnalyticsConfig, et as DocsSearchSourcePage, yt as OrderingItem } from "./types-D-cNOo-t.mjs";
|
|
2
2
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
3
|
|
|
4
4
|
//#region src/mcp.d.ts
|
|
@@ -36,6 +36,31 @@ interface DocsMcpCodeExample {
|
|
|
36
36
|
meta: Record<string, string | boolean>;
|
|
37
37
|
code: string;
|
|
38
38
|
}
|
|
39
|
+
interface DocsMcpConfigSchemaOption {
|
|
40
|
+
path: string;
|
|
41
|
+
name: string;
|
|
42
|
+
type: string;
|
|
43
|
+
default?: string | boolean | number | null;
|
|
44
|
+
description: string;
|
|
45
|
+
docs?: string;
|
|
46
|
+
values?: string[];
|
|
47
|
+
children?: DocsMcpConfigSchemaOption[];
|
|
48
|
+
}
|
|
49
|
+
interface DocsMcpConfigSchema {
|
|
50
|
+
schemaVersion: 1;
|
|
51
|
+
configFile: "docs.config.ts";
|
|
52
|
+
description: string;
|
|
53
|
+
filters?: {
|
|
54
|
+
option?: string;
|
|
55
|
+
query?: string;
|
|
56
|
+
};
|
|
57
|
+
resultCount: number;
|
|
58
|
+
options: DocsMcpConfigSchemaOption[];
|
|
59
|
+
examples: Array<{
|
|
60
|
+
title: string;
|
|
61
|
+
code: string;
|
|
62
|
+
}>;
|
|
63
|
+
}
|
|
39
64
|
interface DocsMcpPageNode {
|
|
40
65
|
type: "page";
|
|
41
66
|
name: string;
|
|
@@ -72,6 +97,7 @@ interface DocsMcpResolvedConfig {
|
|
|
72
97
|
searchDocs: boolean;
|
|
73
98
|
getNavigation: boolean;
|
|
74
99
|
getCodeExamples: boolean;
|
|
100
|
+
getConfigSchema: boolean;
|
|
75
101
|
};
|
|
76
102
|
}
|
|
77
103
|
interface DocsMcpHttpHandlers {
|
|
@@ -112,4 +138,4 @@ declare function createDocsMcpServer(options: CreateDocsMcpServerOptions): Promi
|
|
|
112
138
|
declare function createDocsMcpHttpHandler(options: CreateDocsMcpServerOptions): DocsMcpHttpHandlers;
|
|
113
139
|
declare function runDocsMcpStdio(options: CreateDocsMcpServerOptions): Promise<void>;
|
|
114
140
|
//#endregion
|
|
115
|
-
export { DocsMcpCodeExample, DocsMcpFolderNode, DocsMcpHttpHandlers, DocsMcpNavigationNode, DocsMcpNavigationTree, DocsMcpPage, DocsMcpPageNode, DocsMcpResolvedConfig, DocsMcpSource, createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, normalizeDocsMcpRoute, resolveDocsMcpConfig, runDocsMcpStdio };
|
|
141
|
+
export { DocsMcpCodeExample, DocsMcpConfigSchema, DocsMcpConfigSchemaOption, DocsMcpFolderNode, DocsMcpHttpHandlers, DocsMcpNavigationNode, DocsMcpNavigationTree, DocsMcpPage, DocsMcpPageNode, DocsMcpResolvedConfig, DocsMcpSource, createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, normalizeDocsMcpRoute, resolveDocsMcpConfig, runDocsMcpStdio };
|
package/dist/mcp.mjs
CHANGED
|
@@ -13,6 +13,404 @@ import * as z from "zod/v4";
|
|
|
13
13
|
const DEFAULT_MCP_ROUTE = "/api/docs/mcp";
|
|
14
14
|
const DEFAULT_MCP_VERSION = "0.0.0";
|
|
15
15
|
const DEFAULT_MCP_NAME = "@farming-labs/docs";
|
|
16
|
+
const DOCS_CONFIG_SCHEMA_OPTIONS = [
|
|
17
|
+
{
|
|
18
|
+
path: "entry",
|
|
19
|
+
name: "entry",
|
|
20
|
+
type: "string",
|
|
21
|
+
default: "docs",
|
|
22
|
+
description: "URL path prefix for documentation routes, for example \"docs\" creates /docs.",
|
|
23
|
+
docs: "/docs/overview"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
path: "contentDir",
|
|
27
|
+
name: "contentDir",
|
|
28
|
+
type: "string",
|
|
29
|
+
default: "same as entry",
|
|
30
|
+
description: "Path to markdown content files. Adapters outside Next.js usually need this when content does not live under the route prefix.",
|
|
31
|
+
docs: "/docs/overview"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
path: "staticExport",
|
|
35
|
+
name: "staticExport",
|
|
36
|
+
type: "boolean",
|
|
37
|
+
default: false,
|
|
38
|
+
description: "Enable full static builds. Search, AI, and runtime API routes are hidden.",
|
|
39
|
+
docs: "/docs/overview"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
path: "theme",
|
|
43
|
+
name: "theme",
|
|
44
|
+
type: "DocsTheme",
|
|
45
|
+
description: "Theme instance from a theme factory such as fumadocs() or pixelBorder().",
|
|
46
|
+
docs: "/docs/customization/themes"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
path: "nav",
|
|
50
|
+
name: "nav",
|
|
51
|
+
type: "{ title?: string; url?: string }",
|
|
52
|
+
description: "Sidebar and discovery metadata for the docs site. Non-Next.js adapters usually require it.",
|
|
53
|
+
children: [{
|
|
54
|
+
path: "nav.title",
|
|
55
|
+
name: "title",
|
|
56
|
+
type: "string",
|
|
57
|
+
description: "Human-readable docs site title."
|
|
58
|
+
}, {
|
|
59
|
+
path: "nav.url",
|
|
60
|
+
name: "url",
|
|
61
|
+
type: "string",
|
|
62
|
+
description: "Public base URL for generated absolute links and metadata."
|
|
63
|
+
}]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
path: "github",
|
|
67
|
+
name: "github",
|
|
68
|
+
type: "string | GithubConfig",
|
|
69
|
+
description: "GitHub repository metadata for \"Edit on GitHub\" links and page action prompt templates.",
|
|
70
|
+
docs: "/docs/customization/page-actions"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
path: "themeToggle",
|
|
74
|
+
name: "themeToggle",
|
|
75
|
+
type: "boolean | ThemeToggleConfig",
|
|
76
|
+
default: true,
|
|
77
|
+
description: "Enable or customize the light/dark mode toggle."
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
path: "breadcrumb",
|
|
81
|
+
name: "breadcrumb",
|
|
82
|
+
type: "boolean | BreadcrumbConfig",
|
|
83
|
+
default: true,
|
|
84
|
+
description: "Enable or customize breadcrumb navigation."
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
path: "sidebar",
|
|
88
|
+
name: "sidebar",
|
|
89
|
+
type: "boolean | SidebarConfig",
|
|
90
|
+
default: true,
|
|
91
|
+
description: "Enable or customize the docs sidebar.",
|
|
92
|
+
children: [{
|
|
93
|
+
path: "sidebar.style",
|
|
94
|
+
name: "style",
|
|
95
|
+
type: "string",
|
|
96
|
+
description: "Theme-specific sidebar style variant when supported."
|
|
97
|
+
}, {
|
|
98
|
+
path: "sidebar.defaultOpen",
|
|
99
|
+
name: "defaultOpen",
|
|
100
|
+
type: "boolean",
|
|
101
|
+
description: "Whether collapsible sidebar groups start open by default."
|
|
102
|
+
}]
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
path: "icons",
|
|
106
|
+
name: "icons",
|
|
107
|
+
type: "Record<string, Component>",
|
|
108
|
+
description: "Shared icon registry for frontmatter icon fields and built-in MDX components."
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
path: "components",
|
|
112
|
+
name: "components",
|
|
113
|
+
type: "Record<string, Component>",
|
|
114
|
+
description: "Custom MDX component registry and built-in component overrides."
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
path: "onCopyClick",
|
|
118
|
+
name: "onCopyClick",
|
|
119
|
+
type: "(data: CodeBlockCopyData) => void",
|
|
120
|
+
description: "Callback fired when a visitor copies a code block, including title, content, url, and language."
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
path: "feedback",
|
|
124
|
+
name: "feedback",
|
|
125
|
+
type: "boolean | FeedbackConfig",
|
|
126
|
+
default: false,
|
|
127
|
+
description: "Human page feedback UI. Agent feedback endpoints remain default-on unless opted out.",
|
|
128
|
+
docs: "/docs/customization/feedback"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
path: "readingTime",
|
|
132
|
+
name: "readingTime",
|
|
133
|
+
type: "boolean | ReadingTimeConfig",
|
|
134
|
+
default: false,
|
|
135
|
+
description: "Opt-in estimated reading time label with per-page overrides."
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
path: "agent",
|
|
139
|
+
name: "agent",
|
|
140
|
+
type: "DocsAgentConfig",
|
|
141
|
+
description: "Defaults for docs agent compact and generated agent-facing files.",
|
|
142
|
+
docs: "/docs/getting-started/agent-ready-docs"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
path: "pageActions",
|
|
146
|
+
name: "pageActions",
|
|
147
|
+
type: "PageActionsConfig",
|
|
148
|
+
description: "Copy Markdown and Open in LLM actions for docs pages.",
|
|
149
|
+
docs: "/docs/customization/page-actions",
|
|
150
|
+
children: [{
|
|
151
|
+
path: "pageActions.copyMarkdown",
|
|
152
|
+
name: "copyMarkdown",
|
|
153
|
+
type: "boolean | PageActionConfig",
|
|
154
|
+
description: "Show a Copy Markdown action for the current page."
|
|
155
|
+
}, {
|
|
156
|
+
path: "pageActions.openDocs",
|
|
157
|
+
name: "openDocs",
|
|
158
|
+
type: "boolean | OpenDocsActionConfig",
|
|
159
|
+
description: "Show provider actions that open the current docs page in an LLM.",
|
|
160
|
+
children: [
|
|
161
|
+
{
|
|
162
|
+
path: "pageActions.openDocs.target",
|
|
163
|
+
name: "target",
|
|
164
|
+
type: "\"page\" | \"markdown\"",
|
|
165
|
+
default: "page",
|
|
166
|
+
description: "Whether provider URLs receive the rendered page URL or the .md markdown route."
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
path: "pageActions.openDocs.providers",
|
|
170
|
+
name: "providers",
|
|
171
|
+
type: "Array<string | PromptProviderConfig>",
|
|
172
|
+
description: "Provider IDs or provider objects. Built-ins include chatgpt, claude, cursor, and t3."
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
path: "pageActions.openDocs.prompt",
|
|
176
|
+
name: "prompt",
|
|
177
|
+
type: "string",
|
|
178
|
+
description: "Prompt text prepended to the provider URL when opening docs."
|
|
179
|
+
}
|
|
180
|
+
]
|
|
181
|
+
}]
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
path: "ai",
|
|
185
|
+
name: "ai",
|
|
186
|
+
type: "AIConfig",
|
|
187
|
+
description: "RAG-powered Ask AI configuration.",
|
|
188
|
+
docs: "/docs/customization/ask-ai",
|
|
189
|
+
children: [
|
|
190
|
+
{
|
|
191
|
+
path: "ai.enabled",
|
|
192
|
+
name: "enabled",
|
|
193
|
+
type: "boolean",
|
|
194
|
+
description: "Enable or disable Ask AI."
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
path: "ai.model",
|
|
198
|
+
name: "model",
|
|
199
|
+
type: "string | AIModelConfig",
|
|
200
|
+
description: "Model ID or model routing config."
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
path: "ai.providers",
|
|
204
|
+
name: "providers",
|
|
205
|
+
type: "Record<string, AIProviderConfig>",
|
|
206
|
+
description: "Provider base URLs and optional API keys."
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
path: "ai.systemPrompt",
|
|
210
|
+
name: "systemPrompt",
|
|
211
|
+
type: "string",
|
|
212
|
+
description: "Additional instruction text for generated answers."
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
path: "ai.useMcp",
|
|
216
|
+
name: "useMcp",
|
|
217
|
+
type: "boolean | DocsAskAIMcpConfig",
|
|
218
|
+
description: "Use the built-in MCP search tool as Ask AI's retrieval provider."
|
|
219
|
+
}
|
|
220
|
+
]
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
path: "search",
|
|
224
|
+
name: "search",
|
|
225
|
+
type: "boolean | DocsSearchConfig",
|
|
226
|
+
default: true,
|
|
227
|
+
description: "Built-in simple search, Typesense, Algolia, MCP, or a custom adapter.",
|
|
228
|
+
docs: "/docs/customization/search",
|
|
229
|
+
children: [{
|
|
230
|
+
path: "search.provider",
|
|
231
|
+
name: "provider",
|
|
232
|
+
type: "\"simple\" | \"typesense\" | \"algolia\" | \"mcp\" | \"custom\"",
|
|
233
|
+
default: "simple",
|
|
234
|
+
description: "Search backend used by the docs UI and MCP search tool."
|
|
235
|
+
}, {
|
|
236
|
+
path: "search.maxResults",
|
|
237
|
+
name: "maxResults",
|
|
238
|
+
type: "number",
|
|
239
|
+
description: "Maximum result count returned by search requests."
|
|
240
|
+
}]
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
path: "llmsTxt",
|
|
244
|
+
name: "llmsTxt",
|
|
245
|
+
type: "boolean | LlmsTxtConfig",
|
|
246
|
+
default: true,
|
|
247
|
+
description: "Generated /llms.txt, /llms-full.txt, optional section files, and basePath-aware aliases.",
|
|
248
|
+
docs: "/docs/getting-started/agent-ready-docs"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
path: "changelog",
|
|
252
|
+
name: "changelog",
|
|
253
|
+
type: "boolean | ChangelogConfig",
|
|
254
|
+
default: false,
|
|
255
|
+
description: "Generate changelog feed and entry pages from dated MDX entries.",
|
|
256
|
+
docs: "/docs/customization/changelog"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
path: "mcp",
|
|
260
|
+
name: "mcp",
|
|
261
|
+
type: "boolean | DocsMcpConfig",
|
|
262
|
+
default: true,
|
|
263
|
+
description: "Built-in MCP server over stdio plus HTTP routes at /mcp and /.well-known/mcp, backed by /api/docs/mcp.",
|
|
264
|
+
docs: "/docs/customization/mcp",
|
|
265
|
+
children: [
|
|
266
|
+
{
|
|
267
|
+
path: "mcp.enabled",
|
|
268
|
+
name: "enabled",
|
|
269
|
+
type: "boolean",
|
|
270
|
+
default: true,
|
|
271
|
+
description: "Enable the built-in MCP server."
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
path: "mcp.route",
|
|
275
|
+
name: "route",
|
|
276
|
+
type: "string",
|
|
277
|
+
default: "/api/docs/mcp",
|
|
278
|
+
description: "Canonical Streamable HTTP route used by the MCP endpoint."
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
path: "mcp.name",
|
|
282
|
+
name: "name",
|
|
283
|
+
type: "string",
|
|
284
|
+
default: "nav.title or @farming-labs/docs",
|
|
285
|
+
description: "Human-readable MCP server name reported to clients."
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
path: "mcp.version",
|
|
289
|
+
name: "version",
|
|
290
|
+
type: "string",
|
|
291
|
+
default: "0.0.0",
|
|
292
|
+
description: "Version string reported to MCP clients."
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
path: "mcp.tools",
|
|
296
|
+
name: "tools",
|
|
297
|
+
type: "DocsMcpToolsConfig",
|
|
298
|
+
default: "all enabled",
|
|
299
|
+
description: "Fine-grained built-in MCP tool toggles.",
|
|
300
|
+
children: [
|
|
301
|
+
{
|
|
302
|
+
path: "mcp.tools.listPages",
|
|
303
|
+
name: "listPages",
|
|
304
|
+
type: "boolean",
|
|
305
|
+
default: true,
|
|
306
|
+
description: "Expose the list_pages tool."
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
path: "mcp.tools.getNavigation",
|
|
310
|
+
name: "getNavigation",
|
|
311
|
+
type: "boolean",
|
|
312
|
+
default: true,
|
|
313
|
+
description: "Expose the get_navigation tool."
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
path: "mcp.tools.searchDocs",
|
|
317
|
+
name: "searchDocs",
|
|
318
|
+
type: "boolean",
|
|
319
|
+
default: true,
|
|
320
|
+
description: "Expose the search_docs tool."
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
path: "mcp.tools.readPage",
|
|
324
|
+
name: "readPage",
|
|
325
|
+
type: "boolean",
|
|
326
|
+
default: true,
|
|
327
|
+
description: "Expose the read_page tool."
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
path: "mcp.tools.getCodeExamples",
|
|
331
|
+
name: "getCodeExamples",
|
|
332
|
+
type: "boolean",
|
|
333
|
+
default: true,
|
|
334
|
+
description: "Expose the get_code_examples tool."
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
path: "mcp.tools.getConfigSchema",
|
|
338
|
+
name: "getConfigSchema",
|
|
339
|
+
type: "boolean",
|
|
340
|
+
default: true,
|
|
341
|
+
description: "Expose the get_config_schema tool."
|
|
342
|
+
}
|
|
343
|
+
]
|
|
344
|
+
}
|
|
345
|
+
]
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
path: "apiReference",
|
|
349
|
+
name: "apiReference",
|
|
350
|
+
type: "boolean | ApiReferenceConfig",
|
|
351
|
+
default: false,
|
|
352
|
+
description: "Generated API reference pages from framework route conventions or a hosted OpenAPI document.",
|
|
353
|
+
docs: "/docs/customization/api-reference",
|
|
354
|
+
children: [{
|
|
355
|
+
path: "apiReference.specUrl",
|
|
356
|
+
name: "specUrl",
|
|
357
|
+
type: "string",
|
|
358
|
+
description: "Remote OpenAPI JSON URL when the backend owns the schema."
|
|
359
|
+
}, {
|
|
360
|
+
path: "apiReference.path",
|
|
361
|
+
name: "path",
|
|
362
|
+
type: "string",
|
|
363
|
+
description: "Docs route where the API reference is rendered."
|
|
364
|
+
}]
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
path: "sitemap",
|
|
368
|
+
name: "sitemap",
|
|
369
|
+
type: "boolean | DocsSitemapConfig",
|
|
370
|
+
default: true,
|
|
371
|
+
description: "Generated sitemap.xml, sitemap.md, and /.well-known/sitemap.md."
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
path: "robots",
|
|
375
|
+
name: "robots",
|
|
376
|
+
type: "boolean | DocsRobotsConfig",
|
|
377
|
+
default: true,
|
|
378
|
+
description: "Runtime or generated robots.txt policy for docs routes, agent-readable files, and AI crawler user agents."
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
path: "metadata",
|
|
382
|
+
name: "metadata",
|
|
383
|
+
type: "DocsMetadata",
|
|
384
|
+
description: "SEO and JSON-LD inputs such as titleTemplate and description."
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
path: "og",
|
|
388
|
+
name: "og",
|
|
389
|
+
type: "OGConfig",
|
|
390
|
+
description: "Dynamic Open Graph image configuration."
|
|
391
|
+
}
|
|
392
|
+
];
|
|
393
|
+
const DOCS_CONFIG_SCHEMA_EXAMPLES = [{
|
|
394
|
+
title: "Minimal config",
|
|
395
|
+
code: `import { defineDocs } from "@farming-labs/docs";
|
|
396
|
+
import { fumadocs } from "@farming-labs/theme";
|
|
397
|
+
|
|
398
|
+
export default defineDocs({
|
|
399
|
+
entry: "docs",
|
|
400
|
+
theme: fumadocs(),
|
|
401
|
+
});`
|
|
402
|
+
}, {
|
|
403
|
+
title: "MCP tool toggles",
|
|
404
|
+
code: `export default defineDocs({
|
|
405
|
+
entry: "docs",
|
|
406
|
+
mcp: {
|
|
407
|
+
tools: {
|
|
408
|
+
getConfigSchema: true,
|
|
409
|
+
getCodeExamples: true,
|
|
410
|
+
},
|
|
411
|
+
},
|
|
412
|
+
});`
|
|
413
|
+
}];
|
|
16
414
|
const searchDocsInputSchema = z.object({
|
|
17
415
|
query: z.string().trim().min(1),
|
|
18
416
|
limit: z.number().int().min(1).max(25).optional(),
|
|
@@ -24,6 +422,10 @@ const readPageInputSchema = z.object({
|
|
|
24
422
|
});
|
|
25
423
|
const listPagesInputSchema = z.object({ locale: z.string().min(1).optional() });
|
|
26
424
|
const getNavigationInputSchema = z.object({ locale: z.string().min(1).optional() });
|
|
425
|
+
const getConfigSchemaInputSchema = z.object({
|
|
426
|
+
option: z.string().trim().min(1).optional(),
|
|
427
|
+
query: z.string().trim().min(1).optional()
|
|
428
|
+
});
|
|
27
429
|
const getCodeExamplesInputSchema = z.object({
|
|
28
430
|
query: z.string().trim().min(1).optional(),
|
|
29
431
|
path: z.string().min(1).optional(),
|
|
@@ -50,7 +452,8 @@ function resolveDocsMcpConfig(mcp, defaults = {}) {
|
|
|
50
452
|
readPage: true,
|
|
51
453
|
searchDocs: true,
|
|
52
454
|
getNavigation: true,
|
|
53
|
-
getCodeExamples: true
|
|
455
|
+
getCodeExamples: true,
|
|
456
|
+
getConfigSchema: true
|
|
54
457
|
}
|
|
55
458
|
};
|
|
56
459
|
const config = mcp && typeof mcp === "object" ? mcp : {};
|
|
@@ -64,7 +467,8 @@ function resolveDocsMcpConfig(mcp, defaults = {}) {
|
|
|
64
467
|
readPage: config.tools?.readPage ?? true,
|
|
65
468
|
searchDocs: config.tools?.searchDocs ?? true,
|
|
66
469
|
getNavigation: config.tools?.getNavigation ?? true,
|
|
67
|
-
getCodeExamples: config.tools?.getCodeExamples ?? true
|
|
470
|
+
getCodeExamples: config.tools?.getCodeExamples ?? true,
|
|
471
|
+
getConfigSchema: config.tools?.getConfigSchema ?? true
|
|
68
472
|
}
|
|
69
473
|
};
|
|
70
474
|
}
|
|
@@ -276,6 +680,82 @@ async function createDocsMcpServer(options) {
|
|
|
276
680
|
throw error;
|
|
277
681
|
}
|
|
278
682
|
});
|
|
683
|
+
if (resolved.tools.getConfigSchema) server.registerTool("get_config_schema", {
|
|
684
|
+
title: "Get docs config schema",
|
|
685
|
+
description: "Return structured docs.config.ts option metadata, optionally filtered by option path or query.",
|
|
686
|
+
inputSchema: getConfigSchemaInputSchema,
|
|
687
|
+
annotations: { readOnlyHint: true }
|
|
688
|
+
}, async ({ option, query }) => {
|
|
689
|
+
const startedAt = nowMs();
|
|
690
|
+
const trace = createDocsAgentTraceContext("mcp.tool.get_config_schema");
|
|
691
|
+
const callSpanId = createDocsAgentTraceId("span");
|
|
692
|
+
await emitDocsAgentTraceEvent(options.observability, {
|
|
693
|
+
type: "tool.call",
|
|
694
|
+
source: "mcp",
|
|
695
|
+
traceId: trace.traceId,
|
|
696
|
+
spanId: callSpanId,
|
|
697
|
+
name: "get_config_schema",
|
|
698
|
+
startedAt: trace.startedAt,
|
|
699
|
+
status: "started",
|
|
700
|
+
inputPreview: {
|
|
701
|
+
option,
|
|
702
|
+
queryLength: query?.length
|
|
703
|
+
},
|
|
704
|
+
metadata: { tool: "get_config_schema" }
|
|
705
|
+
});
|
|
706
|
+
try {
|
|
707
|
+
const schema = getDocsConfigSchema({
|
|
708
|
+
option,
|
|
709
|
+
query
|
|
710
|
+
});
|
|
711
|
+
const elapsed = durationMs(startedAt);
|
|
712
|
+
await emitDocsAnalyticsEvent(options.analytics, {
|
|
713
|
+
type: "mcp_tool",
|
|
714
|
+
source: "mcp",
|
|
715
|
+
input: query ? { query } : void 0,
|
|
716
|
+
properties: {
|
|
717
|
+
tool: "get_config_schema",
|
|
718
|
+
option,
|
|
719
|
+
queryLength: query?.length,
|
|
720
|
+
resultCount: schema.resultCount,
|
|
721
|
+
durationMs: elapsed
|
|
722
|
+
}
|
|
723
|
+
});
|
|
724
|
+
await emitDocsAgentTraceEvent(options.observability, {
|
|
725
|
+
type: "tool.result",
|
|
726
|
+
source: "mcp",
|
|
727
|
+
traceId: trace.traceId,
|
|
728
|
+
parentSpanId: callSpanId,
|
|
729
|
+
name: "get_config_schema",
|
|
730
|
+
startedAt: trace.startedAt,
|
|
731
|
+
endedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
732
|
+
durationMs: elapsed,
|
|
733
|
+
status: "success",
|
|
734
|
+
outputPreview: { resultCount: schema.resultCount },
|
|
735
|
+
metadata: { tool: "get_config_schema" }
|
|
736
|
+
});
|
|
737
|
+
return { content: [{
|
|
738
|
+
type: "text",
|
|
739
|
+
text: JSON.stringify(schema, null, 2)
|
|
740
|
+
}] };
|
|
741
|
+
} catch (error) {
|
|
742
|
+
const elapsed = durationMs(startedAt);
|
|
743
|
+
await emitDocsAgentTraceEvent(options.observability, {
|
|
744
|
+
type: "tool.error",
|
|
745
|
+
source: "mcp",
|
|
746
|
+
traceId: trace.traceId,
|
|
747
|
+
parentSpanId: callSpanId,
|
|
748
|
+
name: "get_config_schema",
|
|
749
|
+
startedAt: trace.startedAt,
|
|
750
|
+
endedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
751
|
+
durationMs: elapsed,
|
|
752
|
+
status: "error",
|
|
753
|
+
outputPreview: { message: error instanceof Error ? error.message : "Unknown error" },
|
|
754
|
+
metadata: { tool: "get_config_schema" }
|
|
755
|
+
});
|
|
756
|
+
throw error;
|
|
757
|
+
}
|
|
758
|
+
});
|
|
279
759
|
if (resolved.tools.searchDocs) server.registerTool("search_docs", {
|
|
280
760
|
title: "Search documentation",
|
|
281
761
|
description: "Search the docs by keyword across titles, descriptions, and page content.",
|
|
@@ -989,6 +1469,71 @@ function toSearchSourcePages(pages) {
|
|
|
989
1469
|
related: page.related
|
|
990
1470
|
}));
|
|
991
1471
|
}
|
|
1472
|
+
function getDocsConfigSchema(filters) {
|
|
1473
|
+
const option = filters.option?.trim();
|
|
1474
|
+
const query = filters.query?.trim();
|
|
1475
|
+
let options = DOCS_CONFIG_SCHEMA_OPTIONS.map(cloneConfigSchemaOption);
|
|
1476
|
+
if (option) options = selectConfigSchemaOptions(option);
|
|
1477
|
+
if (query) options = filterConfigSchemaOptionsByQuery(options, query);
|
|
1478
|
+
return {
|
|
1479
|
+
schemaVersion: 1,
|
|
1480
|
+
configFile: "docs.config.ts",
|
|
1481
|
+
description: "Configuration schema for @farming-labs/docs defineDocs(). Use option for an exact top-level or nested path, or query for keyword filtering.",
|
|
1482
|
+
filters: option || query ? {
|
|
1483
|
+
...option ? { option } : {},
|
|
1484
|
+
...query ? { query } : {}
|
|
1485
|
+
} : void 0,
|
|
1486
|
+
resultCount: countConfigSchemaOptions(options),
|
|
1487
|
+
options,
|
|
1488
|
+
examples: DOCS_CONFIG_SCHEMA_EXAMPLES
|
|
1489
|
+
};
|
|
1490
|
+
}
|
|
1491
|
+
function cloneConfigSchemaOption(option) {
|
|
1492
|
+
return {
|
|
1493
|
+
...option,
|
|
1494
|
+
children: option.children?.map(cloneConfigSchemaOption)
|
|
1495
|
+
};
|
|
1496
|
+
}
|
|
1497
|
+
function selectConfigSchemaOptions(optionPath) {
|
|
1498
|
+
const needle = normalizeConfigSchemaToken(optionPath);
|
|
1499
|
+
return flattenConfigSchemaOptions(DOCS_CONFIG_SCHEMA_OPTIONS).filter((option) => {
|
|
1500
|
+
return normalizeConfigSchemaToken(option.path) === needle;
|
|
1501
|
+
}).map(cloneConfigSchemaOption);
|
|
1502
|
+
}
|
|
1503
|
+
function filterConfigSchemaOptionsByQuery(options, query) {
|
|
1504
|
+
return options.flatMap((option) => {
|
|
1505
|
+
if (configSchemaOptionMatchesQuery(option, query)) return [cloneConfigSchemaOption(option)];
|
|
1506
|
+
const children = option.children ? filterConfigSchemaOptionsByQuery(option.children, query) : [];
|
|
1507
|
+
if (children.length === 0) return [];
|
|
1508
|
+
return [{
|
|
1509
|
+
...cloneConfigSchemaOption(option),
|
|
1510
|
+
children
|
|
1511
|
+
}];
|
|
1512
|
+
});
|
|
1513
|
+
}
|
|
1514
|
+
function configSchemaOptionMatchesQuery(option, query) {
|
|
1515
|
+
const searchText = [
|
|
1516
|
+
option.path,
|
|
1517
|
+
option.name,
|
|
1518
|
+
option.type,
|
|
1519
|
+
option.default,
|
|
1520
|
+
option.description,
|
|
1521
|
+
option.docs,
|
|
1522
|
+
option.values?.join(" ")
|
|
1523
|
+
].filter((value) => value !== void 0 && value !== null).join(" ");
|
|
1524
|
+
const lowerSearchText = searchText.toLowerCase();
|
|
1525
|
+
const lowerQuery = query.toLowerCase();
|
|
1526
|
+
return lowerSearchText.includes(lowerQuery) || normalizeConfigSchemaToken(searchText).includes(normalizeConfigSchemaToken(query));
|
|
1527
|
+
}
|
|
1528
|
+
function flattenConfigSchemaOptions(options) {
|
|
1529
|
+
return options.flatMap((option) => [option, ...option.children ? flattenConfigSchemaOptions(option.children) : []]);
|
|
1530
|
+
}
|
|
1531
|
+
function countConfigSchemaOptions(options) {
|
|
1532
|
+
return flattenConfigSchemaOptions(options).length;
|
|
1533
|
+
}
|
|
1534
|
+
function normalizeConfigSchemaToken(value) {
|
|
1535
|
+
return value.trim().toLowerCase().replace(/^docs\.config\.?/, "").replace(/[`'"]/g, "").replace(/[_\-\s]+/g, "");
|
|
1536
|
+
}
|
|
992
1537
|
function isSelfMcpSearchEndpoint(search, route) {
|
|
993
1538
|
if (!search || search === true || typeof search !== "object" || search.provider !== "mcp") return false;
|
|
994
1539
|
const endpoint = search.endpoint.trim();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as DocsObservabilityEventInput, Et as ResolvedDocsRelatedLink, It as TypesenseDocsSearchConfig, J as DocsSearchConfig, K as DocsSearchAdapterFactory, Q as DocsSearchResult, R as DocsObservabilityConfig, W as DocsSearchAdapter, Y as DocsSearchDocument, _ as DocsAnalyticsConfig, _t as OpenDocsTarget, d as CustomDocsSearchConfig, dt as McpDocsSearchConfig, et as DocsSearchSourcePage, k as DocsAskAIMcpConfig, m as DocsAgentTraceEventInput, mt as OpenDocsProvider, q as DocsSearchChunkingConfig, r as AlgoliaDocsSearchConfig, tt as DocsSitemapConfig, v as DocsAnalyticsEvent, y as DocsAnalyticsEventInput, z as DocsObservabilityEvent } from "./types-
|
|
1
|
+
import { B as DocsObservabilityEventInput, Et as ResolvedDocsRelatedLink, It as TypesenseDocsSearchConfig, J as DocsSearchConfig, K as DocsSearchAdapterFactory, Q as DocsSearchResult, R as DocsObservabilityConfig, W as DocsSearchAdapter, Y as DocsSearchDocument, _ as DocsAnalyticsConfig, _t as OpenDocsTarget, d as CustomDocsSearchConfig, dt as McpDocsSearchConfig, et as DocsSearchSourcePage, k as DocsAskAIMcpConfig, m as DocsAgentTraceEventInput, mt as OpenDocsProvider, q as DocsSearchChunkingConfig, r as AlgoliaDocsSearchConfig, tt as DocsSitemapConfig, v as DocsAnalyticsEvent, y as DocsAnalyticsEventInput, z as DocsObservabilityEvent } from "./types-D-cNOo-t.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/cloud-analytics.d.ts
|
|
4
4
|
interface DocsCloudAnalyticsOptions {
|
package/dist/server.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as DocsConfig, B as DocsObservabilityEventInput, D as DocsAskAIFeedbackMessage, E as DocsAskAIFeedbackData, G as DocsSearchAdapterContext, J as DocsSearchConfig, K as DocsSearchAdapterFactory, O as DocsAskAIFeedbackValue, Q as DocsSearchResult, R as DocsObservabilityConfig, T as DocsAskAIFeedbackConfig, W as DocsSearchAdapter, Y as DocsSearchDocument, Z as DocsSearchQuery, _ as DocsAnalyticsConfig, a as ApiReferenceRenderer, dt as McpDocsSearchConfig, et as DocsSearchSourcePage, g as DocsAgentTraceStatus, h as DocsAgentTraceEventType, k as DocsAskAIMcpConfig, m as DocsAgentTraceEventInput, tt as DocsSitemapConfig, v as DocsAnalyticsEvent, y as DocsAnalyticsEventInput, z as DocsObservabilityEvent } from "./types-
|
|
2
|
-
import { $ as emitDocsAgentTraceEvent, A as toDocsSitemapMarkdownUrl, B as parsePromptStringArray, C as createDocsSitemapResponse, D as resolveDocsSitemapConfig, E as renderDocsSitemapXml, F as PromptAction, G as serializeOpenDocsProvider, H as sanitizePromptText, I as PromptProviderChoice, J as DocsAgentTraceContext, K as serializeOpenDocsProviders, L as SerializeOpenDocsProviderOptions, M as DEFAULT_OPEN_DOCS_PROVIDER_IDS, N as DEFAULT_OPEN_DOCS_TARGET, O as resolveDocsSitemapPageLastmod, P as DEFAULT_PROMPT_PROVIDER_TEMPLATES, Q as createDocsAgentTraceId, R as SerializedOpenDocsProvider, S as buildDocsSitemapManifest, T as renderDocsSitemapMarkdown, U as serializeDocsIcon, V as resolvePromptProviderChoices, W as serializeDocsIconRegistry, X as ResolvedDocsObservabilityConfig, Y as ResolvedDocsAnalyticsConfig, Z as createDocsAgentTraceContext, _ as DocsSitemapFormat, a as createMcpSearchAdapter, at as createDocsCloudAnalytics, b as DocsSitemapPageInput, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, et as emitDocsAnalyticsEvent, f as resolveSearchRequestConfig, g as DEFAULT_SITEMAP_XML_ROUTE, h as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, i as createCustomSearchAdapter, it as DocsCloudAnalyticsOptions, j as DEFAULT_OPEN_DOCS_PROMPT, k as resolveDocsSitemapRequest, l as inferDocsAskAIPackageHints, m as DEFAULT_SITEMAP_MD_ROUTE, n as buildDocsSearchDocuments, nt as resolveDocsAnalyticsConfig, o as createSimpleSearchAdapter, p as DEFAULT_SITEMAP_MANIFEST_PATH, q as DOCS_AGENT_TRACE_EVENT_TYPES, r as createAlgoliaSearchAdapter, rt as resolveDocsObservabilityConfig, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, tt as emitDocsObservabilityEvent, u as performDocsSearch, v as DocsSitemapManifest, w as readDocsSitemapManifestFromContentMap, x as DocsSitemapResolvedConfig, y as DocsSitemapManifestPage, z as normalizePromptProviderName } from "./search-
|
|
3
|
-
import { DocsMcpCodeExample, DocsMcpHttpHandlers, DocsMcpNavigationNode, DocsMcpNavigationTree, DocsMcpPage, DocsMcpResolvedConfig, DocsMcpSource, createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, normalizeDocsMcpRoute, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
1
|
+
import { A as DocsConfig, B as DocsObservabilityEventInput, D as DocsAskAIFeedbackMessage, E as DocsAskAIFeedbackData, G as DocsSearchAdapterContext, J as DocsSearchConfig, K as DocsSearchAdapterFactory, O as DocsAskAIFeedbackValue, Q as DocsSearchResult, R as DocsObservabilityConfig, T as DocsAskAIFeedbackConfig, W as DocsSearchAdapter, Y as DocsSearchDocument, Z as DocsSearchQuery, _ as DocsAnalyticsConfig, a as ApiReferenceRenderer, dt as McpDocsSearchConfig, et as DocsSearchSourcePage, g as DocsAgentTraceStatus, h as DocsAgentTraceEventType, k as DocsAskAIMcpConfig, m as DocsAgentTraceEventInput, tt as DocsSitemapConfig, v as DocsAnalyticsEvent, y as DocsAnalyticsEventInput, z as DocsObservabilityEvent } from "./types-D-cNOo-t.mjs";
|
|
2
|
+
import { $ as emitDocsAgentTraceEvent, A as toDocsSitemapMarkdownUrl, B as parsePromptStringArray, C as createDocsSitemapResponse, D as resolveDocsSitemapConfig, E as renderDocsSitemapXml, F as PromptAction, G as serializeOpenDocsProvider, H as sanitizePromptText, I as PromptProviderChoice, J as DocsAgentTraceContext, K as serializeOpenDocsProviders, L as SerializeOpenDocsProviderOptions, M as DEFAULT_OPEN_DOCS_PROVIDER_IDS, N as DEFAULT_OPEN_DOCS_TARGET, O as resolveDocsSitemapPageLastmod, P as DEFAULT_PROMPT_PROVIDER_TEMPLATES, Q as createDocsAgentTraceId, R as SerializedOpenDocsProvider, S as buildDocsSitemapManifest, T as renderDocsSitemapMarkdown, U as serializeDocsIcon, V as resolvePromptProviderChoices, W as serializeDocsIconRegistry, X as ResolvedDocsObservabilityConfig, Y as ResolvedDocsAnalyticsConfig, Z as createDocsAgentTraceContext, _ as DocsSitemapFormat, a as createMcpSearchAdapter, at as createDocsCloudAnalytics, b as DocsSitemapPageInput, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, et as emitDocsAnalyticsEvent, f as resolveSearchRequestConfig, g as DEFAULT_SITEMAP_XML_ROUTE, h as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, i as createCustomSearchAdapter, it as DocsCloudAnalyticsOptions, j as DEFAULT_OPEN_DOCS_PROMPT, k as resolveDocsSitemapRequest, l as inferDocsAskAIPackageHints, m as DEFAULT_SITEMAP_MD_ROUTE, n as buildDocsSearchDocuments, nt as resolveDocsAnalyticsConfig, o as createSimpleSearchAdapter, p as DEFAULT_SITEMAP_MANIFEST_PATH, q as DOCS_AGENT_TRACE_EVENT_TYPES, r as createAlgoliaSearchAdapter, rt as resolveDocsObservabilityConfig, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, tt as emitDocsObservabilityEvent, u as performDocsSearch, v as DocsSitemapManifest, w as readDocsSitemapManifestFromContentMap, x as DocsSitemapResolvedConfig, y as DocsSitemapManifestPage, z as normalizePromptProviderName } from "./search-Dlwp88qb.mjs";
|
|
3
|
+
import { DocsMcpCodeExample, DocsMcpConfigSchema, DocsMcpConfigSchemaOption, 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
|
|
6
6
|
type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD";
|
|
@@ -55,4 +55,4 @@ declare function buildApiReferenceHtmlDocumentAsync(config: DocsConfig, options:
|
|
|
55
55
|
//#region src/sitemap-server.d.ts
|
|
56
56
|
declare function readDocsSitemapManifest(rootDir: string, sitemap?: boolean | DocsSitemapConfig): DocsSitemapManifest | null;
|
|
57
57
|
//#endregion
|
|
58
|
-
export { type ApiReferenceFramework, type ApiReferenceOpenApiDiscovery, type ApiReferenceRenderer, type ApiReferenceRoute, DEFAULT_API_REFERENCE_OPENAPI_ROUTE, DEFAULT_OPEN_DOCS_PROMPT, DEFAULT_OPEN_DOCS_PROVIDER_IDS, DEFAULT_OPEN_DOCS_TARGET, DEFAULT_PROMPT_PROVIDER_TEMPLATES, DEFAULT_SITEMAP_MANIFEST_PATH, DEFAULT_SITEMAP_MD_ROUTE, DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, DEFAULT_SITEMAP_XML_ROUTE, DOCS_AGENT_TRACE_EVENT_TYPES, type DocsAgentTraceContext, type DocsAgentTraceEventInput, type DocsAgentTraceEventType, type DocsAgentTraceStatus, type DocsAnalyticsConfig, type DocsAnalyticsEvent, type DocsAnalyticsEventInput, type DocsAskAIFeedbackConfig, type DocsAskAIFeedbackData, type DocsAskAIFeedbackMessage, type DocsAskAIFeedbackValue, type DocsAskAIMcpConfig, type DocsCloudAnalyticsOptions, type DocsMcpCodeExample, type DocsMcpHttpHandlers, type DocsMcpNavigationNode, type DocsMcpNavigationTree, type DocsMcpPage, type DocsMcpResolvedConfig, type DocsMcpSource, type DocsObservabilityConfig, type DocsObservabilityEvent, type DocsObservabilityEventInput, type DocsSearchAdapter, type DocsSearchAdapterContext, type DocsSearchAdapterFactory, type DocsSearchConfig, type DocsSearchDocument, type DocsSearchQuery, type DocsSearchResult, type DocsSearchSourcePage, type DocsSitemapFormat, type DocsSitemapManifest, type DocsSitemapManifestPage, type DocsSitemapPageInput, type DocsSitemapResolvedConfig, type McpDocsSearchConfig, type PromptAction, type PromptProviderChoice, type ResolvedApiReferenceConfig, type ResolvedDocsAnalyticsConfig, type ResolvedDocsObservabilityConfig, type SerializeOpenDocsProviderOptions, type SerializedOpenDocsProvider, buildApiReferenceHtmlDocument, buildApiReferenceHtmlDocumentAsync, buildApiReferenceOpenApiDocument, buildApiReferenceOpenApiDocumentAsync, buildApiReferencePageTitle, buildApiReferenceScalarCss, buildDocsAskAIContext, buildDocsSearchDocuments, buildDocsSitemapManifest, createAlgoliaSearchAdapter, createCustomSearchAdapter, createDocsAgentTraceContext, createDocsAgentTraceId, createDocsCloudAnalytics, createDocsMcpHttpHandler, createDocsMcpServer, createDocsSitemapResponse, createFilesystemDocsMcpSource, createMcpSearchAdapter, createSimpleSearchAdapter, createTypesenseSearchAdapter, emitDocsAgentTraceEvent, emitDocsAnalyticsEvent, emitDocsObservabilityEvent, formatDocsAskAIPackageHints, inferDocsAskAIPackageHints, isApiReferenceOpenApiRequest, normalizeDocsMcpRoute, normalizePromptProviderName, parsePromptStringArray, performDocsSearch, readDocsSitemapManifest, readDocsSitemapManifestFromContentMap, renderDocsSitemapMarkdown, renderDocsSitemapXml, resolveApiReferenceConfig, resolveApiReferenceOpenApiDiscovery, resolveApiReferenceRenderer, resolveAskAISearchRequestConfig, resolveDocsAnalyticsConfig, resolveDocsMcpConfig, resolveDocsObservabilityConfig, resolveDocsSitemapConfig, resolveDocsSitemapPageLastmod, resolveDocsSitemapRequest, resolvePromptProviderChoices, resolveSearchRequestConfig, runDocsMcpStdio, sanitizePromptText, serializeDocsIcon, serializeDocsIconRegistry, serializeOpenDocsProvider, serializeOpenDocsProviders, toDocsSitemapMarkdownUrl };
|
|
58
|
+
export { type ApiReferenceFramework, type ApiReferenceOpenApiDiscovery, type ApiReferenceRenderer, type ApiReferenceRoute, DEFAULT_API_REFERENCE_OPENAPI_ROUTE, DEFAULT_OPEN_DOCS_PROMPT, DEFAULT_OPEN_DOCS_PROVIDER_IDS, DEFAULT_OPEN_DOCS_TARGET, DEFAULT_PROMPT_PROVIDER_TEMPLATES, DEFAULT_SITEMAP_MANIFEST_PATH, DEFAULT_SITEMAP_MD_ROUTE, DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, DEFAULT_SITEMAP_XML_ROUTE, DOCS_AGENT_TRACE_EVENT_TYPES, type DocsAgentTraceContext, type DocsAgentTraceEventInput, type DocsAgentTraceEventType, type DocsAgentTraceStatus, type DocsAnalyticsConfig, type DocsAnalyticsEvent, type DocsAnalyticsEventInput, type DocsAskAIFeedbackConfig, type DocsAskAIFeedbackData, type DocsAskAIFeedbackMessage, type DocsAskAIFeedbackValue, type DocsAskAIMcpConfig, type DocsCloudAnalyticsOptions, type DocsMcpCodeExample, type DocsMcpConfigSchema, type DocsMcpConfigSchemaOption, type DocsMcpHttpHandlers, type DocsMcpNavigationNode, type DocsMcpNavigationTree, type DocsMcpPage, type DocsMcpResolvedConfig, type DocsMcpSource, type DocsObservabilityConfig, type DocsObservabilityEvent, type DocsObservabilityEventInput, type DocsSearchAdapter, type DocsSearchAdapterContext, type DocsSearchAdapterFactory, type DocsSearchConfig, type DocsSearchDocument, type DocsSearchQuery, type DocsSearchResult, type DocsSearchSourcePage, type DocsSitemapFormat, type DocsSitemapManifest, type DocsSitemapManifestPage, type DocsSitemapPageInput, type DocsSitemapResolvedConfig, type McpDocsSearchConfig, type PromptAction, type PromptProviderChoice, type ResolvedApiReferenceConfig, type ResolvedDocsAnalyticsConfig, type ResolvedDocsObservabilityConfig, type SerializeOpenDocsProviderOptions, type SerializedOpenDocsProvider, buildApiReferenceHtmlDocument, buildApiReferenceHtmlDocumentAsync, buildApiReferenceOpenApiDocument, buildApiReferenceOpenApiDocumentAsync, buildApiReferencePageTitle, buildApiReferenceScalarCss, buildDocsAskAIContext, buildDocsSearchDocuments, buildDocsSitemapManifest, createAlgoliaSearchAdapter, createCustomSearchAdapter, createDocsAgentTraceContext, createDocsAgentTraceId, createDocsCloudAnalytics, createDocsMcpHttpHandler, createDocsMcpServer, createDocsSitemapResponse, createFilesystemDocsMcpSource, createMcpSearchAdapter, createSimpleSearchAdapter, createTypesenseSearchAdapter, emitDocsAgentTraceEvent, emitDocsAnalyticsEvent, emitDocsObservabilityEvent, formatDocsAskAIPackageHints, inferDocsAskAIPackageHints, isApiReferenceOpenApiRequest, normalizeDocsMcpRoute, normalizePromptProviderName, parsePromptStringArray, performDocsSearch, readDocsSitemapManifest, readDocsSitemapManifestFromContentMap, renderDocsSitemapMarkdown, renderDocsSitemapXml, resolveApiReferenceConfig, resolveApiReferenceOpenApiDiscovery, resolveApiReferenceRenderer, resolveAskAISearchRequestConfig, resolveDocsAnalyticsConfig, resolveDocsMcpConfig, resolveDocsObservabilityConfig, resolveDocsSitemapConfig, resolveDocsSitemapPageLastmod, resolveDocsSitemapRequest, resolvePromptProviderChoices, resolveSearchRequestConfig, runDocsMcpStdio, sanitizePromptText, serializeDocsIcon, serializeDocsIconRegistry, serializeOpenDocsProvider, serializeOpenDocsProviders, toDocsSitemapMarkdownUrl };
|
|
@@ -989,6 +989,8 @@ interface DocsMcpToolsConfig {
|
|
|
989
989
|
getNavigation?: boolean;
|
|
990
990
|
/** Expose a `get_code_examples` tool for fenced code blocks and their metadata. */
|
|
991
991
|
getCodeExamples?: boolean;
|
|
992
|
+
/** Expose a `get_config_schema` tool for docs.config option metadata. */
|
|
993
|
+
getConfigSchema?: boolean;
|
|
992
994
|
}
|
|
993
995
|
/**
|
|
994
996
|
* Built-in MCP server configuration.
|