@farming-labs/docs 0.2.59 → 0.2.61
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/README.md +1 -1
- package/dist/{agent-DlxriaTs.mjs → agent-DFHlw_JC.mjs} +3 -3
- package/dist/{agent-BFqyqEnC.mjs → agent-Fl0pjVNF.mjs} +136 -331
- package/dist/{agent-evals-kJs2Y9xR.mjs → agent-evals-f4_OL10T.mjs} +3 -3
- package/dist/{agent-export-BgUaiW8f.mjs → agent-export-D0zQhasD.mjs} +87 -46
- package/dist/agent-skills-bundle.d.mts +13 -0
- package/dist/agent-skills-bundle.mjs +12 -0
- package/dist/agent-skills-server-CIeBszxp.mjs +263 -0
- package/dist/agent-skills-server-CKq3_jMj.d.mts +12 -0
- package/dist/agent-skills-vite.d.mts +31 -0
- package/dist/agent-skills-vite.mjs +70 -0
- package/dist/{agents-Djh-HXih.mjs → agents-ibnXrWyp.mjs} +9 -7
- package/dist/cli/index.mjs +32 -30
- package/dist/client/react.d.mts +1 -1
- package/dist/{cloud-ask-ai-B2WnG4fF.d.mts → cloud-ask-ai-D7ZgF47y.d.mts} +1 -1
- package/dist/{cloud-BH_sHX64.mjs → cloud-pdNC-tyj.mjs} +3 -3
- package/dist/{codeblocks-Bq67u32v.mjs → codeblocks-CFuurVIH.mjs} +2 -2
- package/dist/{config-DASewQ0x.mjs → config-Wcdj-D0a.mjs} +7 -1
- package/dist/{dev-CAQlbguk.mjs → dev-Cmy6DtdF.mjs} +2 -2
- package/dist/docs-cloud-server.d.mts +2 -2
- package/dist/docs-cloud-server.mjs +1 -1
- package/dist/{doctor-CO1VMcF_.mjs → doctor-CXostbsI.mjs} +151 -21
- package/dist/{downgrade-BZs86NVr.mjs → downgrade-w7e6Se0L.mjs} +2 -2
- package/dist/{golden-evaluations-BN9u2wxw.mjs → golden-evaluations-CBZ_JZjf.mjs} +19 -4
- package/dist/index.d.mts +52 -10
- package/dist/index.mjs +8 -7
- package/dist/{init-B_9ENq8Z.mjs → init-CQY0Woe3.mjs} +36 -5
- package/dist/mcp-DyPcoLwm.mjs +156 -0
- package/dist/mcp.d.mts +13 -2
- package/dist/mcp.mjs +699 -408
- package/dist/{metadata-BDuewuzq.mjs → metadata-Dv1ah0Aj.mjs} +1 -1
- package/dist/{package-version-qik_4J6C.mjs → package-version-n5AFur8a.mjs} +1 -1
- package/dist/{reading-time-BkEft6SD.mjs → reading-time-C-SAhQT9.mjs} +10 -9
- package/dist/{review-NC-sOdXn.mjs → review-D2UBrxFq.mjs} +18 -10
- package/dist/{robots-DskPvGPw.mjs → robots-5Yqz9mz7.mjs} +5 -4
- package/dist/{robots-ltltiLJF.mjs → robots-C08kDLsz.mjs} +6 -2
- package/dist/{search-D57JXQLj.mjs → search-9OnMGMvt.mjs} +1 -1
- package/dist/{search-C1JitPwi.d.mts → search-C6heDO8h.d.mts} +3 -126
- package/dist/{search-o4Ud6OXv.mjs → search-CNsRpz90.mjs} +8 -6
- package/dist/server.d.mts +6 -5
- package/dist/server.mjs +9 -7
- package/dist/{sitemap-Cq-Yj_iA.mjs → sitemap-BpYnSsfJ.mjs} +9 -7
- package/dist/{sitemap-server-C1ibVKOy.mjs → sitemap-server-D_0Kzanj.mjs} +1 -1
- package/dist/standards-discovery-C4HUqMd2.d.mts +227 -0
- package/dist/standards-discovery-C54V_aJH.mjs +510 -0
- package/dist/{templates-CfQjpDWW.mjs → templates-Bq_P7ctv.mjs} +102 -9
- package/dist/{types-XHABMh_f.d.mts → types-EhFhYGfr.d.mts} +58 -1
- package/dist/{upgrade-BCJTCW3O.mjs → upgrade-oz-GChgt.mjs} +2 -2
- package/package.json +11 -1
- package/dist/mcp-BAJr3wC2.mjs +0 -104
- /package/dist/{agent-scope-CCaIY1aK.mjs → agent-scope-C_U--OZ7.mjs} +0 -0
- /package/dist/{cloud-ask-ai-hnJfj8-X.mjs → cloud-ask-ai-sbpjOR2K.mjs} +0 -0
- /package/dist/{code-blocks-qe0T8-xe.mjs → code-blocks-DnNVNK2M.mjs} +0 -0
- /package/dist/{errors-CVqZ3kOO.mjs → errors-DbOhkE1h.mjs} +0 -0
- /package/dist/{i18n-CAlj1ADU.mjs → i18n-CCaFUnAN.mjs} +0 -0
- /package/dist/{utils-6UCLxv4B.mjs → utils-DpiIioYb.mjs} +0 -0
|
@@ -752,11 +752,13 @@ export default defineDocs({
|
|
|
752
752
|
function tanstackDocsServerTemplate() {
|
|
753
753
|
return `\
|
|
754
754
|
import { createDocsServer } from "@farming-labs/tanstack-start/server";
|
|
755
|
+
import { bundledAgentSkills } from "@farming-labs/docs/agent-skills-bundle";
|
|
755
756
|
import docsConfig from "../../docs.config";
|
|
756
757
|
|
|
757
758
|
export const docsServer = createDocsServer({
|
|
758
759
|
...docsConfig,
|
|
759
760
|
rootDir: process.cwd(),
|
|
761
|
+
_preloadedAgentSkills: bundledAgentSkills,
|
|
760
762
|
});
|
|
761
763
|
`;
|
|
762
764
|
}
|
|
@@ -886,6 +888,7 @@ function tanstackDocsPublicRouteTemplate(useAlias, filePath, entry) {
|
|
|
886
888
|
import { createFileRoute } from "@tanstack/react-router";
|
|
887
889
|
import { isDocsMcpRequest, isDocsPublicGetRequest } from "@farming-labs/docs";
|
|
888
890
|
import { docsServer } from "${useAlias ? "@/lib/docs.server" : relativeImport(filePath, "src/lib/docs.server.ts")}";
|
|
891
|
+
import docsConfig from "${tanstackDocsConfigImport(filePath)}";
|
|
889
892
|
|
|
890
893
|
const docsEntry = ${JSON.stringify(entry)};
|
|
891
894
|
|
|
@@ -893,7 +896,7 @@ async function handlePublicDocsRequest(request: Request) {
|
|
|
893
896
|
const url = new URL(request.url);
|
|
894
897
|
const method = request.method.toUpperCase();
|
|
895
898
|
|
|
896
|
-
if (isDocsMcpRequest(url)) {
|
|
899
|
+
if (isDocsMcpRequest(url, docsConfig.mcp)) {
|
|
897
900
|
if (method === "OPTIONS") return docsServer.MCP.OPTIONS({ request });
|
|
898
901
|
if (method === "POST") return docsServer.MCP.POST({ request });
|
|
899
902
|
if (method === "DELETE") return docsServer.MCP.DELETE({ request });
|
|
@@ -989,22 +992,55 @@ function tanstackViteConfigTemplate(useAlias) {
|
|
|
989
992
|
import { defineConfig } from "vite";
|
|
990
993
|
import tailwindcss from "@tailwindcss/vite";
|
|
991
994
|
${useAlias ? "import tsconfigPaths from \"vite-tsconfig-paths\";\n" : ""}import { tanstackStart } from "@tanstack/react-start/plugin/vite";
|
|
995
|
+
import { docsAgentSkills } from "@farming-labs/docs/vite";
|
|
992
996
|
import { docsMdx } from "@farming-labs/tanstack-start/vite";
|
|
997
|
+
import docsConfig from "./docs.config";
|
|
993
998
|
|
|
994
999
|
export default defineConfig({
|
|
995
|
-
plugins: [tailwindcss(), docsMdx(), ${useAlias ? "tsconfigPaths({ ignoreConfigErrors: true }), " : ""}tanstackStart()],
|
|
1000
|
+
plugins: [tailwindcss(), docsMdx(), docsAgentSkills(docsConfig), ${useAlias ? "tsconfigPaths({ ignoreConfigErrors: true }), " : ""}tanstackStart()],
|
|
996
1001
|
});
|
|
997
1002
|
`;
|
|
998
1003
|
}
|
|
1004
|
+
function svelteViteConfigTemplate() {
|
|
1005
|
+
return `\
|
|
1006
|
+
import { sveltekit } from "@sveltejs/kit/vite";
|
|
1007
|
+
import { defineConfig } from "vite";
|
|
1008
|
+
import { docsAgentSkills } from "@farming-labs/docs/vite";
|
|
1009
|
+
import docsConfig from "./src/lib/docs.config";
|
|
1010
|
+
|
|
1011
|
+
export default defineConfig({
|
|
1012
|
+
plugins: [sveltekit(), docsAgentSkills(docsConfig)],
|
|
1013
|
+
});
|
|
1014
|
+
`;
|
|
1015
|
+
}
|
|
1016
|
+
/** Add the Agent Skills snapshot plugin to an existing Vite config. */
|
|
1017
|
+
function injectDocsAgentSkillsVitePlugin(content, configImportPath) {
|
|
1018
|
+
if (!content) return null;
|
|
1019
|
+
let out = addImportLine(content, "import { docsAgentSkills } from \"@farming-labs/docs/vite\";");
|
|
1020
|
+
out = addImportLine(out, `import docsConfig from ${JSON.stringify(configImportPath)};`);
|
|
1021
|
+
if (out.includes("docsAgentSkills(docsConfig)")) return out === content ? null : out;
|
|
1022
|
+
const pluginsMatch = out.match(/plugins\s*:\s*\[([\s\S]*?)\]/m);
|
|
1023
|
+
if (pluginsMatch) {
|
|
1024
|
+
const current = pluginsMatch[1].trim();
|
|
1025
|
+
const existing = current ? `${current}${current.endsWith(",") ? "" : ","}` : "";
|
|
1026
|
+
return out.replace(pluginsMatch[0], `plugins: [${existing}${existing ? " " : ""}docsAgentSkills(docsConfig)]`);
|
|
1027
|
+
}
|
|
1028
|
+
const configMatch = out.match(/defineConfig\(\s*\{/);
|
|
1029
|
+
if (!configMatch) return null;
|
|
1030
|
+
return out.replace(configMatch[0], "defineConfig({\n plugins: [docsAgentSkills(docsConfig)],");
|
|
1031
|
+
}
|
|
999
1032
|
function injectTanstackVitePlugins(content, useAlias) {
|
|
1000
1033
|
if (!content) return null;
|
|
1001
1034
|
let out = content;
|
|
1002
1035
|
out = addImportLine(out, "import tailwindcss from \"@tailwindcss/vite\";");
|
|
1003
1036
|
if (useAlias) out = addImportLine(out, "import tsconfigPaths from \"vite-tsconfig-paths\";");
|
|
1004
1037
|
out = addImportLine(out, "import { docsMdx } from \"@farming-labs/tanstack-start/vite\";");
|
|
1038
|
+
out = addImportLine(out, "import { docsAgentSkills } from \"@farming-labs/docs/vite\";");
|
|
1039
|
+
out = addImportLine(out, "import docsConfig from \"./docs.config\";");
|
|
1005
1040
|
const additions = [];
|
|
1006
1041
|
if (!out.includes("tailwindcss()")) additions.push("tailwindcss()");
|
|
1007
1042
|
if (!out.includes("docsMdx()")) additions.push("docsMdx()");
|
|
1043
|
+
if (!out.includes("docsAgentSkills(")) additions.push("docsAgentSkills(docsConfig)");
|
|
1008
1044
|
if (useAlias && !out.includes("tsconfigPaths(")) additions.push("tsconfigPaths({ ignoreConfigErrors: true })");
|
|
1009
1045
|
if (additions.length === 0) return out === content ? null : out;
|
|
1010
1046
|
const pluginsMatch = out.match(/plugins\s*:\s*\[([\s\S]*?)\]/m);
|
|
@@ -1242,6 +1278,7 @@ export default defineDocs({
|
|
|
1242
1278
|
function svelteDocsServerTemplate(cfg) {
|
|
1243
1279
|
return `\
|
|
1244
1280
|
import { createDocsServer } from "@farming-labs/svelte/server";
|
|
1281
|
+
import { bundledAgentSkills } from "@farming-labs/docs/agent-skills-bundle";
|
|
1245
1282
|
import config from "${svelteServerConfigImport(cfg.useAlias)}";
|
|
1246
1283
|
|
|
1247
1284
|
// preload for production
|
|
@@ -1254,6 +1291,7 @@ const contentFiles = import.meta.glob(["/${cfg.entry ?? "docs"}/**/*.{md,mdx,svx
|
|
|
1254
1291
|
export const { load, GET, POST, MCP } = createDocsServer({
|
|
1255
1292
|
...config,
|
|
1256
1293
|
_preloadedContent: contentFiles,
|
|
1294
|
+
_preloadedAgentSkills: bundledAgentSkills,
|
|
1257
1295
|
});
|
|
1258
1296
|
`;
|
|
1259
1297
|
}
|
|
@@ -1314,7 +1352,7 @@ const docsEntry = config.entry ?? "docs";
|
|
|
1314
1352
|
export const handle: Handle = async ({ event, resolve }) => {
|
|
1315
1353
|
const method = event.request.method.toUpperCase();
|
|
1316
1354
|
|
|
1317
|
-
if (isDocsMcpRequest(event.url)) {
|
|
1355
|
+
if (isDocsMcpRequest(event.url, config.mcp)) {
|
|
1318
1356
|
if (method === "OPTIONS") return MCP.OPTIONS({ request: event.request });
|
|
1319
1357
|
if (method === "POST") return MCP.POST({ request: event.request });
|
|
1320
1358
|
if (method === "DELETE") return MCP.DELETE({ request: event.request });
|
|
@@ -1368,7 +1406,7 @@ const docsEntry = docsConfig.entry ?? "docs";
|
|
|
1368
1406
|
const docsPublicHandle: Handle = async ({ event, resolve }) => {
|
|
1369
1407
|
const method = event.request.method.toUpperCase();
|
|
1370
1408
|
|
|
1371
|
-
if (isDocsMcpRequest(event.url)) {
|
|
1409
|
+
if (isDocsMcpRequest(event.url, docsConfig.mcp)) {
|
|
1372
1410
|
if (method === "OPTIONS") return docsMCP.OPTIONS({ request: event.request });
|
|
1373
1411
|
if (method === "POST") return docsMCP.POST({ request: event.request });
|
|
1374
1412
|
if (method === "DELETE") return docsMCP.DELETE({ request: event.request });
|
|
@@ -1659,6 +1697,7 @@ export default defineDocs({
|
|
|
1659
1697
|
function astroDocsServerTemplate(cfg) {
|
|
1660
1698
|
return `\
|
|
1661
1699
|
import { createDocsServer } from "@farming-labs/astro/server";
|
|
1700
|
+
import { bundledAgentSkills } from "@farming-labs/docs/agent-skills-bundle";
|
|
1662
1701
|
import config from "${astroServerConfigImport(cfg.useAlias)}";
|
|
1663
1702
|
|
|
1664
1703
|
const contentFiles = import.meta.glob(["/${cfg.entry ?? "docs"}/**/*.{md,mdx}", "/AGENTS.md", "/AGENT.md", "/skill.md", "/.farming-labs/sitemap-manifest.json"], {
|
|
@@ -1670,6 +1709,7 @@ const contentFiles = import.meta.glob(["/${cfg.entry ?? "docs"}/**/*.{md,mdx}",
|
|
|
1670
1709
|
export const { load, GET, POST, MCP } = createDocsServer({
|
|
1671
1710
|
...config,
|
|
1672
1711
|
_preloadedContent: contentFiles,
|
|
1712
|
+
_preloadedAgentSkills: bundledAgentSkills,
|
|
1673
1713
|
});
|
|
1674
1714
|
`;
|
|
1675
1715
|
}
|
|
@@ -1700,13 +1740,34 @@ function astroConfigTemplate(adapter = "vercel") {
|
|
|
1700
1740
|
return `\
|
|
1701
1741
|
import { defineConfig } from "astro/config";
|
|
1702
1742
|
import ${adapter} from "${info.import}";
|
|
1743
|
+
import { docsAgentSkills } from "@farming-labs/docs/vite";
|
|
1744
|
+
import docsConfig from "./src/lib/docs.config";
|
|
1703
1745
|
|
|
1704
1746
|
export default defineConfig({
|
|
1705
1747
|
output: "server",
|
|
1706
1748
|
adapter: ${adapterCall},
|
|
1749
|
+
vite: { plugins: [docsAgentSkills(docsConfig)] },
|
|
1707
1750
|
});
|
|
1708
1751
|
`;
|
|
1709
1752
|
}
|
|
1753
|
+
/** Add the Agent Skills snapshot plugin to an existing Astro config. */
|
|
1754
|
+
function injectAstroAgentSkillsPlugin(content) {
|
|
1755
|
+
if (!content) return null;
|
|
1756
|
+
let out = addImportLine(content, "import { docsAgentSkills } from \"@farming-labs/docs/vite\";");
|
|
1757
|
+
out = addImportLine(out, "import docsConfig from \"./src/lib/docs.config\";");
|
|
1758
|
+
if (out.includes("docsAgentSkills(docsConfig)")) return out === content ? null : out;
|
|
1759
|
+
const vitePlugins = out.match(/(vite\s*:\s*\{[\s\S]*?plugins\s*:\s*\[)([\s\S]*?)(\])/m);
|
|
1760
|
+
if (vitePlugins) {
|
|
1761
|
+
const current = vitePlugins[2].trim();
|
|
1762
|
+
const next = `${current}${current && !current.endsWith(",") ? "," : ""}${current ? " " : ""}docsAgentSkills(docsConfig)`;
|
|
1763
|
+
return out.replace(vitePlugins[0], `${vitePlugins[1]}${next}${vitePlugins[3]}`);
|
|
1764
|
+
}
|
|
1765
|
+
const viteBlock = out.match(/vite\s*:\s*\{/);
|
|
1766
|
+
if (viteBlock) return out.replace(viteBlock[0], `${viteBlock[0]}\n plugins: [docsAgentSkills(docsConfig)],`);
|
|
1767
|
+
const configMatch = out.match(/defineConfig\(\s*\{/);
|
|
1768
|
+
if (!configMatch) return null;
|
|
1769
|
+
return out.replace(configMatch[0], "defineConfig({\n vite: { plugins: [docsAgentSkills(docsConfig)] },");
|
|
1770
|
+
}
|
|
1710
1771
|
function astroDocsPageTemplate(cfg) {
|
|
1711
1772
|
return `\
|
|
1712
1773
|
---
|
|
@@ -1790,7 +1851,7 @@ const docsEntry = config.entry ?? "docs";
|
|
|
1790
1851
|
export const onRequest: MiddlewareHandler = async (context, next) => {
|
|
1791
1852
|
const method = context.request.method.toUpperCase();
|
|
1792
1853
|
|
|
1793
|
-
if (isDocsMcpRequest(context.url)) {
|
|
1854
|
+
if (isDocsMcpRequest(context.url, config.mcp)) {
|
|
1794
1855
|
if (method === "OPTIONS") return MCP.OPTIONS({ request: context.request });
|
|
1795
1856
|
if (method === "POST") return MCP.POST({ request: context.request });
|
|
1796
1857
|
if (method === "DELETE") return MCP.DELETE({ request: context.request });
|
|
@@ -1844,7 +1905,7 @@ const docsEntry = docsConfig.entry ?? "docs";
|
|
|
1844
1905
|
const docsPublicMiddleware: MiddlewareHandler = async (context, next) => {
|
|
1845
1906
|
const method = context.request.method.toUpperCase();
|
|
1846
1907
|
|
|
1847
|
-
if (isDocsMcpRequest(context.url)) {
|
|
1908
|
+
if (isDocsMcpRequest(context.url, docsConfig.mcp)) {
|
|
1848
1909
|
if (method === "OPTIONS") return docsMCP.OPTIONS({ request: context.request });
|
|
1849
1910
|
if (method === "POST") return docsMCP.POST({ request: context.request });
|
|
1850
1911
|
if (method === "DELETE") return docsMCP.DELETE({ request: context.request });
|
|
@@ -2116,17 +2177,25 @@ export default defineDocs({
|
|
|
2116
2177
|
function nuxtServerApiDocsRouteTemplate(cfg) {
|
|
2117
2178
|
return `\
|
|
2118
2179
|
import { defineDocsHandler } from "@farming-labs/nuxt/server";
|
|
2180
|
+
import { bundledAgentSkills } from "@farming-labs/docs/agent-skills-bundle";
|
|
2119
2181
|
import config from "${cfg.useAlias ? "~/docs.config" : "../../docs.config"}";
|
|
2120
2182
|
|
|
2121
|
-
export default defineDocsHandler(
|
|
2183
|
+
export default defineDocsHandler(
|
|
2184
|
+
{ ...config, _preloadedAgentSkills: bundledAgentSkills },
|
|
2185
|
+
useStorage,
|
|
2186
|
+
);
|
|
2122
2187
|
`;
|
|
2123
2188
|
}
|
|
2124
2189
|
function nuxtServerDocsPublicMiddlewareTemplate(cfg) {
|
|
2125
2190
|
return `\
|
|
2126
2191
|
import { defineDocsPublicHandler } from "@farming-labs/nuxt/server";
|
|
2192
|
+
import { bundledAgentSkills } from "@farming-labs/docs/agent-skills-bundle";
|
|
2127
2193
|
import config from "${cfg.useAlias ? "~/docs.config" : "../../docs.config"}";
|
|
2128
2194
|
|
|
2129
|
-
export default defineDocsPublicHandler(
|
|
2195
|
+
export default defineDocsPublicHandler(
|
|
2196
|
+
{ ...config, _preloadedAgentSkills: bundledAgentSkills },
|
|
2197
|
+
useStorage,
|
|
2198
|
+
);
|
|
2130
2199
|
`;
|
|
2131
2200
|
}
|
|
2132
2201
|
function nuxtServerApiReferenceRouteTemplate(filePath, useAlias) {
|
|
@@ -2171,6 +2240,9 @@ if (error.value) {
|
|
|
2171
2240
|
}
|
|
2172
2241
|
function nuxtConfigTemplate(cfg) {
|
|
2173
2242
|
return `\
|
|
2243
|
+
import { docsAgentSkills } from "@farming-labs/docs/vite";
|
|
2244
|
+
import docsConfig from "./docs.config";
|
|
2245
|
+
|
|
2174
2246
|
export default defineNuxtConfig({
|
|
2175
2247
|
compatibilityDate: "2024-11-01",
|
|
2176
2248
|
|
|
@@ -2185,10 +2257,31 @@ export default defineNuxtConfig({
|
|
|
2185
2257
|
nitro: {
|
|
2186
2258
|
moduleSideEffects: ["@farming-labs/nuxt/server"],
|
|
2187
2259
|
serverAssets: [{ baseName: "${cfg.entry}", dir: "${cfg.entry}" }],
|
|
2260
|
+
rollupConfig: { plugins: [docsAgentSkills(docsConfig)] },
|
|
2188
2261
|
},
|
|
2189
2262
|
});
|
|
2190
2263
|
`;
|
|
2191
2264
|
}
|
|
2265
|
+
/** Add the Agent Skills snapshot plugin to Nitro's server Rollup build. */
|
|
2266
|
+
function injectNuxtAgentSkillsPlugin(content) {
|
|
2267
|
+
if (!content) return null;
|
|
2268
|
+
let out = addImportLine(content, "import { docsAgentSkills } from \"@farming-labs/docs/vite\";");
|
|
2269
|
+
out = addImportLine(out, "import docsConfig from \"./docs.config\";");
|
|
2270
|
+
if (out.includes("docsAgentSkills(docsConfig)")) return out === content ? null : out;
|
|
2271
|
+
const rollupPlugins = out.match(/(rollupConfig\s*:\s*\{[\s\S]*?plugins\s*:\s*\[)([\s\S]*?)(\])/m);
|
|
2272
|
+
if (rollupPlugins) {
|
|
2273
|
+
const current = rollupPlugins[2].trim();
|
|
2274
|
+
const next = `${current}${current && !current.endsWith(",") ? "," : ""}${current ? " " : ""}docsAgentSkills(docsConfig)`;
|
|
2275
|
+
return out.replace(rollupPlugins[0], `${rollupPlugins[1]}${next}${rollupPlugins[3]}`);
|
|
2276
|
+
}
|
|
2277
|
+
const rollupBlock = out.match(/rollupConfig\s*:\s*\{/);
|
|
2278
|
+
if (rollupBlock) return out.replace(rollupBlock[0], `${rollupBlock[0]}\n plugins: [docsAgentSkills(docsConfig)],`);
|
|
2279
|
+
const nitroBlock = out.match(/nitro\s*:\s*\{/);
|
|
2280
|
+
if (nitroBlock) return out.replace(nitroBlock[0], `${nitroBlock[0]}\n rollupConfig: { plugins: [docsAgentSkills(docsConfig)] },`);
|
|
2281
|
+
const configMatch = out.match(/defineNuxtConfig\(\s*\{/);
|
|
2282
|
+
if (!configMatch) return null;
|
|
2283
|
+
return out.replace(configMatch[0], "defineNuxtConfig({\n nitro: { rollupConfig: { plugins: [docsAgentSkills(docsConfig)] } },");
|
|
2284
|
+
}
|
|
2192
2285
|
function nuxtWelcomePageTemplate(cfg) {
|
|
2193
2286
|
return `\
|
|
2194
2287
|
---
|
|
@@ -2369,4 +2462,4 @@ function injectNuxtCssImport(existingContent, theme, customThemeName, globalCssR
|
|
|
2369
2462
|
}
|
|
2370
2463
|
|
|
2371
2464
|
//#endregion
|
|
2372
|
-
export {
|
|
2465
|
+
export { svelteDocsLayoutServerTemplate as $, injectTanstackVitePlugins as A, nuxtGlobalCssTemplate as B, injectDocsAgentSkillsVitePlugin as C, tsconfigTemplate as Ct, injectSvelteCssImport as D, injectRootProviderIntoLayout as E, nextLocaleDocPageTemplate as F, nuxtServerDocsPublicMiddlewareTemplate as G, nuxtQuickstartPageTemplate as H, nextLocalizedPageTemplate as I, quickstartPageTemplate as J, nuxtWelcomePageTemplate as K, nuxtConfigTemplate as L, nextApiReferencePageTemplate as M, nextConfigMergedTemplate as N, injectSvelteDocsPublicHook as O, nextConfigTemplate as P, svelteDocsConfigTemplate as Q, nuxtDocsConfigTemplate as R, injectCssImport as S, tanstackWelcomePageTemplate as St, injectNuxtCssImport as T, nuxtServerApiDocsRouteTemplate as U, nuxtInstallationPageTemplate as V, nuxtServerApiReferenceRouteTemplate as W, svelteApiReferenceRouteTemplate as X, rootLayoutTemplate as Y, svelteDocsApiRouteTemplate as Z, getAstroAdapterPkg as _, tanstackDocsServerTemplate as _t, astroDocsIndexTemplate as a, svelteInstallationPageTemplate as at, injectAstroCssImport as b, tanstackRootRouteTemplate as bt, astroDocsServerTemplate as c, svelteViteConfigTemplate as ct, astroQuickstartPageTemplate as d, tanstackApiReferenceRouteTemplate as dt, svelteDocsLayoutTemplate as et, astroWelcomePageTemplate as f, tanstackDocsCatchAllRouteTemplate as ft, docsLayoutTemplate as g, tanstackDocsPublicRouteTemplate as gt, docsConfigTemplate as h, tanstackDocsIndexRouteTemplate as ht, astroDocsConfigTemplate as i, svelteGlobalCssTemplate as it, installationPageTemplate as j, injectTanstackRootProviderIntoRoute as k, astroGlobalCssTemplate as l, svelteWelcomePageTemplate as lt, customThemeTsTemplate as m, tanstackDocsFunctionsTemplate as mt, astroApiRouteTemplate as n, svelteDocsPublicHookTemplate as nt, astroDocsMiddlewareTemplate as o, svelteQuickstartPageTemplate as ot, customThemeCssTemplate as p, tanstackDocsConfigTemplate as pt, postcssConfigTemplate as q, astroConfigTemplate as r, svelteDocsServerTemplate as rt, astroDocsPageTemplate as s, svelteRootLayoutTemplate as st, astroApiReferenceRouteTemplate as t, svelteDocsPageTemplate as tt, astroInstallationPageTemplate as u, tanstackApiDocsRouteTemplate as ut, globalCssTemplate as v, tanstackInstallationPageTemplate as vt, injectNuxtAgentSkillsPlugin as w, welcomePageTemplate as wt, injectAstroDocsMiddleware as x, tanstackViteConfigTemplate as xt, injectAstroAgentSkillsPlugin as y, tanstackQuickstartPageTemplate as yt, nuxtDocsPageTemplate as z };
|
|
@@ -1227,6 +1227,8 @@ interface DocsMcpAuthenticateContext {
|
|
|
1227
1227
|
request: Request;
|
|
1228
1228
|
/** Normalized pathname of the MCP endpoint being requested. */
|
|
1229
1229
|
pathname: string;
|
|
1230
|
+
/** Canonical OAuth resource identifier for exact token audience validation. */
|
|
1231
|
+
resource: string;
|
|
1230
1232
|
}
|
|
1231
1233
|
type DocsMcpAllowedOrigins = "same-origin" | readonly string[] | ((context: DocsMcpOriginContext) => boolean | Promise<boolean>);
|
|
1232
1234
|
type DocsMcpAuthenticateResult = DocsMcpAuthPrincipal | null | Response;
|
|
@@ -1242,6 +1244,22 @@ interface DocsMcpCorsConfig {
|
|
|
1242
1244
|
/** Browser preflight cache lifetime in seconds. Defaults to 600. */
|
|
1243
1245
|
maxAgeSeconds?: number;
|
|
1244
1246
|
}
|
|
1247
|
+
/** RFC 9728 discovery and endpoint-wide OAuth scope requirements for protected HTTP MCP. */
|
|
1248
|
+
interface DocsMcpProtectedResourceConfig {
|
|
1249
|
+
/**
|
|
1250
|
+
* OAuth authorization server issuer identifiers advertised to MCP clients.
|
|
1251
|
+
* Requires at least one HTTPS URL without query or fragment; loopback HTTP is accepted for development.
|
|
1252
|
+
*/
|
|
1253
|
+
authorizationServers: readonly string[];
|
|
1254
|
+
/** OAuth scopes advertised through RFC 9728 `scopes_supported` metadata. */
|
|
1255
|
+
scopesSupported?: readonly string[];
|
|
1256
|
+
/** Scopes every authenticated HTTP MCP principal must have. */
|
|
1257
|
+
requiredScopes?: readonly string[];
|
|
1258
|
+
/** Human-readable protected-resource name. Defaults to the resolved MCP server name. */
|
|
1259
|
+
resourceName?: string;
|
|
1260
|
+
/** Absolute HTTP(S) URL of human-readable authentication guidance for this MCP resource. */
|
|
1261
|
+
resourceDocumentation?: string;
|
|
1262
|
+
}
|
|
1245
1263
|
/** Security controls for the Streamable HTTP MCP transport. */
|
|
1246
1264
|
interface DocsMcpSecurityConfig {
|
|
1247
1265
|
/**
|
|
@@ -1254,6 +1272,11 @@ interface DocsMcpSecurityConfig {
|
|
|
1254
1272
|
* returning `null` rejects the request with 401 and returning a Response passes it through.
|
|
1255
1273
|
*/
|
|
1256
1274
|
authenticate?: DocsMcpAuthenticate;
|
|
1275
|
+
/**
|
|
1276
|
+
* Opt-in OAuth protected-resource discovery. Requires `authenticate` to protect HTTP MCP.
|
|
1277
|
+
* When active, adapters publish RFC 9728 metadata and framework-generated Bearer challenges.
|
|
1278
|
+
*/
|
|
1279
|
+
protectedResource?: DocsMcpProtectedResourceConfig;
|
|
1257
1280
|
/** Maximum POST body size in bytes. Defaults to 1 MiB. */
|
|
1258
1281
|
maxBodyBytes?: number;
|
|
1259
1282
|
/**
|
|
@@ -2506,6 +2529,36 @@ interface DocsAgentEvaluationsConfig {
|
|
|
2506
2529
|
/** Golden tasks evaluated by `docs doctor` and `docs review`. */
|
|
2507
2530
|
tasks?: DocsAgentGoldenTask[];
|
|
2508
2531
|
}
|
|
2532
|
+
/**
|
|
2533
|
+
* Project-local Agent Skills published by the runtime, static Agent Bundle, and MCP server.
|
|
2534
|
+
*
|
|
2535
|
+
* Each path may point at a `SKILL.md`, a skill directory containing `SKILL.md`, or a
|
|
2536
|
+
* collection directory whose descendants contain `SKILL.md` files. Paths are resolved
|
|
2537
|
+
* inside the current project/workspace boundary. Only `SKILL.md` and files below the
|
|
2538
|
+
* standard `references/`, `scripts/`, and `assets/` directories are published.
|
|
2539
|
+
*/
|
|
2540
|
+
interface DocsAgentSkillsConfig {
|
|
2541
|
+
/** Project-relative skill file, skill directory, or collection directory paths. */
|
|
2542
|
+
paths: string | readonly string[];
|
|
2543
|
+
}
|
|
2544
|
+
/** Concise array shorthand for `agent.skills.paths`. */
|
|
2545
|
+
type DocsAgentSkillsInput = string | readonly string[] | DocsAgentSkillsConfig;
|
|
2546
|
+
/** Explicit A2A service metadata. Configure this only when the URL implements A2A. */
|
|
2547
|
+
interface DocsAgentA2AConfig {
|
|
2548
|
+
interfaceUrl: string;
|
|
2549
|
+
name: string;
|
|
2550
|
+
description: string;
|
|
2551
|
+
documentationUrl: string;
|
|
2552
|
+
provider: {
|
|
2553
|
+
organization: string;
|
|
2554
|
+
url: string;
|
|
2555
|
+
};
|
|
2556
|
+
version?: string;
|
|
2557
|
+
/** A2A protocol version exposed by the interface. @default "0.3" */
|
|
2558
|
+
protocolVersion?: string;
|
|
2559
|
+
/** Transport binding exposed by the interface. @default "HTTP+JSON" */
|
|
2560
|
+
protocolBinding?: string;
|
|
2561
|
+
}
|
|
2509
2562
|
interface DocsAgentConfig {
|
|
2510
2563
|
/**
|
|
2511
2564
|
* Defaults for `docs agent compact`.
|
|
@@ -2516,6 +2569,10 @@ interface DocsAgentConfig {
|
|
|
2516
2569
|
* External providers and runtime execution require explicit opt-in.
|
|
2517
2570
|
*/
|
|
2518
2571
|
evaluations?: boolean | DocsAgentEvaluationsConfig;
|
|
2572
|
+
/** Publish reusable Agent Skills through standards discovery, static exports, and MCP. */
|
|
2573
|
+
skills?: DocsAgentSkillsInput;
|
|
2574
|
+
/** Opt in to an A2A Agent Card for a separately implemented A2A service. */
|
|
2575
|
+
a2a?: DocsAgentA2AConfig;
|
|
2519
2576
|
}
|
|
2520
2577
|
type DocsReviewSeverity = "off" | "suggestion" | "warn" | "error";
|
|
2521
2578
|
type DocsReviewCiMode = "off" | "warn" | "block";
|
|
@@ -3245,4 +3302,4 @@ interface DocsConfig {
|
|
|
3245
3302
|
og?: OGConfig;
|
|
3246
3303
|
}
|
|
3247
3304
|
//#endregion
|
|
3248
|
-
export {
|
|
3305
|
+
export { DocsCloudFeatureConfig as $, DocsTelemetryEvent as $t, DocsAgentGoldenTask as A, PageSidebarFrontmatter as An, DocsRelatedItem as At, DocsAnalyticsEventInput as B, SidebarPageNode as Bn, DocsSearchAdapterContext as Bt, DocsAgentEvaluationTaskInput as C, PageAgentAppliesTo as Cn, DocsMcpSecurityConfig as Ct, DocsAgentGoldenAnswerExpectation as D, PageAgentVerification as Dn, DocsObservabilityConfig as Dt, DocsAgentFeedbackData as E, PageAgentFrontmatter as En, DocsNav as Et, DocsAgentTraceEventInput as F, SidebarComponentProps as Fn, DocsReviewScoreConfig as Ft, DocsAskAIActionType as G, TypographyConfig as Gn, DocsSearchEmbeddingsConfig as Gt, DocsAnalyticsInput as H, SimpleDocsSearchConfig as Hn, DocsSearchChunkingConfig as Ht, DocsAgentTraceEventType as I, SidebarConfig as In, DocsReviewSeverity as It, DocsAskAIFeedbackMessage as J, DocsSearchResultType as Jt, DocsAskAIFeedbackConfig as K, UIConfig as Kn, DocsSearchQuery as Kt, DocsAgentTraceStatus as L, SidebarFolderIndexBehavior as Ln, DocsRobotsConfig as Lt, DocsAgentGoldenTaskFilters as M, ReadingTimeConfig as Mn, DocsReviewCiMode as Mt, DocsAgentSkillsConfig as N, ReadingTimeFormat as Nn, DocsReviewConfig as Nt, DocsAgentGoldenExampleVerification as O, PageFrontmatter as On, DocsObservabilityEvent as Ot, DocsAgentSkillsInput as P, ResolvedDocsRelatedLink as Pn, DocsReviewRulesConfig as Pt, DocsCloudConfig as Q, DocsTelemetryConfig as Qt, DocsAnalyticsConfig as R, SidebarFolderNode as Rn, DocsRobotsRule as Rt, DocsAgentEvaluationSurface as S, PageActionsConfig as Sn, DocsMcpProtectedResourceConfig as St, DocsAgentFeedbackContext as T, PageAgentFailureMode as Tn, DocsMetadata as Tt, DocsAnalyticsSource as U, ThemeToggleConfig as Un, DocsSearchConfig as Ut, DocsAnalyticsEventType as V, SidebarTree as Vn, DocsSearchAdapterFactory as Vt, DocsAskAIActionData as W, TypesenseDocsSearchConfig as Wn, DocsSearchDocument as Wt, DocsAskAIMcpConfig as X, DocsSitemapConfig as Xt, DocsAskAIFeedbackValue as Y, DocsSearchSourcePage as Yt, DocsCloudApiKeyConfig as Z, DocsTelemetryAgentSurface as Zt, DocsAgentEvaluationAnswerProvider as _, OpenDocsProviderConfig as _n, DocsMcpAuthenticateContext as _t, ApiReferenceRenderer as a, FeedbackConfig as an, DocsCodeBlocksRunnerConfig as at, DocsAgentEvaluationAnswerRunner as b, OpenGraphImage as bn, DocsMcpCorsConfig as bt, ChangelogFrontmatter as c, LastUpdatedConfig as cn, DocsCodeBlocksValidationMode as ct, CopyMarkdownFormat as d, LlmsTxtMaxCharsMode as dn, DocsFeedbackData as dt, DocsTelemetryEventInput as en, DocsCloudPreviewConfig as et, CustomDocsSearchConfig as f, LlmsTxtSectionConfig as fn, DocsFeedbackValue as ft, DocsAgentEvaluationAnswerInput as g, OpenDocsProvider as gn, DocsMcpAuthenticate as gt, DocsAgentConfig as h, OpenDocsConfig as hn, DocsMcpAuthPrincipal as ht, ApiReferenceConfig as i, DocsTheme as in, DocsCodeBlocksPlannerProvider as it, DocsAgentGoldenTaskExpectation as j, PageTwitter as jn, DocsReviewCiConfig as jt, DocsAgentGoldenExpectedExample as k, PageOpenGraph as kn, DocsObservabilityEventInput as kt, CodeBlockCopyData as l, LlmsTxtConfig as ln, DocsCodeBlocksValidationPolicy as lt, DocsAgentCompactConfig as m, OGConfig as mn, DocsMcpAllowedOrigins as mt, AgentFeedbackConfig as n, DocsTelemetryFeatures as nn, DocsCodeBlocksConfig as nt, BreadcrumbConfig as o, FontStyle as on, DocsCodeBlocksRunnerProvider as ot, DocsAgentA2AConfig as p, McpDocsSearchConfig as pn, DocsI18nConfig as pt, DocsAskAIFeedbackData as q, DocsSearchResult as qt, AlgoliaDocsSearchConfig as r, DocsTelemetryFramework as rn, DocsCodeBlocksPlannerConfig as rt, ChangelogConfig as s, GithubConfig as sn, DocsCodeBlocksValidateConfig as st, AIConfig as t, DocsTelemetryEventType as tn, DocsCloudPublishConfig as tt, CopyMarkdownConfig as u, LlmsTxtMaxCharsConfig as un, DocsConfig as ut, DocsAgentEvaluationAnswerRequest as v, OpenDocsProviderId as vn, DocsMcpAuthenticateResult as vt, DocsAgentEvaluationsConfig as w, PageAgentCommand as wn, DocsMcpToolsConfig as wt, DocsAgentEvaluationSourceReference as x, OrderingItem as xn, DocsMcpOriginContext as xt, DocsAgentEvaluationAnswerResult as y, OpenDocsTarget as yn, DocsMcpConfig as yt, DocsAnalyticsEvent as z, SidebarNode as zn, DocsSearchAdapter as zt };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as fileExists, o as exec } from "./utils-
|
|
2
|
-
import { a as getPackagesForFramework, c as resolveDocsPackageManager, i as frameworkFromPreset, l as validateUpgradeVersion, n as PRESETS, o as presetFromFramework, r as buildDocsPackageInstallCommand, s as resolveDocsPackageFramework, t as PACKAGES_BY_FRAMEWORK } from "./package-version-
|
|
1
|
+
import { c as fileExists, o as exec } from "./utils-DpiIioYb.mjs";
|
|
2
|
+
import { a as getPackagesForFramework, c as resolveDocsPackageManager, i as frameworkFromPreset, l as validateUpgradeVersion, n as PRESETS, o as presetFromFramework, r as buildDocsPackageInstallCommand, s as resolveDocsPackageFramework, t as PACKAGES_BY_FRAMEWORK } from "./package-version-n5AFur8a.mjs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import pc from "picocolors";
|
|
5
5
|
import * as p from "@clack/prompts";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farming-labs/docs",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.61",
|
|
4
4
|
"description": "Modern, flexible MDX-based docs framework — core types, config, and CLI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"docs",
|
|
@@ -30,6 +30,16 @@
|
|
|
30
30
|
"import": "./dist/server.mjs",
|
|
31
31
|
"default": "./dist/server.mjs"
|
|
32
32
|
},
|
|
33
|
+
"./agent-skills-bundle": {
|
|
34
|
+
"types": "./dist/agent-skills-bundle.d.mts",
|
|
35
|
+
"import": "./dist/agent-skills-bundle.mjs",
|
|
36
|
+
"default": "./dist/agent-skills-bundle.mjs"
|
|
37
|
+
},
|
|
38
|
+
"./vite": {
|
|
39
|
+
"types": "./dist/agent-skills-vite.d.mts",
|
|
40
|
+
"import": "./dist/agent-skills-vite.mjs",
|
|
41
|
+
"default": "./dist/agent-skills-vite.mjs"
|
|
42
|
+
},
|
|
33
43
|
"./cloud/server": {
|
|
34
44
|
"types": "./dist/docs-cloud-server.d.mts",
|
|
35
45
|
"import": "./dist/docs-cloud-server.mjs",
|
package/dist/mcp-BAJr3wC2.mjs
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import "./agent-BFqyqEnC.mjs";
|
|
2
|
-
import "./search-D57JXQLj.mjs";
|
|
3
|
-
import "./sitemap-server-C1ibVKOy.mjs";
|
|
4
|
-
import "./agent-evals-kJs2Y9xR.mjs";
|
|
5
|
-
import { createFilesystemDocsMcpSource, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
6
|
-
import "./code-blocks-qe0T8-xe.mjs";
|
|
7
|
-
import "./server.mjs";
|
|
8
|
-
import { d as readStringProperty, h as resolveDocsContentDir, l as readNavTitle, m as resolveDocsConfigPath, n as extractObjectLiteral, s as readBooleanProperty } from "./config-DASewQ0x.mjs";
|
|
9
|
-
import { readFileSync } from "node:fs";
|
|
10
|
-
import pc from "picocolors";
|
|
11
|
-
|
|
12
|
-
//#region src/cli/mcp.ts
|
|
13
|
-
async function runMcp(options = {}) {
|
|
14
|
-
if (options.setup) {
|
|
15
|
-
printHostedMcpSetup(options);
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
const rootDir = process.cwd();
|
|
19
|
-
const content = readFileSync(resolveDocsConfigPath(rootDir, options.configPath), "utf-8");
|
|
20
|
-
const entry = readStringProperty(content, "entry") ?? "docs";
|
|
21
|
-
const contentDir = resolveDocsContentDir(rootDir, content, entry);
|
|
22
|
-
const navTitle = readNavTitle(content);
|
|
23
|
-
const mcp = readMcpConfig(content);
|
|
24
|
-
await runDocsMcpStdio({
|
|
25
|
-
source: createFilesystemDocsMcpSource({
|
|
26
|
-
rootDir,
|
|
27
|
-
entry,
|
|
28
|
-
contentDir,
|
|
29
|
-
siteTitle: navTitle ?? "Documentation"
|
|
30
|
-
}),
|
|
31
|
-
mcp: resolveDocsMcpConfig(mcp ?? true, { defaultName: navTitle ?? "@farming-labs/docs" }),
|
|
32
|
-
defaultName: navTitle ?? "@farming-labs/docs"
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
function normalizeApiBaseUrl(value) {
|
|
36
|
-
return (value?.trim() || "https://api.farming-labs.dev").replace(/\/+$/g, "");
|
|
37
|
-
}
|
|
38
|
-
function printHostedMcpSetup(options) {
|
|
39
|
-
const deploymentId = options.deploymentId?.trim();
|
|
40
|
-
if (!deploymentId) {
|
|
41
|
-
console.error(pc.red("Missing MCP deployment id."));
|
|
42
|
-
console.error();
|
|
43
|
-
console.error(`Run ${pc.cyan("npx @farming-labs/docs mcp setup --deployment <deployment-id>")}.`);
|
|
44
|
-
process.exit(1);
|
|
45
|
-
}
|
|
46
|
-
const endpoint = `${normalizeApiBaseUrl(options.apiBaseUrl)}/v1/mcp/${deploymentId}`;
|
|
47
|
-
const jsonConfig = { mcpServers: { "docs-cloud": {
|
|
48
|
-
command: "npx",
|
|
49
|
-
args: [
|
|
50
|
-
"@farming-labs/docs",
|
|
51
|
-
"mcp",
|
|
52
|
-
"setup",
|
|
53
|
-
"--deployment",
|
|
54
|
-
deploymentId
|
|
55
|
-
]
|
|
56
|
-
} } };
|
|
57
|
-
if (options.json) {
|
|
58
|
-
console.log(JSON.stringify(jsonConfig, null, 2));
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
console.log(pc.bold("Docs Cloud MCP deployment"));
|
|
62
|
-
console.log(pc.dim(`Deployment: ${deploymentId}`));
|
|
63
|
-
console.log();
|
|
64
|
-
console.log(pc.cyan("CLI stdio"));
|
|
65
|
-
console.log(` npx @farming-labs/docs mcp setup --deployment ${deploymentId}`);
|
|
66
|
-
console.log();
|
|
67
|
-
console.log(pc.cyan("Streamable HTTP"));
|
|
68
|
-
console.log(` ${endpoint}`);
|
|
69
|
-
console.log();
|
|
70
|
-
console.log(pc.cyan("SSE"));
|
|
71
|
-
console.log(` ${endpoint}/sse`);
|
|
72
|
-
console.log();
|
|
73
|
-
console.log(pc.cyan("MCP client JSON"));
|
|
74
|
-
console.log(JSON.stringify(jsonConfig, null, 2));
|
|
75
|
-
console.log();
|
|
76
|
-
console.log(pc.dim("Set DOCS_CLOUD_API_KEY in the agent environment before connecting."));
|
|
77
|
-
}
|
|
78
|
-
function readMcpConfig(content) {
|
|
79
|
-
if (content.match(/mcp\s*:\s*false/)) return false;
|
|
80
|
-
if (content.match(/mcp\s*:\s*true/)) return true;
|
|
81
|
-
const block = extractObjectLiteral(content, "mcp");
|
|
82
|
-
if (!block) return void 0;
|
|
83
|
-
return {
|
|
84
|
-
enabled: readBooleanProperty(block, "enabled"),
|
|
85
|
-
route: readStringProperty(block, "route"),
|
|
86
|
-
name: readStringProperty(block, "name"),
|
|
87
|
-
version: readStringProperty(block, "version"),
|
|
88
|
-
tools: {
|
|
89
|
-
listDocs: readBooleanProperty(block, "listDocs"),
|
|
90
|
-
listPages: readBooleanProperty(block, "listPages"),
|
|
91
|
-
listTasks: readBooleanProperty(block, "listTasks"),
|
|
92
|
-
readTask: readBooleanProperty(block, "readTask"),
|
|
93
|
-
readPage: readBooleanProperty(block, "readPage"),
|
|
94
|
-
searchDocs: readBooleanProperty(block, "searchDocs"),
|
|
95
|
-
getNavigation: readBooleanProperty(block, "getNavigation"),
|
|
96
|
-
getCodeExamples: readBooleanProperty(block, "getCodeExamples"),
|
|
97
|
-
getConfigSchema: readBooleanProperty(block, "getConfigSchema"),
|
|
98
|
-
getContext: readBooleanProperty(block, "getContext")
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
//#endregion
|
|
104
|
-
export { runMcp };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|