@farming-labs/docs 0.1.58 → 0.1.60
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-BQCfaA1j.mjs} +1 -1
- package/dist/cli/index.mjs +26 -8
- package/dist/dev-VD41gGZC.mjs +1289 -0
- package/dist/{doctor-k6ouCFXp.mjs → doctor-DraU0BVq.mjs} +3 -3
- package/dist/index.d.mts +2 -2
- package/dist/init-CcgI3D7-.mjs +1162 -0
- package/dist/{mcp-C-TmMrdw.mjs → mcp-BANLcwQ0.mjs} +1 -1
- package/dist/mcp.d.mts +1 -1
- package/dist/{api-reference-GDAEzQn1.mjs → prompt-utils-8nmFLQVH.mjs} +180 -7
- package/dist/{search-C7mKYgqQ.mjs → search-CLoh315v.mjs} +1 -1
- package/dist/{search-B6aum8AJ.d.mts → search-COePaQmH.d.mts} +1 -1
- package/dist/server.d.mts +26 -3
- package/dist/server.mjs +2 -2
- package/dist/{init-C1tsFxXo.mjs → templates-2M1vfnf-.mjs} +5 -1164
- package/dist/{types-ClMUaY9I.d.mts → types-G-xf-4_c.d.mts} +21 -3
- package/dist/{upgrade-a185_G5A.mjs → upgrade-CA_OE7wL.mjs} +1 -1
- package/package.json +1 -1
- /package/dist/{utils-CpTFbAiS.mjs → utils-DSMXVnEu.mjs} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./
|
|
1
|
+
import "./prompt-utils-8nmFLQVH.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-G-xf-4_c.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";
|
|
@@ -60,6 +61,9 @@ function normalizeRemoteSpecUrl(value) {
|
|
|
60
61
|
if (!trimmed) return void 0;
|
|
61
62
|
return trimmed;
|
|
62
63
|
}
|
|
64
|
+
function isRequestRelativeSpecUrl(value) {
|
|
65
|
+
return typeof value === "string" && value.startsWith("/");
|
|
66
|
+
}
|
|
63
67
|
function buildApiReferencePageTitle(config, title = "API Reference") {
|
|
64
68
|
const template = config.metadata?.titleTemplate;
|
|
65
69
|
if (!template) return title;
|
|
@@ -425,18 +429,18 @@ function relativeLuminance([r, g, b]) {
|
|
|
425
429
|
function buildApiReferenceOpenApiDocument(config, options) {
|
|
426
430
|
if (resolveApiReferenceConfig(config.apiReference).specUrl) return buildUnavailableOpenApiDocument(config, `Remote OpenAPI specs require the async API reference builder. Use the framework route helper or buildApiReferenceOpenApiDocumentAsync().`);
|
|
427
431
|
const routes = buildApiReferenceRoutes(config, options);
|
|
428
|
-
return buildOpenApiDocumentFromRoutes(config, options.framework, routes);
|
|
432
|
+
return buildOpenApiDocumentFromRoutes(config, options.framework, routes, options.baseUrl);
|
|
429
433
|
}
|
|
430
434
|
async function buildApiReferenceOpenApiDocumentAsync(config, options) {
|
|
431
435
|
const apiReference = resolveApiReferenceConfig(config.apiReference);
|
|
432
436
|
if (!apiReference.specUrl) return buildApiReferenceOpenApiDocument(config, options);
|
|
433
437
|
try {
|
|
434
|
-
return normalizeRemoteOpenApiDocument(await fetchRemoteOpenApiDocument(apiReference.specUrl, options.baseUrl), config);
|
|
438
|
+
return normalizeRemoteOpenApiDocument(await fetchRemoteOpenApiDocument(apiReference.specUrl, options.baseUrl), config, options.baseUrl);
|
|
435
439
|
} catch (error) {
|
|
436
440
|
return buildUnavailableOpenApiDocument(config, `Unable to load the remote OpenAPI JSON. ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
437
441
|
}
|
|
438
442
|
}
|
|
439
|
-
function buildOpenApiDocumentFromRoutes(config, framework, routes) {
|
|
443
|
+
function buildOpenApiDocumentFromRoutes(config, framework, routes, baseUrl) {
|
|
440
444
|
const tags = Array.from(new Set(routes.map((route) => route.tag))).map((name) => ({
|
|
441
445
|
name,
|
|
442
446
|
description: `${name} endpoints`
|
|
@@ -448,7 +452,7 @@ function buildOpenApiDocumentFromRoutes(config, framework, routes) {
|
|
|
448
452
|
description: config.metadata?.description ?? `Generated API reference for ${framework}.`,
|
|
449
453
|
version: "0.0.0"
|
|
450
454
|
},
|
|
451
|
-
servers: [{ url: "/" }],
|
|
455
|
+
servers: [{ url: baseUrl ?? "/" }],
|
|
452
456
|
tags,
|
|
453
457
|
paths: buildOpenApiPaths(routes)
|
|
454
458
|
};
|
|
@@ -503,8 +507,12 @@ async function fetchRemoteOpenApiDocument(specUrl, baseUrl) {
|
|
|
503
507
|
if (!("openapi" in parsed) && !("swagger" in parsed)) throw new Error("The remote JSON does not look like an OpenAPI document.");
|
|
504
508
|
return parsed;
|
|
505
509
|
}
|
|
506
|
-
function normalizeRemoteOpenApiDocument(document, config) {
|
|
510
|
+
function normalizeRemoteOpenApiDocument(document, config, baseUrl) {
|
|
511
|
+
const apiReference = resolveApiReferenceConfig(config.apiReference);
|
|
507
512
|
const info = document.info && typeof document.info === "object" && !Array.isArray(document.info) ? document.info : {};
|
|
513
|
+
const normalizedPaths = normalizeRemoteOpenApiPaths(document.paths);
|
|
514
|
+
const normalizedTags = normalizeRemoteOpenApiTags(document.tags, normalizedPaths);
|
|
515
|
+
const normalizedServers = isRequestRelativeSpecUrl(apiReference.specUrl) ? [{ url: baseUrl ?? "/" }] : document.servers;
|
|
508
516
|
return {
|
|
509
517
|
...document,
|
|
510
518
|
info: {
|
|
@@ -512,9 +520,78 @@ function normalizeRemoteOpenApiDocument(document, config) {
|
|
|
512
520
|
version: "0.0.0",
|
|
513
521
|
...info,
|
|
514
522
|
description: typeof info.description === "string" && info.description.trim() ? info.description : config.metadata?.description
|
|
515
|
-
}
|
|
523
|
+
},
|
|
524
|
+
servers: normalizedServers,
|
|
525
|
+
paths: normalizedPaths,
|
|
526
|
+
tags: normalizedTags
|
|
516
527
|
};
|
|
517
528
|
}
|
|
529
|
+
function normalizeRemoteOpenApiPaths(value) {
|
|
530
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return;
|
|
531
|
+
const paths = value;
|
|
532
|
+
const normalized = {};
|
|
533
|
+
for (const [routePath, pathItem] of Object.entries(paths)) {
|
|
534
|
+
if (!pathItem || typeof pathItem !== "object" || Array.isArray(pathItem)) continue;
|
|
535
|
+
const normalizedPathItem = { ...pathItem };
|
|
536
|
+
for (const method of [
|
|
537
|
+
"get",
|
|
538
|
+
"post",
|
|
539
|
+
"put",
|
|
540
|
+
"patch",
|
|
541
|
+
"delete",
|
|
542
|
+
"options",
|
|
543
|
+
"head"
|
|
544
|
+
]) {
|
|
545
|
+
const operation = normalizedPathItem[method];
|
|
546
|
+
if (!operation || typeof operation !== "object" || Array.isArray(operation)) continue;
|
|
547
|
+
const operationRecord = operation;
|
|
548
|
+
const tags = Array.isArray(operationRecord.tags) ? operationRecord.tags.filter((tag) => typeof tag === "string" && tag.trim().length > 0) : [];
|
|
549
|
+
normalizedPathItem[method] = {
|
|
550
|
+
...operationRecord,
|
|
551
|
+
tags: tags.length > 0 ? tags : [inferRemoteOpenApiTag(routePath)]
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
normalized[routePath] = normalizedPathItem;
|
|
555
|
+
}
|
|
556
|
+
return normalized;
|
|
557
|
+
}
|
|
558
|
+
function inferRemoteOpenApiTag(routePath) {
|
|
559
|
+
return humanizeSegment(routePath.split("/").filter(Boolean).find((value) => !value.startsWith("{")) ?? "general");
|
|
560
|
+
}
|
|
561
|
+
function normalizeRemoteOpenApiTags(value, paths) {
|
|
562
|
+
const existingTags = Array.isArray(value) ? value.filter((tag) => !!tag && typeof tag === "object") : [];
|
|
563
|
+
const tagsByName = /* @__PURE__ */ new Map();
|
|
564
|
+
for (const tag of existingTags) {
|
|
565
|
+
const name = typeof tag.name === "string" && tag.name.trim() ? tag.name.trim() : void 0;
|
|
566
|
+
if (!name) continue;
|
|
567
|
+
tagsByName.set(name, tag);
|
|
568
|
+
}
|
|
569
|
+
if (paths) for (const pathItem of Object.values(paths)) for (const method of [
|
|
570
|
+
"get",
|
|
571
|
+
"post",
|
|
572
|
+
"put",
|
|
573
|
+
"patch",
|
|
574
|
+
"delete",
|
|
575
|
+
"options",
|
|
576
|
+
"head"
|
|
577
|
+
]) {
|
|
578
|
+
const operation = pathItem[method];
|
|
579
|
+
if (!operation || typeof operation !== "object" || Array.isArray(operation)) continue;
|
|
580
|
+
const tags = Array.isArray(operation.tags) ? operation.tags : [];
|
|
581
|
+
for (const tag of tags) {
|
|
582
|
+
if (typeof tag !== "string" || !tag.trim()) continue;
|
|
583
|
+
if (!tagsByName.has(tag)) tagsByName.set(tag, {
|
|
584
|
+
name: tag,
|
|
585
|
+
description: `${tag} endpoints`
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
if (tagsByName.size === 0) return [{
|
|
590
|
+
name: "General",
|
|
591
|
+
description: "General endpoints"
|
|
592
|
+
}];
|
|
593
|
+
return Array.from(tagsByName.values());
|
|
594
|
+
}
|
|
518
595
|
function buildUnavailableOpenApiDocument(config, description) {
|
|
519
596
|
return {
|
|
520
597
|
openapi: "3.1.0",
|
|
@@ -810,4 +887,100 @@ function humanizeSegment(value) {
|
|
|
810
887
|
}
|
|
811
888
|
|
|
812
889
|
//#endregion
|
|
813
|
-
|
|
890
|
+
//#region src/prompt-utils.ts
|
|
891
|
+
const require = createRequire(import.meta.url);
|
|
892
|
+
const DEFAULT_PROMPT_PROVIDER_TEMPLATES = {
|
|
893
|
+
chatgpt: "https://chatgpt.com/?q={prompt}",
|
|
894
|
+
claude: "https://claude.ai/new?q={prompt}",
|
|
895
|
+
cursor: "https://cursor.com/link/prompt?text={prompt}",
|
|
896
|
+
gemini: "https://gemini.google.com/app?q={prompt}",
|
|
897
|
+
copilot: "https://github.com/copilot?prompt={prompt}"
|
|
898
|
+
};
|
|
899
|
+
function normalizePromptProviderName(name) {
|
|
900
|
+
return name.trim().toLowerCase();
|
|
901
|
+
}
|
|
902
|
+
function serializeDocsIcon(icon) {
|
|
903
|
+
if (!icon) return void 0;
|
|
904
|
+
if (typeof icon === "string") return icon;
|
|
905
|
+
try {
|
|
906
|
+
const { renderToStaticMarkup } = require("react-dom/server");
|
|
907
|
+
return renderToStaticMarkup(icon);
|
|
908
|
+
} catch {
|
|
909
|
+
return;
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
function serializeDocsIconRegistry(icons) {
|
|
913
|
+
if (!icons) return void 0;
|
|
914
|
+
const entries = Object.entries(icons).map(([name, icon]) => [name, serializeDocsIcon(icon)]).filter((entry) => typeof entry[1] === "string");
|
|
915
|
+
return entries.length > 0 ? Object.fromEntries(entries) : void 0;
|
|
916
|
+
}
|
|
917
|
+
function serializeOpenDocsProviders(providers) {
|
|
918
|
+
if (!providers || providers.length === 0) return void 0;
|
|
919
|
+
return providers.map((provider) => ({
|
|
920
|
+
name: provider.name,
|
|
921
|
+
urlTemplate: provider.urlTemplate,
|
|
922
|
+
promptUrlTemplate: provider.promptUrlTemplate,
|
|
923
|
+
iconHtml: serializeDocsIcon(provider.icon)
|
|
924
|
+
}));
|
|
925
|
+
}
|
|
926
|
+
function parsePromptStringArray(value) {
|
|
927
|
+
if (Array.isArray(value)) {
|
|
928
|
+
const normalized = value.filter((entry) => typeof entry === "string").map((entry) => entry.trim()).filter(Boolean);
|
|
929
|
+
return normalized.length > 0 ? normalized : void 0;
|
|
930
|
+
}
|
|
931
|
+
if (typeof value !== "string") return void 0;
|
|
932
|
+
const trimmed = value.trim();
|
|
933
|
+
if (!trimmed) return void 0;
|
|
934
|
+
if (trimmed.startsWith("[") && trimmed.endsWith("]")) {
|
|
935
|
+
const inner = trimmed.slice(1, -1).trim();
|
|
936
|
+
if (!inner) return void 0;
|
|
937
|
+
const normalized = inner.split(",").map((entry) => entry.trim().replace(/^['"]|['"]$/g, "")).filter(Boolean);
|
|
938
|
+
return normalized.length > 0 ? normalized : void 0;
|
|
939
|
+
}
|
|
940
|
+
const normalized = trimmed.split(",").map((entry) => entry.trim()).filter(Boolean);
|
|
941
|
+
return normalized.length > 0 ? normalized : void 0;
|
|
942
|
+
}
|
|
943
|
+
function resolvePromptProviderChoices(availableProviders, preferredNames) {
|
|
944
|
+
const configuredByName = new Map((availableProviders ?? []).map((provider) => [normalizePromptProviderName(provider.name), provider]));
|
|
945
|
+
const names = preferredNames && preferredNames.length > 0 ? preferredNames : (availableProviders ?? []).map((provider) => provider.name);
|
|
946
|
+
const seen = /* @__PURE__ */ new Set();
|
|
947
|
+
const resolved = [];
|
|
948
|
+
for (const rawName of names) {
|
|
949
|
+
const name = rawName.trim();
|
|
950
|
+
if (!name) continue;
|
|
951
|
+
const normalized = normalizePromptProviderName(name);
|
|
952
|
+
if (seen.has(normalized)) continue;
|
|
953
|
+
seen.add(normalized);
|
|
954
|
+
const configured = configuredByName.get(normalized);
|
|
955
|
+
const template = configured?.promptUrlTemplate ?? configured?.urlTemplate ?? DEFAULT_PROMPT_PROVIDER_TEMPLATES[normalized];
|
|
956
|
+
if (!template) continue;
|
|
957
|
+
resolved.push({
|
|
958
|
+
name: configured?.name ?? name,
|
|
959
|
+
iconHtml: configured?.iconHtml,
|
|
960
|
+
urlTemplate: template
|
|
961
|
+
});
|
|
962
|
+
}
|
|
963
|
+
return resolved;
|
|
964
|
+
}
|
|
965
|
+
function sanitizePromptText(text) {
|
|
966
|
+
const lines = text.replace(/\r\n/g, "\n").replace(/\n{3,}/g, "\n\n").replace(/[ \t]+\n/g, "\n").trim().split("\n");
|
|
967
|
+
const normalized = [];
|
|
968
|
+
for (let index = 0; index < lines.length; index += 1) {
|
|
969
|
+
const current = lines[index] ?? "";
|
|
970
|
+
const previous = normalized[normalized.length - 1] ?? "";
|
|
971
|
+
let nextNonEmpty = "";
|
|
972
|
+
for (let cursor = index + 1; cursor < lines.length; cursor += 1) {
|
|
973
|
+
const candidate = lines[cursor]?.trim() ?? "";
|
|
974
|
+
if (candidate) {
|
|
975
|
+
nextNonEmpty = candidate;
|
|
976
|
+
break;
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
if (current.trim() === "" && previous.trim().startsWith("- ") && nextNonEmpty.startsWith("- ")) continue;
|
|
980
|
+
normalized.push(current);
|
|
981
|
+
}
|
|
982
|
+
return normalized.join("\n");
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
//#endregion
|
|
986
|
+
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-8nmFLQVH.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-G-xf-4_c.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-G-xf-4_c.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-COePaQmH.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-8nmFLQVH.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 };
|