@farming-labs/docs 0.1.102 → 0.1.104
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/{robots-D8IQoKv1.mjs → agent-BK7q65dn.mjs} +176 -238
- package/dist/agent-sUT6Bsop.mjs +9 -0
- package/dist/{agent-BG9YfbHr.mjs → agents-B04j1KsE.mjs} +203 -6
- package/dist/cli/index.mjs +27 -12
- package/dist/{dev-HW5Op4My.mjs → dev-CpvDdmY3.mjs} +1 -1
- package/dist/{doctor-C8NWuL1m.mjs → doctor-DPFrn2se.mjs} +14 -8
- package/dist/index.d.mts +23 -15
- package/dist/index.mjs +3 -2
- package/dist/{init-BXZa9OiZ.mjs → init-BJbBtnBz.mjs} +1 -1
- package/dist/{mcp-D0LCSSaq.mjs → mcp-B-zWyAlw.mjs} +2 -2
- package/dist/mcp.d.mts +1 -1
- package/dist/robots-DDrj6Cpo.mjs +192 -0
- package/dist/{robots-B9RIhGtT.mjs → robots-HU8yTWZv.mjs} +3 -2
- package/dist/{search-jAlynFl1.mjs → search-0H8jdm8S.mjs} +2 -2
- package/dist/{search-DfcI-2-D.d.mts → search-BlXlCmne.d.mts} +1 -1
- package/dist/server.d.mts +2 -2
- package/dist/server.mjs +1 -1
- package/dist/{sitemap-BYVaRIsO.mjs → sitemap-DqzvA3BI.mjs} +2 -2
- package/dist/{templates-Bq8X1qEd.mjs → templates-BpSkUico.mjs} +2 -2
- package/dist/{types-CAxzjKQR.d.mts → types-BSnCAFHc.d.mts} +1 -1
- package/package.json +1 -1
- /package/dist/{config-UI31_wlO.mjs → config-Cio3byUJ.mjs} +0 -0
- /package/dist/{sitemap-server-C4TbbCmY.mjs → sitemap-server-DJvxOqX2.mjs} +0 -0
- /package/dist/{upgrade-D9c60phM.mjs → upgrade-Nh6Jn6Kk.mjs} +0 -0
package/dist/mcp.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { J as DocsSearchConfig, P as DocsMcpConfig, R as DocsObservabilityConfig, _ as DocsAnalyticsConfig, et as DocsSearchSourcePage, gt as OrderingItem } from "./types-
|
|
1
|
+
import { J as DocsSearchConfig, P as DocsMcpConfig, R as DocsObservabilityConfig, _ as DocsAnalyticsConfig, et as DocsSearchSourcePage, gt as OrderingItem } from "./types-BSnCAFHc.mjs";
|
|
2
2
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
3
|
|
|
4
4
|
//#region src/mcp.d.ts
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { u as resolveDocsSitemapConfig } from "./sitemap-CnqcTdQg.mjs";
|
|
2
|
+
import { R as normalizeDocsPathSegment, a as DEFAULT_AGENT_MD_ROUTE, b as DEFAULT_SKILL_MD_ROUTE, c as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, d as DEFAULT_LLMS_FULL_TXT_ROUTE, f as DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE, g as DEFAULT_MCP_PUBLIC_ROUTE, h as DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE, l as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, m as DEFAULT_LLMS_TXT_ROUTE, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, o as DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE, t as DEFAULT_AGENTS_MD_ROUTE, v as DEFAULT_MCP_WELL_KNOWN_ROUTE, x as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE } from "./agent-BK7q65dn.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/robots.ts
|
|
5
|
+
const DEFAULT_ROBOTS_TXT_ROUTE = "/robots.txt";
|
|
6
|
+
const DOCS_ROBOTS_GENERATED_BLOCK_START = "# BEGIN @farming-labs/docs robots";
|
|
7
|
+
const DOCS_ROBOTS_GENERATED_BLOCK_END = "# END @farming-labs/docs robots";
|
|
8
|
+
const DEFAULT_DOCS_AI_ROBOTS_USER_AGENTS = [
|
|
9
|
+
"GPTBot",
|
|
10
|
+
"ChatGPT-User",
|
|
11
|
+
"OAI-SearchBot",
|
|
12
|
+
"ClaudeBot",
|
|
13
|
+
"Claude-User",
|
|
14
|
+
"anthropic-ai",
|
|
15
|
+
"CCBot",
|
|
16
|
+
"Google-Extended"
|
|
17
|
+
];
|
|
18
|
+
function normalizeRoute(value) {
|
|
19
|
+
const trimmed = value.trim();
|
|
20
|
+
if (!trimmed) return "/";
|
|
21
|
+
return trimmed.startsWith("/") ? trimmed.replace(/\/{2,}/g, "/") : `/${trimmed}`;
|
|
22
|
+
}
|
|
23
|
+
function normalizeBaseUrl(value) {
|
|
24
|
+
if (!value) return void 0;
|
|
25
|
+
try {
|
|
26
|
+
const url = new URL(value);
|
|
27
|
+
url.pathname = url.pathname.replace(/\/+$/, "");
|
|
28
|
+
url.search = "";
|
|
29
|
+
url.hash = "";
|
|
30
|
+
return url.toString().replace(/\/+$/, "");
|
|
31
|
+
} catch {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function normalizeStringArray(value) {
|
|
36
|
+
if (Array.isArray(value)) return value;
|
|
37
|
+
return value ? [value] : [];
|
|
38
|
+
}
|
|
39
|
+
function normalizeAiPolicy(value) {
|
|
40
|
+
return value === false || value === "disallow" ? "disallow" : "allow";
|
|
41
|
+
}
|
|
42
|
+
function unique(values) {
|
|
43
|
+
return [...new Set(values.filter(Boolean))];
|
|
44
|
+
}
|
|
45
|
+
function resolveDocsRobotsConfig(input, options = {}) {
|
|
46
|
+
if (input === false) return {
|
|
47
|
+
enabled: false,
|
|
48
|
+
ai: "allow",
|
|
49
|
+
userAgents: [...DEFAULT_DOCS_AI_ROBOTS_USER_AGENTS],
|
|
50
|
+
extraRules: []
|
|
51
|
+
};
|
|
52
|
+
const config = typeof input === "object" ? input : {};
|
|
53
|
+
return {
|
|
54
|
+
enabled: config.enabled ?? true,
|
|
55
|
+
path: config.path,
|
|
56
|
+
baseUrl: normalizeBaseUrl(config.baseUrl) ?? normalizeBaseUrl(options.baseUrl),
|
|
57
|
+
ai: normalizeAiPolicy(config.ai),
|
|
58
|
+
userAgents: unique([...DEFAULT_DOCS_AI_ROBOTS_USER_AGENTS, ...normalizeStringArray(config.aiUserAgents)]),
|
|
59
|
+
extraRules: config.extraRules ?? []
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function getDocsRobotsAllowRoutes(options = {}) {
|
|
63
|
+
const normalizedEntry = normalizeDocsPathSegment(options.entry ?? "docs") || "docs";
|
|
64
|
+
const sitemapConfig = resolveDocsSitemapConfig(options.sitemap);
|
|
65
|
+
const routes = [
|
|
66
|
+
"/",
|
|
67
|
+
`/${normalizedEntry}`,
|
|
68
|
+
`/${normalizedEntry}/`,
|
|
69
|
+
`/${normalizedEntry}.md`,
|
|
70
|
+
`/${normalizedEntry}/*.md`,
|
|
71
|
+
DEFAULT_LLMS_TXT_ROUTE,
|
|
72
|
+
DEFAULT_LLMS_FULL_TXT_ROUTE,
|
|
73
|
+
DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE,
|
|
74
|
+
DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE,
|
|
75
|
+
DEFAULT_SKILL_MD_ROUTE,
|
|
76
|
+
DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE,
|
|
77
|
+
DEFAULT_AGENTS_MD_ROUTE,
|
|
78
|
+
DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE,
|
|
79
|
+
DEFAULT_AGENT_MD_ROUTE,
|
|
80
|
+
DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE,
|
|
81
|
+
DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE,
|
|
82
|
+
DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE,
|
|
83
|
+
DEFAULT_MCP_PUBLIC_ROUTE,
|
|
84
|
+
DEFAULT_MCP_WELL_KNOWN_ROUTE
|
|
85
|
+
];
|
|
86
|
+
if (sitemapConfig.enabled) {
|
|
87
|
+
if (sitemapConfig.xml.enabled) routes.push(sitemapConfig.xml.route);
|
|
88
|
+
if (sitemapConfig.markdown.enabled) routes.push(sitemapConfig.markdown.route, sitemapConfig.markdown.wellKnownRoute);
|
|
89
|
+
}
|
|
90
|
+
return unique(routes.map(normalizeRoute));
|
|
91
|
+
}
|
|
92
|
+
function sitemapUrls(robots, sitemap) {
|
|
93
|
+
const sitemapConfig = resolveDocsSitemapConfig(sitemap, { baseUrl: robots.baseUrl });
|
|
94
|
+
if (!robots.baseUrl || !sitemapConfig.enabled || !sitemapConfig.xml.enabled) return [];
|
|
95
|
+
try {
|
|
96
|
+
return [new URL(sitemapConfig.xml.route, `${robots.baseUrl}/`).toString()];
|
|
97
|
+
} catch {
|
|
98
|
+
return [];
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function appendRule(lines, rule) {
|
|
102
|
+
const userAgents = normalizeStringArray(rule.userAgent);
|
|
103
|
+
if (userAgents.length === 0) return;
|
|
104
|
+
lines.push("");
|
|
105
|
+
for (const userAgent of userAgents) lines.push(`User-agent: ${userAgent}`);
|
|
106
|
+
for (const route of normalizeStringArray(rule.allow)) lines.push(`Allow: ${normalizeRoute(route)}`);
|
|
107
|
+
for (const route of normalizeStringArray(rule.disallow)) lines.push(`Disallow: ${normalizeRoute(route)}`);
|
|
108
|
+
if (typeof rule.crawlDelay === "number" && Number.isFinite(rule.crawlDelay)) lines.push(`Crawl-delay: ${rule.crawlDelay}`);
|
|
109
|
+
}
|
|
110
|
+
function renderDocsRobotsTxt(options = {}) {
|
|
111
|
+
const robots = resolveDocsRobotsConfig(options.robots, { baseUrl: options.baseUrl });
|
|
112
|
+
if (!robots.enabled) return "";
|
|
113
|
+
const lines = [
|
|
114
|
+
"# Generated by @farming-labs/docs.",
|
|
115
|
+
"# Edit docs.config or rerun `docs robots generate --append` / `--force`.",
|
|
116
|
+
"",
|
|
117
|
+
"User-agent: *"
|
|
118
|
+
];
|
|
119
|
+
for (const route of getDocsRobotsAllowRoutes(options)) lines.push(`Allow: ${route}`);
|
|
120
|
+
for (const userAgent of robots.userAgents) {
|
|
121
|
+
lines.push("", `User-agent: ${userAgent}`);
|
|
122
|
+
lines.push(robots.ai === "allow" ? "Allow: /" : "Disallow: /");
|
|
123
|
+
}
|
|
124
|
+
for (const rule of robots.extraRules) appendRule(lines, rule);
|
|
125
|
+
const sitemap = sitemapUrls(robots, options.sitemap);
|
|
126
|
+
if (sitemap.length > 0) {
|
|
127
|
+
lines.push("");
|
|
128
|
+
for (const url of sitemap) lines.push(`Sitemap: ${url}`);
|
|
129
|
+
}
|
|
130
|
+
return `${lines.join("\n")}\n`;
|
|
131
|
+
}
|
|
132
|
+
function resolveDocsRobotsRequest(url, robots) {
|
|
133
|
+
const pathname = normalizeRoute(url.pathname);
|
|
134
|
+
const format = url.searchParams.get("format")?.trim();
|
|
135
|
+
if (pathname === "/api/docs" && format === "robots") return "robots";
|
|
136
|
+
if (!resolveDocsRobotsConfig(robots).enabled) return null;
|
|
137
|
+
return pathname === DEFAULT_ROBOTS_TXT_ROUTE ? "robots" : null;
|
|
138
|
+
}
|
|
139
|
+
function createDocsRobotsResponse({ request, ...options }) {
|
|
140
|
+
const url = new URL(request.url);
|
|
141
|
+
if (!resolveDocsRobotsRequest(url, options.robots)) return null;
|
|
142
|
+
const content = renderDocsRobotsTxt({
|
|
143
|
+
...options,
|
|
144
|
+
baseUrl: options.baseUrl ?? url.origin
|
|
145
|
+
});
|
|
146
|
+
if (!content) return null;
|
|
147
|
+
return new Response(content, { headers: {
|
|
148
|
+
"Content-Type": "text/plain; charset=utf-8",
|
|
149
|
+
"Cache-Control": "public, max-age=0, s-maxage=3600"
|
|
150
|
+
} });
|
|
151
|
+
}
|
|
152
|
+
function renderDocsRobotsGeneratedBlock(options = {}) {
|
|
153
|
+
return `${DOCS_ROBOTS_GENERATED_BLOCK_START}\n${renderDocsRobotsTxt(options).trimEnd()}\n${DOCS_ROBOTS_GENERATED_BLOCK_END}\n`;
|
|
154
|
+
}
|
|
155
|
+
function upsertDocsRobotsGeneratedBlock(existing, block) {
|
|
156
|
+
const escapedStart = DOCS_ROBOTS_GENERATED_BLOCK_START.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
157
|
+
const escapedEnd = DOCS_ROBOTS_GENERATED_BLOCK_END.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
158
|
+
const pattern = new RegExp(`${escapedStart}[\\s\\S]*?${escapedEnd}\\n?`);
|
|
159
|
+
if (pattern.test(existing)) return existing.replace(pattern, block);
|
|
160
|
+
const prefix = existing.trimEnd();
|
|
161
|
+
return `${prefix}${prefix ? "\n\n" : ""}${block}`;
|
|
162
|
+
}
|
|
163
|
+
function blockForUserAgent(content, userAgent) {
|
|
164
|
+
const escaped = userAgent.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
165
|
+
return content.match(new RegExp(`(?:^|\\n)\\s*User-agent:\\s*${escaped}\\s*(?:\\n[ \\t]*(?!User-agent:).*)*`, "i"))?.[0] ?? "";
|
|
166
|
+
}
|
|
167
|
+
function disallowsRoute(content, route) {
|
|
168
|
+
const escapedRoute = route.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
169
|
+
return new RegExp(`^\\s*Disallow:\\s*${escapedRoute}(?:\\s|$)`, "im").test(content);
|
|
170
|
+
}
|
|
171
|
+
function analyzeDocsRobotsTxt(content, options = {}) {
|
|
172
|
+
const expectedRoutes = getDocsRobotsAllowRoutes(options).filter((route) => [
|
|
173
|
+
DEFAULT_LLMS_TXT_ROUTE,
|
|
174
|
+
DEFAULT_LLMS_FULL_TXT_ROUTE,
|
|
175
|
+
DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE,
|
|
176
|
+
DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE,
|
|
177
|
+
DEFAULT_AGENTS_MD_ROUTE,
|
|
178
|
+
DEFAULT_SKILL_MD_ROUTE,
|
|
179
|
+
DEFAULT_MCP_PUBLIC_ROUTE
|
|
180
|
+
].includes(route) || route.includes("sitemap"));
|
|
181
|
+
const missingRoutes = expectedRoutes.filter((route) => !content.includes(route));
|
|
182
|
+
return {
|
|
183
|
+
blocksAgentRoutes: /Disallow:\s*\/(?:\s|$)/i.test(blockForUserAgent(content, "*")) || expectedRoutes.some((route) => disallowsRoute(content, route)),
|
|
184
|
+
blocksAiAgents: DEFAULT_DOCS_AI_ROBOTS_USER_AGENTS.some((userAgent) => /Disallow:\s*\/(?:\s|$)/i.test(blockForUserAgent(content, userAgent))),
|
|
185
|
+
hasAgentRoutes: missingRoutes.length === 0,
|
|
186
|
+
hasAiPolicy: DEFAULT_DOCS_AI_ROBOTS_USER_AGENTS.some((userAgent) => content.includes(userAgent)),
|
|
187
|
+
missingRoutes
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
//#endregion
|
|
192
|
+
export { analyzeDocsRobotsTxt as a, renderDocsRobotsGeneratedBlock as c, resolveDocsRobotsRequest as d, upsertDocsRobotsGeneratedBlock as f, DOCS_ROBOTS_GENERATED_BLOCK_START as i, renderDocsRobotsTxt as l, DEFAULT_ROBOTS_TXT_ROUTE as n, createDocsRobotsResponse as o, DOCS_ROBOTS_GENERATED_BLOCK_END as r, getDocsRobotsAllowRoutes as s, DEFAULT_DOCS_AI_ROBOTS_USER_AGENTS as t, resolveDocsRobotsConfig as u };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import "./agent-BK7q65dn.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-DDrj6Cpo.mjs";
|
|
3
|
+
import { d as readTopLevelStringProperty, f as resolveDocsConfigPath, i as loadDocsConfigModule, o as readBooleanProperty, t as extractNestedObjectLiteral, u as readStringProperty } from "./config-Cio3byUJ.mjs";
|
|
3
4
|
import { t as detectFramework } from "./utils-AmYxHDoz.mjs";
|
|
4
5
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
5
6
|
import path from "node:path";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as buildDocsSearchDocuments, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter } from "./search-BL7o2rXk.mjs";
|
|
2
|
-
import "./sitemap-server-
|
|
2
|
+
import "./sitemap-server-DJvxOqX2.mjs";
|
|
3
3
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
4
4
|
import "./server.mjs";
|
|
5
|
-
import { a as loadProjectEnv, d as readTopLevelStringProperty, f as resolveDocsConfigPath, p as resolveDocsContentDir } from "./config-
|
|
5
|
+
import { a as loadProjectEnv, d as readTopLevelStringProperty, f as resolveDocsConfigPath, p as resolveDocsContentDir } from "./config-Cio3byUJ.mjs";
|
|
6
6
|
import { readFileSync } from "node:fs";
|
|
7
7
|
import pc from "picocolors";
|
|
8
8
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as DocsObservabilityEventInput, Ct as ResolvedDocsRelatedLink, J as DocsSearchConfig, K as DocsSearchAdapterFactory, Nt as TypesenseDocsSearchConfig, Q as DocsSearchResult, R as DocsObservabilityConfig, W as DocsSearchAdapter, Y as DocsSearchDocument, _ as DocsAnalyticsConfig, d as CustomDocsSearchConfig, dt as McpDocsSearchConfig, et as DocsSearchSourcePage, k as DocsAskAIMcpConfig, m as DocsAgentTraceEventInput, q as DocsSearchChunkingConfig, r as AlgoliaDocsSearchConfig, tt as DocsSitemapConfig, v as DocsAnalyticsEvent, y as DocsAnalyticsEventInput, z as DocsObservabilityEvent } from "./types-
|
|
1
|
+
import { B as DocsObservabilityEventInput, Ct as ResolvedDocsRelatedLink, J as DocsSearchConfig, K as DocsSearchAdapterFactory, Nt as TypesenseDocsSearchConfig, Q as DocsSearchResult, R as DocsObservabilityConfig, W as DocsSearchAdapter, Y as DocsSearchDocument, _ as DocsAnalyticsConfig, d as CustomDocsSearchConfig, dt as McpDocsSearchConfig, et as DocsSearchSourcePage, k as DocsAskAIMcpConfig, m as DocsAgentTraceEventInput, q as DocsSearchChunkingConfig, r as AlgoliaDocsSearchConfig, tt as DocsSitemapConfig, v as DocsAnalyticsEvent, y as DocsAnalyticsEventInput, z as DocsObservabilityEvent } from "./types-BSnCAFHc.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/cloud-analytics.d.ts
|
|
4
4
|
interface DocsCloudAnalyticsOptions {
|
package/dist/server.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as DocsConfig, B as DocsObservabilityEventInput, D as DocsAskAIFeedbackMessage, E as DocsAskAIFeedbackData, G as DocsSearchAdapterContext, J as DocsSearchConfig, K as DocsSearchAdapterFactory, O as DocsAskAIFeedbackValue, Q as DocsSearchResult, R as DocsObservabilityConfig, T as DocsAskAIFeedbackConfig, W as DocsSearchAdapter, Y as DocsSearchDocument, Z as DocsSearchQuery, _ as DocsAnalyticsConfig, a as ApiReferenceRenderer, dt as McpDocsSearchConfig, et as DocsSearchSourcePage, g as DocsAgentTraceStatus, h as DocsAgentTraceEventType, k as DocsAskAIMcpConfig, m as DocsAgentTraceEventInput, mt as OpenDocsProvider, tt as DocsSitemapConfig, v as DocsAnalyticsEvent, y as DocsAnalyticsEventInput, z as DocsObservabilityEvent } from "./types-
|
|
2
|
-
import { A as toDocsSitemapMarkdownUrl, B as resolveDocsAnalyticsConfig, C as createDocsSitemapResponse, D as resolveDocsSitemapConfig, E as renderDocsSitemapXml, F as createDocsAgentTraceContext, H as DocsCloudAnalyticsOptions, I as createDocsAgentTraceId, L as emitDocsAgentTraceEvent, M as DocsAgentTraceContext, N as ResolvedDocsAnalyticsConfig, O as resolveDocsSitemapPageLastmod, P as ResolvedDocsObservabilityConfig, R as emitDocsAnalyticsEvent, S as buildDocsSitemapManifest, T as renderDocsSitemapMarkdown, U as createDocsCloudAnalytics, V as resolveDocsObservabilityConfig, _ as DocsSitemapFormat, a as createMcpSearchAdapter, b as DocsSitemapPageInput, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, f as resolveSearchRequestConfig, g as DEFAULT_SITEMAP_XML_ROUTE, h as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, i as createCustomSearchAdapter, j as DOCS_AGENT_TRACE_EVENT_TYPES, k as resolveDocsSitemapRequest, l as inferDocsAskAIPackageHints, m as DEFAULT_SITEMAP_MD_ROUTE, n as buildDocsSearchDocuments, o as createSimpleSearchAdapter, p as DEFAULT_SITEMAP_MANIFEST_PATH, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, u as performDocsSearch, v as DocsSitemapManifest, w as readDocsSitemapManifestFromContentMap, x as DocsSitemapResolvedConfig, y as DocsSitemapManifestPage, z as emitDocsObservabilityEvent } from "./search-
|
|
1
|
+
import { A as DocsConfig, B as DocsObservabilityEventInput, D as DocsAskAIFeedbackMessage, E as DocsAskAIFeedbackData, G as DocsSearchAdapterContext, J as DocsSearchConfig, K as DocsSearchAdapterFactory, O as DocsAskAIFeedbackValue, Q as DocsSearchResult, R as DocsObservabilityConfig, T as DocsAskAIFeedbackConfig, W as DocsSearchAdapter, Y as DocsSearchDocument, Z as DocsSearchQuery, _ as DocsAnalyticsConfig, a as ApiReferenceRenderer, dt as McpDocsSearchConfig, et as DocsSearchSourcePage, g as DocsAgentTraceStatus, h as DocsAgentTraceEventType, k as DocsAskAIMcpConfig, m as DocsAgentTraceEventInput, mt as OpenDocsProvider, tt as DocsSitemapConfig, v as DocsAnalyticsEvent, y as DocsAnalyticsEventInput, z as DocsObservabilityEvent } from "./types-BSnCAFHc.mjs";
|
|
2
|
+
import { A as toDocsSitemapMarkdownUrl, B as resolveDocsAnalyticsConfig, C as createDocsSitemapResponse, D as resolveDocsSitemapConfig, E as renderDocsSitemapXml, F as createDocsAgentTraceContext, H as DocsCloudAnalyticsOptions, I as createDocsAgentTraceId, L as emitDocsAgentTraceEvent, M as DocsAgentTraceContext, N as ResolvedDocsAnalyticsConfig, O as resolveDocsSitemapPageLastmod, P as ResolvedDocsObservabilityConfig, R as emitDocsAnalyticsEvent, S as buildDocsSitemapManifest, T as renderDocsSitemapMarkdown, U as createDocsCloudAnalytics, V as resolveDocsObservabilityConfig, _ as DocsSitemapFormat, a as createMcpSearchAdapter, b as DocsSitemapPageInput, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, f as resolveSearchRequestConfig, g as DEFAULT_SITEMAP_XML_ROUTE, h as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, i as createCustomSearchAdapter, j as DOCS_AGENT_TRACE_EVENT_TYPES, k as resolveDocsSitemapRequest, l as inferDocsAskAIPackageHints, m as DEFAULT_SITEMAP_MD_ROUTE, n as buildDocsSearchDocuments, o as createSimpleSearchAdapter, p as DEFAULT_SITEMAP_MANIFEST_PATH, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, u as performDocsSearch, v as DocsSitemapManifest, w as readDocsSitemapManifestFromContentMap, x as DocsSitemapResolvedConfig, y as DocsSitemapManifestPage, z as emitDocsObservabilityEvent } from "./search-BlXlCmne.mjs";
|
|
3
3
|
import { DocsMcpHttpHandlers, DocsMcpNavigationNode, DocsMcpNavigationTree, DocsMcpPage, DocsMcpResolvedConfig, DocsMcpSource, createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, normalizeDocsMcpRoute, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/api-reference.d.ts
|
package/dist/server.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A as resolveDocsAnalyticsConfig, D as emitDocsAgentTraceEvent, E as createDocsAgentTraceId, M as createDocsCloudAnalytics, O as emitDocsAnalyticsEvent, T as createDocsAgentTraceContext, a as createMcpSearchAdapter, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, f as resolveSearchRequestConfig, i as createCustomSearchAdapter, j as resolveDocsObservabilityConfig, k as emitDocsObservabilityEvent, l as inferDocsAskAIPackageHints, n as buildDocsSearchDocuments, o as createSimpleSearchAdapter, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, u as performDocsSearch, w as DOCS_AGENT_TRACE_EVENT_TYPES } from "./search-BL7o2rXk.mjs";
|
|
2
2
|
import { a as buildDocsSitemapManifest, c as renderDocsSitemapMarkdown, d as resolveDocsSitemapPageLastmod, f as resolveDocsSitemapRequest, i as DEFAULT_SITEMAP_XML_ROUTE, l as renderDocsSitemapXml, n as DEFAULT_SITEMAP_MD_ROUTE, o as createDocsSitemapResponse, p as toDocsSitemapMarkdownUrl, r as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, s as readDocsSitemapManifestFromContentMap, t as DEFAULT_SITEMAP_MANIFEST_PATH, u as resolveDocsSitemapConfig } from "./sitemap-CnqcTdQg.mjs";
|
|
3
|
-
import { _ as isApiReferenceOpenApiRequest, a as resolvePromptProviderChoices, b as resolveApiReferenceRenderer, c as serializeDocsIconRegistry, d as buildApiReferenceHtmlDocument, f as buildApiReferenceHtmlDocumentAsync, g as buildApiReferenceScalarCss, h as buildApiReferencePageTitle, i as parsePromptStringArray, l as serializeOpenDocsProviders, m as buildApiReferenceOpenApiDocumentAsync, n as DEFAULT_PROMPT_PROVIDER_TEMPLATES, o as sanitizePromptText, p as buildApiReferenceOpenApiDocument, r as normalizePromptProviderName, s as serializeDocsIcon, t as readDocsSitemapManifest, u as DEFAULT_API_REFERENCE_OPENAPI_ROUTE, v as resolveApiReferenceConfig, y as resolveApiReferenceOpenApiDiscovery } from "./sitemap-server-
|
|
3
|
+
import { _ as isApiReferenceOpenApiRequest, a as resolvePromptProviderChoices, b as resolveApiReferenceRenderer, c as serializeDocsIconRegistry, d as buildApiReferenceHtmlDocument, f as buildApiReferenceHtmlDocumentAsync, g as buildApiReferenceScalarCss, h as buildApiReferencePageTitle, i as parsePromptStringArray, l as serializeOpenDocsProviders, m as buildApiReferenceOpenApiDocumentAsync, n as DEFAULT_PROMPT_PROVIDER_TEMPLATES, o as sanitizePromptText, p as buildApiReferenceOpenApiDocument, r as normalizePromptProviderName, s as serializeDocsIcon, t as readDocsSitemapManifest, u as DEFAULT_API_REFERENCE_OPENAPI_ROUTE, v as resolveApiReferenceConfig, y as resolveApiReferenceOpenApiDiscovery } from "./sitemap-server-DJvxOqX2.mjs";
|
|
4
4
|
import { createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, normalizeDocsMcpRoute, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
5
5
|
|
|
6
6
|
export { DEFAULT_API_REFERENCE_OPENAPI_ROUTE, DEFAULT_PROMPT_PROVIDER_TEMPLATES, DEFAULT_SITEMAP_MANIFEST_PATH, DEFAULT_SITEMAP_MD_ROUTE, DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, DEFAULT_SITEMAP_XML_ROUTE, DOCS_AGENT_TRACE_EVENT_TYPES, buildApiReferenceHtmlDocument, buildApiReferenceHtmlDocumentAsync, buildApiReferenceOpenApiDocument, buildApiReferenceOpenApiDocumentAsync, buildApiReferencePageTitle, buildApiReferenceScalarCss, buildDocsAskAIContext, buildDocsSearchDocuments, buildDocsSitemapManifest, createAlgoliaSearchAdapter, createCustomSearchAdapter, createDocsAgentTraceContext, createDocsAgentTraceId, createDocsCloudAnalytics, createDocsMcpHttpHandler, createDocsMcpServer, createDocsSitemapResponse, createFilesystemDocsMcpSource, createMcpSearchAdapter, createSimpleSearchAdapter, createTypesenseSearchAdapter, emitDocsAgentTraceEvent, emitDocsAnalyticsEvent, emitDocsObservabilityEvent, formatDocsAskAIPackageHints, inferDocsAskAIPackageHints, isApiReferenceOpenApiRequest, normalizeDocsMcpRoute, normalizePromptProviderName, parsePromptStringArray, performDocsSearch, readDocsSitemapManifest, readDocsSitemapManifestFromContentMap, renderDocsSitemapMarkdown, renderDocsSitemapXml, resolveApiReferenceConfig, resolveApiReferenceOpenApiDiscovery, resolveApiReferenceRenderer, resolveAskAISearchRequestConfig, resolveDocsAnalyticsConfig, resolveDocsMcpConfig, resolveDocsObservabilityConfig, resolveDocsSitemapConfig, resolveDocsSitemapPageLastmod, resolveDocsSitemapRequest, resolvePromptProviderChoices, resolveSearchRequestConfig, runDocsMcpStdio, sanitizePromptText, serializeDocsIcon, serializeDocsIconRegistry, serializeOpenDocsProviders, toDocsSitemapMarkdownUrl };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "./search-BL7o2rXk.mjs";
|
|
2
2
|
import { a as buildDocsSitemapManifest, c as renderDocsSitemapMarkdown, l as renderDocsSitemapXml, u as resolveDocsSitemapConfig } from "./sitemap-CnqcTdQg.mjs";
|
|
3
|
-
import "./sitemap-server-
|
|
3
|
+
import "./sitemap-server-DJvxOqX2.mjs";
|
|
4
4
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
5
5
|
import "./server.mjs";
|
|
6
|
-
import { c as readNavTitle, d as readTopLevelStringProperty, f as resolveDocsConfigPath, i as loadDocsConfigModule, o as readBooleanProperty, p as resolveDocsContentDir, t as extractNestedObjectLiteral, u as readStringProperty } from "./config-
|
|
6
|
+
import { c as readNavTitle, d as readTopLevelStringProperty, f as resolveDocsConfigPath, i as loadDocsConfigModule, o as readBooleanProperty, p as resolveDocsContentDir, t as extractNestedObjectLiteral, u as readStringProperty } from "./config-Cio3byUJ.mjs";
|
|
7
7
|
import { t as detectFramework } from "./utils-AmYxHDoz.mjs";
|
|
8
8
|
import { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
|
|
9
9
|
import path from "node:path";
|
|
@@ -1270,7 +1270,7 @@ import { createDocsServer } from "@farming-labs/svelte/server";
|
|
|
1270
1270
|
import config from "${svelteServerConfigImport(cfg.useAlias)}";
|
|
1271
1271
|
|
|
1272
1272
|
// preload for production
|
|
1273
|
-
const contentFiles = import.meta.glob(["/${cfg.entry ?? "docs"}/**/*.{md,mdx,svx}", "/skill.md", "/.farming-labs/sitemap-manifest.json"], {
|
|
1273
|
+
const contentFiles = import.meta.glob(["/${cfg.entry ?? "docs"}/**/*.{md,mdx,svx}", "/AGENTS.md", "/AGENT.md", "/skill.md", "/.farming-labs/sitemap-manifest.json"], {
|
|
1274
1274
|
query: "?raw",
|
|
1275
1275
|
import: "default",
|
|
1276
1276
|
eager: true,
|
|
@@ -1684,7 +1684,7 @@ function astroDocsServerTemplate(cfg) {
|
|
|
1684
1684
|
import { createDocsServer } from "@farming-labs/astro/server";
|
|
1685
1685
|
import config from "${astroServerConfigImport(cfg.useAlias)}";
|
|
1686
1686
|
|
|
1687
|
-
const contentFiles = import.meta.glob(["/${cfg.entry ?? "docs"}/**/*.{md,mdx}", "/skill.md", "/.farming-labs/sitemap-manifest.json"], {
|
|
1687
|
+
const contentFiles = import.meta.glob(["/${cfg.entry ?? "docs"}/**/*.{md,mdx}", "/AGENTS.md", "/AGENT.md", "/skill.md", "/.farming-labs/sitemap-manifest.json"], {
|
|
1688
1688
|
query: "?raw",
|
|
1689
1689
|
import: "default",
|
|
1690
1690
|
eager: true,
|
|
@@ -635,7 +635,7 @@ interface PageActionsConfig {
|
|
|
635
635
|
type DocsAnalyticsSource = "client" | "server" | "mcp";
|
|
636
636
|
type DocsAgentTraceStatus = "started" | "success" | "error" | "retry" | "timeout";
|
|
637
637
|
type DocsAgentTraceEventType = "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";
|
|
638
|
-
type DocsAnalyticsEventType = "page_view" | "search_open" | "search_close" | "search_query" | "search_result_click" | "search_error" | "ai_open" | "ai_close" | "ai_question" | "ai_response" | "ai_feedback" | "ai_error" | "ai_clear" | "page_action_copy_markdown" | "page_action_open_docs_menu" | "page_action_open_docs" | "code_block_copy" | "feedback_select" | "feedback_submit" | "feedback_error" | "agent_read" | "agent_spec_request" | "agent_feedback_schema" | "agent_feedback_submit" | "agent_feedback_error" | "markdown_request" | "llms_request" | "skill_request" | "api_search" | "api_ai_request" | "api_ai_response" | "api_ai_error" | "mcp_request" | "mcp_tool";
|
|
638
|
+
type DocsAnalyticsEventType = "page_view" | "search_open" | "search_close" | "search_query" | "search_result_click" | "search_error" | "ai_open" | "ai_close" | "ai_question" | "ai_response" | "ai_feedback" | "ai_error" | "ai_clear" | "page_action_copy_markdown" | "page_action_open_docs_menu" | "page_action_open_docs" | "code_block_copy" | "feedback_select" | "feedback_submit" | "feedback_error" | "agent_read" | "agent_spec_request" | "agents_request" | "agent_feedback_schema" | "agent_feedback_submit" | "agent_feedback_error" | "markdown_request" | "llms_request" | "skill_request" | "api_search" | "api_ai_request" | "api_ai_response" | "api_ai_error" | "mcp_request" | "mcp_tool";
|
|
639
639
|
interface DocsAnalyticsInput {
|
|
640
640
|
query?: string;
|
|
641
641
|
question?: string;
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|