@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
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } 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
3
|
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkSGBJ247Qcjs = require('./chunk-SGBJ247Q.cjs');
|
|
5
7
|
|
|
6
8
|
|
|
7
9
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
@@ -159,6 +161,7 @@ var PAGE_CHECK_DROPPED_HEADERS = /* @__PURE__ */ new Set([
|
|
|
159
161
|
"if-unmodified-since",
|
|
160
162
|
"range"
|
|
161
163
|
]);
|
|
164
|
+
var PAGE_SEGMENT_MARKER = /<div\s[^>]*\bid=["']?__farm_page__["'\s>]/i;
|
|
162
165
|
async function anonymousVisitorOpensPage(options, url, targetPathname) {
|
|
163
166
|
const pageUrl = new URL(url);
|
|
164
167
|
pageUrl.pathname = targetPathname;
|
|
@@ -167,6 +170,7 @@ async function anonymousVisitorOpensPage(options, url, targetPathname) {
|
|
|
167
170
|
if (!PAGE_CHECK_DROPPED_HEADERS.has(name.toLowerCase())) headers.append(name, value);
|
|
168
171
|
}
|
|
169
172
|
headers.set("accept", "text/html");
|
|
173
|
+
headers.set(_chunkSGBJ247Qcjs.FARM_MARKDOWN_PAGE_CHECK_HEADER, _chunkSGBJ247Qcjs._getFarmMarkdownPageCheckToken.call(void 0, ));
|
|
170
174
|
const response = await options.renderPage(
|
|
171
175
|
new Request(pageUrl, {
|
|
172
176
|
method: "GET",
|
|
@@ -175,9 +179,12 @@ async function anonymousVisitorOpensPage(options, url, targetPathname) {
|
|
|
175
179
|
signal: options.request.signal
|
|
176
180
|
})
|
|
177
181
|
);
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
182
|
+
if (response.status < 200 || response.status >= 300 || !_optionalChain([response, 'access', _9 => _9.headers, 'access', _10 => _10.get, 'call', _11 => _11("content-type"), 'optionalAccess', _12 => _12.toLowerCase, 'call', _13 => _13(), 'access', _14 => _14.includes, 'call', _15 => _15("text/html")])) {
|
|
183
|
+
void _optionalChain([response, 'access', _16 => _16.body, 'optionalAccess', _17 => _17.cancel, 'call', _18 => _18(), 'access', _19 => _19.catch, 'call', _20 => _20(() => {
|
|
184
|
+
})]);
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
return PAGE_SEGMENT_MARKER.test(await response.text());
|
|
181
188
|
}
|
|
182
189
|
_chunkS3JO3N4Hcjs.__name.call(void 0, anonymousVisitorOpensPage, "anonymousVisitorOpensPage");
|
|
183
190
|
function hasOnlyAnonymousHeaders(headers) {
|
|
@@ -197,7 +204,7 @@ async function createFarmMarkdownSourceResponse(options) {
|
|
|
197
204
|
}
|
|
198
205
|
const url = new URL(options.request.url);
|
|
199
206
|
const hasMarkdownExtension = url.pathname.toLowerCase().endsWith(".md");
|
|
200
|
-
if (!hasMarkdownExtension && !
|
|
207
|
+
if (!hasMarkdownExtension && !_chunkSGBJ247Qcjs.requestAcceptsMarkdown.call(void 0, options.request.headers.get("accept"))) {
|
|
201
208
|
return null;
|
|
202
209
|
}
|
|
203
210
|
const targetPathname = normalizeFarmMarkdownRoutePath(url.pathname);
|
|
@@ -222,8 +229,18 @@ async function createFarmMarkdownSourceResponse(options) {
|
|
|
222
229
|
})
|
|
223
230
|
);
|
|
224
231
|
if (publicResponse.headers.get("X-Farm-Markdown-Route") === targetPathname && publicResponse.headers.has("X-Farm-Markdown-Source")) {
|
|
225
|
-
|
|
226
|
-
|
|
232
|
+
let response = publicResponse;
|
|
233
|
+
if (options.request.headers.has("cookie") || options.request.headers.has("authorization")) {
|
|
234
|
+
const headers2 = new Headers(publicResponse.headers);
|
|
235
|
+
headers2.set("Cache-Control", "private, no-store");
|
|
236
|
+
response = new Response(publicResponse.body, {
|
|
237
|
+
status: publicResponse.status,
|
|
238
|
+
statusText: publicResponse.statusText,
|
|
239
|
+
headers: headers2
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
publicSourceResponses.add(response);
|
|
243
|
+
return response;
|
|
227
244
|
}
|
|
228
245
|
await _optionalChain([publicResponse, 'access', _23 => _23.body, 'optionalAccess', _24 => _24.cancel, 'call', _25 => _25()]);
|
|
229
246
|
if (!hasMarkdownExtension) return null;
|
|
@@ -249,7 +266,7 @@ async function createFarmMarkdownSourceResponse(options) {
|
|
|
249
266
|
if (!hasMarkdownExtension) {
|
|
250
267
|
headers.set("Vary", "Accept");
|
|
251
268
|
}
|
|
252
|
-
return
|
|
269
|
+
return _chunkSGBJ247Qcjs.createFarmMarkdownViewResponse.call(void 0, {
|
|
253
270
|
request: options.request,
|
|
254
271
|
requestUrl: url,
|
|
255
272
|
markdown: source.source,
|
|
@@ -1,18 +1,29 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FARM_DEFAULT_MCP_TOOLS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-P664ZVTV.mjs";
|
|
4
4
|
import {
|
|
5
5
|
DEFAULT_ERROR_STYLES
|
|
6
6
|
} from "./chunk-XAXTTBUT.mjs";
|
|
7
7
|
import {
|
|
8
8
|
serializeFarmLlmsTxt
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-HD5CF3OE.mjs";
|
|
10
|
+
import {
|
|
11
|
+
stampFarmCspNonce
|
|
12
|
+
} from "./chunk-U6QLDL3G.mjs";
|
|
10
13
|
import {
|
|
11
14
|
emitFarmAgentRead
|
|
12
15
|
} from "./chunk-MVL2RAJW.mjs";
|
|
13
16
|
import {
|
|
14
17
|
resolveFarmThemeConfig
|
|
15
18
|
} from "./chunk-AELACLOB.mjs";
|
|
19
|
+
import {
|
|
20
|
+
integrationMiddlewareMayHandlePath
|
|
21
|
+
} from "./chunk-ATSDUUFK.mjs";
|
|
22
|
+
import {
|
|
23
|
+
compileMiddlewareConfig,
|
|
24
|
+
matchesCompiledMiddlewareConfig,
|
|
25
|
+
matchesMiddlewareRoute
|
|
26
|
+
} from "./chunk-P3PLW4FR.mjs";
|
|
16
27
|
import {
|
|
17
28
|
omitFarmResponseBody
|
|
18
29
|
} from "./chunk-5WI2S4CO.mjs";
|
|
@@ -25,12 +36,13 @@ import {
|
|
|
25
36
|
matchesFarmIfNoneMatch
|
|
26
37
|
} from "./chunk-ZMMBIVQM.mjs";
|
|
27
38
|
import {
|
|
39
|
+
createFarmAPIMiddlewarePathnames,
|
|
28
40
|
resolveFarmAPIServerBasePath,
|
|
29
41
|
resolveFarmAPIServerRoutePath
|
|
30
42
|
} from "./chunk-BTHHUD7Q.mjs";
|
|
31
43
|
import {
|
|
32
44
|
FARM_VERSION
|
|
33
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-SOP2EAA6.mjs";
|
|
34
46
|
import {
|
|
35
47
|
localizeFarmPathname
|
|
36
48
|
} from "./chunk-L3KT7IXV.mjs";
|
|
@@ -219,6 +231,71 @@ ${html}`;
|
|
|
219
231
|
}
|
|
220
232
|
__name(composeFarmFullDocument, "composeFarmFullDocument");
|
|
221
233
|
|
|
234
|
+
// src/middleware/may-handle.ts
|
|
235
|
+
function hasFarmMiddlewareConfig(config) {
|
|
236
|
+
if (!config) return false;
|
|
237
|
+
if (Array.isArray(config)) return config.length > 0;
|
|
238
|
+
const configRecord = config;
|
|
239
|
+
return Boolean(
|
|
240
|
+
configRecord.matcher || configRecord.exclude || configRecord.runtime || configRecord.handler || Array.isArray(configRecord.handlers) && configRecord.handlers.length > 0
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
__name(hasFarmMiddlewareConfig, "hasFarmMiddlewareConfig");
|
|
244
|
+
function configMiddlewareMayHandlePath(config, pathname) {
|
|
245
|
+
if (!hasFarmMiddlewareConfig(config)) return false;
|
|
246
|
+
const entries = Array.isArray(config) ? config : [config];
|
|
247
|
+
return entries.some((entry) => {
|
|
248
|
+
if (!entry.matcher && !entry.exclude) return true;
|
|
249
|
+
const matchers = entry.matcher ? (Array.isArray(entry.matcher) ? entry.matcher : [entry.matcher]).map(
|
|
250
|
+
(matcher) => (
|
|
251
|
+
// A request-aware matcher cannot be proven safe at build time.
|
|
252
|
+
typeof matcher === "function" ? () => true : matcher
|
|
253
|
+
)
|
|
254
|
+
) : void 0;
|
|
255
|
+
const compiled = compileMiddlewareConfig({ matcher: matchers, exclude: entry.exclude });
|
|
256
|
+
return matchesCompiledMiddlewareConfig(pathname, compiled, {}).matched;
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
__name(configMiddlewareMayHandlePath, "configMiddlewareMayHandlePath");
|
|
260
|
+
function appMiddlewareMayHandlePath(middlewareRoutes, pathname) {
|
|
261
|
+
return middlewareRoutes.some((route) => matchesMiddlewareRoute(pathname, route).matched);
|
|
262
|
+
}
|
|
263
|
+
__name(appMiddlewareMayHandlePath, "appMiddlewareMayHandlePath");
|
|
264
|
+
var CATCH_ALL_PROBE = "/__farm-listing-probe__/0";
|
|
265
|
+
function isPathSpecificMatcher(matcher) {
|
|
266
|
+
if (typeof matcher === "function") return false;
|
|
267
|
+
const compiled = compileMiddlewareConfig({ matcher });
|
|
268
|
+
return !matchesCompiledMiddlewareConfig(CATCH_ALL_PROBE, compiled, {}).matched;
|
|
269
|
+
}
|
|
270
|
+
__name(isPathSpecificMatcher, "isPathSpecificMatcher");
|
|
271
|
+
function pathSpecificConfigMiddlewareCovers(config, pathname) {
|
|
272
|
+
if (!hasFarmMiddlewareConfig(config)) return false;
|
|
273
|
+
const entries = Array.isArray(config) ? config : [config];
|
|
274
|
+
return entries.some((entry) => {
|
|
275
|
+
if (!entry.matcher) return false;
|
|
276
|
+
const matchers = (Array.isArray(entry.matcher) ? entry.matcher : [entry.matcher]).filter(
|
|
277
|
+
isPathSpecificMatcher
|
|
278
|
+
);
|
|
279
|
+
if (matchers.length === 0) return false;
|
|
280
|
+
const compiled = compileMiddlewareConfig({ matcher: matchers, exclude: entry.exclude });
|
|
281
|
+
return matchesCompiledMiddlewareConfig(pathname, compiled, {}).matched;
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
__name(pathSpecificConfigMiddlewareCovers, "pathSpecificConfigMiddlewareCovers");
|
|
285
|
+
function farmPathGuardCoversPage(options, pathname) {
|
|
286
|
+
return appMiddlewareMayHandlePath(
|
|
287
|
+
options.middlewareRoutes.filter((route) => route.path !== "/"),
|
|
288
|
+
pathname
|
|
289
|
+
) || pathSpecificConfigMiddlewareCovers(options.config.middleware, pathname) || integrationMiddlewareMayHandlePath(options.config.integrations, pathname, CATCH_ALL_PROBE);
|
|
290
|
+
}
|
|
291
|
+
__name(farmPathGuardCoversPage, "farmPathGuardCoversPage");
|
|
292
|
+
function farmPathGuardCoversEndpoint(options, path, apiServerBasePath) {
|
|
293
|
+
return createFarmAPIMiddlewarePathnames(apiServerBasePath)(path).some(
|
|
294
|
+
(pathname) => farmPathGuardCoversPage(options, pathname)
|
|
295
|
+
);
|
|
296
|
+
}
|
|
297
|
+
__name(farmPathGuardCoversEndpoint, "farmPathGuardCoversEndpoint");
|
|
298
|
+
|
|
222
299
|
// src/i18n/alternates.ts
|
|
223
300
|
function renderFarmLocaleAlternateLinks(pathname, config, options = {}) {
|
|
224
301
|
if (config.routing === "none") return "";
|
|
@@ -269,13 +346,19 @@ function isLateRedirectTarget(url) {
|
|
|
269
346
|
}
|
|
270
347
|
}
|
|
271
348
|
__name(isLateRedirectTarget, "isLateRedirectTarget");
|
|
272
|
-
function createLateRedirectRecovery(url) {
|
|
349
|
+
function createLateRedirectRecovery(url, nonce) {
|
|
273
350
|
if (!isLateRedirectTarget(url)) return "";
|
|
274
|
-
return
|
|
351
|
+
return stampFarmCspNonce(
|
|
352
|
+
`<script>window.location.replace(${serializeForInlineScript(url)})</script>`,
|
|
353
|
+
nonce
|
|
354
|
+
);
|
|
275
355
|
}
|
|
276
356
|
__name(createLateRedirectRecovery, "createLateRedirectRecovery");
|
|
277
|
-
function createLateNotFoundRecovery(content) {
|
|
278
|
-
return `<template id="${TEMPLATE_ID}">${content}</template
|
|
357
|
+
function createLateNotFoundRecovery(content, nonce) {
|
|
358
|
+
return `<template id="${TEMPLATE_ID}">${content}</template>` + stampFarmCspNonce(
|
|
359
|
+
`<script>(function(){var t=document.getElementById("${TEMPLATE_ID}");var p=document.getElementById("${PAGE_CONTAINER_ID}");if(t&&p){p.replaceChildren(t.content.cloneNode(true));}if(t)t.remove();document.documentElement.dataset.farmLateNotFound="true";var m=document.createElement("meta");m.name="robots";m.content="noindex";document.head.appendChild(m);})();</script>`,
|
|
360
|
+
nonce
|
|
361
|
+
);
|
|
279
362
|
}
|
|
280
363
|
__name(createLateNotFoundRecovery, "createLateNotFoundRecovery");
|
|
281
364
|
|
|
@@ -763,7 +846,9 @@ function createFarmThemeDocumentParts(input, basePath = "/", serverTheme) {
|
|
|
763
846
|
const script = createFarmThemeBootstrapScript(config, hydrationTheme);
|
|
764
847
|
return {
|
|
765
848
|
attributes: ` data-theme="${initialTheme}"`,
|
|
766
|
-
head:
|
|
849
|
+
head: stampFarmCspNonce(
|
|
850
|
+
`<style id="${THEME_STYLE_ID}">:root[data-theme="light"]{color-scheme:light}:root[data-theme="dark"]{color-scheme:dark}</style><script id="${THEME_SCRIPT_ID}">${script}</script>`
|
|
851
|
+
)
|
|
767
852
|
};
|
|
768
853
|
}
|
|
769
854
|
__name(createFarmThemeDocumentParts, "createFarmThemeDocumentParts");
|
|
@@ -920,12 +1005,13 @@ function createFarmAppManifest(input, { full = false } = {}) {
|
|
|
920
1005
|
packages: input.packages,
|
|
921
1006
|
mcp: {
|
|
922
1007
|
servers: _listFarmMCPCatalogs().map(({ server, tools, details }) => {
|
|
923
|
-
const
|
|
1008
|
+
const open = details?.public === true && !input.guardCoversPath?.(server.path);
|
|
1009
|
+
const listed = full || open;
|
|
924
1010
|
return {
|
|
925
1011
|
name: server.name,
|
|
926
1012
|
version: server.version,
|
|
927
1013
|
path: server.path,
|
|
928
|
-
authorization:
|
|
1014
|
+
authorization: open ? "none" : "required",
|
|
929
1015
|
resources: listed ? [...details?.resources ?? []] : [],
|
|
930
1016
|
prompts: listed ? [...details?.prompts ?? []] : [],
|
|
931
1017
|
tools: (listed ? tools : []).map((tool) => {
|
|
@@ -1078,6 +1164,11 @@ export {
|
|
|
1078
1164
|
removeFarmDocumentTitles,
|
|
1079
1165
|
ensureFarmDocumentMeta,
|
|
1080
1166
|
composeFarmFullDocument,
|
|
1167
|
+
hasFarmMiddlewareConfig,
|
|
1168
|
+
configMiddlewareMayHandlePath,
|
|
1169
|
+
appMiddlewareMayHandlePath,
|
|
1170
|
+
farmPathGuardCoversPage,
|
|
1171
|
+
farmPathGuardCoversEndpoint,
|
|
1081
1172
|
renderFarmLocaleAlternateLinks,
|
|
1082
1173
|
createLateRedirectRecovery,
|
|
1083
1174
|
createLateNotFoundRecovery,
|
|
@@ -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 _chunkWEW2JVA4cjs = require('./chunk-WEW2JVA4.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkSGBJ247Qcjs = require('./chunk-SGBJ247Q.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -108,10 +108,10 @@ function collectFarmDefaultMCPPages(sources, options) {
|
|
|
108
108
|
for (const source of sources) {
|
|
109
109
|
const module = isRecord(source.module) ? source.module : void 0;
|
|
110
110
|
if (_optionalChain([module, 'optionalAccess', _ => _.__farmRouteGuard])) continue;
|
|
111
|
-
if (!
|
|
111
|
+
if (!_chunkSGBJ247Qcjs.isFarmMarkdownMirrorExposed.call(void 0, options.markdown, source.pattern)) continue;
|
|
112
112
|
readable.push({ pattern: source.pattern, metadata: _optionalChain([module, 'optionalAccess', _2 => _2.metadata]) });
|
|
113
113
|
}
|
|
114
|
-
return
|
|
114
|
+
return _chunkWEW2JVA4cjs.collectFarmLlmsTxtPages.call(void 0, readable, {
|
|
115
115
|
origin: options.origin,
|
|
116
116
|
basePath: options.basePath,
|
|
117
117
|
markdown: options.markdown
|
|
@@ -121,7 +121,7 @@ function collectFarmDefaultMCPPages(sources, options) {
|
|
|
121
121
|
url: `${options.origin}${_chunkI57LW5VZcjs.applyFarmBasePath.call(void 0, page.path, options.basePath)}`,
|
|
122
122
|
...page.description ? { description: page.description } : {},
|
|
123
123
|
markdownUrl: `${options.origin}${_chunkI57LW5VZcjs.applyFarmBasePath.call(void 0,
|
|
124
|
-
|
|
124
|
+
_chunkSGBJ247Qcjs.getFarmMarkdownMirrorPath.call(void 0, page.path),
|
|
125
125
|
options.basePath
|
|
126
126
|
)}`
|
|
127
127
|
}));
|
|
@@ -26,13 +26,15 @@ var _chunkPSV6XKPOcjs = require('./chunk-PSV6XKPO.cjs');
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
|
+
var _chunkQTXBII4Zcjs = require('./chunk-QTXBII4Z.cjs');
|
|
29
30
|
|
|
30
31
|
|
|
32
|
+
var _chunkWEW2JVA4cjs = require('./chunk-WEW2JVA4.cjs');
|
|
31
33
|
|
|
32
|
-
var _chunkMRMI32SNcjs = require('./chunk-MRMI32SN.cjs');
|
|
33
34
|
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
|
|
37
|
+
var _chunk2ZYGC6SScjs = require('./chunk-2ZYGC6SS.cjs');
|
|
36
38
|
|
|
37
39
|
|
|
38
40
|
var _chunkYFPGHF5Fcjs = require('./chunk-YFPGHF5F.cjs');
|
|
@@ -51,7 +53,7 @@ var _chunkVEKFLAQMcjs = require('./chunk-VEKFLAQM.cjs');
|
|
|
51
53
|
var _chunkOHY2ZWUGcjs = require('./chunk-OHY2ZWUG.cjs');
|
|
52
54
|
|
|
53
55
|
|
|
54
|
-
var
|
|
56
|
+
var _chunkSGBJ247Qcjs = require('./chunk-SGBJ247Q.cjs');
|
|
55
57
|
|
|
56
58
|
|
|
57
59
|
var _chunkUYIHRDE4cjs = require('./chunk-UYIHRDE4.cjs');
|
|
@@ -63,7 +65,10 @@ var _chunkSDOTRX3Vcjs = require('./chunk-SDOTRX3V.cjs');
|
|
|
63
65
|
var _chunkOI6CMLWXcjs = require('./chunk-OI6CMLWX.cjs');
|
|
64
66
|
|
|
65
67
|
|
|
66
|
-
var
|
|
68
|
+
var _chunkBWIQR4DHcjs = require('./chunk-BWIQR4DH.cjs');
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
var _chunkUPJLHLJUcjs = require('./chunk-UPJLHLJU.cjs');
|
|
67
72
|
|
|
68
73
|
|
|
69
74
|
var _chunkKIIMAWOJcjs = require('./chunk-KIIMAWOJ.cjs');
|
|
@@ -138,13 +143,13 @@ function resolveFarmAgentConfig(input, context = {}) {
|
|
|
138
143
|
const jsonLd = _optionalChain([input, 'optionalAccess', _ => _.jsonLd]);
|
|
139
144
|
return {
|
|
140
145
|
jsonLd: jsonLd === void 0 ? { ...DEFAULT_JSON_LD } : !jsonLd ? false : jsonLd === true ? {} : jsonLd,
|
|
141
|
-
noindexPreviews:
|
|
146
|
+
noindexPreviews: _chunkQTXBII4Zcjs.resolveFarmNoindexPreviews.call(void 0, _optionalChain([input, 'optionalAccess', _2 => _2.noindexPreviews])),
|
|
142
147
|
// The docs engine answers /llms.txt with its own pages; a default here would replace it.
|
|
143
148
|
// llms-full.txt renders every listed page, so it stays opt-in.
|
|
144
|
-
llmsTxt:
|
|
149
|
+
llmsTxt: _chunkWEW2JVA4cjs.resolveFarmLlmsTxtConfig.call(void 0, _nullishCoalesce(_optionalChain([input, 'optionalAccess', _3 => _3.llmsTxt]), () => ( (context.docs ? false : { full: false })))),
|
|
145
150
|
// Same rule as llms.txt: the docs engine answers /sitemap.xml with its own pages.
|
|
146
|
-
sitemap:
|
|
147
|
-
crawlers:
|
|
151
|
+
sitemap: _chunkQTXBII4Zcjs.resolveFarmAgentSitemap.call(void 0, _nullishCoalesce(_optionalChain([input, 'optionalAccess', _4 => _4.sitemap]), () => ( !context.docs))),
|
|
152
|
+
crawlers: _chunkQTXBII4Zcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([input, 'optionalAccess', _5 => _5.crawlers])),
|
|
148
153
|
apiCatalog: resolveFarmAgentBoolean(_optionalChain([input, 'optionalAccess', _6 => _6.apiCatalog]), "apiCatalog", false),
|
|
149
154
|
aiCatalog: resolveFarmAgentBoolean(_optionalChain([input, 'optionalAccess', _7 => _7.aiCatalog]), "aiCatalog", true),
|
|
150
155
|
manifest: resolveFarmAgentBoolean(_optionalChain([input, 'optionalAccess', _8 => _8.manifest]), "manifest", true),
|
|
@@ -657,6 +662,13 @@ function validateRedirectConfigs(redirects, field) {
|
|
|
657
662
|
return redirects;
|
|
658
663
|
}
|
|
659
664
|
_chunkS3JO3N4Hcjs.__name.call(void 0, validateRedirectConfigs, "validateRedirectConfigs");
|
|
665
|
+
function validateMiddlewareConfig(middleware) {
|
|
666
|
+
for (const entry of Array.isArray(middleware) ? middleware : middleware ? [middleware] : []) {
|
|
667
|
+
_chunkUPJLHLJUcjs.compileMiddlewareConfig.call(void 0, { matcher: entry.matcher, exclude: entry.exclude });
|
|
668
|
+
}
|
|
669
|
+
return middleware;
|
|
670
|
+
}
|
|
671
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, validateMiddlewareConfig, "validateMiddlewareConfig");
|
|
660
672
|
function validateConfigRouteSources(routes, field) {
|
|
661
673
|
for (const [index, route] of routes.entries()) {
|
|
662
674
|
_chunkDVM4FKZLcjs.validateConfigRouteSource.call(void 0, route.source, `${field}[${index}].source`);
|
|
@@ -697,9 +709,9 @@ async function resolveConfig(userConfig, mode) {
|
|
|
697
709
|
const routeRules = _chunkQ5B3KJBPcjs.normalizeRouteRules.call(void 0, userConfig.routeRules);
|
|
698
710
|
const routeRuleRedirects = _chunkQ5B3KJBPcjs.routeRulesToRedirects.call(void 0, routeRules);
|
|
699
711
|
const routeRuleHeaders = _chunkQ5B3KJBPcjs.routeRulesToHeaders.call(void 0, routeRules);
|
|
700
|
-
const security =
|
|
701
|
-
const securityHeader =
|
|
702
|
-
if (
|
|
712
|
+
const security = _chunk2ZYGC6SScjs.resolveFarmSecurityConfig.call(void 0, userConfig.security);
|
|
713
|
+
const securityHeader = _chunk2ZYGC6SScjs.getFarmSecurityHeader.call(void 0, security);
|
|
714
|
+
if (_chunk2ZYGC6SScjs.farmCspBlocksFrameworkInlineScripts.call(void 0, security)) {
|
|
703
715
|
_chunk5QIKR7RRcjs.logger.warn(
|
|
704
716
|
"security.csp blocks the inline scripts Farm injects for theming and hydration. Set security.csp.nonce to true for managed dynamic nonces and prerendered hashes, or make the governing script directive allow 'unsafe-inline' without a nonce, hash, or 'strict-dynamic' source."
|
|
705
717
|
);
|
|
@@ -709,7 +721,7 @@ async function resolveConfig(userConfig, mode) {
|
|
|
709
721
|
const srcDir = userConfig.srcDir || "src";
|
|
710
722
|
_chunk6MVFL3R5cjs.setFarmProjectSourceDir.call(void 0, root, srcDir);
|
|
711
723
|
const docs = await resolveDocsConfig(userConfig.docs, { root, srcDir });
|
|
712
|
-
const md =
|
|
724
|
+
const md = _chunkSGBJ247Qcjs.resolveMarkdownConfig.call(void 0, userConfig.md);
|
|
713
725
|
const mdx = _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, userConfig.mdx);
|
|
714
726
|
const env = _chunkVEKFLAQMcjs.resolveEnv.call(void 0, userConfig.env, process.env);
|
|
715
727
|
_chunkVEKFLAQMcjs.setEnv.call(void 0, env);
|
|
@@ -785,7 +797,7 @@ async function resolveConfig(userConfig, mode) {
|
|
|
785
797
|
},
|
|
786
798
|
agent: resolveFarmAgentConfig(userConfig.agent, { docs: docs.enabled }),
|
|
787
799
|
plugins: [
|
|
788
|
-
...
|
|
800
|
+
..._chunkBWIQR4DHcjs.resolveIntegrationPlugins.call(void 0, integrations),
|
|
789
801
|
...nativeMCPPlugin ? [nativeMCPPlugin] : [],
|
|
790
802
|
...userConfig.plugins || []
|
|
791
803
|
],
|
|
@@ -800,12 +812,12 @@ async function resolveConfig(userConfig, mode) {
|
|
|
800
812
|
], "headers"),
|
|
801
813
|
routeRules,
|
|
802
814
|
images: _chunkYFPGHF5Fcjs.resolveFarmImageConfig.call(void 0, userConfig.images),
|
|
803
|
-
performance:
|
|
815
|
+
performance: _chunkQTXBII4Zcjs.resolveFarmPerformanceConfig.call(void 0, userConfig.performance),
|
|
804
816
|
theme: _chunkOI6CMLWXcjs.resolveFarmThemeConfig.call(void 0, userConfig.theme, basePath),
|
|
805
817
|
publicDir: userConfig.publicDir || "public",
|
|
806
818
|
i18n: _chunkHLJ6MBUZcjs.resolveFarmI18nConfig.call(void 0, userConfig.i18n, { root, mode, basePath }),
|
|
807
819
|
openapi,
|
|
808
|
-
middleware: userConfig.middleware || {},
|
|
820
|
+
middleware: validateMiddlewareConfig(userConfig.middleware) || {},
|
|
809
821
|
notFound: userConfig.notFound || {},
|
|
810
822
|
context: userConfig.context || (() => void 0),
|
|
811
823
|
server: _chunkKIIMAWOJcjs.resolveFarmServerConfig.call(void 0, userConfig.server),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkB5J2YVG7cjs = require('./chunk-B5J2YVG7.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkBD3D7EZVcjs = require('./chunk-BD3D7EZV.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkI57LW5VZcjs = require('./chunk-I57LW5VZ.cjs');
|
|
@@ -13,7 +13,7 @@ var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
|
13
13
|
|
|
14
14
|
// src/navigation.ts
|
|
15
15
|
function useRouter2() {
|
|
16
|
-
const router =
|
|
16
|
+
const router = _chunkB5J2YVG7cjs.useRouter.call(void 0, );
|
|
17
17
|
return {
|
|
18
18
|
push: router.push,
|
|
19
19
|
replace: router.replace,
|
|
@@ -21,21 +21,21 @@ function useRouter2() {
|
|
|
21
21
|
forward: router.forward,
|
|
22
22
|
refresh() {
|
|
23
23
|
if (typeof window === "undefined") return Promise.resolve();
|
|
24
|
-
return
|
|
24
|
+
return _chunkBD3D7EZVcjs.getRouter.call(void 0, ).refresh();
|
|
25
25
|
},
|
|
26
26
|
prefetch(href) {
|
|
27
27
|
if (typeof window === "undefined") return Promise.resolve();
|
|
28
|
-
return
|
|
28
|
+
return _chunkBD3D7EZVcjs.getRouter.call(void 0, ).prefetch(_chunkI57LW5VZcjs.applyFarmBasePath.call(void 0, href));
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
_chunkS3JO3N4Hcjs.__name.call(void 0, useRouter2, "useRouter");
|
|
33
33
|
function usePathname() {
|
|
34
|
-
return
|
|
34
|
+
return _chunkB5J2YVG7cjs.useRouter.call(void 0, ).pathname;
|
|
35
35
|
}
|
|
36
36
|
_chunkS3JO3N4Hcjs.__name.call(void 0, usePathname, "usePathname");
|
|
37
37
|
function useSearchParams() {
|
|
38
|
-
return
|
|
38
|
+
return _chunkB5J2YVG7cjs.useRouter.call(void 0, ).searchParams;
|
|
39
39
|
}
|
|
40
40
|
_chunkS3JO3N4Hcjs.__name.call(void 0, useSearchParams, "useSearchParams");
|
|
41
41
|
|