@farming-labs/docs 0.2.55 → 0.2.57
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-DXkXi-pS.mjs → agent-CxDzPqtl.mjs} +1121 -53
- package/dist/{agent-export-BYznnYed.mjs → agent-export-CZR20g0e.mjs} +11 -6
- package/dist/{agent-surface-drift-LS8zQgbq.mjs → agent-surface-drift-rGFS38Ak.mjs} +61 -63
- package/dist/{agent-BOOcHVDL.mjs → agent-v6R0V3lm.mjs} +4 -3
- package/dist/{agents-BHzeeY45.mjs → agents-BPonjolo.mjs} +4 -4
- package/dist/cli/index.mjs +25 -25
- package/dist/{cloud-HWFlbfLJ.mjs → cloud-C45jpBtp.mjs} +1 -1
- package/dist/{codeblocks-BzfkREEC.mjs → codeblocks-CSqgqbg-.mjs} +1 -1
- package/dist/{config-CydaZ5PB.mjs → config-DZbZiYEa.mjs} +18 -2
- package/dist/{doctor-CNIPJdxN.mjs → doctor-svA9Flsx.mjs} +12 -12
- package/dist/index.d.mts +7 -3
- package/dist/index.mjs +5 -5
- package/dist/{init-gnHQ_Pz9.mjs → init-Dm0yDz6v.mjs} +1 -1
- package/dist/{mcp-F9zkBHrU.mjs → mcp-BYIgKsPn.mjs} +4 -4
- package/dist/mcp.mjs +16 -59
- package/dist/{reading-time-BrTd3DIh.mjs → reading-time-W_Id2ayC.mjs} +2 -2
- package/dist/{review-Dlb8dRRx.mjs → review-DZ81wm7h.mjs} +15 -7
- package/dist/{robots-DAptQnkx.mjs → robots-DRpoiYAV.mjs} +1 -1
- package/dist/{robots-4BUJxlvV.mjs → robots-mSc98PMp.mjs} +3 -3
- package/dist/{search-BnQKgDbk.d.mts → search-9uEaC23e.d.mts} +28 -3
- package/dist/{search-B8cF77_i.mjs → search-AMEoabYU.mjs} +4 -4
- package/dist/{search-CEg1omHv.mjs → search-OHp36znm.mjs} +49 -33
- package/dist/server.d.mts +1 -1
- package/dist/server.mjs +3 -3
- package/dist/{sitemap-D9ivTLm8.mjs → sitemap-Cyc0Bbbn.mjs} +4 -4
- package/dist/{sitemap-server-wsNLyVkb.mjs → sitemap-server-zFYctvCa.mjs} +1 -1
- package/package.json +3 -2
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./search-
|
|
1
|
+
import { Ft as renderDocsSitemapMarkdown, It as renderDocsSitemapXml, Lt as resolveDocsSitemapConfig, M as buildDocsAgentDiscoverySpec, Mt as buildDocsSitemapManifest, T as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, a as DEFAULT_AGENT_MD_ROUTE, bt as toDocsMarkdownUrl, c as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, ct as resolveDocsAgentFeedbackConfig, g as DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE, h as DEFAULT_LLMS_FULL_TXT_ROUTE, it as renderDocsMarkdownDocument, l as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, nt as renderDocsAgentsDocument, o as DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE, ot as renderDocsSkillDocument, rt as renderDocsLlmsTxt, 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 } from "./agent-CxDzPqtl.mjs";
|
|
2
|
+
import "./search-OHp36znm.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-
|
|
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-DRpoiYAV.mjs";
|
|
5
|
+
import "./sitemap-server-zFYctvCa.mjs";
|
|
6
6
|
import "./agent-evals-BD17jOqL.mjs";
|
|
7
7
|
import { createFilesystemDocsMcpSource, resolveDocsMcpConfig } from "./mcp.mjs";
|
|
8
8
|
import "./code-blocks-C9awWzEQ.mjs";
|
|
9
9
|
import "./server.mjs";
|
|
10
|
-
import { d as readStringProperty, f as readTopLevelBooleanProperty, h as resolveDocsContentDir, i as loadDocsConfigModule, l as readNavTitle, m as resolveDocsConfigPath, p as readTopLevelStringProperty, r as extractTopLevelConfigObject, s as readBooleanProperty, t as extractNestedObjectLiteral } from "./config-
|
|
10
|
+
import { d as readStringProperty, f as readTopLevelBooleanProperty, h as resolveDocsContentDir, i as loadDocsConfigModule, l as readNavTitle, m as resolveDocsConfigPath, p as readTopLevelStringProperty, r as extractTopLevelConfigObject, s as readBooleanProperty, t as extractNestedObjectLiteral } from "./config-DZbZiYEa.mjs";
|
|
11
11
|
import { t as detectFramework } from "./utils-DBCCkkJS.mjs";
|
|
12
12
|
import { existsSync, lstatSync, mkdirSync, readFileSync, realpathSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
13
13
|
import path from "node:path";
|
|
@@ -693,7 +693,12 @@ async function exportAgentBundle(options = {}) {
|
|
|
693
693
|
markdownUrl: staticMarkdownRoute(page, sourceEntry, routeEntry),
|
|
694
694
|
title: page.title,
|
|
695
695
|
description: page.description,
|
|
696
|
-
content: page.
|
|
696
|
+
content: page.content,
|
|
697
|
+
rawContent: page.rawContent,
|
|
698
|
+
agentContent: page.agentContent,
|
|
699
|
+
agentRawContent: page.agentRawContent,
|
|
700
|
+
agentFallbackContent: page.agentFallbackContent,
|
|
701
|
+
agentFallbackRawContent: page.agentFallbackRawContent
|
|
697
702
|
})), llms);
|
|
698
703
|
for (const route of [DEFAULT_LLMS_TXT_ROUTE, DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE]) addOutput(outputs, publicDir, route, "llms", "text/plain", llmsContent.llmsTxt);
|
|
699
704
|
for (const route of [DEFAULT_LLMS_FULL_TXT_ROUTE, DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE]) addOutput(outputs, publicDir, route, "llms", "text/plain", llmsContent.llmsFullTxt);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ct as findDocsAudienceMdxTags, Et as resolveDocsAudienceMdxContent, Xt as normalizePageAgentFrontmatter, Yt as hasStructuredPageAgentContract } from "./agent-CxDzPqtl.mjs";
|
|
2
2
|
import { n as agentVersionConstraintsOverlap, o as normalizeAgentVersion, r as normalizeAgentFramework } from "./agent-scope-B8lptqCd.mjs";
|
|
3
3
|
import { t as extractCodeBlocksFromMarkdown } from "./code-blocks-C9awWzEQ.mjs";
|
|
4
4
|
import { existsSync, lstatSync, readFileSync, readdirSync } from "node:fs";
|
|
@@ -210,67 +210,63 @@ const PACKAGE_MANAGER_OPTIONS_WITH_VALUES = new Set([
|
|
|
210
210
|
"-F",
|
|
211
211
|
"-w"
|
|
212
212
|
]);
|
|
213
|
-
|
|
213
|
+
function isAgentContextVisible(scopes) {
|
|
214
|
+
return scopes.every((scope) => scope.only === void 0 || scope.only === "agent");
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Extract actual agent-only context while ignoring examples in fenced and inline code.
|
|
218
|
+
*
|
|
219
|
+
* `<Agent>` is agent-only shorthand. `<Audience>` counts only when `only` is the
|
|
220
|
+
* static value `"agent"`; human-only and dynamic/invalid audience declarations do
|
|
221
|
+
* not contribute to agent-context usefulness metrics.
|
|
222
|
+
*/
|
|
214
223
|
function extractAgentBlocks(source, options = {}) {
|
|
215
224
|
const sourcePath = options.sourcePath ?? "unknown";
|
|
216
|
-
const
|
|
225
|
+
const tags = findDocsAudienceMdxTags(source);
|
|
217
226
|
const blocks = [];
|
|
218
|
-
|
|
227
|
+
const scopes = [];
|
|
228
|
+
let nextScopeId = 1;
|
|
229
|
+
let cursor = 0;
|
|
219
230
|
let active;
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
if (active)
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
route: options.route,
|
|
242
|
-
line: active.line,
|
|
243
|
-
content: active.content.join("\n").trim()
|
|
244
|
-
});
|
|
245
|
-
active = void 0;
|
|
246
|
-
}
|
|
247
|
-
continue;
|
|
248
|
-
}
|
|
249
|
-
active.content.push(line);
|
|
250
|
-
continue;
|
|
251
|
-
}
|
|
252
|
-
if (fence || nextFence) {
|
|
253
|
-
fence = nextFence;
|
|
254
|
-
continue;
|
|
255
|
-
}
|
|
256
|
-
if (/^<Agent(?:\s[^>]*)?\s*\/>$/.test(trimmed)) continue;
|
|
257
|
-
const singleLine = /^<Agent(?:\s[^>]*)?>(.*?)<\/Agent>\s*$/.exec(trimmed);
|
|
258
|
-
if (singleLine) {
|
|
259
|
-
blocks.push({
|
|
260
|
-
sourcePath,
|
|
261
|
-
route: options.route,
|
|
262
|
-
line: index + 1,
|
|
263
|
-
content: (singleLine[1] ?? "").trim()
|
|
264
|
-
});
|
|
231
|
+
const appendVisibleContent = (content) => {
|
|
232
|
+
if (active && isAgentContextVisible(scopes)) active.content.push(content);
|
|
233
|
+
};
|
|
234
|
+
const finishActiveBlock = () => {
|
|
235
|
+
if (!active) return;
|
|
236
|
+
blocks.push({
|
|
237
|
+
sourcePath,
|
|
238
|
+
route: options.route,
|
|
239
|
+
line: active.line,
|
|
240
|
+
content: active.content.join("").trim()
|
|
241
|
+
});
|
|
242
|
+
active = void 0;
|
|
243
|
+
};
|
|
244
|
+
for (const tag of tags) {
|
|
245
|
+
const activeScope = scopes.at(-1);
|
|
246
|
+
if (tag.closing && activeScope?.name !== tag.name) continue;
|
|
247
|
+
appendVisibleContent(source.slice(cursor, tag.index));
|
|
248
|
+
cursor = tag.end;
|
|
249
|
+
if (tag.closing) {
|
|
250
|
+
const closedScope = scopes.pop();
|
|
251
|
+
if (active && closedScope?.id === active.scopeId) finishActiveBlock();
|
|
265
252
|
continue;
|
|
266
253
|
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
254
|
+
if (tag.selfClosing) continue;
|
|
255
|
+
const scope = {
|
|
256
|
+
id: nextScopeId,
|
|
257
|
+
name: tag.name,
|
|
258
|
+
only: tag.only
|
|
259
|
+
};
|
|
260
|
+
nextScopeId += 1;
|
|
261
|
+
scopes.push(scope);
|
|
262
|
+
const isAgentOnly = tag.name === "Agent" || tag.name === "Audience" && tag.only === "agent";
|
|
263
|
+
if (!active && isAgentOnly && isAgentContextVisible(scopes)) active = {
|
|
264
|
+
line: source.slice(0, tag.index).split(/\r?\n/).length,
|
|
265
|
+
scopeId: scope.id,
|
|
266
|
+
content: []
|
|
272
267
|
};
|
|
273
268
|
}
|
|
269
|
+
appendVisibleContent(source.slice(cursor));
|
|
274
270
|
return blocks;
|
|
275
271
|
}
|
|
276
272
|
/** Analyze page-level context quality without executing documented commands. */
|
|
@@ -298,10 +294,10 @@ function analyzeAgentUsefulness(options) {
|
|
|
298
294
|
let brokenRelatedLinks = 0;
|
|
299
295
|
const knownRoutes = new Set(options.pages.map((page) => normalizeRoute(page.route)));
|
|
300
296
|
for (const analysis of pages) {
|
|
301
|
-
const { page, agent, actionable } = analysis;
|
|
297
|
+
const { page, agent, actionable, projectedSource } = analysis;
|
|
302
298
|
if (actionable) {
|
|
303
299
|
const guidance = [
|
|
304
|
-
stripFencedContent(
|
|
300
|
+
stripFencedContent(projectedSource),
|
|
305
301
|
page.agentSource ? stripFencedContent(page.agentSource) : void 0,
|
|
306
302
|
...analysis.blocks.map((block) => stripFencedContent(block.content))
|
|
307
303
|
].filter((value) => Boolean(value)).join("\n\n");
|
|
@@ -428,15 +424,17 @@ function analyzeAgentUsefulness(options) {
|
|
|
428
424
|
}
|
|
429
425
|
function analyzePage(page) {
|
|
430
426
|
const agent = normalizePageAgentFrontmatter(page.agent);
|
|
427
|
+
const projectedSource = resolveDocsAudienceMdxContent(page.source, "agent");
|
|
431
428
|
const blocks = extractAgentBlocks(page.source, {
|
|
432
429
|
sourcePath: page.sourcePath,
|
|
433
430
|
route: page.route
|
|
434
431
|
});
|
|
435
|
-
const shellCommands = collectPageCommands(page, agent);
|
|
432
|
+
const shellCommands = collectPageCommands(page, agent, projectedSource);
|
|
436
433
|
return {
|
|
437
434
|
page,
|
|
438
435
|
agent,
|
|
439
436
|
blocks,
|
|
437
|
+
projectedSource,
|
|
440
438
|
shellCommands,
|
|
441
439
|
actionable: page.actionable ?? (hasStructuredPageAgentContract(agent) || shellCommands.length > 0 || blocks.some((block) => ACTIONABLE_PATTERN.test(block.content)) || ACTIONABLE_PATTERN.test(page.agentSource ?? ""))
|
|
442
440
|
};
|
|
@@ -489,7 +487,7 @@ function analyzeBlockQuality(pages, config) {
|
|
|
489
487
|
category: "context",
|
|
490
488
|
line: item.block.line,
|
|
491
489
|
relatedFiles: relatedFiles.filter((file) => file !== item.block.sourcePath),
|
|
492
|
-
message: `Agent block duplicates context used on ${group.length - 1} other page${group.length === 2 ? "" : "s"}.`
|
|
490
|
+
message: `Agent-only block duplicates context used on ${group.length - 1} other page${group.length === 2 ? "" : "s"}.`
|
|
493
491
|
}));
|
|
494
492
|
}
|
|
495
493
|
}
|
|
@@ -507,7 +505,7 @@ function analyzeBlockQuality(pages, config) {
|
|
|
507
505
|
severity: "warning",
|
|
508
506
|
category: "context",
|
|
509
507
|
line: item.block.line,
|
|
510
|
-
message: `${Math.round(ratio * 100)}% of this
|
|
508
|
+
message: `${Math.round(ratio * 100)}% of this agent-only block repeats sentences used across the docs corpus.`
|
|
511
509
|
}));
|
|
512
510
|
}
|
|
513
511
|
if (isGenericAgentBlock(item.block.content, sentences)) {
|
|
@@ -518,7 +516,7 @@ function analyzeBlockQuality(pages, config) {
|
|
|
518
516
|
severity: "suggestion",
|
|
519
517
|
category: "context",
|
|
520
518
|
line: item.block.line,
|
|
521
|
-
message: "Agent block is generic and lacks a concrete command, path, identifier, version, or task-specific constraint."
|
|
519
|
+
message: "Agent-only block is generic and lacks a concrete command, path, identifier, version, or task-specific constraint."
|
|
522
520
|
}));
|
|
523
521
|
}
|
|
524
522
|
}
|
|
@@ -684,7 +682,7 @@ function commandAnalysis(findings) {
|
|
|
684
682
|
status: "healthy"
|
|
685
683
|
};
|
|
686
684
|
}
|
|
687
|
-
function collectPageCommands(page, agent) {
|
|
685
|
+
function collectPageCommands(page, agent, projectedSource) {
|
|
688
686
|
const commands = [];
|
|
689
687
|
for (const command of agent?.commands ?? []) commands.push(normalizeAgentCommand(command, page.sourcePath));
|
|
690
688
|
for (const verification of agent?.verification ?? []) if (typeof verification !== "string" && verification.run) commands.push({
|
|
@@ -692,7 +690,7 @@ function collectPageCommands(page, agent) {
|
|
|
692
690
|
sourcePath: page.sourcePath,
|
|
693
691
|
source: "contract"
|
|
694
692
|
});
|
|
695
|
-
collectMarkdownCommands(commands,
|
|
693
|
+
collectMarkdownCommands(commands, projectedSource, page.sourcePath);
|
|
696
694
|
if (page.agentSource) collectMarkdownCommands(commands, page.agentSource, page.agentSourcePath ?? page.sourcePath);
|
|
697
695
|
return dedupeCommands(commands);
|
|
698
696
|
}
|
|
@@ -1426,4 +1424,4 @@ function analyzeAgentSurfaceDrift(options) {
|
|
|
1426
1424
|
}
|
|
1427
1425
|
|
|
1428
1426
|
//#endregion
|
|
1429
|
-
export { analyzeAgentUsefulness as n, createAgentUsefulnessPagesFromMcp as r, analyzeAgentSurfaceDrift as t };
|
|
1427
|
+
export { extractAgentBlocks as i, analyzeAgentUsefulness as n, createAgentUsefulnessPagesFromMcp as r, analyzeAgentSurfaceDrift as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as hashGeneratedAgentContent, b as serializeGeneratedAgentDocument, g as GENERATED_AGENT_PROVENANCE_VERSION, y as parseGeneratedAgentDocument } from "./search-
|
|
1
|
+
import { $t as stripGeneratedPageAgentContractMarkdown, Xt as normalizePageAgentFrontmatter, it as renderDocsMarkdownDocument, z as findDocsMarkdownPage } from "./agent-CxDzPqtl.mjs";
|
|
2
|
+
import { _ as hashGeneratedAgentContent, b as serializeGeneratedAgentDocument, g as GENERATED_AGENT_PROVENANCE_VERSION, y as parseGeneratedAgentDocument } from "./search-OHp36znm.mjs";
|
|
3
3
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
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-
|
|
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-DZbZiYEa.mjs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import matter from "gray-matter";
|
|
7
7
|
import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
@@ -337,6 +337,7 @@ function buildPageOptions(defaults, pagePath) {
|
|
|
337
337
|
function buildResolvedPageSourceDocument(page) {
|
|
338
338
|
return stripGeneratedPageAgentContractMarkdown(renderDocsMarkdownDocument({
|
|
339
339
|
...page,
|
|
340
|
+
agentContent: void 0,
|
|
340
341
|
agentRawContent: void 0
|
|
341
342
|
}));
|
|
342
343
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { C as DEFAULT_OPENAPI_SCHEMA_ROUTE, a as DEFAULT_AGENT_MD_ROUTE, ct as resolveDocsAgentFeedbackConfig, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, nt as renderDocsAgentsDocument, o as DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE, t as DEFAULT_AGENTS_MD_ROUTE } from "./agent-
|
|
2
|
-
import "./search-
|
|
3
|
-
import { S as resolveApiReferenceConfig } from "./sitemap-server-
|
|
1
|
+
import { C as DEFAULT_OPENAPI_SCHEMA_ROUTE, a as DEFAULT_AGENT_MD_ROUTE, ct as resolveDocsAgentFeedbackConfig, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, nt as renderDocsAgentsDocument, o as DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE, t as DEFAULT_AGENTS_MD_ROUTE } from "./agent-CxDzPqtl.mjs";
|
|
2
|
+
import "./search-OHp36znm.mjs";
|
|
3
|
+
import { S as resolveApiReferenceConfig } from "./sitemap-server-zFYctvCa.mjs";
|
|
4
4
|
import "./agent-evals-BD17jOqL.mjs";
|
|
5
5
|
import { resolveDocsMcpConfig } from "./mcp.mjs";
|
|
6
6
|
import "./code-blocks-C9awWzEQ.mjs";
|
|
7
7
|
import "./server.mjs";
|
|
8
|
-
import { d as readStringProperty, i as loadDocsConfigModule, l as readNavTitle, m as resolveDocsConfigPath, p as readTopLevelStringProperty, s as readBooleanProperty, t as extractNestedObjectLiteral } from "./config-
|
|
8
|
+
import { d as readStringProperty, i as loadDocsConfigModule, l as readNavTitle, m as resolveDocsConfigPath, p as readTopLevelStringProperty, s as readBooleanProperty, t as extractNestedObjectLiteral } from "./config-DZbZiYEa.mjs";
|
|
9
9
|
import { t as detectFramework } from "./utils-DBCCkkJS.mjs";
|
|
10
10
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
11
11
|
import path from "node:path";
|
package/dist/cli/index.mjs
CHANGED
|
@@ -105,43 +105,43 @@ async function main() {
|
|
|
105
105
|
]
|
|
106
106
|
};
|
|
107
107
|
if (!parsedCommand.command || parsedCommand.command === "init") {
|
|
108
|
-
const { init } = await import("../init-
|
|
108
|
+
const { init } = await import("../init-Dm0yDz6v.mjs");
|
|
109
109
|
await init(initOptions);
|
|
110
110
|
} else if (parsedCommand.command === "dev") {
|
|
111
111
|
const { dev } = await import("../dev-BA2kRuCn.mjs");
|
|
112
112
|
await dev(devOptions);
|
|
113
113
|
} else if (parsedCommand.command === "deploy") {
|
|
114
|
-
const { runCloudDeploy } = await import("../cloud-
|
|
114
|
+
const { runCloudDeploy } = await import("../cloud-C45jpBtp.mjs");
|
|
115
115
|
await runCloudDeploy(cloudOptions);
|
|
116
116
|
} else if (parsedCommand.command === "preview") {
|
|
117
|
-
const { runCloudPreview } = await import("../cloud-
|
|
117
|
+
const { runCloudPreview } = await import("../cloud-C45jpBtp.mjs");
|
|
118
118
|
await runCloudPreview(cloudOptions);
|
|
119
119
|
} else if (parsedCommand.command === "cloud" && subcommand === "deploy") {
|
|
120
|
-
const { runCloudDeploy } = await import("../cloud-
|
|
120
|
+
const { runCloudDeploy } = await import("../cloud-C45jpBtp.mjs");
|
|
121
121
|
await runCloudDeploy(cloudOptions);
|
|
122
122
|
} else if (parsedCommand.command === "cloud" && subcommand === "preview") {
|
|
123
|
-
const { runCloudPreview } = await import("../cloud-
|
|
123
|
+
const { runCloudPreview } = await import("../cloud-C45jpBtp.mjs");
|
|
124
124
|
await runCloudPreview(cloudOptions);
|
|
125
125
|
} else if (parsedCommand.command === "cloud" && subcommand === "init") {
|
|
126
|
-
const { runCloudInit } = await import("../cloud-
|
|
126
|
+
const { runCloudInit } = await import("../cloud-C45jpBtp.mjs");
|
|
127
127
|
await runCloudInit(cloudOptions);
|
|
128
128
|
} else if (parsedCommand.command === "cloud" && subcommand === "sync") {
|
|
129
|
-
const { syncCloudConfig } = await import("../cloud-
|
|
129
|
+
const { syncCloudConfig } = await import("../cloud-C45jpBtp.mjs");
|
|
130
130
|
await syncCloudConfig(cloudOptions);
|
|
131
131
|
} else if (parsedCommand.command === "cloud" && subcommand === "check") {
|
|
132
|
-
const { runCloudCheck } = await import("../cloud-
|
|
132
|
+
const { runCloudCheck } = await import("../cloud-C45jpBtp.mjs");
|
|
133
133
|
await runCloudCheck(cloudOptions);
|
|
134
134
|
} else if (parsedCommand.command === "cloud") {
|
|
135
135
|
console.error(pc.red(`Unknown cloud subcommand: ${subcommand ?? "(missing)"}`));
|
|
136
136
|
console.error();
|
|
137
|
-
const { printCloudHelp } = await import("../cloud-
|
|
137
|
+
const { printCloudHelp } = await import("../cloud-C45jpBtp.mjs");
|
|
138
138
|
printCloudHelp();
|
|
139
139
|
process.exit(1);
|
|
140
140
|
} else if (parsedCommand.command === "mcp") {
|
|
141
|
-
const { runMcp } = await import("../mcp-
|
|
141
|
+
const { runMcp } = await import("../mcp-BYIgKsPn.mjs");
|
|
142
142
|
await runMcp(mcpOptions);
|
|
143
143
|
} else if (parsedCommand.command === "agent" && subcommand === "compact") {
|
|
144
|
-
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent-
|
|
144
|
+
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent-v6R0V3lm.mjs").then((n) => n.t);
|
|
145
145
|
const agentCompactOptions = parseAgentCompactArgs(args.slice(2));
|
|
146
146
|
if (agentCompactOptions.help) {
|
|
147
147
|
printAgentCompactHelp();
|
|
@@ -149,7 +149,7 @@ async function main() {
|
|
|
149
149
|
}
|
|
150
150
|
await compactAgentDocs(agentCompactOptions);
|
|
151
151
|
} else if (parsedCommand.command === "agent" && subcommand === "export") {
|
|
152
|
-
const { exportAgentBundle, parseAgentExportArgs, printAgentExportHelp } = await import("../agent-export-
|
|
152
|
+
const { exportAgentBundle, parseAgentExportArgs, printAgentExportHelp } = await import("../agent-export-CZR20g0e.mjs");
|
|
153
153
|
const agentExportOptions = parseAgentExportArgs(args.slice(2));
|
|
154
154
|
if (agentExportOptions.help) {
|
|
155
155
|
printAgentExportHelp();
|
|
@@ -159,13 +159,13 @@ async function main() {
|
|
|
159
159
|
} else if (parsedCommand.command === "agent") {
|
|
160
160
|
console.error(pc.red(`Unknown agent subcommand: ${subcommand ?? "(missing)"}`));
|
|
161
161
|
console.error();
|
|
162
|
-
const { printAgentCompactHelp } = await import("../agent-
|
|
163
|
-
const { printAgentExportHelp } = await import("../agent-export-
|
|
162
|
+
const { printAgentCompactHelp } = await import("../agent-v6R0V3lm.mjs").then((n) => n.t);
|
|
163
|
+
const { printAgentExportHelp } = await import("../agent-export-CZR20g0e.mjs");
|
|
164
164
|
printAgentCompactHelp();
|
|
165
165
|
printAgentExportHelp();
|
|
166
166
|
process.exit(1);
|
|
167
167
|
} else if (parsedCommand.command === "agents" && subcommand === "generate") {
|
|
168
|
-
const { generateAgents, parseAgentsGenerateArgs, printAgentsGenerateHelp } = await import("../agents-
|
|
168
|
+
const { generateAgents, parseAgentsGenerateArgs, printAgentsGenerateHelp } = await import("../agents-BPonjolo.mjs");
|
|
169
169
|
const agentsOptions = parseAgentsGenerateArgs(args.slice(2));
|
|
170
170
|
if (agentsOptions.help) {
|
|
171
171
|
printAgentsGenerateHelp();
|
|
@@ -175,11 +175,11 @@ async function main() {
|
|
|
175
175
|
} else if (parsedCommand.command === "agents") {
|
|
176
176
|
console.error(pc.red(`Unknown agents subcommand: ${subcommand ?? "(missing)"}`));
|
|
177
177
|
console.error();
|
|
178
|
-
const { printAgentsGenerateHelp } = await import("../agents-
|
|
178
|
+
const { printAgentsGenerateHelp } = await import("../agents-BPonjolo.mjs");
|
|
179
179
|
printAgentsGenerateHelp();
|
|
180
180
|
process.exit(1);
|
|
181
181
|
} else if (parsedCommand.command === "doctor") {
|
|
182
|
-
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-
|
|
182
|
+
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-svA9Flsx.mjs");
|
|
183
183
|
const doctorOptions = parseDoctorArgs(args.slice(1));
|
|
184
184
|
if (doctorOptions.help) {
|
|
185
185
|
printDoctorHelp();
|
|
@@ -187,7 +187,7 @@ async function main() {
|
|
|
187
187
|
}
|
|
188
188
|
await runDoctor(doctorOptions);
|
|
189
189
|
} else if (parsedCommand.command === "review") {
|
|
190
|
-
const { parseReviewArgs, printReviewHelp, runReview } = await import("../review-
|
|
190
|
+
const { parseReviewArgs, printReviewHelp, runReview } = await import("../review-DZ81wm7h.mjs");
|
|
191
191
|
const reviewOptions = parseReviewArgs(args.slice(1));
|
|
192
192
|
if (reviewOptions.help) {
|
|
193
193
|
printReviewHelp();
|
|
@@ -195,7 +195,7 @@ async function main() {
|
|
|
195
195
|
}
|
|
196
196
|
await runReview(reviewOptions);
|
|
197
197
|
} else if ((parsedCommand.command === "codeblocks" || parsedCommand.command === "code-blocks") && subcommand === "validate") {
|
|
198
|
-
const { parseCodeBlocksValidateArgs, printCodeBlocksValidateHelp, runCodeBlocksValidate } = await import("../codeblocks-
|
|
198
|
+
const { parseCodeBlocksValidateArgs, printCodeBlocksValidateHelp, runCodeBlocksValidate } = await import("../codeblocks-CSqgqbg-.mjs");
|
|
199
199
|
const codeBlocksOptions = parseCodeBlocksValidateArgs(args.slice(2));
|
|
200
200
|
if (codeBlocksOptions.help) {
|
|
201
201
|
printCodeBlocksValidateHelp();
|
|
@@ -205,11 +205,11 @@ async function main() {
|
|
|
205
205
|
} else if (parsedCommand.command === "codeblocks" || parsedCommand.command === "code-blocks") {
|
|
206
206
|
console.error(pc.red(`Unknown codeblocks subcommand: ${subcommand ?? "(missing)"}`));
|
|
207
207
|
console.error();
|
|
208
|
-
const { printCodeBlocksValidateHelp } = await import("../codeblocks-
|
|
208
|
+
const { printCodeBlocksValidateHelp } = await import("../codeblocks-CSqgqbg-.mjs");
|
|
209
209
|
printCodeBlocksValidateHelp();
|
|
210
210
|
process.exit(1);
|
|
211
211
|
} else if (parsedCommand.command === "search" && subcommand === "sync") {
|
|
212
|
-
const { syncSearch } = await import("../search-
|
|
212
|
+
const { syncSearch } = await import("../search-AMEoabYU.mjs");
|
|
213
213
|
await syncSearch(searchSyncOptions);
|
|
214
214
|
} else if (parsedCommand.command === "search") {
|
|
215
215
|
console.error(pc.red(`Unknown search subcommand: ${subcommand ?? "(missing)"}`));
|
|
@@ -217,7 +217,7 @@ async function main() {
|
|
|
217
217
|
printHelp();
|
|
218
218
|
process.exit(1);
|
|
219
219
|
} else if (parsedCommand.command === "sitemap" && subcommand === "generate") {
|
|
220
|
-
const { generateSitemap, parseSitemapGenerateArgs, printSitemapGenerateHelp } = await import("../sitemap-
|
|
220
|
+
const { generateSitemap, parseSitemapGenerateArgs, printSitemapGenerateHelp } = await import("../sitemap-Cyc0Bbbn.mjs");
|
|
221
221
|
const sitemapOptions = parseSitemapGenerateArgs(args.slice(2));
|
|
222
222
|
if (sitemapOptions.help) {
|
|
223
223
|
printSitemapGenerateHelp();
|
|
@@ -227,11 +227,11 @@ async function main() {
|
|
|
227
227
|
} else if (parsedCommand.command === "sitemap") {
|
|
228
228
|
console.error(pc.red(`Unknown sitemap subcommand: ${subcommand ?? "(missing)"}`));
|
|
229
229
|
console.error();
|
|
230
|
-
const { printSitemapGenerateHelp } = await import("../sitemap-
|
|
230
|
+
const { printSitemapGenerateHelp } = await import("../sitemap-Cyc0Bbbn.mjs");
|
|
231
231
|
printSitemapGenerateHelp();
|
|
232
232
|
process.exit(1);
|
|
233
233
|
} else if (parsedCommand.command === "robots" && subcommand === "generate") {
|
|
234
|
-
const { generateRobots, parseRobotsGenerateArgs, printRobotsGenerateHelp } = await import("../robots-
|
|
234
|
+
const { generateRobots, parseRobotsGenerateArgs, printRobotsGenerateHelp } = await import("../robots-mSc98PMp.mjs");
|
|
235
235
|
const robotsOptions = parseRobotsGenerateArgs(args.slice(2));
|
|
236
236
|
if (robotsOptions.help) {
|
|
237
237
|
printRobotsGenerateHelp();
|
|
@@ -241,7 +241,7 @@ async function main() {
|
|
|
241
241
|
} else if (parsedCommand.command === "robots") {
|
|
242
242
|
console.error(pc.red(`Unknown robots subcommand: ${subcommand ?? "(missing)"}`));
|
|
243
243
|
console.error();
|
|
244
|
-
const { printRobotsGenerateHelp } = await import("../robots-
|
|
244
|
+
const { printRobotsGenerateHelp } = await import("../robots-mSc98PMp.mjs");
|
|
245
245
|
printRobotsGenerateHelp();
|
|
246
246
|
process.exit(1);
|
|
247
247
|
} else if (parsedCommand.command === "downgrade") {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as markCliErrorReported } from "./errors-BFUtdZfC.mjs";
|
|
2
|
-
import { d as readStringProperty, f as readTopLevelBooleanProperty, h as resolveDocsContentDir, i as loadDocsConfigModule, l as readNavTitle, m as resolveDocsConfigPath, o as loadProjectEnv, p as readTopLevelStringProperty, t as extractNestedObjectLiteral } from "./config-
|
|
2
|
+
import { d as readStringProperty, f as readTopLevelBooleanProperty, h as resolveDocsContentDir, i as loadDocsConfigModule, l as readNavTitle, m as resolveDocsConfigPath, o as loadProjectEnv, p as readTopLevelStringProperty, t as extractNestedObjectLiteral } from "./config-DZbZiYEa.mjs";
|
|
3
3
|
import { i as detectPackageManagerFromProject, t as detectFramework } from "./utils-DBCCkkJS.mjs";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as validateCodeBlocks, r as resolveDocsCodeBlocksValidateConfig } from "./code-blocks-C9awWzEQ.mjs";
|
|
2
|
-
import { d as readStringProperty, h as resolveDocsContentDir, i as loadDocsConfigModule, m as resolveDocsConfigPath, p as readTopLevelStringProperty, s as readBooleanProperty, t as extractNestedObjectLiteral, u as readNumberProperty } from "./config-
|
|
2
|
+
import { d as readStringProperty, h as resolveDocsContentDir, i as loadDocsConfigModule, m as resolveDocsConfigPath, p as readTopLevelStringProperty, s as readBooleanProperty, t as extractNestedObjectLiteral, u as readNumberProperty } from "./config-DZbZiYEa.mjs";
|
|
3
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
4
4
|
import pc from "picocolors";
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
-
import { join, resolve } from "node:path";
|
|
2
|
+
import { dirname, join, relative, resolve, sep } from "node:path";
|
|
3
3
|
|
|
4
4
|
//#region src/cli/config.ts
|
|
5
5
|
const FILE_EXTS = [
|
|
@@ -295,6 +295,20 @@ function isPlainDocsConfig(value) {
|
|
|
295
295
|
const prototype = Object.getPrototypeOf(value);
|
|
296
296
|
return prototype === Object.prototype || prototype === null;
|
|
297
297
|
}
|
|
298
|
+
function resolveDocsConfigTsconfigPath(rootDir, configPath) {
|
|
299
|
+
const projectRoot = resolve(rootDir);
|
|
300
|
+
let currentDir = dirname(configPath);
|
|
301
|
+
while (true) {
|
|
302
|
+
const tsconfigPath = join(currentDir, "tsconfig.json");
|
|
303
|
+
if (existsSync(tsconfigPath)) return tsconfigPath;
|
|
304
|
+
if (currentDir === projectRoot) return false;
|
|
305
|
+
const parentDir = dirname(currentDir);
|
|
306
|
+
if (parentDir === currentDir) return false;
|
|
307
|
+
const relativeParent = relative(projectRoot, parentDir);
|
|
308
|
+
if (relativeParent === ".." || relativeParent.startsWith(`..${sep}`)) return false;
|
|
309
|
+
currentDir = parentDir;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
298
312
|
/**
|
|
299
313
|
* Load docs.config with an explicit confidence signal for diagnostics.
|
|
300
314
|
* Existing callers can keep using `loadDocsConfigModule`, which preserves the
|
|
@@ -307,7 +321,9 @@ async function loadDocsConfigModuleResult(rootDir, explicitPath, options = {}) {
|
|
|
307
321
|
const config = resolveDocsConfigModuleExport(await createJiti(import.meta.url, {
|
|
308
322
|
moduleCache: false,
|
|
309
323
|
fsCache: false,
|
|
310
|
-
interopDefault: false
|
|
324
|
+
interopDefault: false,
|
|
325
|
+
jsx: { runtime: "automatic" },
|
|
326
|
+
tsconfigPaths: resolveDocsConfigTsconfigPath(rootDir, configPath)
|
|
311
327
|
}).import(configPath));
|
|
312
328
|
if (!isPlainDocsConfig(config)) return {
|
|
313
329
|
status: "static-fallback",
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { i as scanDocsPageTargets, n as compactAgentDocs, r as inspectAgentCompactionState } from "./agent-
|
|
2
|
-
import "./reading-time-
|
|
3
|
-
import {
|
|
4
|
-
import "./search-
|
|
5
|
-
import { a as analyzeDocsRobotsTxt, n as DEFAULT_ROBOTS_TXT_ROUTE, u as resolveDocsRobotsConfig } from "./robots-
|
|
6
|
-
import "./sitemap-server-
|
|
1
|
+
import { i as scanDocsPageTargets, n as compactAgentDocs, r as inspectAgentCompactionState } from "./agent-v6R0V3lm.mjs";
|
|
2
|
+
import "./reading-time-W_Id2ayC.mjs";
|
|
3
|
+
import { At as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, I as buildDocsMcpEndpointCandidates, Lt as resolveDocsSitemapConfig, M as buildDocsAgentDiscoverySpec, O as DOCS_CONFIG_MAP_TOP_LEVEL_KEYS, P as buildDocsConfigMap, S as DEFAULT_MCP_WELL_KNOWN_ROUTE, T as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, Wt as PAGE_AGENT_CONTRACT_FIELDS, b as DEFAULT_MCP_PUBLIC_ROUTE, c as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, f as DEFAULT_DOCS_CONFIG_ROUTE, h as DEFAULT_LLMS_FULL_TXT_ROUTE, i as DEFAULT_AGENT_FEEDBACK_ROUTE, jt as DEFAULT_SITEMAP_XML_ROUTE, kt as DEFAULT_SITEMAP_MD_ROUTE, l as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, t as DEFAULT_AGENTS_MD_ROUTE, u as DEFAULT_DOCS_API_ROUTE, v as DEFAULT_LLMS_TXT_ROUTE, w as DEFAULT_SKILL_MD_ROUTE } from "./agent-CxDzPqtl.mjs";
|
|
4
|
+
import "./search-OHp36znm.mjs";
|
|
5
|
+
import { a as analyzeDocsRobotsTxt, n as DEFAULT_ROBOTS_TXT_ROUTE, u as resolveDocsRobotsConfig } from "./robots-DRpoiYAV.mjs";
|
|
6
|
+
import "./sitemap-server-zFYctvCa.mjs";
|
|
7
7
|
import { t as runDocsGoldenTasks } from "./agent-evals-BD17jOqL.mjs";
|
|
8
8
|
import { createFilesystemDocsMcpSource, getDocsConfigSchema, resolveDocsMcpConfig } from "./mcp.mjs";
|
|
9
9
|
import "./code-blocks-C9awWzEQ.mjs";
|
|
10
10
|
import "./server.mjs";
|
|
11
|
-
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-
|
|
11
|
+
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-DZbZiYEa.mjs";
|
|
12
12
|
import { t as detectFramework } from "./utils-DBCCkkJS.mjs";
|
|
13
|
-
import { n as analyzeAgentUsefulness, r as createAgentUsefulnessPagesFromMcp, t as analyzeAgentSurfaceDrift } from "./agent-surface-drift-
|
|
13
|
+
import { n as analyzeAgentUsefulness, r as createAgentUsefulnessPagesFromMcp, t as analyzeAgentSurfaceDrift } from "./agent-surface-drift-rGFS38Ak.mjs";
|
|
14
14
|
import { existsSync, lstatSync, readFileSync, readdirSync } from "node:fs";
|
|
15
15
|
import path from "node:path";
|
|
16
16
|
import { LATEST_PROTOCOL_VERSION } from "@modelcontextprotocol/sdk/types.js";
|
|
@@ -1483,8 +1483,8 @@ async function inspectAgentReadiness(options = {}) {
|
|
|
1483
1483
|
checks.push(agentFeedbackEnabled ? makeCheck("feedback", "Agent feedback", "pass", 5, 5, `Structured agent feedback is enabled at ${feedbackRoute} with schema ${feedbackSchemaRoute}.`) : makeCheck("feedback", "Agent feedback", "warn", 0, 5, "Structured agent feedback is not enabled.", "Enable feedback.agent if you want agents to discover and post feedback through the shared docs API."));
|
|
1484
1484
|
checks.push(makeCheck("metadata", "Page metadata", metadataResult.status, metadataResult.score, 5, coverage.totalPages > 0 ? `${metadataCoverage.describedPages}/${coverage.totalPages} pages include descriptions and ${metadataCoverage.relatedPages}/${coverage.totalPages} pages include related links (${metadataCoverage.descriptionCoverage}% described, ${metadataCoverage.relatedCoverage}% related).` : "No docs pages were available to score page metadata.", metadataCoverage.descriptionCoverage >= 75 ? void 0 : "Add page descriptions and related links to more docs pages so agent markdown output carries better context and navigation hints."));
|
|
1485
1485
|
const coverageResult = coverageScore(coverage.explicitCoverage);
|
|
1486
|
-
checks.push(makeCheck("coverage", "
|
|
1487
|
-
checks.push(makeCheck("agent-context-quality", "Agent context usefulness", contextQualityResult.status, contextQualityResult.score, 15, usefulness.metrics.agentBlocks.total > 0 ? `${usefulness.metrics.agentBlocks.useful}/${usefulness.metrics.agentBlocks.total}
|
|
1486
|
+
checks.push(makeCheck("coverage", "Audience-tailored page optimization", coverageResult.status, coverageResult.score, 10, coverage.totalPages > 0 ? `${coverage.explicitPages}/${coverage.totalPages} pages define audience-tailored context (${coverage.pagesWithAgentFiles} page${coverage.pagesWithAgentFiles === 1 ? "" : "s"} with agent.md, ${coverage.pagesWithAgentBlocks} page${coverage.pagesWithAgentBlocks === 1 ? "" : "s"} with embedded audience projections, ${coverage.explicitCoverage}% of pages).` : "No docs pages were available to score audience-tailored page optimization.", coverage.explicitCoverage >= 50 ? void 0 : "Add agent.md files or audience primitives such as <Agent>, <Human>, or <Audience only=\"agent\"> to more pages, or run docs agent compact to create page-level machine docs."));
|
|
1487
|
+
checks.push(makeCheck("agent-context-quality", "Agent context usefulness", contextQualityResult.status, contextQualityResult.score, 15, usefulness.metrics.agentBlocks.total > 0 ? `${usefulness.metrics.agentBlocks.useful}/${usefulness.metrics.agentBlocks.total} agent-only blocks are specific and non-repetitive (${usefulness.metrics.agentBlocks.duplicate} duplicate, ${usefulness.metrics.agentBlocks.boilerplate} boilerplate, ${usefulness.metrics.agentBlocks.generic} generic).` : "No embedded agent-only blocks were present; page contracts and sibling agent.md files remain available as alternatives.", usefulness.metrics.agentBlocks.total > 0 && usefulness.metrics.agentBlocks.useful === usefulness.metrics.agentBlocks.total ? void 0 : "Replace repeated agent-only boilerplate with page-specific constraints, commands, files, expected results, and recovery guidance."));
|
|
1488
1488
|
checks.push(makeCheck("agent-task-completeness", "Agent task completeness", taskCompletenessResult.status, taskCompletenessResult.score, 15, `${usefulness.metrics.taskCompleteness.completePages}/${usefulness.metrics.actionablePages} actionable pages include prerequisites, an expected result, and recovery guidance (${usefulness.metrics.taskCompleteness.coverage}% complete).`, usefulness.metrics.actionablePages > 0 && usefulness.metrics.taskCompleteness.coverage >= 80 ? void 0 : "Add prerequisites, observable outcomes or verification expectations, and rollback or resolved failure modes to actionable pages."));
|
|
1489
1489
|
checks.push(makeCheck("agent-applicability", "Framework and version applicability", applicabilityResult.status, applicabilityResult.score, 10, `${usefulness.metrics.applicability.conflictingPages} conflicting, ${usefulness.metrics.applicability.ambiguousPages} ambiguous, and ${usefulness.metrics.applicability.mismatchedPages} project-mismatched actionable pages.`, usefulness.metrics.actionablePages > 0 && applicabilityIssueCount === 0 ? void 0 : "Declare consistent framework/version metadata in page frontmatter and agent.appliesTo so retrieval can select the right variant."));
|
|
1490
1490
|
checks.push(makeCheck("command-health", "Documented command health", commandHealthResult.status, commandHealthResult.score, 10, `${usefulness.metrics.commands.healthy}/${usefulness.metrics.commands.total} statically inspected commands are healthy; ${usefulness.metrics.commands.unhealthy} are unhealthy and ${usefulness.metrics.commands.unverified} could not be verified safely.`, usefulness.metrics.commands.total > 0 && usefulness.metrics.commands.unhealthy === 0 && usefulness.metrics.commands.unverified === 0 ? void 0 : "Update broken or stale commands and make workspace selectors resolvable so scripts, working directories, package managers, and docs CLI subcommands can be verified."));
|
|
@@ -1600,8 +1600,8 @@ function printAgentDoctorReport(report) {
|
|
|
1600
1600
|
console.log(`${pc.bold("Score:")} ${pc.cyan(`${report.score}%`)} ${pc.dim(`(${report.grade})`)}`);
|
|
1601
1601
|
console.log(`${pc.bold("Framework:")} ${report.framework} ${pc.dim("•")} ${pc.bold("Entry:")} ${report.entry ?? "docs"} ${pc.dim("•")} ${pc.bold("Content:")} ${report.contentDir ?? "-"}`);
|
|
1602
1602
|
if (report.url) console.log(`${pc.bold("Hosted URL:")} ${report.url}`);
|
|
1603
|
-
console.log(`${pc.bold("
|
|
1604
|
-
if (report.usefulness) console.log(`${pc.bold("Useful
|
|
1603
|
+
console.log(`${pc.bold("Audience-tailored pages:")} ${report.coverage.explicitPages}/${report.coverage.totalPages} pages ${pc.dim(`(${report.coverage.explicitCoverage}%)`)}`);
|
|
1604
|
+
if (report.usefulness) console.log(`${pc.bold("Useful agent-only blocks:")} ${report.usefulness.agentBlocks.useful}/${report.usefulness.agentBlocks.total} ${pc.dim(`• ${report.usefulness.taskCompleteness.completePages}/${report.usefulness.actionablePages} actionable pages task-complete`)}`);
|
|
1605
1605
|
if (report.evaluations) console.log(`${pc.bold("Golden tasks:")} ${report.evaluations.status === "unmeasured" ? "unmeasured" : `${report.evaluations.passedTaskCount}/${report.evaluations.taskCount} passed (${report.evaluations.score}/100)`}`);
|
|
1606
1606
|
console.log(`${pc.bold("Generated agent.md freshness:")} ${report.coverage.compaction.freshGeneratedPages} fresh ${pc.dim("•")} ${report.coverage.compaction.staleGeneratedPages} stale ${pc.dim("•")} ${report.coverage.compaction.modifiedGeneratedPages} modified ${pc.dim("•")} ${report.coverage.compaction.tokenBudgetMissingPages} token-budget missing`);
|
|
1607
1607
|
if (report.fixes && report.fixes.length > 0) console.log(`${pc.bold("Fixes:")} ${report.fixes.map((fix) => `${fix.status === "applied" ? "applied" : "skipped"} ${fix.title}`).join(pc.dim(" • "))}`);
|