@farming-labs/docs 0.2.120 → 0.2.122
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/README.md +8 -0
- package/dist/access.d.mts +13 -0
- package/dist/access.mjs +56 -0
- package/dist/agent-conformance.d.mts +60 -0
- package/dist/agent-conformance.mjs +538 -0
- package/dist/agent-contract.d.mts +47 -0
- package/dist/agent-contract.mjs +645 -0
- package/dist/agent-detection.d.mts +6 -0
- package/dist/agent-detection.mjs +83 -0
- package/dist/agent-evals.d.mts +224 -0
- package/dist/{agent-evals-BLNLvXbG.mjs → agent-evals.mjs} +7 -565
- package/dist/agent-feedback-evaluations-node.mjs +38 -0
- package/dist/agent-feedback-evaluations.d.mts +91 -0
- package/dist/{agent-feedback-evaluations-CcMGlgsO.mjs → agent-feedback-evaluations.mjs} +2 -2
- package/dist/agent-feedback-loop.d.mts +45 -0
- package/dist/{agent-feedback-loop-CcZL_sb1.mjs → agent-feedback-loop.mjs} +1 -1
- package/dist/agent-maintenance.d.mts +71 -0
- package/dist/{agent-maintenance-CuZ7iAKq.mjs → agent-maintenance.mjs} +1 -1
- package/dist/agent-provenance.d.mts +23 -0
- package/dist/agent-provenance.mjs +77 -0
- package/dist/agent-scope.mjs +321 -0
- package/dist/agent-skills-archive.mjs +86 -0
- package/dist/agent-skills-bundle.d.mts +1 -1
- package/dist/{agent-skills-progressive-disclosure-PjPtTYL-.mjs → agent-skills-progressive-disclosure.mjs} +2 -2
- package/dist/{agent-skills-server-D5IuvwM7.d.mts → agent-skills-server.d.mts} +3 -3
- package/dist/{agent-skills-server-BC7md56k.mjs → agent-skills-server.mjs} +2 -2
- package/dist/agent-skills-vite.d.mts +3 -3
- package/dist/agent-skills-vite.mjs +1 -2
- package/dist/agent-surface-drift.mjs +236 -0
- package/dist/{golden-evaluations-CLUViycJ.mjs → agent-usefulness.mjs} +5 -290
- package/dist/{content-change-hydration-wqXIZHp6.d.mts → agent.d.mts} +10 -411
- package/dist/agent.mjs +2729 -0
- package/dist/{analytics-w3FDOksr.d.mts → analytics.d.mts} +2 -2
- package/dist/{analytics-p8Vhhu2P.mjs → analytics.mjs} +2 -2
- package/dist/{sitemap-server-BUdPBcGs.d.mts → api-reference.d.mts} +2 -6
- package/dist/api-reference.mjs +1481 -0
- package/dist/{audience-exposure-DBrFWULA.d.mts → audience-exposure.d.mts} +1 -1
- package/dist/audience-exposure.mjs +8 -0
- package/dist/audience.d.mts +44 -0
- package/dist/audience.mjs +1654 -0
- package/dist/authoring-mcp.d.mts +44 -0
- package/dist/{authoring-mcp-CiCUQe3o.mjs → authoring-mcp.mjs} +3 -3
- package/dist/browser.d.mts +6 -4
- package/dist/browser.mjs +6 -7
- package/dist/build.d.mts +8 -0
- package/dist/build.mjs +8 -0
- package/dist/changelog.d.mts +20 -0
- package/dist/changelog.mjs +39 -0
- package/dist/{agent-export-CA6IUQ7T.mjs → cli/agent-export.mjs} +19 -45
- package/dist/{agent-CYk2DxY7.mjs → cli/agent.mjs} +6 -35
- package/dist/{agents-BUiVmj8i.mjs → cli/agents.mjs} +5 -18
- package/dist/cli/api-doctor.mjs +206 -0
- package/dist/{authoring-C2ymvYWl.mjs → cli/authoring.mjs} +2 -8
- package/dist/{cloud-6eKrlmKd.mjs → cli/cloud.mjs} +3 -3
- package/dist/{codeblocks-CHpgAwY-.mjs → cli/codeblocks.mjs} +2 -2
- package/dist/cli/config.d.mts +11 -0
- package/dist/{config-BZnKAj_Y.mjs → cli/config.mjs} +1 -1
- package/dist/cli/dev-banner.mjs +58 -0
- package/dist/{dev-Bnn-NUNa.mjs → cli/dev.mjs} +3 -57
- package/dist/{doctor-Bfkrkzad.mjs → cli/doctor.mjs} +41 -226
- package/dist/{downgrade-CHMta85e.mjs → cli/downgrade.mjs} +2 -2
- package/dist/cli/errors.d.mts +4 -0
- package/dist/{errors-BtnVLhNF.mjs → cli/errors.mjs} +1 -1
- package/dist/{feedback-evals-DMilg9pY.mjs → cli/feedback-evals.mjs} +3 -36
- package/dist/{feedback-DL4T5oIO.mjs → cli/feedback.mjs} +1 -1
- package/dist/cli/git-dates.mjs +35 -0
- package/dist/cli/golden-evaluations.mjs +52 -0
- package/dist/cli/index.d.mts +2 -3
- package/dist/cli/index.mjs +38 -38
- package/dist/{init-K0LmXDZ5.mjs → cli/init.mjs} +3 -3
- package/dist/{mcp-iLCmnPJI.mjs → cli/mcp.mjs} +7 -19
- package/dist/{openapi-diff-HcpUNjA-.mjs → cli/openapi-diff.mjs} +2 -7
- package/dist/{openapi-sdk-BQKC6H-_.mjs → cli/openapi-sdk.mjs} +2 -7
- package/dist/{openapi-source-DK6ts_Bk.mjs → cli/openapi-source.mjs} +2 -2
- package/dist/{package-version-HJhYeq4M.mjs → cli/package-version.mjs} +2 -2
- package/dist/{propose-JmUv_BTt.mjs → cli/propose.mjs} +1 -1
- package/dist/{review-C6EmbV0l.mjs → cli/review.mjs} +16 -15
- package/dist/{robots-DteZB8vl.mjs → cli/robots.mjs} +3 -7
- package/dist/{search-Bhuv_YsL.mjs → cli/search.mjs} +7 -20
- package/dist/{sitemap-DW5LDKDa.mjs → cli/sitemap.mjs} +7 -42
- package/dist/{skills-BAPQLSCm.mjs → cli/skills.mjs} +5 -19
- package/dist/{templates-BuQ8YsGv.mjs → cli/templates.mjs} +1 -1
- package/dist/{upgrade-DlQMOFV1.mjs → cli/upgrade.mjs} +2 -2
- package/dist/{utils-C7KDrPpA.mjs → cli/utils.mjs} +1 -1
- package/dist/client/react.d.mts +2 -18
- package/dist/client/react.mjs +1 -157
- package/dist/{cloud-analytics-D14HplI7.mjs → cloud-analytics.mjs} +1 -1
- package/dist/{cloud-ask-ai-BrsTXQf6.d.mts → cloud-ask-ai.d.mts} +2 -2
- package/dist/{cloud-ask-ai-BqKhjpS5.mjs → cloud-ask-ai.mjs} +3 -3
- package/dist/code-blocks.d.mts +51 -0
- package/dist/{code-blocks-GYdvS3BH.mjs → code-blocks.mjs} +2 -2
- package/dist/code-group-mdx.d.mts +11 -0
- package/dist/code-group-mdx.mjs +57 -0
- package/dist/content-change-hydration.d.mts +87 -0
- package/dist/{openapi-mcp-BIOTLiA7.mjs → content-change-hydration.mjs} +5 -210
- package/dist/content-changes.d.mts +47 -0
- package/dist/content-changes.mjs +216 -0
- package/dist/create-theme.d.mts +48 -0
- package/dist/create-theme.mjs +57 -0
- package/dist/date.d.mts +5 -0
- package/dist/date.mjs +17 -0
- package/dist/define-docs.d.mts +9 -0
- package/dist/define-docs.mjs +46 -0
- package/dist/docs-cloud-client.d.mts +18 -0
- package/dist/docs-cloud-client.mjs +161 -0
- package/dist/docs-cloud-server.d.mts +2 -2
- package/dist/docs-cloud-server.mjs +2 -3
- package/dist/heading-toc.d.mts +10 -0
- package/dist/heading-toc.mjs +23 -0
- package/dist/http-body.d.mts +14 -0
- package/dist/{http-body-DkAPk6D5.mjs → http-body.mjs} +1 -1
- package/dist/http-cache.d.mts +25 -0
- package/dist/http-cache.mjs +140 -0
- package/dist/http-link.mjs +81 -0
- package/dist/i18n.d.mts +18 -0
- package/dist/{i18n-B1gJ9EW0.mjs → i18n.mjs} +1 -1
- package/dist/index.d.mts +42 -674
- package/dist/index.mjs +40 -14
- package/dist/markdown-rendering.mjs +1 -1
- package/dist/markdown-section-cache.mjs +49 -0
- package/dist/markdown-sections.d.mts +47 -0
- package/dist/{markdown-sections-9Oxr33b-.mjs → markdown-sections.mjs} +29 -703
- package/dist/mcp-auth.d.mts +14 -0
- package/dist/mcp-auth.mjs +99 -0
- package/dist/mcp.d.mts +5 -3
- package/dist/mcp.mjs +21 -9
- package/dist/mdx.d.mts +6 -0
- package/dist/mdx.mjs +7 -0
- package/dist/metadata.d.mts +60 -0
- package/dist/{metadata-BOHn0Y5K.mjs → metadata.mjs} +2 -2
- package/dist/native-api-reference.mjs +968 -0
- package/dist/okf.d.mts +42 -0
- package/dist/okf.mjs +145 -0
- package/dist/openapi-contract.mjs +154 -0
- package/dist/{openapi-mcp-node-C4jUpZG6.mjs → openapi-mcp-node.mjs} +1 -1
- package/dist/openapi-mcp.d.mts +26 -0
- package/dist/openapi-mcp.mjs +132 -0
- package/dist/openapi-operations.d.mts +71 -0
- package/dist/{openapi-operations-DFpaqOqA.mjs → openapi-operations.mjs} +1 -1
- package/dist/openapi-overlays.mjs +221 -0
- package/dist/openapi-references.mjs +233 -0
- package/dist/pagination.d.mts +7 -0
- package/dist/pagination.mjs +100 -0
- package/dist/prompt-references.d.mts +12 -0
- package/dist/prompt-references.mjs +132 -0
- package/dist/prompt-utils.d.mts +36 -0
- package/dist/{prompt-utils-B5g-bv7o.mjs → prompt-utils.mjs} +1 -57
- package/dist/reading-time.d.mts +23 -0
- package/dist/reading-time.mjs +58 -0
- package/dist/related.d.mts +7 -0
- package/dist/related.mjs +50 -0
- package/dist/retrieval-digest.d.mts +16 -0
- package/dist/{retrieval-digest-CT-eIEcp.mjs → retrieval-digest.mjs} +1 -1
- package/dist/review.d.mts +69 -0
- package/dist/review.mjs +562 -0
- package/dist/robots.d.mts +54 -0
- package/dist/{robots-BYJAVeI6.mjs → robots.mjs} +5 -3
- package/dist/runtime.d.mts +3 -3
- package/dist/runtime.mjs +3 -9
- package/dist/search.d.mts +210 -0
- package/dist/search.mjs +3401 -0
- package/dist/server.d.mts +22 -198
- package/dist/server.mjs +21 -19
- package/dist/sidebar.d.mts +15 -0
- package/dist/sidebar.mjs +73 -0
- package/dist/sitemap-server.d.mts +7 -0
- package/dist/{sitemap-server-Lg3YhUx4.mjs → sitemap-server.mjs} +2 -2
- package/dist/{sitemap-Cl8vrixd.d.mts → sitemap.d.mts} +3 -3
- package/dist/sitemap.mjs +254 -0
- package/dist/{standards-discovery-BHPc7YIX.d.mts → standards-discovery.d.mts} +2 -2
- package/dist/{standards-discovery-sSEojU80.mjs → standards-discovery.mjs} +3 -139
- package/dist/telemetry-runtime.d.mts +42 -0
- package/dist/telemetry-runtime.mjs +238 -0
- package/dist/telemetry.d.mts +15 -0
- package/dist/telemetry.mjs +117 -0
- package/dist/{types-BJFeMXWZ.d.mts → types.d.mts} +3 -2
- package/dist/urls.d.mts +7 -0
- package/dist/urls.mjs +21 -0
- package/dist/utils.d.mts +8 -0
- package/dist/utils.mjs +22 -0
- package/package.json +21 -3
- package/dist/agent-DkAidqtV.mjs +0 -9026
- package/dist/api-reference-BYee4zMo.mjs +0 -3046
- package/dist/prompt-references-DMgbu_dz.mjs +0 -1082
- package/dist/retrieval-digest-AOx2-LbC.d.mts +0 -367
- package/dist/sidebar-CFHBj29f.mjs +0 -421
- package/dist/sidebar-CMPbVfGP.d.mts +0 -63
- /package/dist/{openapi-CfCzX_a1.mjs → cli/openapi.mjs} +0 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/server";
|
|
2
|
+
|
|
3
|
+
//#region src/authoring-mcp.d.ts
|
|
4
|
+
interface DocsAuthoringMcpOptions {
|
|
5
|
+
rootDir: string;
|
|
6
|
+
/** Project-relative or absolute docs content directory. @default entry */
|
|
7
|
+
contentDir?: string;
|
|
8
|
+
/** Public docs entry and default content directory. @default "docs" */
|
|
9
|
+
entry?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
version?: string;
|
|
12
|
+
/** Branches created by the server must use this prefix. @default "docs/" */
|
|
13
|
+
branchPrefix?: string;
|
|
14
|
+
/** Pull request base branch. @default repository default resolved by gh */
|
|
15
|
+
baseBranch?: string;
|
|
16
|
+
/** Command argv used by authoring_run_doctor. The first item is the executable. */
|
|
17
|
+
doctorCommand?: readonly [string, ...string[]];
|
|
18
|
+
/** Register the external draft-PR publishing tool. Never enabled implicitly. */
|
|
19
|
+
allowPublish?: boolean;
|
|
20
|
+
maxFileBytes?: number;
|
|
21
|
+
}
|
|
22
|
+
interface DocsAuthoringFileState {
|
|
23
|
+
path: string;
|
|
24
|
+
sha256: string;
|
|
25
|
+
bytes: number;
|
|
26
|
+
content: string;
|
|
27
|
+
}
|
|
28
|
+
declare function readDocsAuthoringFile(options: DocsAuthoringMcpOptions, filePath: string): DocsAuthoringFileState;
|
|
29
|
+
declare function writeDocsAuthoringFile(options: DocsAuthoringMcpOptions, input: {
|
|
30
|
+
path: string;
|
|
31
|
+
content: string;
|
|
32
|
+
expectedSha256?: string;
|
|
33
|
+
}): DocsAuthoringFileState;
|
|
34
|
+
/**
|
|
35
|
+
* Create a protected authoring-only MCP server.
|
|
36
|
+
*
|
|
37
|
+
* This server is intentionally separate from createDocsMcpServer and is never wired into public
|
|
38
|
+
* framework adapters. Use stdio locally or place the returned server behind an authenticated,
|
|
39
|
+
* authoring-scoped transport.
|
|
40
|
+
*/
|
|
41
|
+
declare function createDocsAuthoringMcpServer(options: DocsAuthoringMcpOptions): Promise<McpServer>;
|
|
42
|
+
declare function runDocsAuthoringMcpStdio(options: DocsAuthoringMcpOptions): Promise<void>;
|
|
43
|
+
//#endregion
|
|
44
|
+
export { DocsAuthoringFileState, DocsAuthoringMcpOptions, createDocsAuthoringMcpServer, readDocsAuthoringFile, runDocsAuthoringMcpStdio, writeDocsAuthoringFile };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { renderDocsMarkdownDocument } from "./agent.mjs";
|
|
2
2
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { analyzeDocsAgentFeedback, readDocsAgentFeedbackFile } from "./agent-feedback-loop.mjs";
|
|
4
4
|
import { existsSync, lstatSync, mkdirSync, readFileSync, realpathSync, renameSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -377,4 +377,4 @@ async function runDocsAuthoringMcpStdio(options) {
|
|
|
377
377
|
}
|
|
378
378
|
|
|
379
379
|
//#endregion
|
|
380
|
-
export {
|
|
380
|
+
export { createDocsAuthoringMcpServer, readDocsAuthoringFile, runDocsAuthoringMcpStdio, writeDocsAuthoringFile };
|
package/dist/browser.d.mts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { emitDocsAnalyticsEvent, resolveDocsAnalyticsConfig } from "./analytics.mjs";
|
|
2
|
+
import { DocsTelemetryPageViewContext, emitDocsTelemetryPageViewEvent } from "./telemetry-runtime.mjs";
|
|
3
|
+
import { applySidebarFolderIndexBehavior } from "./sidebar.mjs";
|
|
4
|
+
import { buildDocsPageStructuredData } from "./metadata.mjs";
|
|
5
|
+
import { DocsContentAudience, resolveDocsAudienceExposure } from "./audience-exposure.mjs";
|
|
6
|
+
export { type DocsContentAudience, type DocsTelemetryPageViewContext, applySidebarFolderIndexBehavior, buildDocsPageStructuredData, emitDocsAnalyticsEvent, emitDocsTelemetryPageViewEvent, resolveDocsAnalyticsConfig, resolveDocsAudienceExposure };
|
package/dist/browser.mjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import "./
|
|
6
|
-
import { c as emitDocsTelemetryPageViewEvent, t as applySidebarFolderIndexBehavior } from "./sidebar-CFHBj29f.mjs";
|
|
1
|
+
import { emitDocsAnalyticsEvent, resolveDocsAnalyticsConfig } from "./analytics.mjs";
|
|
2
|
+
import { resolveDocsAudienceExposure } from "./audience-exposure.mjs";
|
|
3
|
+
import { emitDocsTelemetryPageViewEvent } from "./telemetry-runtime.mjs";
|
|
4
|
+
import { buildDocsPageStructuredData } from "./metadata.mjs";
|
|
5
|
+
import { applySidebarFolderIndexBehavior } from "./sidebar.mjs";
|
|
7
6
|
|
|
8
|
-
export { applySidebarFolderIndexBehavior, emitDocsAnalyticsEvent, emitDocsTelemetryPageViewEvent, resolveDocsAnalyticsConfig, resolveDocsAudienceExposure };
|
|
7
|
+
export { applySidebarFolderIndexBehavior, buildDocsPageStructuredData, emitDocsAnalyticsEvent, emitDocsTelemetryPageViewEvent, resolveDocsAnalyticsConfig, resolveDocsAudienceExposure };
|
package/dist/build.d.mts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DocsConfig } from "./types.mjs";
|
|
2
|
+
import { 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 } from "./standards-discovery.mjs";
|
|
3
|
+
import { resolveConfiguredAgentSkillsSync } from "./agent-skills-server.mjs";
|
|
4
|
+
import { renderDocsAgentSkillsBundle } from "./agent-skills-vite.mjs";
|
|
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
|
+
import { ensureDocsReviewWorkflow } from "./review.mjs";
|
|
7
|
+
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 };
|
package/dist/build.mjs
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
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";
|
|
2
|
+
import { 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 } from "./standards-discovery.mjs";
|
|
3
|
+
import { resolveConfiguredAgentSkillsSync } from "./agent-skills-server.mjs";
|
|
4
|
+
import { ensureDocsReviewWorkflow } from "./review.mjs";
|
|
5
|
+
import { renderDocsAgentSkillsBundle } from "./agent-skills-vite.mjs";
|
|
6
|
+
import { loadDocsConfigModule } from "./cli/config.mjs";
|
|
7
|
+
|
|
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 };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ChangelogFrontmatter, DocsConfig } from "./types.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/changelog.d.ts
|
|
4
|
+
interface ResolvedChangelogConfig {
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
path: string;
|
|
7
|
+
contentDir: string;
|
|
8
|
+
title: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
search: boolean;
|
|
11
|
+
actionsComponent?: unknown;
|
|
12
|
+
}
|
|
13
|
+
interface ChangelogEntrySummary extends ChangelogFrontmatter {
|
|
14
|
+
slug: string;
|
|
15
|
+
date: string;
|
|
16
|
+
url: string;
|
|
17
|
+
}
|
|
18
|
+
declare function resolveChangelogConfig(value: DocsConfig["changelog"]): ResolvedChangelogConfig;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { ChangelogEntrySummary, ResolvedChangelogConfig, resolveChangelogConfig };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//#region src/changelog.ts
|
|
2
|
+
function normalizePathSegment(value, fallback) {
|
|
3
|
+
return (value ?? fallback).trim().replace(/^\/+|\/+$/g, "") || fallback;
|
|
4
|
+
}
|
|
5
|
+
function normalizeContentDir(value) {
|
|
6
|
+
const trimmed = value?.trim();
|
|
7
|
+
if (!trimmed) return "changelog";
|
|
8
|
+
return trimmed.replace(/\/+$/, "") || "changelog";
|
|
9
|
+
}
|
|
10
|
+
function resolveChangelogConfig(value) {
|
|
11
|
+
if (value === false || value === void 0) return {
|
|
12
|
+
enabled: false,
|
|
13
|
+
path: "changelog",
|
|
14
|
+
contentDir: "changelog",
|
|
15
|
+
title: "Changelog",
|
|
16
|
+
description: void 0,
|
|
17
|
+
search: true
|
|
18
|
+
};
|
|
19
|
+
if (value === true) return {
|
|
20
|
+
enabled: true,
|
|
21
|
+
path: "changelog",
|
|
22
|
+
contentDir: "changelog",
|
|
23
|
+
title: "Changelog",
|
|
24
|
+
description: void 0,
|
|
25
|
+
search: true
|
|
26
|
+
};
|
|
27
|
+
return {
|
|
28
|
+
enabled: value.enabled !== false,
|
|
29
|
+
path: normalizePathSegment(value.path, "changelog"),
|
|
30
|
+
contentDir: normalizeContentDir(value.contentDir),
|
|
31
|
+
title: value.title?.trim() || "Changelog",
|
|
32
|
+
description: value.description?.trim() || void 0,
|
|
33
|
+
search: value.search !== false,
|
|
34
|
+
actionsComponent: value.actionsComponent
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
export { resolveChangelogConfig };
|
|
@@ -1,27 +1,20 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import "
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import "
|
|
9
|
-
import "
|
|
10
|
-
import "
|
|
11
|
-
import {
|
|
12
|
-
import "./
|
|
13
|
-
import {
|
|
14
|
-
import "./
|
|
15
|
-
import "./cloud-ask-ai-BqKhjpS5.mjs";
|
|
16
|
-
import "./code-blocks-GYdvS3BH.mjs";
|
|
17
|
-
import "./sitemap-server-Lg3YhUx4.mjs";
|
|
18
|
-
import "./server.mjs";
|
|
19
|
-
import { _ as resolveDocsContentDir, a as loadDocsConfigModule, d as readNavTitle, g as resolveDocsConfigPath, h as readTopLevelStringProperty, l as readBooleanProperty, m as readTopLevelBooleanProperty, p as readStringProperty, r as extractTopLevelConfigObject, t as extractNestedObjectLiteral } from "./config-BZnKAj_Y.mjs";
|
|
20
|
-
import { t as detectFramework } from "./utils-C7KDrPpA.mjs";
|
|
1
|
+
import { isDocsAgentPageAccessible } from "../access.mjs";
|
|
2
|
+
import { toDocsMarkdownUrl } from "../urls.mjs";
|
|
3
|
+
import { buildDocsOkfBundle, resolveDocsOkfConfig } from "../okf.mjs";
|
|
4
|
+
import { formatDocsContentDigest, resolveDocsHttpDate } from "../http-cache.mjs";
|
|
5
|
+
import { DEFAULT_A2A_AGENT_CARD_ROUTE, DEFAULT_AGENT_SKILLS_INDEX_ROUTE, DEFAULT_AGENT_SKILLS_ROUTE_PREFIX, DEFAULT_LEGACY_SKILLS_INDEX_ROUTE, DEFAULT_LEGACY_SKILLS_ROUTE_PREFIX, buildDocsA2AAgentCard, buildDocsAgentSkillsIndex, buildDocsLegacySkillsIndex, resolveDocsPublishedAgentSkill } from "../standards-discovery.mjs";
|
|
6
|
+
import { buildDocsSitemapManifest, renderDocsSitemapMarkdown, renderDocsSitemapXml, resolveDocsSitemapConfig } from "../sitemap.mjs";
|
|
7
|
+
import { DEFAULT_AGENTS_MD_ROUTE, DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, DEFAULT_AGENT_MD_ROUTE, DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE, DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, DEFAULT_LLMS_FULL_TXT_ROUTE, DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE, DEFAULT_LLMS_TXT_ROUTE, DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE, DEFAULT_SKILL_MD_ROUTE, DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, buildDocsAgentDiscoverySpec, renderDocsAgentsDocument, renderDocsLlmsTxt, renderDocsMarkdownDocument, renderDocsSkillDocument, resolveDocsAgentFeedbackConfig } from "../agent.mjs";
|
|
8
|
+
import { resolveDocsI18n } from "../i18n.mjs";
|
|
9
|
+
import { DOCS_ROBOTS_GENERATED_BLOCK_END, DOCS_ROBOTS_GENERATED_BLOCK_START, renderDocsRobotsGeneratedBlock, resolveDocsRobotsConfig, upsertDocsRobotsGeneratedBlock } from "../robots.mjs";
|
|
10
|
+
import { resolveConfiguredAgentSkills } from "../agent-skills-server.mjs";
|
|
11
|
+
import { createFilesystemDocsMcpSource, resolveDocsMcpConfig } from "../mcp.mjs";
|
|
12
|
+
import { extractNestedObjectLiteral, extractTopLevelConfigObject, loadDocsConfigModule, readBooleanProperty, readNavTitle, readStringProperty, readTopLevelBooleanProperty, readTopLevelStringProperty, resolveDocsConfigPath, resolveDocsContentDir } from "./config.mjs";
|
|
13
|
+
import { readGitLastModifiedDates } from "./git-dates.mjs";
|
|
14
|
+
import { detectFramework } from "./utils.mjs";
|
|
21
15
|
import { existsSync, lstatSync, mkdirSync, readFileSync, realpathSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
22
16
|
import path from "node:path";
|
|
23
17
|
import { createHash, randomUUID } from "node:crypto";
|
|
24
|
-
import { execFileSync } from "node:child_process";
|
|
25
18
|
import pc from "picocolors";
|
|
26
19
|
|
|
27
20
|
//#region src/cli/agent-export.ts
|
|
@@ -345,27 +338,6 @@ function formatDateOnly(value) {
|
|
|
345
338
|
if (Number.isNaN(parsed.getTime())) return void 0;
|
|
346
339
|
return parsed.toISOString().slice(0, 10);
|
|
347
340
|
}
|
|
348
|
-
function pageGitLastmod(rootDir, page) {
|
|
349
|
-
if (page.sourcePath) try {
|
|
350
|
-
const output = execFileSync("git", [
|
|
351
|
-
"log",
|
|
352
|
-
"-1",
|
|
353
|
-
"--format=%cI",
|
|
354
|
-
"--",
|
|
355
|
-
page.sourcePath
|
|
356
|
-
], {
|
|
357
|
-
cwd: rootDir,
|
|
358
|
-
encoding: "utf-8",
|
|
359
|
-
stdio: [
|
|
360
|
-
"ignore",
|
|
361
|
-
"pipe",
|
|
362
|
-
"ignore"
|
|
363
|
-
]
|
|
364
|
-
}).trim();
|
|
365
|
-
const parsed = new Date(output);
|
|
366
|
-
if (!Number.isNaN(parsed.getTime())) return parsed.toISOString();
|
|
367
|
-
} catch {}
|
|
368
|
-
}
|
|
369
341
|
function deterministicSitemapManifest(options) {
|
|
370
342
|
const manifest = buildDocsSitemapManifest({
|
|
371
343
|
pages: options.pages,
|
|
@@ -672,15 +644,17 @@ async function exportAgentBundle(options = {}) {
|
|
|
672
644
|
if (!internalManifestPath) throw new Error(`Agent Bundle internal manifest must resolve inside the project root: ${AGENT_BUNDLE_INTERNAL_MANIFEST}`);
|
|
673
645
|
const publicManifestPath = publicFilePath(publicDir, AGENT_BUNDLE_MANIFEST_ROUTE);
|
|
674
646
|
const previous = readPreviousManifest(internalManifestPath);
|
|
675
|
-
const
|
|
647
|
+
const scannedPages = await loadPages({
|
|
676
648
|
rootDir,
|
|
677
649
|
contentDir,
|
|
678
650
|
routeEntry,
|
|
679
651
|
siteTitle: resolvedSiteTitle,
|
|
680
652
|
ordering: config?.ordering,
|
|
681
653
|
i18n
|
|
682
|
-
})
|
|
683
|
-
|
|
654
|
+
});
|
|
655
|
+
const gitDates = await readGitLastModifiedDates(rootDir, scannedPages.map(({ page }) => page.sourcePath));
|
|
656
|
+
const localizedPages = scannedPages.map(({ page, locale }) => {
|
|
657
|
+
const gitLastmod = gitDates.get(page.sourcePath ?? "");
|
|
684
658
|
return {
|
|
685
659
|
locale,
|
|
686
660
|
page: {
|
|
@@ -1,44 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { createFilesystemDocsMcpSource } from "
|
|
5
|
-
import {
|
|
6
|
-
import { createRequire } from "node:module";
|
|
1
|
+
import { normalizePageAgentFrontmatter, stripGeneratedPageAgentContractMarkdown } from "../agent-contract.mjs";
|
|
2
|
+
import { findDocsMarkdownPage, renderDocsMarkdownDocument } from "../agent.mjs";
|
|
3
|
+
import { GENERATED_AGENT_PROVENANCE_VERSION, hashGeneratedAgentContent, parseGeneratedAgentDocument, serializeGeneratedAgentDocument } from "../agent-provenance.mjs";
|
|
4
|
+
import { createFilesystemDocsMcpSource } from "../mcp.mjs";
|
|
5
|
+
import { extractNestedObjectLiteral, loadDocsConfigModule, loadProjectEnv, readBooleanProperty, readEnvReferenceProperty, readNavTitle, readNumberProperty, readStringProperty, readTopLevelStringProperty, resolveDocsConfigPath, resolveDocsContentDir } from "./config.mjs";
|
|
7
6
|
import matter from "gray-matter";
|
|
8
7
|
import { existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, renameSync, statSync, writeFileSync } from "node:fs";
|
|
9
8
|
import path from "node:path";
|
|
10
9
|
import { execFileSync } from "node:child_process";
|
|
11
10
|
import pc from "picocolors";
|
|
12
11
|
|
|
13
|
-
//#region \0rolldown/runtime.js
|
|
14
|
-
var __defProp = Object.defineProperty;
|
|
15
|
-
var __exportAll = (all, no_symbols) => {
|
|
16
|
-
let target = {};
|
|
17
|
-
for (var name in all) {
|
|
18
|
-
__defProp(target, name, {
|
|
19
|
-
get: all[name],
|
|
20
|
-
enumerable: true
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
if (!no_symbols) {
|
|
24
|
-
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
25
|
-
}
|
|
26
|
-
return target;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
//#endregion
|
|
30
12
|
//#region src/cli/agent.ts
|
|
31
|
-
var agent_exports = /* @__PURE__ */ __exportAll({
|
|
32
|
-
AGENT_COMPACTION_REVIEW_MANIFEST_VERSION: () => AGENT_COMPACTION_REVIEW_MANIFEST_VERSION,
|
|
33
|
-
DEFAULT_AGENT_COMPACTION_REVIEW_MANIFEST_PATH: () => DEFAULT_AGENT_COMPACTION_REVIEW_MANIFEST_PATH,
|
|
34
|
-
compactAgentDocs: () => compactAgentDocs,
|
|
35
|
-
inspectAgentCompactionState: () => inspectAgentCompactionState,
|
|
36
|
-
loadAgentCompactionReviews: () => loadAgentCompactionReviews,
|
|
37
|
-
parseAgentCompactArgs: () => parseAgentCompactArgs,
|
|
38
|
-
printAgentCompactHelp: () => printAgentCompactHelp,
|
|
39
|
-
readPageTokenBudget: () => readPageTokenBudget,
|
|
40
|
-
scanDocsPageTargets: () => scanDocsPageTargets
|
|
41
|
-
});
|
|
42
13
|
const DEFAULT_COMPRESSION_BASE_URL = "https://api.farming-labs.dev";
|
|
43
14
|
const DEFAULT_COMPRESSION_MODEL = "docs-cloud-compress-v1";
|
|
44
15
|
const DEFAULT_COMPRESSION_AGGRESSIVENESS = .3;
|
|
@@ -818,4 +789,4 @@ ${pc.dim("Options:")}
|
|
|
818
789
|
}
|
|
819
790
|
|
|
820
791
|
//#endregion
|
|
821
|
-
export {
|
|
792
|
+
export { compactAgentDocs, inspectAgentCompactionState, loadAgentCompactionReviews, parseAgentCompactArgs, printAgentCompactHelp, scanDocsPageTargets };
|
|
@@ -1,21 +1,8 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import "
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import "./openapi-mcp-BIOTLiA7.mjs";
|
|
7
|
-
import "./prompt-utils-B5g-bv7o.mjs";
|
|
8
|
-
import { p as resolveApiReferenceOpenApiDiscovery } from "./api-reference-BYee4zMo.mjs";
|
|
9
|
-
import "./agent-skills-server-BC7md56k.mjs";
|
|
10
|
-
import "./agent-evals-BLNLvXbG.mjs";
|
|
11
|
-
import { resolveDocsMcpConfig } from "./mcp.mjs";
|
|
12
|
-
import "./authoring-mcp-CiCUQe3o.mjs";
|
|
13
|
-
import "./cloud-ask-ai-BqKhjpS5.mjs";
|
|
14
|
-
import "./code-blocks-GYdvS3BH.mjs";
|
|
15
|
-
import "./sitemap-server-Lg3YhUx4.mjs";
|
|
16
|
-
import "./server.mjs";
|
|
17
|
-
import { a as loadDocsConfigModule, d as readNavTitle, g as resolveDocsConfigPath, h as readTopLevelStringProperty, l as readBooleanProperty, p as readStringProperty, t as extractNestedObjectLiteral } from "./config-BZnKAj_Y.mjs";
|
|
18
|
-
import { t as detectFramework } from "./utils-C7KDrPpA.mjs";
|
|
1
|
+
import { DEFAULT_AGENTS_MD_ROUTE, DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, DEFAULT_AGENT_MD_ROUTE, DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE, renderDocsAgentsDocument, resolveDocsAgentFeedbackConfig } from "../agent.mjs";
|
|
2
|
+
import { resolveApiReferenceOpenApiDiscovery } from "../api-reference.mjs";
|
|
3
|
+
import { resolveDocsMcpConfig } from "../mcp.mjs";
|
|
4
|
+
import { extractNestedObjectLiteral, loadDocsConfigModule, readBooleanProperty, readNavTitle, readStringProperty, readTopLevelStringProperty, resolveDocsConfigPath } from "./config.mjs";
|
|
5
|
+
import { detectFramework } from "./utils.mjs";
|
|
19
6
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
20
7
|
import path from "node:path";
|
|
21
8
|
import pc from "picocolors";
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { buildNormalizedOpenApiModel } from "../openapi-operations.mjs";
|
|
2
|
+
import { validateOpenApiContract } from "../openapi-contract.mjs";
|
|
3
|
+
import { buildApiReferenceOperationPagesAsync, loadApiReferenceOpenApiDocumentAsync, resolveApiReferenceConfig, resolveApiReferenceRenderer } from "../api-reference.mjs";
|
|
4
|
+
import { loadDocsConfigModuleResultWithProjectEnv, resolveDocsConfigPath, resolveDocsProjectRoot } from "./config.mjs";
|
|
5
|
+
import { detectFramework } from "./utils.mjs";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
|
|
8
|
+
//#region src/cli/api-doctor.ts
|
|
9
|
+
function makeCheck(id, title, status, detail, recommendation) {
|
|
10
|
+
return {
|
|
11
|
+
id,
|
|
12
|
+
title,
|
|
13
|
+
status,
|
|
14
|
+
detail,
|
|
15
|
+
recommendation
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function toApiReferenceFramework(framework) {
|
|
19
|
+
return framework === "nextjs" ? "next" : framework;
|
|
20
|
+
}
|
|
21
|
+
function sourceType(source) {
|
|
22
|
+
if (!source) return "generated";
|
|
23
|
+
if (/^https?:/i.test(source) || source.startsWith("/")) return "remote";
|
|
24
|
+
return "local";
|
|
25
|
+
}
|
|
26
|
+
function displaySource(source, routeRoot) {
|
|
27
|
+
if (!source) return `generated:${routeRoot}`;
|
|
28
|
+
if (source.startsWith("/")) return source.split(/[?#]/, 1)[0] || "/";
|
|
29
|
+
if (!/^https?:/i.test(source)) return source;
|
|
30
|
+
try {
|
|
31
|
+
const url = new URL(source);
|
|
32
|
+
url.username = url.username ? "redacted" : "";
|
|
33
|
+
url.password = url.password ? "redacted" : "";
|
|
34
|
+
url.search = "";
|
|
35
|
+
url.hash = "";
|
|
36
|
+
return url.href;
|
|
37
|
+
} catch {
|
|
38
|
+
return "configured remote source";
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function unique(values) {
|
|
42
|
+
return new Set(values).size === values.length;
|
|
43
|
+
}
|
|
44
|
+
function failedReport(framework, detail, recommendation) {
|
|
45
|
+
return {
|
|
46
|
+
mode: "api",
|
|
47
|
+
framework,
|
|
48
|
+
enabled: false,
|
|
49
|
+
sourceCount: 0,
|
|
50
|
+
operationCount: 0,
|
|
51
|
+
checks: [makeCheck("config", "API reference config", "fail", detail, recommendation)],
|
|
52
|
+
sources: [],
|
|
53
|
+
recommendations: [recommendation]
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
async function inspectApiReferenceHealth(options = {}) {
|
|
57
|
+
const invocationRoot = process.cwd();
|
|
58
|
+
let configPath;
|
|
59
|
+
let rootDir;
|
|
60
|
+
let framework = "unknown";
|
|
61
|
+
try {
|
|
62
|
+
configPath = resolveDocsConfigPath(invocationRoot, options.configPath);
|
|
63
|
+
rootDir = resolveDocsProjectRoot(invocationRoot, configPath);
|
|
64
|
+
framework = detectFramework(rootDir) ?? "unknown";
|
|
65
|
+
} catch (error) {
|
|
66
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
67
|
+
framework = detectFramework(invocationRoot) ?? "unknown";
|
|
68
|
+
return failedReport(framework, message, "Add docs.config.ts[x] or pass --config so the API doctor can inspect the contract.");
|
|
69
|
+
}
|
|
70
|
+
const configLoad = await loadDocsConfigModuleResultWithProjectEnv(rootDir, configPath);
|
|
71
|
+
if (configLoad.status !== "evaluated") return {
|
|
72
|
+
...failedReport(framework, `Could not evaluate ${path.relative(rootDir, configPath).replace(/\\/g, "/")}. ${configLoad.error}`, "Fix docs.config module evaluation so API sources, versions, overlays, and renderer settings can be validated."),
|
|
73
|
+
configPath: path.relative(rootDir, configPath).replace(/\\/g, "/")
|
|
74
|
+
};
|
|
75
|
+
const config = configLoad.config;
|
|
76
|
+
let apiReference;
|
|
77
|
+
try {
|
|
78
|
+
apiReference = resolveApiReferenceConfig(config.apiReference);
|
|
79
|
+
} catch (error) {
|
|
80
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
81
|
+
return {
|
|
82
|
+
...failedReport(framework, message, "Correct the apiReference configuration, then rerun docs doctor --api."),
|
|
83
|
+
configPath: path.relative(rootDir, configPath).replace(/\\/g, "/")
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
const relativeConfigPath = path.relative(rootDir, configPath).replace(/\\/g, "/");
|
|
87
|
+
if (!apiReference.enabled) {
|
|
88
|
+
const recommendation = "Enable apiReference when this project should publish an OpenAPI contract and generated operation documentation.";
|
|
89
|
+
return {
|
|
90
|
+
mode: "api",
|
|
91
|
+
framework,
|
|
92
|
+
configPath: relativeConfigPath,
|
|
93
|
+
enabled: false,
|
|
94
|
+
sourceCount: 0,
|
|
95
|
+
operationCount: 0,
|
|
96
|
+
checks: [makeCheck("config", "API reference config", "warn", "apiReference is disabled; there is no API contract to inspect.", recommendation)],
|
|
97
|
+
sources: [],
|
|
98
|
+
recommendations: [recommendation]
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
if (framework === "unknown") return {
|
|
102
|
+
...failedReport(framework, "Could not detect a supported framework from package.json.", "Install or declare Next.js, TanStack Start, Farm.js, SvelteKit, Astro, or Nuxt in the docs app package."),
|
|
103
|
+
configPath: relativeConfigPath,
|
|
104
|
+
enabled: true
|
|
105
|
+
};
|
|
106
|
+
const apiFramework = toApiReferenceFramework(framework);
|
|
107
|
+
const renderer = resolveApiReferenceRenderer(config.apiReference, apiFramework);
|
|
108
|
+
const configuredSources = apiReference.versions.length > 0 ? apiReference.versions.map((version) => ({
|
|
109
|
+
id: version.id,
|
|
110
|
+
label: version.label,
|
|
111
|
+
default: version.default,
|
|
112
|
+
specUrl: version.specUrl,
|
|
113
|
+
overlays: version.overlays
|
|
114
|
+
})) : [{
|
|
115
|
+
id: "default",
|
|
116
|
+
label: "Default",
|
|
117
|
+
default: true,
|
|
118
|
+
specUrl: apiReference.specUrl,
|
|
119
|
+
overlays: apiReference.overlays
|
|
120
|
+
}];
|
|
121
|
+
const loadedSources = await Promise.all(configuredSources.map(async (source) => {
|
|
122
|
+
const baseReport = {
|
|
123
|
+
id: source.id,
|
|
124
|
+
label: source.label,
|
|
125
|
+
default: source.default,
|
|
126
|
+
source: displaySource(source.specUrl, apiReference.routeRoot),
|
|
127
|
+
sourceType: sourceType(source.specUrl),
|
|
128
|
+
overlays: source.overlays.length,
|
|
129
|
+
status: "fail",
|
|
130
|
+
operationCount: 0
|
|
131
|
+
};
|
|
132
|
+
try {
|
|
133
|
+
const document = await loadApiReferenceOpenApiDocumentAsync(config, {
|
|
134
|
+
framework: apiFramework,
|
|
135
|
+
rootDir,
|
|
136
|
+
baseUrl: options.baseUrl,
|
|
137
|
+
version: apiReference.versions.length > 0 ? source.id : void 0
|
|
138
|
+
});
|
|
139
|
+
const validation = validateOpenApiContract(document);
|
|
140
|
+
if (!validation.valid) {
|
|
141
|
+
const first = validation.diagnostics[0];
|
|
142
|
+
throw new Error(first ? `${first.path}: ${first.message}` : "The resolved OpenAPI document is invalid.");
|
|
143
|
+
}
|
|
144
|
+
const model = buildNormalizedOpenApiModel(document);
|
|
145
|
+
return {
|
|
146
|
+
report: {
|
|
147
|
+
...baseReport,
|
|
148
|
+
status: "pass",
|
|
149
|
+
specificationVersion: model.specificationVersion,
|
|
150
|
+
operationCount: model.operationCount
|
|
151
|
+
},
|
|
152
|
+
operationIds: model.operations.map((operation) => operation.operationId),
|
|
153
|
+
operationSlugs: model.operations.map((operation) => operation.slug)
|
|
154
|
+
};
|
|
155
|
+
} catch (error) {
|
|
156
|
+
return {
|
|
157
|
+
report: {
|
|
158
|
+
...baseReport,
|
|
159
|
+
diagnostic: error instanceof Error ? error.message : String(error)
|
|
160
|
+
},
|
|
161
|
+
operationIds: [],
|
|
162
|
+
operationSlugs: []
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
}));
|
|
166
|
+
const sources = loadedSources.map((source) => source.report);
|
|
167
|
+
const failedSources = sources.filter((source) => source.status === "fail");
|
|
168
|
+
const operationCount = sources.reduce((total, source) => total + source.operationCount, 0);
|
|
169
|
+
const checks = [makeCheck("config", "API reference config", "pass", `Evaluated ${relativeConfigPath}; API reference is enabled at /${apiReference.path}.`), makeCheck("versions", "Versions and default", "pass", apiReference.versions.length > 0 ? `Resolved ${apiReference.versions.length} named versions with ${apiReference.defaultVersion} as the explicit default.` : "Resolved one unversioned API contract.")];
|
|
170
|
+
checks.push(failedSources.length === 0 ? makeCheck("sources", "Sources, references, and overlays", "pass", `Loaded ${sources.length} ${sources.length === 1 ? "contract" : "contracts"}, resolved references, and applied ${sources.reduce((total, source) => total + source.overlays, 0)} configured overlays.`) : makeCheck("sources", "Sources, references, and overlays", "fail", failedSources.map((source) => `${source.label}: ${source.diagnostic ?? "unknown error"}`).join(" "), "Fix the reported source, parsing, reference, validation, or overlay error and rerun docs doctor --api."));
|
|
171
|
+
const identityFailure = loadedSources.find((source) => !unique(source.operationIds) || !unique(source.operationSlugs));
|
|
172
|
+
checks.push(identityFailure ? makeCheck("operation-identities", "Operation IDs and slugs", "fail", `${identityFailure.report.label} produced duplicate normalized operation IDs or slugs.`, "Give every operation a stable, unique operationId and remove normalized slug collisions.") : makeCheck("operation-identities", "Operation IDs and slugs", failedSources.length > 0 ? "warn" : "pass", failedSources.length > 0 ? "Operation identities could only be checked for contracts that loaded successfully." : `Validated ${operationCount} unique normalized operation identities across ${sources.length} ${sources.length === 1 ? "contract" : "contracts"}.`));
|
|
173
|
+
const rendererCompatible = renderer !== "fumadocs" || framework === "nextjs";
|
|
174
|
+
checks.push(rendererCompatible ? makeCheck("renderer", "Renderer compatibility", "pass", `${renderer} is supported by ${framework}.`) : makeCheck("renderer", "Renderer compatibility", "fail", `The fumadocs renderer is only available for Next.js; ${framework} supports the Farming Labs and Scalar renderers.`, "Set apiReference.renderer to \"farming-labs\" or \"scalar\" for this framework."));
|
|
175
|
+
if (failedSources.length === 0 && !identityFailure) try {
|
|
176
|
+
const pages = await buildApiReferenceOperationPagesAsync(config, {
|
|
177
|
+
framework: apiFramework,
|
|
178
|
+
rootDir,
|
|
179
|
+
baseUrl: options.baseUrl
|
|
180
|
+
});
|
|
181
|
+
const pageUrls = pages.map((page) => page.url);
|
|
182
|
+
const completePages = pages.every((page) => page.type === "api" && page.canonicalUrl === page.url && Boolean(page.content));
|
|
183
|
+
const parity = pages.length === operationCount && unique(pageUrls) && completePages;
|
|
184
|
+
checks.push(parity ? makeCheck("surface-parity", "Generated surface parity", "pass", `${pages.length} normalized operations produce ${pages.length} unique search, Ask AI, Markdown, and read-only MCP documents.`) : makeCheck("surface-parity", "Generated surface parity", "fail", `Normalized contracts contain ${operationCount} operations, but generated projections contain ${pages.length} complete unique documents.`, "Regenerate operation projections from the normalized model and make their URLs and canonical metadata unique."));
|
|
185
|
+
} catch (error) {
|
|
186
|
+
checks.push(makeCheck("surface-parity", "Generated surface parity", "fail", error instanceof Error ? error.message : String(error), "Fix operation projection generation and rerun docs doctor --api."));
|
|
187
|
+
}
|
|
188
|
+
else checks.push(makeCheck("surface-parity", "Generated surface parity", "warn", "Generated projections were not checked because one or more contracts failed validation."));
|
|
189
|
+
const recommendations = checks.map((check) => check.recommendation).filter((recommendation) => Boolean(recommendation));
|
|
190
|
+
return {
|
|
191
|
+
mode: "api",
|
|
192
|
+
framework,
|
|
193
|
+
configPath: relativeConfigPath,
|
|
194
|
+
enabled: true,
|
|
195
|
+
renderer,
|
|
196
|
+
defaultVersion: apiReference.defaultVersion,
|
|
197
|
+
sourceCount: sources.length,
|
|
198
|
+
operationCount,
|
|
199
|
+
checks,
|
|
200
|
+
sources,
|
|
201
|
+
recommendations
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
//#endregion
|
|
206
|
+
export { inspectApiReferenceHealth };
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import "./
|
|
3
|
-
import "./agent-DkAidqtV.mjs";
|
|
4
|
-
import "./standards-discovery-sSEojU80.mjs";
|
|
5
|
-
import "./sidebar-CFHBj29f.mjs";
|
|
6
|
-
import "./openapi-mcp-BIOTLiA7.mjs";
|
|
7
|
-
import { r as runDocsAuthoringMcpStdio } from "./authoring-mcp-CiCUQe3o.mjs";
|
|
8
|
-
import { _ as resolveDocsContentDir, d as readNavTitle, g as resolveDocsConfigPath, o as loadDocsConfigModuleResult, p as readStringProperty } from "./config-BZnKAj_Y.mjs";
|
|
1
|
+
import { runDocsAuthoringMcpStdio } from "../authoring-mcp.mjs";
|
|
2
|
+
import { loadDocsConfigModuleResult, readNavTitle, readStringProperty, resolveDocsConfigPath, resolveDocsContentDir } from "./config.mjs";
|
|
9
3
|
import { readFileSync } from "node:fs";
|
|
10
4
|
import path from "node:path";
|
|
11
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { extractNestedObjectLiteral, loadDocsConfigModule, loadProjectEnv, readNavTitle, readStringProperty, readTopLevelBooleanProperty, readTopLevelStringProperty, resolveDocsConfigPath, resolveDocsContentDir } from "./config.mjs";
|
|
2
|
+
import { markCliErrorReported } from "./errors.mjs";
|
|
3
|
+
import { detectFramework, detectPackageManagerFromProject } from "./utils.mjs";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { execFileSync } from "node:child_process";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { resolveDocsCodeBlocksValidateConfig, validateCodeBlocks } from "../code-blocks.mjs";
|
|
2
|
+
import { extractNestedObjectLiteral, loadDocsConfigModule, readBooleanProperty, readNumberProperty, readStringProperty, readTopLevelStringProperty, resolveDocsConfigPath, resolveDocsContentDir } from "./config.mjs";
|
|
3
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
4
4
|
import pc from "picocolors";
|
|
5
5
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DocsConfig } from "../types.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/cli/config.d.ts
|
|
4
|
+
declare function loadDocsConfigModule(rootDir: string, explicitPath?: string, options?: {
|
|
5
|
+
silent?: boolean;
|
|
6
|
+
}): Promise<{
|
|
7
|
+
path: string;
|
|
8
|
+
config: DocsConfig;
|
|
9
|
+
} | null>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { loadDocsConfigModule };
|
|
@@ -391,4 +391,4 @@ async function loadDocsConfigModuleResultWithProjectEnv(rootDir, explicitPath, o
|
|
|
391
391
|
}
|
|
392
392
|
|
|
393
393
|
//#endregion
|
|
394
|
-
export {
|
|
394
|
+
export { extractNestedObjectLiteral, extractObjectLiteral, extractTopLevelConfigObject, hasTopLevelProperty, loadDocsConfigModule, loadDocsConfigModuleResult, loadDocsConfigModuleResultWithProjectEnv, loadProjectEnv, readBooleanProperty, readEnvReferenceProperty, readNavTitle, readNumberProperty, readStringProperty, readTopLevelBooleanProperty, readTopLevelStringProperty, resolveDocsConfigPath, resolveDocsContentDir, resolveDocsProjectRoot };
|