@farming-labs/docs 0.2.72 → 0.2.73

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.
Files changed (55) hide show
  1. package/dist/{agent-DbDfIqhe.mjs → agent-ClRpctMG.mjs} +4 -3
  2. package/dist/{agent-evals-CjYzCQMZ.mjs → agent-evals-BFHGypqh.mjs} +30 -13
  3. package/dist/{agent-export-CpQhD8eA.mjs → agent-export-B9bah0AV.mjs} +12 -11
  4. package/dist/{agent-pS2nNQS3.mjs → agent-o9OTadrf.mjs} +576 -765
  5. package/dist/agent-skills-bundle.d.mts +1 -1
  6. package/dist/{agent-skills-server-DZnNB4_S.d.mts → agent-skills-server-DCbAx5WU.d.mts} +2 -2
  7. package/dist/{agent-skills-server-BPVv4gMg.mjs → agent-skills-server-noFn1l_p.mjs} +1 -1
  8. package/dist/agent-skills-vite.d.mts +3 -3
  9. package/dist/agent-skills-vite.mjs +2 -2
  10. package/dist/{agents-B-1h9Jlm.mjs → agents-CR-Uasbc.mjs} +10 -9
  11. package/dist/cli/index.mjs +29 -29
  12. package/dist/client/react.d.mts +1 -1
  13. package/dist/{cloud-ask-ai-D9gIN4Vr.d.mts → cloud-ask-ai-yR9vZmSG.d.mts} +1 -1
  14. package/dist/{cloud-CyysfDny.mjs → cloud-pdNC-tyj.mjs} +3 -3
  15. package/dist/{codeblocks-DAj7EAwt.mjs → codeblocks-CFuurVIH.mjs} +2 -2
  16. package/dist/{dev-qE7MYEh9.mjs → dev-Cc1cFFj-.mjs} +2 -2
  17. package/dist/docs-cloud-server.d.mts +2 -2
  18. package/dist/docs-cloud-server.mjs +1 -1
  19. package/dist/{doctor-CBy8-tPu.mjs → doctor-BeyN3Ljh.mjs} +15 -14
  20. package/dist/{downgrade-DCxezPZI.mjs → downgrade-w7e6Se0L.mjs} +2 -2
  21. package/dist/{golden-evaluations-DGg_eHIY.mjs → golden-evaluations-CloP0pAe.mjs} +4 -3
  22. package/dist/index.d.mts +72 -6
  23. package/dist/index.mjs +9 -8
  24. package/dist/{init-p1MHf06G.mjs → init-DAkI0Lkf.mjs} +3 -3
  25. package/dist/markdown-rendering.d.mts +75 -0
  26. package/dist/markdown-rendering.mjs +618 -0
  27. package/dist/markdown-sections-7OoA7ylx.mjs +1492 -0
  28. package/dist/{mcp-BNK45dzD.mjs → mcp-BLLXvEXB.mjs} +9 -8
  29. package/dist/mcp.d.mts +2 -2
  30. package/dist/mcp.mjs +10 -9
  31. package/dist/{metadata-D6qlWDu-.mjs → metadata-N252j5_a.mjs} +1 -1
  32. package/dist/{package-version-BXHcIm1T.mjs → package-version-n5AFur8a.mjs} +1 -1
  33. package/dist/{reading-time-DvTuW2Iy.mjs → prompt-references-Cz35rlOa.mjs} +158 -4
  34. package/dist/{review-Cace7A2c.mjs → review-DaJLdPLh.mjs} +10 -9
  35. package/dist/{robots-C2SindI5.mjs → robots-BcuxnZqZ.mjs} +2 -2
  36. package/dist/{robots-DmE_wXvG.mjs → robots-DI-9MZz1.mjs} +6 -5
  37. package/dist/{search-1aftosa5.d.mts → search-D1n8Sf25.d.mts} +24 -3
  38. package/dist/{search-DB3svkNQ.mjs → search-DeOJiMAy.mjs} +9 -8
  39. package/dist/{search-BbArHODP.mjs → search-RfPcG1if.mjs} +56 -21
  40. package/dist/server.d.mts +5 -5
  41. package/dist/server.mjs +10 -9
  42. package/dist/{sitemap-DPTLh_26.mjs → sitemap-BGGbX_KE.mjs} +10 -9
  43. package/dist/{sitemap-server-PUoOhplO.mjs → sitemap-server-VefDnzEB.mjs} +1 -1
  44. package/dist/{standards-discovery-DRJ10g7B.d.mts → standards-discovery-83lp1lew.d.mts} +5 -4
  45. package/dist/{standards-discovery-CYfiQE13.mjs → standards-discovery-BwL5ffGx.mjs} +4 -3
  46. package/dist/{upgrade-DDJQ5l6n.mjs → upgrade-oz-GChgt.mjs} +2 -2
  47. package/package.json +9 -1
  48. /package/dist/{cloud-ask-ai-hnJfj8-X.mjs → cloud-ask-ai-sbpjOR2K.mjs} +0 -0
  49. /package/dist/{code-blocks-qe0T8-xe.mjs → code-blocks-DnNVNK2M.mjs} +0 -0
  50. /package/dist/{config-z7_R0f86.mjs → config-Wcdj-D0a.mjs} +0 -0
  51. /package/dist/{errors-Cc_qplZU.mjs → errors-DbOhkE1h.mjs} +0 -0
  52. /package/dist/{i18n-CCaFUnAN.mjs → i18n-hHVWcflJ.mjs} +0 -0
  53. /package/dist/{templates-BJnf6B8l.mjs → templates-C6avM0U3.mjs} +0 -0
  54. /package/dist/{types-B9DNNAdT.d.mts → types-_HCPD4wc.d.mts} +0 -0
  55. /package/dist/{utils-C4RC8Zq_.mjs → utils-DpiIioYb.mjs} +0 -0
@@ -1,7 +1,8 @@
1
- import { B as findDocsMarkdownPage, an as stripGeneratedPageAgentContractMarkdown, at as renderDocsMarkdownDocument, nn as normalizePageAgentFrontmatter } from "./agent-pS2nNQS3.mjs";
2
- import { E as hashGeneratedAgentContent, O as parseGeneratedAgentDocument, T as GENERATED_AGENT_PROVENANCE_VERSION, k as serializeGeneratedAgentDocument } from "./search-BbArHODP.mjs";
1
+ import { B as findDocsMarkdownPage, at as renderDocsMarkdownDocument } from "./agent-o9OTadrf.mjs";
2
+ import { v as normalizePageAgentFrontmatter, x as stripGeneratedPageAgentContractMarkdown } from "./markdown-sections-7OoA7ylx.mjs";
3
+ import { E as hashGeneratedAgentContent, O as parseGeneratedAgentDocument, T as GENERATED_AGENT_PROVENANCE_VERSION, k as serializeGeneratedAgentDocument } from "./search-RfPcG1if.mjs";
3
4
  import { createFilesystemDocsMcpSource } from "./mcp.mjs";
4
- import { _ as resolveDocsContentDir, a as loadDocsConfigModule, c as loadProjectEnv, d as readNavTitle, f as readNumberProperty, g as resolveDocsConfigPath, h as readTopLevelStringProperty, l as readBooleanProperty, p as readStringProperty, t as extractNestedObjectLiteral, u as readEnvReferenceProperty } from "./config-z7_R0f86.mjs";
5
+ import { _ as resolveDocsContentDir, a as loadDocsConfigModule, c as loadProjectEnv, d as readNavTitle, f as readNumberProperty, g as resolveDocsConfigPath, h as readTopLevelStringProperty, l as readBooleanProperty, p as readStringProperty, t as extractNestedObjectLiteral, u as readEnvReferenceProperty } from "./config-Wcdj-D0a.mjs";
5
6
  import { createRequire } from "node:module";
6
7
  import matter from "gray-matter";
7
8
  import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
@@ -1,7 +1,7 @@
1
- import { Gt as findDocsMarkdownSection } from "./agent-pS2nNQS3.mjs";
2
- import { C as normalizeAgentVersion, S as normalizeAgentScopeValues, _ as resolveSearchRequestConfig, b as normalizeAgentFramework, d as performDocsSearch, t as buildDocsAskAIContext, u as normalizeDocsSearchFilters, v as agentVersionConstraintMatches, x as normalizeAgentLocale, y as agentVersionConstraintsOverlap } from "./search-BbArHODP.mjs";
1
+ import { S as upsertPageAgentContractMarkdown, l as stripDocsGeneratedAgentContractMarkers, o as findDocsMarkdownSection } from "./markdown-sections-7OoA7ylx.mjs";
2
+ import { C as normalizeAgentVersion, S as normalizeAgentScopeValues, _ as resolveSearchRequestConfig, b as normalizeAgentFramework, d as performDocsSearch, t as buildDocsAskAIContext, u as normalizeDocsSearchFilters, v as agentVersionConstraintMatches, x as normalizeAgentLocale, y as agentVersionConstraintsOverlap } from "./search-RfPcG1if.mjs";
3
3
  import { buildDocsMcpContext } from "./mcp.mjs";
4
- import { i as validateCodeBlockPlans, n as planCodeBlockTargets, r as resolveDocsCodeBlocksValidateConfig, t as extractCodeBlocksFromMarkdown } from "./code-blocks-qe0T8-xe.mjs";
4
+ import { i as validateCodeBlockPlans, n as planCodeBlockTargets, r as resolveDocsCodeBlocksValidateConfig, t as extractCodeBlocksFromMarkdown } from "./code-blocks-DnNVNK2M.mjs";
5
5
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
6
6
  import { dirname, isAbsolute, join, relative } from "node:path";
7
7
  import { createJiti } from "jiti";
@@ -829,14 +829,17 @@ function canonicalizeSource(value, baseUrl) {
829
829
  if ((explicitlySchemed && (parsed.protocol === "http:" || parsed.protocol === "https:") || /^[\\/]{2}/u.test(rawValue)) && (!configuredBase || parsed.origin !== configuredBase.origin)) origin = parsed.origin;
830
830
  if (explicitlySchemed && parsed.protocol !== "http:" && parsed.protocol !== "https:") origin = `${parsed.protocol}//${parsed.host}`;
831
831
  } catch {
832
- const [pathAndQuery = "/", fragment = ""] = rawValue.split("#", 2);
832
+ const hashIndex = rawValue.indexOf("#");
833
+ const pathAndQuery = hashIndex >= 0 ? rawValue.slice(0, hashIndex) : rawValue || "/";
834
+ const fragment = hashIndex >= 0 ? rawValue.slice(hashIndex + 1) : "";
833
835
  pathname = pathAndQuery.split("?", 1)[0] || "/";
834
836
  hash = fragment ? `#${fragment}` : "";
835
837
  }
836
838
  pathname = pathname.replace(/\/{2,}/gu, "/").replace(/\.md$/iu, "");
837
839
  if (pathname !== "/") pathname = pathname.replace(/\/+$/gu, "");
838
840
  if (!pathname.startsWith("/")) pathname = `/${pathname}`;
839
- const normalizedHash = hash ? `#${safeDecode(hash.slice(1)).trim().replace(/^#+/u, "").toLowerCase()}` : "";
841
+ const decodedHash = hash ? safeDecode(hash.slice(1)).trim() : "";
842
+ const normalizedHash = decodedHash ? `#${encodeURIComponent(decodedHash)}` : "";
840
843
  return `${origin}${pathname || "/"}${normalizedHash === "#" ? "" : normalizedHash}`;
841
844
  }
842
845
  function sourcePage(value) {
@@ -934,22 +937,36 @@ function extractRenderedCitations(context, sources) {
934
937
  blockUtf8Bytes
935
938
  };
936
939
  }
940
+ function getPageAgentSectionMarkdown(page) {
941
+ return upsertPageAgentContractMarkdown(page.agentRawContent ?? page.agentFallbackRawContent ?? page.agentContent ?? page.agentFallbackContent ?? page.rawContent ?? page.content, page.agent);
942
+ }
943
+ function cleanPageAgentContractMarkers(markdown, sourceMarkdown, startLine) {
944
+ return sourceMarkdown && startLine ? stripDocsGeneratedAgentContractMarkers(markdown, {
945
+ sourceMarkdown,
946
+ startLine
947
+ }) : stripDocsGeneratedAgentContractMarkers(markdown);
948
+ }
937
949
  function getPageAgentMarkdown(page) {
938
- return page.agentRawContent ?? page.agentFallbackRawContent ?? page.agentContent ?? page.agentFallbackContent ?? page.rawContent ?? page.content;
950
+ return cleanPageAgentContractMarkers(getPageAgentSectionMarkdown(page));
939
951
  }
940
952
  function findPageForSource(pagesByUrl, value) {
941
953
  return pagesByUrl.get(sourcePage(value));
942
954
  }
943
955
  function getResultAnchor(value) {
944
- return canonicalizeSource(value).split("#", 2)[1] || void 0;
956
+ const canonical = canonicalizeSource(value);
957
+ const hashIndex = canonical.indexOf("#");
958
+ return (hashIndex >= 0 ? canonical.slice(hashIndex + 1) : "") || void 0;
945
959
  }
946
- function hydrateSearchSource(result, index, pagesByUrl, contentMode, baseUrl) {
960
+ /** @internal */
961
+ function hydrateDocsEvaluationSearchSource(result, index, pagesByUrl, contentMode, baseUrl) {
947
962
  const normalizedResultUrl = canonicalizeSource(result.url, baseUrl);
948
963
  const page = findPageForSource(pagesByUrl, normalizedResultUrl);
949
964
  const anchor = getResultAnchor(result.url);
950
965
  const section = anchor ?? result.section;
951
- const pageSection = page && section ? findDocsMarkdownSection(getPageAgentMarkdown(page), section) : void 0;
952
- const content = contentMode === "page-section" && page ? (pageSection?.content ?? getPageAgentMarkdown(page)).trim() : [result.content, result.description].filter(Boolean).join("\n\n").trim();
966
+ const sectionMarkdown = page ? getPageAgentSectionMarkdown(page) : void 0;
967
+ const pageSection = sectionMarkdown && section ? findDocsMarkdownSection(sectionMarkdown, section) : void 0;
968
+ if (contentMode === "page-section" && page && section && !pageSection) return void 0;
969
+ const content = contentMode === "page-section" && page ? cleanPageAgentContractMarkers(pageSection?.content ?? getPageAgentMarkdown(page), pageSection ? sectionMarkdown : void 0, pageSection?.startLine).trim() : [result.content, result.description].filter(Boolean).join("\n\n").trim();
953
970
  const scope = page ? getPageScope(page) : void 0;
954
971
  const url = normalizedResultUrl;
955
972
  return {
@@ -1254,7 +1271,7 @@ async function buildGoldenSurface(options) {
1254
1271
  signal
1255
1272
  })
1256
1273
  });
1257
- const rankedSources = results.slice(0, options.topK).map((result, index) => hydrateSearchSource(result, index, pagesByUrl, "result", options.runOptions.baseUrl));
1274
+ const rankedSources = results.slice(0, options.topK).map((result, index) => hydrateDocsEvaluationSearchSource(result, index, pagesByUrl, "result", options.runOptions.baseUrl)).filter((source) => Boolean(source));
1258
1275
  return {
1259
1276
  surface,
1260
1277
  provider,
@@ -1300,8 +1317,8 @@ async function buildGoldenSurface(options) {
1300
1317
  signal
1301
1318
  })
1302
1319
  });
1303
- const rankedSources = askAI.searchResults.slice(0, options.topK).map((result, index) => hydrateSearchSource(result, index, pagesByUrl, "result", options.runOptions.baseUrl));
1304
- const resultSources = askAI.results.map((result, index) => hydrateSearchSource(result, index, pagesByUrl, "page-section", options.runOptions.baseUrl));
1320
+ const rankedSources = askAI.searchResults.slice(0, options.topK).map((result, index) => hydrateDocsEvaluationSearchSource(result, index, pagesByUrl, "result", options.runOptions.baseUrl)).filter((source) => Boolean(source));
1321
+ const resultSources = askAI.results.map((result, index) => hydrateDocsEvaluationSearchSource(result, index, pagesByUrl, "page-section", options.runOptions.baseUrl));
1305
1322
  const parsed = parseAskAIContextSources({
1306
1323
  context: askAI.context,
1307
1324
  blocks: askAI.blocks.map((block) => block.text),
@@ -1,16 +1,17 @@
1
- import { A as buildDocsAgentDiscoverySpec, Bt as renderDocsSitemapXml, It as buildDocsSitemapManifest, S as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, Vt as resolveDocsSitemapConfig, a as DEFAULT_AGENT_MD_ROUTE, at as renderDocsMarkdownDocument, c as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, g as DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE, h as DEFAULT_LLMS_FULL_TXT_ROUTE, it as renderDocsLlmsTxt, l as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, lt as resolveDocsAgentFeedbackConfig, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, o as DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE, rt as renderDocsAgentsDocument, st as renderDocsSkillDocument, t as DEFAULT_AGENTS_MD_ROUTE, v as DEFAULT_LLMS_TXT_ROUTE, wt as toDocsMarkdownUrl, x as DEFAULT_SKILL_MD_ROUTE, y as DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE, zt as renderDocsSitemapMarkdown } from "./agent-pS2nNQS3.mjs";
2
- import { D as buildDocsAgentSkillsIndex, E as buildDocsA2AAgentCard, I as resolveDocsPublishedAgentSkill, a as DEFAULT_A2A_AGENT_CARD_ROUTE, b as DEFAULT_LEGACY_SKILLS_INDEX_ROUTE, f as DEFAULT_AGENT_SKILLS_ROUTE_PREFIX, k as buildDocsLegacySkillsIndex, u as DEFAULT_AGENT_SKILLS_INDEX_ROUTE, x as DEFAULT_LEGACY_SKILLS_ROUTE_PREFIX } from "./standards-discovery-CYfiQE13.mjs";
3
- import "./search-BbArHODP.mjs";
4
- import { t as resolveDocsI18n } from "./i18n-CCaFUnAN.mjs";
5
- 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-C2SindI5.mjs";
6
- import "./sitemap-server-PUoOhplO.mjs";
7
- import "./agent-evals-CjYzCQMZ.mjs";
1
+ import { A as buildDocsAgentDiscoverySpec, Bt as renderDocsSitemapMarkdown, Ht as resolveDocsSitemapConfig, Lt as buildDocsSitemapManifest, S as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, Vt as renderDocsSitemapXml, a as DEFAULT_AGENT_MD_ROUTE, at as renderDocsMarkdownDocument, c as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, g as DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE, h as DEFAULT_LLMS_FULL_TXT_ROUTE, it as renderDocsLlmsTxt, l as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, lt as resolveDocsAgentFeedbackConfig, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, o as DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE, rt as renderDocsAgentsDocument, st as renderDocsSkillDocument, t as DEFAULT_AGENTS_MD_ROUTE, v as DEFAULT_LLMS_TXT_ROUTE, wt as toDocsMarkdownUrl, x as DEFAULT_SKILL_MD_ROUTE, y as DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE } from "./agent-o9OTadrf.mjs";
2
+ import "./markdown-sections-7OoA7ylx.mjs";
3
+ import { A as buildDocsLegacySkillsIndex, D as buildDocsA2AAgentCard, L as resolveDocsPublishedAgentSkill, O as buildDocsAgentSkillsIndex, a as DEFAULT_A2A_AGENT_CARD_ROUTE, b as DEFAULT_LEGACY_SKILLS_INDEX_ROUTE, f as DEFAULT_AGENT_SKILLS_ROUTE_PREFIX, u as DEFAULT_AGENT_SKILLS_INDEX_ROUTE, x as DEFAULT_LEGACY_SKILLS_ROUTE_PREFIX } from "./standards-discovery-BwL5ffGx.mjs";
4
+ import "./search-RfPcG1if.mjs";
5
+ import { t as resolveDocsI18n } from "./i18n-hHVWcflJ.mjs";
6
+ 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-BcuxnZqZ.mjs";
7
+ import "./sitemap-server-VefDnzEB.mjs";
8
+ import "./agent-evals-BFHGypqh.mjs";
8
9
  import { createFilesystemDocsMcpSource, resolveDocsMcpConfig } from "./mcp.mjs";
9
- import "./code-blocks-qe0T8-xe.mjs";
10
- import { t as resolveConfiguredAgentSkills } from "./agent-skills-server-BPVv4gMg.mjs";
10
+ import "./code-blocks-DnNVNK2M.mjs";
11
+ import { t as resolveConfiguredAgentSkills } from "./agent-skills-server-noFn1l_p.mjs";
11
12
  import "./server.mjs";
12
- import { _ as resolveDocsContentDir, a as loadDocsConfigModule, d as readNavTitle, g as resolveDocsConfigPath, h as readTopLevelStringProperty, l as readBooleanProperty, m as readTopLevelBooleanProperty, p as readStringProperty, r as extractTopLevelConfigObject, t as extractNestedObjectLiteral } from "./config-z7_R0f86.mjs";
13
- import { t as detectFramework } from "./utils-C4RC8Zq_.mjs";
13
+ import { _ as resolveDocsContentDir, a as loadDocsConfigModule, d as readNavTitle, g as resolveDocsConfigPath, h as readTopLevelStringProperty, l as readBooleanProperty, m as readTopLevelBooleanProperty, p as readStringProperty, r as extractTopLevelConfigObject, t as extractNestedObjectLiteral } from "./config-Wcdj-D0a.mjs";
14
+ import { t as detectFramework } from "./utils-DpiIioYb.mjs";
14
15
  import { existsSync, lstatSync, mkdirSync, readFileSync, realpathSync, renameSync, rmSync, writeFileSync } from "node:fs";
15
16
  import path from "node:path";
16
17
  import { execFileSync } from "node:child_process";