@farming-labs/docs 0.1.80 → 0.1.82
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-D76WplUI.mjs → agent-D97eZuWH.mjs} +5 -4
- package/dist/cli/index.mjs +33 -10
- package/dist/{dev-zn7AkGBT.mjs → dev-D4aVZkZl.mjs} +2 -2
- package/dist/{doctor-pbHJkh6g.mjs → doctor-DHUZK-iX.mjs} +86 -8
- package/dist/index.d.mts +48 -3
- package/dist/index.mjs +6 -4
- package/dist/{init-BBdFgtTm.mjs → init-Bt-RwmSW.mjs} +2 -2
- package/dist/{mcp-BPW62uf-.mjs → mcp-OVgCyHrR.mjs} +3 -3
- package/dist/mcp.d.mts +1 -1
- package/dist/mcp.mjs +2 -1
- package/dist/reading-time-pKUeloSI.mjs +315 -0
- package/dist/related-BNj_NdHq.mjs +50 -0
- package/dist/{agent-Dk06hytz.mjs → robots-DCR-ZFLO.mjs} +199 -315
- package/dist/robots-Div3kkxI.mjs +177 -0
- package/dist/{search-kP0mAXCp.mjs → search-B5ze-heM.mjs} +1 -50
- package/dist/{search-D6uAGmiH.d.mts → search-BH07-Otd.d.mts} +1 -1
- package/dist/{search-DD2SP_hD.mjs → search-BIL0Zap1.mjs} +3 -3
- package/dist/server.d.mts +2 -2
- package/dist/server.mjs +3 -3
- package/dist/{sitemap-DCR8tuA7.mjs → sitemap-C2ocmew_.mjs} +5 -5
- package/dist/{sitemap-server-B370zkEo.mjs → sitemap-server-C8Ppk29g.mjs} +1 -1
- package/dist/{types-OAHZJ7NI.d.mts → types-Ch0kE7uS.d.mts} +57 -1
- package/dist/{upgrade-upRj5Fw-.mjs → upgrade-D9c60phM.mjs} +1 -1
- package/package.json +1 -1
- /package/dist/{config-C7sUsMkm.mjs → config-BR6CcCfr.mjs} +0 -0
- /package/dist/{sitemap-Buobvabq.mjs → sitemap-Ccfh6GXO.mjs} +0 -0
- /package/dist/{templates-BIk7zhQ3.mjs → templates-CtPtjNu5.mjs} +0 -0
- /package/dist/{utils-l0lcezN8.mjs → utils-AmYxHDoz.mjs} +0 -0
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { i as DOCS_ROBOTS_GENERATED_BLOCK_START, l as resolveDocsRobotsConfig, r as DOCS_ROBOTS_GENERATED_BLOCK_END, s as renderDocsRobotsGeneratedBlock, u as upsertDocsRobotsGeneratedBlock } from "./robots-DCR-ZFLO.mjs";
|
|
2
|
+
import { d as readTopLevelStringProperty, f as resolveDocsConfigPath, i as loadDocsConfigModule, o as readBooleanProperty, t as extractNestedObjectLiteral, u as readStringProperty } from "./config-BR6CcCfr.mjs";
|
|
3
|
+
import { t as detectFramework } from "./utils-AmYxHDoz.mjs";
|
|
4
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import pc from "picocolors";
|
|
7
|
+
|
|
8
|
+
//#region src/cli/robots.ts
|
|
9
|
+
function parseInlineFlag(arg) {
|
|
10
|
+
const [rawKey, value] = arg.slice(2).split("=", 2);
|
|
11
|
+
return {
|
|
12
|
+
key: rawKey.trim(),
|
|
13
|
+
value
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function parseRobotsGenerateArgs(argv) {
|
|
17
|
+
const parsed = {};
|
|
18
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
19
|
+
const arg = argv[index];
|
|
20
|
+
if (arg === "--help" || arg === "-h") {
|
|
21
|
+
parsed.help = true;
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
if (arg === "--append") {
|
|
25
|
+
parsed.append = true;
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
if (arg === "--force") {
|
|
29
|
+
parsed.force = true;
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
if (arg === "--check") {
|
|
33
|
+
parsed.check = true;
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
if (arg.startsWith("--config=")) {
|
|
37
|
+
const value = parseInlineFlag(arg).value;
|
|
38
|
+
if (!value) throw new Error("Missing value for --config.");
|
|
39
|
+
parsed.configPath = value;
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (arg === "--config") {
|
|
43
|
+
const value = argv[index + 1];
|
|
44
|
+
if (!value || value.startsWith("--")) throw new Error("Missing value for --config.");
|
|
45
|
+
parsed.configPath = value;
|
|
46
|
+
index += 1;
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
if (arg.startsWith("--path=")) {
|
|
50
|
+
const value = parseInlineFlag(arg).value;
|
|
51
|
+
if (!value) throw new Error("Missing value for --path.");
|
|
52
|
+
parsed.path = value;
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
if (arg === "--path") {
|
|
56
|
+
const value = argv[index + 1];
|
|
57
|
+
if (!value || value.startsWith("--")) throw new Error("Missing value for --path.");
|
|
58
|
+
parsed.path = value;
|
|
59
|
+
index += 1;
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
if (!arg.startsWith("--") && !parsed.path) {
|
|
63
|
+
parsed.path = arg;
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
throw new Error(`Unknown robots generate flag: ${arg}.`);
|
|
67
|
+
}
|
|
68
|
+
if (parsed.append && parsed.force) throw new Error("Use either --append or --force, not both.");
|
|
69
|
+
return parsed;
|
|
70
|
+
}
|
|
71
|
+
function readTopLevelBooleanProperty(content, key) {
|
|
72
|
+
const match = content.match(new RegExp(`\\b${key}\\b\\s*:\\s*(true|false)`));
|
|
73
|
+
return match ? match[1] === "true" : void 0;
|
|
74
|
+
}
|
|
75
|
+
function readLlmsBaseUrlFromConfig(content, config) {
|
|
76
|
+
if (config?.llmsTxt && typeof config.llmsTxt === "object") return config.llmsTxt.baseUrl;
|
|
77
|
+
const block = extractNestedObjectLiteral(content, ["llmsTxt"]);
|
|
78
|
+
return block ? readStringProperty(block, "baseUrl") : void 0;
|
|
79
|
+
}
|
|
80
|
+
function readSitemapConfigFromStatic(content) {
|
|
81
|
+
const topLevelBoolean = readTopLevelBooleanProperty(content, "sitemap");
|
|
82
|
+
if (typeof topLevelBoolean === "boolean") return topLevelBoolean;
|
|
83
|
+
const block = extractNestedObjectLiteral(content, ["sitemap"]);
|
|
84
|
+
if (!block) return void 0;
|
|
85
|
+
return {
|
|
86
|
+
enabled: readBooleanProperty(block, "enabled") ?? true,
|
|
87
|
+
routePrefix: readStringProperty(block, "routePrefix"),
|
|
88
|
+
baseUrl: readStringProperty(block, "baseUrl"),
|
|
89
|
+
manifestPath: readStringProperty(block, "manifestPath")
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
function readRobotsConfigFromStatic(content) {
|
|
93
|
+
const topLevelBoolean = readTopLevelBooleanProperty(content, "robots");
|
|
94
|
+
if (typeof topLevelBoolean === "boolean") return topLevelBoolean;
|
|
95
|
+
const block = extractNestedObjectLiteral(content, ["robots"]);
|
|
96
|
+
if (!block) return void 0;
|
|
97
|
+
const aiString = readStringProperty(block, "ai");
|
|
98
|
+
const aiBoolean = readBooleanProperty(block, "ai");
|
|
99
|
+
return {
|
|
100
|
+
enabled: readBooleanProperty(block, "enabled") ?? true,
|
|
101
|
+
path: readStringProperty(block, "path"),
|
|
102
|
+
baseUrl: readStringProperty(block, "baseUrl"),
|
|
103
|
+
ai: aiString === "allow" || aiString === "disallow" ? aiString : typeof aiBoolean === "boolean" ? aiBoolean : void 0
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
function resolveConfiguredRobots(content, config) {
|
|
107
|
+
if (config?.robots !== void 0) return config.robots;
|
|
108
|
+
return readRobotsConfigFromStatic(content) ?? true;
|
|
109
|
+
}
|
|
110
|
+
function resolvePublicDir(rootDir) {
|
|
111
|
+
if (detectFramework(rootDir) === "sveltekit") return path.join(rootDir, "static");
|
|
112
|
+
return path.join(rootDir, "public");
|
|
113
|
+
}
|
|
114
|
+
function resolveRobotsPath(rootDir, options, robots) {
|
|
115
|
+
const configuredPath = options.path ?? robots?.path;
|
|
116
|
+
if (configuredPath) return path.isAbsolute(configuredPath) ? configuredPath : path.resolve(rootDir, configuredPath);
|
|
117
|
+
return path.join(resolvePublicDir(rootDir), "robots.txt");
|
|
118
|
+
}
|
|
119
|
+
function writeIfChanged(filePath, content, check) {
|
|
120
|
+
if ((existsSync(filePath) ? readFileSync(filePath, "utf-8") : void 0) === content) return false;
|
|
121
|
+
if (check) return true;
|
|
122
|
+
mkdirSync(path.dirname(filePath), { recursive: true });
|
|
123
|
+
writeFileSync(filePath, content, "utf-8");
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
126
|
+
async function generateRobots(options = {}) {
|
|
127
|
+
const rootDir = process.cwd();
|
|
128
|
+
const loadedConfigModule = await loadDocsConfigModule(rootDir, options.configPath);
|
|
129
|
+
const configContent = readFileSync(loadedConfigModule?.path ?? resolveDocsConfigPath(rootDir, options.configPath), "utf-8");
|
|
130
|
+
const config = loadedConfigModule?.config;
|
|
131
|
+
const entry = config?.entry ?? readTopLevelStringProperty(configContent, "entry") ?? "docs";
|
|
132
|
+
const sitemap = config?.sitemap ?? readSitemapConfigFromStatic(configContent) ?? true;
|
|
133
|
+
const sitemapBaseUrl = typeof sitemap === "object" ? sitemap.baseUrl : void 0;
|
|
134
|
+
const llmsBaseUrl = readLlmsBaseUrlFromConfig(configContent, config);
|
|
135
|
+
const configuredRobots = resolveConfiguredRobots(configContent, config);
|
|
136
|
+
if (configuredRobots === false) throw new Error("Robots generation is disabled by `robots: false`.");
|
|
137
|
+
const robotsInput = typeof configuredRobots === "object" ? configuredRobots : {};
|
|
138
|
+
const robots = resolveDocsRobotsConfig(robotsInput, { baseUrl: robotsInput.baseUrl ?? sitemapBaseUrl ?? llmsBaseUrl });
|
|
139
|
+
if (!robots.enabled) throw new Error("Robots generation is disabled by `robots.enabled: false`.");
|
|
140
|
+
const robotsPath = resolveRobotsPath(rootDir, options, robotsInput);
|
|
141
|
+
const relativeRobotsPath = path.relative(rootDir, robotsPath).replace(/\\/g, "/");
|
|
142
|
+
const generatedBlock = renderDocsRobotsGeneratedBlock({
|
|
143
|
+
entry,
|
|
144
|
+
sitemap,
|
|
145
|
+
baseUrl: robots.baseUrl,
|
|
146
|
+
robots
|
|
147
|
+
});
|
|
148
|
+
const existing = existsSync(robotsPath) ? readFileSync(robotsPath, "utf-8") : void 0;
|
|
149
|
+
const hasGeneratedBlock = existing?.includes(DOCS_ROBOTS_GENERATED_BLOCK_START) === true && existing.includes(DOCS_ROBOTS_GENERATED_BLOCK_END);
|
|
150
|
+
if (existing !== void 0 && !options.force && !options.append && !hasGeneratedBlock) {
|
|
151
|
+
console.log(pc.yellow(`Found existing robots.txt at ${relativeRobotsPath}.`));
|
|
152
|
+
console.log(pc.dim("Keeping the user-owned file. Use --append to add/update the generated block, or --force to replace it."));
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
const changed = writeIfChanged(robotsPath, existing !== void 0 && (options.append || hasGeneratedBlock) ? upsertDocsRobotsGeneratedBlock(existing, generatedBlock) : generatedBlock, options.check === true);
|
|
156
|
+
if (options.check && changed) throw new Error(`Robots output is stale at ${relativeRobotsPath}. Run \`docs robots generate${options.append ? " --append" : options.force ? " --force" : ""}${options.path ? ` --path ${options.path}` : ""}\` to update it.`);
|
|
157
|
+
console.log(changed ? pc.green(`Generated robots policy at ${relativeRobotsPath}.`) : pc.green(`Robots policy is current at ${relativeRobotsPath}.`));
|
|
158
|
+
}
|
|
159
|
+
function printRobotsGenerateHelp() {
|
|
160
|
+
console.log(`
|
|
161
|
+
${pc.bold("docs robots generate")} — Generate a static robots.txt agent access policy.
|
|
162
|
+
|
|
163
|
+
${pc.dim("Usage:")}
|
|
164
|
+
pnpm exec docs ${pc.cyan("robots generate")} ${pc.dim("[path]")}
|
|
165
|
+
|
|
166
|
+
${pc.dim("Options:")}
|
|
167
|
+
${pc.cyan("--path <path>")} Write to a specific robots.txt path; defaults to the framework public directory
|
|
168
|
+
${pc.cyan("--append")} Add or update a generated block inside an existing robots.txt
|
|
169
|
+
${pc.cyan("--force")} Replace the target robots.txt with the generated policy
|
|
170
|
+
${pc.cyan("--check")} Fail if the generated output would change
|
|
171
|
+
${pc.cyan("--config <path>")} Use a custom docs config path instead of ${pc.dim("docs.config.ts[x]")}
|
|
172
|
+
${pc.cyan("-h, --help")} Show this help message
|
|
173
|
+
`);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
//#endregion
|
|
177
|
+
export { generateRobots, parseRobotsGenerateArgs, printRobotsGenerateHelp };
|
|
@@ -217,55 +217,6 @@ async function emitDocsAgentTraceEvent(observability, event) {
|
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
//#endregion
|
|
221
|
-
//#region src/related.ts
|
|
222
|
-
function normalizeDocsRelated(value) {
|
|
223
|
-
if (!Array.isArray(value)) return [];
|
|
224
|
-
const seen = /* @__PURE__ */ new Set();
|
|
225
|
-
const links = [];
|
|
226
|
-
for (const item of value) {
|
|
227
|
-
const parsed = parseRelatedInput(item);
|
|
228
|
-
if (!parsed) continue;
|
|
229
|
-
const dedupeKey = normalizeRelatedLookupPath(parsed.href) ?? parsed.href;
|
|
230
|
-
if (seen.has(dedupeKey)) continue;
|
|
231
|
-
seen.add(dedupeKey);
|
|
232
|
-
links.push({ href: parsed.href });
|
|
233
|
-
}
|
|
234
|
-
return links;
|
|
235
|
-
}
|
|
236
|
-
function renderDocsRelatedMarkdownLines(related) {
|
|
237
|
-
if (!related?.length) return [];
|
|
238
|
-
return [`Related: ${related.map((link) => normalizeInlineText(link.href)).join(", ")}`];
|
|
239
|
-
}
|
|
240
|
-
function parseRelatedInput(value) {
|
|
241
|
-
if (typeof value === "string") {
|
|
242
|
-
const href = cleanString(value);
|
|
243
|
-
return href ? { href } : null;
|
|
244
|
-
}
|
|
245
|
-
return null;
|
|
246
|
-
}
|
|
247
|
-
function cleanString(value) {
|
|
248
|
-
if (typeof value !== "string") return void 0;
|
|
249
|
-
return value.trim() || void 0;
|
|
250
|
-
}
|
|
251
|
-
function normalizeRelatedLookupPath(value) {
|
|
252
|
-
const trimmed = value.trim();
|
|
253
|
-
if (!trimmed) return null;
|
|
254
|
-
let pathname = trimmed;
|
|
255
|
-
try {
|
|
256
|
-
pathname = new URL(trimmed, "https://docs.local").pathname;
|
|
257
|
-
} catch {
|
|
258
|
-
pathname = trimmed.split(/[?#]/, 1)[0] ?? trimmed;
|
|
259
|
-
}
|
|
260
|
-
pathname = pathname.replace(/\/+/g, "/").replace(/\.md$/i, "");
|
|
261
|
-
if (!pathname.startsWith("/")) pathname = `/${pathname}`;
|
|
262
|
-
if (pathname !== "/") pathname = pathname.replace(/\/+$/, "");
|
|
263
|
-
return pathname;
|
|
264
|
-
}
|
|
265
|
-
function normalizeInlineText(value) {
|
|
266
|
-
return value.replace(/\s+/g, " ").trim();
|
|
267
|
-
}
|
|
268
|
-
|
|
269
220
|
//#endregion
|
|
270
221
|
//#region src/sidebar.ts
|
|
271
222
|
function resolvePageSidebarFolderIndexBehavior(sidebar) {
|
|
@@ -1398,4 +1349,4 @@ function createCustomSearchAdapter(adapter) {
|
|
|
1398
1349
|
}
|
|
1399
1350
|
|
|
1400
1351
|
//#endregion
|
|
1401
|
-
export {
|
|
1352
|
+
export { resolveDocsAnalyticsConfig as A, resolveSidebarFolderIndexBehaviorForPath as C, emitDocsAgentTraceEvent as D, createDocsAgentTraceId as E, createDocsCloudAnalytics as M, emitDocsAnalyticsEvent as O, resolveSidebarFolderIndexBehavior as S, createDocsAgentTraceContext as T, parseGeneratedAgentDocument as _, createMcpSearchAdapter as a, applySidebarFolderIndexBehavior as b, formatDocsAskAIPackageHints as c, resolveAskAISearchRequestConfig as d, resolveSearchRequestConfig as f, normalizeGeneratedAgentContent as g, hashGeneratedAgentContent as h, createCustomSearchAdapter as i, resolveDocsObservabilityConfig as j, emitDocsObservabilityEvent as k, inferDocsAskAIPackageHints as l, GENERATED_AGENT_PROVENANCE_VERSION as m, buildDocsSearchDocuments as n, createSimpleSearchAdapter as o, GENERATED_AGENT_PROVENANCE_MARKER as p, createAlgoliaSearchAdapter as r, createTypesenseSearchAdapter as s, buildDocsAskAIContext as t, performDocsSearch as u, serializeGeneratedAgentDocument as v, DOCS_AGENT_TRACE_EVENT_TYPES as w, resolvePageSidebarFolderIndexBehavior as x, stripGeneratedAgentProvenance as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { At as TypesenseDocsSearchConfig, B as DocsObservabilityEventInput, J as DocsSearchConfig, K as DocsSearchAdapterFactory, Q as DocsSearchResult, R as DocsObservabilityConfig, W as DocsSearchAdapter, Y as DocsSearchDocument, _ as DocsAnalyticsConfig, bt as ResolvedDocsRelatedLink, ct as McpDocsSearchConfig, d as CustomDocsSearchConfig, 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-Ch0kE7uS.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/cloud-analytics.d.ts
|
|
4
4
|
interface DocsCloudAnalyticsOptions {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as buildDocsSearchDocuments, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter } from "./search-
|
|
2
|
-
import "./sitemap-server-
|
|
1
|
+
import { n as buildDocsSearchDocuments, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter } from "./search-B5ze-heM.mjs";
|
|
2
|
+
import "./sitemap-server-C8Ppk29g.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-BR6CcCfr.mjs";
|
|
6
6
|
import { readFileSync } from "node:fs";
|
|
7
7
|
import pc from "picocolors";
|
|
8
8
|
|
package/dist/server.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as DOCS_AGENT_TRACE_EVENT_TYPES, B as resolveDocsObservabilityConfig, C as createDocsSitemapResponse, D as resolveDocsSitemapConfig, E as renderDocsSitemapXml, F as createDocsAgentTraceId, H as createDocsCloudAnalytics, I as emitDocsAgentTraceEvent, L as emitDocsAnalyticsEvent, M as ResolvedDocsAnalyticsConfig, N as ResolvedDocsObservabilityConfig, O as resolveDocsSitemapRequest, P as createDocsAgentTraceContext, R as emitDocsObservabilityEvent, S as buildDocsSitemapManifest, T as renderDocsSitemapMarkdown, V as DocsCloudAnalyticsOptions, _ 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 DocsAgentTraceContext, k as toDocsSitemapMarkdownUrl, 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 resolveDocsAnalyticsConfig } 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, ct as McpDocsSearchConfig, dt as OpenDocsProvider, et as DocsSearchSourcePage, g as DocsAgentTraceStatus, h as DocsAgentTraceEventType, k as DocsAskAIMcpConfig, m as DocsAgentTraceEventInput, tt as DocsSitemapConfig, v as DocsAnalyticsEvent, y as DocsAnalyticsEventInput, z as DocsObservabilityEvent } from "./types-Ch0kE7uS.mjs";
|
|
2
|
+
import { A as DOCS_AGENT_TRACE_EVENT_TYPES, B as resolveDocsObservabilityConfig, C as createDocsSitemapResponse, D as resolveDocsSitemapConfig, E as renderDocsSitemapXml, F as createDocsAgentTraceId, H as createDocsCloudAnalytics, I as emitDocsAgentTraceEvent, L as emitDocsAnalyticsEvent, M as ResolvedDocsAnalyticsConfig, N as ResolvedDocsObservabilityConfig, O as resolveDocsSitemapRequest, P as createDocsAgentTraceContext, R as emitDocsObservabilityEvent, S as buildDocsSitemapManifest, T as renderDocsSitemapMarkdown, V as DocsCloudAnalyticsOptions, _ 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 DocsAgentTraceContext, k as toDocsSitemapMarkdownUrl, 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 resolveDocsAnalyticsConfig } from "./search-BH07-Otd.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
|
-
import { A as
|
|
2
|
-
import { a as buildDocsSitemapManifest, c as renderDocsSitemapMarkdown, d as resolveDocsSitemapRequest, f as toDocsSitemapMarkdownUrl, i as DEFAULT_SITEMAP_XML_ROUTE, l as renderDocsSitemapXml, n as DEFAULT_SITEMAP_MD_ROUTE, o as createDocsSitemapResponse, r as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, s as readDocsSitemapManifestFromContentMap, t as DEFAULT_SITEMAP_MANIFEST_PATH, u as resolveDocsSitemapConfig } from "./sitemap-
|
|
3
|
-
import { _ as resolveApiReferenceRenderer, a as resolvePromptProviderChoices, c as serializeDocsIconRegistry, d as buildApiReferenceHtmlDocumentAsync, f as buildApiReferenceOpenApiDocument, g as resolveApiReferenceConfig, h as buildApiReferenceScalarCss, i as parsePromptStringArray, l as serializeOpenDocsProviders, m as buildApiReferencePageTitle, n as DEFAULT_PROMPT_PROVIDER_TEMPLATES, o as sanitizePromptText, p as buildApiReferenceOpenApiDocumentAsync, r as normalizePromptProviderName, s as serializeDocsIcon, t as readDocsSitemapManifest, u as buildApiReferenceHtmlDocument } from "./sitemap-server-
|
|
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-B5ze-heM.mjs";
|
|
2
|
+
import { a as buildDocsSitemapManifest, c as renderDocsSitemapMarkdown, d as resolveDocsSitemapRequest, f as toDocsSitemapMarkdownUrl, i as DEFAULT_SITEMAP_XML_ROUTE, l as renderDocsSitemapXml, n as DEFAULT_SITEMAP_MD_ROUTE, o as createDocsSitemapResponse, r as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, s as readDocsSitemapManifestFromContentMap, t as DEFAULT_SITEMAP_MANIFEST_PATH, u as resolveDocsSitemapConfig } from "./sitemap-Ccfh6GXO.mjs";
|
|
3
|
+
import { _ as resolveApiReferenceRenderer, a as resolvePromptProviderChoices, c as serializeDocsIconRegistry, d as buildApiReferenceHtmlDocumentAsync, f as buildApiReferenceOpenApiDocument, g as resolveApiReferenceConfig, h as buildApiReferenceScalarCss, i as parsePromptStringArray, l as serializeOpenDocsProviders, m as buildApiReferencePageTitle, n as DEFAULT_PROMPT_PROVIDER_TEMPLATES, o as sanitizePromptText, p as buildApiReferenceOpenApiDocumentAsync, r as normalizePromptProviderName, s as serializeDocsIcon, t as readDocsSitemapManifest, u as buildApiReferenceHtmlDocument } from "./sitemap-server-C8Ppk29g.mjs";
|
|
4
4
|
import { createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, normalizeDocsMcpRoute, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
5
5
|
|
|
6
6
|
export { 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, normalizeDocsMcpRoute, normalizePromptProviderName, parsePromptStringArray, performDocsSearch, readDocsSitemapManifest, readDocsSitemapManifestFromContentMap, renderDocsSitemapMarkdown, renderDocsSitemapXml, resolveApiReferenceConfig, resolveApiReferenceRenderer, resolveAskAISearchRequestConfig, resolveDocsAnalyticsConfig, resolveDocsMcpConfig, resolveDocsObservabilityConfig, resolveDocsSitemapConfig, resolveDocsSitemapRequest, resolvePromptProviderChoices, resolveSearchRequestConfig, runDocsMcpStdio, sanitizePromptText, serializeDocsIcon, serializeDocsIconRegistry, serializeOpenDocsProviders, toDocsSitemapMarkdownUrl };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "./search-
|
|
2
|
-
import { a as buildDocsSitemapManifest, c as renderDocsSitemapMarkdown, l as renderDocsSitemapXml, u as resolveDocsSitemapConfig } from "./sitemap-
|
|
3
|
-
import "./sitemap-server-
|
|
1
|
+
import "./search-B5ze-heM.mjs";
|
|
2
|
+
import { a as buildDocsSitemapManifest, c as renderDocsSitemapMarkdown, l as renderDocsSitemapXml, u as resolveDocsSitemapConfig } from "./sitemap-Ccfh6GXO.mjs";
|
|
3
|
+
import "./sitemap-server-C8Ppk29g.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-
|
|
7
|
-
import { t as detectFramework } from "./utils-
|
|
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-BR6CcCfr.mjs";
|
|
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";
|
|
10
10
|
import pc from "picocolors";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as resolveDocsSitemapConfig } from "./sitemap-
|
|
1
|
+
import { u as resolveDocsSitemapConfig } from "./sitemap-Ccfh6GXO.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
4
4
|
import path, { basename, join, relative } from "node:path";
|
|
@@ -823,6 +823,50 @@ interface DocsSitemapConfig {
|
|
|
823
823
|
/** Markdown sitemap options. */
|
|
824
824
|
markdown?: boolean | SitemapMarkdownConfig;
|
|
825
825
|
}
|
|
826
|
+
interface DocsRobotsRule {
|
|
827
|
+
/** User-agent name or names for this robots.txt rule block. */
|
|
828
|
+
userAgent: string | string[];
|
|
829
|
+
/** Routes to allow for the user-agent block. */
|
|
830
|
+
allow?: string | string[];
|
|
831
|
+
/** Routes to disallow for the user-agent block. */
|
|
832
|
+
disallow?: string | string[];
|
|
833
|
+
/** Optional crawl-delay value emitted as-is for crawlers that support it. */
|
|
834
|
+
crawlDelay?: number;
|
|
835
|
+
}
|
|
836
|
+
/**
|
|
837
|
+
* Configuration for generated `robots.txt` agent access policy files.
|
|
838
|
+
*/
|
|
839
|
+
interface DocsRobotsConfig {
|
|
840
|
+
/**
|
|
841
|
+
* Whether robots.txt generation is enabled.
|
|
842
|
+
* @default true when `robots` is an object
|
|
843
|
+
*/
|
|
844
|
+
enabled?: boolean;
|
|
845
|
+
/**
|
|
846
|
+
* Output file path used by `docs robots generate`.
|
|
847
|
+
* Falls back to the framework public directory, such as `public/robots.txt`
|
|
848
|
+
* or `static/robots.txt` for SvelteKit.
|
|
849
|
+
*/
|
|
850
|
+
path?: string;
|
|
851
|
+
/**
|
|
852
|
+
* Public site URL used for the `Sitemap:` line.
|
|
853
|
+
* Falls back to `sitemap.baseUrl` or `llmsTxt.baseUrl` in the CLI.
|
|
854
|
+
*/
|
|
855
|
+
baseUrl?: string;
|
|
856
|
+
/**
|
|
857
|
+
* Whether to explicitly allow or disallow common AI crawlers.
|
|
858
|
+
* @default "allow"
|
|
859
|
+
*/
|
|
860
|
+
ai?: boolean | "allow" | "disallow";
|
|
861
|
+
/**
|
|
862
|
+
* Additional AI user-agent names to include beside the defaults.
|
|
863
|
+
*/
|
|
864
|
+
aiUserAgents?: string | string[];
|
|
865
|
+
/**
|
|
866
|
+
* Extra robots.txt rule blocks appended after the generated agent policy.
|
|
867
|
+
*/
|
|
868
|
+
extraRules?: DocsRobotsRule[];
|
|
869
|
+
}
|
|
826
870
|
/**
|
|
827
871
|
* Tool-level toggles for the built-in MCP server.
|
|
828
872
|
*
|
|
@@ -2240,6 +2284,18 @@ interface DocsConfig {
|
|
|
2240
2284
|
* ```
|
|
2241
2285
|
*/
|
|
2242
2286
|
sitemap?: boolean | DocsSitemapConfig;
|
|
2287
|
+
/**
|
|
2288
|
+
* Generated robots.txt policy for docs and agent-readable routes.
|
|
2289
|
+
*
|
|
2290
|
+
* @example
|
|
2291
|
+
* ```ts
|
|
2292
|
+
* robots: {
|
|
2293
|
+
* baseUrl: "https://docs.example.com",
|
|
2294
|
+
* ai: "allow",
|
|
2295
|
+
* }
|
|
2296
|
+
* ```
|
|
2297
|
+
*/
|
|
2298
|
+
robots?: boolean | DocsRobotsConfig;
|
|
2243
2299
|
/**
|
|
2244
2300
|
* Generated changelog pages backed by date-folder MDX entries inside the docs
|
|
2245
2301
|
* content tree.
|
|
@@ -2298,4 +2354,4 @@ interface DocsConfig {
|
|
|
2298
2354
|
og?: OGConfig;
|
|
2299
2355
|
}
|
|
2300
2356
|
//#endregion
|
|
2301
|
-
export {
|
|
2357
|
+
export { DocsSearchResultType as $, DocsConfig as A, TypesenseDocsSearchConfig as At, DocsObservabilityEventInput as B, DocsAskAIActionData as C, SidebarFolderIndexBehavior as Ct, DocsAskAIFeedbackMessage as D, SidebarTree as Dt, DocsAskAIFeedbackData as E, SidebarPageNode as Et, DocsMcpToolsConfig as F, DocsSearchAdapterContext as G, DocsRobotsConfig as H, DocsMetadata as I, DocsSearchConfig as J, DocsSearchAdapterFactory as K, DocsNav as L, DocsFeedbackValue as M, UIConfig as Mt, DocsI18nConfig as N, DocsAskAIFeedbackValue as O, SimpleDocsSearchConfig as Ot, DocsMcpConfig as P, DocsSearchResult as Q, DocsObservabilityConfig as R, DocsAnalyticsSource as S, SidebarConfig as St, DocsAskAIFeedbackConfig as T, SidebarNode as Tt, DocsRobotsRule as U, DocsRelatedItem as V, DocsSearchAdapter as W, DocsSearchEmbeddingsConfig as X, DocsSearchDocument as Y, DocsSearchQuery as Z, DocsAnalyticsConfig as _, PageSidebarFrontmatter as _t, ApiReferenceRenderer as a, GithubConfig as at, DocsAnalyticsEventType as b, ResolvedDocsRelatedLink as bt, ChangelogFrontmatter as c, McpDocsSearchConfig as ct, CustomDocsSearchConfig as d, OpenDocsProvider as dt, DocsSearchSourcePage as et, DocsAgentFeedbackContext as f, OpenGraphImage as ft, DocsAgentTraceStatus as g, PageOpenGraph as gt, DocsAgentTraceEventType as h, PageFrontmatter as ht, ApiReferenceConfig as i, FontStyle as it, DocsFeedbackData as j, TypographyConfig as jt, DocsAskAIMcpConfig as k, ThemeToggleConfig as kt, CodeBlockCopyData as l, OGConfig as lt, DocsAgentTraceEventInput as m, PageActionsConfig as mt, AgentFeedbackConfig as n, DocsTheme as nt, BreadcrumbConfig as o, LastUpdatedConfig as ot, DocsAgentFeedbackData as p, OrderingItem as pt, DocsSearchChunkingConfig as q, AlgoliaDocsSearchConfig as r, FeedbackConfig as rt, ChangelogConfig as s, LlmsTxtConfig as st, AIConfig as t, DocsSitemapConfig as tt, CopyMarkdownConfig as u, OpenDocsConfig as ut, DocsAnalyticsEvent as v, PageTwitter as vt, DocsAskAIActionType as w, SidebarFolderNode as wt, DocsAnalyticsInput as x, SidebarComponentProps as xt, DocsAnalyticsEventInput as y, ReadingTimeConfig as yt, DocsObservabilityEvent as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as installCommand, i as detectPackageManagerFromLockfile, o as exec, s as fileExists, t as detectFramework } from "./utils-
|
|
1
|
+
import { c as installCommand, i as detectPackageManagerFromLockfile, o as exec, s as fileExists, t as detectFramework } from "./utils-AmYxHDoz.mjs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import pc from "picocolors";
|
|
4
4
|
import * as p from "@clack/prompts";
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|