@farming-labs/docs 0.2.17 → 0.2.19
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-BEsFNVCf.mjs → agent-DpKOO7Ho.mjs} +1 -1
- package/dist/cli/index.mjs +3 -3
- package/dist/{doctor-DIy5NFKB.mjs → doctor-kYJcYbcT.mjs} +1 -1
- package/dist/index.d.mts +10 -5
- package/dist/index.mjs +1 -1
- package/dist/mcp.d.mts +1 -1
- package/dist/{reading-time-aLJf0n4H.mjs → reading-time-DzuY0IRX.mjs} +18 -13
- package/dist/{search-Dg-0ceOM.d.mts → search-85XeG3Jw.d.mts} +1 -1
- package/dist/server.d.mts +2 -2
- package/dist/{types-Bmfu9bLl.d.mts → types-_MVT8iXy.d.mts} +20 -0
- package/package.json +1 -1
package/dist/cli/index.mjs
CHANGED
|
@@ -134,7 +134,7 @@ async function main() {
|
|
|
134
134
|
const { runMcp } = await import("../mcp-Dvy_EkRx.mjs");
|
|
135
135
|
await runMcp(mcpOptions);
|
|
136
136
|
} else if (parsedCommand.command === "agent" && subcommand === "compact") {
|
|
137
|
-
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent-
|
|
137
|
+
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent-DpKOO7Ho.mjs");
|
|
138
138
|
const agentCompactOptions = parseAgentCompactArgs(args.slice(2));
|
|
139
139
|
if (agentCompactOptions.help) {
|
|
140
140
|
printAgentCompactHelp();
|
|
@@ -144,7 +144,7 @@ async function main() {
|
|
|
144
144
|
} else if (parsedCommand.command === "agent") {
|
|
145
145
|
console.error(pc.red(`Unknown agent subcommand: ${subcommand ?? "(missing)"}`));
|
|
146
146
|
console.error();
|
|
147
|
-
const { printAgentCompactHelp } = await import("../agent-
|
|
147
|
+
const { printAgentCompactHelp } = await import("../agent-DpKOO7Ho.mjs");
|
|
148
148
|
printAgentCompactHelp();
|
|
149
149
|
process.exit(1);
|
|
150
150
|
} else if (parsedCommand.command === "agents" && subcommand === "generate") {
|
|
@@ -162,7 +162,7 @@ async function main() {
|
|
|
162
162
|
printAgentsGenerateHelp();
|
|
163
163
|
process.exit(1);
|
|
164
164
|
} else if (parsedCommand.command === "doctor") {
|
|
165
|
-
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-
|
|
165
|
+
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-kYJcYbcT.mjs");
|
|
166
166
|
const doctorOptions = parseDoctorArgs(args.slice(1));
|
|
167
167
|
if (doctorOptions.help) {
|
|
168
168
|
printDoctorHelp();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./reading-time-
|
|
1
|
+
import "./reading-time-DzuY0IRX.mjs";
|
|
2
2
|
import { a as DEFAULT_SITEMAP_XML_ROUTE, d as resolveDocsSitemapConfig, i as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, r as DEFAULT_SITEMAP_MD_ROUTE } from "./sitemap-CMNj0Pt3.mjs";
|
|
3
3
|
import { O as buildDocsMcpEndpointCandidates, b as DEFAULT_SKILL_MD_ROUTE, c as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, d as DEFAULT_LLMS_FULL_TXT_ROUTE, g as DEFAULT_MCP_PUBLIC_ROUTE, i as DEFAULT_AGENT_FEEDBACK_ROUTE, l as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, m as DEFAULT_LLMS_TXT_ROUTE, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, t as DEFAULT_AGENTS_MD_ROUTE, v as DEFAULT_MCP_WELL_KNOWN_ROUTE, x as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE } from "./agent-B7T4gauS.mjs";
|
|
4
4
|
import { a as analyzeDocsRobotsTxt, n as DEFAULT_ROBOTS_TXT_ROUTE, u as resolveDocsRobotsConfig } from "./robots-CDdD2o-Q.mjs";
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as DocsObservabilityEvent, $t as SidebarPageNode, A as DocsAskAIMcpConfig, At as LlmsTxtSectionConfig, B as DocsCodeBlocksRunnerProvider, Bt as PageActionsConfig, C as DocsAnalyticsSource, Ct as FeedbackConfig, D as DocsAskAIFeedbackData, Dt as LlmsTxtConfig, E as DocsAskAIFeedbackConfig, Et as LastUpdatedConfig, F as DocsCloudPublishConfig, Ft as OpenDocsProviderConfig, G as DocsFeedbackData, Gt as ReadingTimeConfig, H as DocsCodeBlocksValidationMode, Ht as PageOpenGraph, I as DocsCodeBlocksConfig, It as OpenDocsProviderId, J as DocsMcpConfig, Jt as SidebarComponentProps, K as DocsFeedbackValue, Kt as ReadingTimeFormat, L as DocsCodeBlocksPlannerConfig, Lt as OpenDocsTarget, M as DocsCloudConfig, Mt as OGConfig, N as DocsCloudFeatureConfig, Nt as OpenDocsConfig, O as DocsAskAIFeedbackMessage, Ot as LlmsTxtMaxCharsConfig, P as DocsCloudPreviewConfig, Pt as OpenDocsProvider, Q as DocsObservabilityConfig, Qt as SidebarNode, R as DocsCodeBlocksPlannerProvider, Rt as OpenGraphImage, S as DocsAnalyticsInput, St as DocsTheme, T as DocsAskAIActionType, Tt as GithubConfig, U as DocsCodeBlocksValidationPolicy, Ut as PageSidebarFrontmatter, V as DocsCodeBlocksValidateConfig, Vt as PageFrontmatter, W as DocsConfig, Wt as PageTwitter, X as DocsMetadata, Xt as SidebarFolderIndexBehavior, Y as DocsMcpToolsConfig, Yt as SidebarConfig, Z as DocsNav, Zt as SidebarFolderNode, _ as DocsAgentTraceStatus, _t as DocsSearchQuery, a as ApiReferenceRenderer, an as UIConfig, at as DocsReviewRulesConfig, b as DocsAnalyticsEventInput, bt as DocsSearchSourcePage, c as ChangelogFrontmatter, ct as DocsRobotsConfig, d as CopyMarkdownFormat, dt as DocsSearchAdapterContext, en as SidebarTree, et as DocsObservabilityEventInput, f as CustomDocsSearchConfig, ft as DocsSearchAdapterFactory, g as DocsAgentTraceEventType, gt as DocsSearchEmbeddingsConfig, h as DocsAgentTraceEventInput, ht as DocsSearchDocument, i as ApiReferenceConfig, in as TypographyConfig, it as DocsReviewConfig, j as DocsCloudApiKeyConfig, jt as McpDocsSearchConfig, k as DocsAskAIFeedbackValue, kt as LlmsTxtMaxCharsMode, l as CodeBlockCopyData, lt as DocsRobotsRule, m as DocsAgentFeedbackData, mt as DocsSearchConfig, n as AgentFeedbackConfig, nn as ThemeToggleConfig, nt as DocsReviewCiConfig, o as BreadcrumbConfig, ot as DocsReviewScoreConfig, p as DocsAgentFeedbackContext, pt as DocsSearchChunkingConfig, q as DocsI18nConfig, qt as ResolvedDocsRelatedLink, r as AlgoliaDocsSearchConfig, rn as TypesenseDocsSearchConfig, rt as DocsReviewCiMode, s as ChangelogConfig, st as DocsReviewSeverity, t as AIConfig, tn as SimpleDocsSearchConfig, tt as DocsRelatedItem, u as CopyMarkdownConfig, ut as DocsSearchAdapter, v as DocsAnalyticsConfig, vt as DocsSearchResult, w as DocsAskAIActionData, wt as FontStyle, x as DocsAnalyticsEventType, xt as DocsSitemapConfig, y as DocsAnalyticsEvent, yt as DocsSearchResultType, z as DocsCodeBlocksRunnerConfig, zt as OrderingItem } from "./types-
|
|
2
|
-
import { $ as createDocsAgentTraceId, A as resolveDocsSitemapRequest, C as buildDocsSitemapManifest, D as renderDocsSitemapXml, E as renderDocsSitemapMarkdown, I as PromptAction, J as DOCS_AGENT_TRACE_EVENT_TYPES, L as PromptProviderChoice, O as resolveDocsSitemapConfig, Q as createDocsAgentTraceContext, R as SerializeOpenDocsProviderOptions, S as DocsSitemapResolvedConfig, T as readDocsSitemapManifestFromContentMap, X as ResolvedDocsAnalyticsConfig, Y as DocsAgentTraceContext, Z as ResolvedDocsObservabilityConfig, _ as DEFAULT_SITEMAP_XML_ROUTE, a as createMcpSearchAdapter, at as resolveDocsObservabilityConfig, b as DocsSitemapManifestPage, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, et as emitDocsAgentTraceEvent, f as resolveSearchRequestConfig, g as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, h as DEFAULT_SITEMAP_MD_ROUTE, i as createCustomSearchAdapter, it as resolveDocsAnalyticsConfig, j as toDocsSitemapMarkdownUrl, k as resolveDocsSitemapPageLastmod, l as inferDocsAskAIPackageHints, m as DEFAULT_SITEMAP_MD_DOCS_ROUTE, n as buildDocsSearchDocuments, nt as emitDocsObservabilityEvent, o as createSimpleSearchAdapter, p as DEFAULT_SITEMAP_MANIFEST_PATH, r as createAlgoliaSearchAdapter, rt as getDocsRequestAnalyticsProperties, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, tt as emitDocsAnalyticsEvent, u as performDocsSearch, v as DocsSitemapFormat, w as createDocsSitemapResponse, x as DocsSitemapPageInput, y as DocsSitemapManifest, z as SerializedOpenDocsProvider } from "./search-
|
|
1
|
+
import { $ as DocsObservabilityEvent, $t as SidebarPageNode, A as DocsAskAIMcpConfig, At as LlmsTxtSectionConfig, B as DocsCodeBlocksRunnerProvider, Bt as PageActionsConfig, C as DocsAnalyticsSource, Ct as FeedbackConfig, D as DocsAskAIFeedbackData, Dt as LlmsTxtConfig, E as DocsAskAIFeedbackConfig, Et as LastUpdatedConfig, F as DocsCloudPublishConfig, Ft as OpenDocsProviderConfig, G as DocsFeedbackData, Gt as ReadingTimeConfig, H as DocsCodeBlocksValidationMode, Ht as PageOpenGraph, I as DocsCodeBlocksConfig, It as OpenDocsProviderId, J as DocsMcpConfig, Jt as SidebarComponentProps, K as DocsFeedbackValue, Kt as ReadingTimeFormat, L as DocsCodeBlocksPlannerConfig, Lt as OpenDocsTarget, M as DocsCloudConfig, Mt as OGConfig, N as DocsCloudFeatureConfig, Nt as OpenDocsConfig, O as DocsAskAIFeedbackMessage, Ot as LlmsTxtMaxCharsConfig, P as DocsCloudPreviewConfig, Pt as OpenDocsProvider, Q as DocsObservabilityConfig, Qt as SidebarNode, R as DocsCodeBlocksPlannerProvider, Rt as OpenGraphImage, S as DocsAnalyticsInput, St as DocsTheme, T as DocsAskAIActionType, Tt as GithubConfig, U as DocsCodeBlocksValidationPolicy, Ut as PageSidebarFrontmatter, V as DocsCodeBlocksValidateConfig, Vt as PageFrontmatter, W as DocsConfig, Wt as PageTwitter, X as DocsMetadata, Xt as SidebarFolderIndexBehavior, Y as DocsMcpToolsConfig, Yt as SidebarConfig, Z as DocsNav, Zt as SidebarFolderNode, _ as DocsAgentTraceStatus, _t as DocsSearchQuery, a as ApiReferenceRenderer, an as UIConfig, at as DocsReviewRulesConfig, b as DocsAnalyticsEventInput, bt as DocsSearchSourcePage, c as ChangelogFrontmatter, ct as DocsRobotsConfig, d as CopyMarkdownFormat, dt as DocsSearchAdapterContext, en as SidebarTree, et as DocsObservabilityEventInput, f as CustomDocsSearchConfig, ft as DocsSearchAdapterFactory, g as DocsAgentTraceEventType, gt as DocsSearchEmbeddingsConfig, h as DocsAgentTraceEventInput, ht as DocsSearchDocument, i as ApiReferenceConfig, in as TypographyConfig, it as DocsReviewConfig, j as DocsCloudApiKeyConfig, jt as McpDocsSearchConfig, k as DocsAskAIFeedbackValue, kt as LlmsTxtMaxCharsMode, l as CodeBlockCopyData, lt as DocsRobotsRule, m as DocsAgentFeedbackData, mt as DocsSearchConfig, n as AgentFeedbackConfig, nn as ThemeToggleConfig, nt as DocsReviewCiConfig, o as BreadcrumbConfig, ot as DocsReviewScoreConfig, p as DocsAgentFeedbackContext, pt as DocsSearchChunkingConfig, q as DocsI18nConfig, qt as ResolvedDocsRelatedLink, r as AlgoliaDocsSearchConfig, rn as TypesenseDocsSearchConfig, rt as DocsReviewCiMode, s as ChangelogConfig, st as DocsReviewSeverity, t as AIConfig, tn as SimpleDocsSearchConfig, tt as DocsRelatedItem, u as CopyMarkdownConfig, ut as DocsSearchAdapter, v as DocsAnalyticsConfig, vt as DocsSearchResult, w as DocsAskAIActionData, wt as FontStyle, x as DocsAnalyticsEventType, xt as DocsSitemapConfig, y as DocsAnalyticsEvent, yt as DocsSearchResultType, z as DocsCodeBlocksRunnerConfig, zt as OrderingItem } from "./types-_MVT8iXy.mjs";
|
|
2
|
+
import { $ as createDocsAgentTraceId, A as resolveDocsSitemapRequest, C as buildDocsSitemapManifest, D as renderDocsSitemapXml, E as renderDocsSitemapMarkdown, I as PromptAction, J as DOCS_AGENT_TRACE_EVENT_TYPES, L as PromptProviderChoice, O as resolveDocsSitemapConfig, Q as createDocsAgentTraceContext, R as SerializeOpenDocsProviderOptions, S as DocsSitemapResolvedConfig, T as readDocsSitemapManifestFromContentMap, X as ResolvedDocsAnalyticsConfig, Y as DocsAgentTraceContext, Z as ResolvedDocsObservabilityConfig, _ as DEFAULT_SITEMAP_XML_ROUTE, a as createMcpSearchAdapter, at as resolveDocsObservabilityConfig, b as DocsSitemapManifestPage, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, et as emitDocsAgentTraceEvent, f as resolveSearchRequestConfig, g as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, h as DEFAULT_SITEMAP_MD_ROUTE, i as createCustomSearchAdapter, it as resolveDocsAnalyticsConfig, j as toDocsSitemapMarkdownUrl, k as resolveDocsSitemapPageLastmod, l as inferDocsAskAIPackageHints, m as DEFAULT_SITEMAP_MD_DOCS_ROUTE, n as buildDocsSearchDocuments, nt as emitDocsObservabilityEvent, o as createSimpleSearchAdapter, p as DEFAULT_SITEMAP_MANIFEST_PATH, r as createAlgoliaSearchAdapter, rt as getDocsRequestAnalyticsProperties, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, tt as emitDocsAnalyticsEvent, u as performDocsSearch, v as DocsSitemapFormat, w as createDocsSitemapResponse, x as DocsSitemapPageInput, y as DocsSitemapManifest, z as SerializedOpenDocsProvider } from "./search-85XeG3Jw.mjs";
|
|
3
3
|
import { DocsMcpPage, DocsMcpResolvedConfig } from "./mcp.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/define-docs.d.ts
|
|
@@ -152,15 +152,20 @@ interface ResolvedReadingTimeOptions {
|
|
|
152
152
|
enabled: boolean;
|
|
153
153
|
wordsPerMinute?: number;
|
|
154
154
|
format: ReadingTimeFormat;
|
|
155
|
+
includeCode: boolean;
|
|
155
156
|
}
|
|
156
|
-
|
|
157
|
+
interface ReadingTimeEstimateOptions {
|
|
158
|
+
includeCode?: boolean;
|
|
159
|
+
}
|
|
160
|
+
declare function estimateReadingTimeMinutes(content: string, wordsPerMinute?: number, options?: ReadingTimeEstimateOptions): number;
|
|
157
161
|
declare function resolveReadingTimeOptions(readingTime: boolean | ReadingTimeConfig | null | undefined): ResolvedReadingTimeOptions;
|
|
158
|
-
declare function resolveReadingTimeFromContent(frontmatter: Partial<PageFrontmatter> | undefined, content: string, wordsPerMinute?: number): number | null;
|
|
162
|
+
declare function resolveReadingTimeFromContent(frontmatter: Partial<PageFrontmatter> | undefined, content: string, wordsPerMinute?: number, options?: ReadingTimeEstimateOptions): number | null;
|
|
159
163
|
declare function resolvePageReadingTime(frontmatter: Partial<PageFrontmatter> | undefined, content: string, options?: {
|
|
160
164
|
enabledByDefault?: boolean;
|
|
161
165
|
wordsPerMinute?: number;
|
|
166
|
+
includeCode?: boolean;
|
|
162
167
|
}): number | null | undefined;
|
|
163
|
-
declare function resolveReadingTimeFromSource(source: string, wordsPerMinute?: number): number | null;
|
|
168
|
+
declare function resolveReadingTimeFromSource(source: string, wordsPerMinute?: number, options?: ReadingTimeEstimateOptions): number | null;
|
|
164
169
|
//#endregion
|
|
165
170
|
//#region src/related.d.ts
|
|
166
171
|
declare function normalizeDocsRelated(value: unknown): ResolvedDocsRelatedLink[];
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-DzuY0IRX.mjs";
|
|
2
2
|
import { A as getDocsRequestAnalyticsProperties, C as resolveSidebarFolderIndexBehaviorForPath, D as emitDocsAgentTraceEvent, E as createDocsAgentTraceId, M as resolveDocsObservabilityConfig, 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 resolveDocsAnalyticsConfig, 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-B3JYx2zk.mjs";
|
|
3
3
|
import { n as renderDocsRelatedMarkdownLines, t as normalizeDocsRelated } from "./related-BNj_NdHq.mjs";
|
|
4
4
|
import { a as DEFAULT_SITEMAP_XML_ROUTE, c as readDocsSitemapManifestFromContentMap, d as resolveDocsSitemapConfig, f as resolveDocsSitemapPageLastmod, i as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, l as renderDocsSitemapMarkdown, m as toDocsSitemapMarkdownUrl, n as DEFAULT_SITEMAP_MD_DOCS_ROUTE, o as buildDocsSitemapManifest, p as resolveDocsSitemapRequest, r as DEFAULT_SITEMAP_MD_ROUTE, s as createDocsSitemapResponse, t as DEFAULT_SITEMAP_MANIFEST_PATH, u as renderDocsSitemapXml } from "./sitemap-CMNj0Pt3.mjs";
|
package/dist/mcp.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { J as DocsMcpConfig, Q as DocsObservabilityConfig, bt as DocsSearchSourcePage, mt as DocsSearchConfig, v as DocsAnalyticsConfig, zt as OrderingItem } from "./types-
|
|
1
|
+
import { J as DocsMcpConfig, Q as DocsObservabilityConfig, bt as DocsSearchSourcePage, mt as DocsSearchConfig, v as DocsAnalyticsConfig, zt as OrderingItem } from "./types-_MVT8iXy.mjs";
|
|
2
2
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
3
|
|
|
4
4
|
//#region src/mcp.d.ts
|
|
@@ -389,45 +389,50 @@ function normalizeWordsPerMinute(wordsPerMinute) {
|
|
|
389
389
|
if (typeof wordsPerMinute !== "number" || !Number.isFinite(wordsPerMinute)) return 220;
|
|
390
390
|
return Math.max(1, Math.floor(wordsPerMinute));
|
|
391
391
|
}
|
|
392
|
-
function stripNonReadingContent(content) {
|
|
393
|
-
|
|
392
|
+
function stripNonReadingContent(content, options) {
|
|
393
|
+
const includeCode = options?.includeCode === true;
|
|
394
|
+
return (includeCode ? content.replace(/^(`{3,}|~{3,})[^\n]*$/gm, " ").replace(/`([^`\n]+)`/g, " $1 ") : content.replace(/(`{3,})[^\n]*\n[\s\S]*?\1/g, " ").replace(/(~{3,})[^\n]*\n[\s\S]*?\1/g, " ").replace(/`[^`\n]+`/g, " ")).replace(/!\[[^\]]*\]\([^)]+\)/g, " ").replace(/\[([^\]]+)\]\([^)]+\)/g, " $1 ").replace(/<[^>]+>/g, " ").replace(includeCode ? /[{}]/g : /\{[^{}]*\}/g, " ").replace(/https?:\/\/\S+/g, " ").replace(/[#>*_~|]/g, " ");
|
|
394
395
|
}
|
|
395
|
-
function estimateReadingTimeMinutes(content, wordsPerMinute) {
|
|
396
|
-
const wordCount = stripNonReadingContent(content).match(/\b[\p{L}\p{N}][\p{L}\p{N}'’-]*\b/gu)?.length ?? 0;
|
|
396
|
+
function estimateReadingTimeMinutes(content, wordsPerMinute, options) {
|
|
397
|
+
const wordCount = stripNonReadingContent(content, options).match(/\b[\p{L}\p{N}][\p{L}\p{N}'’-]*\b/gu)?.length ?? 0;
|
|
397
398
|
return Math.max(1, Math.ceil(wordCount / normalizeWordsPerMinute(wordsPerMinute)));
|
|
398
399
|
}
|
|
399
400
|
function resolveReadingTimeOptions(readingTime) {
|
|
400
401
|
if (readingTime === true) return {
|
|
401
402
|
enabled: true,
|
|
402
|
-
format: "long"
|
|
403
|
+
format: "long",
|
|
404
|
+
includeCode: false
|
|
403
405
|
};
|
|
404
406
|
if (readingTime === false || readingTime === void 0 || readingTime === null) return {
|
|
405
407
|
enabled: false,
|
|
406
|
-
format: "long"
|
|
408
|
+
format: "long",
|
|
409
|
+
includeCode: false
|
|
407
410
|
};
|
|
408
411
|
if (typeof readingTime !== "object") return {
|
|
409
412
|
enabled: false,
|
|
410
|
-
format: "long"
|
|
413
|
+
format: "long",
|
|
414
|
+
includeCode: false
|
|
411
415
|
};
|
|
412
416
|
return {
|
|
413
417
|
enabled: readingTime.enabled !== false,
|
|
414
418
|
wordsPerMinute: typeof readingTime.wordsPerMinute === "number" && Number.isFinite(readingTime.wordsPerMinute) ? readingTime.wordsPerMinute : void 0,
|
|
415
|
-
format: readingTime.format === "short" ? "short" : "long"
|
|
419
|
+
format: readingTime.format === "short" ? "short" : "long",
|
|
420
|
+
includeCode: readingTime.includeCode === true
|
|
416
421
|
};
|
|
417
422
|
}
|
|
418
|
-
function resolveReadingTimeFromContent(frontmatter, content, wordsPerMinute) {
|
|
423
|
+
function resolveReadingTimeFromContent(frontmatter, content, wordsPerMinute, options) {
|
|
419
424
|
const pageData = frontmatter ?? {};
|
|
420
425
|
if (pageData.readingTime === false) return null;
|
|
421
426
|
if (typeof pageData.readingTime === "number" && Number.isFinite(pageData.readingTime)) return Math.max(1, Math.ceil(pageData.readingTime));
|
|
422
|
-
return estimateReadingTimeMinutes(content, wordsPerMinute);
|
|
427
|
+
return estimateReadingTimeMinutes(content, wordsPerMinute, options);
|
|
423
428
|
}
|
|
424
429
|
function resolvePageReadingTime(frontmatter, content, options) {
|
|
425
430
|
if (!(options?.enabledByDefault ?? false) && !hasExplicitReadingTime(frontmatter)) return;
|
|
426
|
-
return resolveReadingTimeFromContent(frontmatter, content, options?.wordsPerMinute);
|
|
431
|
+
return resolveReadingTimeFromContent(frontmatter, content, options?.wordsPerMinute, { includeCode: options?.includeCode });
|
|
427
432
|
}
|
|
428
|
-
function resolveReadingTimeFromSource(source, wordsPerMinute) {
|
|
433
|
+
function resolveReadingTimeFromSource(source, wordsPerMinute, options) {
|
|
429
434
|
const { data, content } = matter(source);
|
|
430
|
-
return resolveReadingTimeFromContent(data, content, wordsPerMinute);
|
|
435
|
+
return resolveReadingTimeFromContent(data, content, wordsPerMinute, options);
|
|
431
436
|
}
|
|
432
437
|
|
|
433
438
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as DocsObservabilityEvent, A as DocsAskAIMcpConfig, Lt as OpenDocsTarget, Pt as OpenDocsProvider, Q as DocsObservabilityConfig, b as DocsAnalyticsEventInput, bt as DocsSearchSourcePage, et as DocsObservabilityEventInput, f as CustomDocsSearchConfig, ft as DocsSearchAdapterFactory, h as DocsAgentTraceEventInput, ht as DocsSearchDocument, jt as McpDocsSearchConfig, mt as DocsSearchConfig, pt as DocsSearchChunkingConfig, qt as ResolvedDocsRelatedLink, r as AlgoliaDocsSearchConfig, rn as TypesenseDocsSearchConfig, ut as DocsSearchAdapter, v as DocsAnalyticsConfig, vt as DocsSearchResult, xt as DocsSitemapConfig, y as DocsAnalyticsEvent } from "./types-
|
|
1
|
+
import { $ as DocsObservabilityEvent, A as DocsAskAIMcpConfig, Lt as OpenDocsTarget, Pt as OpenDocsProvider, Q as DocsObservabilityConfig, b as DocsAnalyticsEventInput, bt as DocsSearchSourcePage, et as DocsObservabilityEventInput, f as CustomDocsSearchConfig, ft as DocsSearchAdapterFactory, h as DocsAgentTraceEventInput, ht as DocsSearchDocument, jt as McpDocsSearchConfig, mt as DocsSearchConfig, pt as DocsSearchChunkingConfig, qt as ResolvedDocsRelatedLink, r as AlgoliaDocsSearchConfig, rn as TypesenseDocsSearchConfig, ut as DocsSearchAdapter, v as DocsAnalyticsConfig, vt as DocsSearchResult, xt as DocsSitemapConfig, y as DocsAnalyticsEvent } from "./types-_MVT8iXy.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/analytics.d.ts
|
|
4
4
|
declare const DOCS_AGENT_TRACE_EVENT_TYPES: readonly ["run.start", "run.end", "run.error", "user.input", "prompt.build", "retrieval.query", "retrieval.result", "retrieval.error", "model.call", "model.response", "model.stream", "model.error", "tool.call", "tool.result", "tool.error", "retry", "timeout", "error", "agent.final"];
|
package/dist/server.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as DocsObservabilityEvent, A as DocsAskAIMcpConfig, D as DocsAskAIFeedbackData, E as DocsAskAIFeedbackConfig, O as DocsAskAIFeedbackMessage, Q as DocsObservabilityConfig, W as DocsConfig, _ as DocsAgentTraceStatus, _t as DocsSearchQuery, a as ApiReferenceRenderer, at as DocsReviewRulesConfig, b as DocsAnalyticsEventInput, bt as DocsSearchSourcePage, dt as DocsSearchAdapterContext, et as DocsObservabilityEventInput, ft as DocsSearchAdapterFactory, g as DocsAgentTraceEventType, h as DocsAgentTraceEventInput, ht as DocsSearchDocument, it as DocsReviewConfig, jt as McpDocsSearchConfig, k as DocsAskAIFeedbackValue, mt as DocsSearchConfig, rt as DocsReviewCiMode, ut as DocsSearchAdapter, v as DocsAnalyticsConfig, vt as DocsSearchResult, xt as DocsSitemapConfig, y as DocsAnalyticsEvent } from "./types-
|
|
2
|
-
import { $ as createDocsAgentTraceId, A as resolveDocsSitemapRequest, B as normalizePromptProviderName, C as buildDocsSitemapManifest, D as renderDocsSitemapXml, E as renderDocsSitemapMarkdown, F as DEFAULT_PROMPT_PROVIDER_TEMPLATES, G as serializeDocsIconRegistry, H as resolvePromptProviderChoices, I as PromptAction, J as DOCS_AGENT_TRACE_EVENT_TYPES, K as serializeOpenDocsProvider, L as PromptProviderChoice, M as DEFAULT_OPEN_DOCS_PROMPT, N as DEFAULT_OPEN_DOCS_PROVIDER_IDS, O as resolveDocsSitemapConfig, P as DEFAULT_OPEN_DOCS_TARGET, Q as createDocsAgentTraceContext, R as SerializeOpenDocsProviderOptions, S as DocsSitemapResolvedConfig, T as readDocsSitemapManifestFromContentMap, U as sanitizePromptText, V as parsePromptStringArray, W as serializeDocsIcon, X as ResolvedDocsAnalyticsConfig, Y as DocsAgentTraceContext, Z as ResolvedDocsObservabilityConfig, _ as DEFAULT_SITEMAP_XML_ROUTE, a as createMcpSearchAdapter, at as resolveDocsObservabilityConfig, b as DocsSitemapManifestPage, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, et as emitDocsAgentTraceEvent, f as resolveSearchRequestConfig, g as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, h as DEFAULT_SITEMAP_MD_ROUTE, i as createCustomSearchAdapter, it as resolveDocsAnalyticsConfig, j as toDocsSitemapMarkdownUrl, k as resolveDocsSitemapPageLastmod, l as inferDocsAskAIPackageHints, m as DEFAULT_SITEMAP_MD_DOCS_ROUTE, n as buildDocsSearchDocuments, nt as emitDocsObservabilityEvent, o as createSimpleSearchAdapter, p as DEFAULT_SITEMAP_MANIFEST_PATH, q as serializeOpenDocsProviders, r as createAlgoliaSearchAdapter, rt as getDocsRequestAnalyticsProperties, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, tt as emitDocsAnalyticsEvent, u as performDocsSearch, v as DocsSitemapFormat, w as createDocsSitemapResponse, x as DocsSitemapPageInput, y as DocsSitemapManifest, z as SerializedOpenDocsProvider } from "./search-
|
|
1
|
+
import { $ as DocsObservabilityEvent, A as DocsAskAIMcpConfig, D as DocsAskAIFeedbackData, E as DocsAskAIFeedbackConfig, O as DocsAskAIFeedbackMessage, Q as DocsObservabilityConfig, W as DocsConfig, _ as DocsAgentTraceStatus, _t as DocsSearchQuery, a as ApiReferenceRenderer, at as DocsReviewRulesConfig, b as DocsAnalyticsEventInput, bt as DocsSearchSourcePage, dt as DocsSearchAdapterContext, et as DocsObservabilityEventInput, ft as DocsSearchAdapterFactory, g as DocsAgentTraceEventType, h as DocsAgentTraceEventInput, ht as DocsSearchDocument, it as DocsReviewConfig, jt as McpDocsSearchConfig, k as DocsAskAIFeedbackValue, mt as DocsSearchConfig, rt as DocsReviewCiMode, ut as DocsSearchAdapter, v as DocsAnalyticsConfig, vt as DocsSearchResult, xt as DocsSitemapConfig, y as DocsAnalyticsEvent } from "./types-_MVT8iXy.mjs";
|
|
2
|
+
import { $ as createDocsAgentTraceId, A as resolveDocsSitemapRequest, B as normalizePromptProviderName, C as buildDocsSitemapManifest, D as renderDocsSitemapXml, E as renderDocsSitemapMarkdown, F as DEFAULT_PROMPT_PROVIDER_TEMPLATES, G as serializeDocsIconRegistry, H as resolvePromptProviderChoices, I as PromptAction, J as DOCS_AGENT_TRACE_EVENT_TYPES, K as serializeOpenDocsProvider, L as PromptProviderChoice, M as DEFAULT_OPEN_DOCS_PROMPT, N as DEFAULT_OPEN_DOCS_PROVIDER_IDS, O as resolveDocsSitemapConfig, P as DEFAULT_OPEN_DOCS_TARGET, Q as createDocsAgentTraceContext, R as SerializeOpenDocsProviderOptions, S as DocsSitemapResolvedConfig, T as readDocsSitemapManifestFromContentMap, U as sanitizePromptText, V as parsePromptStringArray, W as serializeDocsIcon, X as ResolvedDocsAnalyticsConfig, Y as DocsAgentTraceContext, Z as ResolvedDocsObservabilityConfig, _ as DEFAULT_SITEMAP_XML_ROUTE, a as createMcpSearchAdapter, at as resolveDocsObservabilityConfig, b as DocsSitemapManifestPage, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, et as emitDocsAgentTraceEvent, f as resolveSearchRequestConfig, g as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, h as DEFAULT_SITEMAP_MD_ROUTE, i as createCustomSearchAdapter, it as resolveDocsAnalyticsConfig, j as toDocsSitemapMarkdownUrl, k as resolveDocsSitemapPageLastmod, l as inferDocsAskAIPackageHints, m as DEFAULT_SITEMAP_MD_DOCS_ROUTE, n as buildDocsSearchDocuments, nt as emitDocsObservabilityEvent, o as createSimpleSearchAdapter, p as DEFAULT_SITEMAP_MANIFEST_PATH, q as serializeOpenDocsProviders, r as createAlgoliaSearchAdapter, rt as getDocsRequestAnalyticsProperties, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, tt as emitDocsAnalyticsEvent, u as performDocsSearch, v as DocsSitemapFormat, w as createDocsSitemapResponse, x as DocsSitemapPageInput, y as DocsSitemapManifest, z as SerializedOpenDocsProvider } from "./search-85XeG3Jw.mjs";
|
|
3
3
|
import { DocsMcpCodeExample, DocsMcpConfigSchema, DocsMcpConfigSchemaOption, DocsMcpDocsList, DocsMcpDocsPageSummary, DocsMcpDocsSection, DocsMcpHttpHandlers, DocsMcpNavigationNode, DocsMcpNavigationTree, DocsMcpPage, DocsMcpResolvedConfig, DocsMcpSource, createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, normalizeDocsMcpRoute, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/code-group-mdx.d.ts
|
|
@@ -640,6 +640,8 @@ interface CopyMarkdownConfig {
|
|
|
640
640
|
enabled?: boolean;
|
|
641
641
|
/** Content format copied by the button. @default "markdown" */
|
|
642
642
|
format?: CopyMarkdownFormat;
|
|
643
|
+
/** Whether to prepend the current page title to copied content. @default false */
|
|
644
|
+
includeTitle?: boolean;
|
|
643
645
|
/** Button label shown before the page is copied. @default "Copy page" */
|
|
644
646
|
label?: string;
|
|
645
647
|
/** Button label shown after a successful copy. @default "Copied!" */
|
|
@@ -1242,6 +1244,11 @@ interface LastUpdatedConfig {
|
|
|
1242
1244
|
* @default true
|
|
1243
1245
|
*/
|
|
1244
1246
|
enabled?: boolean;
|
|
1247
|
+
/**
|
|
1248
|
+
* Label shown before the formatted date.
|
|
1249
|
+
* @default "Last updated"
|
|
1250
|
+
*/
|
|
1251
|
+
label?: string;
|
|
1245
1252
|
/**
|
|
1246
1253
|
* Where to render the "Last updated" date.
|
|
1247
1254
|
*
|
|
@@ -1280,6 +1287,15 @@ interface ReadingTimeConfig {
|
|
|
1280
1287
|
* @default "long"
|
|
1281
1288
|
*/
|
|
1282
1289
|
format?: ReadingTimeFormat;
|
|
1290
|
+
/**
|
|
1291
|
+
* Whether fenced and inline code should count toward the estimate.
|
|
1292
|
+
*
|
|
1293
|
+
* Code is ignored by default so the label reflects human prose. Set this to
|
|
1294
|
+
* `true` when code-heavy guides should include examples in the estimate.
|
|
1295
|
+
*
|
|
1296
|
+
* @default false
|
|
1297
|
+
*/
|
|
1298
|
+
includeCode?: boolean;
|
|
1283
1299
|
}
|
|
1284
1300
|
/**
|
|
1285
1301
|
* GitHub repository configuration for "Edit on GitHub" links
|
|
@@ -1940,6 +1956,10 @@ interface FeedbackConfig {
|
|
|
1940
1956
|
negativeLabel?: string;
|
|
1941
1957
|
/** Label for the submit button. @default "Submit" */
|
|
1942
1958
|
submitLabel?: string;
|
|
1959
|
+
/** Message shown after feedback is submitted successfully. @default "Thanks for the feedback." */
|
|
1960
|
+
successMessage?: string;
|
|
1961
|
+
/** Message shown when feedback submission fails. @default "Could not send feedback. Please try again." */
|
|
1962
|
+
errorMessage?: string;
|
|
1943
1963
|
/**
|
|
1944
1964
|
* Callback fired when the user submits the feedback form.
|
|
1945
1965
|
*
|