@farming-labs/docs 0.2.58 → 0.2.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-CxDzPqtl.mjs → agent-BFqyqEnC.mjs} +557 -71
- package/dist/{agent-BFtIbSyJ.mjs → agent-DlxriaTs.mjs} +2 -2
- package/dist/{agent-evals-BW0vEc-F.mjs → agent-evals-kJs2Y9xR.mjs} +1 -1
- package/dist/{agent-export-vsdq0Huq.mjs → agent-export-BgUaiW8f.mjs} +17 -7
- package/dist/{agents-ChKj-VYw.mjs → agents-Djh-HXih.mjs} +12 -4
- package/dist/cli/index.mjs +14 -14
- package/dist/client/react.d.mts +1 -1
- package/dist/{cloud-ask-ai-a5Juvlvh.d.mts → cloud-ask-ai-B2WnG4fF.d.mts} +1 -1
- package/dist/docs-cloud-server.d.mts +2 -2
- package/dist/{doctor-H8gilyTg.mjs → doctor-CO1VMcF_.mjs} +181 -17
- package/dist/{golden-evaluations-BiUg5Xe_.mjs → golden-evaluations-BN9u2wxw.mjs} +1 -1
- package/dist/index.d.mts +98 -20
- package/dist/index.mjs +6 -6
- package/dist/{mcp-CiNww-Wu.mjs → mcp-BAJr3wC2.mjs} +4 -4
- package/dist/mcp.d.mts +1 -1
- package/dist/mcp.mjs +2 -2
- package/dist/{metadata-3ljRN9MM.mjs → metadata-BDuewuzq.mjs} +1 -1
- package/dist/{reading-time-EaVom2cl.mjs → reading-time-BkEft6SD.mjs} +307 -18
- package/dist/{review-BEgX7ey7.mjs → review-NC-sOdXn.mjs} +20 -9
- package/dist/{robots-CFlsfYdA.mjs → robots-DskPvGPw.mjs} +2 -2
- package/dist/{robots-DRpoiYAV.mjs → robots-ltltiLJF.mjs} +4 -1
- package/dist/{search-BblemZl4.d.mts → search-C1JitPwi.d.mts} +129 -4
- package/dist/{search-Bo9ubPVO.mjs → search-D57JXQLj.mjs} +1 -1
- package/dist/{search-CoajN9X1.mjs → search-o4Ud6OXv.mjs} +4 -4
- package/dist/server.d.mts +4 -3
- package/dist/server.mjs +4 -4
- package/dist/{sitemap-D_aXWPdJ.mjs → sitemap-Cq-Yj_iA.mjs} +4 -4
- package/dist/{sitemap-server-BYwE0zXs.mjs → sitemap-server-C1ibVKOy.mjs} +2 -1
- package/dist/{types-C1nPRXqo.d.mts → types-XHABMh_f.d.mts} +6 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as DEFAULT_MCP_WELL_KNOWN_ROUTE, c as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, f as DEFAULT_DOCS_CONFIG_ROUTE, h as DEFAULT_LLMS_FULL_TXT_ROUTE, i as DEFAULT_AGENT_FEEDBACK_ROUTE, jt as
|
|
2
|
-
import { n as DEFAULT_ROBOTS_TXT_ROUTE } from "./robots-
|
|
1
|
+
import { Gt as API_CATALOG_PROFILE_URI, Nt as DEFAULT_SITEMAP_XML_ROUTE, Qt as DEFAULT_API_CATALOG_ROUTE, S as DEFAULT_MCP_WELL_KNOWN_ROUTE, Ut as AGENT_SKILLS_DISCOVERY_SCHEMA_URI, Wt as API_CATALOG_MEDIA_TYPE, Yt as DEFAULT_AGENT_SKILLS_ROUTE_PREFIX, c as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, f as DEFAULT_DOCS_CONFIG_ROUTE, h as DEFAULT_LLMS_FULL_TXT_ROUTE, i as DEFAULT_AGENT_FEEDBACK_ROUTE, jt as DEFAULT_SITEMAP_MD_ROUTE, m as DEFAULT_DOCS_DIAGNOSTICS_ROUTE, qt as DEFAULT_AGENT_SKILLS_INDEX_ROUTE, t as DEFAULT_AGENTS_MD_ROUTE, v as DEFAULT_LLMS_TXT_ROUTE, w as DEFAULT_SKILL_MD_ROUTE } from "./agent-BFqyqEnC.mjs";
|
|
2
|
+
import { n as DEFAULT_ROBOTS_TXT_ROUTE } from "./robots-ltltiLJF.mjs";
|
|
3
3
|
import matter from "gray-matter";
|
|
4
4
|
|
|
5
5
|
//#region src/define-docs.ts
|
|
@@ -159,9 +159,89 @@ function extendTheme(baseTheme, extensions) {
|
|
|
159
159
|
return deepMerge(baseTheme, extensions);
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
+
//#endregion
|
|
163
|
+
//#region src/http-link.ts
|
|
164
|
+
/** Split an HTTP list without treating delimiters inside quotes or URI references as separators. */
|
|
165
|
+
function splitHttpList(value, delimiter) {
|
|
166
|
+
const parts = [];
|
|
167
|
+
let start = 0;
|
|
168
|
+
let quoted = false;
|
|
169
|
+
let escaped = false;
|
|
170
|
+
let angleDepth = 0;
|
|
171
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
172
|
+
const character = value[index];
|
|
173
|
+
if (escaped) {
|
|
174
|
+
escaped = false;
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
if (quoted && character === "\\") {
|
|
178
|
+
escaped = true;
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
if (character === "\"") {
|
|
182
|
+
quoted = !quoted;
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
if (!quoted && character === "<") angleDepth += 1;
|
|
186
|
+
if (!quoted && character === ">" && angleDepth > 0) angleDepth -= 1;
|
|
187
|
+
if (!quoted && angleDepth === 0 && character === delimiter) {
|
|
188
|
+
parts.push(value.slice(start, index).trim());
|
|
189
|
+
start = index + 1;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
parts.push(value.slice(start).trim());
|
|
193
|
+
return parts.filter(Boolean);
|
|
194
|
+
}
|
|
195
|
+
function unquoteHttpValue(value) {
|
|
196
|
+
const trimmed = value.trim();
|
|
197
|
+
if (!trimmed.startsWith("\"") || !trimmed.endsWith("\"")) return trimmed;
|
|
198
|
+
return trimmed.slice(1, -1).replace(/\\(.)/g, "$1");
|
|
199
|
+
}
|
|
200
|
+
/** Parse Link header values while preserving the target/relation association. */
|
|
201
|
+
function parseHttpLinkHeader(header) {
|
|
202
|
+
if (!header) return [];
|
|
203
|
+
const links = [];
|
|
204
|
+
for (const value of splitHttpList(header, ",")) {
|
|
205
|
+
const target = value.match(/^\s*<([^>]*)>/);
|
|
206
|
+
if (!target) continue;
|
|
207
|
+
const relations = [];
|
|
208
|
+
for (const rawParameter of splitHttpList(value.slice(target[0].length), ";")) {
|
|
209
|
+
const separator = rawParameter.indexOf("=");
|
|
210
|
+
if (separator < 0 || rawParameter.slice(0, separator).trim().toLowerCase() !== "rel") continue;
|
|
211
|
+
relations.push(...unquoteHttpValue(rawParameter.slice(separator + 1)).toLowerCase().split(/\s+/));
|
|
212
|
+
}
|
|
213
|
+
links.push({
|
|
214
|
+
href: target[1],
|
|
215
|
+
relations: relations.filter(Boolean)
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
return links;
|
|
219
|
+
}
|
|
220
|
+
function httpLinkMatchesExpectation(links, expectation, responseUrl) {
|
|
221
|
+
let expectedUrl;
|
|
222
|
+
try {
|
|
223
|
+
expectedUrl = new URL(expectation.href, responseUrl).toString();
|
|
224
|
+
} catch {
|
|
225
|
+
return false;
|
|
226
|
+
}
|
|
227
|
+
return links.some((link) => {
|
|
228
|
+
try {
|
|
229
|
+
return new URL(link.href, responseUrl).toString() === expectedUrl && link.relations.includes(expectation.rel.toLowerCase());
|
|
230
|
+
} catch {
|
|
231
|
+
return false;
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
function httpLinkHeaderHasTargetRelation(header, href, rel, responseUrl) {
|
|
236
|
+
return httpLinkMatchesExpectation(parseHttpLinkHeader(header), {
|
|
237
|
+
href,
|
|
238
|
+
rel
|
|
239
|
+
}, responseUrl);
|
|
240
|
+
}
|
|
241
|
+
|
|
162
242
|
//#endregion
|
|
163
243
|
//#region src/agent-conformance.ts
|
|
164
|
-
const DOCS_AGENT_CONTRACT_VERSION = "1.
|
|
244
|
+
const DOCS_AGENT_CONTRACT_VERSION = "1.1";
|
|
165
245
|
function normalizeOrigin(value) {
|
|
166
246
|
return value.replace(/\/+$/, "");
|
|
167
247
|
}
|
|
@@ -185,7 +265,118 @@ function createDocsAgentContractCases(options = {}) {
|
|
|
185
265
|
request: { url: url(DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE) },
|
|
186
266
|
expect: {
|
|
187
267
|
statuses: [200],
|
|
188
|
-
contentTypes: json
|
|
268
|
+
contentTypes: json,
|
|
269
|
+
linkRelations: [{
|
|
270
|
+
href: DEFAULT_API_CATALOG_ROUTE,
|
|
271
|
+
rel: "api-catalog"
|
|
272
|
+
}, {
|
|
273
|
+
href: DEFAULT_AGENT_SKILLS_INDEX_ROUTE,
|
|
274
|
+
rel: "service-meta"
|
|
275
|
+
}]
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
surface: "api-catalog",
|
|
280
|
+
request: { url: url(DEFAULT_API_CATALOG_ROUTE) },
|
|
281
|
+
expect: {
|
|
282
|
+
statuses: [200],
|
|
283
|
+
contentTypes: [`${API_CATALOG_MEDIA_TYPE}; profile="${API_CATALOG_PROFILE_URI}"`],
|
|
284
|
+
bodyIncludes: [
|
|
285
|
+
"linkset",
|
|
286
|
+
DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE,
|
|
287
|
+
DEFAULT_AGENT_SKILLS_INDEX_ROUTE
|
|
288
|
+
],
|
|
289
|
+
linkRelations: [{
|
|
290
|
+
href: DEFAULT_API_CATALOG_ROUTE,
|
|
291
|
+
rel: "api-catalog"
|
|
292
|
+
}]
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
surface: "api-catalog-head",
|
|
297
|
+
request: {
|
|
298
|
+
url: url(DEFAULT_API_CATALOG_ROUTE),
|
|
299
|
+
init: { method: "HEAD" }
|
|
300
|
+
},
|
|
301
|
+
expect: {
|
|
302
|
+
statuses: [200],
|
|
303
|
+
contentTypes: [`${API_CATALOG_MEDIA_TYPE}; profile="${API_CATALOG_PROFILE_URI}"`],
|
|
304
|
+
bodyEmpty: true,
|
|
305
|
+
linkRelations: [{
|
|
306
|
+
href: DEFAULT_API_CATALOG_ROUTE,
|
|
307
|
+
rel: "api-catalog"
|
|
308
|
+
}]
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
surface: "agent-skills-index",
|
|
313
|
+
request: { url: url(DEFAULT_AGENT_SKILLS_INDEX_ROUTE) },
|
|
314
|
+
expect: {
|
|
315
|
+
statuses: [200],
|
|
316
|
+
contentTypes: json,
|
|
317
|
+
bodyIncludes: [
|
|
318
|
+
"https://schemas.agentskills.io/discovery/0.2.0/schema.json",
|
|
319
|
+
`${DEFAULT_AGENT_SKILLS_ROUTE_PREFIX}/docs/SKILL.md`,
|
|
320
|
+
"sha256:"
|
|
321
|
+
],
|
|
322
|
+
linkRelations: [{
|
|
323
|
+
href: `${DEFAULT_AGENT_SKILLS_ROUTE_PREFIX}/docs/SKILL.md`,
|
|
324
|
+
rel: "item"
|
|
325
|
+
}, {
|
|
326
|
+
href: DEFAULT_API_CATALOG_ROUTE,
|
|
327
|
+
rel: "api-catalog"
|
|
328
|
+
}]
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
surface: "agent-skills-index-head",
|
|
333
|
+
request: {
|
|
334
|
+
url: url(DEFAULT_AGENT_SKILLS_INDEX_ROUTE),
|
|
335
|
+
init: { method: "HEAD" }
|
|
336
|
+
},
|
|
337
|
+
expect: {
|
|
338
|
+
statuses: [200],
|
|
339
|
+
contentTypes: json,
|
|
340
|
+
bodyEmpty: true,
|
|
341
|
+
linkRelations: [{
|
|
342
|
+
href: DEFAULT_API_CATALOG_ROUTE,
|
|
343
|
+
rel: "api-catalog"
|
|
344
|
+
}]
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
surface: "agent-skill",
|
|
349
|
+
request: { url: url(`${DEFAULT_AGENT_SKILLS_ROUTE_PREFIX}/docs/SKILL.md`) },
|
|
350
|
+
expect: {
|
|
351
|
+
statuses: [200],
|
|
352
|
+
contentTypes: markdown,
|
|
353
|
+
bodyIncludes: ["name: docs"],
|
|
354
|
+
linkRelations: [{
|
|
355
|
+
href: DEFAULT_AGENT_SKILLS_INDEX_ROUTE,
|
|
356
|
+
rel: "collection"
|
|
357
|
+
}, {
|
|
358
|
+
href: DEFAULT_API_CATALOG_ROUTE,
|
|
359
|
+
rel: "api-catalog"
|
|
360
|
+
}]
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
surface: "agent-skill-head",
|
|
365
|
+
request: {
|
|
366
|
+
url: url(`${DEFAULT_AGENT_SKILLS_ROUTE_PREFIX}/docs/SKILL.md`),
|
|
367
|
+
init: { method: "HEAD" }
|
|
368
|
+
},
|
|
369
|
+
expect: {
|
|
370
|
+
statuses: [200],
|
|
371
|
+
contentTypes: markdown,
|
|
372
|
+
bodyEmpty: true,
|
|
373
|
+
linkRelations: [{
|
|
374
|
+
href: DEFAULT_AGENT_SKILLS_INDEX_ROUTE,
|
|
375
|
+
rel: "collection"
|
|
376
|
+
}, {
|
|
377
|
+
href: DEFAULT_API_CATALOG_ROUTE,
|
|
378
|
+
rel: "api-catalog"
|
|
379
|
+
}]
|
|
189
380
|
}
|
|
190
381
|
},
|
|
191
382
|
{
|
|
@@ -340,22 +531,112 @@ function createDocsAgentContractCases(options = {}) {
|
|
|
340
531
|
}
|
|
341
532
|
}
|
|
342
533
|
];
|
|
343
|
-
if (locale)
|
|
344
|
-
surface
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
534
|
+
if (locale) {
|
|
535
|
+
const markdownMissingIndex = cases.findIndex((contractCase) => contractCase.surface === "markdown-missing");
|
|
536
|
+
cases.splice(markdownMissingIndex, 0, {
|
|
537
|
+
surface: "markdown-locale",
|
|
538
|
+
request: { url: url(`/${entry}.md?lang=${encodeURIComponent(locale)}`) },
|
|
539
|
+
expect: {
|
|
540
|
+
statuses: [200],
|
|
541
|
+
contentTypes: markdown,
|
|
542
|
+
bodyIncludes: ["Bonjour"]
|
|
543
|
+
}
|
|
544
|
+
});
|
|
545
|
+
}
|
|
352
546
|
return cases;
|
|
353
547
|
}
|
|
548
|
+
function parseParameterizedValue(value) {
|
|
549
|
+
const [rawValue, ...rawParameters] = splitHttpList(value, ";");
|
|
550
|
+
const normalizedValue = rawValue?.trim().toLowerCase();
|
|
551
|
+
if (!normalizedValue) return null;
|
|
552
|
+
const parameters = /* @__PURE__ */ new Map();
|
|
553
|
+
for (const rawParameter of rawParameters) {
|
|
554
|
+
const separator = rawParameter.indexOf("=");
|
|
555
|
+
if (separator < 0) continue;
|
|
556
|
+
const name = rawParameter.slice(0, separator).trim().toLowerCase();
|
|
557
|
+
if (!name) continue;
|
|
558
|
+
parameters.set(name, unquoteHttpValue(rawParameter.slice(separator + 1)));
|
|
559
|
+
}
|
|
560
|
+
return {
|
|
561
|
+
value: normalizedValue,
|
|
562
|
+
parameters
|
|
563
|
+
};
|
|
564
|
+
}
|
|
354
565
|
function matchesContentType(actual, expected) {
|
|
355
|
-
const
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
566
|
+
const parsedActual = parseParameterizedValue(actual);
|
|
567
|
+
if (!parsedActual) return false;
|
|
568
|
+
return expected.some((value) => {
|
|
569
|
+
const parsedExpected = parseParameterizedValue(value);
|
|
570
|
+
if (!parsedExpected || parsedExpected.value !== parsedActual.value) return false;
|
|
571
|
+
return [...parsedExpected.parameters].every(([name, expectedValue]) => parsedActual.parameters.get(name) === expectedValue);
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
function asRecord(value) {
|
|
575
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
576
|
+
}
|
|
577
|
+
function isNonEmptyString(value) {
|
|
578
|
+
return typeof value === "string" && value.trim().length > 0;
|
|
579
|
+
}
|
|
580
|
+
async function sha256Utf8(content) {
|
|
581
|
+
const digest = await globalThis.crypto.subtle.digest("SHA-256", new TextEncoder().encode(content));
|
|
582
|
+
return [...new Uint8Array(digest)].map((value) => value.toString(16).padStart(2, "0")).join("");
|
|
583
|
+
}
|
|
584
|
+
async function validateAgentSkillsIndex(content, indexUrl, handle) {
|
|
585
|
+
const issues = [];
|
|
586
|
+
let parsed;
|
|
587
|
+
try {
|
|
588
|
+
parsed = JSON.parse(content);
|
|
589
|
+
} catch {
|
|
590
|
+
return ["Agent Skills index did not contain valid JSON"];
|
|
591
|
+
}
|
|
592
|
+
const root = asRecord(parsed);
|
|
593
|
+
if (root?.$schema !== AGENT_SKILLS_DISCOVERY_SCHEMA_URI) issues.push(`Agent Skills index did not declare ${AGENT_SKILLS_DISCOVERY_SCHEMA_URI}`);
|
|
594
|
+
if (!Array.isArray(root?.skills) || root.skills.length === 0) {
|
|
595
|
+
issues.push("Agent Skills index did not declare any skills");
|
|
596
|
+
return issues;
|
|
597
|
+
}
|
|
598
|
+
const seenNames = /* @__PURE__ */ new Set();
|
|
599
|
+
const origin = new URL(indexUrl).origin;
|
|
600
|
+
for (const rawSkill of root.skills) {
|
|
601
|
+
const skill = asRecord(rawSkill);
|
|
602
|
+
const name = skill?.name;
|
|
603
|
+
const description = skill?.description;
|
|
604
|
+
const artifactRoute = skill?.url;
|
|
605
|
+
const digest = skill?.digest;
|
|
606
|
+
if (!isNonEmptyString(name) || !/^[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(name) || name.length > 64 || skill?.type !== "skill-md" || !isNonEmptyString(description) || description.length > 1024 || !isNonEmptyString(artifactRoute) || typeof digest !== "string" || !/^sha256:[0-9a-f]{64}$/u.test(digest)) {
|
|
607
|
+
issues.push("Agent Skills index contained an invalid skill entry");
|
|
608
|
+
continue;
|
|
609
|
+
}
|
|
610
|
+
if (seenNames.has(name)) {
|
|
611
|
+
issues.push(`Agent Skills index declared duplicate skill ${JSON.stringify(name)}`);
|
|
612
|
+
continue;
|
|
613
|
+
}
|
|
614
|
+
seenNames.add(name);
|
|
615
|
+
let artifactUrl;
|
|
616
|
+
try {
|
|
617
|
+
artifactUrl = new URL(artifactRoute, indexUrl);
|
|
618
|
+
} catch {
|
|
619
|
+
issues.push(`Agent Skills artifact URL for ${JSON.stringify(name)} was invalid`);
|
|
620
|
+
continue;
|
|
621
|
+
}
|
|
622
|
+
const expectedPath = `${DEFAULT_AGENT_SKILLS_ROUTE_PREFIX}/${name}/SKILL.md`;
|
|
623
|
+
if (artifactUrl.origin !== origin || !artifactUrl.pathname.endsWith(expectedPath)) {
|
|
624
|
+
issues.push(`Agent Skills artifact URL for ${JSON.stringify(name)} did not resolve to same-origin ${expectedPath}`);
|
|
625
|
+
continue;
|
|
626
|
+
}
|
|
627
|
+
try {
|
|
628
|
+
const response = await handle(new Request(artifactUrl), "agent-skill");
|
|
629
|
+
const artifact = await response.text();
|
|
630
|
+
if (response.status !== 200) issues.push(`Agent Skills artifact ${JSON.stringify(artifactRoute)} returned status ${response.status}`);
|
|
631
|
+
const contentType = response.headers.get("content-type") ?? "";
|
|
632
|
+
if (!matchesContentType(contentType, ["text/markdown"])) issues.push(`Agent Skills artifact ${JSON.stringify(artifactRoute)} returned content-type ${contentType || "<missing>"}`);
|
|
633
|
+
const actualDigest = `sha256:${await sha256Utf8(artifact)}`;
|
|
634
|
+
if (actualDigest !== digest) issues.push(`Agent Skills artifact ${JSON.stringify(artifactRoute)} digest ${actualDigest} did not match ${digest}`);
|
|
635
|
+
} catch (error) {
|
|
636
|
+
issues.push(`Agent Skills artifact ${JSON.stringify(artifactRoute)} failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
return issues;
|
|
359
640
|
}
|
|
360
641
|
async function runDocsAgentConformance(options) {
|
|
361
642
|
const cases = createDocsAgentContractCases(options);
|
|
@@ -369,6 +650,14 @@ async function runDocsAgentConformance(options) {
|
|
|
369
650
|
if (!contractCase.expect.statuses.includes(response.status)) issues.push(`expected status ${contractCase.expect.statuses.join(" or ")}, received ${response.status}`);
|
|
370
651
|
if (!matchesContentType(contentType, contractCase.expect.contentTypes)) issues.push(`expected content-type ${contractCase.expect.contentTypes.join(" or ")}, received ${contentType || "<missing>"}`);
|
|
371
652
|
for (const requiredText of contractCase.expect.bodyIncludes ?? []) if (!body.toLowerCase().includes(requiredText.toLowerCase())) issues.push(`response body did not include ${JSON.stringify(requiredText)}`);
|
|
653
|
+
if (contractCase.expect.bodyEmpty && body !== "") issues.push(`expected an empty response body, received ${body.length} characters`);
|
|
654
|
+
if (contractCase.surface === "agent-skills-index") issues.push(...await validateAgentSkillsIndex(body, contractCase.request.url, options.handle));
|
|
655
|
+
for (const [header, requiredValues] of Object.entries(contractCase.expect.headerIncludes ?? {})) {
|
|
656
|
+
const actual = response.headers.get(header) ?? "";
|
|
657
|
+
for (const requiredValue of requiredValues) if (!actual.toLowerCase().includes(requiredValue.toLowerCase())) issues.push(`response header ${JSON.stringify(header)} did not include ${JSON.stringify(requiredValue)}`);
|
|
658
|
+
}
|
|
659
|
+
const parsedLinks = parseHttpLinkHeader(response.headers.get("link"));
|
|
660
|
+
for (const expectation of contractCase.expect.linkRelations ?? []) if (!httpLinkMatchesExpectation(parsedLinks, expectation, contractCase.request.url)) issues.push(`response Link header did not include ${JSON.stringify(expectation.href)} with rel=${JSON.stringify(expectation.rel)} in the same link-value`);
|
|
372
661
|
results.push({
|
|
373
662
|
surface: contractCase.surface,
|
|
374
663
|
passed: issues.length === 0,
|
|
@@ -449,4 +738,4 @@ function resolveReadingTimeFromSource(source, wordsPerMinute, options) {
|
|
|
449
738
|
}
|
|
450
739
|
|
|
451
740
|
//#endregion
|
|
452
|
-
export { resolveReadingTimeOptions as a, runDocsAgentConformance as c,
|
|
741
|
+
export { resolveReadingTimeOptions as a, runDocsAgentConformance as c, extendTheme as d, deepMerge as f, resolveReadingTimeFromSource as i, httpLinkHeaderHasTargetRelation as l, defineDocs as m, resolvePageReadingTime as n, DOCS_AGENT_CONTRACT_VERSION as o, resolveChangelogConfig as p, resolveReadingTimeFromContent as r, createDocsAgentContractCases as s, estimateReadingTimeMinutes as t, createTheme as u };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Jt as
|
|
2
|
-
import { d as resolveAskAISearchRequestConfig } from "./search-
|
|
3
|
-
import { a as resolveDocsMetadataBaseUrl } from "./metadata-
|
|
4
|
-
import { c as resolveDocsReviewConfig, o as ensureDocsReviewWorkflow, s as readDocsReviewConfigFromSource, t as runDocsGoldenTasks } from "./agent-evals-
|
|
1
|
+
import { Jt as DEFAULT_AGENT_SKILLS_ROUTE_PATTERN, Kt as DEFAULT_AGENT_SKILLS_INDEX_FORMAT, M as buildDocsAgentDiscoverySpec, O as DOCS_CONFIG_MAP_TOP_LEVEL_KEYS, P as buildDocsConfigMap, Qt as DEFAULT_API_CATALOG_ROUTE, Xt as DEFAULT_AGENT_SKILL_FORMAT, Zt as DEFAULT_API_CATALOG_FORMAT, _n as hasStructuredPageAgentContract, an as resolveDocsDiscoveryApiRoute, fn as PAGE_AGENT_CONTRACT_FIELDS, gn as getPageAgentFrontmatterIssues, qt as DEFAULT_AGENT_SKILLS_INDEX_ROUTE, vn as normalizePageAgentFrontmatter, wt as findDocsAudienceMdxIssues } from "./agent-BFqyqEnC.mjs";
|
|
2
|
+
import { d as resolveAskAISearchRequestConfig } from "./search-D57JXQLj.mjs";
|
|
3
|
+
import { a as resolveDocsMetadataBaseUrl } from "./metadata-BDuewuzq.mjs";
|
|
4
|
+
import { c as resolveDocsReviewConfig, o as ensureDocsReviewWorkflow, s as readDocsReviewConfigFromSource, t as runDocsGoldenTasks } from "./agent-evals-kJs2Y9xR.mjs";
|
|
5
5
|
import { createFilesystemDocsMcpSource, getDocsConfigSchema, resolveDocsMcpConfig } from "./mcp.mjs";
|
|
6
6
|
import "./code-blocks-qe0T8-xe.mjs";
|
|
7
7
|
import { a as loadDocsConfigModuleResultWithProjectEnv, h as resolveDocsContentDir, m as resolveDocsConfigPath, p as readTopLevelStringProperty } from "./config-DASewQ0x.mjs";
|
|
8
8
|
import { t as detectFramework } from "./utils-6UCLxv4B.mjs";
|
|
9
|
-
import { a as extractAgentBlocks, i as createAgentUsefulnessPagesFromMcp, n as analyzeAgentSurfaceDrift, r as analyzeAgentUsefulness, t as resolveGoldenEvaluationInput } from "./golden-evaluations-
|
|
9
|
+
import { a as extractAgentBlocks, i as createAgentUsefulnessPagesFromMcp, n as analyzeAgentSurfaceDrift, r as analyzeAgentUsefulness, t as resolveGoldenEvaluationInput } from "./golden-evaluations-BN9u2wxw.mjs";
|
|
10
10
|
import matter from "gray-matter";
|
|
11
11
|
import { existsSync, lstatSync, readFileSync, readdirSync } from "node:fs";
|
|
12
12
|
import path from "node:path";
|
|
@@ -209,9 +209,11 @@ async function runReview(options = {}) {
|
|
|
209
209
|
const evaluatedConfig = configLoad.config;
|
|
210
210
|
const searchEnabled = evaluatedConfig.search !== false && !(typeof evaluatedConfig.search === "object" && evaluatedConfig.search?.enabled === false);
|
|
211
211
|
const mcp = resolveDocsMcpConfig(evaluatedConfig.mcp, { defaultName: typeof evaluatedConfig.nav?.title === "string" ? evaluatedConfig.nav.title : void 0 });
|
|
212
|
+
const apiRoute = resolveDocsDiscoveryApiRoute(evaluatedConfig.cloud?.apiRoute);
|
|
212
213
|
const discovery = buildDocsAgentDiscoverySpec({
|
|
213
214
|
origin: "http://localhost",
|
|
214
215
|
entry,
|
|
216
|
+
apiRoute,
|
|
215
217
|
search: evaluatedConfig.search,
|
|
216
218
|
mcp
|
|
217
219
|
});
|
|
@@ -225,7 +227,7 @@ async function runReview(options = {}) {
|
|
|
225
227
|
entry,
|
|
226
228
|
search: {
|
|
227
229
|
enabled: searchEnabled,
|
|
228
|
-
endpoint: `${
|
|
230
|
+
endpoint: `${apiRoute}?query={query}`
|
|
229
231
|
},
|
|
230
232
|
mcp: {
|
|
231
233
|
enabled: mcp.enabled,
|
|
@@ -233,9 +235,18 @@ async function runReview(options = {}) {
|
|
|
233
235
|
tools: mcp.tools
|
|
234
236
|
},
|
|
235
237
|
routes: {
|
|
236
|
-
"api.docs":
|
|
237
|
-
"api.config":
|
|
238
|
-
"
|
|
238
|
+
"api.docs": apiRoute,
|
|
239
|
+
"api.config": `${apiRoute}?format=config`,
|
|
240
|
+
"api.apiCatalog": DEFAULT_API_CATALOG_ROUTE,
|
|
241
|
+
"api.apiCatalogQuery": `${apiRoute}?format=${DEFAULT_API_CATALOG_FORMAT}`,
|
|
242
|
+
"api.agentSkillsIndex": DEFAULT_AGENT_SKILLS_INDEX_ROUTE,
|
|
243
|
+
"apiCatalog.route": DEFAULT_API_CATALOG_ROUTE,
|
|
244
|
+
"apiCatalog.api": `${apiRoute}?format=${DEFAULT_API_CATALOG_FORMAT}`,
|
|
245
|
+
"config.endpoint": `${apiRoute}?format=config`,
|
|
246
|
+
"skills.discovery.index": DEFAULT_AGENT_SKILLS_INDEX_ROUTE,
|
|
247
|
+
"skills.discovery.artifact": DEFAULT_AGENT_SKILLS_ROUTE_PATTERN,
|
|
248
|
+
"skills.discovery.apiIndex": `${apiRoute}?format=${DEFAULT_AGENT_SKILLS_INDEX_FORMAT}`,
|
|
249
|
+
"skills.discovery.apiArtifact": `${apiRoute}?format=${DEFAULT_AGENT_SKILL_FORMAT}&name={name}`
|
|
239
250
|
}
|
|
240
251
|
}
|
|
241
252
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./agent-
|
|
2
|
-
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-
|
|
1
|
+
import "./agent-BFqyqEnC.mjs";
|
|
2
|
+
import { c as renderDocsRobotsGeneratedBlock, f as upsertDocsRobotsGeneratedBlock, i as DOCS_ROBOTS_GENERATED_BLOCK_START, r as DOCS_ROBOTS_GENERATED_BLOCK_END, u as resolveDocsRobotsConfig } from "./robots-ltltiLJF.mjs";
|
|
3
3
|
import { d as readStringProperty, i as loadDocsConfigModule, m as resolveDocsConfigPath, p as readTopLevelStringProperty, s as readBooleanProperty, t as extractNestedObjectLiteral } from "./config-DASewQ0x.mjs";
|
|
4
4
|
import { t as detectFramework } from "./utils-6UCLxv4B.mjs";
|
|
5
5
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Qt as DEFAULT_API_CATALOG_ROUTE, S as DEFAULT_MCP_WELL_KNOWN_ROUTE, T as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, Yt as DEFAULT_AGENT_SKILLS_ROUTE_PREFIX, a as DEFAULT_AGENT_MD_ROUTE, b as DEFAULT_MCP_PUBLIC_ROUTE, c as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, et as normalizeDocsPathSegment, g as DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE, h as DEFAULT_LLMS_FULL_TXT_ROUTE, l as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, o as DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE, qt as DEFAULT_AGENT_SKILLS_INDEX_ROUTE, t as DEFAULT_AGENTS_MD_ROUTE, v as DEFAULT_LLMS_TXT_ROUTE, w as DEFAULT_SKILL_MD_ROUTE, y as DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE, zt as resolveDocsSitemapConfig } from "./agent-BFqyqEnC.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/robots.ts
|
|
4
4
|
const DEFAULT_ROBOTS_TXT_ROUTE = "/robots.txt";
|
|
@@ -79,6 +79,9 @@ function getDocsRobotsAllowRoutes(options = {}) {
|
|
|
79
79
|
DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE,
|
|
80
80
|
DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE,
|
|
81
81
|
DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE,
|
|
82
|
+
...options.apiCatalog === false ? [] : [DEFAULT_API_CATALOG_ROUTE],
|
|
83
|
+
DEFAULT_AGENT_SKILLS_INDEX_ROUTE,
|
|
84
|
+
`${DEFAULT_AGENT_SKILLS_ROUTE_PREFIX}/*/SKILL.md`,
|
|
82
85
|
DEFAULT_MCP_PUBLIC_ROUTE,
|
|
83
86
|
DEFAULT_MCP_WELL_KNOWN_ROUTE
|
|
84
87
|
];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { An as ResolvedDocsRelatedLink, Bn as TypesenseDocsSearchConfig, Bt as DocsSearchDocument, Ct as DocsObservabilityConfig, F as DocsAnalyticsConfig, Ft as DocsSearchAdapter, Gt as DocsSearchSourcePage, I as DocsAnalyticsEvent, Kt as DocsSitemapConfig, L as DocsAnalyticsEventInput, Lt as DocsSearchAdapterFactory, M as DocsAgentTraceEventInput, Rt as DocsSearchChunkingConfig, Tt as DocsObservabilityEventInput, Ut as DocsSearchResult, f as CustomDocsSearchConfig, fn as OpenDocsProvider, hn as OpenDocsTarget, ln as McpDocsSearchConfig, q as DocsAskAIMcpConfig, r as AlgoliaDocsSearchConfig, wt as DocsObservabilityEvent, zt as DocsSearchConfig } from "./types-
|
|
1
|
+
import { An as ResolvedDocsRelatedLink, Bn as TypesenseDocsSearchConfig, Bt as DocsSearchDocument, Ct as DocsObservabilityConfig, F as DocsAnalyticsConfig, Ft as DocsSearchAdapter, Gt as DocsSearchSourcePage, I as DocsAnalyticsEvent, Kt as DocsSitemapConfig, L as DocsAnalyticsEventInput, Lt as DocsSearchAdapterFactory, M as DocsAgentTraceEventInput, Rt as DocsSearchChunkingConfig, Tt as DocsObservabilityEventInput, Ut as DocsSearchResult, f as CustomDocsSearchConfig, fn as OpenDocsProvider, hn as OpenDocsTarget, ln as McpDocsSearchConfig, q as DocsAskAIMcpConfig, r as AlgoliaDocsSearchConfig, wt as DocsObservabilityEvent, zt as DocsSearchConfig } from "./types-XHABMh_f.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/analytics.d.ts
|
|
4
4
|
declare const DOCS_AGENT_TRACE_EVENT_TYPES: readonly ["run.start", "run.end", "run.error", "user.input", "prompt.build", "retrieval.query", "retrieval.result", "retrieval.error", "model.call", "model.response", "model.stream", "model.error", "tool.call", "tool.result", "tool.error", "retry", "timeout", "error", "agent.final"];
|
|
@@ -29,6 +29,130 @@ declare function emitDocsAnalyticsEvent(analytics: boolean | DocsAnalyticsConfig
|
|
|
29
29
|
declare function emitDocsObservabilityEvent(observability: boolean | DocsObservabilityConfig | undefined, event: DocsObservabilityEventInput): Promise<void>;
|
|
30
30
|
declare function emitDocsAgentTraceEvent(observability: boolean | DocsObservabilityConfig | undefined, event: DocsAgentTraceEventInput): Promise<void>;
|
|
31
31
|
//#endregion
|
|
32
|
+
//#region src/standards-discovery.d.ts
|
|
33
|
+
declare const DEFAULT_API_CATALOG_ROUTE = "/.well-known/api-catalog";
|
|
34
|
+
declare const DEFAULT_API_CATALOG_FORMAT = "api-catalog";
|
|
35
|
+
declare const API_CATALOG_PROFILE_URI = "https://www.rfc-editor.org/info/rfc9727";
|
|
36
|
+
declare const API_CATALOG_MEDIA_TYPE = "application/linkset+json";
|
|
37
|
+
declare const DEFAULT_AGENT_SKILLS_INDEX_ROUTE = "/.well-known/agent-skills/index.json";
|
|
38
|
+
declare const DEFAULT_AGENT_SKILLS_ROUTE_PREFIX = "/.well-known/agent-skills";
|
|
39
|
+
declare const DEFAULT_AGENT_SKILLS_ROUTE_PATTERN = "/.well-known/agent-skills/{name}/SKILL.md";
|
|
40
|
+
declare const DEFAULT_AGENT_SKILLS_INDEX_FORMAT = "agent-skills";
|
|
41
|
+
declare const DEFAULT_AGENT_SKILL_FORMAT = "agent-skill";
|
|
42
|
+
declare const AGENT_SKILLS_DISCOVERY_SCHEMA_URI = "https://schemas.agentskills.io/discovery/0.2.0/schema.json";
|
|
43
|
+
interface DocsAgentSkillIndexEntry {
|
|
44
|
+
name: string;
|
|
45
|
+
type: "skill-md";
|
|
46
|
+
description: string;
|
|
47
|
+
url: string;
|
|
48
|
+
digest: `sha256:${string}`;
|
|
49
|
+
}
|
|
50
|
+
interface DocsAgentSkillsIndex {
|
|
51
|
+
$schema: typeof AGENT_SKILLS_DISCOVERY_SCHEMA_URI;
|
|
52
|
+
skills: DocsAgentSkillIndexEntry[];
|
|
53
|
+
}
|
|
54
|
+
interface DocsPublishedAgentSkill extends DocsAgentSkillIndexEntry {
|
|
55
|
+
content: string;
|
|
56
|
+
sha256: string;
|
|
57
|
+
}
|
|
58
|
+
interface DocsPublishedAgentSkillOptions {
|
|
59
|
+
preferredDocument?: string | null;
|
|
60
|
+
fallbackDocument: string;
|
|
61
|
+
}
|
|
62
|
+
interface DocsApiCatalogLinkTarget {
|
|
63
|
+
href: string;
|
|
64
|
+
type?: string;
|
|
65
|
+
title?: string;
|
|
66
|
+
}
|
|
67
|
+
interface DocsApiCatalogLinkContext {
|
|
68
|
+
anchor: string;
|
|
69
|
+
item?: DocsApiCatalogLinkTarget[];
|
|
70
|
+
"api-catalog"?: DocsApiCatalogLinkTarget[];
|
|
71
|
+
"service-desc"?: DocsApiCatalogLinkTarget[];
|
|
72
|
+
"service-doc"?: DocsApiCatalogLinkTarget[];
|
|
73
|
+
"service-meta"?: DocsApiCatalogLinkTarget[];
|
|
74
|
+
}
|
|
75
|
+
interface DocsApiCatalog {
|
|
76
|
+
linkset: DocsApiCatalogLinkContext[];
|
|
77
|
+
}
|
|
78
|
+
interface DocsApiCatalogOptions {
|
|
79
|
+
origin: string;
|
|
80
|
+
docsRoute?: string;
|
|
81
|
+
apiRoute?: string | null;
|
|
82
|
+
/** Additional HTTP API endpoints to list as RFC 9727 `item` links. */
|
|
83
|
+
apiRoutes?: readonly {
|
|
84
|
+
route: string;
|
|
85
|
+
type?: string;
|
|
86
|
+
title?: string;
|
|
87
|
+
}[];
|
|
88
|
+
configRoute?: string | null;
|
|
89
|
+
diagnosticsRoute?: string | null;
|
|
90
|
+
agentManifestRoute?: string | null;
|
|
91
|
+
agentSkillsIndexRoute?: string | null;
|
|
92
|
+
agentsRoute?: string | null;
|
|
93
|
+
skillRoute?: string | null;
|
|
94
|
+
markdownRootRoute?: string | null;
|
|
95
|
+
llmsRoutes?: readonly string[];
|
|
96
|
+
sitemapRoutes?: readonly string[];
|
|
97
|
+
robotsRoute?: string | null;
|
|
98
|
+
mcpRoute?: string | null;
|
|
99
|
+
feedbackRoutes?: readonly string[];
|
|
100
|
+
openapiRoute?: string | null;
|
|
101
|
+
apiReferenceRoute?: string | null;
|
|
102
|
+
}
|
|
103
|
+
type DocsStandardsDiscoveryRequest = {
|
|
104
|
+
kind: "api-catalog";
|
|
105
|
+
} | {
|
|
106
|
+
kind: "agent-skills-index";
|
|
107
|
+
} | {
|
|
108
|
+
kind: "agent-skill";
|
|
109
|
+
name: string;
|
|
110
|
+
};
|
|
111
|
+
interface DocsDiscoveryApiRouteOptions {
|
|
112
|
+
/** Same-origin Docs API pathname used by query-form discovery. @default "/api/docs" */
|
|
113
|
+
apiRoute?: string;
|
|
114
|
+
}
|
|
115
|
+
interface DocsStandardsDiscoveryRouteOptions extends DocsDiscoveryApiRouteOptions {}
|
|
116
|
+
interface CreateDocsStandardsResponseOptions {
|
|
117
|
+
request: Request;
|
|
118
|
+
apiCatalog?: DocsApiCatalog;
|
|
119
|
+
/** Whether the RFC 9727 catalog is exposed. Defaults to true. */
|
|
120
|
+
apiCatalogEnabled?: boolean;
|
|
121
|
+
/** Internal docs API route used for query-form forwarding. */
|
|
122
|
+
apiRoute?: string;
|
|
123
|
+
preferredSkillDocument?: string | null;
|
|
124
|
+
fallbackSkillDocument: string;
|
|
125
|
+
}
|
|
126
|
+
/** Resolve the same-origin Docs API pathname used by query-form discovery routes. */
|
|
127
|
+
declare function resolveDocsDiscoveryApiRoute(apiRoute?: string): string;
|
|
128
|
+
/** Build an RFC 9727 API Catalog using the RFC 9264 JSON Linkset representation. */
|
|
129
|
+
declare function buildDocsApiCatalog(options: DocsApiCatalogOptions): DocsApiCatalog;
|
|
130
|
+
declare function sha256DocsDiscoveryContent(content: string): Promise<string>;
|
|
131
|
+
/** Select a valid public skill and hash the exact bytes returned by its standards route. */
|
|
132
|
+
declare function resolveDocsPublishedAgentSkill({
|
|
133
|
+
preferredDocument,
|
|
134
|
+
fallbackDocument
|
|
135
|
+
}: DocsPublishedAgentSkillOptions): Promise<DocsPublishedAgentSkill>;
|
|
136
|
+
declare function buildDocsAgentSkillsIndex(skills: DocsPublishedAgentSkill | readonly DocsPublishedAgentSkill[]): DocsAgentSkillsIndex;
|
|
137
|
+
declare function resolveDocsStandardsDiscoveryRequest(url: URL, options?: DocsStandardsDiscoveryRouteOptions): DocsStandardsDiscoveryRequest | null;
|
|
138
|
+
declare function isDocsStandardsDiscoveryRequest(url: URL, options?: DocsStandardsDiscoveryRouteOptions): boolean;
|
|
139
|
+
/** Cross-link the standards endpoints without replacing an existing canonical Link value. */
|
|
140
|
+
declare function getDocsDiscoveryLinkHeader(options?: {
|
|
141
|
+
includeApiCatalog?: boolean;
|
|
142
|
+
includeManifest?: boolean;
|
|
143
|
+
includeSkills?: boolean;
|
|
144
|
+
}): string;
|
|
145
|
+
declare function appendDocsDiscoveryLinkHeader(headers: Headers, value?: string): Headers;
|
|
146
|
+
/** Return one RFC 9727 or Agent Skills discovery response, or null for unrelated requests. */
|
|
147
|
+
declare function createDocsStandardsResponse({
|
|
148
|
+
request,
|
|
149
|
+
apiCatalog,
|
|
150
|
+
apiCatalogEnabled,
|
|
151
|
+
apiRoute,
|
|
152
|
+
preferredSkillDocument,
|
|
153
|
+
fallbackSkillDocument
|
|
154
|
+
}: CreateDocsStandardsResponseOptions): Promise<Response | null>;
|
|
155
|
+
//#endregion
|
|
32
156
|
//#region src/audience.d.ts
|
|
33
157
|
/** The two content projections emitted by the docs framework. */
|
|
34
158
|
type DocsContentAudience = "human" | "agent";
|
|
@@ -144,7 +268,7 @@ interface DocsSitemapResolvedConfig {
|
|
|
144
268
|
wellKnownRoute: string;
|
|
145
269
|
};
|
|
146
270
|
}
|
|
147
|
-
interface CreateDocsSitemapResponseOptions {
|
|
271
|
+
interface CreateDocsSitemapResponseOptions extends DocsDiscoveryApiRouteOptions {
|
|
148
272
|
request: Request;
|
|
149
273
|
sitemap?: boolean | DocsSitemapConfig;
|
|
150
274
|
entry?: string;
|
|
@@ -156,7 +280,7 @@ interface CreateDocsSitemapResponseOptions {
|
|
|
156
280
|
declare function resolveDocsSitemapConfig(sitemap?: boolean | DocsSitemapConfig, defaults?: {
|
|
157
281
|
baseUrl?: string;
|
|
158
282
|
}): DocsSitemapResolvedConfig;
|
|
159
|
-
declare function resolveDocsSitemapRequest(url: URL, sitemap?: boolean | DocsSitemapConfig): DocsSitemapFormat | null;
|
|
283
|
+
declare function resolveDocsSitemapRequest(url: URL, sitemap?: boolean | DocsSitemapConfig, options?: DocsDiscoveryApiRouteOptions): DocsSitemapFormat | null;
|
|
160
284
|
declare function toDocsSitemapMarkdownUrl(url: string): string;
|
|
161
285
|
declare function buildDocsSitemapManifest(options: {
|
|
162
286
|
pages: DocsSitemapPageInput[];
|
|
@@ -183,6 +307,7 @@ declare function readDocsSitemapManifestFromContentMap(contentMap?: Record<strin
|
|
|
183
307
|
declare function resolveDocsSitemapPageLastmod(manifest: DocsSitemapManifest | null | undefined, url: string): string | undefined;
|
|
184
308
|
declare function createDocsSitemapResponse({
|
|
185
309
|
request,
|
|
310
|
+
apiRoute,
|
|
186
311
|
sitemap,
|
|
187
312
|
entry,
|
|
188
313
|
siteTitle,
|
|
@@ -269,4 +394,4 @@ declare function buildDocsAskAIContext(options: {
|
|
|
269
394
|
}): Promise<DocsAskAIContext>;
|
|
270
395
|
declare function createCustomSearchAdapter(adapter: DocsSearchAdapter | DocsSearchAdapterFactory): CustomDocsSearchConfig;
|
|
271
396
|
//#endregion
|
|
272
|
-
export { resolveDocsAudienceMdxContent as $, resolveDocsSitemapRequest as A, normalizePromptProviderName as B, buildDocsSitemapManifest as C, renderDocsSitemapXml as D, renderDocsSitemapMarkdown as E, DEFAULT_PROMPT_PROVIDER_TEMPLATES as F, serializeDocsIconRegistry as G, resolvePromptProviderChoices as H, PromptAction as I, DocsAudienceMdxIssue as J, serializeOpenDocsProvider as K, PromptProviderChoice as L, DEFAULT_OPEN_DOCS_PROMPT as M, DEFAULT_OPEN_DOCS_PROVIDER_IDS as N, resolveDocsSitemapConfig as O, DEFAULT_OPEN_DOCS_TARGET as P, resolveDocsAudienceExposure as Q, SerializeOpenDocsProviderOptions as R, DocsSitemapResolvedConfig as S, readDocsSitemapManifestFromContentMap as T, sanitizePromptText as U, parsePromptStringArray as V, serializeDocsIcon as W, findDocsAudienceMdxIssues as X, DocsContentAudience as Y, resolveDocsAgentMdxContent as Z, DEFAULT_SITEMAP_XML_ROUTE as _, createMcpSearchAdapter as a,
|
|
397
|
+
export { resolveDocsAudienceMdxContent as $, resolveDocsSitemapRequest as A, resolveDocsStandardsDiscoveryRequest as At, normalizePromptProviderName as B, emitDocsObservabilityEvent as Bt, buildDocsSitemapManifest as C, buildDocsAgentSkillsIndex as Ct, renderDocsSitemapXml as D, isDocsStandardsDiscoveryRequest as Dt, renderDocsSitemapMarkdown as E, getDocsDiscoveryLinkHeader as Et, DEFAULT_PROMPT_PROVIDER_TEMPLATES as F, ResolvedDocsObservabilityConfig as Ft, serializeDocsIconRegistry as G, resolvePromptProviderChoices as H, resolveDocsAnalyticsConfig as Ht, PromptAction as I, createDocsAgentTraceContext as It, DocsAudienceMdxIssue as J, serializeOpenDocsProvider as K, PromptProviderChoice as L, createDocsAgentTraceId as Lt, DEFAULT_OPEN_DOCS_PROMPT as M, DOCS_AGENT_TRACE_EVENT_TYPES as Mt, DEFAULT_OPEN_DOCS_PROVIDER_IDS as N, DocsAgentTraceContext as Nt, resolveDocsSitemapConfig as O, resolveDocsDiscoveryApiRoute as Ot, DEFAULT_OPEN_DOCS_TARGET as P, ResolvedDocsAnalyticsConfig as Pt, resolveDocsAudienceExposure as Q, SerializeOpenDocsProviderOptions as R, emitDocsAgentTraceEvent as Rt, DocsSitemapResolvedConfig as S, appendDocsDiscoveryLinkHeader as St, readDocsSitemapManifestFromContentMap as T, createDocsStandardsResponse as Tt, sanitizePromptText as U, resolveDocsObservabilityConfig as Ut, parsePromptStringArray as V, getDocsRequestAnalyticsProperties as Vt, serializeDocsIcon as W, findDocsAudienceMdxIssues as X, DocsContentAudience as Y, resolveDocsAgentMdxContent as Z, DEFAULT_SITEMAP_XML_ROUTE as _, DocsDiscoveryApiRouteOptions as _t, createMcpSearchAdapter as a, DEFAULT_AGENT_SKILLS_INDEX_ROUTE as at, DocsSitemapManifestPage as b, DocsStandardsDiscoveryRequest as bt, formatDocsAskAIPackageHints as c, DEFAULT_AGENT_SKILL_FORMAT as ct, resolveAskAISearchRequestConfig as d, DocsAgentSkillIndexEntry as dt, AGENT_SKILLS_DISCOVERY_SCHEMA_URI as et, resolveSearchRequestConfig as f, DocsAgentSkillsIndex as ft, DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE as g, DocsApiCatalogOptions as gt, DEFAULT_SITEMAP_MD_ROUTE as h, DocsApiCatalogLinkTarget as ht, createCustomSearchAdapter as i, DEFAULT_AGENT_SKILLS_INDEX_FORMAT as it, toDocsSitemapMarkdownUrl as j, sha256DocsDiscoveryContent as jt, resolveDocsSitemapPageLastmod as k, resolveDocsPublishedAgentSkill as kt, inferDocsAskAIPackageHints as l, DEFAULT_API_CATALOG_FORMAT as lt, DEFAULT_SITEMAP_MD_DOCS_ROUTE as m, DocsApiCatalogLinkContext as mt, buildDocsSearchDocuments as n, API_CATALOG_PROFILE_URI as nt, createSimpleSearchAdapter as o, DEFAULT_AGENT_SKILLS_ROUTE_PATTERN as ot, DEFAULT_SITEMAP_MANIFEST_PATH as p, DocsApiCatalog as pt, serializeOpenDocsProviders as q, createAlgoliaSearchAdapter as r, CreateDocsStandardsResponseOptions as rt, createTypesenseSearchAdapter as s, DEFAULT_AGENT_SKILLS_ROUTE_PREFIX as st, buildDocsAskAIContext as t, API_CATALOG_MEDIA_TYPE as tt, performDocsSearch as u, DEFAULT_API_CATALOG_ROUTE as ut, DocsSitemapFormat as v, DocsPublishedAgentSkill as vt, createDocsSitemapResponse as w, buildDocsApiCatalog as wt, DocsSitemapPageInput as x, DocsStandardsDiscoveryRouteOptions as xt, DocsSitemapManifest as y, DocsPublishedAgentSkillOptions as yt, SerializedOpenDocsProvider as z, emitDocsAnalyticsEvent as zt };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { G as
|
|
1
|
+
import { G as isDocsAgentDiscoveryRequest, K as isDocsAgentsRequest, Q as isDocsSkillRequest, Sn as upsertPageAgentContractMarkdown, _t as resolveDocsMarkdownRequest, bt as resolveDocsSkillFormat, dn as PAGE_AGENT_CONTRACT_END_MARKER, dt as resolveDocsAgentsFormat, lt as resolveDocsAgentFeedbackConfig, mn as PAGE_AGENT_CONTRACT_START_MARKER, pt as resolveDocsLlmsTxtRequest, ut as resolveDocsAgentFeedbackRequest, yn as renderPageAgentContractMarkdown } from "./agent-BFqyqEnC.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/telemetry.ts
|
|
4
4
|
const DOCS_PACKAGE_NAME = "@farming-labs/docs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./agent-
|
|
2
|
-
import { n as buildDocsSearchDocuments, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter } from "./search-
|
|
3
|
-
import "./sitemap-server-
|
|
4
|
-
import "./agent-evals-
|
|
1
|
+
import "./agent-BFqyqEnC.mjs";
|
|
2
|
+
import { n as buildDocsSearchDocuments, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter } from "./search-D57JXQLj.mjs";
|
|
3
|
+
import "./sitemap-server-C1ibVKOy.mjs";
|
|
4
|
+
import "./agent-evals-kJs2Y9xR.mjs";
|
|
5
5
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
6
6
|
import "./code-blocks-qe0T8-xe.mjs";
|
|
7
7
|
import "./server.mjs";
|