@farming-labs/docs 0.1.117 → 0.1.118
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-CaDyUn0F.mjs → doctor-CU4knIej.mjs} +1 -0
- package/dist/index.d.mts +3 -2
- package/dist/{mcp-BUf-9KXn.mjs → mcp-BMgH1Q33.mjs} +1 -0
- package/dist/mcp.d.mts +30 -2
- package/dist/mcp.mjs +280 -0
- package/dist/{search-Dlwp88qb.d.mts → search-Dqu1Q27e.d.mts} +1 -1
- package/dist/server.d.mts +4 -4
- package/dist/{types-D-cNOo-t.d.mts → types-Dts3a32G.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-BMgH1Q33.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-CU4knIej.mjs");
|
|
118
118
|
const doctorOptions = parseDoctorArgs(args.slice(1));
|
|
119
119
|
if (doctorOptions.help) {
|
|
120
120
|
printDoctorHelp();
|
|
@@ -952,6 +952,7 @@ async function probeMcpRoute(baseUrl, route) {
|
|
|
952
952
|
const tools = toolsPayload.result?.tools;
|
|
953
953
|
const toolNames = Array.isArray(tools) ? tools.map((tool) => tool.name).filter((name) => typeof name === "string") : [];
|
|
954
954
|
const missingTools = [
|
|
955
|
+
"list_docs",
|
|
955
956
|
"list_pages",
|
|
956
957
|
"get_navigation",
|
|
957
958
|
"search_docs",
|
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-Dts3a32G.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-Dqu1Q27e.mjs";
|
|
3
3
|
import { DocsMcpPage, DocsMcpResolvedConfig } from "./mcp.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/define-docs.d.ts
|
|
@@ -597,6 +597,7 @@ declare function buildDocsAgentDiscoverySpec({
|
|
|
597
597
|
name: string;
|
|
598
598
|
version: string;
|
|
599
599
|
tools: {
|
|
600
|
+
listDocs: boolean;
|
|
600
601
|
listPages: boolean;
|
|
601
602
|
readPage: boolean;
|
|
602
603
|
searchDocs: boolean;
|
|
@@ -35,6 +35,7 @@ function readMcpConfig(content) {
|
|
|
35
35
|
name: readStringProperty(block, "name"),
|
|
36
36
|
version: readStringProperty(block, "version"),
|
|
37
37
|
tools: {
|
|
38
|
+
listDocs: readBooleanProperty(block, "listDocs"),
|
|
38
39
|
listPages: readBooleanProperty(block, "listPages"),
|
|
39
40
|
readPage: readBooleanProperty(block, "readPage"),
|
|
40
41
|
searchDocs: readBooleanProperty(block, "searchDocs"),
|
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-Dts3a32G.mjs";
|
|
2
2
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
3
|
|
|
4
4
|
//#region src/mcp.d.ts
|
|
@@ -36,6 +36,33 @@ interface DocsMcpCodeExample {
|
|
|
36
36
|
meta: Record<string, string | boolean>;
|
|
37
37
|
code: string;
|
|
38
38
|
}
|
|
39
|
+
interface DocsMcpDocsPageSummary {
|
|
40
|
+
slug: string;
|
|
41
|
+
url: string;
|
|
42
|
+
title: string;
|
|
43
|
+
description?: string;
|
|
44
|
+
icon?: string;
|
|
45
|
+
sourcePath?: string;
|
|
46
|
+
lastModified?: string;
|
|
47
|
+
}
|
|
48
|
+
interface DocsMcpDocsSection {
|
|
49
|
+
slug: string;
|
|
50
|
+
title: string;
|
|
51
|
+
url?: string;
|
|
52
|
+
description?: string;
|
|
53
|
+
icon?: string;
|
|
54
|
+
pageCount: number;
|
|
55
|
+
pages: DocsMcpDocsPageSummary[];
|
|
56
|
+
sections: DocsMcpDocsSection[];
|
|
57
|
+
}
|
|
58
|
+
interface DocsMcpDocsList {
|
|
59
|
+
section?: string;
|
|
60
|
+
resultCount: number;
|
|
61
|
+
sectionCount: number;
|
|
62
|
+
pages: DocsMcpDocsPageSummary[];
|
|
63
|
+
rootPages: DocsMcpDocsPageSummary[];
|
|
64
|
+
sections: DocsMcpDocsSection[];
|
|
65
|
+
}
|
|
39
66
|
interface DocsMcpConfigSchemaOption {
|
|
40
67
|
path: string;
|
|
41
68
|
name: string;
|
|
@@ -92,6 +119,7 @@ interface DocsMcpResolvedConfig {
|
|
|
92
119
|
name: string;
|
|
93
120
|
version: string;
|
|
94
121
|
tools: {
|
|
122
|
+
listDocs: boolean;
|
|
95
123
|
listPages: boolean;
|
|
96
124
|
readPage: boolean;
|
|
97
125
|
searchDocs: boolean;
|
|
@@ -138,4 +166,4 @@ declare function createDocsMcpServer(options: CreateDocsMcpServerOptions): Promi
|
|
|
138
166
|
declare function createDocsMcpHttpHandler(options: CreateDocsMcpServerOptions): DocsMcpHttpHandlers;
|
|
139
167
|
declare function runDocsMcpStdio(options: CreateDocsMcpServerOptions): Promise<void>;
|
|
140
168
|
//#endregion
|
|
141
|
-
export { DocsMcpCodeExample, DocsMcpConfigSchema, DocsMcpConfigSchemaOption, DocsMcpFolderNode, DocsMcpHttpHandlers, DocsMcpNavigationNode, DocsMcpNavigationTree, DocsMcpPage, DocsMcpPageNode, DocsMcpResolvedConfig, DocsMcpSource, createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, normalizeDocsMcpRoute, resolveDocsMcpConfig, runDocsMcpStdio };
|
|
169
|
+
export { DocsMcpCodeExample, DocsMcpConfigSchema, DocsMcpConfigSchemaOption, DocsMcpDocsList, DocsMcpDocsPageSummary, DocsMcpDocsSection, DocsMcpFolderNode, DocsMcpHttpHandlers, DocsMcpNavigationNode, DocsMcpNavigationTree, DocsMcpPage, DocsMcpPageNode, DocsMcpResolvedConfig, DocsMcpSource, createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, normalizeDocsMcpRoute, resolveDocsMcpConfig, runDocsMcpStdio };
|
package/dist/mcp.mjs
CHANGED
|
@@ -298,6 +298,13 @@ const DOCS_CONFIG_SCHEMA_OPTIONS = [
|
|
|
298
298
|
default: "all enabled",
|
|
299
299
|
description: "Fine-grained built-in MCP tool toggles.",
|
|
300
300
|
children: [
|
|
301
|
+
{
|
|
302
|
+
path: "mcp.tools.listDocs",
|
|
303
|
+
name: "listDocs",
|
|
304
|
+
type: "boolean",
|
|
305
|
+
default: true,
|
|
306
|
+
description: "Expose the list_docs tool."
|
|
307
|
+
},
|
|
301
308
|
{
|
|
302
309
|
path: "mcp.tools.listPages",
|
|
303
310
|
name: "listPages",
|
|
@@ -405,6 +412,7 @@ export default defineDocs({
|
|
|
405
412
|
entry: "docs",
|
|
406
413
|
mcp: {
|
|
407
414
|
tools: {
|
|
415
|
+
listDocs: true,
|
|
408
416
|
getConfigSchema: true,
|
|
409
417
|
getCodeExamples: true,
|
|
410
418
|
},
|
|
@@ -421,6 +429,10 @@ const readPageInputSchema = z.object({
|
|
|
421
429
|
locale: z.string().min(1).optional()
|
|
422
430
|
});
|
|
423
431
|
const listPagesInputSchema = z.object({ locale: z.string().min(1).optional() });
|
|
432
|
+
const listDocsInputSchema = z.object({
|
|
433
|
+
section: z.string().trim().min(1).optional(),
|
|
434
|
+
locale: z.string().min(1).optional()
|
|
435
|
+
});
|
|
424
436
|
const getNavigationInputSchema = z.object({ locale: z.string().min(1).optional() });
|
|
425
437
|
const getConfigSchemaInputSchema = z.object({
|
|
426
438
|
option: z.string().trim().min(1).optional(),
|
|
@@ -448,6 +460,7 @@ function resolveDocsMcpConfig(mcp, defaults = {}) {
|
|
|
448
460
|
name: defaults.defaultName ?? DEFAULT_MCP_NAME,
|
|
449
461
|
version: defaults.defaultVersion ?? DEFAULT_MCP_VERSION,
|
|
450
462
|
tools: {
|
|
463
|
+
listDocs: true,
|
|
451
464
|
listPages: true,
|
|
452
465
|
readPage: true,
|
|
453
466
|
searchDocs: true,
|
|
@@ -463,6 +476,7 @@ function resolveDocsMcpConfig(mcp, defaults = {}) {
|
|
|
463
476
|
name: config.name ?? defaults.defaultName ?? DEFAULT_MCP_NAME,
|
|
464
477
|
version: config.version ?? defaults.defaultVersion ?? DEFAULT_MCP_VERSION,
|
|
465
478
|
tools: {
|
|
479
|
+
listDocs: config.tools?.listDocs ?? true,
|
|
466
480
|
listPages: config.tools?.listPages ?? true,
|
|
467
481
|
readPage: config.tools?.readPage ?? true,
|
|
468
482
|
searchDocs: config.tools?.searchDocs ?? true,
|
|
@@ -610,6 +624,88 @@ async function createDocsMcpServer(options) {
|
|
|
610
624
|
throw error;
|
|
611
625
|
}
|
|
612
626
|
});
|
|
627
|
+
if (resolved.tools.listDocs) server.registerTool("list_docs", {
|
|
628
|
+
title: "List docs by section",
|
|
629
|
+
description: "List documentation pages grouped by section, optionally narrowed to one section.",
|
|
630
|
+
inputSchema: listDocsInputSchema,
|
|
631
|
+
annotations: { readOnlyHint: true }
|
|
632
|
+
}, async ({ section, locale }) => {
|
|
633
|
+
const startedAt = nowMs();
|
|
634
|
+
const trace = createDocsAgentTraceContext("mcp.tool.list_docs");
|
|
635
|
+
const callSpanId = createDocsAgentTraceId("span");
|
|
636
|
+
await emitDocsAgentTraceEvent(options.observability, {
|
|
637
|
+
type: "tool.call",
|
|
638
|
+
source: "mcp",
|
|
639
|
+
traceId: trace.traceId,
|
|
640
|
+
spanId: callSpanId,
|
|
641
|
+
name: "list_docs",
|
|
642
|
+
startedAt: trace.startedAt,
|
|
643
|
+
status: "started",
|
|
644
|
+
locale,
|
|
645
|
+
inputPreview: {
|
|
646
|
+
section,
|
|
647
|
+
locale
|
|
648
|
+
},
|
|
649
|
+
metadata: { tool: "list_docs" }
|
|
650
|
+
});
|
|
651
|
+
try {
|
|
652
|
+
const docs = listDocsBySection(dedupePages(await options.source.getPages(locale)), {
|
|
653
|
+
section,
|
|
654
|
+
entry: options.source.entry
|
|
655
|
+
});
|
|
656
|
+
const elapsed = durationMs(startedAt);
|
|
657
|
+
await emitDocsAnalyticsEvent(options.analytics, {
|
|
658
|
+
type: "mcp_tool",
|
|
659
|
+
source: "mcp",
|
|
660
|
+
locale,
|
|
661
|
+
properties: {
|
|
662
|
+
tool: "list_docs",
|
|
663
|
+
section,
|
|
664
|
+
resultCount: docs.resultCount,
|
|
665
|
+
sectionCount: docs.sectionCount,
|
|
666
|
+
durationMs: elapsed
|
|
667
|
+
}
|
|
668
|
+
});
|
|
669
|
+
await emitDocsAgentTraceEvent(options.observability, {
|
|
670
|
+
type: "tool.result",
|
|
671
|
+
source: "mcp",
|
|
672
|
+
traceId: trace.traceId,
|
|
673
|
+
parentSpanId: callSpanId,
|
|
674
|
+
name: "list_docs",
|
|
675
|
+
startedAt: trace.startedAt,
|
|
676
|
+
endedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
677
|
+
durationMs: elapsed,
|
|
678
|
+
status: "success",
|
|
679
|
+
locale,
|
|
680
|
+
outputPreview: {
|
|
681
|
+
resultCount: docs.resultCount,
|
|
682
|
+
sectionCount: docs.sectionCount
|
|
683
|
+
},
|
|
684
|
+
metadata: { tool: "list_docs" }
|
|
685
|
+
});
|
|
686
|
+
return { content: [{
|
|
687
|
+
type: "text",
|
|
688
|
+
text: JSON.stringify(docs, null, 2)
|
|
689
|
+
}] };
|
|
690
|
+
} catch (error) {
|
|
691
|
+
const elapsed = durationMs(startedAt);
|
|
692
|
+
await emitDocsAgentTraceEvent(options.observability, {
|
|
693
|
+
type: "tool.error",
|
|
694
|
+
source: "mcp",
|
|
695
|
+
traceId: trace.traceId,
|
|
696
|
+
parentSpanId: callSpanId,
|
|
697
|
+
name: "list_docs",
|
|
698
|
+
startedAt: trace.startedAt,
|
|
699
|
+
endedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
700
|
+
durationMs: elapsed,
|
|
701
|
+
status: "error",
|
|
702
|
+
locale,
|
|
703
|
+
outputPreview: { message: error instanceof Error ? error.message : "Unknown error" },
|
|
704
|
+
metadata: { tool: "list_docs" }
|
|
705
|
+
});
|
|
706
|
+
throw error;
|
|
707
|
+
}
|
|
708
|
+
});
|
|
613
709
|
if (resolved.tools.getNavigation) server.registerTool("get_navigation", {
|
|
614
710
|
title: "Get docs navigation",
|
|
615
711
|
description: "Return the documentation navigation tree for the current docs site.",
|
|
@@ -1559,6 +1655,190 @@ function toPageSummaries(pages) {
|
|
|
1559
1655
|
icon: page.icon
|
|
1560
1656
|
}));
|
|
1561
1657
|
}
|
|
1658
|
+
function toDocsListPageSummary(page) {
|
|
1659
|
+
return {
|
|
1660
|
+
slug: page.slug,
|
|
1661
|
+
url: page.url,
|
|
1662
|
+
title: page.title,
|
|
1663
|
+
description: page.description,
|
|
1664
|
+
icon: page.icon,
|
|
1665
|
+
sourcePath: page.sourcePath,
|
|
1666
|
+
lastModified: page.lastModified
|
|
1667
|
+
};
|
|
1668
|
+
}
|
|
1669
|
+
function listDocsBySection(pages, filters) {
|
|
1670
|
+
const allPages = pages.map(toDocsListPageSummary);
|
|
1671
|
+
const tree = buildDocsSectionTree(pages);
|
|
1672
|
+
const requestedSection = filters.section?.trim();
|
|
1673
|
+
if (!requestedSection) return {
|
|
1674
|
+
resultCount: allPages.length,
|
|
1675
|
+
sectionCount: countDocsSections(tree.sections),
|
|
1676
|
+
pages: allPages,
|
|
1677
|
+
rootPages: tree.rootPages,
|
|
1678
|
+
sections: tree.sections
|
|
1679
|
+
};
|
|
1680
|
+
const section = findDocsSection(tree.sections, requestedSection, filters.entry);
|
|
1681
|
+
if (section) {
|
|
1682
|
+
const sections = [cloneDocsSection(section)];
|
|
1683
|
+
const matchedPages = flattenDocsSectionPages(sections[0]);
|
|
1684
|
+
return {
|
|
1685
|
+
section: requestedSection,
|
|
1686
|
+
resultCount: matchedPages.length,
|
|
1687
|
+
sectionCount: countDocsSections(sections),
|
|
1688
|
+
pages: matchedPages,
|
|
1689
|
+
rootPages: [],
|
|
1690
|
+
sections
|
|
1691
|
+
};
|
|
1692
|
+
}
|
|
1693
|
+
const page = allPages.find((candidate) => docsListPageMatches(candidate, requestedSection, filters.entry));
|
|
1694
|
+
if (page) return {
|
|
1695
|
+
section: requestedSection,
|
|
1696
|
+
resultCount: 1,
|
|
1697
|
+
sectionCount: 0,
|
|
1698
|
+
pages: [page],
|
|
1699
|
+
rootPages: [page],
|
|
1700
|
+
sections: []
|
|
1701
|
+
};
|
|
1702
|
+
return {
|
|
1703
|
+
section: requestedSection,
|
|
1704
|
+
resultCount: 0,
|
|
1705
|
+
sectionCount: 0,
|
|
1706
|
+
pages: [],
|
|
1707
|
+
rootPages: [],
|
|
1708
|
+
sections: []
|
|
1709
|
+
};
|
|
1710
|
+
}
|
|
1711
|
+
function buildDocsSectionTree(pages) {
|
|
1712
|
+
const sectionSlugs = /* @__PURE__ */ new Set();
|
|
1713
|
+
for (const page of pages) {
|
|
1714
|
+
const parts = page.slug.split("/").filter(Boolean);
|
|
1715
|
+
for (let index = 1; index < parts.length; index += 1) sectionSlugs.add(parts.slice(0, index).join("/"));
|
|
1716
|
+
}
|
|
1717
|
+
const rootPages = [];
|
|
1718
|
+
const sections = [];
|
|
1719
|
+
const sectionBySlug = /* @__PURE__ */ new Map();
|
|
1720
|
+
function getOrCreateSection(slug) {
|
|
1721
|
+
const existing = sectionBySlug.get(slug);
|
|
1722
|
+
if (existing) return existing;
|
|
1723
|
+
const parts = slug.split("/").filter(Boolean);
|
|
1724
|
+
const section = {
|
|
1725
|
+
slug,
|
|
1726
|
+
title: titleize(parts.at(-1) ?? slug),
|
|
1727
|
+
pageCount: 0,
|
|
1728
|
+
pages: [],
|
|
1729
|
+
sections: []
|
|
1730
|
+
};
|
|
1731
|
+
sectionBySlug.set(slug, section);
|
|
1732
|
+
if (parts.length <= 1) sections.push(section);
|
|
1733
|
+
else getOrCreateSection(parts.slice(0, -1).join("/")).sections.push(section);
|
|
1734
|
+
return section;
|
|
1735
|
+
}
|
|
1736
|
+
for (const page of pages) {
|
|
1737
|
+
const summary = toDocsListPageSummary(page);
|
|
1738
|
+
const parts = page.slug.split("/").filter(Boolean);
|
|
1739
|
+
if (parts.length === 0) {
|
|
1740
|
+
rootPages.push(summary);
|
|
1741
|
+
continue;
|
|
1742
|
+
}
|
|
1743
|
+
const isSectionIndex = sectionSlugs.has(page.slug);
|
|
1744
|
+
if (parts.length === 1 && !isSectionIndex) {
|
|
1745
|
+
rootPages.push(summary);
|
|
1746
|
+
continue;
|
|
1747
|
+
}
|
|
1748
|
+
if (isSectionIndex) {
|
|
1749
|
+
const section = getOrCreateSection(page.slug);
|
|
1750
|
+
hydrateDocsSection(section, summary);
|
|
1751
|
+
pushUniqueDocsPage(section.pages, summary, "start");
|
|
1752
|
+
continue;
|
|
1753
|
+
}
|
|
1754
|
+
pushUniqueDocsPage(getOrCreateSection(parts.slice(0, -1).join("/")).pages, summary, "end");
|
|
1755
|
+
}
|
|
1756
|
+
updateDocsSectionPageCounts(sections);
|
|
1757
|
+
return {
|
|
1758
|
+
rootPages,
|
|
1759
|
+
sections
|
|
1760
|
+
};
|
|
1761
|
+
}
|
|
1762
|
+
function hydrateDocsSection(section, page) {
|
|
1763
|
+
section.title = page.title;
|
|
1764
|
+
section.url = page.url;
|
|
1765
|
+
section.description = page.description;
|
|
1766
|
+
section.icon = page.icon;
|
|
1767
|
+
}
|
|
1768
|
+
function pushUniqueDocsPage(pages, page, position) {
|
|
1769
|
+
if (pages.some((candidate) => candidate.url === page.url)) return;
|
|
1770
|
+
if (position === "start") {
|
|
1771
|
+
pages.unshift(page);
|
|
1772
|
+
return;
|
|
1773
|
+
}
|
|
1774
|
+
pages.push(page);
|
|
1775
|
+
}
|
|
1776
|
+
function updateDocsSectionPageCounts(sections) {
|
|
1777
|
+
let total = 0;
|
|
1778
|
+
for (const section of sections) {
|
|
1779
|
+
section.pageCount = section.pages.length + updateDocsSectionPageCounts(section.sections);
|
|
1780
|
+
total += section.pageCount;
|
|
1781
|
+
}
|
|
1782
|
+
return total;
|
|
1783
|
+
}
|
|
1784
|
+
function findDocsSection(sections, section, entry) {
|
|
1785
|
+
for (const candidate of sections) {
|
|
1786
|
+
if (docsListSectionMatches(candidate, section, entry)) return candidate;
|
|
1787
|
+
const child = findDocsSection(candidate.sections, section, entry);
|
|
1788
|
+
if (child) return child;
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
1791
|
+
function docsListSectionMatches(section, value, entry) {
|
|
1792
|
+
return docsListCandidates(section, entry).includes(normalizeDocsListMatchValue(value));
|
|
1793
|
+
}
|
|
1794
|
+
function docsListPageMatches(page, value, entry) {
|
|
1795
|
+
return docsListCandidates(page, entry).includes(normalizeDocsListMatchValue(value));
|
|
1796
|
+
}
|
|
1797
|
+
function docsListCandidates(value, entry) {
|
|
1798
|
+
return [
|
|
1799
|
+
value.slug,
|
|
1800
|
+
value.url,
|
|
1801
|
+
value.title,
|
|
1802
|
+
value.url ? stripDocsEntryFromPath(value.url, entry) : void 0,
|
|
1803
|
+
stripDocsEntryFromPath(value.slug, entry)
|
|
1804
|
+
].filter((candidate) => Boolean(candidate)).map(normalizeDocsListMatchValue);
|
|
1805
|
+
}
|
|
1806
|
+
function stripDocsEntryFromPath(value, entry) {
|
|
1807
|
+
const normalized = normalizePathSegment(value.replace(/\.md$/i, ""));
|
|
1808
|
+
const normalizedEntry = normalizePathSegment(entry ?? "");
|
|
1809
|
+
if (!normalizedEntry) return normalized;
|
|
1810
|
+
if (normalized === normalizedEntry) return "";
|
|
1811
|
+
if (normalized.startsWith(`${normalizedEntry}/`)) return normalized.slice(normalizedEntry.length + 1);
|
|
1812
|
+
return normalized;
|
|
1813
|
+
}
|
|
1814
|
+
function normalizeDocsListMatchValue(value) {
|
|
1815
|
+
return normalizePathSegment(value.replace(/^https?:\/\/[^/]+/i, "").replace(/\.md$/i, "")).trim().toLowerCase().replace(/\s+/g, "-").replace(/_+/g, "-").replace(/\/+/g, "/").replace(/^\/+|\/+$/g, "");
|
|
1816
|
+
}
|
|
1817
|
+
function cloneDocsSection(section) {
|
|
1818
|
+
return {
|
|
1819
|
+
...section,
|
|
1820
|
+
pages: section.pages.map((page) => ({ ...page })),
|
|
1821
|
+
sections: section.sections.map(cloneDocsSection)
|
|
1822
|
+
};
|
|
1823
|
+
}
|
|
1824
|
+
function flattenDocsSectionPages(section) {
|
|
1825
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1826
|
+
const pages = [];
|
|
1827
|
+
function add(page) {
|
|
1828
|
+
if (seen.has(page.url)) return;
|
|
1829
|
+
seen.add(page.url);
|
|
1830
|
+
pages.push({ ...page });
|
|
1831
|
+
}
|
|
1832
|
+
function visit(current) {
|
|
1833
|
+
current.pages.forEach(add);
|
|
1834
|
+
current.sections.forEach(visit);
|
|
1835
|
+
}
|
|
1836
|
+
visit(section);
|
|
1837
|
+
return pages;
|
|
1838
|
+
}
|
|
1839
|
+
function countDocsSections(sections) {
|
|
1840
|
+
return sections.reduce((total, section) => total + 1 + countDocsSections(section.sections), 0);
|
|
1841
|
+
}
|
|
1562
1842
|
function extractDocsMcpCodeExamples(page) {
|
|
1563
1843
|
const source = page.agentRawContent ?? page.agentFallbackRawContent ?? page.rawContent;
|
|
1564
1844
|
if (!source) return [];
|
|
@@ -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-Dts3a32G.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, DocsMcpConfigSchema, DocsMcpConfigSchemaOption, 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-Dts3a32G.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-Dqu1Q27e.mjs";
|
|
3
|
+
import { DocsMcpCodeExample, DocsMcpConfigSchema, DocsMcpConfigSchemaOption, DocsMcpDocsList, DocsMcpDocsPageSummary, DocsMcpDocsSection, 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 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 };
|
|
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 DocsMcpDocsList, type DocsMcpDocsPageSummary, type DocsMcpDocsSection, type DocsMcpHttpHandlers, type DocsMcpNavigationNode, type DocsMcpNavigationTree, type DocsMcpPage, type DocsMcpResolvedConfig, type DocsMcpSource, type DocsObservabilityConfig, type DocsObservabilityEvent, type DocsObservabilityEventInput, type DocsSearchAdapter, type DocsSearchAdapterContext, type DocsSearchAdapterFactory, type DocsSearchConfig, type DocsSearchDocument, type DocsSearchQuery, type DocsSearchResult, type DocsSearchSourcePage, type DocsSitemapFormat, type DocsSitemapManifest, type DocsSitemapManifestPage, type DocsSitemapPageInput, type DocsSitemapResolvedConfig, type McpDocsSearchConfig, type PromptAction, type PromptProviderChoice, type ResolvedApiReferenceConfig, type ResolvedDocsAnalyticsConfig, type ResolvedDocsObservabilityConfig, type 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 };
|
|
@@ -979,6 +979,8 @@ interface DocsRobotsConfig {
|
|
|
979
979
|
* All tools default to `true` when omitted.
|
|
980
980
|
*/
|
|
981
981
|
interface DocsMcpToolsConfig {
|
|
982
|
+
/** Expose a `list_docs` tool that returns docs pages grouped by section. */
|
|
983
|
+
listDocs?: boolean;
|
|
982
984
|
/** Expose a `list_pages` tool that returns the known docs pages. */
|
|
983
985
|
listPages?: boolean;
|
|
984
986
|
/** Expose a `read_page` tool that returns a page by slug or URL path. */
|