@farming-labs/docs 0.2.53 → 0.2.55

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.
Files changed (51) hide show
  1. package/dist/agent-BOOcHVDL.mjs +623 -0
  2. package/dist/{agent-BMxMpEa0.mjs → agent-DXkXi-pS.mjs} +590 -19
  3. package/dist/agent-evals-BD17jOqL.mjs +1166 -0
  4. package/dist/{agent-export--X9Go-wj.mjs → agent-export-BYznnYed.mjs} +9 -8
  5. package/dist/agent-scope-B8lptqCd.mjs +283 -0
  6. package/dist/agent-surface-drift-LS8zQgbq.mjs +1429 -0
  7. package/dist/{agents-CW-zTNKP.mjs → agents-BHzeeY45.mjs} +7 -6
  8. package/dist/{analytics-BZEwTK-8.mjs → analytics-Bx44lg6d.mjs} +1 -1
  9. package/dist/cli/index.mjs +29 -29
  10. package/dist/client/react.d.mts +1 -1
  11. package/dist/client/react.mjs +1 -1
  12. package/dist/{cloud-zs0qAnKJ.mjs → cloud-HWFlbfLJ.mjs} +4 -4
  13. package/dist/{cloud-ask-ai-BFlx8VMO.mjs → cloud-ask-ai-1k0q6OAH.mjs} +1 -1
  14. package/dist/{cloud-ask-ai-CMzYVzVX.d.mts → cloud-ask-ai-CvRVnwdK.d.mts} +1 -1
  15. package/dist/code-blocks-C9awWzEQ.mjs +871 -0
  16. package/dist/codeblocks-BzfkREEC.mjs +250 -0
  17. package/dist/{config-DhIyFsy9.mjs → config-CydaZ5PB.mjs} +52 -11
  18. package/dist/{dev-DFeVU2Ui.mjs → dev-BA2kRuCn.mjs} +3 -3
  19. package/dist/docs-cloud-server.d.mts +2 -2
  20. package/dist/docs-cloud-server.mjs +2 -2
  21. package/dist/{doctor-CkM5tKdD.mjs → doctor-CNIPJdxN.mjs} +150 -32
  22. package/dist/{downgrade-Dj_KXV11.mjs → downgrade-BStNhyCc.mjs} +2 -2
  23. package/dist/index.d.mts +40 -17
  24. package/dist/index.mjs +6 -7
  25. package/dist/{init-Cmz-oqnp.mjs → init-gnHQ_Pz9.mjs} +3 -3
  26. package/dist/{mcp-B4Q1PN93.mjs → mcp-F9zkBHrU.mjs} +6 -5
  27. package/dist/mcp.d.mts +22 -4
  28. package/dist/mcp.mjs +521 -43
  29. package/dist/{package-version-DxnTZH4m.mjs → package-version-DRIc08EU.mjs} +1 -1
  30. package/dist/{reading-time-BuK2YL23.mjs → reading-time-BrTd3DIh.mjs} +2 -3
  31. package/dist/{review-BEsbm0l2.mjs → review-Dlb8dRRx.mjs} +149 -14
  32. package/dist/{robots-BOwkq9du.mjs → robots-4BUJxlvV.mjs} +4 -5
  33. package/dist/{robots-C6uQG-fS.mjs → robots-DAptQnkx.mjs} +1 -1
  34. package/dist/{search-CtAXkk_J.mjs → search-B8cF77_i.mjs} +6 -5
  35. package/dist/{search-CTu6Bvq-.d.mts → search-BnQKgDbk.d.mts} +1 -1
  36. package/dist/{search-CJNLkdjX.mjs → search-CEg1omHv.mjs} +54 -11
  37. package/dist/server.d.mts +108 -5
  38. package/dist/server.mjs +9 -9
  39. package/dist/{sitemap-OPb8EdNe.mjs → sitemap-D9ivTLm8.mjs} +8 -7
  40. package/dist/{sitemap-server-DnilMEiZ.mjs → sitemap-server-wsNLyVkb.mjs} +1 -1
  41. package/dist/{types-CdKu8KmO.d.mts → types-R-DN23yw.d.mts} +79 -2
  42. package/dist/{upgrade-BNdBB9tQ.mjs → upgrade-CXYRNV0C.mjs} +2 -2
  43. package/package.json +2 -2
  44. package/dist/agent-2t4kZLGo.mjs +0 -10
  45. package/dist/agent-contract-b0akaPcg.mjs +0 -573
  46. package/dist/codeblocks-DWM4IJPL.mjs +0 -1710
  47. package/dist/review-BHdy75TE.mjs +0 -541
  48. /package/dist/{cloud-analytics-Dlk_byos.mjs → cloud-analytics-CSyFE6SS.mjs} +0 -0
  49. /package/dist/{errors-BxfYhp1L.mjs → errors-BFUtdZfC.mjs} +0 -0
  50. /package/dist/{templates-Bty9M6lA.mjs → templates-1Cod8KrJ.mjs} +0 -0
  51. /package/dist/{utils-CMZTjRQT.mjs → utils-DBCCkkJS.mjs} +0 -0
@@ -1,17 +1,18 @@
1
- import "./agent-contract-b0akaPcg.mjs";
2
- import { At as renderDocsSitemapMarkdown, Dt as buildDocsSitemapManifest, Mt as resolveDocsSitemapConfig, T as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, a as DEFAULT_AGENT_MD_ROUTE, at as renderDocsSkillDocument, bt as toDocsMarkdownUrl, c as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, g as DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE, h as DEFAULT_LLMS_FULL_TXT_ROUTE, j as buildDocsAgentDiscoverySpec, jt as renderDocsSitemapXml, l as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, nt as renderDocsLlmsTxt, o as DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE, rt as renderDocsMarkdownDocument, st as resolveDocsAgentFeedbackConfig, t as DEFAULT_AGENTS_MD_ROUTE, tt as renderDocsAgentsDocument, v as DEFAULT_LLMS_TXT_ROUTE, w as DEFAULT_SKILL_MD_ROUTE, y as DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE } from "./agent-BMxMpEa0.mjs";
3
- import "./search-CJNLkdjX.mjs";
1
+ import { M as buildDocsAgentDiscoverySpec, Mt as renderDocsSitemapXml, Nt as resolveDocsSitemapConfig, Ot as buildDocsSitemapManifest, T as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, a as DEFAULT_AGENT_MD_ROUTE, c as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, ct as resolveDocsAgentFeedbackConfig, g as DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE, h as DEFAULT_LLMS_FULL_TXT_ROUTE, it as renderDocsMarkdownDocument, jt as renderDocsSitemapMarkdown, l as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, nt as renderDocsAgentsDocument, o as DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE, ot as renderDocsSkillDocument, rt as renderDocsLlmsTxt, t as DEFAULT_AGENTS_MD_ROUTE, v as DEFAULT_LLMS_TXT_ROUTE, w as DEFAULT_SKILL_MD_ROUTE, xt as toDocsMarkdownUrl, y as DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE } from "./agent-DXkXi-pS.mjs";
2
+ import "./search-CEg1omHv.mjs";
4
3
  import { t as resolveDocsI18n } from "./i18n-CAlj1ADU.mjs";
5
- import { c as renderDocsRobotsGeneratedBlock, f as upsertDocsRobotsGeneratedBlock, i as DOCS_ROBOTS_GENERATED_BLOCK_START, r as DOCS_ROBOTS_GENERATED_BLOCK_END, u as resolveDocsRobotsConfig } from "./robots-C6uQG-fS.mjs";
6
- import "./sitemap-server-DnilMEiZ.mjs";
4
+ 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-DAptQnkx.mjs";
5
+ import "./sitemap-server-wsNLyVkb.mjs";
6
+ import "./agent-evals-BD17jOqL.mjs";
7
7
  import { createFilesystemDocsMcpSource, resolveDocsMcpConfig } from "./mcp.mjs";
8
+ import "./code-blocks-C9awWzEQ.mjs";
8
9
  import "./server.mjs";
9
- import { c as readNavTitle, d as readTopLevelBooleanProperty, f as readTopLevelStringProperty, i as loadDocsConfigModule, m as resolveDocsContentDir, o as readBooleanProperty, p as resolveDocsConfigPath, r as extractTopLevelConfigObject, t as extractNestedObjectLiteral, u as readStringProperty } from "./config-DhIyFsy9.mjs";
10
- import { t as detectFramework } from "./utils-CMZTjRQT.mjs";
10
+ import { d as readStringProperty, f as readTopLevelBooleanProperty, h as resolveDocsContentDir, i as loadDocsConfigModule, l as readNavTitle, m as resolveDocsConfigPath, p as readTopLevelStringProperty, r as extractTopLevelConfigObject, s as readBooleanProperty, t as extractNestedObjectLiteral } from "./config-CydaZ5PB.mjs";
11
+ import { t as detectFramework } from "./utils-DBCCkkJS.mjs";
11
12
  import { existsSync, lstatSync, mkdirSync, readFileSync, realpathSync, renameSync, rmSync, writeFileSync } from "node:fs";
12
13
  import path from "node:path";
13
- import pc from "picocolors";
14
14
  import { execFileSync } from "node:child_process";
15
+ import pc from "picocolors";
15
16
  import { createHash, randomUUID } from "node:crypto";
16
17
 
17
18
  //#region src/cli/agent-export.ts
@@ -0,0 +1,283 @@
1
+ //#region src/agent-scope.ts
2
+ /** Normalize framework aliases used by page metadata, agent contracts, MCP, and evaluations. */
3
+ function normalizeAgentFramework(value) {
4
+ const normalized = value.toLowerCase().replace(/[^a-z0-9]/gu, "");
5
+ if ([
6
+ "next",
7
+ "nextjs",
8
+ "nextjsapp",
9
+ "reactnext"
10
+ ].includes(normalized)) return "nextjs";
11
+ if ([
12
+ "tanstack",
13
+ "tanstackstart",
14
+ "start"
15
+ ].includes(normalized)) return "tanstackstart";
16
+ if (["svelte", "sveltekit"].includes(normalized)) return "sveltekit";
17
+ if (["nuxt", "nuxtjs"].includes(normalized)) return "nuxt";
18
+ return normalized;
19
+ }
20
+ function normalizeAgentLocale(value) {
21
+ return value.trim().toLowerCase().replace(/_/gu, "-");
22
+ }
23
+ function normalizeAgentVersion(value) {
24
+ return value.trim().toLowerCase().replace(/^v(?=\d)/u, "");
25
+ }
26
+ function normalizeAgentScopeValues(value) {
27
+ const values = Array.isArray(value) ? value : typeof value === "string" ? [value] : [];
28
+ return Array.from(new Set(values.map((item) => item.trim()).filter(Boolean)));
29
+ }
30
+ function compareVersions(left, right) {
31
+ for (let index = 0; index < 3; index += 1) if (left[index] !== right[index]) return left[index] > right[index] ? 1 : -1;
32
+ return 0;
33
+ }
34
+ function parseExactVersion(value) {
35
+ const match = normalizeAgentVersion(value).match(/^(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:-[0-9a-z.-]+)?(?:\+[0-9a-z.-]+)?$/iu);
36
+ if (!match) return void 0;
37
+ return [
38
+ Number(match[1]),
39
+ Number(match[2] ?? 0),
40
+ Number(match[3] ?? 0)
41
+ ];
42
+ }
43
+ function parseVersionOperand(value) {
44
+ const normalized = normalizeAgentVersion(value);
45
+ if (normalized === "*" || normalized === "x") return {
46
+ version: [
47
+ 0,
48
+ 0,
49
+ 0
50
+ ],
51
+ components: 0,
52
+ wildcard: true
53
+ };
54
+ const match = normalized.match(/^(\d+)(?:\.(\d+|x|\*))?(?:\.(\d+|x|\*))?$/iu);
55
+ if (!match) return void 0;
56
+ const raw = [
57
+ match[1],
58
+ match[2],
59
+ match[3]
60
+ ];
61
+ const wildcardIndex = raw.findIndex((part, index) => index > 0 && (part?.toLowerCase() === "x" || part === "*"));
62
+ if (wildcardIndex >= 0 && raw.slice(wildcardIndex + 1).some((part) => part && part.toLowerCase() !== "x" && part !== "*")) return;
63
+ const components = wildcardIndex >= 0 ? wildcardIndex : raw.filter(Boolean).length;
64
+ return {
65
+ version: [
66
+ Number(raw[0]),
67
+ Number(raw[1] ?? 0) || 0,
68
+ Number(raw[2] ?? 0) || 0
69
+ ],
70
+ components,
71
+ wildcard: wildcardIndex >= 0
72
+ };
73
+ }
74
+ function nextVersionBoundary(operand) {
75
+ const [major, minor] = operand.version;
76
+ if (operand.components <= 0) return void 0;
77
+ if (operand.components === 1) return [
78
+ major + 1,
79
+ 0,
80
+ 0
81
+ ];
82
+ return [
83
+ major,
84
+ minor + 1,
85
+ 0
86
+ ];
87
+ }
88
+ function operandRange(operand) {
89
+ if (operand.components === 0) return {
90
+ minimumInclusive: true,
91
+ maximumInclusive: false
92
+ };
93
+ if (operand.components < 3 || operand.wildcard) return {
94
+ minimum: operand.version,
95
+ minimumInclusive: true,
96
+ maximum: nextVersionBoundary(operand),
97
+ maximumInclusive: false
98
+ };
99
+ return {
100
+ minimum: operand.version,
101
+ minimumInclusive: true,
102
+ maximum: operand.version,
103
+ maximumInclusive: true
104
+ };
105
+ }
106
+ function caretRange(operand) {
107
+ const [major, minor, patch] = operand.version;
108
+ let maximum;
109
+ if (major > 0) maximum = [
110
+ major + 1,
111
+ 0,
112
+ 0
113
+ ];
114
+ else if (operand.components <= 1) maximum = [
115
+ 1,
116
+ 0,
117
+ 0
118
+ ];
119
+ else if (minor > 0 || operand.components === 2) maximum = [
120
+ 0,
121
+ minor + 1,
122
+ 0
123
+ ];
124
+ else maximum = [
125
+ 0,
126
+ 0,
127
+ patch + 1
128
+ ];
129
+ return {
130
+ minimum: operand.version,
131
+ minimumInclusive: true,
132
+ maximum,
133
+ maximumInclusive: false
134
+ };
135
+ }
136
+ function tildeRange(operand) {
137
+ const [major, minor] = operand.version;
138
+ const maximum = operand.components <= 1 ? [
139
+ major + 1,
140
+ 0,
141
+ 0
142
+ ] : [
143
+ major,
144
+ minor + 1,
145
+ 0
146
+ ];
147
+ return {
148
+ minimum: operand.version,
149
+ minimumInclusive: true,
150
+ maximum,
151
+ maximumInclusive: false
152
+ };
153
+ }
154
+ function intersectRanges(left, right) {
155
+ let minimum = left.minimum;
156
+ let minimumInclusive = left.minimumInclusive;
157
+ if (!minimum || right.minimum && compareVersions(right.minimum, minimum) > 0) {
158
+ minimum = right.minimum;
159
+ minimumInclusive = right.minimumInclusive;
160
+ } else if (right.minimum && compareVersions(right.minimum, minimum) === 0) minimumInclusive = minimumInclusive && right.minimumInclusive;
161
+ let maximum = left.maximum;
162
+ let maximumInclusive = left.maximumInclusive;
163
+ if (!maximum || right.maximum && compareVersions(right.maximum, maximum) < 0) {
164
+ maximum = right.maximum;
165
+ maximumInclusive = right.maximumInclusive;
166
+ } else if (right.maximum && compareVersions(right.maximum, maximum) === 0) maximumInclusive = maximumInclusive && right.maximumInclusive;
167
+ if (minimum && maximum) {
168
+ const compared = compareVersions(minimum, maximum);
169
+ if (compared > 0 || compared === 0 && !(minimumInclusive && maximumInclusive)) return void 0;
170
+ }
171
+ return {
172
+ minimum,
173
+ minimumInclusive,
174
+ maximum,
175
+ maximumInclusive
176
+ };
177
+ }
178
+ function comparatorRange(operator, operand) {
179
+ if (!operator || operator === "=") return operandRange(operand);
180
+ if (operator === ">=") return {
181
+ minimum: operand.version,
182
+ minimumInclusive: true,
183
+ maximumInclusive: false
184
+ };
185
+ if (operator === ">") {
186
+ const partialBoundary = operand.components < 3 ? nextVersionBoundary(operand) : void 0;
187
+ return {
188
+ minimum: partialBoundary ?? operand.version,
189
+ minimumInclusive: Boolean(partialBoundary),
190
+ maximumInclusive: false
191
+ };
192
+ }
193
+ if (operator === "<") return {
194
+ minimumInclusive: true,
195
+ maximum: operand.version,
196
+ maximumInclusive: false
197
+ };
198
+ const partialBoundary = operand.components < 3 ? nextVersionBoundary(operand) : void 0;
199
+ return {
200
+ minimumInclusive: true,
201
+ maximum: partialBoundary ?? operand.version,
202
+ maximumInclusive: !partialBoundary
203
+ };
204
+ }
205
+ function parseVersionRangeBranch(value) {
206
+ const branch = normalizeAgentVersion(value).trim();
207
+ if (!branch) return void 0;
208
+ const hyphen = branch.match(/^(.+?)\s+-\s+(.+)$/u);
209
+ if (hyphen) {
210
+ const minimumOperand = parseVersionOperand(hyphen[1]);
211
+ const maximumOperand = parseVersionOperand(hyphen[2]);
212
+ if (!minimumOperand || !maximumOperand) return void 0;
213
+ const maximumBoundary = maximumOperand.components < 3 ? nextVersionBoundary(maximumOperand) : maximumOperand.version;
214
+ return intersectRanges({
215
+ minimum: minimumOperand.version,
216
+ minimumInclusive: true,
217
+ maximumInclusive: false
218
+ }, {
219
+ minimumInclusive: true,
220
+ maximum: maximumBoundary,
221
+ maximumInclusive: maximumOperand.components === 3
222
+ });
223
+ }
224
+ const special = branch.match(/^(\^|~)\s*(.+)$/u);
225
+ if (special) {
226
+ const operand = parseVersionOperand(special[2]);
227
+ if (!operand || operand.components === 0) return void 0;
228
+ return special[1] === "^" ? caretRange(operand) : tildeRange(operand);
229
+ }
230
+ const comparators = Array.from(branch.matchAll(/(>=|<=|>|<|=)\s*([^\s]+)/gu));
231
+ if (comparators.length > 0) {
232
+ if (comparators.map((match) => match[0]).join(" ").replace(/\s+/gu, " ") !== branch.replace(/\s+/gu, " ")) return void 0;
233
+ let range = {
234
+ minimumInclusive: true,
235
+ maximumInclusive: false
236
+ };
237
+ for (const comparator of comparators) {
238
+ const operand = parseVersionOperand(comparator[2]);
239
+ if (!operand) return void 0;
240
+ const next = intersectRanges(range, comparatorRange(comparator[1], operand));
241
+ if (!next) return void 0;
242
+ range = next;
243
+ }
244
+ return range;
245
+ }
246
+ const operand = parseVersionOperand(branch);
247
+ return operand ? operandRange(operand) : void 0;
248
+ }
249
+ function parseVersionRanges(value) {
250
+ return normalizeAgentVersion(value).split("||").map((branch) => parseVersionRangeBranch(branch)).filter((range) => Boolean(range));
251
+ }
252
+ function rangeContains(range, version) {
253
+ if (range.minimum) {
254
+ const compared = compareVersions(version, range.minimum);
255
+ if (compared < 0 || compared === 0 && !range.minimumInclusive) return false;
256
+ }
257
+ if (range.maximum) {
258
+ const compared = compareVersions(version, range.maximum);
259
+ if (compared > 0 || compared === 0 && !range.maximumInclusive) return false;
260
+ }
261
+ return true;
262
+ }
263
+ function rangesOverlap(left, right) {
264
+ return Boolean(intersectRanges(left, right));
265
+ }
266
+ /** Match an exact requested version against an exact or range-like documented constraint. */
267
+ function agentVersionConstraintMatches(requested, constraint) {
268
+ if (normalizeAgentVersion(requested) === normalizeAgentVersion(constraint)) return Boolean(normalizeAgentVersion(requested));
269
+ const wanted = parseExactVersion(requested);
270
+ if (!wanted) return false;
271
+ return parseVersionRanges(constraint).some((range) => rangeContains(range, wanted));
272
+ }
273
+ /** Return true when two exact or range-like documented version constraints can select one version. */
274
+ function agentVersionConstraintsOverlap(left, right) {
275
+ const normalizedLeft = normalizeAgentVersion(left);
276
+ if (normalizedLeft === normalizeAgentVersion(right)) return Boolean(normalizedLeft);
277
+ const leftRanges = parseVersionRanges(left);
278
+ const rightRanges = parseVersionRanges(right);
279
+ return leftRanges.some((leftRange) => rightRanges.some((rightRange) => rangesOverlap(leftRange, rightRange)));
280
+ }
281
+
282
+ //#endregion
283
+ export { normalizeAgentScopeValues as a, normalizeAgentLocale as i, agentVersionConstraintsOverlap as n, normalizeAgentVersion as o, normalizeAgentFramework as r, agentVersionConstraintMatches as t };