@farming-labs/docs 0.2.106 → 0.2.108
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-CaCWThBY.mjs → agent--fSgaVIK.mjs} +207 -12
- package/dist/{agent-DCTGj6J7.mjs → agent-BDrflLmt.mjs} +1 -1
- package/dist/{agent-evals-D-sPJfXz.mjs → agent-evals-3m5FXStK.mjs} +26 -7
- package/dist/{agent-export-GcTZPLfB.mjs → agent-export-CSdby81L.mjs} +6 -6
- package/dist/agent-skills-bundle.d.mts +1 -1
- package/dist/{agent-skills-server-D34054x5.d.mts → agent-skills-server-CF6iVTBR.d.mts} +2 -2
- package/dist/agent-skills-vite.d.mts +3 -3
- package/dist/{agents-e1SYT64z.mjs → agents-DDt41QR8.mjs} +5 -5
- package/dist/{analytics-aeXwEvQX.d.mts → analytics-CwXxM9oL.d.mts} +1 -1
- package/dist/{authoring-Do87QzBd.mjs → authoring-ct8s0Z_X.mjs} +3 -3
- package/dist/{authoring-mcp-Be7quE5R.mjs → authoring-mcp-Wy-h93DM.mjs} +1 -1
- package/dist/browser.d.mts +2 -2
- package/dist/cli/index.d.mts +2 -1
- package/dist/cli/index.mjs +40 -28
- package/dist/client/react.d.mts +1 -1
- package/dist/{cloud-ask-ai-BqfiQaNZ.d.mts → cloud-ask-ai-C9dvEBpW.d.mts} +1 -1
- package/dist/{content-change-hydration-CoYRs3pC.d.mts → content-change-hydration-CDuohygf.d.mts} +2 -2
- package/dist/docs-cloud-server.d.mts +2 -2
- package/dist/{doctor-CtK1CRPj.mjs → doctor-DESIZy7v.mjs} +126 -30
- package/dist/{golden-evaluations-De4KwoYr.mjs → golden-evaluations-Dc06CZM-.mjs} +4 -1
- package/dist/index.d.mts +6 -6
- package/dist/index.mjs +4 -4
- package/dist/{mcp-DsjWxF7g.mjs → mcp-CC74oNj3.mjs} +5 -5
- package/dist/mcp.d.mts +3 -3
- package/dist/mcp.mjs +16 -2
- package/dist/{openapi-mcp-DQ3xptKo.mjs → openapi-mcp-CFWUsMUr.mjs} +1 -1
- package/dist/{prompt-references-1Wce71c7.mjs → prompt-references-DVhk8W6r.mjs} +2 -2
- package/dist/{retrieval-digest-DyNRD-mt.d.mts → retrieval-digest-VUlhYMUW.d.mts} +10 -3
- package/dist/{review-XI9FXeos.mjs → review-glShh1or.mjs} +4 -4
- package/dist/{robots-CzKesbdX.mjs → robots-D6RgVpll.mjs} +2 -2
- package/dist/{robots-BOjWB1ky.mjs → robots-dNbBnlVh.mjs} +1 -1
- package/dist/{search-DwAoC9X7.mjs → search-BOOiOwTS.mjs} +5 -5
- package/dist/server.d.mts +6 -6
- package/dist/server.mjs +5 -5
- package/dist/{sidebar-CJze8SBi.d.mts → sidebar-Bne72SU-.d.mts} +1 -1
- package/dist/{sitemap-DOaJIKJf.mjs → sitemap-Ck1YKSAJ.mjs} +5 -5
- package/dist/{sitemap-server-NeVu8W38.mjs → sitemap-server-BKNIqgvq.mjs} +1 -1
- package/dist/{skills-BILSESek.mjs → skills-Bucp3wjq.mjs} +5 -5
- package/dist/{standards-discovery-Xm84bS4M.d.mts → standards-discovery-CjyUCxdy.d.mts} +1 -1
- package/dist/{types-QhYMnKvb.d.mts → types-BkAk6B2d.d.mts} +13 -1
- package/package.json +1 -1
package/dist/cli/index.mjs
CHANGED
|
@@ -149,12 +149,13 @@ async function main() {
|
|
|
149
149
|
printCloudHelp();
|
|
150
150
|
process.exit(1);
|
|
151
151
|
} else if (parsedCommand.command === "mcp" && subcommand === "author") {
|
|
152
|
-
const { runAuthoringMcp } = await import("../authoring-
|
|
152
|
+
const { runAuthoringMcp } = await import("../authoring-ct8s0Z_X.mjs");
|
|
153
153
|
await runAuthoringMcp(authoringMcpOptions);
|
|
154
154
|
} else if (parsedCommand.command === "mcp") {
|
|
155
|
-
const { runMcp } = await import("../mcp-
|
|
155
|
+
const { runMcp } = await import("../mcp-CC74oNj3.mjs");
|
|
156
156
|
await runMcp(mcpOptions);
|
|
157
|
-
} else if (parsedCommand.command === "agent" && subcommand === "
|
|
157
|
+
} else if (parsedCommand.command === "agent" && (subcommand === "--help" || subcommand === "-h")) printAgentHelp();
|
|
158
|
+
else if (parsedCommand.command === "agent" && subcommand === "feedback") {
|
|
158
159
|
const { parseAgentFeedbackImproveArgs, printAgentFeedbackImproveHelp, runAgentFeedbackImprove } = await import("../feedback-DWVUMrxy.mjs");
|
|
159
160
|
const feedbackOptions = parseAgentFeedbackImproveArgs(args.slice(2));
|
|
160
161
|
if (feedbackOptions.help) {
|
|
@@ -179,7 +180,7 @@ async function main() {
|
|
|
179
180
|
}
|
|
180
181
|
await runAgentMaintenancePropose(proposeOptions);
|
|
181
182
|
} else if (parsedCommand.command === "agent" && subcommand === "compact") {
|
|
182
|
-
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent
|
|
183
|
+
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent--fSgaVIK.mjs").then((n) => n.t);
|
|
183
184
|
const agentCompactOptions = parseAgentCompactArgs(args.slice(2));
|
|
184
185
|
if (agentCompactOptions.help) {
|
|
185
186
|
printAgentCompactHelp();
|
|
@@ -187,7 +188,7 @@ async function main() {
|
|
|
187
188
|
}
|
|
188
189
|
await compactAgentDocs(agentCompactOptions);
|
|
189
190
|
} else if (parsedCommand.command === "agent" && subcommand === "export") {
|
|
190
|
-
const { exportAgentBundle, parseAgentExportArgs, printAgentExportHelp } = await import("../agent-export-
|
|
191
|
+
const { exportAgentBundle, parseAgentExportArgs, printAgentExportHelp } = await import("../agent-export-CSdby81L.mjs");
|
|
191
192
|
const agentExportOptions = parseAgentExportArgs(args.slice(2));
|
|
192
193
|
if (agentExportOptions.help) {
|
|
193
194
|
printAgentExportHelp();
|
|
@@ -197,19 +198,10 @@ async function main() {
|
|
|
197
198
|
} else if (parsedCommand.command === "agent") {
|
|
198
199
|
console.error(pc.red(`Unknown agent subcommand: ${subcommand ?? "(missing)"}`));
|
|
199
200
|
console.error();
|
|
200
|
-
|
|
201
|
-
const { printAgentExportHelp } = await import("../agent-export-GcTZPLfB.mjs");
|
|
202
|
-
const { printAgentFeedbackImproveHelp } = await import("../feedback-DWVUMrxy.mjs");
|
|
203
|
-
const { printAgentFeedbackEvaluationsHelp } = await import("../feedback-evals-k0sFDdms.mjs");
|
|
204
|
-
const { printAgentMaintenanceProposeHelp } = await import("../propose-DJOiHu9Y.mjs");
|
|
205
|
-
printAgentCompactHelp();
|
|
206
|
-
printAgentExportHelp();
|
|
207
|
-
printAgentFeedbackImproveHelp();
|
|
208
|
-
printAgentFeedbackEvaluationsHelp();
|
|
209
|
-
printAgentMaintenanceProposeHelp();
|
|
201
|
+
printAgentHelp();
|
|
210
202
|
process.exit(1);
|
|
211
203
|
} else if (parsedCommand.command === "agents" && subcommand === "generate") {
|
|
212
|
-
const { generateAgents, parseAgentsGenerateArgs, printAgentsGenerateHelp } = await import("../agents-
|
|
204
|
+
const { generateAgents, parseAgentsGenerateArgs, printAgentsGenerateHelp } = await import("../agents-DDt41QR8.mjs");
|
|
213
205
|
const agentsOptions = parseAgentsGenerateArgs(args.slice(2));
|
|
214
206
|
if (agentsOptions.help) {
|
|
215
207
|
printAgentsGenerateHelp();
|
|
@@ -219,11 +211,11 @@ async function main() {
|
|
|
219
211
|
} else if (parsedCommand.command === "agents") {
|
|
220
212
|
console.error(pc.red(`Unknown agents subcommand: ${subcommand ?? "(missing)"}`));
|
|
221
213
|
console.error();
|
|
222
|
-
const { printAgentsGenerateHelp } = await import("../agents-
|
|
214
|
+
const { printAgentsGenerateHelp } = await import("../agents-DDt41QR8.mjs");
|
|
223
215
|
printAgentsGenerateHelp();
|
|
224
216
|
process.exit(1);
|
|
225
217
|
} else if (parsedCommand.command === "skills" && subcommand === "scaffold") {
|
|
226
|
-
const { parseSkillScaffoldArgs, printSkillScaffoldHelp, scaffoldSkillFromContracts } = await import("../skills-
|
|
218
|
+
const { parseSkillScaffoldArgs, printSkillScaffoldHelp, scaffoldSkillFromContracts } = await import("../skills-Bucp3wjq.mjs");
|
|
227
219
|
const skillOptions = parseSkillScaffoldArgs(args.slice(2));
|
|
228
220
|
if (skillOptions.help) {
|
|
229
221
|
printSkillScaffoldHelp();
|
|
@@ -231,16 +223,16 @@ async function main() {
|
|
|
231
223
|
}
|
|
232
224
|
await scaffoldSkillFromContracts(skillOptions);
|
|
233
225
|
} else if (parsedCommand.command === "skills" && (subcommand === "--help" || subcommand === "-h")) {
|
|
234
|
-
const { printSkillScaffoldHelp } = await import("../skills-
|
|
226
|
+
const { printSkillScaffoldHelp } = await import("../skills-Bucp3wjq.mjs");
|
|
235
227
|
printSkillScaffoldHelp();
|
|
236
228
|
} else if (parsedCommand.command === "skills") {
|
|
237
229
|
console.error(pc.red(`Unknown skills subcommand: ${subcommand ?? "(missing)"}`));
|
|
238
230
|
console.error();
|
|
239
|
-
const { printSkillScaffoldHelp } = await import("../skills-
|
|
231
|
+
const { printSkillScaffoldHelp } = await import("../skills-Bucp3wjq.mjs");
|
|
240
232
|
printSkillScaffoldHelp();
|
|
241
233
|
process.exit(1);
|
|
242
234
|
} else if (parsedCommand.command === "doctor") {
|
|
243
|
-
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-
|
|
235
|
+
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-DESIZy7v.mjs");
|
|
244
236
|
const doctorOptions = parseDoctorArgs(args.slice(1));
|
|
245
237
|
if (doctorOptions.help) {
|
|
246
238
|
printDoctorHelp();
|
|
@@ -248,7 +240,7 @@ async function main() {
|
|
|
248
240
|
}
|
|
249
241
|
await runDoctor(doctorOptions);
|
|
250
242
|
} else if (parsedCommand.command === "review") {
|
|
251
|
-
const { parseReviewArgs, printReviewHelp, runReview } = await import("../review-
|
|
243
|
+
const { parseReviewArgs, printReviewHelp, runReview } = await import("../review-glShh1or.mjs");
|
|
252
244
|
const reviewOptions = parseReviewArgs(args.slice(1));
|
|
253
245
|
if (reviewOptions.help) {
|
|
254
246
|
printReviewHelp();
|
|
@@ -270,7 +262,7 @@ async function main() {
|
|
|
270
262
|
printCodeBlocksValidateHelp();
|
|
271
263
|
process.exit(1);
|
|
272
264
|
} else if (parsedCommand.command === "search" && subcommand === "sync") {
|
|
273
|
-
const { syncSearch } = await import("../search-
|
|
265
|
+
const { syncSearch } = await import("../search-BOOiOwTS.mjs");
|
|
274
266
|
await syncSearch(searchSyncOptions);
|
|
275
267
|
} else if (parsedCommand.command === "search") {
|
|
276
268
|
console.error(pc.red(`Unknown search subcommand: ${subcommand ?? "(missing)"}`));
|
|
@@ -278,7 +270,7 @@ async function main() {
|
|
|
278
270
|
printHelp();
|
|
279
271
|
process.exit(1);
|
|
280
272
|
} else if (parsedCommand.command === "sitemap" && subcommand === "generate") {
|
|
281
|
-
const { generateSitemap, parseSitemapGenerateArgs, printSitemapGenerateHelp } = await import("../sitemap-
|
|
273
|
+
const { generateSitemap, parseSitemapGenerateArgs, printSitemapGenerateHelp } = await import("../sitemap-Ck1YKSAJ.mjs");
|
|
282
274
|
const sitemapOptions = parseSitemapGenerateArgs(args.slice(2));
|
|
283
275
|
if (sitemapOptions.help) {
|
|
284
276
|
printSitemapGenerateHelp();
|
|
@@ -288,11 +280,11 @@ async function main() {
|
|
|
288
280
|
} else if (parsedCommand.command === "sitemap") {
|
|
289
281
|
console.error(pc.red(`Unknown sitemap subcommand: ${subcommand ?? "(missing)"}`));
|
|
290
282
|
console.error();
|
|
291
|
-
const { printSitemapGenerateHelp } = await import("../sitemap-
|
|
283
|
+
const { printSitemapGenerateHelp } = await import("../sitemap-Ck1YKSAJ.mjs");
|
|
292
284
|
printSitemapGenerateHelp();
|
|
293
285
|
process.exit(1);
|
|
294
286
|
} else if (parsedCommand.command === "robots" && subcommand === "generate") {
|
|
295
|
-
const { generateRobots, parseRobotsGenerateArgs, printRobotsGenerateHelp } = await import("../robots-
|
|
287
|
+
const { generateRobots, parseRobotsGenerateArgs, printRobotsGenerateHelp } = await import("../robots-D6RgVpll.mjs");
|
|
296
288
|
const robotsOptions = parseRobotsGenerateArgs(args.slice(2));
|
|
297
289
|
if (robotsOptions.help) {
|
|
298
290
|
printRobotsGenerateHelp();
|
|
@@ -302,7 +294,7 @@ async function main() {
|
|
|
302
294
|
} else if (parsedCommand.command === "robots") {
|
|
303
295
|
console.error(pc.red(`Unknown robots subcommand: ${subcommand ?? "(missing)"}`));
|
|
304
296
|
console.error();
|
|
305
|
-
const { printRobotsGenerateHelp } = await import("../robots-
|
|
297
|
+
const { printRobotsGenerateHelp } = await import("../robots-D6RgVpll.mjs");
|
|
306
298
|
printRobotsGenerateHelp();
|
|
307
299
|
process.exit(1);
|
|
308
300
|
} else if (parsedCommand.command === "downgrade") {
|
|
@@ -334,6 +326,22 @@ async function main() {
|
|
|
334
326
|
process.exit(1);
|
|
335
327
|
}
|
|
336
328
|
}
|
|
329
|
+
function printAgentHelp() {
|
|
330
|
+
console.log(`${pc.bold("docs agent")} — Agent documentation utilities
|
|
331
|
+
|
|
332
|
+
Usage:
|
|
333
|
+
docs agent <command> [options]
|
|
334
|
+
|
|
335
|
+
Commands:
|
|
336
|
+
${pc.cyan("compact")} Generate or refresh page-level ${pc.dim("agent.md")} files
|
|
337
|
+
${pc.cyan("export")} Export or check a static Agent Bundle
|
|
338
|
+
${pc.cyan("feedback")} Cluster recurring agent feedback into improvement drafts
|
|
339
|
+
${pc.cyan("feedback-evals")} Create reviewed evaluation candidates and regression baselines
|
|
340
|
+
${pc.cyan("propose")} Combine recurring signals into maintenance proposals
|
|
341
|
+
|
|
342
|
+
Run ${pc.cyan("docs agent <command> --help")} for command-specific options.
|
|
343
|
+
`);
|
|
344
|
+
}
|
|
337
345
|
function printHelp() {
|
|
338
346
|
console.log(`
|
|
339
347
|
${pc.bold("@farming-labs/docs")} — Documentation framework CLI
|
|
@@ -415,6 +423,8 @@ ${pc.dim("Options for agent compact:")}
|
|
|
415
423
|
${pc.cyan("agent compact --all")} Compact every folder-based docs page
|
|
416
424
|
${pc.cyan("agent compact --changed")} Compact only docs pages changed in the current git working tree
|
|
417
425
|
${pc.cyan("agent compact --stale")} Refresh only stale generated ${pc.dim("agent.md")} files
|
|
426
|
+
${pc.cyan("agent compact --check")} Fail when generated ${pc.dim("agent.md")} files are stale or required files are missing
|
|
427
|
+
${pc.cyan("agent compact --review <page...>")} Record hash-bound human review without rewriting ${pc.dim("agent.md")}
|
|
418
428
|
${pc.cyan("--page <slug|path>")} Repeatable explicit page flag; positional page args work too
|
|
419
429
|
${pc.cyan("--include-missing")} With ${pc.cyan("--stale")}, also create explicit or token-budget pages missing ${pc.dim("agent.md")}
|
|
420
430
|
${pc.cyan("--api-key <key>")} Use an API key directly; prefer ${pc.dim("cloud.apiKey.env")}
|
|
@@ -472,6 +482,8 @@ ${pc.dim("Options for doctor:")}
|
|
|
472
482
|
${pc.cyan("doctor --agent --fix")} Refresh stale generated ${pc.dim("agent.md")} files and token-budget missing outputs
|
|
473
483
|
${pc.cyan("doctor --agent --fix --dry-run")} Report the fix command without writing generated ${pc.dim("agent.md")} files
|
|
474
484
|
${pc.cyan("doctor --fail-on warn|fail")} Choose whether warnings or only failures fail CI
|
|
485
|
+
${pc.cyan("doctor --timeout <ms>")} Set each hosted probe timeout (default: ${pc.dim("15000")})
|
|
486
|
+
${pc.cyan("doctor --retries <0-5>")} Retry safe hosted GET/HEAD probes (default: ${pc.dim("1")})
|
|
475
487
|
${pc.cyan("doctor agent")} Subcommand alias for agent scoring
|
|
476
488
|
${pc.cyan("doctor site")} Subcommand alias for reader-facing scoring
|
|
477
489
|
${pc.cyan("doctor human")} Legacy alias for reader-facing scoring
|
|
@@ -550,4 +562,4 @@ main().catch((err) => {
|
|
|
550
562
|
});
|
|
551
563
|
|
|
552
564
|
//#endregion
|
|
553
|
-
export { formatCliError, parseCommandAlias, parseFlags };
|
|
565
|
+
export { formatCliError, parseCommandAlias, parseFlags, printAgentHelp };
|
package/dist/client/react.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ht as DocsAnalyticsConfig, kt as DocsCloudConfig, t as AIConfig } from "./types-BkAk6B2d.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/cloud-ask-ai.d.ts
|
|
4
4
|
interface DocsCloudAskAIConfig {
|
package/dist/{content-change-hydration-CoYRs3pC.d.mts → content-change-hydration-CDuohygf.d.mts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { O as DocsA2AAgentCardOptions, R as DocsDiscoveryApiRouteOptions, z as DocsPublishedAgentSkill } from "./standards-discovery-
|
|
1
|
+
import { $n as DocsSearchFacetsResponse, Dn as DocsPaginatedSearchResponse, Dr as FeedbackConfig, Dt as DocsAskAIMcpConfig, En as DocsPageAccessPolicy, Fr as McpDocsSearchConfig, J as DocsAgentFeedbackData, Jn as DocsSearchDocument, Jt as DocsContentSnapshot, Kn as DocsSearchChunkingConfig, L as DocsAgentContentChangesConfig, Ln as DocsRobotsConfig, Mr as LlmsTxtMaxCharsConfig, Nr as LlmsTxtMaxCharsMode, Pr as LlmsTxtSectionConfig, Qt as DocsI18nConfig, Vn as DocsSearchAdapterFactory, Vt as DocsConfig, Zr as PageAgentFrontmatter, _n as DocsOkfConfig, ai as ResolvedDocsRelatedLink, dr as DocsSearchRequest, f as CustomDocsSearchConfig, hi as TypesenseDocsSearchConfig, hr as DocsSearchSourcePage, in as DocsMcpConfig, ir as DocsSearchFilters, jr as LlmsTxtConfig, m as DocsAccessPrincipal, nr as DocsSearchFilterField, pr as DocsSearchResult, qn as DocsSearchConfig, qt as DocsContentChangesResponse, r as AlgoliaDocsSearchConfig, rr as DocsSearchFilterInput, vr as DocsSitemapConfig, xn as DocsOkfTrustMetadataInput, zn as DocsSearchAdapter } from "./types-BkAk6B2d.mjs";
|
|
2
|
+
import { O as DocsA2AAgentCardOptions, R as DocsDiscoveryApiRouteOptions, z as DocsPublishedAgentSkill } from "./standards-discovery-CjyUCxdy.mjs";
|
|
3
3
|
import { t as DocsContentAudience } from "./audience-exposure-CkNZNeVX.mjs";
|
|
4
4
|
import { DocsMcpPage, DocsMcpResolvedConfig, DocsMcpResolvedPromptsConfig } from "./mcp.mjs";
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as DocsCloudAskAIResponseOptions, t as DocsCloudAskAIConfig } from "./cloud-ask-ai-
|
|
1
|
+
import { _t as DocsAnalyticsEventInput, gt as DocsAnalyticsEvent, ht as DocsAnalyticsConfig } from "./types-BkAk6B2d.mjs";
|
|
2
|
+
import { n as DocsCloudAskAIResponseOptions, t as DocsCloudAskAIConfig } from "./cloud-ask-ai-C9dvEBpW.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,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as scanDocsPageTargets, i as loadAgentCompactionReviews, n as compactAgentDocs, r as inspectAgentCompactionState } from "./agent--fSgaVIK.mjs";
|
|
2
2
|
import { f as PAGE_AGENT_CONTRACT_FIELDS } from "./markdown-sections-BKy4labo.mjs";
|
|
3
|
-
import { d as httpLinkHeaderHasTargetRelation, f as AGENT_SKILL_ARCHIVE_MAX_UNCOMPRESSED_BYTES, p as readAgentSkillDocumentFromTar } from "./prompt-references-
|
|
4
|
-
import { A as buildDocsAgentDiscoverySpec, At as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, F as buildDocsMcpEndpointCandidates, Gn as getDocsMcpProtectedResourceMetadataRoutes, Jn as isDocsMcpOAuthScopeToken, Lt as resolveDocsSitemapConfig, M as buildDocsConfigMap, Qn as normalizeDocsMcpAuthorizationServerUrls, S as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, T as DOCS_CONFIG_MAP_TOP_LEVEL_KEYS, Un as DEFAULT_MCP_WELL_KNOWN_ROUTE, Vn as DEFAULT_MCP_PUBLIC_ROUTE, c as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, cr as resolveDocsOkfTrustMetadata, 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, mn as resolveAskAISearchRequestConfig, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, sr as resolveDocsOkfConfig, t as DEFAULT_AGENTS_MD_ROUTE, v as DEFAULT_LLMS_TXT_ROUTE, x as DEFAULT_SKILL_MD_ROUTE } from "./agent-
|
|
3
|
+
import { d as httpLinkHeaderHasTargetRelation, f as AGENT_SKILL_ARCHIVE_MAX_UNCOMPRESSED_BYTES, p as readAgentSkillDocumentFromTar } from "./prompt-references-DVhk8W6r.mjs";
|
|
4
|
+
import { A as buildDocsAgentDiscoverySpec, At as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, F as buildDocsMcpEndpointCandidates, Gn as getDocsMcpProtectedResourceMetadataRoutes, Jn as isDocsMcpOAuthScopeToken, Lt as resolveDocsSitemapConfig, M as buildDocsConfigMap, Qn as normalizeDocsMcpAuthorizationServerUrls, S as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, T as DOCS_CONFIG_MAP_TOP_LEVEL_KEYS, Un as DEFAULT_MCP_WELL_KNOWN_ROUTE, Vn as DEFAULT_MCP_PUBLIC_ROUTE, c as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, cr as resolveDocsOkfTrustMetadata, 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, mn as resolveAskAISearchRequestConfig, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, sr as resolveDocsOkfConfig, t as DEFAULT_AGENTS_MD_ROUTE, v as DEFAULT_LLMS_TXT_ROUTE, x as DEFAULT_SKILL_MD_ROUTE } from "./agent-BDrflLmt.mjs";
|
|
5
5
|
import { I as resolveDocsDiscoveryApiRoute, _ as DEFAULT_API_CATALOG_FORMAT, d as DEFAULT_AGENT_SKILLS_ROUTE_PATTERN, f as DEFAULT_AGENT_SKILLS_ROUTE_PREFIX, h as DEFAULT_AGENT_SKILL_FORMAT, l as DEFAULT_AGENT_SKILLS_INDEX_FORMAT, n as API_CATALOG_MEDIA_TYPE, r as API_CATALOG_PROFILE_URI, t as AGENT_SKILLS_DISCOVERY_SCHEMA_URI, u as DEFAULT_AGENT_SKILLS_INDEX_ROUTE, v as DEFAULT_API_CATALOG_ROUTE } from "./standards-discovery-Bpz90VYq.mjs";
|
|
6
6
|
import { isDocsAgentSkillName, validateDocsAgentSkillFrontmatter } from "./agent-skills-spec.mjs";
|
|
7
|
-
import "./openapi-mcp-
|
|
8
|
-
import { a as analyzeDocsRobotsTxt, n as DEFAULT_ROBOTS_TXT_ROUTE, u as resolveDocsRobotsConfig } from "./robots-
|
|
7
|
+
import "./openapi-mcp-CFWUsMUr.mjs";
|
|
8
|
+
import { a as analyzeDocsRobotsTxt, n as DEFAULT_ROBOTS_TXT_ROUTE, u as resolveDocsRobotsConfig } from "./robots-dNbBnlVh.mjs";
|
|
9
9
|
import { a as resolveDocsMetadataBaseUrl } from "./metadata-7htr-Xj_.mjs";
|
|
10
|
-
import "./sitemap-server-
|
|
10
|
+
import "./sitemap-server-BKNIqgvq.mjs";
|
|
11
11
|
import { r as resolveConfiguredAgentSkills } from "./agent-skills-server-Ddbf15pY.mjs";
|
|
12
|
-
import { t as runDocsGoldenTasks } from "./agent-evals-
|
|
12
|
+
import { t as runDocsGoldenTasks } from "./agent-evals-3m5FXStK.mjs";
|
|
13
13
|
import { createFilesystemDocsMcpSource, getDocsConfigSchema, resolveDocsMcpConfig } from "./mcp.mjs";
|
|
14
|
-
import "./authoring-mcp-
|
|
14
|
+
import "./authoring-mcp-Wy-h93DM.mjs";
|
|
15
15
|
import "./code-blocks-D90CCJFs.mjs";
|
|
16
16
|
import "./server.mjs";
|
|
17
17
|
import { _ as resolveDocsContentDir, d as readNavTitle, g as resolveDocsConfigPath, h as readTopLevelStringProperty, l as readBooleanProperty, r as extractTopLevelConfigObject, s as loadDocsConfigModuleResultWithProjectEnv, t as extractNestedObjectLiteral, v as resolveDocsProjectRoot } from "./config-DrZ3fXgf.mjs";
|
|
18
18
|
import { t as detectFramework } from "./utils-Cc1SrVza.mjs";
|
|
19
|
-
import { i as createAgentUsefulnessPagesFromMcp, n as analyzeAgentSurfaceDrift, r as analyzeAgentUsefulness, t as resolveGoldenEvaluationInput } from "./golden-evaluations-
|
|
19
|
+
import { i as createAgentUsefulnessPagesFromMcp, n as analyzeAgentSurfaceDrift, r as analyzeAgentUsefulness, t as resolveGoldenEvaluationInput } from "./golden-evaluations-Dc06CZM-.mjs";
|
|
20
20
|
import { t as analyzeConfiguredAgentSkillsProgressiveDisclosure } from "./agent-skills-progressive-disclosure-DL-q4JZo.mjs";
|
|
21
21
|
import { existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
|
|
22
22
|
import path from "node:path";
|
|
@@ -24,8 +24,12 @@ import { createHash } from "node:crypto";
|
|
|
24
24
|
import { gunzipSync } from "node:zlib";
|
|
25
25
|
import { LATEST_PROTOCOL_VERSION } from "@modelcontextprotocol/server";
|
|
26
26
|
import pc from "picocolors";
|
|
27
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
27
28
|
|
|
28
29
|
//#region src/cli/doctor.ts
|
|
30
|
+
const DEFAULT_HOSTED_TIMEOUT_MS = 15e3;
|
|
31
|
+
const DEFAULT_HOSTED_RETRIES = 1;
|
|
32
|
+
const hostedProbeOptions = new AsyncLocalStorage();
|
|
29
33
|
const NEXT_CONFIG_PATTERN = /^next\.config\.(?:[cm]?js|[cm]?ts)$/;
|
|
30
34
|
const ASTRO_CONFIG_PATTERN = /^astro\.config\.(?:[cm]?js|[cm]?ts)$/;
|
|
31
35
|
const CODE_FILE_PATTERN = /\.(?:[cm]?js|[cm]?ts|jsx|tsx)$/;
|
|
@@ -58,6 +62,12 @@ function parseDoctorFailOn(value) {
|
|
|
58
62
|
if (value === "warn" || value === "fail") return value;
|
|
59
63
|
throw new Error("Invalid value for --fail-on. Expected warn or fail.");
|
|
60
64
|
}
|
|
65
|
+
function parseDoctorInteger(flag, value, bounds) {
|
|
66
|
+
if (!/^\d+$/.test(value)) throw new Error(`Invalid value for ${flag}. Expected an integer.`);
|
|
67
|
+
const parsed = Number(value);
|
|
68
|
+
if (parsed < bounds.min || parsed > bounds.max) throw new Error(`Invalid value for ${flag}. Expected a value between ${bounds.min} and ${bounds.max}.`);
|
|
69
|
+
return parsed;
|
|
70
|
+
}
|
|
61
71
|
function parseDoctorArgs(argv) {
|
|
62
72
|
const parsed = {};
|
|
63
73
|
for (let index = 0; index < argv.length; index += 1) {
|
|
@@ -152,6 +162,44 @@ function parseDoctorArgs(argv) {
|
|
|
152
162
|
index += 1;
|
|
153
163
|
continue;
|
|
154
164
|
}
|
|
165
|
+
if (arg.startsWith("--timeout=")) {
|
|
166
|
+
const value = parseInlineFlag(arg).value;
|
|
167
|
+
if (!value) throw new Error("Missing value for --timeout.");
|
|
168
|
+
parsed.hostedTimeoutMs = parseDoctorInteger("--timeout", value, {
|
|
169
|
+
min: 100,
|
|
170
|
+
max: 12e4
|
|
171
|
+
});
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
if (arg === "--timeout") {
|
|
175
|
+
const value = argv[index + 1];
|
|
176
|
+
if (!value || value.startsWith("--")) throw new Error("Missing value for --timeout.");
|
|
177
|
+
parsed.hostedTimeoutMs = parseDoctorInteger("--timeout", value, {
|
|
178
|
+
min: 100,
|
|
179
|
+
max: 12e4
|
|
180
|
+
});
|
|
181
|
+
index += 1;
|
|
182
|
+
continue;
|
|
183
|
+
}
|
|
184
|
+
if (arg.startsWith("--retries=")) {
|
|
185
|
+
const value = parseInlineFlag(arg).value;
|
|
186
|
+
if (value === void 0 || value === "") throw new Error("Missing value for --retries.");
|
|
187
|
+
parsed.hostedRetries = parseDoctorInteger("--retries", value, {
|
|
188
|
+
min: 0,
|
|
189
|
+
max: 5
|
|
190
|
+
});
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
if (arg === "--retries") {
|
|
194
|
+
const value = argv[index + 1];
|
|
195
|
+
if (!value || value.startsWith("--")) throw new Error("Missing value for --retries.");
|
|
196
|
+
parsed.hostedRetries = parseDoctorInteger("--retries", value, {
|
|
197
|
+
min: 0,
|
|
198
|
+
max: 5
|
|
199
|
+
});
|
|
200
|
+
index += 1;
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
155
203
|
if (arg === "--config") {
|
|
156
204
|
const value = argv[index + 1];
|
|
157
205
|
if (!value || value.startsWith("--")) throw new Error("Missing value for --config.");
|
|
@@ -195,6 +243,8 @@ ${pc.dim("Options:")}
|
|
|
195
243
|
${pc.cyan("--dry-run")} With ${pc.cyan("--fix")}, report the compaction command without writing files
|
|
196
244
|
${pc.cyan("--fail-on <level>")} Exit with failure on ${pc.cyan("warn")} or only on ${pc.cyan("fail")}
|
|
197
245
|
${pc.cyan("--url <url>")} Probe hosted agent surfaces, e.g. ${pc.dim("https://docs.example.com")}
|
|
246
|
+
${pc.cyan("--timeout <ms>")} Set each hosted probe timeout (default: ${pc.dim(String(DEFAULT_HOSTED_TIMEOUT_MS))})
|
|
247
|
+
${pc.cyan("--retries <count>")} Retry safe hosted GET/HEAD probes (default: ${pc.dim(String(DEFAULT_HOSTED_RETRIES))})
|
|
198
248
|
${pc.cyan("--config <path>")} Use a custom docs config path instead of ${pc.dim("docs.config.ts[x]")}
|
|
199
249
|
${pc.cyan("-h, --help")} Show this help message
|
|
200
250
|
`);
|
|
@@ -677,6 +727,9 @@ function buildCoverage(pages) {
|
|
|
677
727
|
explicitCoverage: totalPages === 0 ? 0 : Math.round(explicitPages / Math.max(totalPages, 1) * 100),
|
|
678
728
|
compaction: {
|
|
679
729
|
freshGeneratedPages: 0,
|
|
730
|
+
reviewedGeneratedPages: 0,
|
|
731
|
+
invalidReviewedPages: 0,
|
|
732
|
+
orphanedReviews: 0,
|
|
680
733
|
staleGeneratedPages: 0,
|
|
681
734
|
modifiedGeneratedPages: 0,
|
|
682
735
|
unknownGeneratedPages: 0,
|
|
@@ -704,20 +757,36 @@ function buildCompactionCoverage(rootDir, contentDir, entry, pages, defaults) {
|
|
|
704
757
|
const targetsBySlug = new Map(targets.map((target) => [target.slug, target]));
|
|
705
758
|
const coverage = {
|
|
706
759
|
freshGeneratedPages: 0,
|
|
760
|
+
reviewedGeneratedPages: 0,
|
|
761
|
+
invalidReviewedPages: 0,
|
|
762
|
+
orphanedReviews: 0,
|
|
707
763
|
staleGeneratedPages: 0,
|
|
708
764
|
modifiedGeneratedPages: 0,
|
|
709
765
|
unknownGeneratedPages: 0,
|
|
710
766
|
tokenBudgetMissingPages: 0,
|
|
711
767
|
otherMissingPages: 0
|
|
712
768
|
};
|
|
769
|
+
const reviewRecords = loadAgentCompactionReviews(rootDir, defaults.reviewManifestPath);
|
|
770
|
+
const inspectionDefaults = {
|
|
771
|
+
...defaults,
|
|
772
|
+
reviewRecords
|
|
773
|
+
};
|
|
774
|
+
const targetRoutes = new Set(targets.map((target) => target.url));
|
|
775
|
+
coverage.orphanedReviews = reviewRecords.filter((review) => !targetRoutes.has(review.route)).length;
|
|
713
776
|
for (const page of pages) {
|
|
714
777
|
const target = targetsBySlug.get(page.slug);
|
|
715
778
|
if (!target) continue;
|
|
716
|
-
const state = inspectAgentCompactionState(page, target,
|
|
779
|
+
const state = inspectAgentCompactionState(page, target, inspectionDefaults);
|
|
717
780
|
switch (state.status) {
|
|
718
781
|
case "fresh":
|
|
719
782
|
coverage.freshGeneratedPages += 1;
|
|
720
783
|
break;
|
|
784
|
+
case "reviewed":
|
|
785
|
+
coverage.reviewedGeneratedPages += 1;
|
|
786
|
+
break;
|
|
787
|
+
case "review-invalid":
|
|
788
|
+
coverage.invalidReviewedPages += 1;
|
|
789
|
+
break;
|
|
721
790
|
case "stale":
|
|
722
791
|
coverage.staleGeneratedPages += 1;
|
|
723
792
|
break;
|
|
@@ -737,8 +806,10 @@ function buildCompactionCoverage(rootDir, contentDir, entry, pages, defaults) {
|
|
|
737
806
|
return coverage;
|
|
738
807
|
}
|
|
739
808
|
function compactionFreshnessScore(coverage, compactConfigured) {
|
|
740
|
-
if (coverage.staleGeneratedPages > 0 || coverage.modifiedGeneratedPages > 0 || coverage.tokenBudgetMissingPages > 0) {
|
|
809
|
+
if (coverage.invalidReviewedPages > 0 || coverage.orphanedReviews > 0 || coverage.staleGeneratedPages > 0 || coverage.modifiedGeneratedPages > 0 || coverage.tokenBudgetMissingPages > 0) {
|
|
741
810
|
const recommendations = [];
|
|
811
|
+
if (coverage.invalidReviewedPages > 0) recommendations.push("Inspect every changed source/settings/output hash, then rerun docs agent compact --review with an explicit reviewer and rationale only when the preserved agent.md remains correct.");
|
|
812
|
+
if (coverage.orphanedReviews > 0) recommendations.push("Remove or replace orphaned entries in the agent compaction review manifest.");
|
|
742
813
|
if (coverage.staleGeneratedPages > 0) recommendations.push("Run docs agent compact --stale to refresh stale generated agent.md files.");
|
|
743
814
|
if (coverage.modifiedGeneratedPages > 0) recommendations.push("Review modified generated agent.md files before overwriting them; --stale skips manual edits on purpose.");
|
|
744
815
|
if (coverage.tokenBudgetMissingPages > 0) recommendations.push("Run docs agent compact --stale --include-missing to create generated agent.md files for pages that opted into agent.tokenBudget.");
|
|
@@ -752,7 +823,7 @@ function compactionFreshnessScore(coverage, compactConfigured) {
|
|
|
752
823
|
status: "pass",
|
|
753
824
|
score: compactConfigured ? 5 : 3
|
|
754
825
|
};
|
|
755
|
-
if (coverage.freshGeneratedPages > 0) return {
|
|
826
|
+
if (coverage.freshGeneratedPages > 0 || coverage.reviewedGeneratedPages > 0) return {
|
|
756
827
|
status: "pass",
|
|
757
828
|
score: compactConfigured ? 5 : 4
|
|
758
829
|
};
|
|
@@ -837,16 +908,31 @@ function toMarkdownRoute(pageUrl) {
|
|
|
837
908
|
const normalized = pageUrl === "/" ? "/index" : pageUrl.replace(/\/+$/, "");
|
|
838
909
|
return normalized.endsWith(".md") ? normalized : `${normalized}.md`;
|
|
839
910
|
}
|
|
840
|
-
async function fetchWithTimeout(url, init = {}
|
|
841
|
-
const
|
|
842
|
-
const
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
911
|
+
async function fetchWithTimeout(url, init = {}) {
|
|
912
|
+
const options = hostedProbeOptions.getStore();
|
|
913
|
+
const timeoutMs = options?.timeoutMs ?? DEFAULT_HOSTED_TIMEOUT_MS;
|
|
914
|
+
const retries = options?.retries ?? DEFAULT_HOSTED_RETRIES;
|
|
915
|
+
const method = init.method?.toUpperCase() ?? "GET";
|
|
916
|
+
const retryableMethod = method === "GET" || method === "HEAD";
|
|
917
|
+
for (let attempt = 0;; attempt += 1) {
|
|
918
|
+
const controller = new AbortController();
|
|
919
|
+
const timeout = setTimeout(() => controller.abort(), timeoutMs);
|
|
920
|
+
try {
|
|
921
|
+
const response = await fetch(url, {
|
|
922
|
+
...init,
|
|
923
|
+
signal: controller.signal
|
|
924
|
+
});
|
|
925
|
+
const retryableStatus = response.status === 408 || response.status === 425 || response.status === 429 || response.status >= 500;
|
|
926
|
+
if (retryableMethod && retryableStatus && attempt < retries) {
|
|
927
|
+
await response.body?.cancel().catch(() => void 0);
|
|
928
|
+
continue;
|
|
929
|
+
}
|
|
930
|
+
return response;
|
|
931
|
+
} catch (error) {
|
|
932
|
+
if (!retryableMethod || attempt >= retries) throw error;
|
|
933
|
+
} finally {
|
|
934
|
+
clearTimeout(timeout);
|
|
935
|
+
}
|
|
850
936
|
}
|
|
851
937
|
}
|
|
852
938
|
async function probeTextRoute(baseUrl, route) {
|
|
@@ -1707,6 +1793,9 @@ async function inspectAgentReadiness(options = {}) {
|
|
|
1707
1793
|
explicitCoverage: 0,
|
|
1708
1794
|
compaction: {
|
|
1709
1795
|
freshGeneratedPages: 0,
|
|
1796
|
+
reviewedGeneratedPages: 0,
|
|
1797
|
+
invalidReviewedPages: 0,
|
|
1798
|
+
orphanedReviews: 0,
|
|
1710
1799
|
staleGeneratedPages: 0,
|
|
1711
1800
|
modifiedGeneratedPages: 0,
|
|
1712
1801
|
unknownGeneratedPages: 0,
|
|
@@ -1917,19 +2006,26 @@ async function inspectAgentReadiness(options = {}) {
|
|
|
1917
2006
|
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."));
|
|
1918
2007
|
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.", commandFindings));
|
|
1919
2008
|
checks.push(makeCheck("related-coverage", "Related-page task coverage", relatedCoverageResult.status, relatedCoverageResult.score, 5, `${usefulness.metrics.related.coveredActionablePages}/${usefulness.metrics.actionablePages} actionable pages link to a valid related docs route; ${usefulness.metrics.related.brokenLinks} related links are broken.`, usefulness.metrics.actionablePages > 0 && usefulness.metrics.related.coverage >= 80 && usefulness.metrics.related.brokenLinks === 0 ? void 0 : "Add and validate related routes on actionable pages so agents can expand context without guessing."));
|
|
1920
|
-
checks.push(makeCheck("compact", "Agent compaction freshness", compactionResult.status, compactionResult.score, 5, `${compactionCoverage.freshGeneratedPages} fresh, ${compactionCoverage.staleGeneratedPages} stale, ${compactionCoverage.modifiedGeneratedPages} modified, ${compactionCoverage.unknownGeneratedPages} unknown, ${compactionCoverage.tokenBudgetMissingPages} token-budget missing, and ${compactionCoverage.otherMissingPages} other missing page${compactionCoverage.otherMissingPages === 1 ? "" : "s"} across compactable docs pages.` + (compactConfigured ? " agent.compact defaults are configured." : " No agent.compact defaults were found in docs config."), compactionResult.recommendation));
|
|
2009
|
+
checks.push(makeCheck("compact", "Agent compaction freshness", compactionResult.status, compactionResult.score, 5, `${compactionCoverage.freshGeneratedPages} fresh, ${compactionCoverage.reviewedGeneratedPages} reviewed, ${compactionCoverage.invalidReviewedPages} invalid reviews, ${compactionCoverage.orphanedReviews} orphaned reviews, ${compactionCoverage.staleGeneratedPages} stale, ${compactionCoverage.modifiedGeneratedPages} modified, ${compactionCoverage.unknownGeneratedPages} unknown, ${compactionCoverage.tokenBudgetMissingPages} token-budget missing, and ${compactionCoverage.otherMissingPages} other missing page${compactionCoverage.otherMissingPages === 1 ? "" : "s"} across compactable docs pages.` + (compactConfigured ? " agent.compact defaults are configured." : " No agent.compact defaults were found in docs config."), compactionResult.recommendation));
|
|
1921
2010
|
const averageMetric = (values) => values.length === 0 ? 0 : Math.round(values.reduce((total, value) => total + value, 0) / values.length * 100) / 100;
|
|
1922
2011
|
const evaluationQuality = evaluations.quality;
|
|
1923
2012
|
const proportionalEvaluationScore = evaluationQuality.score === null ? 0 : Math.round(evaluationQuality.score / 100 * 10);
|
|
1924
2013
|
const evaluationScore = evaluationQuality.status === "failed" ? Math.min(9, proportionalEvaluationScore) : proportionalEvaluationScore;
|
|
1925
2014
|
checks.push(makeCheck("golden-tasks", "Golden task quality", evaluationQuality.status === "passed" ? "pass" : evaluationQuality.status === "failed" ? "fail" : "warn", evaluationScore, 10, evaluationQuality.status === "unmeasured" ? "No golden agent tasks are configured; evaluation quality is unmeasured." : `${evaluationQuality.passedTaskCount}/${evaluationQuality.taskCount} golden tasks passed with ${evaluationQuality.score}/100 average quality across configured expectations, ${averageMetric(evaluations.tasks.map((task) => task.retrieval.recallAtK))} retrieval recall, ${averageMetric(evaluations.tasks.map((task) => task.citations.recall))} citation recall, and ${evaluations.tasks.reduce((total, task) => total + task.usage.usedUtf8Bytes, 0)} UTF-8 context bytes used.`, evaluationQuality.status === "passed" ? void 0 : evaluationQuality.status === "unmeasured" ? "Configure agent.evaluations.tasks so doctor and review can measure retrieval, citations, framework/version selection, adversarial safety, executable examples, and token usage." : "Inspect the failed golden task metrics and fix retrieval ranking, citations, applicability metadata, adversarial safety, examples, or context budgets."));
|
|
1926
2015
|
const evaluationCoverage = evaluations.coverage;
|
|
1927
|
-
const formatDimensionCoverage = (label, dimension) =>
|
|
1928
|
-
|
|
2016
|
+
const formatDimensionCoverage = (label, dimension) => {
|
|
2017
|
+
if (dimension.status === "not-applicable") return `${label}: not applicable (${dimension.notApplicableTaskCount} tasks)`;
|
|
2018
|
+
return `${label}: ${dimension.status} (${dimension.measuredTaskCount}/${dimension.applicableTaskCount} applicable tasks${dimension.notApplicableTaskCount > 0 ? `, ${dimension.notApplicableTaskCount} not applicable` : ""})`;
|
|
2019
|
+
};
|
|
2020
|
+
const evaluationCoveragePassed = evaluationCoverage.status === "measured" || evaluationCoverage.status === "not-applicable";
|
|
2021
|
+
checks.push(makeCheck("golden-task-coverage", "Golden evaluation coverage", evaluationCoveragePassed ? "pass" : "warn", Math.round(evaluationCoverage.coveragePercent / 100 * 5), 5, `${evaluationCoverage.status} coverage across optional confidence dimensions (${evaluationCoverage.measuredTaskDimensions}/${evaluationCoverage.applicableTaskDimensions} applicable task-dimensions, ${evaluationCoverage.notApplicableTaskDimensions} not applicable, ${evaluationCoverage.coveragePercent}%): ${formatDimensionCoverage("safety", evaluationCoverage.dimensions.safety)}; ${formatDimensionCoverage("answer quality", evaluationCoverage.dimensions.answerQuality)}; ${formatDimensionCoverage("executable examples", evaluationCoverage.dimensions.executableExamples)}.`, evaluationCoveragePassed ? void 0 : "Add golden-task safety expectations, actual-answer assertions, and execute-level example checks for applicable tasks; explicitly mark example execution not-applicable only when it would not meaningfully validate the task."));
|
|
1929
2022
|
const okfConfig = resolveDocsOkfConfig(config?.agent?.okf);
|
|
1930
2023
|
const staleOkfPages = okfConfig.enabled ? pages.filter((page) => resolveDocsOkfTrustMetadata(page, okfConfig).stale) : [];
|
|
1931
2024
|
checks.push(makeCheck("okf-trust", "OKF trust metadata", staleOkfPages.length > 0 ? "warn" : "pass", staleOkfPages.length > 0 ? 1 : 2, 2, !okfConfig.enabled ? "OKF export is optional and not configured." : staleOkfPages.length === 0 ? `OKF v0.2 trust metadata is enabled at ${okfConfig.route}; ${pages.length} page${pages.length === 1 ? "" : "s"} passed the configured staleness policy.` : `${staleOkfPages.length}/${pages.length} OKF document${staleOkfPages.length === 1 ? " is" : "s are"} beyond stale_after.`, staleOkfPages.length > 0 ? "Review or regenerate stale pages, then update okf.verified or stale_after with an auditable timestamp." : void 0));
|
|
1932
|
-
const hosted = options.url ? await
|
|
2025
|
+
const hosted = options.url ? await hostedProbeOptions.run({
|
|
2026
|
+
timeoutMs: options.hostedTimeoutMs ?? DEFAULT_HOSTED_TIMEOUT_MS,
|
|
2027
|
+
retries: options.hostedRetries ?? DEFAULT_HOSTED_RETRIES
|
|
2028
|
+
}, () => buildHostedAgentChecks(options.url, pages)) : void 0;
|
|
1933
2029
|
if (hosted) checks.push(...hosted.checks);
|
|
1934
2030
|
const { score, maxScore } = normalizedDoctorScore(checks.reduce((total, check) => total + check.score, 0), checks.reduce((total, check) => total + check.maxScore, 0));
|
|
1935
2031
|
return {
|
|
@@ -2048,9 +2144,9 @@ function printAgentDoctorReport(report) {
|
|
|
2048
2144
|
const evaluationQuality = report.evaluations.quality;
|
|
2049
2145
|
console.log(`${pc.bold("Golden task quality:")} ${evaluationQuality.status === "unmeasured" ? "unmeasured" : `${evaluationQuality.passedTaskCount}/${evaluationQuality.taskCount} passed (${evaluationQuality.score}/100)`}`);
|
|
2050
2146
|
const evaluationCoverage = report.evaluations.coverage;
|
|
2051
|
-
console.log(`${pc.bold("Evaluation coverage:")} ${evaluationCoverage.status} ${pc.dim(`(${evaluationCoverage.measuredTaskDimensions}/${evaluationCoverage.
|
|
2147
|
+
console.log(`${pc.bold("Evaluation coverage:")} ${evaluationCoverage.status} ${pc.dim(`(${evaluationCoverage.measuredTaskDimensions}/${evaluationCoverage.applicableTaskDimensions} applicable task-dimensions, ${evaluationCoverage.notApplicableTaskDimensions} not applicable, ${evaluationCoverage.coveragePercent}%)`)} ${pc.dim("•")} safety ${evaluationCoverage.dimensions.safety.status} ${pc.dim("•")} answer quality ${evaluationCoverage.dimensions.answerQuality.status} ${pc.dim("•")} executable examples ${evaluationCoverage.dimensions.executableExamples.status}`);
|
|
2052
2148
|
}
|
|
2053
|
-
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`);
|
|
2149
|
+
console.log(`${pc.bold("Generated agent.md freshness:")} ${report.coverage.compaction.freshGeneratedPages} fresh ${pc.dim("•")} ${report.coverage.compaction.reviewedGeneratedPages} reviewed ${pc.dim("•")} ${report.coverage.compaction.invalidReviewedPages} invalid reviews ${pc.dim("•")} ${report.coverage.compaction.staleGeneratedPages} stale ${pc.dim("•")} ${report.coverage.compaction.modifiedGeneratedPages} modified ${pc.dim("•")} ${report.coverage.compaction.tokenBudgetMissingPages} token-budget missing`);
|
|
2054
2150
|
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(" • "))}`);
|
|
2055
2151
|
console.log();
|
|
2056
2152
|
for (const check of report.checks) {
|
|
@@ -2137,11 +2233,11 @@ async function runAgentDoctorFixes(report, options) {
|
|
|
2137
2233
|
const fixes = [];
|
|
2138
2234
|
const compaction = report.coverage.compaction;
|
|
2139
2235
|
if (!(compaction.staleGeneratedPages > 0 || compaction.tokenBudgetMissingPages > 0)) {
|
|
2140
|
-
if (compaction.modifiedGeneratedPages > 0 || compaction.unknownGeneratedPages > 0) fixes.push({
|
|
2236
|
+
if (compaction.invalidReviewedPages > 0 || compaction.orphanedReviews > 0 || compaction.modifiedGeneratedPages > 0 || compaction.unknownGeneratedPages > 0) fixes.push({
|
|
2141
2237
|
id: "agent-compact",
|
|
2142
2238
|
title: "agent compact",
|
|
2143
2239
|
status: "skipped",
|
|
2144
|
-
detail: "Only
|
|
2240
|
+
detail: "Only invalid/orphaned reviews or modified/unknown agent.md files need attention; doctor --fix leaves those for manual review."
|
|
2145
2241
|
});
|
|
2146
2242
|
return fixes;
|
|
2147
2243
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as hasStructuredPageAgentContract, v as normalizePageAgentFrontmatter } from "./markdown-sections-BKy4labo.mjs";
|
|
2
|
-
import { An as normalizeAgentFramework, En as resolveDocsAudienceMdxContent, Nn as normalizeAgentVersion, kn as agentVersionConstraintsOverlap, wn as findDocsAudienceMdxTags } from "./agent-
|
|
2
|
+
import { An as normalizeAgentFramework, En as resolveDocsAudienceMdxContent, Nn as normalizeAgentVersion, kn as agentVersionConstraintsOverlap, wn as findDocsAudienceMdxTags } from "./agent-BDrflLmt.mjs";
|
|
3
3
|
import { t as extractCodeBlocksFromMarkdown } from "./code-blocks-D90CCJFs.mjs";
|
|
4
4
|
import { isMap, isScalar, isSeq, parseDocument } from "yaml";
|
|
5
5
|
import { existsSync, lstatSync, readFileSync, readdirSync } from "node:fs";
|
|
@@ -43,6 +43,9 @@ const DEFAULT_DOCS_COMMANDS = [
|
|
|
43
43
|
"skills scaffold",
|
|
44
44
|
"agent compact",
|
|
45
45
|
"agent export",
|
|
46
|
+
"agent feedback",
|
|
47
|
+
"agent feedback-evals",
|
|
48
|
+
"agent propose",
|
|
46
49
|
"agents generate",
|
|
47
50
|
"doctor",
|
|
48
51
|
"review",
|