@farming-labs/docs 0.1.145 → 0.2.1
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-D6yhkz-n.mjs → agent-C_62RAst.mjs} +1 -1
- package/dist/cli/index.mjs +36 -18
- package/dist/{cloud-BBg-41RG.mjs → cloud-CHeiSRTt.mjs} +220 -1
- package/dist/{codeblocks-Vzf0AQNa.mjs → codeblocks-BnwZNsYO.mjs} +1 -1
- package/dist/{doctor-CzJqqL9p.mjs → doctor-D12L89uq.mjs} +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{init-CZx_vasZ.mjs → init-BHUB2nUr.mjs} +1 -1
- package/dist/mcp.d.mts +1 -1
- package/dist/mcp.mjs +1 -1
- package/dist/{search-BZJhx8MO.mjs → search-B3JYx2zk.mjs} +1 -1
- package/dist/{search-KTntMh-a.mjs → search-DH6NeNJP.mjs} +1 -1
- package/dist/{search-vwey5r8r.d.mts → search-MHSL0tYu.d.mts} +1 -1
- package/dist/server.d.mts +2 -2
- package/dist/server.mjs +1 -1
- package/dist/{types-DooUSWkW.d.mts → types-Dneyfhkv.d.mts} +29 -0
- package/package.json +1 -1
|
@@ -3,6 +3,6 @@ import "./agent-B7T4gauS.mjs";
|
|
|
3
3
|
import "./robots-CDdD2o-Q.mjs";
|
|
4
4
|
import "./sitemap-server-idLUrmmU.mjs";
|
|
5
5
|
import "./config-rHQQuz98.mjs";
|
|
6
|
-
import { a as readPageTokenBudget, i as printAgentCompactHelp, n as inspectAgentCompactionState, o as scanDocsPageTargets, r as parseAgentCompactArgs, t as compactAgentDocs } from "./codeblocks-
|
|
6
|
+
import { a as readPageTokenBudget, i as printAgentCompactHelp, n as inspectAgentCompactionState, o as scanDocsPageTargets, r as parseAgentCompactArgs, t as compactAgentDocs } from "./codeblocks-BnwZNsYO.mjs";
|
|
7
7
|
|
|
8
8
|
export { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp };
|
package/dist/cli/index.mjs
CHANGED
|
@@ -27,7 +27,11 @@ function parseFlags(argv) {
|
|
|
27
27
|
"algolia",
|
|
28
28
|
"verbose",
|
|
29
29
|
"host",
|
|
30
|
-
"json"
|
|
30
|
+
"json",
|
|
31
|
+
"network",
|
|
32
|
+
"analytics",
|
|
33
|
+
"ask-ai",
|
|
34
|
+
"deploy"
|
|
31
35
|
]);
|
|
32
36
|
for (let i = 0; i < argv.length; i++) {
|
|
33
37
|
const arg = argv[i];
|
|
@@ -85,43 +89,52 @@ async function main() {
|
|
|
85
89
|
apiBaseUrl: typeof flags["api-base-url"] === "string" ? flags["api-base-url"] : typeof flags.url === "string" ? flags.url : void 0,
|
|
86
90
|
apiKey: typeof flags["api-key"] === "string" ? flags["api-key"] : void 0,
|
|
87
91
|
apiKeyEnv: typeof flags["api-key-env"] === "string" ? flags["api-key-env"] : void 0,
|
|
88
|
-
json: typeof flags.json === "boolean" ? flags.json : void 0
|
|
92
|
+
json: typeof flags.json === "boolean" ? flags.json : void 0,
|
|
93
|
+
network: typeof flags.network === "boolean" ? flags.network : void 0,
|
|
94
|
+
checkTargets: [
|
|
95
|
+
...flags.deploy === true ? ["deploy"] : [],
|
|
96
|
+
...flags.analytics === true ? ["analytics"] : [],
|
|
97
|
+
...flags["ask-ai"] === true ? ["ask-ai"] : []
|
|
98
|
+
]
|
|
89
99
|
};
|
|
90
100
|
if (!parsedCommand.command || parsedCommand.command === "init") {
|
|
91
|
-
const { init } = await import("../init-
|
|
101
|
+
const { init } = await import("../init-BHUB2nUr.mjs");
|
|
92
102
|
await init(initOptions);
|
|
93
103
|
} else if (parsedCommand.command === "dev") {
|
|
94
104
|
const { dev } = await import("../dev-D58nBPBv.mjs");
|
|
95
105
|
await dev(devOptions);
|
|
96
106
|
} else if (parsedCommand.command === "deploy") {
|
|
97
|
-
const { runCloudDeploy } = await import("../cloud-
|
|
107
|
+
const { runCloudDeploy } = await import("../cloud-CHeiSRTt.mjs");
|
|
98
108
|
await runCloudDeploy(cloudOptions);
|
|
99
109
|
} else if (parsedCommand.command === "preview") {
|
|
100
|
-
const { runCloudPreview } = await import("../cloud-
|
|
110
|
+
const { runCloudPreview } = await import("../cloud-CHeiSRTt.mjs");
|
|
101
111
|
await runCloudPreview(cloudOptions);
|
|
102
112
|
} else if (parsedCommand.command === "cloud" && subcommand === "deploy") {
|
|
103
|
-
const { runCloudDeploy } = await import("../cloud-
|
|
113
|
+
const { runCloudDeploy } = await import("../cloud-CHeiSRTt.mjs");
|
|
104
114
|
await runCloudDeploy(cloudOptions);
|
|
105
115
|
} else if (parsedCommand.command === "cloud" && subcommand === "preview") {
|
|
106
|
-
const { runCloudPreview } = await import("../cloud-
|
|
116
|
+
const { runCloudPreview } = await import("../cloud-CHeiSRTt.mjs");
|
|
107
117
|
await runCloudPreview(cloudOptions);
|
|
108
118
|
} else if (parsedCommand.command === "cloud" && subcommand === "init") {
|
|
109
|
-
const { runCloudInit } = await import("../cloud-
|
|
119
|
+
const { runCloudInit } = await import("../cloud-CHeiSRTt.mjs");
|
|
110
120
|
await runCloudInit(cloudOptions);
|
|
111
121
|
} else if (parsedCommand.command === "cloud" && subcommand === "sync") {
|
|
112
|
-
const { syncCloudConfig } = await import("../cloud-
|
|
122
|
+
const { syncCloudConfig } = await import("../cloud-CHeiSRTt.mjs");
|
|
113
123
|
await syncCloudConfig(cloudOptions);
|
|
124
|
+
} else if (parsedCommand.command === "cloud" && subcommand === "check") {
|
|
125
|
+
const { runCloudCheck } = await import("../cloud-CHeiSRTt.mjs");
|
|
126
|
+
await runCloudCheck(cloudOptions);
|
|
114
127
|
} else if (parsedCommand.command === "cloud") {
|
|
115
128
|
console.error(pc.red(`Unknown cloud subcommand: ${subcommand ?? "(missing)"}`));
|
|
116
129
|
console.error();
|
|
117
|
-
const { printCloudHelp } = await import("../cloud-
|
|
130
|
+
const { printCloudHelp } = await import("../cloud-CHeiSRTt.mjs");
|
|
118
131
|
printCloudHelp();
|
|
119
132
|
process.exit(1);
|
|
120
133
|
} else if (parsedCommand.command === "mcp") {
|
|
121
134
|
const { runMcp } = await import("../mcp-B_OFsXRH.mjs");
|
|
122
135
|
await runMcp(mcpOptions);
|
|
123
136
|
} else if (parsedCommand.command === "agent" && subcommand === "compact") {
|
|
124
|
-
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent-
|
|
137
|
+
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent-C_62RAst.mjs");
|
|
125
138
|
const agentCompactOptions = parseAgentCompactArgs(args.slice(2));
|
|
126
139
|
if (agentCompactOptions.help) {
|
|
127
140
|
printAgentCompactHelp();
|
|
@@ -131,7 +144,7 @@ async function main() {
|
|
|
131
144
|
} else if (parsedCommand.command === "agent") {
|
|
132
145
|
console.error(pc.red(`Unknown agent subcommand: ${subcommand ?? "(missing)"}`));
|
|
133
146
|
console.error();
|
|
134
|
-
const { printAgentCompactHelp } = await import("../agent-
|
|
147
|
+
const { printAgentCompactHelp } = await import("../agent-C_62RAst.mjs");
|
|
135
148
|
printAgentCompactHelp();
|
|
136
149
|
process.exit(1);
|
|
137
150
|
} else if (parsedCommand.command === "agents" && subcommand === "generate") {
|
|
@@ -149,7 +162,7 @@ async function main() {
|
|
|
149
162
|
printAgentsGenerateHelp();
|
|
150
163
|
process.exit(1);
|
|
151
164
|
} else if (parsedCommand.command === "doctor") {
|
|
152
|
-
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-
|
|
165
|
+
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-D12L89uq.mjs");
|
|
153
166
|
const doctorOptions = parseDoctorArgs(args.slice(1));
|
|
154
167
|
if (doctorOptions.help) {
|
|
155
168
|
printDoctorHelp();
|
|
@@ -165,7 +178,7 @@ async function main() {
|
|
|
165
178
|
}
|
|
166
179
|
await runReview(reviewOptions);
|
|
167
180
|
} else if ((parsedCommand.command === "codeblocks" || parsedCommand.command === "code-blocks") && subcommand === "validate") {
|
|
168
|
-
const { parseCodeBlocksValidateArgs, printCodeBlocksValidateHelp, runCodeBlocksValidate } = await import("../codeblocks-
|
|
181
|
+
const { parseCodeBlocksValidateArgs, printCodeBlocksValidateHelp, runCodeBlocksValidate } = await import("../codeblocks-BnwZNsYO.mjs");
|
|
169
182
|
const codeBlocksOptions = parseCodeBlocksValidateArgs(args.slice(2));
|
|
170
183
|
if (codeBlocksOptions.help) {
|
|
171
184
|
printCodeBlocksValidateHelp();
|
|
@@ -175,11 +188,11 @@ async function main() {
|
|
|
175
188
|
} else if (parsedCommand.command === "codeblocks" || parsedCommand.command === "code-blocks") {
|
|
176
189
|
console.error(pc.red(`Unknown codeblocks subcommand: ${subcommand ?? "(missing)"}`));
|
|
177
190
|
console.error();
|
|
178
|
-
const { printCodeBlocksValidateHelp } = await import("../codeblocks-
|
|
191
|
+
const { printCodeBlocksValidateHelp } = await import("../codeblocks-BnwZNsYO.mjs");
|
|
179
192
|
printCodeBlocksValidateHelp();
|
|
180
193
|
process.exit(1);
|
|
181
194
|
} else if (parsedCommand.command === "search" && subcommand === "sync") {
|
|
182
|
-
const { syncSearch } = await import("../search-
|
|
195
|
+
const { syncSearch } = await import("../search-DH6NeNJP.mjs");
|
|
183
196
|
await syncSearch(searchSyncOptions);
|
|
184
197
|
} else if (parsedCommand.command === "search") {
|
|
185
198
|
console.error(pc.red(`Unknown search subcommand: ${subcommand ?? "(missing)"}`));
|
|
@@ -253,7 +266,7 @@ ${pc.dim("Commands:")}
|
|
|
253
266
|
${pc.cyan("dev")} Run frameworkless docs locally from ${pc.dim("docs.json")}
|
|
254
267
|
${pc.cyan("deploy")} Sync cloud config and deploy hosted preview docs
|
|
255
268
|
${pc.cyan("preview")} Alias for ${pc.cyan("deploy")}
|
|
256
|
-
${pc.cyan("cloud")} Docs Cloud utilities (${pc.dim("init")}, ${pc.dim("deploy")}, ${pc.dim("preview")}, ${pc.dim("sync")})
|
|
269
|
+
${pc.cyan("cloud")} Docs Cloud utilities (${pc.dim("init")}, ${pc.dim("check")}, ${pc.dim("deploy")}, ${pc.dim("preview")}, ${pc.dim("sync")})
|
|
257
270
|
${pc.cyan("agent")} Agent utilities (${pc.dim("compact")} to generate sibling agent.md files)
|
|
258
271
|
${pc.cyan("agents")} AGENTS.md utilities (${pc.dim("generate")} for static agent instructions)
|
|
259
272
|
${pc.cyan("doctor")} Inspect and score agent or reader-facing docs quality
|
|
@@ -289,17 +302,22 @@ ${pc.dim("Options for dev:")}
|
|
|
289
302
|
${pc.cyan("--host [host]")} Expose the preview on your network; optionally pass a host value
|
|
290
303
|
${pc.cyan("--verbose")} Show raw runtime logs in addition to branded CLI output
|
|
291
304
|
|
|
292
|
-
${pc.dim("Options for cloud
|
|
305
|
+
${pc.dim("Options for cloud:")}
|
|
293
306
|
${pc.cyan("cloud init")} Add Docs Cloud config to ${pc.dim("docs.config.ts")} and ${pc.dim("docs.json")}
|
|
294
307
|
${pc.cyan("deploy")} Sync ${pc.dim("docs.config.ts")} into ${pc.dim("docs.json")} and deploy hosted preview docs
|
|
295
308
|
${pc.cyan("cloud deploy")} Same as ${pc.cyan("deploy")}
|
|
296
309
|
${pc.cyan("preview")} Alias for ${pc.cyan("deploy")}
|
|
297
310
|
${pc.cyan("cloud preview")} Compatibility alias for ${pc.cyan("cloud deploy")}
|
|
298
311
|
${pc.cyan("cloud sync")} Only materialize cloud settings into ${pc.dim("docs.json")}
|
|
312
|
+
${pc.cyan("cloud check")} Validate Docs Cloud config, analytics envs, API key, and Ask AI wiring
|
|
299
313
|
${pc.cyan("--config <path>")} Use a custom docs config path
|
|
300
314
|
${pc.cyan("--api-key-env <name>")} Env var that stores the Docs Cloud API key
|
|
301
315
|
${pc.cyan("--api-base-url <url>")} Override the Docs Cloud API base URL
|
|
302
316
|
${pc.cyan("--api-key <key>")} Use an API key directly; prefer ${pc.dim("cloud.apiKey.env")}
|
|
317
|
+
${pc.cyan("--analytics")} Only check Docs Cloud analytics integration
|
|
318
|
+
${pc.cyan("--ask-ai")} Only check Docs Cloud Ask AI integration
|
|
319
|
+
${pc.cyan("--deploy")} Only check Docs Cloud deploy integration
|
|
320
|
+
${pc.cyan("--no-network")} Skip live Docs Cloud API validation for ${pc.cyan("cloud check")}
|
|
303
321
|
${pc.cyan("--json")} Print machine-readable output
|
|
304
322
|
${pc.dim("required scopes")} project:read, preview:write, jobs:read
|
|
305
323
|
|
|
@@ -20,6 +20,13 @@ const REQUIRED_PREVIEW_API_KEY_SCOPES = [
|
|
|
20
20
|
"preview:write",
|
|
21
21
|
"jobs:read"
|
|
22
22
|
];
|
|
23
|
+
const DOCS_CLOUD_PROJECT_ID_ENVS = ["NEXT_PUBLIC_DOCS_CLOUD_PROJECT_ID", "DOCS_CLOUD_PROJECT_ID"];
|
|
24
|
+
const DEFAULT_PUBLIC_DOCS_CLOUD_API_KEY_ENV = "NEXT_PUBLIC_DOCS_CLOUD_API_KEY";
|
|
25
|
+
const CLOUD_CHECK_TARGETS = [
|
|
26
|
+
"deploy",
|
|
27
|
+
"analytics",
|
|
28
|
+
"ask-ai"
|
|
29
|
+
];
|
|
23
30
|
function isRecord(value) {
|
|
24
31
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
25
32
|
}
|
|
@@ -593,6 +600,90 @@ async function materializeCloudConfig(options = {}) {
|
|
|
593
600
|
updated
|
|
594
601
|
};
|
|
595
602
|
}
|
|
603
|
+
function readCombinedEnv(rootDir) {
|
|
604
|
+
const env = { ...loadProjectEnv(rootDir) };
|
|
605
|
+
for (const [key, value] of Object.entries(process.env)) if (typeof value === "string") env[key] = value;
|
|
606
|
+
return env;
|
|
607
|
+
}
|
|
608
|
+
function readEnvValue(env, name) {
|
|
609
|
+
if (!name) return void 0;
|
|
610
|
+
const value = env[name]?.trim();
|
|
611
|
+
return value ? value : void 0;
|
|
612
|
+
}
|
|
613
|
+
function readFirstEnv(env, names) {
|
|
614
|
+
for (const name of names) {
|
|
615
|
+
const value = readEnvValue(env, name);
|
|
616
|
+
if (value) return {
|
|
617
|
+
name,
|
|
618
|
+
value
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
function readConfiguredCloudApiKeyEnv(snapshot) {
|
|
623
|
+
const moduleEnv = snapshot.config?.cloud?.apiKey?.env?.trim();
|
|
624
|
+
if (moduleEnv) return moduleEnv;
|
|
625
|
+
const apiKeyBlock = extractNestedObjectLiteral(snapshot.content ?? "", ["cloud", "apiKey"]);
|
|
626
|
+
return (apiKeyBlock ? readStringProperty(apiKeyBlock, "env") : void 0)?.trim() || void 0;
|
|
627
|
+
}
|
|
628
|
+
function readAiProvider(snapshot) {
|
|
629
|
+
const moduleProvider = (snapshot.config?.ai)?.provider;
|
|
630
|
+
if (typeof moduleProvider === "string" && moduleProvider.trim()) return moduleProvider.trim();
|
|
631
|
+
const aiBlock = extractNestedObjectLiteral(snapshot.content ?? "", ["ai"]);
|
|
632
|
+
return (aiBlock ? readStringProperty(aiBlock, "provider") : void 0)?.trim() || void 0;
|
|
633
|
+
}
|
|
634
|
+
function readRuntimeAnalyticsDisabled(snapshot) {
|
|
635
|
+
const moduleAnalytics = snapshot.config?.analytics;
|
|
636
|
+
if (moduleAnalytics === false) return true;
|
|
637
|
+
if (isRecord(moduleAnalytics) && moduleAnalytics.enabled === false) return true;
|
|
638
|
+
if (readTopLevelBooleanProperty(snapshot.content ?? "", "analytics") === false) return true;
|
|
639
|
+
const analyticsBlock = extractNestedObjectLiteral(snapshot.content ?? "", ["analytics"]);
|
|
640
|
+
return (analyticsBlock ? readTopLevelBooleanProperty(analyticsBlock, "enabled") : void 0) === false;
|
|
641
|
+
}
|
|
642
|
+
function isCloudAnalyticsEnabled(analytics) {
|
|
643
|
+
if (analytics === false) return false;
|
|
644
|
+
if (isRecord(analytics) && analytics.enabled === false) return false;
|
|
645
|
+
return typeof analytics !== "undefined";
|
|
646
|
+
}
|
|
647
|
+
function createCheck(name, status, message, details) {
|
|
648
|
+
return {
|
|
649
|
+
name,
|
|
650
|
+
status,
|
|
651
|
+
message,
|
|
652
|
+
...details ? { details } : {}
|
|
653
|
+
};
|
|
654
|
+
}
|
|
655
|
+
function summarizeIdentity(identity) {
|
|
656
|
+
if (!isRecord(identity)) return void 0;
|
|
657
|
+
const workspace = isRecord(identity.workspace) ? identity.workspace : void 0;
|
|
658
|
+
const apiKey = isRecord(identity.apiKey) ? identity.apiKey : void 0;
|
|
659
|
+
const scopes = readApiKeyScopes(identity);
|
|
660
|
+
return {
|
|
661
|
+
...workspace ? { workspace: {
|
|
662
|
+
...typeof workspace.id === "string" ? { id: workspace.id } : {},
|
|
663
|
+
...typeof workspace.name === "string" ? { name: workspace.name } : {}
|
|
664
|
+
} } : {},
|
|
665
|
+
...apiKey ? { apiKey: {
|
|
666
|
+
...typeof apiKey.id === "string" ? { id: apiKey.id } : {},
|
|
667
|
+
...scopes.length > 0 ? { scopes } : {}
|
|
668
|
+
} } : {}
|
|
669
|
+
};
|
|
670
|
+
}
|
|
671
|
+
function formatCheckStatus(status) {
|
|
672
|
+
if (status === "pass") return pc.green("ok");
|
|
673
|
+
if (status === "warn") return pc.yellow("warn");
|
|
674
|
+
return pc.red("fail");
|
|
675
|
+
}
|
|
676
|
+
function countChecks(checks, status) {
|
|
677
|
+
return checks.filter((check) => check.status === status).length;
|
|
678
|
+
}
|
|
679
|
+
function resolveCloudCheckTargets(options) {
|
|
680
|
+
const targets = new Set(options.checkTargets);
|
|
681
|
+
if (targets.size > 0) return targets;
|
|
682
|
+
return new Set(CLOUD_CHECK_TARGETS);
|
|
683
|
+
}
|
|
684
|
+
function formatCloudCheckTargets(targets) {
|
|
685
|
+
return targets.join(", ");
|
|
686
|
+
}
|
|
596
687
|
function resolveApiBaseUrl(options) {
|
|
597
688
|
return (options.apiBaseUrl ?? process.env.DOCS_CLOUD_API_URL ?? process.env.NEXT_PUBLIC_DOCS_CLOUD_URL ?? DEFAULT_DOCS_CLOUD_API_BASE_URL).replace(/\/+$/, "");
|
|
598
689
|
}
|
|
@@ -849,6 +940,129 @@ function createSpinner(initialMessage, options = {}) {
|
|
|
849
940
|
}
|
|
850
941
|
};
|
|
851
942
|
}
|
|
943
|
+
async function checkCloudConfig(options = {}) {
|
|
944
|
+
const rootDir = options.rootDir ?? process.cwd();
|
|
945
|
+
const docsJsonPath = path.join(rootDir, DOCS_JSON_FILE);
|
|
946
|
+
const existing = readExistingDocsJson(docsJsonPath);
|
|
947
|
+
const snapshot = await loadDocsConfigSnapshot(rootDir, options.configPath);
|
|
948
|
+
const config = materializeDocsJsonObject({
|
|
949
|
+
rootDir,
|
|
950
|
+
snapshot,
|
|
951
|
+
existing
|
|
952
|
+
});
|
|
953
|
+
const serialized = serializeMaterializedDocsJson(config);
|
|
954
|
+
const previous = existing ? fs.readFileSync(docsJsonPath, "utf-8") : void 0;
|
|
955
|
+
const apiBaseUrl = resolveApiBaseUrl(options);
|
|
956
|
+
const apiKeyEnv = config.cloud?.apiKey?.env ?? DOCS_CLOUD_DEFAULT_API_KEY_ENV;
|
|
957
|
+
const env = readCombinedEnv(rootDir);
|
|
958
|
+
const checks = [];
|
|
959
|
+
const configPath = snapshot.path ?? docsJsonPath;
|
|
960
|
+
const network = options.network !== false;
|
|
961
|
+
const explicitApiKey = options.apiKey?.trim();
|
|
962
|
+
const targetSet = resolveCloudCheckTargets(options);
|
|
963
|
+
const targets = CLOUD_CHECK_TARGETS.filter((target) => targetSet.has(target));
|
|
964
|
+
const checkDeploy = targetSet.has("deploy");
|
|
965
|
+
const checkAnalytics = targetSet.has("analytics");
|
|
966
|
+
const checkAskAi = targetSet.has("ask-ai");
|
|
967
|
+
const checkProjectEnv = checkAnalytics || checkAskAi;
|
|
968
|
+
let identity;
|
|
969
|
+
checks.push(createCheck("config", snapshot.path ? "pass" : "warn", snapshot.path ? `Loaded ${path.relative(rootDir, snapshot.path) || "docs.config.ts"}` : `No docs.config.* found; checking ${DOCS_JSON_FILE} defaults instead.`));
|
|
970
|
+
checks.push(createCheck("docs.json", !existing ? "warn" : previous === serialized ? "pass" : "warn", !existing ? `${DOCS_JSON_FILE} is missing. Run docs cloud sync to materialize cloud config.` : previous === serialized ? `${DOCS_JSON_FILE} is in sync with docs.config.` : `${DOCS_JSON_FILE} is stale. Run docs cloud sync before deploying.`));
|
|
971
|
+
const apiKey = explicitApiKey || readEnvValue(env, apiKeyEnv);
|
|
972
|
+
if (checkDeploy) {
|
|
973
|
+
try {
|
|
974
|
+
normalizeEnvName(apiKeyEnv, DOCS_CLOUD_DEFAULT_API_KEY_ENV);
|
|
975
|
+
checks.push(createCheck("apiKey.config", "pass", `Using cloud.apiKey.env ${apiKeyEnv}.`));
|
|
976
|
+
} catch (error) {
|
|
977
|
+
checks.push(createCheck("apiKey.config", "fail", error instanceof Error ? error.message : `Invalid API key env ${apiKeyEnv}.`));
|
|
978
|
+
}
|
|
979
|
+
checks.push(createCheck("apiKey.value", apiKey ? "pass" : "fail", apiKey ? explicitApiKey ? "Docs Cloud API key was provided with --api-key." : `Docs Cloud API key is present in ${apiKeyEnv}.` : `Missing Docs Cloud API key. Set ${apiKeyEnv} or pass --api-key.`, {
|
|
980
|
+
env: apiKeyEnv,
|
|
981
|
+
source: explicitApiKey ? "flag" : apiKey ? "env" : "missing"
|
|
982
|
+
}));
|
|
983
|
+
}
|
|
984
|
+
checks.push(createCheck("cloud.enabled", config.cloud?.enabled === false ? "fail" : "pass", config.cloud?.enabled === false ? "Docs Cloud is disabled by cloud.enabled: false." : "Docs Cloud is enabled."));
|
|
985
|
+
if (checkDeploy) {
|
|
986
|
+
if (config.cloud?.deploy?.enabled === false) checks.push(createCheck("deploy.enabled", "fail", "Docs Cloud deployment is disabled by cloud.deploy.enabled: false."));
|
|
987
|
+
else checks.push(createCheck("deploy.enabled", "pass", "Docs Cloud deployment is enabled."));
|
|
988
|
+
if (config.cloud?.preview?.enabled === false) checks.push(createCheck("preview.enabled", "fail", "Docs Cloud preview deployment is disabled by cloud.preview.enabled: false."));
|
|
989
|
+
}
|
|
990
|
+
const runtimeAnalyticsDisabled = readRuntimeAnalyticsDisabled(snapshot);
|
|
991
|
+
const cloudAnalyticsEnabled = isCloudAnalyticsEnabled(config.cloud?.analytics);
|
|
992
|
+
if (checkAnalytics) {
|
|
993
|
+
if (runtimeAnalyticsDisabled) checks.push(createCheck("analytics.runtime", "fail", "Runtime analytics is disabled by analytics: false or analytics.enabled: false."));
|
|
994
|
+
else checks.push(createCheck("analytics.runtime", "pass", "Runtime analytics is not disabled."));
|
|
995
|
+
checks.push(createCheck("analytics.cloud", cloudAnalyticsEnabled ? "pass" : "warn", cloudAnalyticsEnabled ? "Docs Cloud analytics is enabled in cloud.analytics." : "cloud.analytics is not enabled; run docs cloud init to add the recommended analytics config."));
|
|
996
|
+
}
|
|
997
|
+
const projectEnv = readFirstEnv(env, DOCS_CLOUD_PROJECT_ID_ENVS);
|
|
998
|
+
const analyticsNeedsProjectId = cloudAnalyticsEnabled && !runtimeAnalyticsDisabled;
|
|
999
|
+
if (checkProjectEnv) checks.push(createCheck("project.env", projectEnv ? "pass" : analyticsNeedsProjectId || checkAskAi ? "fail" : "warn", projectEnv ? `Docs Cloud project id is present in ${projectEnv.name}.` : `Missing Docs Cloud project id. Set ${DOCS_CLOUD_PROJECT_ID_ENVS.join(" or ")} for analytics and docs-cloud Ask AI.`, projectEnv ? { env: projectEnv.name } : void 0));
|
|
1000
|
+
const aiProvider = readAiProvider(snapshot);
|
|
1001
|
+
if (checkAskAi) if (aiProvider === "docs-cloud") {
|
|
1002
|
+
checks.push(createCheck("askAi.provider", "pass", "Ask AI is configured with provider: \"docs-cloud\"."));
|
|
1003
|
+
const configuredApiKeyEnv = readConfiguredCloudApiKeyEnv(snapshot);
|
|
1004
|
+
const directApiKeyEnv = configuredApiKeyEnv ? configuredApiKeyEnv.startsWith("NEXT_PUBLIC_") ? configuredApiKeyEnv : void 0 : DEFAULT_PUBLIC_DOCS_CLOUD_API_KEY_ENV;
|
|
1005
|
+
const directApiKey = readEnvValue(env, directApiKeyEnv);
|
|
1006
|
+
if (directApiKeyEnv) checks.push(createCheck("askAi.direct", directApiKey && projectEnv ? "pass" : "fail", directApiKey && projectEnv ? `Ask AI can call the Docs Cloud knowledge endpoint directly with ${directApiKeyEnv}.` : `Ask AI docs-cloud direct mode needs ${directApiKeyEnv} and a Docs Cloud project id.`, { apiKeyEnv: directApiKeyEnv }));
|
|
1007
|
+
} else if (aiProvider) checks.push(createCheck("askAi.provider", "pass", `Ask AI provider is ${aiProvider}.`));
|
|
1008
|
+
else checks.push(createCheck("askAi.provider", "warn", "Ask AI is not configured with provider: \"docs-cloud\"."));
|
|
1009
|
+
if (checkDeploy) if (!network) checks.push(createCheck("apiKey.network", "warn", "Skipped Docs Cloud API validation because --no-network was passed."));
|
|
1010
|
+
else if (!apiKey) checks.push(createCheck("apiKey.network", "warn", "Skipped Docs Cloud API validation because no API key value was available."));
|
|
1011
|
+
else try {
|
|
1012
|
+
const response = await fetchCloudJson({
|
|
1013
|
+
url: `${apiBaseUrl}/api/cloud/me`,
|
|
1014
|
+
apiKey
|
|
1015
|
+
});
|
|
1016
|
+
identity = summarizeIdentity(response);
|
|
1017
|
+
checks.push(createCheck("apiKey.network", "pass", `Validated API key with ${apiBaseUrl}.`, identity));
|
|
1018
|
+
const scopes = readApiKeyScopes(response);
|
|
1019
|
+
if (scopes.length === 0) checks.push(createCheck("apiKey.scopes", "warn", "Docs Cloud validated the API key but did not return scope metadata."));
|
|
1020
|
+
else {
|
|
1021
|
+
const missing = REQUIRED_PREVIEW_API_KEY_SCOPES.filter((scope) => !scopes.includes(scope));
|
|
1022
|
+
checks.push(createCheck("apiKey.scopes", missing.length === 0 ? "pass" : "fail", missing.length === 0 ? `API key has required deploy scopes: ${REQUIRED_PREVIEW_API_KEY_SCOPES.join(", ")}.` : `API key is missing required deploy scope${missing.length === 1 ? "" : "s"}: ${missing.join(", ")}.`, { scopes }));
|
|
1023
|
+
}
|
|
1024
|
+
} catch (error) {
|
|
1025
|
+
checks.push(createCheck("apiKey.network", "fail", error instanceof Error ? error.message : "Could not validate Docs Cloud API key."));
|
|
1026
|
+
}
|
|
1027
|
+
return {
|
|
1028
|
+
ok: countChecks(checks, "fail") === 0,
|
|
1029
|
+
apiBaseUrl,
|
|
1030
|
+
configPath,
|
|
1031
|
+
docsJsonPath,
|
|
1032
|
+
apiKeyEnv,
|
|
1033
|
+
analyticsProjectIdEnv: projectEnv?.name,
|
|
1034
|
+
network,
|
|
1035
|
+
targets,
|
|
1036
|
+
checks,
|
|
1037
|
+
...identity ? { identity } : {}
|
|
1038
|
+
};
|
|
1039
|
+
}
|
|
1040
|
+
async function runCloudCheck(options = {}) {
|
|
1041
|
+
const result = await checkCloudConfig(options);
|
|
1042
|
+
if (options.json) console.log(JSON.stringify(result, null, 2));
|
|
1043
|
+
else {
|
|
1044
|
+
console.log(pc.bold("Docs Cloud check"));
|
|
1045
|
+
console.log(`${pc.dim("api")} ${result.apiBaseUrl}`);
|
|
1046
|
+
console.log(`${pc.dim("scope")} ${formatCloudCheckTargets(result.targets)}`);
|
|
1047
|
+
console.log();
|
|
1048
|
+
for (const check of result.checks) console.log(`${formatCheckStatus(check.status)} ${pc.bold(check.name)} ${check.message}`);
|
|
1049
|
+
console.log();
|
|
1050
|
+
if (result.ok) {
|
|
1051
|
+
const warnings = countChecks(result.checks, "warn");
|
|
1052
|
+
const suffix = warnings > 0 ? ` with ${warnings} warning${warnings === 1 ? "" : "s"}` : "";
|
|
1053
|
+
console.log(`${pc.green("ok")} Docs Cloud check passed${suffix}.`);
|
|
1054
|
+
} else {
|
|
1055
|
+
const failures = countChecks(result.checks, "fail");
|
|
1056
|
+
console.log(`${pc.red("fail")} Docs Cloud check failed with ${failures} failed check${failures === 1 ? "" : "s"}.`);
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
if (!result.ok) {
|
|
1060
|
+
const error = /* @__PURE__ */ new Error("Docs Cloud check failed.");
|
|
1061
|
+
markCliErrorReported(error);
|
|
1062
|
+
throw error;
|
|
1063
|
+
}
|
|
1064
|
+
return result;
|
|
1065
|
+
}
|
|
852
1066
|
async function syncCloudConfig(options = {}) {
|
|
853
1067
|
const result = await materializeCloudConfig(options);
|
|
854
1068
|
if (options.json) {
|
|
@@ -970,6 +1184,7 @@ ${pc.bold("@farming-labs/docs cloud")}
|
|
|
970
1184
|
|
|
971
1185
|
${pc.dim("Usage:")}
|
|
972
1186
|
${pc.cyan("docs cloud init")} Add Docs Cloud config to ${pc.dim("docs.config.ts")} and ${pc.dim("docs.json")}
|
|
1187
|
+
${pc.cyan("docs cloud check")} Validate Docs Cloud config, analytics envs, API key, and Ask AI wiring
|
|
973
1188
|
${pc.cyan("docs deploy")} Sync ${pc.dim("docs.config.ts")} to ${pc.dim("docs.json")} and deploy hosted preview docs
|
|
974
1189
|
${pc.cyan("docs cloud deploy")} Same as ${pc.cyan("docs deploy")}
|
|
975
1190
|
${pc.cyan("docs preview")} Compatibility alias for ${pc.cyan("docs deploy")}
|
|
@@ -981,6 +1196,10 @@ ${pc.dim("Options:")}
|
|
|
981
1196
|
${pc.cyan("--api-key-env <name>")} Env var that stores the Docs Cloud API key
|
|
982
1197
|
${pc.cyan("--api-base-url <url>")} Override Docs Cloud API base URL
|
|
983
1198
|
${pc.cyan("--api-key <key>")} Use an API key directly; prefer ${pc.dim("cloud.apiKey.env")}
|
|
1199
|
+
${pc.cyan("--analytics")} Only check Docs Cloud analytics integration
|
|
1200
|
+
${pc.cyan("--ask-ai")} Only check Docs Cloud Ask AI integration
|
|
1201
|
+
${pc.cyan("--deploy")} Only check Docs Cloud deploy integration
|
|
1202
|
+
${pc.cyan("--no-network")} Skip live Docs Cloud API validation for ${pc.cyan("cloud check")}
|
|
984
1203
|
${pc.cyan("--json")} Print machine-readable output
|
|
985
1204
|
|
|
986
1205
|
${pc.dim("API key scopes:")}
|
|
@@ -997,4 +1216,4 @@ ${pc.dim("Config example:")}
|
|
|
997
1216
|
}
|
|
998
1217
|
|
|
999
1218
|
//#endregion
|
|
1000
|
-
export { initCloudConfig, printCloudHelp, runCloudDeploy, runCloudInit, runCloudPreview, syncCloudConfig };
|
|
1219
|
+
export { initCloudConfig, printCloudHelp, runCloudCheck, runCloudDeploy, runCloudInit, 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-B3JYx2zk.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";
|
|
@@ -7,7 +7,7 @@ import { createFilesystemDocsMcpSource, resolveDocsMcpConfig } from "./mcp.mjs";
|
|
|
7
7
|
import "./server.mjs";
|
|
8
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-rHQQuz98.mjs";
|
|
9
9
|
import { t as detectFramework } from "./utils-CGlOADu1.mjs";
|
|
10
|
-
import { n as inspectAgentCompactionState, o as scanDocsPageTargets } from "./codeblocks-
|
|
10
|
+
import { n as inspectAgentCompactionState, o as scanDocsPageTargets } from "./codeblocks-BnwZNsYO.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";
|
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 resolveDocsObservabilityConfig, 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 resolveDocsAnalyticsConfig, 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, p as DEFAULT_SITEMAP_MANIFEST_PATH, r as createAlgoliaSearchAdapter, rt as getDocsRequestAnalyticsProperties, 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-Dneyfhkv.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 resolveDocsObservabilityConfig, 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 resolveDocsAnalyticsConfig, 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, p as DEFAULT_SITEMAP_MANIFEST_PATH, r as createAlgoliaSearchAdapter, rt as getDocsRequestAnalyticsProperties, 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-MHSL0tYu.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 getDocsRequestAnalyticsProperties, C as resolveSidebarFolderIndexBehaviorForPath, D as emitDocsAgentTraceEvent, E as createDocsAgentTraceId, M as resolveDocsObservabilityConfig, 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 resolveDocsAnalyticsConfig, 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 getDocsRequestAnalyticsProperties, C as resolveSidebarFolderIndexBehaviorForPath, D as emitDocsAgentTraceEvent, E as createDocsAgentTraceId, M as resolveDocsObservabilityConfig, 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 resolveDocsAnalyticsConfig, 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-B3JYx2zk.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";
|
|
@@ -188,7 +188,7 @@ async function configureDocsCloudOnboarding(options) {
|
|
|
188
188
|
enabled = cloudAnswer;
|
|
189
189
|
}
|
|
190
190
|
if (!enabled) return;
|
|
191
|
-
const { initCloudConfig } = await import("./cloud-
|
|
191
|
+
const { initCloudConfig } = await import("./cloud-CHeiSRTt.mjs");
|
|
192
192
|
printDocsCloudOnboardingInstructions(await initCloudConfig({
|
|
193
193
|
rootDir: options.rootDir,
|
|
194
194
|
configPath: getDocsCloudConfigPathForFramework(options.framework)
|
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-Dneyfhkv.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-B3JYx2zk.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";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/cloud-analytics.ts
|
|
2
|
-
const DEFAULT_DOCS_CLOUD_ANALYTICS_ENDPOINT = "https://
|
|
2
|
+
const DEFAULT_DOCS_CLOUD_ANALYTICS_ENDPOINT = "https://api.farming-labs.dev/v1/analytics/events";
|
|
3
3
|
function normalizeRuntimeEnvValue(value) {
|
|
4
4
|
const normalized = value?.trim();
|
|
5
5
|
return normalized ? normalized : void 0;
|
|
@@ -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-B3JYx2zk.mjs";
|
|
2
2
|
import "./sitemap-server-idLUrmmU.mjs";
|
|
3
3
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
4
4
|
import "./server.mjs";
|
|
@@ -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-Dneyfhkv.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/analytics.d.ts
|
|
4
4
|
declare const DOCS_AGENT_TRACE_EVENT_TYPES: readonly ["run.start", "run.end", "run.error", "user.input", "prompt.build", "retrieval.query", "retrieval.result", "retrieval.error", "model.call", "model.response", "model.stream", "model.error", "tool.call", "tool.result", "tool.error", "retry", "timeout", "error", "agent.final"];
|
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 resolveDocsObservabilityConfig, 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 resolveDocsAnalyticsConfig, 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, p as DEFAULT_SITEMAP_MANIFEST_PATH, q as serializeOpenDocsProviders, r as createAlgoliaSearchAdapter, rt as getDocsRequestAnalyticsProperties, 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-Dneyfhkv.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 resolveDocsObservabilityConfig, 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 resolveDocsAnalyticsConfig, 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, p as DEFAULT_SITEMAP_MANIFEST_PATH, q as serializeOpenDocsProviders, r as createAlgoliaSearchAdapter, rt as getDocsRequestAnalyticsProperties, 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-MHSL0tYu.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 getDocsRequestAnalyticsProperties, D as emitDocsAgentTraceEvent, E as createDocsAgentTraceId, M as resolveDocsObservabilityConfig, O as emitDocsAnalyticsEvent, T as createDocsAgentTraceContext, a as createMcpSearchAdapter, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, f as resolveSearchRequestConfig, i as createCustomSearchAdapter, j as resolveDocsAnalyticsConfig, 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 getDocsRequestAnalyticsProperties, D as emitDocsAgentTraceEvent, E as createDocsAgentTraceId, M as resolveDocsObservabilityConfig, O as emitDocsAnalyticsEvent, T as createDocsAgentTraceContext, a as createMcpSearchAdapter, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, f as resolveSearchRequestConfig, i as createCustomSearchAdapter, j as resolveDocsAnalyticsConfig, 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-B3JYx2zk.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";
|
|
@@ -1473,6 +1473,35 @@ interface AIConfig {
|
|
|
1473
1473
|
* ```
|
|
1474
1474
|
*/
|
|
1475
1475
|
triggerComponent?: unknown;
|
|
1476
|
+
/**
|
|
1477
|
+
* Server-side answer provider used by Ask AI.
|
|
1478
|
+
*
|
|
1479
|
+
* - `"docs-cloud"` — send questions to the configured Docs Cloud project
|
|
1480
|
+
* using `NEXT_PUBLIC_DOCS_CLOUD_PROJECT_ID` and a browser-safe
|
|
1481
|
+
* Docs Cloud API key env such as `NEXT_PUBLIC_DOCS_CLOUD_API_KEY`.
|
|
1482
|
+
* If only a server-side key is configured, framework integrations may
|
|
1483
|
+
* proxy through the local docs API route.
|
|
1484
|
+
* - Omit this option to use the built-in OpenAI-compatible RAG handler.
|
|
1485
|
+
*
|
|
1486
|
+
* @example
|
|
1487
|
+
* ```ts
|
|
1488
|
+
* ai: {
|
|
1489
|
+
* enabled: true,
|
|
1490
|
+
* provider: "docs-cloud",
|
|
1491
|
+
* }
|
|
1492
|
+
* ```
|
|
1493
|
+
*/
|
|
1494
|
+
provider?: "docs-cloud" | (string & {});
|
|
1495
|
+
/**
|
|
1496
|
+
* Whether Ask AI should request streaming responses when the selected
|
|
1497
|
+
* provider supports them.
|
|
1498
|
+
*
|
|
1499
|
+
* Docs Cloud streams token deltas by default for `provider: "docs-cloud"`.
|
|
1500
|
+
* Set this to `false` to request a single JSON answer instead.
|
|
1501
|
+
*
|
|
1502
|
+
* @default true
|
|
1503
|
+
*/
|
|
1504
|
+
stream?: boolean;
|
|
1476
1505
|
/**
|
|
1477
1506
|
* The LLM model configuration.
|
|
1478
1507
|
*
|