@farming-labs/docs 0.1.98 → 0.1.100
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-CrDjOj_r.mjs → agent-2qREGB9R.mjs} +2 -2
- package/dist/cli/index.mjs +11 -11
- package/dist/{dev-BYcuiPDT.mjs → dev-HW5Op4My.mjs} +1 -1
- package/dist/{doctor-DoAc0pk1.mjs → doctor-Dhs6DEbs.mjs} +3 -3
- package/dist/index.d.mts +37 -3
- package/dist/index.mjs +2 -2
- package/dist/{init-CrEmoE77.mjs → init-BXZa9OiZ.mjs} +1 -1
- package/dist/{mcp-B81O1ge_.mjs → mcp-D0LCSSaq.mjs} +1 -1
- package/dist/mcp.d.mts +1 -1
- package/dist/{robots-kWkyLc7r.mjs → robots-C3KeCl0S.mjs} +54 -4
- package/dist/{robots-BaXaw9yz.mjs → robots-b9bMJ-w5.mjs} +1 -1
- package/dist/{search-CB4HlcPm.d.mts → search-DfcI-2-D.d.mts} +1 -1
- package/dist/{search-DQoE9Ptd.mjs → search-jAlynFl1.mjs} +1 -1
- package/dist/server.d.mts +15 -3
- 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/dist/{templates-WRMxbthG.mjs → templates-Bq8X1qEd.mjs} +24 -4
- package/dist/{types-DlNKVpdX.d.mts → types-CAxzjKQR.d.mts} +4 -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 { J as renderDocsMarkdownDocument, N as findDocsMarkdownPage } from "./robots-C3KeCl0S.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
|
@@ -77,16 +77,16 @@ async function main() {
|
|
|
77
77
|
searchApiKey: typeof flags["search-api-key"] === "string" ? flags["search-api-key"] : void 0
|
|
78
78
|
};
|
|
79
79
|
if (!parsedCommand.command || parsedCommand.command === "init") {
|
|
80
|
-
const { init } = await import("../init-
|
|
80
|
+
const { init } = await import("../init-BXZa9OiZ.mjs");
|
|
81
81
|
await init(initOptions);
|
|
82
82
|
} else if (parsedCommand.command === "dev") {
|
|
83
|
-
const { dev } = await import("../dev-
|
|
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-2qREGB9R.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-2qREGB9R.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-Dhs6DEbs.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-b9bMJ-w5.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-b9bMJ-w5.mjs");
|
|
144
144
|
printRobotsGenerateHelp();
|
|
145
145
|
process.exit(1);
|
|
146
146
|
} else if (parsedCommand.command === "upgrade") {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { K as rootLayoutTemplate, W as postcssConfigTemplate, g as docsLayoutTemplate, v as globalCssTemplate, yt as tsconfigTemplate } from "./templates-
|
|
1
|
+
import { K as rootLayoutTemplate, W as postcssConfigTemplate, g as docsLayoutTemplate, v as globalCssTemplate, yt as tsconfigTemplate } from "./templates-Bq8X1qEd.mjs";
|
|
2
2
|
import { i as detectPackageManagerFromLockfile } from "./utils-AmYxHDoz.mjs";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
@@ -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, 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-C3KeCl0S.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-2qREGB9R.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";
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as DocsSearchResultType, A as DocsConfig, At as SidebarTree, B as DocsObservabilityEventInput, C as DocsAskAIActionData, Ct as ResolvedDocsRelatedLink, D as DocsAskAIFeedbackMessage, Dt as SidebarFolderNode, E as DocsAskAIFeedbackData, Et as SidebarFolderIndexBehavior, F as DocsMcpToolsConfig, Ft as UIConfig, G as DocsSearchAdapterContext, H as DocsRobotsConfig, I as DocsMetadata, J as DocsSearchConfig, K as DocsSearchAdapterFactory, L as DocsNav, M as DocsFeedbackValue, Mt as ThemeToggleConfig, N as DocsI18nConfig, Nt as TypesenseDocsSearchConfig, O as DocsAskAIFeedbackValue, Ot as SidebarNode, P as DocsMcpConfig, Pt as TypographyConfig, Q as DocsSearchResult, R as DocsObservabilityConfig, S as DocsAnalyticsSource, St as ReadingTimeConfig, T as DocsAskAIFeedbackConfig, Tt as SidebarConfig, U as DocsRobotsRule, V as DocsRelatedItem, W as DocsSearchAdapter, X as DocsSearchEmbeddingsConfig, Y as DocsSearchDocument, Z as DocsSearchQuery, _ as DocsAnalyticsConfig, _t as PageActionsConfig, a as ApiReferenceRenderer, at as GithubConfig, b as DocsAnalyticsEventType, bt as PageSidebarFrontmatter, 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 OrderingItem, h as DocsAgentTraceEventType, ht as OpenGraphImage, i as ApiReferenceConfig, it as FontStyle, j as DocsFeedbackData, jt as SimpleDocsSearchConfig, k as DocsAskAIMcpConfig, kt as SidebarPageNode, 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 PageFrontmatter, w as DocsAskAIActionType, wt as SidebarComponentProps, x as DocsAnalyticsInput, xt as PageTwitter, y as DocsAnalyticsEventInput, yt as PageOpenGraph, z as DocsObservabilityEvent } from "./types-
|
|
2
|
-
import { A as toDocsSitemapMarkdownUrl, B as resolveDocsAnalyticsConfig, C as createDocsSitemapResponse, D as resolveDocsSitemapConfig, E as renderDocsSitemapXml, F as createDocsAgentTraceContext, H as DocsCloudAnalyticsOptions, I as createDocsAgentTraceId, L as emitDocsAgentTraceEvent, M as DocsAgentTraceContext, N as ResolvedDocsAnalyticsConfig, O as resolveDocsSitemapPageLastmod, P as ResolvedDocsObservabilityConfig, R as emitDocsAnalyticsEvent, S as buildDocsSitemapManifest, T as renderDocsSitemapMarkdown, U as createDocsCloudAnalytics, V as resolveDocsObservabilityConfig, _ as DocsSitemapFormat, a as createMcpSearchAdapter, b as DocsSitemapPageInput, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, f as resolveSearchRequestConfig, g as DEFAULT_SITEMAP_XML_ROUTE, h as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, i as createCustomSearchAdapter, j as DOCS_AGENT_TRACE_EVENT_TYPES, k as resolveDocsSitemapRequest, l as inferDocsAskAIPackageHints, m as DEFAULT_SITEMAP_MD_ROUTE, n as buildDocsSearchDocuments, o as createSimpleSearchAdapter, p as DEFAULT_SITEMAP_MANIFEST_PATH, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, u as performDocsSearch, v as DocsSitemapManifest, w as readDocsSitemapManifestFromContentMap, x as DocsSitemapResolvedConfig, y as DocsSitemapManifestPage, z as emitDocsObservabilityEvent } from "./search-
|
|
1
|
+
import { $ as DocsSearchResultType, A as DocsConfig, At as SidebarTree, B as DocsObservabilityEventInput, C as DocsAskAIActionData, Ct as ResolvedDocsRelatedLink, D as DocsAskAIFeedbackMessage, Dt as SidebarFolderNode, E as DocsAskAIFeedbackData, Et as SidebarFolderIndexBehavior, F as DocsMcpToolsConfig, Ft as UIConfig, G as DocsSearchAdapterContext, H as DocsRobotsConfig, I as DocsMetadata, J as DocsSearchConfig, K as DocsSearchAdapterFactory, L as DocsNav, M as DocsFeedbackValue, Mt as ThemeToggleConfig, N as DocsI18nConfig, Nt as TypesenseDocsSearchConfig, O as DocsAskAIFeedbackValue, Ot as SidebarNode, P as DocsMcpConfig, Pt as TypographyConfig, Q as DocsSearchResult, R as DocsObservabilityConfig, S as DocsAnalyticsSource, St as ReadingTimeConfig, T as DocsAskAIFeedbackConfig, Tt as SidebarConfig, U as DocsRobotsRule, V as DocsRelatedItem, W as DocsSearchAdapter, X as DocsSearchEmbeddingsConfig, Y as DocsSearchDocument, Z as DocsSearchQuery, _ as DocsAnalyticsConfig, _t as PageActionsConfig, a as ApiReferenceRenderer, at as GithubConfig, b as DocsAnalyticsEventType, bt as PageSidebarFrontmatter, 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 OrderingItem, h as DocsAgentTraceEventType, ht as OpenGraphImage, i as ApiReferenceConfig, it as FontStyle, j as DocsFeedbackData, jt as SimpleDocsSearchConfig, k as DocsAskAIMcpConfig, kt as SidebarPageNode, 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 PageFrontmatter, w as DocsAskAIActionType, wt as SidebarComponentProps, x as DocsAnalyticsInput, xt as PageTwitter, y as DocsAnalyticsEventInput, yt as PageOpenGraph, z as DocsObservabilityEvent } from "./types-CAxzjKQR.mjs";
|
|
2
|
+
import { A as toDocsSitemapMarkdownUrl, B as resolveDocsAnalyticsConfig, C as createDocsSitemapResponse, D as resolveDocsSitemapConfig, E as renderDocsSitemapXml, F as createDocsAgentTraceContext, H as DocsCloudAnalyticsOptions, I as createDocsAgentTraceId, L as emitDocsAgentTraceEvent, M as DocsAgentTraceContext, N as ResolvedDocsAnalyticsConfig, O as resolveDocsSitemapPageLastmod, P as ResolvedDocsObservabilityConfig, R as emitDocsAnalyticsEvent, S as buildDocsSitemapManifest, T as renderDocsSitemapMarkdown, U as createDocsCloudAnalytics, V as resolveDocsObservabilityConfig, _ as DocsSitemapFormat, a as createMcpSearchAdapter, b as DocsSitemapPageInput, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, f as resolveSearchRequestConfig, g as DEFAULT_SITEMAP_XML_ROUTE, h as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, i as createCustomSearchAdapter, j as DOCS_AGENT_TRACE_EVENT_TYPES, k as resolveDocsSitemapRequest, l as inferDocsAskAIPackageHints, m as DEFAULT_SITEMAP_MD_ROUTE, n as buildDocsSearchDocuments, o as createSimpleSearchAdapter, p as DEFAULT_SITEMAP_MANIFEST_PATH, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, u as performDocsSearch, v as DocsSitemapManifest, w as readDocsSitemapManifestFromContentMap, x as DocsSitemapResolvedConfig, y as DocsSitemapManifestPage, z as emitDocsObservabilityEvent } from "./search-DfcI-2-D.mjs";
|
|
3
3
|
import { DocsMcpPage, DocsMcpResolvedConfig } from "./mcp.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/define-docs.d.ts
|
|
@@ -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";
|
|
@@ -240,6 +241,21 @@ interface DocsLlmsDiscoveryConfig {
|
|
|
240
241
|
siteDescription?: string;
|
|
241
242
|
maxChars?: LlmsTxtMaxCharsConfig;
|
|
242
243
|
sections?: LlmsTxtSectionConfig[];
|
|
244
|
+
openapi?: boolean | DocsOpenApiDiscoveryConfig;
|
|
245
|
+
}
|
|
246
|
+
interface DocsOpenApiDiscoveryConfig {
|
|
247
|
+
enabled?: boolean;
|
|
248
|
+
url?: string;
|
|
249
|
+
source?: "generated" | "configured";
|
|
250
|
+
specUrl?: string;
|
|
251
|
+
apiReferencePath?: string;
|
|
252
|
+
}
|
|
253
|
+
interface DocsOpenApiResolvedDiscoveryConfig {
|
|
254
|
+
enabled: boolean;
|
|
255
|
+
url?: string;
|
|
256
|
+
source?: "generated" | "configured";
|
|
257
|
+
specUrl?: string;
|
|
258
|
+
apiReferencePath?: string;
|
|
243
259
|
}
|
|
244
260
|
interface DocsLlmsTxtResolvedMaxChars {
|
|
245
261
|
mode: LlmsTxtMaxCharsMode;
|
|
@@ -295,6 +311,7 @@ interface DocsAgentDiscoverySpecOptions {
|
|
|
295
311
|
llms?: DocsLlmsDiscoveryConfig;
|
|
296
312
|
sitemap?: boolean | DocsSitemapConfig;
|
|
297
313
|
robots?: boolean | DocsRobotsConfig;
|
|
314
|
+
openapi?: boolean | DocsOpenApiDiscoveryConfig;
|
|
298
315
|
markdown?: {
|
|
299
316
|
acceptHeader?: boolean;
|
|
300
317
|
signatureAgentHeader?: boolean;
|
|
@@ -309,6 +326,7 @@ interface DocsSkillDocumentOptions {
|
|
|
309
326
|
llms?: DocsLlmsDiscoveryConfig;
|
|
310
327
|
sitemap?: boolean | DocsSitemapConfig;
|
|
311
328
|
robots?: boolean | DocsRobotsConfig;
|
|
329
|
+
openapi?: boolean | DocsOpenApiDiscoveryConfig;
|
|
312
330
|
markdown?: {
|
|
313
331
|
acceptHeader?: boolean;
|
|
314
332
|
signatureAgentHeader?: boolean;
|
|
@@ -379,6 +397,7 @@ declare function isDocsPublicGetRequest(entry: string, url: URL, request: Reques
|
|
|
379
397
|
llms?: boolean | DocsLlmsDiscoveryConfig | LlmsTxtConfig;
|
|
380
398
|
robots?: boolean | DocsRobotsConfig;
|
|
381
399
|
}): boolean;
|
|
400
|
+
declare function isDocsLlmsTxtPublicRequest(url: URL, llms?: boolean | DocsLlmsDiscoveryConfig | LlmsTxtConfig): boolean;
|
|
382
401
|
declare function resolveDocsLlmsTxtFormat(url: URL): "llms" | "llms-full" | null;
|
|
383
402
|
declare function resolveDocsMarkdownRequest(entry: string, url: URL, request: Request): {
|
|
384
403
|
requestedPath: string;
|
|
@@ -402,6 +421,7 @@ declare function renderDocsSkillDocument({
|
|
|
402
421
|
llms,
|
|
403
422
|
sitemap,
|
|
404
423
|
robots,
|
|
424
|
+
openapi,
|
|
405
425
|
markdown
|
|
406
426
|
}: DocsSkillDocumentOptions): string;
|
|
407
427
|
declare function resolveDocsAgentMdxContent(content: string, audience: "human" | "agent"): string;
|
|
@@ -415,6 +435,7 @@ declare function buildDocsAgentDiscoverySpec({
|
|
|
415
435
|
llms,
|
|
416
436
|
sitemap,
|
|
417
437
|
robots,
|
|
438
|
+
openapi,
|
|
418
439
|
markdown
|
|
419
440
|
}: DocsAgentDiscoverySpecOptions): {
|
|
420
441
|
version: string;
|
|
@@ -444,6 +465,8 @@ declare function buildDocsAgentDiscoverySpec({
|
|
|
444
465
|
sitemap: boolean;
|
|
445
466
|
robots: boolean;
|
|
446
467
|
structuredData: boolean;
|
|
468
|
+
apiReference: boolean;
|
|
469
|
+
openapi: boolean;
|
|
447
470
|
agentFeedback: boolean;
|
|
448
471
|
locales: boolean;
|
|
449
472
|
};
|
|
@@ -455,6 +478,7 @@ declare function buildDocsAgentDiscoverySpec({
|
|
|
455
478
|
agentSpecWellKnown: string;
|
|
456
479
|
agentSpecWellKnownJson: string;
|
|
457
480
|
agentSpecQuery: string;
|
|
481
|
+
openapi: string;
|
|
458
482
|
};
|
|
459
483
|
markdown: {
|
|
460
484
|
enabled: boolean;
|
|
@@ -513,6 +537,14 @@ declare function buildDocsAgentDiscoverySpec({
|
|
|
513
537
|
canonicalUrlField: string;
|
|
514
538
|
breadcrumbType: string;
|
|
515
539
|
};
|
|
540
|
+
openapi: {
|
|
541
|
+
enabled: boolean;
|
|
542
|
+
url: string | null;
|
|
543
|
+
source: "generated" | "configured" | null;
|
|
544
|
+
specUrl: string | null;
|
|
545
|
+
apiReferencePath: string | null;
|
|
546
|
+
format: string;
|
|
547
|
+
};
|
|
516
548
|
search: {
|
|
517
549
|
enabled: boolean;
|
|
518
550
|
endpoint: string;
|
|
@@ -561,10 +593,12 @@ declare function buildDocsAgentDiscoverySpec({
|
|
|
561
593
|
instructions: {
|
|
562
594
|
preferMarkdownRoutes: boolean;
|
|
563
595
|
useMcpWhenAvailable: boolean;
|
|
596
|
+
useOpenApiWhenAvailable: boolean;
|
|
564
597
|
readFeedbackSchemaBeforeSubmitting: boolean;
|
|
565
598
|
doNotAssumeFeedbackPayloadShape: boolean;
|
|
566
599
|
};
|
|
567
600
|
};
|
|
601
|
+
declare function resolveDocsOpenApiDiscoveryConfig(openapi?: boolean | DocsOpenApiDiscoveryConfig): DocsOpenApiResolvedDiscoveryConfig;
|
|
568
602
|
//#endregion
|
|
569
603
|
//#region src/robots.d.ts
|
|
570
604
|
declare const DEFAULT_ROBOTS_TXT_ROUTE = "/robots.txt";
|
|
@@ -609,4 +643,4 @@ declare function renderDocsRobotsGeneratedBlock(options?: DocsRobotsRenderOption
|
|
|
609
643
|
declare function upsertDocsRobotsGeneratedBlock(existing: string, block: string): string;
|
|
610
644
|
declare function analyzeDocsRobotsTxt(content: string, options?: DocsRobotsRenderOptions): DocsRobotsAnalysis;
|
|
611
645
|
//#endregion
|
|
612
|
-
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, 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 };
|
|
646
|
+
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 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, 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 resolveDocsAgentMdxContent, A as DOCS_MARKDOWN_SIGNATURE_AGENT_HEADER, B as isDocsMcpRequest, C as DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE, D as DEFAULT_OPENAPI_SCHEMA_ROUTE, E as DEFAULT_MCP_WELL_KNOWN_ROUTE, F as getDocsMarkdownCanonicalLinkHeader, G as normalizeDocsUrlPath, H as isDocsSkillRequest, I as getDocsMarkdownVaryHeader, J as renderDocsMarkdownDocument, K as parseDocsAgentFeedbackData, L as hasDocsMarkdownSignatureAgent, M as buildDocsAgentFeedbackSchema, N as findDocsMarkdownPage, O as DEFAULT_SKILL_MD_ROUTE, P as getDocsLlmsTxtMaxCharsIssue, Q as resolveDocsAgentFeedbackRequest, R as isDocsAgentDiscoveryRequest, S as DEFAULT_LLMS_TXT_ROUTE, T as DEFAULT_MCP_ROUTE, U as matchesDocsLlmsTxtSection, V as isDocsPublicGetRequest, W as normalizeDocsPathSegment, X as renderDocsSkillDocument, Y as renderDocsMarkdownNotFound, Z as resolveDocsAgentFeedbackConfig, _ as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, a as analyzeDocsRobotsTxt, at as resolveDocsOpenApiDiscoveryConfig, b as DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE, c as renderDocsRobotsGeneratedBlock, ct as toDocsMarkdownUrl, d as resolveDocsRobotsRequest, et as resolveDocsLlmsTxtFormat, 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 resolveDocsMarkdownRequest, j as buildDocsAgentDiscoverySpec, k as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, l as renderDocsRobotsTxt, lt as validateDocsAgentFeedbackPayload, m as DEFAULT_AGENT_FEEDBACK_ROUTE, n as DEFAULT_ROBOTS_TXT_ROUTE, nt as resolveDocsLlmsTxtSections, o as createDocsRobotsResponse, ot as resolveDocsSkillFormat, p as DEFAULT_AGENT_FEEDBACK_PAYLOAD_SCHEMA, q as renderDocsLlmsTxt, r as DOCS_ROBOTS_GENERATED_BLOCK_END, rt as resolveDocsMarkdownCanonicalUrl, s as getDocsRobotsAllowRoutes, st as selectDocsLlmsTxtContent, t as DEFAULT_DOCS_AI_ROBOTS_USER_AGENTS, tt as resolveDocsLlmsTxtRequest, u as resolveDocsRobotsConfig, 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 isDocsLlmsTxtPublicRequest } from "./robots-C3KeCl0S.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, 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, 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,4 +1,4 @@
|
|
|
1
|
-
import { $ as svelteDocsPublicHookTemplate, A as nextConfigMergedTemplate, B as nuxtServerApiDocsRouteTemplate, C as injectRootProviderIntoLayout, D as injectTanstackVitePlugins, E as injectTanstackRootProviderIntoRoute, F as nuxtDocsConfigTemplate, G as quickstartPageTemplate, H as nuxtServerDocsPublicMiddlewareTemplate, I as nuxtDocsPageTemplate, J as svelteDocsApiRouteTemplate, K as rootLayoutTemplate, L as nuxtGlobalCssTemplate, M as nextLocaleDocPageTemplate, N as nextLocalizedPageTemplate, O as installationPageTemplate, P as nuxtConfigTemplate, Q as svelteDocsPageTemplate, R as nuxtInstallationPageTemplate, S as injectNuxtCssImport, T as injectSvelteDocsPublicHook, U as nuxtWelcomePageTemplate, V as nuxtServerApiReferenceRouteTemplate, W as postcssConfigTemplate, X as svelteDocsLayoutServerTemplate, Y as svelteDocsConfigTemplate, Z as svelteDocsLayoutTemplate, _ as getAstroAdapterPkg, _t as tanstackViteConfigTemplate, a as astroDocsIndexTemplate, at as svelteWelcomePageTemplate, b as injectAstroDocsMiddleware, bt as welcomePageTemplate, c as astroDocsServerTemplate, ct as tanstackDocsCatchAllRouteTemplate, d as astroQuickstartPageTemplate, dt as tanstackDocsIndexRouteTemplate, et as svelteDocsServerTemplate, f as astroWelcomePageTemplate, ft as tanstackDocsPublicRouteTemplate, g as docsLayoutTemplate, gt as tanstackRootRouteTemplate, h as docsConfigTemplate, ht as tanstackQuickstartPageTemplate, i as astroDocsConfigTemplate, it as svelteRootLayoutTemplate, j as nextConfigTemplate, k as nextApiReferencePageTemplate, l as astroGlobalCssTemplate, lt as tanstackDocsConfigTemplate, m as customThemeTsTemplate, mt as tanstackInstallationPageTemplate, n as astroApiRouteTemplate, nt as svelteInstallationPageTemplate, o as astroDocsMiddlewareTemplate, ot as tanstackApiDocsRouteTemplate, p as customThemeCssTemplate, pt as tanstackDocsServerTemplate, q as svelteApiReferenceRouteTemplate, r as astroConfigTemplate, rt as svelteQuickstartPageTemplate, s as astroDocsPageTemplate, st as tanstackApiReferenceRouteTemplate, t as astroApiReferenceRouteTemplate, tt as svelteGlobalCssTemplate, u as astroInstallationPageTemplate, ut as tanstackDocsFunctionsTemplate, v as globalCssTemplate, vt as tanstackWelcomePageTemplate, w as injectSvelteCssImport, x as injectCssImport, y as injectAstroCssImport, yt as tsconfigTemplate, z as nuxtQuickstartPageTemplate } from "./templates-
|
|
1
|
+
import { $ as svelteDocsPublicHookTemplate, A as nextConfigMergedTemplate, B as nuxtServerApiDocsRouteTemplate, C as injectRootProviderIntoLayout, D as injectTanstackVitePlugins, E as injectTanstackRootProviderIntoRoute, F as nuxtDocsConfigTemplate, G as quickstartPageTemplate, H as nuxtServerDocsPublicMiddlewareTemplate, I as nuxtDocsPageTemplate, J as svelteDocsApiRouteTemplate, K as rootLayoutTemplate, L as nuxtGlobalCssTemplate, M as nextLocaleDocPageTemplate, N as nextLocalizedPageTemplate, O as installationPageTemplate, P as nuxtConfigTemplate, Q as svelteDocsPageTemplate, R as nuxtInstallationPageTemplate, S as injectNuxtCssImport, T as injectSvelteDocsPublicHook, U as nuxtWelcomePageTemplate, V as nuxtServerApiReferenceRouteTemplate, W as postcssConfigTemplate, X as svelteDocsLayoutServerTemplate, Y as svelteDocsConfigTemplate, Z as svelteDocsLayoutTemplate, _ as getAstroAdapterPkg, _t as tanstackViteConfigTemplate, a as astroDocsIndexTemplate, at as svelteWelcomePageTemplate, b as injectAstroDocsMiddleware, bt as welcomePageTemplate, c as astroDocsServerTemplate, ct as tanstackDocsCatchAllRouteTemplate, d as astroQuickstartPageTemplate, dt as tanstackDocsIndexRouteTemplate, et as svelteDocsServerTemplate, f as astroWelcomePageTemplate, ft as tanstackDocsPublicRouteTemplate, g as docsLayoutTemplate, gt as tanstackRootRouteTemplate, h as docsConfigTemplate, ht as tanstackQuickstartPageTemplate, i as astroDocsConfigTemplate, it as svelteRootLayoutTemplate, j as nextConfigTemplate, k as nextApiReferencePageTemplate, l as astroGlobalCssTemplate, lt as tanstackDocsConfigTemplate, m as customThemeTsTemplate, mt as tanstackInstallationPageTemplate, n as astroApiRouteTemplate, nt as svelteInstallationPageTemplate, o as astroDocsMiddlewareTemplate, ot as tanstackApiDocsRouteTemplate, p as customThemeCssTemplate, pt as tanstackDocsServerTemplate, q as svelteApiReferenceRouteTemplate, r as astroConfigTemplate, rt as svelteQuickstartPageTemplate, s as astroDocsPageTemplate, st as tanstackApiReferenceRouteTemplate, t as astroApiReferenceRouteTemplate, tt as svelteGlobalCssTemplate, u as astroInstallationPageTemplate, ut as tanstackDocsFunctionsTemplate, v as globalCssTemplate, vt as tanstackWelcomePageTemplate, w as injectSvelteCssImport, x as injectCssImport, y as injectAstroCssImport, yt as tsconfigTemplate, z as nuxtQuickstartPageTemplate } from "./templates-Bq8X1qEd.mjs";
|
|
2
2
|
import { a as devInstallCommand, c as installCommand, d as writeFileSafe, i as detectPackageManagerFromLockfile, l as readFileSafe, n as detectGlobalCssFiles, o as exec, r as detectNextAppDir, s as fileExists, t as detectFramework, u as spawnAndWaitFor } from "./utils-AmYxHDoz.mjs";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
@@ -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";
|
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, gt as OrderingItem } from "./types-
|
|
1
|
+
import { J as DocsSearchConfig, P as DocsMcpConfig, R as DocsObservabilityConfig, _ as DocsAnalyticsConfig, et as DocsSearchSourcePage, gt as OrderingItem } from "./types-CAxzjKQR.mjs";
|
|
2
2
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
3
|
|
|
4
4
|
//#region src/mcp.d.ts
|
|
@@ -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";
|
|
@@ -356,6 +357,10 @@ function renderLlmsTxtPageList(pages, baseUrl) {
|
|
|
356
357
|
}
|
|
357
358
|
return content;
|
|
358
359
|
}
|
|
360
|
+
function resolveDocsResourceUrl(baseUrl, url) {
|
|
361
|
+
if (/^[a-z][a-z0-9+.-]*:/i.test(url)) return url;
|
|
362
|
+
return `${baseUrl}${url.startsWith("/") ? url : `/${url}`}`;
|
|
363
|
+
}
|
|
359
364
|
function renderLlmsFullTxtPages(pages, baseUrl) {
|
|
360
365
|
let content = "";
|
|
361
366
|
for (const page of pages) {
|
|
@@ -372,6 +377,7 @@ function renderDocsLlmsTxt(pages, options = {}) {
|
|
|
372
377
|
const baseUrl = options.baseUrl ?? "";
|
|
373
378
|
const maxChars = normalizeLlmsTxtMaxChars(options.maxChars);
|
|
374
379
|
const sections = resolveDocsLlmsTxtSections(options);
|
|
380
|
+
const openapi = resolveDocsOpenApiDiscoveryConfig(options.openapi);
|
|
375
381
|
const matchedPageUrls = /* @__PURE__ */ new Set();
|
|
376
382
|
const generatedSections = sections.map((section) => {
|
|
377
383
|
const sectionPages = pages.filter((page) => matchesDocsLlmsTxtSection(page.url, section));
|
|
@@ -403,6 +409,12 @@ function renderDocsLlmsTxt(pages, options = {}) {
|
|
|
403
409
|
}
|
|
404
410
|
llmsTxt += "\n";
|
|
405
411
|
}
|
|
412
|
+
if (openapi.enabled && openapi.url) {
|
|
413
|
+
llmsTxt += "## API Schemas\n\n";
|
|
414
|
+
llmsTxt += `- [OpenAPI schema](${resolveDocsResourceUrl(baseUrl, openapi.url)}): Machine-readable API schema for tool use and API clients`;
|
|
415
|
+
if (openapi.apiReferencePath) llmsTxt += `; rendered API reference at ${resolveDocsResourceUrl(baseUrl, openapi.apiReferencePath)}`;
|
|
416
|
+
llmsTxt += "\n\n";
|
|
417
|
+
}
|
|
406
418
|
if (rootPages.length > 0 || generatedSections.length === 0) {
|
|
407
419
|
llmsTxt += "## Pages\n\n";
|
|
408
420
|
llmsTxt += renderLlmsTxtPageList(rootPages, baseUrl);
|
|
@@ -471,6 +483,9 @@ function isDocsPublicGetRequest(entry, url, request, options = {}) {
|
|
|
471
483
|
if (pathname === DEFAULT_DOCS_API_ROUTE || pathname === DEFAULT_MCP_ROUTE) return false;
|
|
472
484
|
return isDocsAgentDiscoveryRequest(url) || isDocsSkillRequest(url) || pathname === DEFAULT_AGENT_DISCOVERY_ROBOTS_TXT_ROUTE && isRobotsDiscoveryEnabled(options.robots) || resolveDocsLlmsTxtRequest(url, options.llms) !== null || resolveDocsSitemapRequest(url, options.sitemap) !== null || resolveDocsMarkdownRequest(entry, url, request) !== null;
|
|
473
485
|
}
|
|
486
|
+
function isDocsLlmsTxtPublicRequest(url, llms) {
|
|
487
|
+
return normalizeDocsUrlPath(url.pathname) !== DEFAULT_DOCS_API_ROUTE && resolveDocsLlmsTxtRequest(url, llms) !== null;
|
|
488
|
+
}
|
|
474
489
|
function resolveDocsLlmsTxtFormat(url) {
|
|
475
490
|
return resolveDocsLlmsTxtRequest(url)?.format ?? null;
|
|
476
491
|
}
|
|
@@ -550,7 +565,7 @@ function renderDocsMarkdownDocument(page, options) {
|
|
|
550
565
|
lines.push("", page.agentFallbackRawContent ?? page.rawContent ?? page.content);
|
|
551
566
|
return lines.join("\n");
|
|
552
567
|
}
|
|
553
|
-
function renderDocsSkillDocument({ origin, entry = "docs", search, mcp, feedback, llms, sitemap, robots, markdown }) {
|
|
568
|
+
function renderDocsSkillDocument({ origin, entry = "docs", search, mcp, feedback, llms, sitemap, robots, openapi, markdown }) {
|
|
554
569
|
const normalizedEntry = normalizeDocsPathSegment(entry) || "docs";
|
|
555
570
|
const siteTitle = compactSkillText(llms?.siteTitle ?? "Documentation");
|
|
556
571
|
const siteDescription = llms?.siteDescription ? compactSkillText(llms.siteDescription) : void 0;
|
|
@@ -559,6 +574,7 @@ function renderDocsSkillDocument({ origin, entry = "docs", search, mcp, feedback
|
|
|
559
574
|
const feedbackEnabled = feedback?.enabled ?? false;
|
|
560
575
|
const sitemapConfig = resolveDocsSitemapConfig(sitemap);
|
|
561
576
|
const robotsEnabled = isRobotsDiscoveryEnabled(robots);
|
|
577
|
+
const openapiConfig = resolveDocsOpenApiDiscoveryConfig(openapi);
|
|
562
578
|
const feedbackRoute = feedback?.route ?? DEFAULT_AGENT_FEEDBACK_ROUTE;
|
|
563
579
|
const feedbackSchemaRoute = feedback?.schemaRoute ?? `${feedbackRoute}/schema`;
|
|
564
580
|
const llmsSections = resolveDocsLlmsTxtSections(llms);
|
|
@@ -580,6 +596,7 @@ function renderDocsSkillDocument({ origin, entry = "docs", search, mcp, feedback
|
|
|
580
596
|
if (markdownAcceptHeader) lines.push(`- You can also request ${markdownAcceptHeader} from normal page URLs.`);
|
|
581
597
|
if (markdownSignatureAgentHeader) lines.push(`- Requests with ${markdownSignatureAgentHeader} on normal page URLs receive markdown automatically.`);
|
|
582
598
|
if (searchEnabled) lines.push(`- Search with ${DEFAULT_DOCS_API_ROUTE}?query={query} when you do not know the page.`);
|
|
599
|
+
if (openapiConfig.enabled && openapiConfig.url) lines.push(`- Fetch ${openapiConfig.url} for the machine-readable OpenAPI schema before scraping API reference pages.`);
|
|
583
600
|
if (llmsEnabled) {
|
|
584
601
|
lines.push(`- Use ${DEFAULT_LLMS_TXT_ROUTE} for a compact docs index.`, `- Use ${DEFAULT_LLMS_FULL_TXT_ROUTE} for full markdown context.`);
|
|
585
602
|
for (const section of llmsSections) lines.push(`- Use ${section.route} for the ${section.title} llms.txt section.`);
|
|
@@ -600,6 +617,10 @@ function renderDocsSkillDocument({ origin, entry = "docs", search, mcp, feedback
|
|
|
600
617
|
lines.push(`- ${section.title} llms-full.txt: ${section.fullRoute}`);
|
|
601
618
|
}
|
|
602
619
|
}
|
|
620
|
+
if (openapiConfig.enabled && openapiConfig.url) {
|
|
621
|
+
lines.push(`- OpenAPI schema: ${openapiConfig.url}`);
|
|
622
|
+
if (openapiConfig.apiReferencePath) lines.push(`- API reference: ${openapiConfig.apiReferencePath}`);
|
|
623
|
+
}
|
|
603
624
|
if (sitemapConfig.enabled) {
|
|
604
625
|
if (sitemapConfig.xml.enabled) lines.push(`- Sitemap XML: ${sitemapConfig.xml.route}`);
|
|
605
626
|
if (sitemapConfig.markdown.enabled) lines.push(`- Sitemap Markdown: ${sitemapConfig.markdown.route}`, `- Sitemap well-known alias: ${sitemapConfig.markdown.wellKnownRoute}`);
|
|
@@ -655,7 +676,7 @@ function resolveDocsAgentMdxContent(content, audience) {
|
|
|
655
676
|
}
|
|
656
677
|
return output.join("\n").replace(/\n{3,}/g, "\n\n").trim();
|
|
657
678
|
}
|
|
658
|
-
function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, search, mcp, feedback, llms, sitemap, robots, markdown }) {
|
|
679
|
+
function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, search, mcp, feedback, llms, sitemap, robots, openapi, markdown }) {
|
|
659
680
|
const normalizedEntry = normalizeDocsPathSegment(entry) || "docs";
|
|
660
681
|
const localesEnabled = i18n !== null;
|
|
661
682
|
const searchEnabled = isSearchEnabled(search);
|
|
@@ -665,6 +686,7 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, sear
|
|
|
665
686
|
const llmsSections = resolveDocsLlmsTxtSections(llms);
|
|
666
687
|
const sitemapConfig = resolveDocsSitemapConfig(sitemap, { baseUrl: llms?.baseUrl });
|
|
667
688
|
const robotsEnabled = isRobotsDiscoveryEnabled(robots);
|
|
689
|
+
const openapiConfig = resolveDocsOpenApiDiscoveryConfig(openapi);
|
|
668
690
|
return {
|
|
669
691
|
version: "1",
|
|
670
692
|
name: "@farming-labs/docs",
|
|
@@ -693,6 +715,8 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, sear
|
|
|
693
715
|
sitemap: sitemapConfig.enabled,
|
|
694
716
|
robots: robotsEnabled,
|
|
695
717
|
structuredData: true,
|
|
718
|
+
apiReference: openapiConfig.enabled,
|
|
719
|
+
openapi: openapiConfig.enabled,
|
|
696
720
|
agentFeedback: feedback?.enabled ?? false,
|
|
697
721
|
locales: localesEnabled
|
|
698
722
|
},
|
|
@@ -703,7 +727,8 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, sear
|
|
|
703
727
|
agentSpecFallback: DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE,
|
|
704
728
|
agentSpecWellKnown: DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE,
|
|
705
729
|
agentSpecWellKnownJson: DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE,
|
|
706
|
-
agentSpecQuery: `${DEFAULT_DOCS_API_ROUTE}?agent=spec
|
|
730
|
+
agentSpecQuery: `${DEFAULT_DOCS_API_ROUTE}?agent=spec`,
|
|
731
|
+
openapi: DEFAULT_OPENAPI_SCHEMA_ROUTE
|
|
707
732
|
},
|
|
708
733
|
markdown: {
|
|
709
734
|
enabled: true,
|
|
@@ -772,6 +797,14 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, sear
|
|
|
772
797
|
canonicalUrlField: "url",
|
|
773
798
|
breadcrumbType: "BreadcrumbList"
|
|
774
799
|
},
|
|
800
|
+
openapi: {
|
|
801
|
+
enabled: openapiConfig.enabled,
|
|
802
|
+
url: openapiConfig.url ?? null,
|
|
803
|
+
source: openapiConfig.source ?? null,
|
|
804
|
+
specUrl: openapiConfig.specUrl ?? null,
|
|
805
|
+
apiReferencePath: openapiConfig.apiReferencePath ?? null,
|
|
806
|
+
format: "OpenAPI 3.1"
|
|
807
|
+
},
|
|
775
808
|
search: {
|
|
776
809
|
enabled: searchEnabled,
|
|
777
810
|
endpoint: `${DEFAULT_DOCS_API_ROUTE}?query={query}`,
|
|
@@ -815,6 +848,7 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", i18n = null, sear
|
|
|
815
848
|
instructions: {
|
|
816
849
|
preferMarkdownRoutes: true,
|
|
817
850
|
useMcpWhenAvailable: true,
|
|
851
|
+
useOpenApiWhenAvailable: true,
|
|
818
852
|
readFeedbackSchemaBeforeSubmitting: true,
|
|
819
853
|
doNotAssumeFeedbackPayloadShape: true
|
|
820
854
|
}
|
|
@@ -852,6 +886,22 @@ function isRobotsDiscoveryEnabled(robots) {
|
|
|
852
886
|
if (robots && typeof robots === "object" && robots.enabled === false) return false;
|
|
853
887
|
return true;
|
|
854
888
|
}
|
|
889
|
+
function resolveDocsOpenApiDiscoveryConfig(openapi) {
|
|
890
|
+
if (openapi === false || openapi === void 0) return { enabled: false };
|
|
891
|
+
if (openapi === true) return {
|
|
892
|
+
enabled: true,
|
|
893
|
+
url: DEFAULT_OPENAPI_SCHEMA_ROUTE,
|
|
894
|
+
source: "generated"
|
|
895
|
+
};
|
|
896
|
+
if (openapi.enabled === false) return { enabled: false };
|
|
897
|
+
return {
|
|
898
|
+
enabled: true,
|
|
899
|
+
url: openapi.url ?? DEFAULT_OPENAPI_SCHEMA_ROUTE,
|
|
900
|
+
source: openapi.source ?? "generated",
|
|
901
|
+
specUrl: openapi.specUrl,
|
|
902
|
+
apiReferencePath: openapi.apiReferencePath
|
|
903
|
+
};
|
|
904
|
+
}
|
|
855
905
|
function compactSkillText(value) {
|
|
856
906
|
return value.replace(/\s+/g, " ").trim();
|
|
857
907
|
}
|
|
@@ -1048,4 +1098,4 @@ function analyzeDocsRobotsTxt(content, options = {}) {
|
|
|
1048
1098
|
}
|
|
1049
1099
|
|
|
1050
1100
|
//#endregion
|
|
1051
|
-
export {
|
|
1101
|
+
export { resolveDocsAgentMdxContent as $, DOCS_MARKDOWN_SIGNATURE_AGENT_HEADER as A, isDocsMcpRequest as B, DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE as C, DEFAULT_OPENAPI_SCHEMA_ROUTE as D, DEFAULT_MCP_WELL_KNOWN_ROUTE as E, getDocsMarkdownCanonicalLinkHeader as F, normalizeDocsUrlPath as G, isDocsSkillRequest as H, getDocsMarkdownVaryHeader as I, renderDocsMarkdownDocument as J, parseDocsAgentFeedbackData as K, hasDocsMarkdownSignatureAgent as L, buildDocsAgentFeedbackSchema as M, findDocsMarkdownPage as N, DEFAULT_SKILL_MD_ROUTE as O, getDocsLlmsTxtMaxCharsIssue as P, resolveDocsAgentFeedbackRequest as Q, isDocsAgentDiscoveryRequest as R, DEFAULT_LLMS_TXT_ROUTE as S, DEFAULT_MCP_ROUTE as T, matchesDocsLlmsTxtSection as U, isDocsPublicGetRequest as V, normalizeDocsPathSegment as W, renderDocsSkillDocument as X, renderDocsMarkdownNotFound as Y, resolveDocsAgentFeedbackConfig as Z, DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE as _, analyzeDocsRobotsTxt as a, resolveDocsOpenApiDiscoveryConfig as at, DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE as b, renderDocsRobotsGeneratedBlock as c, toDocsMarkdownUrl as ct, resolveDocsRobotsRequest as d, resolveDocsLlmsTxtFormat 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, resolveDocsMarkdownRequest as it, buildDocsAgentDiscoverySpec as j, DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE as k, renderDocsRobotsTxt as l, validateDocsAgentFeedbackPayload as lt, DEFAULT_AGENT_FEEDBACK_ROUTE as m, DEFAULT_ROBOTS_TXT_ROUTE as n, resolveDocsLlmsTxtSections as nt, createDocsRobotsResponse as o, resolveDocsSkillFormat as ot, DEFAULT_AGENT_FEEDBACK_PAYLOAD_SCHEMA as p, renderDocsLlmsTxt as q, DOCS_ROBOTS_GENERATED_BLOCK_END as r, resolveDocsMarkdownCanonicalUrl as rt, getDocsRobotsAllowRoutes as s, selectDocsLlmsTxtContent as st, DEFAULT_DOCS_AI_ROBOTS_USER_AGENTS as t, resolveDocsLlmsTxtRequest as tt, resolveDocsRobotsConfig as u, 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, isDocsLlmsTxtPublicRequest as z };
|
|
@@ -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-C3KeCl0S.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";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as DocsObservabilityEventInput, Ct as ResolvedDocsRelatedLink, J as DocsSearchConfig, K as DocsSearchAdapterFactory, Nt as TypesenseDocsSearchConfig, Q as DocsSearchResult, R as DocsObservabilityConfig, W as DocsSearchAdapter, Y as DocsSearchDocument, _ as DocsAnalyticsConfig, d as CustomDocsSearchConfig, dt as McpDocsSearchConfig, et as DocsSearchSourcePage, k as DocsAskAIMcpConfig, m as DocsAgentTraceEventInput, 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, Ct as ResolvedDocsRelatedLink, J as DocsSearchConfig, K as DocsSearchAdapterFactory, Nt as TypesenseDocsSearchConfig, Q as DocsSearchResult, R as DocsObservabilityConfig, W as DocsSearchAdapter, Y as DocsSearchDocument, _ as DocsAnalyticsConfig, d as CustomDocsSearchConfig, dt as McpDocsSearchConfig, et as DocsSearchSourcePage, k as DocsAskAIMcpConfig, m as DocsAgentTraceEventInput, q as DocsSearchChunkingConfig, r as AlgoliaDocsSearchConfig, tt as DocsSitemapConfig, v as DocsAnalyticsEvent, y as DocsAnalyticsEventInput, z as DocsObservabilityEvent } from "./types-CAxzjKQR.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/cloud-analytics.d.ts
|
|
4
4
|
interface DocsCloudAnalyticsOptions {
|
|
@@ -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
|
@@ -1,5 +1,5 @@
|
|
|
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, mt as OpenDocsProvider, tt as DocsSitemapConfig, v as DocsAnalyticsEvent, y as DocsAnalyticsEventInput, z as DocsObservabilityEvent } from "./types-
|
|
2
|
-
import { A as toDocsSitemapMarkdownUrl, B as resolveDocsAnalyticsConfig, C as createDocsSitemapResponse, D as resolveDocsSitemapConfig, E as renderDocsSitemapXml, F as createDocsAgentTraceContext, H as DocsCloudAnalyticsOptions, I as createDocsAgentTraceId, L as emitDocsAgentTraceEvent, M as DocsAgentTraceContext, N as ResolvedDocsAnalyticsConfig, O as resolveDocsSitemapPageLastmod, P as ResolvedDocsObservabilityConfig, R as emitDocsAnalyticsEvent, S as buildDocsSitemapManifest, T as renderDocsSitemapMarkdown, U as createDocsCloudAnalytics, V as resolveDocsObservabilityConfig, _ as DocsSitemapFormat, a as createMcpSearchAdapter, b as DocsSitemapPageInput, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, f as resolveSearchRequestConfig, g as DEFAULT_SITEMAP_XML_ROUTE, h as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, i as createCustomSearchAdapter, j as DOCS_AGENT_TRACE_EVENT_TYPES, k as resolveDocsSitemapRequest, l as inferDocsAskAIPackageHints, m as DEFAULT_SITEMAP_MD_ROUTE, n as buildDocsSearchDocuments, o as createSimpleSearchAdapter, p as DEFAULT_SITEMAP_MANIFEST_PATH, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, u as performDocsSearch, v as DocsSitemapManifest, w as readDocsSitemapManifestFromContentMap, x as DocsSitemapResolvedConfig, y as DocsSitemapManifestPage, z as emitDocsObservabilityEvent } from "./search-
|
|
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, mt as OpenDocsProvider, tt as DocsSitemapConfig, v as DocsAnalyticsEvent, y as DocsAnalyticsEventInput, z as DocsObservabilityEvent } from "./types-CAxzjKQR.mjs";
|
|
2
|
+
import { A as toDocsSitemapMarkdownUrl, B as resolveDocsAnalyticsConfig, C as createDocsSitemapResponse, D as resolveDocsSitemapConfig, E as renderDocsSitemapXml, F as createDocsAgentTraceContext, H as DocsCloudAnalyticsOptions, I as createDocsAgentTraceId, L as emitDocsAgentTraceEvent, M as DocsAgentTraceContext, N as ResolvedDocsAnalyticsConfig, O as resolveDocsSitemapPageLastmod, P as ResolvedDocsObservabilityConfig, R as emitDocsAnalyticsEvent, S as buildDocsSitemapManifest, T as renderDocsSitemapMarkdown, U as createDocsCloudAnalytics, V as resolveDocsObservabilityConfig, _ as DocsSitemapFormat, a as createMcpSearchAdapter, b as DocsSitemapPageInput, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, f as resolveSearchRequestConfig, g as DEFAULT_SITEMAP_XML_ROUTE, h as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, i as createCustomSearchAdapter, j as DOCS_AGENT_TRACE_EVENT_TYPES, k as resolveDocsSitemapRequest, l as inferDocsAskAIPackageHints, m as DEFAULT_SITEMAP_MD_ROUTE, n as buildDocsSearchDocuments, o as createSimpleSearchAdapter, p as DEFAULT_SITEMAP_MANIFEST_PATH, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, u as performDocsSearch, v as DocsSitemapManifest, w as readDocsSitemapManifestFromContentMap, x as DocsSitemapResolvedConfig, y as DocsSitemapManifestPage, z as emitDocsObservabilityEvent } from "./search-DfcI-2-D.mjs";
|
|
3
3
|
import { 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
|
|
@@ -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 };
|
|
@@ -1329,7 +1329,7 @@ export { GET, POST } from "${svelteRouteServerImport(filePath, useAlias)}";
|
|
|
1329
1329
|
function svelteDocsPublicHookTemplate(filePath, useAlias) {
|
|
1330
1330
|
const serverImport = svelteRouteServerImport(filePath, useAlias);
|
|
1331
1331
|
return `\
|
|
1332
|
-
import { isDocsMcpRequest, isDocsPublicGetRequest } from "@farming-labs/docs";
|
|
1332
|
+
import { isDocsLlmsTxtPublicRequest, isDocsMcpRequest, isDocsPublicGetRequest } from "@farming-labs/docs";
|
|
1333
1333
|
import type { Handle } from "@sveltejs/kit";
|
|
1334
1334
|
import config from "${svelteRouteConfigImport(filePath, useAlias)}";
|
|
1335
1335
|
import { GET, MCP } from "${serverImport}";
|
|
@@ -1349,6 +1349,11 @@ export const handle: Handle = async ({ event, resolve }) => {
|
|
|
1349
1349
|
});
|
|
1350
1350
|
}
|
|
1351
1351
|
|
|
1352
|
+
if ((method === "GET" || method === "HEAD") && isDocsLlmsTxtPublicRequest(event.url, config.llmsTxt)) {
|
|
1353
|
+
const nativeResponse = await resolve(event);
|
|
1354
|
+
if (nativeResponse.status !== 404) return nativeResponse;
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1352
1357
|
if ((method === "GET" || method === "HEAD") && isDocsPublicGetRequest(docsEntry, event.url, event.request, { sitemap: config.sitemap, llms: config.llmsTxt, robots: config.robots })) {
|
|
1353
1358
|
return GET({ url: event.url, request: event.request });
|
|
1354
1359
|
}
|
|
@@ -1375,7 +1380,7 @@ function injectSvelteDocsPublicHook(content, filePath, useAlias) {
|
|
|
1375
1380
|
break;
|
|
1376
1381
|
}
|
|
1377
1382
|
const imports = [
|
|
1378
|
-
"import { isDocsMcpRequest, isDocsPublicGetRequest } from \"@farming-labs/docs\";",
|
|
1383
|
+
"import { isDocsLlmsTxtPublicRequest, isDocsMcpRequest, isDocsPublicGetRequest } from \"@farming-labs/docs\";",
|
|
1379
1384
|
...next.includes("Handle") ? [] : ["import type { Handle } from \"@sveltejs/kit\";"],
|
|
1380
1385
|
...hasExistingHandle && !next.includes("sequence") ? ["import { sequence } from \"@sveltejs/kit/hooks\";"] : [],
|
|
1381
1386
|
`import docsConfig from "${configImport}";`,
|
|
@@ -1397,6 +1402,11 @@ const docsPublicHandle: Handle = async ({ event, resolve }) => {
|
|
|
1397
1402
|
});
|
|
1398
1403
|
}
|
|
1399
1404
|
|
|
1405
|
+
if ((method === "GET" || method === "HEAD") && isDocsLlmsTxtPublicRequest(event.url, docsConfig.llmsTxt)) {
|
|
1406
|
+
const nativeResponse = await resolve(event);
|
|
1407
|
+
if (nativeResponse.status !== 404) return nativeResponse;
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1400
1410
|
if ((method === "GET" || method === "HEAD") && isDocsPublicGetRequest(docsEntry, event.url, event.request, { sitemap: docsConfig.sitemap, llms: docsConfig.llmsTxt, robots: docsConfig.robots })) {
|
|
1401
1411
|
return docsGET({ url: event.url, request: event.request });
|
|
1402
1412
|
}
|
|
@@ -1793,7 +1803,7 @@ export const POST: APIRoute = async ({ request }) => {
|
|
|
1793
1803
|
function astroDocsMiddlewareTemplate(filePath, useAlias) {
|
|
1794
1804
|
const serverImport = astroRouteServerImport(filePath, useAlias);
|
|
1795
1805
|
return `\
|
|
1796
|
-
import { isDocsMcpRequest, isDocsPublicGetRequest } from "@farming-labs/docs";
|
|
1806
|
+
import { isDocsLlmsTxtPublicRequest, isDocsMcpRequest, isDocsPublicGetRequest } from "@farming-labs/docs";
|
|
1797
1807
|
import type { MiddlewareHandler } from "astro";
|
|
1798
1808
|
import config from "${astroRouteConfigImport(filePath, useAlias)}";
|
|
1799
1809
|
import { GET, MCP } from "${serverImport}";
|
|
@@ -1813,6 +1823,11 @@ export const onRequest: MiddlewareHandler = async (context, next) => {
|
|
|
1813
1823
|
});
|
|
1814
1824
|
}
|
|
1815
1825
|
|
|
1826
|
+
if ((method === "GET" || method === "HEAD") && isDocsLlmsTxtPublicRequest(context.url, config.llmsTxt)) {
|
|
1827
|
+
const nativeResponse = await next();
|
|
1828
|
+
if (nativeResponse.status !== 404) return nativeResponse;
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1816
1831
|
if ((method === "GET" || method === "HEAD") && isDocsPublicGetRequest(docsEntry, context.url, context.request, { sitemap: config.sitemap, llms: config.llmsTxt, robots: config.robots })) {
|
|
1817
1832
|
return GET({ request: context.request });
|
|
1818
1833
|
}
|
|
@@ -1839,7 +1854,7 @@ function injectAstroDocsMiddleware(content, filePath, useAlias) {
|
|
|
1839
1854
|
break;
|
|
1840
1855
|
}
|
|
1841
1856
|
const imports = [
|
|
1842
|
-
"import { isDocsMcpRequest, isDocsPublicGetRequest } from \"@farming-labs/docs\";",
|
|
1857
|
+
"import { isDocsLlmsTxtPublicRequest, isDocsMcpRequest, isDocsPublicGetRequest } from \"@farming-labs/docs\";",
|
|
1843
1858
|
...next.includes("MiddlewareHandler") ? [] : ["import type { MiddlewareHandler } from \"astro\";"],
|
|
1844
1859
|
...hasExistingMiddleware && !next.includes("sequence") ? ["import { sequence } from \"astro:middleware\";"] : [],
|
|
1845
1860
|
`import docsConfig from "${configImport}";`,
|
|
@@ -1861,6 +1876,11 @@ const docsPublicMiddleware: MiddlewareHandler = async (context, next) => {
|
|
|
1861
1876
|
});
|
|
1862
1877
|
}
|
|
1863
1878
|
|
|
1879
|
+
if ((method === "GET" || method === "HEAD") && isDocsLlmsTxtPublicRequest(context.url, docsConfig.llmsTxt)) {
|
|
1880
|
+
const nativeResponse = await next();
|
|
1881
|
+
if (nativeResponse.status !== 404) return nativeResponse;
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1864
1884
|
if ((method === "GET" || method === "HEAD") && isDocsPublicGetRequest(docsEntry, context.url, context.request, { sitemap: docsConfig.sitemap, llms: docsConfig.llmsTxt, robots: docsConfig.robots })) {
|
|
1865
1885
|
return docsGET({ request: context.request });
|
|
1866
1886
|
}
|
|
@@ -734,6 +734,7 @@ interface DocsObservabilityConfig {
|
|
|
734
734
|
*/
|
|
735
735
|
/**
|
|
736
736
|
* Configuration for auto-generated `/llms.txt` and `/llms-full.txt` routes.
|
|
737
|
+
* Native static files at the same public routes take precedence.
|
|
737
738
|
*
|
|
738
739
|
* @see https://llmstxt.org
|
|
739
740
|
*/
|
|
@@ -2313,7 +2314,9 @@ interface DocsConfig {
|
|
|
2313
2314
|
ordering?: "alphabetical" | "numeric" | OrderingItem[];
|
|
2314
2315
|
/**
|
|
2315
2316
|
* Auto-generate `/llms.txt` and `/llms-full.txt` routes for LLM-friendly
|
|
2316
|
-
* documentation.
|
|
2317
|
+
* documentation. Native static files at those routes take precedence, so
|
|
2318
|
+
* `public/llms.txt` or SvelteKit `static/llms.txt` can override the
|
|
2319
|
+
* generated output without extra config.
|
|
2317
2320
|
*
|
|
2318
2321
|
* @example
|
|
2319
2322
|
* ```ts
|