@farming-labs/docs 0.1.58 → 0.1.59
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-DBVNPqFU.mjs → agent-3gfGIRgr.mjs} +1 -1
- package/dist/cli/index.mjs +5 -5
- package/dist/{doctor-k6ouCFXp.mjs → doctor-_pzgvY8k.mjs} +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/{mcp-C-TmMrdw.mjs → mcp-DSCLcG0O.mjs} +1 -1
- package/dist/mcp.d.mts +1 -1
- package/dist/{api-reference-GDAEzQn1.mjs → prompt-utils-CbtKaiIU.mjs} +98 -1
- package/dist/{search-C7mKYgqQ.mjs → search-DFCYC33M.mjs} +1 -1
- package/dist/{search-B6aum8AJ.d.mts → search-DWkWwsU5.d.mts} +1 -1
- package/dist/server.d.mts +26 -3
- package/dist/server.mjs +2 -2
- package/dist/{types-ClMUaY9I.d.mts → types-bAjvrTGU.d.mts} +21 -3
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { C as renderDocsMarkdownDocument, g as findDocsMarkdownPage } from "./agent-CCznWtjf.mjs";
|
|
2
2
|
import { d as hashGeneratedAgentContent, m as serializeGeneratedAgentDocument, p as parseGeneratedAgentDocument, u as GENERATED_AGENT_PROVENANCE_VERSION } from "./search-Cu_pxL8o.mjs";
|
|
3
3
|
import "./index.mjs";
|
|
4
|
-
import "./
|
|
4
|
+
import "./prompt-utils-CbtKaiIU.mjs";
|
|
5
5
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
6
6
|
import "./server.mjs";
|
|
7
7
|
import { a as loadProjectEnv, c as readNavTitle, d as readTopLevelStringProperty, f as resolveDocsConfigPath, i as loadDocsConfigModule, l as readNumberProperty, o as readBooleanProperty, p as resolveDocsContentDir, s as readEnvReferenceProperty, t as extractNestedObjectLiteral, u as readStringProperty } from "./config-Si-yUfM_.mjs";
|
package/dist/cli/index.mjs
CHANGED
|
@@ -72,10 +72,10 @@ async function main() {
|
|
|
72
72
|
const { init } = await import("../init-C1tsFxXo.mjs");
|
|
73
73
|
await init(initOptions);
|
|
74
74
|
} else if (parsedCommand.command === "mcp") {
|
|
75
|
-
const { runMcp } = await import("../mcp-
|
|
75
|
+
const { runMcp } = await import("../mcp-DSCLcG0O.mjs");
|
|
76
76
|
await runMcp(mcpOptions);
|
|
77
77
|
} else if (parsedCommand.command === "agent" && subcommand === "compact") {
|
|
78
|
-
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent-
|
|
78
|
+
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent-3gfGIRgr.mjs");
|
|
79
79
|
const agentCompactOptions = parseAgentCompactArgs(args.slice(2));
|
|
80
80
|
if (agentCompactOptions.help) {
|
|
81
81
|
printAgentCompactHelp();
|
|
@@ -85,11 +85,11 @@ async function main() {
|
|
|
85
85
|
} else if (parsedCommand.command === "agent") {
|
|
86
86
|
console.error(pc.red(`Unknown agent subcommand: ${subcommand ?? "(missing)"}`));
|
|
87
87
|
console.error();
|
|
88
|
-
const { printAgentCompactHelp } = await import("../agent-
|
|
88
|
+
const { printAgentCompactHelp } = await import("../agent-3gfGIRgr.mjs");
|
|
89
89
|
printAgentCompactHelp();
|
|
90
90
|
process.exit(1);
|
|
91
91
|
} else if (parsedCommand.command === "doctor") {
|
|
92
|
-
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-
|
|
92
|
+
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-_pzgvY8k.mjs");
|
|
93
93
|
const doctorOptions = parseDoctorArgs(args.slice(1));
|
|
94
94
|
if (doctorOptions.help) {
|
|
95
95
|
printDoctorHelp();
|
|
@@ -97,7 +97,7 @@ async function main() {
|
|
|
97
97
|
}
|
|
98
98
|
await runDoctor(doctorOptions);
|
|
99
99
|
} else if (parsedCommand.command === "search" && subcommand === "sync") {
|
|
100
|
-
const { syncSearch } = await import("../search-
|
|
100
|
+
const { syncSearch } = await import("../search-DFCYC33M.mjs");
|
|
101
101
|
await syncSearch(searchSyncOptions);
|
|
102
102
|
} else if (parsedCommand.command === "search") {
|
|
103
103
|
console.error(pc.red(`Unknown search subcommand: ${subcommand ?? "(missing)"}`));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { c as DEFAULT_LLMS_TXT_ROUTE, f as DEFAULT_MCP_WELL_KNOWN_ROUTE, i as DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE, m as DEFAULT_SKILL_MD_WELL_KNOWN_ROUTE, o as DEFAULT_LLMS_FULL_TXT_ROUTE, p as DEFAULT_SKILL_MD_ROUTE, r as DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE, t as DEFAULT_AGENT_FEEDBACK_ROUTE, u as DEFAULT_MCP_PUBLIC_ROUTE } from "./agent-CCznWtjf.mjs";
|
|
2
|
-
import "./
|
|
2
|
+
import "./prompt-utils-CbtKaiIU.mjs";
|
|
3
3
|
import { createFilesystemDocsMcpSource, resolveDocsMcpConfig } from "./mcp.mjs";
|
|
4
4
|
import "./server.mjs";
|
|
5
5
|
import { a as loadProjectEnv, c as readNavTitle, d as readTopLevelStringProperty, f as resolveDocsConfigPath, i as loadDocsConfigModule, o as readBooleanProperty, p as resolveDocsContentDir, r as extractTopLevelConfigObject, t as extractNestedObjectLiteral } from "./config-Si-yUfM_.mjs";
|
|
6
|
-
import { inspectAgentCompactionState, scanDocsPageTargets } from "./agent-
|
|
6
|
+
import { inspectAgentCompactionState, scanDocsPageTargets } from "./agent-3gfGIRgr.mjs";
|
|
7
7
|
import { t as detectFramework } from "./utils-CpTFbAiS.mjs";
|
|
8
8
|
import { existsSync, lstatSync, readFileSync, readdirSync } from "node:fs";
|
|
9
9
|
import path from "node:path";
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as SidebarComponentProps, A as DocsSearchQuery, B as McpDocsSearchConfig, C as DocsSearchAdapter, D as DocsSearchConfig, E as DocsSearchChunkingConfig, F as FeedbackConfig, G as OrderingItem, H as OpenDocsConfig, I as FontStyle, J as PageOpenGraph, K as PageActionsConfig, L as GithubConfig, M as DocsSearchResultType, N as DocsSearchSourcePage, O as DocsSearchDocument, P as DocsTheme, Q as ResolvedDocsRelatedLink, R as LastUpdatedConfig, S as DocsRelatedItem, T as DocsSearchAdapterFactory, U as OpenDocsProvider, V as OGConfig, W as OpenGraphImage, X as PageTwitter, Y as PageSidebarFrontmatter, Z as ReadingTimeConfig, _ as DocsI18nConfig, a as ApiReferenceRenderer, at as SidebarTree, b as DocsMetadata, c as ChangelogFrontmatter, ct as TypesenseDocsSearchConfig, d as CustomDocsSearchConfig, et as SidebarConfig, f as DocsAgentFeedbackContext, g as DocsFeedbackValue, h as DocsFeedbackData, i as ApiReferenceConfig, it as SidebarPageNode, j as DocsSearchResult, k as DocsSearchEmbeddingsConfig, l as CodeBlockCopyData, lt as TypographyConfig, m as DocsConfig, n as AgentFeedbackConfig, nt as SidebarFolderNode, o as BreadcrumbConfig, ot as SimpleDocsSearchConfig, p as DocsAgentFeedbackData, q as PageFrontmatter, r as AlgoliaDocsSearchConfig, rt as SidebarNode, s as ChangelogConfig, st as ThemeToggleConfig, t as AIConfig, tt as SidebarFolderIndexBehavior, u as CopyMarkdownConfig, ut as UIConfig, v as DocsMcpConfig, w as DocsSearchAdapterContext, x as DocsNav, y as DocsMcpToolsConfig, z as LlmsTxtConfig } from "./types-
|
|
1
|
+
import { $ as SidebarComponentProps, A as DocsSearchQuery, B as McpDocsSearchConfig, C as DocsSearchAdapter, D as DocsSearchConfig, E as DocsSearchChunkingConfig, F as FeedbackConfig, G as OrderingItem, H as OpenDocsConfig, I as FontStyle, J as PageOpenGraph, K as PageActionsConfig, L as GithubConfig, M as DocsSearchResultType, N as DocsSearchSourcePage, O as DocsSearchDocument, P as DocsTheme, Q as ResolvedDocsRelatedLink, R as LastUpdatedConfig, S as DocsRelatedItem, T as DocsSearchAdapterFactory, U as OpenDocsProvider, V as OGConfig, W as OpenGraphImage, X as PageTwitter, Y as PageSidebarFrontmatter, Z as ReadingTimeConfig, _ as DocsI18nConfig, a as ApiReferenceRenderer, at as SidebarTree, b as DocsMetadata, c as ChangelogFrontmatter, ct as TypesenseDocsSearchConfig, d as CustomDocsSearchConfig, et as SidebarConfig, f as DocsAgentFeedbackContext, g as DocsFeedbackValue, h as DocsFeedbackData, i as ApiReferenceConfig, it as SidebarPageNode, j as DocsSearchResult, k as DocsSearchEmbeddingsConfig, l as CodeBlockCopyData, lt as TypographyConfig, m as DocsConfig, n as AgentFeedbackConfig, nt as SidebarFolderNode, o as BreadcrumbConfig, ot as SimpleDocsSearchConfig, p as DocsAgentFeedbackData, q as PageFrontmatter, r as AlgoliaDocsSearchConfig, rt as SidebarNode, s as ChangelogConfig, st as ThemeToggleConfig, t as AIConfig, tt as SidebarFolderIndexBehavior, u as CopyMarkdownConfig, ut as UIConfig, v as DocsMcpConfig, w as DocsSearchAdapterContext, x as DocsNav, y as DocsMcpToolsConfig, z as LlmsTxtConfig } from "./types-bAjvrTGU.mjs";
|
|
2
2
|
import { DocsMcpPage, DocsMcpResolvedConfig } from "./mcp.mjs";
|
|
3
|
-
import { a as createSimpleSearchAdapter, c as resolveSearchRequestConfig, i as createMcpSearchAdapter, n as createAlgoliaSearchAdapter, o as createTypesenseSearchAdapter, r as createCustomSearchAdapter, s as performDocsSearch, t as buildDocsSearchDocuments } from "./search-
|
|
3
|
+
import { a as createSimpleSearchAdapter, c as resolveSearchRequestConfig, i as createMcpSearchAdapter, n as createAlgoliaSearchAdapter, o as createTypesenseSearchAdapter, r as createCustomSearchAdapter, s as performDocsSearch, t as buildDocsSearchDocuments } from "./search-DWkWwsU5.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/define-docs.d.ts
|
|
6
6
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./
|
|
1
|
+
import "./prompt-utils-CbtKaiIU.mjs";
|
|
2
2
|
import { createFilesystemDocsMcpSource, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
3
3
|
import "./server.mjs";
|
|
4
4
|
import { c as readNavTitle, f as resolveDocsConfigPath, n as extractObjectLiteral, o as readBooleanProperty, p as resolveDocsContentDir, u as readStringProperty } from "./config-Si-yUfM_.mjs";
|
package/dist/mcp.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DocsSearchConfig, G as OrderingItem, N as DocsSearchSourcePage, v as DocsMcpConfig } from "./types-
|
|
1
|
+
import { D as DocsSearchConfig, G as OrderingItem, N as DocsSearchSourcePage, v as DocsMcpConfig } from "./types-bAjvrTGU.mjs";
|
|
2
2
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
3
|
|
|
4
4
|
//#region src/mcp.d.ts
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
1
2
|
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
2
3
|
import { basename, join, relative } from "node:path";
|
|
3
4
|
import { getHtmlDocument } from "@scalar/core/libs/html-rendering";
|
|
@@ -810,4 +811,100 @@ function humanizeSegment(value) {
|
|
|
810
811
|
}
|
|
811
812
|
|
|
812
813
|
//#endregion
|
|
813
|
-
|
|
814
|
+
//#region src/prompt-utils.ts
|
|
815
|
+
const require = createRequire(import.meta.url);
|
|
816
|
+
const DEFAULT_PROMPT_PROVIDER_TEMPLATES = {
|
|
817
|
+
chatgpt: "https://chatgpt.com/?q={prompt}",
|
|
818
|
+
claude: "https://claude.ai/new?q={prompt}",
|
|
819
|
+
cursor: "https://cursor.com/link/prompt?text={prompt}",
|
|
820
|
+
gemini: "https://gemini.google.com/app?q={prompt}",
|
|
821
|
+
copilot: "https://github.com/copilot?prompt={prompt}"
|
|
822
|
+
};
|
|
823
|
+
function normalizePromptProviderName(name) {
|
|
824
|
+
return name.trim().toLowerCase();
|
|
825
|
+
}
|
|
826
|
+
function serializeDocsIcon(icon) {
|
|
827
|
+
if (!icon) return void 0;
|
|
828
|
+
if (typeof icon === "string") return icon;
|
|
829
|
+
try {
|
|
830
|
+
const { renderToStaticMarkup } = require("react-dom/server");
|
|
831
|
+
return renderToStaticMarkup(icon);
|
|
832
|
+
} catch {
|
|
833
|
+
return;
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
function serializeDocsIconRegistry(icons) {
|
|
837
|
+
if (!icons) return void 0;
|
|
838
|
+
const entries = Object.entries(icons).map(([name, icon]) => [name, serializeDocsIcon(icon)]).filter((entry) => typeof entry[1] === "string");
|
|
839
|
+
return entries.length > 0 ? Object.fromEntries(entries) : void 0;
|
|
840
|
+
}
|
|
841
|
+
function serializeOpenDocsProviders(providers) {
|
|
842
|
+
if (!providers || providers.length === 0) return void 0;
|
|
843
|
+
return providers.map((provider) => ({
|
|
844
|
+
name: provider.name,
|
|
845
|
+
urlTemplate: provider.urlTemplate,
|
|
846
|
+
promptUrlTemplate: provider.promptUrlTemplate,
|
|
847
|
+
iconHtml: serializeDocsIcon(provider.icon)
|
|
848
|
+
}));
|
|
849
|
+
}
|
|
850
|
+
function parsePromptStringArray(value) {
|
|
851
|
+
if (Array.isArray(value)) {
|
|
852
|
+
const normalized = value.filter((entry) => typeof entry === "string").map((entry) => entry.trim()).filter(Boolean);
|
|
853
|
+
return normalized.length > 0 ? normalized : void 0;
|
|
854
|
+
}
|
|
855
|
+
if (typeof value !== "string") return void 0;
|
|
856
|
+
const trimmed = value.trim();
|
|
857
|
+
if (!trimmed) return void 0;
|
|
858
|
+
if (trimmed.startsWith("[") && trimmed.endsWith("]")) {
|
|
859
|
+
const inner = trimmed.slice(1, -1).trim();
|
|
860
|
+
if (!inner) return void 0;
|
|
861
|
+
const normalized = inner.split(",").map((entry) => entry.trim().replace(/^['"]|['"]$/g, "")).filter(Boolean);
|
|
862
|
+
return normalized.length > 0 ? normalized : void 0;
|
|
863
|
+
}
|
|
864
|
+
const normalized = trimmed.split(",").map((entry) => entry.trim()).filter(Boolean);
|
|
865
|
+
return normalized.length > 0 ? normalized : void 0;
|
|
866
|
+
}
|
|
867
|
+
function resolvePromptProviderChoices(availableProviders, preferredNames) {
|
|
868
|
+
const configuredByName = new Map((availableProviders ?? []).map((provider) => [normalizePromptProviderName(provider.name), provider]));
|
|
869
|
+
const names = preferredNames && preferredNames.length > 0 ? preferredNames : (availableProviders ?? []).map((provider) => provider.name);
|
|
870
|
+
const seen = /* @__PURE__ */ new Set();
|
|
871
|
+
const resolved = [];
|
|
872
|
+
for (const rawName of names) {
|
|
873
|
+
const name = rawName.trim();
|
|
874
|
+
if (!name) continue;
|
|
875
|
+
const normalized = normalizePromptProviderName(name);
|
|
876
|
+
if (seen.has(normalized)) continue;
|
|
877
|
+
seen.add(normalized);
|
|
878
|
+
const configured = configuredByName.get(normalized);
|
|
879
|
+
const template = configured?.promptUrlTemplate ?? configured?.urlTemplate ?? DEFAULT_PROMPT_PROVIDER_TEMPLATES[normalized];
|
|
880
|
+
if (!template) continue;
|
|
881
|
+
resolved.push({
|
|
882
|
+
name: configured?.name ?? name,
|
|
883
|
+
iconHtml: configured?.iconHtml,
|
|
884
|
+
urlTemplate: template
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
return resolved;
|
|
888
|
+
}
|
|
889
|
+
function sanitizePromptText(text) {
|
|
890
|
+
const lines = text.replace(/\r\n/g, "\n").replace(/\n{3,}/g, "\n\n").replace(/[ \t]+\n/g, "\n").trim().split("\n");
|
|
891
|
+
const normalized = [];
|
|
892
|
+
for (let index = 0; index < lines.length; index += 1) {
|
|
893
|
+
const current = lines[index] ?? "";
|
|
894
|
+
const previous = normalized[normalized.length - 1] ?? "";
|
|
895
|
+
let nextNonEmpty = "";
|
|
896
|
+
for (let cursor = index + 1; cursor < lines.length; cursor += 1) {
|
|
897
|
+
const candidate = lines[cursor]?.trim() ?? "";
|
|
898
|
+
if (candidate) {
|
|
899
|
+
nextNonEmpty = candidate;
|
|
900
|
+
break;
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
if (current.trim() === "" && previous.trim().startsWith("- ") && nextNonEmpty.startsWith("- ")) continue;
|
|
904
|
+
normalized.push(current);
|
|
905
|
+
}
|
|
906
|
+
return normalized.join("\n");
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
//#endregion
|
|
910
|
+
export { sanitizePromptText as a, serializeOpenDocsProviders as c, buildApiReferenceOpenApiDocument as d, buildApiReferenceOpenApiDocumentAsync as f, resolveApiReferenceRenderer as g, resolveApiReferenceConfig as h, resolvePromptProviderChoices as i, buildApiReferenceHtmlDocument as l, buildApiReferenceScalarCss as m, normalizePromptProviderName as n, serializeDocsIcon as o, buildApiReferencePageTitle as p, parsePromptStringArray as r, serializeDocsIconRegistry as s, DEFAULT_PROMPT_PROVIDER_TEMPLATES as t, buildApiReferenceHtmlDocumentAsync as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as createAlgoliaSearchAdapter, o as createTypesenseSearchAdapter, t as buildDocsSearchDocuments } from "./search-Cu_pxL8o.mjs";
|
|
2
|
-
import "./
|
|
2
|
+
import "./prompt-utils-CbtKaiIU.mjs";
|
|
3
3
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
4
4
|
import "./server.mjs";
|
|
5
5
|
import { a as loadProjectEnv, d as readTopLevelStringProperty, f as resolveDocsConfigPath, p as resolveDocsContentDir } from "./config-Si-yUfM_.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as McpDocsSearchConfig, C as DocsSearchAdapter, D as DocsSearchConfig, E as DocsSearchChunkingConfig, N as DocsSearchSourcePage, O as DocsSearchDocument, T as DocsSearchAdapterFactory, ct as TypesenseDocsSearchConfig, d as CustomDocsSearchConfig, j as DocsSearchResult, r as AlgoliaDocsSearchConfig } from "./types-
|
|
1
|
+
import { B as McpDocsSearchConfig, C as DocsSearchAdapter, D as DocsSearchConfig, E as DocsSearchChunkingConfig, N as DocsSearchSourcePage, O as DocsSearchDocument, T as DocsSearchAdapterFactory, ct as TypesenseDocsSearchConfig, d as CustomDocsSearchConfig, j as DocsSearchResult, r as AlgoliaDocsSearchConfig } from "./types-bAjvrTGU.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/search.d.ts
|
|
4
4
|
declare function buildDocsSearchDocuments(pages: DocsSearchSourcePage[], chunking?: DocsSearchChunkingConfig): DocsSearchDocument[];
|
package/dist/server.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as DocsSearchQuery, B as McpDocsSearchConfig, C as DocsSearchAdapter, D as DocsSearchConfig, N as DocsSearchSourcePage, O as DocsSearchDocument, T as DocsSearchAdapterFactory, a as ApiReferenceRenderer, j as DocsSearchResult, m as DocsConfig, w as DocsSearchAdapterContext } from "./types-
|
|
1
|
+
import { A as DocsSearchQuery, B as McpDocsSearchConfig, C as DocsSearchAdapter, D as DocsSearchConfig, N as DocsSearchSourcePage, O as DocsSearchDocument, T as DocsSearchAdapterFactory, U as OpenDocsProvider, a as ApiReferenceRenderer, j as DocsSearchResult, m as DocsConfig, w as DocsSearchAdapterContext } from "./types-bAjvrTGU.mjs";
|
|
2
2
|
import { DocsMcpHttpHandlers, DocsMcpNavigationNode, DocsMcpNavigationTree, DocsMcpPage, DocsMcpResolvedConfig, DocsMcpSource, createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, normalizeDocsMcpRoute, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
3
|
-
import { a as createSimpleSearchAdapter, c as resolveSearchRequestConfig, i as createMcpSearchAdapter, n as createAlgoliaSearchAdapter, o as createTypesenseSearchAdapter, r as createCustomSearchAdapter, s as performDocsSearch, t as buildDocsSearchDocuments } from "./search-
|
|
3
|
+
import { a as createSimpleSearchAdapter, c as resolveSearchRequestConfig, i as createMcpSearchAdapter, n as createAlgoliaSearchAdapter, o as createTypesenseSearchAdapter, r as createCustomSearchAdapter, s as performDocsSearch, t as buildDocsSearchDocuments } from "./search-DWkWwsU5.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/api-reference.d.ts
|
|
6
6
|
type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD";
|
|
@@ -40,4 +40,27 @@ declare function buildApiReferenceOpenApiDocumentAsync(config: DocsConfig, optio
|
|
|
40
40
|
declare function buildApiReferenceHtmlDocument(config: DocsConfig, options: BuildApiReferenceHtmlOptions): string;
|
|
41
41
|
declare function buildApiReferenceHtmlDocumentAsync(config: DocsConfig, options: BuildApiReferenceHtmlOptions): Promise<string>;
|
|
42
42
|
//#endregion
|
|
43
|
-
|
|
43
|
+
//#region src/prompt-utils.d.ts
|
|
44
|
+
type PromptAction = "copy" | "open";
|
|
45
|
+
interface SerializedOpenDocsProvider {
|
|
46
|
+
name: string;
|
|
47
|
+
iconHtml?: string;
|
|
48
|
+
urlTemplate: string;
|
|
49
|
+
promptUrlTemplate?: string;
|
|
50
|
+
}
|
|
51
|
+
interface PromptProviderChoice {
|
|
52
|
+
name: string;
|
|
53
|
+
iconHtml?: string;
|
|
54
|
+
urlTemplate: string;
|
|
55
|
+
}
|
|
56
|
+
type PromptProviderInput = Pick<SerializedOpenDocsProvider, "name" | "iconHtml"> & Partial<Pick<SerializedOpenDocsProvider, "promptUrlTemplate" | "urlTemplate">>;
|
|
57
|
+
declare const DEFAULT_PROMPT_PROVIDER_TEMPLATES: Record<string, string>;
|
|
58
|
+
declare function normalizePromptProviderName(name: string): string;
|
|
59
|
+
declare function serializeDocsIcon(icon: unknown): string | undefined;
|
|
60
|
+
declare function serializeDocsIconRegistry(icons?: Record<string, unknown>): Record<string, string> | undefined;
|
|
61
|
+
declare function serializeOpenDocsProviders(providers?: OpenDocsProvider[]): SerializedOpenDocsProvider[] | undefined;
|
|
62
|
+
declare function parsePromptStringArray(value: unknown): string[] | undefined;
|
|
63
|
+
declare function resolvePromptProviderChoices(availableProviders?: PromptProviderInput[], preferredNames?: string[]): PromptProviderChoice[];
|
|
64
|
+
declare function sanitizePromptText(text: string): string;
|
|
65
|
+
//#endregion
|
|
66
|
+
export { type ApiReferenceFramework, type ApiReferenceRenderer, type ApiReferenceRoute, DEFAULT_PROMPT_PROVIDER_TEMPLATES, type DocsMcpHttpHandlers, type DocsMcpNavigationNode, type DocsMcpNavigationTree, type DocsMcpPage, type DocsMcpResolvedConfig, type DocsMcpSource, type DocsSearchAdapter, type DocsSearchAdapterContext, type DocsSearchAdapterFactory, type DocsSearchConfig, type DocsSearchDocument, type DocsSearchQuery, type DocsSearchResult, type DocsSearchSourcePage, type McpDocsSearchConfig, type PromptAction, type PromptProviderChoice, type ResolvedApiReferenceConfig, type SerializedOpenDocsProvider, buildApiReferenceHtmlDocument, buildApiReferenceHtmlDocumentAsync, buildApiReferenceOpenApiDocument, buildApiReferenceOpenApiDocumentAsync, buildApiReferencePageTitle, buildApiReferenceScalarCss, buildDocsSearchDocuments, createAlgoliaSearchAdapter, createCustomSearchAdapter, createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, createMcpSearchAdapter, createSimpleSearchAdapter, createTypesenseSearchAdapter, normalizeDocsMcpRoute, normalizePromptProviderName, parsePromptStringArray, performDocsSearch, resolveApiReferenceConfig, resolveApiReferenceRenderer, resolveDocsMcpConfig, resolvePromptProviderChoices, resolveSearchRequestConfig, runDocsMcpStdio, sanitizePromptText, serializeDocsIcon, serializeDocsIconRegistry, serializeOpenDocsProviders };
|
package/dist/server.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as createSimpleSearchAdapter, c as resolveSearchRequestConfig, i as createMcpSearchAdapter, n as createAlgoliaSearchAdapter, o as createTypesenseSearchAdapter, r as createCustomSearchAdapter, s as performDocsSearch, t as buildDocsSearchDocuments } from "./search-Cu_pxL8o.mjs";
|
|
2
|
-
import { a as
|
|
2
|
+
import { a as sanitizePromptText, c as serializeOpenDocsProviders, d as buildApiReferenceOpenApiDocument, f as buildApiReferenceOpenApiDocumentAsync, g as resolveApiReferenceRenderer, h as resolveApiReferenceConfig, i as resolvePromptProviderChoices, l as buildApiReferenceHtmlDocument, m as buildApiReferenceScalarCss, n as normalizePromptProviderName, o as serializeDocsIcon, p as buildApiReferencePageTitle, r as parsePromptStringArray, s as serializeDocsIconRegistry, t as DEFAULT_PROMPT_PROVIDER_TEMPLATES, u as buildApiReferenceHtmlDocumentAsync } from "./prompt-utils-CbtKaiIU.mjs";
|
|
3
3
|
import { createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, normalizeDocsMcpRoute, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
4
4
|
|
|
5
|
-
export { buildApiReferenceHtmlDocument, buildApiReferenceHtmlDocumentAsync, buildApiReferenceOpenApiDocument, buildApiReferenceOpenApiDocumentAsync, buildApiReferencePageTitle, buildApiReferenceScalarCss, buildDocsSearchDocuments, createAlgoliaSearchAdapter, createCustomSearchAdapter, createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, createMcpSearchAdapter, createSimpleSearchAdapter, createTypesenseSearchAdapter, normalizeDocsMcpRoute, performDocsSearch, resolveApiReferenceConfig, resolveApiReferenceRenderer, resolveDocsMcpConfig, resolveSearchRequestConfig, runDocsMcpStdio };
|
|
5
|
+
export { DEFAULT_PROMPT_PROVIDER_TEMPLATES, buildApiReferenceHtmlDocument, buildApiReferenceHtmlDocumentAsync, buildApiReferenceOpenApiDocument, buildApiReferenceOpenApiDocumentAsync, buildApiReferencePageTitle, buildApiReferenceScalarCss, buildDocsSearchDocuments, createAlgoliaSearchAdapter, createCustomSearchAdapter, createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, createMcpSearchAdapter, createSimpleSearchAdapter, createTypesenseSearchAdapter, normalizeDocsMcpRoute, normalizePromptProviderName, parsePromptStringArray, performDocsSearch, resolveApiReferenceConfig, resolveApiReferenceRenderer, resolveDocsMcpConfig, resolvePromptProviderChoices, resolveSearchRequestConfig, runDocsMcpStdio, sanitizePromptText, serializeDocsIcon, serializeDocsIconRegistry, serializeOpenDocsProviders };
|
|
@@ -174,7 +174,7 @@ interface UIConfig {
|
|
|
174
174
|
/** Whether cards have visible borders @default true */bordered?: boolean; /** Card background color override */
|
|
175
175
|
background?: string;
|
|
176
176
|
};
|
|
177
|
-
/** Default props/variants for built-in MDX components (Callout, CodeBlock, Tabs, HoverLink, etc.) */
|
|
177
|
+
/** Default props/variants for built-in MDX components (Callout, CodeBlock, Tabs, HoverLink, Prompt, etc.) */
|
|
178
178
|
components?: {
|
|
179
179
|
[key: string]: Record<string, unknown> | ((defaults: unknown) => unknown);
|
|
180
180
|
};
|
|
@@ -522,7 +522,12 @@ interface SidebarConfig {
|
|
|
522
522
|
*
|
|
523
523
|
* @example
|
|
524
524
|
* ```ts
|
|
525
|
-
* {
|
|
525
|
+
* {
|
|
526
|
+
* name: "Claude",
|
|
527
|
+
* icon: <ClaudeIcon />,
|
|
528
|
+
* urlTemplate: "https://claude.ai?url={url}",
|
|
529
|
+
* promptUrlTemplate: "https://claude.ai/new?q={prompt}",
|
|
530
|
+
* }
|
|
526
531
|
* ```
|
|
527
532
|
*/
|
|
528
533
|
interface OpenDocsProvider {
|
|
@@ -540,6 +545,17 @@ interface OpenDocsProvider {
|
|
|
540
545
|
* @example "{githubUrl}" — open current page file on GitHub (edit view)
|
|
541
546
|
*/
|
|
542
547
|
urlTemplate: string;
|
|
548
|
+
/**
|
|
549
|
+
* Optional URL template used by the built-in `Prompt` MDX component.
|
|
550
|
+
* When omitted, known providers such as ChatGPT, Claude, Cursor, Gemini,
|
|
551
|
+
* and Copilot fall back to a built-in `{prompt}` template by provider name.
|
|
552
|
+
*
|
|
553
|
+
* Placeholders:
|
|
554
|
+
* - `{prompt}` — prompt text (encoded).
|
|
555
|
+
*
|
|
556
|
+
* @example "https://cursor.com/link/prompt?text={prompt}"
|
|
557
|
+
*/
|
|
558
|
+
promptUrlTemplate?: string;
|
|
543
559
|
}
|
|
544
560
|
/**
|
|
545
561
|
* Configuration for the "Open in …" dropdown that lets users
|
|
@@ -1742,10 +1758,12 @@ interface DocsConfig {
|
|
|
1742
1758
|
*/
|
|
1743
1759
|
mcp?: boolean | DocsMcpConfig;
|
|
1744
1760
|
/**
|
|
1745
|
-
*
|
|
1761
|
+
* Shared icon registry for sidebar items and built-in MDX components.
|
|
1746
1762
|
*
|
|
1747
1763
|
* Map string labels to React elements. Reference them in page frontmatter
|
|
1748
1764
|
* with `icon: "label"` and the matching icon renders in the sidebar.
|
|
1765
|
+
* Built-in components such as `Prompt` can also reference these keys for
|
|
1766
|
+
* their card and action icons.
|
|
1749
1767
|
*
|
|
1750
1768
|
* @example
|
|
1751
1769
|
* ```tsx
|