@farming-labs/docs 0.2.128 → 0.2.129

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.
@@ -15,5 +15,11 @@ declare const bundledAgentSkills: readonly DocsPublishedAgentSkill[] | undefined
15
15
  * `bundledAgentSkills`; consumers fall back to the filesystem when undefined.
16
16
  */
17
17
  declare const bundledRootDocuments: Readonly<Record<string, string>> | undefined;
18
+ /**
19
+ * Build-time snapshot of the app's `package.json` version, reported as the MCP
20
+ * server version when `mcp.version` is not set. A deployed function usually has
21
+ * no `package.json` beside it; consumers read the file when this is undefined.
22
+ */
23
+ declare const bundledAppVersion: string | undefined;
18
24
  //#endregion
19
- export { bundledAgentSkills, bundledRootDocuments };
25
+ export { bundledAgentSkills, bundledAppVersion, bundledRootDocuments };
@@ -13,6 +13,12 @@ const bundledAgentSkills = void 0;
13
13
  * `bundledAgentSkills`; consumers fall back to the filesystem when undefined.
14
14
  */
15
15
  const bundledRootDocuments = void 0;
16
+ /**
17
+ * Build-time snapshot of the app's `package.json` version, reported as the MCP
18
+ * server version when `mcp.version` is not set. A deployed function usually has
19
+ * no `package.json` beside it; consumers read the file when this is undefined.
20
+ */
21
+ const bundledAppVersion = void 0;
16
22
 
17
23
  //#endregion
18
- export { bundledAgentSkills, bundledRootDocuments };
24
+ export { bundledAgentSkills, bundledAppVersion, bundledRootDocuments };
@@ -19,7 +19,7 @@ interface DocsAgentSkillsBuildPlugin {
19
19
  load(id: string): Promise<string | undefined>;
20
20
  }
21
21
  /** Render a self-contained virtual module without relying on Node at runtime. */
22
- declare function renderDocsAgentSkillsBundle(skills: readonly DocsPublishedAgentSkill[], rootDocuments?: Readonly<Record<string, string>>): string;
22
+ declare function renderDocsAgentSkillsBundle(skills: readonly DocsPublishedAgentSkill[], rootDocuments?: Readonly<Record<string, string>>, appVersion?: string): string;
23
23
  /**
24
24
  * Snapshot configured Agent Skills into the server bundle.
25
25
  *
@@ -25,7 +25,7 @@ function serializeSnapshotLiteral(value) {
25
25
  return JSON.stringify(value).replaceAll("\u2028", "\\u2028").replaceAll("\u2029", "\\u2029");
26
26
  }
27
27
  /** Render a self-contained virtual module without relying on Node at runtime. */
28
- function renderDocsAgentSkillsBundle(skills, rootDocuments) {
28
+ function renderDocsAgentSkillsBundle(skills, rootDocuments, appVersion) {
29
29
  return `const snapshot = ${serializeSnapshotLiteral(skills.map(serializeSkill))};
30
30
  function decodeBase64(value) {
31
31
  const binary = globalThis.atob(value);
@@ -42,6 +42,7 @@ export const bundledAgentSkills = snapshot.map((skill) => ({
42
42
  files: skill.files.map((file) => ({ ...file, content: hydrateContent(file.content) })),
43
43
  }));
44
44
  export const bundledRootDocuments = ${rootDocuments ? serializeSnapshotLiteral(rootDocuments) : "undefined"};
45
+ export const bundledAppVersion = ${appVersion ? serializeSnapshotLiteral(appVersion) : "undefined"};
45
46
  `;
46
47
  }
47
48
  /**
@@ -0,0 +1,10 @@
1
+ //#region src/app-version.d.ts
2
+ /**
3
+ * The `version` field of the app's `package.json`, which adapters report as the
4
+ * MCP server version when `mcp.version` is not set. Returns `undefined` when the
5
+ * file is missing (a deployed function often ships without it), unreadable, or
6
+ * has no usable version, so callers fall back instead of failing to start.
7
+ */
8
+ declare function readDocsAppVersion(rootDir: string): string | undefined;
9
+ //#endregion
10
+ export { readDocsAppVersion };
@@ -0,0 +1,30 @@
1
+ import { readFileSync } from "node:fs";
2
+ import path from "node:path";
3
+
4
+ //#region src/app-version.ts
5
+ /**
6
+ * The `version` field of the app's `package.json`, which adapters report as the
7
+ * MCP server version when `mcp.version` is not set. Returns `undefined` when the
8
+ * file is missing (a deployed function often ships without it), unreadable, or
9
+ * has no usable version, so callers fall back instead of failing to start.
10
+ */
11
+ function readDocsAppVersion(rootDir) {
12
+ try {
13
+ const manifestPath = path.join(
14
+ /* turbopackIgnore: true */
15
+ rootDir,
16
+ "package.json"
17
+ );
18
+ const version = JSON.parse(readFileSync(
19
+ /* turbopackIgnore: true */
20
+ manifestPath,
21
+ "utf8"
22
+ ))?.version;
23
+ return typeof version === "string" && version.trim() ? version.trim() : void 0;
24
+ } catch {
25
+ return;
26
+ }
27
+ }
28
+
29
+ //#endregion
30
+ export { readDocsAppVersion };
package/dist/audience.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  import { createDocsMarkdownParser } from "./markdown-parser.mjs";
2
+ import { createDocsTextTransformCache } from "./text-transform-cache.mjs";
2
3
  import { resolveDocsAudienceExposure } from "./audience-exposure.mjs";
3
4
 
4
5
  //#region src/audience.ts
@@ -8,6 +9,10 @@ const DOCS_AUDIENCE_TAG_NAMES = [
8
9
  "Human"
9
10
  ];
10
11
  const DOCS_AUDIENCE_TAG_CANDIDATE_PATTERN = /<\/?(?:Audience|Agent|Human)(?=[\s/>])/;
12
+ const audienceContentCaches = {
13
+ human: createDocsTextTransformCache(),
14
+ agent: createDocsTextTransformCache()
15
+ };
11
16
  function parseAudienceOnly(attributes) {
12
17
  if (/\{\s*\.\.\./.test(attributes)) return void 0;
13
18
  const value = attributes.match(/(?:^|\s)only\s*=\s*(?:"(human|agent)"|'(human|agent)'|\{\s*"(human|agent)"\s*\}|\{\s*'(human|agent)'\s*\})/)?.slice(1).find(Boolean);
@@ -1616,6 +1621,10 @@ function findDocsAudienceMdxIssues(content) {
1616
1621
  * These primitives shape content for each surface; they are not an access-control boundary.
1617
1622
  */
1618
1623
  function resolveDocsAudienceMdxContent(content, audience) {
1624
+ if (!DOCS_AUDIENCE_TAG_CANDIDATE_PATTERN.test(content)) return content;
1625
+ const cache = audienceContentCaches[audience];
1626
+ const cached = cache.get(content);
1627
+ if (cached !== void 0) return cached;
1619
1628
  const scopes = [];
1620
1629
  let output = "";
1621
1630
  let cursor = 0;
@@ -1643,7 +1652,9 @@ function resolveDocsAudienceMdxContent(content, audience) {
1643
1652
  if (tag.expression && visibleBeforeTag) output += isAudienceVisible(scopes, audience) ? "<>" : tag.jsxChild ? "{null}" : "null";
1644
1653
  }
1645
1654
  if (isAudienceVisible(scopes, audience)) output += content.slice(cursor);
1646
- return resolvedTag ? normalizeProjectedWhitespace(output) : content;
1655
+ const result = resolvedTag ? normalizeProjectedWhitespace(output) : content;
1656
+ cache.set(content, result);
1657
+ return result;
1647
1658
  }
1648
1659
  /** Backwards-compatible name retained for existing integrations. */
1649
1660
  function resolveDocsAgentMdxContent(content, audience) {
package/dist/build.d.mts CHANGED
@@ -4,5 +4,6 @@ import { resolveConfiguredAgentSkillsSync } from "./agent-skills-server.mjs";
4
4
  import { renderDocsAgentSkillsBundle } from "./agent-skills-vite.mjs";
5
5
  import { DOCS_AI_AGENT_USER_AGENT_HEADER_PATTERN, DOCS_BOT_LIKE_USER_AGENT_HEADER_PATTERN, DOCS_TRADITIONAL_BOT_USER_AGENT_HEADER_PATTERN } from "./agent-detection.mjs";
6
6
  import { ensureDocsReviewWorkflow } from "./review.mjs";
7
+ import { readDocsAppVersion } from "./app-version.mjs";
7
8
  import { loadDocsConfigModule } from "./cli/config.mjs";
8
- export { DEFAULT_A2A_AGENT_CARD_ROUTE, DEFAULT_AGENT_SKILLS_INDEX_ROUTE, DEFAULT_AGENT_SKILLS_ROUTE_PREFIX, DEFAULT_AGENT_SKILL_ARCHIVE_FORMAT, DEFAULT_API_CATALOG_ROUTE, DEFAULT_LEGACY_SKILLS_INDEX_ROUTE, DEFAULT_LEGACY_SKILLS_ROUTE_PREFIX, DOCS_AI_AGENT_USER_AGENT_HEADER_PATTERN, DOCS_BOT_LIKE_USER_AGENT_HEADER_PATTERN, DOCS_TRADITIONAL_BOT_USER_AGENT_HEADER_PATTERN, type DocsConfig, ensureDocsReviewWorkflow, loadDocsConfigModule, renderDocsAgentSkillsBundle, resolveConfiguredAgentSkillsSync };
9
+ export { DEFAULT_A2A_AGENT_CARD_ROUTE, DEFAULT_AGENT_SKILLS_INDEX_ROUTE, DEFAULT_AGENT_SKILLS_ROUTE_PREFIX, DEFAULT_AGENT_SKILL_ARCHIVE_FORMAT, DEFAULT_API_CATALOG_ROUTE, DEFAULT_LEGACY_SKILLS_INDEX_ROUTE, DEFAULT_LEGACY_SKILLS_ROUTE_PREFIX, DOCS_AI_AGENT_USER_AGENT_HEADER_PATTERN, DOCS_BOT_LIKE_USER_AGENT_HEADER_PATTERN, DOCS_TRADITIONAL_BOT_USER_AGENT_HEADER_PATTERN, type DocsConfig, ensureDocsReviewWorkflow, loadDocsConfigModule, readDocsAppVersion, renderDocsAgentSkillsBundle, resolveConfiguredAgentSkillsSync };
package/dist/build.mjs CHANGED
@@ -3,6 +3,7 @@ import { DEFAULT_A2A_AGENT_CARD_ROUTE, DEFAULT_AGENT_SKILLS_INDEX_ROUTE, DEFAULT
3
3
  import { resolveConfiguredAgentSkillsSync } from "./agent-skills-server.mjs";
4
4
  import { ensureDocsReviewWorkflow } from "./review.mjs";
5
5
  import { renderDocsAgentSkillsBundle } from "./agent-skills-vite.mjs";
6
+ import { readDocsAppVersion } from "./app-version.mjs";
6
7
  import { loadDocsConfigModule } from "./cli/config.mjs";
7
8
 
8
- export { DEFAULT_A2A_AGENT_CARD_ROUTE, DEFAULT_AGENT_SKILLS_INDEX_ROUTE, DEFAULT_AGENT_SKILLS_ROUTE_PREFIX, DEFAULT_AGENT_SKILL_ARCHIVE_FORMAT, DEFAULT_API_CATALOG_ROUTE, DEFAULT_LEGACY_SKILLS_INDEX_ROUTE, DEFAULT_LEGACY_SKILLS_ROUTE_PREFIX, DOCS_AI_AGENT_USER_AGENT_HEADER_PATTERN, DOCS_BOT_LIKE_USER_AGENT_HEADER_PATTERN, DOCS_TRADITIONAL_BOT_USER_AGENT_HEADER_PATTERN, ensureDocsReviewWorkflow, loadDocsConfigModule, renderDocsAgentSkillsBundle, resolveConfiguredAgentSkillsSync };
9
+ export { DEFAULT_A2A_AGENT_CARD_ROUTE, DEFAULT_AGENT_SKILLS_INDEX_ROUTE, DEFAULT_AGENT_SKILLS_ROUTE_PREFIX, DEFAULT_AGENT_SKILL_ARCHIVE_FORMAT, DEFAULT_API_CATALOG_ROUTE, DEFAULT_LEGACY_SKILLS_INDEX_ROUTE, DEFAULT_LEGACY_SKILLS_ROUTE_PREFIX, DOCS_AI_AGENT_USER_AGENT_HEADER_PATTERN, DOCS_BOT_LIKE_USER_AGENT_HEADER_PATTERN, DOCS_TRADITIONAL_BOT_USER_AGENT_HEADER_PATTERN, ensureDocsReviewWorkflow, loadDocsConfigModule, readDocsAppVersion, renderDocsAgentSkillsBundle, resolveConfiguredAgentSkillsSync };
package/dist/cli/mcp.mjs CHANGED
@@ -3,6 +3,7 @@ import { resolveDocsMetadataBaseUrl } from "../metadata.mjs";
3
3
  import { buildApiReferenceOperationPagesAsync } from "../api-reference.mjs";
4
4
  import { resolveConfiguredAgentSkills } from "../agent-skills-server.mjs";
5
5
  import { createFilesystemDocsMcpSource, resolveDocsMcpConfig, runDocsMcpStdio } from "../mcp.mjs";
6
+ import { readDocsAppVersion } from "../app-version.mjs";
6
7
  import { extractNestedObjectLiteral, extractObjectLiteral, hasTopLevelProperty, loadDocsConfigModuleResult, readBooleanProperty, readNavTitle, readStringProperty, resolveDocsConfigPath, resolveDocsContentDir } from "./config.mjs";
7
8
  import { detectFramework } from "./utils.mjs";
8
9
  import { existsSync, readFileSync } from "node:fs";
@@ -46,7 +47,11 @@ async function runMcp(options = {}) {
46
47
  siteTitle: navTitle ?? "Documentation",
47
48
  baseUrl: loadedConfig ? resolveDocsMetadataBaseUrl(loadedConfig) : void 0
48
49
  });
49
- const resolvedMcp = resolveDocsMcpConfig(mcp ?? true, { defaultName: navTitle ?? "@farming-labs/docs" });
50
+ const appVersion = readDocsAppVersion(rootDir);
51
+ const resolvedMcp = resolveDocsMcpConfig(mcp ?? true, {
52
+ defaultName: navTitle ?? "@farming-labs/docs",
53
+ defaultVersion: appVersion
54
+ });
50
55
  const source = {
51
56
  ...filesystemSource,
52
57
  async getSkills() {
@@ -70,7 +75,8 @@ async function runMcp(options = {}) {
70
75
  mcp: resolvedMcp,
71
76
  contentChanges: loadedConfig?.agent?.contentChanges,
72
77
  evaluations: loadedConfig?.agent?.evaluations,
73
- defaultName: navTitle ?? "@farming-labs/docs"
78
+ defaultName: navTitle ?? "@farming-labs/docs",
79
+ defaultVersion: appVersion
74
80
  });
75
81
  }
76
82
  function normalizeApiBaseUrl(value) {
@@ -0,0 +1,47 @@
1
+ //#region src/mcp-server-card.d.ts
2
+ /**
3
+ * MCP server cards (SEP-2127): a small JSON document served at
4
+ * `<streamable-http-url>/server-card` that names the server and its endpoint, so a
5
+ * client can discover it from the URL alone. The card carries identity only, never
6
+ * tools or resources, so it reveals nothing the endpoint does not already answer.
7
+ */
8
+ declare const DOCS_MCP_SERVER_CARD_SUFFIX = "/server-card";
9
+ interface DocsMcpServerCard {
10
+ $schema: string;
11
+ name: string;
12
+ version: string;
13
+ description: string;
14
+ title?: string;
15
+ websiteUrl?: string;
16
+ remotes: Array<{
17
+ type: "streamable-http";
18
+ url: string;
19
+ supportedProtocolVersions: string[];
20
+ }>;
21
+ }
22
+ interface CreateDocsMcpServerCardOptions {
23
+ /** Absolute URL of the Streamable HTTP endpoint the card describes. */
24
+ endpointUrl: string;
25
+ /** The MCP server name reported in `serverInfo`. */
26
+ name: string;
27
+ /** The MCP server version reported in `serverInfo`. */
28
+ version: string;
29
+ /** What the server offers; the card keeps the first 100 characters. */
30
+ description?: string;
31
+ /** Documentation site the server reads from. */
32
+ websiteUrl?: string;
33
+ }
34
+ /**
35
+ * Build the server card for a docs MCP endpoint. The card's `name` must be
36
+ * reverse-DNS, so a plain server name such as a site title becomes the
37
+ * card's `title` and the name is namespaced by the endpoint's host.
38
+ */
39
+ declare function createDocsMcpServerCard(options: CreateDocsMcpServerCardOptions): DocsMcpServerCard;
40
+ /**
41
+ * Answer a request for a server card: public, read-only metadata with CORS for
42
+ * any origin and an ETag. The body names the request's origin, so caches
43
+ * revalidate instead of reusing it.
44
+ */
45
+ declare function createDocsMcpServerCardResponse(request: Request, card: DocsMcpServerCard): Response;
46
+ //#endregion
47
+ export { CreateDocsMcpServerCardOptions, DOCS_MCP_SERVER_CARD_SUFFIX, DocsMcpServerCard, createDocsMcpServerCard, createDocsMcpServerCardResponse };
@@ -0,0 +1,83 @@
1
+ import { createDocsCacheableResponse } from "./http-cache.mjs";
2
+ import { SUPPORTED_PROTOCOL_VERSIONS } from "@modelcontextprotocol/server";
3
+
4
+ //#region src/mcp-server-card.ts
5
+ /**
6
+ * MCP server cards (SEP-2127): a small JSON document served at
7
+ * `<streamable-http-url>/server-card` that names the server and its endpoint, so a
8
+ * client can discover it from the URL alone. The card carries identity only, never
9
+ * tools or resources, so it reveals nothing the endpoint does not already answer.
10
+ */
11
+ const DOCS_MCP_SERVER_CARD_SUFFIX = "/server-card";
12
+ const SERVER_CARD_SCHEMA = "https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json";
13
+ const SERVER_CARD_CONTENT_TYPE = "application/mcp-server-card+json; charset=utf-8";
14
+ const CARD_DESCRIPTION_MAX = 100;
15
+ const REVERSE_DNS_NAME = /^[a-zA-Z0-9.-]+\/[a-zA-Z0-9._-]+$/;
16
+ function cardNamespace(host) {
17
+ if (host.includes(":") || /^\d+(?:\.\d+){3}$/.test(host)) return "local";
18
+ return host.split(".").reverse().join(".");
19
+ }
20
+ function truncateDescription(text) {
21
+ return text.length <= CARD_DESCRIPTION_MAX ? text : `${text.slice(0, CARD_DESCRIPTION_MAX - 1).trimEnd()}…`;
22
+ }
23
+ /**
24
+ * Build the server card for a docs MCP endpoint. The card's `name` must be
25
+ * reverse-DNS, so a plain server name such as a site title becomes the
26
+ * card's `title` and the name is namespaced by the endpoint's host.
27
+ */
28
+ function createDocsMcpServerCard(options) {
29
+ const endpoint = new URL(options.endpointUrl);
30
+ const reverseDns = REVERSE_DNS_NAME.test(options.name);
31
+ const description = truncateDescription(options.description?.trim() || `Search and read the ${options.name} documentation.`);
32
+ return {
33
+ $schema: SERVER_CARD_SCHEMA,
34
+ name: reverseDns ? options.name : `${cardNamespace(endpoint.hostname)}/docs`,
35
+ version: options.version,
36
+ description,
37
+ ...reverseDns ? {} : { title: options.name },
38
+ ...options.websiteUrl ? { websiteUrl: options.websiteUrl } : {},
39
+ remotes: [{
40
+ type: "streamable-http",
41
+ url: endpoint.href,
42
+ supportedProtocolVersions: [...SUPPORTED_PROTOCOL_VERSIONS]
43
+ }]
44
+ };
45
+ }
46
+ const SERVER_CARD_CORS_HEADERS = Object.freeze({
47
+ "Access-Control-Allow-Origin": "*",
48
+ "Access-Control-Allow-Methods": "GET, HEAD, OPTIONS",
49
+ "Access-Control-Allow-Headers": "Content-Type, If-None-Match"
50
+ });
51
+ /**
52
+ * Answer a request for a server card: public, read-only metadata with CORS for
53
+ * any origin and an ETag. The body names the request's origin, so caches
54
+ * revalidate instead of reusing it.
55
+ */
56
+ function createDocsMcpServerCardResponse(request, card) {
57
+ const method = request.method.toUpperCase();
58
+ if (method === "OPTIONS") return new Response(null, {
59
+ status: 204,
60
+ headers: SERVER_CARD_CORS_HEADERS
61
+ });
62
+ if (method !== "GET" && method !== "HEAD") return new Response("Method Not Allowed", {
63
+ status: 405,
64
+ headers: {
65
+ ...SERVER_CARD_CORS_HEADERS,
66
+ Allow: "GET, HEAD, OPTIONS",
67
+ "Content-Type": "text/plain; charset=utf-8"
68
+ }
69
+ });
70
+ return createDocsCacheableResponse({
71
+ request,
72
+ content: JSON.stringify(card),
73
+ headers: {
74
+ ...SERVER_CARD_CORS_HEADERS,
75
+ "Content-Type": SERVER_CARD_CONTENT_TYPE,
76
+ "Cache-Control": "public, max-age=0, must-revalidate",
77
+ "X-Content-Type-Options": "nosniff"
78
+ }
79
+ });
80
+ }
81
+
82
+ //#endregion
83
+ export { DOCS_MCP_SERVER_CARD_SUFFIX, createDocsMcpServerCard, createDocsMcpServerCardResponse };
package/dist/mcp.mjs CHANGED
@@ -1679,7 +1679,7 @@ const DOCS_CONFIG_SCHEMA_OPTIONS_TEMPLATE = [
1679
1679
  path: "mcp.version",
1680
1680
  name: "version",
1681
1681
  type: "string",
1682
- default: "0.0.0",
1682
+ default: "package.json version or 0.0.0",
1683
1683
  description: "Version string reported to MCP clients."
1684
1684
  },
1685
1685
  {
@@ -1,5 +1,6 @@
1
1
  import { resolveConfiguredAgentSkills } from "./agent-skills-server.mjs";
2
+ import { readDocsAppVersion } from "./app-version.mjs";
2
3
  import { DocsMcpPage, createDocsMcpHttpHandler, createFilesystemDocsMcpSource, resolveDocsMcpConfig } from "./mcp.mjs";
3
4
  import { buildApiReferenceHtmlDocumentAsync, buildApiReferenceOpenApiDocumentAsync, buildApiReferenceOperationPagesAsync, buildApiReferencePageTitle, buildApiReferenceScalarCss, createApiReferenceOperationMarkdownResponse, resolveApiReferenceConfig, resolveApiReferenceOpenApiDiscovery, resolveApiReferenceRenderer, resolveApiReferenceVersion, resolveApiReferenceVersionFromPathname } from "./api-reference.mjs";
4
5
  import { readDocsSitemapManifest } from "./sitemap-server.mjs";
5
- export { type DocsMcpPage, buildApiReferenceHtmlDocumentAsync, buildApiReferenceOpenApiDocumentAsync, buildApiReferenceOperationPagesAsync, buildApiReferencePageTitle, buildApiReferenceScalarCss, createApiReferenceOperationMarkdownResponse, createDocsMcpHttpHandler, createFilesystemDocsMcpSource, readDocsSitemapManifest, resolveApiReferenceConfig, resolveApiReferenceOpenApiDiscovery, resolveApiReferenceRenderer, resolveApiReferenceVersion, resolveApiReferenceVersionFromPathname, resolveConfiguredAgentSkills, resolveDocsMcpConfig };
6
+ export { type DocsMcpPage, buildApiReferenceHtmlDocumentAsync, buildApiReferenceOpenApiDocumentAsync, buildApiReferenceOperationPagesAsync, buildApiReferencePageTitle, buildApiReferenceScalarCss, createApiReferenceOperationMarkdownResponse, createDocsMcpHttpHandler, createFilesystemDocsMcpSource, readDocsAppVersion, readDocsSitemapManifest, resolveApiReferenceConfig, resolveApiReferenceOpenApiDiscovery, resolveApiReferenceRenderer, resolveApiReferenceVersion, resolveApiReferenceVersionFromPathname, resolveConfiguredAgentSkills, resolveDocsMcpConfig };
package/dist/runtime.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import { buildApiReferenceHtmlDocumentAsync, buildApiReferenceOpenApiDocumentAsync, buildApiReferenceOperationPagesAsync, buildApiReferencePageTitle, buildApiReferenceScalarCss, createApiReferenceOperationMarkdownResponse, resolveApiReferenceConfig, resolveApiReferenceOpenApiDiscovery, resolveApiReferenceRenderer, resolveApiReferenceVersion, resolveApiReferenceVersionFromPathname } from "./api-reference.mjs";
2
2
  import { resolveConfiguredAgentSkills } from "./agent-skills-server.mjs";
3
3
  import { createDocsMcpHttpHandler, createFilesystemDocsMcpSource, resolveDocsMcpConfig } from "./mcp.mjs";
4
+ import { readDocsAppVersion } from "./app-version.mjs";
4
5
  import { readDocsSitemapManifest } from "./sitemap-server.mjs";
5
6
 
6
- export { buildApiReferenceHtmlDocumentAsync, buildApiReferenceOpenApiDocumentAsync, buildApiReferenceOperationPagesAsync, buildApiReferencePageTitle, buildApiReferenceScalarCss, createApiReferenceOperationMarkdownResponse, createDocsMcpHttpHandler, createFilesystemDocsMcpSource, readDocsSitemapManifest, resolveApiReferenceConfig, resolveApiReferenceOpenApiDiscovery, resolveApiReferenceRenderer, resolveApiReferenceVersion, resolveApiReferenceVersionFromPathname, resolveConfiguredAgentSkills, resolveDocsMcpConfig };
7
+ export { buildApiReferenceHtmlDocumentAsync, buildApiReferenceOpenApiDocumentAsync, buildApiReferenceOperationPagesAsync, buildApiReferencePageTitle, buildApiReferenceScalarCss, createApiReferenceOperationMarkdownResponse, createDocsMcpHttpHandler, createFilesystemDocsMcpSource, readDocsAppVersion, readDocsSitemapManifest, resolveApiReferenceConfig, resolveApiReferenceOpenApiDiscovery, resolveApiReferenceRenderer, resolveApiReferenceVersion, resolveApiReferenceVersionFromPathname, resolveConfiguredAgentSkills, resolveDocsMcpConfig };
package/dist/server.d.mts CHANGED
@@ -3,6 +3,7 @@ import { ResolveConfiguredAgentSkillsOptions, resolveConfiguredAgentSkills, reso
3
3
  import { renderDocsAgentSkillsBundle } from "./agent-skills-vite.mjs";
4
4
  import { DOCS_AGENT_TRACE_EVENT_TYPES, DocsAgentTraceContext, ResolvedDocsAnalyticsConfig, ResolvedDocsObservabilityConfig, createDocsAgentTraceContext, createDocsAgentTraceId, emitDocsAgentTraceEvent, emitDocsAnalyticsEvent, emitDocsObservabilityEvent, getDocsRequestAnalyticsProperties, resolveDocsAnalyticsConfig, resolveDocsObservabilityConfig } from "./analytics.mjs";
5
5
  import { DEFAULT_DOCS_REVIEW_SCORE_THRESHOLD, DEFAULT_DOCS_REVIEW_WORKFLOW_PATH, ResolvedDocsReviewConfig, buildDocsReviewWorkflow, buildDocsReviewWorkflowPathFilters, ensureDocsReviewWorkflow, readDocsReviewConfigFromSource, resolveDocsReviewConfig } from "./review.mjs";
6
+ import { readDocsAppVersion } from "./app-version.mjs";
6
7
  import { loadDocsConfigModule } from "./cli/config.mjs";
7
8
  import { DocsCloudAskAIConfig, DocsCloudAskAIResponseOptions, createDocsCloudAskAIResponse, isDocsCloudAskAIProvider } from "./cloud-ask-ai.mjs";
8
9
  import { DocsCloudAskAIOptions, DocsCloudPublicConfig, DocsCloudRouteHandlerOptions, DocsCloudRouteHandlers, DocsCloudRuntimeEnv, DocsCloudRuntimeValue, DocsCloudServer, DocsCloudServerOptions, DocsCloudTrackEventOptions, createDocsCloudRouteHandler, createDocsCloudServer } from "./docs-cloud-server.mjs";
@@ -22,4 +23,5 @@ import { ApiReferenceFramework, ApiReferenceOpenApiDiscovery, ApiReferenceOpenAp
22
23
  import { readDocsSitemapManifest } from "./sitemap-server.mjs";
23
24
  import { NormalizedOpenApiExample, NormalizedOpenApiMediaType, NormalizedOpenApiModel, NormalizedOpenApiOperation, NormalizedOpenApiParameter, NormalizedOpenApiRequestBody, NormalizedOpenApiResponse, OPENAPI_OPERATION_METHODS, OpenApiOperationMethod, buildNormalizedOpenApiModel } from "./openapi-operations.mjs";
24
25
  import { DocsAuthoringFileState, DocsAuthoringMcpOptions, createDocsAuthoringMcpServer, readDocsAuthoringFile, runDocsAuthoringMcpStdio, writeDocsAuthoringFile } from "./authoring-mcp.mjs";
25
- export { type ApiReferenceFramework, type ApiReferenceOpenApiDiscovery, type ApiReferenceOpenApiVersionDiscovery, type ApiReferenceRenderer, type ApiReferenceRendererConfig, type ApiReferenceRendererInput, type ApiReferenceRoute, type BuildApiReferenceOperationPagesOptions, type BuildApiReferenceOptions, type BuildDocsContentSnapshotOptions, type CreateApiReferenceOperationMarkdownResponseOptions, type CreateDocsMcpServerOptions, DEFAULT_API_REFERENCE_OPENAPI_ROUTE, DEFAULT_DOCS_CONTENT_CHANGE_HYDRATION_TOKEN_BUDGET, DEFAULT_DOCS_MCP_CONTENT_CHANGE_POLL_INTERVAL_MS, 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, DEFAULT_DOCS_REVIEW_SCORE_THRESHOLD, DEFAULT_DOCS_REVIEW_WORKFLOW_PATH, DEFAULT_OPEN_DOCS_PROMPT, DEFAULT_OPEN_DOCS_PROVIDER_IDS, DEFAULT_OPEN_DOCS_TARGET, DEFAULT_PROMPT_PROVIDER_TEMPLATES, DEFAULT_SITEMAP_MANIFEST_PATH, DEFAULT_SITEMAP_MD_DOCS_ROUTE, DEFAULT_SITEMAP_MD_ROUTE, DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, DEFAULT_SITEMAP_XML_ROUTE, DOCS_AGENT_FEEDBACK_IMPROVEMENT_FORMAT, DOCS_AGENT_TRACE_EVENT_TYPES, DOCS_CONFIG_SCHEMA_OPTIONS, DOCS_CONTENT_CHANGES_FORMAT, DOCS_CONTENT_CHANGES_RESPONSE_VALUE, DOCS_CONTENT_CHANGE_HYDRATION_FORMAT, DOCS_CONTENT_SNAPSHOT_FORMAT, DOCS_MCP_CONTENT_CHANGES_CURRENT_URI, DOCS_MCP_CONTENT_CHANGES_URI_TEMPLATE, type DocsAgentContentChangesConfig, type DocsAgentEvaluationAnswerInput, type DocsAgentEvaluationAnswerProvider, type DocsAgentEvaluationAnswerRequest, type DocsAgentEvaluationAnswerResult, type DocsAgentEvaluationAnswerRunner, type DocsAgentEvaluationSourceReference, type DocsAgentEvaluationSurface, type DocsAgentEvaluationTaskInput, type DocsAgentFeedbackCluster, type DocsAgentFeedbackImprovementOptions, type DocsAgentFeedbackImprovementReport, type DocsAgentFeedbackIssueDraft, type DocsAgentGoldenAnswerExpectation, type DocsAgentGoldenAuthenticatedContentExpectation, type DocsAgentGoldenExampleVerification, type DocsAgentGoldenFreshnessExpectation, type DocsAgentGoldenPromptInjectionExpectation, type DocsAgentGoldenQueryVariant, type DocsAgentGoldenQueryVariantKind, type DocsAgentGoldenSafetyExpectation, type DocsAgentTraceContext, type DocsAgentTraceEventInput, type DocsAgentTraceEventType, type DocsAgentTraceStatus, type DocsAnalyticsConfig, type DocsAnalyticsEvent, type DocsAnalyticsEventInput, type DocsAskAIFeedbackConfig, type DocsAskAIFeedbackData, type DocsAskAIFeedbackMessage, type DocsAskAIFeedbackValue, type DocsAskAIMcpConfig, type DocsAuthoringFileState, type DocsAuthoringMcpOptions, type DocsCloudAskAIConfig, type DocsCloudAskAIOptions, type DocsCloudAskAIResponseOptions, type DocsCloudPublicConfig, type DocsCloudRouteHandlerOptions, type DocsCloudRouteHandlers, type DocsCloudRuntimeEnv, type DocsCloudRuntimeValue, type DocsCloudServer, type DocsCloudServerOptions, type DocsCloudTrackEventOptions, type DocsContentChangeDocument, type DocsContentChangeFeed, type DocsContentChangeHydrationBudget, type DocsContentChangeHydrationContent, type DocsContentChangeHydrationResponse, type DocsContentChangeHydrationSection, type DocsContentChangeHydrationTombstone, type DocsContentChangeSnapshotContext, type DocsContentChangeSnapshotLoader, type DocsContentChangeSnapshotSaver, type DocsContentChangedDocument, type DocsContentChangesRequest, DocsContentChangesRequestError, type DocsContentChangesResponse, type DocsContentSnapshot, type DocsContentSnapshotDocument, type DocsGoldenAnswerMetrics, type DocsGoldenCitationMetrics, type DocsGoldenEvaluationCoverage, type DocsGoldenEvaluationCoverageStatus, type DocsGoldenEvaluationDimensionCoverage, type DocsGoldenEvaluationQuality, type DocsGoldenEvaluationStatus, type DocsGoldenExampleMetrics, type DocsGoldenExampleResult, type DocsGoldenExpectedExample, type DocsGoldenQueryVariantResult, type DocsGoldenRetrievalMetrics, type DocsGoldenRetrievedSource, type DocsGoldenSafetyCaseKind, type DocsGoldenSafetyCaseResult, type DocsGoldenSafetyMetrics, type DocsGoldenSelectionMetrics, type DocsGoldenTask, type DocsGoldenTaskExpectation, type DocsGoldenTaskFilters, type DocsGoldenTaskReport, type DocsGoldenTasksReport, type DocsGoldenUsageMetrics, type DocsLocalMcpSearchRuntimeConfig, type DocsLocalMcpSearchRuntimeInput, type DocsMarkdownPromptBlock, type DocsMcpAgentContractSummary, type DocsMcpApiReferenceSource, type DocsMcpCodeExample, type DocsMcpConfigSchema, type DocsMcpConfigSchemaOption, type DocsMcpContextResult, type DocsMcpContextSource, type DocsMcpDocsList, type DocsMcpDocsPageSummary, type DocsMcpDocsSection, type DocsMcpHttpHandlers, type DocsMcpNavigationNode, type DocsMcpNavigationTree, type DocsMcpPage, type DocsMcpPageSectionIndex, type DocsMcpPageSectionList, type DocsMcpPaginatedDocsList, type DocsMcpPagination, type DocsMcpRequestContext, type DocsMcpResolvedConfig, type DocsMcpResolvedCorsConfig, type DocsMcpResolvedPromptsConfig, type DocsMcpResolvedProtectedResourceConfig, type DocsMcpResolvedSecurityConfig, type DocsMcpSource, type DocsMcpTaskSummary, type DocsObservabilityConfig, type DocsObservabilityEvent, type DocsObservabilityEventInput, type DocsPaginatedSearchResponse, DocsPaginationCursorError, type DocsResolvedContentChangesConfig, type DocsRetrievalSourceProvenance, type DocsRetrievalSourceScope, type DocsSearchAdapter, type DocsSearchAdapterContext, type DocsSearchAdapterFactory, type DocsSearchAdapterPage, type DocsSearchAmbiguityDecision, type DocsSearchAmbiguityDecisionStatus, type DocsSearchAmbiguityResolution, type DocsSearchConfig, type DocsSearchDocument, type DocsSearchExplanation, type DocsSearchFilterDecision, type DocsSearchFilterDecisionOutcome, type DocsSearchFilterField, type DocsSearchFilterInput, type DocsSearchFilters, type DocsSearchMatchField, type DocsSearchMatchedTerm, type DocsSearchQuery, type DocsSearchRankingReason, type DocsSearchRankingReasonCode, type DocsSearchRankingStrategy, type DocsSearchRequest, DocsSearchRequestError, type DocsSearchRequestResolutionOptions, type DocsSearchResponse, type DocsSearchResult, type DocsSearchSourcePage, type DocsSearchWarning, type DocsSearchWarningCode, type DocsSitemapFormat, type DocsSitemapManifest, type DocsSitemapManifestPage, type DocsSitemapPageInput, type DocsSitemapResolvedConfig, type EnrichDocsSearchDocumentsWithProvenanceOptions, type ExtractedDocsMarkdownPromptBlocks, type HydrateDocsContentChangesOptions, MAX_DOCS_CONTENT_CHANGE_HYDRATION_TOKEN_BUDGET, MIN_DOCS_CONTENT_CHANGE_HYDRATION_TOKEN_BUDGET, type McpDocsSearchConfig, type NormalizedOpenApiExample, type NormalizedOpenApiMediaType, type NormalizedOpenApiModel, type NormalizedOpenApiOperation, type NormalizedOpenApiParameter, type NormalizedOpenApiRequestBody, type NormalizedOpenApiResponse, OPENAPI_OPERATION_METHODS, type OpenApiOperationMethod, type PerformDocsSearchOptions, type PromptAction, type PromptProviderChoice, type ResolveConfiguredAgentSkillsOptions, type ResolveDocsContentChangesOptions, type ResolvedApiReferenceConfig, type ResolvedApiReferenceVersion, type ResolvedDocsAnalyticsConfig, type ResolvedDocsObservabilityConfig, type ResolvedDocsReviewConfig, type RunDocsGoldenTasksOptions, type SerializeOpenDocsProviderOptions, type SerializedOpenDocsProvider, analyzeDocsAgentFeedback, buildApiReferenceHtmlDocument, buildApiReferenceHtmlDocumentAsync, buildApiReferenceOpenApiDocument, buildApiReferenceOpenApiDocumentAsync, buildApiReferenceOperationPagesAsync, buildApiReferencePageTitle, buildApiReferenceScalarCss, buildDocsAskAIContext, buildDocsContentSnapshot, buildDocsRetrievalDigestProjection, buildDocsReviewWorkflow, buildDocsReviewWorkflowPathFilters, buildDocsSearchDocuments, buildDocsSitemapManifest, buildNormalizedOpenApiModel, createAlgoliaSearchAdapter, createApiReferenceOperationMarkdownResponse, createCustomSearchAdapter, createDocsAgentTraceContext, createDocsAgentTraceId, createDocsAuthoringMcpServer, createDocsCloudAskAIResponse, createDocsCloudRouteHandler, createDocsCloudServer, createDocsContentChangeFeed, createDocsContentChangesHttpResponse, createDocsMcpHttpHandler, createDocsMcpServer, createDocsSitemapResponse, createFilesystemDocsMcpSource, createMcpSearchAdapter, createSimpleSearchAdapter, createTypesenseSearchAdapter, digestDocsRetrievalContent, emitDocsAgentTraceEvent, emitDocsAnalyticsEvent, emitDocsObservabilityEvent, enrichDocsSearchDocumentsWithProvenance, ensureDocsReviewWorkflow, extractDocsMarkdownPromptBlocks, formatDocsAskAIPackageHints, getDocsConfigSchema, getDocsRequestAnalyticsProperties, hydrateDocsContentChanges, inferDocsAskAIPackageHints, isApiReferenceOpenApiRequest, isDocsCloudAskAIProvider, isDocsContentChangeGeneration, isDocsContentChangesRequest, isDocsRetrievalCanonicalUrl, loadDocsConfigModule, normalizeDocsMcpRoute, normalizeDocsSearchFilters, normalizePromptProviderName, parsePromptStringArray, performDocsSearch, performDocsSearchWithMetadata, readDocsAgentFeedbackFile, readDocsAuthoringFile, readDocsReviewConfigFromSource, readDocsSitemapManifest, readDocsSitemapManifestFromContentMap, remarkCodeGroup, renderDocsAgentSkillsBundle, renderDocsSitemapMarkdown, renderDocsSitemapXml, resolveApiReferenceConfig, resolveApiReferenceOpenApiDiscovery, resolveApiReferenceRenderer, resolveApiReferenceVersion, resolveApiReferenceVersionFromPathname, resolveAskAISearchRequestConfig, resolveConfiguredAgentSkills, resolveConfiguredAgentSkillsSync, resolveDocsAnalyticsConfig, resolveDocsContentChangesConfig, resolveDocsContentChangesRequest, resolveDocsMcpConfig, resolveDocsMcpPromptsConfig, resolveDocsObservabilityConfig, resolveDocsRetrievalLastModified, resolveDocsReviewConfig, resolveDocsSearchAudience, resolveDocsSearchError, resolveDocsSearchFilters, resolveDocsSearchRequest, resolveDocsSitemapConfig, resolveDocsSitemapPageLastmod, resolveDocsSitemapRequest, resolveLocalDocsMcpSearchConfig, resolvePromptProviderChoices, resolveSearchRequestConfig, runDocsAuthoringMcpStdio, runDocsGoldenTasks, runDocsMcpStdio, sanitizePromptText, serializeDocsIcon, serializeDocsIconRegistry, serializeOpenDocsProvider, serializeOpenDocsProviders, toDocsSitemapMarkdownUrl, writeDocsAuthoringFile };
26
+ import { CreateDocsMcpServerCardOptions, DOCS_MCP_SERVER_CARD_SUFFIX, DocsMcpServerCard, createDocsMcpServerCard, createDocsMcpServerCardResponse } from "./mcp-server-card.mjs";
27
+ export { type ApiReferenceFramework, type ApiReferenceOpenApiDiscovery, type ApiReferenceOpenApiVersionDiscovery, type ApiReferenceRenderer, type ApiReferenceRendererConfig, type ApiReferenceRendererInput, type ApiReferenceRoute, type BuildApiReferenceOperationPagesOptions, type BuildApiReferenceOptions, type BuildDocsContentSnapshotOptions, type CreateApiReferenceOperationMarkdownResponseOptions, type CreateDocsMcpServerCardOptions, type CreateDocsMcpServerOptions, DEFAULT_API_REFERENCE_OPENAPI_ROUTE, DEFAULT_DOCS_CONTENT_CHANGE_HYDRATION_TOKEN_BUDGET, DEFAULT_DOCS_MCP_CONTENT_CHANGE_POLL_INTERVAL_MS, 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, DEFAULT_DOCS_REVIEW_SCORE_THRESHOLD, DEFAULT_DOCS_REVIEW_WORKFLOW_PATH, DEFAULT_OPEN_DOCS_PROMPT, DEFAULT_OPEN_DOCS_PROVIDER_IDS, DEFAULT_OPEN_DOCS_TARGET, DEFAULT_PROMPT_PROVIDER_TEMPLATES, DEFAULT_SITEMAP_MANIFEST_PATH, DEFAULT_SITEMAP_MD_DOCS_ROUTE, DEFAULT_SITEMAP_MD_ROUTE, DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, DEFAULT_SITEMAP_XML_ROUTE, DOCS_AGENT_FEEDBACK_IMPROVEMENT_FORMAT, DOCS_AGENT_TRACE_EVENT_TYPES, DOCS_CONFIG_SCHEMA_OPTIONS, DOCS_CONTENT_CHANGES_FORMAT, DOCS_CONTENT_CHANGES_RESPONSE_VALUE, DOCS_CONTENT_CHANGE_HYDRATION_FORMAT, DOCS_CONTENT_SNAPSHOT_FORMAT, DOCS_MCP_CONTENT_CHANGES_CURRENT_URI, DOCS_MCP_CONTENT_CHANGES_URI_TEMPLATE, DOCS_MCP_SERVER_CARD_SUFFIX, type DocsAgentContentChangesConfig, type DocsAgentEvaluationAnswerInput, type DocsAgentEvaluationAnswerProvider, type DocsAgentEvaluationAnswerRequest, type DocsAgentEvaluationAnswerResult, type DocsAgentEvaluationAnswerRunner, type DocsAgentEvaluationSourceReference, type DocsAgentEvaluationSurface, type DocsAgentEvaluationTaskInput, type DocsAgentFeedbackCluster, type DocsAgentFeedbackImprovementOptions, type DocsAgentFeedbackImprovementReport, type DocsAgentFeedbackIssueDraft, type DocsAgentGoldenAnswerExpectation, type DocsAgentGoldenAuthenticatedContentExpectation, type DocsAgentGoldenExampleVerification, type DocsAgentGoldenFreshnessExpectation, type DocsAgentGoldenPromptInjectionExpectation, type DocsAgentGoldenQueryVariant, type DocsAgentGoldenQueryVariantKind, type DocsAgentGoldenSafetyExpectation, type DocsAgentTraceContext, type DocsAgentTraceEventInput, type DocsAgentTraceEventType, type DocsAgentTraceStatus, type DocsAnalyticsConfig, type DocsAnalyticsEvent, type DocsAnalyticsEventInput, type DocsAskAIFeedbackConfig, type DocsAskAIFeedbackData, type DocsAskAIFeedbackMessage, type DocsAskAIFeedbackValue, type DocsAskAIMcpConfig, type DocsAuthoringFileState, type DocsAuthoringMcpOptions, type DocsCloudAskAIConfig, type DocsCloudAskAIOptions, type DocsCloudAskAIResponseOptions, type DocsCloudPublicConfig, type DocsCloudRouteHandlerOptions, type DocsCloudRouteHandlers, type DocsCloudRuntimeEnv, type DocsCloudRuntimeValue, type DocsCloudServer, type DocsCloudServerOptions, type DocsCloudTrackEventOptions, type DocsContentChangeDocument, type DocsContentChangeFeed, type DocsContentChangeHydrationBudget, type DocsContentChangeHydrationContent, type DocsContentChangeHydrationResponse, type DocsContentChangeHydrationSection, type DocsContentChangeHydrationTombstone, type DocsContentChangeSnapshotContext, type DocsContentChangeSnapshotLoader, type DocsContentChangeSnapshotSaver, type DocsContentChangedDocument, type DocsContentChangesRequest, DocsContentChangesRequestError, type DocsContentChangesResponse, type DocsContentSnapshot, type DocsContentSnapshotDocument, type DocsGoldenAnswerMetrics, type DocsGoldenCitationMetrics, type DocsGoldenEvaluationCoverage, type DocsGoldenEvaluationCoverageStatus, type DocsGoldenEvaluationDimensionCoverage, type DocsGoldenEvaluationQuality, type DocsGoldenEvaluationStatus, type DocsGoldenExampleMetrics, type DocsGoldenExampleResult, type DocsGoldenExpectedExample, type DocsGoldenQueryVariantResult, type DocsGoldenRetrievalMetrics, type DocsGoldenRetrievedSource, type DocsGoldenSafetyCaseKind, type DocsGoldenSafetyCaseResult, type DocsGoldenSafetyMetrics, type DocsGoldenSelectionMetrics, type DocsGoldenTask, type DocsGoldenTaskExpectation, type DocsGoldenTaskFilters, type DocsGoldenTaskReport, type DocsGoldenTasksReport, type DocsGoldenUsageMetrics, type DocsLocalMcpSearchRuntimeConfig, type DocsLocalMcpSearchRuntimeInput, type DocsMarkdownPromptBlock, type DocsMcpAgentContractSummary, type DocsMcpApiReferenceSource, type DocsMcpCodeExample, type DocsMcpConfigSchema, type DocsMcpConfigSchemaOption, type DocsMcpContextResult, type DocsMcpContextSource, type DocsMcpDocsList, type DocsMcpDocsPageSummary, type DocsMcpDocsSection, type DocsMcpHttpHandlers, type DocsMcpNavigationNode, type DocsMcpNavigationTree, type DocsMcpPage, type DocsMcpPageSectionIndex, type DocsMcpPageSectionList, type DocsMcpPaginatedDocsList, type DocsMcpPagination, type DocsMcpRequestContext, type DocsMcpResolvedConfig, type DocsMcpResolvedCorsConfig, type DocsMcpResolvedPromptsConfig, type DocsMcpResolvedProtectedResourceConfig, type DocsMcpResolvedSecurityConfig, type DocsMcpServerCard, type DocsMcpSource, type DocsMcpTaskSummary, type DocsObservabilityConfig, type DocsObservabilityEvent, type DocsObservabilityEventInput, type DocsPaginatedSearchResponse, DocsPaginationCursorError, type DocsResolvedContentChangesConfig, type DocsRetrievalSourceProvenance, type DocsRetrievalSourceScope, type DocsSearchAdapter, type DocsSearchAdapterContext, type DocsSearchAdapterFactory, type DocsSearchAdapterPage, type DocsSearchAmbiguityDecision, type DocsSearchAmbiguityDecisionStatus, type DocsSearchAmbiguityResolution, type DocsSearchConfig, type DocsSearchDocument, type DocsSearchExplanation, type DocsSearchFilterDecision, type DocsSearchFilterDecisionOutcome, type DocsSearchFilterField, type DocsSearchFilterInput, type DocsSearchFilters, type DocsSearchMatchField, type DocsSearchMatchedTerm, type DocsSearchQuery, type DocsSearchRankingReason, type DocsSearchRankingReasonCode, type DocsSearchRankingStrategy, type DocsSearchRequest, DocsSearchRequestError, type DocsSearchRequestResolutionOptions, type DocsSearchResponse, type DocsSearchResult, type DocsSearchSourcePage, type DocsSearchWarning, type DocsSearchWarningCode, type DocsSitemapFormat, type DocsSitemapManifest, type DocsSitemapManifestPage, type DocsSitemapPageInput, type DocsSitemapResolvedConfig, type EnrichDocsSearchDocumentsWithProvenanceOptions, type ExtractedDocsMarkdownPromptBlocks, type HydrateDocsContentChangesOptions, MAX_DOCS_CONTENT_CHANGE_HYDRATION_TOKEN_BUDGET, MIN_DOCS_CONTENT_CHANGE_HYDRATION_TOKEN_BUDGET, type McpDocsSearchConfig, type NormalizedOpenApiExample, type NormalizedOpenApiMediaType, type NormalizedOpenApiModel, type NormalizedOpenApiOperation, type NormalizedOpenApiParameter, type NormalizedOpenApiRequestBody, type NormalizedOpenApiResponse, OPENAPI_OPERATION_METHODS, type OpenApiOperationMethod, type PerformDocsSearchOptions, type PromptAction, type PromptProviderChoice, type ResolveConfiguredAgentSkillsOptions, type ResolveDocsContentChangesOptions, type ResolvedApiReferenceConfig, type ResolvedApiReferenceVersion, type ResolvedDocsAnalyticsConfig, type ResolvedDocsObservabilityConfig, type ResolvedDocsReviewConfig, type RunDocsGoldenTasksOptions, type SerializeOpenDocsProviderOptions, type SerializedOpenDocsProvider, analyzeDocsAgentFeedback, buildApiReferenceHtmlDocument, buildApiReferenceHtmlDocumentAsync, buildApiReferenceOpenApiDocument, buildApiReferenceOpenApiDocumentAsync, buildApiReferenceOperationPagesAsync, buildApiReferencePageTitle, buildApiReferenceScalarCss, buildDocsAskAIContext, buildDocsContentSnapshot, buildDocsRetrievalDigestProjection, buildDocsReviewWorkflow, buildDocsReviewWorkflowPathFilters, buildDocsSearchDocuments, buildDocsSitemapManifest, buildNormalizedOpenApiModel, createAlgoliaSearchAdapter, createApiReferenceOperationMarkdownResponse, createCustomSearchAdapter, createDocsAgentTraceContext, createDocsAgentTraceId, createDocsAuthoringMcpServer, createDocsCloudAskAIResponse, createDocsCloudRouteHandler, createDocsCloudServer, createDocsContentChangeFeed, createDocsContentChangesHttpResponse, createDocsMcpHttpHandler, createDocsMcpServer, createDocsMcpServerCard, createDocsMcpServerCardResponse, createDocsSitemapResponse, createFilesystemDocsMcpSource, createMcpSearchAdapter, createSimpleSearchAdapter, createTypesenseSearchAdapter, digestDocsRetrievalContent, emitDocsAgentTraceEvent, emitDocsAnalyticsEvent, emitDocsObservabilityEvent, enrichDocsSearchDocumentsWithProvenance, ensureDocsReviewWorkflow, extractDocsMarkdownPromptBlocks, formatDocsAskAIPackageHints, getDocsConfigSchema, getDocsRequestAnalyticsProperties, hydrateDocsContentChanges, inferDocsAskAIPackageHints, isApiReferenceOpenApiRequest, isDocsCloudAskAIProvider, isDocsContentChangeGeneration, isDocsContentChangesRequest, isDocsRetrievalCanonicalUrl, loadDocsConfigModule, normalizeDocsMcpRoute, normalizeDocsSearchFilters, normalizePromptProviderName, parsePromptStringArray, performDocsSearch, performDocsSearchWithMetadata, readDocsAgentFeedbackFile, readDocsAppVersion, readDocsAuthoringFile, readDocsReviewConfigFromSource, readDocsSitemapManifest, readDocsSitemapManifestFromContentMap, remarkCodeGroup, renderDocsAgentSkillsBundle, renderDocsSitemapMarkdown, renderDocsSitemapXml, resolveApiReferenceConfig, resolveApiReferenceOpenApiDiscovery, resolveApiReferenceRenderer, resolveApiReferenceVersion, resolveApiReferenceVersionFromPathname, resolveAskAISearchRequestConfig, resolveConfiguredAgentSkills, resolveConfiguredAgentSkillsSync, resolveDocsAnalyticsConfig, resolveDocsContentChangesConfig, resolveDocsContentChangesRequest, resolveDocsMcpConfig, resolveDocsMcpPromptsConfig, resolveDocsObservabilityConfig, resolveDocsRetrievalLastModified, resolveDocsReviewConfig, resolveDocsSearchAudience, resolveDocsSearchError, resolveDocsSearchFilters, resolveDocsSearchRequest, resolveDocsSitemapConfig, resolveDocsSitemapPageLastmod, resolveDocsSitemapRequest, resolveLocalDocsMcpSearchConfig, resolvePromptProviderChoices, resolveSearchRequestConfig, runDocsAuthoringMcpStdio, runDocsGoldenTasks, runDocsMcpStdio, sanitizePromptText, serializeDocsIcon, serializeDocsIconRegistry, serializeOpenDocsProvider, serializeOpenDocsProviders, toDocsSitemapMarkdownUrl, writeDocsAuthoringFile };
package/dist/server.mjs CHANGED
@@ -18,8 +18,10 @@ import { createDocsCloudAskAIResponse, isDocsCloudAskAIProvider } from "./cloud-
18
18
  import { createDocsCloudRouteHandler, createDocsCloudServer } from "./docs-cloud-server.mjs";
19
19
  import { runDocsGoldenTasks } from "./agent-evals.mjs";
20
20
  import { renderDocsAgentSkillsBundle } from "./agent-skills-vite.mjs";
21
+ import { readDocsAppVersion } from "./app-version.mjs";
21
22
  import { loadDocsConfigModule } from "./cli/config.mjs";
22
23
  import { DEFAULT_OPEN_DOCS_PROMPT, DEFAULT_OPEN_DOCS_PROVIDER_IDS, DEFAULT_OPEN_DOCS_TARGET, DEFAULT_PROMPT_PROVIDER_TEMPLATES, normalizePromptProviderName, parsePromptStringArray, resolvePromptProviderChoices, sanitizePromptText, serializeDocsIcon, serializeDocsIconRegistry, serializeOpenDocsProvider, serializeOpenDocsProviders } from "./prompt-utils.mjs";
23
24
  import { readDocsSitemapManifest } from "./sitemap-server.mjs";
25
+ import { DOCS_MCP_SERVER_CARD_SUFFIX, createDocsMcpServerCard, createDocsMcpServerCardResponse } from "./mcp-server-card.mjs";
24
26
 
25
- export { DEFAULT_API_REFERENCE_OPENAPI_ROUTE, DEFAULT_DOCS_CONTENT_CHANGE_HYDRATION_TOKEN_BUDGET, DEFAULT_DOCS_MCP_CONTENT_CHANGE_POLL_INTERVAL_MS, 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, DEFAULT_DOCS_REVIEW_SCORE_THRESHOLD, DEFAULT_DOCS_REVIEW_WORKFLOW_PATH, DEFAULT_OPEN_DOCS_PROMPT, DEFAULT_OPEN_DOCS_PROVIDER_IDS, DEFAULT_OPEN_DOCS_TARGET, DEFAULT_PROMPT_PROVIDER_TEMPLATES, DEFAULT_SITEMAP_MANIFEST_PATH, DEFAULT_SITEMAP_MD_DOCS_ROUTE, DEFAULT_SITEMAP_MD_ROUTE, DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, DEFAULT_SITEMAP_XML_ROUTE, DOCS_AGENT_FEEDBACK_IMPROVEMENT_FORMAT, DOCS_AGENT_TRACE_EVENT_TYPES, DOCS_CONFIG_SCHEMA_OPTIONS, DOCS_CONTENT_CHANGES_FORMAT, DOCS_CONTENT_CHANGES_RESPONSE_VALUE, DOCS_CONTENT_CHANGE_HYDRATION_FORMAT, DOCS_CONTENT_SNAPSHOT_FORMAT, DOCS_MCP_CONTENT_CHANGES_CURRENT_URI, DOCS_MCP_CONTENT_CHANGES_URI_TEMPLATE, DocsContentChangesRequestError, DocsPaginationCursorError, DocsSearchRequestError, MAX_DOCS_CONTENT_CHANGE_HYDRATION_TOKEN_BUDGET, MIN_DOCS_CONTENT_CHANGE_HYDRATION_TOKEN_BUDGET, OPENAPI_OPERATION_METHODS, analyzeDocsAgentFeedback, buildApiReferenceHtmlDocument, buildApiReferenceHtmlDocumentAsync, buildApiReferenceOpenApiDocument, buildApiReferenceOpenApiDocumentAsync, buildApiReferenceOperationPagesAsync, buildApiReferencePageTitle, buildApiReferenceScalarCss, buildDocsAskAIContext, buildDocsContentSnapshot, buildDocsRetrievalDigestProjection, buildDocsReviewWorkflow, buildDocsReviewWorkflowPathFilters, buildDocsSearchDocuments, buildDocsSitemapManifest, buildNormalizedOpenApiModel, createAlgoliaSearchAdapter, createApiReferenceOperationMarkdownResponse, createCustomSearchAdapter, createDocsAgentTraceContext, createDocsAgentTraceId, createDocsAuthoringMcpServer, createDocsCloudAskAIResponse, createDocsCloudRouteHandler, createDocsCloudServer, createDocsContentChangeFeed, createDocsContentChangesHttpResponse, createDocsMcpHttpHandler, createDocsMcpServer, createDocsSitemapResponse, createFilesystemDocsMcpSource, createMcpSearchAdapter, createSimpleSearchAdapter, createTypesenseSearchAdapter, digestDocsRetrievalContent, emitDocsAgentTraceEvent, emitDocsAnalyticsEvent, emitDocsObservabilityEvent, enrichDocsSearchDocumentsWithProvenance, ensureDocsReviewWorkflow, extractDocsMarkdownPromptBlocks, formatDocsAskAIPackageHints, getDocsConfigSchema, getDocsRequestAnalyticsProperties, hydrateDocsContentChanges, inferDocsAskAIPackageHints, isApiReferenceOpenApiRequest, isDocsCloudAskAIProvider, isDocsContentChangeGeneration, isDocsContentChangesRequest, isDocsRetrievalCanonicalUrl, loadDocsConfigModule, normalizeDocsMcpRoute, normalizeDocsSearchFilters, normalizePromptProviderName, parsePromptStringArray, performDocsSearch, performDocsSearchWithMetadata, readDocsAgentFeedbackFile, readDocsAuthoringFile, readDocsReviewConfigFromSource, readDocsSitemapManifest, readDocsSitemapManifestFromContentMap, remarkCodeGroup, renderDocsAgentSkillsBundle, renderDocsSitemapMarkdown, renderDocsSitemapXml, resolveApiReferenceConfig, resolveApiReferenceOpenApiDiscovery, resolveApiReferenceRenderer, resolveApiReferenceVersion, resolveApiReferenceVersionFromPathname, resolveAskAISearchRequestConfig, resolveConfiguredAgentSkills, resolveConfiguredAgentSkillsSync, resolveDocsAnalyticsConfig, resolveDocsContentChangesConfig, resolveDocsContentChangesRequest, resolveDocsMcpConfig, resolveDocsMcpPromptsConfig, resolveDocsObservabilityConfig, resolveDocsRetrievalLastModified, resolveDocsReviewConfig, resolveDocsSearchAudience, resolveDocsSearchError, resolveDocsSearchFilters, resolveDocsSearchRequest, resolveDocsSitemapConfig, resolveDocsSitemapPageLastmod, resolveDocsSitemapRequest, resolveLocalDocsMcpSearchConfig, resolvePromptProviderChoices, resolveSearchRequestConfig, runDocsAuthoringMcpStdio, runDocsGoldenTasks, runDocsMcpStdio, sanitizePromptText, serializeDocsIcon, serializeDocsIconRegistry, serializeOpenDocsProvider, serializeOpenDocsProviders, toDocsSitemapMarkdownUrl, writeDocsAuthoringFile };
27
+ export { DEFAULT_API_REFERENCE_OPENAPI_ROUTE, DEFAULT_DOCS_CONTENT_CHANGE_HYDRATION_TOKEN_BUDGET, DEFAULT_DOCS_MCP_CONTENT_CHANGE_POLL_INTERVAL_MS, 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, DEFAULT_DOCS_REVIEW_SCORE_THRESHOLD, DEFAULT_DOCS_REVIEW_WORKFLOW_PATH, DEFAULT_OPEN_DOCS_PROMPT, DEFAULT_OPEN_DOCS_PROVIDER_IDS, DEFAULT_OPEN_DOCS_TARGET, DEFAULT_PROMPT_PROVIDER_TEMPLATES, DEFAULT_SITEMAP_MANIFEST_PATH, DEFAULT_SITEMAP_MD_DOCS_ROUTE, DEFAULT_SITEMAP_MD_ROUTE, DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, DEFAULT_SITEMAP_XML_ROUTE, DOCS_AGENT_FEEDBACK_IMPROVEMENT_FORMAT, DOCS_AGENT_TRACE_EVENT_TYPES, DOCS_CONFIG_SCHEMA_OPTIONS, DOCS_CONTENT_CHANGES_FORMAT, DOCS_CONTENT_CHANGES_RESPONSE_VALUE, DOCS_CONTENT_CHANGE_HYDRATION_FORMAT, DOCS_CONTENT_SNAPSHOT_FORMAT, DOCS_MCP_CONTENT_CHANGES_CURRENT_URI, DOCS_MCP_CONTENT_CHANGES_URI_TEMPLATE, DOCS_MCP_SERVER_CARD_SUFFIX, DocsContentChangesRequestError, DocsPaginationCursorError, DocsSearchRequestError, MAX_DOCS_CONTENT_CHANGE_HYDRATION_TOKEN_BUDGET, MIN_DOCS_CONTENT_CHANGE_HYDRATION_TOKEN_BUDGET, OPENAPI_OPERATION_METHODS, analyzeDocsAgentFeedback, buildApiReferenceHtmlDocument, buildApiReferenceHtmlDocumentAsync, buildApiReferenceOpenApiDocument, buildApiReferenceOpenApiDocumentAsync, buildApiReferenceOperationPagesAsync, buildApiReferencePageTitle, buildApiReferenceScalarCss, buildDocsAskAIContext, buildDocsContentSnapshot, buildDocsRetrievalDigestProjection, buildDocsReviewWorkflow, buildDocsReviewWorkflowPathFilters, buildDocsSearchDocuments, buildDocsSitemapManifest, buildNormalizedOpenApiModel, createAlgoliaSearchAdapter, createApiReferenceOperationMarkdownResponse, createCustomSearchAdapter, createDocsAgentTraceContext, createDocsAgentTraceId, createDocsAuthoringMcpServer, createDocsCloudAskAIResponse, createDocsCloudRouteHandler, createDocsCloudServer, createDocsContentChangeFeed, createDocsContentChangesHttpResponse, createDocsMcpHttpHandler, createDocsMcpServer, createDocsMcpServerCard, createDocsMcpServerCardResponse, createDocsSitemapResponse, createFilesystemDocsMcpSource, createMcpSearchAdapter, createSimpleSearchAdapter, createTypesenseSearchAdapter, digestDocsRetrievalContent, emitDocsAgentTraceEvent, emitDocsAnalyticsEvent, emitDocsObservabilityEvent, enrichDocsSearchDocumentsWithProvenance, ensureDocsReviewWorkflow, extractDocsMarkdownPromptBlocks, formatDocsAskAIPackageHints, getDocsConfigSchema, getDocsRequestAnalyticsProperties, hydrateDocsContentChanges, inferDocsAskAIPackageHints, isApiReferenceOpenApiRequest, isDocsCloudAskAIProvider, isDocsContentChangeGeneration, isDocsContentChangesRequest, isDocsRetrievalCanonicalUrl, loadDocsConfigModule, normalizeDocsMcpRoute, normalizeDocsSearchFilters, normalizePromptProviderName, parsePromptStringArray, performDocsSearch, performDocsSearchWithMetadata, readDocsAgentFeedbackFile, readDocsAppVersion, readDocsAuthoringFile, readDocsReviewConfigFromSource, readDocsSitemapManifest, readDocsSitemapManifestFromContentMap, remarkCodeGroup, renderDocsAgentSkillsBundle, renderDocsSitemapMarkdown, renderDocsSitemapXml, resolveApiReferenceConfig, resolveApiReferenceOpenApiDiscovery, resolveApiReferenceRenderer, resolveApiReferenceVersion, resolveApiReferenceVersionFromPathname, resolveAskAISearchRequestConfig, resolveConfiguredAgentSkills, resolveConfiguredAgentSkillsSync, resolveDocsAnalyticsConfig, resolveDocsContentChangesConfig, resolveDocsContentChangesRequest, resolveDocsMcpConfig, resolveDocsMcpPromptsConfig, resolveDocsObservabilityConfig, resolveDocsRetrievalLastModified, resolveDocsReviewConfig, resolveDocsSearchAudience, resolveDocsSearchError, resolveDocsSearchFilters, resolveDocsSearchRequest, resolveDocsSitemapConfig, resolveDocsSitemapPageLastmod, resolveDocsSitemapRequest, resolveLocalDocsMcpSearchConfig, resolvePromptProviderChoices, resolveSearchRequestConfig, runDocsAuthoringMcpStdio, runDocsGoldenTasks, runDocsMcpStdio, sanitizePromptText, serializeDocsIcon, serializeDocsIconRegistry, serializeOpenDocsProvider, serializeOpenDocsProviders, toDocsSitemapMarkdownUrl, writeDocsAuthoringFile };
@@ -0,0 +1,38 @@
1
+ //#region src/text-transform-cache.ts
2
+ /** Bounded LRU cache for pure text transforms. Values are immutable strings. */
3
+ function createDocsTextTransformCache({ maxEntries = 512, maxCharacters = 4e6 } = {}) {
4
+ const entries = /* @__PURE__ */ new Map();
5
+ let characters = 0;
6
+ return {
7
+ get(source) {
8
+ const entry = entries.get(source);
9
+ if (!entry) return void 0;
10
+ entries.delete(source);
11
+ entries.set(source, entry);
12
+ return entry.value;
13
+ },
14
+ set(source, value) {
15
+ const previous = entries.get(source);
16
+ if (previous) {
17
+ entries.delete(source);
18
+ characters -= previous.characters;
19
+ }
20
+ const size = source.length + (source === value ? 0 : value.length);
21
+ if (maxEntries < 1 || size > maxCharacters) return;
22
+ entries.set(source, {
23
+ value,
24
+ characters: size
25
+ });
26
+ characters += size;
27
+ while (entries.size > maxEntries || characters > maxCharacters) {
28
+ const oldest = entries.entries().next().value;
29
+ if (!oldest) break;
30
+ entries.delete(oldest[0]);
31
+ characters -= oldest[1].characters;
32
+ }
33
+ }
34
+ };
35
+ }
36
+
37
+ //#endregion
38
+ export { createDocsTextTransformCache };
package/dist/types.d.mts CHANGED
@@ -1080,14 +1080,6 @@ interface LlmsTxtConfig {
1080
1080
  * @default true
1081
1081
  */
1082
1082
  apiCatalog?: boolean;
1083
- /**
1084
- * Render the `llms.txt` link as a visible header link instead of a visually hidden agent
1085
- * directive. The link gets `data-visible-in-header="true"`; style and place it in your site's
1086
- * CSS (`.fd-agent-llms-directive[data-visible-in-header="true"]`), and keep it clear of the
1087
- * search and menu buttons on narrow screens. The link stays in the page for agents either way.
1088
- * @default false
1089
- */
1090
- showInHeader?: boolean;
1091
1083
  /**
1092
1084
  * Base URL for your docs site (used to build absolute links in llms.txt).
1093
1085
  * @example "https://docs.example.com"
@@ -1441,7 +1433,7 @@ interface DocsMcpConfig {
1441
1433
  name?: string;
1442
1434
  /**
1443
1435
  * Version string reported by the MCP server.
1444
- * Defaults to `"0.0.0"` when not set.
1436
+ * Defaults to the app's `package.json` version, or `"0.0.0"` when it cannot be read.
1445
1437
  */
1446
1438
  version?: string;
1447
1439
  /** Fine-grained tool toggles. Omitted tools stay enabled. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farming-labs/docs",
3
- "version": "0.2.128",
3
+ "version": "0.2.129",
4
4
  "description": "Modern, flexible MDX-based docs framework — core types, config, and CLI",
5
5
  "keywords": [
6
6
  "docs",