@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.
Files changed (77) hide show
  1. package/dist/{agent-BLHMoVId.mjs → agent-CaCWThBY.mjs} +4 -4
  2. package/dist/{agent-CFqECAG0.mjs → agent-DCTGj6J7.mjs} +212 -19
  3. package/dist/{agent-evals-GpcaCbRb.mjs → agent-evals-D-sPJfXz.mjs} +5 -5
  4. package/dist/{agent-export-oiWxB5aX.mjs → agent-export-GcTZPLfB.mjs} +30 -17
  5. package/dist/agent-feedback-evaluations-DQCTFegz.mjs +240 -0
  6. package/dist/agent-feedback-loop-vaC-M1sx.mjs +196 -0
  7. package/dist/agent-maintenance-CuZ7iAKq.mjs +289 -0
  8. package/dist/agent-skills-bundle.d.mts +1 -1
  9. package/dist/{agent-skills-progressive-disclosure-Da9LKEKv.mjs → agent-skills-progressive-disclosure-DL-q4JZo.mjs} +1 -1
  10. package/dist/{agent-skills-server-CICMh0zv.d.mts → agent-skills-server-D34054x5.d.mts} +2 -2
  11. package/dist/{agent-skills-server-DFqQyO_V.mjs → agent-skills-server-Ddbf15pY.mjs} +1 -1
  12. package/dist/agent-skills-vite.d.mts +3 -3
  13. package/dist/agent-skills-vite.mjs +2 -2
  14. package/dist/{agents-CtqIUW5I.mjs → agents-e1SYT64z.mjs} +11 -10
  15. package/dist/{analytics-Bx44lg6d.mjs → analytics-CqfcIBdg.mjs} +1 -1
  16. package/dist/{analytics-C75BnTEW.d.mts → analytics-aeXwEvQX.d.mts} +1 -1
  17. package/dist/authoring-Do87QzBd.mjs +41 -0
  18. package/dist/authoring-mcp-Be7quE5R.mjs +380 -0
  19. package/dist/browser.d.mts +3 -3
  20. package/dist/browser.mjs +2 -2
  21. package/dist/cli/index.mjs +103 -35
  22. package/dist/client/react.d.mts +1 -1
  23. package/dist/client/react.mjs +1 -1
  24. package/dist/{cloud-FNfcbfli.mjs → cloud-Bvof6mET.mjs} +3 -3
  25. package/dist/{cloud-ask-ai-BmbZVAT5.d.mts → cloud-ask-ai-BqfiQaNZ.d.mts} +1 -1
  26. package/dist/{cloud-ask-ai-CkCYjf2N.mjs → cloud-ask-ai-CK2qlNns.mjs} +1 -1
  27. package/dist/{code-blocks-Bel6vDqI.mjs → code-blocks-D90CCJFs.mjs} +1 -1
  28. package/dist/{codeblocks-jbWuvtJQ.mjs → codeblocks-C911CdyJ.mjs} +2 -2
  29. package/dist/{agent-lWTq6pgr.d.mts → content-change-hydration-CoYRs3pC.d.mts} +707 -675
  30. package/dist/{dev-BvbYmTLz.mjs → dev-Bx0JNglW.mjs} +3 -3
  31. package/dist/docs-cloud-server.d.mts +2 -2
  32. package/dist/docs-cloud-server.mjs +2 -2
  33. package/dist/{doctor-Bmm0uY98.mjs → doctor-CtK1CRPj.mjs} +20 -16
  34. package/dist/{downgrade-Dqm0rJMy.mjs → downgrade-BXmQMkMy.mjs} +2 -2
  35. package/dist/feedback-DWVUMrxy.mjs +72 -0
  36. package/dist/feedback-evals-k0sFDdms.mjs +146 -0
  37. package/dist/{golden-evaluations-K45fcWGW.mjs → golden-evaluations-De4KwoYr.mjs} +3 -3
  38. package/dist/index.d.mts +236 -9
  39. package/dist/index.mjs +14 -11
  40. package/dist/{init-jDQSo-Or.mjs → init-CCV2eRNB.mjs} +3 -3
  41. package/dist/markdown-rendering.mjs +1 -1
  42. package/dist/{markdown-sections-7OoA7ylx.mjs → markdown-sections-BKy4labo.mjs} +110 -2
  43. package/dist/{mcp-CwgKlbIz.mjs → mcp-DsjWxF7g.mjs} +11 -10
  44. package/dist/mcp.d.mts +20 -5
  45. package/dist/mcp.mjs +538 -56
  46. package/dist/{metadata-D4v_R1t5.mjs → metadata-7htr-Xj_.mjs} +1 -1
  47. package/dist/{content-change-hydration-BsbBXAUi.mjs → openapi-mcp-DQ3xptKo.mjs} +182 -4
  48. package/dist/openapi-mcp-node-vO3IXVGI.mjs +43 -0
  49. package/dist/{package-version--oQiHwZj.mjs → package-version-Ci99L0yo.mjs} +1 -1
  50. package/dist/{prompt-references-DW5vG5zs.mjs → prompt-references-1Wce71c7.mjs} +3 -3
  51. package/dist/propose-DJOiHu9Y.mjs +73 -0
  52. package/dist/retrieval-digest-B-SgtXKK.mjs +177 -0
  53. package/dist/retrieval-digest-DyNRD-mt.d.mts +467 -0
  54. package/dist/{review-C_5wB0rR.mjs → review-XI9FXeos.mjs} +12 -12
  55. package/dist/{robots-NQesPX5L.mjs → robots-BOjWB1ky.mjs} +2 -2
  56. package/dist/{robots-BQ42Y84a.mjs → robots-CzKesbdX.mjs} +6 -6
  57. package/dist/{search-B5etKU-v.mjs → search-DwAoC9X7.mjs} +12 -11
  58. package/dist/server.d.mts +47 -264
  59. package/dist/server.mjs +14 -11
  60. package/dist/{sidebar-CwZlgyAz.d.mts → sidebar-CJze8SBi.d.mts} +1 -1
  61. package/dist/{sitemap-DjhxvQP1.mjs → sitemap-DOaJIKJf.mjs} +11 -10
  62. package/dist/{sitemap-server-B0SiREN0.mjs → sitemap-server-NeVu8W38.mjs} +11 -1
  63. package/dist/{skills-BFang8vF.mjs → skills-BILSESek.mjs} +11 -10
  64. package/dist/{standards-discovery-Ckx0tN7B.mjs → standards-discovery-Bpz90VYq.mjs} +2 -177
  65. package/dist/{standards-discovery-D1Ys4J3h.d.mts → standards-discovery-Xm84bS4M.d.mts} +1 -1
  66. package/dist/{types-DLLefoU5.d.mts → types-QhYMnKvb.d.mts} +148 -2
  67. package/dist/{upgrade-kj2crJSk.mjs → upgrade-B92U83xo.mjs} +2 -2
  68. package/package.json +1 -1
  69. package/dist/retrieval-digest-DYEsIeCE.d.mts +0 -164
  70. /package/dist/{audience-exposure-Cw3SA4WE.d.mts → audience-exposure-CkNZNeVX.d.mts} +0 -0
  71. /package/dist/{cloud-analytics-CSyFE6SS.mjs → cloud-analytics-Ci1yiwD8.mjs} +0 -0
  72. /package/dist/{config-BaTmjDqD.mjs → config-DrZ3fXgf.mjs} +0 -0
  73. /package/dist/{errors-DZiNXv5c.mjs → errors-BDmra6mz.mjs} +0 -0
  74. /package/dist/{i18n-B3BIxShC.mjs → i18n-B1gJ9EW0.mjs} +0 -0
  75. /package/dist/{sidebar-IcpElOVH.mjs → sidebar-3W51s2sF.mjs} +0 -0
  76. /package/dist/{templates-kc7jxspR.mjs → templates-DdB4BBGq.mjs} +0 -0
  77. /package/dist/{utils-DOMeZW9V.mjs → utils-Cc1SrVza.mjs} +0 -0
@@ -0,0 +1,289 @@
1
+ //#region src/agent-maintenance.ts
2
+ const DOCS_AGENT_MAINTENANCE_PROPOSAL_FORMAT = "farming-labs-agent-maintenance-proposals.v1";
3
+ const SOURCES = new Set([
4
+ "agent-feedback",
5
+ "ask-ai",
6
+ "git",
7
+ "issue",
8
+ "mcp",
9
+ "search",
10
+ "support"
11
+ ]);
12
+ const SEVERITIES = new Set([
13
+ "info",
14
+ "warning",
15
+ "error",
16
+ "critical"
17
+ ]);
18
+ const SEVERITY_RANK = {
19
+ info: 1,
20
+ warning: 2,
21
+ error: 3,
22
+ critical: 4
23
+ };
24
+ const TOPIC_STOP_WORDS = new Set([
25
+ "a",
26
+ "an",
27
+ "and",
28
+ "docs",
29
+ "for",
30
+ "from",
31
+ "how",
32
+ "in",
33
+ "of",
34
+ "on",
35
+ "the",
36
+ "to",
37
+ "with"
38
+ ]);
39
+ function cleanString(value, maxLength = 1e3) {
40
+ if (typeof value !== "string") return void 0;
41
+ const normalized = value.split("").map((character) => {
42
+ const code = character.charCodeAt(0);
43
+ return code <= 31 || code === 127 ? " " : character;
44
+ }).join("").trim().replace(/\s+/g, " ");
45
+ return normalized ? normalized.slice(0, maxLength) : void 0;
46
+ }
47
+ function slugify(value) {
48
+ return value.toLowerCase().replace(/^https?:\/\//, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 72) || "docs-maintenance";
49
+ }
50
+ function topicSignature(value) {
51
+ const tokens = value.toLowerCase().match(/[a-z0-9][a-z0-9_-]*/g)?.filter((token) => token.length > 1 && !TOPIC_STOP_WORDS.has(token));
52
+ return [...new Set(tokens ?? [])].sort().slice(0, 12).join("-") || "unspecified";
53
+ }
54
+ function normalizeSignal(value, index) {
55
+ if (!SOURCES.has(value.source)) throw new Error(`Signal ${index + 1}.source is not supported.`);
56
+ const summary = cleanString(value.summary);
57
+ if (!summary) throw new Error(`Signal ${index + 1}.summary must be a non-empty string.`);
58
+ const page = cleanString(value.page, 300) ?? "(unknown page)";
59
+ const task = cleanString(value.task, 500);
60
+ const topic = cleanString(value.topic, 300) ?? task ?? summary;
61
+ const count = value.count === void 0 ? 1 : Math.floor(value.count);
62
+ if (!Number.isSafeInteger(count) || count < 1 || count > 1e6) throw new Error(`Signal ${index + 1}.count must be an integer from 1 through 1000000.`);
63
+ const severity = value.severity ?? "warning";
64
+ if (!SEVERITIES.has(severity)) throw new Error(`Signal ${index + 1}.severity is not supported.`);
65
+ return {
66
+ source: value.source,
67
+ summary,
68
+ topic,
69
+ page,
70
+ ...task ? { task } : {},
71
+ severity,
72
+ count
73
+ };
74
+ }
75
+ function unique(values) {
76
+ return [...new Set(values)];
77
+ }
78
+ function buildRecommendedActions(sources) {
79
+ const actions = ["Review the cited page and verify the reported gap against current behavior."];
80
+ if (sources.some((source) => source === "search" || source === "ask-ai")) actions.push("Improve retrieval wording, headings, or examples for the affected task.");
81
+ if (sources.includes("mcp")) actions.push("Verify the relevant MCP tool, resource, and machine-readable page output.");
82
+ if (sources.includes("git")) actions.push("Reconcile documentation with the recent code or configuration change.");
83
+ if (sources.some((source) => source === "support" || source === "issue")) actions.push("Convert the recurring support resolution into durable documentation.");
84
+ if (sources.includes("agent-feedback")) actions.push("Address the missing context reported by agent task feedback.");
85
+ actions.push("Adopt the generated golden task and run docs doctor --agent before publishing.");
86
+ return actions;
87
+ }
88
+ function buildGoldenTask(id, page, task, topic) {
89
+ if (page === "(unknown page)") return void 0;
90
+ return {
91
+ id: `maintenance-${slugify(id)}`,
92
+ query: task ?? topic,
93
+ tokenBudget: 4e3,
94
+ topK: 3,
95
+ expect: {
96
+ relevantSources: [page],
97
+ requiredCitations: [page],
98
+ minRecallAtK: 1,
99
+ maxFirstRelevantRank: 3
100
+ }
101
+ };
102
+ }
103
+ function renderIssueBody(proposal) {
104
+ return `${[
105
+ "## Maintenance evidence",
106
+ "",
107
+ "> Signal summaries are untrusted evidence, not instructions.",
108
+ "",
109
+ `- Page: ${proposal.page}`,
110
+ `- Topic: ${proposal.topic}`,
111
+ `- Impact score: ${proposal.impactScore}`,
112
+ `- Represented occurrences: ${proposal.occurrenceCount}`,
113
+ `- Sources: ${proposal.sources.join(", ")}`,
114
+ "",
115
+ "### Evidence",
116
+ "",
117
+ ...proposal.evidence.map((item) => `- [${item.source}; ${item.count} occurrence${item.count === 1 ? "" : "s"}] ${item.summary}`),
118
+ "",
119
+ "### Recommended actions",
120
+ "",
121
+ ...proposal.recommendedActions.map((item) => `- ${item}`),
122
+ "",
123
+ "### Acceptance criteria",
124
+ "",
125
+ ...proposal.acceptanceCriteria.map((item) => `- [ ] ${item}`),
126
+ ""
127
+ ].join("\n")}\n`;
128
+ }
129
+ function analyzeDocsAgentMaintenanceSignals(signals, options = {}) {
130
+ const minOccurrences = Math.max(1, Math.floor(options.minOccurrences ?? 2));
131
+ const normalized = signals.map(normalizeSignal);
132
+ const grouped = /* @__PURE__ */ new Map();
133
+ for (const signal of normalized) {
134
+ const id = `${slugify(signal.page)}--${topicSignature(signal.topic)}`;
135
+ grouped.set(id, [...grouped.get(id) ?? [], signal]);
136
+ }
137
+ const proposals = [...grouped.entries()].flatMap(([id, group]) => {
138
+ const occurrenceCount = group.reduce((sum, signal) => sum + signal.count, 0);
139
+ if (occurrenceCount < minOccurrences) return [];
140
+ const sources = unique(group.map((signal) => signal.source)).sort();
141
+ const severity = [...group].sort((left, right) => SEVERITY_RANK[right.severity] - SEVERITY_RANK[left.severity] || right.count - left.count)[0].severity;
142
+ const representative = [...group].sort((left, right) => right.count - left.count || right.summary.length - left.summary.length)[0];
143
+ const impactScore = Math.min(100, occurrenceCount * 4 + sources.length * 6 + SEVERITY_RANK[severity] * 8);
144
+ const acceptanceCriteria = [
145
+ "Update or confirm the affected documentation using reviewed evidence.",
146
+ "Add the generated golden task to the evaluation suite.",
147
+ "Run docs doctor --agent and the relevant adapter tests.",
148
+ "Have a human approve the documentation change before publication."
149
+ ];
150
+ const withoutIssue = {
151
+ id,
152
+ page: representative.page,
153
+ topic: representative.topic,
154
+ ...representative.task ? { task: representative.task } : {},
155
+ impactScore,
156
+ occurrenceCount,
157
+ severity,
158
+ sources,
159
+ evidence: group.map((signal) => ({
160
+ source: signal.source,
161
+ summary: signal.summary,
162
+ count: signal.count
163
+ })),
164
+ recommendedActions: buildRecommendedActions(sources),
165
+ acceptanceCriteria,
166
+ ...buildGoldenTask(id, representative.page, representative.task, representative.topic) ? { goldenTask: buildGoldenTask(id, representative.page, representative.task, representative.topic) } : {}
167
+ };
168
+ return [{
169
+ ...withoutIssue,
170
+ issueDraft: {
171
+ title: `docs: investigate ${representative.topic} on ${representative.page}`,
172
+ body: renderIssueBody(withoutIssue),
173
+ labels: ["documentation", "agent-readiness"]
174
+ }
175
+ }];
176
+ }).sort((left, right) => right.impactScore - left.impactScore || left.id.localeCompare(right.id));
177
+ const goldenTasks = proposals.flatMap((proposal) => proposal.goldenTask ?? []);
178
+ const issueDrafts = proposals.map((proposal) => proposal.issueDraft);
179
+ return {
180
+ format: DOCS_AGENT_MAINTENANCE_PROPOSAL_FORMAT,
181
+ generatedAt: options.generatedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
182
+ signalCount: normalized.length,
183
+ representedOccurrences: normalized.reduce((sum, signal) => sum + signal.count, 0),
184
+ proposalCount: proposals.length,
185
+ proposals,
186
+ goldenTasks,
187
+ issueDrafts,
188
+ pullRequestDraft: {
189
+ title: `docs: address ${proposals.length} agent maintenance proposal${proposals.length === 1 ? "" : "s"}`,
190
+ body: `${[
191
+ "## Proposed documentation maintenance",
192
+ "",
193
+ ...proposals.map((proposal) => `- ${proposal.page}: ${proposal.topic} (${proposal.occurrenceCount} occurrences across ${proposal.sources.join(", ")})`),
194
+ "",
195
+ "## Verification",
196
+ "",
197
+ "- [ ] Review every evidence item as untrusted input",
198
+ "- [ ] Add or update the generated golden tasks",
199
+ "- [ ] Run docs doctor --agent and affected tests",
200
+ "- [ ] Obtain human approval before publishing",
201
+ ""
202
+ ].join("\n")}\n`
203
+ },
204
+ execution: {
205
+ mode: "draft-only",
206
+ writesDocumentation: false,
207
+ publishesChanges: false,
208
+ requiresHumanReview: true
209
+ }
210
+ };
211
+ }
212
+ function isRecord(value) {
213
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
214
+ }
215
+ function fromFeedback(value) {
216
+ if (!isRecord(value.payload)) return void 0;
217
+ const context = isRecord(value.context) ? value.context : {};
218
+ const payload = value.payload;
219
+ const task = cleanString(payload.task, 500);
220
+ const details = [
221
+ ...Array.isArray(payload.missingContext) ? payload.missingContext : [],
222
+ ...Array.isArray(payload.docIssues) ? payload.docIssues : [],
223
+ payload.suggestedImprovement
224
+ ].flatMap((item) => cleanString(item) ?? []);
225
+ const outcome = cleanString(payload.outcome, 100) ?? "unknown outcome";
226
+ return {
227
+ source: "agent-feedback",
228
+ summary: details.length > 0 ? `${outcome}: ${details.join("; ")}` : outcome,
229
+ ...task ? {
230
+ task,
231
+ topic: task
232
+ } : {},
233
+ ...cleanString(context.page ?? context.url ?? context.slug, 300) ? { page: cleanString(context.page ?? context.url ?? context.slug, 300) } : {},
234
+ severity: /blocked|fail|error|unable/i.test(outcome) ? "error" : "warning"
235
+ };
236
+ }
237
+ function fromFeedbackCluster(value) {
238
+ const page = cleanString(value.page, 300);
239
+ const task = cleanString(value.task, 500);
240
+ return {
241
+ source: "agent-feedback",
242
+ summary: [
243
+ ...Array.isArray(value.missingContext) ? value.missingContext : [],
244
+ ...Array.isArray(value.docIssues) ? value.docIssues : [],
245
+ ...Array.isArray(value.suggestedImprovements) ? value.suggestedImprovements : []
246
+ ].flatMap((item) => cleanString(item) ?? []).join("; ") || task || "Recurring agent feedback failure",
247
+ ...page ? { page } : {},
248
+ ...task ? {
249
+ task,
250
+ topic: task
251
+ } : {},
252
+ severity: "error",
253
+ count: typeof value.occurrences === "number" && Number.isSafeInteger(value.occurrences) ? value.occurrences : 1
254
+ };
255
+ }
256
+ function parseSignal(value, label) {
257
+ if (!isRecord(value)) throw new Error(`${label} must be an object.`);
258
+ const feedback = fromFeedback(value);
259
+ if (feedback) return feedback;
260
+ return value;
261
+ }
262
+ function extractSignals(value) {
263
+ if (Array.isArray(value)) return value.map((item, index) => parseSignal(item, `Signal ${index + 1}`));
264
+ if (!isRecord(value)) return void 0;
265
+ if (Array.isArray(value.clusters)) return value.clusters.map((item, index) => {
266
+ if (!isRecord(item)) throw new Error(`Feedback cluster ${index + 1} must be an object.`);
267
+ return fromFeedbackCluster(item);
268
+ });
269
+ const collection = value.signals ?? value.events ?? value.items;
270
+ if (Array.isArray(collection)) return collection.map((item, index) => parseSignal(item, `Signal ${index + 1}`));
271
+ }
272
+ function parseDocsAgentMaintenanceSignals(content) {
273
+ content = content.trim();
274
+ if (!content) return [];
275
+ try {
276
+ const extracted = extractSignals(JSON.parse(content));
277
+ if (extracted) return extracted;
278
+ } catch {}
279
+ return content.split(/\r?\n/).map((line, index) => {
280
+ try {
281
+ return parseSignal(JSON.parse(line), `Signal line ${index + 1}`);
282
+ } catch (error) {
283
+ throw new Error(`Invalid maintenance signal JSON on line ${index + 1}: ${error instanceof Error ? error.message : String(error)}`);
284
+ }
285
+ });
286
+ }
287
+
288
+ //#endregion
289
+ export { analyzeDocsAgentMaintenanceSignals as n, parseDocsAgentMaintenanceSignals as r, DOCS_AGENT_MAINTENANCE_PROPOSAL_FORMAT as t };
@@ -1,4 +1,4 @@
1
- import { z as DocsPublishedAgentSkill } from "./standards-discovery-D1Ys4J3h.mjs";
1
+ import { z as DocsPublishedAgentSkill } from "./standards-discovery-Xm84bS4M.mjs";
2
2
 
3
3
  //#region src/agent-skills-bundle.d.ts
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  import { validateDocsAgentSkillFrontmatter } from "./agent-skills-spec.mjs";
2
- import { n as resolveConfiguredAgentSkillPathsSync } from "./agent-skills-server-DFqQyO_V.mjs";
2
+ import { n as resolveConfiguredAgentSkillPathsSync } from "./agent-skills-server-Ddbf15pY.mjs";
3
3
  import { existsSync, lstatSync, readFileSync, readdirSync } from "node:fs";
4
4
  import path from "node:path";
5
5
 
@@ -1,5 +1,5 @@
1
- import { st as DocsAgentSkillsInput } from "./types-DLLefoU5.mjs";
2
- import { z as DocsPublishedAgentSkill } from "./standards-discovery-D1Ys4J3h.mjs";
1
+ import { lt as DocsAgentSkillsInput } from "./types-QhYMnKvb.mjs";
2
+ import { z as DocsPublishedAgentSkill } from "./standards-discovery-Xm84bS4M.mjs";
3
3
 
4
4
  //#region src/agent-skills-server.d.ts
5
5
  interface ResolveConfiguredAgentSkillsOptions {
@@ -1,4 +1,4 @@
1
- import { f as DEFAULT_AGENT_SKILLS_ROUTE_PREFIX, j as buildDocsPublishedAgentSkill } from "./standards-discovery-Ckx0tN7B.mjs";
1
+ import { f as DEFAULT_AGENT_SKILLS_ROUTE_PREFIX, j as buildDocsPublishedAgentSkill } from "./standards-discovery-Bpz90VYq.mjs";
2
2
  import { existsSync, lstatSync, readFileSync, readdirSync, realpathSync, statSync } from "node:fs";
3
3
  import path from "node:path";
4
4
  import { createHash } from "node:crypto";
@@ -1,6 +1,6 @@
1
- import { st as DocsAgentSkillsInput } from "./types-DLLefoU5.mjs";
2
- import { z as DocsPublishedAgentSkill } from "./standards-discovery-D1Ys4J3h.mjs";
3
- import { t as ResolveConfiguredAgentSkillsOptions } from "./agent-skills-server-CICMh0zv.mjs";
1
+ import { lt as DocsAgentSkillsInput } from "./types-QhYMnKvb.mjs";
2
+ import { z as DocsPublishedAgentSkill } from "./standards-discovery-Xm84bS4M.mjs";
3
+ import { t as ResolveConfiguredAgentSkillsOptions } from "./agent-skills-server-D34054x5.mjs";
4
4
 
5
5
  //#region src/agent-skills-vite.d.ts
6
6
  declare const DOCS_AGENT_SKILLS_BUNDLE_MODULE = "@farming-labs/docs/agent-skills-bundle";
@@ -1,5 +1,5 @@
1
- import "./standards-discovery-Ckx0tN7B.mjs";
2
- import { r as resolveConfiguredAgentSkills } from "./agent-skills-server-DFqQyO_V.mjs";
1
+ import "./standards-discovery-Bpz90VYq.mjs";
2
+ import { r as resolveConfiguredAgentSkills } from "./agent-skills-server-Ddbf15pY.mjs";
3
3
 
4
4
  //#region src/agent-skills-vite.ts
5
5
  const DOCS_AGENT_SKILLS_BUNDLE_MODULE = "@farming-labs/docs/agent-skills-bundle";
@@ -1,15 +1,16 @@
1
- import { a as DEFAULT_AGENT_MD_ROUTE, lt as resolveDocsAgentFeedbackConfig, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, o as DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE, rt as renderDocsAgentsDocument, t as DEFAULT_AGENTS_MD_ROUTE } from "./agent-CFqECAG0.mjs";
2
- import "./markdown-sections-7OoA7ylx.mjs";
3
- import "./standards-discovery-Ckx0tN7B.mjs";
4
- import "./content-change-hydration-BsbBXAUi.mjs";
5
- import { C as resolveApiReferenceOpenApiDiscovery } from "./sitemap-server-B0SiREN0.mjs";
6
- import "./agent-skills-server-DFqQyO_V.mjs";
7
- import "./agent-evals-GpcaCbRb.mjs";
1
+ import "./markdown-sections-BKy4labo.mjs";
2
+ import { a as DEFAULT_AGENT_MD_ROUTE, it as renderDocsAgentsDocument, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, o as DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE, t as DEFAULT_AGENTS_MD_ROUTE, ut as resolveDocsAgentFeedbackConfig } from "./agent-DCTGj6J7.mjs";
3
+ import "./standards-discovery-Bpz90VYq.mjs";
4
+ import "./openapi-mcp-DQ3xptKo.mjs";
5
+ import { C as resolveApiReferenceOpenApiDiscovery } from "./sitemap-server-NeVu8W38.mjs";
6
+ import "./agent-skills-server-Ddbf15pY.mjs";
7
+ import "./agent-evals-D-sPJfXz.mjs";
8
8
  import { resolveDocsMcpConfig } from "./mcp.mjs";
9
- import "./code-blocks-Bel6vDqI.mjs";
9
+ import "./authoring-mcp-Be7quE5R.mjs";
10
+ import "./code-blocks-D90CCJFs.mjs";
10
11
  import "./server.mjs";
11
- import { a as loadDocsConfigModule, d as readNavTitle, g as resolveDocsConfigPath, h as readTopLevelStringProperty, l as readBooleanProperty, p as readStringProperty, t as extractNestedObjectLiteral } from "./config-BaTmjDqD.mjs";
12
- import { t as detectFramework } from "./utils-DOMeZW9V.mjs";
12
+ import { a as loadDocsConfigModule, d as readNavTitle, g as resolveDocsConfigPath, h as readTopLevelStringProperty, l as readBooleanProperty, p as readStringProperty, t as extractNestedObjectLiteral } from "./config-DrZ3fXgf.mjs";
13
+ import { t as detectFramework } from "./utils-Cc1SrVza.mjs";
13
14
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
14
15
  import path from "node:path";
15
16
  import pc from "picocolors";
@@ -1,4 +1,4 @@
1
- import { n as sendDocsCloudAnalyticsEvent, t as resolveDocsCloudAnalyticsOptions } from "./cloud-analytics-CSyFE6SS.mjs";
1
+ import { n as sendDocsCloudAnalyticsEvent, t as resolveDocsCloudAnalyticsOptions } from "./cloud-analytics-Ci1yiwD8.mjs";
2
2
 
3
3
  //#region src/analytics.ts
4
4
  const ANALYTICS_LOG_PREFIX = "[@farming-labs/docs:analytics]";
@@ -1,4 +1,4 @@
1
- import { dn as DocsObservabilityEvent, fn as DocsObservabilityEventInput, ft as DocsAnalyticsConfig, lt as DocsAgentTraceEventInput, mt as DocsAnalyticsEventInput, pt as DocsAnalyticsEvent, un as DocsObservabilityConfig } from "./types-DLLefoU5.mjs";
1
+ import { dt as DocsAgentTraceEventInput, fn as DocsObservabilityConfig, gt as DocsAnalyticsEventInput, ht as DocsAnalyticsEvent, mn as DocsObservabilityEventInput, mt as DocsAnalyticsConfig, pn as DocsObservabilityEvent } from "./types-QhYMnKvb.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"];
@@ -0,0 +1,41 @@
1
+ import "./markdown-sections-BKy4labo.mjs";
2
+ import "./agent-DCTGj6J7.mjs";
3
+ import "./standards-discovery-Bpz90VYq.mjs";
4
+ import "./openapi-mcp-DQ3xptKo.mjs";
5
+ import { r as runDocsAuthoringMcpStdio } from "./authoring-mcp-Be7quE5R.mjs";
6
+ import { _ as resolveDocsContentDir, d as readNavTitle, g as resolveDocsConfigPath, o as loadDocsConfigModuleResult, p as readStringProperty } from "./config-DrZ3fXgf.mjs";
7
+ import { readFileSync } from "node:fs";
8
+ import path from "node:path";
9
+
10
+ //#region src/cli/authoring.ts
11
+ async function runAuthoringMcp(options = {}) {
12
+ const rootDir = process.cwd();
13
+ const content = readFileSync(resolveDocsConfigPath(rootDir, options.configPath), "utf8");
14
+ const configLoad = await loadDocsConfigModuleResult(rootDir, options.configPath);
15
+ const config = configLoad.status === "evaluated" ? configLoad.config : void 0;
16
+ const entry = config?.entry ?? readStringProperty(content, "entry") ?? "docs";
17
+ const contentDir = config?.contentDir ?? resolveDocsContentDir(rootDir, content, entry);
18
+ const navTitle = typeof config?.nav?.title === "string" ? config.nav.title : readNavTitle(content);
19
+ const cliPath = process.argv[1];
20
+ if (!cliPath) throw new Error("Could not resolve the docs CLI executable for doctor checks.");
21
+ await runDocsAuthoringMcpStdio({
22
+ rootDir,
23
+ entry,
24
+ contentDir,
25
+ name: `${navTitle ?? "Documentation"} authoring`,
26
+ branchPrefix: options.branchPrefix,
27
+ baseBranch: options.baseBranch,
28
+ allowPublish: options.allowPublish,
29
+ doctorCommand: [
30
+ process.execPath,
31
+ path.resolve(cliPath),
32
+ "doctor",
33
+ "--agent",
34
+ "--json",
35
+ ...options.configPath ? ["--config", options.configPath] : []
36
+ ]
37
+ });
38
+ }
39
+
40
+ //#endregion
41
+ export { runAuthoringMcp };