@farming-labs/docs 0.2.24 → 0.2.26
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-DpKOO7Ho.mjs → agent-BpPhLG_h.mjs} +7 -6
- package/dist/{agent-B7T4gauS.mjs → agent-DEr3FFdg.mjs} +300 -3
- package/dist/{agents-Bhloif3y.mjs → agents-spZpwT1w.mjs} +5 -4
- package/dist/cli/index.mjs +27 -27
- package/dist/{cloud-DLc03Z41.mjs → cloud-B_bpA0Mh.mjs} +3 -3
- package/dist/{codeblocks-BnwZNsYO.mjs → codeblocks-Dcn5tRbB.mjs} +3 -3
- package/dist/{dev-C5rHIIpC.mjs → dev-DxVevOP_.mjs} +3 -10
- package/dist/{doctor-kYJcYbcT.mjs → doctor-Qe_2T86D.mjs} +8 -8
- package/dist/{downgrade-D45M-NvV.mjs → downgrade-D7zavP20.mjs} +2 -2
- package/dist/index.d.mts +34 -3
- package/dist/index.mjs +5 -7
- package/dist/{init-D-Ki2dWn.mjs → init-CRS-LZdr.mjs} +6 -5
- package/dist/{mcp-Dvy_EkRx.mjs → mcp-DVipSdBh.mjs} +4 -2
- package/dist/mcp.d.mts +3 -1
- package/dist/mcp.mjs +61 -2
- package/dist/{package-version-DMFdOnyC.mjs → package-version-CeNAB4NZ.mjs} +4 -4
- package/dist/{reading-time-DzuY0IRX.mjs → reading-time-CPAy1SWO.mjs} +1 -0
- package/dist/{review-DI_Ht3VO.mjs → review-Bnd4NH9y.mjs} +2 -2
- package/dist/{robots-CDdD2o-Q.mjs → robots-BcP7nSfi.mjs} +1 -2
- package/dist/{robots-DHQosx37.mjs → robots-BzO2bi0d.mjs} +4 -4
- package/dist/{search-BXupn-c-.mjs → search-CSJNTYNX.mjs} +4 -3
- package/dist/{search-D-iBv3VC.d.mts → search-D_xnvMMK.d.mts} +1 -1
- package/dist/{search-B3JYx2zk.mjs → search-DiFxtL5t.mjs} +276 -8
- package/dist/server.d.mts +2 -2
- package/dist/server.mjs +4 -4
- package/dist/{sitemap-server-CVSQQszk.mjs → sitemap-server-RZG9eOJB.mjs} +1 -1
- package/dist/{sitemap-BfViRvLP.mjs → sitemap-vHpdCag9.mjs} +5 -4
- package/dist/{types-BCEobEGw.d.mts → types-5-f3AZ9z.d.mts} +75 -1
- package/dist/{upgrade-C1nInojy.mjs → upgrade-Dzej61y4.mjs} +2 -2
- package/dist/{utils-CGlOADu1.mjs → utils-CoHZJ1i4.mjs} +72 -6
- package/package.json +1 -1
- package/dist/related-BNj_NdHq.mjs +0 -50
- package/dist/sitemap-CMNj0Pt3.mjs +0 -252
- /package/dist/{config-rHQQuz98.mjs → config-De5z-2LK.mjs} +0 -0
- /package/dist/{errors-DqlZftq3.mjs → errors-Dw5gMhEZ.mjs} +0 -0
- /package/dist/{review-B7goPYUb.mjs → review-CJD85JTm.mjs} +0 -0
- /package/dist/{templates-CMcXQ0Gk.mjs → templates-BOoV0cIR.mjs} +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import "./reading-time-
|
|
2
|
-
import "./
|
|
3
|
-
import "./
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
1
|
+
import "./reading-time-CPAy1SWO.mjs";
|
|
2
|
+
import "./search-DiFxtL5t.mjs";
|
|
3
|
+
import "./agent-DEr3FFdg.mjs";
|
|
4
|
+
import "./robots-BcP7nSfi.mjs";
|
|
5
|
+
import "./sitemap-server-RZG9eOJB.mjs";
|
|
6
|
+
import "./config-De5z-2LK.mjs";
|
|
7
|
+
import { a as readPageTokenBudget, i as printAgentCompactHelp, n as inspectAgentCompactionState, o as scanDocsPageTargets, r as parseAgentCompactArgs, t as compactAgentDocs } from "./codeblocks-Dcn5tRbB.mjs";
|
|
7
8
|
|
|
8
9
|
export { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp };
|
|
@@ -1,6 +1,303 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/related.ts
|
|
2
|
+
function normalizeDocsRelated(value) {
|
|
3
|
+
if (!Array.isArray(value)) return [];
|
|
4
|
+
const seen = /* @__PURE__ */ new Set();
|
|
5
|
+
const links = [];
|
|
6
|
+
for (const item of value) {
|
|
7
|
+
const parsed = parseRelatedInput(item);
|
|
8
|
+
if (!parsed) continue;
|
|
9
|
+
const dedupeKey = normalizeRelatedLookupPath(parsed.href) ?? parsed.href;
|
|
10
|
+
if (seen.has(dedupeKey)) continue;
|
|
11
|
+
seen.add(dedupeKey);
|
|
12
|
+
links.push({ href: parsed.href });
|
|
13
|
+
}
|
|
14
|
+
return links;
|
|
15
|
+
}
|
|
16
|
+
function renderDocsRelatedMarkdownLines(related) {
|
|
17
|
+
if (!related?.length) return [];
|
|
18
|
+
return [`Related: ${related.map((link) => normalizeInlineText(link.href)).join(", ")}`];
|
|
19
|
+
}
|
|
20
|
+
function parseRelatedInput(value) {
|
|
21
|
+
if (typeof value === "string") {
|
|
22
|
+
const href = cleanString(value);
|
|
23
|
+
return href ? { href } : null;
|
|
24
|
+
}
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
function cleanString(value) {
|
|
28
|
+
if (typeof value !== "string") return void 0;
|
|
29
|
+
return value.trim() || void 0;
|
|
30
|
+
}
|
|
31
|
+
function normalizeRelatedLookupPath(value) {
|
|
32
|
+
const trimmed = value.trim();
|
|
33
|
+
if (!trimmed) return null;
|
|
34
|
+
let pathname = trimmed;
|
|
35
|
+
try {
|
|
36
|
+
pathname = new URL(trimmed, "https://docs.local").pathname;
|
|
37
|
+
} catch {
|
|
38
|
+
pathname = trimmed.split(/[?#]/, 1)[0] ?? trimmed;
|
|
39
|
+
}
|
|
40
|
+
pathname = pathname.replace(/\/+/g, "/").replace(/\.md$/i, "");
|
|
41
|
+
if (!pathname.startsWith("/")) pathname = `/${pathname}`;
|
|
42
|
+
if (pathname !== "/") pathname = pathname.replace(/\/+$/, "");
|
|
43
|
+
return pathname;
|
|
44
|
+
}
|
|
45
|
+
function normalizeInlineText(value) {
|
|
46
|
+
return value.replace(/\s+/g, " ").trim();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/sitemap.ts
|
|
51
|
+
const DEFAULT_SITEMAP_XML_ROUTE = "/sitemap.xml";
|
|
52
|
+
const DEFAULT_SITEMAP_MD_ROUTE = "/sitemap.md";
|
|
53
|
+
const DEFAULT_SITEMAP_MD_DOCS_ROUTE = "/docs/sitemap.md";
|
|
54
|
+
const DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE = "/.well-known/sitemap.md";
|
|
55
|
+
const DEFAULT_SITEMAP_MANIFEST_PATH = ".farming-labs/sitemap-manifest.json";
|
|
56
|
+
function normalizeUrlPath(value) {
|
|
57
|
+
const normalized = value.replace(/\/+/g, "/");
|
|
58
|
+
if (normalized === "/") return normalized;
|
|
59
|
+
return normalized.replace(/\/+$/, "");
|
|
60
|
+
}
|
|
61
|
+
function normalizeRoutePrefix(value) {
|
|
62
|
+
if (!value) return "";
|
|
63
|
+
const normalized = normalizeUrlPath(`/${value.replace(/^\/+|\/+$/g, "")}`);
|
|
64
|
+
return normalized === "/" ? "" : normalized;
|
|
65
|
+
}
|
|
66
|
+
function joinRoute(prefix, route) {
|
|
67
|
+
return normalizeUrlPath(`${prefix}/${route.replace(/^\/+/, "")}`);
|
|
68
|
+
}
|
|
69
|
+
function normalizeDateOnly(value) {
|
|
70
|
+
if (!value) return void 0;
|
|
71
|
+
const trimmed = value.trim();
|
|
72
|
+
if (!trimmed) return void 0;
|
|
73
|
+
const dateOnly = trimmed.match(/^(\d{4}-\d{2}-\d{2})/);
|
|
74
|
+
if (dateOnly) return dateOnly[1];
|
|
75
|
+
const parsed = new Date(trimmed);
|
|
76
|
+
if (Number.isNaN(parsed.getTime())) return void 0;
|
|
77
|
+
return parsed.toISOString().slice(0, 10);
|
|
78
|
+
}
|
|
79
|
+
function normalizeBaseUrl(value) {
|
|
80
|
+
if (!value) return void 0;
|
|
81
|
+
return value.trim().replace(/\/+$/, "") || void 0;
|
|
82
|
+
}
|
|
83
|
+
function isEnabledObject(config) {
|
|
84
|
+
if (config === false) return false;
|
|
85
|
+
if (config === void 0) return true;
|
|
86
|
+
if (config === true) return true;
|
|
87
|
+
return config.enabled !== false;
|
|
88
|
+
}
|
|
89
|
+
function resolveDocsSitemapConfig(sitemap, defaults = {}) {
|
|
90
|
+
const objectConfig = sitemap && typeof sitemap === "object" ? sitemap : {};
|
|
91
|
+
const routePrefix = normalizeRoutePrefix(objectConfig.routePrefix);
|
|
92
|
+
const xmlConfig = objectConfig.xml;
|
|
93
|
+
const markdownConfig = objectConfig.markdown;
|
|
94
|
+
const xmlEnabled = xmlConfig === false ? false : typeof xmlConfig === "object" ? xmlConfig.enabled ?? true : true;
|
|
95
|
+
const markdownEnabled = markdownConfig === false ? false : typeof markdownConfig === "object" ? markdownConfig.enabled ?? true : true;
|
|
96
|
+
return {
|
|
97
|
+
enabled: isEnabledObject(sitemap),
|
|
98
|
+
routePrefix,
|
|
99
|
+
baseUrl: normalizeBaseUrl(objectConfig.baseUrl ?? defaults.baseUrl),
|
|
100
|
+
manifestPath: objectConfig.manifestPath ?? DEFAULT_SITEMAP_MANIFEST_PATH,
|
|
101
|
+
xml: {
|
|
102
|
+
enabled: xmlEnabled,
|
|
103
|
+
includeLastmod: typeof xmlConfig === "object" ? xmlConfig.includeLastmod ?? true : true,
|
|
104
|
+
route: joinRoute(routePrefix, DEFAULT_SITEMAP_XML_ROUTE)
|
|
105
|
+
},
|
|
106
|
+
markdown: {
|
|
107
|
+
enabled: markdownEnabled,
|
|
108
|
+
includeDescriptions: typeof markdownConfig === "object" ? markdownConfig.includeDescriptions ?? true : true,
|
|
109
|
+
includeLastmod: typeof markdownConfig === "object" ? markdownConfig.includeLastmod ?? true : true,
|
|
110
|
+
linkTarget: typeof markdownConfig === "object" ? markdownConfig.linkTarget ?? "both" : "both",
|
|
111
|
+
route: joinRoute(routePrefix, DEFAULT_SITEMAP_MD_ROUTE),
|
|
112
|
+
docsRoute: routePrefix ? void 0 : DEFAULT_SITEMAP_MD_DOCS_ROUTE,
|
|
113
|
+
wellKnownRoute: joinRoute(routePrefix, DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE)
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
function resolveDocsSitemapRequest(url, sitemap) {
|
|
118
|
+
const pathname = normalizeUrlPath(url.pathname);
|
|
119
|
+
const format = url.searchParams.get("format")?.trim();
|
|
120
|
+
if (pathname === "/api/docs") {
|
|
121
|
+
if (format === "sitemap-xml") return "xml";
|
|
122
|
+
if (format === "sitemap-md" || format === "sitemap-markdown") return "markdown";
|
|
123
|
+
}
|
|
124
|
+
const resolved = resolveDocsSitemapConfig(sitemap);
|
|
125
|
+
if (!resolved.enabled) return null;
|
|
126
|
+
if (resolved.xml.enabled && pathname === resolved.xml.route) return "xml";
|
|
127
|
+
if (resolved.markdown.enabled && (pathname === resolved.markdown.route || pathname === resolved.markdown.docsRoute || pathname === resolved.markdown.wellKnownRoute)) return "markdown";
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
function toDocsSitemapMarkdownUrl(url) {
|
|
131
|
+
const normalized = normalizeUrlPath(url);
|
|
132
|
+
return normalized.endsWith(".md") ? normalized : `${normalized}.md`;
|
|
133
|
+
}
|
|
134
|
+
function absolutizeUrl(baseUrl, url) {
|
|
135
|
+
if (/^https?:\/\//i.test(url)) return url;
|
|
136
|
+
const base = normalizeBaseUrl(baseUrl);
|
|
137
|
+
return base ? `${base}${url.startsWith("/") ? url : `/${url}`}` : url;
|
|
138
|
+
}
|
|
139
|
+
function escapeXml(value) {
|
|
140
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
141
|
+
}
|
|
142
|
+
function hashString(value) {
|
|
143
|
+
let hash = 14695981039346656037n;
|
|
144
|
+
const bytes = new TextEncoder().encode(value);
|
|
145
|
+
for (const byte of bytes) {
|
|
146
|
+
hash ^= BigInt(byte);
|
|
147
|
+
hash = BigInt.asUintN(64, hash * 1099511628211n);
|
|
148
|
+
}
|
|
149
|
+
return `"fnv1a64-${hash.toString(16).padStart(16, "0")}"`;
|
|
150
|
+
}
|
|
151
|
+
function newestLastmod(pages) {
|
|
152
|
+
let newest;
|
|
153
|
+
for (const page of pages) {
|
|
154
|
+
const date = normalizeDateOnly(page.lastmod);
|
|
155
|
+
if (!date) continue;
|
|
156
|
+
if (!newest || date > newest) newest = date;
|
|
157
|
+
}
|
|
158
|
+
return newest;
|
|
159
|
+
}
|
|
160
|
+
function titleize(value) {
|
|
161
|
+
return value.replace(/-/g, " ").replace(/\b\w/g, (char) => char.toUpperCase());
|
|
162
|
+
}
|
|
163
|
+
function sitemapSectionName(entry, pageUrl) {
|
|
164
|
+
const normalizedEntry = `/${entry.replace(/^\/+|\/+$/g, "") || "docs"}`;
|
|
165
|
+
const normalizedUrl = normalizeUrlPath(pageUrl);
|
|
166
|
+
if (normalizedUrl === normalizedEntry) return "Overview";
|
|
167
|
+
const firstSegment = (normalizedUrl.startsWith(`${normalizedEntry}/`) ? normalizedUrl.slice(normalizedEntry.length + 1) : normalizedUrl.replace(/^\/+/, "")).split("/").filter(Boolean)[0];
|
|
168
|
+
return firstSegment ? titleize(firstSegment) : "Pages";
|
|
169
|
+
}
|
|
170
|
+
function buildDocsSitemapManifest(options) {
|
|
171
|
+
const baseUrl = normalizeBaseUrl(options.baseUrl);
|
|
172
|
+
const seen = /* @__PURE__ */ new Set();
|
|
173
|
+
const pages = [];
|
|
174
|
+
for (const page of options.pages) {
|
|
175
|
+
const url = normalizeUrlPath(page.url);
|
|
176
|
+
if (seen.has(url)) continue;
|
|
177
|
+
seen.add(url);
|
|
178
|
+
const resolvedLastmod = options.resolveLastmod?.(page);
|
|
179
|
+
const fallbackLastmod = normalizeDateOnly(page.lastmod ?? page.lastModified);
|
|
180
|
+
const lastmod = normalizeDateOnly(resolvedLastmod?.lastmod) ?? fallbackLastmod;
|
|
181
|
+
pages.push({
|
|
182
|
+
url,
|
|
183
|
+
absoluteUrl: absolutizeUrl(baseUrl, url),
|
|
184
|
+
markdownUrl: toDocsSitemapMarkdownUrl(url),
|
|
185
|
+
title: page.title,
|
|
186
|
+
description: page.description,
|
|
187
|
+
sourcePath: page.sourcePath,
|
|
188
|
+
lastmod,
|
|
189
|
+
lastmodSource: resolvedLastmod?.lastmodSource ?? (lastmod ? "unknown" : void 0),
|
|
190
|
+
related: page.related?.map((link) => link.href)
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
pages.sort((left, right) => left.url.localeCompare(right.url));
|
|
194
|
+
return {
|
|
195
|
+
version: 1,
|
|
196
|
+
generatedAt: options.generatedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
197
|
+
baseUrl,
|
|
198
|
+
entry: options.entry ?? "docs",
|
|
199
|
+
siteTitle: options.siteTitle,
|
|
200
|
+
pages
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
function renderDocsSitemapXml(manifest, options = {}) {
|
|
204
|
+
const baseUrl = normalizeBaseUrl(options.baseUrl ?? manifest.baseUrl);
|
|
205
|
+
const includeLastmod = options.includeLastmod ?? true;
|
|
206
|
+
const lines = ["<?xml version=\"1.0\" encoding=\"UTF-8\"?>", "<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">"];
|
|
207
|
+
for (const page of manifest.pages) {
|
|
208
|
+
lines.push(" <url>");
|
|
209
|
+
lines.push(` <loc>${escapeXml(page.absoluteUrl ?? absolutizeUrl(baseUrl, page.url))}</loc>`);
|
|
210
|
+
const lastmod = normalizeDateOnly(page.lastmod);
|
|
211
|
+
if (includeLastmod && lastmod) lines.push(` <lastmod>${lastmod}</lastmod>`);
|
|
212
|
+
lines.push(" </url>");
|
|
213
|
+
}
|
|
214
|
+
lines.push("</urlset>");
|
|
215
|
+
return `${lines.join("\n")}\n`;
|
|
216
|
+
}
|
|
217
|
+
function renderDocsSitemapMarkdown(manifest, options = {}) {
|
|
218
|
+
const siteTitle = manifest.siteTitle ?? "Documentation";
|
|
219
|
+
const includeDescriptions = options.includeDescriptions ?? true;
|
|
220
|
+
const includeLastmod = options.includeLastmod ?? true;
|
|
221
|
+
const linkTarget = options.linkTarget ?? "both";
|
|
222
|
+
const lines = [`# ${siteTitle} Sitemap`, ""];
|
|
223
|
+
const baseUrl = normalizeBaseUrl(options.baseUrl ?? manifest.baseUrl);
|
|
224
|
+
if (baseUrl) lines.push(`Base URL: ${baseUrl}`);
|
|
225
|
+
lines.push(`Docs entry: /${manifest.entry.replace(/^\/+|\/+$/g, "") || "docs"}`);
|
|
226
|
+
lines.push(`Generated: ${normalizeDateOnly(manifest.generatedAt) ?? manifest.generatedAt}`, "");
|
|
227
|
+
const groups = /* @__PURE__ */ new Map();
|
|
228
|
+
for (const page of manifest.pages) {
|
|
229
|
+
const sectionName = sitemapSectionName(manifest.entry, page.url);
|
|
230
|
+
groups.set(sectionName, [...groups.get(sectionName) ?? [], page]);
|
|
231
|
+
}
|
|
232
|
+
for (const [sectionName, pages] of groups) {
|
|
233
|
+
lines.push(`## ${sectionName}`, "");
|
|
234
|
+
for (const page of pages) {
|
|
235
|
+
const primaryHref = linkTarget === "markdown" ? page.markdownUrl : page.url;
|
|
236
|
+
lines.push(`- [${page.title}](${primaryHref})`);
|
|
237
|
+
if (linkTarget === "both" || linkTarget === "markdown") lines.push(` Markdown: ${page.markdownUrl}`);
|
|
238
|
+
if (includeDescriptions && page.description) lines.push(` Description: ${page.description}`);
|
|
239
|
+
const lastmod = normalizeDateOnly(page.lastmod);
|
|
240
|
+
if (includeLastmod && lastmod) lines.push(` Last updated: ${lastmod}`);
|
|
241
|
+
if (page.related && page.related.length > 0) lines.push(` Related: ${page.related.join(", ")}`);
|
|
242
|
+
lines.push("");
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return lines.join("\n").replace(/\n{3,}/g, "\n\n");
|
|
246
|
+
}
|
|
247
|
+
function readDocsSitemapManifestFromContentMap(contentMap) {
|
|
248
|
+
if (!contentMap) return null;
|
|
249
|
+
const raw = contentMap[`/${DEFAULT_SITEMAP_MANIFEST_PATH}`] ?? contentMap[DEFAULT_SITEMAP_MANIFEST_PATH];
|
|
250
|
+
if (!raw) return null;
|
|
251
|
+
try {
|
|
252
|
+
return JSON.parse(raw);
|
|
253
|
+
} catch {
|
|
254
|
+
return null;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
function resolveDocsSitemapPageLastmod(manifest, url) {
|
|
258
|
+
if (!manifest) return void 0;
|
|
259
|
+
const normalizedUrl = normalizeUrlPath(url);
|
|
260
|
+
return normalizeDateOnly(manifest.pages.find((entry) => normalizeUrlPath(entry.url) === normalizedUrl)?.lastmod);
|
|
261
|
+
}
|
|
262
|
+
function createDocsSitemapResponse({ request, sitemap, entry = "docs", siteTitle, baseUrl, pages, manifest }) {
|
|
263
|
+
const url = new URL(request.url);
|
|
264
|
+
const format = resolveDocsSitemapRequest(url, sitemap);
|
|
265
|
+
if (!format) return null;
|
|
266
|
+
const resolved = resolveDocsSitemapConfig(sitemap, { baseUrl });
|
|
267
|
+
if (!resolved.enabled) return null;
|
|
268
|
+
if (format === "xml" && !resolved.xml.enabled) return null;
|
|
269
|
+
if (format === "markdown" && !resolved.markdown.enabled) return null;
|
|
270
|
+
const nextManifest = manifest ?? buildDocsSitemapManifest({
|
|
271
|
+
pages,
|
|
272
|
+
entry,
|
|
273
|
+
siteTitle,
|
|
274
|
+
baseUrl: resolved.baseUrl ?? url.origin
|
|
275
|
+
});
|
|
276
|
+
const responseBaseUrl = resolved.baseUrl ?? nextManifest.baseUrl ?? url.origin;
|
|
277
|
+
const body = format === "xml" ? renderDocsSitemapXml(nextManifest, {
|
|
278
|
+
baseUrl: responseBaseUrl,
|
|
279
|
+
includeLastmod: resolved.xml.includeLastmod
|
|
280
|
+
}) : renderDocsSitemapMarkdown(nextManifest, {
|
|
281
|
+
baseUrl: responseBaseUrl,
|
|
282
|
+
includeDescriptions: resolved.markdown.includeDescriptions,
|
|
283
|
+
includeLastmod: resolved.markdown.includeLastmod,
|
|
284
|
+
linkTarget: resolved.markdown.linkTarget
|
|
285
|
+
});
|
|
286
|
+
const headers = new Headers({
|
|
287
|
+
"Content-Type": format === "xml" ? "application/xml; charset=utf-8" : "text/markdown; charset=utf-8",
|
|
288
|
+
"Cache-Control": "public, max-age=0, must-revalidate",
|
|
289
|
+
ETag: hashString(body)
|
|
290
|
+
});
|
|
291
|
+
const lastModified = newestLastmod(nextManifest.pages);
|
|
292
|
+
if (lastModified) headers.set("Last-Modified", (/* @__PURE__ */ new Date(`${lastModified}T00:00:00.000Z`)).toUTCString());
|
|
293
|
+
if (request.headers.get("if-none-match") === headers.get("ETag")) return new Response(null, {
|
|
294
|
+
status: 304,
|
|
295
|
+
headers
|
|
296
|
+
});
|
|
297
|
+
return new Response(body, { headers });
|
|
298
|
+
}
|
|
3
299
|
|
|
300
|
+
//#endregion
|
|
4
301
|
//#region src/agent.ts
|
|
5
302
|
const DEFAULT_DOCS_API_ROUTE = "/api/docs";
|
|
6
303
|
const DEFAULT_OPENAPI_SCHEMA_ROUTE = `${DEFAULT_DOCS_API_ROUTE}?format=openapi`;
|
|
@@ -1434,4 +1731,4 @@ function toYamlString(value) {
|
|
|
1434
1731
|
}
|
|
1435
1732
|
|
|
1436
1733
|
//#endregion
|
|
1437
|
-
export { resolveDocsAgentsFormat as $, findDocsMarkdownPage as A, isDocsSkillRequest as B, DOCS_BOT_LIKE_USER_AGENT_HEADER_PATTERN as C, buildDocsAgentFeedbackSchema as D, buildDocsAgentDiscoverySpec as E, isDocsAgentDiscoveryRequest as F, renderDocsAgentsDocument as G, normalizeDocsPathSegment as H, isDocsAgentsRequest as I, renderDocsMarkdownNotFound as J, renderDocsLlmsTxt as K, isDocsLlmsTxtPublicRequest as L, getDocsMarkdownCanonicalLinkHeader as M, getDocsMarkdownVaryHeader as N, buildDocsMcpEndpointCandidates as O, hasDocsMarkdownSignatureAgent as P, resolveDocsAgentMdxContent as Q, isDocsMcpRequest as R, DOCS_AI_AGENT_USER_AGENT_HEADER_PATTERN as S, DOCS_TRADITIONAL_BOT_USER_AGENT_HEADER_PATTERN as T, normalizeDocsUrlPath as U, matchesDocsLlmsTxtSection as V, parseDocsAgentFeedbackData as W, resolveDocsAgentFeedbackConfig as X, renderDocsSkillDocument as Y, resolveDocsAgentFeedbackRequest as Z, DEFAULT_MCP_ROUTE as _, DEFAULT_AGENT_MD_ROUTE as a, resolveDocsMarkdownRequest as at, DEFAULT_SKILL_MD_ROUTE as b, DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE as c, selectDocsLlmsTxtContent as ct, DEFAULT_LLMS_FULL_TXT_ROUTE as d, resolveDocsLlmsTxtFormat as et, DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE as f, DEFAULT_MCP_PUBLIC_ROUTE as g, DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE as h, DEFAULT_AGENT_FEEDBACK_ROUTE as i, resolveDocsMarkdownRecovery as it, getDocsLlmsTxtMaxCharsIssue as j, detectDocsMarkdownAgentRequest as k, DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE as l, toDocsMarkdownUrl as lt, DEFAULT_LLMS_TXT_ROUTE as m, DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE as n, resolveDocsLlmsTxtSections as nt, DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE as o, resolveDocsOpenApiDiscoveryConfig as ot, DEFAULT_LLMS_TXT_MAX_CHARS as p, renderDocsMarkdownDocument as q, DEFAULT_AGENT_FEEDBACK_PAYLOAD_SCHEMA as r, resolveDocsMarkdownCanonicalUrl as rt, DEFAULT_AGENT_SPEC_ROUTE as s, resolveDocsSkillFormat as st, DEFAULT_AGENTS_MD_ROUTE as t, resolveDocsLlmsTxtRequest as tt, DEFAULT_DOCS_API_ROUTE as u, validateDocsAgentFeedbackPayload as ut, DEFAULT_MCP_WELL_KNOWN_ROUTE as v, DOCS_MARKDOWN_SIGNATURE_AGENT_HEADER as w, DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE as x, DEFAULT_OPENAPI_SCHEMA_ROUTE as y, isDocsPublicGetRequest as z };
|
|
1734
|
+
export { resolveDocsAgentsFormat as $, findDocsMarkdownPage as A, isDocsSkillRequest as B, DOCS_BOT_LIKE_USER_AGENT_HEADER_PATTERN as C, resolveDocsSitemapRequest as Ct, buildDocsAgentFeedbackSchema as D, buildDocsAgentDiscoverySpec as E, renderDocsRelatedMarkdownLines as Et, isDocsAgentDiscoveryRequest as F, renderDocsAgentsDocument as G, normalizeDocsPathSegment as H, isDocsAgentsRequest as I, renderDocsMarkdownNotFound as J, renderDocsLlmsTxt as K, isDocsLlmsTxtPublicRequest as L, getDocsMarkdownCanonicalLinkHeader as M, getDocsMarkdownVaryHeader as N, buildDocsMcpEndpointCandidates as O, hasDocsMarkdownSignatureAgent as P, resolveDocsAgentMdxContent as Q, isDocsMcpRequest as R, DOCS_AI_AGENT_USER_AGENT_HEADER_PATTERN as S, resolveDocsSitemapPageLastmod as St, DOCS_TRADITIONAL_BOT_USER_AGENT_HEADER_PATTERN as T, normalizeDocsRelated as Tt, normalizeDocsUrlPath as U, matchesDocsLlmsTxtSection as V, parseDocsAgentFeedbackData as W, resolveDocsAgentFeedbackConfig as X, renderDocsSkillDocument as Y, resolveDocsAgentFeedbackRequest as Z, DEFAULT_MCP_ROUTE as _, createDocsSitemapResponse as _t, DEFAULT_AGENT_MD_ROUTE as a, resolveDocsMarkdownRequest as at, DEFAULT_SKILL_MD_ROUTE as b, renderDocsSitemapXml as bt, DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE as c, selectDocsLlmsTxtContent as ct, DEFAULT_LLMS_FULL_TXT_ROUTE as d, DEFAULT_SITEMAP_MANIFEST_PATH as dt, resolveDocsLlmsTxtFormat as et, DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE as f, DEFAULT_SITEMAP_MD_DOCS_ROUTE as ft, DEFAULT_MCP_PUBLIC_ROUTE as g, buildDocsSitemapManifest as gt, DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE as h, DEFAULT_SITEMAP_XML_ROUTE as ht, DEFAULT_AGENT_FEEDBACK_ROUTE as i, resolveDocsMarkdownRecovery as it, getDocsLlmsTxtMaxCharsIssue as j, detectDocsMarkdownAgentRequest as k, DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE as l, toDocsMarkdownUrl as lt, DEFAULT_LLMS_TXT_ROUTE as m, DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE as mt, DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE as n, resolveDocsLlmsTxtSections as nt, DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE as o, resolveDocsOpenApiDiscoveryConfig as ot, DEFAULT_LLMS_TXT_MAX_CHARS as p, DEFAULT_SITEMAP_MD_ROUTE as pt, renderDocsMarkdownDocument as q, DEFAULT_AGENT_FEEDBACK_PAYLOAD_SCHEMA as r, resolveDocsMarkdownCanonicalUrl as rt, DEFAULT_AGENT_SPEC_ROUTE as s, resolveDocsSkillFormat as st, DEFAULT_AGENTS_MD_ROUTE as t, resolveDocsLlmsTxtRequest as tt, DEFAULT_DOCS_API_ROUTE as u, validateDocsAgentFeedbackPayload as ut, DEFAULT_MCP_WELL_KNOWN_ROUTE as v, readDocsSitemapManifestFromContentMap as vt, DOCS_MARKDOWN_SIGNATURE_AGENT_HEADER as w, toDocsSitemapMarkdownUrl as wt, DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE as x, resolveDocsSitemapConfig as xt, DEFAULT_OPENAPI_SCHEMA_ROUTE as y, renderDocsSitemapMarkdown as yt, isDocsPublicGetRequest as z };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import "./search-DiFxtL5t.mjs";
|
|
2
|
+
import { G as renderDocsAgentsDocument, X as resolveDocsAgentFeedbackConfig, a as DEFAULT_AGENT_MD_ROUTE, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, o as DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE, t as DEFAULT_AGENTS_MD_ROUTE, y as DEFAULT_OPENAPI_SCHEMA_ROUTE } from "./agent-DEr3FFdg.mjs";
|
|
3
|
+
import { S as resolveApiReferenceConfig } from "./sitemap-server-RZG9eOJB.mjs";
|
|
3
4
|
import { resolveDocsMcpConfig } from "./mcp.mjs";
|
|
4
5
|
import "./server.mjs";
|
|
5
|
-
import { c as readNavTitle, f as readTopLevelStringProperty, i as loadDocsConfigModule, o as readBooleanProperty, p as resolveDocsConfigPath, t as extractNestedObjectLiteral, u as readStringProperty } from "./config-
|
|
6
|
-
import { t as detectFramework } from "./utils-
|
|
6
|
+
import { c as readNavTitle, f as readTopLevelStringProperty, i as loadDocsConfigModule, o as readBooleanProperty, p as resolveDocsConfigPath, t as extractNestedObjectLiteral, u as readStringProperty } from "./config-De5z-2LK.mjs";
|
|
7
|
+
import { t as detectFramework } from "./utils-CoHZJ1i4.mjs";
|
|
7
8
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
8
9
|
import path from "node:path";
|
|
9
10
|
import pc from "picocolors";
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { i as wasCliErrorReported, r as shouldPrintStackTrace, t as formatCliError } from "../errors-
|
|
2
|
+
import { i as wasCliErrorReported, r as shouldPrintStackTrace, t as formatCliError } from "../errors-Dw5gMhEZ.mjs";
|
|
3
3
|
import pc from "picocolors";
|
|
4
4
|
|
|
5
5
|
//#region src/cli/index.ts
|
|
@@ -98,43 +98,43 @@ async function main() {
|
|
|
98
98
|
]
|
|
99
99
|
};
|
|
100
100
|
if (!parsedCommand.command || parsedCommand.command === "init") {
|
|
101
|
-
const { init } = await import("../init-
|
|
101
|
+
const { init } = await import("../init-CRS-LZdr.mjs");
|
|
102
102
|
await init(initOptions);
|
|
103
103
|
} else if (parsedCommand.command === "dev") {
|
|
104
|
-
const { dev } = await import("../dev-
|
|
104
|
+
const { dev } = await import("../dev-DxVevOP_.mjs");
|
|
105
105
|
await dev(devOptions);
|
|
106
106
|
} else if (parsedCommand.command === "deploy") {
|
|
107
|
-
const { runCloudDeploy } = await import("../cloud-
|
|
107
|
+
const { runCloudDeploy } = await import("../cloud-B_bpA0Mh.mjs");
|
|
108
108
|
await runCloudDeploy(cloudOptions);
|
|
109
109
|
} else if (parsedCommand.command === "preview") {
|
|
110
|
-
const { runCloudPreview } = await import("../cloud-
|
|
110
|
+
const { runCloudPreview } = await import("../cloud-B_bpA0Mh.mjs");
|
|
111
111
|
await runCloudPreview(cloudOptions);
|
|
112
112
|
} else if (parsedCommand.command === "cloud" && subcommand === "deploy") {
|
|
113
|
-
const { runCloudDeploy } = await import("../cloud-
|
|
113
|
+
const { runCloudDeploy } = await import("../cloud-B_bpA0Mh.mjs");
|
|
114
114
|
await runCloudDeploy(cloudOptions);
|
|
115
115
|
} else if (parsedCommand.command === "cloud" && subcommand === "preview") {
|
|
116
|
-
const { runCloudPreview } = await import("../cloud-
|
|
116
|
+
const { runCloudPreview } = await import("../cloud-B_bpA0Mh.mjs");
|
|
117
117
|
await runCloudPreview(cloudOptions);
|
|
118
118
|
} else if (parsedCommand.command === "cloud" && subcommand === "init") {
|
|
119
|
-
const { runCloudInit } = await import("../cloud-
|
|
119
|
+
const { runCloudInit } = await import("../cloud-B_bpA0Mh.mjs");
|
|
120
120
|
await runCloudInit(cloudOptions);
|
|
121
121
|
} else if (parsedCommand.command === "cloud" && subcommand === "sync") {
|
|
122
|
-
const { syncCloudConfig } = await import("../cloud-
|
|
122
|
+
const { syncCloudConfig } = await import("../cloud-B_bpA0Mh.mjs");
|
|
123
123
|
await syncCloudConfig(cloudOptions);
|
|
124
124
|
} else if (parsedCommand.command === "cloud" && subcommand === "check") {
|
|
125
|
-
const { runCloudCheck } = await import("../cloud-
|
|
125
|
+
const { runCloudCheck } = await import("../cloud-B_bpA0Mh.mjs");
|
|
126
126
|
await runCloudCheck(cloudOptions);
|
|
127
127
|
} else if (parsedCommand.command === "cloud") {
|
|
128
128
|
console.error(pc.red(`Unknown cloud subcommand: ${subcommand ?? "(missing)"}`));
|
|
129
129
|
console.error();
|
|
130
|
-
const { printCloudHelp } = await import("../cloud-
|
|
130
|
+
const { printCloudHelp } = await import("../cloud-B_bpA0Mh.mjs");
|
|
131
131
|
printCloudHelp();
|
|
132
132
|
process.exit(1);
|
|
133
133
|
} else if (parsedCommand.command === "mcp") {
|
|
134
|
-
const { runMcp } = await import("../mcp-
|
|
134
|
+
const { runMcp } = await import("../mcp-DVipSdBh.mjs");
|
|
135
135
|
await runMcp(mcpOptions);
|
|
136
136
|
} else if (parsedCommand.command === "agent" && subcommand === "compact") {
|
|
137
|
-
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent-
|
|
137
|
+
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent-BpPhLG_h.mjs");
|
|
138
138
|
const agentCompactOptions = parseAgentCompactArgs(args.slice(2));
|
|
139
139
|
if (agentCompactOptions.help) {
|
|
140
140
|
printAgentCompactHelp();
|
|
@@ -144,11 +144,11 @@ async function main() {
|
|
|
144
144
|
} else if (parsedCommand.command === "agent") {
|
|
145
145
|
console.error(pc.red(`Unknown agent subcommand: ${subcommand ?? "(missing)"}`));
|
|
146
146
|
console.error();
|
|
147
|
-
const { printAgentCompactHelp } = await import("../agent-
|
|
147
|
+
const { printAgentCompactHelp } = await import("../agent-BpPhLG_h.mjs");
|
|
148
148
|
printAgentCompactHelp();
|
|
149
149
|
process.exit(1);
|
|
150
150
|
} else if (parsedCommand.command === "agents" && subcommand === "generate") {
|
|
151
|
-
const { generateAgents, parseAgentsGenerateArgs, printAgentsGenerateHelp } = await import("../agents-
|
|
151
|
+
const { generateAgents, parseAgentsGenerateArgs, printAgentsGenerateHelp } = await import("../agents-spZpwT1w.mjs");
|
|
152
152
|
const agentsOptions = parseAgentsGenerateArgs(args.slice(2));
|
|
153
153
|
if (agentsOptions.help) {
|
|
154
154
|
printAgentsGenerateHelp();
|
|
@@ -158,11 +158,11 @@ async function main() {
|
|
|
158
158
|
} else if (parsedCommand.command === "agents") {
|
|
159
159
|
console.error(pc.red(`Unknown agents subcommand: ${subcommand ?? "(missing)"}`));
|
|
160
160
|
console.error();
|
|
161
|
-
const { printAgentsGenerateHelp } = await import("../agents-
|
|
161
|
+
const { printAgentsGenerateHelp } = await import("../agents-spZpwT1w.mjs");
|
|
162
162
|
printAgentsGenerateHelp();
|
|
163
163
|
process.exit(1);
|
|
164
164
|
} else if (parsedCommand.command === "doctor") {
|
|
165
|
-
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-
|
|
165
|
+
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-Qe_2T86D.mjs");
|
|
166
166
|
const doctorOptions = parseDoctorArgs(args.slice(1));
|
|
167
167
|
if (doctorOptions.help) {
|
|
168
168
|
printDoctorHelp();
|
|
@@ -170,7 +170,7 @@ async function main() {
|
|
|
170
170
|
}
|
|
171
171
|
await runDoctor(doctorOptions);
|
|
172
172
|
} else if (parsedCommand.command === "review") {
|
|
173
|
-
const { parseReviewArgs, printReviewHelp, runReview } = await import("../review-
|
|
173
|
+
const { parseReviewArgs, printReviewHelp, runReview } = await import("../review-Bnd4NH9y.mjs");
|
|
174
174
|
const reviewOptions = parseReviewArgs(args.slice(1));
|
|
175
175
|
if (reviewOptions.help) {
|
|
176
176
|
printReviewHelp();
|
|
@@ -178,7 +178,7 @@ async function main() {
|
|
|
178
178
|
}
|
|
179
179
|
await runReview(reviewOptions);
|
|
180
180
|
} else if ((parsedCommand.command === "codeblocks" || parsedCommand.command === "code-blocks") && subcommand === "validate") {
|
|
181
|
-
const { parseCodeBlocksValidateArgs, printCodeBlocksValidateHelp, runCodeBlocksValidate } = await import("../codeblocks-
|
|
181
|
+
const { parseCodeBlocksValidateArgs, printCodeBlocksValidateHelp, runCodeBlocksValidate } = await import("../codeblocks-Dcn5tRbB.mjs");
|
|
182
182
|
const codeBlocksOptions = parseCodeBlocksValidateArgs(args.slice(2));
|
|
183
183
|
if (codeBlocksOptions.help) {
|
|
184
184
|
printCodeBlocksValidateHelp();
|
|
@@ -188,11 +188,11 @@ async function main() {
|
|
|
188
188
|
} else if (parsedCommand.command === "codeblocks" || parsedCommand.command === "code-blocks") {
|
|
189
189
|
console.error(pc.red(`Unknown codeblocks subcommand: ${subcommand ?? "(missing)"}`));
|
|
190
190
|
console.error();
|
|
191
|
-
const { printCodeBlocksValidateHelp } = await import("../codeblocks-
|
|
191
|
+
const { printCodeBlocksValidateHelp } = await import("../codeblocks-Dcn5tRbB.mjs");
|
|
192
192
|
printCodeBlocksValidateHelp();
|
|
193
193
|
process.exit(1);
|
|
194
194
|
} else if (parsedCommand.command === "search" && subcommand === "sync") {
|
|
195
|
-
const { syncSearch } = await import("../search-
|
|
195
|
+
const { syncSearch } = await import("../search-CSJNTYNX.mjs");
|
|
196
196
|
await syncSearch(searchSyncOptions);
|
|
197
197
|
} else if (parsedCommand.command === "search") {
|
|
198
198
|
console.error(pc.red(`Unknown search subcommand: ${subcommand ?? "(missing)"}`));
|
|
@@ -200,7 +200,7 @@ async function main() {
|
|
|
200
200
|
printHelp();
|
|
201
201
|
process.exit(1);
|
|
202
202
|
} else if (parsedCommand.command === "sitemap" && subcommand === "generate") {
|
|
203
|
-
const { generateSitemap, parseSitemapGenerateArgs, printSitemapGenerateHelp } = await import("../sitemap-
|
|
203
|
+
const { generateSitemap, parseSitemapGenerateArgs, printSitemapGenerateHelp } = await import("../sitemap-vHpdCag9.mjs");
|
|
204
204
|
const sitemapOptions = parseSitemapGenerateArgs(args.slice(2));
|
|
205
205
|
if (sitemapOptions.help) {
|
|
206
206
|
printSitemapGenerateHelp();
|
|
@@ -210,11 +210,11 @@ async function main() {
|
|
|
210
210
|
} else if (parsedCommand.command === "sitemap") {
|
|
211
211
|
console.error(pc.red(`Unknown sitemap subcommand: ${subcommand ?? "(missing)"}`));
|
|
212
212
|
console.error();
|
|
213
|
-
const { printSitemapGenerateHelp } = await import("../sitemap-
|
|
213
|
+
const { printSitemapGenerateHelp } = await import("../sitemap-vHpdCag9.mjs");
|
|
214
214
|
printSitemapGenerateHelp();
|
|
215
215
|
process.exit(1);
|
|
216
216
|
} else if (parsedCommand.command === "robots" && subcommand === "generate") {
|
|
217
|
-
const { generateRobots, parseRobotsGenerateArgs, printRobotsGenerateHelp } = await import("../robots-
|
|
217
|
+
const { generateRobots, parseRobotsGenerateArgs, printRobotsGenerateHelp } = await import("../robots-BzO2bi0d.mjs");
|
|
218
218
|
const robotsOptions = parseRobotsGenerateArgs(args.slice(2));
|
|
219
219
|
if (robotsOptions.help) {
|
|
220
220
|
printRobotsGenerateHelp();
|
|
@@ -224,11 +224,11 @@ async function main() {
|
|
|
224
224
|
} else if (parsedCommand.command === "robots") {
|
|
225
225
|
console.error(pc.red(`Unknown robots subcommand: ${subcommand ?? "(missing)"}`));
|
|
226
226
|
console.error();
|
|
227
|
-
const { printRobotsGenerateHelp } = await import("../robots-
|
|
227
|
+
const { printRobotsGenerateHelp } = await import("../robots-BzO2bi0d.mjs");
|
|
228
228
|
printRobotsGenerateHelp();
|
|
229
229
|
process.exit(1);
|
|
230
230
|
} else if (parsedCommand.command === "downgrade") {
|
|
231
|
-
const { downgrade } = await import("../downgrade-
|
|
231
|
+
const { downgrade } = await import("../downgrade-D7zavP20.mjs");
|
|
232
232
|
const framework = (typeof flags.framework === "string" ? flags.framework : void 0) ?? (args[1] && !args[1].startsWith("--") ? args[1] : void 0);
|
|
233
233
|
const hasVersionFlag = args.includes("--version") || args.some((arg) => arg.startsWith("--version="));
|
|
234
234
|
await downgrade({
|
|
@@ -236,7 +236,7 @@ async function main() {
|
|
|
236
236
|
version: typeof flags.version === "string" ? flags.version : hasVersionFlag ? "" : void 0
|
|
237
237
|
});
|
|
238
238
|
} else if (parsedCommand.command === "upgrade") {
|
|
239
|
-
const { upgrade } = await import("../upgrade-
|
|
239
|
+
const { upgrade } = await import("../upgrade-Dzej61y4.mjs");
|
|
240
240
|
const framework = (typeof flags.framework === "string" ? flags.framework : void 0) ?? (args[1] && !args[1].startsWith("--") ? args[1] : void 0);
|
|
241
241
|
const hasVersionFlag = args.includes("--version") || args.some((arg) => arg.startsWith("--version="));
|
|
242
242
|
const version = typeof flags.version === "string" ? flags.version : hasVersionFlag ? "" : void 0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as markCliErrorReported } from "./errors-
|
|
2
|
-
import { a as loadProjectEnv, c as readNavTitle, d as readTopLevelBooleanProperty, f as readTopLevelStringProperty, i as loadDocsConfigModule, m as resolveDocsContentDir, p as resolveDocsConfigPath, t as extractNestedObjectLiteral, u as readStringProperty } from "./config-
|
|
3
|
-
import { t as detectFramework } from "./utils-
|
|
1
|
+
import { n as markCliErrorReported } from "./errors-Dw5gMhEZ.mjs";
|
|
2
|
+
import { a as loadProjectEnv, c as readNavTitle, d as readTopLevelBooleanProperty, f as readTopLevelStringProperty, i as loadDocsConfigModule, m as resolveDocsContentDir, p as resolveDocsConfigPath, t as extractNestedObjectLiteral, u as readStringProperty } from "./config-De5z-2LK.mjs";
|
|
3
|
+
import { t as detectFramework } from "./utils-CoHZJ1i4.mjs";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import pc from "picocolors";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { _ as parseGeneratedAgentDocument, h as hashGeneratedAgentContent, m as GENERATED_AGENT_PROVENANCE_VERSION, v as serializeGeneratedAgentDocument } from "./search-
|
|
2
|
-
import { A as findDocsMarkdownPage, q as renderDocsMarkdownDocument } from "./agent-
|
|
1
|
+
import { _ as parseGeneratedAgentDocument, h as hashGeneratedAgentContent, m as GENERATED_AGENT_PROVENANCE_VERSION, v as serializeGeneratedAgentDocument } from "./search-DiFxtL5t.mjs";
|
|
2
|
+
import { A as findDocsMarkdownPage, q as renderDocsMarkdownDocument } from "./agent-DEr3FFdg.mjs";
|
|
3
3
|
import "./index.mjs";
|
|
4
4
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
5
5
|
import "./server.mjs";
|
|
6
|
-
import { a as loadProjectEnv, c as readNavTitle, f as readTopLevelStringProperty, i as loadDocsConfigModule, l as readNumberProperty, m as resolveDocsContentDir, o as readBooleanProperty, p as resolveDocsConfigPath, s as readEnvReferenceProperty, t as extractNestedObjectLiteral, u as readStringProperty } from "./config-
|
|
6
|
+
import { a as loadProjectEnv, c as readNavTitle, f as readTopLevelStringProperty, i as loadDocsConfigModule, l as readNumberProperty, m as resolveDocsContentDir, o as readBooleanProperty, p as resolveDocsConfigPath, s as readEnvReferenceProperty, t as extractNestedObjectLiteral, u as readStringProperty } from "./config-De5z-2LK.mjs";
|
|
7
7
|
import matter from "gray-matter";
|
|
8
8
|
import { existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
9
9
|
import path from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as
|
|
2
|
-
import { K as rootLayoutTemplate, W as postcssConfigTemplate, g as docsLayoutTemplate, v as globalCssTemplate, yt as tsconfigTemplate } from "./templates-
|
|
1
|
+
import { i as detectPackageManagerFromProject } from "./utils-CoHZJ1i4.mjs";
|
|
2
|
+
import { K as rootLayoutTemplate, W as postcssConfigTemplate, g as docsLayoutTemplate, v as globalCssTemplate, yt as tsconfigTemplate } from "./templates-BOoV0cIR.mjs";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import pc from "picocolors";
|
|
@@ -441,14 +441,7 @@ function findLocalFrameworkRoot(startDir) {
|
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
443
|
function detectNearestPackageManager(startDir) {
|
|
444
|
-
|
|
445
|
-
while (true) {
|
|
446
|
-
const detected = detectPackageManagerFromLockfile(current);
|
|
447
|
-
if (detected) return detected;
|
|
448
|
-
const parent = path.dirname(current);
|
|
449
|
-
if (parent === current) return "npm";
|
|
450
|
-
current = parent;
|
|
451
|
-
}
|
|
444
|
+
return detectPackageManagerFromProject(startDir)?.packageManager ?? "npm";
|
|
452
445
|
}
|
|
453
446
|
function resolveManagedConfigPath(projectRoot) {
|
|
454
447
|
const primaryPath = path.join(projectRoot, PRIMARY_MANAGED_CONFIG_FILE);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import "./reading-time-
|
|
2
|
-
import
|
|
3
|
-
import { O as buildDocsMcpEndpointCandidates, b as DEFAULT_SKILL_MD_ROUTE, c as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, d as DEFAULT_LLMS_FULL_TXT_ROUTE, g as DEFAULT_MCP_PUBLIC_ROUTE, i as DEFAULT_AGENT_FEEDBACK_ROUTE, l as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, m as DEFAULT_LLMS_TXT_ROUTE, n as DEFAULT_AGENTS_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-
|
|
4
|
-
import { a as analyzeDocsRobotsTxt, n as DEFAULT_ROBOTS_TXT_ROUTE, u as resolveDocsRobotsConfig } from "./robots-
|
|
5
|
-
import "./sitemap-server-
|
|
1
|
+
import "./reading-time-CPAy1SWO.mjs";
|
|
2
|
+
import "./search-DiFxtL5t.mjs";
|
|
3
|
+
import { O as buildDocsMcpEndpointCandidates, b as DEFAULT_SKILL_MD_ROUTE, c as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, d as DEFAULT_LLMS_FULL_TXT_ROUTE, g as DEFAULT_MCP_PUBLIC_ROUTE, ht as DEFAULT_SITEMAP_XML_ROUTE, i as DEFAULT_AGENT_FEEDBACK_ROUTE, l as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, m as DEFAULT_LLMS_TXT_ROUTE, mt as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, pt as DEFAULT_SITEMAP_MD_ROUTE, t as DEFAULT_AGENTS_MD_ROUTE, v as DEFAULT_MCP_WELL_KNOWN_ROUTE, x as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, xt as resolveDocsSitemapConfig } from "./agent-DEr3FFdg.mjs";
|
|
4
|
+
import { a as analyzeDocsRobotsTxt, n as DEFAULT_ROBOTS_TXT_ROUTE, u as resolveDocsRobotsConfig } from "./robots-BcP7nSfi.mjs";
|
|
5
|
+
import "./sitemap-server-RZG9eOJB.mjs";
|
|
6
6
|
import { createFilesystemDocsMcpSource, resolveDocsMcpConfig } from "./mcp.mjs";
|
|
7
7
|
import "./server.mjs";
|
|
8
|
-
import { a as loadProjectEnv, c as readNavTitle, f as readTopLevelStringProperty, i as loadDocsConfigModule, m as resolveDocsContentDir, o as readBooleanProperty, p as resolveDocsConfigPath, r as extractTopLevelConfigObject, t as extractNestedObjectLiteral } from "./config-
|
|
9
|
-
import { t as detectFramework } from "./utils-
|
|
10
|
-
import { n as inspectAgentCompactionState, o as scanDocsPageTargets } from "./codeblocks-
|
|
8
|
+
import { a as loadProjectEnv, c as readNavTitle, f as readTopLevelStringProperty, i as loadDocsConfigModule, m as resolveDocsContentDir, o as readBooleanProperty, p as resolveDocsConfigPath, r as extractTopLevelConfigObject, t as extractNestedObjectLiteral } from "./config-De5z-2LK.mjs";
|
|
9
|
+
import { t as detectFramework } from "./utils-CoHZJ1i4.mjs";
|
|
10
|
+
import { n as inspectAgentCompactionState, o as scanDocsPageTargets } from "./codeblocks-Dcn5tRbB.mjs";
|
|
11
11
|
import { existsSync, lstatSync, readFileSync, readdirSync } from "node:fs";
|
|
12
12
|
import path from "node:path";
|
|
13
13
|
import { LATEST_PROTOCOL_VERSION } from "@modelcontextprotocol/sdk/types.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as fileExists, o as exec, s as execOutput } from "./utils-
|
|
2
|
-
import { a as getPackagesForFramework, c as resolveDocsPackageManager, l as validateUpgradeVersion, r as buildDocsPackageInstallCommand, s as resolveDocsPackageFramework } from "./package-version-
|
|
1
|
+
import { c as fileExists, o as exec, s as execOutput } from "./utils-CoHZJ1i4.mjs";
|
|
2
|
+
import { a as getPackagesForFramework, c as resolveDocsPackageManager, l as validateUpgradeVersion, r as buildDocsPackageInstallCommand, s as resolveDocsPackageFramework } from "./package-version-CeNAB4NZ.mjs";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import pc from "picocolors";
|