@farming-labs/docs 0.2.117 → 0.2.119
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-DGNTD-N6.mjs → agent-CYk2DxY7.mjs} +4 -4
- package/dist/{agent-CEZCaYto.mjs → agent-DkAidqtV.mjs} +23 -9
- package/dist/{agent-evals-CmeTjDMC.mjs → agent-evals-BLNLvXbG.mjs} +4 -4
- package/dist/{agent-export-DIKwVWYN.mjs → agent-export-Cxljt6RP.mjs} +16 -12
- package/dist/{agent-feedback-evaluations-DQCTFegz.mjs → agent-feedback-evaluations-CcMGlgsO.mjs} +1 -1
- package/dist/agent-skills-bundle.d.mts +1 -1
- package/dist/{agent-skills-progressive-disclosure-BDSjGGFd.mjs → agent-skills-progressive-disclosure-PjPtTYL-.mjs} +1 -1
- package/dist/{agent-skills-server-Ddm90WL6.mjs → agent-skills-server-BC7md56k.mjs} +224 -46
- package/dist/{agent-skills-server-BWRJjIQG.d.mts → agent-skills-server-CTNWr23x.d.mts} +2 -2
- package/dist/agent-skills-vite.d.mts +3 -3
- package/dist/agent-skills-vite.mjs +2 -2
- package/dist/{agents-l8RtkFim.mjs → agents-jtn256sz.mjs} +15 -11
- package/dist/{analytics-R9c-Md4b.d.mts → analytics-B8RZiKUt.d.mts} +1 -1
- package/dist/{analytics-CqfcIBdg.mjs → analytics-p8Vhhu2P.mjs} +1 -1
- package/dist/{api-reference-0XdEWya8.mjs → api-reference-By_LokQ-.mjs} +1 -1
- package/dist/{authoring-CvsCmYuq.mjs → authoring-C2ymvYWl.mjs} +8 -6
- package/dist/{authoring-mcp-C35lj3cI.mjs → authoring-mcp-CiCUQe3o.mjs} +1 -1
- package/dist/browser.d.mts +4 -4
- package/dist/browser.mjs +7 -4
- package/dist/cli/index.mjs +38 -38
- package/dist/client/react.d.mts +1 -1
- package/dist/client/react.mjs +1 -1
- package/dist/{cloud-DtmNQJg2.mjs → cloud-6eKrlmKd.mjs} +3 -3
- package/dist/{cloud-ask-ai-DLyrydIR.d.mts → cloud-ask-ai-BOahlsIZ.d.mts} +1 -1
- package/dist/{cloud-ask-ai-BDtBbbZZ.mjs → cloud-ask-ai-BqKhjpS5.mjs} +8 -7
- package/dist/{codeblocks-DEcqNXve.mjs → codeblocks-CHpgAwY-.mjs} +1 -1
- package/dist/{content-change-hydration-BWJNUIot.d.mts → content-change-hydration-CvHJadhE.d.mts} +3 -3
- package/dist/{dev-Df77AKR1.mjs → dev-Bnn-NUNa.mjs} +2 -2
- package/dist/docs-cloud-server.d.mts +2 -2
- package/dist/docs-cloud-server.mjs +3 -2
- package/dist/{doctor-zNmt9s6j.mjs → doctor-CUMgbglt.mjs} +21 -17
- package/dist/{downgrade-C6DSsOO9.mjs → downgrade-CHMta85e.mjs} +2 -2
- package/dist/{feedback-evals-CYuS2wTu.mjs → feedback-evals-DMilg9pY.mjs} +1 -1
- package/dist/{golden-evaluations-B1QDOzYj.mjs → golden-evaluations-CLUViycJ.mjs} +2 -2
- package/dist/http-body-DkAPk6D5.mjs +64 -0
- package/dist/index.d.mts +26 -43
- package/dist/index.mjs +13 -13
- package/dist/{init-BXKzipSS.mjs → init-K0LmXDZ5.mjs} +3 -3
- package/dist/markdown-rendering.mjs +1 -1
- package/dist/{mcp-Bj3ZoEtt.mjs → mcp-Bvha6_mG.mjs} +16 -12
- package/dist/mcp.d.mts +3 -3
- package/dist/mcp.mjs +79 -22
- package/dist/{metadata-7htr-Xj_.mjs → metadata-BOHn0Y5K.mjs} +1 -1
- package/dist/{openapi-diff-DKW3xkQU.mjs → openapi-diff-BOESBfnP.mjs} +6 -5
- package/dist/{openapi-mcp-UF4Cx885.mjs → openapi-mcp-BIOTLiA7.mjs} +4 -316
- package/dist/{openapi-sdk-DqRHPsCb.mjs → openapi-sdk-DJutz2AC.mjs} +6 -5
- package/dist/{openapi-source-CiKbUK71.mjs → openapi-source-CiX3hwFp.mjs} +1 -1
- package/dist/{package-version-CTkii52k.mjs → package-version-HJhYeq4M.mjs} +1 -1
- package/dist/{prompt-references-Cficetgk.mjs → prompt-references-DMgbu_dz.mjs} +20 -4
- package/dist/{sitemap-server-C4bpuoLi.mjs → prompt-utils-B5g-bv7o.mjs} +1 -17
- package/dist/{retrieval-digest-PD4fFy7P.d.mts → retrieval-digest-DLAQsQmx.d.mts} +2 -109
- package/dist/{review-CcplK9Hj.mjs → review-C6EmbV0l.mjs} +13 -11
- package/dist/{robots-BPYWIGqD.mjs → robots-BYJAVeI6.mjs} +2 -2
- package/dist/{robots-D4T3zZr_.mjs → robots-DteZB8vl.mjs} +7 -6
- package/dist/runtime.d.mts +5 -0
- package/dist/runtime.mjs +12 -0
- package/dist/{search-BNmlDQJ2.mjs → search-DKcdZgGx.mjs} +16 -12
- package/dist/server.d.mts +8 -116
- package/dist/server.mjs +15 -12
- package/dist/sidebar-C2LKcU7n.d.mts +63 -0
- package/dist/sidebar-CFHBj29f.mjs +421 -0
- package/dist/{sitemap-Bc4LkIcm.mjs → sitemap-CBQoERNz.mjs} +15 -11
- package/dist/sitemap-DafdOrxK.d.mts +110 -0
- package/dist/sitemap-server-C9r22_06.d.mts +114 -0
- package/dist/sitemap-server-Lg3YhUx4.mjs +18 -0
- package/dist/{skills-B6wl1bUL.mjs → skills-a90P31sJ.mjs} +15 -11
- package/dist/{standards-discovery-C1RLKwV9.d.mts → standards-discovery-1fiUVDAo.d.mts} +1 -1
- package/dist/{standards-discovery-Bpz90VYq.mjs → standards-discovery-sSEojU80.mjs} +1 -1
- package/dist/{types-Dkl2DUfp.d.mts → types-BncG8J3g.d.mts} +1 -1
- package/dist/{upgrade-8zStRidw.mjs → upgrade-DlQMOFV1.mjs} +2 -2
- package/package.json +8 -3
- package/dist/audience-exposure-DVsfT9Sx.mjs +0 -8
- package/dist/sidebar-3W51s2sF.mjs +0 -73
- package/dist/sidebar-CGbvEPTX.d.mts +0 -15
- /package/dist/{audience-exposure-BAjHjaTT.d.mts → audience-exposure-DBrFWULA.d.mts} +0 -0
- /package/dist/{cloud-analytics-Ci1yiwD8.mjs → cloud-analytics-D14HplI7.mjs} +0 -0
- /package/dist/{config-BnUOoj07.mjs → config-BZnKAj_Y.mjs} +0 -0
- /package/dist/{errors-BkS29NUA.mjs → errors-BtnVLhNF.mjs} +0 -0
- /package/dist/{feedback-CNsQP2jY.mjs → feedback-DL4T5oIO.mjs} +0 -0
- /package/dist/{markdown-sections-BKy4labo.mjs → markdown-sections-9Oxr33b-.mjs} +0 -0
- /package/dist/{openapi-anOaQn9o.mjs → openapi-CfCzX_a1.mjs} +0 -0
- /package/dist/{propose-ZH_mGMY_.mjs → propose-JmUv_BTt.mjs} +0 -0
- /package/dist/{retrieval-digest-B-SgtXKK.mjs → retrieval-digest-CT-eIEcp.mjs} +0 -0
- /package/dist/{templates-BiORflC3.mjs → templates-BuQ8YsGv.mjs} +0 -0
- /package/dist/{utils-c9arebCi.mjs → utils-C7KDrPpA.mjs} +0 -0
package/dist/mcp.mjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
7
|
-
import { n as resolvePageSidebarFolderIndexBehavior } from "./sidebar-
|
|
1
|
+
import "./http-body-DkAPk6D5.mjs";
|
|
2
|
+
import { C as filterDocsPagesByAccess, S as upsertPageAgentContractMarkdown, _ as hasStructuredPageAgentContract, o as findDocsMarkdownSection, s as parseDocsMarkdownSections, v as normalizePageAgentFrontmatter, y as renderPageAgentContractMarkdown } from "./markdown-sections-9Oxr33b-.mjs";
|
|
3
|
+
import { a as emitDocsAnalyticsEvent, i as emitDocsAgentTraceEvent, n as createDocsAgentTraceContext, r as createDocsAgentTraceId } from "./analytics-p8Vhhu2P.mjs";
|
|
4
|
+
import { $n as isDocsMcpResourcePath, An as agentVersionConstraintMatches, Bn as normalizeDocsRelated, Dn as resolveDocsAudienceMdxContent, E as DOCS_MARKDOWN_SECTION_INDEX_FORMAT, Et as validateDocsAgentFeedbackPayload, Gt as DocsContentChangesRequestError, In as DocsPaginationCursorError, Jt as isDocsContentChangeGeneration, Kt as createDocsContentChangeFeed, Mn as normalizeAgentFramework, Nn as normalizeAgentLocale, P as buildDocsMarkdownSectionIndex, Pn as normalizeAgentScopeValues, Rn as paginateDocsItems, Tt as toDocsMarkdownUrl, Vn as renderDocsRelatedMarkdownLines, Xn as isDocsMcpOAuthScopeToken, Xt as resolveDocsContentChangesConfig, Zn as isDocsMcpProtectedResourceMetadataPath, cr as normalizeDocsOkfTrustMetadataInput, er as normalizeDocsMcpAuthorizationServerUrls, fn as normalizeDocsSearchFilters, jn as agentVersionConstraintsOverlap, lr as resolveDocsOkfConfig, mn as performDocsSearchWithMetadata, nr as resolveDocsMcpProtectedResourceMetadataLocation, pn as performDocsSearch, rn as buildDocsSearchFacets, rr as resolveDocsMcpResourceLocation, sr as buildDocsOkfBundle, tr as normalizeDocsMcpEndpointPath, ut as resolveDocsAgentFeedbackConfig, xn as resolveLocalDocsMcpSearchConfig } from "./agent-DkAidqtV.mjs";
|
|
5
|
+
import { r as isDocsRetrievalCanonicalUrl } from "./retrieval-digest-CT-eIEcp.mjs";
|
|
6
|
+
import "./standards-discovery-sSEojU80.mjs";
|
|
7
|
+
import { a as emitDocsTelemetryAgentSurfaceEvent, l as emitDocsTelemetryProjectEvent, n as resolvePageSidebarFolderIndexBehavior, s as emitDocsTelemetryMcpToolEvent } from "./sidebar-CFHBj29f.mjs";
|
|
8
|
+
import { a as DEFAULT_DOCS_CONTENT_CHANGE_HYDRATION_TOKEN_BUDGET, c as MIN_DOCS_CONTENT_CHANGE_HYDRATION_TOKEN_BUDGET, g as stripGeneratedAgentProvenance, i as resolveDocsOpenApiMcpOperations, l as hydrateDocsContentChanges, n as readDocsOpenApiMcpResponse, o as DOCS_CONTENT_CHANGE_HYDRATION_FORMAT, r as resolveDocsOpenApiMcpBaseUrl, s as MAX_DOCS_CONTENT_CHANGE_HYDRATION_TOKEN_BUDGET, t as acquireDocsOpenApiMcpBudget } from "./openapi-mcp-BIOTLiA7.mjs";
|
|
8
9
|
import { t as validateDocsOpenApiMcpUrl } from "./openapi-mcp-node-C4jUpZG6.mjs";
|
|
9
10
|
import matter from "gray-matter";
|
|
10
11
|
import fs from "node:fs";
|
|
@@ -3006,7 +3007,11 @@ function createFilesystemDocsMcpSource(options = {}) {
|
|
|
3006
3007
|
const rootDir = options.rootDir ?? process.cwd();
|
|
3007
3008
|
const entry = normalizePathSegment(options.entry ?? "docs") || "docs";
|
|
3008
3009
|
const contentDir = options.contentDir ?? entry;
|
|
3009
|
-
const contentDirAbs = path.resolve(
|
|
3010
|
+
const contentDirAbs = path.resolve(
|
|
3011
|
+
/* turbopackIgnore: true */
|
|
3012
|
+
rootDir,
|
|
3013
|
+
contentDir
|
|
3014
|
+
);
|
|
3010
3015
|
const cache = /* @__PURE__ */ new Map();
|
|
3011
3016
|
const navigationCache = /* @__PURE__ */ new Map();
|
|
3012
3017
|
function getPages() {
|
|
@@ -5909,25 +5914,46 @@ function resolveFilesystemDocsPageSource(dir) {
|
|
|
5909
5914
|
"page.mdx",
|
|
5910
5915
|
"page.md",
|
|
5911
5916
|
"page.svx"
|
|
5912
|
-
].map((fileName) => path.join(
|
|
5917
|
+
].map((fileName) => path.join(
|
|
5918
|
+
/* turbopackIgnore: true */
|
|
5919
|
+
dir,
|
|
5920
|
+
fileName
|
|
5921
|
+
)).find((candidate) => fs.existsSync(
|
|
5922
|
+
/* turbopackIgnore: true */
|
|
5923
|
+
candidate
|
|
5924
|
+
));
|
|
5913
5925
|
}
|
|
5914
5926
|
function hasVisibleDescendantFilesystemDocsPage(dir) {
|
|
5915
5927
|
let entries;
|
|
5916
5928
|
try {
|
|
5917
|
-
entries = fs.readdirSync(
|
|
5929
|
+
entries = fs.readdirSync(
|
|
5930
|
+
/* turbopackIgnore: true */
|
|
5931
|
+
dir
|
|
5932
|
+
);
|
|
5918
5933
|
} catch {
|
|
5919
5934
|
return false;
|
|
5920
5935
|
}
|
|
5921
5936
|
for (const name of entries.sort()) {
|
|
5922
|
-
const full = path.join(
|
|
5937
|
+
const full = path.join(
|
|
5938
|
+
/* turbopackIgnore: true */
|
|
5939
|
+
dir,
|
|
5940
|
+
name
|
|
5941
|
+
);
|
|
5923
5942
|
try {
|
|
5924
|
-
if (!fs.statSync(
|
|
5943
|
+
if (!fs.statSync(
|
|
5944
|
+
/* turbopackIgnore: true */
|
|
5945
|
+
full
|
|
5946
|
+
).isDirectory()) continue;
|
|
5925
5947
|
} catch {
|
|
5926
5948
|
continue;
|
|
5927
5949
|
}
|
|
5928
5950
|
const pageSource = resolveFilesystemDocsPageSource(full);
|
|
5929
5951
|
if (pageSource) try {
|
|
5930
|
-
const data = matter(fs.readFileSync(
|
|
5952
|
+
const data = matter(fs.readFileSync(
|
|
5953
|
+
/* turbopackIgnore: true */
|
|
5954
|
+
pageSource,
|
|
5955
|
+
"utf-8"
|
|
5956
|
+
)).data;
|
|
5931
5957
|
const hiddenFolderIndex = resolvePageSidebarFolderIndexBehavior(data.sidebar) === "hidden";
|
|
5932
5958
|
if (data.hidden !== true && !hiddenFolderIndex) return true;
|
|
5933
5959
|
} catch {
|
|
@@ -5944,18 +5970,35 @@ function normalizeFrontmatterLastmod(value) {
|
|
|
5944
5970
|
function scanFilesystemDocsPages(contentDirAbs, entry, rootDir) {
|
|
5945
5971
|
const pages = [];
|
|
5946
5972
|
function scan(dir, slugParts) {
|
|
5947
|
-
if (!fs.existsSync(
|
|
5948
|
-
|
|
5973
|
+
if (!fs.existsSync(
|
|
5974
|
+
/* turbopackIgnore: true */
|
|
5975
|
+
dir
|
|
5976
|
+
)) return;
|
|
5977
|
+
const entries = fs.readdirSync(
|
|
5978
|
+
/* turbopackIgnore: true */
|
|
5979
|
+
dir
|
|
5980
|
+
).sort();
|
|
5949
5981
|
for (const name of entries) {
|
|
5950
|
-
const full = path.join(
|
|
5951
|
-
|
|
5982
|
+
const full = path.join(
|
|
5983
|
+
/* turbopackIgnore: true */
|
|
5984
|
+
dir,
|
|
5985
|
+
name
|
|
5986
|
+
);
|
|
5987
|
+
const stat = fs.statSync(
|
|
5988
|
+
/* turbopackIgnore: true */
|
|
5989
|
+
full
|
|
5990
|
+
);
|
|
5952
5991
|
if (stat.isDirectory()) {
|
|
5953
5992
|
scan(full, [...slugParts, name]);
|
|
5954
5993
|
continue;
|
|
5955
5994
|
}
|
|
5956
5995
|
if (name === "agent.md") continue;
|
|
5957
5996
|
if (!name.endsWith(".md") && !name.endsWith(".mdx") && !name.endsWith(".svx")) continue;
|
|
5958
|
-
const { data, content } = matter(fs.readFileSync(
|
|
5997
|
+
const { data, content } = matter(fs.readFileSync(
|
|
5998
|
+
/* turbopackIgnore: true */
|
|
5999
|
+
full,
|
|
6000
|
+
"utf-8"
|
|
6001
|
+
));
|
|
5959
6002
|
const baseName = name.replace(/\.(md|mdx|svx)$/, "");
|
|
5960
6003
|
const isIndex = baseName === "index" || baseName === "page" || baseName === "+page";
|
|
5961
6004
|
if (isIndex && resolvePageSidebarFolderIndexBehavior(data.sidebar) === "hidden" && hasVisibleDescendantFilesystemDocsPage(dir)) continue;
|
|
@@ -5995,14 +6038,28 @@ function scanFilesystemDocsPages(contentDirAbs, entry, rootDir) {
|
|
|
5995
6038
|
return resolveRelatedForMcpPages(pages);
|
|
5996
6039
|
}
|
|
5997
6040
|
function readFilesystemAgentDoc(dir) {
|
|
5998
|
-
const agentPath = path.join(
|
|
5999
|
-
|
|
6000
|
-
|
|
6041
|
+
const agentPath = path.join(
|
|
6042
|
+
/* turbopackIgnore: true */
|
|
6043
|
+
dir,
|
|
6044
|
+
"agent.md"
|
|
6045
|
+
);
|
|
6046
|
+
if (!fs.existsSync(
|
|
6047
|
+
/* turbopackIgnore: true */
|
|
6048
|
+
agentPath
|
|
6049
|
+
)) return void 0;
|
|
6050
|
+
const { content } = matter(stripGeneratedAgentProvenance(fs.readFileSync(
|
|
6051
|
+
/* turbopackIgnore: true */
|
|
6052
|
+
agentPath,
|
|
6053
|
+
"utf-8"
|
|
6054
|
+
)));
|
|
6001
6055
|
const agentContent = resolveDocsAudienceMdxContent(content, "agent");
|
|
6002
6056
|
return {
|
|
6003
6057
|
agentContent: stripMarkdownForMcp(agentContent),
|
|
6004
6058
|
agentRawContent: agentContent,
|
|
6005
|
-
agentLastModified: fs.statSync(
|
|
6059
|
+
agentLastModified: fs.statSync(
|
|
6060
|
+
/* turbopackIgnore: true */
|
|
6061
|
+
agentPath
|
|
6062
|
+
).mtime.toISOString()
|
|
6006
6063
|
};
|
|
6007
6064
|
}
|
|
6008
6065
|
function resolveRelatedForMcpPages(pages) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as hasStructuredPageAgentContract, v as normalizePageAgentFrontmatter } from "./markdown-sections-
|
|
1
|
+
import { _ as hasStructuredPageAgentContract, v as normalizePageAgentFrontmatter } from "./markdown-sections-9Oxr33b-.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/metadata.ts
|
|
4
4
|
/**
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import "./
|
|
1
|
+
import "./http-body-DkAPk6D5.mjs";
|
|
2
|
+
import "./markdown-sections-9Oxr33b-.mjs";
|
|
3
|
+
import "./agent-DkAidqtV.mjs";
|
|
4
|
+
import "./standards-discovery-sSEojU80.mjs";
|
|
4
5
|
import { n as buildNormalizedOpenApiModel } from "./openapi-operations-DFpaqOqA.mjs";
|
|
5
|
-
import "./api-reference-
|
|
6
|
-
import { n as loadOpenApiCliSource, t as displayOpenApiCliSource } from "./openapi-source-
|
|
6
|
+
import "./api-reference-By_LokQ-.mjs";
|
|
7
|
+
import { n as loadOpenApiCliSource, t as displayOpenApiCliSource } from "./openapi-source-CiX3hwFp.mjs";
|
|
7
8
|
import path from "node:path";
|
|
8
9
|
import pc from "picocolors";
|
|
9
10
|
|
|
@@ -1,321 +1,9 @@
|
|
|
1
|
-
import { s as parseDocsMarkdownSections } from "./markdown-sections-
|
|
2
|
-
import {
|
|
3
|
-
import { n as digestDocsRetrievalContent } from "./retrieval-digest-
|
|
1
|
+
import { s as parseDocsMarkdownSections } from "./markdown-sections-9Oxr33b-.mjs";
|
|
2
|
+
import { In as DocsPaginationCursorError, Ln as createDocsPaginationCursor, tn as buildDocsRetrievalDigestProjection, zn as resolveDocsPaginationOffset } from "./agent-DkAidqtV.mjs";
|
|
3
|
+
import { n as digestDocsRetrievalContent } from "./retrieval-digest-CT-eIEcp.mjs";
|
|
4
4
|
import { n as buildNormalizedOpenApiModel } from "./openapi-operations-DFpaqOqA.mjs";
|
|
5
5
|
import matter from "gray-matter";
|
|
6
6
|
|
|
7
|
-
//#region src/telemetry.ts
|
|
8
|
-
const DOCS_PACKAGE_NAME = "@farming-labs/docs";
|
|
9
|
-
const DOCS_PACKAGE_VERSION = "0.2.25";
|
|
10
|
-
const DEFAULT_DOCS_TELEMETRY_ENDPOINT = "https://docs.farming-labs.dev/api/telemetry/events";
|
|
11
|
-
const PROJECT_TELEMETRY_CACHE_TTL_MS = 1440 * 60 * 1e3;
|
|
12
|
-
const PROJECT_TELEMETRY_CACHE_MAX_KEYS = 256;
|
|
13
|
-
function getRuntimeEnv() {
|
|
14
|
-
if (typeof process === "undefined" || !process.env) return;
|
|
15
|
-
return process.env;
|
|
16
|
-
}
|
|
17
|
-
function readRuntimeEnv(name) {
|
|
18
|
-
const value = getRuntimeEnv()?.[name]?.trim();
|
|
19
|
-
return value ? value : void 0;
|
|
20
|
-
}
|
|
21
|
-
function isTruthyEnv(value) {
|
|
22
|
-
return /^(1|true|yes|on)$/i.test(value ?? "");
|
|
23
|
-
}
|
|
24
|
-
function isFalsyEnv(value) {
|
|
25
|
-
return /^(0|false|no|off)$/i.test(value ?? "");
|
|
26
|
-
}
|
|
27
|
-
function isBrowserRuntime() {
|
|
28
|
-
return typeof window !== "undefined" && typeof document !== "undefined";
|
|
29
|
-
}
|
|
30
|
-
function isProductionTelemetryRuntime() {
|
|
31
|
-
if (isBrowserRuntime()) return false;
|
|
32
|
-
const env = getRuntimeEnv();
|
|
33
|
-
if (!env) return true;
|
|
34
|
-
if (env.NODE_ENV === "test") return false;
|
|
35
|
-
if (env.VERCEL_ENV === "production") return true;
|
|
36
|
-
if (env.CONTEXT === "production" && isTruthyEnv(env.NETLIFY)) return true;
|
|
37
|
-
if (isTruthyEnv(env.CF_PAGES)) return true;
|
|
38
|
-
if (env.RENDER_SERVICE_ID || env.FLY_APP_NAME || env.RAILWAY_ENVIRONMENT) return true;
|
|
39
|
-
return env.NODE_ENV === "production";
|
|
40
|
-
}
|
|
41
|
-
function resolveDocsTelemetryConfig(telemetry) {
|
|
42
|
-
const envToggle = readRuntimeEnv("DOCS_TELEMETRY");
|
|
43
|
-
const envDisabled = readRuntimeEnv("DOCS_TELEMETRY_DISABLED");
|
|
44
|
-
if (isFalsyEnv(envToggle) || isTruthyEnv(envDisabled) || telemetry === false) return { enabled: false };
|
|
45
|
-
const objectConfig = telemetry && typeof telemetry === "object" ? telemetry : void 0;
|
|
46
|
-
if (objectConfig?.enabled === false) return { enabled: false };
|
|
47
|
-
return {
|
|
48
|
-
enabled: telemetry === true || objectConfig?.enabled === true || isTruthyEnv(envToggle) || isProductionTelemetryRuntime(),
|
|
49
|
-
endpoint: objectConfig?.endpoint?.trim() || readRuntimeEnv("DOCS_TELEMETRY_ENDPOINT") || DEFAULT_DOCS_TELEMETRY_ENDPOINT
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
function readRequestOrigin(request) {
|
|
53
|
-
if (!request?.url) return void 0;
|
|
54
|
-
try {
|
|
55
|
-
return new URL(request.url).origin;
|
|
56
|
-
} catch {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
/** Normalize an HTTP(S) telemetry site value to its origin. */
|
|
61
|
-
function normalizeDocsTelemetryOrigin(candidate) {
|
|
62
|
-
if (typeof candidate !== "string") return void 0;
|
|
63
|
-
const trimmed = candidate.trim();
|
|
64
|
-
if (!trimmed) return void 0;
|
|
65
|
-
try {
|
|
66
|
-
const hasScheme = /^[a-z][a-z\d+.-]*:(?!\d)/i.test(trimmed);
|
|
67
|
-
const url = new URL(hasScheme ? trimmed : `https://${trimmed}`);
|
|
68
|
-
if (url.protocol !== "http:" && url.protocol !== "https:") return void 0;
|
|
69
|
-
return url.origin;
|
|
70
|
-
} catch {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
/** Return whether a telemetry origin points at a local development server. */
|
|
75
|
-
function isLocalDocsTelemetryOrigin(candidate) {
|
|
76
|
-
const origin = normalizeDocsTelemetryOrigin(candidate);
|
|
77
|
-
if (!origin) return false;
|
|
78
|
-
const hostname = new URL(origin).hostname.toLowerCase().replace(/^\[|\]$/g, "").replace(/\.+$/, "");
|
|
79
|
-
if ([
|
|
80
|
-
"localhost",
|
|
81
|
-
"localhost.localdomain",
|
|
82
|
-
"localhost6",
|
|
83
|
-
"localhost6.localdomain6",
|
|
84
|
-
"ip6-localhost",
|
|
85
|
-
"ip6-loopback"
|
|
86
|
-
].includes(hostname) || hostname.endsWith(".localhost")) return true;
|
|
87
|
-
if (hostname === "::" || hostname === "::1") return true;
|
|
88
|
-
const ipv4 = hostname.split(".").map((part) => Number(part));
|
|
89
|
-
if (ipv4.length === 4 && ipv4.every((part) => Number.isInteger(part) && part >= 0 && part <= 255)) return ipv4[0] === 127 || ipv4.every((part) => part === 0);
|
|
90
|
-
return /^::ffff:7f[0-9a-f]{2}:/.test(hostname) || hostname === "::ffff:0:0";
|
|
91
|
-
}
|
|
92
|
-
function isBlockedDocsTelemetryOrigin(candidate) {
|
|
93
|
-
if (candidate === void 0) return false;
|
|
94
|
-
return !normalizeDocsTelemetryOrigin(candidate) || isLocalDocsTelemetryOrigin(candidate);
|
|
95
|
-
}
|
|
96
|
-
function readDeploymentOrigin() {
|
|
97
|
-
const candidates = [
|
|
98
|
-
readRuntimeEnv("DOCS_SITE_URL"),
|
|
99
|
-
readRuntimeEnv("NEXT_PUBLIC_BASE_URL"),
|
|
100
|
-
readRuntimeEnv("NEXT_PUBLIC_SITE_URL"),
|
|
101
|
-
readRuntimeEnv("SITE_URL"),
|
|
102
|
-
readRuntimeEnv("URL"),
|
|
103
|
-
readRuntimeEnv("CF_PAGES_URL"),
|
|
104
|
-
readRuntimeEnv("VERCEL_PROJECT_PRODUCTION_URL"),
|
|
105
|
-
readRuntimeEnv("VERCEL_URL"),
|
|
106
|
-
readRuntimeEnv("DEPLOY_PRIME_URL")
|
|
107
|
-
];
|
|
108
|
-
for (const candidate of candidates) {
|
|
109
|
-
const origin = normalizeDocsTelemetryOrigin(candidate);
|
|
110
|
-
if (origin) return origin;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
function detectDeployment() {
|
|
114
|
-
const env = getRuntimeEnv();
|
|
115
|
-
if (!env) return void 0;
|
|
116
|
-
if (env.VERCEL || env.VERCEL_ENV) return {
|
|
117
|
-
provider: "vercel",
|
|
118
|
-
environment: env.VERCEL_ENV,
|
|
119
|
-
id: env.VERCEL_DEPLOYMENT_ID ?? env.VERCEL_GIT_COMMIT_SHA,
|
|
120
|
-
region: env.VERCEL_REGION
|
|
121
|
-
};
|
|
122
|
-
if (env.NETLIFY) return {
|
|
123
|
-
provider: "netlify",
|
|
124
|
-
environment: env.CONTEXT,
|
|
125
|
-
id: env.DEPLOY_ID ?? env.COMMIT_REF
|
|
126
|
-
};
|
|
127
|
-
if (env.CF_PAGES) return {
|
|
128
|
-
provider: "cloudflare-pages",
|
|
129
|
-
environment: env.CF_PAGES_BRANCH,
|
|
130
|
-
id: env.CF_PAGES_COMMIT_SHA
|
|
131
|
-
};
|
|
132
|
-
if (env.RENDER_SERVICE_ID) return {
|
|
133
|
-
provider: "render",
|
|
134
|
-
environment: env.RENDER_ENV,
|
|
135
|
-
id: env.RENDER_SERVICE_ID
|
|
136
|
-
};
|
|
137
|
-
if (env.FLY_APP_NAME) return {
|
|
138
|
-
provider: "fly",
|
|
139
|
-
environment: env.FLY_APP_NAME,
|
|
140
|
-
id: env.FLY_ALLOC_ID,
|
|
141
|
-
region: env.FLY_REGION
|
|
142
|
-
};
|
|
143
|
-
if (env.RAILWAY_ENVIRONMENT) return {
|
|
144
|
-
provider: "railway",
|
|
145
|
-
environment: env.RAILWAY_ENVIRONMENT,
|
|
146
|
-
id: env.RAILWAY_DEPLOYMENT_ID
|
|
147
|
-
};
|
|
148
|
-
return env.NODE_ENV === "production" ? { environment: "production" } : void 0;
|
|
149
|
-
}
|
|
150
|
-
function detectRuntime() {
|
|
151
|
-
if (typeof process !== "undefined" && process.versions?.node) return {
|
|
152
|
-
name: "node",
|
|
153
|
-
version: process.versions.node
|
|
154
|
-
};
|
|
155
|
-
if (typeof navigator !== "undefined" && navigator.userAgent) return { name: "web-standard" };
|
|
156
|
-
}
|
|
157
|
-
function isObjectConfigEnabled(value, defaultEnabled) {
|
|
158
|
-
if (value === false) return false;
|
|
159
|
-
if (value === true) return true;
|
|
160
|
-
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
161
|
-
const enabled = value.enabled;
|
|
162
|
-
return enabled === false ? false : defaultEnabled || enabled === true;
|
|
163
|
-
}
|
|
164
|
-
return defaultEnabled;
|
|
165
|
-
}
|
|
166
|
-
function hasObjectConfig(value) {
|
|
167
|
-
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
168
|
-
}
|
|
169
|
-
function getDocsTelemetryFeatures(config) {
|
|
170
|
-
const pageActions = config.pageActions;
|
|
171
|
-
const feedback = config.feedback;
|
|
172
|
-
return {
|
|
173
|
-
search: isObjectConfigEnabled(config.search, true),
|
|
174
|
-
contentChanges: resolveDocsContentChangesConfig(config.agent?.contentChanges, { staticExport: config.staticExport === true }).enabled,
|
|
175
|
-
ai: isObjectConfigEnabled(config.ai, false),
|
|
176
|
-
mcp: isObjectConfigEnabled(config.mcp, true),
|
|
177
|
-
llmsTxt: isObjectConfigEnabled(config.llmsTxt, true),
|
|
178
|
-
pageActions: hasObjectConfig(pageActions),
|
|
179
|
-
feedback: feedback === true || hasObjectConfig(feedback) && feedback.enabled !== false,
|
|
180
|
-
agentFeedback: feedback !== false && !(hasObjectConfig(feedback) && feedback.agent === false) && !(hasObjectConfig(feedback) && hasObjectConfig(feedback.agent) && feedback.agent.enabled === false),
|
|
181
|
-
sitemap: isObjectConfigEnabled(config.sitemap, true),
|
|
182
|
-
robots: isObjectConfigEnabled(config.robots, true),
|
|
183
|
-
apiReference: isObjectConfigEnabled(config.apiReference, false),
|
|
184
|
-
staticExport: config.staticExport === true,
|
|
185
|
-
changelog: isObjectConfigEnabled(config.changelog, false),
|
|
186
|
-
cloud: typeof config.cloud !== "undefined" && isObjectConfigEnabled(config.cloud, true),
|
|
187
|
-
review: isObjectConfigEnabled(config.review, true),
|
|
188
|
-
codeBlocksValidate: hasObjectConfig(config.codeBlocks) && Boolean(config.codeBlocks.validate)
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
function createDocsTelemetryEvent(config, input, context = {}) {
|
|
192
|
-
const telemetryConfig = config.telemetry && typeof config.telemetry === "object" ? config.telemetry : void 0;
|
|
193
|
-
const siteOriginCandidates = [
|
|
194
|
-
context.siteOrigin,
|
|
195
|
-
input.site?.origin,
|
|
196
|
-
telemetryConfig?.siteOrigin,
|
|
197
|
-
readRequestOrigin(context.request),
|
|
198
|
-
readDeploymentOrigin()
|
|
199
|
-
];
|
|
200
|
-
if (siteOriginCandidates.some(isBlockedDocsTelemetryOrigin)) return void 0;
|
|
201
|
-
const siteOrigin = siteOriginCandidates.map(normalizeDocsTelemetryOrigin).find((origin) => Boolean(origin));
|
|
202
|
-
const deployment = input.deployment ?? detectDeployment();
|
|
203
|
-
const properties = context.properties || input.properties ? {
|
|
204
|
-
...input.properties,
|
|
205
|
-
...context.properties
|
|
206
|
-
} : void 0;
|
|
207
|
-
return {
|
|
208
|
-
...input,
|
|
209
|
-
timestamp: input.timestamp ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
210
|
-
package: {
|
|
211
|
-
name: DOCS_PACKAGE_NAME,
|
|
212
|
-
version: DOCS_PACKAGE_VERSION,
|
|
213
|
-
...input.package
|
|
214
|
-
},
|
|
215
|
-
framework: input.framework ?? context.framework,
|
|
216
|
-
runtime: input.runtime ?? detectRuntime(),
|
|
217
|
-
site: siteOrigin ? { origin: siteOrigin } : input.site,
|
|
218
|
-
deployment,
|
|
219
|
-
features: input.features ?? getDocsTelemetryFeatures(config),
|
|
220
|
-
properties
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
function projectEventKey(event) {
|
|
224
|
-
return [
|
|
225
|
-
event.package.name,
|
|
226
|
-
event.package.version,
|
|
227
|
-
event.framework ?? "",
|
|
228
|
-
event.site?.origin ?? "",
|
|
229
|
-
event.deployment?.provider ?? "",
|
|
230
|
-
event.deployment?.environment ?? "",
|
|
231
|
-
event.deployment?.id ?? ""
|
|
232
|
-
].join("|");
|
|
233
|
-
}
|
|
234
|
-
function getSentProjectKeys() {
|
|
235
|
-
const globalValue = globalThis;
|
|
236
|
-
globalValue.__farmingLabsDocsTelemetryProjectKeys__ ??= /* @__PURE__ */ new Map();
|
|
237
|
-
return globalValue.__farmingLabsDocsTelemetryProjectKeys__;
|
|
238
|
-
}
|
|
239
|
-
function pruneSentProjectKeys(sent, now) {
|
|
240
|
-
for (const [key, expiresAt] of sent) if (expiresAt <= now) sent.delete(key);
|
|
241
|
-
while (sent.size >= PROJECT_TELEMETRY_CACHE_MAX_KEYS) {
|
|
242
|
-
const oldestKey = sent.keys().next().value;
|
|
243
|
-
if (!oldestKey) return;
|
|
244
|
-
sent.delete(oldestKey);
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
async function emitDocsTelemetryEvent(telemetry, event) {
|
|
248
|
-
const resolved = resolveDocsTelemetryConfig(telemetry);
|
|
249
|
-
const eventSiteOrigin = event.site?.origin;
|
|
250
|
-
const normalizedSiteOrigin = normalizeDocsTelemetryOrigin(eventSiteOrigin);
|
|
251
|
-
if (!resolved.enabled || !resolved.endpoint || typeof fetch !== "function" || eventSiteOrigin !== void 0 && (!normalizedSiteOrigin || isLocalDocsTelemetryOrigin(eventSiteOrigin))) return;
|
|
252
|
-
const eventToSend = normalizedSiteOrigin ? {
|
|
253
|
-
...event,
|
|
254
|
-
site: { origin: normalizedSiteOrigin }
|
|
255
|
-
} : event;
|
|
256
|
-
try {
|
|
257
|
-
const ingestKey = readRuntimeEnv("DOCS_TELEMETRY_INGEST_KEY");
|
|
258
|
-
const headers = { "content-type": "application/json" };
|
|
259
|
-
if (ingestKey) headers["x-docs-telemetry-key"] = ingestKey;
|
|
260
|
-
await fetch(resolved.endpoint, {
|
|
261
|
-
method: "POST",
|
|
262
|
-
headers,
|
|
263
|
-
body: JSON.stringify({ event: eventToSend }),
|
|
264
|
-
keepalive: true
|
|
265
|
-
});
|
|
266
|
-
} catch {}
|
|
267
|
-
}
|
|
268
|
-
function emitDocsTelemetryProjectEvent(config, context = {}) {
|
|
269
|
-
const event = createDocsTelemetryEvent(config, { type: "project_detected" }, context);
|
|
270
|
-
if (!event) return;
|
|
271
|
-
const key = projectEventKey(event);
|
|
272
|
-
const sent = getSentProjectKeys();
|
|
273
|
-
const now = Date.now();
|
|
274
|
-
const expiresAt = sent.get(key);
|
|
275
|
-
if (expiresAt && expiresAt > now) return;
|
|
276
|
-
if (typeof expiresAt === "number") sent.delete(key);
|
|
277
|
-
pruneSentProjectKeys(sent, now);
|
|
278
|
-
sent.set(key, now + PROJECT_TELEMETRY_CACHE_TTL_MS);
|
|
279
|
-
emitDocsTelemetryEvent(config.telemetry, event);
|
|
280
|
-
}
|
|
281
|
-
function emitDocsTelemetryAgentSurfaceEvent(config, context) {
|
|
282
|
-
const event = createDocsTelemetryEvent(config, {
|
|
283
|
-
type: context.surface === "mcp" ? "mcp_request" : "agent_surface_used",
|
|
284
|
-
properties: { surface: context.surface }
|
|
285
|
-
}, context);
|
|
286
|
-
if (!event) return;
|
|
287
|
-
emitDocsTelemetryEvent(config.telemetry, event);
|
|
288
|
-
}
|
|
289
|
-
function emitDocsTelemetryMcpToolEvent(config, context) {
|
|
290
|
-
const event = createDocsTelemetryEvent(config, {
|
|
291
|
-
type: "mcp_tool_used",
|
|
292
|
-
properties: {
|
|
293
|
-
tool: context.tool,
|
|
294
|
-
locale: context.locale,
|
|
295
|
-
resultCount: context.resultCount
|
|
296
|
-
}
|
|
297
|
-
}, context);
|
|
298
|
-
if (!event) return;
|
|
299
|
-
emitDocsTelemetryEvent(config.telemetry, event);
|
|
300
|
-
}
|
|
301
|
-
function inferDocsTelemetryAgentSurface(request, options) {
|
|
302
|
-
const url = new URL(request.url);
|
|
303
|
-
const method = request.method.toUpperCase();
|
|
304
|
-
const feedbackRequest = resolveDocsAgentFeedbackRequest(url, resolveDocsAgentFeedbackConfig(options.feedback));
|
|
305
|
-
if ((method === "GET" || method === "HEAD") && isDocsAgentDiscoveryRequest(url)) return "agent_spec";
|
|
306
|
-
if ((method === "GET" || method === "HEAD") && feedbackRequest?.kind === "schema") return "agent_feedback_schema";
|
|
307
|
-
if (method === "POST" && feedbackRequest?.kind === "submit") return "agent_feedback_submit";
|
|
308
|
-
if (method === "GET" || method === "HEAD") {
|
|
309
|
-
if (isDocsContentChangesRequest(url)) return "content_changes";
|
|
310
|
-
if (isDocsAgentsRequest(url) || resolveDocsAgentsFormat(url) === "agents") return "agents";
|
|
311
|
-
if (isDocsSkillRequest(url) || resolveDocsSkillFormat(url) === "skill") return "skill";
|
|
312
|
-
if (resolveDocsMarkdownRequest(options.entry, url, request)) return "markdown";
|
|
313
|
-
if (resolveDocsLlmsTxtRequest(url, options.llmsTxt, options.entry)) return "llms";
|
|
314
|
-
}
|
|
315
|
-
if (method === "POST") return "ask_ai";
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
//#endregion
|
|
319
7
|
//#region src/agent-provenance.ts
|
|
320
8
|
const GENERATED_AGENT_PROVENANCE_MARKER = "@farming-labs/docs:generated";
|
|
321
9
|
const GENERATED_AGENT_PROVENANCE_VERSION = 1;
|
|
@@ -735,4 +423,4 @@ function resolveDocsOpenApiMcpBaseUrl(document, config) {
|
|
|
735
423
|
}
|
|
736
424
|
|
|
737
425
|
//#endregion
|
|
738
|
-
export {
|
|
426
|
+
export { DEFAULT_DOCS_CONTENT_CHANGE_HYDRATION_TOKEN_BUDGET as a, MIN_DOCS_CONTENT_CHANGE_HYDRATION_TOKEN_BUDGET as c, GENERATED_AGENT_PROVENANCE_VERSION as d, hashGeneratedAgentContent as f, stripGeneratedAgentProvenance as g, serializeGeneratedAgentDocument as h, resolveDocsOpenApiMcpOperations as i, hydrateDocsContentChanges as l, parseGeneratedAgentDocument as m, readDocsOpenApiMcpResponse as n, DOCS_CONTENT_CHANGE_HYDRATION_FORMAT as o, normalizeGeneratedAgentContent as p, resolveDocsOpenApiMcpBaseUrl as r, MAX_DOCS_CONTENT_CHANGE_HYDRATION_TOKEN_BUDGET as s, acquireDocsOpenApiMcpBudget as t, GENERATED_AGENT_PROVENANCE_MARKER as u };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import "./
|
|
1
|
+
import "./http-body-DkAPk6D5.mjs";
|
|
2
|
+
import "./markdown-sections-9Oxr33b-.mjs";
|
|
3
|
+
import "./agent-DkAidqtV.mjs";
|
|
4
|
+
import "./standards-discovery-sSEojU80.mjs";
|
|
4
5
|
import { n as buildNormalizedOpenApiModel } from "./openapi-operations-DFpaqOqA.mjs";
|
|
5
|
-
import "./api-reference-
|
|
6
|
-
import { n as loadOpenApiCliSource, t as displayOpenApiCliSource } from "./openapi-source-
|
|
6
|
+
import "./api-reference-By_LokQ-.mjs";
|
|
7
|
+
import { n as loadOpenApiCliSource, t as displayOpenApiCliSource } from "./openapi-source-CiX3hwFp.mjs";
|
|
7
8
|
import { existsSync, mkdirSync, readFileSync, realpathSync, writeFileSync } from "node:fs";
|
|
8
9
|
import path from "node:path";
|
|
9
10
|
import pc from "picocolors";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as loadApiReferenceOpenApiDocumentAsync } from "./api-reference-
|
|
1
|
+
import { d as loadApiReferenceOpenApiDocumentAsync } from "./api-reference-By_LokQ-.mjs";
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as detectPackageManagerFromProject, l as formatPackageManagerDetection, t as detectFramework, u as installCommand } from "./utils-
|
|
1
|
+
import { i as detectPackageManagerFromProject, l as formatPackageManagerDetection, t as detectFramework, u as installCommand } from "./utils-C7KDrPpA.mjs";
|
|
2
2
|
import pc from "picocolors";
|
|
3
3
|
import * as p from "@clack/prompts";
|
|
4
4
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { At as DEFAULT_SITEMAP_MD_ROUTE,
|
|
2
|
-
import { C as DOCS_AGENT_MANIFEST_SCHEMA_MEDIA_TYPE, S as DOCS_AGENT_MANIFEST_FORMAT, T as DOCS_AGENT_MANIFEST_VERSION, f as DEFAULT_AGENT_SKILLS_ROUTE_PREFIX, n as API_CATALOG_MEDIA_TYPE, r as API_CATALOG_PROFILE_URI, t as AGENT_SKILLS_DISCOVERY_SCHEMA_URI, u as DEFAULT_AGENT_SKILLS_INDEX_ROUTE, v as DEFAULT_API_CATALOG_ROUTE, w as DOCS_AGENT_MANIFEST_SCHEMA_URI } from "./standards-discovery-
|
|
1
|
+
import { At as DEFAULT_SITEMAP_MD_ROUTE, Gn as DEFAULT_MCP_WELL_KNOWN_ROUTE, Mt as DEFAULT_SITEMAP_XML_ROUTE, c as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, f as DEFAULT_DOCS_CONFIG_ROUTE, h as DEFAULT_LLMS_FULL_TXT_ROUTE, i as DEFAULT_AGENT_FEEDBACK_ROUTE, m as DEFAULT_DOCS_DIAGNOSTICS_ROUTE, t as DEFAULT_AGENTS_MD_ROUTE, v as DEFAULT_LLMS_TXT_ROUTE, x as DEFAULT_SKILL_MD_ROUTE } from "./agent-DkAidqtV.mjs";
|
|
2
|
+
import { C as DOCS_AGENT_MANIFEST_SCHEMA_MEDIA_TYPE, S as DOCS_AGENT_MANIFEST_FORMAT, T as DOCS_AGENT_MANIFEST_VERSION, f as DEFAULT_AGENT_SKILLS_ROUTE_PREFIX, n as API_CATALOG_MEDIA_TYPE, r as API_CATALOG_PROFILE_URI, t as AGENT_SKILLS_DISCOVERY_SCHEMA_URI, u as DEFAULT_AGENT_SKILLS_INDEX_ROUTE, v as DEFAULT_API_CATALOG_ROUTE, w as DOCS_AGENT_MANIFEST_SCHEMA_URI } from "./standards-discovery-sSEojU80.mjs";
|
|
3
3
|
import { isDocsAgentSkillName, validateDocsAgentSkillFrontmatter } from "./agent-skills-spec.mjs";
|
|
4
|
-
import { n as DEFAULT_ROBOTS_TXT_ROUTE } from "./robots-
|
|
4
|
+
import { n as DEFAULT_ROBOTS_TXT_ROUTE } from "./robots-BYJAVeI6.mjs";
|
|
5
5
|
import matter from "gray-matter";
|
|
6
6
|
|
|
7
7
|
//#region src/define-docs.ts
|
|
@@ -86,6 +86,22 @@ function resolveChangelogConfig(value) {
|
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region src/date.ts
|
|
91
|
+
const DATE_ONLY_PATTERN = /^\d{4}-\d{2}-\d{2}$/;
|
|
92
|
+
/** Formats docs timestamps without allowing the deployment timezone to change the calendar day. */
|
|
93
|
+
function formatDocsLastModifiedDate(value) {
|
|
94
|
+
const normalized = typeof value === "string" && DATE_ONLY_PATTERN.test(value) ? `${value}T00:00:00.000Z` : value;
|
|
95
|
+
const date = normalized instanceof Date ? normalized : new Date(normalized);
|
|
96
|
+
if (Number.isNaN(date.getTime())) return void 0;
|
|
97
|
+
return date.toLocaleDateString("en-US", {
|
|
98
|
+
year: "numeric",
|
|
99
|
+
month: "long",
|
|
100
|
+
day: "numeric",
|
|
101
|
+
timeZone: "UTC"
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
89
105
|
//#endregion
|
|
90
106
|
//#region src/utils.ts
|
|
91
107
|
/**
|
|
@@ -1063,4 +1079,4 @@ function isolateDocsMarkdownPromptReferences(root, value) {
|
|
|
1063
1079
|
}
|
|
1064
1080
|
|
|
1065
1081
|
//#endregion
|
|
1066
|
-
export {
|
|
1082
|
+
export { formatDocsLastModifiedDate as _, resolveReadingTimeFromContent as a, DOCS_AGENT_CONTRACT_VERSION as c, httpLinkHeaderHasTargetRelation as d, AGENT_SKILL_ARCHIVE_MAX_UNCOMPRESSED_BYTES as f, deepMerge as g, extendTheme as h, resolvePageReadingTime as i, createDocsAgentContractCases as l, createTheme as m, encodeDocsHeadingTocUrls as n, resolveReadingTimeFromSource as o, readAgentSkillDocumentFromTar as p, estimateReadingTimeMinutes as r, resolveReadingTimeOptions as s, isolateDocsMarkdownPromptReferences as t, runDocsAgentConformance as u, resolveChangelogConfig as v, defineDocs as y };
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { Rt as resolveDocsSitemapConfig } from "./agent-CEZCaYto.mjs";
|
|
2
1
|
import { createRequire } from "node:module";
|
|
3
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
4
|
-
import path from "node:path";
|
|
5
2
|
|
|
6
3
|
//#region src/code-group-mdx.ts
|
|
7
4
|
const codeGroupTitleAttributes = [
|
|
@@ -219,17 +216,4 @@ function sanitizePromptText(text) {
|
|
|
219
216
|
}
|
|
220
217
|
|
|
221
218
|
//#endregion
|
|
222
|
-
|
|
223
|
-
function readDocsSitemapManifest(rootDir, sitemap) {
|
|
224
|
-
const resolved = resolveDocsSitemapConfig(sitemap);
|
|
225
|
-
const manifestPath = path.resolve(rootDir, resolved.manifestPath);
|
|
226
|
-
if (!existsSync(manifestPath)) return null;
|
|
227
|
-
try {
|
|
228
|
-
return JSON.parse(readFileSync(manifestPath, "utf-8"));
|
|
229
|
-
} catch {
|
|
230
|
-
return null;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
//#endregion
|
|
235
|
-
export { DEFAULT_PROMPT_PROVIDER_TEMPLATES as a, resolvePromptProviderChoices as c, serializeDocsIconRegistry as d, serializeOpenDocsProvider as f, DEFAULT_OPEN_DOCS_TARGET as i, sanitizePromptText as l, remarkCodeGroup as m, DEFAULT_OPEN_DOCS_PROMPT as n, normalizePromptProviderName as o, serializeOpenDocsProviders as p, DEFAULT_OPEN_DOCS_PROVIDER_IDS as r, parsePromptStringArray as s, readDocsSitemapManifest as t, serializeDocsIcon as u };
|
|
219
|
+
export { normalizePromptProviderName as a, sanitizePromptText as c, serializeOpenDocsProvider as d, serializeOpenDocsProviders as f, DEFAULT_PROMPT_PROVIDER_TEMPLATES as i, serializeDocsIcon as l, DEFAULT_OPEN_DOCS_PROVIDER_IDS as n, parsePromptStringArray as o, remarkCodeGroup as p, DEFAULT_OPEN_DOCS_TARGET as r, resolvePromptProviderChoices as s, DEFAULT_OPEN_DOCS_PROMPT as t, serializeDocsIconRegistry as u };
|