@farming-labs/docs 0.2.61 → 0.2.63
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-DFHlw_JC.mjs → agent-CQTH7NFu.mjs} +2 -2
- package/dist/{agent-Fl0pjVNF.mjs → agent-DKKptIgy.mjs} +17 -4
- package/dist/{agent-evals-f4_OL10T.mjs → agent-evals-B7MIxuEX.mjs} +1 -1
- package/dist/{agent-export-D0zQhasD.mjs → agent-export-CBgWgPvH.mjs} +7 -7
- package/dist/agent-skills-server-CPja6Syt.d.mts +14 -0
- package/dist/{agent-skills-server-CIeBszxp.mjs → agent-skills-server-DraIb6FV.mjs} +171 -19
- package/dist/agent-skills-vite.d.mts +2 -2
- package/dist/agent-skills-vite.mjs +2 -2
- package/dist/{agents-ibnXrWyp.mjs → agents-XWZBub6f.mjs} +6 -6
- package/dist/cli/index.mjs +14 -14
- package/dist/client/react.d.mts +1 -1
- package/dist/{cloud-ask-ai-D7ZgF47y.d.mts → cloud-ask-ai-zpwkdwnF.d.mts} +1 -1
- package/dist/docs-cloud-server.d.mts +2 -2
- package/dist/{doctor-CXostbsI.mjs → doctor-CJqtzKZT.mjs} +11 -11
- package/dist/{golden-evaluations-CBZ_JZjf.mjs → golden-evaluations-Dsvh0etV.mjs} +6 -1
- package/dist/index.d.mts +12 -3
- package/dist/index.mjs +7 -7
- package/dist/{mcp-DyPcoLwm.mjs → mcp-B9dcsivk.mjs} +6 -6
- package/dist/mcp.d.mts +1 -1
- package/dist/mcp.mjs +11 -7
- package/dist/{metadata-Dv1ah0Aj.mjs → metadata-DWExHQnx.mjs} +1 -1
- package/dist/{reading-time-C-SAhQT9.mjs → reading-time-CYZ5VvKU.mjs} +3 -3
- package/dist/{review-D2UBrxFq.mjs → review-Fndl5brR.mjs} +6 -6
- package/dist/{robots-C08kDLsz.mjs → robots-BIpC4j4P.mjs} +2 -2
- package/dist/{robots-5Yqz9mz7.mjs → robots-CUTahhoY.mjs} +3 -3
- package/dist/{search-9OnMGMvt.mjs → search-B6V6qtiI.mjs} +110 -42
- package/dist/{search-C6heDO8h.d.mts → search-CaSyi6H6.d.mts} +7 -2
- package/dist/{search-CNsRpz90.mjs → search-DSjCeOk7.mjs} +6 -6
- package/dist/server.d.mts +6 -5
- package/dist/server.mjs +8 -7
- package/dist/{sitemap-BpYnSsfJ.mjs → sitemap-Cykpe3Tz.mjs} +6 -6
- package/dist/{sitemap-server-D_0Kzanj.mjs → sitemap-server-C_6Wes83.mjs} +1 -1
- package/dist/{standards-discovery-C54V_aJH.mjs → standards-discovery-jkykaXq1.mjs} +18 -9
- package/dist/{types-EhFhYGfr.d.mts → types-lMBIdZg0.d.mts} +10 -0
- package/package.json +1 -1
- package/dist/agent-skills-server-CKq3_jMj.d.mts +0 -12
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Jt as normalizePageAgentFrontmatter, L as findDocsMarkdownPage, Zt as stripGeneratedPageAgentContractMarkdown, tt as renderDocsMarkdownDocument } from "./agent-
|
|
2
|
-
import { _ as
|
|
1
|
+
import { Jt as normalizePageAgentFrontmatter, L as findDocsMarkdownPage, Zt as stripGeneratedPageAgentContractMarkdown, tt as renderDocsMarkdownDocument } from "./agent-DKKptIgy.mjs";
|
|
2
|
+
import { _ as GENERATED_AGENT_PROVENANCE_VERSION, b as parseGeneratedAgentDocument, v as hashGeneratedAgentContent, x as serializeGeneratedAgentDocument } from "./search-B6V6qtiI.mjs";
|
|
3
3
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
4
4
|
import { _ as resolveDocsContentDir, a as loadDocsConfigModule, c as loadProjectEnv, d as readNavTitle, f as readNumberProperty, g as resolveDocsConfigPath, h as readTopLevelStringProperty, l as readBooleanProperty, p as readStringProperty, t as extractNestedObjectLiteral, u as readEnvReferenceProperty } from "./config-Wcdj-D0a.mjs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as buildDocsApiCatalog,
|
|
1
|
+
import { C as buildDocsApiCatalog, E as createDocsStandardsResponse, O as isDocsStandardsDiscoveryRequest, a as DEFAULT_A2A_AGENT_CARD_ROUTE, c as DEFAULT_AGENT_SKILLS_INDEX_ROUTE, g as DEFAULT_API_CATALOG_ROUTE, h as DEFAULT_API_CATALOG_FORMAT, k as resolveDocsDiscoveryApiRoute, l as DEFAULT_AGENT_SKILLS_ROUTE_PATTERN, n as API_CATALOG_MEDIA_TYPE, o as DEFAULT_AGENT_SKILLS_ARCHIVE_ROUTE_PATTERN, r as API_CATALOG_PROFILE_URI, s as DEFAULT_AGENT_SKILLS_INDEX_FORMAT, t as AGENT_SKILLS_DISCOVERY_SCHEMA_URI, v as DEFAULT_LEGACY_SKILLS_INDEX_ROUTE } from "./standards-discovery-jkykaXq1.mjs";
|
|
2
2
|
import { createProcessor } from "@mdx-js/mdx";
|
|
3
3
|
|
|
4
4
|
//#region src/mcp-auth.ts
|
|
@@ -2433,6 +2433,7 @@ function buildDocsDiagnostics(config, options = {}) {
|
|
|
2433
2433
|
agents: apiQueryRoute("format=agents"),
|
|
2434
2434
|
skill: apiQueryRoute("format=skill"),
|
|
2435
2435
|
search: search.enabled ? apiQueryRoute("query={query}") : null,
|
|
2436
|
+
agentSearch: search.enabled ? apiQueryRoute("query={query}&audience=agent") : null,
|
|
2436
2437
|
askAi: ai.enabled ? apiRoute : null,
|
|
2437
2438
|
mcp: mcp.enabled ? mcp.route : null,
|
|
2438
2439
|
llmsTxt: llms.enabled ? DEFAULT_LLMS_TXT_ROUTE : null,
|
|
@@ -2463,6 +2464,14 @@ function buildDocsDiagnostics(config, options = {}) {
|
|
|
2463
2464
|
status: search.enabled ? "enabled" : "disabled",
|
|
2464
2465
|
reason: search.reason,
|
|
2465
2466
|
route: search.enabled ? apiQueryRoute("query={query}") : null,
|
|
2467
|
+
routes: {
|
|
2468
|
+
human: search.enabled ? apiQueryRoute("query={query}") : null,
|
|
2469
|
+
agent: search.enabled ? apiQueryRoute("query={query}&audience=agent") : null
|
|
2470
|
+
},
|
|
2471
|
+
agentEndpoint: search.enabled ? apiQueryRoute("query={query}&audience=agent") : null,
|
|
2472
|
+
audienceParam: "audience",
|
|
2473
|
+
defaultAudience: "human",
|
|
2474
|
+
supportedAudiences: ["human", "agent"],
|
|
2466
2475
|
provider: search.provider,
|
|
2467
2476
|
transport: "GET"
|
|
2468
2477
|
},
|
|
@@ -3662,7 +3671,7 @@ function renderDocsMarkdownNotFound({ entry = "docs", apiRoute, requestedPath, o
|
|
|
3662
3671
|
lines.push(`- [${match.title}](${match.markdownUrl}) (${confidence} confidence)${match.description ? ` - ${match.description}` : ""}`);
|
|
3663
3672
|
}
|
|
3664
3673
|
}
|
|
3665
|
-
lines.push("", "## Recovery", "", "- If a closest match looks right, fetch that markdown URL directly.", "- If the match is uncertain, search the docs first and then fetch the smallest page that answers the task.", "- Use the sitemap routes below to browse the full docs index before guessing another slug.", "", "## Discovery Routes", "", "Use these discovery routes to find the right page:", "", `- Agent discovery spec: \`${DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE}\``, `- Agent discovery fallback: \`${DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE}\``, `- Agent discovery API: \`${agentSpecApiRoute}\``, `- API catalog: \`${DEFAULT_API_CATALOG_ROUTE}\``, `- Agent Skills index: \`${DEFAULT_AGENT_SKILLS_INDEX_ROUTE}\``, `- Agent instructions: \`${DEFAULT_AGENTS_MD_ROUTE}\``, `-
|
|
3674
|
+
lines.push("", "## Recovery", "", "- If a closest match looks right, fetch that markdown URL directly.", "- If the match is uncertain, search the docs first and then fetch the smallest page that answers the task.", "- Use the sitemap routes below to browse the full docs index before guessing another slug.", "", "## Discovery Routes", "", "Use these discovery routes to find the right page:", "", `- Agent discovery spec: \`${DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE}\``, `- Agent discovery fallback: \`${DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE}\``, `- Agent discovery API: \`${agentSpecApiRoute}\``, `- API catalog: \`${DEFAULT_API_CATALOG_ROUTE}\``, `- Agent Skills index: \`${DEFAULT_AGENT_SKILLS_INDEX_ROUTE}\``, `- Agent instructions: \`${DEFAULT_AGENTS_MD_ROUTE}\``, `- Agent search endpoint: \`${resolvedApiRoute}?query={query}&audience=agent\``, `- Docs index markdown: \`/${normalizedEntry}.md\``, `- Requested markdown API route: \`${requestedApiRoute}\``);
|
|
3666
3675
|
if (sitemapConfig.enabled) {
|
|
3667
3676
|
if (sitemapConfig.markdown.enabled) {
|
|
3668
3677
|
lines.push(`- Semantic sitemap: \`${sitemapConfig.markdown.route}\``);
|
|
@@ -3840,7 +3849,7 @@ function appendDocsMarkdownNegotiationStartLines(lines, context, variant) {
|
|
|
3840
3849
|
}
|
|
3841
3850
|
function appendDocsSearchStartLine(lines, context, variant) {
|
|
3842
3851
|
if (!context.searchEnabled) return;
|
|
3843
|
-
lines.push(variant === "skill" ? `- Search with ${context.apiRoute}?query={query} when you do not know the page.` : `- Search with ${context.apiRoute}?query={query} when the route is unknown.`);
|
|
3852
|
+
lines.push(variant === "skill" ? `- Search with ${context.apiRoute}?query={query}&audience=agent when you do not know the page.` : `- Search with ${context.apiRoute}?query={query}&audience=agent when the route is unknown.`);
|
|
3844
3853
|
}
|
|
3845
3854
|
function appendDocsOpenApiStartLine(lines, context, variant) {
|
|
3846
3855
|
if (!context.openapiConfig.enabled || !context.openapiConfig.url) return;
|
|
@@ -4178,9 +4187,13 @@ function buildDocsAgentDiscoverySpec({ origin, entry = "docs", apiRoute, apiCata
|
|
|
4178
4187
|
search: {
|
|
4179
4188
|
enabled: searchEnabled,
|
|
4180
4189
|
endpoint: apiQueryRoute("query={query}"),
|
|
4190
|
+
agentEndpoint: apiQueryRoute("query={query}&audience=agent"),
|
|
4181
4191
|
method: "GET",
|
|
4182
4192
|
queryParam: "query",
|
|
4183
|
-
localeParam: "lang"
|
|
4193
|
+
localeParam: "lang",
|
|
4194
|
+
audienceParam: "audience",
|
|
4195
|
+
defaultAudience: "human",
|
|
4196
|
+
supportedAudiences: ["human", "agent"]
|
|
4184
4197
|
},
|
|
4185
4198
|
agents: {
|
|
4186
4199
|
enabled: true,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { m as findDocsMarkdownSection, p as resolveSearchRequestConfig, t as buildDocsAskAIContext, u as performDocsSearch } from "./search-B6V6qtiI.mjs";
|
|
2
2
|
import { a as normalizeAgentScopeValues, i as normalizeAgentLocale, n as agentVersionConstraintsOverlap, o as normalizeAgentVersion, r as normalizeAgentFramework, t as agentVersionConstraintMatches } from "./agent-scope-C_U--OZ7.mjs";
|
|
3
3
|
import { buildDocsMcpContext } from "./mcp.mjs";
|
|
4
4
|
import { i as validateCodeBlockPlans, n as planCodeBlockTargets, r as resolveDocsCodeBlocksValidateConfig, t as extractCodeBlocksFromMarkdown } from "./code-blocks-DnNVNK2M.mjs";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { $ as renderDocsAgentsDocument, At as buildDocsSitemapManifest, Ft as resolveDocsSitemapConfig, Nt as renderDocsSitemapMarkdown, Pt as renderDocsSitemapXml, S as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, a as DEFAULT_AGENT_MD_ROUTE, at as resolveDocsAgentFeedbackConfig, c as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, et as renderDocsLlmsTxt, g as DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE, h as DEFAULT_LLMS_FULL_TXT_ROUTE, k as buildDocsAgentDiscoverySpec, l as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, o as DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE, rt as renderDocsSkillDocument, t as DEFAULT_AGENTS_MD_ROUTE, tt as renderDocsMarkdownDocument, v as DEFAULT_LLMS_TXT_ROUTE, vt as toDocsMarkdownUrl, x as DEFAULT_SKILL_MD_ROUTE, y as DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE } from "./agent-
|
|
2
|
-
import { S as buildDocsAgentSkillsIndex, a as DEFAULT_A2A_AGENT_CARD_ROUTE, c as DEFAULT_AGENT_SKILLS_INDEX_ROUTE,
|
|
3
|
-
import "./search-
|
|
1
|
+
import { $ as renderDocsAgentsDocument, At as buildDocsSitemapManifest, Ft as resolveDocsSitemapConfig, Nt as renderDocsSitemapMarkdown, Pt as renderDocsSitemapXml, S as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, a as DEFAULT_AGENT_MD_ROUTE, at as resolveDocsAgentFeedbackConfig, c as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, et as renderDocsLlmsTxt, g as DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE, h as DEFAULT_LLMS_FULL_TXT_ROUTE, k as buildDocsAgentDiscoverySpec, l as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, o as DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE, rt as renderDocsSkillDocument, t as DEFAULT_AGENTS_MD_ROUTE, tt as renderDocsMarkdownDocument, v as DEFAULT_LLMS_TXT_ROUTE, vt as toDocsMarkdownUrl, x as DEFAULT_SKILL_MD_ROUTE, y as DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE } from "./agent-DKKptIgy.mjs";
|
|
2
|
+
import { A as resolveDocsPublishedAgentSkill, S as buildDocsAgentSkillsIndex, a as DEFAULT_A2A_AGENT_CARD_ROUTE, c as DEFAULT_AGENT_SKILLS_INDEX_ROUTE, u as DEFAULT_AGENT_SKILLS_ROUTE_PREFIX, v as DEFAULT_LEGACY_SKILLS_INDEX_ROUTE, w as buildDocsLegacySkillsIndex, x as buildDocsA2AAgentCard, y as DEFAULT_LEGACY_SKILLS_ROUTE_PREFIX } from "./standards-discovery-jkykaXq1.mjs";
|
|
3
|
+
import "./search-B6V6qtiI.mjs";
|
|
4
4
|
import { t as resolveDocsI18n } from "./i18n-CCaFUnAN.mjs";
|
|
5
|
-
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-
|
|
6
|
-
import "./sitemap-server-
|
|
7
|
-
import "./agent-evals-
|
|
5
|
+
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-BIpC4j4P.mjs";
|
|
6
|
+
import "./sitemap-server-C_6Wes83.mjs";
|
|
7
|
+
import "./agent-evals-B7MIxuEX.mjs";
|
|
8
8
|
import { createFilesystemDocsMcpSource, resolveDocsMcpConfig } from "./mcp.mjs";
|
|
9
9
|
import "./code-blocks-DnNVNK2M.mjs";
|
|
10
|
-
import { t as resolveConfiguredAgentSkills } from "./agent-skills-server-
|
|
10
|
+
import { t as resolveConfiguredAgentSkills } from "./agent-skills-server-DraIb6FV.mjs";
|
|
11
11
|
import "./server.mjs";
|
|
12
12
|
import { _ as resolveDocsContentDir, a as loadDocsConfigModule, d as readNavTitle, g as resolveDocsConfigPath, h as readTopLevelStringProperty, l as readBooleanProperty, m as readTopLevelBooleanProperty, p as readStringProperty, r as extractTopLevelConfigObject, t as extractNestedObjectLiteral } from "./config-Wcdj-D0a.mjs";
|
|
13
13
|
import { t as detectFramework } from "./utils-DpiIioYb.mjs";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { A as DocsPublishedAgentSkill } from "./standards-discovery-C4HUqMd2.mjs";
|
|
2
|
+
import { P as DocsAgentSkillsInput } from "./types-lMBIdZg0.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/agent-skills-server.d.ts
|
|
5
|
+
interface ResolveConfiguredAgentSkillsOptions {
|
|
6
|
+
rootDir?: string;
|
|
7
|
+
workspaceRoot?: string;
|
|
8
|
+
}
|
|
9
|
+
/** Resolve and safely package all project skills configured through `agent.skills` synchronously. */
|
|
10
|
+
declare function resolveConfiguredAgentSkillsSync(input: DocsAgentSkillsInput | undefined, options?: ResolveConfiguredAgentSkillsOptions): DocsPublishedAgentSkill[];
|
|
11
|
+
/** Resolve and package configured skills without blocking runtime filesystem or compression work. */
|
|
12
|
+
declare function resolveConfiguredAgentSkills(input: DocsAgentSkillsInput | undefined, options?: ResolveConfiguredAgentSkillsOptions): Promise<DocsPublishedAgentSkill[]>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { resolveConfiguredAgentSkills as n, resolveConfiguredAgentSkillsSync as r, ResolveConfiguredAgentSkillsOptions as t };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { T as buildDocsPublishedAgentSkill, u as DEFAULT_AGENT_SKILLS_ROUTE_PREFIX } from "./standards-discovery-jkykaXq1.mjs";
|
|
2
2
|
import { existsSync, lstatSync, readFileSync, readdirSync, realpathSync, statSync } from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
|
-
import {
|
|
5
|
+
import { access, lstat, readFile, readdir, realpath, stat } from "node:fs/promises";
|
|
6
|
+
import { gzip, gzipSync } from "node:zlib";
|
|
6
7
|
|
|
7
8
|
//#region src/agent-skills-server.ts
|
|
8
9
|
const COMPANION_DIRECTORIES = new Set([
|
|
@@ -28,6 +29,24 @@ function findWorkspaceRoot(rootDir) {
|
|
|
28
29
|
current = parent;
|
|
29
30
|
}
|
|
30
31
|
}
|
|
32
|
+
async function pathExists(candidate) {
|
|
33
|
+
try {
|
|
34
|
+
await access(candidate);
|
|
35
|
+
return true;
|
|
36
|
+
} catch {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
async function findWorkspaceRootAsync(rootDir) {
|
|
41
|
+
const resolvedRoot = await realpath(rootDir);
|
|
42
|
+
let current = resolvedRoot;
|
|
43
|
+
for (;;) {
|
|
44
|
+
if (await pathExists(path.join(current, ".git")) || await pathExists(path.join(current, "pnpm-workspace.yaml")) || await pathExists(path.join(current, "pnpm-workspace.yml"))) return current;
|
|
45
|
+
const parent = path.dirname(current);
|
|
46
|
+
if (parent === current) return resolvedRoot;
|
|
47
|
+
current = parent;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
31
50
|
function normalizeConfiguredPaths(input) {
|
|
32
51
|
if (!input) return [];
|
|
33
52
|
const value = typeof input === "string" || Array.isArray(input) ? input : input.paths;
|
|
@@ -41,6 +60,14 @@ function resolveSafeConfiguredPath(configuredPath, rootDir, workspaceRoot) {
|
|
|
41
60
|
if (!isInside(workspaceRoot, resolved)) throw new Error(`Agent Skill symlink escapes the workspace: ${configuredPath}`);
|
|
42
61
|
return resolved;
|
|
43
62
|
}
|
|
63
|
+
async function resolveSafeConfiguredPathAsync(configuredPath, rootDir, workspaceRoot) {
|
|
64
|
+
const candidate = path.resolve(rootDir, configuredPath);
|
|
65
|
+
if (!await pathExists(candidate)) throw new Error(`Configured Agent Skill path does not exist: ${configuredPath}`);
|
|
66
|
+
if ((await lstat(candidate)).isSymbolicLink()) throw new Error(`Configured Agent Skill paths may not be symlinks: ${configuredPath}`);
|
|
67
|
+
const resolved = await realpath(candidate);
|
|
68
|
+
if (!isInside(workspaceRoot, resolved)) throw new Error(`Agent Skill symlink escapes the workspace: ${configuredPath}`);
|
|
69
|
+
return resolved;
|
|
70
|
+
}
|
|
44
71
|
function collectSkillDocuments(candidate, workspaceRoot, results, visited, depth = 0) {
|
|
45
72
|
if (depth > MAX_COLLECTION_DEPTH) throw new Error(`Agent Skill collection exceeds ${MAX_COLLECTION_DEPTH} directory levels.`);
|
|
46
73
|
const resolved = realpathSync(candidate);
|
|
@@ -70,6 +97,36 @@ function collectSkillDocuments(candidate, workspaceRoot, results, visited, depth
|
|
|
70
97
|
} else throw new Error(`Unsafe filesystem entry in Agent Skill collection: ${entryPath}`);
|
|
71
98
|
}
|
|
72
99
|
}
|
|
100
|
+
async function collectSkillDocumentsAsync(candidate, workspaceRoot, results, visited, depth = 0) {
|
|
101
|
+
if (depth > MAX_COLLECTION_DEPTH) throw new Error(`Agent Skill collection exceeds ${MAX_COLLECTION_DEPTH} directory levels.`);
|
|
102
|
+
const resolved = await realpath(candidate);
|
|
103
|
+
if (!isInside(workspaceRoot, resolved)) throw new Error(`Agent Skill symlink escapes the workspace: ${candidate}`);
|
|
104
|
+
if (visited.has(resolved)) return;
|
|
105
|
+
visited.add(resolved);
|
|
106
|
+
const info = await stat(resolved);
|
|
107
|
+
if (info.isFile()) {
|
|
108
|
+
if (path.basename(resolved) !== "SKILL.md") throw new Error(`Agent Skill file must be named SKILL.md: ${candidate}`);
|
|
109
|
+
results.add(resolved);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
if (!info.isDirectory()) throw new Error(`Agent Skill path must be a regular file or directory: ${candidate}`);
|
|
113
|
+
const directSkill = path.join(resolved, "SKILL.md");
|
|
114
|
+
if (await pathExists(directSkill)) {
|
|
115
|
+
const directInfo = await lstat(directSkill);
|
|
116
|
+
if (!directInfo.isFile() || directInfo.isSymbolicLink()) throw new Error(`Agent Skill SKILL.md must be a non-symlink regular file: ${directSkill}`);
|
|
117
|
+
results.add(directSkill);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
const entries = await readdir(resolved, { withFileTypes: true });
|
|
121
|
+
for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
|
|
122
|
+
if (IGNORED_COLLECTION_DIRECTORIES.has(entry.name) || entry.name.startsWith(".") || COMPANION_DIRECTORIES.has(entry.name)) continue;
|
|
123
|
+
const entryPath = path.join(resolved, entry.name);
|
|
124
|
+
if (entry.isSymbolicLink()) throw new Error(`Agent Skill collections may not contain symlinks: ${entryPath}`);
|
|
125
|
+
else if (entry.isDirectory() || entry.isFile()) {
|
|
126
|
+
if (entry.isDirectory() || entry.name === "SKILL.md") await collectSkillDocumentsAsync(entryPath, workspaceRoot, results, visited, depth + 1);
|
|
127
|
+
} else throw new Error(`Unsafe filesystem entry in Agent Skill collection: ${entryPath}`);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
73
130
|
function encodeSkillFileUrl(name, relativePath) {
|
|
74
131
|
const encodedPath = relativePath.split("/").map((segment) => encodeURIComponent(segment)).join("/");
|
|
75
132
|
return `${DEFAULT_AGENT_SKILLS_ROUTE_PREFIX}/${encodeURIComponent(name)}/${encodedPath}`;
|
|
@@ -161,6 +218,49 @@ function readCompanionFiles(skillDir, name, rootSkillBytes) {
|
|
|
161
218
|
}
|
|
162
219
|
return files;
|
|
163
220
|
}
|
|
221
|
+
async function readCompanionFilesAsync(skillDir, name, rootSkillBytes) {
|
|
222
|
+
const files = [];
|
|
223
|
+
let totalBytes = rootSkillBytes;
|
|
224
|
+
async function visit(absoluteDir, relativeDir, depth = 0) {
|
|
225
|
+
if (depth > MAX_COLLECTION_DEPTH) throw new Error(`Agent Skill companion tree exceeds ${MAX_COLLECTION_DEPTH} levels: ${skillDir}`);
|
|
226
|
+
const entries = await readdir(absoluteDir, { withFileTypes: true });
|
|
227
|
+
for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
|
|
228
|
+
const absolutePath = path.join(absoluteDir, entry.name);
|
|
229
|
+
const relativePath = path.posix.join(relativeDir, entry.name);
|
|
230
|
+
if (entry.isSymbolicLink()) throw new Error(`Agent Skill companion files may not be symlinks: ${absolutePath}`);
|
|
231
|
+
if (entry.isDirectory()) {
|
|
232
|
+
await visit(absolutePath, relativePath, depth + 1);
|
|
233
|
+
continue;
|
|
234
|
+
}
|
|
235
|
+
if (!entry.isFile()) throw new Error(`Unsafe filesystem entry in Agent Skill: ${absolutePath}`);
|
|
236
|
+
const executable = ((await stat(absolutePath)).mode & 73) !== 0;
|
|
237
|
+
const content = await readFile(absolutePath);
|
|
238
|
+
if (content.byteLength > MAX_FILE_BYTES) throw new Error(`Agent Skill file exceeds ${MAX_FILE_BYTES} bytes: ${absolutePath}`);
|
|
239
|
+
totalBytes += content.byteLength;
|
|
240
|
+
if (totalBytes > MAX_SKILL_BYTES || files.length >= MAX_FILES_PER_SKILL - 1) throw new Error(`Agent Skill exceeds safe publication limits: ${skillDir}`);
|
|
241
|
+
const mediaType = mediaTypeFor(relativePath);
|
|
242
|
+
const value = preserveFileBytes(content, mediaType);
|
|
243
|
+
const sha256 = hashBytes(value);
|
|
244
|
+
files.push({
|
|
245
|
+
path: relativePath,
|
|
246
|
+
url: encodeSkillFileUrl(name, relativePath),
|
|
247
|
+
mediaType,
|
|
248
|
+
content: value,
|
|
249
|
+
sha256,
|
|
250
|
+
digest: `sha256:${sha256}`,
|
|
251
|
+
executable
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
for (const directory of [...COMPANION_DIRECTORIES].sort()) {
|
|
256
|
+
const absoluteDir = path.join(skillDir, directory);
|
|
257
|
+
if (!await pathExists(absoluteDir)) continue;
|
|
258
|
+
const info = await lstat(absoluteDir);
|
|
259
|
+
if (info.isSymbolicLink() || !info.isDirectory()) throw new Error(`Agent Skill ${directory}/ must be a non-symlink directory: ${absoluteDir}`);
|
|
260
|
+
await visit(absoluteDir, directory);
|
|
261
|
+
}
|
|
262
|
+
return files;
|
|
263
|
+
}
|
|
164
264
|
function writeTarString(header, offset, length, value) {
|
|
165
265
|
const encoded = Buffer.from(value, "utf8");
|
|
166
266
|
if (encoded.byteLength > length) throw new Error(`Agent Skill archive path is too long: ${value}`);
|
|
@@ -184,7 +284,7 @@ function createTarHeader(name, size, executable) {
|
|
|
184
284
|
writeTarString(header, 148, 8, `${header.reduce((sum, byte) => sum + byte, 0).toString(8).padStart(6, "0")}\0 `);
|
|
185
285
|
return header;
|
|
186
286
|
}
|
|
187
|
-
function
|
|
287
|
+
function createDeterministicTar(files) {
|
|
188
288
|
const chunks = [];
|
|
189
289
|
let total = 0;
|
|
190
290
|
for (const file of [...files].sort(compareSkillFilePath)) {
|
|
@@ -206,19 +306,30 @@ function createDeterministicTarGzip(files) {
|
|
|
206
306
|
tar.set(chunk, offset);
|
|
207
307
|
offset += chunk.byteLength;
|
|
208
308
|
}
|
|
209
|
-
|
|
309
|
+
return tar;
|
|
310
|
+
}
|
|
311
|
+
function normalizeGzipArchive(content) {
|
|
312
|
+
const archive = new Uint8Array(content);
|
|
210
313
|
if (archive.byteLength > 9) archive[9] = 255;
|
|
211
314
|
return archive;
|
|
212
315
|
}
|
|
213
|
-
|
|
316
|
+
function createDeterministicTarGzip(files) {
|
|
317
|
+
return normalizeGzipArchive(gzipSync(createDeterministicTar(files), { level: 9 }));
|
|
318
|
+
}
|
|
319
|
+
function createDeterministicTarGzipAsync(files) {
|
|
320
|
+
return new Promise((resolve, reject) => {
|
|
321
|
+
gzip(createDeterministicTar(files), { level: 9 }, (error, content) => {
|
|
322
|
+
if (error) reject(error);
|
|
323
|
+
else resolve(normalizeGzipArchive(content));
|
|
324
|
+
});
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
function publishSkillDocumentSync(skillPath) {
|
|
214
328
|
const skillDir = path.dirname(skillPath);
|
|
215
329
|
const skillDocument = readFileSync(skillPath, "utf8");
|
|
216
330
|
const skillDocumentBytes = Buffer.byteLength(skillDocument, "utf8");
|
|
217
331
|
if (skillDocumentBytes > MAX_FILE_BYTES) throw new Error(`Agent Skill SKILL.md exceeds ${MAX_FILE_BYTES} bytes: ${skillPath}`);
|
|
218
|
-
const base =
|
|
219
|
-
preferredDocument: skillDocument,
|
|
220
|
-
fallbackDocument: skillDocument
|
|
221
|
-
});
|
|
332
|
+
const base = buildDocsPublishedAgentSkill(skillDocument, hashBytes(skillDocument));
|
|
222
333
|
if (base.name !== path.basename(skillDir)) throw new Error(`Agent Skill frontmatter name "${base.name}" must match its directory "${path.basename(skillDir)}".`);
|
|
223
334
|
const companions = readCompanionFiles(skillDir, base.name, skillDocumentBytes);
|
|
224
335
|
const files = [...base.files, ...companions].sort(compareSkillFilePath);
|
|
@@ -240,8 +351,43 @@ async function publishSkillDocument(skillPath) {
|
|
|
240
351
|
files
|
|
241
352
|
};
|
|
242
353
|
}
|
|
243
|
-
|
|
244
|
-
|
|
354
|
+
async function publishSkillDocumentAsync(skillPath) {
|
|
355
|
+
const skillDir = path.dirname(skillPath);
|
|
356
|
+
const skillDocument = await readFile(skillPath, "utf8");
|
|
357
|
+
const skillDocumentBytes = Buffer.byteLength(skillDocument, "utf8");
|
|
358
|
+
if (skillDocumentBytes > MAX_FILE_BYTES) throw new Error(`Agent Skill SKILL.md exceeds ${MAX_FILE_BYTES} bytes: ${skillPath}`);
|
|
359
|
+
const base = buildDocsPublishedAgentSkill(skillDocument, hashBytes(skillDocument));
|
|
360
|
+
if (base.name !== path.basename(skillDir)) throw new Error(`Agent Skill frontmatter name "${base.name}" must match its directory "${path.basename(skillDir)}".`);
|
|
361
|
+
const companions = await readCompanionFilesAsync(skillDir, base.name, skillDocumentBytes);
|
|
362
|
+
const files = [...base.files, ...companions].sort(compareSkillFilePath);
|
|
363
|
+
if (companions.length === 0) return {
|
|
364
|
+
...base,
|
|
365
|
+
files
|
|
366
|
+
};
|
|
367
|
+
const content = await createDeterministicTarGzipAsync(files);
|
|
368
|
+
const sha256 = hashBytes(content);
|
|
369
|
+
return {
|
|
370
|
+
name: base.name,
|
|
371
|
+
type: "archive",
|
|
372
|
+
description: base.description,
|
|
373
|
+
url: `${DEFAULT_AGENT_SKILLS_ROUTE_PREFIX}/${encodeURIComponent(base.name)}.tar.gz`,
|
|
374
|
+
digest: `sha256:${sha256}`,
|
|
375
|
+
content,
|
|
376
|
+
sha256,
|
|
377
|
+
skillDocument,
|
|
378
|
+
files
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
function validateAndSortSkills(published) {
|
|
382
|
+
const names = /* @__PURE__ */ new Set();
|
|
383
|
+
for (const skill of published) {
|
|
384
|
+
if (names.has(skill.name)) throw new Error(`Duplicate configured Agent Skill name: ${skill.name}`);
|
|
385
|
+
names.add(skill.name);
|
|
386
|
+
}
|
|
387
|
+
return published.sort((left, right) => left.name.localeCompare(right.name));
|
|
388
|
+
}
|
|
389
|
+
/** Resolve and safely package all project skills configured through `agent.skills` synchronously. */
|
|
390
|
+
function resolveConfiguredAgentSkillsSync(input, options = {}) {
|
|
245
391
|
const configuredPaths = normalizeConfiguredPaths(input);
|
|
246
392
|
if (configuredPaths.length === 0) return [];
|
|
247
393
|
const rootDir = realpathSync(options.rootDir ?? process.cwd());
|
|
@@ -250,14 +396,20 @@ async function resolveConfiguredAgentSkills(input, options = {}) {
|
|
|
250
396
|
const documents = /* @__PURE__ */ new Set();
|
|
251
397
|
const visited = /* @__PURE__ */ new Set();
|
|
252
398
|
for (const configuredPath of configuredPaths) collectSkillDocuments(resolveSafeConfiguredPath(configuredPath, rootDir, workspaceRoot), workspaceRoot, documents, visited);
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
399
|
+
return validateAndSortSkills([...documents].sort().map(publishSkillDocumentSync));
|
|
400
|
+
}
|
|
401
|
+
/** Resolve and package configured skills without blocking runtime filesystem or compression work. */
|
|
402
|
+
async function resolveConfiguredAgentSkills(input, options = {}) {
|
|
403
|
+
const configuredPaths = normalizeConfiguredPaths(input);
|
|
404
|
+
if (configuredPaths.length === 0) return [];
|
|
405
|
+
const rootDir = await realpath(options.rootDir ?? process.cwd());
|
|
406
|
+
const workspaceRoot = options.workspaceRoot === void 0 ? await findWorkspaceRootAsync(rootDir) : await realpath(options.workspaceRoot);
|
|
407
|
+
if (!isInside(workspaceRoot, rootDir)) throw new Error("Agent Skill rootDir must stay inside the configured workspace root.");
|
|
408
|
+
const documents = /* @__PURE__ */ new Set();
|
|
409
|
+
const visited = /* @__PURE__ */ new Set();
|
|
410
|
+
for (const configuredPath of configuredPaths) await collectSkillDocumentsAsync(await resolveSafeConfiguredPathAsync(configuredPath, rootDir, workspaceRoot), workspaceRoot, documents, visited);
|
|
411
|
+
return validateAndSortSkills(await Promise.all([...documents].sort().map(publishSkillDocumentAsync)));
|
|
260
412
|
}
|
|
261
413
|
|
|
262
414
|
//#endregion
|
|
263
|
-
export { resolveConfiguredAgentSkills as t };
|
|
415
|
+
export { resolveConfiguredAgentSkillsSync as n, resolveConfiguredAgentSkills as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A as DocsPublishedAgentSkill } from "./standards-discovery-C4HUqMd2.mjs";
|
|
2
|
-
import { P as DocsAgentSkillsInput } from "./types-
|
|
3
|
-
import { t as ResolveConfiguredAgentSkillsOptions } from "./agent-skills-server-
|
|
2
|
+
import { P as DocsAgentSkillsInput } from "./types-lMBIdZg0.mjs";
|
|
3
|
+
import { t as ResolveConfiguredAgentSkillsOptions } from "./agent-skills-server-CPja6Syt.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/agent-skills-vite.d.ts
|
|
6
6
|
declare const DOCS_AGENT_SKILLS_BUNDLE_MODULE = "@farming-labs/docs/agent-skills-bundle";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./standards-discovery-
|
|
2
|
-
import { t as resolveConfiguredAgentSkills } from "./agent-skills-server-
|
|
1
|
+
import "./standards-discovery-jkykaXq1.mjs";
|
|
2
|
+
import { t as resolveConfiguredAgentSkills } from "./agent-skills-server-DraIb6FV.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/agent-skills-vite.ts
|
|
5
5
|
const DOCS_AGENT_SKILLS_BUNDLE_MODULE = "@farming-labs/docs/agent-skills-bundle";
|
|
@@ -1,11 +1,11 @@
|
|
|
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-
|
|
2
|
-
import "./standards-discovery-
|
|
3
|
-
import "./search-
|
|
4
|
-
import { S as resolveApiReferenceConfig } from "./sitemap-server-
|
|
5
|
-
import "./agent-evals-
|
|
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-DKKptIgy.mjs";
|
|
2
|
+
import "./standards-discovery-jkykaXq1.mjs";
|
|
3
|
+
import "./search-B6V6qtiI.mjs";
|
|
4
|
+
import { S as resolveApiReferenceConfig } from "./sitemap-server-C_6Wes83.mjs";
|
|
5
|
+
import "./agent-evals-B7MIxuEX.mjs";
|
|
6
6
|
import { resolveDocsMcpConfig } from "./mcp.mjs";
|
|
7
7
|
import "./code-blocks-DnNVNK2M.mjs";
|
|
8
|
-
import "./agent-skills-server-
|
|
8
|
+
import "./agent-skills-server-DraIb6FV.mjs";
|
|
9
9
|
import "./server.mjs";
|
|
10
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
11
|
import { t as detectFramework } from "./utils-DpiIioYb.mjs";
|
package/dist/cli/index.mjs
CHANGED
|
@@ -139,10 +139,10 @@ async function main() {
|
|
|
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-B9dcsivk.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-CQTH7NFu.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-CBgWgPvH.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-CQTH7NFu.mjs").then((n) => n.t);
|
|
164
|
+
const { printAgentExportHelp } = await import("../agent-export-CBgWgPvH.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-XWZBub6f.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-XWZBub6f.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-CJqtzKZT.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-Fndl5brR.mjs");
|
|
192
192
|
const reviewOptions = parseReviewArgs(args.slice(1));
|
|
193
193
|
if (reviewOptions.help) {
|
|
194
194
|
printReviewHelp();
|
|
@@ -210,7 +210,7 @@ async function main() {
|
|
|
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-DSjCeOk7.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-Cykpe3Tz.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-Cykpe3Tz.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-CUTahhoY.mjs");
|
|
236
236
|
const robotsOptions = parseRobotsGenerateArgs(args.slice(2));
|
|
237
237
|
if (robotsOptions.help) {
|
|
238
238
|
printRobotsGenerateHelp();
|
|
@@ -242,7 +242,7 @@ 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-CUTahhoY.mjs");
|
|
246
246
|
printRobotsGenerateHelp();
|
|
247
247
|
process.exit(1);
|
|
248
248
|
} else if (parsedCommand.command === "downgrade") {
|
package/dist/client/react.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Q as DocsCloudConfig, R as DocsAnalyticsConfig, t as AIConfig } from "./types-
|
|
1
|
+
import { Q as DocsCloudConfig, R as DocsAnalyticsConfig, t as AIConfig } from "./types-lMBIdZg0.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/cloud-ask-ai.d.ts
|
|
4
4
|
interface DocsCloudAskAIConfig {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as DocsAnalyticsEventInput, R as DocsAnalyticsConfig, z as DocsAnalyticsEvent } from "./types-
|
|
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-lMBIdZg0.mjs";
|
|
2
|
+
import { n as DocsCloudAskAIResponseOptions, t as DocsCloudAskAIConfig } from "./cloud-ask-ai-zpwkdwnF.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,19 +1,19 @@
|
|
|
1
|
-
import { i as scanDocsPageTargets, n as compactAgentDocs, r as inspectAgentCompactionState } from "./agent-
|
|
2
|
-
import { l as httpLinkHeaderHasTargetRelation } from "./reading-time-
|
|
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-
|
|
4
|
-
import {
|
|
5
|
-
import { d as resolveAskAISearchRequestConfig } from "./search-
|
|
6
|
-
import { a as analyzeDocsRobotsTxt, n as DEFAULT_ROBOTS_TXT_ROUTE, u as resolveDocsRobotsConfig } from "./robots-
|
|
7
|
-
import { a as resolveDocsMetadataBaseUrl } from "./metadata-
|
|
8
|
-
import "./sitemap-server-
|
|
9
|
-
import { t as runDocsGoldenTasks } from "./agent-evals-
|
|
1
|
+
import { i as scanDocsPageTargets, n as compactAgentDocs, r as inspectAgentCompactionState } from "./agent-CQTH7NFu.mjs";
|
|
2
|
+
import { l as httpLinkHeaderHasTargetRelation } from "./reading-time-CYZ5VvKU.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-DKKptIgy.mjs";
|
|
4
|
+
import { c as DEFAULT_AGENT_SKILLS_INDEX_ROUTE, g as DEFAULT_API_CATALOG_ROUTE, h as DEFAULT_API_CATALOG_FORMAT, k as resolveDocsDiscoveryApiRoute, 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-jkykaXq1.mjs";
|
|
5
|
+
import { d as resolveAskAISearchRequestConfig } from "./search-B6V6qtiI.mjs";
|
|
6
|
+
import { a as analyzeDocsRobotsTxt, n as DEFAULT_ROBOTS_TXT_ROUTE, u as resolveDocsRobotsConfig } from "./robots-BIpC4j4P.mjs";
|
|
7
|
+
import { a as resolveDocsMetadataBaseUrl } from "./metadata-DWExHQnx.mjs";
|
|
8
|
+
import "./sitemap-server-C_6Wes83.mjs";
|
|
9
|
+
import { t as runDocsGoldenTasks } from "./agent-evals-B7MIxuEX.mjs";
|
|
10
10
|
import { createFilesystemDocsMcpSource, getDocsConfigSchema, resolveDocsMcpConfig } from "./mcp.mjs";
|
|
11
11
|
import "./code-blocks-DnNVNK2M.mjs";
|
|
12
|
-
import "./agent-skills-server-
|
|
12
|
+
import "./agent-skills-server-DraIb6FV.mjs";
|
|
13
13
|
import "./server.mjs";
|
|
14
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
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-
|
|
16
|
+
import { i as createAgentUsefulnessPagesFromMcp, n as analyzeAgentSurfaceDrift, r as analyzeAgentUsefulness, t as resolveGoldenEvaluationInput } from "./golden-evaluations-Dsvh0etV.mjs";
|
|
17
17
|
import { existsSync, lstatSync, readFileSync, readdirSync } from "node:fs";
|
|
18
18
|
import path from "node:path";
|
|
19
19
|
import { LATEST_PROTOCOL_VERSION } from "@modelcontextprotocol/sdk/types.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Jt as normalizePageAgentFrontmatter, qt as hasStructuredPageAgentContract, wt as resolveDocsAudienceMdxContent, xt as findDocsAudienceMdxTags } from "./agent-
|
|
1
|
+
import { Jt as normalizePageAgentFrontmatter, qt as hasStructuredPageAgentContract, wt as resolveDocsAudienceMdxContent, xt as findDocsAudienceMdxTags } from "./agent-DKKptIgy.mjs";
|
|
2
2
|
import { n as agentVersionConstraintsOverlap, o as normalizeAgentVersion, r as normalizeAgentFramework } from "./agent-scope-C_U--OZ7.mjs";
|
|
3
3
|
import { t as extractCodeBlocksFromMarkdown } from "./code-blocks-DnNVNK2M.mjs";
|
|
4
4
|
import { existsSync, lstatSync, readFileSync, readdirSync } from "node:fs";
|
|
@@ -1394,6 +1394,11 @@ function analyzeAgentSurfaceDrift(options) {
|
|
|
1394
1394
|
compareExpectedValue(issues, options.discovery, "search-enabled-mismatch", "search.enabled", options.expected.search.enabled, "Discovery search.enabled");
|
|
1395
1395
|
compareExpectedValue(issues, options.discovery, "search-capability-mismatch", "capabilities.search", options.expected.search.enabled, "Discovery capabilities.search");
|
|
1396
1396
|
compareExpectedValue(issues, options.discovery, "search-route-mismatch", "search.endpoint", options.expected.search.endpoint, "Discovery search.endpoint");
|
|
1397
|
+
const expectedAgentSearchEndpoint = options.expected.search.endpoint === null ? null : `${options.expected.search.endpoint}${options.expected.search.endpoint.includes("?") ? "&" : "?"}audience=agent`;
|
|
1398
|
+
compareExpectedValue(issues, options.discovery, "search-audience-mismatch", "search.agentEndpoint", expectedAgentSearchEndpoint, "Discovery search.agentEndpoint");
|
|
1399
|
+
compareExpectedValue(issues, options.discovery, "search-audience-mismatch", "search.audienceParam", "audience", "Discovery search.audienceParam");
|
|
1400
|
+
compareExpectedValue(issues, options.discovery, "search-audience-mismatch", "search.defaultAudience", "human", "Discovery search.defaultAudience");
|
|
1401
|
+
compareExpectedValue(issues, options.discovery, "search-audience-mismatch", "search.supportedAudiences", ["human", "agent"], "Discovery search.supportedAudiences");
|
|
1397
1402
|
compareExpectedValue(issues, options.discovery, "mcp-enabled-mismatch", "mcp.enabled", options.expected.mcp.enabled, "Discovery mcp.enabled");
|
|
1398
1403
|
compareExpectedValue(issues, options.discovery, "mcp-capability-mismatch", "capabilities.mcp", options.expected.mcp.enabled, "Discovery capabilities.mcp");
|
|
1399
1404
|
compareExpectedValue(issues, options.discovery, "mcp-route-mismatch", "mcp.endpoint", options.expected.mcp.endpoint, "Discovery mcp.endpoint");
|