@farming-labs/docs 0.1.133 → 0.1.135
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-CKxYOgwV.mjs → agent-B1QkB5cK.mjs} +2 -2
- package/dist/{agents-Cht6pl2W.mjs → agents-DuchBHZq.mjs} +1 -1
- package/dist/cli/index.mjs +30 -20
- package/dist/{cloud-88xTLXn3.mjs → cloud-BdSGNsah.mjs} +141 -17
- package/dist/{codeblocks-BoYq0OXV.mjs → codeblocks-CvaUvBID.mjs} +1 -1
- package/dist/{doctor-CGwgkvAq.mjs → doctor-CcLWN0Vt.mjs} +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{mcp-CUAR3XfW.mjs → mcp-A59-H379.mjs} +1 -1
- package/dist/mcp.d.mts +1 -1
- package/dist/mcp.mjs +3 -3
- package/dist/{search-Cekr2OyP.mjs → search-BpT6vLj7.mjs} +1 -1
- package/dist/{search-BL7o2rXk.mjs → search-CLU1Qlpi.mjs} +5 -5
- package/dist/{search-CNoiftmI.d.mts → search-HIuIWw6s.d.mts} +1 -1
- package/dist/server.d.mts +2 -2
- package/dist/server.mjs +1 -1
- package/dist/{sitemap-BBfGr3tJ.mjs → sitemap-Nt9Ft2Xw.mjs} +1 -1
- package/dist/{types-C-C-9SMJ.d.mts → types-DC1QpBmS.d.mts} +14 -7
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "./reading-time-DPAazAGu.mjs";
|
|
2
|
-
import "./search-
|
|
2
|
+
import "./search-CLU1Qlpi.mjs";
|
|
3
3
|
import "./agent-B7T4gauS.mjs";
|
|
4
4
|
import "./robots-CDdD2o-Q.mjs";
|
|
5
5
|
import "./sitemap-server-idLUrmmU.mjs";
|
|
6
6
|
import "./config-CBoixmrv.mjs";
|
|
7
|
-
import { a as readPageTokenBudget, i as printAgentCompactHelp, n as inspectAgentCompactionState, o as scanDocsPageTargets, r as parseAgentCompactArgs, t as compactAgentDocs } from "./codeblocks-
|
|
7
|
+
import { a as readPageTokenBudget, i as printAgentCompactHelp, n as inspectAgentCompactionState, o as scanDocsPageTargets, r as parseAgentCompactArgs, t as compactAgentDocs } from "./codeblocks-CvaUvBID.mjs";
|
|
8
8
|
|
|
9
9
|
export { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./search-
|
|
1
|
+
import "./search-CLU1Qlpi.mjs";
|
|
2
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-B7T4gauS.mjs";
|
|
3
3
|
import { S as resolveApiReferenceConfig } from "./sitemap-server-idLUrmmU.mjs";
|
|
4
4
|
import { resolveDocsMcpConfig } from "./mcp.mjs";
|
package/dist/cli/index.mjs
CHANGED
|
@@ -89,26 +89,32 @@ async function main() {
|
|
|
89
89
|
} else if (parsedCommand.command === "dev") {
|
|
90
90
|
const { dev } = await import("../dev-DdlhqXNU.mjs");
|
|
91
91
|
await dev(devOptions);
|
|
92
|
+
} else if (parsedCommand.command === "deploy") {
|
|
93
|
+
const { runCloudDeploy } = await import("../cloud-BdSGNsah.mjs");
|
|
94
|
+
await runCloudDeploy(cloudOptions);
|
|
92
95
|
} else if (parsedCommand.command === "preview") {
|
|
93
|
-
const { runCloudPreview } = await import("../cloud-
|
|
96
|
+
const { runCloudPreview } = await import("../cloud-BdSGNsah.mjs");
|
|
94
97
|
await runCloudPreview(cloudOptions);
|
|
98
|
+
} else if (parsedCommand.command === "cloud" && subcommand === "deploy") {
|
|
99
|
+
const { runCloudDeploy } = await import("../cloud-BdSGNsah.mjs");
|
|
100
|
+
await runCloudDeploy(cloudOptions);
|
|
95
101
|
} else if (parsedCommand.command === "cloud" && subcommand === "preview") {
|
|
96
|
-
const { runCloudPreview } = await import("../cloud-
|
|
102
|
+
const { runCloudPreview } = await import("../cloud-BdSGNsah.mjs");
|
|
97
103
|
await runCloudPreview(cloudOptions);
|
|
98
104
|
} else if (parsedCommand.command === "cloud" && subcommand === "sync") {
|
|
99
|
-
const { syncCloudConfig } = await import("../cloud-
|
|
105
|
+
const { syncCloudConfig } = await import("../cloud-BdSGNsah.mjs");
|
|
100
106
|
await syncCloudConfig(cloudOptions);
|
|
101
107
|
} else if (parsedCommand.command === "cloud") {
|
|
102
108
|
console.error(pc.red(`Unknown cloud subcommand: ${subcommand ?? "(missing)"}`));
|
|
103
109
|
console.error();
|
|
104
|
-
const { printCloudHelp } = await import("../cloud-
|
|
110
|
+
const { printCloudHelp } = await import("../cloud-BdSGNsah.mjs");
|
|
105
111
|
printCloudHelp();
|
|
106
112
|
process.exit(1);
|
|
107
113
|
} else if (parsedCommand.command === "mcp") {
|
|
108
|
-
const { runMcp } = await import("../mcp-
|
|
114
|
+
const { runMcp } = await import("../mcp-A59-H379.mjs");
|
|
109
115
|
await runMcp(mcpOptions);
|
|
110
116
|
} else if (parsedCommand.command === "agent" && subcommand === "compact") {
|
|
111
|
-
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent-
|
|
117
|
+
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent-B1QkB5cK.mjs");
|
|
112
118
|
const agentCompactOptions = parseAgentCompactArgs(args.slice(2));
|
|
113
119
|
if (agentCompactOptions.help) {
|
|
114
120
|
printAgentCompactHelp();
|
|
@@ -118,11 +124,11 @@ async function main() {
|
|
|
118
124
|
} else if (parsedCommand.command === "agent") {
|
|
119
125
|
console.error(pc.red(`Unknown agent subcommand: ${subcommand ?? "(missing)"}`));
|
|
120
126
|
console.error();
|
|
121
|
-
const { printAgentCompactHelp } = await import("../agent-
|
|
127
|
+
const { printAgentCompactHelp } = await import("../agent-B1QkB5cK.mjs");
|
|
122
128
|
printAgentCompactHelp();
|
|
123
129
|
process.exit(1);
|
|
124
130
|
} else if (parsedCommand.command === "agents" && subcommand === "generate") {
|
|
125
|
-
const { generateAgents, parseAgentsGenerateArgs, printAgentsGenerateHelp } = await import("../agents-
|
|
131
|
+
const { generateAgents, parseAgentsGenerateArgs, printAgentsGenerateHelp } = await import("../agents-DuchBHZq.mjs");
|
|
126
132
|
const agentsOptions = parseAgentsGenerateArgs(args.slice(2));
|
|
127
133
|
if (agentsOptions.help) {
|
|
128
134
|
printAgentsGenerateHelp();
|
|
@@ -132,11 +138,11 @@ async function main() {
|
|
|
132
138
|
} else if (parsedCommand.command === "agents") {
|
|
133
139
|
console.error(pc.red(`Unknown agents subcommand: ${subcommand ?? "(missing)"}`));
|
|
134
140
|
console.error();
|
|
135
|
-
const { printAgentsGenerateHelp } = await import("../agents-
|
|
141
|
+
const { printAgentsGenerateHelp } = await import("../agents-DuchBHZq.mjs");
|
|
136
142
|
printAgentsGenerateHelp();
|
|
137
143
|
process.exit(1);
|
|
138
144
|
} else if (parsedCommand.command === "doctor") {
|
|
139
|
-
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-
|
|
145
|
+
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-CcLWN0Vt.mjs");
|
|
140
146
|
const doctorOptions = parseDoctorArgs(args.slice(1));
|
|
141
147
|
if (doctorOptions.help) {
|
|
142
148
|
printDoctorHelp();
|
|
@@ -152,7 +158,7 @@ async function main() {
|
|
|
152
158
|
}
|
|
153
159
|
await runReview(reviewOptions);
|
|
154
160
|
} else if ((parsedCommand.command === "codeblocks" || parsedCommand.command === "code-blocks") && subcommand === "validate") {
|
|
155
|
-
const { parseCodeBlocksValidateArgs, printCodeBlocksValidateHelp, runCodeBlocksValidate } = await import("../codeblocks-
|
|
161
|
+
const { parseCodeBlocksValidateArgs, printCodeBlocksValidateHelp, runCodeBlocksValidate } = await import("../codeblocks-CvaUvBID.mjs");
|
|
156
162
|
const codeBlocksOptions = parseCodeBlocksValidateArgs(args.slice(2));
|
|
157
163
|
if (codeBlocksOptions.help) {
|
|
158
164
|
printCodeBlocksValidateHelp();
|
|
@@ -162,11 +168,11 @@ async function main() {
|
|
|
162
168
|
} else if (parsedCommand.command === "codeblocks" || parsedCommand.command === "code-blocks") {
|
|
163
169
|
console.error(pc.red(`Unknown codeblocks subcommand: ${subcommand ?? "(missing)"}`));
|
|
164
170
|
console.error();
|
|
165
|
-
const { printCodeBlocksValidateHelp } = await import("../codeblocks-
|
|
171
|
+
const { printCodeBlocksValidateHelp } = await import("../codeblocks-CvaUvBID.mjs");
|
|
166
172
|
printCodeBlocksValidateHelp();
|
|
167
173
|
process.exit(1);
|
|
168
174
|
} else if (parsedCommand.command === "search" && subcommand === "sync") {
|
|
169
|
-
const { syncSearch } = await import("../search-
|
|
175
|
+
const { syncSearch } = await import("../search-BpT6vLj7.mjs");
|
|
170
176
|
await syncSearch(searchSyncOptions);
|
|
171
177
|
} else if (parsedCommand.command === "search") {
|
|
172
178
|
console.error(pc.red(`Unknown search subcommand: ${subcommand ?? "(missing)"}`));
|
|
@@ -174,7 +180,7 @@ async function main() {
|
|
|
174
180
|
printHelp();
|
|
175
181
|
process.exit(1);
|
|
176
182
|
} else if (parsedCommand.command === "sitemap" && subcommand === "generate") {
|
|
177
|
-
const { generateSitemap, parseSitemapGenerateArgs, printSitemapGenerateHelp } = await import("../sitemap-
|
|
183
|
+
const { generateSitemap, parseSitemapGenerateArgs, printSitemapGenerateHelp } = await import("../sitemap-Nt9Ft2Xw.mjs");
|
|
178
184
|
const sitemapOptions = parseSitemapGenerateArgs(args.slice(2));
|
|
179
185
|
if (sitemapOptions.help) {
|
|
180
186
|
printSitemapGenerateHelp();
|
|
@@ -184,7 +190,7 @@ async function main() {
|
|
|
184
190
|
} else if (parsedCommand.command === "sitemap") {
|
|
185
191
|
console.error(pc.red(`Unknown sitemap subcommand: ${subcommand ?? "(missing)"}`));
|
|
186
192
|
console.error();
|
|
187
|
-
const { printSitemapGenerateHelp } = await import("../sitemap-
|
|
193
|
+
const { printSitemapGenerateHelp } = await import("../sitemap-Nt9Ft2Xw.mjs");
|
|
188
194
|
printSitemapGenerateHelp();
|
|
189
195
|
process.exit(1);
|
|
190
196
|
} else if (parsedCommand.command === "robots" && subcommand === "generate") {
|
|
@@ -238,8 +244,9 @@ ${pc.dim("Usage:")}
|
|
|
238
244
|
${pc.dim("Commands:")}
|
|
239
245
|
${pc.cyan("init")} Scaffold docs in your project (default)
|
|
240
246
|
${pc.cyan("dev")} Run frameworkless docs locally from ${pc.dim("docs.json")}
|
|
241
|
-
${pc.cyan("
|
|
242
|
-
${pc.cyan("
|
|
247
|
+
${pc.cyan("deploy")} Sync cloud config and deploy hosted preview docs
|
|
248
|
+
${pc.cyan("preview")} Alias for ${pc.cyan("deploy")}
|
|
249
|
+
${pc.cyan("cloud")} Docs Cloud utilities (${pc.dim("deploy")}, ${pc.dim("preview")}, ${pc.dim("sync")})
|
|
243
250
|
${pc.cyan("agent")} Agent utilities (${pc.dim("compact")} to generate sibling agent.md files)
|
|
244
251
|
${pc.cyan("agents")} AGENTS.md utilities (${pc.dim("generate")} for static agent instructions)
|
|
245
252
|
${pc.cyan("doctor")} Inspect and score agent or reader-facing docs quality
|
|
@@ -273,14 +280,17 @@ ${pc.dim("Options for dev:")}
|
|
|
273
280
|
${pc.cyan("--host [host]")} Expose the preview on your network; optionally pass a host value
|
|
274
281
|
${pc.cyan("--verbose")} Show raw runtime logs in addition to branded CLI output
|
|
275
282
|
|
|
276
|
-
${pc.dim("Options for cloud
|
|
277
|
-
${pc.cyan("
|
|
278
|
-
${pc.cyan("cloud
|
|
283
|
+
${pc.dim("Options for cloud deploy:")}
|
|
284
|
+
${pc.cyan("deploy")} Sync ${pc.dim("docs.config.ts")} into ${pc.dim("docs.json")} and deploy hosted preview docs
|
|
285
|
+
${pc.cyan("cloud deploy")} Same as ${pc.cyan("deploy")}
|
|
286
|
+
${pc.cyan("preview")} Alias for ${pc.cyan("deploy")}
|
|
287
|
+
${pc.cyan("cloud preview")} Compatibility alias for ${pc.cyan("cloud deploy")}
|
|
279
288
|
${pc.cyan("cloud sync")} Only materialize cloud settings into ${pc.dim("docs.json")}
|
|
280
289
|
${pc.cyan("--config <path>")} Use a custom docs config path
|
|
281
290
|
${pc.cyan("--api-base-url <url>")} Override the Docs Cloud API base URL
|
|
282
291
|
${pc.cyan("--api-key <key>")} Use an API key directly; prefer ${pc.dim("cloud.apiKey.env")}
|
|
283
292
|
${pc.cyan("--json")} Print machine-readable output
|
|
293
|
+
${pc.dim("required scopes")} project:read, preview:write, jobs:read
|
|
284
294
|
|
|
285
295
|
${pc.dim("Options for agent compact:")}
|
|
286
296
|
${pc.cyan("agent compact <page...>")} Compact pages and write sibling ${pc.dim("agent.md")} files
|
|
@@ -12,6 +12,11 @@ const DOCS_CLOUD_DEFAULT_API_KEY_ENV = "DOCS_CLOUD_API_KEY";
|
|
|
12
12
|
const DEFAULT_DOCS_CLOUD_API_BASE_URL = "https://docs-app.farming-labs.dev";
|
|
13
13
|
const DEFAULT_PREVIEW_TIMEOUT_MS = 300 * 1e3;
|
|
14
14
|
const DEFAULT_PREVIEW_POLL_INTERVAL_MS = 2e3;
|
|
15
|
+
const REQUIRED_PREVIEW_API_KEY_SCOPES = [
|
|
16
|
+
"project:read",
|
|
17
|
+
"preview:write",
|
|
18
|
+
"jobs:read"
|
|
19
|
+
];
|
|
15
20
|
function isRecord(value) {
|
|
16
21
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
17
22
|
}
|
|
@@ -146,7 +151,6 @@ function normalizeAnalyticsConfig(analytics) {
|
|
|
146
151
|
function normalizeCloudConfig(cloud) {
|
|
147
152
|
const normalized = {
|
|
148
153
|
apiKey: normalizeApiKeyConfig(cloud?.apiKey),
|
|
149
|
-
preview: normalizePreviewConfig(cloud?.preview),
|
|
150
154
|
publish: normalizePublishConfig(cloud?.publish)
|
|
151
155
|
};
|
|
152
156
|
if (cloud?.enabled === false) normalized.enabled = false;
|
|
@@ -156,6 +160,7 @@ function normalizeCloudConfig(cloud) {
|
|
|
156
160
|
if (ai) normalized.ai = ai;
|
|
157
161
|
const deploy = normalizeFeatureConfig(cloud?.deploy);
|
|
158
162
|
if (deploy) normalized.deploy = deploy;
|
|
163
|
+
if (cloud?.preview) normalized.preview = normalizePreviewConfig(cloud.preview);
|
|
159
164
|
return normalized;
|
|
160
165
|
}
|
|
161
166
|
function readStaticCloudConfig(content) {
|
|
@@ -223,7 +228,7 @@ function resolveSiteConfig(rootDir, snapshot, existing) {
|
|
|
223
228
|
const description = metadataDescription || existingSite?.description;
|
|
224
229
|
if (!name && !description && !existingSite) return void 0;
|
|
225
230
|
return {
|
|
226
|
-
...existingSite
|
|
231
|
+
...existingSite,
|
|
227
232
|
...typeof name === "string" ? { name } : {},
|
|
228
233
|
...typeof description === "string" ? { description } : {}
|
|
229
234
|
};
|
|
@@ -253,12 +258,12 @@ function materializeDocsJsonObject(params) {
|
|
|
253
258
|
const existingContent = toJsonRecord(params.existing?.content);
|
|
254
259
|
const site = resolveSiteConfig(params.rootDir, params.snapshot, params.existing);
|
|
255
260
|
const content = {
|
|
256
|
-
...existingContent
|
|
261
|
+
...existingContent,
|
|
257
262
|
docsRoot,
|
|
258
263
|
...apiReferenceRoot ? { apiReferenceRoot } : {}
|
|
259
264
|
};
|
|
260
265
|
return {
|
|
261
|
-
...params.existing
|
|
266
|
+
...params.existing,
|
|
262
267
|
$schema: params.existing?.$schema ?? DOCS_CLOUD_SCHEMA_URL,
|
|
263
268
|
version: 1,
|
|
264
269
|
docs: resolveDocsBlock(params.rootDir, params.snapshot, params.existing),
|
|
@@ -324,6 +329,89 @@ function readResponseMessage(body, fallback) {
|
|
|
324
329
|
}
|
|
325
330
|
return fallback;
|
|
326
331
|
}
|
|
332
|
+
const FAILURE_DETAIL_OBJECT_KEYS = [
|
|
333
|
+
"job",
|
|
334
|
+
"run",
|
|
335
|
+
"preview",
|
|
336
|
+
"deployment",
|
|
337
|
+
"build"
|
|
338
|
+
];
|
|
339
|
+
const FAILURE_DETAIL_ARRAY_KEYS = [
|
|
340
|
+
"jobs",
|
|
341
|
+
"runs",
|
|
342
|
+
"steps",
|
|
343
|
+
"tasks",
|
|
344
|
+
"stages",
|
|
345
|
+
"checks"
|
|
346
|
+
];
|
|
347
|
+
const FAILURE_DETAIL_MESSAGE_KEYS = [
|
|
348
|
+
"error",
|
|
349
|
+
"message",
|
|
350
|
+
"detail",
|
|
351
|
+
"reason",
|
|
352
|
+
"summary"
|
|
353
|
+
];
|
|
354
|
+
const FAILURE_DETAIL_LABEL_KEYS = [
|
|
355
|
+
"name",
|
|
356
|
+
"title",
|
|
357
|
+
"label",
|
|
358
|
+
"step",
|
|
359
|
+
"phase",
|
|
360
|
+
"stage",
|
|
361
|
+
"id"
|
|
362
|
+
];
|
|
363
|
+
const FAILURE_DETAIL_STATUS_KEYS = [
|
|
364
|
+
"status",
|
|
365
|
+
"state",
|
|
366
|
+
"conclusion",
|
|
367
|
+
"result",
|
|
368
|
+
"outcome"
|
|
369
|
+
];
|
|
370
|
+
function readTrimmedString(value) {
|
|
371
|
+
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
372
|
+
}
|
|
373
|
+
function readFirstString(record, keys) {
|
|
374
|
+
for (const key of keys) {
|
|
375
|
+
const value = readTrimmedString(record[key]);
|
|
376
|
+
if (value) return value;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
function singularizeKey(key) {
|
|
380
|
+
return key.endsWith("s") ? key.slice(0, -1) : key;
|
|
381
|
+
}
|
|
382
|
+
function findPreviewFailureDetail(value, parentPath = [], fallbackLabel) {
|
|
383
|
+
if (!isRecord(value)) return void 0;
|
|
384
|
+
const label = readFirstString(value, FAILURE_DETAIL_LABEL_KEYS) ?? fallbackLabel;
|
|
385
|
+
const path = label ? [...parentPath, label] : parentPath;
|
|
386
|
+
for (const key of FAILURE_DETAIL_OBJECT_KEYS) {
|
|
387
|
+
const detail = findPreviewFailureDetail(value[key], path, key);
|
|
388
|
+
if (detail) return detail;
|
|
389
|
+
}
|
|
390
|
+
for (const key of FAILURE_DETAIL_ARRAY_KEYS) {
|
|
391
|
+
const children = value[key];
|
|
392
|
+
if (!Array.isArray(children)) continue;
|
|
393
|
+
for (const child of children) {
|
|
394
|
+
const detail = findPreviewFailureDetail(child, path, singularizeKey(key));
|
|
395
|
+
if (detail) return detail;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
const status = readFirstString(value, FAILURE_DETAIL_STATUS_KEYS);
|
|
399
|
+
if (!isTerminalFailureStatus(status)) return void 0;
|
|
400
|
+
return {
|
|
401
|
+
message: readFirstString(value, FAILURE_DETAIL_MESSAGE_KEYS),
|
|
402
|
+
path,
|
|
403
|
+
status
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
function readPreviewFailureMessage(body, fallback) {
|
|
407
|
+
const detail = findPreviewFailureDetail(body);
|
|
408
|
+
if (!detail) return readResponseMessage(body, fallback);
|
|
409
|
+
const prefix = fallback.replace(/\.+$/g, "");
|
|
410
|
+
const location = detail.path.length > 0 ? ` at ${detail.path.join(" > ")}` : "";
|
|
411
|
+
const status = detail.status ? ` (${detail.status})` : "";
|
|
412
|
+
const message = detail.message ?? readResponseMessage(body, "");
|
|
413
|
+
return message ? `${prefix}${location}${status}: ${message}` : `${prefix}${location}${status}.`;
|
|
414
|
+
}
|
|
327
415
|
async function fetchCloudJson(params) {
|
|
328
416
|
const headers = new Headers(params.init?.headers);
|
|
329
417
|
headers.set("authorization", `Bearer ${params.apiKey}`);
|
|
@@ -357,7 +445,31 @@ function readStatusUrl(body, apiBaseUrl) {
|
|
|
357
445
|
}
|
|
358
446
|
function readPreviewStatus(body) {
|
|
359
447
|
if (!isRecord(body)) return void 0;
|
|
448
|
+
const job = body.job;
|
|
449
|
+
if (isRecord(job) && typeof job.status === "string") return job.status;
|
|
450
|
+
const preview = body.preview;
|
|
451
|
+
if (isRecord(preview) && typeof preview.status === "string") return preview.status;
|
|
360
452
|
const status = body.status;
|
|
453
|
+
if (typeof status === "string") return status;
|
|
454
|
+
}
|
|
455
|
+
function readApiKeyScopes(body) {
|
|
456
|
+
if (!isRecord(body)) return [];
|
|
457
|
+
const apiKey = body.apiKey;
|
|
458
|
+
if (!isRecord(apiKey) || !Array.isArray(apiKey.scopes)) return [];
|
|
459
|
+
return apiKey.scopes.filter((scope) => typeof scope === "string");
|
|
460
|
+
}
|
|
461
|
+
function assertPreviewApiKeyScopes(identity) {
|
|
462
|
+
const scopes = readApiKeyScopes(identity);
|
|
463
|
+
const missing = REQUIRED_PREVIEW_API_KEY_SCOPES.filter((scope) => !scopes.includes(scope));
|
|
464
|
+
if (missing.length > 0) throw new Error(`Docs Cloud API key is missing required preview scope${missing.length === 1 ? "" : "s"}: ${missing.join(", ")}.`);
|
|
465
|
+
return scopes;
|
|
466
|
+
}
|
|
467
|
+
function isTerminalFailureStatus(status) {
|
|
468
|
+
const normalized = status?.toLowerCase();
|
|
469
|
+
return normalized === "failed" || normalized === "failure" || normalized === "error" || normalized === "canceled" || normalized === "cancelled" || normalized === "timed_out" || normalized === "timeout";
|
|
470
|
+
}
|
|
471
|
+
function readStatusLabel(body) {
|
|
472
|
+
const status = readPreviewStatus(body);
|
|
361
473
|
return typeof status === "string" ? status : void 0;
|
|
362
474
|
}
|
|
363
475
|
async function requestPreview(params) {
|
|
@@ -393,8 +505,7 @@ async function requestPreview(params) {
|
|
|
393
505
|
url,
|
|
394
506
|
response: statusBody
|
|
395
507
|
};
|
|
396
|
-
|
|
397
|
-
if (status === "failed" || status === "error") throw new Error(readResponseMessage(statusBody, "Docs Cloud preview failed."));
|
|
508
|
+
if (isTerminalFailureStatus(readStatusLabel(statusBody))) throw new Error(readPreviewFailureMessage(statusBody, "Docs Cloud preview failed."));
|
|
398
509
|
}
|
|
399
510
|
throw new Error("Docs Cloud preview timed out before a URL was ready.");
|
|
400
511
|
}
|
|
@@ -453,17 +564,18 @@ async function syncCloudConfig(options = {}) {
|
|
|
453
564
|
console.log(`${pc.dim("api key env")} ${result.apiKeyEnv}`);
|
|
454
565
|
return result;
|
|
455
566
|
}
|
|
456
|
-
async function
|
|
567
|
+
async function runCloudDeployment(options = {}) {
|
|
457
568
|
const rootDir = options.rootDir ?? process.cwd();
|
|
458
|
-
const spinner = createSpinner("Preparing Docs Cloud
|
|
569
|
+
const spinner = createSpinner("Preparing Docs Cloud deployment", options);
|
|
459
570
|
try {
|
|
460
571
|
const materialized = await materializeCloudConfig({
|
|
461
572
|
...options,
|
|
462
573
|
rootDir
|
|
463
574
|
});
|
|
464
575
|
spinner.update(`${materialized.created ? "Created" : "Synced"} ${DOCS_JSON_FILE}`);
|
|
465
|
-
if (materialized.config.cloud?.enabled === false) throw new Error("Docs Cloud is disabled in cloud.enabled. Remove that override or set cloud.enabled: true before
|
|
466
|
-
if (materialized.config.cloud?.preview?.enabled === false) throw new Error("Docs Cloud preview
|
|
576
|
+
if (materialized.config.cloud?.enabled === false) throw new Error("Docs Cloud is disabled in cloud.enabled. Remove that override or set cloud.enabled: true before deploying hosted preview docs.");
|
|
577
|
+
if (materialized.config.cloud?.preview?.enabled === false) throw new Error("Docs Cloud preview deployments are disabled in cloud.preview.enabled. Remove that legacy override before deploying hosted preview docs.");
|
|
578
|
+
if (materialized.config.cloud?.deploy?.enabled === false) throw new Error("Docs Cloud deployment is disabled in cloud.deploy.enabled. Set it to true before deploying hosted preview docs.");
|
|
467
579
|
const apiKey = resolveApiKey(options, rootDir, materialized.apiKeyEnv);
|
|
468
580
|
const apiBaseUrl = resolveApiBaseUrl(options);
|
|
469
581
|
spinner.update("Validating Docs Cloud API key");
|
|
@@ -471,7 +583,8 @@ async function runCloudPreview(options = {}) {
|
|
|
471
583
|
url: `${apiBaseUrl}/api/cloud/me`,
|
|
472
584
|
apiKey
|
|
473
585
|
});
|
|
474
|
-
|
|
586
|
+
assertPreviewApiKeyScopes(identity);
|
|
587
|
+
spinner.update("Requesting Docs Cloud deployment");
|
|
475
588
|
const preview = await requestPreview({
|
|
476
589
|
apiBaseUrl,
|
|
477
590
|
apiKey,
|
|
@@ -482,7 +595,7 @@ async function runCloudPreview(options = {}) {
|
|
|
482
595
|
timeoutMs: options.timeoutMs ?? DEFAULT_PREVIEW_TIMEOUT_MS,
|
|
483
596
|
pollIntervalMs: options.pollIntervalMs ?? DEFAULT_PREVIEW_POLL_INTERVAL_MS
|
|
484
597
|
});
|
|
485
|
-
spinner.succeed("Docs Cloud
|
|
598
|
+
spinner.succeed("Docs Cloud deployment is ready");
|
|
486
599
|
const result = {
|
|
487
600
|
url: preview.url,
|
|
488
601
|
docsJsonPath: materialized.docsJsonPath,
|
|
@@ -491,7 +604,7 @@ async function runCloudPreview(options = {}) {
|
|
|
491
604
|
response: preview.response
|
|
492
605
|
};
|
|
493
606
|
if (options.json) console.log(JSON.stringify(result, null, 2));
|
|
494
|
-
else console.log(`${pc.bold("
|
|
607
|
+
else console.log(`${pc.bold("Deployment")} ${pc.cyan(preview.url)}`);
|
|
495
608
|
return result;
|
|
496
609
|
} catch (error) {
|
|
497
610
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -501,13 +614,21 @@ async function runCloudPreview(options = {}) {
|
|
|
501
614
|
spinner.stop();
|
|
502
615
|
}
|
|
503
616
|
}
|
|
617
|
+
async function runCloudDeploy(options = {}) {
|
|
618
|
+
return runCloudDeployment(options);
|
|
619
|
+
}
|
|
620
|
+
async function runCloudPreview(options = {}) {
|
|
621
|
+
return runCloudDeployment(options);
|
|
622
|
+
}
|
|
504
623
|
function printCloudHelp() {
|
|
505
624
|
console.log(`
|
|
506
625
|
${pc.bold("@farming-labs/docs cloud")}
|
|
507
626
|
|
|
508
627
|
${pc.dim("Usage:")}
|
|
509
|
-
${pc.cyan("docs
|
|
510
|
-
${pc.cyan("docs cloud
|
|
628
|
+
${pc.cyan("docs deploy")} Sync ${pc.dim("docs.config.ts")} to ${pc.dim("docs.json")} and deploy hosted preview docs
|
|
629
|
+
${pc.cyan("docs cloud deploy")} Same as ${pc.cyan("docs deploy")}
|
|
630
|
+
${pc.cyan("docs preview")} Compatibility alias for ${pc.cyan("docs deploy")}
|
|
631
|
+
${pc.cyan("docs cloud preview")} Compatibility alias for ${pc.cyan("docs cloud deploy")}
|
|
511
632
|
${pc.cyan("docs cloud sync")} Only materialize cloud settings into ${pc.dim("docs.json")}
|
|
512
633
|
|
|
513
634
|
${pc.dim("Options:")}
|
|
@@ -516,14 +637,17 @@ ${pc.dim("Options:")}
|
|
|
516
637
|
${pc.cyan("--api-key <key>")} Use an API key directly; prefer ${pc.dim("cloud.apiKey.env")}
|
|
517
638
|
${pc.cyan("--json")} Print machine-readable output
|
|
518
639
|
|
|
640
|
+
${pc.dim("API key scopes:")}
|
|
641
|
+
${REQUIRED_PREVIEW_API_KEY_SCOPES.join(", ")}
|
|
642
|
+
|
|
519
643
|
${pc.dim("Config example:")}
|
|
520
644
|
cloud: {
|
|
521
645
|
apiKey: { env: "DOCS_CLOUD_API_KEY" },
|
|
522
|
-
|
|
646
|
+
deploy: { enabled: true },
|
|
523
647
|
publish: { mode: "draft-pr", baseBranch: "main" },
|
|
524
648
|
}
|
|
525
649
|
`);
|
|
526
650
|
}
|
|
527
651
|
|
|
528
652
|
//#endregion
|
|
529
|
-
export { printCloudHelp, runCloudPreview, syncCloudConfig };
|
|
653
|
+
export { printCloudHelp, runCloudDeploy, runCloudPreview, syncCloudConfig };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as parseGeneratedAgentDocument, h as hashGeneratedAgentContent, m as GENERATED_AGENT_PROVENANCE_VERSION, v as serializeGeneratedAgentDocument } from "./search-
|
|
1
|
+
import { _ as parseGeneratedAgentDocument, h as hashGeneratedAgentContent, m as GENERATED_AGENT_PROVENANCE_VERSION, v as serializeGeneratedAgentDocument } from "./search-CLU1Qlpi.mjs";
|
|
2
2
|
import { A as findDocsMarkdownPage, q as renderDocsMarkdownDocument } from "./agent-B7T4gauS.mjs";
|
|
3
3
|
import "./index.mjs";
|
|
4
4
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./reading-time-DPAazAGu.mjs";
|
|
2
|
-
import "./search-
|
|
2
|
+
import "./search-CLU1Qlpi.mjs";
|
|
3
3
|
import { a as DEFAULT_SITEMAP_XML_ROUTE, d as resolveDocsSitemapConfig, i as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, r as DEFAULT_SITEMAP_MD_ROUTE } from "./sitemap-CMNj0Pt3.mjs";
|
|
4
4
|
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-B7T4gauS.mjs";
|
|
5
5
|
import { a as analyzeDocsRobotsTxt, n as DEFAULT_ROBOTS_TXT_ROUTE, u as resolveDocsRobotsConfig } from "./robots-CDdD2o-Q.mjs";
|
|
@@ -8,7 +8,7 @@ import { createFilesystemDocsMcpSource, resolveDocsMcpConfig } from "./mcp.mjs";
|
|
|
8
8
|
import "./server.mjs";
|
|
9
9
|
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-CBoixmrv.mjs";
|
|
10
10
|
import { t as detectFramework } from "./utils-x5EtYWjC.mjs";
|
|
11
|
-
import { n as inspectAgentCompactionState, o as scanDocsPageTargets } from "./codeblocks-
|
|
11
|
+
import { n as inspectAgentCompactionState, o as scanDocsPageTargets } from "./codeblocks-CvaUvBID.mjs";
|
|
12
12
|
import { existsSync, lstatSync, readFileSync, readdirSync } from "node:fs";
|
|
13
13
|
import path from "node:path";
|
|
14
14
|
import { LATEST_PROTOCOL_VERSION } from "@modelcontextprotocol/sdk/types.js";
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as DocsObservabilityEventInput, $t as SimpleDocsSearchConfig, A as DocsCloudApiKeyConfig, At as McpDocsSearchConfig, B as DocsCodeBlocksValidateConfig, Bt as PageFrontmatter, C as DocsAskAIActionData, Ct as FontStyle, D as DocsAskAIFeedbackMessage, Dt as LlmsTxtMaxCharsConfig, E as DocsAskAIFeedbackData, Et as LlmsTxtConfig, F as DocsCodeBlocksConfig, Ft as OpenDocsProviderId, G as DocsFeedbackValue, Gt as ResolvedDocsRelatedLink, H as DocsCodeBlocksValidationPolicy, Ht as PageSidebarFrontmatter, I as DocsCodeBlocksPlannerConfig, It as OpenDocsTarget, J as DocsMcpToolsConfig, Jt as SidebarFolderIndexBehavior, K as DocsI18nConfig, Kt as SidebarComponentProps, L as DocsCodeBlocksPlannerProvider, Lt as OpenGraphImage, M as DocsCloudFeatureConfig, Mt as OpenDocsConfig, N as DocsCloudPreviewConfig, Nt as OpenDocsProvider, O as DocsAskAIFeedbackValue, Ot as LlmsTxtMaxCharsMode, P as DocsCloudPublishConfig, Pt as OpenDocsProviderConfig, Q as DocsObservabilityEvent, Qt as SidebarTree, R as DocsCodeBlocksRunnerConfig, Rt as OrderingItem, S as DocsAnalyticsSource, St as FeedbackConfig, T as DocsAskAIFeedbackConfig, Tt as LastUpdatedConfig, U as DocsConfig, Ut as PageTwitter, V as DocsCodeBlocksValidationMode, Vt as PageOpenGraph, W as DocsFeedbackData, Wt as ReadingTimeConfig, X as DocsNav, Xt as SidebarNode, Y as DocsMetadata, Yt as SidebarFolderNode, Z as DocsObservabilityConfig, Zt as SidebarPageNode, _ as DocsAnalyticsConfig, _t as DocsSearchResult, a as ApiReferenceRenderer, at as DocsReviewScoreConfig, b as DocsAnalyticsEventType, bt as DocsSitemapConfig, c as ChangelogFrontmatter, ct as DocsRobotsRule, d as CustomDocsSearchConfig, dt as DocsSearchAdapterFactory, en as ThemeToggleConfig, et as DocsRelatedItem, f as DocsAgentFeedbackContext, ft as DocsSearchChunkingConfig, g as DocsAgentTraceStatus, gt as DocsSearchQuery, h as DocsAgentTraceEventType, ht as DocsSearchEmbeddingsConfig, i as ApiReferenceConfig, it as DocsReviewRulesConfig, j as DocsCloudConfig, jt as OGConfig, k as DocsAskAIMcpConfig, kt as LlmsTxtSectionConfig, l as CodeBlockCopyData, lt as DocsSearchAdapter, m as DocsAgentTraceEventInput, mt as DocsSearchDocument, n as AgentFeedbackConfig, nn as TypographyConfig, nt as DocsReviewCiMode, o as BreadcrumbConfig, ot as DocsReviewSeverity, p as DocsAgentFeedbackData, pt as DocsSearchConfig, q as DocsMcpConfig, qt as SidebarConfig, r as AlgoliaDocsSearchConfig, rn as UIConfig, rt as DocsReviewConfig, s as ChangelogConfig, st as DocsRobotsConfig, t as AIConfig, tn as TypesenseDocsSearchConfig, tt as DocsReviewCiConfig, u as CopyMarkdownConfig, ut as DocsSearchAdapterContext, v as DocsAnalyticsEvent, vt as DocsSearchResultType, w as DocsAskAIActionType, wt as GithubConfig, x as DocsAnalyticsInput, xt as DocsTheme, y as DocsAnalyticsEventInput, yt as DocsSearchSourcePage, z as DocsCodeBlocksRunnerProvider, zt as PageActionsConfig } from "./types-
|
|
2
|
-
import { $ as createDocsAgentTraceId, A as resolveDocsSitemapRequest, C as buildDocsSitemapManifest, D as renderDocsSitemapXml, E as renderDocsSitemapMarkdown, I as PromptAction, J as DOCS_AGENT_TRACE_EVENT_TYPES, L as PromptProviderChoice, O as resolveDocsSitemapConfig, Q as createDocsAgentTraceContext, R as SerializeOpenDocsProviderOptions, S as DocsSitemapResolvedConfig, T as readDocsSitemapManifestFromContentMap, X as ResolvedDocsAnalyticsConfig, Y as DocsAgentTraceContext, Z as ResolvedDocsObservabilityConfig, _ as DEFAULT_SITEMAP_XML_ROUTE, a as createMcpSearchAdapter, at as DocsCloudAnalyticsOptions, b as DocsSitemapManifestPage, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, et as emitDocsAgentTraceEvent, f as resolveSearchRequestConfig, g as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, h as DEFAULT_SITEMAP_MD_ROUTE, i as createCustomSearchAdapter, it as resolveDocsObservabilityConfig, j as toDocsSitemapMarkdownUrl, k as resolveDocsSitemapPageLastmod, l as inferDocsAskAIPackageHints, m as DEFAULT_SITEMAP_MD_DOCS_ROUTE, n as buildDocsSearchDocuments, nt as emitDocsObservabilityEvent, o as createSimpleSearchAdapter, ot as createDocsCloudAnalytics, p as DEFAULT_SITEMAP_MANIFEST_PATH, r as createAlgoliaSearchAdapter, rt as resolveDocsAnalyticsConfig, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, tt as emitDocsAnalyticsEvent, u as performDocsSearch, v as DocsSitemapFormat, w as createDocsSitemapResponse, x as DocsSitemapPageInput, y as DocsSitemapManifest, z as SerializedOpenDocsProvider } from "./search-
|
|
1
|
+
import { $ as DocsObservabilityEventInput, $t as SimpleDocsSearchConfig, A as DocsCloudApiKeyConfig, At as McpDocsSearchConfig, B as DocsCodeBlocksValidateConfig, Bt as PageFrontmatter, C as DocsAskAIActionData, Ct as FontStyle, D as DocsAskAIFeedbackMessage, Dt as LlmsTxtMaxCharsConfig, E as DocsAskAIFeedbackData, Et as LlmsTxtConfig, F as DocsCodeBlocksConfig, Ft as OpenDocsProviderId, G as DocsFeedbackValue, Gt as ResolvedDocsRelatedLink, H as DocsCodeBlocksValidationPolicy, Ht as PageSidebarFrontmatter, I as DocsCodeBlocksPlannerConfig, It as OpenDocsTarget, J as DocsMcpToolsConfig, Jt as SidebarFolderIndexBehavior, K as DocsI18nConfig, Kt as SidebarComponentProps, L as DocsCodeBlocksPlannerProvider, Lt as OpenGraphImage, M as DocsCloudFeatureConfig, Mt as OpenDocsConfig, N as DocsCloudPreviewConfig, Nt as OpenDocsProvider, O as DocsAskAIFeedbackValue, Ot as LlmsTxtMaxCharsMode, P as DocsCloudPublishConfig, Pt as OpenDocsProviderConfig, Q as DocsObservabilityEvent, Qt as SidebarTree, R as DocsCodeBlocksRunnerConfig, Rt as OrderingItem, S as DocsAnalyticsSource, St as FeedbackConfig, T as DocsAskAIFeedbackConfig, Tt as LastUpdatedConfig, U as DocsConfig, Ut as PageTwitter, V as DocsCodeBlocksValidationMode, Vt as PageOpenGraph, W as DocsFeedbackData, Wt as ReadingTimeConfig, X as DocsNav, Xt as SidebarNode, Y as DocsMetadata, Yt as SidebarFolderNode, Z as DocsObservabilityConfig, Zt as SidebarPageNode, _ as DocsAnalyticsConfig, _t as DocsSearchResult, a as ApiReferenceRenderer, at as DocsReviewScoreConfig, b as DocsAnalyticsEventType, bt as DocsSitemapConfig, c as ChangelogFrontmatter, ct as DocsRobotsRule, d as CustomDocsSearchConfig, dt as DocsSearchAdapterFactory, en as ThemeToggleConfig, et as DocsRelatedItem, f as DocsAgentFeedbackContext, ft as DocsSearchChunkingConfig, g as DocsAgentTraceStatus, gt as DocsSearchQuery, h as DocsAgentTraceEventType, ht as DocsSearchEmbeddingsConfig, i as ApiReferenceConfig, it as DocsReviewRulesConfig, j as DocsCloudConfig, jt as OGConfig, k as DocsAskAIMcpConfig, kt as LlmsTxtSectionConfig, l as CodeBlockCopyData, lt as DocsSearchAdapter, m as DocsAgentTraceEventInput, mt as DocsSearchDocument, n as AgentFeedbackConfig, nn as TypographyConfig, nt as DocsReviewCiMode, o as BreadcrumbConfig, ot as DocsReviewSeverity, p as DocsAgentFeedbackData, pt as DocsSearchConfig, q as DocsMcpConfig, qt as SidebarConfig, r as AlgoliaDocsSearchConfig, rn as UIConfig, rt as DocsReviewConfig, s as ChangelogConfig, st as DocsRobotsConfig, t as AIConfig, tn as TypesenseDocsSearchConfig, tt as DocsReviewCiConfig, u as CopyMarkdownConfig, ut as DocsSearchAdapterContext, v as DocsAnalyticsEvent, vt as DocsSearchResultType, w as DocsAskAIActionType, wt as GithubConfig, x as DocsAnalyticsInput, xt as DocsTheme, y as DocsAnalyticsEventInput, yt as DocsSearchSourcePage, z as DocsCodeBlocksRunnerProvider, zt as PageActionsConfig } from "./types-DC1QpBmS.mjs";
|
|
2
|
+
import { $ as createDocsAgentTraceId, A as resolveDocsSitemapRequest, C as buildDocsSitemapManifest, D as renderDocsSitemapXml, E as renderDocsSitemapMarkdown, I as PromptAction, J as DOCS_AGENT_TRACE_EVENT_TYPES, L as PromptProviderChoice, O as resolveDocsSitemapConfig, Q as createDocsAgentTraceContext, R as SerializeOpenDocsProviderOptions, S as DocsSitemapResolvedConfig, T as readDocsSitemapManifestFromContentMap, X as ResolvedDocsAnalyticsConfig, Y as DocsAgentTraceContext, Z as ResolvedDocsObservabilityConfig, _ as DEFAULT_SITEMAP_XML_ROUTE, a as createMcpSearchAdapter, at as DocsCloudAnalyticsOptions, b as DocsSitemapManifestPage, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, et as emitDocsAgentTraceEvent, f as resolveSearchRequestConfig, g as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, h as DEFAULT_SITEMAP_MD_ROUTE, i as createCustomSearchAdapter, it as resolveDocsObservabilityConfig, j as toDocsSitemapMarkdownUrl, k as resolveDocsSitemapPageLastmod, l as inferDocsAskAIPackageHints, m as DEFAULT_SITEMAP_MD_DOCS_ROUTE, n as buildDocsSearchDocuments, nt as emitDocsObservabilityEvent, o as createSimpleSearchAdapter, ot as createDocsCloudAnalytics, p as DEFAULT_SITEMAP_MANIFEST_PATH, r as createAlgoliaSearchAdapter, rt as resolveDocsAnalyticsConfig, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, tt as emitDocsAnalyticsEvent, u as performDocsSearch, v as DocsSitemapFormat, w as createDocsSitemapResponse, x as DocsSitemapPageInput, y as DocsSitemapManifest, z as SerializedOpenDocsProvider } from "./search-HIuIWw6s.mjs";
|
|
3
3
|
import { DocsMcpPage, DocsMcpResolvedConfig } from "./mcp.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/define-docs.d.ts
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as extendTheme, a as resolveReadingTimeOptions, b as defineDocs, c as buildPageTwitter, d as resolveOGImage, f as resolveTitle, g as createTheme, h as resolveDocsPath, i as resolveReadingTimeFromSource, l as renderDocsPageStructuredDataJson, m as resolveDocsLocale, n as resolvePageReadingTime, o as buildDocsPageStructuredData, p as resolveDocsI18n, r as resolveReadingTimeFromContent, s as buildPageOpenGraph, t as estimateReadingTimeMinutes, u as resolveDocsMetadataBaseUrl, v as deepMerge, y as resolveChangelogConfig } from "./reading-time-DPAazAGu.mjs";
|
|
2
|
-
import { A as resolveDocsAnalyticsConfig, C as resolveSidebarFolderIndexBehaviorForPath, D as emitDocsAgentTraceEvent, E as createDocsAgentTraceId, M as createDocsCloudAnalytics, O as emitDocsAnalyticsEvent, S as resolveSidebarFolderIndexBehavior, T as createDocsAgentTraceContext, _ as parseGeneratedAgentDocument, a as createMcpSearchAdapter, b as applySidebarFolderIndexBehavior, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, f as resolveSearchRequestConfig, g as normalizeGeneratedAgentContent, h as hashGeneratedAgentContent, i as createCustomSearchAdapter, j as resolveDocsObservabilityConfig, k as emitDocsObservabilityEvent, l as inferDocsAskAIPackageHints, m as GENERATED_AGENT_PROVENANCE_VERSION, n as buildDocsSearchDocuments, o as createSimpleSearchAdapter, p as GENERATED_AGENT_PROVENANCE_MARKER, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, u as performDocsSearch, v as serializeGeneratedAgentDocument, w as DOCS_AGENT_TRACE_EVENT_TYPES, x as resolvePageSidebarFolderIndexBehavior, y as stripGeneratedAgentProvenance } from "./search-
|
|
2
|
+
import { A as resolveDocsAnalyticsConfig, C as resolveSidebarFolderIndexBehaviorForPath, D as emitDocsAgentTraceEvent, E as createDocsAgentTraceId, M as createDocsCloudAnalytics, O as emitDocsAnalyticsEvent, S as resolveSidebarFolderIndexBehavior, T as createDocsAgentTraceContext, _ as parseGeneratedAgentDocument, a as createMcpSearchAdapter, b as applySidebarFolderIndexBehavior, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, f as resolveSearchRequestConfig, g as normalizeGeneratedAgentContent, h as hashGeneratedAgentContent, i as createCustomSearchAdapter, j as resolveDocsObservabilityConfig, k as emitDocsObservabilityEvent, l as inferDocsAskAIPackageHints, m as GENERATED_AGENT_PROVENANCE_VERSION, n as buildDocsSearchDocuments, o as createSimpleSearchAdapter, p as GENERATED_AGENT_PROVENANCE_MARKER, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, u as performDocsSearch, v as serializeGeneratedAgentDocument, w as DOCS_AGENT_TRACE_EVENT_TYPES, x as resolvePageSidebarFolderIndexBehavior, y as stripGeneratedAgentProvenance } from "./search-CLU1Qlpi.mjs";
|
|
3
3
|
import { n as renderDocsRelatedMarkdownLines, t as normalizeDocsRelated } from "./related-BNj_NdHq.mjs";
|
|
4
4
|
import { a as DEFAULT_SITEMAP_XML_ROUTE, c as readDocsSitemapManifestFromContentMap, d as resolveDocsSitemapConfig, f as resolveDocsSitemapPageLastmod, i as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, l as renderDocsSitemapMarkdown, m as toDocsSitemapMarkdownUrl, n as DEFAULT_SITEMAP_MD_DOCS_ROUTE, o as buildDocsSitemapManifest, p as resolveDocsSitemapRequest, r as DEFAULT_SITEMAP_MD_ROUTE, s as createDocsSitemapResponse, t as DEFAULT_SITEMAP_MANIFEST_PATH, u as renderDocsSitemapXml } from "./sitemap-CMNj0Pt3.mjs";
|
|
5
5
|
import { $ as resolveDocsAgentsFormat, A as findDocsMarkdownPage, B as isDocsSkillRequest, C as DOCS_BOT_LIKE_USER_AGENT_HEADER_PATTERN, D as buildDocsAgentFeedbackSchema, E as buildDocsAgentDiscoverySpec, F as isDocsAgentDiscoveryRequest, G as renderDocsAgentsDocument, H as normalizeDocsPathSegment, I as isDocsAgentsRequest, J as renderDocsMarkdownNotFound, K as renderDocsLlmsTxt, L as isDocsLlmsTxtPublicRequest, M as getDocsMarkdownCanonicalLinkHeader, N as getDocsMarkdownVaryHeader, O as buildDocsMcpEndpointCandidates, P as hasDocsMarkdownSignatureAgent, Q as resolveDocsAgentMdxContent, R as isDocsMcpRequest, S as DOCS_AI_AGENT_USER_AGENT_HEADER_PATTERN, T as DOCS_TRADITIONAL_BOT_USER_AGENT_HEADER_PATTERN, U as normalizeDocsUrlPath, V as matchesDocsLlmsTxtSection, W as parseDocsAgentFeedbackData, X as resolveDocsAgentFeedbackConfig, Y as renderDocsSkillDocument, Z as resolveDocsAgentFeedbackRequest, _ as DEFAULT_MCP_ROUTE, a as DEFAULT_AGENT_MD_ROUTE, at as resolveDocsMarkdownRequest, b as DEFAULT_SKILL_MD_ROUTE, c as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, ct as selectDocsLlmsTxtContent, d as DEFAULT_LLMS_FULL_TXT_ROUTE, et as resolveDocsLlmsTxtFormat, f as DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE, g as DEFAULT_MCP_PUBLIC_ROUTE, h as DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE, i as DEFAULT_AGENT_FEEDBACK_ROUTE, it as resolveDocsMarkdownRecovery, j as getDocsLlmsTxtMaxCharsIssue, k as detectDocsMarkdownAgentRequest, l as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, lt as toDocsMarkdownUrl, m as DEFAULT_LLMS_TXT_ROUTE, n as DEFAULT_AGENTS_MD_WELL_KNOWN_ROUTE, nt as resolveDocsLlmsTxtSections, o as DEFAULT_AGENT_MD_WELL_KNOWN_ROUTE, ot as resolveDocsOpenApiDiscoveryConfig, p as DEFAULT_LLMS_TXT_MAX_CHARS, q as renderDocsMarkdownDocument, r as DEFAULT_AGENT_FEEDBACK_PAYLOAD_SCHEMA, rt as resolveDocsMarkdownCanonicalUrl, s as DEFAULT_AGENT_SPEC_ROUTE, st as resolveDocsSkillFormat, t as DEFAULT_AGENTS_MD_ROUTE, tt as resolveDocsLlmsTxtRequest, u as DEFAULT_DOCS_API_ROUTE, ut as validateDocsAgentFeedbackPayload, v as DEFAULT_MCP_WELL_KNOWN_ROUTE, w as DOCS_MARKDOWN_SIGNATURE_AGENT_HEADER, x as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, y as DEFAULT_OPENAPI_SCHEMA_ROUTE, z as isDocsPublicGetRequest } from "./agent-B7T4gauS.mjs";
|
package/dist/mcp.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Rt as OrderingItem, Z as DocsObservabilityConfig, _ as DocsAnalyticsConfig, pt as DocsSearchConfig, q as DocsMcpConfig, yt as DocsSearchSourcePage } from "./types-
|
|
1
|
+
import { Rt as OrderingItem, Z as DocsObservabilityConfig, _ as DocsAnalyticsConfig, pt as DocsSearchConfig, q as DocsMcpConfig, yt as DocsSearchSourcePage } from "./types-DC1QpBmS.mjs";
|
|
2
2
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
3
|
|
|
4
4
|
//#region src/mcp.d.ts
|
package/dist/mcp.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as emitDocsAgentTraceEvent, E as createDocsAgentTraceId, O as emitDocsAnalyticsEvent, T as createDocsAgentTraceContext, u as performDocsSearch, x as resolvePageSidebarFolderIndexBehavior, y as stripGeneratedAgentProvenance } from "./search-
|
|
1
|
+
import { D as emitDocsAgentTraceEvent, E as createDocsAgentTraceId, O as emitDocsAnalyticsEvent, T as createDocsAgentTraceContext, u as performDocsSearch, x as resolvePageSidebarFolderIndexBehavior, y as stripGeneratedAgentProvenance } from "./search-CLU1Qlpi.mjs";
|
|
2
2
|
import { n as renderDocsRelatedMarkdownLines, t as normalizeDocsRelated } from "./related-BNj_NdHq.mjs";
|
|
3
3
|
import matter from "gray-matter";
|
|
4
4
|
import fs from "node:fs";
|
|
@@ -253,11 +253,11 @@ const DOCS_CONFIG_SCHEMA_OPTIONS = [
|
|
|
253
253
|
description: "Environment variable that stores the Docs Cloud API key. The key value is never written to docs.json."
|
|
254
254
|
},
|
|
255
255
|
{
|
|
256
|
-
path: "cloud.
|
|
256
|
+
path: "cloud.deploy.enabled",
|
|
257
257
|
name: "enabled",
|
|
258
258
|
type: "boolean",
|
|
259
259
|
default: true,
|
|
260
|
-
description: "
|
|
260
|
+
description: "Enable the docs deploy command for hosted preview docs."
|
|
261
261
|
},
|
|
262
262
|
{
|
|
263
263
|
path: "cloud.publish.mode",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as buildDocsSearchDocuments, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter } from "./search-
|
|
1
|
+
import { n as buildDocsSearchDocuments, r as createAlgoliaSearchAdapter, s as createTypesenseSearchAdapter } from "./search-CLU1Qlpi.mjs";
|
|
2
2
|
import "./sitemap-server-idLUrmmU.mjs";
|
|
3
3
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
4
4
|
import "./server.mjs";
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
//#region src/cloud-analytics.ts
|
|
2
2
|
const DOCS_CLOUD_ANALYTICS_OPTIONS = Symbol.for("@farming-labs/docs/cloud-analytics");
|
|
3
|
-
const DOCS_CLOUD_ANALYTICS_ENDPOINT = "https://docs.farming-labs.dev/api/analytics/events";
|
|
3
|
+
const DOCS_CLOUD_ANALYTICS_ENDPOINT = "https://docs-app.farming-labs.dev/api/analytics/events";
|
|
4
4
|
function readRuntimeEnv(name) {
|
|
5
5
|
if (typeof process !== "undefined" && process.env && typeof process.env[name] === "string" && process.env[name].trim().length > 0) return process.env[name].trim();
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function isFalsyEnv(value) {
|
|
8
8
|
if (!value) return false;
|
|
9
|
-
return /^(
|
|
9
|
+
return /^(0|false|no|off)$/i.test(value);
|
|
10
10
|
}
|
|
11
11
|
function resolveDocsCloudAnalyticsOptions(analytics) {
|
|
12
12
|
if (analytics && typeof analytics === "object") {
|
|
13
13
|
const explicit = analytics[DOCS_CLOUD_ANALYTICS_OPTIONS];
|
|
14
14
|
if (explicit) return explicit;
|
|
15
15
|
}
|
|
16
|
-
if (!isTruthyEnv(readRuntimeEnv("NEXT_PUBLIC_DOCS_CLOUD_ANALYTICS_ENABLED") ?? readRuntimeEnv("DOCS_CLOUD_ANALYTICS_ENABLED"))) return null;
|
|
17
16
|
const projectId = readRuntimeEnv("NEXT_PUBLIC_DOCS_CLOUD_PROJECT_ID") ?? readRuntimeEnv("DOCS_CLOUD_PROJECT_ID");
|
|
18
17
|
const apiKey = readRuntimeEnv("NEXT_PUBLIC_DOCS_CLOUD_ANALYTICS_KEY") ?? readRuntimeEnv("DOCS_CLOUD_ANALYTICS_KEY");
|
|
19
|
-
|
|
18
|
+
const enabled = readRuntimeEnv("NEXT_PUBLIC_DOCS_CLOUD_ANALYTICS_ENABLED") ?? readRuntimeEnv("DOCS_CLOUD_ANALYTICS_ENABLED");
|
|
19
|
+
if (!projectId || isFalsyEnv(enabled)) return null;
|
|
20
20
|
return {
|
|
21
21
|
projectId,
|
|
22
22
|
apiKey
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as DocsObservabilityEventInput, At as McpDocsSearchConfig, Gt as ResolvedDocsRelatedLink, It as OpenDocsTarget, Nt as OpenDocsProvider, Q as DocsObservabilityEvent, Z as DocsObservabilityConfig, _ as DocsAnalyticsConfig, _t as DocsSearchResult, bt as DocsSitemapConfig, d as CustomDocsSearchConfig, dt as DocsSearchAdapterFactory, ft as DocsSearchChunkingConfig, k as DocsAskAIMcpConfig, lt as DocsSearchAdapter, m as DocsAgentTraceEventInput, mt as DocsSearchDocument, pt as DocsSearchConfig, r as AlgoliaDocsSearchConfig, tn as TypesenseDocsSearchConfig, v as DocsAnalyticsEvent, y as DocsAnalyticsEventInput, yt as DocsSearchSourcePage } from "./types-
|
|
1
|
+
import { $ as DocsObservabilityEventInput, At as McpDocsSearchConfig, Gt as ResolvedDocsRelatedLink, It as OpenDocsTarget, Nt as OpenDocsProvider, Q as DocsObservabilityEvent, Z as DocsObservabilityConfig, _ as DocsAnalyticsConfig, _t as DocsSearchResult, bt as DocsSitemapConfig, d as CustomDocsSearchConfig, dt as DocsSearchAdapterFactory, ft as DocsSearchChunkingConfig, k as DocsAskAIMcpConfig, lt as DocsSearchAdapter, m as DocsAgentTraceEventInput, mt as DocsSearchDocument, pt as DocsSearchConfig, r as AlgoliaDocsSearchConfig, tn as TypesenseDocsSearchConfig, v as DocsAnalyticsEvent, y as DocsAnalyticsEventInput, yt as DocsSearchSourcePage } from "./types-DC1QpBmS.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 { $ as DocsObservabilityEventInput, At as McpDocsSearchConfig, D as DocsAskAIFeedbackMessage, E as DocsAskAIFeedbackData, O as DocsAskAIFeedbackValue, Q as DocsObservabilityEvent, T as DocsAskAIFeedbackConfig, U as DocsConfig, Z as DocsObservabilityConfig, _ as DocsAnalyticsConfig, _t as DocsSearchResult, a as ApiReferenceRenderer, bt as DocsSitemapConfig, dt as DocsSearchAdapterFactory, g as DocsAgentTraceStatus, gt as DocsSearchQuery, h as DocsAgentTraceEventType, it as DocsReviewRulesConfig, k as DocsAskAIMcpConfig, lt as DocsSearchAdapter, m as DocsAgentTraceEventInput, mt as DocsSearchDocument, nt as DocsReviewCiMode, pt as DocsSearchConfig, rt as DocsReviewConfig, ut as DocsSearchAdapterContext, v as DocsAnalyticsEvent, y as DocsAnalyticsEventInput, yt as DocsSearchSourcePage } from "./types-
|
|
2
|
-
import { $ as createDocsAgentTraceId, A as resolveDocsSitemapRequest, B as normalizePromptProviderName, C as buildDocsSitemapManifest, D as renderDocsSitemapXml, E as renderDocsSitemapMarkdown, F as DEFAULT_PROMPT_PROVIDER_TEMPLATES, G as serializeDocsIconRegistry, H as resolvePromptProviderChoices, I as PromptAction, J as DOCS_AGENT_TRACE_EVENT_TYPES, K as serializeOpenDocsProvider, L as PromptProviderChoice, M as DEFAULT_OPEN_DOCS_PROMPT, N as DEFAULT_OPEN_DOCS_PROVIDER_IDS, O as resolveDocsSitemapConfig, P as DEFAULT_OPEN_DOCS_TARGET, Q as createDocsAgentTraceContext, R as SerializeOpenDocsProviderOptions, S as DocsSitemapResolvedConfig, T as readDocsSitemapManifestFromContentMap, U as sanitizePromptText, V as parsePromptStringArray, W as serializeDocsIcon, X as ResolvedDocsAnalyticsConfig, Y as DocsAgentTraceContext, Z as ResolvedDocsObservabilityConfig, _ as DEFAULT_SITEMAP_XML_ROUTE, a as createMcpSearchAdapter, at as DocsCloudAnalyticsOptions, b as DocsSitemapManifestPage, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, et as emitDocsAgentTraceEvent, f as resolveSearchRequestConfig, g as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, h as DEFAULT_SITEMAP_MD_ROUTE, i as createCustomSearchAdapter, it as resolveDocsObservabilityConfig, j as toDocsSitemapMarkdownUrl, k as resolveDocsSitemapPageLastmod, l as inferDocsAskAIPackageHints, m as DEFAULT_SITEMAP_MD_DOCS_ROUTE, n as buildDocsSearchDocuments, nt as emitDocsObservabilityEvent, o as createSimpleSearchAdapter, ot as createDocsCloudAnalytics, p as DEFAULT_SITEMAP_MANIFEST_PATH, q as serializeOpenDocsProviders, r as createAlgoliaSearchAdapter, rt as resolveDocsAnalyticsConfig, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, tt as emitDocsAnalyticsEvent, u as performDocsSearch, v as DocsSitemapFormat, w as createDocsSitemapResponse, x as DocsSitemapPageInput, y as DocsSitemapManifest, z as SerializedOpenDocsProvider } from "./search-
|
|
1
|
+
import { $ as DocsObservabilityEventInput, At as McpDocsSearchConfig, D as DocsAskAIFeedbackMessage, E as DocsAskAIFeedbackData, O as DocsAskAIFeedbackValue, Q as DocsObservabilityEvent, T as DocsAskAIFeedbackConfig, U as DocsConfig, Z as DocsObservabilityConfig, _ as DocsAnalyticsConfig, _t as DocsSearchResult, a as ApiReferenceRenderer, bt as DocsSitemapConfig, dt as DocsSearchAdapterFactory, g as DocsAgentTraceStatus, gt as DocsSearchQuery, h as DocsAgentTraceEventType, it as DocsReviewRulesConfig, k as DocsAskAIMcpConfig, lt as DocsSearchAdapter, m as DocsAgentTraceEventInput, mt as DocsSearchDocument, nt as DocsReviewCiMode, pt as DocsSearchConfig, rt as DocsReviewConfig, ut as DocsSearchAdapterContext, v as DocsAnalyticsEvent, y as DocsAnalyticsEventInput, yt as DocsSearchSourcePage } from "./types-DC1QpBmS.mjs";
|
|
2
|
+
import { $ as createDocsAgentTraceId, A as resolveDocsSitemapRequest, B as normalizePromptProviderName, C as buildDocsSitemapManifest, D as renderDocsSitemapXml, E as renderDocsSitemapMarkdown, F as DEFAULT_PROMPT_PROVIDER_TEMPLATES, G as serializeDocsIconRegistry, H as resolvePromptProviderChoices, I as PromptAction, J as DOCS_AGENT_TRACE_EVENT_TYPES, K as serializeOpenDocsProvider, L as PromptProviderChoice, M as DEFAULT_OPEN_DOCS_PROMPT, N as DEFAULT_OPEN_DOCS_PROVIDER_IDS, O as resolveDocsSitemapConfig, P as DEFAULT_OPEN_DOCS_TARGET, Q as createDocsAgentTraceContext, R as SerializeOpenDocsProviderOptions, S as DocsSitemapResolvedConfig, T as readDocsSitemapManifestFromContentMap, U as sanitizePromptText, V as parsePromptStringArray, W as serializeDocsIcon, X as ResolvedDocsAnalyticsConfig, Y as DocsAgentTraceContext, Z as ResolvedDocsObservabilityConfig, _ as DEFAULT_SITEMAP_XML_ROUTE, a as createMcpSearchAdapter, at as DocsCloudAnalyticsOptions, b as DocsSitemapManifestPage, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, et as emitDocsAgentTraceEvent, f as resolveSearchRequestConfig, g as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, h as DEFAULT_SITEMAP_MD_ROUTE, i as createCustomSearchAdapter, it as resolveDocsObservabilityConfig, j as toDocsSitemapMarkdownUrl, k as resolveDocsSitemapPageLastmod, l as inferDocsAskAIPackageHints, m as DEFAULT_SITEMAP_MD_DOCS_ROUTE, n as buildDocsSearchDocuments, nt as emitDocsObservabilityEvent, o as createSimpleSearchAdapter, ot as createDocsCloudAnalytics, p as DEFAULT_SITEMAP_MANIFEST_PATH, q as serializeOpenDocsProviders, r as createAlgoliaSearchAdapter, rt as resolveDocsAnalyticsConfig, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, tt as emitDocsAnalyticsEvent, u as performDocsSearch, v as DocsSitemapFormat, w as createDocsSitemapResponse, x as DocsSitemapPageInput, y as DocsSitemapManifest, z as SerializedOpenDocsProvider } from "./search-HIuIWw6s.mjs";
|
|
3
3
|
import { DocsMcpCodeExample, DocsMcpConfigSchema, DocsMcpConfigSchemaOption, DocsMcpDocsList, DocsMcpDocsPageSummary, DocsMcpDocsSection, DocsMcpHttpHandlers, DocsMcpNavigationNode, DocsMcpNavigationTree, DocsMcpPage, DocsMcpResolvedConfig, DocsMcpSource, createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, normalizeDocsMcpRoute, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/code-group-mdx.d.ts
|
package/dist/server.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-CLU1Qlpi.mjs";
|
|
2
2
|
import { a as DEFAULT_SITEMAP_XML_ROUTE, c as readDocsSitemapManifestFromContentMap, d as resolveDocsSitemapConfig, f as resolveDocsSitemapPageLastmod, i as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, l as renderDocsSitemapMarkdown, m as toDocsSitemapMarkdownUrl, n as DEFAULT_SITEMAP_MD_DOCS_ROUTE, o as buildDocsSitemapManifest, p as resolveDocsSitemapRequest, r as DEFAULT_SITEMAP_MD_ROUTE, s as createDocsSitemapResponse, t as DEFAULT_SITEMAP_MANIFEST_PATH, u as renderDocsSitemapXml } from "./sitemap-CMNj0Pt3.mjs";
|
|
3
3
|
import { C as resolveApiReferenceOpenApiDiscovery, S as resolveApiReferenceConfig, T as remarkCodeGroup, _ as buildApiReferenceOpenApiDocument, a as DEFAULT_PROMPT_PROVIDER_TEMPLATES, b as buildApiReferenceScalarCss, c as resolvePromptProviderChoices, d as serializeDocsIconRegistry, f as serializeOpenDocsProvider, g as buildApiReferenceHtmlDocumentAsync, h as buildApiReferenceHtmlDocument, i as DEFAULT_OPEN_DOCS_TARGET, l as sanitizePromptText, m as DEFAULT_API_REFERENCE_OPENAPI_ROUTE, n as DEFAULT_OPEN_DOCS_PROMPT, o as normalizePromptProviderName, p as serializeOpenDocsProviders, r as DEFAULT_OPEN_DOCS_PROVIDER_IDS, s as parsePromptStringArray, t as readDocsSitemapManifest, u as serializeDocsIcon, v as buildApiReferenceOpenApiDocumentAsync, w as resolveApiReferenceRenderer, x as isApiReferenceOpenApiRequest, y as buildApiReferencePageTitle } from "./sitemap-server-idLUrmmU.mjs";
|
|
4
4
|
import { a as ensureDocsReviewWorkflow, i as buildDocsReviewWorkflowPathFilters, n as DEFAULT_DOCS_REVIEW_WORKFLOW_PATH, o as readDocsReviewConfigFromSource, r as buildDocsReviewWorkflow, s as resolveDocsReviewConfig, t as DEFAULT_DOCS_REVIEW_SCORE_THRESHOLD } from "./review-B7goPYUb.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./search-
|
|
1
|
+
import "./search-CLU1Qlpi.mjs";
|
|
2
2
|
import { d as resolveDocsSitemapConfig, l as renderDocsSitemapMarkdown, o as buildDocsSitemapManifest, u as renderDocsSitemapXml } from "./sitemap-CMNj0Pt3.mjs";
|
|
3
3
|
import "./sitemap-server-idLUrmmU.mjs";
|
|
4
4
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
@@ -765,7 +765,13 @@ interface DocsCloudApiKeyConfig {
|
|
|
765
765
|
env?: string;
|
|
766
766
|
}
|
|
767
767
|
interface DocsCloudPreviewConfig {
|
|
768
|
-
/**
|
|
768
|
+
/**
|
|
769
|
+
* Legacy hosted preview deployment gate.
|
|
770
|
+
*
|
|
771
|
+
* Prefer `cloud.deploy.enabled` in new configs.
|
|
772
|
+
*
|
|
773
|
+
* @default true when this legacy object is provided
|
|
774
|
+
*/
|
|
769
775
|
enabled?: boolean;
|
|
770
776
|
}
|
|
771
777
|
interface DocsCloudPublishConfig {
|
|
@@ -787,9 +793,9 @@ interface DocsCloudConfig {
|
|
|
787
793
|
* compatibility with older docs.json files.
|
|
788
794
|
*/
|
|
789
795
|
enabled?: boolean;
|
|
790
|
-
/** API key lookup used by `docs
|
|
796
|
+
/** API key lookup used by `docs deploy` and other cloud CLI commands. */
|
|
791
797
|
apiKey?: DocsCloudApiKeyConfig;
|
|
792
|
-
/**
|
|
798
|
+
/** Legacy hosted preview deployment settings. Prefer `deploy` in new configs. */
|
|
793
799
|
preview?: DocsCloudPreviewConfig;
|
|
794
800
|
/** Generated docs publishing settings. */
|
|
795
801
|
publish?: DocsCloudPublishConfig;
|
|
@@ -797,7 +803,7 @@ interface DocsCloudConfig {
|
|
|
797
803
|
analytics?: boolean | Omit<DocsAnalyticsConfig, "onEvent">;
|
|
798
804
|
/** Hosted AI feature toggle. */
|
|
799
805
|
ai?: DocsCloudFeatureConfig;
|
|
800
|
-
/** Hosted deployment feature toggle
|
|
806
|
+
/** Hosted deployment feature toggle used by `docs deploy`. */
|
|
801
807
|
deploy?: DocsCloudFeatureConfig;
|
|
802
808
|
}
|
|
803
809
|
interface DocsObservabilityConfig {
|
|
@@ -2326,7 +2332,8 @@ interface DocsConfig {
|
|
|
2326
2332
|
/**
|
|
2327
2333
|
* Built-in analytics event stream for docs interactions.
|
|
2328
2334
|
*
|
|
2329
|
-
* - `false`
|
|
2335
|
+
* - `false` -> analytics disabled
|
|
2336
|
+
* - omitted -> analytics disabled unless Docs Cloud provides project identity
|
|
2330
2337
|
* - `true` -> log product/usage events to the console
|
|
2331
2338
|
* - `{ onEvent(event) { ... } }` -> send events to your analytics sink
|
|
2332
2339
|
*
|
|
@@ -2337,7 +2344,7 @@ interface DocsConfig {
|
|
|
2337
2344
|
/**
|
|
2338
2345
|
* Docs Cloud integration settings.
|
|
2339
2346
|
*
|
|
2340
|
-
* Use this to configure the API key env var and cloud
|
|
2347
|
+
* Use this to configure the API key env var and cloud deploy defaults once
|
|
2341
2348
|
* in `docs.config.ts`; cloud CLI commands mirror the serializable subset into
|
|
2342
2349
|
* `docs.json` automatically.
|
|
2343
2350
|
*
|
|
@@ -2345,7 +2352,7 @@ interface DocsConfig {
|
|
|
2345
2352
|
* ```ts
|
|
2346
2353
|
* cloud: {
|
|
2347
2354
|
* apiKey: { env: "DOCS_CLOUD_API_KEY" },
|
|
2348
|
-
*
|
|
2355
|
+
* deploy: { enabled: true },
|
|
2349
2356
|
* publish: { mode: "draft-pr", baseBranch: "main" },
|
|
2350
2357
|
* }
|
|
2351
2358
|
* ```
|