@farming-labs/docs 0.2.58 → 0.2.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-CxDzPqtl.mjs → agent-BFqyqEnC.mjs} +557 -71
- package/dist/{agent-BFtIbSyJ.mjs → agent-DlxriaTs.mjs} +2 -2
- package/dist/{agent-evals-BW0vEc-F.mjs → agent-evals-kJs2Y9xR.mjs} +1 -1
- package/dist/{agent-export-vsdq0Huq.mjs → agent-export-BgUaiW8f.mjs} +17 -7
- package/dist/{agents-ChKj-VYw.mjs → agents-Djh-HXih.mjs} +12 -4
- package/dist/cli/index.mjs +19 -17
- package/dist/client/react.d.mts +1 -1
- package/dist/{cloud-ask-ai-a5Juvlvh.d.mts → cloud-ask-ai-B2WnG4fF.d.mts} +1 -1
- package/dist/{dev-CAQlbguk.mjs → dev-DgY5xGl9.mjs} +1 -1
- package/dist/docs-cloud-server.d.mts +2 -2
- package/dist/{doctor-H8gilyTg.mjs → doctor-CO1VMcF_.mjs} +181 -17
- package/dist/{golden-evaluations-BiUg5Xe_.mjs → golden-evaluations-BN9u2wxw.mjs} +1 -1
- package/dist/index.d.mts +98 -20
- package/dist/index.mjs +6 -6
- package/dist/{init-B_9ENq8Z.mjs → init-Bd_k06bR.mjs} +1 -1
- package/dist/{mcp-CiNww-Wu.mjs → mcp-B_yXL5G5.mjs} +53 -20
- package/dist/mcp.d.mts +1 -1
- package/dist/mcp.mjs +2 -2
- package/dist/{metadata-3ljRN9MM.mjs → metadata-BDuewuzq.mjs} +1 -1
- package/dist/{reading-time-EaVom2cl.mjs → reading-time-BkEft6SD.mjs} +307 -18
- package/dist/{review-BEgX7ey7.mjs → review-NC-sOdXn.mjs} +20 -9
- package/dist/{robots-CFlsfYdA.mjs → robots-DskPvGPw.mjs} +2 -2
- package/dist/{robots-DRpoiYAV.mjs → robots-ltltiLJF.mjs} +4 -1
- package/dist/{search-BblemZl4.d.mts → search-C1JitPwi.d.mts} +129 -4
- package/dist/{search-Bo9ubPVO.mjs → search-D57JXQLj.mjs} +1 -1
- package/dist/{search-CoajN9X1.mjs → search-o4Ud6OXv.mjs} +4 -4
- package/dist/server.d.mts +4 -3
- package/dist/server.mjs +4 -4
- package/dist/{sitemap-D_aXWPdJ.mjs → sitemap-Cq-Yj_iA.mjs} +4 -4
- package/dist/{sitemap-server-BYwE0zXs.mjs → sitemap-server-C1ibVKOy.mjs} +2 -1
- package/dist/{templates-CfQjpDWW.mjs → templates-DNw15P-x.mjs} +1 -0
- package/dist/{types-C1nPRXqo.d.mts → types-XHABMh_f.d.mts} +6 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as hashGeneratedAgentContent, b as serializeGeneratedAgentDocument, g as GENERATED_AGENT_PROVENANCE_VERSION, y as parseGeneratedAgentDocument } from "./search-
|
|
1
|
+
import { B as findDocsMarkdownPage, at as renderDocsMarkdownDocument, vn as normalizePageAgentFrontmatter, xn as stripGeneratedPageAgentContractMarkdown } from "./agent-BFqyqEnC.mjs";
|
|
2
|
+
import { _ as hashGeneratedAgentContent, b as serializeGeneratedAgentDocument, g as GENERATED_AGENT_PROVENANCE_VERSION, y as parseGeneratedAgentDocument } from "./search-D57JXQLj.mjs";
|
|
3
3
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
4
4
|
import { c as readEnvReferenceProperty, d as readStringProperty, h as resolveDocsContentDir, i as loadDocsConfigModule, l as readNavTitle, m as resolveDocsConfigPath, o as loadProjectEnv, p as readTopLevelStringProperty, s as readBooleanProperty, t as extractNestedObjectLiteral, u as readNumberProperty } from "./config-DASewQ0x.mjs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as resolveSearchRequestConfig, p as findDocsMarkdownSection, t as buildDocsAskAIContext, u as performDocsSearch } from "./search-
|
|
1
|
+
import { f as resolveSearchRequestConfig, p as findDocsMarkdownSection, t as buildDocsAskAIContext, u as performDocsSearch } from "./search-D57JXQLj.mjs";
|
|
2
2
|
import { a as normalizeAgentScopeValues, i as normalizeAgentLocale, n as agentVersionConstraintsOverlap, o as normalizeAgentVersion, r as normalizeAgentFramework, t as agentVersionConstraintMatches } from "./agent-scope-CCaIY1aK.mjs";
|
|
3
3
|
import { buildDocsMcpContext } from "./mcp.mjs";
|
|
4
4
|
import { i as validateCodeBlockPlans, n as planCodeBlockTargets, r as resolveDocsCodeBlocksValidateConfig, t as extractCodeBlocksFromMarkdown } from "./code-blocks-qe0T8-xe.mjs";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./search-
|
|
1
|
+
import { Lt as renderDocsSitemapMarkdown, M as buildDocsAgentDiscoverySpec, Pt as buildDocsSitemapManifest, Rt as renderDocsSitemapXml, St as toDocsMarkdownUrl, T as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, a as DEFAULT_AGENT_MD_ROUTE, at as renderDocsMarkdownDocument, c as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, en as buildDocsAgentSkillsIndex, g as DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE, h as DEFAULT_LLMS_FULL_TXT_ROUTE, it as renderDocsLlmsTxt, l as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, lt as resolveDocsAgentFeedbackConfig, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, o as DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE, on as resolveDocsPublishedAgentSkill, qt as DEFAULT_AGENT_SKILLS_INDEX_ROUTE, rt as renderDocsAgentsDocument, st as renderDocsSkillDocument, t as DEFAULT_AGENTS_MD_ROUTE, v as DEFAULT_LLMS_TXT_ROUTE, w as DEFAULT_SKILL_MD_ROUTE, y as DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE, zt as resolveDocsSitemapConfig } from "./agent-BFqyqEnC.mjs";
|
|
2
|
+
import "./search-D57JXQLj.mjs";
|
|
3
3
|
import { t as resolveDocsI18n } from "./i18n-CAlj1ADU.mjs";
|
|
4
|
-
import { c as renderDocsRobotsGeneratedBlock, f as upsertDocsRobotsGeneratedBlock, i as DOCS_ROBOTS_GENERATED_BLOCK_START, r as DOCS_ROBOTS_GENERATED_BLOCK_END, u as resolveDocsRobotsConfig } from "./robots-
|
|
5
|
-
import "./sitemap-server-
|
|
6
|
-
import "./agent-evals-
|
|
4
|
+
import { c as renderDocsRobotsGeneratedBlock, f as upsertDocsRobotsGeneratedBlock, i as DOCS_ROBOTS_GENERATED_BLOCK_START, r as DOCS_ROBOTS_GENERATED_BLOCK_END, u as resolveDocsRobotsConfig } from "./robots-ltltiLJF.mjs";
|
|
5
|
+
import "./sitemap-server-C1ibVKOy.mjs";
|
|
6
|
+
import "./agent-evals-kJs2Y9xR.mjs";
|
|
7
7
|
import { createFilesystemDocsMcpSource, resolveDocsMcpConfig } from "./mcp.mjs";
|
|
8
8
|
import "./code-blocks-qe0T8-xe.mjs";
|
|
9
9
|
import "./server.mjs";
|
|
@@ -448,6 +448,7 @@ function resolveRobotsOutput(publicDir, entry, sitemap, robots) {
|
|
|
448
448
|
const existing = readExisting(absolutePath);
|
|
449
449
|
const generatedBlock = renderDocsRobotsGeneratedBlock({
|
|
450
450
|
entry,
|
|
451
|
+
apiCatalog: false,
|
|
451
452
|
sitemap,
|
|
452
453
|
baseUrl: robots.baseUrl,
|
|
453
454
|
robots
|
|
@@ -617,8 +618,8 @@ async function exportAgentBundle(options = {}) {
|
|
|
617
618
|
const siteDescription = llmsConfig?.siteDescription ?? metadataDescription;
|
|
618
619
|
const resolvedSiteTitle = llmsConfig?.siteTitle ?? siteTitle;
|
|
619
620
|
const sitemapInput = config?.sitemap ?? readStaticSitemapConfig(configContent) ?? true;
|
|
620
|
-
const baseUrl = llmsConfig?.baseUrl ?? (typeof sitemapInput === "object" ? sitemapInput.baseUrl : void 0);
|
|
621
621
|
const robotsInput = config?.robots ?? readStaticRobotsConfig(configContent) ?? true;
|
|
622
|
+
const baseUrl = llmsConfig?.baseUrl ?? (typeof sitemapInput === "object" ? sitemapInput.baseUrl : void 0) ?? (typeof robotsInput === "object" ? robotsInput.baseUrl : void 0);
|
|
622
623
|
const i18n = resolveDocsI18n(config?.i18n ?? readStaticI18nConfig(configContent));
|
|
623
624
|
const publicDirectory = detectFramework(rootDir) === "sveltekit" ? "static" : "public";
|
|
624
625
|
const publicDir = resolveContainedPath(rootDir, publicDirectory);
|
|
@@ -658,6 +659,7 @@ async function exportAgentBundle(options = {}) {
|
|
|
658
659
|
const openapi = { enabled: false };
|
|
659
660
|
const llms = {
|
|
660
661
|
enabled: llmsEnabled,
|
|
662
|
+
apiCatalog: false,
|
|
661
663
|
baseUrl,
|
|
662
664
|
siteTitle: resolvedSiteTitle,
|
|
663
665
|
siteDescription,
|
|
@@ -668,6 +670,8 @@ async function exportAgentBundle(options = {}) {
|
|
|
668
670
|
const documentOptions = {
|
|
669
671
|
origin: baseUrl ?? "/",
|
|
670
672
|
entry: routeEntry || "docs",
|
|
673
|
+
apiRoute: config?.cloud?.apiRoute,
|
|
674
|
+
apiCatalog: false,
|
|
671
675
|
search: false,
|
|
672
676
|
mcp,
|
|
673
677
|
feedback,
|
|
@@ -784,13 +788,19 @@ async function exportAgentBundle(options = {}) {
|
|
|
784
788
|
}
|
|
785
789
|
}
|
|
786
790
|
if (robots.enabled) outputs.push(resolveRobotsOutput(publicDir, routeEntry || "docs", sitemapInput, robots));
|
|
791
|
+
outputs = resolveUserOwnedOverrides(outputs, previous);
|
|
792
|
+
const publishedAgentSkill = await resolveDocsPublishedAgentSkill({
|
|
793
|
+
preferredDocument: outputs.find((output) => output.route === DEFAULT_SKILL_MD_ROUTE)?.content ?? normalizeContent(publicSkill),
|
|
794
|
+
fallbackDocument: normalizeContent(generatedSkill)
|
|
795
|
+
});
|
|
796
|
+
addOutput(outputs, publicDir, publishedAgentSkill.url, "skill", "text/markdown", publishedAgentSkill.content);
|
|
797
|
+
addOutput(outputs, publicDir, DEFAULT_AGENT_SKILLS_INDEX_ROUTE, "discovery", "application/json", JSON.stringify(buildDocsAgentSkillsIndex(publishedAgentSkill), null, 2));
|
|
787
798
|
assertOutputPathsDoNotCollide({
|
|
788
799
|
outputs,
|
|
789
800
|
internalOutputs,
|
|
790
801
|
publicManifestPath,
|
|
791
802
|
internalManifestPath
|
|
792
803
|
});
|
|
793
|
-
outputs = resolveUserOwnedOverrides(outputs, previous);
|
|
794
804
|
outputs.sort((left, right) => left.publicPath.localeCompare(right.publicPath));
|
|
795
805
|
const stalePaths = staleManagedPaths(publicDir, previous, outputs);
|
|
796
806
|
const staleInternal = staleInternalPaths(rootDir, previous, internalOutputs);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as DEFAULT_OPENAPI_SCHEMA_ROUTE, a as DEFAULT_AGENT_MD_ROUTE,
|
|
2
|
-
import "./search-
|
|
3
|
-
import { S as resolveApiReferenceConfig } from "./sitemap-server-
|
|
4
|
-
import "./agent-evals-
|
|
1
|
+
import { C as DEFAULT_OPENAPI_SCHEMA_ROUTE, a as DEFAULT_AGENT_MD_ROUTE, lt as resolveDocsAgentFeedbackConfig, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, o as DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE, rt as renderDocsAgentsDocument, t as DEFAULT_AGENTS_MD_ROUTE } from "./agent-BFqyqEnC.mjs";
|
|
2
|
+
import "./search-D57JXQLj.mjs";
|
|
3
|
+
import { S as resolveApiReferenceConfig } from "./sitemap-server-C1ibVKOy.mjs";
|
|
4
|
+
import "./agent-evals-kJs2Y9xR.mjs";
|
|
5
5
|
import { resolveDocsMcpConfig } from "./mcp.mjs";
|
|
6
6
|
import "./code-blocks-qe0T8-xe.mjs";
|
|
7
7
|
import "./server.mjs";
|
|
@@ -84,6 +84,11 @@ function readSitemapBaseUrlFromConfig(content, config) {
|
|
|
84
84
|
const block = extractNestedObjectLiteral(content, ["sitemap"]);
|
|
85
85
|
return block ? readStringProperty(block, "baseUrl") : void 0;
|
|
86
86
|
}
|
|
87
|
+
function readCloudApiRouteFromConfig(content, config) {
|
|
88
|
+
if (typeof config?.cloud?.apiRoute === "string") return config.cloud.apiRoute;
|
|
89
|
+
const block = extractNestedObjectLiteral(content, ["cloud"]);
|
|
90
|
+
return block ? readStringProperty(block, "apiRoute") : void 0;
|
|
91
|
+
}
|
|
87
92
|
function readRobotsConfigFromStatic(content) {
|
|
88
93
|
const topLevelBoolean = readTopLevelBooleanProperty(content, "robots");
|
|
89
94
|
if (typeof topLevelBoolean === "boolean") return topLevelBoolean;
|
|
@@ -126,6 +131,7 @@ function resolveOpenApiDiscovery(config) {
|
|
|
126
131
|
return {
|
|
127
132
|
enabled: true,
|
|
128
133
|
url: DEFAULT_OPENAPI_SCHEMA_ROUTE,
|
|
134
|
+
urlSource: "default",
|
|
129
135
|
source: apiReference.specUrl ? "configured" : "generated",
|
|
130
136
|
specUrl: apiReference.specUrl,
|
|
131
137
|
apiReferencePath: `/${apiReference.path}`
|
|
@@ -140,6 +146,7 @@ async function generateAgents(options = {}) {
|
|
|
140
146
|
const siteTitle = typeof config?.nav?.title === "string" ? config.nav.title : readNavTitle(configContent) ?? "Documentation";
|
|
141
147
|
const siteDescription = typeof config?.metadata?.description === "string" ? config.metadata.description : void 0;
|
|
142
148
|
const baseUrl = readLlmsBaseUrlFromConfig(configContent, config) ?? readSitemapBaseUrlFromConfig(configContent, config);
|
|
149
|
+
const apiRoute = readCloudApiRouteFromConfig(configContent, config);
|
|
143
150
|
const llmsTxt = config?.llmsTxt;
|
|
144
151
|
const llmsEnabled = llmsTxt === false ? false : typeof llmsTxt === "object" ? llmsTxt.enabled ?? true : true;
|
|
145
152
|
const llmsConfig = typeof llmsTxt === "object" ? llmsTxt : void 0;
|
|
@@ -148,6 +155,7 @@ async function generateAgents(options = {}) {
|
|
|
148
155
|
const generatedContent = normalizeGeneratedContent(renderDocsAgentsDocument({
|
|
149
156
|
origin: baseUrl ?? "http://localhost",
|
|
150
157
|
entry,
|
|
158
|
+
apiRoute,
|
|
151
159
|
search: config?.search,
|
|
152
160
|
mcp: resolveDocsMcpConfig(config?.mcp),
|
|
153
161
|
feedback: resolveDocsAgentFeedbackConfig(config?.feedback),
|
package/dist/cli/index.mjs
CHANGED
|
@@ -67,6 +67,7 @@ async function main() {
|
|
|
67
67
|
setup: subcommand === "setup",
|
|
68
68
|
deploymentId: typeof flags.deployment === "string" ? flags.deployment : void 0,
|
|
69
69
|
apiBaseUrl: typeof flags["api-base-url"] === "string" ? flags["api-base-url"] : typeof flags.url === "string" ? flags.url : void 0,
|
|
70
|
+
client: typeof flags.client === "string" ? flags.client : void 0,
|
|
70
71
|
json: typeof flags.json === "boolean" ? flags.json : void 0
|
|
71
72
|
};
|
|
72
73
|
const devOptions = {
|
|
@@ -105,10 +106,10 @@ async function main() {
|
|
|
105
106
|
]
|
|
106
107
|
};
|
|
107
108
|
if (!parsedCommand.command || parsedCommand.command === "init") {
|
|
108
|
-
const { init } = await import("../init-
|
|
109
|
+
const { init } = await import("../init-Bd_k06bR.mjs");
|
|
109
110
|
await init(initOptions);
|
|
110
111
|
} else if (parsedCommand.command === "dev") {
|
|
111
|
-
const { dev } = await import("../dev-
|
|
112
|
+
const { dev } = await import("../dev-DgY5xGl9.mjs");
|
|
112
113
|
await dev(devOptions);
|
|
113
114
|
} else if (parsedCommand.command === "deploy") {
|
|
114
115
|
const { runCloudDeploy } = await import("../cloud-BH_sHX64.mjs");
|
|
@@ -138,10 +139,10 @@ async function main() {
|
|
|
138
139
|
printCloudHelp();
|
|
139
140
|
process.exit(1);
|
|
140
141
|
} else if (parsedCommand.command === "mcp") {
|
|
141
|
-
const { runMcp } = await import("../mcp-
|
|
142
|
+
const { runMcp } = await import("../mcp-B_yXL5G5.mjs");
|
|
142
143
|
await runMcp(mcpOptions);
|
|
143
144
|
} else if (parsedCommand.command === "agent" && subcommand === "compact") {
|
|
144
|
-
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent-
|
|
145
|
+
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent-DlxriaTs.mjs").then((n) => n.t);
|
|
145
146
|
const agentCompactOptions = parseAgentCompactArgs(args.slice(2));
|
|
146
147
|
if (agentCompactOptions.help) {
|
|
147
148
|
printAgentCompactHelp();
|
|
@@ -149,7 +150,7 @@ async function main() {
|
|
|
149
150
|
}
|
|
150
151
|
await compactAgentDocs(agentCompactOptions);
|
|
151
152
|
} else if (parsedCommand.command === "agent" && subcommand === "export") {
|
|
152
|
-
const { exportAgentBundle, parseAgentExportArgs, printAgentExportHelp } = await import("../agent-export-
|
|
153
|
+
const { exportAgentBundle, parseAgentExportArgs, printAgentExportHelp } = await import("../agent-export-BgUaiW8f.mjs");
|
|
153
154
|
const agentExportOptions = parseAgentExportArgs(args.slice(2));
|
|
154
155
|
if (agentExportOptions.help) {
|
|
155
156
|
printAgentExportHelp();
|
|
@@ -159,13 +160,13 @@ async function main() {
|
|
|
159
160
|
} else if (parsedCommand.command === "agent") {
|
|
160
161
|
console.error(pc.red(`Unknown agent subcommand: ${subcommand ?? "(missing)"}`));
|
|
161
162
|
console.error();
|
|
162
|
-
const { printAgentCompactHelp } = await import("../agent-
|
|
163
|
-
const { printAgentExportHelp } = await import("../agent-export-
|
|
163
|
+
const { printAgentCompactHelp } = await import("../agent-DlxriaTs.mjs").then((n) => n.t);
|
|
164
|
+
const { printAgentExportHelp } = await import("../agent-export-BgUaiW8f.mjs");
|
|
164
165
|
printAgentCompactHelp();
|
|
165
166
|
printAgentExportHelp();
|
|
166
167
|
process.exit(1);
|
|
167
168
|
} else if (parsedCommand.command === "agents" && subcommand === "generate") {
|
|
168
|
-
const { generateAgents, parseAgentsGenerateArgs, printAgentsGenerateHelp } = await import("../agents-
|
|
169
|
+
const { generateAgents, parseAgentsGenerateArgs, printAgentsGenerateHelp } = await import("../agents-Djh-HXih.mjs");
|
|
169
170
|
const agentsOptions = parseAgentsGenerateArgs(args.slice(2));
|
|
170
171
|
if (agentsOptions.help) {
|
|
171
172
|
printAgentsGenerateHelp();
|
|
@@ -175,11 +176,11 @@ async function main() {
|
|
|
175
176
|
} else if (parsedCommand.command === "agents") {
|
|
176
177
|
console.error(pc.red(`Unknown agents subcommand: ${subcommand ?? "(missing)"}`));
|
|
177
178
|
console.error();
|
|
178
|
-
const { printAgentsGenerateHelp } = await import("../agents-
|
|
179
|
+
const { printAgentsGenerateHelp } = await import("../agents-Djh-HXih.mjs");
|
|
179
180
|
printAgentsGenerateHelp();
|
|
180
181
|
process.exit(1);
|
|
181
182
|
} else if (parsedCommand.command === "doctor") {
|
|
182
|
-
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-
|
|
183
|
+
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-CO1VMcF_.mjs");
|
|
183
184
|
const doctorOptions = parseDoctorArgs(args.slice(1));
|
|
184
185
|
if (doctorOptions.help) {
|
|
185
186
|
printDoctorHelp();
|
|
@@ -187,7 +188,7 @@ async function main() {
|
|
|
187
188
|
}
|
|
188
189
|
await runDoctor(doctorOptions);
|
|
189
190
|
} else if (parsedCommand.command === "review") {
|
|
190
|
-
const { parseReviewArgs, printReviewHelp, runReview } = await import("../review-
|
|
191
|
+
const { parseReviewArgs, printReviewHelp, runReview } = await import("../review-NC-sOdXn.mjs");
|
|
191
192
|
const reviewOptions = parseReviewArgs(args.slice(1));
|
|
192
193
|
if (reviewOptions.help) {
|
|
193
194
|
printReviewHelp();
|
|
@@ -209,7 +210,7 @@ async function main() {
|
|
|
209
210
|
printCodeBlocksValidateHelp();
|
|
210
211
|
process.exit(1);
|
|
211
212
|
} else if (parsedCommand.command === "search" && subcommand === "sync") {
|
|
212
|
-
const { syncSearch } = await import("../search-
|
|
213
|
+
const { syncSearch } = await import("../search-o4Ud6OXv.mjs");
|
|
213
214
|
await syncSearch(searchSyncOptions);
|
|
214
215
|
} else if (parsedCommand.command === "search") {
|
|
215
216
|
console.error(pc.red(`Unknown search subcommand: ${subcommand ?? "(missing)"}`));
|
|
@@ -217,7 +218,7 @@ async function main() {
|
|
|
217
218
|
printHelp();
|
|
218
219
|
process.exit(1);
|
|
219
220
|
} else if (parsedCommand.command === "sitemap" && subcommand === "generate") {
|
|
220
|
-
const { generateSitemap, parseSitemapGenerateArgs, printSitemapGenerateHelp } = await import("../sitemap-
|
|
221
|
+
const { generateSitemap, parseSitemapGenerateArgs, printSitemapGenerateHelp } = await import("../sitemap-Cq-Yj_iA.mjs");
|
|
221
222
|
const sitemapOptions = parseSitemapGenerateArgs(args.slice(2));
|
|
222
223
|
if (sitemapOptions.help) {
|
|
223
224
|
printSitemapGenerateHelp();
|
|
@@ -227,11 +228,11 @@ async function main() {
|
|
|
227
228
|
} else if (parsedCommand.command === "sitemap") {
|
|
228
229
|
console.error(pc.red(`Unknown sitemap subcommand: ${subcommand ?? "(missing)"}`));
|
|
229
230
|
console.error();
|
|
230
|
-
const { printSitemapGenerateHelp } = await import("../sitemap-
|
|
231
|
+
const { printSitemapGenerateHelp } = await import("../sitemap-Cq-Yj_iA.mjs");
|
|
231
232
|
printSitemapGenerateHelp();
|
|
232
233
|
process.exit(1);
|
|
233
234
|
} else if (parsedCommand.command === "robots" && subcommand === "generate") {
|
|
234
|
-
const { generateRobots, parseRobotsGenerateArgs, printRobotsGenerateHelp } = await import("../robots-
|
|
235
|
+
const { generateRobots, parseRobotsGenerateArgs, printRobotsGenerateHelp } = await import("../robots-DskPvGPw.mjs");
|
|
235
236
|
const robotsOptions = parseRobotsGenerateArgs(args.slice(2));
|
|
236
237
|
if (robotsOptions.help) {
|
|
237
238
|
printRobotsGenerateHelp();
|
|
@@ -241,7 +242,7 @@ async function main() {
|
|
|
241
242
|
} else if (parsedCommand.command === "robots") {
|
|
242
243
|
console.error(pc.red(`Unknown robots subcommand: ${subcommand ?? "(missing)"}`));
|
|
243
244
|
console.error();
|
|
244
|
-
const { printRobotsGenerateHelp } = await import("../robots-
|
|
245
|
+
const { printRobotsGenerateHelp } = await import("../robots-DskPvGPw.mjs");
|
|
245
246
|
printRobotsGenerateHelp();
|
|
246
247
|
process.exit(1);
|
|
247
248
|
} else if (parsedCommand.command === "downgrade") {
|
|
@@ -316,7 +317,8 @@ ${pc.dim("Options for mcp:")}
|
|
|
316
317
|
${pc.cyan("--config <path>")} Use a custom docs config path instead of ${pc.dim("docs.config.ts[x]")}
|
|
317
318
|
${pc.cyan("mcp setup --deployment <id>")} Print Docs Cloud hosted MCP setup for a deployment id
|
|
318
319
|
${pc.cyan("--api-base-url <url>")} Override the hosted Docs Cloud API base URL for ${pc.cyan("mcp setup")}
|
|
319
|
-
${pc.cyan("--
|
|
320
|
+
${pc.cyan("--client <name>")} Emit native config for ${pc.dim("claude-code")}, ${pc.dim("cursor")}, or ${pc.dim("vscode")}
|
|
321
|
+
${pc.cyan("--json")} Print the selected MCP client JSON only for ${pc.cyan("mcp setup")}
|
|
320
322
|
|
|
321
323
|
${pc.dim("Options for dev:")}
|
|
322
324
|
${pc.cyan("--port <number>")} Run the frameworkless preview on a custom port
|
package/dist/client/react.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as DocsAnalyticsConfig, Y as DocsCloudConfig, t as AIConfig } from "./types-
|
|
1
|
+
import { F as DocsAnalyticsConfig, Y as DocsCloudConfig, t as AIConfig } from "./types-XHABMh_f.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/cloud-ask-ai.d.ts
|
|
4
4
|
interface DocsCloudAskAIConfig {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as detectPackageManagerFromProject } from "./utils-6UCLxv4B.mjs";
|
|
2
|
-
import { K as rootLayoutTemplate, W as postcssConfigTemplate, g as docsLayoutTemplate, v as globalCssTemplate, yt as tsconfigTemplate } from "./templates-
|
|
2
|
+
import { K as rootLayoutTemplate, W as postcssConfigTemplate, g as docsLayoutTemplate, v as globalCssTemplate, yt as tsconfigTemplate } from "./templates-DNw15P-x.mjs";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { spawn } from "node:child_process";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as DocsAnalyticsConfig, I as DocsAnalyticsEvent, L as DocsAnalyticsEventInput } from "./types-
|
|
2
|
-
import { n as DocsCloudAskAIResponseOptions, t as DocsCloudAskAIConfig } from "./cloud-ask-ai-
|
|
1
|
+
import { F as DocsAnalyticsConfig, I as DocsAnalyticsEvent, L as DocsAnalyticsEventInput } from "./types-XHABMh_f.mjs";
|
|
2
|
+
import { n as DocsCloudAskAIResponseOptions, t as DocsCloudAskAIConfig } from "./cloud-ask-ai-B2WnG4fF.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/docs-cloud-server.d.ts
|
|
5
5
|
type DocsCloudRuntimeValue<T = string> = T | undefined | null | (() => T | undefined | null);
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import { i as scanDocsPageTargets, n as compactAgentDocs, r as inspectAgentCompactionState } from "./agent-
|
|
2
|
-
import "./reading-time-
|
|
3
|
-
import {
|
|
4
|
-
import { d as resolveAskAISearchRequestConfig } from "./search-
|
|
5
|
-
import { a as analyzeDocsRobotsTxt, n as DEFAULT_ROBOTS_TXT_ROUTE, u as resolveDocsRobotsConfig } from "./robots-
|
|
6
|
-
import { a as resolveDocsMetadataBaseUrl } from "./metadata-
|
|
7
|
-
import "./sitemap-server-
|
|
8
|
-
import { t as runDocsGoldenTasks } from "./agent-evals-
|
|
1
|
+
import { i as scanDocsPageTargets, n as compactAgentDocs, r as inspectAgentCompactionState } from "./agent-DlxriaTs.mjs";
|
|
2
|
+
import { l as httpLinkHeaderHasTargetRelation } from "./reading-time-BkEft6SD.mjs";
|
|
3
|
+
import { Gt as API_CATALOG_PROFILE_URI, I as buildDocsMcpEndpointCandidates, Jt as DEFAULT_AGENT_SKILLS_ROUTE_PATTERN, Kt as DEFAULT_AGENT_SKILLS_INDEX_FORMAT, M as buildDocsAgentDiscoverySpec, Mt as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, Nt as DEFAULT_SITEMAP_XML_ROUTE, O as DOCS_CONFIG_MAP_TOP_LEVEL_KEYS, P as buildDocsConfigMap, Qt as DEFAULT_API_CATALOG_ROUTE, S as DEFAULT_MCP_WELL_KNOWN_ROUTE, T as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, Ut as AGENT_SKILLS_DISCOVERY_SCHEMA_URI, Wt as API_CATALOG_MEDIA_TYPE, Xt as DEFAULT_AGENT_SKILL_FORMAT, Zt as DEFAULT_API_CATALOG_FORMAT, an as resolveDocsDiscoveryApiRoute, b as DEFAULT_MCP_PUBLIC_ROUTE, c as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, fn as PAGE_AGENT_CONTRACT_FIELDS, h as DEFAULT_LLMS_FULL_TXT_ROUTE, i as DEFAULT_AGENT_FEEDBACK_ROUTE, jt as DEFAULT_SITEMAP_MD_ROUTE, l as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, qt as DEFAULT_AGENT_SKILLS_INDEX_ROUTE, t as DEFAULT_AGENTS_MD_ROUTE, v as DEFAULT_LLMS_TXT_ROUTE, w as DEFAULT_SKILL_MD_ROUTE, zt as resolveDocsSitemapConfig } from "./agent-BFqyqEnC.mjs";
|
|
4
|
+
import { d as resolveAskAISearchRequestConfig } from "./search-D57JXQLj.mjs";
|
|
5
|
+
import { a as analyzeDocsRobotsTxt, n as DEFAULT_ROBOTS_TXT_ROUTE, u as resolveDocsRobotsConfig } from "./robots-ltltiLJF.mjs";
|
|
6
|
+
import { a as resolveDocsMetadataBaseUrl } from "./metadata-BDuewuzq.mjs";
|
|
7
|
+
import "./sitemap-server-C1ibVKOy.mjs";
|
|
8
|
+
import { t as runDocsGoldenTasks } from "./agent-evals-kJs2Y9xR.mjs";
|
|
9
9
|
import { createFilesystemDocsMcpSource, getDocsConfigSchema, resolveDocsMcpConfig } from "./mcp.mjs";
|
|
10
10
|
import "./code-blocks-qe0T8-xe.mjs";
|
|
11
11
|
import "./server.mjs";
|
|
12
12
|
import { a as loadDocsConfigModuleResultWithProjectEnv, h as resolveDocsContentDir, l as readNavTitle, m as resolveDocsConfigPath, p as readTopLevelStringProperty, r as extractTopLevelConfigObject, s as readBooleanProperty, t as extractNestedObjectLiteral } from "./config-DASewQ0x.mjs";
|
|
13
13
|
import { t as detectFramework } from "./utils-6UCLxv4B.mjs";
|
|
14
|
-
import { i as createAgentUsefulnessPagesFromMcp, n as analyzeAgentSurfaceDrift, r as analyzeAgentUsefulness, t as resolveGoldenEvaluationInput } from "./golden-evaluations-
|
|
14
|
+
import { i as createAgentUsefulnessPagesFromMcp, n as analyzeAgentSurfaceDrift, r as analyzeAgentUsefulness, t as resolveGoldenEvaluationInput } from "./golden-evaluations-BN9u2wxw.mjs";
|
|
15
15
|
import { existsSync, lstatSync, readFileSync, readdirSync } from "node:fs";
|
|
16
16
|
import path from "node:path";
|
|
17
17
|
import { LATEST_PROTOCOL_VERSION } from "@modelcontextprotocol/sdk/types.js";
|
|
18
18
|
import pc from "picocolors";
|
|
19
|
+
import { createHash } from "node:crypto";
|
|
19
20
|
|
|
20
21
|
//#region src/cli/doctor.ts
|
|
21
22
|
const NEXT_CONFIG_PATTERN = /^next\.config\.(?:[cm]?js|[cm]?ts)$/;
|
|
@@ -1081,11 +1082,160 @@ function isHostedAgentDiscoveryManifest(value) {
|
|
|
1081
1082
|
const site = asRecord(root?.site);
|
|
1082
1083
|
const capabilities = asRecord(root?.capabilities);
|
|
1083
1084
|
const api = asRecord(root?.api);
|
|
1085
|
+
const apiCatalog = asRecord(root?.apiCatalog);
|
|
1084
1086
|
const config = asRecord(root?.config);
|
|
1085
1087
|
const search = asRecord(root?.search);
|
|
1088
|
+
const skillsDiscovery = asRecord(asRecord(root?.skills)?.discovery);
|
|
1086
1089
|
const mcp = asRecord(root?.mcp);
|
|
1087
1090
|
const agentContractFields = asRecord(asRecord(root?.agentContract)?.fields);
|
|
1088
|
-
|
|
1091
|
+
const apiRoute = isNonEmptyString(api?.docs) ? resolveDocsDiscoveryApiRoute(api.docs) : void 0;
|
|
1092
|
+
return Boolean(root && isNonEmptyString(root.version) && isNonEmptyString(root.name) && isNonEmptyString(root.baseUrl) && isNonEmptyString(site?.entry) && typeof capabilities?.search === "boolean" && typeof capabilities?.mcp === "boolean" && capabilities?.apiCatalog === true && capabilities?.agentSkillsDiscovery === true && apiRoute && api?.docs === apiRoute && api?.config === `${apiRoute}?format=config` && api?.apiCatalog === DEFAULT_API_CATALOG_ROUTE && api?.apiCatalogQuery === `${apiRoute}?format=${DEFAULT_API_CATALOG_FORMAT}` && api?.agentSkillsIndex === DEFAULT_AGENT_SKILLS_INDEX_ROUTE && apiCatalog?.enabled === true && apiCatalog?.route === DEFAULT_API_CATALOG_ROUTE && apiCatalog?.api === `${apiRoute}?format=${DEFAULT_API_CATALOG_FORMAT}` && apiCatalog?.mediaType === API_CATALOG_MEDIA_TYPE && apiCatalog?.profile === API_CATALOG_PROFILE_URI && skillsDiscovery?.schema === AGENT_SKILLS_DISCOVERY_SCHEMA_URI && skillsDiscovery?.index === DEFAULT_AGENT_SKILLS_INDEX_ROUTE && skillsDiscovery?.artifact === DEFAULT_AGENT_SKILLS_ROUTE_PATTERN && skillsDiscovery?.apiIndex === `${apiRoute}?format=${DEFAULT_AGENT_SKILLS_INDEX_FORMAT}` && skillsDiscovery?.apiArtifact === `${apiRoute}?format=${DEFAULT_AGENT_SKILL_FORMAT}&name={name}` && skillsDiscovery?.digest === "sha256" && config?.endpoint === `${apiRoute}?format=config` && typeof search?.enabled === "boolean" && isNonEmptyString(search?.endpoint) && typeof mcp?.enabled === "boolean" && isNonEmptyString(mcp?.endpoint) && isBooleanRecord(mcp?.tools) && agentContractFields && Object.keys(agentContractFields).length > 0);
|
|
1093
|
+
}
|
|
1094
|
+
function responseMediaType(contentType) {
|
|
1095
|
+
return contentType?.split(";", 1)[0]?.trim().toLowerCase() ?? "";
|
|
1096
|
+
}
|
|
1097
|
+
function contentTypeParameter(contentType, name) {
|
|
1098
|
+
if (!contentType) return void 0;
|
|
1099
|
+
const parameterPattern = new RegExp(`(?:^|;)\\s*${name.replace(/[.*+?^${}()|[\\]\\]/g, "\\$&")}\\s*=\\s*(?:"([^"]*)"|([^;\\s]+))`, "i");
|
|
1100
|
+
const match = contentType.match(parameterPattern);
|
|
1101
|
+
return match?.[1] ?? match?.[2];
|
|
1102
|
+
}
|
|
1103
|
+
function isApiCatalogLinkset(value) {
|
|
1104
|
+
const root = asRecord(value);
|
|
1105
|
+
if (!Array.isArray(root?.linkset) || root.linkset.length === 0) return false;
|
|
1106
|
+
let apiLinks = 0;
|
|
1107
|
+
for (const rawContext of root.linkset) {
|
|
1108
|
+
const context = asRecord(rawContext);
|
|
1109
|
+
if (!isNonEmptyString(context?.anchor)) return false;
|
|
1110
|
+
if (!Array.isArray(context.item)) continue;
|
|
1111
|
+
for (const rawItem of context.item) {
|
|
1112
|
+
if (!isNonEmptyString(asRecord(rawItem)?.href)) return false;
|
|
1113
|
+
apiLinks += 1;
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
return apiLinks > 0;
|
|
1117
|
+
}
|
|
1118
|
+
async function probeApiCatalogRoute(baseUrl) {
|
|
1119
|
+
const route = DEFAULT_API_CATALOG_ROUTE;
|
|
1120
|
+
const url = joinDoctorUrl(baseUrl, route);
|
|
1121
|
+
try {
|
|
1122
|
+
const [getResponse, headResponse] = await Promise.all([fetchWithTimeout(url, { headers: { Accept: API_CATALOG_MEDIA_TYPE } }), fetchWithTimeout(url, {
|
|
1123
|
+
method: "HEAD",
|
|
1124
|
+
headers: { Accept: API_CATALOG_MEDIA_TYPE }
|
|
1125
|
+
})]);
|
|
1126
|
+
const text = await getResponse.text().catch(() => "");
|
|
1127
|
+
let body;
|
|
1128
|
+
try {
|
|
1129
|
+
body = JSON.parse(text);
|
|
1130
|
+
} catch {
|
|
1131
|
+
body = void 0;
|
|
1132
|
+
}
|
|
1133
|
+
const failures = [];
|
|
1134
|
+
if (!getResponse.ok) failures.push(`GET returned HTTP ${getResponse.status}`);
|
|
1135
|
+
if (!headResponse.ok) failures.push(`HEAD returned HTTP ${headResponse.status}`);
|
|
1136
|
+
for (const [method, response] of [["GET", getResponse], ["HEAD", headResponse]]) {
|
|
1137
|
+
const contentType = response.headers.get("content-type");
|
|
1138
|
+
if (responseMediaType(contentType) !== API_CATALOG_MEDIA_TYPE) failures.push(`${method} Content-Type is ${JSON.stringify(contentType ?? "<missing>")}`);
|
|
1139
|
+
else if (contentTypeParameter(contentType, "profile") !== API_CATALOG_PROFILE_URI) failures.push(`${method} Content-Type is missing the RFC 9727 profile`);
|
|
1140
|
+
if (!httpLinkHeaderHasTargetRelation(response.headers.get("link"), DEFAULT_API_CATALOG_ROUTE, "api-catalog", url)) failures.push(`${method} is missing an ${DEFAULT_API_CATALOG_ROUTE} rel="api-catalog" Link value`);
|
|
1141
|
+
}
|
|
1142
|
+
if (!isApiCatalogLinkset(body)) failures.push("GET did not return a JSON Linkset with at least one API item");
|
|
1143
|
+
return failures.length === 0 ? {
|
|
1144
|
+
ok: true,
|
|
1145
|
+
detail: `${route} passed RFC 9727 GET and HEAD checks with a profiled JSON Linkset and api-catalog Link headers.`
|
|
1146
|
+
} : {
|
|
1147
|
+
ok: false,
|
|
1148
|
+
detail: `${route} failed standards validation: ${failures.join("; ")}.`
|
|
1149
|
+
};
|
|
1150
|
+
} catch (error) {
|
|
1151
|
+
return {
|
|
1152
|
+
ok: false,
|
|
1153
|
+
detail: `${route} failed: ${error instanceof Error ? error.message : String(error)}.`
|
|
1154
|
+
};
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
function isValidAgentSkillEntry(value) {
|
|
1158
|
+
const entry = asRecord(value);
|
|
1159
|
+
return Boolean(entry && typeof entry.name === "string" && /^[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(entry.name) && entry.name.length <= 64 && entry.type === "skill-md" && isNonEmptyString(entry.description) && entry.description.length <= 1024 && isNonEmptyString(entry.url) && typeof entry.digest === "string" && /^sha256:[0-9a-f]{64}$/u.test(entry.digest));
|
|
1160
|
+
}
|
|
1161
|
+
async function probeAgentSkillsDiscovery(baseUrl) {
|
|
1162
|
+
const route = DEFAULT_AGENT_SKILLS_INDEX_ROUTE;
|
|
1163
|
+
const indexUrl = joinDoctorUrl(baseUrl, route);
|
|
1164
|
+
try {
|
|
1165
|
+
const [indexResponse, indexHeadResponse] = await Promise.all([fetchWithTimeout(indexUrl, { headers: { Accept: "application/json" } }), fetchWithTimeout(indexUrl, {
|
|
1166
|
+
method: "HEAD",
|
|
1167
|
+
headers: { Accept: "application/json" }
|
|
1168
|
+
})]);
|
|
1169
|
+
const text = await indexResponse.text().catch(() => "");
|
|
1170
|
+
const failures = [];
|
|
1171
|
+
let body;
|
|
1172
|
+
try {
|
|
1173
|
+
body = JSON.parse(text);
|
|
1174
|
+
} catch {
|
|
1175
|
+
body = void 0;
|
|
1176
|
+
}
|
|
1177
|
+
if (!indexResponse.ok) failures.push(`index returned HTTP ${indexResponse.status}`);
|
|
1178
|
+
if (!indexHeadResponse.ok) failures.push(`index HEAD returned HTTP ${indexHeadResponse.status}`);
|
|
1179
|
+
if (responseMediaType(indexResponse.headers.get("content-type")) !== "application/json") failures.push("index Content-Type is not application/json");
|
|
1180
|
+
if (responseMediaType(indexHeadResponse.headers.get("content-type")) !== "application/json") failures.push("index HEAD Content-Type is not application/json");
|
|
1181
|
+
const root = asRecord(body);
|
|
1182
|
+
if (root?.$schema !== AGENT_SKILLS_DISCOVERY_SCHEMA_URI) failures.push("index $schema is not the Agent Skills discovery 0.2.0 schema");
|
|
1183
|
+
const skills = Array.isArray(root?.skills) ? root.skills : [];
|
|
1184
|
+
if (skills.length === 0) failures.push("index does not publish any skills");
|
|
1185
|
+
if (skills.length > 100) failures.push("index publishes more than 100 skills");
|
|
1186
|
+
const validSkills = skills.filter(isValidAgentSkillEntry);
|
|
1187
|
+
if (validSkills.length !== skills.length) failures.push("one or more index entries have invalid name, type, description, URL, or digest fields");
|
|
1188
|
+
if (new Set(validSkills.map((skill) => skill.name)).size !== validSkills.length) failures.push("index contains duplicate skill names");
|
|
1189
|
+
const baseOrigin = new URL(baseUrl).origin;
|
|
1190
|
+
const artifactDetails = [];
|
|
1191
|
+
if (skills.length <= 100) for (const skill of validSkills) {
|
|
1192
|
+
let artifactUrl;
|
|
1193
|
+
try {
|
|
1194
|
+
artifactUrl = new URL(skill.url, indexUrl);
|
|
1195
|
+
} catch {
|
|
1196
|
+
failures.push(`${skill.name} has an invalid artifact URL`);
|
|
1197
|
+
continue;
|
|
1198
|
+
}
|
|
1199
|
+
const expectedPath = DEFAULT_AGENT_SKILLS_ROUTE_PATTERN.replace("{name}", skill.name);
|
|
1200
|
+
if (artifactUrl.origin !== baseOrigin) {
|
|
1201
|
+
failures.push(`${skill.name} artifact is not same-origin`);
|
|
1202
|
+
continue;
|
|
1203
|
+
}
|
|
1204
|
+
if (!artifactUrl.pathname.endsWith(expectedPath)) {
|
|
1205
|
+
failures.push(`${skill.name} artifact URL does not match ${expectedPath}`);
|
|
1206
|
+
continue;
|
|
1207
|
+
}
|
|
1208
|
+
try {
|
|
1209
|
+
const [artifactResponse, artifactHeadResponse] = await Promise.all([fetchWithTimeout(artifactUrl.toString(), { headers: { Accept: "text/markdown" } }), fetchWithTimeout(artifactUrl.toString(), {
|
|
1210
|
+
method: "HEAD",
|
|
1211
|
+
headers: { Accept: "text/markdown" }
|
|
1212
|
+
})]);
|
|
1213
|
+
const content = Buffer.from(await artifactResponse.arrayBuffer());
|
|
1214
|
+
const computedDigest = `sha256:${createHash("sha256").update(content).digest("hex")}`;
|
|
1215
|
+
if (!artifactResponse.ok) failures.push(`${skill.name} artifact returned HTTP ${artifactResponse.status}`);
|
|
1216
|
+
else if (!artifactHeadResponse.ok) failures.push(`${skill.name} artifact HEAD returned HTTP ${artifactHeadResponse.status}`);
|
|
1217
|
+
else if (responseMediaType(artifactResponse.headers.get("content-type")) !== "text/markdown") failures.push(`${skill.name} artifact Content-Type is not text/markdown`);
|
|
1218
|
+
else if (responseMediaType(artifactHeadResponse.headers.get("content-type")) !== "text/markdown") failures.push(`${skill.name} artifact HEAD Content-Type is not text/markdown`);
|
|
1219
|
+
else if (content.length === 0) failures.push(`${skill.name} artifact is empty`);
|
|
1220
|
+
else if (computedDigest !== skill.digest) failures.push(`${skill.name} artifact digest does not match the index`);
|
|
1221
|
+
else artifactDetails.push(`${skill.name} digest verified`);
|
|
1222
|
+
} catch (error) {
|
|
1223
|
+
failures.push(`${skill.name} artifact failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
return failures.length === 0 ? {
|
|
1227
|
+
ok: true,
|
|
1228
|
+
detail: `${route} returned a valid Agent Skills index; ${artifactDetails.join(", ")}.`
|
|
1229
|
+
} : {
|
|
1230
|
+
ok: false,
|
|
1231
|
+
detail: `${route} failed standards validation: ${failures.join("; ")}.`
|
|
1232
|
+
};
|
|
1233
|
+
} catch (error) {
|
|
1234
|
+
return {
|
|
1235
|
+
ok: false,
|
|
1236
|
+
detail: `${route} failed: ${error instanceof Error ? error.message : String(error)}.`
|
|
1237
|
+
};
|
|
1238
|
+
}
|
|
1089
1239
|
}
|
|
1090
1240
|
function readDiscoveryRoute(value) {
|
|
1091
1241
|
return typeof value === "string" && value.startsWith("/") ? value : void 0;
|
|
@@ -1237,6 +1387,9 @@ async function buildHostedAgentChecks(url, pages) {
|
|
|
1237
1387
|
const discovery = await probeJsonRoute(baseUrl, DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE);
|
|
1238
1388
|
const discoveryManifestValid = discovery.ok && isHostedAgentDiscoveryManifest(discovery.body);
|
|
1239
1389
|
checks.push(makeCheck("hosted-agent-discovery", "Hosted agent discovery", discoveryManifestValid ? "pass" : "fail", discoveryManifestValid ? 5 : 0, 5, `${baseUrl}: ${discovery.ok && !discoveryManifestValid ? `${discovery.detail} The payload is not a complete agent discovery manifest.` : discovery.detail}`, discoveryManifestValid ? void 0 : `Make sure ${DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE} returns the complete agent discovery manifest from the shared docs API.`));
|
|
1390
|
+
const [apiCatalog, agentSkills] = await Promise.all([probeApiCatalogRoute(baseUrl), probeAgentSkillsDiscovery(baseUrl)]);
|
|
1391
|
+
checks.push(makeCheck("hosted-api-catalog", "Hosted RFC 9727 API catalog", apiCatalog.ok ? "pass" : "fail", apiCatalog.ok ? 5 : 0, 5, apiCatalog.detail, apiCatalog.ok ? void 0 : `Publish ${DEFAULT_API_CATALOG_ROUTE} with GET and HEAD support, the profiled ${API_CATALOG_MEDIA_TYPE} content type, a rel="api-catalog" Link header, and API links.`));
|
|
1392
|
+
checks.push(makeCheck("hosted-agent-skills", "Hosted Agent Skills discovery", agentSkills.ok ? "pass" : "fail", agentSkills.ok ? 5 : 0, 5, agentSkills.detail, agentSkills.ok ? void 0 : `Publish ${DEFAULT_AGENT_SKILLS_INDEX_ROUTE} and make every indexed SKILL.md artifact match its declared SHA-256 digest.`));
|
|
1240
1393
|
const llms = await Promise.all([probeTextRoute(baseUrl, DEFAULT_LLMS_TXT_ROUTE), probeTextRoute(baseUrl, DEFAULT_LLMS_FULL_TXT_ROUTE)]);
|
|
1241
1394
|
const llmsPassed = llms.filter((result) => result.ok).length;
|
|
1242
1395
|
checks.push(makeCheck("hosted-llms", "Hosted llms.txt", llmsPassed === llms.length ? "pass" : llmsPassed > 0 ? "warn" : "fail", llmsPassed === llms.length ? 5 : llmsPassed > 0 ? 3 : 0, 5, llms.map((result) => result.detail).join(" "), llmsPassed === llms.length ? void 0 : "Verify deployed /llms.txt and /llms-full.txt routes return non-empty text."));
|
|
@@ -1408,9 +1561,11 @@ async function inspectAgentReadiness(options = {}) {
|
|
|
1408
1561
|
const robotsPath = resolveRobotsFilePath(rootDir, framework, typeof robotsInput === "object" ? robotsInput : void 0);
|
|
1409
1562
|
const feedbackRoute = DEFAULT_AGENT_FEEDBACK_ROUTE;
|
|
1410
1563
|
const feedbackSchemaRoute = `${feedbackRoute}/schema`;
|
|
1564
|
+
const apiRoute = resolveDocsDiscoveryApiRoute(config?.cloud?.apiRoute);
|
|
1411
1565
|
const discovery = buildDocsAgentDiscoverySpec({
|
|
1412
1566
|
origin: "http://localhost",
|
|
1413
1567
|
entry,
|
|
1568
|
+
apiRoute,
|
|
1414
1569
|
search: searchEnabled,
|
|
1415
1570
|
mcp: mcpConfig,
|
|
1416
1571
|
feedback: {
|
|
@@ -1429,7 +1584,7 @@ async function inspectAgentReadiness(options = {}) {
|
|
|
1429
1584
|
entry,
|
|
1430
1585
|
search: {
|
|
1431
1586
|
enabled: searchEnabled,
|
|
1432
|
-
endpoint: `${
|
|
1587
|
+
endpoint: `${apiRoute}?query={query}`
|
|
1433
1588
|
},
|
|
1434
1589
|
mcp: {
|
|
1435
1590
|
enabled: mcpConfig.enabled,
|
|
@@ -1437,23 +1592,32 @@ async function inspectAgentReadiness(options = {}) {
|
|
|
1437
1592
|
tools: mcpConfig.tools
|
|
1438
1593
|
},
|
|
1439
1594
|
routes: {
|
|
1440
|
-
"api.docs":
|
|
1441
|
-
"api.config":
|
|
1442
|
-
"
|
|
1595
|
+
"api.docs": apiRoute,
|
|
1596
|
+
"api.config": `${apiRoute}?format=config`,
|
|
1597
|
+
"api.apiCatalog": DEFAULT_API_CATALOG_ROUTE,
|
|
1598
|
+
"api.apiCatalogQuery": `${apiRoute}?format=${DEFAULT_API_CATALOG_FORMAT}`,
|
|
1599
|
+
"api.agentSkillsIndex": DEFAULT_AGENT_SKILLS_INDEX_ROUTE,
|
|
1600
|
+
"apiCatalog.route": DEFAULT_API_CATALOG_ROUTE,
|
|
1601
|
+
"apiCatalog.api": `${apiRoute}?format=${DEFAULT_API_CATALOG_FORMAT}`,
|
|
1602
|
+
"config.endpoint": `${apiRoute}?format=config`,
|
|
1603
|
+
"skills.discovery.index": DEFAULT_AGENT_SKILLS_INDEX_ROUTE,
|
|
1604
|
+
"skills.discovery.artifact": DEFAULT_AGENT_SKILLS_ROUTE_PATTERN,
|
|
1605
|
+
"skills.discovery.apiIndex": `${apiRoute}?format=${DEFAULT_AGENT_SKILLS_INDEX_FORMAT}`,
|
|
1606
|
+
"skills.discovery.apiArtifact": `${apiRoute}?format=${DEFAULT_AGENT_SKILL_FORMAT}&name={name}`
|
|
1443
1607
|
}
|
|
1444
1608
|
}
|
|
1445
1609
|
});
|
|
1446
1610
|
const checks = [];
|
|
1447
1611
|
checks.push(makeCheck("config", "Docs config", configLoad.status === "evaluated" ? "pass" : "warn", configLoad.status === "evaluated" ? 10 : 2, configCheckMax, configLoad.status === "evaluated" ? `Resolved ${path.relative(rootDir, configLoad.path).replace(/\\/g, "/")} and evaluated the config module.` : `Resolved ${path.relative(rootDir, configPath).replace(/\\/g, "/")} using static parsing fallback.`, configLoad.status === "evaluated" ? void 0 : "Fix docs.config module evaluation before relying on resolved diagnostic scores."));
|
|
1448
1612
|
const canScoreSurfaceDrift = configLoad.status === "evaluated";
|
|
1449
|
-
checks.push(makeCheck("surface-drift", "Discovery/config/schema consistency", !canScoreSurfaceDrift ? "warn" : surfaceDrift.length === 0 ? "pass" : "fail", !canScoreSurfaceDrift ? 0 : surfaceDrift.length === 0 ? 10 : Math.max(0, 10 - surfaceDrift.length * 2), 10, !canScoreSurfaceDrift ? "Not scored because docs.config could not be evaluated; static parsing cannot prove discovery/config/schema consistency." : surfaceDrift.length === 0 ? "Resolved config, discovery metadata, MCP tool flags, config schema, and agent contract fields agree." : surfaceDrift.slice(0, 3).map((issue) => issue.message).join(" "), canScoreSurfaceDrift && surfaceDrift.length === 0 ? void 0 : canScoreSurfaceDrift ? "Align docs config, agent discovery, MCP tools, config schema, and the canonical page agent contract before publishing." : "Fix docs.config module evaluation so doctor can compare resolved config with discovery and schema surfaces."));
|
|
1613
|
+
checks.push(makeCheck("surface-drift", "Discovery/config/schema consistency", !canScoreSurfaceDrift ? "warn" : surfaceDrift.length === 0 ? "pass" : "fail", !canScoreSurfaceDrift ? 0 : surfaceDrift.length === 0 ? 10 : Math.max(0, 10 - surfaceDrift.length * 2), 10, !canScoreSurfaceDrift ? "Not scored because docs.config could not be evaluated; static parsing cannot prove discovery/config/schema consistency." : surfaceDrift.length === 0 ? "Resolved config, discovery metadata, MCP tool flags, config schema, and agent contract fields agree." : surfaceDrift.slice(0, 3).map((issue) => issue.message).join(" "), canScoreSurfaceDrift && surfaceDrift.length === 0 ? void 0 : canScoreSurfaceDrift ? "Align docs config, agent discovery (including API catalog and Agent Skills routes), MCP tools, config schema, and the canonical page agent contract before publishing." : "Fix docs.config module evaluation so doctor can compare resolved config with discovery and schema surfaces."));
|
|
1450
1614
|
const dynamicStaticFallback = configLoad.status === "static-fallback" && /(?:\.\.\.|process\.env|import\.meta\.env|\[[^\]]+\]\s*:|:\s*[A-Za-z_$][\w$]*\s*[,}])/u.test(configContent);
|
|
1451
1615
|
checks.push(configLoad.status === "evaluated" ? makeCheck("config-confidence", "Config loading confidence", "pass", 5, 5, "High confidence: docs.config was evaluated with project-local environment values.") : makeCheck("config-confidence", "Config loading confidence", "warn", dynamicStaticFallback ? 1 : 2, 5, `${dynamicStaticFallback ? "Low" : "Partial"} confidence: only static config parsing succeeded. ${configLoad.error}`, "Fix docs.config module evaluation so doctor and review can inspect dynamic values, golden tasks, and resolved feature settings."));
|
|
1452
1616
|
const contentDirAbs = path.resolve(rootDir, contentDir);
|
|
1453
1617
|
checks.push(coverage.totalPages > 0 ? makeCheck("content", "Docs content", "pass", 10, 10, `Found ${coverage.totalPages} docs page${coverage.totalPages === 1 ? "" : "s"} in ${path.relative(rootDir, contentDirAbs).replace(/\\/g, "/")}.`) : makeCheck("content", "Docs content", "fail", 0, 10, `No folder-based docs pages were found in ${path.relative(rootDir, contentDirAbs).replace(/\\/g, "/")}.`, "Add index/page MDX files under the configured contentDir so the machine-readable surfaces have pages to serve."));
|
|
1454
1618
|
checks.push(makeCheck("api-route", "Docs API route", routeSurface.apiMounted ? "pass" : "fail", routeSurface.apiMounted ? 10 : 0, 10, routeSurface.apiDetail, routeSurface.apiMounted ? void 0 : "Wire the framework docs API route so /api/docs can serve markdown, llms.txt, sitemap, AGENTS.md, skill.md, and discovery responses."));
|
|
1455
|
-
checks.push(makeCheck("public-routes", "Public agent routes", routeSurface.publicMounted ? "pass" : "fail", routeSurface.publicMounted ? 10 : 0, 10, routeSurface.publicDetail, routeSurface.publicMounted ? void 0 : "Add the framework public forwarder so /.well-known/*, /llms.txt, /sitemap.xml, /sitemap.md, /docs/sitemap.md, /AGENTS.md, /skill.md, /mcp, and .md routes resolve from the shared docs API."));
|
|
1456
|
-
checks.push(makeCheck("agent-discovery", "Agent discovery spec", routeSurface.apiMounted && routeSurface.publicMounted ? "pass" : "fail", routeSurface.apiMounted && routeSurface.publicMounted ? 5 : 0, 5, routeSurface.apiMounted && routeSurface.publicMounted ? `Expected discovery endpoints are available through ${DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE}, ${DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE}, and /api/docs?agent=spec.` : "Could not verify the shared agent discovery spec endpoints because docs API/public route wiring is incomplete.", routeSurface.apiMounted && routeSurface.publicMounted ? void 0 : "Make sure both the docs API handler and
|
|
1619
|
+
checks.push(makeCheck("public-routes", "Public agent routes", routeSurface.publicMounted ? "pass" : "fail", routeSurface.publicMounted ? 10 : 0, 10, routeSurface.publicDetail, routeSurface.publicMounted ? void 0 : "Add the framework public forwarder so /.well-known/api-catalog, /.well-known/agent-skills/*, the other /.well-known/* resources, /llms.txt, /sitemap.xml, /sitemap.md, /docs/sitemap.md, /AGENTS.md, /skill.md, /mcp, and .md routes resolve from the shared docs API."));
|
|
1620
|
+
checks.push(makeCheck("agent-discovery", "Agent discovery spec", routeSurface.apiMounted && routeSurface.publicMounted ? "pass" : "fail", routeSurface.apiMounted && routeSurface.publicMounted ? 5 : 0, 5, routeSurface.apiMounted && routeSurface.publicMounted ? `Expected discovery endpoints are available through ${DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE}, ${DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE}, ${DEFAULT_API_CATALOG_ROUTE}, ${DEFAULT_AGENT_SKILLS_INDEX_ROUTE}, and /api/docs?agent=spec.` : "Could not verify the shared agent discovery spec endpoints because docs API/public route wiring is incomplete.", routeSurface.apiMounted && routeSurface.publicMounted ? void 0 : "Make sure both the docs API handler and public docs forwarder expose the custom agent manifest, RFC 9727 API catalog, and Agent Skills discovery routes."));
|
|
1457
1621
|
checks.push(llmsEnabled ? makeCheck("llms", "llms.txt discovery", "pass", 5, 5, `Enabled via ${DEFAULT_LLMS_TXT_ROUTE} and ${DEFAULT_LLMS_FULL_TXT_ROUTE}.`) : makeCheck("llms", "llms.txt discovery", "warn", 0, 5, `${DEFAULT_LLMS_TXT_ROUTE} and ${DEFAULT_LLMS_FULL_TXT_ROUTE} are disabled in docs config.`, "Enable llmsTxt so agents and GEO crawlers can discover the docs index and full context surfaces."));
|
|
1458
1622
|
checks.push(sitemapConfig.enabled ? makeCheck("sitemap", "Sitemap discovery", "pass", 5, 5, `Enabled via ${[
|
|
1459
1623
|
sitemapConfig.xml.route,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ot as resolveDocsAudienceMdxContent, Tt as findDocsAudienceMdxTags, _n as hasStructuredPageAgentContract, vn as normalizePageAgentFrontmatter } from "./agent-BFqyqEnC.mjs";
|
|
2
2
|
import { n as agentVersionConstraintsOverlap, o as normalizeAgentVersion, r as normalizeAgentFramework } from "./agent-scope-CCaIY1aK.mjs";
|
|
3
3
|
import { t as extractCodeBlocksFromMarkdown } from "./code-blocks-qe0T8-xe.mjs";
|
|
4
4
|
import { existsSync, lstatSync, readFileSync, readdirSync } from "node:fs";
|