@farming-labs/docs 0.2.70 → 0.2.71
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-CXkn2ihX.mjs → agent-FIyl4-Oa.mjs} +509 -10
- package/dist/{agent-MOuft73V.mjs → agent-bof3qzKZ.mjs} +2 -2
- package/dist/{agent-evals-BTh28hl-.mjs → agent-evals-Cr9TAkmB.mjs} +2 -1
- package/dist/{agent-export-43XUqLf5.mjs → agent-export-7Ws4KqDE.mjs} +9 -6
- package/dist/{agents-C16sSxHU.mjs → agents-Be2ntaFr.mjs} +4 -4
- package/dist/cli/index.mjs +14 -14
- package/dist/{doctor-WjSas47Z.mjs → doctor-DoPAofVP.mjs} +9 -9
- package/dist/{golden-evaluations-Cg0braJV.mjs → golden-evaluations-CPGGnXOV.mjs} +1 -1
- package/dist/index.d.mts +80 -3
- package/dist/index.mjs +6 -6
- package/dist/{mcp-BDPfedoh.mjs → mcp-BLynUzE7.mjs} +4 -4
- package/dist/mcp.mjs +2 -2
- package/dist/{metadata-BMBvGASC.mjs → metadata-bw8k-9x-.mjs} +1 -1
- package/dist/{reading-time-D0s9Osqw.mjs → reading-time-DtNegNiq.mjs} +2 -2
- package/dist/{review-_0G2gAtx.mjs → review-NFnYbMRI.mjs} +5 -5
- package/dist/{robots-DLl9Zizg.mjs → robots-B3e-aWPy.mjs} +2 -2
- package/dist/{robots-DOnLGE0l.mjs → robots-DOqBwQw8.mjs} +1 -1
- package/dist/{search-B9tkri5i.mjs → search-DOGUUZvs.mjs} +4 -4
- package/dist/{search-Boqkxa3T.mjs → search-x5O0-9X3.mjs} +2 -142
- package/dist/server.mjs +4 -4
- package/dist/{sitemap-FgXlxHEO.mjs → sitemap-BpMKdDUd.mjs} +4 -4
- package/dist/{sitemap-server-Bynukz-j.mjs → sitemap-server-D_hayOp6.mjs} +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { At as resolveDocsAudienceMdxContent, G as isDocsAgentDiscoveryRequest, Gt as findDocsMarkdownSection, K as isDocsAgentsRequest, Kt as parseDocsMarkdownSections, Q as isDocsSkillRequest, Qt as PAGE_AGENT_CONTRACT_START_MARKER, Yt as PAGE_AGENT_CONTRACT_END_MARKER, _t as resolveDocsMarkdownRequest, dt as resolveDocsAgentsFormat, lt as resolveDocsAgentFeedbackConfig, on as upsertPageAgentContractMarkdown, pt as resolveDocsLlmsTxtRequest, rn as renderPageAgentContractMarkdown, ut as resolveDocsAgentFeedbackRequest, xt as resolveDocsSkillFormat } from "./agent-FIyl4-Oa.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/telemetry.ts
|
|
4
4
|
const DOCS_PACKAGE_NAME = "@farming-labs/docs";
|
|
@@ -457,146 +457,6 @@ function serializeGeneratedAgentDocument(content, provenance) {
|
|
|
457
457
|
].join("\n")}\n`;
|
|
458
458
|
}
|
|
459
459
|
|
|
460
|
-
//#endregion
|
|
461
|
-
//#region src/markdown-sections.ts
|
|
462
|
-
const HTML_ENTITIES = {
|
|
463
|
-
amp: "&",
|
|
464
|
-
apos: "'",
|
|
465
|
-
gt: ">",
|
|
466
|
-
lt: "<",
|
|
467
|
-
nbsp: " ",
|
|
468
|
-
quot: "\""
|
|
469
|
-
};
|
|
470
|
-
/**
|
|
471
|
-
* Reduce inline Markdown in a heading to the visible label used by search and anchors.
|
|
472
|
-
* This intentionally covers the common inline constructs without adding a Markdown parser
|
|
473
|
-
* dependency to the runtime package.
|
|
474
|
-
*/
|
|
475
|
-
function cleanDocsMarkdownHeadingLabel(value) {
|
|
476
|
-
return value.replace(/!\[([^\]]*)\]\([^)]*\)/gu, "$1").replace(/\[([^\]]+)\]\([^)]*\)/gu, "$1").replace(/!\[([^\]]*)\]\[[^\]]*\]/gu, "$1").replace(/\[([^\]]+)\]\[[^\]]*\]/gu, "$1").replace(/<((?:https?:\/\/|mailto:)[^>]+)>/giu, "$1").replace(/<[^>]+>/gu, "").replace(/`+([^`]*?)`+/gu, "$1").replace(/\\([!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~])/gu, "$1").replace(/[*_~]/gu, "").replace(/&(#(?:x[0-9a-f]+|\d+)|[a-z]+);/giu, (_match, entity) => {
|
|
477
|
-
if (entity.startsWith("#x") || entity.startsWith("#X")) {
|
|
478
|
-
const codePoint = Number.parseInt(entity.slice(2), 16);
|
|
479
|
-
return Number.isSafeInteger(codePoint) && codePoint >= 0 && codePoint <= 1114111 ? String.fromCodePoint(codePoint) : _match;
|
|
480
|
-
}
|
|
481
|
-
if (entity.startsWith("#")) {
|
|
482
|
-
const codePoint = Number.parseInt(entity.slice(1), 10);
|
|
483
|
-
return Number.isSafeInteger(codePoint) && codePoint >= 0 && codePoint <= 1114111 ? String.fromCodePoint(codePoint) : _match;
|
|
484
|
-
}
|
|
485
|
-
return HTML_ENTITIES[entity.toLowerCase()] ?? _match;
|
|
486
|
-
}).replace(/\s+/gu, " ").trim();
|
|
487
|
-
}
|
|
488
|
-
/** Keep anchors aligned with the framework's existing ASCII heading-slug behavior. */
|
|
489
|
-
function slugifyDocsMarkdownHeading(value) {
|
|
490
|
-
return cleanDocsMarkdownHeadingLabel(value).toLowerCase().replace(/[`'"‘’“”]/gu, "").replace(/&/gu, " and ").replace(/[^a-z0-9\s-]/gu, "").replace(/\s+/gu, "-").replace(/-+/gu, "-").replace(/^-|-$/gu, "");
|
|
491
|
-
}
|
|
492
|
-
function readOpeningFence(line) {
|
|
493
|
-
const match = line.match(/^ {0,3}(`{3,}|~{3,})/u);
|
|
494
|
-
if (!match) return void 0;
|
|
495
|
-
return {
|
|
496
|
-
marker: match[1][0],
|
|
497
|
-
length: match[1].length
|
|
498
|
-
};
|
|
499
|
-
}
|
|
500
|
-
function isClosingFence(line, fence) {
|
|
501
|
-
const marker = fence.marker === "`" ? "`" : "~";
|
|
502
|
-
const match = line.match(new RegExp(`^ {0,3}(${marker}{${fence.length},})[\\t ]*$`, "u"));
|
|
503
|
-
return Boolean(match);
|
|
504
|
-
}
|
|
505
|
-
function readAtxHeading(line) {
|
|
506
|
-
const match = line.match(/^ {0,3}(#{1,6})(?:[\t ]+|$)(.*)$/u);
|
|
507
|
-
if (!match) return void 0;
|
|
508
|
-
return {
|
|
509
|
-
title: cleanDocsMarkdownHeadingLabel(match[2].replace(/[\t ]+#+[\t ]*$/u, "").trim()),
|
|
510
|
-
level: match[1].length
|
|
511
|
-
};
|
|
512
|
-
}
|
|
513
|
-
function readSetextLevel(line) {
|
|
514
|
-
const match = line.match(/^ {0,3}(=+|-+)[\t ]*$/u);
|
|
515
|
-
if (!match) return void 0;
|
|
516
|
-
return match[1][0] === "=" ? 1 : 2;
|
|
517
|
-
}
|
|
518
|
-
function normalizeDocsSectionSelector(value) {
|
|
519
|
-
let selector = value.trim();
|
|
520
|
-
const hashIndex = selector.lastIndexOf("#");
|
|
521
|
-
if (hashIndex >= 0) selector = selector.slice(hashIndex + 1);
|
|
522
|
-
try {
|
|
523
|
-
selector = decodeURIComponent(selector);
|
|
524
|
-
} catch {}
|
|
525
|
-
return cleanDocsMarkdownHeadingLabel(selector.replace(/^#+/u, "")).toLowerCase();
|
|
526
|
-
}
|
|
527
|
-
/**
|
|
528
|
-
* Parse heading sections once for search, Ask AI hydration, and MCP tools.
|
|
529
|
-
* Supports CommonMark ATX indentation, Setext headings, fenced-code exclusion,
|
|
530
|
-
* visible inline labels, and stable duplicate anchors.
|
|
531
|
-
*/
|
|
532
|
-
function parseDocsMarkdownSections(markdown) {
|
|
533
|
-
const lines = markdown.split("\n");
|
|
534
|
-
const headings = [];
|
|
535
|
-
const headingCounts = /* @__PURE__ */ new Map();
|
|
536
|
-
let openFence;
|
|
537
|
-
let setextCandidate;
|
|
538
|
-
const pushHeading = (title, level, start) => {
|
|
539
|
-
const baseAnchor = slugifyDocsMarkdownHeading(title) || `section-${headings.length}`;
|
|
540
|
-
const seen = headingCounts.get(baseAnchor) ?? 0;
|
|
541
|
-
headingCounts.set(baseAnchor, seen + 1);
|
|
542
|
-
headings.push({
|
|
543
|
-
title,
|
|
544
|
-
anchor: seen === 0 ? baseAnchor : `${baseAnchor}-${seen}`,
|
|
545
|
-
level,
|
|
546
|
-
start
|
|
547
|
-
});
|
|
548
|
-
};
|
|
549
|
-
for (let index = 0; index < lines.length; index += 1) {
|
|
550
|
-
const line = lines[index];
|
|
551
|
-
if (openFence) {
|
|
552
|
-
if (isClosingFence(line, openFence)) openFence = void 0;
|
|
553
|
-
setextCandidate = void 0;
|
|
554
|
-
continue;
|
|
555
|
-
}
|
|
556
|
-
const openingFence = readOpeningFence(line);
|
|
557
|
-
if (openingFence) {
|
|
558
|
-
openFence = openingFence;
|
|
559
|
-
setextCandidate = void 0;
|
|
560
|
-
continue;
|
|
561
|
-
}
|
|
562
|
-
const setextLevel = readSetextLevel(line);
|
|
563
|
-
if (setextLevel && setextCandidate?.index === index - 1) {
|
|
564
|
-
const title = cleanDocsMarkdownHeadingLabel(setextCandidate.value.trim());
|
|
565
|
-
if (title) pushHeading(title, setextLevel, setextCandidate.index);
|
|
566
|
-
setextCandidate = void 0;
|
|
567
|
-
continue;
|
|
568
|
-
}
|
|
569
|
-
const atxHeading = readAtxHeading(line);
|
|
570
|
-
if (atxHeading) {
|
|
571
|
-
pushHeading(atxHeading.title, atxHeading.level, index);
|
|
572
|
-
setextCandidate = void 0;
|
|
573
|
-
continue;
|
|
574
|
-
}
|
|
575
|
-
if (!line.trim() || /^ {4}|^\t/u.test(line)) {
|
|
576
|
-
setextCandidate = void 0;
|
|
577
|
-
continue;
|
|
578
|
-
}
|
|
579
|
-
setextCandidate = {
|
|
580
|
-
index,
|
|
581
|
-
value: line
|
|
582
|
-
};
|
|
583
|
-
}
|
|
584
|
-
return headings.map((heading, index) => {
|
|
585
|
-
const end = headings.slice(index + 1).find((candidate) => candidate.level <= heading.level)?.start ?? lines.length;
|
|
586
|
-
return {
|
|
587
|
-
title: heading.title,
|
|
588
|
-
anchor: heading.anchor,
|
|
589
|
-
level: heading.level,
|
|
590
|
-
content: lines.slice(heading.start, end).join("\n").trim()
|
|
591
|
-
};
|
|
592
|
-
});
|
|
593
|
-
}
|
|
594
|
-
function findDocsMarkdownSection(markdown, requestedSection) {
|
|
595
|
-
const selector = normalizeDocsSectionSelector(requestedSection);
|
|
596
|
-
if (!selector) return void 0;
|
|
597
|
-
return parseDocsMarkdownSections(markdown).find((section) => normalizeDocsSectionSelector(section.title) === selector || section.anchor === selector);
|
|
598
|
-
}
|
|
599
|
-
|
|
600
460
|
//#endregion
|
|
601
461
|
//#region src/search.ts
|
|
602
462
|
const DEFAULT_SEARCH_LIMIT = 10;
|
|
@@ -1823,4 +1683,4 @@ function createCustomSearchAdapter(adapter) {
|
|
|
1823
1683
|
}
|
|
1824
1684
|
|
|
1825
1685
|
//#endregion
|
|
1826
|
-
export {
|
|
1686
|
+
export { inferDocsTelemetryAgentSurface as A, resolveSidebarFolderIndexBehavior as C, emitDocsTelemetryMcpToolEvent as D, emitDocsTelemetryEvent as E, normalizeDocsTelemetryOrigin as M, resolveDocsTelemetryConfig as N, emitDocsTelemetryProjectEvent as O, resolvePageSidebarFolderIndexBehavior as S, emitDocsTelemetryAgentSurfaceEvent as T, normalizeGeneratedAgentContent as _, createMcpSearchAdapter as a, stripGeneratedAgentProvenance as b, formatDocsAskAIPackageHints as c, resolveAskAISearchRequestConfig as d, resolveDocsSearchAudience as f, hashGeneratedAgentContent as g, GENERATED_AGENT_PROVENANCE_VERSION as h, createCustomSearchAdapter as i, isLocalDocsTelemetryOrigin as j, getDocsTelemetryFeatures as k, inferDocsAskAIPackageHints as l, GENERATED_AGENT_PROVENANCE_MARKER as m, buildDocsSearchDocuments as n, createSimpleSearchAdapter as o, resolveSearchRequestConfig as p, createAlgoliaSearchAdapter as r, createTypesenseSearchAdapter as s, buildDocsAskAIContext as t, performDocsSearch as u, parseGeneratedAgentDocument as v, resolveSidebarFolderIndexBehaviorForPath as w, applySidebarFolderIndexBehavior as x, serializeGeneratedAgentDocument as y };
|
package/dist/server.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { a as emitDocsAnalyticsEvent, c as resolveDocsAnalyticsConfig, i as emitDocsAgentTraceEvent, l as resolveDocsObservabilityConfig, n as createDocsAgentTraceContext, o as emitDocsObservabilityEvent, r as createDocsAgentTraceId, s as getDocsRequestAnalyticsProperties, t as DOCS_AGENT_TRACE_EVENT_TYPES } from "./analytics-Bx44lg6d.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { Bt as renderDocsSitemapXml, Ft as DEFAULT_SITEMAP_XML_ROUTE, Ht as resolveDocsSitemapPageLastmod, It as buildDocsSitemapManifest, Lt as createDocsSitemapResponse, Mt as DEFAULT_SITEMAP_MD_DOCS_ROUTE, Nt as DEFAULT_SITEMAP_MD_ROUTE, Pt as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, Rt as readDocsSitemapManifestFromContentMap, Ut as resolveDocsSitemapRequest, Vt as resolveDocsSitemapConfig, Wt as toDocsSitemapMarkdownUrl, jt as DEFAULT_SITEMAP_MANIFEST_PATH, zt as renderDocsSitemapMarkdown } from "./agent-FIyl4-Oa.mjs";
|
|
3
3
|
import "./standards-discovery-CYfiQE13.mjs";
|
|
4
|
-
import { a as createMcpSearchAdapter, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, f as resolveDocsSearchAudience, i as createCustomSearchAdapter, l as inferDocsAskAIPackageHints, n as buildDocsSearchDocuments, o as createSimpleSearchAdapter, p as resolveSearchRequestConfig, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, u as performDocsSearch } from "./search-
|
|
5
|
-
import { C as resolveApiReferenceOpenApiDiscovery, S as resolveApiReferenceConfig, T as remarkCodeGroup, _ as buildApiReferenceOpenApiDocument, a as DEFAULT_PROMPT_PROVIDER_TEMPLATES, b as buildApiReferenceScalarCss, c as resolvePromptProviderChoices, d as serializeDocsIconRegistry, f as serializeOpenDocsProvider, g as buildApiReferenceHtmlDocumentAsync, h as buildApiReferenceHtmlDocument, i as DEFAULT_OPEN_DOCS_TARGET, l as sanitizePromptText, m as DEFAULT_API_REFERENCE_OPENAPI_ROUTE, 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 buildApiReferenceOpenApiDocumentAsync, w as resolveApiReferenceRenderer, x as isApiReferenceOpenApiRequest, y as buildApiReferencePageTitle } from "./sitemap-server-
|
|
6
|
-
import { a as buildDocsReviewWorkflowPathFilters, c as resolveDocsReviewConfig, i as buildDocsReviewWorkflow, n as DEFAULT_DOCS_REVIEW_SCORE_THRESHOLD, o as ensureDocsReviewWorkflow, r as DEFAULT_DOCS_REVIEW_WORKFLOW_PATH, s as readDocsReviewConfigFromSource, t as runDocsGoldenTasks } from "./agent-evals-
|
|
4
|
+
import { a as createMcpSearchAdapter, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, f as resolveDocsSearchAudience, i as createCustomSearchAdapter, l as inferDocsAskAIPackageHints, n as buildDocsSearchDocuments, o as createSimpleSearchAdapter, p as resolveSearchRequestConfig, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, u as performDocsSearch } from "./search-x5O0-9X3.mjs";
|
|
5
|
+
import { C as resolveApiReferenceOpenApiDiscovery, S as resolveApiReferenceConfig, T as remarkCodeGroup, _ as buildApiReferenceOpenApiDocument, a as DEFAULT_PROMPT_PROVIDER_TEMPLATES, b as buildApiReferenceScalarCss, c as resolvePromptProviderChoices, d as serializeDocsIconRegistry, f as serializeOpenDocsProvider, g as buildApiReferenceHtmlDocumentAsync, h as buildApiReferenceHtmlDocument, i as DEFAULT_OPEN_DOCS_TARGET, l as sanitizePromptText, m as DEFAULT_API_REFERENCE_OPENAPI_ROUTE, 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 buildApiReferenceOpenApiDocumentAsync, w as resolveApiReferenceRenderer, x as isApiReferenceOpenApiRequest, y as buildApiReferencePageTitle } from "./sitemap-server-D_hayOp6.mjs";
|
|
6
|
+
import { a as buildDocsReviewWorkflowPathFilters, c as resolveDocsReviewConfig, i as buildDocsReviewWorkflow, n as DEFAULT_DOCS_REVIEW_SCORE_THRESHOLD, o as ensureDocsReviewWorkflow, r as DEFAULT_DOCS_REVIEW_WORKFLOW_PATH, s as readDocsReviewConfigFromSource, t as runDocsGoldenTasks } from "./agent-evals-Cr9TAkmB.mjs";
|
|
7
7
|
import { DEFAULT_DOCS_MCP_CORS_ALLOWED_HEADERS, DEFAULT_DOCS_MCP_CORS_EXPOSED_HEADERS, DEFAULT_DOCS_MCP_CORS_MAX_AGE_SECONDS, DEFAULT_DOCS_MCP_MAX_BODY_BYTES, DOCS_CONFIG_SCHEMA_OPTIONS, createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, getDocsConfigSchema, normalizeDocsMcpRoute, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
8
8
|
import { n as isDocsCloudAskAIProvider, t as createDocsCloudAskAIResponse } from "./cloud-ask-ai-sbpjOR2K.mjs";
|
|
9
9
|
import { createDocsCloudRouteHandler, createDocsCloudServer } from "./docs-cloud-server.mjs";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Bt as renderDocsSitemapXml, It as buildDocsSitemapManifest, Vt as resolveDocsSitemapConfig, zt as renderDocsSitemapMarkdown } from "./agent-FIyl4-Oa.mjs";
|
|
2
2
|
import "./standards-discovery-CYfiQE13.mjs";
|
|
3
|
-
import "./search-
|
|
4
|
-
import "./sitemap-server-
|
|
5
|
-
import "./agent-evals-
|
|
3
|
+
import "./search-x5O0-9X3.mjs";
|
|
4
|
+
import "./sitemap-server-D_hayOp6.mjs";
|
|
5
|
+
import "./agent-evals-Cr9TAkmB.mjs";
|
|
6
6
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
7
7
|
import "./code-blocks-DnNVNK2M.mjs";
|
|
8
8
|
import "./agent-skills-server-B4u3qy-1.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Vt as resolveDocsSitemapConfig } from "./agent-FIyl4-Oa.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
4
4
|
import path, { basename, join, relative } from "node:path";
|