@farming-labs/docs 0.1.142 → 0.1.144
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/cli/index.mjs +13 -9
- package/dist/{cloud-BFgfAmuX.mjs → cloud-BBg-41RG.mjs} +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/{init-D8Jw1iUE.mjs → init-CZx_vasZ.mjs} +67 -0
- package/dist/mcp.d.mts +1 -1
- package/dist/{search-MyKnoCrX.d.mts → search-vwey5r8r.d.mts} +1 -1
- package/dist/server.d.mts +2 -2
- package/dist/{types-CwsXQ_v1.d.mts → types-DooUSWkW.d.mts} +2 -1
- package/package.json +1 -1
package/dist/cli/index.mjs
CHANGED
|
@@ -22,6 +22,7 @@ function parseFlags(argv) {
|
|
|
22
22
|
const flags = {};
|
|
23
23
|
const booleanFlags = new Set([
|
|
24
24
|
"api-reference",
|
|
25
|
+
"cloud",
|
|
25
26
|
"typesense",
|
|
26
27
|
"algolia",
|
|
27
28
|
"verbose",
|
|
@@ -53,7 +54,8 @@ async function main() {
|
|
|
53
54
|
theme: typeof flags.theme === "string" ? flags.theme : void 0,
|
|
54
55
|
entry: typeof flags.entry === "string" ? flags.entry : void 0,
|
|
55
56
|
apiReference: typeof flags["api-reference"] === "boolean" ? flags["api-reference"] : void 0,
|
|
56
|
-
apiRouteRoot: typeof flags["api-route-root"] === "string" ? flags["api-route-root"] : void 0
|
|
57
|
+
apiRouteRoot: typeof flags["api-route-root"] === "string" ? flags["api-route-root"] : void 0,
|
|
58
|
+
cloud: typeof flags.cloud === "boolean" ? flags.cloud : void 0
|
|
57
59
|
};
|
|
58
60
|
const mcpOptions = { configPath: typeof flags.config === "string" ? flags.config : void 0 };
|
|
59
61
|
const devOptions = {
|
|
@@ -86,33 +88,33 @@ async function main() {
|
|
|
86
88
|
json: typeof flags.json === "boolean" ? flags.json : void 0
|
|
87
89
|
};
|
|
88
90
|
if (!parsedCommand.command || parsedCommand.command === "init") {
|
|
89
|
-
const { init } = await import("../init-
|
|
91
|
+
const { init } = await import("../init-CZx_vasZ.mjs");
|
|
90
92
|
await init(initOptions);
|
|
91
93
|
} else if (parsedCommand.command === "dev") {
|
|
92
94
|
const { dev } = await import("../dev-D58nBPBv.mjs");
|
|
93
95
|
await dev(devOptions);
|
|
94
96
|
} else if (parsedCommand.command === "deploy") {
|
|
95
|
-
const { runCloudDeploy } = await import("../cloud-
|
|
97
|
+
const { runCloudDeploy } = await import("../cloud-BBg-41RG.mjs");
|
|
96
98
|
await runCloudDeploy(cloudOptions);
|
|
97
99
|
} else if (parsedCommand.command === "preview") {
|
|
98
|
-
const { runCloudPreview } = await import("../cloud-
|
|
100
|
+
const { runCloudPreview } = await import("../cloud-BBg-41RG.mjs");
|
|
99
101
|
await runCloudPreview(cloudOptions);
|
|
100
102
|
} else if (parsedCommand.command === "cloud" && subcommand === "deploy") {
|
|
101
|
-
const { runCloudDeploy } = await import("../cloud-
|
|
103
|
+
const { runCloudDeploy } = await import("../cloud-BBg-41RG.mjs");
|
|
102
104
|
await runCloudDeploy(cloudOptions);
|
|
103
105
|
} else if (parsedCommand.command === "cloud" && subcommand === "preview") {
|
|
104
|
-
const { runCloudPreview } = await import("../cloud-
|
|
106
|
+
const { runCloudPreview } = await import("../cloud-BBg-41RG.mjs");
|
|
105
107
|
await runCloudPreview(cloudOptions);
|
|
106
108
|
} else if (parsedCommand.command === "cloud" && subcommand === "init") {
|
|
107
|
-
const { runCloudInit } = await import("../cloud-
|
|
109
|
+
const { runCloudInit } = await import("../cloud-BBg-41RG.mjs");
|
|
108
110
|
await runCloudInit(cloudOptions);
|
|
109
111
|
} else if (parsedCommand.command === "cloud" && subcommand === "sync") {
|
|
110
|
-
const { syncCloudConfig } = await import("../cloud-
|
|
112
|
+
const { syncCloudConfig } = await import("../cloud-BBg-41RG.mjs");
|
|
111
113
|
await syncCloudConfig(cloudOptions);
|
|
112
114
|
} else if (parsedCommand.command === "cloud") {
|
|
113
115
|
console.error(pc.red(`Unknown cloud subcommand: ${subcommand ?? "(missing)"}`));
|
|
114
116
|
console.error();
|
|
115
|
-
const { printCloudHelp } = await import("../cloud-
|
|
117
|
+
const { printCloudHelp } = await import("../cloud-BBg-41RG.mjs");
|
|
116
118
|
printCloudHelp();
|
|
117
119
|
process.exit(1);
|
|
118
120
|
} else if (parsedCommand.command === "mcp") {
|
|
@@ -275,6 +277,8 @@ ${pc.dim("Options for init:")}
|
|
|
275
277
|
${pc.cyan("--api-reference")} Scaffold API reference support during ${pc.cyan("init")}
|
|
276
278
|
${pc.cyan("--no-api-reference")} Skip API reference scaffold during ${pc.cyan("init")}
|
|
277
279
|
${pc.cyan("--api-route-root <path>")} Override the API route root scanned by ${pc.cyan("apiReference.routeRoot")} (e.g. ${pc.dim("api")}, ${pc.dim("internal-api")})
|
|
280
|
+
${pc.cyan("--cloud")} Add Docs Cloud infrastructure support during ${pc.cyan("init")}
|
|
281
|
+
${pc.cyan("--no-cloud")} Skip the Docs Cloud infrastructure prompt during ${pc.cyan("init")}
|
|
278
282
|
|
|
279
283
|
${pc.dim("Options for mcp:")}
|
|
280
284
|
${pc.cyan("--config <path>")} Use a custom docs config path instead of ${pc.dim("docs.config.ts[x]")}
|
|
@@ -997,4 +997,4 @@ ${pc.dim("Config example:")}
|
|
|
997
997
|
}
|
|
998
998
|
|
|
999
999
|
//#endregion
|
|
1000
|
-
export { printCloudHelp, runCloudDeploy, runCloudInit, runCloudPreview, syncCloudConfig };
|
|
1000
|
+
export { initCloudConfig, printCloudHelp, runCloudDeploy, runCloudInit, runCloudPreview, syncCloudConfig };
|
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-DooUSWkW.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-vwey5r8r.mjs";
|
|
3
3
|
import { DocsMcpPage, DocsMcpResolvedConfig } from "./mcp.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/define-docs.d.ts
|
|
@@ -14,6 +14,7 @@ const VALID_TEMPLATES = [
|
|
|
14
14
|
"astro",
|
|
15
15
|
"tanstack-start"
|
|
16
16
|
];
|
|
17
|
+
const DOCS_CLOUD_DASHBOARD_URL = "https://docs-app.farming-labs.dev";
|
|
17
18
|
const COMMON_LOCALE_OPTIONS = [
|
|
18
19
|
{
|
|
19
20
|
value: "en",
|
|
@@ -142,6 +143,57 @@ function detectApiRouteRoot(cwd, framework, nextAppDir = "app") {
|
|
|
142
143
|
if (fs.existsSync(path.join(serverRoot, defaultRoot))) return defaultRoot;
|
|
143
144
|
return detectFromRecursiveRouteFiles(serverRoot, (entry, relativePath) => /\.(?:[cm]?[jt]s)$/i.test(relativePath) && !relativePath.endsWith(".d.ts") && entry.isFile()) ?? defaultRoot;
|
|
144
145
|
}
|
|
146
|
+
function frameworkForTemplate(template) {
|
|
147
|
+
if (template === "next") return "nextjs";
|
|
148
|
+
if (template === "tanstack-start") return "tanstack-start";
|
|
149
|
+
if (template === "sveltekit") return "sveltekit";
|
|
150
|
+
if (template === "astro") return "astro";
|
|
151
|
+
return "nuxt";
|
|
152
|
+
}
|
|
153
|
+
function getDocsCloudConfigPathForFramework(framework) {
|
|
154
|
+
if (framework === "sveltekit" || framework === "astro") return "src/lib/docs.config.ts";
|
|
155
|
+
}
|
|
156
|
+
function docsCloudDeployCommand(pm) {
|
|
157
|
+
if (pm === "pnpm") return "pnpm dlx @farming-labs/docs deploy";
|
|
158
|
+
if (pm === "yarn") return "npx @farming-labs/docs deploy";
|
|
159
|
+
if (pm === "bun") return "bunx @farming-labs/docs deploy";
|
|
160
|
+
return "npx @farming-labs/docs deploy";
|
|
161
|
+
}
|
|
162
|
+
function printDocsCloudOnboardingInstructions(result, rootDir, pm) {
|
|
163
|
+
const relativeConfigPath = path.relative(rootDir, result.configPath) || path.basename(result.configPath);
|
|
164
|
+
const relativeDocsJsonPath = path.relative(rootDir, result.docsJsonPath) || path.basename(result.docsJsonPath);
|
|
165
|
+
p.log.success(`Docs Cloud infrastructure support configured:\n ${pc.green("+")} ${relativeConfigPath}\n ${pc.green("+")} ${relativeDocsJsonPath}`);
|
|
166
|
+
console.log();
|
|
167
|
+
console.log(pc.bold("Finish Docs Cloud authentication"));
|
|
168
|
+
console.log(`1. Sign in to ${pc.cyan(DOCS_CLOUD_DASHBOARD_URL)}.`);
|
|
169
|
+
console.log("2. Open your Docs Cloud project settings and create a project API key.");
|
|
170
|
+
console.log(`3. Add the key to ${pc.cyan(".env.local")} or your shell:`);
|
|
171
|
+
console.log(` ${pc.cyan(result.apiKeyEnv)}=${pc.dim("fl_key_...")}`);
|
|
172
|
+
console.log(` ${pc.cyan(result.analyticsProjectIdEnv)}=${pc.dim("docs_cloud_project_id")}`);
|
|
173
|
+
console.log("4. Keep local env files out of git and use the same env names in production.");
|
|
174
|
+
console.log(`5. Deploy when ready with ${pc.cyan(docsCloudDeployCommand(pm))}.`);
|
|
175
|
+
console.log();
|
|
176
|
+
}
|
|
177
|
+
async function configureDocsCloudOnboarding(options) {
|
|
178
|
+
let enabled = options.enabled;
|
|
179
|
+
if (typeof enabled !== "boolean") {
|
|
180
|
+
const cloudAnswer = await p.confirm({
|
|
181
|
+
message: `Do you want Docs Cloud infrastructure support? ${pc.dim("Adds cloud config and docs.json")}`,
|
|
182
|
+
initialValue: false
|
|
183
|
+
});
|
|
184
|
+
if (p.isCancel(cloudAnswer)) {
|
|
185
|
+
p.outro(pc.red("Init cancelled."));
|
|
186
|
+
process.exit(0);
|
|
187
|
+
}
|
|
188
|
+
enabled = cloudAnswer;
|
|
189
|
+
}
|
|
190
|
+
if (!enabled) return;
|
|
191
|
+
const { initCloudConfig } = await import("./cloud-BBg-41RG.mjs");
|
|
192
|
+
printDocsCloudOnboardingInstructions(await initCloudConfig({
|
|
193
|
+
rootDir: options.rootDir,
|
|
194
|
+
configPath: getDocsCloudConfigPathForFramework(options.framework)
|
|
195
|
+
}), options.rootDir, options.packageManager);
|
|
196
|
+
}
|
|
145
197
|
async function init(options = {}) {
|
|
146
198
|
const cwd = process.cwd();
|
|
147
199
|
p.intro(pc.bgCyan(pc.black(" @farming-labs/docs ")));
|
|
@@ -276,11 +328,20 @@ async function init(options = {}) {
|
|
|
276
328
|
const pmFresh = pmAnswer;
|
|
277
329
|
p.log.success(`Bootstrapped ${pc.cyan(`'${projectName}'`)}. Installing dependencies with ${pc.cyan(pmFresh)}...`);
|
|
278
330
|
const installCmd = pmFresh === "yarn" ? "yarn install" : pmFresh === "npm" ? "npm install" : pmFresh === "bun" ? "bun install" : "pnpm install";
|
|
331
|
+
let installSucceeded = true;
|
|
279
332
|
try {
|
|
280
333
|
exec(installCmd, targetDir);
|
|
281
334
|
} catch {
|
|
335
|
+
installSucceeded = false;
|
|
282
336
|
p.log.warn(`${pmFresh} install failed. Run ${pc.cyan(installCmd)} manually inside the project.`);
|
|
283
337
|
}
|
|
338
|
+
if (installSucceeded) await configureDocsCloudOnboarding({
|
|
339
|
+
rootDir: targetDir,
|
|
340
|
+
framework: frameworkForTemplate(template),
|
|
341
|
+
packageManager: pmFresh,
|
|
342
|
+
enabled: options.cloud
|
|
343
|
+
});
|
|
344
|
+
else if (options.cloud) p.log.warn(`Skipping Docs Cloud onboarding until dependencies are installed. Then run ${pc.cyan("docs cloud init")}.`);
|
|
284
345
|
const devCmd = pmFresh === "yarn" ? "yarn dev" : pmFresh === "npm" ? "npm run dev" : pmFresh === "bun" ? "bun dev" : "pnpm dev";
|
|
285
346
|
p.outro(pc.green(`Done! Run ${pc.cyan(`cd ${projectName} && ${devCmd}`)} to start the dev server and navigate to the /docs.`));
|
|
286
347
|
p.outro(pc.green("Happy documenting!"));
|
|
@@ -770,6 +831,12 @@ async function init(options = {}) {
|
|
|
770
831
|
process.exit(1);
|
|
771
832
|
}
|
|
772
833
|
s2.stop("Dependencies installed");
|
|
834
|
+
await configureDocsCloudOnboarding({
|
|
835
|
+
rootDir: cwd,
|
|
836
|
+
framework,
|
|
837
|
+
packageManager: pm,
|
|
838
|
+
enabled: options.cloud
|
|
839
|
+
});
|
|
773
840
|
const startDev = await p.confirm({
|
|
774
841
|
message: "Start the dev server now?",
|
|
775
842
|
initialValue: true
|
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-DooUSWkW.mjs";
|
|
2
2
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
3
|
|
|
4
4
|
//#region src/mcp.d.ts
|
|
@@ -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-DooUSWkW.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-DooUSWkW.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-vwey5r8r.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
|
|
@@ -668,10 +668,11 @@ interface PageActionsConfig {
|
|
|
668
668
|
*
|
|
669
669
|
* - `"below-title"` — render below the first `<h1>` heading (default)
|
|
670
670
|
* - `"above-title"` — render above the page title / content
|
|
671
|
+
* - `"toc"` — render as a compact rail in the table-of-contents column
|
|
671
672
|
*
|
|
672
673
|
* @default "below-title"
|
|
673
674
|
*/
|
|
674
|
-
position?: "above-title" | "below-title";
|
|
675
|
+
position?: "above-title" | "below-title" | "toc";
|
|
675
676
|
/**
|
|
676
677
|
* Horizontal alignment of page action buttons.
|
|
677
678
|
*
|