@farm.js/core 0.1.40 → 0.1.42

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.
Files changed (238) hide show
  1. package/dist/{agent-mcp-DRlXq3lM.d.ts → agent-mcp-SSD6L3VZ.d.ts} +8 -2
  2. package/dist/{agent-mcp-XNF4JqHw.d.mts → agent-mcp-ssVy_tea.d.mts} +8 -2
  3. package/dist/agent-runtime.d.mts +2 -2
  4. package/dist/agent-runtime.d.ts +2 -2
  5. package/dist/api/client.cjs +3 -3
  6. package/dist/api/client.mjs +2 -2
  7. package/dist/api/route-manager.cjs +8 -8
  8. package/dist/api/route-manager.d.mts +4 -4
  9. package/dist/api/route-manager.d.ts +4 -4
  10. package/dist/api/route-manager.mjs +7 -7
  11. package/dist/api/runtime.cjs +6 -6
  12. package/dist/api/runtime.d.mts +3 -3
  13. package/dist/api/runtime.d.ts +3 -3
  14. package/dist/api/runtime.mjs +5 -5
  15. package/dist/api.cjs +10 -10
  16. package/dist/api.d.mts +4 -4
  17. package/dist/api.d.ts +4 -4
  18. package/dist/api.mjs +9 -9
  19. package/dist/{app-CWjCklhF.d.mts → app-1h3lVT4a.d.mts} +5 -5
  20. package/dist/{app-CDJHPqZn.d.ts → app-KjFzdCqy.d.ts} +5 -5
  21. package/dist/app-manifest-D3RkVNuS.d.mts +120 -0
  22. package/dist/app-manifest-DaW8-tvX.d.ts +120 -0
  23. package/dist/app-markdown.d.mts +3 -3
  24. package/dist/app-markdown.d.ts +3 -3
  25. package/dist/cache.cjs +3 -3
  26. package/dist/cache.mjs +2 -2
  27. package/dist/{chunk-UM3ZV5EP.mjs → chunk-24SP5TGU.mjs} +1 -1
  28. package/dist/{chunk-B6IMBBOS.cjs → chunk-25LPIZSX.cjs} +3 -3
  29. package/dist/{chunk-WW374SGU.mjs → chunk-26RUNDIR.mjs} +1 -1
  30. package/dist/{chunk-B77AUCBV.cjs → chunk-2FUIT2G2.cjs} +3 -3
  31. package/dist/{chunk-IMQO6ZUU.mjs → chunk-2JZHQDUY.mjs} +2 -2
  32. package/dist/{chunk-BPGO2IEP.mjs → chunk-35WS7P2V.mjs} +24 -126
  33. package/dist/{chunk-XKIUHXHW.mjs → chunk-375K2ZVU.mjs} +46 -52
  34. package/dist/{chunk-MNUSIXGS.mjs → chunk-4KQDHTWX.mjs} +1 -1
  35. package/dist/{chunk-DATEWH3W.cjs → chunk-6IZWX6ES.cjs} +22 -8
  36. package/dist/{chunk-Y6LRPO2K.mjs → chunk-6LVRDOAW.mjs} +19 -5
  37. package/dist/{chunk-UMQAK3KP.cjs → chunk-6MVFHNYZ.cjs} +2 -2
  38. package/dist/{chunk-OLQ73ZO5.mjs → chunk-6PKXK4TY.mjs} +3 -3
  39. package/dist/{chunk-PYQ3ZG4Z.mjs → chunk-724JLMS4.mjs} +4 -4
  40. package/dist/{chunk-PNCM5MFD.mjs → chunk-7UEEHAW7.mjs} +1 -1
  41. package/dist/{chunk-EW4MEVLE.cjs → chunk-7YHSD3Z6.cjs} +82 -118
  42. package/dist/{chunk-DKU6NXRK.cjs → chunk-AHFRQMRX.cjs} +1 -1
  43. package/dist/{chunk-7VAJSSPG.mjs → chunk-B2GSRB3P.mjs} +1 -1
  44. package/dist/{chunk-JXB6DVCO.mjs → chunk-BPNRQ5BA.mjs} +1 -1
  45. package/dist/{chunk-FLZ4H25A.cjs → chunk-BXJ5HJTJ.cjs} +13 -12
  46. package/dist/{chunk-GNVEJUT5.cjs → chunk-C5KVWHIH.cjs} +21 -21
  47. package/dist/chunk-COABSY3U.mjs +196 -0
  48. package/dist/{chunk-Y2GNNXGV.cjs → chunk-D64OPY6A.cjs} +5 -5
  49. package/dist/{chunk-BYQVROIP.mjs → chunk-DMRPN25V.mjs} +69 -0
  50. package/dist/{chunk-I64GEPOB.cjs → chunk-FEYQCYT7.cjs} +3 -3
  51. package/dist/{chunk-AXB5P7BK.mjs → chunk-FIAPD365.mjs} +1 -1
  52. package/dist/{chunk-7FHZ3E6D.cjs → chunk-GB7LDGY5.cjs} +2 -2
  53. package/dist/{chunk-45UZKX2J.mjs → chunk-HJ64F4GS.mjs} +2 -2
  54. package/dist/{chunk-IRYK4Z5M.cjs → chunk-I5MG3TKE.cjs} +2 -2
  55. package/dist/{chunk-YR2P74F7.cjs → chunk-IFWSR7YZ.cjs} +2 -2
  56. package/dist/{chunk-5E65AL7P.mjs → chunk-IN6RCKLL.mjs} +5 -4
  57. package/dist/{chunk-CKFK3Z2V.mjs → chunk-IVQY6UTY.mjs} +1 -1
  58. package/dist/{chunk-3TB5QGUW.cjs → chunk-JAXDRRRC.cjs} +70 -1
  59. package/dist/{chunk-EORXKFLR.cjs → chunk-JEIG3EWE.cjs} +1 -1
  60. package/dist/{chunk-54QWHSNR.cjs → chunk-JG3MEQUH.cjs} +150 -156
  61. package/dist/{chunk-TFX4RTH2.mjs → chunk-JOW4HDJO.mjs} +1 -1
  62. package/dist/{chunk-H44XGLFU.cjs → chunk-L6A26QT5.cjs} +9 -9
  63. package/dist/{chunk-OZN4XL6L.cjs → chunk-LIZTLA5F.cjs} +7 -6
  64. package/dist/{chunk-62DY5GKS.mjs → chunk-LLUA2LSC.mjs} +2 -2
  65. package/dist/{chunk-LDPKAYVS.cjs → chunk-LYIZHJTK.cjs} +2 -2
  66. package/dist/{chunk-2DMWQWNJ.mjs → chunk-MEASUNVY.mjs} +1 -1
  67. package/dist/{chunk-T4II4MMW.mjs → chunk-MHHCLYXU.mjs} +1 -1
  68. package/dist/{chunk-SHFXCE5A.cjs → chunk-MHN4UR5U.cjs} +4 -4
  69. package/dist/{chunk-5JEC43MQ.cjs → chunk-MN4TQJ3W.cjs} +9 -9
  70. package/dist/{chunk-5XS5NCVM.cjs → chunk-MY5PZYAD.cjs} +4 -4
  71. package/dist/{chunk-2JG2LJDI.cjs → chunk-NBPNUQYO.cjs} +2 -2
  72. package/dist/{chunk-4XO5GSD6.cjs → chunk-NFG4PUPI.cjs} +2 -2
  73. package/dist/{chunk-Y4QVEU67.mjs → chunk-NU25TRIO.mjs} +5 -4
  74. package/dist/{chunk-5LL6TKII.mjs → chunk-O7USYJ4U.mjs} +1 -1
  75. package/dist/{chunk-VBN3UAPQ.mjs → chunk-P2UJF4SS.mjs} +1 -1
  76. package/dist/{chunk-T6DLMX5V.mjs → chunk-PIZXONIS.mjs} +73 -109
  77. package/dist/{chunk-KK22JPQM.cjs → chunk-QEILRWVV.cjs} +30 -132
  78. package/dist/{chunk-UXMIFB44.cjs → chunk-QIBP5EFA.cjs} +5 -5
  79. package/dist/{chunk-TAKG7ZCD.cjs → chunk-QKZMB7LY.cjs} +14 -14
  80. package/dist/{chunk-FCOLU5P6.mjs → chunk-QTEJGB5A.mjs} +39 -16
  81. package/dist/{chunk-QJM7A4CR.cjs → chunk-S7MTDRYA.cjs} +10 -10
  82. package/dist/{chunk-ACLPN56I.mjs → chunk-SGB4IW7K.mjs} +1 -1
  83. package/dist/{chunk-GKQL726H.cjs → chunk-TCJ4A4A2.cjs} +78 -82
  84. package/dist/{chunk-ZKVJYQPO.mjs → chunk-TUL355PH.mjs} +13 -17
  85. package/dist/{chunk-H56MQYEG.mjs → chunk-U2UC7UGP.mjs} +1 -1
  86. package/dist/{chunk-I63UCMXW.mjs → chunk-ULQOP5UI.mjs} +2 -2
  87. package/dist/{chunk-HBEBV7OZ.mjs → chunk-UQUEANTY.mjs} +1 -1
  88. package/dist/chunk-VHRS3MCW.cjs +196 -0
  89. package/dist/{chunk-WCWV25PG.mjs → chunk-VTBXE6QG.mjs} +2 -2
  90. package/dist/{chunk-E55H6UKH.cjs → chunk-WLHA5USH.cjs} +9 -9
  91. package/dist/{chunk-YJBWB6GF.mjs → chunk-WMBRZI5V.mjs} +1 -1
  92. package/dist/{chunk-AGR7F3LA.cjs → chunk-WROEFVNO.cjs} +3 -3
  93. package/dist/{chunk-CA62IQY3.cjs → chunk-WU7ZS3EM.cjs} +2 -2
  94. package/dist/{chunk-ZOABCQGT.mjs → chunk-X3NGFVRF.mjs} +37 -22
  95. package/dist/{chunk-XJAEZCT6.mjs → chunk-XUC6CFLE.mjs} +1 -1
  96. package/dist/{chunk-6ILGLCXF.cjs → chunk-YWCYV7QC.cjs} +8 -8
  97. package/dist/{chunk-T36UJS3X.mjs → chunk-YYQVGKO5.mjs} +2 -2
  98. package/dist/{chunk-EGCT3AHF.cjs → chunk-ZATTDMBW.cjs} +127 -104
  99. package/dist/{chunk-PGW7HZE2.cjs → chunk-ZS6HDNOM.cjs} +6 -6
  100. package/dist/{chunk-XVIEGKTT.cjs → chunk-ZTP3BJG6.cjs} +41 -26
  101. package/dist/{client-plugins-B_5QbNrp.d.mts → client-plugins-C9Py_50W.d.mts} +79 -7
  102. package/dist/{client-plugins-DgSfIWIF.d.ts → client-plugins-DIem0I0W.d.ts} +79 -7
  103. package/dist/client-plugins.d.mts +2 -2
  104. package/dist/client-plugins.d.ts +2 -2
  105. package/dist/client.cjs +5 -5
  106. package/dist/client.d.mts +6 -6
  107. package/dist/client.d.ts +6 -6
  108. package/dist/client.mjs +4 -4
  109. package/dist/client.react-server.mjs +2 -0
  110. package/dist/config.d.mts +2 -2
  111. package/dist/config.d.ts +2 -2
  112. package/dist/{devtools-ANJ7JAPQ.cjs → devtools-2RY3EKHL.cjs} +6 -6
  113. package/dist/{devtools-VEQQDVHE.mjs → devtools-Q3LBNUJ7.mjs} +5 -5
  114. package/dist/docs.cjs +8 -8
  115. package/dist/docs.d.mts +3 -3
  116. package/dist/docs.d.ts +3 -3
  117. package/dist/docs.mjs +7 -7
  118. package/dist/headers.cjs +4 -4
  119. package/dist/headers.mjs +3 -3
  120. package/dist/image/server.d.mts +1 -1
  121. package/dist/image/server.d.ts +1 -1
  122. package/dist/image/sharp.d.mts +1 -1
  123. package/dist/image/sharp.d.ts +1 -1
  124. package/dist/{image-config-Duob7wER.d.ts → image-config-BpH1q5R8.d.mts} +4 -1
  125. package/dist/{image-config-Duob7wER.d.mts → image-config-BpH1q5R8.d.ts} +4 -1
  126. package/dist/image.d.mts +1 -1
  127. package/dist/image.d.ts +1 -1
  128. package/dist/index.cjs +40 -38
  129. package/dist/index.d.mts +16 -135
  130. package/dist/index.d.ts +16 -135
  131. package/dist/index.mjs +39 -37
  132. package/dist/integrations.d.mts +2 -2
  133. package/dist/integrations.d.ts +2 -2
  134. package/dist/internal/app-markdown-runtime.d.mts +3 -3
  135. package/dist/internal/app-markdown-runtime.d.ts +3 -3
  136. package/dist/internal/build-runtime.cjs +23 -23
  137. package/dist/internal/build-runtime.d.mts +4 -4
  138. package/dist/internal/build-runtime.d.ts +4 -4
  139. package/dist/internal/build-runtime.mjs +22 -22
  140. package/dist/internal/cli-runtime.cjs +13 -13
  141. package/dist/internal/cli-runtime.mjs +12 -12
  142. package/dist/internal/client-error-overlay.cjs +4 -4
  143. package/dist/internal/client-error-overlay.mjs +1 -1
  144. package/dist/internal/compression-runtime.d.mts +2 -2
  145. package/dist/internal/compression-runtime.d.ts +2 -2
  146. package/dist/internal/config-runtime.cjs +6 -6
  147. package/dist/internal/config-runtime.d.mts +3 -3
  148. package/dist/internal/config-runtime.d.ts +3 -3
  149. package/dist/internal/config-runtime.mjs +5 -5
  150. package/dist/internal/docs-precompiled-runtime.cjs +3 -3
  151. package/dist/internal/docs-precompiled-runtime.mjs +2 -2
  152. package/dist/internal/infra-analytics-runtime.cjs +5 -5
  153. package/dist/internal/infra-analytics-runtime.mjs +3 -3
  154. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  155. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  156. package/dist/internal/production-runtime.cjs +21 -13
  157. package/dist/internal/production-runtime.d.mts +29 -126
  158. package/dist/internal/production-runtime.d.ts +29 -126
  159. package/dist/internal/production-runtime.mjs +21 -13
  160. package/dist/markdown.d.mts +2 -2
  161. package/dist/markdown.d.ts +2 -2
  162. package/dist/middleware.cjs +7 -7
  163. package/dist/middleware.d.mts +4 -4
  164. package/dist/middleware.d.ts +4 -4
  165. package/dist/middleware.mjs +6 -6
  166. package/dist/navigation.cjs +4 -4
  167. package/dist/navigation.d.mts +5 -5
  168. package/dist/navigation.d.ts +5 -5
  169. package/dist/navigation.mjs +3 -3
  170. package/dist/{nitro-NFG2LBRC.mjs → nitro-KDACKNHU.mjs} +1 -1
  171. package/dist/{nitro-S2QABUFA.cjs → nitro-NPGU6VBT.cjs} +2 -2
  172. package/dist/plugin.cjs +21 -21
  173. package/dist/plugin.d.mts +4 -3
  174. package/dist/plugin.d.ts +4 -3
  175. package/dist/plugin.mjs +20 -20
  176. package/dist/{production-runtime-j_WCfuwB.d.mts → production-runtime-CHFKIgpW.d.mts} +1 -1
  177. package/dist/{production-runtime-DfknD3g_.d.ts → production-runtime-bjjWq-DA.d.ts} +1 -1
  178. package/dist/query/client.cjs +2 -2
  179. package/dist/query/client.mjs +3 -3
  180. package/dist/{render-plan-CFIhcYYS.d.ts → render-plan-B2UndB4x.d.ts} +1 -1
  181. package/dist/{render-plan-ChUtsymc.d.mts → render-plan-DOHg6wdO.d.mts} +1 -1
  182. package/dist/renderer-client.d.mts +4 -4
  183. package/dist/renderer-client.d.ts +4 -4
  184. package/dist/{request-F4HRwzSd.d.mts → request-DQcGfdgQ.d.mts} +1 -1
  185. package/dist/{request-RJvelT8L.d.ts → request-DVNXRQrI.d.ts} +1 -1
  186. package/dist/request.cjs +3 -3
  187. package/dist/request.d.mts +3 -3
  188. package/dist/request.d.ts +3 -3
  189. package/dist/request.mjs +2 -2
  190. package/dist/{route-rendering-D4coJ-kw.d.ts → route-rendering-B_6fj-GG.d.ts} +1 -1
  191. package/dist/{route-rendering-3a4fbNyC.d.mts → route-rendering-CEX4mFn-.d.mts} +1 -1
  192. package/dist/{router-WLEW3Te1.d.ts → router-CHEMHm1P.d.ts} +1 -1
  193. package/dist/{router-DqIssGRO.d.mts → router-CKHPBKXX.d.mts} +1 -1
  194. package/dist/routes.cjs +4 -4
  195. package/dist/routes.d.mts +2 -2
  196. package/dist/routes.d.ts +2 -2
  197. package/dist/routes.mjs +3 -3
  198. package/dist/{runtime-BrNdLOq9.d.ts → runtime-Br2ZDTAv.d.ts} +1 -1
  199. package/dist/{runtime-CmE_j-js.d.mts → runtime-jj8TKNsy.d.mts} +1 -1
  200. package/dist/server-fn.cjs +4 -4
  201. package/dist/server-fn.mjs +3 -3
  202. package/dist/server-plugins.cjs +5 -5
  203. package/dist/server-plugins.d.mts +3 -3
  204. package/dist/server-plugins.d.ts +3 -3
  205. package/dist/server-plugins.mjs +4 -4
  206. package/dist/server-query.cjs +5 -5
  207. package/dist/server-query.mjs +4 -4
  208. package/dist/server.cjs +46 -46
  209. package/dist/server.d.mts +10 -9
  210. package/dist/server.d.ts +10 -9
  211. package/dist/server.mjs +25 -25
  212. package/dist/{spa-router-C41zjnFl.d.mts → spa-router-BEvS9Erj.d.mts} +2 -2
  213. package/dist/{spa-router-D_0VXqPC.d.ts → spa-router-DmCuH5B7.d.ts} +2 -2
  214. package/dist/ssg-57v6cZcW.d.mts +184 -0
  215. package/dist/ssg-gT093ETk.d.ts +184 -0
  216. package/dist/testing.cjs +11 -11
  217. package/dist/testing.d.mts +2 -2
  218. package/dist/testing.d.ts +2 -2
  219. package/dist/testing.mjs +8 -8
  220. package/dist/theme/server.cjs +4 -4
  221. package/dist/theme/server.mjs +3 -3
  222. package/dist/{utils-YYcWsOJp.d.ts → utils-CCTKvR-P.d.ts} +1 -1
  223. package/dist/{utils-BKWSe3S7.d.mts → utils-raHHQVyL.d.mts} +1 -1
  224. package/dist/version.cjs +2 -2
  225. package/dist/version.mjs +1 -1
  226. package/dist/vite.cjs +38 -22
  227. package/dist/vite.d.mts +41 -4
  228. package/dist/vite.d.ts +41 -4
  229. package/dist/vite.mjs +38 -22
  230. package/dist/workflows.cjs +2 -2
  231. package/dist/workflows.mjs +1 -1
  232. package/package.json +2 -1
  233. package/dist/chunk-DAO7JGTS.mjs +0 -73
  234. package/dist/chunk-SYQ3MOWW.cjs +0 -73
  235. package/dist/programmatic-routes-client-DcoxEaLe.d.mts +0 -55
  236. package/dist/programmatic-routes-client-DcoxEaLe.d.ts +0 -55
  237. /package/dist/{chunk-MOSYH4CY.mjs → chunk-FWCGUVVL.mjs} +0 -0
  238. /package/dist/{chunk-4A3YUB4D.cjs → chunk-KF6VDJH7.cjs} +0 -0
@@ -4,12 +4,15 @@ import {
4
4
  import {
5
5
  DEFAULT_ERROR_STYLES
6
6
  } from "./chunk-XAXTTBUT.mjs";
7
+ import {
8
+ resolveFarmAppManifestConfig
9
+ } from "./chunk-DMRPN25V.mjs";
7
10
  import {
8
11
  serializeFarmLlmsTxt
9
12
  } from "./chunk-ETPEZLS3.mjs";
10
13
  import {
11
14
  stampFarmCspNonce
12
- } from "./chunk-PNCM5MFD.mjs";
15
+ } from "./chunk-7UEEHAW7.mjs";
13
16
  import {
14
17
  emitFarmAgentRead
15
18
  } from "./chunk-KYN5ODF6.mjs";
@@ -42,7 +45,7 @@ import {
42
45
  } from "./chunk-ZZGQD7A4.mjs";
43
46
  import {
44
47
  FARM_VERSION
45
- } from "./chunk-H56MQYEG.mjs";
48
+ } from "./chunk-U2UC7UGP.mjs";
46
49
  import {
47
50
  localizeFarmPathname
48
51
  } from "./chunk-L3KT7IXV.mjs";
@@ -112,7 +115,7 @@ function routeBoundaryCoversDirectory(boundaryPattern, directory) {
112
115
  __name(routeBoundaryCoversDirectory, "routeBoundaryCoversDirectory");
113
116
 
114
117
  // src/server/full-document.ts
115
- var CONTENTS_WRAPPER = /^<div\b[^>]*style="display\s*:\s*contents"[^>]*>/i;
118
+ var CONTENTS_WRAPPER = /^<div\b[^>]*style="display\s*:\s*contents;?\s*"[^>]*>/i;
116
119
  var HOISTED_HEAD_ELEMENT = /^(?:<(?:meta|link|base)\b[^>]*>|<title\b[^>]*>[\s\S]*?<\/title>|<script\b[^>]*\basync\b[^>]*><\/script>|<style\b[^>]*\bdata-precedence\b[^>]*>[\s\S]*?<\/style>)/i;
117
120
  function peelDocumentPrefix(markup) {
118
121
  let inner = markup.replace(/^\s+/, "");
@@ -961,13 +964,11 @@ function isFarmAppManifestPath(pathname) {
961
964
  return pathname === FARM_APP_MANIFEST_PATH || pathname === FARM_APP_MANIFEST_LEGACY_PATH;
962
965
  }
963
966
  __name(isFarmAppManifestPath, "isFarmAppManifestPath");
964
- var FARM_INFRA_SIGNATURE_HEADER = "farmjs-infra-signature";
965
- var SIGNED_PURPOSE = "farmjs-manifest-v1";
966
- var SIGNATURE_WINDOW_SECONDS = 300;
967
967
  function resolveFarmAppManifestInput(config, extra) {
968
968
  const llms = config.agent?.llmsTxt;
969
969
  const plugins = (config.plugins ?? []).map(({ name }) => name);
970
970
  const webmcp = plugins.includes("farm:webmcp");
971
+ const sections = resolveFarmAppManifestConfig(config.agent?.manifest);
971
972
  return {
972
973
  renderer: config.renderer?.name ?? "react",
973
974
  basePath: config.basePath || "/",
@@ -984,7 +985,7 @@ function resolveFarmAppManifestInput(config, extra) {
984
985
  openapi: config.openapi?.enabled && config.openapi.specRoute ? config.openapi.specRoute : null
985
986
  },
986
987
  plugins,
987
- analytics: config.analytics !== false
988
+ ...sections ? { sections } : {}
988
989
  };
989
990
  }
990
991
  __name(resolveFarmAppManifestInput, "resolveFarmAppManifestInput");
@@ -993,56 +994,71 @@ var SOURCES = {
993
994
  standalone: "defineTool",
994
995
  serverFunction: "serverFunction"
995
996
  };
996
- function createFarmAppManifest(input, { full = false } = {}) {
997
- const manifest = {
997
+ var DEFAULT_SECTIONS = resolveFarmAppManifestConfig(void 0);
998
+ function createFarmAppManifest(input) {
999
+ const sections = input.sections ?? DEFAULT_SECTIONS;
1000
+ const { app, mcp, webmcp } = sections;
1001
+ return {
998
1002
  schemaVersion: 1,
999
- app: {
1000
- farm: FARM_VERSION,
1001
- renderer: input.renderer,
1003
+ app: app ? {
1004
+ ...app.version ? { farm: FARM_VERSION } : {},
1005
+ ...app.renderer ? { renderer: input.renderer } : {},
1002
1006
  basePath: input.basePath,
1003
- build: input.build
1004
- },
1005
- packages: input.packages,
1006
- mcp: {
1007
- servers: _listFarmMCPCatalogs().map(({ server, tools, details }) => {
1008
- const open = details?.public === true && !input.guardCoversPath?.(server.path);
1009
- const listed = full || open;
1010
- return {
1011
- name: server.name,
1012
- version: server.version,
1013
- path: server.path,
1014
- authorization: open ? "none" : "required",
1015
- resources: listed ? [...details?.resources ?? []] : [],
1016
- prompts: listed ? [...details?.prompts ?? []] : [],
1017
- tools: (listed ? tools : []).map((tool) => {
1018
- const schemas = details?.schemas?.[tool.name];
1019
- const hints = Object.fromEntries(
1020
- ["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"].filter((hint) => typeof tool[hint] === "boolean").map((hint) => [hint, tool[hint]])
1021
- );
1022
- return {
1023
- name: tool.name,
1024
- ...tool.title ? { title: tool.title } : {},
1025
- ...tool.description ? { description: tool.description } : {},
1026
- source: SOURCES[tool.kind],
1027
- // MCP clients never see the route behind a tool; only Infra's view names it.
1028
- ...full && tool.kind === "endpoint" ? { method: tool.method, path: tool.path } : {},
1029
- ...hints,
1030
- ...schemas ? { inputSchema: schemas.input } : {},
1031
- ...schemas?.output ? { outputSchema: schemas.output } : {}
1032
- };
1033
- })
1034
- };
1035
- })
1036
- },
1037
- webmcp: input.webmcp,
1038
- integrations: input.integrations,
1039
- agent: input.agent,
1040
- plugins: input.plugins
1007
+ ...app.build ? { build: input.build } : {}
1008
+ } : null,
1009
+ packages: sections.packages === "names" ? Object.fromEntries(Object.keys(input.packages).map((name) => [name, null])) : sections.packages ? input.packages : null,
1010
+ mcp: mcp ? { servers: listServers(input, mcp) } : null,
1011
+ webmcp: webmcp ? {
1012
+ enabled: input.webmcp.enabled,
1013
+ tools: input.webmcp.tools.filter((tool) => !webmcp.hide.includes(tool.name))
1014
+ } : null,
1015
+ integrations: sections.integrations ? input.integrations : null,
1016
+ agent: sections.agent ? input.agent : null,
1017
+ plugins: sections.plugins ? input.plugins : null
1041
1018
  };
1042
- manifest.mcp.servers.push(...listDefaultServer(input));
1043
- return manifest;
1044
1019
  }
1045
1020
  __name(createFarmAppManifest, "createFarmAppManifest");
1021
+ function listServers(input, mcp) {
1022
+ const servers = _listFarmMCPCatalogs().map(({ server, tools, details }) => {
1023
+ const open = details?.public === true && !input.guardCoversPath?.(server.path);
1024
+ return {
1025
+ name: server.name,
1026
+ version: server.version,
1027
+ path: server.path,
1028
+ authorization: open ? "none" : "required",
1029
+ resources: open ? [...details?.resources ?? []] : [],
1030
+ prompts: open ? [...details?.prompts ?? []] : [],
1031
+ tools: (open ? tools : []).map((tool) => {
1032
+ const schemas = details?.schemas?.[tool.name];
1033
+ const hints = Object.fromEntries(
1034
+ ["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"].filter((hint) => typeof tool[hint] === "boolean").map((hint) => [hint, tool[hint]])
1035
+ );
1036
+ return {
1037
+ name: tool.name,
1038
+ ...tool.title ? { title: tool.title } : {},
1039
+ ...tool.description ? { description: tool.description } : {},
1040
+ source: SOURCES[tool.kind],
1041
+ ...hints,
1042
+ ...schemas ? { inputSchema: schemas.input } : {},
1043
+ ...schemas?.output ? { outputSchema: schemas.output } : {}
1044
+ };
1045
+ })
1046
+ };
1047
+ });
1048
+ return [...servers, ...listDefaultServer(input)].filter((server) => !mcp.hide.includes(server.name)).map((server) => ({
1049
+ ...server,
1050
+ tools: server.tools.filter((tool) => !mcp.hide.includes(`${server.name}/${tool.name}`)).map((tool) => mcp.schemas ? tool : withoutSchemas(tool))
1051
+ }));
1052
+ }
1053
+ __name(listServers, "listServers");
1054
+ function withoutSchemas({
1055
+ inputSchema: _input,
1056
+ outputSchema: _output,
1057
+ ...tool
1058
+ }) {
1059
+ return tool;
1060
+ }
1061
+ __name(withoutSchemas, "withoutSchemas");
1046
1062
  function listDefaultServer(input) {
1047
1063
  const server = input.defaultMCP?.();
1048
1064
  if (!server) return [];
@@ -1068,57 +1084,13 @@ function listDefaultServer(input) {
1068
1084
  ];
1069
1085
  }
1070
1086
  __name(listDefaultServer, "listDefaultServer");
1071
- var encoder = new TextEncoder();
1072
- var hex = /* @__PURE__ */ __name((bytes) => [...new Uint8Array(bytes)].map((byte) => byte.toString(16).padStart(2, "0")).join(""), "hex");
1073
- async function sha256Hex(value) {
1074
- return hex(await crypto.subtle.digest("SHA-256", encoder.encode(value)));
1075
- }
1076
- __name(sha256Hex, "sha256Hex");
1077
- async function hmacHex(secret, message) {
1078
- const key = await crypto.subtle.importKey(
1079
- "raw",
1080
- encoder.encode(secret),
1081
- { name: "HMAC", hash: "SHA-256" },
1082
- false,
1083
- ["sign"]
1084
- );
1085
- return hex(await crypto.subtle.sign("HMAC", key, encoder.encode(message)));
1086
- }
1087
- __name(hmacHex, "hmacHex");
1088
- function sameHex(a, b) {
1089
- if (a.length !== b.length) return false;
1090
- let difference = 0;
1091
- for (let index = 0; index < a.length; index++)
1092
- difference |= a.charCodeAt(index) ^ b.charCodeAt(index);
1093
- return difference === 0;
1094
- }
1095
- __name(sameHex, "sameHex");
1096
- async function verifyFarmInfraManifestSignature(header, key, now = Date.now()) {
1097
- if (!header || header.length > 2048) return false;
1098
- const parts = header.split(",").map((part) => part.trim());
1099
- const timestamp = Number(
1100
- /^t=(\d{1,12})$/.exec(parts.find((part) => part.startsWith("t=")) ?? "")?.[1]
1101
- );
1102
- if (!Number.isSafeInteger(timestamp)) return false;
1103
- if (Math.abs(now / 1e3 - timestamp) > SIGNATURE_WINDOW_SECONDS) return false;
1104
- const signatures = parts.filter((part) => part.startsWith("v1=")).map((part) => part.slice(3)).filter((value) => /^[0-9a-f]{64}$/.test(value));
1105
- if (!signatures.length || signatures.length > 8) return false;
1106
- const expected = await hmacHex(await sha256Hex(key), `${SIGNED_PURPOSE}
1107
- ${timestamp}`);
1108
- return signatures.some((signature) => sameHex(signature, expected));
1109
- }
1110
- __name(verifyFarmInfraManifestSignature, "verifyFarmInfraManifestSignature");
1111
- function processEnv() {
1112
- return globalThis.process?.env ?? {};
1113
- }
1114
- __name(processEnv, "processEnv");
1115
1087
  var CORS_HEADERS = {
1116
1088
  "access-control-allow-origin": "*",
1117
1089
  "access-control-allow-methods": "GET, HEAD, OPTIONS",
1118
- "access-control-allow-headers": `If-None-Match, ${FARM_INFRA_SIGNATURE_HEADER}`,
1090
+ "access-control-allow-headers": "If-None-Match",
1119
1091
  "access-control-expose-headers": "ETag"
1120
1092
  };
1121
- async function createFarmAppManifestResponse(request, input, options = {}) {
1093
+ async function createFarmAppManifestResponse(request, input) {
1122
1094
  const method = request.method.toUpperCase();
1123
1095
  if (method === "OPTIONS") return new Response(null, { status: 204, headers: CORS_HEADERS });
1124
1096
  if (method !== "GET" && method !== "HEAD") {
@@ -1127,23 +1099,16 @@ async function createFarmAppManifestResponse(request, input, options = {}) {
1127
1099
  headers: { ...CORS_HEADERS, allow: "GET, HEAD, OPTIONS", "content-type": "text/plain" }
1128
1100
  });
1129
1101
  }
1130
- const signature = request.headers.get(FARM_INFRA_SIGNATURE_HEADER);
1131
- const key = input.analytics ? (options.env ?? processEnv()).FARMJS_API_KEY?.trim() : void 0;
1132
- const full = Boolean(
1133
- signature && key && await verifyFarmInfraManifestSignature(signature, key)
1134
- );
1135
- const body = JSON.stringify(createFarmAppManifest(input, { full }));
1102
+ const body = JSON.stringify(createFarmAppManifest(input));
1136
1103
  const etag = createFarmWeakETag(body);
1137
1104
  const headers = {
1138
1105
  ...CORS_HEADERS,
1139
1106
  "content-type": "application/json; charset=utf-8",
1140
- // The full view is for Infra alone; shared caches keep the two views apart.
1141
- "cache-control": full ? "private, no-store" : "public, max-age=0, must-revalidate",
1142
- vary: FARM_INFRA_SIGNATURE_HEADER,
1107
+ "cache-control": "public, max-age=0, must-revalidate",
1143
1108
  etag,
1144
1109
  "x-content-type-options": "nosniff"
1145
1110
  };
1146
- if (!full && matchesFarmIfNoneMatch(request.headers.get("if-none-match"), etag)) {
1111
+ if (matchesFarmIfNoneMatch(request.headers.get("if-none-match"), etag)) {
1147
1112
  return new Response(null, { status: 304, headers });
1148
1113
  }
1149
1114
  return new Response(method === "HEAD" ? null : body, { status: 200, headers });
@@ -1186,7 +1151,6 @@ export {
1186
1151
  FARM_APP_MANIFEST_PATH,
1187
1152
  FARM_APP_MANIFEST_LEGACY_PATH,
1188
1153
  isFarmAppManifestPath,
1189
- FARM_INFRA_SIGNATURE_HEADER,
1190
1154
  resolveFarmAppManifestInput,
1191
1155
  createFarmAppManifestResponse
1192
1156
  };
@@ -9,7 +9,10 @@ var _chunk4U5XZDLGcjs = require('./chunk-4U5XZDLG.cjs');
9
9
  var _chunk6D24SDKOcjs = require('./chunk-6D24SDKO.cjs');
10
10
 
11
11
 
12
- var _chunkSYQ3MOWWcjs = require('./chunk-SYQ3MOWW.cjs');
12
+
13
+
14
+
15
+ var _chunkVHRS3MCWcjs = require('./chunk-VHRS3MCW.cjs');
13
16
 
14
17
 
15
18
 
@@ -29,13 +32,13 @@ var _chunkWBKEZXWEcjs = require('./chunk-WBKEZXWE.cjs');
29
32
  var _chunkM7MKQXAFcjs = require('./chunk-M7MKQXAF.cjs');
30
33
 
31
34
 
32
- var _chunk4A3YUB4Dcjs = require('./chunk-4A3YUB4D.cjs');
35
+ var _chunkKF6VDJH7cjs = require('./chunk-KF6VDJH7.cjs');
33
36
 
34
37
 
35
38
  var _chunkUFDAAQFXcjs = require('./chunk-UFDAAQFX.cjs');
36
39
 
37
40
 
38
- var _chunkCA62IQY3cjs = require('./chunk-CA62IQY3.cjs');
41
+ var _chunkWU7ZS3EMcjs = require('./chunk-WU7ZS3EM.cjs');
39
42
 
40
43
 
41
44
  var _chunk5QIKR7RRcjs = require('./chunk-5QIKR7RR.cjs');
@@ -44,10 +47,8 @@ var _chunk5QIKR7RRcjs = require('./chunk-5QIKR7RR.cjs');
44
47
  var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
45
48
 
46
49
  // src/ssg.ts
50
+ var _fs = require('fs'); var fs = _interopRequireWildcard(_fs); var fs2 = _interopRequireWildcard(_fs);
47
51
  var _promises = require('fs/promises');
48
- var OPTIONAL_CATCH_ALL_SEGMENT = /^\[\[\.\.\.([^\]]+)\]\]$/;
49
- var REQUIRED_CATCH_ALL_SEGMENT = /^\[\.\.\.([^\]]+)\]$/;
50
- var REQUIRED_DYNAMIC_SEGMENT = /^\[([^\]]+)\]$/;
51
52
  var REQUEST_API_LABELS = /* @__PURE__ */ new Map([
52
53
  ["cookies", "request cookies"],
53
54
  ["headers", "request headers"],
@@ -65,7 +66,7 @@ var ROUTE_PROP_LABELS = /* @__PURE__ */ new Map([
65
66
  ["context", "request context"]
66
67
  ]);
67
68
  function resolveConfiguredRouteRenderingConfig(mod, source, options) {
68
- return _chunkSYQ3MOWWcjs.mergeRouteRenderingDirectiveConfig.call(void 0, parseRouteRenderingDirective(source), mod, options);
69
+ return _chunkVHRS3MCWcjs.mergeRouteRenderingDirectiveConfig.call(void 0, parseRouteRenderingDirective(source), mod, options);
69
70
  }
70
71
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveConfiguredRouteRenderingConfig, "resolveConfiguredRouteRenderingConfig");
71
72
  function resolveRouteRenderingConfig(mod, source, options) {
@@ -317,6 +318,17 @@ function parseRouteRenderingDirective(source) {
317
318
  return void 0;
318
319
  }
319
320
  _chunkS3JO3N4Hcjs.__name.call(void 0, parseRouteRenderingDirective, "parseRouteRenderingDirective");
321
+ function readRouteRenderingDirectiveFromFile(modulePath) {
322
+ try {
323
+ const source = _fs.readFileSync.call(void 0, modulePath, "utf8");
324
+ const directive = parseRouteRenderingDirective(source);
325
+ if (findRequestBoundSourceBlockers(source).length === 0) return directive;
326
+ return { ..._nullishCoalesce(directive, () => ( { ssg: false, ppr: false, directive: "" })), requestBound: true };
327
+ } catch (e) {
328
+ return void 0;
329
+ }
330
+ }
331
+ _chunkS3JO3N4Hcjs.__name.call(void 0, readRouteRenderingDirectiveFromFile, "readRouteRenderingDirectiveFromFile");
320
332
  function parseKnownRenderingDirective(directive) {
321
333
  const normalized = directive.trim().toLowerCase();
322
334
  const match = normalized.match(
@@ -454,11 +466,11 @@ async function collectSSGPages(routes, loadModule, options = {}) {
454
466
  );
455
467
  }
456
468
  const paths = await getStaticPaths();
457
- const optionalCatchAllParams = getOptionalCatchAllParameterNames(route.path);
469
+ const optionalCatchAllParams = _chunkVHRS3MCWcjs.getOptionalCatchAllParameterNames.call(void 0, route.path);
458
470
  const materializedPages = paths.map((params) => ({
459
- urlPath: materializeSSGRoutePath(route.path, params),
471
+ urlPath: _chunkVHRS3MCWcjs.materializeSSGRoutePath.call(void 0, route.path, params),
460
472
  filePath: route.filePath,
461
- params: normalizeStaticPathParams(params, optionalCatchAllParams),
473
+ params: _chunkVHRS3MCWcjs.normalizeStaticPathParams.call(void 0, params, optionalCatchAllParams),
462
474
  revalidate: rendering.revalidate
463
475
  }));
464
476
  ssgPages.push(...materializedPages);
@@ -495,121 +507,6 @@ Add \`export const dynamic = "force-static";\` after verifying that imported cod
495
507
  return { ssg: ssgPages, ssr: ssrRoutes };
496
508
  }
497
509
  _chunkS3JO3N4Hcjs.__name.call(void 0, collectSSGPages, "collectSSGPages");
498
- function materializeSSGRoutePath(routePattern, params) {
499
- const outputSegments = [];
500
- for (const segment of routePattern.split("/")) {
501
- if (!segment) {
502
- continue;
503
- }
504
- const optionalCatchAll = segment.match(OPTIONAL_CATCH_ALL_SEGMENT);
505
- if (optionalCatchAll) {
506
- const parameterName = optionalCatchAll[1];
507
- const value = params[parameterName];
508
- const values = readCatchAllSegments(value, {
509
- optional: true,
510
- parameterName,
511
- routePattern
512
- });
513
- outputSegments.push(...values.map(encodePathSegment));
514
- continue;
515
- }
516
- const requiredCatchAll = segment.match(REQUIRED_CATCH_ALL_SEGMENT);
517
- if (requiredCatchAll) {
518
- const parameterName = requiredCatchAll[1];
519
- const value = params[parameterName];
520
- const values = readCatchAllSegments(value, {
521
- optional: false,
522
- parameterName,
523
- routePattern
524
- });
525
- outputSegments.push(...values.map(encodePathSegment));
526
- continue;
527
- }
528
- const requiredDynamic = segment.match(REQUIRED_DYNAMIC_SEGMENT);
529
- if (requiredDynamic) {
530
- const parameterName = requiredDynamic[1];
531
- const value = params[parameterName];
532
- if (isStaticPathArray(value)) {
533
- throw new Error(
534
- `Cannot materialize SSG route "${routePattern}": parameter "${parameterName}" must be a scalar value; arrays are only supported for catch-all segments.`
535
- );
536
- }
537
- if (isMissingPathValue(value)) {
538
- throw missingRequiredParameterError(routePattern, parameterName);
539
- }
540
- outputSegments.push(encodePathSegment(value));
541
- continue;
542
- }
543
- outputSegments.push(segment);
544
- }
545
- return outputSegments.length > 0 ? `/${outputSegments.join("/")}` : "/";
546
- }
547
- _chunkS3JO3N4Hcjs.__name.call(void 0, materializeSSGRoutePath, "materializeSSGRoutePath");
548
- function readCatchAllSegments(value, options) {
549
- if (isMissingPathValue(value) || isStaticPathArray(value) && value.length === 0) {
550
- if (options.optional) {
551
- return [];
552
- }
553
- throw missingRequiredParameterError(options.routePattern, options.parameterName);
554
- }
555
- const segments = isStaticPathArray(value) ? [...value] : [value];
556
- if (segments.some(isMissingPathValue)) {
557
- throw new Error(
558
- `Cannot materialize SSG route "${options.routePattern}": catch-all parameter "${options.parameterName}" contains an empty path segment.`
559
- );
560
- }
561
- return segments;
562
- }
563
- _chunkS3JO3N4Hcjs.__name.call(void 0, readCatchAllSegments, "readCatchAllSegments");
564
- function getOptionalCatchAllParameterNames(routePattern) {
565
- return new Set(
566
- routePattern.split("/").map((segment) => _optionalChain([segment, 'access', _41 => _41.match, 'call', _42 => _42(OPTIONAL_CATCH_ALL_SEGMENT), 'optionalAccess', _43 => _43[1]])).filter((name) => Boolean(name))
567
- );
568
- }
569
- _chunkS3JO3N4Hcjs.__name.call(void 0, getOptionalCatchAllParameterNames, "getOptionalCatchAllParameterNames");
570
- function normalizeStaticPathParams(params, optionalCatchAllParams) {
571
- const entries = Object.entries(params).map(([key, value]) => {
572
- const emptyOptionalCatchAll = optionalCatchAllParams.has(key) && (isMissingPathValue(value) || isStaticPathArray(value) && value.length === 0);
573
- return [
574
- key,
575
- emptyOptionalCatchAll ? "" : isStaticPathArray(value) ? value.map(String).join("/") : String(value)
576
- ];
577
- });
578
- for (const name of optionalCatchAllParams) {
579
- if (!Object.prototype.hasOwnProperty.call(params, name)) {
580
- entries.push([name, ""]);
581
- }
582
- }
583
- return Object.fromEntries(entries);
584
- }
585
- _chunkS3JO3N4Hcjs.__name.call(void 0, normalizeStaticPathParams, "normalizeStaticPathParams");
586
- function isMissingPathValue(value) {
587
- return value === "" || value === null || typeof value === "undefined";
588
- }
589
- _chunkS3JO3N4Hcjs.__name.call(void 0, isMissingPathValue, "isMissingPathValue");
590
- function isStaticPathArray(value) {
591
- return Array.isArray(value);
592
- }
593
- _chunkS3JO3N4Hcjs.__name.call(void 0, isStaticPathArray, "isStaticPathArray");
594
- function missingRequiredParameterError(routePattern, parameterName) {
595
- return new Error(
596
- `Cannot materialize SSG route "${routePattern}": required parameter "${parameterName}" is missing or empty.`
597
- );
598
- }
599
- _chunkS3JO3N4Hcjs.__name.call(void 0, missingRequiredParameterError, "missingRequiredParameterError");
600
- function encodePathSegment(value) {
601
- const encoded = encodeURIComponent(String(value)).replace(
602
- /[!'()*]/g,
603
- (character) => `%${character.charCodeAt(0).toString(16).toUpperCase()}`
604
- );
605
- if (encoded === "." || encoded === "..") {
606
- throw new Error(
607
- `Cannot materialize SSG path segment "${encoded}": dot-only segments are unsafe to prerender.`
608
- );
609
- }
610
- return encoded;
611
- }
612
- _chunkS3JO3N4Hcjs.__name.call(void 0, encodePathSegment, "encodePathSegment");
613
510
  function isSSGModule(mod) {
614
511
  return resolveRouteRenderingConfig(mod).ssg;
615
512
  }
@@ -647,7 +544,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, matchSSGPage, "matchSSGPage");
647
544
 
648
545
  // src/routing/generate-route-types.ts
649
546
  var _path = require('path'); var path = _interopRequireWildcard(_path); var path3 = _interopRequireWildcard(_path);
650
- var _fs = require('fs'); var fs = _interopRequireWildcard(_fs); var fs2 = _interopRequireWildcard(_fs);
547
+
651
548
  function routeSegmentsToTsTypeLiteral(segments) {
652
549
  if (segments.length === 0) return '"/"';
653
550
  const hasDynamic = segments.some((s) => s.startsWith("["));
@@ -736,7 +633,7 @@ async function createRouteTypeDeclarations(options, outPath) {
736
633
  }
737
634
  }
738
635
  }
739
- for (const route of await _chunk4A3YUB4Dcjs.discoverProgrammaticRoutePaths.call(void 0, source.root, source.srcDir)) {
636
+ for (const route of await _chunkKF6VDJH7cjs.discoverProgrammaticRoutePaths.call(void 0, source.root, source.srcDir)) {
740
637
  patterns.add(route);
741
638
  routeModulePatterns.add(route);
742
639
  }
@@ -1061,7 +958,7 @@ function fieldTsType(field) {
1061
958
  case "json":
1062
959
  return "unknown";
1063
960
  case "enum":
1064
- return _optionalChain([field, 'access', _44 => _44.values, 'optionalAccess', _45 => _45.length]) ? field.values.map((value) => JSON.stringify(value)).join(" | ") : "string";
961
+ return _optionalChain([field, 'access', _41 => _41.values, 'optionalAccess', _42 => _42.length]) ? field.values.map((value) => JSON.stringify(value)).join(" | ") : "string";
1065
962
  // id, uuid, string, text, datetime all travel as strings over JSON.
1066
963
  default:
1067
964
  return "string";
@@ -1088,7 +985,7 @@ async function generateFarmTypeArtifacts(options) {
1088
985
  const shouldGenerateApi = options.api !== false;
1089
986
  const shouldGenerateEnv = options.env !== false;
1090
987
  const shouldGenerateImages = options.images !== false;
1091
- const shouldGenerateI18n = options.i18n !== false && _optionalChain([options, 'access', _46 => _46.i18nConfig, 'optionalAccess', _47 => _47.enabled]);
988
+ const shouldGenerateI18n = options.i18n !== false && _optionalChain([options, 'access', _43 => _43.i18nConfig, 'optionalAccess', _44 => _44.enabled]);
1092
989
  const sourceRoots = _chunkWBKEZXWEcjs.getFarmSourceRoots.call(void 0, { root, srcDir, layers: options.layers });
1093
990
  const appDirs = _chunkWBKEZXWEcjs.getFarmAppDirectories.call(void 0, { root, srcDir, layers: options.layers });
1094
991
  const result = {
@@ -1132,7 +1029,7 @@ async function generateFarmTypeArtifacts(options) {
1132
1029
  const generator = new (0, _chunkXSIRSMAScjs.APITypeGenerator)(appDirs);
1133
1030
  const apiRoutes = generator.scanAPIRoutes();
1134
1031
  const apiTypesPath = options.apiTypesOutFile ? _path.resolve.call(void 0, root, options.apiTypesOutFile) : _path.join.call(void 0, root, srcDir, "lib", "api.generated.ts");
1135
- const pluginRoutes = _chunkCA62IQY3cjs.resolvePluginRoutes.call(void 0, options.plugins);
1032
+ const pluginRoutes = _chunkWU7ZS3EMcjs.resolvePluginRoutes.call(void 0, options.plugins);
1136
1033
  const configFiles = [
1137
1034
  ...(_nullishCoalesce(options.layers, () => ( []))).map((layer) => layer.configFile).filter((file) => Boolean(file)),
1138
1035
  options.configPath ? _path.resolve.call(void 0, root, options.configPath) : [
@@ -1208,7 +1105,7 @@ async function generateFarmTypeArtifacts(options) {
1208
1105
  });
1209
1106
  }
1210
1107
  }
1211
- if (shouldRefreshUnifiedTypes && _optionalChain([options, 'access', _48 => _48.i18nConfig, 'optionalAccess', _49 => _49.enabled]) && !options.i18nTypesOutFile) {
1108
+ if (shouldRefreshUnifiedTypes && _optionalChain([options, 'access', _45 => _45.i18nConfig, 'optionalAccess', _46 => _46.enabled]) && !options.i18nTypesOutFile) {
1212
1109
  const { signatures } = await _chunkUFDAAQFXcjs.readFarmI18nCatalogs.call(void 0, options.i18nConfig);
1213
1110
  unifiedSections.push(renderFarmI18nTypes(options.i18nConfig.locales, signatures));
1214
1111
  result.i18nTypesPath = unifiedTypesPath;
@@ -1341,4 +1238,5 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, collectLegacyTypeArtifacts, "collectLegacy
1341
1238
 
1342
1239
 
1343
1240
 
1344
- exports.resolveRouteRenderingConfig = resolveRouteRenderingConfig; exports.resolveRouteRenderingConfigFromFile = resolveRouteRenderingConfigFromFile; exports.analyzeStaticRouteCandidate = analyzeStaticRouteCandidate; exports.findRequestBoundSourceBlockers = findRequestBoundSourceBlockers; exports.parseRouteRenderingDirective = parseRouteRenderingDirective; exports.collectSSGPages = collectSSGPages; exports.isSSGModule = isSSGModule; exports.hasISR = hasISR; exports.getRevalidateInterval = getRevalidateInterval; exports.hasPPR = hasPPR; exports.generateSSGManifest = generateSSGManifest; exports.matchSSGPage = matchSSGPage; exports.generateRouteTypes = generateRouteTypes; exports.generateFarmImageTypes = generateFarmImageTypes; exports.createFarmImageTypeDeclarations = createFarmImageTypeDeclarations; exports.generateFarmI18nTypes = generateFarmI18nTypes; exports.generateFarmTypeArtifacts = generateFarmTypeArtifacts;
1241
+
1242
+ exports.resolveRouteRenderingConfig = resolveRouteRenderingConfig; exports.resolveRouteRenderingConfigFromFile = resolveRouteRenderingConfigFromFile; exports.analyzeStaticRouteCandidate = analyzeStaticRouteCandidate; exports.findRequestBoundSourceBlockers = findRequestBoundSourceBlockers; exports.parseRouteRenderingDirective = parseRouteRenderingDirective; exports.readRouteRenderingDirectiveFromFile = readRouteRenderingDirectiveFromFile; exports.collectSSGPages = collectSSGPages; exports.isSSGModule = isSSGModule; exports.hasISR = hasISR; exports.getRevalidateInterval = getRevalidateInterval; exports.hasPPR = hasPPR; exports.generateSSGManifest = generateSSGManifest; exports.matchSSGPage = matchSSGPage; exports.generateRouteTypes = generateRouteTypes; exports.generateFarmImageTypes = generateFarmImageTypes; exports.createFarmImageTypeDeclarations = createFarmImageTypeDeclarations; exports.generateFarmI18nTypes = generateFarmI18nTypes; exports.generateFarmTypeArtifacts = generateFarmTypeArtifacts;
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
- var _chunkCA62IQY3cjs = require('./chunk-CA62IQY3.cjs');
4
+ var _chunkWU7ZS3EMcjs = require('./chunk-WU7ZS3EM.cjs');
5
5
 
6
6
 
7
7
  var _chunkWMAPPDMMcjs = require('./chunk-WMAPPDMM.cjs');
@@ -36,7 +36,7 @@ var _chunkS3A45T7Fcjs = require('./chunk-S3A45T7F.cjs');
36
36
  var _chunkZEG3OPIBcjs = require('./chunk-ZEG3OPIB.cjs');
37
37
 
38
38
 
39
- var _chunkXVIEGKTTcjs = require('./chunk-XVIEGKTT.cjs');
39
+ var _chunkZTP3BJG6cjs = require('./chunk-ZTP3BJG6.cjs');
40
40
 
41
41
 
42
42
  var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
@@ -55,7 +55,7 @@ function mergePluginAPIRoutes(existing, plugins, expected, options = {}) {
55
55
  });
56
56
  }
57
57
  const api = createPluginLocalAPI(existing, options.bodySizeLimit, options.dispatch);
58
- for (const definition of _chunkCA62IQY3cjs.resolvePluginRoutes.call(void 0, plugins, { api })) {
58
+ for (const definition of _chunkWU7ZS3EMcjs.resolvePluginRoutes.call(void 0, plugins, { api })) {
59
59
  _chunkWMAPPDMMcjs.registerAPIRouteShape.call(void 0, shapes, definition.path, `plugin:${definition.path}`, "app");
60
60
  let route = routes.get(definition.path);
61
61
  if (_optionalChain([route, 'optionalAccess', _ => _.methods, 'access', _2 => _2.includes, 'call', _3 => _3(definition.method)])) {
@@ -197,7 +197,7 @@ async function invokeAPIRouteEndpoint(endpoint, request, params = {}, bodySizeLi
197
197
  if (response2) return response2;
198
198
  throw error;
199
199
  }
200
- const response = await _chunkXVIEGKTTcjs._runWithCurrentRequest.call(void 0,
200
+ const response = await _chunkZTP3BJG6cjs._runWithCurrentRequest.call(void 0,
201
201
  request,
202
202
  () => invokeAPIRouteEndpointInContext(endpoint, request, params)
203
203
  );
@@ -262,7 +262,7 @@ async function invokeAPIRouteEndpointInContext(endpoint, request, params) {
262
262
  invalidations: []
263
263
  };
264
264
  } catch (error) {
265
- if (_chunkCA62IQY3cjs.isEndpointFailure.call(void 0, error)) {
265
+ if (_chunkWU7ZS3EMcjs.isEndpointFailure.call(void 0, error)) {
266
266
  return createEndpointFailureResponse(error);
267
267
  }
268
268
  throw error;