@farm.js/core 0.1.37 → 0.1.39
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-BC0bAGVF.d.mts → agent-mcp-BhneNPb4.d.mts} +1 -1
- package/dist/{agent-mcp-jyDHbQKe.d.ts → agent-mcp-HcTYQmNX.d.ts} +1 -1
- package/dist/{agent-mcp-handler-SJAHFSPI.cjs → agent-mcp-handler-MRGP3WJ3.cjs} +5 -5
- package/dist/{agent-mcp-handler-LPJ2CADR.mjs → agent-mcp-handler-OLRMZONF.mjs} +4 -4
- package/dist/agent-runtime.cjs +3 -3
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/agent-runtime.mjs +2 -2
- package/dist/api/client.cjs +3 -3
- package/dist/api/client.mjs +2 -2
- package/dist/api/route-manager.cjs +5 -5
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/route-manager.mjs +4 -4
- package/dist/api/runtime.cjs +4 -4
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api/runtime.mjs +3 -3
- package/dist/api.cjs +7 -7
- package/dist/api.d.mts +3 -3
- package/dist/api.d.ts +3 -3
- package/dist/api.mjs +6 -6
- package/dist/{app-CKO3iN1c.d.ts → app-CMkoghtp.d.ts} +21 -3
- package/dist/{app-Cbkj9ufe.d.mts → app-DVzmmbNO.d.mts} +21 -3
- package/dist/app-markdown.cjs +4 -4
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/app-markdown.mjs +3 -3
- package/dist/chunk-2ZYGC6SS.cjs +576 -0
- package/dist/{chunk-75X755YZ.cjs → chunk-34UCJRQO.cjs} +2 -2
- package/dist/{chunk-CVH2BXPY.cjs → chunk-3LOLJTFV.cjs} +6 -6
- package/dist/{chunk-4GPOC4LN.cjs → chunk-472NCAZ7.cjs} +3 -3
- package/dist/{chunk-O6WAEAX3.mjs → chunk-5BWWFHR2.mjs} +70 -15
- package/dist/{chunk-6LGFV2CQ.cjs → chunk-5OKBARDN.cjs} +2 -2
- package/dist/{chunk-3IP27TCG.cjs → chunk-5PWXMJOH.cjs} +19 -19
- package/dist/{chunk-WT4TGLXT.cjs → chunk-5ULKUBIA.cjs} +6 -6
- package/dist/{chunk-WRPHYQVY.mjs → chunk-677THUVP.mjs} +1 -1
- package/dist/chunk-6BK3K2GB.mjs +318 -0
- package/dist/{chunk-HEVMCTSR.mjs → chunk-6HB6V3R7.mjs} +1 -1
- package/dist/{chunk-NICDYKBS.cjs → chunk-6XWDE2P2.cjs} +22 -4
- package/dist/{chunk-CXEN47J3.mjs → chunk-73WX6PRY.mjs} +25 -0
- package/dist/{chunk-EXG5LD6B.mjs → chunk-75HN5IZ3.mjs} +21 -9
- package/dist/{chunk-7O5M4UKW.cjs → chunk-A657YSP4.cjs} +2 -2
- package/dist/{chunk-LBDP3YT3.mjs → chunk-ARC7I3O2.mjs} +1 -1
- package/dist/{chunk-Q5FYSK45.cjs → chunk-AS2VPMEE.cjs} +640 -521
- package/dist/{chunk-Z5BEWYVO.mjs → chunk-ATSDUUFK.mjs} +27 -1
- package/dist/{chunk-EMMQ64QW.cjs → chunk-B5J2YVG7.cjs} +16 -16
- package/dist/{chunk-FWE7LEQC.cjs → chunk-BD3D7EZV.cjs} +4 -4
- package/dist/{chunk-Z7LA7MHQ.mjs → chunk-BFJTHYTN.mjs} +1 -1
- package/dist/{chunk-UJZLSXUB.cjs → chunk-BWIQR4DH.cjs} +30 -4
- package/dist/{chunk-W2YDNK66.cjs → chunk-BXDJXFQG.cjs} +4 -4
- package/dist/{chunk-MCIZVNOQ.mjs → chunk-BZHXGVMA.mjs} +1 -1
- package/dist/{chunk-7DWNJI73.cjs → chunk-CIOT4HGT.cjs} +37 -19
- package/dist/{chunk-KDTBF3UU.mjs → chunk-CNNOLE4O.mjs} +1 -1
- package/dist/{chunk-TDNWPAVR.mjs → chunk-CUM5NYL5.mjs} +1 -1
- package/dist/{chunk-HITLGIAO.cjs → chunk-CY2ZQ5C6.cjs} +7 -6
- package/dist/{chunk-KPFKMDM7.mjs → chunk-EGCTIS5F.mjs} +2 -2
- package/dist/{chunk-VR4GD5I3.cjs → chunk-EIPC3FDA.cjs} +12 -4
- package/dist/{chunk-B5PFZLKV.cjs → chunk-EKN7NSZO.cjs} +25 -8
- package/dist/{chunk-6SJ2KJTA.mjs → chunk-EPYU2EBL.mjs} +1 -1
- package/dist/{chunk-LBGILORX.mjs → chunk-GKBWWRBG.mjs} +101 -10
- package/dist/{chunk-PTZ2TVNE.cjs → chunk-H5CLOUZS.cjs} +5 -5
- package/dist/{chunk-DTSROJ5J.mjs → chunk-HD5CF3OE.mjs} +1 -1
- package/dist/{chunk-3A4KGQYI.cjs → chunk-HRETEZ2Z.cjs} +27 -15
- package/dist/{chunk-ATWHHSY2.cjs → chunk-HRSAQ23K.cjs} +7 -7
- package/dist/{chunk-IAIYV4RZ.mjs → chunk-HXRYZWTA.mjs} +1 -1
- package/dist/{chunk-4P6ULFMD.mjs → chunk-HYTZYOW2.mjs} +222 -103
- package/dist/{chunk-HMRSWN47.mjs → chunk-INL3THCU.mjs} +1 -1
- package/dist/{chunk-FBOJ55OM.mjs → chunk-IVLZZZEI.mjs} +1 -1
- package/dist/{chunk-ENLZ4R3Y.mjs → chunk-J7K2NZD6.mjs} +7 -6
- package/dist/{chunk-PMQHMWZU.cjs → chunk-JCYYXBAJ.cjs} +3 -3
- package/dist/{chunk-K3SAEIM3.mjs → chunk-KTSUBU2E.mjs} +2 -2
- package/dist/{chunk-LPFV45AY.cjs → chunk-LMPAPBUA.cjs} +19 -19
- package/dist/{chunk-EK4QAEFZ.cjs → chunk-LZESP4IR.cjs} +25 -0
- package/dist/{chunk-TW4GYDBJ.mjs → chunk-MLY2RP5R.mjs} +10 -2
- package/dist/{chunk-BHY547NB.cjs → chunk-NBBEQLOK.cjs} +9 -9
- package/dist/{chunk-WQ7T2263.mjs → chunk-OAHTRMIC.mjs} +3 -3
- package/dist/{chunk-HZFM2LWQ.mjs → chunk-P3PLW4FR.mjs} +34 -2
- package/dist/{chunk-UH6QN5NL.mjs → chunk-P664ZVTV.mjs} +2 -2
- package/dist/{chunk-TE2G5ION.cjs → chunk-PGZDEPTM.cjs} +88 -33
- package/dist/{chunk-3KGDJLJK.mjs → chunk-POSPE3IO.mjs} +19 -1
- package/dist/{chunk-FGRYBX5X.mjs → chunk-PVZE2JGJ.mjs} +2 -2
- package/dist/{chunk-TPLJVC7E.mjs → chunk-QFW2IH5E.mjs} +23 -6
- package/dist/{chunk-5BXGGEC7.cjs → chunk-QG775BRV.cjs} +17 -17
- package/dist/{chunk-S3VWVTVA.mjs → chunk-QRKIMN7T.mjs} +13 -1
- package/dist/chunk-QTXBII4Z.cjs +632 -0
- package/dist/{chunk-NQ6QFZWD.cjs → chunk-QUCXCDE2.cjs} +1 -1
- package/dist/{chunk-NFMDCAOS.mjs → chunk-QYMZOOC5.mjs} +3 -3
- package/dist/{chunk-CI6E3UOH.cjs → chunk-RG4A6LB2.cjs} +7 -7
- package/dist/{chunk-LOFKRKO7.cjs → chunk-RVXFINNS.cjs} +113 -22
- package/dist/{chunk-7SQ5SGYZ.cjs → chunk-RW63BOV7.cjs} +2 -2
- package/dist/{chunk-U6MPZ35Q.cjs → chunk-RWFLWR5J.cjs} +8 -8
- package/dist/{chunk-EUV4YR3V.cjs → chunk-SGBJ247Q.cjs} +18 -2
- package/dist/{chunk-J3ANCZKA.mjs → chunk-SKVTP5PR.mjs} +1 -1
- package/dist/{chunk-YCKO6FRS.mjs → chunk-SOP2EAA6.mjs} +1 -1
- package/dist/{chunk-ND2CWPOD.mjs → chunk-TS4JHGUJ.mjs} +1 -1
- package/dist/chunk-U6QLDL3G.mjs +576 -0
- package/dist/{chunk-OW67PDDS.cjs → chunk-ULASELLA.cjs} +13 -1
- package/dist/{chunk-4GWRFP22.cjs → chunk-UPJLHLJU.cjs} +35 -3
- package/dist/{chunk-WWIKMBRN.mjs → chunk-VNGH5MLF.mjs} +17 -1
- package/dist/{chunk-NNSAQX3U.mjs → chunk-VT4WFRHA.mjs} +1 -1
- package/dist/{chunk-JPNFPAZ4.mjs → chunk-VWBHM3F6.mjs} +2 -2
- package/dist/{chunk-ADOAUDQ6.cjs → chunk-VXEEATVD.cjs} +2 -2
- package/dist/{chunk-RRMVL6CJ.mjs → chunk-W36M2BQ4.mjs} +1 -1
- package/dist/{chunk-4WQ6PGSJ.cjs → chunk-WEW2JVA4.cjs} +4 -4
- package/dist/{chunk-4E5WBPEG.mjs → chunk-WFRT7JPX.mjs} +8 -533
- package/dist/{chunk-VXAWRDK7.mjs → chunk-WLL43JMO.mjs} +1 -1
- package/dist/chunk-WW46B6HA.cjs +318 -0
- package/dist/{chunk-D3C5LBQY.cjs → chunk-WXJLNP33.cjs} +2 -2
- package/dist/{chunk-NDILNQ4L.cjs → chunk-XKG2BLFN.cjs} +2 -2
- package/dist/{chunk-6TJITR2B.cjs → chunk-YFYUYWL7.cjs} +870 -751
- package/dist/{chunk-XOPOIFTJ.mjs → chunk-YKZRDB5Z.mjs} +25 -7
- package/dist/{chunk-K4I4O5TS.mjs → chunk-ZUPXLIGB.mjs} +790 -671
- package/dist/{chunk-G2TEB74S.cjs → chunk-ZXH4TS3F.cjs} +2 -2
- package/dist/{client-plugins-CV4eJ9De.d.mts → client-plugins-CsCuCLBz.d.mts} +58 -7
- package/dist/{client-plugins-C8DjftDF.d.ts → client-plugins-D0ke-Hc8.d.ts} +58 -7
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.cjs +7 -7
- package/dist/client.d.mts +5 -5
- package/dist/client.d.ts +5 -5
- package/dist/client.mjs +6 -6
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/{devtools-KVOY2TCZ.mjs → devtools-5AFIPVUJ.mjs} +8 -6
- package/dist/{devtools-JXFQNWSH.cjs → devtools-LW4QQ5J3.cjs} +9 -7
- package/dist/docs.cjs +12 -10
- package/dist/docs.d.mts +20 -2
- package/dist/docs.d.ts +20 -2
- package/dist/docs.mjs +11 -9
- package/dist/headers.cjs +6 -4
- package/dist/headers.d.mts +11 -1
- package/dist/headers.d.ts +11 -1
- package/dist/headers.mjs +5 -3
- package/dist/index.cjs +55 -42
- package/dist/index.d.mts +15 -15
- package/dist/index.d.ts +15 -15
- package/dist/index.mjs +55 -42
- package/dist/integrations.cjs +5 -3
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/integrations.mjs +4 -2
- package/dist/internal/app-markdown-runtime.cjs +3 -3
- package/dist/internal/app-markdown-runtime.d.mts +2 -2
- package/dist/internal/app-markdown-runtime.d.ts +2 -2
- package/dist/internal/app-markdown-runtime.mjs +2 -2
- package/dist/internal/build-runtime.cjs +30 -29
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +29 -28
- package/dist/internal/cli-runtime.cjs +11 -9
- package/dist/internal/cli-runtime.mjs +10 -8
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +9 -7
- package/dist/internal/config-runtime.d.mts +2 -2
- package/dist/internal/config-runtime.d.ts +2 -2
- package/dist/internal/config-runtime.mjs +8 -6
- package/dist/internal/docs-precompiled-runtime.cjs +19 -13
- package/dist/internal/docs-precompiled-runtime.d.mts +5 -0
- package/dist/internal/docs-precompiled-runtime.d.ts +5 -0
- package/dist/internal/docs-precompiled-runtime.mjs +14 -8
- package/dist/internal/infra-analytics-runtime.cjs +5 -5
- package/dist/internal/infra-analytics-runtime.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-node-env.cjs +6 -2
- package/dist/internal/production-node-env.d.mts +10 -1
- package/dist/internal/production-node-env.d.ts +10 -1
- package/dist/internal/production-node-env.mjs +5 -1
- package/dist/internal/production-runtime.cjs +38 -16
- package/dist/internal/production-runtime.d.mts +51 -11
- package/dist/internal/production-runtime.d.ts +51 -11
- package/dist/internal/production-runtime.mjs +40 -18
- package/dist/markdown.cjs +8 -2
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/markdown.mjs +7 -1
- package/dist/middleware.cjs +10 -8
- package/dist/middleware.d.mts +24 -4
- package/dist/middleware.d.ts +24 -4
- package/dist/middleware.mjs +10 -8
- package/dist/navigation.cjs +6 -6
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/navigation.mjs +5 -5
- package/dist/plugin.cjs +23 -22
- package/dist/plugin.d.mts +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.mjs +22 -21
- package/dist/{production-runtime-C2kkrPVZ.d.ts → production-runtime-BaI3WHnV.d.ts} +1 -1
- package/dist/{production-runtime-Du_FHb2-.d.mts → production-runtime-DfRP0cV0.d.mts} +1 -1
- package/dist/query/client.cjs +8 -8
- package/dist/query/client.mjs +3 -3
- package/dist/{render-plan-BnnPTpus.d.ts → render-plan-CfIdJKAf.d.ts} +1 -1
- package/dist/{render-plan-Cgx7v8tJ.d.mts → render-plan-Dg8RBYFa.d.mts} +1 -1
- package/dist/renderer-client.cjs +5 -5
- package/dist/renderer-client.d.mts +3 -3
- package/dist/renderer-client.d.ts +3 -3
- package/dist/renderer-client.mjs +2 -2
- package/dist/renderer.d.mts +13 -4
- package/dist/renderer.d.ts +13 -4
- package/dist/{request-BNWr7r5e.d.ts → request-CEbHIIl4.d.ts} +4 -2
- package/dist/{request-sKayKcop.d.mts → request-DfE02G_A.d.mts} +4 -2
- package/dist/request.cjs +3 -3
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/request.mjs +2 -2
- package/dist/{route-rendering-DWFp3Yq4.d.mts → route-rendering-BHyOfXjD.d.mts} +1 -1
- package/dist/{route-rendering-Bx4Auw6Q.d.ts → route-rendering-C4oHbv6C.d.ts} +1 -1
- package/dist/{router-BK6K42Ij.d.mts → router-DwhA61SB.d.mts} +1 -1
- package/dist/{router-DnW_2tQi.d.ts → router-uRN_29Em.d.ts} +1 -1
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/{runtime-DJDaCMd_.d.mts → runtime-BEdHhN4C.d.mts} +1 -1
- package/dist/{runtime-CA3Ei5k_.d.ts → runtime-COk03hmx.d.ts} +1 -1
- package/dist/server-fn.cjs +3 -3
- package/dist/server-fn.mjs +2 -2
- package/dist/server-plugins.cjs +5 -5
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server-plugins.mjs +4 -4
- package/dist/server-query.cjs +4 -4
- package/dist/server-query.mjs +3 -3
- package/dist/server.cjs +49 -48
- package/dist/server.d.mts +7 -7
- package/dist/server.d.ts +7 -7
- package/dist/server.mjs +27 -26
- package/dist/{spa-router-Mwbd7g2L.d.ts → spa-router-DrVOBVGg.d.ts} +2 -2
- package/dist/{spa-router-D6fUA4Rn.d.mts → spa-router-w4aFOuyn.d.mts} +2 -2
- package/dist/testing.cjs +5 -5
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.mjs +4 -4
- package/dist/theme/server.cjs +4 -4
- package/dist/theme/server.mjs +3 -3
- package/dist/{utils-p9Hs-jCc.d.mts → utils-BtYehqeU.d.mts} +1 -1
- package/dist/{utils-BwVcAfUR.d.ts → utils-Dhuqwmd2.d.ts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +23 -22
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.mjs +22 -21
- package/package.json +1 -1
- package/dist/chunk-655RLQQL.mjs +0 -43
- package/dist/chunk-MRMI32SN.cjs +0 -1157
- package/dist/chunk-MT763TDW.cjs +0 -43
|
@@ -2,9 +2,10 @@ import {
|
|
|
2
2
|
defineSchema
|
|
3
3
|
} from "./chunk-44SYJEG3.mjs";
|
|
4
4
|
import {
|
|
5
|
+
assertSupportedMiddlewareMatcher,
|
|
5
6
|
compileMiddlewareConfig,
|
|
6
7
|
matchesCompiledMiddlewareConfig
|
|
7
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-P3PLW4FR.mjs";
|
|
8
9
|
import {
|
|
9
10
|
bufferFarmRequestBody,
|
|
10
11
|
clearRequestContext,
|
|
@@ -285,6 +286,15 @@ function resolveIntegrationPlugins(integrations) {
|
|
|
285
286
|
if (!integration || !isFarmIntegration(integration)) {
|
|
286
287
|
continue;
|
|
287
288
|
}
|
|
289
|
+
for (const entry of integration.middleware || []) {
|
|
290
|
+
if (!entry.matcher) continue;
|
|
291
|
+
const matchers = Array.isArray(entry.matcher) ? entry.matcher : [entry.matcher];
|
|
292
|
+
try {
|
|
293
|
+
matchers.forEach(assertSupportedMiddlewareMatcher);
|
|
294
|
+
} catch (error) {
|
|
295
|
+
throw new Error(`Integration "${key}": ${error.message}`);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
288
298
|
const owner = createIntegrationPluginOwner(key, integration, "lifecycle");
|
|
289
299
|
plugins.push(withIntegrationPluginOwner(createIntegrationPlugin(key, integration), owner));
|
|
290
300
|
plugins.push(...resolveIntegrationPluginContributions(key, integration));
|
|
@@ -2033,6 +2043,21 @@ function resolveIntegrationMiddlewareParams(entry, pathname, config) {
|
|
|
2033
2043
|
return null;
|
|
2034
2044
|
}
|
|
2035
2045
|
__name(resolveIntegrationMiddlewareParams, "resolveIntegrationMiddlewareParams");
|
|
2046
|
+
function integrationMiddlewareMayHandlePath(integrations, pathname, catchAllProbe) {
|
|
2047
|
+
if (!integrations) return false;
|
|
2048
|
+
const covers = /* @__PURE__ */ __name((entry) => resolveIntegrationMiddlewareParams(entry, pathname, void 0) !== null, "covers");
|
|
2049
|
+
return Object.values(integrations).some(
|
|
2050
|
+
(integration) => isFarmIntegration(integration) && (integration.middleware || []).some((entry) => {
|
|
2051
|
+
if (catchAllProbe === void 0) return covers(entry);
|
|
2052
|
+
if (!entry.matcher) return false;
|
|
2053
|
+
const specific = (Array.isArray(entry.matcher) ? entry.matcher : [entry.matcher]).filter(
|
|
2054
|
+
(matcher) => resolveIntegrationMiddlewareParams({ matcher }, catchAllProbe, void 0) === null
|
|
2055
|
+
);
|
|
2056
|
+
return specific.length > 0 && covers({ matcher: specific });
|
|
2057
|
+
})
|
|
2058
|
+
);
|
|
2059
|
+
}
|
|
2060
|
+
__name(integrationMiddlewareMayHandlePath, "integrationMiddlewareMayHandlePath");
|
|
2036
2061
|
var FARM_INTEGRATION_API_BASE_PATH_KEY = "__farmAPIServerBasePath";
|
|
2037
2062
|
var integrationAPIPathnames = /* @__PURE__ */ new WeakMap();
|
|
2038
2063
|
function getIntegrationAPIPathnames(config) {
|
|
@@ -2183,5 +2208,6 @@ export {
|
|
|
2183
2208
|
getRegisteredIntegrationAPIManifest,
|
|
2184
2209
|
dispatchIntegrationRequest,
|
|
2185
2210
|
dispatchIntegrationRequests,
|
|
2211
|
+
integrationMiddlewareMayHandlePath,
|
|
2186
2212
|
FARM_INTEGRATION_API_BASE_PATH_KEY
|
|
2187
2213
|
};
|
|
@@ -7,13 +7,13 @@ var _chunkSU7MH53Pcjs = require('./chunk-SU7MH53P.cjs');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkBD3D7EZVcjs = require('./chunk-BD3D7EZV.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunkS6FJO323cjs = require('./chunk-S6FJO323.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkULASELLAcjs = require('./chunk-ULASELLA.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
var _chunkBIDYX3SLcjs = require('./chunk-BIDYX3SL.cjs');
|
|
@@ -52,7 +52,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, shouldBlockUnload, "shouldBlockUnload");
|
|
|
52
52
|
function navigateViaRouter(href, basePath, replace, options = {}) {
|
|
53
53
|
if (typeof window === "undefined") return;
|
|
54
54
|
const url = _chunkI57LW5VZcjs.applyFarmBasePath.call(void 0, href, basePath);
|
|
55
|
-
const spaRouter =
|
|
55
|
+
const spaRouter = _chunkBD3D7EZVcjs.getInstalledFarmSPARouter.call(void 0, );
|
|
56
56
|
if (spaRouter) {
|
|
57
57
|
void spaRouter.navigate(url, {
|
|
58
58
|
replace,
|
|
@@ -65,7 +65,7 @@ function navigateViaRouter(href, basePath, replace, options = {}) {
|
|
|
65
65
|
} else {
|
|
66
66
|
window.history.pushState(null, "", url);
|
|
67
67
|
}
|
|
68
|
-
|
|
68
|
+
_chunkBD3D7EZVcjs.notifyHistoryChange.call(void 0, "url-search");
|
|
69
69
|
}
|
|
70
70
|
_chunkS3JO3N4Hcjs.__name.call(void 0, navigateViaRouter, "navigateViaRouter");
|
|
71
71
|
function useRouter(options = {}) {
|
|
@@ -85,7 +85,7 @@ function useRouter(options = {}) {
|
|
|
85
85
|
setState(readRouterState(basePath, routeMatcher));
|
|
86
86
|
}, "handlePopState");
|
|
87
87
|
handlePopState();
|
|
88
|
-
const unsubscribe =
|
|
88
|
+
const unsubscribe = _chunkBD3D7EZVcjs.subscribeHistoryChange.call(void 0, handlePopState);
|
|
89
89
|
return unsubscribe;
|
|
90
90
|
}, [basePath, routeMatcher]);
|
|
91
91
|
const push = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (href, navigateOptions) => {
|
|
@@ -96,11 +96,11 @@ function useRouter(options = {}) {
|
|
|
96
96
|
}, "replace");
|
|
97
97
|
const pushState = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (pageState, href) => {
|
|
98
98
|
if (typeof window === "undefined") return;
|
|
99
|
-
|
|
99
|
+
_chunkBD3D7EZVcjs.getRouter.call(void 0, ).pushState(pageState, resolveClientHref(href, basePath));
|
|
100
100
|
}, "pushState");
|
|
101
101
|
const replaceState = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (pageState, href) => {
|
|
102
102
|
if (typeof window === "undefined") return;
|
|
103
|
-
|
|
103
|
+
_chunkBD3D7EZVcjs.getRouter.call(void 0, ).replaceState(pageState, resolveClientHref(href, basePath));
|
|
104
104
|
}, "replaceState");
|
|
105
105
|
const back = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => {
|
|
106
106
|
if (typeof window !== "undefined") {
|
|
@@ -124,25 +124,25 @@ function useRouter(options = {}) {
|
|
|
124
124
|
}
|
|
125
125
|
_chunkS3JO3N4Hcjs.__name.call(void 0, useRouter, "useRouter");
|
|
126
126
|
function usePageState() {
|
|
127
|
-
const [state, setState] = _react.useState.call(void 0, () =>
|
|
127
|
+
const [state, setState] = _react.useState.call(void 0, () => _chunkBD3D7EZVcjs.readPageState.call(void 0, ));
|
|
128
128
|
_react.useEffect.call(void 0, () => {
|
|
129
129
|
if (typeof window === "undefined") return;
|
|
130
130
|
const handlePopState = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => {
|
|
131
|
-
setState(
|
|
131
|
+
setState(_chunkBD3D7EZVcjs.readPageState.call(void 0, ));
|
|
132
132
|
}, "handlePopState");
|
|
133
133
|
handlePopState();
|
|
134
|
-
return
|
|
134
|
+
return _chunkBD3D7EZVcjs.subscribeHistoryChange.call(void 0, handlePopState);
|
|
135
135
|
}, []);
|
|
136
136
|
return state;
|
|
137
137
|
}
|
|
138
138
|
_chunkS3JO3N4Hcjs.__name.call(void 0, usePageState, "usePageState");
|
|
139
139
|
function useNavigation() {
|
|
140
140
|
const [state, setState] = _react.useState.call(void 0,
|
|
141
|
-
() =>
|
|
141
|
+
() => _chunkBD3D7EZVcjs.getRouter.call(void 0, ).getNavigationState()
|
|
142
142
|
);
|
|
143
143
|
_react.useEffect.call(void 0, () => {
|
|
144
144
|
if (typeof window === "undefined") return;
|
|
145
|
-
return
|
|
145
|
+
return _chunkBD3D7EZVcjs.getRouter.call(void 0, ).subscribeNavigation(setState);
|
|
146
146
|
}, []);
|
|
147
147
|
return state;
|
|
148
148
|
}
|
|
@@ -155,7 +155,7 @@ function useBlocker(options) {
|
|
|
155
155
|
if (typeof window === "undefined" || !active) {
|
|
156
156
|
return;
|
|
157
157
|
}
|
|
158
|
-
return
|
|
158
|
+
return _chunkBD3D7EZVcjs.getRouter.call(void 0, ).addBlocker(
|
|
159
159
|
async (context) => {
|
|
160
160
|
const current = optionsRef.current;
|
|
161
161
|
const when = typeof current.when === "function" ? current.when(context) : current.when;
|
|
@@ -179,7 +179,7 @@ function useScrollRestoration(key) {
|
|
|
179
179
|
_react.useEffect.call(void 0, () => {
|
|
180
180
|
const element = ref.current;
|
|
181
181
|
if (!element) return;
|
|
182
|
-
return
|
|
182
|
+
return _chunkBD3D7EZVcjs.getRouter.call(void 0, ).registerScrollElement(key, element);
|
|
183
183
|
}, [key]);
|
|
184
184
|
return ref;
|
|
185
185
|
}
|
|
@@ -201,7 +201,7 @@ function readRouterState(basePath, routeMatcher) {
|
|
|
201
201
|
pathname,
|
|
202
202
|
searchParams: url.searchParams,
|
|
203
203
|
params: _optionalChain([routeMatcher, 'optionalAccess', _5 => _5.match, 'call', _6 => _6(routePathname), 'optionalAccess', _7 => _7.params]) || {},
|
|
204
|
-
pageState: typeof window === "undefined" ? null :
|
|
204
|
+
pageState: typeof window === "undefined" ? null : _chunkBD3D7EZVcjs.readPageState.call(void 0, )
|
|
205
205
|
};
|
|
206
206
|
}
|
|
207
207
|
_chunkS3JO3N4Hcjs.__name.call(void 0, readRouterState, "readRouterState");
|
|
@@ -213,7 +213,7 @@ function readCurrentUrl() {
|
|
|
213
213
|
return void 0;
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
|
-
const request =
|
|
216
|
+
const request = _chunkULASELLAcjs._resolveCurrentRequest.call(void 0, );
|
|
217
217
|
if (!request) return void 0;
|
|
218
218
|
try {
|
|
219
219
|
return new URL(request.url);
|
|
@@ -17,7 +17,7 @@ var _chunkJ7FSKED3cjs = require('./chunk-J7FSKED3.cjs');
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkLZESP4IRcjs = require('./chunk-LZESP4IR.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
@@ -31,7 +31,7 @@ var _chunkQBK2AA4Ucjs = require('./chunk-QBK2AA4U.cjs');
|
|
|
31
31
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
32
32
|
|
|
33
33
|
// src/client/metadata-reconciler.ts
|
|
34
|
-
var MANAGED_ATTRIBUTE =
|
|
34
|
+
var MANAGED_ATTRIBUTE = _chunkLZESP4IRcjs.FARM_METADATA_ATTRIBUTE;
|
|
35
35
|
var OWNED_SELECTORS = [
|
|
36
36
|
'meta[name="description"]',
|
|
37
37
|
'meta[name="keywords"]',
|
|
@@ -66,8 +66,8 @@ function removeAll(selector) {
|
|
|
66
66
|
}
|
|
67
67
|
_chunkS3JO3N4Hcjs.__name.call(void 0, removeAll, "removeAll");
|
|
68
68
|
function applyFarmMetadataToDocument(metadata, pathname) {
|
|
69
|
-
document.title =
|
|
70
|
-
const rendered =
|
|
69
|
+
document.title = _chunkLZESP4IRcjs.resolveMetadataTitle.call(void 0, _optionalChain([metadata, 'optionalAccess', _ => _.title])) || "Farm.js App";
|
|
70
|
+
const rendered = _chunkLZESP4IRcjs.renderMetadataHead.call(void 0, metadata, { pathname });
|
|
71
71
|
const template = document.createElement("template");
|
|
72
72
|
template.innerHTML = rendered.tags;
|
|
73
73
|
const viewport = document.createElement("template");
|
|
@@ -4,7 +4,8 @@ var _chunkG643DQCHcjs = require('./chunk-G643DQCH.cjs');
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
var _chunkUPJLHLJUcjs = require('./chunk-UPJLHLJU.cjs');
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
|
|
@@ -285,6 +286,15 @@ function resolveIntegrationPlugins(integrations) {
|
|
|
285
286
|
if (!integration || !isFarmIntegration(integration)) {
|
|
286
287
|
continue;
|
|
287
288
|
}
|
|
289
|
+
for (const entry of integration.middleware || []) {
|
|
290
|
+
if (!entry.matcher) continue;
|
|
291
|
+
const matchers = Array.isArray(entry.matcher) ? entry.matcher : [entry.matcher];
|
|
292
|
+
try {
|
|
293
|
+
matchers.forEach(_chunkUPJLHLJUcjs.assertSupportedMiddlewareMatcher);
|
|
294
|
+
} catch (error) {
|
|
295
|
+
throw new Error(`Integration "${key}": ${error.message}`);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
288
298
|
const owner = createIntegrationPluginOwner(key, integration, "lifecycle");
|
|
289
299
|
plugins.push(withIntegrationPluginOwner(createIntegrationPlugin(key, integration), owner));
|
|
290
300
|
plugins.push(...resolveIntegrationPluginContributions(key, integration));
|
|
@@ -2021,18 +2031,33 @@ function resolveIntegrationMiddlewareParams(entry, pathname, config) {
|
|
|
2021
2031
|
}
|
|
2022
2032
|
let compiled = compiledIntegrationGuards.get(entry);
|
|
2023
2033
|
if (!compiled) {
|
|
2024
|
-
compiled =
|
|
2034
|
+
compiled = _chunkUPJLHLJUcjs.compileMiddlewareConfig.call(void 0, {
|
|
2025
2035
|
matcher: typeof entry.matcher === "string" ? entry.matcher : [...entry.matcher]
|
|
2026
2036
|
});
|
|
2027
2037
|
compiledIntegrationGuards.set(entry, compiled);
|
|
2028
2038
|
}
|
|
2029
2039
|
for (const candidate of candidates) {
|
|
2030
|
-
const result =
|
|
2040
|
+
const result = _chunkUPJLHLJUcjs.matchesCompiledMiddlewareConfig.call(void 0, candidate, compiled, noMiddlewareContext);
|
|
2031
2041
|
if (result.matched) return _nullishCoalesce(result.params, () => ( {}));
|
|
2032
2042
|
}
|
|
2033
2043
|
return null;
|
|
2034
2044
|
}
|
|
2035
2045
|
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveIntegrationMiddlewareParams, "resolveIntegrationMiddlewareParams");
|
|
2046
|
+
function integrationMiddlewareMayHandlePath(integrations, pathname, catchAllProbe) {
|
|
2047
|
+
if (!integrations) return false;
|
|
2048
|
+
const covers = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (entry) => resolveIntegrationMiddlewareParams(entry, pathname, void 0) !== null, "covers");
|
|
2049
|
+
return Object.values(integrations).some(
|
|
2050
|
+
(integration) => isFarmIntegration(integration) && (integration.middleware || []).some((entry) => {
|
|
2051
|
+
if (catchAllProbe === void 0) return covers(entry);
|
|
2052
|
+
if (!entry.matcher) return false;
|
|
2053
|
+
const specific = (Array.isArray(entry.matcher) ? entry.matcher : [entry.matcher]).filter(
|
|
2054
|
+
(matcher) => resolveIntegrationMiddlewareParams({ matcher }, catchAllProbe, void 0) === null
|
|
2055
|
+
);
|
|
2056
|
+
return specific.length > 0 && covers({ matcher: specific });
|
|
2057
|
+
})
|
|
2058
|
+
);
|
|
2059
|
+
}
|
|
2060
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, integrationMiddlewareMayHandlePath, "integrationMiddlewareMayHandlePath");
|
|
2036
2061
|
var FARM_INTEGRATION_API_BASE_PATH_KEY = "__farmAPIServerBasePath";
|
|
2037
2062
|
var integrationAPIPathnames = /* @__PURE__ */ new WeakMap();
|
|
2038
2063
|
function getIntegrationAPIPathnames(config) {
|
|
@@ -2184,4 +2209,5 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, normalizeMatcher, "normalizeMatcher");
|
|
|
2184
2209
|
|
|
2185
2210
|
|
|
2186
2211
|
|
|
2187
|
-
|
|
2212
|
+
|
|
2213
|
+
exports.getFarmPluginIntegrationContext = getFarmPluginIntegrationContext; exports.FARM_INTEGRATION_INTERNAL_DISPATCH_CONTEXT_KEY = FARM_INTEGRATION_INTERNAL_DISPATCH_CONTEXT_KEY; exports.FARM_INTEGRATION_SET_COOKIES_KEY = FARM_INTEGRATION_SET_COOKIES_KEY; exports.forwardIntegrationSetCookies = forwardIntegrationSetCookies; exports.defineIntegrationSchema = defineIntegrationSchema; exports.getFarmIntegrationPluginServerRuntime = getFarmIntegrationPluginServerRuntime; exports.getFarmIntegrationPluginOwner = getFarmIntegrationPluginOwner; exports.createIntegrationRoute = createIntegrationRoute; exports.integrationRoute = integrationRoute; exports.defineIntegration = defineIntegration; exports.isFarmIntegration = isFarmIntegration; exports.resolveIntegrationPlugins = resolveIntegrationPlugins; exports.getIntegrationProviders = getIntegrationProviders; exports.isFarmIntegrationProviderComponentReference = isFarmIntegrationProviderComponentReference; exports.getIntegrationDocumentNavigationMatchers = getIntegrationDocumentNavigationMatchers; exports.getIntegrationSchemas = getIntegrationSchemas; exports.getRegisteredIntegrationRuntime = getRegisteredIntegrationRuntime; exports.getRegisteredIntegrations = getRegisteredIntegrations; exports.getRegisteredIntegrationSchemas = getRegisteredIntegrationSchemas; exports.matchIntegrationRoute = matchIntegrationRoute; exports.matchRegisteredIntegrationRoute = matchRegisteredIntegrationRoute; exports.getRegisteredIntegrationAPIManifest = getRegisteredIntegrationAPIManifest; exports.dispatchIntegrationRequest = dispatchIntegrationRequest; exports.dispatchIntegrationRequests = dispatchIntegrationRequests; exports.integrationMiddlewareMayHandlePath = integrationMiddlewareMayHandlePath; exports.FARM_INTEGRATION_API_BASE_PATH_KEY = FARM_INTEGRATION_API_BASE_PATH_KEY;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } 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 _chunkLMPAPBUAcjs = require('./chunk-LMPAPBUA.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkUPJLHLJUcjs = require('./chunk-UPJLHLJU.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkHLJ6MBUZcjs = require('./chunk-HLJ6MBUZ.cjs');
|
|
@@ -213,7 +213,7 @@ var _MiddlewareChainImpl = class _MiddlewareChainImpl {
|
|
|
213
213
|
*/
|
|
214
214
|
when(condition, fn) {
|
|
215
215
|
const conditionalMiddleware = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (ctx, next) => {
|
|
216
|
-
const shouldRun = typeof condition === "function" ?
|
|
216
|
+
const shouldRun = typeof condition === "function" ? _chunkUPJLHLJUcjs.matchesMiddlewarePredicate.call(void 0, condition, ctx) : condition;
|
|
217
217
|
if (!shouldRun) {
|
|
218
218
|
return next();
|
|
219
219
|
}
|
|
@@ -418,7 +418,7 @@ function farmMiddlewarePlugin(options = {}) {
|
|
|
418
418
|
mode: server.config.mode === "production" ? "production" : "development",
|
|
419
419
|
basePath: _nullishCoalesce(options.basePath, () => ( "/"))
|
|
420
420
|
});
|
|
421
|
-
manager = new (0,
|
|
421
|
+
manager = new (0, _chunkLMPAPBUAcjs.MiddlewareManager)(
|
|
422
422
|
getMiddlewareAppDirectory(server.config.root, srcDir),
|
|
423
423
|
server,
|
|
424
424
|
options.middleware,
|
|
@@ -3,18 +3,19 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
var _chunkPGZDEPTMcjs = require('./chunk-PGZDEPTM.cjs');
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
var _chunkIK6LVLKCcjs = require('./chunk-IK6LVLKC.cjs');
|
|
11
12
|
|
|
12
13
|
|
|
13
|
-
var
|
|
14
|
+
var _chunkHRETEZ2Zcjs = require('./chunk-HRETEZ2Z.cjs');
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
|
|
17
|
-
var
|
|
18
|
+
var _chunkCY2ZQ5C6cjs = require('./chunk-CY2ZQ5C6.cjs');
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
@@ -27,8 +28,17 @@ function hasFarmDocsRuntimeAdapter(docs) {
|
|
|
27
28
|
return Boolean(_optionalChain([docs, 'optionalAccess', _ => _.enabled]) && _optionalChain([docs, 'access', _2 => _2.adapter, 'optionalAccess', _3 => _3.server]) && docs.adapter.react);
|
|
28
29
|
}
|
|
29
30
|
_chunkS3JO3N4Hcjs.__name.call(void 0, hasFarmDocsRuntimeAdapter, "hasFarmDocsRuntimeAdapter");
|
|
31
|
+
function assertFarmDocsAdapterServesNoGuardedPages(docs, options, isPathGuarded) {
|
|
32
|
+
if (!isPathGuarded || !hasFarmDocsRuntimeAdapter(docs)) return;
|
|
33
|
+
const guarded = _chunkPGZDEPTMcjs.discoverFarmDocsPages.call(void 0, _chunkPGZDEPTMcjs.resolveFarmDocsContentDir.call(void 0, docs, options), docs).filter((page) => isPathGuarded(page.href) || isPathGuarded(_chunkPGZDEPTMcjs.getFarmDocsMarkdownPath.call(void 0, page.href))).map((page) => page.href);
|
|
34
|
+
if (guarded.length === 0) return;
|
|
35
|
+
throw new Error(
|
|
36
|
+
`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.`
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, assertFarmDocsAdapterServesNoGuardedPages, "assertFarmDocsAdapterServesNoGuardedPages");
|
|
30
40
|
async function loadFarmDocsConfigModule(docs, loadModule) {
|
|
31
|
-
const configModule =
|
|
41
|
+
const configModule = _chunkCY2ZQ5C6cjs.getFarmDocsAdapterConfigModule.call(void 0, docs);
|
|
32
42
|
if (!configModule) return void 0;
|
|
33
43
|
const loaded = await loadModule(configModule);
|
|
34
44
|
const config = _nullishCoalesce(_optionalChain([loaded, 'optionalAccess', _4 => _4.default]), () => ( loaded));
|
|
@@ -40,7 +50,7 @@ function createFarmDocsAdapterRuntimeConfig(docs, options, moduleConfig) {
|
|
|
40
50
|
...moduleConfig ? { ...moduleConfig, ...docs.configOverrides } : _nullishCoalesce(docs.runtimeConfig, () => ( docs.config)),
|
|
41
51
|
entry: docs.config.entry || docs.entry.replace(/^\/+|\/+$/g, "") || "docs",
|
|
42
52
|
docsPath: docs.entry,
|
|
43
|
-
contentDir:
|
|
53
|
+
contentDir: _chunkPGZDEPTMcjs.resolveFarmDocsContentDir.call(void 0, docs, options)
|
|
44
54
|
};
|
|
45
55
|
}
|
|
46
56
|
_chunkS3JO3N4Hcjs.__name.call(void 0, createFarmDocsAdapterRuntimeConfig, "createFarmDocsAdapterRuntimeConfig");
|
|
@@ -99,6 +109,7 @@ async function createFarmDocsAdapterHandler(docs, options) {
|
|
|
99
109
|
if (!hasFarmDocsRuntimeAdapter(docs)) {
|
|
100
110
|
throw new Error("Farm docs adapter requires server and react runtime entrypoints.");
|
|
101
111
|
}
|
|
112
|
+
assertFarmDocsAdapterServesNoGuardedPages(docs, options, options.isPathGuarded);
|
|
102
113
|
const serverModule = await options.loadModule(
|
|
103
114
|
docs.adapter.server
|
|
104
115
|
);
|
|
@@ -277,25 +288,25 @@ function getDocsDescription(docs) {
|
|
|
277
288
|
}
|
|
278
289
|
_chunkS3JO3N4Hcjs.__name.call(void 0, getDocsDescription, "getDocsDescription");
|
|
279
290
|
function getLoadedDocsPages(context) {
|
|
280
|
-
return
|
|
291
|
+
return _chunkPGZDEPTMcjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs).filter((page) => !context.isPathGuarded(page.href)).map((page) => _chunkPGZDEPTMcjs.loadFarmDocsPage.call(void 0, context.contentDir, context.docs, page.slug)).filter((page) => Boolean(page));
|
|
281
292
|
}
|
|
282
293
|
_chunkS3JO3N4Hcjs.__name.call(void 0, getLoadedDocsPages, "getLoadedDocsPages");
|
|
283
294
|
function toDocsSourcePage(page) {
|
|
284
295
|
return {
|
|
285
|
-
...
|
|
296
|
+
..._chunkPGZDEPTMcjs.toFarmDocsMarkdownPage.call(void 0, page),
|
|
286
297
|
sourcePath: page.sourcePath
|
|
287
298
|
};
|
|
288
299
|
}
|
|
289
300
|
_chunkS3JO3N4Hcjs.__name.call(void 0, toDocsSourcePage, "toDocsSourcePage");
|
|
290
301
|
function toDocsSitemapPage(page) {
|
|
291
302
|
return {
|
|
292
|
-
...
|
|
303
|
+
..._chunkPGZDEPTMcjs.toFarmDocsMarkdownPage.call(void 0, page),
|
|
293
304
|
sourcePath: page.sourcePath
|
|
294
305
|
};
|
|
295
306
|
}
|
|
296
307
|
_chunkS3JO3N4Hcjs.__name.call(void 0, toDocsSitemapPage, "toDocsSitemapPage");
|
|
297
308
|
function toDocsLlmsPage(page) {
|
|
298
|
-
return
|
|
309
|
+
return _chunkPGZDEPTMcjs.toFarmDocsMarkdownPage.call(void 0, page);
|
|
299
310
|
}
|
|
300
311
|
_chunkS3JO3N4Hcjs.__name.call(void 0, toDocsLlmsPage, "toDocsLlmsPage");
|
|
301
312
|
function getDocsLlmsOptions(context, request) {
|
|
@@ -389,7 +400,9 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, renderAgentsDocument, "renderAgentsDocumen
|
|
|
389
400
|
function buildAgentSpec(context, request) {
|
|
390
401
|
const url = new URL(request.url);
|
|
391
402
|
const origin = url.origin;
|
|
392
|
-
const pages =
|
|
403
|
+
const pages = _chunkPGZDEPTMcjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs).filter(
|
|
404
|
+
(page) => !context.isPathGuarded(page.href)
|
|
405
|
+
);
|
|
393
406
|
const spec = _chunkIK6LVLKCcjs.docsEngine.call(void 0, ).buildDocsAgentDiscoverySpec(getDocsDiscoveryOptions(context, request));
|
|
394
407
|
const title = getDocsTitle(context.docs);
|
|
395
408
|
return {
|
|
@@ -449,7 +462,7 @@ function redactDocsConfigValue(value, key, inHeaders) {
|
|
|
449
462
|
);
|
|
450
463
|
}
|
|
451
464
|
if (value === null || value === void 0 || typeof value === "function") return value;
|
|
452
|
-
return inHeaders ||
|
|
465
|
+
return inHeaders || _chunkCY2ZQ5C6cjs.isSecretDocsConfigKey.call(void 0, key) ? REDACTED_DOCS_CONFIG_VALUE : value;
|
|
453
466
|
}
|
|
454
467
|
_chunkS3JO3N4Hcjs.__name.call(void 0, redactDocsConfigValue, "redactDocsConfigValue");
|
|
455
468
|
function toPublicDocsPath(value, root) {
|
|
@@ -479,7 +492,7 @@ function buildPublicConfig(context) {
|
|
|
479
492
|
}
|
|
480
493
|
_chunkS3JO3N4Hcjs.__name.call(void 0, buildPublicConfig, "buildPublicConfig");
|
|
481
494
|
function buildDiagnostics(context) {
|
|
482
|
-
const pages =
|
|
495
|
+
const pages = _chunkPGZDEPTMcjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs);
|
|
483
496
|
const diagnostics = _chunkIK6LVLKCcjs.docsEngine.call(void 0, ).buildDocsDiagnostics(context.docs.config, {
|
|
484
497
|
entry: context.docs.entry,
|
|
485
498
|
mcp: {
|
|
@@ -551,13 +564,15 @@ async function resolveAPIContext(options) {
|
|
|
551
564
|
config: options.config,
|
|
552
565
|
configPath: options.configPath
|
|
553
566
|
}));
|
|
554
|
-
const docs = isResolvedDocsConfig(docsInput) ? docsInput : await
|
|
567
|
+
const docs = isResolvedDocsConfig(docsInput) ? docsInput : await _chunkHRETEZ2Zcjs.resolveDocsConfig.call(void 0, docsInput, { root, srcDir });
|
|
568
|
+
const guardedPaths = new Set(_nullishCoalesce(_optionalChain([runtimeConfig, 'optionalAccess', _20 => _20.guardedPaths]), () => ( [])));
|
|
555
569
|
return {
|
|
556
570
|
root,
|
|
557
571
|
srcDir,
|
|
558
572
|
docs,
|
|
559
|
-
contentDir:
|
|
560
|
-
diagnostics: options.diagnostics === true
|
|
573
|
+
contentDir: _chunkPGZDEPTMcjs.resolveFarmDocsContentDir.call(void 0, docs, { root, srcDir }),
|
|
574
|
+
diagnostics: options.diagnostics === true,
|
|
575
|
+
isPathGuarded: _nullishCoalesce(options.isPathGuarded, () => ( ((pathname) => guardedPaths.has(pathname))))
|
|
561
576
|
};
|
|
562
577
|
}
|
|
563
578
|
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveAPIContext, "resolveAPIContext");
|
|
@@ -615,10 +630,12 @@ async function handleDocsAPIGet(request, context) {
|
|
|
615
630
|
if (format === "markdown" || url.pathname.endsWith(".md")) {
|
|
616
631
|
const pathParam = url.searchParams.get("path") || url.searchParams.get("slug");
|
|
617
632
|
const slug = normalizeDocsApiSlug(_nullishCoalesce(_nullishCoalesce(pathParam, () => ( pathTarget.slug)), () => ( "")), context.docs);
|
|
618
|
-
const page =
|
|
619
|
-
if (!page
|
|
633
|
+
const page = _chunkPGZDEPTMcjs.loadFarmDocsPage.call(void 0, context.contentDir, context.docs, slug);
|
|
634
|
+
if (!page || context.isPathGuarded(page.href)) {
|
|
635
|
+
return text("Docs page not found\n", "text/plain; charset=utf-8", { status: 404 });
|
|
636
|
+
}
|
|
620
637
|
return text(
|
|
621
|
-
_chunkIK6LVLKCcjs.docsEngine.call(void 0, ).renderDocsMarkdownDocument(
|
|
638
|
+
_chunkIK6LVLKCcjs.docsEngine.call(void 0, ).renderDocsMarkdownDocument(_chunkPGZDEPTMcjs.toFarmDocsMarkdownPage.call(void 0, page), {
|
|
622
639
|
origin: new URL(request.url).origin,
|
|
623
640
|
llms: getDocsLlmsOptions(context, request),
|
|
624
641
|
sitemap: context.docs.config.sitemap
|
|
@@ -693,4 +710,5 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmDocsAPIHandler, "createFarmDocsA
|
|
|
693
710
|
|
|
694
711
|
|
|
695
712
|
|
|
696
|
-
|
|
713
|
+
|
|
714
|
+
exports.hasFarmDocsRuntimeAdapter = hasFarmDocsRuntimeAdapter; exports.assertFarmDocsAdapterServesNoGuardedPages = assertFarmDocsAdapterServesNoGuardedPages; exports.compileFarmDocsAdapterEdgeManifest = compileFarmDocsAdapterEdgeManifest; exports.createFarmDocsAdapterHandler = createFarmDocsAdapterHandler; exports.isFarmDocsAPIRequest = isFarmDocsAPIRequest; exports.createDocsAPI = createDocsAPI; exports.createFarmDocsAPIHandler = createFarmDocsAPIHandler;
|
|
@@ -20,15 +20,16 @@ async function hydrateFarmDocsAdapterRuntime() {
|
|
|
20
20
|
async function hydrateFarmDocsAdapterRuntime() {
|
|
21
21
|
const runtime = window.__FARM_DOCS_ADAPTER__;
|
|
22
22
|
if (!runtime) return false;
|
|
23
|
-
|
|
23
|
+
// The docs server flags pages whose config holds what its JSON copy cannot (icons,
|
|
24
|
+
// MDX components, callbacks); the adapter restores those from the module itself.
|
|
25
|
+
// Fetch it alongside the adapter rather than after it: they don't depend on each other.
|
|
26
|
+
const [FarmDocsAdapterReact, configModule] = await Promise.all([
|
|
27
|
+
import(${JSON.stringify(reactModule)}),
|
|
28
|
+
runtime.configModule ? ${configModule ? `import(${JSON.stringify(configModule)})` : "undefined"} : undefined,
|
|
29
|
+
]);
|
|
24
30
|
if (typeof FarmDocsAdapterReact.hydrateFarmDocs !== "function") {
|
|
25
31
|
throw new Error("The configured Farm docs adapter does not export hydrateFarmDocs().");
|
|
26
32
|
}
|
|
27
|
-
// The docs server flags pages whose config holds what its JSON copy cannot (icons,
|
|
28
|
-
// MDX components, callbacks); the adapter restores those from the module itself.
|
|
29
|
-
const configModule = runtime.configModule
|
|
30
|
-
? ${configModule ? `await import(${JSON.stringify(configModule)})` : "undefined"}
|
|
31
|
-
: undefined;
|
|
32
33
|
FarmDocsAdapterReact.hydrateFarmDocs({
|
|
33
34
|
config: runtime.config || {},
|
|
34
35
|
data: runtime.data,
|
|
@@ -3,18 +3,21 @@
|
|
|
3
3
|
var _chunkAI7QMY7Ocjs = require('./chunk-AI7QMY7O.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk6XWDE2P2cjs = require('./chunk-6XWDE2P2.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunkULASELLAcjs = require('./chunk-ULASELLA.cjs');
|
|
7
10
|
|
|
8
11
|
|
|
9
12
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
10
13
|
|
|
11
14
|
// src/headers.ts
|
|
12
15
|
function headers() {
|
|
13
|
-
return new Headers(
|
|
16
|
+
return new Headers(_chunk6XWDE2P2cjs.getCurrentRequest.call(void 0, ).headers);
|
|
14
17
|
}
|
|
15
18
|
_chunkS3JO3N4Hcjs.__name.call(void 0, headers, "headers");
|
|
16
19
|
function cookies() {
|
|
17
|
-
const cookieHeader =
|
|
20
|
+
const cookieHeader = _chunk6XWDE2P2cjs.getCurrentRequest.call(void 0, ).headers.get("cookie") || "";
|
|
18
21
|
const parsed = _chunkAI7QMY7Ocjs.parseRequestCookieHeader.call(void 0, cookieHeader);
|
|
19
22
|
return {
|
|
20
23
|
get(name) {
|
|
@@ -35,8 +38,13 @@ function cookies() {
|
|
|
35
38
|
};
|
|
36
39
|
}
|
|
37
40
|
_chunkS3JO3N4Hcjs.__name.call(void 0, cookies, "cookies");
|
|
41
|
+
function getCspNonce() {
|
|
42
|
+
return _chunkULASELLAcjs._resolveCurrentCspNonce.call(void 0, );
|
|
43
|
+
}
|
|
44
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, getCspNonce, "getCspNonce");
|
|
45
|
+
|
|
38
46
|
|
|
39
47
|
|
|
40
48
|
|
|
41
49
|
|
|
42
|
-
exports.headers = headers; exports.cookies = cookies;
|
|
50
|
+
exports.headers = headers; exports.cookies = cookies; exports.getCspNonce = getCspNonce;
|