@farm.js/core 0.1.51-beta.1 → 0.1.51-beta.3
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-mcp-handler-WWCC4GLG.mjs → agent-mcp-handler-7JSKGSOW.mjs} +4 -4
- package/dist/{agent-mcp-handler-RT3COCEL.cjs → agent-mcp-handler-YE4AGWHN.cjs} +5 -5
- package/dist/{agent-mcp.d-ZuuNgrkQ.d.ts → agent-mcp.d-BAR9njbJ.d.ts} +1 -1
- package/dist/{agent-mcp.d-BPzpKBHQ.d.mts → agent-mcp.d-BJKChOrO.d.mts} +1 -1
- package/dist/agent-runtime.d.mts +2 -2
- package/dist/agent-runtime.d.ts +2 -2
- package/dist/{analyzer-V74FTD2F.mjs → analyzer-OTPEWH5W.mjs} +82 -22
- package/dist/{analyzer-AZULAOPL.cjs → analyzer-TSQXZCZN.cjs} +82 -22
- package/dist/api/route-manager.d.mts +4 -4
- package/dist/api/route-manager.d.ts +4 -4
- package/dist/api/runtime.d.mts +3 -3
- package/dist/api/runtime.d.ts +3 -3
- package/dist/api.d.mts +4 -4
- package/dist/api.d.ts +4 -4
- package/dist/{app-manifest.d-HWhqbP2X.d.ts → app-manifest.d-BLFbaqx8.d.ts} +1 -1
- package/dist/{app-manifest.d-BJDcZn3W.d.mts → app-manifest.d-DEQNnNhV.d.mts} +1 -1
- package/dist/app-markdown.cjs +4 -4
- package/dist/app-markdown.d.mts +3 -3
- package/dist/app-markdown.d.ts +3 -3
- package/dist/app-markdown.mjs +3 -3
- package/dist/{app.d-B5EWdob-.d.ts → app.d-CNPaUYaa.d.ts} +4 -4
- package/dist/{app.d-DOGW1KI8.d.mts → app.d-CT7xDkj2.d.mts} +4 -4
- package/dist/{chunk-YVJV7Q2X.mjs → chunk-3BLEXUGE.mjs} +1 -1
- package/dist/chunk-3HLQTOVU.cjs +6 -0
- package/dist/{chunk-KU7MBLDZ.mjs → chunk-3SMXQNFD.mjs} +2 -2
- package/dist/{chunk-EWC76P5D.mjs → chunk-3TLKUBXG.mjs} +411 -166
- package/dist/{chunk-BSEKNTMS.mjs → chunk-3WSIYBMG.mjs} +41 -19
- package/dist/{chunk-JVBNKWLV.cjs → chunk-3XQ57EFI.cjs} +16 -16
- package/dist/{chunk-GW4YUIHW.mjs → chunk-3Z63X45F.mjs} +1 -1
- package/dist/{chunk-SCRC5AMM.mjs → chunk-4353ZRE5.mjs} +1 -1
- package/dist/{chunk-SBABQKPT.cjs → chunk-46KXZBOG.cjs} +5 -5
- package/dist/{chunk-2756SHCI.cjs → chunk-4CGOMZP3.cjs} +221 -199
- package/dist/{chunk-RMPNYUGT.cjs → chunk-4SEHMBL4.cjs} +10 -10
- package/dist/{chunk-QAIAFCRZ.mjs → chunk-4TKAIO2F.mjs} +3 -3
- package/dist/{chunk-NJLTQR5P.cjs → chunk-53SACYBY.cjs} +7 -7
- package/dist/{chunk-I3EFXUAR.mjs → chunk-5FXPJIOT.mjs} +2 -2
- package/dist/chunk-7FVVQEVL.cjs +541 -0
- package/dist/{chunk-IFBINMI4.cjs → chunk-7MD37P5V.cjs} +5 -5
- package/dist/{chunk-JATTVAHA.cjs → chunk-B3GM5I6N.cjs} +4 -4
- package/dist/chunk-C3BOESDW.mjs +541 -0
- package/dist/{chunk-WJFFPXCV.cjs → chunk-D7UQC4O6.cjs} +10 -8
- package/dist/{chunk-KRRZJ77U.mjs → chunk-E5DXF5GE.mjs} +2 -2
- package/dist/chunk-EFZGB7JC.cjs +114 -0
- package/dist/{chunk-NYQSC4DX.cjs → chunk-FFE2EMF7.cjs} +5 -5
- package/dist/{chunk-KMB5BMFX.mjs → chunk-GAO7MS5O.mjs} +9 -3
- package/dist/{chunk-HIFIG6HL.cjs → chunk-H33PJEXN.cjs} +5 -5
- package/dist/{chunk-TT66CP3P.cjs → chunk-HLWOWZFX.cjs} +2 -2
- package/dist/chunk-JXEPLIXD.cjs +389 -0
- package/dist/{chunk-VITZRYW3.cjs → chunk-KLNFJDFM.cjs} +15 -9
- package/dist/{chunk-KBRZAYI7.mjs → chunk-LDNSSHEG.mjs} +2 -2
- package/dist/chunk-LLZSYFOM.mjs +6 -0
- package/dist/{chunk-N77JBPLC.mjs → chunk-LPDKG6RA.mjs} +9 -7
- package/dist/chunk-MIGFX2FN.mjs +758 -0
- package/dist/{chunk-72D2NX77.mjs → chunk-MRNDAJEV.mjs} +1 -1
- package/dist/{chunk-5A5GAZ75.mjs → chunk-NOTSHVRN.mjs} +406 -234
- package/dist/{chunk-AGR7VJH2.cjs → chunk-OAMUSC7H.cjs} +1 -1
- package/dist/chunk-P6MHI5O2.cjs +758 -0
- package/dist/{chunk-EOSFVNXZ.mjs → chunk-R4PHCZ3G.mjs} +1 -1
- package/dist/{chunk-X2M4XN4V.cjs → chunk-TQMI6BYO.cjs} +675 -430
- package/dist/{chunk-76GHW3WI.cjs → chunk-TSFMFPRU.cjs} +4 -4
- package/dist/{chunk-5N7QAGEA.cjs → chunk-TWHXBMLJ.cjs} +37 -7
- package/dist/{chunk-BOVGCUDZ.cjs → chunk-UJL4JOXV.cjs} +2 -2
- package/dist/chunk-UQF3OJVE.mjs +389 -0
- package/dist/{chunk-XY4DYGSU.cjs → chunk-WGUHDWT5.cjs} +607 -435
- package/dist/{chunk-LAZK6UV7.mjs → chunk-YAJTD3ZG.mjs} +1 -1
- package/dist/{chunk-7UPCJDB5.mjs → chunk-YUEYBL35.mjs} +2 -2
- package/dist/{chunk-EIMK7D2D.mjs → chunk-ZD2VKAUI.mjs} +34 -4
- package/dist/chunk-ZNXTU4YH.mjs +114 -0
- package/dist/{client-plugins.d-C_3CdALC.d.mts → client-plugins.d-DllmH8eM.d.mts} +31 -5
- package/dist/{client-plugins.d-C0n8Yhh-.d.ts → client-plugins.d-n3iWY1EJ.d.ts} +31 -5
- package/dist/client-plugins.d.mts +2 -2
- package/dist/client-plugins.d.ts +2 -2
- package/dist/client.d.mts +7 -7
- package/dist/client.d.ts +7 -7
- package/dist/{config.d-CnhyvvmT.d.ts → config.d-DqKaCr1r.d.mts} +14 -3
- package/dist/{config.d-CnhyvvmT.d.mts → config.d-DqKaCr1r.d.ts} +14 -3
- package/dist/config.d.mts +2 -2
- package/dist/config.d.ts +2 -2
- package/dist/desktop.d.mts +3 -3
- package/dist/desktop.d.ts +3 -3
- package/dist/{devtools-KJFUE5FO.cjs → devtools-TO6TAO32.cjs} +5 -5
- package/dist/{devtools-BU5IT2PD.mjs → devtools-UESYARTF.mjs} +4 -4
- package/dist/docs.cjs +7 -7
- package/dist/docs.d.mts +3 -3
- package/dist/docs.d.ts +3 -3
- package/dist/docs.mjs +6 -6
- package/dist/index.cjs +23 -18
- package/dist/{index.d-CsGxS-hZ.d.mts → index.d-BL7KKiwa.d.mts} +1 -1
- package/dist/{index.d-B6M_8kmo.d.ts → index.d-BXsAXm1U.d.ts} +1 -1
- package/dist/index.d.mts +17 -17
- package/dist/index.d.ts +17 -17
- package/dist/index.mjs +23 -18
- package/dist/integrations.d.mts +2 -2
- package/dist/integrations.d.ts +2 -2
- package/dist/internal/app-markdown-runtime.cjs +3 -3
- package/dist/internal/app-markdown-runtime.d.mts +3 -3
- package/dist/internal/app-markdown-runtime.d.ts +3 -3
- package/dist/internal/app-markdown-runtime.mjs +2 -2
- package/dist/internal/build-runtime.cjs +21 -18
- package/dist/internal/build-runtime.d.mts +4 -4
- package/dist/internal/build-runtime.d.ts +4 -4
- package/dist/internal/build-runtime.mjs +20 -17
- package/dist/internal/cli-runtime.cjs +7 -7
- package/dist/internal/cli-runtime.mjs +6 -6
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.d.mts +5 -5
- package/dist/internal/client-runtime.d.ts +5 -5
- package/dist/internal/compression-runtime.d.mts +2 -2
- package/dist/internal/compression-runtime.d.ts +2 -2
- package/dist/internal/config-runtime.cjs +6 -6
- package/dist/internal/config-runtime.d.mts +41 -80
- package/dist/internal/config-runtime.d.ts +41 -80
- package/dist/internal/config-runtime.mjs +5 -5
- package/dist/internal/infra-analytics-runtime.cjs +8 -8
- package/dist/internal/infra-analytics-runtime.mjs +6 -6
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-runtime.cjs +91 -9
- package/dist/internal/production-runtime.d.mts +67 -12
- package/dist/internal/production-runtime.d.ts +67 -12
- package/dist/internal/production-runtime.mjs +90 -8
- package/dist/markdown.cjs +4 -2
- package/dist/markdown.d.mts +2 -2
- package/dist/markdown.d.ts +2 -2
- package/dist/markdown.mjs +3 -1
- package/dist/middleware.d.mts +4 -4
- package/dist/middleware.d.ts +4 -4
- package/dist/mobile.d.mts +21 -5
- package/dist/mobile.d.ts +21 -5
- package/dist/native-tree-EBPDFTRW.mjs +25 -0
- package/dist/native-tree-MMZS7S6W.cjs +25 -0
- package/dist/{navigation-delegate.d-C0BbdUgN.d.mts → navigation-delegate.d-C76gXTmO.d.mts} +1 -1
- package/dist/{navigation-delegate.d-jArRF0ZP.d.ts → navigation-delegate.d-DIyDslxt.d.ts} +1 -1
- package/dist/navigation.d.mts +5 -5
- package/dist/navigation.d.ts +5 -5
- package/dist/plugin.cjs +14 -13
- package/dist/plugin.d.mts +5 -4
- package/dist/plugin.d.ts +5 -4
- package/dist/plugin.mjs +13 -12
- package/dist/{production-runtime.d-DFaQ1qaV.d.mts → production-runtime.d-CDHztggO.d.mts} +1 -1
- package/dist/{production-runtime.d-UnXmSS_S.d.ts → production-runtime.d-tyaGdbk6.d.ts} +1 -1
- package/dist/{programmatic-routes-client.d-VZ0qcbH4.d.ts → programmatic-routes-client.d-XfmIrCK1.d.ts} +2 -2
- package/dist/{programmatic-routes-client.d-BIowUXQC.d.mts → programmatic-routes-client.d-aAWiDd64.d.mts} +2 -2
- package/dist/{render-plan.d-BNeqyPyJ.d.mts → render-plan.d-Diwybxo8.d.mts} +1 -1
- package/dist/{render-plan.d-BB6KrYjP.d.ts → render-plan.d-Dr5WRjoV.d.ts} +1 -1
- package/dist/renderer-client.d.mts +5 -5
- package/dist/renderer-client.d.ts +5 -5
- package/dist/{request.d-Bxhghm76.d.ts → request.d-D01fRn--.d.ts} +1 -1
- package/dist/{request.d-BV1munmx.d.mts → request.d-Dd3AFR79.d.mts} +1 -1
- package/dist/request.d.mts +3 -3
- package/dist/request.d.ts +3 -3
- package/dist/{route-rendering.d-DShqKlgK.d.mts → route-rendering.d-BQ53lJ_D.d.mts} +1 -1
- package/dist/{route-rendering.d-BIf7zE9d.d.ts → route-rendering.d-Bhx4QoJt.d.ts} +1 -1
- package/dist/{router.d-BE7i84fb.d.mts → router.d-Bi23a6Xc.d.mts} +1 -1
- package/dist/{router.d-Bw3K3b0a.d.ts → router.d-DQ3k7EYn.d.ts} +1 -1
- package/dist/{routes.d-_5tBQexL.d.mts → routes.d-BgTd7vI4.d.mts} +91 -4
- package/dist/{routes.d-DVZQL0-H.d.ts → routes.d-C7jMJFvP.d.ts} +91 -4
- package/dist/routes.d.mts +2 -2
- package/dist/routes.d.ts +2 -2
- package/dist/{rsc-pipeline-FBM6NFYY.mjs → rsc-pipeline-K3ER3Q4N.mjs} +5 -5
- package/dist/{rsc-pipeline-IQI5XQLS.cjs → rsc-pipeline-OCZIT5OF.cjs} +6 -6
- package/dist/{runtime-DXEVFYLE.cjs → runtime-DKNSIH7V.cjs} +85 -29
- package/dist/{runtime-2JYIDUON.mjs → runtime-MKYDEUZT.mjs} +75 -19
- package/dist/{runtime.d-CQgoYR0Q.d.mts → runtime.d-B2Js6qZ2.d.mts} +1 -1
- package/dist/{runtime.d-CfhaLPl-.d.ts → runtime.d-BL-CGwoi.d.ts} +1 -1
- package/dist/server-plugins.d.mts +3 -3
- package/dist/server-plugins.d.ts +3 -3
- package/dist/server.cjs +31 -30
- package/dist/server.d.mts +11 -10
- package/dist/server.d.ts +11 -10
- package/dist/server.mjs +16 -15
- package/dist/session-AAU7RNRO.cjs +23 -0
- package/dist/session-IGEDQ5PY.mjs +23 -0
- package/dist/{spa-router.d-D63jb6nX.d.mts → spa-router.d-B2rIFGs0.d.mts} +2 -2
- package/dist/{spa-router.d-C5opIgXg.d.ts → spa-router.d-DqZ6Lfs0.d.ts} +2 -2
- package/dist/testing.d.mts +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/{utils.d-CkpTqTsC.d.ts → utils.d-Bv2MPeLR.d.ts} +1 -1
- package/dist/{utils.d-CO-U4OVZ.d.mts → utils.d-fqXe8lNc.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +14 -13
- package/dist/vite.d.mts +12 -6
- package/dist/vite.d.ts +12 -6
- package/dist/vite.mjs +13 -12
- package/package.json +3 -3
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
resolveFarmIsolatedClientHydrationMode,
|
|
38
38
|
resolveModuleSourcePath,
|
|
39
39
|
stripUseClientDirective
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-3TLKUBXG.mjs";
|
|
41
41
|
import {
|
|
42
42
|
loadTailwindVitePlugin
|
|
43
43
|
} from "./chunk-PIHKO25G.mjs";
|
|
@@ -61,7 +61,10 @@ import {
|
|
|
61
61
|
parseFarmLayoutChainHeader,
|
|
62
62
|
renderFarmLocaleAlternateLinks,
|
|
63
63
|
stripRouteGroups
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-YUEYBL35.mjs";
|
|
65
|
+
import {
|
|
66
|
+
FARM_NATIVE_TREE_CONTENT_TYPE
|
|
67
|
+
} from "./chunk-LLZSYFOM.mjs";
|
|
65
68
|
import {
|
|
66
69
|
isFarmPreviewDeploymentEnvironment
|
|
67
70
|
} from "./chunk-CSLUBKGG.mjs";
|
|
@@ -79,10 +82,10 @@ import {
|
|
|
79
82
|
resolveFarmMCPRouteLabel,
|
|
80
83
|
resolveFarmMarkdownRouteLabel,
|
|
81
84
|
setFarmRouteLabel
|
|
82
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-4TKAIO2F.mjs";
|
|
83
86
|
import {
|
|
84
87
|
FARM_DEFAULT_MCP_PATH
|
|
85
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-E5DXF5GE.mjs";
|
|
86
89
|
import {
|
|
87
90
|
resolveFarmLayoutFonts
|
|
88
91
|
} from "./chunk-HZOMT5DY.mjs";
|
|
@@ -98,7 +101,7 @@ import {
|
|
|
98
101
|
createFarmMarkdownSourceResponse,
|
|
99
102
|
isFarmMarkdownPageFile,
|
|
100
103
|
normalizeFarmMarkdownRoutePath
|
|
101
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-3Z63X45F.mjs";
|
|
102
105
|
import {
|
|
103
106
|
generateFarmDocsAdapterClientRuntime,
|
|
104
107
|
getFarmDocsAdapterConfigModule
|
|
@@ -129,10 +132,10 @@ import {
|
|
|
129
132
|
FARM_PREVIEW_ROBOTS_TAG,
|
|
130
133
|
resolveFarmAgentCrawlers,
|
|
131
134
|
resolveFarmAgentSitemap
|
|
132
|
-
} from "./chunk-
|
|
135
|
+
} from "./chunk-LDNSSHEG.mjs";
|
|
133
136
|
import {
|
|
134
137
|
resolveFarmLlmsTxtConfig
|
|
135
|
-
} from "./chunk-
|
|
138
|
+
} from "./chunk-YAJTD3ZG.mjs";
|
|
136
139
|
import {
|
|
137
140
|
getPublicFarmImageConfig,
|
|
138
141
|
resolveFarmImageConfig
|
|
@@ -153,7 +156,7 @@ import {
|
|
|
153
156
|
getFarmMarkdownAlternatePath,
|
|
154
157
|
getFarmMarkdownMirrorPath,
|
|
155
158
|
resolveMarkdownMirrorTarget
|
|
156
|
-
} from "./chunk-
|
|
159
|
+
} from "./chunk-LPDKG6RA.mjs";
|
|
157
160
|
import {
|
|
158
161
|
resolveFarmRouteContext,
|
|
159
162
|
withFarmRouteContext
|
|
@@ -244,7 +247,7 @@ import {
|
|
|
244
247
|
} from "./chunk-LM2YOGDK.mjs";
|
|
245
248
|
import {
|
|
246
249
|
FARM_VERSION
|
|
247
|
-
} from "./chunk-
|
|
250
|
+
} from "./chunk-R4PHCZ3G.mjs";
|
|
248
251
|
import {
|
|
249
252
|
DEFAULT_FARM_API_BASE_PATH
|
|
250
253
|
} from "./chunk-BLD5GVCG.mjs";
|
|
@@ -765,7 +768,7 @@ function loadFarmWorkflowsDevRuntime() {
|
|
|
765
768
|
return import("./workflows.mjs");
|
|
766
769
|
}
|
|
767
770
|
function loadFarmDevtoolsSnapshotRuntime() {
|
|
768
|
-
return import("./devtools-
|
|
771
|
+
return import("./devtools-UESYARTF.mjs");
|
|
769
772
|
}
|
|
770
773
|
function loadFarmDevtoolsUIRuntime() {
|
|
771
774
|
return import("./devtools-ui-CYBVFLPH.mjs");
|
|
@@ -792,14 +795,14 @@ function farmI18nClientBridgePlugin() {
|
|
|
792
795
|
var FARM_SERVER_ONLY_ENTRIES = /* @__PURE__ */ new Set(["@farm.js/core/og"]);
|
|
793
796
|
var FARM_PLATFORM_ENTRY = "@farm.js/core/platform";
|
|
794
797
|
var FARM_PLATFORM_CLIENT_ID = "\0farm:platform-client";
|
|
795
|
-
function createFarmPlatformClientModule() {
|
|
796
|
-
return `export function platform() { return ${JSON.stringify(
|
|
798
|
+
function createFarmPlatformClientModule(platform) {
|
|
799
|
+
return `export function platform() { return ${JSON.stringify(platform)}; }
|
|
797
800
|
export function appDataDir() {
|
|
798
801
|
throw new Error("[Farm] appDataDir() is server-only. Read and write app data from a server function or API route.");
|
|
799
802
|
}
|
|
800
803
|
`;
|
|
801
804
|
}
|
|
802
|
-
function farmServerOnlyEntriesPlugin() {
|
|
805
|
+
function farmServerOnlyEntriesPlugin(options = {}) {
|
|
803
806
|
let root = process.cwd();
|
|
804
807
|
let vercelOgInstalled = false;
|
|
805
808
|
return {
|
|
@@ -813,14 +816,14 @@ function farmServerOnlyEntriesPlugin() {
|
|
|
813
816
|
configResolved(config) {
|
|
814
817
|
root = config.root;
|
|
815
818
|
},
|
|
816
|
-
resolveId(id, importer,
|
|
817
|
-
if (id === FARM_PLATFORM_ENTRY) return
|
|
818
|
-
if (!
|
|
819
|
-
return resolveFarmBrowserBuiltin(this, id, importer,
|
|
819
|
+
resolveId(id, importer, options2) {
|
|
820
|
+
if (id === FARM_PLATFORM_ENTRY) return options2?.ssr ? null : FARM_PLATFORM_CLIENT_ID;
|
|
821
|
+
if (!options2?.ssr && isBuiltin(id)) {
|
|
822
|
+
return resolveFarmBrowserBuiltin(this, id, importer, options2);
|
|
820
823
|
}
|
|
821
824
|
if (!FARM_SERVER_ONLY_ENTRIES.has(id)) return null;
|
|
822
825
|
const importedBy = importer ? ` (imported by ${importer})` : "";
|
|
823
|
-
if (!
|
|
826
|
+
if (!options2?.ssr) {
|
|
824
827
|
this.error(
|
|
825
828
|
`${id} is server-only and cannot be imported into client code${importedBy}. Use it from an API route or another server module.`
|
|
826
829
|
);
|
|
@@ -834,7 +837,9 @@ function farmServerOnlyEntriesPlugin() {
|
|
|
834
837
|
return null;
|
|
835
838
|
},
|
|
836
839
|
load(id) {
|
|
837
|
-
if (id === FARM_PLATFORM_CLIENT_ID)
|
|
840
|
+
if (id === FARM_PLATFORM_CLIENT_ID) {
|
|
841
|
+
return createFarmPlatformClientModule(options.platform ?? resolveFarmPlatform());
|
|
842
|
+
}
|
|
838
843
|
return loadFarmBrowserBuiltin(id) ?? null;
|
|
839
844
|
}
|
|
840
845
|
};
|
|
@@ -2332,6 +2337,23 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2332
2337
|
return;
|
|
2333
2338
|
}
|
|
2334
2339
|
}
|
|
2340
|
+
if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD") && req.headers.accept?.includes(FARM_NATIVE_TREE_CONTENT_TYPE)) {
|
|
2341
|
+
const { createFarmNativeTreeResponse } = await import("./native-tree-EBPDFTRW.mjs");
|
|
2342
|
+
const treeResponse = await createFarmNativeTreeResponse({
|
|
2343
|
+
request: new Request(fullUrl, { method: requestMethod, headers: docsHeaders }),
|
|
2344
|
+
// As for the Markdown mirror: this server's own listener, redirects not followed.
|
|
2345
|
+
renderPage: (request) => createFarmDevServerDispatch(server)(
|
|
2346
|
+
new Request(request, {
|
|
2347
|
+
signal: res.destroyed ? AbortSignal.abort() : createFarmNodeRequestAbortSignal(req, res)
|
|
2348
|
+
})
|
|
2349
|
+
)
|
|
2350
|
+
});
|
|
2351
|
+
await serveBuiltInRoute(() => treeResponse, {
|
|
2352
|
+
computed: treeResponse,
|
|
2353
|
+
label: farmApp.getRouteManager().matchRoute(stripFarmBasePath(requestPathname, farmConfig.basePath)).route?.pattern ?? null
|
|
2354
|
+
});
|
|
2355
|
+
return;
|
|
2356
|
+
}
|
|
2335
2357
|
const markdownRouteLabel = () => resolveFarmMarkdownRouteLabel(
|
|
2336
2358
|
stripFarmBasePath(requestPathname, farmConfig.basePath),
|
|
2337
2359
|
(page) => farmApp.getRouteManager().matchRoute(page).route?.pattern
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkTWHXBMLJcjs = require('./chunk-TWHXBMLJ.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _chunkV3UOEWCBcjs = require('./chunk-V3UOEWCB.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkKLNFJDFMcjs = require('./chunk-KLNFJDFM.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
@@ -27,7 +27,7 @@ function hasFarmDocsRuntimeAdapter(docs) {
|
|
|
27
27
|
}
|
|
28
28
|
function assertFarmDocsAdapterServesNoGuardedPages(docs, options, isPathGuarded) {
|
|
29
29
|
if (!isPathGuarded || !hasFarmDocsRuntimeAdapter(docs)) return;
|
|
30
|
-
const guarded =
|
|
30
|
+
const guarded = _chunkTWHXBMLJcjs.getFarmDocsRoots.call(void 0, docs).flatMap((root) => _chunkTWHXBMLJcjs.discoverFarmDocsPages.call(void 0, _chunkTWHXBMLJcjs.resolveFarmDocsContentDir.call(void 0, root, options), root)).filter((page) => isPathGuarded(page.href) || isPathGuarded(_chunkTWHXBMLJcjs.getFarmDocsMarkdownPath.call(void 0, page.href))).map((page) => page.href);
|
|
31
31
|
if (guarded.length === 0) return;
|
|
32
32
|
throw new Error(
|
|
33
33
|
`Docs pages behind a path guard (${guarded.join(", ")}) would be public: the docs adapter ${JSON.stringify(docs.adapter.id)} serves their content in llms-full.txt, search, Markdown, and MCP without running the app's guards. Move those pages out of the docs content directory, or set docs.adapter = false to use Farm's built-in docs runtime, which keeps guarded pages off anonymous surfaces.`
|
|
@@ -53,7 +53,7 @@ function createFarmDocsAdapterRuntimeConfig(docs, options, moduleConfig) {
|
|
|
53
53
|
...moduleConfig ? { ...getFarmDocsConfigModuleRoot(moduleConfig, docs.entry), ...docs.configOverrides } : _nullishCoalesce(docs.runtimeConfig, () => ( docs.config)),
|
|
54
54
|
entry: docs.config.entry || docs.entry.replace(/^\/+|\/+$/g, "") || "docs",
|
|
55
55
|
docsPath: docs.entry,
|
|
56
|
-
contentDir:
|
|
56
|
+
contentDir: _chunkTWHXBMLJcjs.resolveFarmDocsContentDir.call(void 0, docs, options)
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
function getFarmDocsAdapterStylesheets(options) {
|
|
@@ -120,7 +120,7 @@ async function listFarmDocsAdapterPages(docs, options) {
|
|
|
120
120
|
if (typeof serverModule.listFarmDocsPages !== "function") return null;
|
|
121
121
|
const listPages = serverModule.listFarmDocsPages;
|
|
122
122
|
const pages = (await Promise.all(
|
|
123
|
-
|
|
123
|
+
_chunkTWHXBMLJcjs.getFarmDocsRoots.call(void 0, docs).map(
|
|
124
124
|
(root) => listPages(createFarmDocsAdapterRuntimeConfig(root, options), { rootDir: options.root })
|
|
125
125
|
)
|
|
126
126
|
)).flat();
|
|
@@ -159,7 +159,7 @@ async function createFarmDocsAdapterHandler(docs, options) {
|
|
|
159
159
|
};
|
|
160
160
|
if (multiRoot) {
|
|
161
161
|
return serverModule.createFarmDocsMultiRuntimeHandler(
|
|
162
|
-
|
|
162
|
+
_chunkTWHXBMLJcjs.getFarmDocsRoots.call(void 0, docs).map(
|
|
163
163
|
(root) => createFarmDocsAdapterRuntimeConfig(root, options, moduleConfig)
|
|
164
164
|
),
|
|
165
165
|
handlerOptions
|
|
@@ -305,22 +305,22 @@ function getDocsDescription(docs) {
|
|
|
305
305
|
return _optionalChain([docs, 'access', _15 => _15.config, 'access', _16 => _16.metadata, 'optionalAccess', _17 => _17.description]);
|
|
306
306
|
}
|
|
307
307
|
function getLoadedDocsPages(context) {
|
|
308
|
-
return
|
|
308
|
+
return _chunkTWHXBMLJcjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs).filter((page) => !context.isPathGuarded(page.href)).map((page) => _chunkTWHXBMLJcjs.loadFarmDocsPage.call(void 0, context.contentDir, context.docs, page.slug)).filter((page) => Boolean(page));
|
|
309
309
|
}
|
|
310
310
|
function toDocsSourcePage(page) {
|
|
311
311
|
return {
|
|
312
|
-
...
|
|
312
|
+
..._chunkTWHXBMLJcjs.toFarmDocsMarkdownPage.call(void 0, page),
|
|
313
313
|
sourcePath: page.sourcePath
|
|
314
314
|
};
|
|
315
315
|
}
|
|
316
316
|
function toDocsSitemapPage(page) {
|
|
317
317
|
return {
|
|
318
|
-
...
|
|
318
|
+
..._chunkTWHXBMLJcjs.toFarmDocsMarkdownPage.call(void 0, page),
|
|
319
319
|
sourcePath: page.sourcePath
|
|
320
320
|
};
|
|
321
321
|
}
|
|
322
322
|
function toDocsLlmsPage(page) {
|
|
323
|
-
return
|
|
323
|
+
return _chunkTWHXBMLJcjs.toFarmDocsMarkdownPage.call(void 0, page);
|
|
324
324
|
}
|
|
325
325
|
function getDocsLlmsOptions(context, request) {
|
|
326
326
|
const configured = isRecord(context.docs.config.llmsTxt) ? context.docs.config.llmsTxt : {};
|
|
@@ -407,7 +407,7 @@ function renderAgentsDocument(context, request) {
|
|
|
407
407
|
function buildAgentSpec(context, request) {
|
|
408
408
|
const url = new URL(request.url);
|
|
409
409
|
const origin = url.origin;
|
|
410
|
-
const pages =
|
|
410
|
+
const pages = _chunkTWHXBMLJcjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs).filter(
|
|
411
411
|
(page) => !context.isPathGuarded(page.href)
|
|
412
412
|
);
|
|
413
413
|
const spec = _chunkV3UOEWCBcjs.docsEngine.call(void 0, ).buildDocsAgentDiscoverySpec(getDocsDiscoveryOptions(context, request));
|
|
@@ -495,7 +495,7 @@ function buildPublicConfig(context) {
|
|
|
495
495
|
};
|
|
496
496
|
}
|
|
497
497
|
function buildDiagnostics(context) {
|
|
498
|
-
const pages =
|
|
498
|
+
const pages = _chunkTWHXBMLJcjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs);
|
|
499
499
|
const diagnostics = _chunkV3UOEWCBcjs.docsEngine.call(void 0, ).buildDocsDiagnostics(context.docs.config, {
|
|
500
500
|
entry: context.docs.entry,
|
|
501
501
|
mcp: {
|
|
@@ -565,13 +565,13 @@ async function resolveAPIContext(options) {
|
|
|
565
565
|
config: options.config,
|
|
566
566
|
configPath: options.configPath
|
|
567
567
|
}));
|
|
568
|
-
const docs = isResolvedDocsConfig(docsInput) ? docsInput : await
|
|
568
|
+
const docs = isResolvedDocsConfig(docsInput) ? docsInput : await _chunkKLNFJDFMcjs.resolveDocsConfig.call(void 0, docsInput, { root, srcDir });
|
|
569
569
|
const guardedPaths = new Set(_nullishCoalesce(_optionalChain([runtimeConfig, 'optionalAccess', _24 => _24.guardedPaths]), () => ( [])));
|
|
570
570
|
return {
|
|
571
571
|
root,
|
|
572
572
|
srcDir,
|
|
573
573
|
docs,
|
|
574
|
-
contentDir:
|
|
574
|
+
contentDir: _chunkTWHXBMLJcjs.resolveFarmDocsContentDir.call(void 0, docs, { root, srcDir }),
|
|
575
575
|
diagnostics: options.diagnostics === true,
|
|
576
576
|
isPathGuarded: _nullishCoalesce(options.isPathGuarded, () => ( ((pathname) => guardedPaths.has(pathname))))
|
|
577
577
|
};
|
|
@@ -630,12 +630,12 @@ async function handleDocsAPIGet(request, context) {
|
|
|
630
630
|
if (format === "markdown" || url.pathname.endsWith(".md")) {
|
|
631
631
|
const pathParam = url.searchParams.get("path") || url.searchParams.get("slug");
|
|
632
632
|
const slug = normalizeDocsApiSlug(_nullishCoalesce(_nullishCoalesce(pathParam, () => ( pathTarget.slug)), () => ( "")), context.docs);
|
|
633
|
-
const page =
|
|
633
|
+
const page = _chunkTWHXBMLJcjs.loadFarmDocsPage.call(void 0, context.contentDir, context.docs, slug);
|
|
634
634
|
if (!page || context.isPathGuarded(page.href)) {
|
|
635
635
|
return text("Docs page not found\n", "text/plain; charset=utf-8", { status: 404 });
|
|
636
636
|
}
|
|
637
637
|
return text(
|
|
638
|
-
_chunkV3UOEWCBcjs.docsEngine.call(void 0, ).renderDocsMarkdownDocument(
|
|
638
|
+
_chunkV3UOEWCBcjs.docsEngine.call(void 0, ).renderDocsMarkdownDocument(_chunkTWHXBMLJcjs.toFarmDocsMarkdownPage.call(void 0, page), {
|
|
639
639
|
origin: new URL(request.url).origin,
|
|
640
640
|
llms: getDocsLlmsOptions(context, request),
|
|
641
641
|
sitemap: context.docs.config.sitemap
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkH33PJEXNcjs = require('./chunk-H33PJEXN.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkD7UQC4O6cjs = require('./chunk-D7UQC4O6.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -105,10 +105,10 @@ function collectFarmDefaultMCPPages(sources, options) {
|
|
|
105
105
|
for (const source of sources) {
|
|
106
106
|
const module = isRecord(source.module) ? source.module : void 0;
|
|
107
107
|
if (_optionalChain([module, 'optionalAccess', _ => _.__farmRouteGuard])) continue;
|
|
108
|
-
if (!
|
|
108
|
+
if (!_chunkD7UQC4O6cjs.isFarmMarkdownMirrorExposed.call(void 0, options.markdown, source.pattern)) continue;
|
|
109
109
|
readable.push({ pattern: source.pattern, metadata: _optionalChain([module, 'optionalAccess', _2 => _2.metadata]) });
|
|
110
110
|
}
|
|
111
|
-
return
|
|
111
|
+
return _chunkH33PJEXNcjs.collectFarmLlmsTxtPages.call(void 0, readable, {
|
|
112
112
|
origin: options.origin,
|
|
113
113
|
basePath: options.basePath,
|
|
114
114
|
markdown: options.markdown
|
|
@@ -118,7 +118,7 @@ function collectFarmDefaultMCPPages(sources, options) {
|
|
|
118
118
|
url: `${options.origin}${_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, page.path, options.basePath)}`,
|
|
119
119
|
...page.description ? { description: page.description } : {},
|
|
120
120
|
markdownUrl: `${options.origin}${_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0,
|
|
121
|
-
|
|
121
|
+
_chunkD7UQC4O6cjs.getFarmMarkdownMirrorPath.call(void 0, page.path),
|
|
122
122
|
options.basePath
|
|
123
123
|
)}`
|
|
124
124
|
}));
|