@farming-labs/docs 0.1.99 → 0.1.101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-Bjl8t7hu.mjs → agent-BG9YfbHr.mjs} +2 -2
- package/dist/cli/index.mjs +9 -9
- package/dist/{doctor-Ze0Zt047.mjs → doctor-C8NWuL1m.mjs} +28 -6
- package/dist/index.d.mts +46 -1
- package/dist/index.mjs +2 -2
- package/dist/{mcp-B81O1ge_.mjs → mcp-D0LCSSaq.mjs} +1 -1
- package/dist/{robots-q51zxmDq.mjs → robots-B9RIhGtT.mjs} +1 -1
- package/dist/{robots-CeYdBgoI.mjs → robots-D8IQoKv1.mjs} +153 -4
- package/dist/{search-DQoE9Ptd.mjs → search-jAlynFl1.mjs} +1 -1
- package/dist/server.d.mts +13 -1
- package/dist/server.mjs +2 -2
- package/dist/{sitemap-BnvSrGc8.mjs → sitemap-BYVaRIsO.mjs} +1 -1
- package/dist/{sitemap-server-CJEm6hr5.mjs → sitemap-server-C4TbbCmY.mjs} +16 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./reading-time-CbbHNg9V.mjs";
|
|
2
2
|
import { _ as parseGeneratedAgentDocument, h as hashGeneratedAgentContent, m as GENERATED_AGENT_PROVENANCE_VERSION, v as serializeGeneratedAgentDocument } from "./search-BL7o2rXk.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { P as findDocsMarkdownPage, Y as renderDocsMarkdownDocument } from "./robots-D8IQoKv1.mjs";
|
|
4
4
|
import "./index.mjs";
|
|
5
|
-
import "./sitemap-server-
|
|
5
|
+
import "./sitemap-server-C4TbbCmY.mjs";
|
|
6
6
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
7
7
|
import "./server.mjs";
|
|
8
8
|
import { a as loadProjectEnv, c as readNavTitle, d as readTopLevelStringProperty, f as resolveDocsConfigPath, i as loadDocsConfigModule, l as readNumberProperty, o as readBooleanProperty, p as resolveDocsContentDir, s as readEnvReferenceProperty, t as extractNestedObjectLiteral, u as readStringProperty } from "./config-UI31_wlO.mjs";
|
package/dist/cli/index.mjs
CHANGED
|
@@ -83,10 +83,10 @@ async function main() {
|
|
|
83
83
|
const { dev } = await import("../dev-HW5Op4My.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-D0LCSSaq.mjs");
|
|
87
87
|
await runMcp(mcpOptions);
|
|
88
88
|
} else if (parsedCommand.command === "agent" && subcommand === "compact") {
|
|
89
|
-
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent-
|
|
89
|
+
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent-BG9YfbHr.mjs");
|
|
90
90
|
const agentCompactOptions = parseAgentCompactArgs(args.slice(2));
|
|
91
91
|
if (agentCompactOptions.help) {
|
|
92
92
|
printAgentCompactHelp();
|
|
@@ -96,11 +96,11 @@ async function main() {
|
|
|
96
96
|
} else if (parsedCommand.command === "agent") {
|
|
97
97
|
console.error(pc.red(`Unknown agent subcommand: ${subcommand ?? "(missing)"}`));
|
|
98
98
|
console.error();
|
|
99
|
-
const { printAgentCompactHelp } = await import("../agent-
|
|
99
|
+
const { printAgentCompactHelp } = await import("../agent-BG9YfbHr.mjs");
|
|
100
100
|
printAgentCompactHelp();
|
|
101
101
|
process.exit(1);
|
|
102
102
|
} else if (parsedCommand.command === "doctor") {
|
|
103
|
-
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-
|
|
103
|
+
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-C8NWuL1m.mjs");
|
|
104
104
|
const doctorOptions = parseDoctorArgs(args.slice(1));
|
|
105
105
|
if (doctorOptions.help) {
|
|
106
106
|
printDoctorHelp();
|
|
@@ -108,7 +108,7 @@ async function main() {
|
|
|
108
108
|
}
|
|
109
109
|
await runDoctor(doctorOptions);
|
|
110
110
|
} else if (parsedCommand.command === "search" && subcommand === "sync") {
|
|
111
|
-
const { syncSearch } = await import("../search-
|
|
111
|
+
const { syncSearch } = await import("../search-jAlynFl1.mjs");
|
|
112
112
|
await syncSearch(searchSyncOptions);
|
|
113
113
|
} else if (parsedCommand.command === "search") {
|
|
114
114
|
console.error(pc.red(`Unknown search subcommand: ${subcommand ?? "(missing)"}`));
|
|
@@ -116,7 +116,7 @@ async function main() {
|
|
|
116
116
|
printHelp();
|
|
117
117
|
process.exit(1);
|
|
118
118
|
} else if (parsedCommand.command === "sitemap" && subcommand === "generate") {
|
|
119
|
-
const { generateSitemap, parseSitemapGenerateArgs, printSitemapGenerateHelp } = await import("../sitemap-
|
|
119
|
+
const { generateSitemap, parseSitemapGenerateArgs, printSitemapGenerateHelp } = await import("../sitemap-BYVaRIsO.mjs");
|
|
120
120
|
const sitemapOptions = parseSitemapGenerateArgs(args.slice(2));
|
|
121
121
|
if (sitemapOptions.help) {
|
|
122
122
|
printSitemapGenerateHelp();
|
|
@@ -126,11 +126,11 @@ async function main() {
|
|
|
126
126
|
} else if (parsedCommand.command === "sitemap") {
|
|
127
127
|
console.error(pc.red(`Unknown sitemap subcommand: ${subcommand ?? "(missing)"}`));
|
|
128
128
|
console.error();
|
|
129
|
-
const { printSitemapGenerateHelp } = await import("../sitemap-
|
|
129
|
+
const { printSitemapGenerateHelp } = await import("../sitemap-BYVaRIsO.mjs");
|
|
130
130
|
printSitemapGenerateHelp();
|
|
131
131
|
process.exit(1);
|
|
132
132
|
} else if (parsedCommand.command === "robots" && subcommand === "generate") {
|
|
133
|
-
const { generateRobots, parseRobotsGenerateArgs, printRobotsGenerateHelp } = await import("../robots-
|
|
133
|
+
const { generateRobots, parseRobotsGenerateArgs, printRobotsGenerateHelp } = await import("../robots-B9RIhGtT.mjs");
|
|
134
134
|
const robotsOptions = parseRobotsGenerateArgs(args.slice(2));
|
|
135
135
|
if (robotsOptions.help) {
|
|
136
136
|
printRobotsGenerateHelp();
|
|
@@ -140,7 +140,7 @@ async function main() {
|
|
|
140
140
|
} else if (parsedCommand.command === "robots") {
|
|
141
141
|
console.error(pc.red(`Unknown robots subcommand: ${subcommand ?? "(missing)"}`));
|
|
142
142
|
console.error();
|
|
143
|
-
const { printRobotsGenerateHelp } = await import("../robots-
|
|
143
|
+
const { printRobotsGenerateHelp } = await import("../robots-B9RIhGtT.mjs");
|
|
144
144
|
printRobotsGenerateHelp();
|
|
145
145
|
process.exit(1);
|
|
146
146
|
} else if (parsedCommand.command === "upgrade") {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "./reading-time-CbbHNg9V.mjs";
|
|
2
2
|
import "./search-BL7o2rXk.mjs";
|
|
3
3
|
import { i as DEFAULT_SITEMAP_XML_ROUTE, n as DEFAULT_SITEMAP_MD_ROUTE, r as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, u as resolveDocsSitemapConfig } from "./sitemap-CnqcTdQg.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import "./sitemap-server-
|
|
4
|
+
import { E as DEFAULT_MCP_WELL_KNOWN_ROUTE, N as buildDocsMcpEndpointCandidates, O as DEFAULT_SKILL_MD_ROUTE, S as DEFAULT_LLMS_TXT_ROUTE, _ as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, a as analyzeDocsRobotsTxt, g as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, k as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, m as DEFAULT_AGENT_FEEDBACK_ROUTE, n as DEFAULT_ROBOTS_TXT_ROUTE, u as resolveDocsRobotsConfig, w as DEFAULT_MCP_PUBLIC_ROUTE, y as DEFAULT_LLMS_FULL_TXT_ROUTE } from "./robots-D8IQoKv1.mjs";
|
|
5
|
+
import "./sitemap-server-C4TbbCmY.mjs";
|
|
6
6
|
import { createFilesystemDocsMcpSource, resolveDocsMcpConfig } from "./mcp.mjs";
|
|
7
7
|
import "./server.mjs";
|
|
8
8
|
import { a as loadProjectEnv, c as readNavTitle, d as readTopLevelStringProperty, f as resolveDocsConfigPath, i as loadDocsConfigModule, o as readBooleanProperty, p as resolveDocsContentDir, r as extractTopLevelConfigObject, t as extractNestedObjectLiteral } from "./config-UI31_wlO.mjs";
|
|
9
|
-
import { inspectAgentCompactionState, scanDocsPageTargets } from "./agent-
|
|
9
|
+
import { inspectAgentCompactionState, scanDocsPageTargets } from "./agent-BG9YfbHr.mjs";
|
|
10
10
|
import { t as detectFramework } from "./utils-AmYxHDoz.mjs";
|
|
11
11
|
import { existsSync, lstatSync, readFileSync, readdirSync } from "node:fs";
|
|
12
12
|
import path from "node:path";
|
|
@@ -971,6 +971,20 @@ async function probeMcpRoute(baseUrl, route) {
|
|
|
971
971
|
};
|
|
972
972
|
}
|
|
973
973
|
}
|
|
974
|
+
async function probeMcpRouteCandidates(baseUrl, routes) {
|
|
975
|
+
const candidates = buildDocsMcpEndpointCandidates(baseUrl, routes);
|
|
976
|
+
const probes = await Promise.all(candidates.map(async (candidate) => {
|
|
977
|
+
const probe = await probeMcpRoute(candidate.baseUrl, candidate.route);
|
|
978
|
+
return {
|
|
979
|
+
...probe,
|
|
980
|
+
detail: `${candidate.label}: ${probe.detail}`
|
|
981
|
+
};
|
|
982
|
+
}));
|
|
983
|
+
return {
|
|
984
|
+
labels: candidates.map((candidate) => candidate.label),
|
|
985
|
+
probes
|
|
986
|
+
};
|
|
987
|
+
}
|
|
974
988
|
function asRecord(value) {
|
|
975
989
|
return value && typeof value === "object" ? value : void 0;
|
|
976
990
|
}
|
|
@@ -1002,6 +1016,13 @@ function hostedRobotsRoute(discoveryBody) {
|
|
|
1002
1016
|
route: readDiscoveryRoute(robots?.route) ?? DEFAULT_ROBOTS_TXT_ROUTE
|
|
1003
1017
|
};
|
|
1004
1018
|
}
|
|
1019
|
+
function hostedMcpRoutes(discoveryBody) {
|
|
1020
|
+
const mcp = asRecord(asRecord(discoveryBody)?.mcp);
|
|
1021
|
+
const publicEndpoints = mcp?.publicEndpoints ?? mcp?.endpoints;
|
|
1022
|
+
const declaredRoutes = Array.isArray(publicEndpoints) ? publicEndpoints.filter((value) => typeof value === "string" && value.startsWith("/")) : [];
|
|
1023
|
+
if (declaredRoutes.length > 0) return Array.from(new Set(declaredRoutes));
|
|
1024
|
+
return Array.from(new Set([readDiscoveryRoute(mcp?.publicEndpoint) ?? DEFAULT_MCP_PUBLIC_ROUTE, readDiscoveryRoute(mcp?.wellKnownEndpoint) ?? DEFAULT_MCP_WELL_KNOWN_ROUTE]));
|
|
1025
|
+
}
|
|
1005
1026
|
function hostedCapability(discoveryBody, key) {
|
|
1006
1027
|
const root = asRecord(discoveryBody);
|
|
1007
1028
|
const capability = asRecord(root?.capabilities)?.[key];
|
|
@@ -1140,9 +1161,10 @@ async function buildHostedAgentChecks(url, pages) {
|
|
|
1140
1161
|
const markdownAlternateScore = hostedSurfaceScore(htmlPageProbes, (probe) => probe.hasMarkdownAlternate);
|
|
1141
1162
|
const markdownRoutesEnabled = hostedCapability(discovery.body, "markdownRoutes");
|
|
1142
1163
|
checks.push(makeCheck("hosted-markdown-alternate", "Hosted markdown alternate links", markdownRoutesEnabled === false ? "warn" : markdownAlternateScore.status, markdownRoutesEnabled === false ? 0 : markdownAlternateScore.score, 5, markdownRoutesEnabled === false ? "The hosted discovery spec reports markdown routes as disabled." : markdownAlternateScore.total > 0 ? `${markdownAlternateScore.passed}/${markdownAlternateScore.total} sampled hosted docs pages include <link rel="alternate" type="text/markdown"> pointing to .md routes.` : "No hosted docs pages were available to verify markdown alternate links.", markdownRoutesEnabled === false || markdownAlternateScore.status === "pass" ? void 0 : "Add a text/markdown alternate link in each docs page head, usually through `alternates.types['text/markdown']`, so agents can discover the page markdown URL from HTML."));
|
|
1143
|
-
const mcp = await
|
|
1144
|
-
const mcpPassed = mcp.filter((result) => result.ok).length;
|
|
1145
|
-
|
|
1164
|
+
const mcp = await probeMcpRouteCandidates(baseUrl, hostedMcpRoutes(discovery.body));
|
|
1165
|
+
const mcpPassed = mcp.probes.filter((result) => result.ok).length;
|
|
1166
|
+
const mcpDetailProbes = mcpPassed > 0 ? mcp.probes.filter((result) => result.ok) : mcp.probes;
|
|
1167
|
+
checks.push(makeCheck("hosted-mcp", "Hosted MCP handshake", mcpPassed > 0 ? "pass" : "fail", mcpPassed > 0 ? 10 : 0, 10, mcpDetailProbes.map((result) => result.detail).join(" "), mcpPassed > 0 ? void 0 : `Verify one of ${mcp.labels.join(" or ")} supports Streamable HTTP initialize and tools/list.`));
|
|
1146
1168
|
return {
|
|
1147
1169
|
baseUrl,
|
|
1148
1170
|
checks
|
package/dist/index.d.mts
CHANGED
|
@@ -201,6 +201,7 @@ declare function serializeGeneratedAgentDocument(content: string, provenance: Ge
|
|
|
201
201
|
//#endregion
|
|
202
202
|
//#region src/agent.d.ts
|
|
203
203
|
declare const DEFAULT_DOCS_API_ROUTE = "/api/docs";
|
|
204
|
+
declare const DEFAULT_OPENAPI_SCHEMA_ROUTE = "/api/docs?format=openapi";
|
|
204
205
|
declare const DEFAULT_AGENT_SPEC_ROUTE = "/api/docs/agent/spec";
|
|
205
206
|
declare const DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE = "/.well-known/agent";
|
|
206
207
|
declare const DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE = "/.well-known/agent.json";
|
|
@@ -217,6 +218,17 @@ declare const DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE = "/.well-known/skill.md";
|
|
|
217
218
|
declare const DEFAULT_AGENT_FEEDBACK_ROUTE = "/api/docs/agent/feedback";
|
|
218
219
|
declare const DEFAULT_AGENT_FEEDBACK_PAYLOAD_SCHEMA: Record<string, unknown>;
|
|
219
220
|
declare const DOCS_MARKDOWN_SIGNATURE_AGENT_HEADER = "Signature-Agent";
|
|
221
|
+
interface DocsMcpEndpointCandidate {
|
|
222
|
+
baseUrl: string;
|
|
223
|
+
route: string;
|
|
224
|
+
url: string;
|
|
225
|
+
label: string;
|
|
226
|
+
}
|
|
227
|
+
interface DocsMcpEndpointCandidateOptions {
|
|
228
|
+
includeOriginFallback?: boolean;
|
|
229
|
+
includeRootDomainFallback?: boolean;
|
|
230
|
+
includeMcpSubdomainFallback?: boolean;
|
|
231
|
+
}
|
|
220
232
|
interface DocsAgentFeedbackResolvedConfig {
|
|
221
233
|
enabled: boolean;
|
|
222
234
|
route: string;
|
|
@@ -240,6 +252,21 @@ interface DocsLlmsDiscoveryConfig {
|
|
|
240
252
|
siteDescription?: string;
|
|
241
253
|
maxChars?: LlmsTxtMaxCharsConfig;
|
|
242
254
|
sections?: LlmsTxtSectionConfig[];
|
|
255
|
+
openapi?: boolean | DocsOpenApiDiscoveryConfig;
|
|
256
|
+
}
|
|
257
|
+
interface DocsOpenApiDiscoveryConfig {
|
|
258
|
+
enabled?: boolean;
|
|
259
|
+
url?: string;
|
|
260
|
+
source?: "generated" | "configured";
|
|
261
|
+
specUrl?: string;
|
|
262
|
+
apiReferencePath?: string;
|
|
263
|
+
}
|
|
264
|
+
interface DocsOpenApiResolvedDiscoveryConfig {
|
|
265
|
+
enabled: boolean;
|
|
266
|
+
url?: string;
|
|
267
|
+
source?: "generated" | "configured";
|
|
268
|
+
specUrl?: string;
|
|
269
|
+
apiReferencePath?: string;
|
|
243
270
|
}
|
|
244
271
|
interface DocsLlmsTxtResolvedMaxChars {
|
|
245
272
|
mode: LlmsTxtMaxCharsMode;
|
|
@@ -295,6 +322,7 @@ interface DocsAgentDiscoverySpecOptions {
|
|
|
295
322
|
llms?: DocsLlmsDiscoveryConfig;
|
|
296
323
|
sitemap?: boolean | DocsSitemapConfig;
|
|
297
324
|
robots?: boolean | DocsRobotsConfig;
|
|
325
|
+
openapi?: boolean | DocsOpenApiDiscoveryConfig;
|
|
298
326
|
markdown?: {
|
|
299
327
|
acceptHeader?: boolean;
|
|
300
328
|
signatureAgentHeader?: boolean;
|
|
@@ -309,6 +337,7 @@ interface DocsSkillDocumentOptions {
|
|
|
309
337
|
llms?: DocsLlmsDiscoveryConfig;
|
|
310
338
|
sitemap?: boolean | DocsSitemapConfig;
|
|
311
339
|
robots?: boolean | DocsRobotsConfig;
|
|
340
|
+
openapi?: boolean | DocsOpenApiDiscoveryConfig;
|
|
312
341
|
markdown?: {
|
|
313
342
|
acceptHeader?: boolean;
|
|
314
343
|
signatureAgentHeader?: boolean;
|
|
@@ -372,6 +401,7 @@ declare function selectDocsLlmsTxtContent(content: DocsLlmsTxtGeneratedContent,
|
|
|
372
401
|
declare function getDocsLlmsTxtMaxCharsIssue(label: string, content: string, maxChars: DocsLlmsTxtResolvedMaxChars): DocsLlmsTxtMaxCharsIssue | null;
|
|
373
402
|
declare function isDocsAgentDiscoveryRequest(url: URL): boolean;
|
|
374
403
|
declare function isDocsMcpRequest(url: URL): boolean;
|
|
404
|
+
declare function buildDocsMcpEndpointCandidates(baseUrl: string, routes?: readonly string[], options?: DocsMcpEndpointCandidateOptions): DocsMcpEndpointCandidate[];
|
|
375
405
|
declare function isDocsSkillRequest(url: URL): boolean;
|
|
376
406
|
declare function resolveDocsSkillFormat(url: URL): "skill" | null;
|
|
377
407
|
declare function isDocsPublicGetRequest(entry: string, url: URL, request: Request, options?: {
|
|
@@ -403,6 +433,7 @@ declare function renderDocsSkillDocument({
|
|
|
403
433
|
llms,
|
|
404
434
|
sitemap,
|
|
405
435
|
robots,
|
|
436
|
+
openapi,
|
|
406
437
|
markdown
|
|
407
438
|
}: DocsSkillDocumentOptions): string;
|
|
408
439
|
declare function resolveDocsAgentMdxContent(content: string, audience: "human" | "agent"): string;
|
|
@@ -416,6 +447,7 @@ declare function buildDocsAgentDiscoverySpec({
|
|
|
416
447
|
llms,
|
|
417
448
|
sitemap,
|
|
418
449
|
robots,
|
|
450
|
+
openapi,
|
|
419
451
|
markdown
|
|
420
452
|
}: DocsAgentDiscoverySpecOptions): {
|
|
421
453
|
version: string;
|
|
@@ -445,6 +477,8 @@ declare function buildDocsAgentDiscoverySpec({
|
|
|
445
477
|
sitemap: boolean;
|
|
446
478
|
robots: boolean;
|
|
447
479
|
structuredData: boolean;
|
|
480
|
+
apiReference: boolean;
|
|
481
|
+
openapi: boolean;
|
|
448
482
|
agentFeedback: boolean;
|
|
449
483
|
locales: boolean;
|
|
450
484
|
};
|
|
@@ -456,6 +490,7 @@ declare function buildDocsAgentDiscoverySpec({
|
|
|
456
490
|
agentSpecWellKnown: string;
|
|
457
491
|
agentSpecWellKnownJson: string;
|
|
458
492
|
agentSpecQuery: string;
|
|
493
|
+
openapi: string;
|
|
459
494
|
};
|
|
460
495
|
markdown: {
|
|
461
496
|
enabled: boolean;
|
|
@@ -514,6 +549,14 @@ declare function buildDocsAgentDiscoverySpec({
|
|
|
514
549
|
canonicalUrlField: string;
|
|
515
550
|
breadcrumbType: string;
|
|
516
551
|
};
|
|
552
|
+
openapi: {
|
|
553
|
+
enabled: boolean;
|
|
554
|
+
url: string | null;
|
|
555
|
+
source: "generated" | "configured" | null;
|
|
556
|
+
specUrl: string | null;
|
|
557
|
+
apiReferencePath: string | null;
|
|
558
|
+
format: string;
|
|
559
|
+
};
|
|
517
560
|
search: {
|
|
518
561
|
enabled: boolean;
|
|
519
562
|
endpoint: string;
|
|
@@ -562,10 +605,12 @@ declare function buildDocsAgentDiscoverySpec({
|
|
|
562
605
|
instructions: {
|
|
563
606
|
preferMarkdownRoutes: boolean;
|
|
564
607
|
useMcpWhenAvailable: boolean;
|
|
608
|
+
useOpenApiWhenAvailable: boolean;
|
|
565
609
|
readFeedbackSchemaBeforeSubmitting: boolean;
|
|
566
610
|
doNotAssumeFeedbackPayloadShape: boolean;
|
|
567
611
|
};
|
|
568
612
|
};
|
|
613
|
+
declare function resolveDocsOpenApiDiscoveryConfig(openapi?: boolean | DocsOpenApiDiscoveryConfig): DocsOpenApiResolvedDiscoveryConfig;
|
|
569
614
|
//#endregion
|
|
570
615
|
//#region src/robots.d.ts
|
|
571
616
|
declare const DEFAULT_ROBOTS_TXT_ROUTE = "/robots.txt";
|
|
@@ -610,4 +655,4 @@ declare function renderDocsRobotsGeneratedBlock(options?: DocsRobotsRenderOption
|
|
|
610
655
|
declare function upsertDocsRobotsGeneratedBlock(existing: string, block: string): string;
|
|
611
656
|
declare function analyzeDocsRobotsTxt(content: string, options?: DocsRobotsRenderOptions): DocsRobotsAnalysis;
|
|
612
657
|
//#endregion
|
|
613
|
-
export { type AIConfig, type AgentFeedbackConfig, type AlgoliaDocsSearchConfig, type ApiReferenceConfig, type ApiReferenceRenderer, type BreadcrumbConfig, type ChangelogConfig, type ChangelogEntrySummary, type ChangelogFrontmatter, type CodeBlockCopyData, type CopyMarkdownConfig, type CustomDocsSearchConfig, DEFAULT_AGENT_FEEDBACK_PAYLOAD_SCHEMA, DEFAULT_AGENT_FEEDBACK_ROUTE, DEFAULT_AGENT_SPEC_ROUTE, DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, DEFAULT_DOCS_AI_ROBOTS_USER_AGENTS, DEFAULT_DOCS_API_ROUTE, DEFAULT_LLMS_FULL_TXT_ROUTE, DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE, DEFAULT_LLMS_TXT_MAX_CHARS, DEFAULT_LLMS_TXT_ROUTE, DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE, DEFAULT_MCP_PUBLIC_ROUTE, DEFAULT_MCP_ROUTE, DEFAULT_MCP_WELL_KNOWN_ROUTE, DEFAULT_ROBOTS_TXT_ROUTE, DEFAULT_SITEMAP_MANIFEST_PATH, DEFAULT_SITEMAP_MD_ROUTE, DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, DEFAULT_SITEMAP_XML_ROUTE, DEFAULT_SKILL_MD_ROUTE, DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, DOCS_AGENT_TRACE_EVENT_TYPES, DOCS_MARKDOWN_SIGNATURE_AGENT_HEADER, DOCS_ROBOTS_GENERATED_BLOCK_END, DOCS_ROBOTS_GENERATED_BLOCK_START, type DocsAgentDiscoverySpecOptions, type DocsAgentFeedbackContext, type DocsAgentFeedbackData, type DocsAgentFeedbackDiscoveryConfig, type DocsAgentFeedbackRequest, type DocsAgentFeedbackResolvedConfig, type DocsAgentTraceContext, type DocsAgentTraceEventInput, type DocsAgentTraceEventType, type DocsAgentTraceStatus, type DocsAnalyticsConfig, type DocsAnalyticsEvent, type DocsAnalyticsEventInput, type DocsAnalyticsEventType, type DocsAnalyticsInput, type DocsAnalyticsSource, type DocsAskAIActionData, type DocsAskAIActionType, type DocsAskAIFeedbackConfig, type DocsAskAIFeedbackData, type DocsAskAIFeedbackMessage, type DocsAskAIFeedbackValue, type DocsAskAIMcpConfig, type DocsCloudAnalyticsOptions, type DocsConfig, type DocsFeedbackData, type DocsFeedbackValue, type DocsI18nConfig, type DocsLlmsDiscoveryConfig, type DocsLlmsTxtGeneratedContent, type DocsLlmsTxtGeneratedSection, type DocsLlmsTxtMaxCharsIssue, type DocsLlmsTxtPageInput, type DocsLlmsTxtRequest, type DocsLlmsTxtResolvedMaxChars, type DocsLlmsTxtResolvedSection, type DocsLlmsTxtSelectedContent, type DocsMarkdownPage, type DocsMcpConfig, type DocsMcpToolsConfig, type DocsMetadata, type DocsNav, type DocsObservabilityConfig, type DocsObservabilityEvent, type DocsObservabilityEventInput, type DocsPageStructuredDataInput, type DocsPathMatch, type DocsRelatedItem, type DocsRobotsConfig, type DocsRobotsRenderOptions, type DocsRobotsResolvedConfig, type DocsRobotsRule, type DocsSearchAdapter, type DocsSearchAdapterContext, type DocsSearchAdapterFactory, type DocsSearchChunkingConfig, type DocsSearchConfig, type DocsSearchDocument, type DocsSearchEmbeddingsConfig, type DocsSearchQuery, type DocsSearchResult, type DocsSearchResultType, type DocsSearchSourcePage, type DocsSitemapConfig, type DocsSitemapFormat, type DocsSitemapManifest, type DocsSitemapManifestPage, type DocsSitemapPageInput, type DocsSitemapResolvedConfig, type DocsSkillDocumentOptions, type DocsStructuredDataBreadcrumb, type DocsTheme, type FeedbackConfig, type FontStyle, GENERATED_AGENT_PROVENANCE_MARKER, GENERATED_AGENT_PROVENANCE_VERSION, type GeneratedAgentProvenance, type GeneratedAgentSourceKind, type GithubConfig, type LastUpdatedConfig, type LlmsTxtConfig, type LlmsTxtMaxCharsConfig, type LlmsTxtMaxCharsMode, type LlmsTxtSectionConfig, type McpDocsSearchConfig, type OGConfig, type OpenDocsConfig, type OpenDocsProvider, type OpenGraphImage, type OrderingItem, type PageActionsConfig, type PageFrontmatter, type PageOpenGraph, type PageSidebarFrontmatter, type PageTwitter, type ReadingTimeConfig, type ResolvedChangelogConfig, type ResolvedDocsAnalyticsConfig, type ResolvedDocsI18n, type ResolvedDocsObservabilityConfig, type ResolvedDocsRelatedLink, type SidebarComponentProps, type SidebarConfig, type SidebarFolderIndexBehavior, type SidebarFolderNode, type SidebarNode, type SidebarPageNode, type SidebarTree, type SimpleDocsSearchConfig, type ThemeToggleConfig, type TypesenseDocsSearchConfig, type TypographyConfig, type UIConfig, analyzeDocsRobotsTxt, applySidebarFolderIndexBehavior, buildDocsAgentDiscoverySpec, buildDocsAgentFeedbackSchema, buildDocsAskAIContext, buildDocsPageStructuredData, buildDocsSearchDocuments, buildDocsSitemapManifest, buildPageOpenGraph, buildPageTwitter, createAlgoliaSearchAdapter, createCustomSearchAdapter, createDocsAgentTraceContext, createDocsAgentTraceId, createDocsCloudAnalytics, createDocsRobotsResponse, createDocsSitemapResponse, createMcpSearchAdapter, createSimpleSearchAdapter, createTheme, createTypesenseSearchAdapter, deepMerge, defineDocs, emitDocsAgentTraceEvent, emitDocsAnalyticsEvent, emitDocsObservabilityEvent, estimateReadingTimeMinutes, extendTheme, findDocsMarkdownPage, formatDocsAskAIPackageHints, getDocsLlmsTxtMaxCharsIssue, getDocsMarkdownCanonicalLinkHeader, getDocsMarkdownVaryHeader, getDocsRobotsAllowRoutes, hasDocsMarkdownSignatureAgent, hashGeneratedAgentContent, inferDocsAskAIPackageHints, isDocsAgentDiscoveryRequest, isDocsLlmsTxtPublicRequest, isDocsMcpRequest, isDocsPublicGetRequest, isDocsSkillRequest, matchesDocsLlmsTxtSection, normalizeDocsPathSegment, normalizeDocsRelated, normalizeDocsUrlPath, normalizeGeneratedAgentContent, parseDocsAgentFeedbackData, parseGeneratedAgentDocument, performDocsSearch, readDocsSitemapManifestFromContentMap, renderDocsLlmsTxt, renderDocsMarkdownDocument, renderDocsMarkdownNotFound, renderDocsPageStructuredDataJson, renderDocsRelatedMarkdownLines, renderDocsRobotsGeneratedBlock, renderDocsRobotsTxt, renderDocsSitemapMarkdown, renderDocsSitemapXml, renderDocsSkillDocument, resolveAskAISearchRequestConfig, resolveChangelogConfig, resolveDocsAgentFeedbackConfig, resolveDocsAgentFeedbackRequest, resolveDocsAgentMdxContent, resolveDocsAnalyticsConfig, resolveDocsI18n, resolveDocsLlmsTxtFormat, resolveDocsLlmsTxtRequest, resolveDocsLlmsTxtSections, resolveDocsLocale, resolveDocsMarkdownCanonicalUrl, resolveDocsMarkdownRequest, resolveDocsMetadataBaseUrl, resolveDocsObservabilityConfig, resolveDocsPath, resolveDocsRobotsConfig, resolveDocsRobotsRequest, resolveDocsSitemapConfig, resolveDocsSitemapPageLastmod, resolveDocsSitemapRequest, resolveDocsSkillFormat, resolveOGImage, resolvePageReadingTime, resolvePageSidebarFolderIndexBehavior, resolveReadingTimeFromContent, resolveReadingTimeFromSource, resolveReadingTimeOptions, resolveSearchRequestConfig, resolveSidebarFolderIndexBehavior, resolveSidebarFolderIndexBehaviorForPath, resolveTitle, selectDocsLlmsTxtContent, serializeGeneratedAgentDocument, stripGeneratedAgentProvenance, toDocsMarkdownUrl, toDocsSitemapMarkdownUrl, upsertDocsRobotsGeneratedBlock, validateDocsAgentFeedbackPayload };
|
|
658
|
+
export { type AIConfig, type AgentFeedbackConfig, type AlgoliaDocsSearchConfig, type ApiReferenceConfig, type ApiReferenceRenderer, type BreadcrumbConfig, type ChangelogConfig, type ChangelogEntrySummary, type ChangelogFrontmatter, type CodeBlockCopyData, type CopyMarkdownConfig, type CustomDocsSearchConfig, DEFAULT_AGENT_FEEDBACK_PAYLOAD_SCHEMA, DEFAULT_AGENT_FEEDBACK_ROUTE, DEFAULT_AGENT_SPEC_ROUTE, DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, DEFAULT_DOCS_AI_ROBOTS_USER_AGENTS, DEFAULT_DOCS_API_ROUTE, DEFAULT_LLMS_FULL_TXT_ROUTE, DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE, DEFAULT_LLMS_TXT_MAX_CHARS, DEFAULT_LLMS_TXT_ROUTE, DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE, DEFAULT_MCP_PUBLIC_ROUTE, DEFAULT_MCP_ROUTE, DEFAULT_MCP_WELL_KNOWN_ROUTE, DEFAULT_OPENAPI_SCHEMA_ROUTE, DEFAULT_ROBOTS_TXT_ROUTE, DEFAULT_SITEMAP_MANIFEST_PATH, DEFAULT_SITEMAP_MD_ROUTE, DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, DEFAULT_SITEMAP_XML_ROUTE, DEFAULT_SKILL_MD_ROUTE, DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, DOCS_AGENT_TRACE_EVENT_TYPES, DOCS_MARKDOWN_SIGNATURE_AGENT_HEADER, DOCS_ROBOTS_GENERATED_BLOCK_END, DOCS_ROBOTS_GENERATED_BLOCK_START, type DocsAgentDiscoverySpecOptions, type DocsAgentFeedbackContext, type DocsAgentFeedbackData, type DocsAgentFeedbackDiscoveryConfig, type DocsAgentFeedbackRequest, type DocsAgentFeedbackResolvedConfig, type DocsAgentTraceContext, type DocsAgentTraceEventInput, type DocsAgentTraceEventType, type DocsAgentTraceStatus, type DocsAnalyticsConfig, type DocsAnalyticsEvent, type DocsAnalyticsEventInput, type DocsAnalyticsEventType, type DocsAnalyticsInput, type DocsAnalyticsSource, type DocsAskAIActionData, type DocsAskAIActionType, type DocsAskAIFeedbackConfig, type DocsAskAIFeedbackData, type DocsAskAIFeedbackMessage, type DocsAskAIFeedbackValue, type DocsAskAIMcpConfig, type DocsCloudAnalyticsOptions, type DocsConfig, type DocsFeedbackData, type DocsFeedbackValue, type DocsI18nConfig, type DocsLlmsDiscoveryConfig, type DocsLlmsTxtGeneratedContent, type DocsLlmsTxtGeneratedSection, type DocsLlmsTxtMaxCharsIssue, type DocsLlmsTxtPageInput, type DocsLlmsTxtRequest, type DocsLlmsTxtResolvedMaxChars, type DocsLlmsTxtResolvedSection, type DocsLlmsTxtSelectedContent, type DocsMarkdownPage, type DocsMcpConfig, type DocsMcpEndpointCandidate, type DocsMcpEndpointCandidateOptions, type DocsMcpToolsConfig, type DocsMetadata, type DocsNav, type DocsObservabilityConfig, type DocsObservabilityEvent, type DocsObservabilityEventInput, type DocsOpenApiDiscoveryConfig, type DocsOpenApiResolvedDiscoveryConfig, type DocsPageStructuredDataInput, type DocsPathMatch, type DocsRelatedItem, type DocsRobotsConfig, type DocsRobotsRenderOptions, type DocsRobotsResolvedConfig, type DocsRobotsRule, type DocsSearchAdapter, type DocsSearchAdapterContext, type DocsSearchAdapterFactory, type DocsSearchChunkingConfig, type DocsSearchConfig, type DocsSearchDocument, type DocsSearchEmbeddingsConfig, type DocsSearchQuery, type DocsSearchResult, type DocsSearchResultType, type DocsSearchSourcePage, type DocsSitemapConfig, type DocsSitemapFormat, type DocsSitemapManifest, type DocsSitemapManifestPage, type DocsSitemapPageInput, type DocsSitemapResolvedConfig, type DocsSkillDocumentOptions, type DocsStructuredDataBreadcrumb, type DocsTheme, type FeedbackConfig, type FontStyle, GENERATED_AGENT_PROVENANCE_MARKER, GENERATED_AGENT_PROVENANCE_VERSION, type GeneratedAgentProvenance, type GeneratedAgentSourceKind, type GithubConfig, type LastUpdatedConfig, type LlmsTxtConfig, type LlmsTxtMaxCharsConfig, type LlmsTxtMaxCharsMode, type LlmsTxtSectionConfig, type McpDocsSearchConfig, type OGConfig, type OpenDocsConfig, type OpenDocsProvider, type OpenGraphImage, type OrderingItem, type PageActionsConfig, type PageFrontmatter, type PageOpenGraph, type PageSidebarFrontmatter, type PageTwitter, type ReadingTimeConfig, type ResolvedChangelogConfig, type ResolvedDocsAnalyticsConfig, type ResolvedDocsI18n, type ResolvedDocsObservabilityConfig, type ResolvedDocsRelatedLink, type SidebarComponentProps, type SidebarConfig, type SidebarFolderIndexBehavior, type SidebarFolderNode, type SidebarNode, type SidebarPageNode, type SidebarTree, type SimpleDocsSearchConfig, type ThemeToggleConfig, type TypesenseDocsSearchConfig, type TypographyConfig, type UIConfig, analyzeDocsRobotsTxt, applySidebarFolderIndexBehavior, buildDocsAgentDiscoverySpec, buildDocsAgentFeedbackSchema, buildDocsAskAIContext, buildDocsMcpEndpointCandidates, buildDocsPageStructuredData, buildDocsSearchDocuments, buildDocsSitemapManifest, buildPageOpenGraph, buildPageTwitter, createAlgoliaSearchAdapter, createCustomSearchAdapter, createDocsAgentTraceContext, createDocsAgentTraceId, createDocsCloudAnalytics, createDocsRobotsResponse, createDocsSitemapResponse, createMcpSearchAdapter, createSimpleSearchAdapter, createTheme, createTypesenseSearchAdapter, deepMerge, defineDocs, emitDocsAgentTraceEvent, emitDocsAnalyticsEvent, emitDocsObservabilityEvent, estimateReadingTimeMinutes, extendTheme, findDocsMarkdownPage, formatDocsAskAIPackageHints, getDocsLlmsTxtMaxCharsIssue, getDocsMarkdownCanonicalLinkHeader, getDocsMarkdownVaryHeader, getDocsRobotsAllowRoutes, hasDocsMarkdownSignatureAgent, hashGeneratedAgentContent, inferDocsAskAIPackageHints, isDocsAgentDiscoveryRequest, isDocsLlmsTxtPublicRequest, isDocsMcpRequest, isDocsPublicGetRequest, isDocsSkillRequest, matchesDocsLlmsTxtSection, normalizeDocsPathSegment, normalizeDocsRelated, normalizeDocsUrlPath, normalizeGeneratedAgentContent, parseDocsAgentFeedbackData, parseGeneratedAgentDocument, performDocsSearch, readDocsSitemapManifestFromContentMap, renderDocsLlmsTxt, renderDocsMarkdownDocument, renderDocsMarkdownNotFound, renderDocsPageStructuredDataJson, renderDocsRelatedMarkdownLines, renderDocsRobotsGeneratedBlock, renderDocsRobotsTxt, renderDocsSitemapMarkdown, renderDocsSitemapXml, renderDocsSkillDocument, resolveAskAISearchRequestConfig, resolveChangelogConfig, resolveDocsAgentFeedbackConfig, resolveDocsAgentFeedbackRequest, resolveDocsAgentMdxContent, resolveDocsAnalyticsConfig, resolveDocsI18n, resolveDocsLlmsTxtFormat, resolveDocsLlmsTxtRequest, resolveDocsLlmsTxtSections, resolveDocsLocale, resolveDocsMarkdownCanonicalUrl, resolveDocsMarkdownRequest, resolveDocsMetadataBaseUrl, resolveDocsObservabilityConfig, resolveDocsOpenApiDiscoveryConfig, resolveDocsPath, resolveDocsRobotsConfig, resolveDocsRobotsRequest, resolveDocsSitemapConfig, resolveDocsSitemapPageLastmod, resolveDocsSitemapRequest, resolveDocsSkillFormat, resolveOGImage, resolvePageReadingTime, resolvePageSidebarFolderIndexBehavior, resolveReadingTimeFromContent, resolveReadingTimeFromSource, resolveReadingTimeOptions, resolveSearchRequestConfig, resolveSidebarFolderIndexBehavior, resolveSidebarFolderIndexBehaviorForPath, resolveTitle, selectDocsLlmsTxtContent, serializeGeneratedAgentDocument, stripGeneratedAgentProvenance, toDocsMarkdownUrl, toDocsSitemapMarkdownUrl, upsertDocsRobotsGeneratedBlock, validateDocsAgentFeedbackPayload };
|
package/dist/index.mjs
CHANGED
|
@@ -2,6 +2,6 @@ import { _ as extendTheme, a as resolveReadingTimeOptions, b as defineDocs, c as
|
|
|
2
2
|
import { A as resolveDocsAnalyticsConfig, C as resolveSidebarFolderIndexBehaviorForPath, D as emitDocsAgentTraceEvent, E as createDocsAgentTraceId, M as createDocsCloudAnalytics, O as emitDocsAnalyticsEvent, S as resolveSidebarFolderIndexBehavior, T as createDocsAgentTraceContext, _ as parseGeneratedAgentDocument, a as createMcpSearchAdapter, b as applySidebarFolderIndexBehavior, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, f as resolveSearchRequestConfig, g as normalizeGeneratedAgentContent, h as hashGeneratedAgentContent, i as createCustomSearchAdapter, j as resolveDocsObservabilityConfig, k as emitDocsObservabilityEvent, l as inferDocsAskAIPackageHints, m as GENERATED_AGENT_PROVENANCE_VERSION, n as buildDocsSearchDocuments, o as createSimpleSearchAdapter, p as GENERATED_AGENT_PROVENANCE_MARKER, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, u as performDocsSearch, v as serializeGeneratedAgentDocument, w as DOCS_AGENT_TRACE_EVENT_TYPES, x as resolvePageSidebarFolderIndexBehavior, y as stripGeneratedAgentProvenance } from "./search-BL7o2rXk.mjs";
|
|
3
3
|
import { n as renderDocsRelatedMarkdownLines, t as normalizeDocsRelated } from "./related-BNj_NdHq.mjs";
|
|
4
4
|
import { a as buildDocsSitemapManifest, c as renderDocsSitemapMarkdown, d as resolveDocsSitemapPageLastmod, f as resolveDocsSitemapRequest, i as DEFAULT_SITEMAP_XML_ROUTE, l as renderDocsSitemapXml, n as DEFAULT_SITEMAP_MD_ROUTE, o as createDocsSitemapResponse, p as toDocsSitemapMarkdownUrl, r as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, s as readDocsSitemapManifestFromContentMap, t as DEFAULT_SITEMAP_MANIFEST_PATH, u as resolveDocsSitemapConfig } from "./sitemap-CnqcTdQg.mjs";
|
|
5
|
-
import { $ as
|
|
5
|
+
import { $ as resolveDocsAgentFeedbackRequest, A as DOCS_MARKDOWN_SIGNATURE_AGENT_HEADER, B as isDocsLlmsTxtPublicRequest, C as DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE, D as DEFAULT_OPENAPI_SCHEMA_ROUTE, E as DEFAULT_MCP_WELL_KNOWN_ROUTE, F as getDocsLlmsTxtMaxCharsIssue, G as normalizeDocsPathSegment, H as isDocsPublicGetRequest, I as getDocsMarkdownCanonicalLinkHeader, J as renderDocsLlmsTxt, K as normalizeDocsUrlPath, L as getDocsMarkdownVaryHeader, M as buildDocsAgentFeedbackSchema, N as buildDocsMcpEndpointCandidates, O as DEFAULT_SKILL_MD_ROUTE, P as findDocsMarkdownPage, Q as resolveDocsAgentFeedbackConfig, R as hasDocsMarkdownSignatureAgent, S as DEFAULT_LLMS_TXT_ROUTE, T as DEFAULT_MCP_ROUTE, U as isDocsSkillRequest, V as isDocsMcpRequest, W as matchesDocsLlmsTxtSection, X as renderDocsMarkdownNotFound, Y as renderDocsMarkdownDocument, Z as renderDocsSkillDocument, _ as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, a as analyzeDocsRobotsTxt, at as resolveDocsMarkdownRequest, b as DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE, c as renderDocsRobotsGeneratedBlock, ct as selectDocsLlmsTxtContent, d as resolveDocsRobotsRequest, et as resolveDocsAgentMdxContent, f as upsertDocsRobotsGeneratedBlock, g as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, h as DEFAULT_AGENT_SPEC_ROUTE, i as DOCS_ROBOTS_GENERATED_BLOCK_START, it as resolveDocsMarkdownCanonicalUrl, j as buildDocsAgentDiscoverySpec, k as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, l as renderDocsRobotsTxt, lt as toDocsMarkdownUrl, m as DEFAULT_AGENT_FEEDBACK_ROUTE, n as DEFAULT_ROBOTS_TXT_ROUTE, nt as resolveDocsLlmsTxtRequest, o as createDocsRobotsResponse, ot as resolveDocsOpenApiDiscoveryConfig, p as DEFAULT_AGENT_FEEDBACK_PAYLOAD_SCHEMA, q as parseDocsAgentFeedbackData, r as DOCS_ROBOTS_GENERATED_BLOCK_END, rt as resolveDocsLlmsTxtSections, s as getDocsRobotsAllowRoutes, st as resolveDocsSkillFormat, t as DEFAULT_DOCS_AI_ROBOTS_USER_AGENTS, tt as resolveDocsLlmsTxtFormat, u as resolveDocsRobotsConfig, ut as validateDocsAgentFeedbackPayload, v as DEFAULT_DOCS_API_ROUTE, w as DEFAULT_MCP_PUBLIC_ROUTE, x as DEFAULT_LLMS_TXT_MAX_CHARS, y as DEFAULT_LLMS_FULL_TXT_ROUTE, z as isDocsAgentDiscoveryRequest } from "./robots-D8IQoKv1.mjs";
|
|
6
6
|
|
|
7
|
-
export { DEFAULT_AGENT_FEEDBACK_PAYLOAD_SCHEMA, DEFAULT_AGENT_FEEDBACK_ROUTE, DEFAULT_AGENT_SPEC_ROUTE, DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, DEFAULT_DOCS_AI_ROBOTS_USER_AGENTS, DEFAULT_DOCS_API_ROUTE, DEFAULT_LLMS_FULL_TXT_ROUTE, DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE, DEFAULT_LLMS_TXT_MAX_CHARS, DEFAULT_LLMS_TXT_ROUTE, DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE, DEFAULT_MCP_PUBLIC_ROUTE, DEFAULT_MCP_ROUTE, DEFAULT_MCP_WELL_KNOWN_ROUTE, DEFAULT_ROBOTS_TXT_ROUTE, DEFAULT_SITEMAP_MANIFEST_PATH, DEFAULT_SITEMAP_MD_ROUTE, DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, DEFAULT_SITEMAP_XML_ROUTE, DEFAULT_SKILL_MD_ROUTE, DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, DOCS_AGENT_TRACE_EVENT_TYPES, DOCS_MARKDOWN_SIGNATURE_AGENT_HEADER, DOCS_ROBOTS_GENERATED_BLOCK_END, DOCS_ROBOTS_GENERATED_BLOCK_START, GENERATED_AGENT_PROVENANCE_MARKER, GENERATED_AGENT_PROVENANCE_VERSION, analyzeDocsRobotsTxt, applySidebarFolderIndexBehavior, buildDocsAgentDiscoverySpec, buildDocsAgentFeedbackSchema, buildDocsAskAIContext, buildDocsPageStructuredData, buildDocsSearchDocuments, buildDocsSitemapManifest, buildPageOpenGraph, buildPageTwitter, createAlgoliaSearchAdapter, createCustomSearchAdapter, createDocsAgentTraceContext, createDocsAgentTraceId, createDocsCloudAnalytics, createDocsRobotsResponse, createDocsSitemapResponse, createMcpSearchAdapter, createSimpleSearchAdapter, createTheme, createTypesenseSearchAdapter, deepMerge, defineDocs, emitDocsAgentTraceEvent, emitDocsAnalyticsEvent, emitDocsObservabilityEvent, estimateReadingTimeMinutes, extendTheme, findDocsMarkdownPage, formatDocsAskAIPackageHints, getDocsLlmsTxtMaxCharsIssue, getDocsMarkdownCanonicalLinkHeader, getDocsMarkdownVaryHeader, getDocsRobotsAllowRoutes, hasDocsMarkdownSignatureAgent, hashGeneratedAgentContent, inferDocsAskAIPackageHints, isDocsAgentDiscoveryRequest, isDocsLlmsTxtPublicRequest, isDocsMcpRequest, isDocsPublicGetRequest, isDocsSkillRequest, matchesDocsLlmsTxtSection, normalizeDocsPathSegment, normalizeDocsRelated, normalizeDocsUrlPath, normalizeGeneratedAgentContent, parseDocsAgentFeedbackData, parseGeneratedAgentDocument, performDocsSearch, readDocsSitemapManifestFromContentMap, renderDocsLlmsTxt, renderDocsMarkdownDocument, renderDocsMarkdownNotFound, renderDocsPageStructuredDataJson, renderDocsRelatedMarkdownLines, renderDocsRobotsGeneratedBlock, renderDocsRobotsTxt, renderDocsSitemapMarkdown, renderDocsSitemapXml, renderDocsSkillDocument, resolveAskAISearchRequestConfig, resolveChangelogConfig, resolveDocsAgentFeedbackConfig, resolveDocsAgentFeedbackRequest, resolveDocsAgentMdxContent, resolveDocsAnalyticsConfig, resolveDocsI18n, resolveDocsLlmsTxtFormat, resolveDocsLlmsTxtRequest, resolveDocsLlmsTxtSections, resolveDocsLocale, resolveDocsMarkdownCanonicalUrl, resolveDocsMarkdownRequest, resolveDocsMetadataBaseUrl, resolveDocsObservabilityConfig, resolveDocsPath, resolveDocsRobotsConfig, resolveDocsRobotsRequest, resolveDocsSitemapConfig, resolveDocsSitemapPageLastmod, resolveDocsSitemapRequest, resolveDocsSkillFormat, resolveOGImage, resolvePageReadingTime, resolvePageSidebarFolderIndexBehavior, resolveReadingTimeFromContent, resolveReadingTimeFromSource, resolveReadingTimeOptions, resolveSearchRequestConfig, resolveSidebarFolderIndexBehavior, resolveSidebarFolderIndexBehaviorForPath, resolveTitle, selectDocsLlmsTxtContent, serializeGeneratedAgentDocument, stripGeneratedAgentProvenance, toDocsMarkdownUrl, toDocsSitemapMarkdownUrl, upsertDocsRobotsGeneratedBlock, validateDocsAgentFeedbackPayload };
|
|
7
|
+
export { DEFAULT_AGENT_FEEDBACK_PAYLOAD_SCHEMA, DEFAULT_AGENT_FEEDBACK_ROUTE, DEFAULT_AGENT_SPEC_ROUTE, DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, DEFAULT_DOCS_AI_ROBOTS_USER_AGENTS, DEFAULT_DOCS_API_ROUTE, DEFAULT_LLMS_FULL_TXT_ROUTE, DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE, DEFAULT_LLMS_TXT_MAX_CHARS, DEFAULT_LLMS_TXT_ROUTE, DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE, DEFAULT_MCP_PUBLIC_ROUTE, DEFAULT_MCP_ROUTE, DEFAULT_MCP_WELL_KNOWN_ROUTE, DEFAULT_OPENAPI_SCHEMA_ROUTE, DEFAULT_ROBOTS_TXT_ROUTE, DEFAULT_SITEMAP_MANIFEST_PATH, DEFAULT_SITEMAP_MD_ROUTE, DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, DEFAULT_SITEMAP_XML_ROUTE, DEFAULT_SKILL_MD_ROUTE, DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, DOCS_AGENT_TRACE_EVENT_TYPES, DOCS_MARKDOWN_SIGNATURE_AGENT_HEADER, DOCS_ROBOTS_GENERATED_BLOCK_END, DOCS_ROBOTS_GENERATED_BLOCK_START, GENERATED_AGENT_PROVENANCE_MARKER, GENERATED_AGENT_PROVENANCE_VERSION, analyzeDocsRobotsTxt, applySidebarFolderIndexBehavior, buildDocsAgentDiscoverySpec, buildDocsAgentFeedbackSchema, buildDocsAskAIContext, buildDocsMcpEndpointCandidates, buildDocsPageStructuredData, buildDocsSearchDocuments, buildDocsSitemapManifest, buildPageOpenGraph, buildPageTwitter, createAlgoliaSearchAdapter, createCustomSearchAdapter, createDocsAgentTraceContext, createDocsAgentTraceId, createDocsCloudAnalytics, createDocsRobotsResponse, createDocsSitemapResponse, createMcpSearchAdapter, createSimpleSearchAdapter, createTheme, createTypesenseSearchAdapter, deepMerge, defineDocs, emitDocsAgentTraceEvent, emitDocsAnalyticsEvent, emitDocsObservabilityEvent, estimateReadingTimeMinutes, extendTheme, findDocsMarkdownPage, formatDocsAskAIPackageHints, getDocsLlmsTxtMaxCharsIssue, getDocsMarkdownCanonicalLinkHeader, getDocsMarkdownVaryHeader, getDocsRobotsAllowRoutes, hasDocsMarkdownSignatureAgent, hashGeneratedAgentContent, inferDocsAskAIPackageHints, isDocsAgentDiscoveryRequest, isDocsLlmsTxtPublicRequest, isDocsMcpRequest, isDocsPublicGetRequest, isDocsSkillRequest, matchesDocsLlmsTxtSection, normalizeDocsPathSegment, normalizeDocsRelated, normalizeDocsUrlPath, normalizeGeneratedAgentContent, parseDocsAgentFeedbackData, parseGeneratedAgentDocument, performDocsSearch, readDocsSitemapManifestFromContentMap, renderDocsLlmsTxt, renderDocsMarkdownDocument, renderDocsMarkdownNotFound, renderDocsPageStructuredDataJson, renderDocsRelatedMarkdownLines, renderDocsRobotsGeneratedBlock, renderDocsRobotsTxt, renderDocsSitemapMarkdown, renderDocsSitemapXml, renderDocsSkillDocument, resolveAskAISearchRequestConfig, resolveChangelogConfig, resolveDocsAgentFeedbackConfig, resolveDocsAgentFeedbackRequest, resolveDocsAgentMdxContent, resolveDocsAnalyticsConfig, resolveDocsI18n, resolveDocsLlmsTxtFormat, resolveDocsLlmsTxtRequest, resolveDocsLlmsTxtSections, resolveDocsLocale, resolveDocsMarkdownCanonicalUrl, resolveDocsMarkdownRequest, resolveDocsMetadataBaseUrl, resolveDocsObservabilityConfig, resolveDocsOpenApiDiscoveryConfig, resolveDocsPath, resolveDocsRobotsConfig, resolveDocsRobotsRequest, resolveDocsSitemapConfig, resolveDocsSitemapPageLastmod, resolveDocsSitemapRequest, resolveDocsSkillFormat, resolveOGImage, resolvePageReadingTime, resolvePageSidebarFolderIndexBehavior, resolveReadingTimeFromContent, resolveReadingTimeFromSource, resolveReadingTimeOptions, resolveSearchRequestConfig, resolveSidebarFolderIndexBehavior, resolveSidebarFolderIndexBehaviorForPath, resolveTitle, selectDocsLlmsTxtContent, serializeGeneratedAgentDocument, stripGeneratedAgentProvenance, toDocsMarkdownUrl, toDocsSitemapMarkdownUrl, upsertDocsRobotsGeneratedBlock, validateDocsAgentFeedbackPayload };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./search-BL7o2rXk.mjs";
|
|
2
|
-
import "./sitemap-server-
|
|
2
|
+
import "./sitemap-server-C4TbbCmY.mjs";
|
|
3
3
|
import { createFilesystemDocsMcpSource, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
4
4
|
import "./server.mjs";
|
|
5
5
|
import { c as readNavTitle, f as resolveDocsConfigPath, n as extractObjectLiteral, o as readBooleanProperty, p as resolveDocsContentDir, u as readStringProperty } from "./config-UI31_wlO.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as renderDocsRobotsGeneratedBlock, f as upsertDocsRobotsGeneratedBlock, i as DOCS_ROBOTS_GENERATED_BLOCK_START, r as DOCS_ROBOTS_GENERATED_BLOCK_END, u as resolveDocsRobotsConfig } from "./robots-
|
|
1
|
+
import { c as renderDocsRobotsGeneratedBlock, f as upsertDocsRobotsGeneratedBlock, i as DOCS_ROBOTS_GENERATED_BLOCK_START, r as DOCS_ROBOTS_GENERATED_BLOCK_END, u as resolveDocsRobotsConfig } from "./robots-D8IQoKv1.mjs";
|
|
2
2
|
import { d as readTopLevelStringProperty, f as resolveDocsConfigPath, i as loadDocsConfigModule, o as readBooleanProperty, t as extractNestedObjectLiteral, u as readStringProperty } from "./config-UI31_wlO.mjs";
|
|
3
3
|
import { t as detectFramework } from "./utils-AmYxHDoz.mjs";
|
|
4
4
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
@@ -3,6 +3,7 @@ import { f as resolveDocsSitemapRequest, i as DEFAULT_SITEMAP_XML_ROUTE, n as DE
|
|
|
3
3
|
|
|
4
4
|
//#region src/agent.ts
|
|
5
5
|
const DEFAULT_DOCS_API_ROUTE = "/api/docs";
|
|
6
|
+
const DEFAULT_OPENAPI_SCHEMA_ROUTE = `${DEFAULT_DOCS_API_ROUTE}?format=openapi`;
|
|
6
7
|
const DEFAULT_AGENT_SPEC_ROUTE = "/api/docs/agent/spec";
|
|
7
8
|
const DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE = "/.well-known/agent";
|
|
8
9
|
const DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE = "/.well-known/agent.json";
|
|
@@ -63,6 +64,29 @@ const DEFAULT_AGENT_FEEDBACK_PAYLOAD_SCHEMA = {
|
|
|
63
64
|
};
|
|
64
65
|
const DOCS_MARKDOWN_SIGNATURE_AGENT_HEADER = "Signature-Agent";
|
|
65
66
|
const DOCS_LLMS_TXT_DIRECTIVE_LINE = "LLM index: /llms.txt";
|
|
67
|
+
const DOCS_MCP_SERVICE_SUBDOMAIN_LABELS = new Set([
|
|
68
|
+
"api",
|
|
69
|
+
"developer",
|
|
70
|
+
"developers",
|
|
71
|
+
"dev",
|
|
72
|
+
"docs",
|
|
73
|
+
"help",
|
|
74
|
+
"mcp",
|
|
75
|
+
"reference"
|
|
76
|
+
]);
|
|
77
|
+
const COMMON_SECOND_LEVEL_PUBLIC_SUFFIX_LABELS = new Set([
|
|
78
|
+
"ac",
|
|
79
|
+
"co",
|
|
80
|
+
"com",
|
|
81
|
+
"edu",
|
|
82
|
+
"go",
|
|
83
|
+
"gov",
|
|
84
|
+
"mil",
|
|
85
|
+
"ne",
|
|
86
|
+
"net",
|
|
87
|
+
"or",
|
|
88
|
+
"org"
|
|
89
|
+
]);
|
|
66
90
|
function normalizeDocsPathSegment(value) {
|
|
67
91
|
return value.replace(/^\/+|\/+$/g, "");
|
|
68
92
|
}
|
|
@@ -356,6 +380,10 @@ function renderLlmsTxtPageList(pages, baseUrl) {
|
|
|
356
380
|
}
|
|
357
381
|
return content;
|
|
358
382
|
}
|
|
383
|
+
function resolveDocsResourceUrl(baseUrl, url) {
|
|
384
|
+
if (/^[a-z][a-z0-9+.-]*:/i.test(url)) return url;
|
|
385
|
+
return `${baseUrl}${url.startsWith("/") ? url : `/${url}`}`;
|
|
386
|
+
}
|
|
359
387
|
function renderLlmsFullTxtPages(pages, baseUrl) {
|
|
360
388
|
let content = "";
|
|
361
389
|
for (const page of pages) {
|
|
@@ -372,6 +400,7 @@ function renderDocsLlmsTxt(pages, options = {}) {
|
|
|
372
400
|
const baseUrl = options.baseUrl ?? "";
|
|
373
401
|
const maxChars = normalizeLlmsTxtMaxChars(options.maxChars);
|
|
374
402
|
const sections = resolveDocsLlmsTxtSections(options);
|
|
403
|
+
const openapi = resolveDocsOpenApiDiscoveryConfig(options.openapi);
|
|
375
404
|
const matchedPageUrls = /* @__PURE__ */ new Set();
|
|
376
405
|
const generatedSections = sections.map((section) => {
|
|
377
406
|
const sectionPages = pages.filter((page) => matchesDocsLlmsTxtSection(page.url, section));
|
|
@@ -403,6 +432,12 @@ function renderDocsLlmsTxt(pages, options = {}) {
|
|
|
403
432
|
}
|
|
404
433
|
llmsTxt += "\n";
|
|
405
434
|
}
|
|
435
|
+
if (openapi.enabled && openapi.url) {
|
|
436
|
+
llmsTxt += "## API Schemas\n\n";
|
|
437
|
+
llmsTxt += `- [OpenAPI schema](${resolveDocsResourceUrl(baseUrl, openapi.url)}): Machine-readable API schema for tool use and API clients`;
|
|
438
|
+
if (openapi.apiReferencePath) llmsTxt += `; rendered API reference at ${resolveDocsResourceUrl(baseUrl, openapi.apiReferencePath)}`;
|
|
439
|
+
llmsTxt += "\n\n";
|
|
440
|
+
}
|
|
406
441
|
if (rootPages.length > 0 || generatedSections.length === 0) {
|
|
407
442
|
llmsTxt += "## Pages\n\n";
|
|
408
443
|
llmsTxt += renderLlmsTxtPageList(rootPages, baseUrl);
|
|
@@ -458,6 +493,85 @@ function isDocsMcpRequest(url) {
|
|
|
458
493
|
const pathname = normalizeDocsUrlPath(url.pathname);
|
|
459
494
|
return pathname === DEFAULT_MCP_ROUTE || pathname === DEFAULT_MCP_PUBLIC_ROUTE || pathname === DEFAULT_MCP_WELL_KNOWN_ROUTE;
|
|
460
495
|
}
|
|
496
|
+
function buildDocsMcpEndpointCandidates(baseUrl, routes = [DEFAULT_MCP_PUBLIC_ROUTE, DEFAULT_MCP_WELL_KNOWN_ROUTE], options = {}) {
|
|
497
|
+
const includeOriginFallback = options.includeOriginFallback !== false;
|
|
498
|
+
const includeRootDomainFallback = options.includeRootDomainFallback !== false;
|
|
499
|
+
const includeMcpSubdomainFallback = options.includeMcpSubdomainFallback !== false;
|
|
500
|
+
const base = new URL(baseUrl);
|
|
501
|
+
const primaryOrigin = base.origin;
|
|
502
|
+
const seen = /* @__PURE__ */ new Set();
|
|
503
|
+
const candidates = [];
|
|
504
|
+
const addCandidate = (candidateBaseUrl, route) => {
|
|
505
|
+
const resolved = resolveDocsMcpCandidateUrl(candidateBaseUrl, route);
|
|
506
|
+
if (seen.has(resolved.url)) return;
|
|
507
|
+
seen.add(resolved.url);
|
|
508
|
+
candidates.push({
|
|
509
|
+
...resolved,
|
|
510
|
+
label: formatDocsMcpCandidateLabel(resolved.url, primaryOrigin)
|
|
511
|
+
});
|
|
512
|
+
};
|
|
513
|
+
for (const route of routes) addCandidate(baseUrl, route);
|
|
514
|
+
const originBaseUrl = primaryOrigin;
|
|
515
|
+
if (includeOriginFallback && originBaseUrl !== baseUrl.replace(/\/+$/, "")) for (const route of routes) addCandidate(originBaseUrl, route);
|
|
516
|
+
if (includeRootDomainFallback) for (const rootDomainBaseUrl of toDocsRootDomainBaseUrls(base)) for (const route of routes) addCandidate(rootDomainBaseUrl, route);
|
|
517
|
+
if (includeMcpSubdomainFallback) for (const mcpBaseUrl of toDocsMcpSubdomainBaseUrls(base)) {
|
|
518
|
+
addCandidate(mcpBaseUrl, DEFAULT_MCP_PUBLIC_ROUTE);
|
|
519
|
+
addCandidate(mcpBaseUrl, "/");
|
|
520
|
+
}
|
|
521
|
+
return candidates;
|
|
522
|
+
}
|
|
523
|
+
function resolveDocsMcpCandidateUrl(baseUrl, route) {
|
|
524
|
+
if (/^https?:\/\//i.test(route)) {
|
|
525
|
+
const parsed = new URL(route);
|
|
526
|
+
const path = `${parsed.pathname || "/"}${parsed.search}`;
|
|
527
|
+
return {
|
|
528
|
+
baseUrl: parsed.origin,
|
|
529
|
+
route: path,
|
|
530
|
+
url: parsed.toString()
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
const base = new URL(baseUrl);
|
|
534
|
+
const basePath = base.pathname.replace(/\/+$/, "");
|
|
535
|
+
const routePath = route.startsWith("/") ? route : `/${route}`;
|
|
536
|
+
const parsed = new URL(`${basePath}${routePath}`, base.origin);
|
|
537
|
+
return {
|
|
538
|
+
baseUrl: parsed.origin,
|
|
539
|
+
route: `${parsed.pathname}${parsed.search}`,
|
|
540
|
+
url: parsed.toString()
|
|
541
|
+
};
|
|
542
|
+
}
|
|
543
|
+
function formatDocsMcpCandidateLabel(url, primaryOrigin) {
|
|
544
|
+
const parsed = new URL(url);
|
|
545
|
+
const path = `${parsed.pathname}${parsed.search}`;
|
|
546
|
+
return parsed.origin === primaryOrigin ? path : `${parsed.origin}${path}`;
|
|
547
|
+
}
|
|
548
|
+
function toDocsMcpSubdomainBaseUrls(base) {
|
|
549
|
+
return getDocsMcpRootDomainCandidates(base.hostname).map((rootDomain) => `${base.protocol}//mcp.${rootDomain}${base.port ? `:${base.port}` : ""}`);
|
|
550
|
+
}
|
|
551
|
+
function toDocsRootDomainBaseUrls(base) {
|
|
552
|
+
return getDocsMcpRootDomainCandidates(base.hostname).map((rootDomain) => `${base.protocol}//${rootDomain}${base.port ? `:${base.port}` : ""}`);
|
|
553
|
+
}
|
|
554
|
+
function getDocsMcpRootDomainCandidates(hostname) {
|
|
555
|
+
const normalized = hostname.toLowerCase().replace(/^\[|\]$/g, "").replace(/\.$/, "");
|
|
556
|
+
if (!normalized || !normalized.includes(".") || isDocsIpHostname(normalized)) return [];
|
|
557
|
+
const labels = normalized.split(".").filter(Boolean);
|
|
558
|
+
if (labels.length < 2) return [];
|
|
559
|
+
const candidates = [];
|
|
560
|
+
const addCandidate = (candidateLabels) => {
|
|
561
|
+
if (candidateLabels.length < 2) return;
|
|
562
|
+
const candidate = candidateLabels.join(".");
|
|
563
|
+
if (!candidates.includes(candidate)) candidates.push(candidate);
|
|
564
|
+
};
|
|
565
|
+
if (labels.length >= 3 && DOCS_MCP_SERVICE_SUBDOMAIN_LABELS.has(labels[0] ?? "")) addCandidate(labels.slice(1));
|
|
566
|
+
const tld = labels.at(-1) ?? "";
|
|
567
|
+
const secondLevel = labels.at(-2) ?? "";
|
|
568
|
+
if (labels.length >= 3 && tld.length === 2 && COMMON_SECOND_LEVEL_PUBLIC_SUFFIX_LABELS.has(secondLevel)) addCandidate(labels.slice(-3));
|
|
569
|
+
else addCandidate(labels.slice(-2));
|
|
570
|
+
return candidates;
|
|
571
|
+
}
|
|
572
|
+
function isDocsIpHostname(hostname) {
|
|
573
|
+
return /^(\d{1,3}\.){3}\d{1,3}$/.test(hostname) || hostname.includes(":");
|
|
574
|
+
}
|
|
461
575
|
function isDocsSkillRequest(url) {
|
|
462
576
|
const pathname = normalizeDocsUrlPath(url.pathname);
|
|
463
577
|
if (pathname === DEFAULT_SKILL_MD_ROUTE || pathname === DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE) return true;
|
|
@@ -553,7 +667,7 @@ function renderDocsMarkdownDocument(page, options) {
|
|
|
553
667
|
lines.push("", page.agentFallbackRawContent ?? page.rawContent ?? page.content);
|
|
554
668
|
return lines.join("\n");
|
|
555
669
|
}
|
|
556
|
-
function renderDocsSkillDocument({ origin, entry = "docs", search, mcp, feedback, llms, sitemap, robots, markdown }) {
|
|
670
|
+
function renderDocsSkillDocument({ origin, entry = "docs", search, mcp, feedback, llms, sitemap, robots, openapi, markdown }) {
|
|
557
671
|
const normalizedEntry = normalizeDocsPathSegment(entry) || "docs";
|
|
558
672
|
const siteTitle = compactSkillText(llms?.siteTitle ?? "Documentation");
|
|
559
673
|
const siteDescription = llms?.siteDescription ? compactSkillText(llms.siteDescription) : void 0;
|
|
@@ -562,6 +676,7 @@ function renderDocsSkillDocument({ origin, entry = "docs", search, mcp, feedback
|
|
|
562
676
|
const feedbackEnabled = feedback?.enabled ?? false;
|
|
563
677
|
const sitemapConfig = resolveDocsSitemapConfig(sitemap);
|
|
564
678
|
const robotsEnabled = isRobotsDiscoveryEnabled(robots);
|
|
679
|
+
const openapiConfig = resolveDocsOpenApiDiscoveryConfig(openapi);
|
|
565
680
|
const feedbackRoute = feedback?.route ?? DEFAULT_AGENT_FEEDBACK_ROUTE;
|
|
566
681
|
const feedbackSchemaRoute = feedback?.schemaRoute ?? `${feedbackRoute}/schema`;
|
|
567
682
|
const llmsSections = resolveDocsLlmsTxtSections(llms);
|
|
@@ -583,6 +698,7 @@ function renderDocsSkillDocument({ origin, entry = "docs", search, mcp, feedback
|
|
|
583
698
|
if (markdownAcceptHeader) lines.push(`- You can also request ${markdownAcceptHeader} from normal page URLs.`);
|
|
584
699
|
if (markdownSignatureAgentHeader) lines.push(`- Requests with ${markdownSignatureAgentHeader} on normal page URLs receive markdown automatically.`);
|
|
585
700
|
if (searchEnabled) lines.push(`- Search with ${DEFAULT_DOCS_API_ROUTE}?query={query} when you do not know the page.`);
|
|
701
|
+
if (openapiConfig.enabled && openapiConfig.url) lines.push(`- Fetch ${openapiConfig.url} for the machine-readable OpenAPI schema before scraping API reference pages.`);
|
|
586
702
|
if (llmsEnabled) {
|
|
587
703
|
lines.push(`- Use ${DEFAULT_LLMS_TXT_ROUTE} for a compact docs index.`, `- Use ${DEFAULT_LLMS_FULL_TXT_ROUTE} for full markdown context.`);
|
|
588
704
|
for (const section of llmsSections) lines.push(`- Use ${section.route} for the ${section.title} llms.txt section.`);
|
|
@@ -603,6 +719,10 @@ function renderDocsSkillDocument({ origin, entry = "docs", search, mcp, feedback
|
|
|
603
719
|
lines.push(`- ${section.title} llms-full.txt: ${section.fullRoute}`);
|
|
604
720
|
}
|
|
605
721
|
}
|
|
722
|
+
if (openapiConfig.enabled && openapiConfig.url) {
|
|
723
|
+
lines.push(`- OpenAPI schema: ${openapiConfig.url}`);
|
|
724
|
+
if (openapiConfig.apiReferencePath) lines.push(`- API reference: ${openapiConfig.apiReferencePath}`);
|
|
725
|
+
}
|
|
606
726
|
if (sitemapConfig.enabled) {
|
|
607
727
|
if (sitemapConfig.xml.enabled) lines.push(`- Sitemap XML: ${sitemapConfig.xml.route}`);
|
|
608
728
|
if (sitemapConfig.markdown.enabled) lines.push(`- Sitemap Markdown: ${sitemapConfig.markdown.route}`, `- Sitemap well-known alias: ${sitemapConfig.markdown.wellKnownRoute}`);
|
|
@@ -658,7 +778,7 @@ function resolveDocsAgentMdxContent(content, audience) {
|
|
|
658
778
|
}
|
|
659
779
|
return output.join("\n").replace(/\n{3,}/g, "\n\n").trim();
|
|
660
780
|
}
|
|
661
|
-
function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, search, mcp, feedback, llms, sitemap, robots, markdown }) {
|
|
781
|
+
function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, search, mcp, feedback, llms, sitemap, robots, openapi, markdown }) {
|
|
662
782
|
const normalizedEntry = normalizeDocsPathSegment(entry) || "docs";
|
|
663
783
|
const localesEnabled = i18n !== null;
|
|
664
784
|
const searchEnabled = isSearchEnabled(search);
|
|
@@ -668,6 +788,7 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, sear
|
|
|
668
788
|
const llmsSections = resolveDocsLlmsTxtSections(llms);
|
|
669
789
|
const sitemapConfig = resolveDocsSitemapConfig(sitemap, { baseUrl: llms?.baseUrl });
|
|
670
790
|
const robotsEnabled = isRobotsDiscoveryEnabled(robots);
|
|
791
|
+
const openapiConfig = resolveDocsOpenApiDiscoveryConfig(openapi);
|
|
671
792
|
return {
|
|
672
793
|
version: "1",
|
|
673
794
|
name: "@farming-labs/docs",
|
|
@@ -696,6 +817,8 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, sear
|
|
|
696
817
|
sitemap: sitemapConfig.enabled,
|
|
697
818
|
robots: robotsEnabled,
|
|
698
819
|
structuredData: true,
|
|
820
|
+
apiReference: openapiConfig.enabled,
|
|
821
|
+
openapi: openapiConfig.enabled,
|
|
699
822
|
agentFeedback: feedback?.enabled ?? false,
|
|
700
823
|
locales: localesEnabled
|
|
701
824
|
},
|
|
@@ -706,7 +829,8 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, sear
|
|
|
706
829
|
agentSpecFallback: DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE,
|
|
707
830
|
agentSpecWellKnown: DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE,
|
|
708
831
|
agentSpecWellKnownJson: DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE,
|
|
709
|
-
agentSpecQuery: `${DEFAULT_DOCS_API_ROUTE}?agent=spec
|
|
832
|
+
agentSpecQuery: `${DEFAULT_DOCS_API_ROUTE}?agent=spec`,
|
|
833
|
+
openapi: DEFAULT_OPENAPI_SCHEMA_ROUTE
|
|
710
834
|
},
|
|
711
835
|
markdown: {
|
|
712
836
|
enabled: true,
|
|
@@ -775,6 +899,14 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, sear
|
|
|
775
899
|
canonicalUrlField: "url",
|
|
776
900
|
breadcrumbType: "BreadcrumbList"
|
|
777
901
|
},
|
|
902
|
+
openapi: {
|
|
903
|
+
enabled: openapiConfig.enabled,
|
|
904
|
+
url: openapiConfig.url ?? null,
|
|
905
|
+
source: openapiConfig.source ?? null,
|
|
906
|
+
specUrl: openapiConfig.specUrl ?? null,
|
|
907
|
+
apiReferencePath: openapiConfig.apiReferencePath ?? null,
|
|
908
|
+
format: "OpenAPI 3.1"
|
|
909
|
+
},
|
|
778
910
|
search: {
|
|
779
911
|
enabled: searchEnabled,
|
|
780
912
|
endpoint: `${DEFAULT_DOCS_API_ROUTE}?query={query}`,
|
|
@@ -818,6 +950,7 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, sear
|
|
|
818
950
|
instructions: {
|
|
819
951
|
preferMarkdownRoutes: true,
|
|
820
952
|
useMcpWhenAvailable: true,
|
|
953
|
+
useOpenApiWhenAvailable: true,
|
|
821
954
|
readFeedbackSchemaBeforeSubmitting: true,
|
|
822
955
|
doNotAssumeFeedbackPayloadShape: true
|
|
823
956
|
}
|
|
@@ -855,6 +988,22 @@ function isRobotsDiscoveryEnabled(robots) {
|
|
|
855
988
|
if (robots && typeof robots === "object" && robots.enabled === false) return false;
|
|
856
989
|
return true;
|
|
857
990
|
}
|
|
991
|
+
function resolveDocsOpenApiDiscoveryConfig(openapi) {
|
|
992
|
+
if (openapi === false || openapi === void 0) return { enabled: false };
|
|
993
|
+
if (openapi === true) return {
|
|
994
|
+
enabled: true,
|
|
995
|
+
url: DEFAULT_OPENAPI_SCHEMA_ROUTE,
|
|
996
|
+
source: "generated"
|
|
997
|
+
};
|
|
998
|
+
if (openapi.enabled === false) return { enabled: false };
|
|
999
|
+
return {
|
|
1000
|
+
enabled: true,
|
|
1001
|
+
url: openapi.url ?? DEFAULT_OPENAPI_SCHEMA_ROUTE,
|
|
1002
|
+
source: openapi.source ?? "generated",
|
|
1003
|
+
specUrl: openapi.specUrl,
|
|
1004
|
+
apiReferencePath: openapi.apiReferencePath
|
|
1005
|
+
};
|
|
1006
|
+
}
|
|
858
1007
|
function compactSkillText(value) {
|
|
859
1008
|
return value.replace(/\s+/g, " ").trim();
|
|
860
1009
|
}
|
|
@@ -1051,4 +1200,4 @@ function analyzeDocsRobotsTxt(content, options = {}) {
|
|
|
1051
1200
|
}
|
|
1052
1201
|
|
|
1053
1202
|
//#endregion
|
|
1054
|
-
export {
|
|
1203
|
+
export { resolveDocsAgentFeedbackRequest as $, DOCS_MARKDOWN_SIGNATURE_AGENT_HEADER as A, isDocsLlmsTxtPublicRequest as B, DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE as C, DEFAULT_OPENAPI_SCHEMA_ROUTE as D, DEFAULT_MCP_WELL_KNOWN_ROUTE as E, getDocsLlmsTxtMaxCharsIssue as F, normalizeDocsPathSegment as G, isDocsPublicGetRequest as H, getDocsMarkdownCanonicalLinkHeader as I, renderDocsLlmsTxt as J, normalizeDocsUrlPath as K, getDocsMarkdownVaryHeader as L, buildDocsAgentFeedbackSchema as M, buildDocsMcpEndpointCandidates as N, DEFAULT_SKILL_MD_ROUTE as O, findDocsMarkdownPage as P, resolveDocsAgentFeedbackConfig as Q, hasDocsMarkdownSignatureAgent as R, DEFAULT_LLMS_TXT_ROUTE as S, DEFAULT_MCP_ROUTE as T, isDocsSkillRequest as U, isDocsMcpRequest as V, matchesDocsLlmsTxtSection as W, renderDocsMarkdownNotFound as X, renderDocsMarkdownDocument as Y, renderDocsSkillDocument as Z, DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE as _, analyzeDocsRobotsTxt as a, resolveDocsMarkdownRequest as at, DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE as b, renderDocsRobotsGeneratedBlock as c, selectDocsLlmsTxtContent as ct, resolveDocsRobotsRequest as d, resolveDocsAgentMdxContent as et, upsertDocsRobotsGeneratedBlock as f, DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE as g, DEFAULT_AGENT_SPEC_ROUTE as h, DOCS_ROBOTS_GENERATED_BLOCK_START as i, resolveDocsMarkdownCanonicalUrl as it, buildDocsAgentDiscoverySpec as j, DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE as k, renderDocsRobotsTxt as l, toDocsMarkdownUrl as lt, DEFAULT_AGENT_FEEDBACK_ROUTE as m, DEFAULT_ROBOTS_TXT_ROUTE as n, resolveDocsLlmsTxtRequest as nt, createDocsRobotsResponse as o, resolveDocsOpenApiDiscoveryConfig as ot, DEFAULT_AGENT_FEEDBACK_PAYLOAD_SCHEMA as p, parseDocsAgentFeedbackData as q, DOCS_ROBOTS_GENERATED_BLOCK_END as r, resolveDocsLlmsTxtSections as rt, getDocsRobotsAllowRoutes as s, resolveDocsSkillFormat as st, DEFAULT_DOCS_AI_ROBOTS_USER_AGENTS as t, resolveDocsLlmsTxtFormat as tt, resolveDocsRobotsConfig as u, validateDocsAgentFeedbackPayload as ut, DEFAULT_DOCS_API_ROUTE as v, DEFAULT_MCP_PUBLIC_ROUTE as w, DEFAULT_LLMS_TXT_MAX_CHARS as x, DEFAULT_LLMS_FULL_TXT_ROUTE as y, isDocsAgentDiscoveryRequest as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as buildDocsSearchDocuments, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter } from "./search-BL7o2rXk.mjs";
|
|
2
|
-
import "./sitemap-server-
|
|
2
|
+
import "./sitemap-server-C4TbbCmY.mjs";
|
|
3
3
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
4
4
|
import "./server.mjs";
|
|
5
5
|
import { a as loadProjectEnv, d as readTopLevelStringProperty, f as resolveDocsConfigPath, p as resolveDocsContentDir } from "./config-UI31_wlO.mjs";
|
package/dist/server.d.mts
CHANGED
|
@@ -23,6 +23,13 @@ interface ResolvedApiReferenceConfig {
|
|
|
23
23
|
routeRoot: string;
|
|
24
24
|
exclude: string[];
|
|
25
25
|
}
|
|
26
|
+
interface ApiReferenceOpenApiDiscovery {
|
|
27
|
+
enabled: boolean;
|
|
28
|
+
url?: string;
|
|
29
|
+
source?: "generated" | "configured";
|
|
30
|
+
specUrl?: string;
|
|
31
|
+
apiReferencePath?: string;
|
|
32
|
+
}
|
|
26
33
|
interface BuildApiReferenceOptions {
|
|
27
34
|
framework: ApiReferenceFramework;
|
|
28
35
|
rootDir?: string;
|
|
@@ -31,8 +38,13 @@ interface BuildApiReferenceOptions {
|
|
|
31
38
|
interface BuildApiReferenceHtmlOptions extends BuildApiReferenceOptions {
|
|
32
39
|
title?: string;
|
|
33
40
|
}
|
|
41
|
+
declare const DEFAULT_API_REFERENCE_OPENAPI_ROUTE = "/api/docs?format=openapi";
|
|
34
42
|
declare function resolveApiReferenceConfig(value: DocsConfig["apiReference"]): ResolvedApiReferenceConfig;
|
|
35
43
|
declare function resolveApiReferenceRenderer(value: DocsConfig["apiReference"], framework: ApiReferenceFramework): ApiReferenceRenderer;
|
|
44
|
+
declare function resolveApiReferenceOpenApiDiscovery(value: DocsConfig["apiReference"], options?: {
|
|
45
|
+
route?: string;
|
|
46
|
+
}): ApiReferenceOpenApiDiscovery;
|
|
47
|
+
declare function isApiReferenceOpenApiRequest(url: URL): boolean;
|
|
36
48
|
declare function buildApiReferencePageTitle(config: DocsConfig, title?: string): string;
|
|
37
49
|
declare function buildApiReferenceScalarCss(config: DocsConfig): string;
|
|
38
50
|
declare function buildApiReferenceOpenApiDocument(config: DocsConfig, options: BuildApiReferenceOptions): Record<string, unknown>;
|
|
@@ -66,4 +78,4 @@ declare function sanitizePromptText(text: string): string;
|
|
|
66
78
|
//#region src/sitemap-server.d.ts
|
|
67
79
|
declare function readDocsSitemapManifest(rootDir: string, sitemap?: boolean | DocsSitemapConfig): DocsSitemapManifest | null;
|
|
68
80
|
//#endregion
|
|
69
|
-
export { type ApiReferenceFramework, type ApiReferenceRenderer, type ApiReferenceRoute, 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 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 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, normalizeDocsMcpRoute, normalizePromptProviderName, parsePromptStringArray, performDocsSearch, readDocsSitemapManifest, readDocsSitemapManifestFromContentMap, renderDocsSitemapMarkdown, renderDocsSitemapXml, resolveApiReferenceConfig, resolveApiReferenceRenderer, resolveAskAISearchRequestConfig, resolveDocsAnalyticsConfig, resolveDocsMcpConfig, resolveDocsObservabilityConfig, resolveDocsSitemapConfig, resolveDocsSitemapPageLastmod, resolveDocsSitemapRequest, resolvePromptProviderChoices, resolveSearchRequestConfig, runDocsMcpStdio, sanitizePromptText, serializeDocsIcon, serializeDocsIconRegistry, serializeOpenDocsProviders, toDocsSitemapMarkdownUrl };
|
|
81
|
+
export { type ApiReferenceFramework, type ApiReferenceOpenApiDiscovery, type ApiReferenceRenderer, type ApiReferenceRoute, DEFAULT_API_REFERENCE_OPENAPI_ROUTE, 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 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 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, serializeOpenDocsProviders, toDocsSitemapMarkdownUrl };
|
package/dist/server.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A as resolveDocsAnalyticsConfig, D as emitDocsAgentTraceEvent, E as createDocsAgentTraceId, M as createDocsCloudAnalytics, O as emitDocsAnalyticsEvent, T as createDocsAgentTraceContext, a as createMcpSearchAdapter, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, f as resolveSearchRequestConfig, i as createCustomSearchAdapter, j as resolveDocsObservabilityConfig, k as emitDocsObservabilityEvent, l as inferDocsAskAIPackageHints, n as buildDocsSearchDocuments, o as createSimpleSearchAdapter, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, u as performDocsSearch, w as DOCS_AGENT_TRACE_EVENT_TYPES } from "./search-BL7o2rXk.mjs";
|
|
2
2
|
import { a as buildDocsSitemapManifest, c as renderDocsSitemapMarkdown, d as resolveDocsSitemapPageLastmod, f as resolveDocsSitemapRequest, i as DEFAULT_SITEMAP_XML_ROUTE, l as renderDocsSitemapXml, n as DEFAULT_SITEMAP_MD_ROUTE, o as createDocsSitemapResponse, p as toDocsSitemapMarkdownUrl, r as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, s as readDocsSitemapManifestFromContentMap, t as DEFAULT_SITEMAP_MANIFEST_PATH, u as resolveDocsSitemapConfig } from "./sitemap-CnqcTdQg.mjs";
|
|
3
|
-
import { _ as
|
|
3
|
+
import { _ as isApiReferenceOpenApiRequest, a as resolvePromptProviderChoices, b as resolveApiReferenceRenderer, c as serializeDocsIconRegistry, d as buildApiReferenceHtmlDocument, f as buildApiReferenceHtmlDocumentAsync, g as buildApiReferenceScalarCss, h as buildApiReferencePageTitle, i as parsePromptStringArray, l as serializeOpenDocsProviders, m as buildApiReferenceOpenApiDocumentAsync, n as DEFAULT_PROMPT_PROVIDER_TEMPLATES, o as sanitizePromptText, p as buildApiReferenceOpenApiDocument, r as normalizePromptProviderName, s as serializeDocsIcon, t as readDocsSitemapManifest, u as DEFAULT_API_REFERENCE_OPENAPI_ROUTE, v as resolveApiReferenceConfig, y as resolveApiReferenceOpenApiDiscovery } from "./sitemap-server-C4TbbCmY.mjs";
|
|
4
4
|
import { createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, normalizeDocsMcpRoute, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
5
5
|
|
|
6
|
-
export { 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, 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, normalizeDocsMcpRoute, normalizePromptProviderName, parsePromptStringArray, performDocsSearch, readDocsSitemapManifest, readDocsSitemapManifestFromContentMap, renderDocsSitemapMarkdown, renderDocsSitemapXml, resolveApiReferenceConfig, resolveApiReferenceRenderer, resolveAskAISearchRequestConfig, resolveDocsAnalyticsConfig, resolveDocsMcpConfig, resolveDocsObservabilityConfig, resolveDocsSitemapConfig, resolveDocsSitemapPageLastmod, resolveDocsSitemapRequest, resolvePromptProviderChoices, resolveSearchRequestConfig, runDocsMcpStdio, sanitizePromptText, serializeDocsIcon, serializeDocsIconRegistry, serializeOpenDocsProviders, toDocsSitemapMarkdownUrl };
|
|
6
|
+
export { DEFAULT_API_REFERENCE_OPENAPI_ROUTE, 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, 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, serializeOpenDocsProviders, toDocsSitemapMarkdownUrl };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./search-BL7o2rXk.mjs";
|
|
2
2
|
import { a as buildDocsSitemapManifest, c as renderDocsSitemapMarkdown, l as renderDocsSitemapXml, u as resolveDocsSitemapConfig } from "./sitemap-CnqcTdQg.mjs";
|
|
3
|
-
import "./sitemap-server-
|
|
3
|
+
import "./sitemap-server-C4TbbCmY.mjs";
|
|
4
4
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
5
5
|
import "./server.mjs";
|
|
6
6
|
import { c as readNavTitle, d as readTopLevelStringProperty, f as resolveDocsConfigPath, i as loadDocsConfigModule, o as readBooleanProperty, p as resolveDocsContentDir, t as extractNestedObjectLiteral, u as readStringProperty } from "./config-UI31_wlO.mjs";
|
|
@@ -20,6 +20,7 @@ const METHOD_NAMES = [
|
|
|
20
20
|
"OPTIONS",
|
|
21
21
|
"HEAD"
|
|
22
22
|
];
|
|
23
|
+
const DEFAULT_API_REFERENCE_OPENAPI_ROUTE = "/api/docs?format=openapi";
|
|
23
24
|
function normalizePathSegment(value) {
|
|
24
25
|
return value.replace(/^\/+|\/+$/g, "");
|
|
25
26
|
}
|
|
@@ -57,6 +58,20 @@ function resolveApiReferenceRenderer(value, framework) {
|
|
|
57
58
|
if (config.renderer) return config.renderer;
|
|
58
59
|
return framework === "next" ? "fumadocs" : "scalar";
|
|
59
60
|
}
|
|
61
|
+
function resolveApiReferenceOpenApiDiscovery(value, options = {}) {
|
|
62
|
+
const config = resolveApiReferenceConfig(value);
|
|
63
|
+
if (!config.enabled) return { enabled: false };
|
|
64
|
+
return {
|
|
65
|
+
enabled: true,
|
|
66
|
+
url: options.route ?? DEFAULT_API_REFERENCE_OPENAPI_ROUTE,
|
|
67
|
+
source: config.specUrl ? "configured" : "generated",
|
|
68
|
+
specUrl: config.specUrl,
|
|
69
|
+
apiReferencePath: `/${config.path}`
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function isApiReferenceOpenApiRequest(url) {
|
|
73
|
+
return url.searchParams.get("format")?.trim() === "openapi";
|
|
74
|
+
}
|
|
60
75
|
function normalizeRemoteSpecUrl(value) {
|
|
61
76
|
const trimmed = value?.trim();
|
|
62
77
|
if (!trimmed) return void 0;
|
|
@@ -997,4 +1012,4 @@ function readDocsSitemapManifest(rootDir, sitemap) {
|
|
|
997
1012
|
}
|
|
998
1013
|
|
|
999
1014
|
//#endregion
|
|
1000
|
-
export {
|
|
1015
|
+
export { isApiReferenceOpenApiRequest as _, resolvePromptProviderChoices as a, resolveApiReferenceRenderer as b, serializeDocsIconRegistry as c, buildApiReferenceHtmlDocument as d, buildApiReferenceHtmlDocumentAsync as f, buildApiReferenceScalarCss as g, buildApiReferencePageTitle as h, parsePromptStringArray as i, serializeOpenDocsProviders as l, buildApiReferenceOpenApiDocumentAsync as m, DEFAULT_PROMPT_PROVIDER_TEMPLATES as n, sanitizePromptText as o, buildApiReferenceOpenApiDocument as p, normalizePromptProviderName as r, serializeDocsIcon as s, readDocsSitemapManifest as t, DEFAULT_API_REFERENCE_OPENAPI_ROUTE as u, resolveApiReferenceConfig as v, resolveApiReferenceOpenApiDiscovery as y };
|