@farming-labs/docs 0.2.60 → 0.2.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{agent-DlxriaTs.mjs → agent-DFHlw_JC.mjs} +3 -3
- package/dist/{agent-BFqyqEnC.mjs → agent-Fl0pjVNF.mjs} +136 -331
- package/dist/{agent-evals-kJs2Y9xR.mjs → agent-evals-f4_OL10T.mjs} +3 -3
- package/dist/{agent-export-BgUaiW8f.mjs → agent-export-D0zQhasD.mjs} +87 -46
- package/dist/agent-skills-bundle.d.mts +13 -0
- package/dist/agent-skills-bundle.mjs +12 -0
- package/dist/agent-skills-server-CIeBszxp.mjs +263 -0
- package/dist/agent-skills-server-CKq3_jMj.d.mts +12 -0
- package/dist/agent-skills-vite.d.mts +31 -0
- package/dist/agent-skills-vite.mjs +70 -0
- package/dist/{agents-Djh-HXih.mjs → agents-ibnXrWyp.mjs} +9 -7
- package/dist/cli/index.mjs +29 -29
- package/dist/client/react.d.mts +1 -1
- package/dist/{cloud-ask-ai-B2WnG4fF.d.mts → cloud-ask-ai-D7ZgF47y.d.mts} +1 -1
- package/dist/{cloud-BH_sHX64.mjs → cloud-pdNC-tyj.mjs} +3 -3
- package/dist/{codeblocks-Bq67u32v.mjs → codeblocks-CFuurVIH.mjs} +2 -2
- package/dist/{config-DASewQ0x.mjs → config-Wcdj-D0a.mjs} +7 -1
- package/dist/{dev-DgY5xGl9.mjs → dev-Cmy6DtdF.mjs} +2 -2
- package/dist/docs-cloud-server.d.mts +2 -2
- package/dist/docs-cloud-server.mjs +1 -1
- package/dist/{doctor-CO1VMcF_.mjs → doctor-CXostbsI.mjs} +151 -21
- package/dist/{downgrade-BZs86NVr.mjs → downgrade-w7e6Se0L.mjs} +2 -2
- package/dist/{golden-evaluations-BN9u2wxw.mjs → golden-evaluations-CBZ_JZjf.mjs} +19 -4
- package/dist/index.d.mts +52 -10
- package/dist/index.mjs +8 -7
- package/dist/{init-Bd_k06bR.mjs → init-CQY0Woe3.mjs} +36 -5
- package/dist/{mcp-B_yXL5G5.mjs → mcp-DyPcoLwm.mjs} +33 -14
- package/dist/mcp.d.mts +13 -2
- package/dist/mcp.mjs +699 -408
- package/dist/{metadata-BDuewuzq.mjs → metadata-Dv1ah0Aj.mjs} +1 -1
- package/dist/{package-version-qik_4J6C.mjs → package-version-n5AFur8a.mjs} +1 -1
- package/dist/{reading-time-BkEft6SD.mjs → reading-time-C-SAhQT9.mjs} +10 -9
- package/dist/{review-NC-sOdXn.mjs → review-D2UBrxFq.mjs} +18 -10
- package/dist/{robots-DskPvGPw.mjs → robots-5Yqz9mz7.mjs} +5 -4
- package/dist/{robots-ltltiLJF.mjs → robots-C08kDLsz.mjs} +6 -2
- package/dist/{search-D57JXQLj.mjs → search-9OnMGMvt.mjs} +1 -1
- package/dist/{search-C1JitPwi.d.mts → search-C6heDO8h.d.mts} +3 -126
- package/dist/{search-o4Ud6OXv.mjs → search-CNsRpz90.mjs} +8 -6
- package/dist/server.d.mts +6 -5
- package/dist/server.mjs +9 -7
- package/dist/{sitemap-Cq-Yj_iA.mjs → sitemap-BpYnSsfJ.mjs} +9 -7
- package/dist/{sitemap-server-C1ibVKOy.mjs → sitemap-server-D_0Kzanj.mjs} +1 -1
- package/dist/standards-discovery-C4HUqMd2.d.mts +227 -0
- package/dist/standards-discovery-C54V_aJH.mjs +510 -0
- package/dist/{templates-DNw15P-x.mjs → templates-Bq_P7ctv.mjs} +101 -9
- package/dist/{types-XHABMh_f.d.mts → types-EhFhYGfr.d.mts} +58 -1
- package/dist/{upgrade-BCJTCW3O.mjs → upgrade-oz-GChgt.mjs} +2 -2
- package/package.json +11 -1
- /package/dist/{agent-scope-CCaIY1aK.mjs → agent-scope-C_U--OZ7.mjs} +0 -0
- /package/dist/{cloud-ask-ai-hnJfj8-X.mjs → cloud-ask-ai-sbpjOR2K.mjs} +0 -0
- /package/dist/{code-blocks-qe0T8-xe.mjs → code-blocks-DnNVNK2M.mjs} +0 -0
- /package/dist/{errors-CVqZ3kOO.mjs → errors-DbOhkE1h.mjs} +0 -0
- /package/dist/{i18n-CAlj1ADU.mjs → i18n-CCaFUnAN.mjs} +0 -0
- /package/dist/{utils-6UCLxv4B.mjs → utils-DpiIioYb.mjs} +0 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import "./standards-discovery-C54V_aJH.mjs";
|
|
2
|
+
import { t as resolveConfiguredAgentSkills } from "./agent-skills-server-CIeBszxp.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/agent-skills-vite.ts
|
|
5
|
+
const DOCS_AGENT_SKILLS_BUNDLE_MODULE = "@farming-labs/docs/agent-skills-bundle";
|
|
6
|
+
const RESOLVED_BUNDLE_MODULE = "\0farming-labs:agent-skills-bundle";
|
|
7
|
+
function isBundleModuleId(id) {
|
|
8
|
+
if (id === RESOLVED_BUNDLE_MODULE) return true;
|
|
9
|
+
const cleanId = id.split("?", 1)[0].replaceAll("\\", "/");
|
|
10
|
+
return /(?:^|\/)agent-skills-bundle\.(?:[cm]?js|ts)$/.test(cleanId);
|
|
11
|
+
}
|
|
12
|
+
function serializeContent(content) {
|
|
13
|
+
return typeof content === "string" ? { text: content } : { base64: Buffer.from(content).toString("base64") };
|
|
14
|
+
}
|
|
15
|
+
function serializeSkill(skill) {
|
|
16
|
+
return {
|
|
17
|
+
...skill,
|
|
18
|
+
content: serializeContent(skill.content),
|
|
19
|
+
files: skill.files.map((file) => ({
|
|
20
|
+
...file,
|
|
21
|
+
content: serializeContent(file.content)
|
|
22
|
+
}))
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/** Render a self-contained virtual module without relying on Node at runtime. */
|
|
26
|
+
function renderDocsAgentSkillsBundle(skills) {
|
|
27
|
+
return `const snapshot = ${JSON.stringify(skills.map(serializeSkill)).replaceAll("\u2028", "\\u2028").replaceAll("\u2029", "\\u2029")};
|
|
28
|
+
function decodeBase64(value) {
|
|
29
|
+
const binary = globalThis.atob(value);
|
|
30
|
+
const bytes = new Uint8Array(binary.length);
|
|
31
|
+
for (let index = 0; index < binary.length; index += 1) bytes[index] = binary.charCodeAt(index);
|
|
32
|
+
return bytes;
|
|
33
|
+
}
|
|
34
|
+
function hydrateContent(content) {
|
|
35
|
+
return typeof content.text === "string" ? content.text : decodeBase64(content.base64);
|
|
36
|
+
}
|
|
37
|
+
export const bundledAgentSkills = snapshot.map((skill) => ({
|
|
38
|
+
...skill,
|
|
39
|
+
content: hydrateContent(skill.content),
|
|
40
|
+
files: skill.files.map((file) => ({ ...file, content: hydrateContent(file.content) })),
|
|
41
|
+
}));
|
|
42
|
+
`;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Snapshot configured Agent Skills into the server bundle.
|
|
46
|
+
*
|
|
47
|
+
* The same plugin object works in Vite, Astro/Svelte/TanStack, and Nitro's
|
|
48
|
+
* Rollup build. Paths remain relative to the project root unless overridden.
|
|
49
|
+
*/
|
|
50
|
+
function docsAgentSkills(config, options = {}) {
|
|
51
|
+
let source;
|
|
52
|
+
return {
|
|
53
|
+
name: "farming-labs-agent-skills",
|
|
54
|
+
enforce: "pre",
|
|
55
|
+
resolveId(id) {
|
|
56
|
+
return id === DOCS_AGENT_SKILLS_BUNDLE_MODULE ? RESOLVED_BUNDLE_MODULE : void 0;
|
|
57
|
+
},
|
|
58
|
+
async load(id) {
|
|
59
|
+
if (!isBundleModuleId(id)) return void 0;
|
|
60
|
+
source ??= resolveConfiguredAgentSkills(config.agent?.skills, {
|
|
61
|
+
rootDir: options.rootDir ?? config.rootDir ?? process.cwd(),
|
|
62
|
+
workspaceRoot: options.workspaceRoot
|
|
63
|
+
}).then(renderDocsAgentSkillsBundle);
|
|
64
|
+
return source;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
//#endregion
|
|
70
|
+
export { DOCS_AGENT_SKILLS_BUNDLE_MODULE, docsAgentSkills, renderDocsAgentSkillsBundle };
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
import
|
|
4
|
-
import "./
|
|
1
|
+
import { $ as renderDocsAgentsDocument, a as DEFAULT_AGENT_MD_ROUTE, at as resolveDocsAgentFeedbackConfig, b as DEFAULT_OPENAPI_SCHEMA_ROUTE, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, o as DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE, t as DEFAULT_AGENTS_MD_ROUTE } from "./agent-Fl0pjVNF.mjs";
|
|
2
|
+
import "./standards-discovery-C54V_aJH.mjs";
|
|
3
|
+
import "./search-9OnMGMvt.mjs";
|
|
4
|
+
import { S as resolveApiReferenceConfig } from "./sitemap-server-D_0Kzanj.mjs";
|
|
5
|
+
import "./agent-evals-f4_OL10T.mjs";
|
|
5
6
|
import { resolveDocsMcpConfig } from "./mcp.mjs";
|
|
6
|
-
import "./code-blocks-
|
|
7
|
+
import "./code-blocks-DnNVNK2M.mjs";
|
|
8
|
+
import "./agent-skills-server-CIeBszxp.mjs";
|
|
7
9
|
import "./server.mjs";
|
|
8
|
-
import {
|
|
9
|
-
import { t as detectFramework } from "./utils-
|
|
10
|
+
import { a as loadDocsConfigModule, d as readNavTitle, g as resolveDocsConfigPath, h as readTopLevelStringProperty, l as readBooleanProperty, p as readStringProperty, t as extractNestedObjectLiteral } from "./config-Wcdj-D0a.mjs";
|
|
11
|
+
import { t as detectFramework } from "./utils-DpiIioYb.mjs";
|
|
10
12
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
11
13
|
import path from "node:path";
|
|
12
14
|
import pc from "picocolors";
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { i as wasCliErrorReported, r as shouldPrintStackTrace, t as formatCliError } from "../errors-
|
|
2
|
+
import { i as wasCliErrorReported, r as shouldPrintStackTrace, t as formatCliError } from "../errors-DbOhkE1h.mjs";
|
|
3
3
|
import pc from "picocolors";
|
|
4
4
|
|
|
5
5
|
//#region src/cli/index.ts
|
|
@@ -106,43 +106,43 @@ async function main() {
|
|
|
106
106
|
]
|
|
107
107
|
};
|
|
108
108
|
if (!parsedCommand.command || parsedCommand.command === "init") {
|
|
109
|
-
const { init } = await import("../init-
|
|
109
|
+
const { init } = await import("../init-CQY0Woe3.mjs");
|
|
110
110
|
await init(initOptions);
|
|
111
111
|
} else if (parsedCommand.command === "dev") {
|
|
112
|
-
const { dev } = await import("../dev-
|
|
112
|
+
const { dev } = await import("../dev-Cmy6DtdF.mjs");
|
|
113
113
|
await dev(devOptions);
|
|
114
114
|
} else if (parsedCommand.command === "deploy") {
|
|
115
|
-
const { runCloudDeploy } = await import("../cloud-
|
|
115
|
+
const { runCloudDeploy } = await import("../cloud-pdNC-tyj.mjs");
|
|
116
116
|
await runCloudDeploy(cloudOptions);
|
|
117
117
|
} else if (parsedCommand.command === "preview") {
|
|
118
|
-
const { runCloudPreview } = await import("../cloud-
|
|
118
|
+
const { runCloudPreview } = await import("../cloud-pdNC-tyj.mjs");
|
|
119
119
|
await runCloudPreview(cloudOptions);
|
|
120
120
|
} else if (parsedCommand.command === "cloud" && subcommand === "deploy") {
|
|
121
|
-
const { runCloudDeploy } = await import("../cloud-
|
|
121
|
+
const { runCloudDeploy } = await import("../cloud-pdNC-tyj.mjs");
|
|
122
122
|
await runCloudDeploy(cloudOptions);
|
|
123
123
|
} else if (parsedCommand.command === "cloud" && subcommand === "preview") {
|
|
124
|
-
const { runCloudPreview } = await import("../cloud-
|
|
124
|
+
const { runCloudPreview } = await import("../cloud-pdNC-tyj.mjs");
|
|
125
125
|
await runCloudPreview(cloudOptions);
|
|
126
126
|
} else if (parsedCommand.command === "cloud" && subcommand === "init") {
|
|
127
|
-
const { runCloudInit } = await import("../cloud-
|
|
127
|
+
const { runCloudInit } = await import("../cloud-pdNC-tyj.mjs");
|
|
128
128
|
await runCloudInit(cloudOptions);
|
|
129
129
|
} else if (parsedCommand.command === "cloud" && subcommand === "sync") {
|
|
130
|
-
const { syncCloudConfig } = await import("../cloud-
|
|
130
|
+
const { syncCloudConfig } = await import("../cloud-pdNC-tyj.mjs");
|
|
131
131
|
await syncCloudConfig(cloudOptions);
|
|
132
132
|
} else if (parsedCommand.command === "cloud" && subcommand === "check") {
|
|
133
|
-
const { runCloudCheck } = await import("../cloud-
|
|
133
|
+
const { runCloudCheck } = await import("../cloud-pdNC-tyj.mjs");
|
|
134
134
|
await runCloudCheck(cloudOptions);
|
|
135
135
|
} else if (parsedCommand.command === "cloud") {
|
|
136
136
|
console.error(pc.red(`Unknown cloud subcommand: ${subcommand ?? "(missing)"}`));
|
|
137
137
|
console.error();
|
|
138
|
-
const { printCloudHelp } = await import("../cloud-
|
|
138
|
+
const { printCloudHelp } = await import("../cloud-pdNC-tyj.mjs");
|
|
139
139
|
printCloudHelp();
|
|
140
140
|
process.exit(1);
|
|
141
141
|
} else if (parsedCommand.command === "mcp") {
|
|
142
|
-
const { runMcp } = await import("../mcp-
|
|
142
|
+
const { runMcp } = await import("../mcp-DyPcoLwm.mjs");
|
|
143
143
|
await runMcp(mcpOptions);
|
|
144
144
|
} else if (parsedCommand.command === "agent" && subcommand === "compact") {
|
|
145
|
-
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent-
|
|
145
|
+
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent-DFHlw_JC.mjs").then((n) => n.t);
|
|
146
146
|
const agentCompactOptions = parseAgentCompactArgs(args.slice(2));
|
|
147
147
|
if (agentCompactOptions.help) {
|
|
148
148
|
printAgentCompactHelp();
|
|
@@ -150,7 +150,7 @@ async function main() {
|
|
|
150
150
|
}
|
|
151
151
|
await compactAgentDocs(agentCompactOptions);
|
|
152
152
|
} else if (parsedCommand.command === "agent" && subcommand === "export") {
|
|
153
|
-
const { exportAgentBundle, parseAgentExportArgs, printAgentExportHelp } = await import("../agent-export-
|
|
153
|
+
const { exportAgentBundle, parseAgentExportArgs, printAgentExportHelp } = await import("../agent-export-D0zQhasD.mjs");
|
|
154
154
|
const agentExportOptions = parseAgentExportArgs(args.slice(2));
|
|
155
155
|
if (agentExportOptions.help) {
|
|
156
156
|
printAgentExportHelp();
|
|
@@ -160,13 +160,13 @@ async function main() {
|
|
|
160
160
|
} else if (parsedCommand.command === "agent") {
|
|
161
161
|
console.error(pc.red(`Unknown agent subcommand: ${subcommand ?? "(missing)"}`));
|
|
162
162
|
console.error();
|
|
163
|
-
const { printAgentCompactHelp } = await import("../agent-
|
|
164
|
-
const { printAgentExportHelp } = await import("../agent-export-
|
|
163
|
+
const { printAgentCompactHelp } = await import("../agent-DFHlw_JC.mjs").then((n) => n.t);
|
|
164
|
+
const { printAgentExportHelp } = await import("../agent-export-D0zQhasD.mjs");
|
|
165
165
|
printAgentCompactHelp();
|
|
166
166
|
printAgentExportHelp();
|
|
167
167
|
process.exit(1);
|
|
168
168
|
} else if (parsedCommand.command === "agents" && subcommand === "generate") {
|
|
169
|
-
const { generateAgents, parseAgentsGenerateArgs, printAgentsGenerateHelp } = await import("../agents-
|
|
169
|
+
const { generateAgents, parseAgentsGenerateArgs, printAgentsGenerateHelp } = await import("../agents-ibnXrWyp.mjs");
|
|
170
170
|
const agentsOptions = parseAgentsGenerateArgs(args.slice(2));
|
|
171
171
|
if (agentsOptions.help) {
|
|
172
172
|
printAgentsGenerateHelp();
|
|
@@ -176,11 +176,11 @@ async function main() {
|
|
|
176
176
|
} else if (parsedCommand.command === "agents") {
|
|
177
177
|
console.error(pc.red(`Unknown agents subcommand: ${subcommand ?? "(missing)"}`));
|
|
178
178
|
console.error();
|
|
179
|
-
const { printAgentsGenerateHelp } = await import("../agents-
|
|
179
|
+
const { printAgentsGenerateHelp } = await import("../agents-ibnXrWyp.mjs");
|
|
180
180
|
printAgentsGenerateHelp();
|
|
181
181
|
process.exit(1);
|
|
182
182
|
} else if (parsedCommand.command === "doctor") {
|
|
183
|
-
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-
|
|
183
|
+
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-CXostbsI.mjs");
|
|
184
184
|
const doctorOptions = parseDoctorArgs(args.slice(1));
|
|
185
185
|
if (doctorOptions.help) {
|
|
186
186
|
printDoctorHelp();
|
|
@@ -188,7 +188,7 @@ async function main() {
|
|
|
188
188
|
}
|
|
189
189
|
await runDoctor(doctorOptions);
|
|
190
190
|
} else if (parsedCommand.command === "review") {
|
|
191
|
-
const { parseReviewArgs, printReviewHelp, runReview } = await import("../review-
|
|
191
|
+
const { parseReviewArgs, printReviewHelp, runReview } = await import("../review-D2UBrxFq.mjs");
|
|
192
192
|
const reviewOptions = parseReviewArgs(args.slice(1));
|
|
193
193
|
if (reviewOptions.help) {
|
|
194
194
|
printReviewHelp();
|
|
@@ -196,7 +196,7 @@ async function main() {
|
|
|
196
196
|
}
|
|
197
197
|
await runReview(reviewOptions);
|
|
198
198
|
} else if ((parsedCommand.command === "codeblocks" || parsedCommand.command === "code-blocks") && subcommand === "validate") {
|
|
199
|
-
const { parseCodeBlocksValidateArgs, printCodeBlocksValidateHelp, runCodeBlocksValidate } = await import("../codeblocks-
|
|
199
|
+
const { parseCodeBlocksValidateArgs, printCodeBlocksValidateHelp, runCodeBlocksValidate } = await import("../codeblocks-CFuurVIH.mjs");
|
|
200
200
|
const codeBlocksOptions = parseCodeBlocksValidateArgs(args.slice(2));
|
|
201
201
|
if (codeBlocksOptions.help) {
|
|
202
202
|
printCodeBlocksValidateHelp();
|
|
@@ -206,11 +206,11 @@ async function main() {
|
|
|
206
206
|
} else if (parsedCommand.command === "codeblocks" || parsedCommand.command === "code-blocks") {
|
|
207
207
|
console.error(pc.red(`Unknown codeblocks subcommand: ${subcommand ?? "(missing)"}`));
|
|
208
208
|
console.error();
|
|
209
|
-
const { printCodeBlocksValidateHelp } = await import("../codeblocks-
|
|
209
|
+
const { printCodeBlocksValidateHelp } = await import("../codeblocks-CFuurVIH.mjs");
|
|
210
210
|
printCodeBlocksValidateHelp();
|
|
211
211
|
process.exit(1);
|
|
212
212
|
} else if (parsedCommand.command === "search" && subcommand === "sync") {
|
|
213
|
-
const { syncSearch } = await import("../search-
|
|
213
|
+
const { syncSearch } = await import("../search-CNsRpz90.mjs");
|
|
214
214
|
await syncSearch(searchSyncOptions);
|
|
215
215
|
} else if (parsedCommand.command === "search") {
|
|
216
216
|
console.error(pc.red(`Unknown search subcommand: ${subcommand ?? "(missing)"}`));
|
|
@@ -218,7 +218,7 @@ async function main() {
|
|
|
218
218
|
printHelp();
|
|
219
219
|
process.exit(1);
|
|
220
220
|
} else if (parsedCommand.command === "sitemap" && subcommand === "generate") {
|
|
221
|
-
const { generateSitemap, parseSitemapGenerateArgs, printSitemapGenerateHelp } = await import("../sitemap-
|
|
221
|
+
const { generateSitemap, parseSitemapGenerateArgs, printSitemapGenerateHelp } = await import("../sitemap-BpYnSsfJ.mjs");
|
|
222
222
|
const sitemapOptions = parseSitemapGenerateArgs(args.slice(2));
|
|
223
223
|
if (sitemapOptions.help) {
|
|
224
224
|
printSitemapGenerateHelp();
|
|
@@ -228,11 +228,11 @@ async function main() {
|
|
|
228
228
|
} else if (parsedCommand.command === "sitemap") {
|
|
229
229
|
console.error(pc.red(`Unknown sitemap subcommand: ${subcommand ?? "(missing)"}`));
|
|
230
230
|
console.error();
|
|
231
|
-
const { printSitemapGenerateHelp } = await import("../sitemap-
|
|
231
|
+
const { printSitemapGenerateHelp } = await import("../sitemap-BpYnSsfJ.mjs");
|
|
232
232
|
printSitemapGenerateHelp();
|
|
233
233
|
process.exit(1);
|
|
234
234
|
} else if (parsedCommand.command === "robots" && subcommand === "generate") {
|
|
235
|
-
const { generateRobots, parseRobotsGenerateArgs, printRobotsGenerateHelp } = await import("../robots-
|
|
235
|
+
const { generateRobots, parseRobotsGenerateArgs, printRobotsGenerateHelp } = await import("../robots-5Yqz9mz7.mjs");
|
|
236
236
|
const robotsOptions = parseRobotsGenerateArgs(args.slice(2));
|
|
237
237
|
if (robotsOptions.help) {
|
|
238
238
|
printRobotsGenerateHelp();
|
|
@@ -242,11 +242,11 @@ async function main() {
|
|
|
242
242
|
} else if (parsedCommand.command === "robots") {
|
|
243
243
|
console.error(pc.red(`Unknown robots subcommand: ${subcommand ?? "(missing)"}`));
|
|
244
244
|
console.error();
|
|
245
|
-
const { printRobotsGenerateHelp } = await import("../robots-
|
|
245
|
+
const { printRobotsGenerateHelp } = await import("../robots-5Yqz9mz7.mjs");
|
|
246
246
|
printRobotsGenerateHelp();
|
|
247
247
|
process.exit(1);
|
|
248
248
|
} else if (parsedCommand.command === "downgrade") {
|
|
249
|
-
const { downgrade } = await import("../downgrade-
|
|
249
|
+
const { downgrade } = await import("../downgrade-w7e6Se0L.mjs");
|
|
250
250
|
const framework = (typeof flags.framework === "string" ? flags.framework : void 0) ?? (args[1] && !args[1].startsWith("--") ? args[1] : void 0);
|
|
251
251
|
const hasVersionFlag = args.includes("--version") || args.some((arg) => arg.startsWith("--version="));
|
|
252
252
|
await downgrade({
|
|
@@ -255,7 +255,7 @@ async function main() {
|
|
|
255
255
|
dryRun: flags["dry-run"] === true
|
|
256
256
|
});
|
|
257
257
|
} else if (parsedCommand.command === "upgrade") {
|
|
258
|
-
const { upgrade } = await import("../upgrade-
|
|
258
|
+
const { upgrade } = await import("../upgrade-oz-GChgt.mjs");
|
|
259
259
|
const framework = (typeof flags.framework === "string" ? flags.framework : void 0) ?? (args[1] && !args[1].startsWith("--") ? args[1] : void 0);
|
|
260
260
|
const hasVersionFlag = args.includes("--version") || args.some((arg) => arg.startsWith("--version="));
|
|
261
261
|
const version = typeof flags.version === "string" ? flags.version : hasVersionFlag ? "" : void 0;
|
package/dist/client/react.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Q as DocsCloudConfig, R as DocsAnalyticsConfig, t as AIConfig } from "./types-EhFhYGfr.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/cloud-ask-ai.d.ts
|
|
4
4
|
interface DocsCloudAskAIConfig {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as markCliErrorReported } from "./errors-
|
|
2
|
-
import {
|
|
3
|
-
import { i as detectPackageManagerFromProject, t as detectFramework } from "./utils-
|
|
1
|
+
import { n as markCliErrorReported } from "./errors-DbOhkE1h.mjs";
|
|
2
|
+
import { _ as resolveDocsContentDir, a as loadDocsConfigModule, c as loadProjectEnv, d as readNavTitle, g as resolveDocsConfigPath, h as readTopLevelStringProperty, m as readTopLevelBooleanProperty, p as readStringProperty, t as extractNestedObjectLiteral } from "./config-Wcdj-D0a.mjs";
|
|
3
|
+
import { i as detectPackageManagerFromProject, t as detectFramework } from "./utils-DpiIioYb.mjs";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { execFileSync } from "node:child_process";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as validateCodeBlocks, r as resolveDocsCodeBlocksValidateConfig } from "./code-blocks-
|
|
2
|
-
import {
|
|
1
|
+
import { a as validateCodeBlocks, r as resolveDocsCodeBlocksValidateConfig } from "./code-blocks-DnNVNK2M.mjs";
|
|
2
|
+
import { _ as resolveDocsContentDir, a as loadDocsConfigModule, f as readNumberProperty, g as resolveDocsConfigPath, h as readTopLevelStringProperty, l as readBooleanProperty, p as readStringProperty, t as extractNestedObjectLiteral } from "./config-Wcdj-D0a.mjs";
|
|
3
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
4
4
|
import pc from "picocolors";
|
|
5
5
|
|
|
@@ -143,6 +143,12 @@ function extractTopLevelObjectLiteral(content, key) {
|
|
|
143
143
|
return braceEnd === -1 ? void 0 : normalizedProperty.slice(braceStart + 1, braceEnd);
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
+
/** Return whether an object-literal body declares a direct property with this name. */
|
|
147
|
+
function hasTopLevelProperty(content, key) {
|
|
148
|
+
const escaped = escapeRegExp(key);
|
|
149
|
+
const propertyPattern = new RegExp(`^(?:${escaped}|["']${escaped}["'])\\s*:`);
|
|
150
|
+
return splitTopLevelProperties(content).some((property) => propertyPattern.test(stripLeadingPropertyTrivia(property)));
|
|
151
|
+
}
|
|
146
152
|
function extractTopLevelConfigObject(content) {
|
|
147
153
|
for (const marker of ["defineDocs(", "export default"]) {
|
|
148
154
|
const markerIndex = content.indexOf(marker);
|
|
@@ -360,4 +366,4 @@ async function loadDocsConfigModuleResultWithProjectEnv(rootDir, explicitPath, o
|
|
|
360
366
|
}
|
|
361
367
|
|
|
362
368
|
//#endregion
|
|
363
|
-
export {
|
|
369
|
+
export { resolveDocsContentDir as _, loadDocsConfigModule as a, loadProjectEnv as c, readNavTitle as d, readNumberProperty as f, resolveDocsConfigPath as g, readTopLevelStringProperty as h, hasTopLevelProperty as i, readBooleanProperty as l, readTopLevelBooleanProperty as m, extractObjectLiteral as n, loadDocsConfigModuleResult as o, readStringProperty as p, extractTopLevelConfigObject as r, loadDocsConfigModuleResultWithProjectEnv as s, extractNestedObjectLiteral as t, readEnvReferenceProperty as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as detectPackageManagerFromProject } from "./utils-
|
|
2
|
-
import {
|
|
1
|
+
import { i as detectPackageManagerFromProject } from "./utils-DpiIioYb.mjs";
|
|
2
|
+
import { Ct as tsconfigTemplate, Y as rootLayoutTemplate, g as docsLayoutTemplate, q as postcssConfigTemplate, v as globalCssTemplate } from "./templates-Bq_P7ctv.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 {
|
|
2
|
-
import { n as DocsCloudAskAIResponseOptions, t as DocsCloudAskAIConfig } from "./cloud-ask-ai-
|
|
1
|
+
import { B as DocsAnalyticsEventInput, R as DocsAnalyticsConfig, z as DocsAnalyticsEvent } from "./types-EhFhYGfr.mjs";
|
|
2
|
+
import { n as DocsCloudAskAIResponseOptions, t as DocsCloudAskAIConfig } from "./cloud-ask-ai-D7ZgF47y.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,5 +1,5 @@
|
|
|
1
1
|
import { n as sendDocsCloudAnalyticsEvent } from "./cloud-analytics-CSyFE6SS.mjs";
|
|
2
|
-
import { t as createDocsCloudAskAIResponse } from "./cloud-ask-ai-
|
|
2
|
+
import { t as createDocsCloudAskAIResponse } from "./cloud-ask-ai-sbpjOR2K.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/docs-cloud-server.ts
|
|
5
5
|
const DEFAULT_DOCS_CLOUD_API_BASE_URL = "https://api.farming-labs.dev";
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import { i as scanDocsPageTargets, n as compactAgentDocs, r as inspectAgentCompactionState } from "./agent-
|
|
2
|
-
import { l as httpLinkHeaderHasTargetRelation } from "./reading-time-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { a as
|
|
7
|
-
import "./
|
|
8
|
-
import
|
|
1
|
+
import { i as scanDocsPageTargets, n as compactAgentDocs, r as inspectAgentCompactionState } from "./agent-DFHlw_JC.mjs";
|
|
2
|
+
import { l as httpLinkHeaderHasTargetRelation } from "./reading-time-C-SAhQT9.mjs";
|
|
3
|
+
import { Dt as DEFAULT_SITEMAP_MD_ROUTE, Ft as resolveDocsSitemapConfig, Ht as PAGE_AGENT_CONTRACT_FIELDS, N as buildDocsMcpEndpointCandidates, Ot as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, S as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, T as DOCS_CONFIG_MAP_TOP_LEVEL_KEYS, c as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, dn as normalizeDocsMcpAuthorizationServerUrls, en as DEFAULT_MCP_PUBLIC_ROUTE, h as DEFAULT_LLMS_FULL_TXT_ROUTE, i as DEFAULT_AGENT_FEEDBACK_ROUTE, in as getDocsMcpProtectedResourceMetadataRoutes, j as buildDocsConfigMap, k as buildDocsAgentDiscoverySpec, kt as DEFAULT_SITEMAP_XML_ROUTE, l as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, nn as DEFAULT_MCP_WELL_KNOWN_ROUTE, sn as isDocsMcpOAuthScopeToken, t as DEFAULT_AGENTS_MD_ROUTE, v as DEFAULT_LLMS_TXT_ROUTE, x as DEFAULT_SKILL_MD_ROUTE } from "./agent-Fl0pjVNF.mjs";
|
|
4
|
+
import { O as resolveDocsDiscoveryApiRoute, c as DEFAULT_AGENT_SKILLS_INDEX_ROUTE, g as DEFAULT_API_CATALOG_ROUTE, h as DEFAULT_API_CATALOG_FORMAT, l as DEFAULT_AGENT_SKILLS_ROUTE_PATTERN, n as API_CATALOG_MEDIA_TYPE, p as DEFAULT_AGENT_SKILL_FORMAT, r as API_CATALOG_PROFILE_URI, s as DEFAULT_AGENT_SKILLS_INDEX_FORMAT, t as AGENT_SKILLS_DISCOVERY_SCHEMA_URI, u as DEFAULT_AGENT_SKILLS_ROUTE_PREFIX } from "./standards-discovery-C54V_aJH.mjs";
|
|
5
|
+
import { d as resolveAskAISearchRequestConfig } from "./search-9OnMGMvt.mjs";
|
|
6
|
+
import { a as analyzeDocsRobotsTxt, n as DEFAULT_ROBOTS_TXT_ROUTE, u as resolveDocsRobotsConfig } from "./robots-C08kDLsz.mjs";
|
|
7
|
+
import { a as resolveDocsMetadataBaseUrl } from "./metadata-Dv1ah0Aj.mjs";
|
|
8
|
+
import "./sitemap-server-D_0Kzanj.mjs";
|
|
9
|
+
import { t as runDocsGoldenTasks } from "./agent-evals-f4_OL10T.mjs";
|
|
9
10
|
import { createFilesystemDocsMcpSource, getDocsConfigSchema, resolveDocsMcpConfig } from "./mcp.mjs";
|
|
10
|
-
import "./code-blocks-
|
|
11
|
+
import "./code-blocks-DnNVNK2M.mjs";
|
|
12
|
+
import "./agent-skills-server-CIeBszxp.mjs";
|
|
11
13
|
import "./server.mjs";
|
|
12
|
-
import {
|
|
13
|
-
import { t as detectFramework } from "./utils-
|
|
14
|
-
import { i as createAgentUsefulnessPagesFromMcp, n as analyzeAgentSurfaceDrift, r as analyzeAgentUsefulness, t as resolveGoldenEvaluationInput } from "./golden-evaluations-
|
|
14
|
+
import { _ as resolveDocsContentDir, d as readNavTitle, g as resolveDocsConfigPath, h as readTopLevelStringProperty, l as readBooleanProperty, r as extractTopLevelConfigObject, s as loadDocsConfigModuleResultWithProjectEnv, t as extractNestedObjectLiteral } from "./config-Wcdj-D0a.mjs";
|
|
15
|
+
import { t as detectFramework } from "./utils-DpiIioYb.mjs";
|
|
16
|
+
import { i as createAgentUsefulnessPagesFromMcp, n as analyzeAgentSurfaceDrift, r as analyzeAgentUsefulness, t as resolveGoldenEvaluationInput } from "./golden-evaluations-CBZ_JZjf.mjs";
|
|
15
17
|
import { existsSync, lstatSync, readFileSync, readdirSync } from "node:fs";
|
|
16
18
|
import path from "node:path";
|
|
17
19
|
import { LATEST_PROTOCOL_VERSION } from "@modelcontextprotocol/sdk/types.js";
|
|
18
|
-
import pc from "picocolors";
|
|
19
20
|
import { createHash } from "node:crypto";
|
|
21
|
+
import pc from "picocolors";
|
|
20
22
|
|
|
21
23
|
//#region src/cli/doctor.ts
|
|
22
24
|
const NEXT_CONFIG_PATTERN = /^next\.config\.(?:[cm]?js|[cm]?ts)$/;
|
|
@@ -1006,6 +1008,7 @@ async function probeMcpRoute(baseUrl, route, expectedTools) {
|
|
|
1006
1008
|
}
|
|
1007
1009
|
}
|
|
1008
1010
|
});
|
|
1011
|
+
if (initializeResponse.status === 401) return await probeProtectedMcpDiscovery(baseUrl, route, initializeResponse);
|
|
1009
1012
|
const initializePayload = await parseMcpResponse(initializeResponse);
|
|
1010
1013
|
if (!initializeResponse.ok || initializePayload.error) return {
|
|
1011
1014
|
ok: false,
|
|
@@ -1053,6 +1056,125 @@ async function probeMcpRoute(baseUrl, route, expectedTools) {
|
|
|
1053
1056
|
};
|
|
1054
1057
|
}
|
|
1055
1058
|
}
|
|
1059
|
+
async function probeProtectedMcpDiscovery(baseUrl, route, response) {
|
|
1060
|
+
const bearerChallenge = findBearerChallenge(response.headers.get("www-authenticate") ?? "");
|
|
1061
|
+
const rawMetadataUrl = bearerChallenge ? readHttpAuthQuotedParameter(bearerChallenge, "resource_metadata") : void 0;
|
|
1062
|
+
if (!bearerChallenge || !rawMetadataUrl) return {
|
|
1063
|
+
ok: false,
|
|
1064
|
+
detail: `${route} requires authentication but did not return a Bearer resource_metadata challenge.`
|
|
1065
|
+
};
|
|
1066
|
+
const resourceUrl = new URL(joinDoctorUrl(baseUrl, route));
|
|
1067
|
+
let metadataUrl;
|
|
1068
|
+
try {
|
|
1069
|
+
metadataUrl = new URL(rawMetadataUrl);
|
|
1070
|
+
} catch {
|
|
1071
|
+
return {
|
|
1072
|
+
ok: false,
|
|
1073
|
+
detail: `${route} returned an invalid resource_metadata URL.`
|
|
1074
|
+
};
|
|
1075
|
+
}
|
|
1076
|
+
if (metadataUrl.origin !== resourceUrl.origin) return {
|
|
1077
|
+
ok: false,
|
|
1078
|
+
detail: `${route} returned cross-origin protected-resource metadata; the hosted doctor will not fetch it.`
|
|
1079
|
+
};
|
|
1080
|
+
let metadataResponse;
|
|
1081
|
+
try {
|
|
1082
|
+
metadataResponse = await fetchWithTimeout(metadataUrl.href, {
|
|
1083
|
+
headers: { Accept: "application/json" },
|
|
1084
|
+
redirect: "manual"
|
|
1085
|
+
});
|
|
1086
|
+
} catch (error) {
|
|
1087
|
+
return {
|
|
1088
|
+
ok: false,
|
|
1089
|
+
detail: `${route} protected-resource metadata failed: ${error instanceof Error ? error.message : String(error)}.`
|
|
1090
|
+
};
|
|
1091
|
+
}
|
|
1092
|
+
if (metadataResponse.status !== 200) return {
|
|
1093
|
+
ok: false,
|
|
1094
|
+
detail: `${route} protected-resource metadata returned HTTP ${metadataResponse.status}.`
|
|
1095
|
+
};
|
|
1096
|
+
if (responseMediaType(metadataResponse.headers.get("content-type")) !== "application/json") return {
|
|
1097
|
+
ok: false,
|
|
1098
|
+
detail: `${route} protected-resource metadata did not return application/json.`
|
|
1099
|
+
};
|
|
1100
|
+
let metadata;
|
|
1101
|
+
try {
|
|
1102
|
+
const metadataRecord = asRecord(await metadataResponse.json());
|
|
1103
|
+
if (!metadataRecord) return {
|
|
1104
|
+
ok: false,
|
|
1105
|
+
detail: `${route} protected-resource metadata must be a JSON object.`
|
|
1106
|
+
};
|
|
1107
|
+
metadata = metadataRecord;
|
|
1108
|
+
} catch {
|
|
1109
|
+
return {
|
|
1110
|
+
ok: false,
|
|
1111
|
+
detail: `${route} protected-resource metadata is not valid JSON.`
|
|
1112
|
+
};
|
|
1113
|
+
}
|
|
1114
|
+
if (metadata.resource !== resourceUrl.href) return {
|
|
1115
|
+
ok: false,
|
|
1116
|
+
detail: `${route} protected-resource metadata identifies ${String(metadata.resource ?? "no resource")} instead of ${resourceUrl.href}.`
|
|
1117
|
+
};
|
|
1118
|
+
const authorizationServers = metadata.authorization_servers;
|
|
1119
|
+
if (!Array.isArray(authorizationServers) || authorizationServers.length === 0 || normalizeDocsMcpAuthorizationServerUrls(authorizationServers.filter((issuer) => typeof issuer === "string")).length !== authorizationServers.length) return {
|
|
1120
|
+
ok: false,
|
|
1121
|
+
detail: `${route} protected-resource metadata is missing valid authorization_servers.`
|
|
1122
|
+
};
|
|
1123
|
+
const scopesSupported = metadata.scopes_supported;
|
|
1124
|
+
if (scopesSupported !== void 0 && (!Array.isArray(scopesSupported) || scopesSupported.some((scope) => !isDocsMcpOAuthScopeToken(scope)))) return {
|
|
1125
|
+
ok: false,
|
|
1126
|
+
detail: `${route} protected-resource metadata has invalid scopes_supported.`
|
|
1127
|
+
};
|
|
1128
|
+
const challengeScope = readHttpAuthQuotedParameter(bearerChallenge, "scope");
|
|
1129
|
+
if (challengeScope !== void 0 && challengeScope.split(" ").some((scope) => !isDocsMcpOAuthScopeToken(scope))) return {
|
|
1130
|
+
ok: false,
|
|
1131
|
+
detail: `${route} returned an invalid Bearer scope challenge.`
|
|
1132
|
+
};
|
|
1133
|
+
return {
|
|
1134
|
+
ok: true,
|
|
1135
|
+
detail: `${route} is protected and exposes valid RFC 9728 metadata at ${metadataUrl.pathname}.`
|
|
1136
|
+
};
|
|
1137
|
+
}
|
|
1138
|
+
function findBearerChallenge(header) {
|
|
1139
|
+
let first = 0;
|
|
1140
|
+
while (first < header.length && /\s/u.test(header[first] ?? "")) first += 1;
|
|
1141
|
+
const starts = [first];
|
|
1142
|
+
let quoted = false;
|
|
1143
|
+
let escaped = false;
|
|
1144
|
+
for (let index = 0; index < header.length; index += 1) {
|
|
1145
|
+
const character = header[index];
|
|
1146
|
+
if (escaped) {
|
|
1147
|
+
escaped = false;
|
|
1148
|
+
continue;
|
|
1149
|
+
}
|
|
1150
|
+
if (quoted && character === "\\") {
|
|
1151
|
+
escaped = true;
|
|
1152
|
+
continue;
|
|
1153
|
+
}
|
|
1154
|
+
if (character === "\"") {
|
|
1155
|
+
quoted = !quoted;
|
|
1156
|
+
continue;
|
|
1157
|
+
}
|
|
1158
|
+
if (quoted || character !== ",") continue;
|
|
1159
|
+
let candidate = index + 1;
|
|
1160
|
+
while (candidate < header.length && /\s/u.test(header[candidate] ?? "")) candidate += 1;
|
|
1161
|
+
const tokenStart = candidate;
|
|
1162
|
+
while (candidate < header.length && /[!#$%&'*+\-.^_`|~0-9A-Za-z]/u.test(header[candidate] ?? "")) candidate += 1;
|
|
1163
|
+
if (candidate === tokenStart) continue;
|
|
1164
|
+
let afterToken = candidate;
|
|
1165
|
+
while (afterToken < header.length && /\s/u.test(header[afterToken] ?? "")) afterToken += 1;
|
|
1166
|
+
if (header[afterToken] !== "=") starts.push(tokenStart);
|
|
1167
|
+
}
|
|
1168
|
+
for (let index = 0; index < starts.length; index += 1) {
|
|
1169
|
+
const start = starts[index] ?? 0;
|
|
1170
|
+
if ((/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+/u.exec(header.slice(start))?.[0])?.toLowerCase() !== "bearer") continue;
|
|
1171
|
+
const end = starts[index + 1] ?? header.length;
|
|
1172
|
+
return header.slice(start, end).replace(/,\s*$/u, "").trim();
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
function readHttpAuthQuotedParameter(header, name) {
|
|
1176
|
+
return (new RegExp(`(?:^|[,\\s])${name}\\s*=\\s*"((?:\\\\.|[^"\\\\])*)"`, "i").exec(header)?.[1])?.replace(/\\(.)/g, "$1");
|
|
1177
|
+
}
|
|
1056
1178
|
async function probeMcpRouteCandidates(baseUrl, routes, expectedTools) {
|
|
1057
1179
|
const candidates = buildDocsMcpEndpointCandidates(baseUrl, routes);
|
|
1058
1180
|
const probes = await Promise.all(candidates.map(async (candidate) => {
|
|
@@ -1156,7 +1278,7 @@ async function probeApiCatalogRoute(baseUrl) {
|
|
|
1156
1278
|
}
|
|
1157
1279
|
function isValidAgentSkillEntry(value) {
|
|
1158
1280
|
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));
|
|
1281
|
+
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" || entry.type === "archive") && isNonEmptyString(entry.description) && entry.description.length <= 1024 && isNonEmptyString(entry.url) && typeof entry.digest === "string" && /^sha256:[0-9a-f]{64}$/u.test(entry.digest));
|
|
1160
1282
|
}
|
|
1161
1283
|
async function probeAgentSkillsDiscovery(baseUrl) {
|
|
1162
1284
|
const route = DEFAULT_AGENT_SKILLS_INDEX_ROUTE;
|
|
@@ -1196,7 +1318,8 @@ async function probeAgentSkillsDiscovery(baseUrl) {
|
|
|
1196
1318
|
failures.push(`${skill.name} has an invalid artifact URL`);
|
|
1197
1319
|
continue;
|
|
1198
1320
|
}
|
|
1199
|
-
const expectedPath = DEFAULT_AGENT_SKILLS_ROUTE_PATTERN.replace("{name}", skill.name);
|
|
1321
|
+
const expectedPath = skill.type === "archive" ? `${DEFAULT_AGENT_SKILLS_ROUTE_PREFIX}/${skill.name}.tar.gz` : DEFAULT_AGENT_SKILLS_ROUTE_PATTERN.replace("{name}", skill.name);
|
|
1322
|
+
const expectedMediaType = skill.type === "archive" ? "application/gzip" : "text/markdown";
|
|
1200
1323
|
if (artifactUrl.origin !== baseOrigin) {
|
|
1201
1324
|
failures.push(`${skill.name} artifact is not same-origin`);
|
|
1202
1325
|
continue;
|
|
@@ -1206,16 +1329,16 @@ async function probeAgentSkillsDiscovery(baseUrl) {
|
|
|
1206
1329
|
continue;
|
|
1207
1330
|
}
|
|
1208
1331
|
try {
|
|
1209
|
-
const [artifactResponse, artifactHeadResponse] = await Promise.all([fetchWithTimeout(artifactUrl.toString(), { headers: { Accept:
|
|
1332
|
+
const [artifactResponse, artifactHeadResponse] = await Promise.all([fetchWithTimeout(artifactUrl.toString(), { headers: { Accept: expectedMediaType } }), fetchWithTimeout(artifactUrl.toString(), {
|
|
1210
1333
|
method: "HEAD",
|
|
1211
|
-
headers: { Accept:
|
|
1334
|
+
headers: { Accept: expectedMediaType }
|
|
1212
1335
|
})]);
|
|
1213
1336
|
const content = Buffer.from(await artifactResponse.arrayBuffer());
|
|
1214
1337
|
const computedDigest = `sha256:${createHash("sha256").update(content).digest("hex")}`;
|
|
1215
1338
|
if (!artifactResponse.ok) failures.push(`${skill.name} artifact returned HTTP ${artifactResponse.status}`);
|
|
1216
1339
|
else if (!artifactHeadResponse.ok) failures.push(`${skill.name} artifact HEAD returned HTTP ${artifactHeadResponse.status}`);
|
|
1217
|
-
else if (responseMediaType(artifactResponse.headers.get("content-type")) !==
|
|
1218
|
-
else if (responseMediaType(artifactHeadResponse.headers.get("content-type")) !==
|
|
1340
|
+
else if (responseMediaType(artifactResponse.headers.get("content-type")) !== expectedMediaType) failures.push(`${skill.name} artifact Content-Type is not ${expectedMediaType}`);
|
|
1341
|
+
else if (responseMediaType(artifactHeadResponse.headers.get("content-type")) !== expectedMediaType) failures.push(`${skill.name} artifact HEAD Content-Type is not ${expectedMediaType}`);
|
|
1219
1342
|
else if (content.length === 0) failures.push(`${skill.name} artifact is empty`);
|
|
1220
1343
|
else if (computedDigest !== skill.digest) failures.push(`${skill.name} artifact digest does not match the index`);
|
|
1221
1344
|
else artifactDetails.push(`${skill.name} digest verified`);
|
|
@@ -1574,7 +1697,13 @@ async function inspectAgentReadiness(options = {}) {
|
|
|
1574
1697
|
schemaRoute: feedbackSchemaRoute
|
|
1575
1698
|
}
|
|
1576
1699
|
});
|
|
1577
|
-
const configuredAgentReviewPaths = configLoad.status === "evaluated" ? Object.values(buildDocsConfigMap(configLoad.config).pointers).map((pointer) => pointer.path).filter((optionPath) => optionPath === "agent" || optionPath.startsWith("agent.") || optionPath === "review" || optionPath.startsWith("review.")) : [];
|
|
1700
|
+
const configuredAgentReviewPaths = configLoad.status === "evaluated" ? Object.values(buildDocsConfigMap(configLoad.config).pointers).map((pointer) => pointer.path).filter((optionPath) => optionPath === "agent" || optionPath.startsWith("agent.") || optionPath === "mcp" || optionPath.startsWith("mcp.") || optionPath === "review" || optionPath.startsWith("review.")) : [];
|
|
1701
|
+
const expectedMcpProtectedResource = mcpConfig.enabled && mcpConfig.security?.authenticate && mcpConfig.security.protectedResource ? {
|
|
1702
|
+
metadataEndpoints: [...getDocsMcpProtectedResourceMetadataRoutes(mcpConfig.route)],
|
|
1703
|
+
authorizationServers: mcpConfig.security.protectedResource.authorizationServers,
|
|
1704
|
+
scopesSupported: mcpConfig.security.protectedResource.scopesSupported,
|
|
1705
|
+
requiredScopes: mcpConfig.security.protectedResource.requiredScopes
|
|
1706
|
+
} : null;
|
|
1578
1707
|
const surfaceDrift = analyzeAgentSurfaceDrift({
|
|
1579
1708
|
configOptionPaths: [...new Set([...DOCS_CONFIG_MAP_TOP_LEVEL_KEYS, ...configuredAgentReviewPaths])],
|
|
1580
1709
|
schemaOptions: getDocsConfigSchema().options,
|
|
@@ -1589,7 +1718,8 @@ async function inspectAgentReadiness(options = {}) {
|
|
|
1589
1718
|
mcp: {
|
|
1590
1719
|
enabled: mcpConfig.enabled,
|
|
1591
1720
|
endpoint: mcpConfig.route,
|
|
1592
|
-
tools: mcpConfig.tools
|
|
1721
|
+
tools: mcpConfig.tools,
|
|
1722
|
+
protectedResource: expectedMcpProtectedResource
|
|
1593
1723
|
},
|
|
1594
1724
|
routes: {
|
|
1595
1725
|
"api.docs": apiRoute,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as fileExists, o as exec, s as execOutput } from "./utils-
|
|
2
|
-
import { a as getPackagesForFramework, c as resolveDocsPackageManager, l as validateUpgradeVersion, r as buildDocsPackageInstallCommand, s as resolveDocsPackageFramework } from "./package-version-
|
|
1
|
+
import { c as fileExists, o as exec, s as execOutput } from "./utils-DpiIioYb.mjs";
|
|
2
|
+
import { a as getPackagesForFramework, c as resolveDocsPackageManager, l as validateUpgradeVersion, r as buildDocsPackageInstallCommand, s as resolveDocsPackageFramework } from "./package-version-n5AFur8a.mjs";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import pc from "picocolors";
|