@farming-labs/docs 0.2.103 → 0.2.105
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-BLHMoVId.mjs → agent-CaCWThBY.mjs} +4 -4
- package/dist/{agent-CFqECAG0.mjs → agent-DCTGj6J7.mjs} +212 -19
- package/dist/{agent-evals-GpcaCbRb.mjs → agent-evals-D-sPJfXz.mjs} +5 -5
- package/dist/{agent-export-oiWxB5aX.mjs → agent-export-GcTZPLfB.mjs} +30 -17
- package/dist/agent-feedback-evaluations-DQCTFegz.mjs +240 -0
- package/dist/agent-feedback-loop-vaC-M1sx.mjs +196 -0
- package/dist/agent-maintenance-CuZ7iAKq.mjs +289 -0
- package/dist/agent-skills-bundle.d.mts +1 -1
- package/dist/{agent-skills-progressive-disclosure-Da9LKEKv.mjs → agent-skills-progressive-disclosure-DL-q4JZo.mjs} +1 -1
- package/dist/{agent-skills-server-CICMh0zv.d.mts → agent-skills-server-D34054x5.d.mts} +2 -2
- package/dist/{agent-skills-server-DFqQyO_V.mjs → agent-skills-server-Ddbf15pY.mjs} +1 -1
- package/dist/agent-skills-vite.d.mts +3 -3
- package/dist/agent-skills-vite.mjs +2 -2
- package/dist/{agents-CtqIUW5I.mjs → agents-e1SYT64z.mjs} +11 -10
- package/dist/{analytics-Bx44lg6d.mjs → analytics-CqfcIBdg.mjs} +1 -1
- package/dist/{analytics-C75BnTEW.d.mts → analytics-aeXwEvQX.d.mts} +1 -1
- package/dist/authoring-Do87QzBd.mjs +41 -0
- package/dist/authoring-mcp-Be7quE5R.mjs +380 -0
- package/dist/browser.d.mts +3 -3
- package/dist/browser.mjs +2 -2
- package/dist/cli/index.mjs +103 -35
- package/dist/client/react.d.mts +1 -1
- package/dist/client/react.mjs +1 -1
- package/dist/{cloud-FNfcbfli.mjs → cloud-Bvof6mET.mjs} +3 -3
- package/dist/{cloud-ask-ai-BmbZVAT5.d.mts → cloud-ask-ai-BqfiQaNZ.d.mts} +1 -1
- package/dist/{cloud-ask-ai-CkCYjf2N.mjs → cloud-ask-ai-CK2qlNns.mjs} +1 -1
- package/dist/{code-blocks-Bel6vDqI.mjs → code-blocks-D90CCJFs.mjs} +1 -1
- package/dist/{codeblocks-jbWuvtJQ.mjs → codeblocks-C911CdyJ.mjs} +2 -2
- package/dist/{agent-lWTq6pgr.d.mts → content-change-hydration-CoYRs3pC.d.mts} +707 -675
- package/dist/{dev-BvbYmTLz.mjs → dev-Bx0JNglW.mjs} +3 -3
- package/dist/docs-cloud-server.d.mts +2 -2
- package/dist/docs-cloud-server.mjs +2 -2
- package/dist/{doctor-Bmm0uY98.mjs → doctor-CtK1CRPj.mjs} +20 -16
- package/dist/{downgrade-Dqm0rJMy.mjs → downgrade-BXmQMkMy.mjs} +2 -2
- package/dist/feedback-DWVUMrxy.mjs +72 -0
- package/dist/feedback-evals-k0sFDdms.mjs +146 -0
- package/dist/{golden-evaluations-K45fcWGW.mjs → golden-evaluations-De4KwoYr.mjs} +3 -3
- package/dist/index.d.mts +236 -9
- package/dist/index.mjs +14 -11
- package/dist/{init-jDQSo-Or.mjs → init-CCV2eRNB.mjs} +3 -3
- package/dist/markdown-rendering.mjs +1 -1
- package/dist/{markdown-sections-7OoA7ylx.mjs → markdown-sections-BKy4labo.mjs} +110 -2
- package/dist/{mcp-CwgKlbIz.mjs → mcp-DsjWxF7g.mjs} +11 -10
- package/dist/mcp.d.mts +20 -5
- package/dist/mcp.mjs +538 -56
- package/dist/{metadata-D4v_R1t5.mjs → metadata-7htr-Xj_.mjs} +1 -1
- package/dist/{content-change-hydration-BsbBXAUi.mjs → openapi-mcp-DQ3xptKo.mjs} +182 -4
- package/dist/openapi-mcp-node-vO3IXVGI.mjs +43 -0
- package/dist/{package-version--oQiHwZj.mjs → package-version-Ci99L0yo.mjs} +1 -1
- package/dist/{prompt-references-DW5vG5zs.mjs → prompt-references-1Wce71c7.mjs} +3 -3
- package/dist/propose-DJOiHu9Y.mjs +73 -0
- package/dist/retrieval-digest-B-SgtXKK.mjs +177 -0
- package/dist/retrieval-digest-DyNRD-mt.d.mts +467 -0
- package/dist/{review-C_5wB0rR.mjs → review-XI9FXeos.mjs} +12 -12
- package/dist/{robots-NQesPX5L.mjs → robots-BOjWB1ky.mjs} +2 -2
- package/dist/{robots-BQ42Y84a.mjs → robots-CzKesbdX.mjs} +6 -6
- package/dist/{search-B5etKU-v.mjs → search-DwAoC9X7.mjs} +12 -11
- package/dist/server.d.mts +47 -264
- package/dist/server.mjs +14 -11
- package/dist/{sidebar-CwZlgyAz.d.mts → sidebar-CJze8SBi.d.mts} +1 -1
- package/dist/{sitemap-DjhxvQP1.mjs → sitemap-DOaJIKJf.mjs} +11 -10
- package/dist/{sitemap-server-B0SiREN0.mjs → sitemap-server-NeVu8W38.mjs} +11 -1
- package/dist/{skills-BFang8vF.mjs → skills-BILSESek.mjs} +11 -10
- package/dist/{standards-discovery-Ckx0tN7B.mjs → standards-discovery-Bpz90VYq.mjs} +2 -177
- package/dist/{standards-discovery-D1Ys4J3h.d.mts → standards-discovery-Xm84bS4M.d.mts} +1 -1
- package/dist/{types-DLLefoU5.d.mts → types-QhYMnKvb.d.mts} +148 -2
- package/dist/{upgrade-kj2crJSk.mjs → upgrade-B92U83xo.mjs} +2 -2
- package/package.json +1 -1
- package/dist/retrieval-digest-DYEsIeCE.d.mts +0 -164
- /package/dist/{audience-exposure-Cw3SA4WE.d.mts → audience-exposure-CkNZNeVX.d.mts} +0 -0
- /package/dist/{cloud-analytics-CSyFE6SS.mjs → cloud-analytics-Ci1yiwD8.mjs} +0 -0
- /package/dist/{config-BaTmjDqD.mjs → config-DrZ3fXgf.mjs} +0 -0
- /package/dist/{errors-DZiNXv5c.mjs → errors-BDmra6mz.mjs} +0 -0
- /package/dist/{i18n-B3BIxShC.mjs → i18n-B1gJ9EW0.mjs} +0 -0
- /package/dist/{sidebar-IcpElOVH.mjs → sidebar-3W51s2sF.mjs} +0 -0
- /package/dist/{templates-kc7jxspR.mjs → templates-DdB4BBGq.mjs} +0 -0
- /package/dist/{utils-DOMeZW9V.mjs → utils-Cc1SrVza.mjs} +0 -0
|
@@ -3,6 +3,61 @@ import { slug } from "github-slugger";
|
|
|
3
3
|
import { parseEntities } from "parse-entities";
|
|
4
4
|
import remarkGfm from "remark-gfm";
|
|
5
5
|
|
|
6
|
+
//#region src/access.ts
|
|
7
|
+
function isRecord$1(value) {
|
|
8
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
9
|
+
}
|
|
10
|
+
function normalizeStrings(value) {
|
|
11
|
+
if (!Array.isArray(value)) return void 0;
|
|
12
|
+
const strings = Array.from(new Set(value.flatMap((item) => typeof item === "string" && item.trim() ? [item.trim()] : [])));
|
|
13
|
+
return strings.length > 0 ? strings : void 0;
|
|
14
|
+
}
|
|
15
|
+
function normalizeClaimValue(value) {
|
|
16
|
+
if (typeof value === "string") return value.trim() || void 0;
|
|
17
|
+
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
18
|
+
if (typeof value === "boolean") return value;
|
|
19
|
+
return normalizeStrings(value);
|
|
20
|
+
}
|
|
21
|
+
function normalizeDocsPageAccessPolicy(value) {
|
|
22
|
+
if (!isRecord$1(value)) return void 0;
|
|
23
|
+
const visibility = value.visibility === "public" || value.visibility === "authenticated" ? value.visibility : void 0;
|
|
24
|
+
const scopes = normalizeStrings(value.scopes);
|
|
25
|
+
const rawClaims = isRecord$1(value.claims) ? value.claims : void 0;
|
|
26
|
+
const claims = rawClaims ? Object.fromEntries(Object.entries(rawClaims).flatMap(([name, rawValue]) => {
|
|
27
|
+
const normalizedName = name.trim();
|
|
28
|
+
const normalizedValue = normalizeClaimValue(rawValue);
|
|
29
|
+
return normalizedName && normalizedValue !== void 0 ? [[normalizedName, normalizedValue]] : [];
|
|
30
|
+
})) : void 0;
|
|
31
|
+
const normalizedClaims = claims && Object.keys(claims).length > 0 ? claims : void 0;
|
|
32
|
+
if (!visibility && !scopes && !normalizedClaims) return void 0;
|
|
33
|
+
return {
|
|
34
|
+
...visibility ? { visibility } : {},
|
|
35
|
+
...scopes ? { scopes } : {},
|
|
36
|
+
...normalizedClaims ? { claims: normalizedClaims } : {}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function claimMatches(expected, actual) {
|
|
40
|
+
const expectedValues = Array.isArray(expected) ? expected : [expected];
|
|
41
|
+
const actualValues = Array.isArray(actual) ? actual : [actual];
|
|
42
|
+
return expectedValues.some((expectedValue) => actualValues.some((actualValue) => actualValue === expectedValue));
|
|
43
|
+
}
|
|
44
|
+
function isDocsPageAccessAllowed(policy, principal) {
|
|
45
|
+
if (!policy) return true;
|
|
46
|
+
if (!(policy.visibility !== "public" || Boolean(policy.scopes?.length) || Boolean(policy.claims && Object.keys(policy.claims).length > 0))) return true;
|
|
47
|
+
if (!principal) return false;
|
|
48
|
+
const scopes = new Set(principal.scopes ?? []);
|
|
49
|
+
if (policy.scopes?.some((scope) => !scopes.has(scope))) return false;
|
|
50
|
+
for (const [name, expected] of Object.entries(policy.claims ?? {})) if (!claimMatches(expected, principal.claims?.[name])) return false;
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
function isDocsAgentPageAccessible(page, principal) {
|
|
54
|
+
return isDocsPageAccessAllowed(page.agent?.access, principal);
|
|
55
|
+
}
|
|
56
|
+
function filterDocsPagesByAccess(pages, principal) {
|
|
57
|
+
return pages.filter((page) => isDocsAgentPageAccessible(page, principal));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
//#endregion
|
|
6
61
|
//#region src/agent-contract.ts
|
|
7
62
|
const PAGE_AGENT_STRUCTURED_CONTRACT_FIELDS = [
|
|
8
63
|
"task",
|
|
@@ -16,9 +71,14 @@ const PAGE_AGENT_STRUCTURED_CONTRACT_FIELDS = [
|
|
|
16
71
|
"rollback",
|
|
17
72
|
"failureModes"
|
|
18
73
|
];
|
|
19
|
-
const PAGE_AGENT_CONTRACT_FIELDS = [
|
|
74
|
+
const PAGE_AGENT_CONTRACT_FIELDS = [
|
|
75
|
+
"tokenBudget",
|
|
76
|
+
"access",
|
|
77
|
+
...PAGE_AGENT_STRUCTURED_CONTRACT_FIELDS
|
|
78
|
+
];
|
|
20
79
|
const PAGE_AGENT_CONTRACT_FIELD_SCHEMA = {
|
|
21
80
|
tokenBudget: "number",
|
|
81
|
+
access: "{visibility?,scopes?,claims?}",
|
|
22
82
|
task: "string",
|
|
23
83
|
outcome: "string",
|
|
24
84
|
appliesTo: {
|
|
@@ -50,6 +110,11 @@ const VERIFICATION_FIELDS = [
|
|
|
50
110
|
"expect"
|
|
51
111
|
];
|
|
52
112
|
const FAILURE_MODE_FIELDS = ["symptom", "resolution"];
|
|
113
|
+
const ACCESS_FIELDS = [
|
|
114
|
+
"visibility",
|
|
115
|
+
"scopes",
|
|
116
|
+
"claims"
|
|
117
|
+
];
|
|
53
118
|
const PAGE_AGENT_CONTRACT_START_MARKER = "<!-- farming-labs:agent-contract:start -->";
|
|
54
119
|
const PAGE_AGENT_CONTRACT_END_MARKER = "<!-- farming-labs:agent-contract:end -->";
|
|
55
120
|
function isRecord(value) {
|
|
@@ -163,6 +228,7 @@ function normalizeTokenBudget(value) {
|
|
|
163
228
|
function normalizePageAgentFrontmatter(value) {
|
|
164
229
|
if (!isRecord(value)) return void 0;
|
|
165
230
|
const tokenBudget = normalizeTokenBudget(value.tokenBudget);
|
|
231
|
+
const access = "access" in value ? normalizeDocsPageAccessPolicy(value.access) ?? { visibility: "authenticated" } : void 0;
|
|
166
232
|
const task = normalizeString(value.task);
|
|
167
233
|
const outcome = normalizeString(value.outcome);
|
|
168
234
|
const appliesTo = normalizeAppliesTo(value.appliesTo);
|
|
@@ -175,6 +241,7 @@ function normalizePageAgentFrontmatter(value) {
|
|
|
175
241
|
const failureModes = normalizeFailureModes(value.failureModes);
|
|
176
242
|
const normalized = {
|
|
177
243
|
...tokenBudget !== void 0 ? { tokenBudget } : {},
|
|
244
|
+
...access ? { access } : {},
|
|
178
245
|
...task ? { task } : {},
|
|
179
246
|
...outcome ? { outcome } : {},
|
|
180
247
|
...appliesTo ? { appliesTo } : {},
|
|
@@ -258,6 +325,35 @@ function getPageAgentFrontmatterIssues(value) {
|
|
|
258
325
|
path: "agent.tokenBudget",
|
|
259
326
|
message: "must be a positive finite number"
|
|
260
327
|
});
|
|
328
|
+
if ("access" in value) if (!isRecord(value.access)) issues.push({
|
|
329
|
+
path: "agent.access",
|
|
330
|
+
message: "must be an object"
|
|
331
|
+
});
|
|
332
|
+
else {
|
|
333
|
+
addUnknownKeyIssues(issues, value.access, ACCESS_FIELDS, "agent.access");
|
|
334
|
+
if ("visibility" in value.access && value.access.visibility !== "public" && value.access.visibility !== "authenticated") issues.push({
|
|
335
|
+
path: "agent.access.visibility",
|
|
336
|
+
message: "must be \"public\" or \"authenticated\""
|
|
337
|
+
});
|
|
338
|
+
if ("scopes" in value.access && !normalizeStringList(value.access.scopes)) issues.push({
|
|
339
|
+
path: "agent.access.scopes",
|
|
340
|
+
message: "must be a non-empty string array"
|
|
341
|
+
});
|
|
342
|
+
if ("claims" in value.access) {
|
|
343
|
+
if (!isRecord(value.access.claims) || Object.keys(value.access.claims).length === 0) issues.push({
|
|
344
|
+
path: "agent.access.claims",
|
|
345
|
+
message: "must be a non-empty object"
|
|
346
|
+
});
|
|
347
|
+
else for (const [name, claim] of Object.entries(value.access.claims)) if (!name.trim() || normalizeDocsPageAccessPolicy({ claims: { [name]: claim } }) === void 0) issues.push({
|
|
348
|
+
path: `agent.access.claims.${name || "<empty>"}`,
|
|
349
|
+
message: "must be a string, number, boolean, or non-empty string array"
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
if (!normalizeDocsPageAccessPolicy(value.access)) issues.push({
|
|
353
|
+
path: "agent.access",
|
|
354
|
+
message: "must include a valid visibility, scope, or claim"
|
|
355
|
+
});
|
|
356
|
+
}
|
|
261
357
|
addStringIssue(issues, value, "task");
|
|
262
358
|
addStringIssue(issues, value, "outcome");
|
|
263
359
|
if ("appliesTo" in value) if (!isRecord(value.appliesTo)) issues.push({
|
|
@@ -415,6 +511,18 @@ function renderPageAgentFrontmatterYamlLines(value, indentation = 0) {
|
|
|
415
511
|
const child = `${indent} `;
|
|
416
512
|
const lines = [`${indent}agent:`];
|
|
417
513
|
if (agent.tokenBudget !== void 0) lines.push(`${child}tokenBudget: ${agent.tokenBudget}`);
|
|
514
|
+
if (agent.access) {
|
|
515
|
+
lines.push(`${child}access:`);
|
|
516
|
+
const accessIndent = `${child} `;
|
|
517
|
+
if (agent.access.visibility) lines.push(`${accessIndent}visibility: ${agent.access.visibility}`);
|
|
518
|
+
if (agent.access.scopes) renderYamlStringList(lines, accessIndent, "scopes", [...agent.access.scopes]);
|
|
519
|
+
if (agent.access.claims) {
|
|
520
|
+
lines.push(`${accessIndent}claims:`);
|
|
521
|
+
const claimsIndent = `${accessIndent} `;
|
|
522
|
+
for (const [name, claim] of Object.entries(agent.access.claims).sort(([left], [right]) => left.localeCompare(right))) if (Array.isArray(claim)) renderYamlStringList(lines, claimsIndent, yamlString(name), [...claim]);
|
|
523
|
+
else lines.push(`${claimsIndent}${yamlString(name)}: ${typeof claim === "string" ? yamlString(claim) : claim}`);
|
|
524
|
+
}
|
|
525
|
+
}
|
|
418
526
|
if (agent.task) lines.push(`${child}task: ${yamlString(agent.task)}`);
|
|
419
527
|
if (agent.outcome) lines.push(`${child}outcome: ${yamlString(agent.outcome)}`);
|
|
420
528
|
if (agent.appliesTo) {
|
|
@@ -1489,4 +1597,4 @@ function findDocsMarkdownSection(markdown, requestedSection) {
|
|
|
1489
1597
|
}
|
|
1490
1598
|
|
|
1491
1599
|
//#endregion
|
|
1492
|
-
export { upsertPageAgentContractMarkdown as S, hasStructuredPageAgentContract as _, findDocsGeneratedAgentContractRanges as a, renderPageAgentFrontmatterYamlLines as b, slugifyDocsMarkdownHeading as c, PAGE_AGENT_CONTRACT_END_MARKER as d, PAGE_AGENT_CONTRACT_FIELDS as f, getPageAgentFrontmatterIssues as g, PAGE_AGENT_STRUCTURED_CONTRACT_FIELDS as h, createDocsRenderedHeadingAnchorResolver as i, stripDocsGeneratedAgentContractMarkers as l, PAGE_AGENT_CONTRACT_START_MARKER as m, cleanDocsRenderedHeadingLabel as n, findDocsMarkdownSection as o, PAGE_AGENT_CONTRACT_FIELD_SCHEMA as p, createDocsMarkdownHeadingAnchorResolver as r, parseDocsMarkdownSections as s, applyDocsMarkdownHeadingAnchors as t, withDocsMarkdownRenderableHeadings as u, normalizePageAgentFrontmatter as v, stripGeneratedPageAgentContractMarkdown as x, renderPageAgentContractMarkdown as y };
|
|
1600
|
+
export { filterDocsPagesByAccess as C, normalizeDocsPageAccessPolicy as E, upsertPageAgentContractMarkdown as S, isDocsPageAccessAllowed as T, hasStructuredPageAgentContract as _, findDocsGeneratedAgentContractRanges as a, renderPageAgentFrontmatterYamlLines as b, slugifyDocsMarkdownHeading as c, PAGE_AGENT_CONTRACT_END_MARKER as d, PAGE_AGENT_CONTRACT_FIELDS as f, getPageAgentFrontmatterIssues as g, PAGE_AGENT_STRUCTURED_CONTRACT_FIELDS as h, createDocsRenderedHeadingAnchorResolver as i, stripDocsGeneratedAgentContractMarkers as l, PAGE_AGENT_CONTRACT_START_MARKER as m, cleanDocsRenderedHeadingLabel as n, findDocsMarkdownSection as o, PAGE_AGENT_CONTRACT_FIELD_SCHEMA as p, createDocsMarkdownHeadingAnchorResolver as r, parseDocsMarkdownSections as s, applyDocsMarkdownHeadingAnchors as t, withDocsMarkdownRenderableHeadings as u, normalizePageAgentFrontmatter as v, isDocsAgentPageAccessible as w, stripGeneratedPageAgentContractMarkdown as x, renderPageAgentContractMarkdown as y };
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import { L as resolveDocsPublishedAgentSkill } from "./standards-discovery-
|
|
4
|
-
import "./
|
|
5
|
-
import { a as resolveDocsMetadataBaseUrl } from "./metadata-
|
|
6
|
-
import "./sitemap-server-
|
|
7
|
-
import { r as resolveConfiguredAgentSkills } from "./agent-skills-server-
|
|
8
|
-
import "./agent-evals-
|
|
1
|
+
import "./markdown-sections-BKy4labo.mjs";
|
|
2
|
+
import "./agent-DCTGj6J7.mjs";
|
|
3
|
+
import { L as resolveDocsPublishedAgentSkill } from "./standards-discovery-Bpz90VYq.mjs";
|
|
4
|
+
import "./openapi-mcp-DQ3xptKo.mjs";
|
|
5
|
+
import { a as resolveDocsMetadataBaseUrl } from "./metadata-7htr-Xj_.mjs";
|
|
6
|
+
import "./sitemap-server-NeVu8W38.mjs";
|
|
7
|
+
import { r as resolveConfiguredAgentSkills } from "./agent-skills-server-Ddbf15pY.mjs";
|
|
8
|
+
import "./agent-evals-D-sPJfXz.mjs";
|
|
9
9
|
import { createFilesystemDocsMcpSource, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
10
|
-
import "./
|
|
10
|
+
import "./authoring-mcp-Be7quE5R.mjs";
|
|
11
|
+
import "./code-blocks-D90CCJFs.mjs";
|
|
11
12
|
import "./server.mjs";
|
|
12
|
-
import { _ as resolveDocsContentDir, d as readNavTitle, g as resolveDocsConfigPath, i as hasTopLevelProperty, l as readBooleanProperty, n as extractObjectLiteral, o as loadDocsConfigModuleResult, p as readStringProperty, t as extractNestedObjectLiteral } from "./config-
|
|
13
|
+
import { _ as resolveDocsContentDir, d as readNavTitle, g as resolveDocsConfigPath, i as hasTopLevelProperty, l as readBooleanProperty, n as extractObjectLiteral, o as loadDocsConfigModuleResult, p as readStringProperty, t as extractNestedObjectLiteral } from "./config-DrZ3fXgf.mjs";
|
|
13
14
|
import { existsSync, readFileSync } from "node:fs";
|
|
14
15
|
import path from "node:path";
|
|
15
16
|
import pc from "picocolors";
|
package/dist/mcp.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { z as DocsPublishedAgentSkill } from "./standards-discovery-
|
|
3
|
-
import {
|
|
1
|
+
import { $t as DocsMcpAuthPrincipal, Er as FeedbackConfig, Hr as OrderingItem, K as DocsAgentEvaluationsConfig, Kn as DocsSearchConfig, L as DocsAgentContentChangesConfig, On as DocsRetrievalSourceProvenance, Qt as DocsMcpAllowedOrigins, Sn as DocsOpenApiMcpConfig, Xr as PageAgentFrontmatter, bn as DocsOkfTrustMetadataInput, en as DocsMcpAuthenticate, fn as DocsObservabilityConfig, gn as DocsOkfConfig, mr as DocsSearchSourcePage, mt as DocsAnalyticsConfig, rn as DocsMcpConfig, wr as DocsTelemetryFramework, yr as DocsTelemetryConfig } from "./types-QhYMnKvb.mjs";
|
|
2
|
+
import { z as DocsPublishedAgentSkill } from "./standards-discovery-Xm84bS4M.mjs";
|
|
3
|
+
import { a as DocsContentChangeHydrationResponse, c as HydrateDocsContentChangesOptions, d as hydrateDocsContentChanges, h as DocsContentChangeFeed, i as DocsContentChangeHydrationContent, l as MAX_DOCS_CONTENT_CHANGE_HYDRATION_TOKEN_BUDGET, n as DOCS_CONTENT_CHANGE_HYDRATION_FORMAT, o as DocsContentChangeHydrationSection, r as DocsContentChangeHydrationBudget, s as DocsContentChangeHydrationTombstone, sn as DocsMarkdownSectionIndex, t as DEFAULT_DOCS_CONTENT_CHANGE_HYDRATION_TOKEN_BUDGET, u as MIN_DOCS_CONTENT_CHANGE_HYDRATION_TOKEN_BUDGET } from "./content-change-hydration-CoYRs3pC.mjs";
|
|
4
4
|
import { McpServer } from "@modelcontextprotocol/server";
|
|
5
5
|
|
|
6
6
|
//#region src/mcp.d.ts
|
|
@@ -15,6 +15,7 @@ interface DocsMcpPage {
|
|
|
15
15
|
sourcePath?: string;
|
|
16
16
|
lastmod?: string;
|
|
17
17
|
lastModified?: string;
|
|
18
|
+
okf?: DocsOkfTrustMetadataInput;
|
|
18
19
|
locale?: string;
|
|
19
20
|
framework?: string;
|
|
20
21
|
version?: string;
|
|
@@ -187,6 +188,8 @@ interface DocsMcpContextResult {
|
|
|
187
188
|
}
|
|
188
189
|
interface DocsMcpContextOptions {
|
|
189
190
|
pages: readonly DocsMcpPage[];
|
|
191
|
+
/** Authenticated identity used to retain authorized pages during retrieval. */
|
|
192
|
+
principal?: DocsMcpAuthPrincipal;
|
|
190
193
|
query: string;
|
|
191
194
|
framework?: string;
|
|
192
195
|
version?: string;
|
|
@@ -268,7 +271,9 @@ interface DocsMcpResolvedConfig {
|
|
|
268
271
|
listDocs: boolean;
|
|
269
272
|
listPages: boolean; /** Optional so manually constructed resolved configs from older releases remain assignable. */
|
|
270
273
|
listPageSections?: boolean;
|
|
271
|
-
readPage: boolean;
|
|
274
|
+
readPage: boolean; /** Optional so manually constructed resolved configs from older releases remain assignable. */
|
|
275
|
+
readPages?: boolean; /** Optional so manually constructed resolved configs from older releases remain assignable. */
|
|
276
|
+
submitFeedback?: boolean;
|
|
272
277
|
listTasks?: boolean;
|
|
273
278
|
readTask?: boolean;
|
|
274
279
|
searchDocs: boolean; /** Optional so manually constructed resolved configs from older releases remain assignable. */
|
|
@@ -278,7 +283,8 @@ interface DocsMcpResolvedConfig {
|
|
|
278
283
|
getNavigation: boolean;
|
|
279
284
|
getCodeExamples: boolean;
|
|
280
285
|
getConfigSchema: boolean;
|
|
281
|
-
getContext: boolean;
|
|
286
|
+
getContext: boolean; /** Optional so manually constructed resolved configs from older releases remain assignable. */
|
|
287
|
+
getTrustMetadata?: boolean;
|
|
282
288
|
};
|
|
283
289
|
/** Resolved built-in prompt projection. Optional for legacy constructed values. */
|
|
284
290
|
prompts?: DocsMcpResolvedPromptsConfig;
|
|
@@ -320,6 +326,15 @@ interface CreateDocsMcpServerOptions {
|
|
|
320
326
|
contentChanges?: boolean | DocsAgentContentChangesConfig;
|
|
321
327
|
/** Golden-task definitions available for explicit, expectation-blind prompt projection. */
|
|
322
328
|
evaluations?: boolean | DocsAgentEvaluationsConfig;
|
|
329
|
+
/** OKF v0.2 trust metadata projected into page output and the trust tool. */
|
|
330
|
+
okf?: boolean | DocsOkfConfig;
|
|
331
|
+
/** Explicit deny-by-default OpenAPI operation projection. */
|
|
332
|
+
openapi?: {
|
|
333
|
+
config?: DocsOpenApiMcpConfig;
|
|
334
|
+
document: Record<string, unknown> | (() => Record<string, unknown> | Promise<Record<string, unknown>>);
|
|
335
|
+
};
|
|
336
|
+
/** Agent feedback schema and callback used by the opt-in `submit_feedback` tool. */
|
|
337
|
+
feedback?: boolean | FeedbackConfig;
|
|
323
338
|
/** @internal Shared feed instance keeps HTTP and MCP snapshot history aligned. */
|
|
324
339
|
contentChangeFeed?: DocsContentChangeFeed;
|
|
325
340
|
/** @internal Check interval while at least one 2026 content subscription is open. */
|