@farming-labs/docs 0.2.57 → 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-v6R0V3lm.mjs → agent-DlxriaTs.mjs} +3 -3
- package/dist/agent-evals-kJs2Y9xR.mjs +2144 -0
- package/dist/{agent-export-CZR20g0e.mjs → agent-export-BgUaiW8f.mjs} +20 -10
- package/dist/{agents-BPonjolo.mjs → agents-Djh-HXih.mjs} +15 -7
- package/dist/cli/index.mjs +29 -29
- package/dist/client/react.d.mts +1 -1
- package/dist/{cloud-C45jpBtp.mjs → cloud-BH_sHX64.mjs} +3 -3
- package/dist/{cloud-ask-ai-CvRVnwdK.d.mts → cloud-ask-ai-B2WnG4fF.d.mts} +1 -1
- package/dist/{code-blocks-C9awWzEQ.mjs → code-blocks-qe0T8-xe.mjs} +1 -1
- package/dist/{codeblocks-CSqgqbg-.mjs → codeblocks-Bq67u32v.mjs} +2 -2
- package/dist/{dev-BA2kRuCn.mjs → dev-CAQlbguk.mjs} +2 -2
- package/dist/docs-cloud-server.d.mts +2 -2
- package/dist/docs-cloud-server.mjs +1 -1
- package/dist/{doctor-svA9Flsx.mjs → doctor-CO1VMcF_.mjs} +208 -41
- package/dist/{downgrade-BStNhyCc.mjs → downgrade-BZs86NVr.mjs} +2 -2
- package/dist/{agent-surface-drift-rGFS38Ak.mjs → golden-evaluations-BN9u2wxw.mjs} +60 -4
- package/dist/index.d.mts +98 -20
- package/dist/index.mjs +6 -5
- package/dist/{init-Dm0yDz6v.mjs → init-B_9ENq8Z.mjs} +3 -3
- package/dist/{mcp-BYIgKsPn.mjs → mcp-BAJr3wC2.mjs} +6 -6
- package/dist/mcp.d.mts +1 -1
- package/dist/mcp.mjs +149 -7
- package/dist/metadata-BDuewuzq.mjs +237 -0
- package/dist/{package-version-DRIc08EU.mjs → package-version-qik_4J6C.mjs} +1 -1
- package/dist/{reading-time-W_Id2ayC.mjs → reading-time-BkEft6SD.mjs} +307 -250
- package/dist/{review-DZ81wm7h.mjs → review-NC-sOdXn.mjs} +44 -32
- package/dist/{robots-mSc98PMp.mjs → robots-DskPvGPw.mjs} +4 -4
- package/dist/{robots-DRpoiYAV.mjs → robots-ltltiLJF.mjs} +4 -1
- package/dist/{search-9uEaC23e.d.mts → search-C1JitPwi.d.mts} +153 -6
- package/dist/{search-OHp36znm.mjs → search-D57JXQLj.mjs} +150 -39
- package/dist/{search-AMEoabYU.mjs → search-o4Ud6OXv.mjs} +6 -6
- package/dist/server.d.mts +108 -6
- package/dist/server.mjs +6 -6
- package/dist/{sitemap-Cyc0Bbbn.mjs → sitemap-Cq-Yj_iA.mjs} +7 -7
- package/dist/{sitemap-server-zFYctvCa.mjs → sitemap-server-C1ibVKOy.mjs} +2 -1
- package/dist/{types-R-DN23yw.d.mts → types-XHABMh_f.d.mts} +96 -6
- package/dist/{upgrade-CXYRNV0C.mjs → upgrade-BCJTCW3O.mjs} +2 -2
- package/package.json +1 -1
- package/dist/agent-evals-BD17jOqL.mjs +0 -1166
- /package/dist/{agent-scope-B8lptqCd.mjs → agent-scope-CCaIY1aK.mjs} +0 -0
- /package/dist/{cloud-ask-ai-1k0q6OAH.mjs → cloud-ask-ai-hnJfj8-X.mjs} +0 -0
- /package/dist/{config-DZbZiYEa.mjs → config-DASewQ0x.mjs} +0 -0
- /package/dist/{errors-BFUtdZfC.mjs → errors-CVqZ3kOO.mjs} +0 -0
- /package/dist/{templates-1Cod8KrJ.mjs → templates-CfQjpDWW.mjs} +0 -0
- /package/dist/{utils-DBCCkkJS.mjs → utils-6UCLxv4B.mjs} +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { Jt as
|
|
2
|
-
import "./search-
|
|
3
|
-
import {
|
|
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";
|
|
4
5
|
import { createFilesystemDocsMcpSource, getDocsConfigSchema, resolveDocsMcpConfig } from "./mcp.mjs";
|
|
5
|
-
import "./code-blocks-
|
|
6
|
-
import { a as loadDocsConfigModuleResultWithProjectEnv, h as resolveDocsContentDir, m as resolveDocsConfigPath, p as readTopLevelStringProperty } from "./config-
|
|
7
|
-
import { t as detectFramework } from "./utils-
|
|
8
|
-
import {
|
|
6
|
+
import "./code-blocks-qe0T8-xe.mjs";
|
|
7
|
+
import { a as loadDocsConfigModuleResultWithProjectEnv, h as resolveDocsContentDir, m as resolveDocsConfigPath, p as readTopLevelStringProperty } from "./config-DASewQ0x.mjs";
|
|
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-BN9u2wxw.mjs";
|
|
9
10
|
import matter from "gray-matter";
|
|
10
11
|
import { existsSync, lstatSync, readFileSync, readdirSync } from "node:fs";
|
|
11
12
|
import path from "node:path";
|
|
@@ -25,26 +26,6 @@ const IGNORED_DIRS = new Set([
|
|
|
25
26
|
"node_modules",
|
|
26
27
|
"out"
|
|
27
28
|
]);
|
|
28
|
-
function isPlainRecord(value) {
|
|
29
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
30
|
-
}
|
|
31
|
-
function resolveGoldenEvaluationTasks(evaluationInput) {
|
|
32
|
-
if (evaluationInput === void 0 || typeof evaluationInput === "boolean") return void 0;
|
|
33
|
-
if (!isPlainRecord(evaluationInput)) return { evaluationConfig: evaluationInput };
|
|
34
|
-
if (evaluationInput.enabled === false) return void 0;
|
|
35
|
-
if ("enabled" in evaluationInput && typeof evaluationInput.enabled !== "boolean") return evaluationInput;
|
|
36
|
-
if (!("tasks" in evaluationInput)) return void 0;
|
|
37
|
-
const runtimeTasks = evaluationInput.tasks;
|
|
38
|
-
if (!Array.isArray(runtimeTasks)) return runtimeTasks;
|
|
39
|
-
return runtimeTasks.map((task) => {
|
|
40
|
-
if (!isPlainRecord(task)) return task;
|
|
41
|
-
return {
|
|
42
|
-
...task,
|
|
43
|
-
tokenBudget: task.tokenBudget ?? evaluationInput.tokenBudget,
|
|
44
|
-
topK: task.topK ?? evaluationInput.topK
|
|
45
|
-
};
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
29
|
function parseReviewArgs(argv) {
|
|
49
30
|
const parsed = {};
|
|
50
31
|
for (let index = 0; index < argv.length; index += 1) {
|
|
@@ -182,7 +163,27 @@ async function runReview(options = {}) {
|
|
|
182
163
|
});
|
|
183
164
|
}
|
|
184
165
|
const evaluationInput = config?.agent?.evaluations;
|
|
185
|
-
const
|
|
166
|
+
const evaluation = resolveGoldenEvaluationInput(evaluationInput);
|
|
167
|
+
const evaluationBaseUrl = config ? resolveDocsMetadataBaseUrl(config) : void 0;
|
|
168
|
+
const evaluationSiteTitle = typeof config?.nav?.title === "string" ? config.nav.title : void 0;
|
|
169
|
+
const evaluationMcp = resolveDocsMcpConfig(config?.mcp, { defaultName: evaluationSiteTitle });
|
|
170
|
+
const askAISearch = resolveAskAISearchRequestConfig({
|
|
171
|
+
search: config?.search,
|
|
172
|
+
useMcp: config?.ai?.useMcp,
|
|
173
|
+
mcpEndpoint: evaluationMcp.route,
|
|
174
|
+
mcpEnabled: evaluationMcp.enabled,
|
|
175
|
+
mcpSearchEnabled: evaluationMcp.tools.searchDocs,
|
|
176
|
+
requestUrl: evaluationBaseUrl
|
|
177
|
+
});
|
|
178
|
+
const evaluations = await runDocsGoldenTasks(corpusPages, evaluation.tasks, {
|
|
179
|
+
...evaluation.options,
|
|
180
|
+
search: config?.search,
|
|
181
|
+
askAISearch,
|
|
182
|
+
siteTitle: evaluationSiteTitle,
|
|
183
|
+
baseUrl: evaluationBaseUrl,
|
|
184
|
+
rootDir,
|
|
185
|
+
codeBlocksValidate: config?.codeBlocks?.validate
|
|
186
|
+
});
|
|
186
187
|
if (relevantFiles.length > 0 && evaluations.status === "unmeasured") pushFinding(findings, review, {
|
|
187
188
|
rule: "goldenTasks",
|
|
188
189
|
code: "golden-tasks-unmeasured",
|
|
@@ -208,9 +209,11 @@ async function runReview(options = {}) {
|
|
|
208
209
|
const evaluatedConfig = configLoad.config;
|
|
209
210
|
const searchEnabled = evaluatedConfig.search !== false && !(typeof evaluatedConfig.search === "object" && evaluatedConfig.search?.enabled === false);
|
|
210
211
|
const mcp = resolveDocsMcpConfig(evaluatedConfig.mcp, { defaultName: typeof evaluatedConfig.nav?.title === "string" ? evaluatedConfig.nav.title : void 0 });
|
|
212
|
+
const apiRoute = resolveDocsDiscoveryApiRoute(evaluatedConfig.cloud?.apiRoute);
|
|
211
213
|
const discovery = buildDocsAgentDiscoverySpec({
|
|
212
214
|
origin: "http://localhost",
|
|
213
215
|
entry,
|
|
216
|
+
apiRoute,
|
|
214
217
|
search: evaluatedConfig.search,
|
|
215
218
|
mcp
|
|
216
219
|
});
|
|
@@ -224,7 +227,7 @@ async function runReview(options = {}) {
|
|
|
224
227
|
entry,
|
|
225
228
|
search: {
|
|
226
229
|
enabled: searchEnabled,
|
|
227
|
-
endpoint: `${
|
|
230
|
+
endpoint: `${apiRoute}?query={query}`
|
|
228
231
|
},
|
|
229
232
|
mcp: {
|
|
230
233
|
enabled: mcp.enabled,
|
|
@@ -232,9 +235,18 @@ async function runReview(options = {}) {
|
|
|
232
235
|
tools: mcp.tools
|
|
233
236
|
},
|
|
234
237
|
routes: {
|
|
235
|
-
"api.docs":
|
|
236
|
-
"api.config":
|
|
237
|
-
"
|
|
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}`
|
|
238
250
|
}
|
|
239
251
|
}
|
|
240
252
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
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-
|
|
3
|
-
import { d as readStringProperty, i as loadDocsConfigModule, m as resolveDocsConfigPath, p as readTopLevelStringProperty, s as readBooleanProperty, t as extractNestedObjectLiteral } from "./config-
|
|
4
|
-
import { t as detectFramework } from "./utils-
|
|
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
|
+
import { d as readStringProperty, i as loadDocsConfigModule, m as resolveDocsConfigPath, p as readTopLevelStringProperty, s as readBooleanProperty, t as extractNestedObjectLiteral } from "./config-DASewQ0x.mjs";
|
|
4
|
+
import { t as detectFramework } from "./utils-6UCLxv4B.mjs";
|
|
5
5
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import pc from "picocolors";
|
|
@@ -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 {
|
|
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,
|
|
@@ -198,6 +323,11 @@ interface DocsAskAIContextResult extends DocsSearchResult {
|
|
|
198
323
|
}
|
|
199
324
|
interface DocsAskAIContext {
|
|
200
325
|
context: string;
|
|
326
|
+
/** Structured production context blocks; avoids reparsing markdown horizontal rules. */
|
|
327
|
+
blocks: Array<{
|
|
328
|
+
text: string;
|
|
329
|
+
result: DocsAskAIContextResult;
|
|
330
|
+
}>;
|
|
201
331
|
results: DocsAskAIContextResult[];
|
|
202
332
|
searchResults: DocsSearchResult[];
|
|
203
333
|
packageHints: DocsAskAIPackageHints;
|
|
@@ -230,8 +360,22 @@ declare function performDocsSearch(options: {
|
|
|
230
360
|
audience?: DocsContentAudience;
|
|
231
361
|
locale?: string;
|
|
232
362
|
pathname?: string;
|
|
233
|
-
siteTitle?: string;
|
|
363
|
+
siteTitle?: string; /** Canonical docs URL used to distinguish same-site absolute hits from foreign MCP results. */
|
|
364
|
+
baseUrl?: string;
|
|
234
365
|
limit?: number;
|
|
366
|
+
/**
|
|
367
|
+
* Controls provider failures. Runtime search keeps the resilient `fallback` default;
|
|
368
|
+
* diagnostics can request `throw` so a broken configured provider cannot be scored as
|
|
369
|
+
* successful simple search.
|
|
370
|
+
*/
|
|
371
|
+
failureMode?: "fallback" | "throw";
|
|
372
|
+
/**
|
|
373
|
+
* Whether non-simple provider hits are supplemented with exact/local simple results.
|
|
374
|
+
* Runtime search defaults to true; provider diagnostics can disable supplementation.
|
|
375
|
+
*/
|
|
376
|
+
supplementExternalResults?: boolean; /** Fail closed on absolute provider hits when no canonical docs origin is available. */
|
|
377
|
+
strictExternalOrigins?: boolean; /** Optional cancellation signal forwarded to adapters and their managed requests. */
|
|
378
|
+
signal?: AbortSignal;
|
|
235
379
|
}): Promise<DocsSearchResult[]>;
|
|
236
380
|
declare function buildDocsAskAIContext(options: {
|
|
237
381
|
pages: DocsSearchSourcePage[];
|
|
@@ -243,8 +387,11 @@ declare function buildDocsAskAIContext(options: {
|
|
|
243
387
|
baseUrl?: string;
|
|
244
388
|
limit?: number;
|
|
245
389
|
maxContextChars?: number;
|
|
246
|
-
maxResultChars?: number;
|
|
390
|
+
maxResultChars?: number; /** See `performDocsSearch.failureMode`. Defaults to resilient runtime fallback. */
|
|
391
|
+
searchFailureMode?: "fallback" | "throw"; /** See `performDocsSearch.strictExternalOrigins`. */
|
|
392
|
+
strictExternalOrigins?: boolean; /** Optional cancellation signal forwarded to the configured search provider. */
|
|
393
|
+
signal?: AbortSignal;
|
|
247
394
|
}): Promise<DocsAskAIContext>;
|
|
248
395
|
declare function createCustomSearchAdapter(adapter: DocsSearchAdapter | DocsSearchAdapterFactory): CustomDocsSearchConfig;
|
|
249
396
|
//#endregion
|
|
250
|
-
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 };
|