@farming-labs/docs 0.2.38 → 0.2.40
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-BjlgUwmW.mjs → agent-WcXCJ4EN.mjs} +3 -3
- package/dist/{agents-C3O0I2iR.mjs → agents-BjTEkCsY.mjs} +2 -2
- package/dist/cli/index.mjs +11 -11
- package/dist/{codeblocks-CZ4ksbeK.mjs → codeblocks-DTlvGTH4.mjs} +1 -1
- package/dist/{doctor-B5HXAHzl.mjs → doctor-VwhpJct8.mjs} +3 -3
- package/dist/index.mjs +1 -1
- package/dist/{mcp-IzaAkFGS.mjs → mcp-DfJiBC0f.mjs} +2 -2
- package/dist/mcp.mjs +1 -1
- package/dist/{search-CCLIVI86.mjs → search-BuOU4idW.mjs} +128 -34
- package/dist/{search-BaoPusEb.mjs → search-CA3H4Dfv.mjs} +2 -2
- package/dist/server.mjs +2 -2
- package/dist/{sitemap-BzumWs0b.mjs → sitemap-CUtSSoGG.mjs} +2 -2
- package/dist/{sitemap-server--TxO6rGi.mjs → sitemap-server-PLcNxmtk.mjs} +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "./reading-time-CPAy1SWO.mjs";
|
|
2
|
-
import "./search-
|
|
2
|
+
import "./search-BuOU4idW.mjs";
|
|
3
3
|
import "./agent-B6szuz_8.mjs";
|
|
4
4
|
import "./robots-CVoC0w0i.mjs";
|
|
5
|
-
import "./sitemap-server
|
|
5
|
+
import "./sitemap-server-PLcNxmtk.mjs";
|
|
6
6
|
import "./config-De5z-2LK.mjs";
|
|
7
|
-
import { a as readPageTokenBudget, i as printAgentCompactHelp, n as inspectAgentCompactionState, o as scanDocsPageTargets, r as parseAgentCompactArgs, t as compactAgentDocs } from "./codeblocks-
|
|
7
|
+
import { a as readPageTokenBudget, i as printAgentCompactHelp, n as inspectAgentCompactionState, o as scanDocsPageTargets, r as parseAgentCompactArgs, t as compactAgentDocs } from "./codeblocks-DTlvGTH4.mjs";
|
|
8
8
|
|
|
9
9
|
export { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./search-
|
|
1
|
+
import "./search-BuOU4idW.mjs";
|
|
2
2
|
import { $ as renderDocsAgentsDocument, C as DEFAULT_OPENAPI_SCHEMA_ROUTE, a as DEFAULT_AGENT_MD_ROUTE, it as resolveDocsAgentFeedbackConfig, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, o as DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE, t as DEFAULT_AGENTS_MD_ROUTE } from "./agent-B6szuz_8.mjs";
|
|
3
|
-
import { w as resolveApiReferenceConfig } from "./sitemap-server
|
|
3
|
+
import { w as resolveApiReferenceConfig } from "./sitemap-server-PLcNxmtk.mjs";
|
|
4
4
|
import { resolveDocsMcpConfig } from "./mcp.mjs";
|
|
5
5
|
import "./server.mjs";
|
|
6
6
|
import { c as readNavTitle, f as readTopLevelStringProperty, i as loadDocsConfigModule, o as readBooleanProperty, p as resolveDocsConfigPath, t as extractNestedObjectLiteral, u as readStringProperty } from "./config-De5z-2LK.mjs";
|
package/dist/cli/index.mjs
CHANGED
|
@@ -138,10 +138,10 @@ async function main() {
|
|
|
138
138
|
printCloudHelp();
|
|
139
139
|
process.exit(1);
|
|
140
140
|
} else if (parsedCommand.command === "mcp") {
|
|
141
|
-
const { runMcp } = await import("../mcp-
|
|
141
|
+
const { runMcp } = await import("../mcp-DfJiBC0f.mjs");
|
|
142
142
|
await runMcp(mcpOptions);
|
|
143
143
|
} else if (parsedCommand.command === "agent" && subcommand === "compact") {
|
|
144
|
-
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent-
|
|
144
|
+
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent-WcXCJ4EN.mjs");
|
|
145
145
|
const agentCompactOptions = parseAgentCompactArgs(args.slice(2));
|
|
146
146
|
if (agentCompactOptions.help) {
|
|
147
147
|
printAgentCompactHelp();
|
|
@@ -151,11 +151,11 @@ async function main() {
|
|
|
151
151
|
} else if (parsedCommand.command === "agent") {
|
|
152
152
|
console.error(pc.red(`Unknown agent subcommand: ${subcommand ?? "(missing)"}`));
|
|
153
153
|
console.error();
|
|
154
|
-
const { printAgentCompactHelp } = await import("../agent-
|
|
154
|
+
const { printAgentCompactHelp } = await import("../agent-WcXCJ4EN.mjs");
|
|
155
155
|
printAgentCompactHelp();
|
|
156
156
|
process.exit(1);
|
|
157
157
|
} else if (parsedCommand.command === "agents" && subcommand === "generate") {
|
|
158
|
-
const { generateAgents, parseAgentsGenerateArgs, printAgentsGenerateHelp } = await import("../agents-
|
|
158
|
+
const { generateAgents, parseAgentsGenerateArgs, printAgentsGenerateHelp } = await import("../agents-BjTEkCsY.mjs");
|
|
159
159
|
const agentsOptions = parseAgentsGenerateArgs(args.slice(2));
|
|
160
160
|
if (agentsOptions.help) {
|
|
161
161
|
printAgentsGenerateHelp();
|
|
@@ -165,11 +165,11 @@ async function main() {
|
|
|
165
165
|
} else if (parsedCommand.command === "agents") {
|
|
166
166
|
console.error(pc.red(`Unknown agents subcommand: ${subcommand ?? "(missing)"}`));
|
|
167
167
|
console.error();
|
|
168
|
-
const { printAgentsGenerateHelp } = await import("../agents-
|
|
168
|
+
const { printAgentsGenerateHelp } = await import("../agents-BjTEkCsY.mjs");
|
|
169
169
|
printAgentsGenerateHelp();
|
|
170
170
|
process.exit(1);
|
|
171
171
|
} else if (parsedCommand.command === "doctor") {
|
|
172
|
-
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-
|
|
172
|
+
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-VwhpJct8.mjs");
|
|
173
173
|
const doctorOptions = parseDoctorArgs(args.slice(1));
|
|
174
174
|
if (doctorOptions.help) {
|
|
175
175
|
printDoctorHelp();
|
|
@@ -185,7 +185,7 @@ async function main() {
|
|
|
185
185
|
}
|
|
186
186
|
await runReview(reviewOptions);
|
|
187
187
|
} else if ((parsedCommand.command === "codeblocks" || parsedCommand.command === "code-blocks") && subcommand === "validate") {
|
|
188
|
-
const { parseCodeBlocksValidateArgs, printCodeBlocksValidateHelp, runCodeBlocksValidate } = await import("../codeblocks-
|
|
188
|
+
const { parseCodeBlocksValidateArgs, printCodeBlocksValidateHelp, runCodeBlocksValidate } = await import("../codeblocks-DTlvGTH4.mjs");
|
|
189
189
|
const codeBlocksOptions = parseCodeBlocksValidateArgs(args.slice(2));
|
|
190
190
|
if (codeBlocksOptions.help) {
|
|
191
191
|
printCodeBlocksValidateHelp();
|
|
@@ -195,11 +195,11 @@ async function main() {
|
|
|
195
195
|
} else if (parsedCommand.command === "codeblocks" || parsedCommand.command === "code-blocks") {
|
|
196
196
|
console.error(pc.red(`Unknown codeblocks subcommand: ${subcommand ?? "(missing)"}`));
|
|
197
197
|
console.error();
|
|
198
|
-
const { printCodeBlocksValidateHelp } = await import("../codeblocks-
|
|
198
|
+
const { printCodeBlocksValidateHelp } = await import("../codeblocks-DTlvGTH4.mjs");
|
|
199
199
|
printCodeBlocksValidateHelp();
|
|
200
200
|
process.exit(1);
|
|
201
201
|
} else if (parsedCommand.command === "search" && subcommand === "sync") {
|
|
202
|
-
const { syncSearch } = await import("../search-
|
|
202
|
+
const { syncSearch } = await import("../search-CA3H4Dfv.mjs");
|
|
203
203
|
await syncSearch(searchSyncOptions);
|
|
204
204
|
} else if (parsedCommand.command === "search") {
|
|
205
205
|
console.error(pc.red(`Unknown search subcommand: ${subcommand ?? "(missing)"}`));
|
|
@@ -207,7 +207,7 @@ async function main() {
|
|
|
207
207
|
printHelp();
|
|
208
208
|
process.exit(1);
|
|
209
209
|
} else if (parsedCommand.command === "sitemap" && subcommand === "generate") {
|
|
210
|
-
const { generateSitemap, parseSitemapGenerateArgs, printSitemapGenerateHelp } = await import("../sitemap-
|
|
210
|
+
const { generateSitemap, parseSitemapGenerateArgs, printSitemapGenerateHelp } = await import("../sitemap-CUtSSoGG.mjs");
|
|
211
211
|
const sitemapOptions = parseSitemapGenerateArgs(args.slice(2));
|
|
212
212
|
if (sitemapOptions.help) {
|
|
213
213
|
printSitemapGenerateHelp();
|
|
@@ -217,7 +217,7 @@ async function main() {
|
|
|
217
217
|
} else if (parsedCommand.command === "sitemap") {
|
|
218
218
|
console.error(pc.red(`Unknown sitemap subcommand: ${subcommand ?? "(missing)"}`));
|
|
219
219
|
console.error();
|
|
220
|
-
const { printSitemapGenerateHelp } = await import("../sitemap-
|
|
220
|
+
const { printSitemapGenerateHelp } = await import("../sitemap-CUtSSoGG.mjs");
|
|
221
221
|
printSitemapGenerateHelp();
|
|
222
222
|
process.exit(1);
|
|
223
223
|
} else if (parsedCommand.command === "robots" && subcommand === "generate") {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as parseGeneratedAgentDocument, h as hashGeneratedAgentContent, m as GENERATED_AGENT_PROVENANCE_VERSION, v as serializeGeneratedAgentDocument } from "./search-
|
|
1
|
+
import { _ as parseGeneratedAgentDocument, h as hashGeneratedAgentContent, m as GENERATED_AGENT_PROVENANCE_VERSION, v as serializeGeneratedAgentDocument } from "./search-BuOU4idW.mjs";
|
|
2
2
|
import { I as findDocsMarkdownPage, tt as renderDocsMarkdownDocument } from "./agent-B6szuz_8.mjs";
|
|
3
3
|
import "./index.mjs";
|
|
4
4
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import "./reading-time-CPAy1SWO.mjs";
|
|
2
|
-
import "./search-
|
|
2
|
+
import "./search-BuOU4idW.mjs";
|
|
3
3
|
import { Ct as DEFAULT_SITEMAP_XML_ROUTE, P as buildDocsMcpEndpointCandidates, S as DEFAULT_MCP_WELL_KNOWN_ROUTE, St as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, T as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, b as DEFAULT_MCP_PUBLIC_ROUTE, c as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, h as DEFAULT_LLMS_FULL_TXT_ROUTE, i as DEFAULT_AGENT_FEEDBACK_ROUTE, kt as resolveDocsSitemapConfig, l as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, t as DEFAULT_AGENTS_MD_ROUTE, v as DEFAULT_LLMS_TXT_ROUTE, w as DEFAULT_SKILL_MD_ROUTE, xt as DEFAULT_SITEMAP_MD_ROUTE } from "./agent-B6szuz_8.mjs";
|
|
4
4
|
import { a as analyzeDocsRobotsTxt, n as DEFAULT_ROBOTS_TXT_ROUTE, u as resolveDocsRobotsConfig } from "./robots-CVoC0w0i.mjs";
|
|
5
|
-
import "./sitemap-server
|
|
5
|
+
import "./sitemap-server-PLcNxmtk.mjs";
|
|
6
6
|
import { createFilesystemDocsMcpSource, resolveDocsMcpConfig } from "./mcp.mjs";
|
|
7
7
|
import "./server.mjs";
|
|
8
8
|
import { a as loadProjectEnv, c as readNavTitle, f as readTopLevelStringProperty, i as loadDocsConfigModule, m as resolveDocsContentDir, o as readBooleanProperty, p as resolveDocsConfigPath, r as extractTopLevelConfigObject, t as extractNestedObjectLiteral } from "./config-De5z-2LK.mjs";
|
|
9
9
|
import { t as detectFramework } from "./utils-CoHZJ1i4.mjs";
|
|
10
|
-
import { n as inspectAgentCompactionState, o as scanDocsPageTargets, t as compactAgentDocs } from "./codeblocks-
|
|
10
|
+
import { n as inspectAgentCompactionState, o as scanDocsPageTargets, t as compactAgentDocs } from "./codeblocks-DTlvGTH4.mjs";
|
|
11
11
|
import { existsSync, lstatSync, readFileSync, readdirSync } from "node:fs";
|
|
12
12
|
import path from "node:path";
|
|
13
13
|
import { LATEST_PROTOCOL_VERSION } from "@modelcontextprotocol/sdk/types.js";
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as extendTheme, a as resolveReadingTimeOptions, b as defineDocs, c as buildPageTwitter, d as resolveOGImage, f as resolveTitle, g as createTheme, h as resolveDocsPath, i as resolveReadingTimeFromSource, l as renderDocsPageStructuredDataJson, m as resolveDocsLocale, n as resolvePageReadingTime, o as buildDocsPageStructuredData, p as resolveDocsI18n, r as resolveReadingTimeFromContent, s as buildPageOpenGraph, t as estimateReadingTimeMinutes, u as resolveDocsMetadataBaseUrl, v as deepMerge, y as resolveChangelogConfig } from "./reading-time-CPAy1SWO.mjs";
|
|
2
|
-
import { A as resolveDocsTelemetryConfig, C as resolveSidebarFolderIndexBehaviorForPath, D as emitDocsTelemetryProjectEvent, E as emitDocsTelemetryMcpToolEvent, F as emitDocsAnalyticsEvent, I as emitDocsObservabilityEvent, L as getDocsRequestAnalyticsProperties, M as createDocsAgentTraceContext, N as createDocsAgentTraceId, O as getDocsTelemetryFeatures, P as emitDocsAgentTraceEvent, R as resolveDocsAnalyticsConfig, S as resolveSidebarFolderIndexBehavior, T as emitDocsTelemetryEvent, _ 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 DOCS_AGENT_TRACE_EVENT_TYPES, k as inferDocsTelemetryAgentSurface, 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 emitDocsTelemetryAgentSurfaceEvent, x as resolvePageSidebarFolderIndexBehavior, y as stripGeneratedAgentProvenance, z as resolveDocsObservabilityConfig } from "./search-
|
|
2
|
+
import { A as resolveDocsTelemetryConfig, C as resolveSidebarFolderIndexBehaviorForPath, D as emitDocsTelemetryProjectEvent, E as emitDocsTelemetryMcpToolEvent, F as emitDocsAnalyticsEvent, I as emitDocsObservabilityEvent, L as getDocsRequestAnalyticsProperties, M as createDocsAgentTraceContext, N as createDocsAgentTraceId, O as getDocsTelemetryFeatures, P as emitDocsAgentTraceEvent, R as resolveDocsAnalyticsConfig, S as resolveSidebarFolderIndexBehavior, T as emitDocsTelemetryEvent, _ 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 DOCS_AGENT_TRACE_EVENT_TYPES, k as inferDocsTelemetryAgentSurface, 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 emitDocsTelemetryAgentSurfaceEvent, x as resolvePageSidebarFolderIndexBehavior, y as stripGeneratedAgentProvenance, z as resolveDocsObservabilityConfig } from "./search-BuOU4idW.mjs";
|
|
3
3
|
import { $ as renderDocsAgentsDocument, A as buildDocsAgentDiscoverySpec, At as resolveDocsSitemapPageLastmod, B as hasDocsMarkdownSignatureAgent, C as DEFAULT_OPENAPI_SCHEMA_ROUTE, Ct as DEFAULT_SITEMAP_XML_ROUTE, D as DOCS_BOT_LIKE_USER_AGENT_HEADER_PATTERN, Dt as renderDocsSitemapMarkdown, E as DOCS_AI_AGENT_USER_AGENT_HEADER_PATTERN, Et as readDocsSitemapManifestFromContentMap, F as detectDocsMarkdownAgentRequest, G as isDocsLlmsTxtPublicRequest, H as isDocsAgentsRequest, I as findDocsMarkdownPage, J as isDocsSkillRequest, K as isDocsMcpRequest, L as getDocsLlmsTxtMaxCharsIssue, M as buildDocsConfigMap, Mt as toDocsSitemapMarkdownUrl, N as buildDocsDiagnostics, Nt as normalizeDocsRelated, O as DOCS_MARKDOWN_SIGNATURE_AGENT_HEADER, Ot as renderDocsSitemapXml, P as buildDocsMcpEndpointCandidates, Pt as renderDocsRelatedMarkdownLines, Q as parseDocsAgentFeedbackData, R as getDocsMarkdownCanonicalLinkHeader, S as DEFAULT_MCP_WELL_KNOWN_ROUTE, St as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, T as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, Tt as createDocsSitemapResponse, U as isDocsConfigRequest, V as isDocsAgentDiscoveryRequest, W as isDocsDiagnosticsRequest, X as normalizeDocsPathSegment, Y as matchesDocsLlmsTxtSection, Z as normalizeDocsUrlPath, _ as DEFAULT_LLMS_TXT_MAX_CHARS, _t as toDocsMarkdownUrl, a as DEFAULT_AGENT_MD_ROUTE, at as resolveDocsAgentFeedbackRequest, b as DEFAULT_MCP_PUBLIC_ROUTE, bt as DEFAULT_SITEMAP_MD_DOCS_ROUTE, c as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, ct as resolveDocsLlmsTxtFormat, d as DEFAULT_DOCS_CONFIG_FORMAT, dt as resolveDocsMarkdownCanonicalUrl, et as renderDocsLlmsTxt, f as DEFAULT_DOCS_CONFIG_ROUTE, ft as resolveDocsMarkdownRecovery, g as DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE, gt as selectDocsLlmsTxtContent, h as DEFAULT_LLMS_FULL_TXT_ROUTE, ht as resolveDocsSkillFormat, i as DEFAULT_AGENT_FEEDBACK_ROUTE, it as resolveDocsAgentFeedbackConfig, j as buildDocsAgentFeedbackSchema, jt as resolveDocsSitemapRequest, k as DOCS_TRADITIONAL_BOT_USER_AGENT_HEADER_PATTERN, kt as resolveDocsSitemapConfig, l as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, lt as resolveDocsLlmsTxtRequest, m as DEFAULT_DOCS_DIAGNOSTICS_ROUTE, mt as resolveDocsOpenApiDiscoveryConfig, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, nt as renderDocsMarkdownNotFound, o as DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE, ot as resolveDocsAgentMdxContent, p as DEFAULT_DOCS_DIAGNOSTICS_FORMAT, pt as resolveDocsMarkdownRequest, q as isDocsPublicGetRequest, r as DEFAULT_AGENT_FEEDBACK_PAYLOAD_SCHEMA, rt as renderDocsSkillDocument, s as DEFAULT_AGENT_SPEC_ROUTE, st as resolveDocsAgentsFormat, t as DEFAULT_AGENTS_MD_ROUTE, tt as renderDocsMarkdownDocument, u as DEFAULT_DOCS_API_ROUTE, ut as resolveDocsLlmsTxtSections, v as DEFAULT_LLMS_TXT_ROUTE, vt as validateDocsAgentFeedbackPayload, w as DEFAULT_SKILL_MD_ROUTE, wt as buildDocsSitemapManifest, x as DEFAULT_MCP_ROUTE, xt as DEFAULT_SITEMAP_MD_ROUTE, y as DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE, yt as DEFAULT_SITEMAP_MANIFEST_PATH, z as getDocsMarkdownVaryHeader } from "./agent-B6szuz_8.mjs";
|
|
4
4
|
import { a as analyzeDocsRobotsTxt, c as renderDocsRobotsGeneratedBlock, d as resolveDocsRobotsRequest, f as upsertDocsRobotsGeneratedBlock, i as DOCS_ROBOTS_GENERATED_BLOCK_START, l as renderDocsRobotsTxt, n as DEFAULT_ROBOTS_TXT_ROUTE, o as createDocsRobotsResponse, r as DOCS_ROBOTS_GENERATED_BLOCK_END, s as getDocsRobotsAllowRoutes, t as DEFAULT_DOCS_AI_ROBOTS_USER_AGENTS, u as resolveDocsRobotsConfig } from "./robots-CVoC0w0i.mjs";
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./search-
|
|
1
|
+
import "./search-BuOU4idW.mjs";
|
|
2
2
|
import "./agent-B6szuz_8.mjs";
|
|
3
|
-
import "./sitemap-server
|
|
3
|
+
import "./sitemap-server-PLcNxmtk.mjs";
|
|
4
4
|
import { createFilesystemDocsMcpSource, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
5
5
|
import "./server.mjs";
|
|
6
6
|
import { c as readNavTitle, m as resolveDocsContentDir, n as extractObjectLiteral, o as readBooleanProperty, p as resolveDocsConfigPath, u as readStringProperty } from "./config-De5z-2LK.mjs";
|
package/dist/mcp.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as emitDocsTelemetryProjectEvent, E as emitDocsTelemetryMcpToolEvent, F as emitDocsAnalyticsEvent, M as createDocsAgentTraceContext, N as createDocsAgentTraceId, P as emitDocsAgentTraceEvent, u as performDocsSearch, w as emitDocsTelemetryAgentSurfaceEvent, x as resolvePageSidebarFolderIndexBehavior, y as stripGeneratedAgentProvenance } from "./search-
|
|
1
|
+
import { D as emitDocsTelemetryProjectEvent, E as emitDocsTelemetryMcpToolEvent, F as emitDocsAnalyticsEvent, M as createDocsAgentTraceContext, N as createDocsAgentTraceId, P as emitDocsAgentTraceEvent, u as performDocsSearch, w as emitDocsTelemetryAgentSurfaceEvent, x as resolvePageSidebarFolderIndexBehavior, y as stripGeneratedAgentProvenance } from "./search-BuOU4idW.mjs";
|
|
2
2
|
import { Nt as normalizeDocsRelated, Pt as renderDocsRelatedMarkdownLines } from "./agent-B6szuz_8.mjs";
|
|
3
3
|
import matter from "gray-matter";
|
|
4
4
|
import fs from "node:fs";
|
|
@@ -769,6 +769,25 @@ function normalizeMcpSsePayload(body) {
|
|
|
769
769
|
function normalizeWhitespace(value) {
|
|
770
770
|
return value.replace(/\s+/g, " ").trim();
|
|
771
771
|
}
|
|
772
|
+
function normalizeSearchPhrase(value) {
|
|
773
|
+
return normalizeWhitespace(value.toLowerCase().replace(/[?!.,;:]+$/g, ""));
|
|
774
|
+
}
|
|
775
|
+
function escapeRegExp(value) {
|
|
776
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
777
|
+
}
|
|
778
|
+
function literalMatchPriority(query, value) {
|
|
779
|
+
const q = normalizeSearchPhrase(query);
|
|
780
|
+
const text = normalizeSearchPhrase(value ?? "");
|
|
781
|
+
if (!q || !text) return 0;
|
|
782
|
+
if (text === q) return 2;
|
|
783
|
+
const boundary = "[^\\p{L}\\p{N}]";
|
|
784
|
+
return new RegExp(`(^|${boundary})${escapeRegExp(q)}(?=$|${boundary})`, "u").test(text) ? 1 : 0;
|
|
785
|
+
}
|
|
786
|
+
function isLiteralLookupQuery(query) {
|
|
787
|
+
const q = normalizeSearchPhrase(query);
|
|
788
|
+
const words = tokenizeSearchQuery(q);
|
|
789
|
+
return words.length > 0 && words.length <= 3 && words.join(" ") === q;
|
|
790
|
+
}
|
|
772
791
|
function tokenizeSearchQuery(query) {
|
|
773
792
|
return Array.from(new Set(query.toLowerCase().replace(/[^\p{L}\p{N}@/_:.-]+/gu, " ").split(/\s+/).map((word) => word.replace(/^[^\p{L}\p{N}@]+|[^\p{L}\p{N}]+$/gu, "")).filter((word) => word.length > 1 && !SEARCH_STOP_WORDS.has(word))));
|
|
774
793
|
}
|
|
@@ -779,6 +798,25 @@ function normalizeUrlPathname(value) {
|
|
|
779
798
|
return value.split(/[?#]/)[0]?.replace(/\/+$/, "") || "/";
|
|
780
799
|
}
|
|
781
800
|
}
|
|
801
|
+
function safeDecodeUrlSegment(value) {
|
|
802
|
+
try {
|
|
803
|
+
return decodeURIComponent(value);
|
|
804
|
+
} catch {
|
|
805
|
+
return value;
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
function getUrlSearchSegments(value) {
|
|
809
|
+
let pathname = "";
|
|
810
|
+
try {
|
|
811
|
+
pathname = new URL(value, "https://docs.local").pathname;
|
|
812
|
+
} catch {
|
|
813
|
+
pathname = value.split(/[?#]/)[0] ?? "";
|
|
814
|
+
}
|
|
815
|
+
return Array.from(new Set(pathname.split("/").flatMap((segment) => {
|
|
816
|
+
const decoded = safeDecodeUrlSegment(segment);
|
|
817
|
+
return [decoded, decoded.replace(/[-_]+/g, " ")];
|
|
818
|
+
}).map(normalizeSearchPhrase).filter(Boolean)));
|
|
819
|
+
}
|
|
782
820
|
function resolveAskAIContextUrl(value, baseUrl) {
|
|
783
821
|
if (!baseUrl) return value;
|
|
784
822
|
try {
|
|
@@ -936,6 +974,58 @@ function mergeSearchResults(...groups) {
|
|
|
936
974
|
}
|
|
937
975
|
return results;
|
|
938
976
|
}
|
|
977
|
+
function pageToSearchDocument(page) {
|
|
978
|
+
return {
|
|
979
|
+
id: makeDocumentId(page.url, "page"),
|
|
980
|
+
url: page.url,
|
|
981
|
+
title: page.title,
|
|
982
|
+
content: normalizeWhitespace(page.content),
|
|
983
|
+
description: page.description,
|
|
984
|
+
type: "page",
|
|
985
|
+
locale: page.locale,
|
|
986
|
+
framework: page.framework,
|
|
987
|
+
version: page.version,
|
|
988
|
+
tags: page.tags
|
|
989
|
+
};
|
|
990
|
+
}
|
|
991
|
+
function buildExactPageSearchResults(query, pages) {
|
|
992
|
+
const normalizedQuery = normalizeSearchPhrase(query);
|
|
993
|
+
if (!normalizedQuery) return [];
|
|
994
|
+
const results = [];
|
|
995
|
+
for (const page of pages) {
|
|
996
|
+
const document = pageToSearchDocument(page);
|
|
997
|
+
const title = normalizeSearchPhrase(page.title);
|
|
998
|
+
const urlSegments = getUrlSearchSegments(page.url);
|
|
999
|
+
if (!(title === normalizedQuery || urlSegments.includes(normalizedQuery))) continue;
|
|
1000
|
+
results.push({
|
|
1001
|
+
id: document.id,
|
|
1002
|
+
url: document.url,
|
|
1003
|
+
content: cleanSearchResultText(document.title) ?? document.title,
|
|
1004
|
+
description: cleanSearchResultText(buildSnippet(document, query) ?? document.description),
|
|
1005
|
+
type: "page",
|
|
1006
|
+
score: scoreDocument(query, document) + 2e3
|
|
1007
|
+
});
|
|
1008
|
+
}
|
|
1009
|
+
return results.sort((a, b) => (b.score ?? 0) - (a.score ?? 0) || a.url.localeCompare(b.url));
|
|
1010
|
+
}
|
|
1011
|
+
function hasDistinctResultSection(result) {
|
|
1012
|
+
if (result.type === "page") return false;
|
|
1013
|
+
const section = normalizeSearchPhrase(stripHtml(result.section ?? ""));
|
|
1014
|
+
if (!section) return true;
|
|
1015
|
+
return section !== normalizeSearchPhrase(normalizeSearchPhrase(stripHtml(result.content)).split(/\s+[—–]\s+/)[0] ?? "");
|
|
1016
|
+
}
|
|
1017
|
+
function insideLiteralResultPriority(query, result) {
|
|
1018
|
+
if (!hasDistinctResultSection(result) || !isLiteralLookupQuery(query)) return 0;
|
|
1019
|
+
return Math.max(literalMatchPriority(query, stripHtml(result.section ?? "")), literalMatchPriority(query, stripHtml(result.description ?? "")));
|
|
1020
|
+
}
|
|
1021
|
+
function prioritizeLiteralInsideResults(query, results) {
|
|
1022
|
+
if (!isLiteralLookupQuery(query)) return results;
|
|
1023
|
+
return [...results].sort((a, b) => {
|
|
1024
|
+
const literalDelta = insideLiteralResultPriority(query, b) - insideLiteralResultPriority(query, a);
|
|
1025
|
+
if (literalDelta) return literalDelta;
|
|
1026
|
+
return 0;
|
|
1027
|
+
});
|
|
1028
|
+
}
|
|
939
1029
|
function shouldSupplementAskAIWithSimpleSearch(search) {
|
|
940
1030
|
return search.enabled && search.provider !== "simple";
|
|
941
1031
|
}
|
|
@@ -1012,18 +1102,7 @@ function splitPageIntoSections(page) {
|
|
|
1012
1102
|
function buildDocsSearchDocuments(pages, chunking = {}) {
|
|
1013
1103
|
const strategy = chunking.strategy ?? "section";
|
|
1014
1104
|
return pages.flatMap((page) => {
|
|
1015
|
-
const base =
|
|
1016
|
-
id: makeDocumentId(page.url, "page"),
|
|
1017
|
-
url: page.url,
|
|
1018
|
-
title: page.title,
|
|
1019
|
-
content: normalizeWhitespace(page.content),
|
|
1020
|
-
description: page.description,
|
|
1021
|
-
type: "page",
|
|
1022
|
-
locale: page.locale,
|
|
1023
|
-
framework: page.framework,
|
|
1024
|
-
version: page.version,
|
|
1025
|
-
tags: page.tags
|
|
1026
|
-
};
|
|
1105
|
+
const base = pageToSearchDocument(page);
|
|
1027
1106
|
if (strategy === "page") return [base];
|
|
1028
1107
|
const sections = splitPageIntoSections(page);
|
|
1029
1108
|
if (sections.length === 0) return [base];
|
|
@@ -1031,23 +1110,34 @@ function buildDocsSearchDocuments(pages, chunking = {}) {
|
|
|
1031
1110
|
});
|
|
1032
1111
|
}
|
|
1033
1112
|
function scoreDocument(query, document) {
|
|
1034
|
-
const q =
|
|
1113
|
+
const q = normalizeSearchPhrase(query);
|
|
1035
1114
|
if (!q) return 0;
|
|
1036
1115
|
const words = tokenizeSearchQuery(q);
|
|
1037
|
-
const title = document.title
|
|
1038
|
-
const section = document.section
|
|
1039
|
-
const
|
|
1040
|
-
const
|
|
1041
|
-
const
|
|
1116
|
+
const title = normalizeSearchPhrase(document.title);
|
|
1117
|
+
const section = document.section ? normalizeSearchPhrase(document.section) : "";
|
|
1118
|
+
const hasDistinctSection = Boolean(section && section !== title);
|
|
1119
|
+
const titleSection = section ? normalizeSearchPhrase(`${document.title} ${document.section}`) : "";
|
|
1120
|
+
const description = document.description ? normalizeSearchPhrase(document.description) : "";
|
|
1121
|
+
const content = normalizeSearchPhrase(document.content);
|
|
1122
|
+
const url = normalizeSearchPhrase(document.url);
|
|
1123
|
+
const urlSegments = getUrlSearchSegments(document.url);
|
|
1042
1124
|
const titleTokens = tokenizeSearchQuery(title);
|
|
1043
1125
|
const sectionTokens = tokenizeSearchQuery(section);
|
|
1044
1126
|
let score = 0;
|
|
1045
|
-
|
|
1127
|
+
const insideLiteralPriority = document.type !== "page" && hasDistinctSection && isLiteralLookupQuery(q) ? Math.max(literalMatchPriority(q, section), literalMatchPriority(q, description), literalMatchPriority(q, content)) : 0;
|
|
1128
|
+
if (insideLiteralPriority > 0) score += insideLiteralPriority * 2250;
|
|
1129
|
+
if (title === q) score += 1120;
|
|
1046
1130
|
else if (title.startsWith(q)) score += 70;
|
|
1047
1131
|
else if (title.includes(q)) score += 45;
|
|
1048
|
-
if (
|
|
1049
|
-
|
|
1050
|
-
|
|
1132
|
+
if (hasDistinctSection) {
|
|
1133
|
+
if (section === q) score += 1080;
|
|
1134
|
+
else if (section.startsWith(q)) score += 55;
|
|
1135
|
+
else if (section.includes(q)) score += 30;
|
|
1136
|
+
if (titleSection === q) score += 1e3;
|
|
1137
|
+
else if (titleSection.startsWith(q)) score += 50;
|
|
1138
|
+
else if (titleSection.includes(q)) score += 28;
|
|
1139
|
+
}
|
|
1140
|
+
if (urlSegments.includes(q)) score += 950;
|
|
1051
1141
|
if (url.includes(q)) score += 12;
|
|
1052
1142
|
if (description.includes(q)) score += 18;
|
|
1053
1143
|
if (content.includes(q)) score += 12;
|
|
@@ -1064,15 +1154,17 @@ function scoreDocument(query, document) {
|
|
|
1064
1154
|
score += 12;
|
|
1065
1155
|
matched = true;
|
|
1066
1156
|
}
|
|
1067
|
-
if (
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1157
|
+
if (hasDistinctSection) {
|
|
1158
|
+
if (section === word) {
|
|
1159
|
+
score += 22;
|
|
1160
|
+
matched = true;
|
|
1161
|
+
} else if (section.startsWith(word)) {
|
|
1162
|
+
score += 16;
|
|
1163
|
+
matched = true;
|
|
1164
|
+
} else if (section.includes(word)) {
|
|
1165
|
+
score += 10;
|
|
1166
|
+
matched = true;
|
|
1167
|
+
}
|
|
1076
1168
|
}
|
|
1077
1169
|
if (description.includes(word)) {
|
|
1078
1170
|
score += 6;
|
|
@@ -1085,11 +1177,11 @@ function scoreDocument(query, document) {
|
|
|
1085
1177
|
if (matched) matchedWords += 1;
|
|
1086
1178
|
}
|
|
1087
1179
|
if (words.length > 1) {
|
|
1088
|
-
if (sectionTokens.length > 0 && words.every((word) => sectionTokens.includes(word))) score += 30;
|
|
1180
|
+
if (hasDistinctSection && sectionTokens.length > 0 && words.every((word) => sectionTokens.includes(word))) score += 30;
|
|
1089
1181
|
if (document.type === "page" && titleTokens.length > 0 && words.every((word) => titleTokens.includes(word))) score += 24;
|
|
1090
1182
|
}
|
|
1091
1183
|
if (matchedWords === words.length && words.length > 1) score += 20;
|
|
1092
|
-
if (document.type === "heading") score += 6;
|
|
1184
|
+
if (document.type === "heading" && hasDistinctSection) score += 6;
|
|
1093
1185
|
return score;
|
|
1094
1186
|
}
|
|
1095
1187
|
function buildSnippet(document, query) {
|
|
@@ -1613,7 +1705,9 @@ async function performDocsSearch(options) {
|
|
|
1613
1705
|
try {
|
|
1614
1706
|
const adapter = await resolveSearchAdapter(search, context);
|
|
1615
1707
|
await maybeSyncSearchIndex(adapter, search, context);
|
|
1616
|
-
|
|
1708
|
+
const results = await adapter.search(query, context);
|
|
1709
|
+
if (search.provider === "simple") return results;
|
|
1710
|
+
return prioritizeLiteralInsideResults(options.query, mergeSearchResults(buildExactPageSearchResults(options.query, options.pages), results)).slice(0, query.limit ?? search.maxResults ?? DEFAULT_SEARCH_LIMIT);
|
|
1617
1711
|
} catch {
|
|
1618
1712
|
return createSimpleSearchAdapter().search(query, context);
|
|
1619
1713
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as buildDocsSearchDocuments, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter } from "./search-
|
|
1
|
+
import { n as buildDocsSearchDocuments, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter } from "./search-BuOU4idW.mjs";
|
|
2
2
|
import "./agent-B6szuz_8.mjs";
|
|
3
|
-
import "./sitemap-server
|
|
3
|
+
import "./sitemap-server-PLcNxmtk.mjs";
|
|
4
4
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
5
5
|
import "./server.mjs";
|
|
6
6
|
import { a as loadProjectEnv, f as readTopLevelStringProperty, m as resolveDocsContentDir, p as resolveDocsConfigPath } from "./config-De5z-2LK.mjs";
|
package/dist/server.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { F as emitDocsAnalyticsEvent, I as emitDocsObservabilityEvent, L as getDocsRequestAnalyticsProperties, M as createDocsAgentTraceContext, N as createDocsAgentTraceId, P as emitDocsAgentTraceEvent, R as resolveDocsAnalyticsConfig, a as createMcpSearchAdapter, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, f as resolveSearchRequestConfig, i as createCustomSearchAdapter, j as DOCS_AGENT_TRACE_EVENT_TYPES, l as inferDocsAskAIPackageHints, n as buildDocsSearchDocuments, o as createSimpleSearchAdapter, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, u as performDocsSearch, z as resolveDocsObservabilityConfig } from "./search-
|
|
1
|
+
import { F as emitDocsAnalyticsEvent, I as emitDocsObservabilityEvent, L as getDocsRequestAnalyticsProperties, M as createDocsAgentTraceContext, N as createDocsAgentTraceId, P as emitDocsAgentTraceEvent, R as resolveDocsAnalyticsConfig, a as createMcpSearchAdapter, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, f as resolveSearchRequestConfig, i as createCustomSearchAdapter, j as DOCS_AGENT_TRACE_EVENT_TYPES, l as inferDocsAskAIPackageHints, n as buildDocsSearchDocuments, o as createSimpleSearchAdapter, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, u as performDocsSearch, z as resolveDocsObservabilityConfig } from "./search-BuOU4idW.mjs";
|
|
2
2
|
import { At as resolveDocsSitemapPageLastmod, Ct as DEFAULT_SITEMAP_XML_ROUTE, Dt as renderDocsSitemapMarkdown, Et as readDocsSitemapManifestFromContentMap, Mt as toDocsSitemapMarkdownUrl, Ot as renderDocsSitemapXml, St as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, Tt as createDocsSitemapResponse, bt as DEFAULT_SITEMAP_MD_DOCS_ROUTE, jt as resolveDocsSitemapRequest, kt as resolveDocsSitemapConfig, wt as buildDocsSitemapManifest, xt as DEFAULT_SITEMAP_MD_ROUTE, yt as DEFAULT_SITEMAP_MANIFEST_PATH } from "./agent-B6szuz_8.mjs";
|
|
3
|
-
import { C as isApiReferenceOpenApiRequest, D as remarkCodeGroup, E as resolveApiReferenceRenderer, S as buildApiReferenceScalarCss, T as resolveApiReferenceOpenApiDiscovery, _ as buildApiReferenceHtmlDocument, a as DEFAULT_PROMPT_PROVIDER_TEMPLATES, b as buildApiReferenceOpenApiDocumentAsync, c as resolvePromptProviderChoices, d as serializeDocsIconRegistry, f as serializeOpenDocsProvider, g as DEFAULT_API_REFERENCE_OPENAPI_ROUTE, h as isDocsCloudAskAIProvider, i as DEFAULT_OPEN_DOCS_TARGET, l as sanitizePromptText, m as createDocsCloudAskAIResponse, n as DEFAULT_OPEN_DOCS_PROMPT, o as normalizePromptProviderName, p as serializeOpenDocsProviders, r as DEFAULT_OPEN_DOCS_PROVIDER_IDS, s as parsePromptStringArray, t as readDocsSitemapManifest, u as serializeDocsIcon, v as buildApiReferenceHtmlDocumentAsync, w as resolveApiReferenceConfig, x as buildApiReferencePageTitle, y as buildApiReferenceOpenApiDocument } from "./sitemap-server
|
|
3
|
+
import { C as isApiReferenceOpenApiRequest, D as remarkCodeGroup, E as resolveApiReferenceRenderer, S as buildApiReferenceScalarCss, T as resolveApiReferenceOpenApiDiscovery, _ as buildApiReferenceHtmlDocument, a as DEFAULT_PROMPT_PROVIDER_TEMPLATES, b as buildApiReferenceOpenApiDocumentAsync, c as resolvePromptProviderChoices, d as serializeDocsIconRegistry, f as serializeOpenDocsProvider, g as DEFAULT_API_REFERENCE_OPENAPI_ROUTE, h as isDocsCloudAskAIProvider, i as DEFAULT_OPEN_DOCS_TARGET, l as sanitizePromptText, m as createDocsCloudAskAIResponse, n as DEFAULT_OPEN_DOCS_PROMPT, o as normalizePromptProviderName, p as serializeOpenDocsProviders, r as DEFAULT_OPEN_DOCS_PROVIDER_IDS, s as parsePromptStringArray, t as readDocsSitemapManifest, u as serializeDocsIcon, v as buildApiReferenceHtmlDocumentAsync, w as resolveApiReferenceConfig, x as buildApiReferencePageTitle, y as buildApiReferenceOpenApiDocument } from "./sitemap-server-PLcNxmtk.mjs";
|
|
4
4
|
import { a as ensureDocsReviewWorkflow, i as buildDocsReviewWorkflowPathFilters, n as DEFAULT_DOCS_REVIEW_WORKFLOW_PATH, o as readDocsReviewConfigFromSource, r as buildDocsReviewWorkflow, s as resolveDocsReviewConfig, t as DEFAULT_DOCS_REVIEW_SCORE_THRESHOLD } from "./review-CJD85JTm.mjs";
|
|
5
5
|
import { createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, normalizeDocsMcpRoute, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./search-
|
|
1
|
+
import "./search-BuOU4idW.mjs";
|
|
2
2
|
import { Dt as renderDocsSitemapMarkdown, Ot as renderDocsSitemapXml, kt as resolveDocsSitemapConfig, wt as buildDocsSitemapManifest } from "./agent-B6szuz_8.mjs";
|
|
3
|
-
import "./sitemap-server
|
|
3
|
+
import "./sitemap-server-PLcNxmtk.mjs";
|
|
4
4
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
5
5
|
import "./server.mjs";
|
|
6
6
|
import { c as readNavTitle, f as readTopLevelStringProperty, i as loadDocsConfigModule, m as resolveDocsContentDir, o as readBooleanProperty, p as resolveDocsConfigPath, t as extractNestedObjectLiteral, u as readStringProperty } from "./config-De5z-2LK.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as emitDocsAnalyticsEvent } from "./search-
|
|
1
|
+
import { F as emitDocsAnalyticsEvent } from "./search-BuOU4idW.mjs";
|
|
2
2
|
import { kt as resolveDocsSitemapConfig } from "./agent-B6szuz_8.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|