@farm.js/core 0.1.72 → 0.1.73

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 (200) hide show
  1. package/dist/{agent-mcp-handler-VIT4GOSR.mjs → agent-mcp-handler-RK7LDYEL.mjs} +4 -4
  2. package/dist/{agent-mcp-handler-KE4J3W7S.cjs → agent-mcp-handler-VBCA3WZ6.cjs} +5 -5
  3. package/dist/{agent-mcp.d-BO3rZXEM.d.ts → agent-mcp.d-D_gHjCAE.d.ts} +1 -1
  4. package/dist/{agent-mcp.d-Cwff7lcA.d.mts → agent-mcp.d-PvEf-1mi.d.mts} +1 -1
  5. package/dist/agent-runtime.d.mts +2 -2
  6. package/dist/agent-runtime.d.ts +2 -2
  7. package/dist/{analyzer-5Q75LTIL.mjs → analyzer-MFYCJT75.mjs} +2 -2
  8. package/dist/analyzer-V5ZMRIIY.cjs +16 -0
  9. package/dist/api/node.d.mts +4 -4
  10. package/dist/api/node.d.ts +4 -4
  11. package/dist/api/route-manager.d.mts +4 -4
  12. package/dist/api/route-manager.d.ts +4 -4
  13. package/dist/api/runtime.d.mts +3 -3
  14. package/dist/api/runtime.d.ts +3 -3
  15. package/dist/api.d.mts +5 -5
  16. package/dist/api.d.ts +5 -5
  17. package/dist/{app-manifest.d-DwjGkYlP.d.ts → app-manifest.d-BpVTg43i.d.ts} +1 -1
  18. package/dist/{app-manifest.d-USD_IbFd.d.mts → app-manifest.d-CN7cEWHX.d.mts} +1 -1
  19. package/dist/app-markdown.cjs +4 -4
  20. package/dist/app-markdown.d.mts +3 -3
  21. package/dist/app-markdown.d.ts +3 -3
  22. package/dist/app-markdown.mjs +3 -3
  23. package/dist/{app.d-fW06_h8h.d.mts → app.d-BFWzAdTe.d.mts} +10 -4
  24. package/dist/{app.d-DAmF2MAk.d.ts → app.d-DO4PTCWm.d.ts} +10 -4
  25. package/dist/{chunk-OSMUE5ST.mjs → chunk-462MUII7.mjs} +3 -3
  26. package/dist/{chunk-MWUDEYBI.mjs → chunk-4CTCSKAF.mjs} +1 -1
  27. package/dist/{chunk-FSSONJRV.cjs → chunk-4YHGQDTT.cjs} +12 -12
  28. package/dist/{chunk-YCNHUIPR.cjs → chunk-4Z3YLMSW.cjs} +10 -10
  29. package/dist/{chunk-O32QPFVV.cjs → chunk-5PDMBWAF.cjs} +5 -5
  30. package/dist/{chunk-E2V7RRFL.mjs → chunk-6O6PAZZR.mjs} +1 -1
  31. package/dist/{chunk-LXEJNWF5.mjs → chunk-73K53YPP.mjs} +2 -2
  32. package/dist/{chunk-WIJF3PBM.mjs → chunk-7GMBETHM.mjs} +1 -1
  33. package/dist/{chunk-DGNMXL2O.mjs → chunk-B67CW2LM.mjs} +1 -1
  34. package/dist/{chunk-E3LE6EZH.cjs → chunk-CLEWORVY.cjs} +2 -2
  35. package/dist/{chunk-KPJYBSHL.mjs → chunk-CPMME66W.mjs} +149 -22
  36. package/dist/{chunk-VAWDGGW3.mjs → chunk-CYRIIVD4.mjs} +26 -15
  37. package/dist/{chunk-RFWWXEIF.mjs → chunk-FRO4BB2T.mjs} +1 -1
  38. package/dist/{chunk-N3XO5AL5.cjs → chunk-GPO3LJDJ.cjs} +2 -2
  39. package/dist/{chunk-645ENY7W.mjs → chunk-GZOKWJIW.mjs} +4 -4
  40. package/dist/{chunk-NAXKOTPP.cjs → chunk-HFUOLILA.cjs} +21 -21
  41. package/dist/{chunk-C2JOS77Z.cjs → chunk-HGB4PM2C.cjs} +178 -51
  42. package/dist/{chunk-BE7AQXJB.cjs → chunk-HTXKSREF.cjs} +255 -89
  43. package/dist/{chunk-Z3GPAFIA.mjs → chunk-HY6IVQ54.mjs} +1 -1
  44. package/dist/{chunk-3JN5M3T5.mjs → chunk-IBVN7SW5.mjs} +247 -81
  45. package/dist/{chunk-OSEQL34Q.cjs → chunk-ILQ5DKYF.cjs} +2 -2
  46. package/dist/{chunk-AUAMXI6N.mjs → chunk-IXZSBO76.mjs} +1 -1
  47. package/dist/{chunk-77VNYVVX.mjs → chunk-JMOCMXTQ.mjs} +1 -1
  48. package/dist/{chunk-5R4Q5FN7.cjs → chunk-KDOZORJD.cjs} +52 -41
  49. package/dist/{chunk-7QCJDYZQ.cjs → chunk-KTDG4THT.cjs} +2 -2
  50. package/dist/{chunk-L6E4SHUB.cjs → chunk-LGR7565L.cjs} +6 -6
  51. package/dist/chunk-LRPPXKCX.mjs +58 -0
  52. package/dist/{chunk-5XFKWHZD.mjs → chunk-MJEKMT6B.mjs} +95 -106
  53. package/dist/chunk-NDOE76QC.cjs +58 -0
  54. package/dist/{chunk-REP6HWJN.mjs → chunk-OBYM5S5G.mjs} +2 -2
  55. package/dist/{chunk-ZUVAGMQ5.cjs → chunk-ODBM54RT.cjs} +7 -7
  56. package/dist/{chunk-J5ASGNKF.mjs → chunk-OIP62QEL.mjs} +1 -1
  57. package/dist/{chunk-3WG7GJQL.cjs → chunk-OXNZUCHN.cjs} +9 -9
  58. package/dist/{chunk-C5AM2XDN.cjs → chunk-PXAHSCR6.cjs} +4 -4
  59. package/dist/{chunk-BSXKZPFE.mjs → chunk-QGCSUC5O.mjs} +112 -70
  60. package/dist/{chunk-EXN4DTVF.cjs → chunk-QKEZLYON.cjs} +2 -2
  61. package/dist/{chunk-QUYAGU65.mjs → chunk-REK6HZSU.mjs} +267 -231
  62. package/dist/{chunk-5X6OHJEE.cjs → chunk-ROCF6UQD.cjs} +5 -8
  63. package/dist/{chunk-KQAB5LML.mjs → chunk-SUQACHER.mjs} +2 -2
  64. package/dist/{chunk-NV26EGMC.mjs → chunk-SVQX5HYW.mjs} +2 -2
  65. package/dist/{chunk-CBLRSZQL.cjs → chunk-TAU3OF5B.cjs} +223 -234
  66. package/dist/{chunk-IWCYRDRQ.cjs → chunk-TDCP3Z4T.cjs} +3 -3
  67. package/dist/{chunk-TP4RAV7Y.cjs → chunk-TU6VAH4V.cjs} +8 -8
  68. package/dist/{chunk-ZDZUFD67.cjs → chunk-UVQRMUAR.cjs} +1 -1
  69. package/dist/{chunk-JMFTKNBA.mjs → chunk-UVZMSRHF.mjs} +2 -2
  70. package/dist/{chunk-GF22VGMS.cjs → chunk-VPETSSWN.cjs} +2 -2
  71. package/dist/{chunk-AYVGD3PK.mjs → chunk-XI3OXOMK.mjs} +1 -1
  72. package/dist/{chunk-HLMUWKAP.cjs → chunk-XUSJVHHD.cjs} +408 -366
  73. package/dist/{chunk-ET6WW3FY.cjs → chunk-YZK64PZT.cjs} +433 -397
  74. package/dist/{chunk-DS7JGFW5.mjs → chunk-Z3IN6GEX.mjs} +4 -7
  75. package/dist/{client-component.d-ciHeCxr-.d.mts → client-component.d-C71rMuHF.d.mts} +2 -2
  76. package/dist/{client-component.d-9J7CkTWW.d.ts → client-component.d-sF-Znk0j.d.ts} +2 -2
  77. package/dist/{client-plugins.d-JnRz5a1o.d.mts → client-plugins.d-B-Gd9mWR.d.mts} +1 -1
  78. package/dist/{client-plugins.d-CUOhfapO.d.ts → client-plugins.d-MFibjgBg.d.ts} +1 -1
  79. package/dist/client-plugins.d.mts +2 -2
  80. package/dist/client-plugins.d.ts +2 -2
  81. package/dist/client.d.mts +7 -7
  82. package/dist/client.d.ts +7 -7
  83. package/dist/config.d.mts +2 -2
  84. package/dist/config.d.ts +2 -2
  85. package/dist/desktop.d.mts +3 -3
  86. package/dist/desktop.d.ts +3 -3
  87. package/dist/{devtools-IZFUYWPG.cjs → devtools-6K4QXFRL.cjs} +5 -5
  88. package/dist/{devtools-7JPQMSTQ.mjs → devtools-TDIJ6HVC.mjs} +4 -4
  89. package/dist/docs.cjs +8 -8
  90. package/dist/docs.d.mts +3 -3
  91. package/dist/docs.d.ts +3 -3
  92. package/dist/docs.mjs +7 -7
  93. package/dist/environment/vite.cjs +3 -3
  94. package/dist/environment/vite.mjs +2 -2
  95. package/dist/{headers.d-rbbTKGaN.d.mts → headers.d-BUxGJTsj.d.mts} +1 -1
  96. package/dist/{headers.d-CqpTL_fZ.d.ts → headers.d-uQ6BR59u.d.ts} +1 -1
  97. package/dist/index.cjs +24 -22
  98. package/dist/{index.d-CMKvzHLW.d.ts → index.d-BCGfxCXY.d.ts} +1 -1
  99. package/dist/{index.d-D_B2D9Il.d.mts → index.d-CuWOJ-un.d.mts} +1 -1
  100. package/dist/index.d.mts +18 -18
  101. package/dist/index.d.ts +18 -18
  102. package/dist/index.mjs +23 -21
  103. package/dist/integrations/orm.d.mts +2 -2
  104. package/dist/integrations/orm.d.ts +2 -2
  105. package/dist/integrations.d.mts +2 -2
  106. package/dist/integrations.d.ts +2 -2
  107. package/dist/internal/app-markdown-runtime.cjs +3 -3
  108. package/dist/internal/app-markdown-runtime.d.mts +3 -3
  109. package/dist/internal/app-markdown-runtime.d.ts +3 -3
  110. package/dist/internal/app-markdown-runtime.mjs +2 -2
  111. package/dist/internal/build-runtime.cjs +23 -23
  112. package/dist/internal/build-runtime.d.mts +4 -4
  113. package/dist/internal/build-runtime.d.ts +4 -4
  114. package/dist/internal/build-runtime.mjs +22 -22
  115. package/dist/internal/cli-runtime.cjs +9 -9
  116. package/dist/internal/cli-runtime.mjs +8 -8
  117. package/dist/internal/client-error-overlay.cjs +4 -4
  118. package/dist/internal/client-error-overlay.mjs +1 -1
  119. package/dist/internal/client-runtime.d.mts +5 -5
  120. package/dist/internal/client-runtime.d.ts +5 -5
  121. package/dist/internal/compression-runtime.d.mts +2 -2
  122. package/dist/internal/compression-runtime.d.ts +2 -2
  123. package/dist/internal/config-runtime.cjs +6 -6
  124. package/dist/internal/config-runtime.d.mts +4 -4
  125. package/dist/internal/config-runtime.d.ts +4 -4
  126. package/dist/internal/config-runtime.mjs +5 -5
  127. package/dist/internal/infra-analytics-runtime.cjs +9 -9
  128. package/dist/internal/infra-analytics-runtime.mjs +7 -7
  129. package/dist/internal/native-server-fns.cjs +4 -4
  130. package/dist/internal/native-server-fns.mjs +3 -3
  131. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  132. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  133. package/dist/internal/production-runtime.cjs +11 -11
  134. package/dist/internal/production-runtime.d.mts +10 -10
  135. package/dist/internal/production-runtime.d.ts +10 -10
  136. package/dist/internal/production-runtime.mjs +10 -10
  137. package/dist/markdown.cjs +2 -2
  138. package/dist/markdown.d.mts +2 -2
  139. package/dist/markdown.d.ts +2 -2
  140. package/dist/markdown.mjs +1 -1
  141. package/dist/middleware.d.mts +2 -2
  142. package/dist/middleware.d.ts +2 -2
  143. package/dist/{mount.d-ImEO7q8a.d.mts → mount.d-BIYmcGGg.d.mts} +1 -1
  144. package/dist/{mount.d-B0XMxDRh.d.ts → mount.d-q8k0cJV0.d.ts} +1 -1
  145. package/dist/{native-tree-L2IIEBXH.mjs → native-tree-OYGKP2NZ.mjs} +2 -2
  146. package/dist/{native-tree-GF4BH33L.cjs → native-tree-R6CQMDTI.cjs} +3 -3
  147. package/dist/{navigation-delegate.d-RRx1CSlb.d.ts → navigation-delegate.d-Btfs6Uoa.d.ts} +1 -1
  148. package/dist/{navigation-delegate.d-83Q7ksf7.d.mts → navigation-delegate.d-CYBUupsv.d.mts} +1 -1
  149. package/dist/navigation.d.mts +5 -5
  150. package/dist/navigation.d.ts +5 -5
  151. package/dist/{observability.d-B2363jB6.d.mts → observability.d-DdJRiaIX.d.mts} +27 -3
  152. package/dist/{observability.d-B2363jB6.d.ts → observability.d-DdJRiaIX.d.ts} +27 -3
  153. package/dist/observability.d.mts +1 -1
  154. package/dist/observability.d.ts +1 -1
  155. package/dist/plugin.cjs +15 -15
  156. package/dist/plugin.d.mts +5 -5
  157. package/dist/plugin.d.ts +5 -5
  158. package/dist/plugin.mjs +14 -14
  159. package/dist/{render-plan.d-Ds2sXJ5m.d.ts → render-plan.d-0FHusf1D.d.ts} +1 -1
  160. package/dist/{render-plan.d-wP8nTeRV.d.mts → render-plan.d-BlyxqKMu.d.mts} +1 -1
  161. package/dist/renderer-client.d.mts +5 -5
  162. package/dist/renderer-client.d.ts +5 -5
  163. package/dist/{request.d-zpSn6pu_.d.ts → request.d-CPdVjssg.d.ts} +1 -1
  164. package/dist/{request.d-F3h7K37m.d.mts → request.d-CX-gks1l.d.mts} +1 -1
  165. package/dist/request.d.mts +3 -3
  166. package/dist/request.d.ts +3 -3
  167. package/dist/{route-rendering.d-Mw0ZKG2e.d.mts → route-rendering.d-CcvZ_4N2.d.mts} +1 -1
  168. package/dist/{route-rendering.d-BL0_AdKj.d.ts → route-rendering.d-DcOoSNoG.d.ts} +1 -1
  169. package/dist/{router.d-NGVsU11T.d.mts → router.d-C8RHma4A.d.mts} +1 -1
  170. package/dist/{router.d-BwXigemZ.d.ts → router.d-D2QnK8cM.d.ts} +1 -1
  171. package/dist/routes.d.mts +2 -2
  172. package/dist/routes.d.ts +2 -2
  173. package/dist/{rsc-pipeline-DHYZLWSF.mjs → rsc-pipeline-LC2FBZAR.mjs} +5 -5
  174. package/dist/{rsc-pipeline-BNXYMG4G.cjs → rsc-pipeline-NTAM65NT.cjs} +6 -6
  175. package/dist/{runtime-XPYKUNL3.mjs → runtime-MWAC7NWR.mjs} +5 -5
  176. package/dist/{runtime-IWOT6ZVC.cjs → runtime-U4PAMTVH.cjs} +7 -7
  177. package/dist/{runtime.d-OBIZWpx1.d.ts → runtime.d-1l_1bLrL.d.ts} +1 -1
  178. package/dist/{runtime.d-BA3MzhXz.d.mts → runtime.d-BQUHHq8M.d.mts} +1 -1
  179. package/dist/server-plugins.d.mts +4 -4
  180. package/dist/server-plugins.d.ts +4 -4
  181. package/dist/server.cjs +37 -35
  182. package/dist/server.d.mts +11 -11
  183. package/dist/server.d.ts +11 -11
  184. package/dist/server.mjs +20 -18
  185. package/dist/{spa-router.d-DrYT944-.d.ts → spa-router.d-BJtXNeqo.d.ts} +2 -2
  186. package/dist/{spa-router.d-BG2XzE5p.d.mts → spa-router.d-BzPdi48R.d.mts} +2 -2
  187. package/dist/testing.d.mts +2 -2
  188. package/dist/testing.d.ts +2 -2
  189. package/dist/{utils.d-C1k9BJeD.d.mts → utils.d-B4ZW-6z6.d.mts} +1 -1
  190. package/dist/{utils.d-DcF4wxey.d.ts → utils.d-DquC6qxy.d.ts} +1 -1
  191. package/dist/version.cjs +2 -2
  192. package/dist/version.mjs +1 -1
  193. package/dist/vite.cjs +17 -15
  194. package/dist/vite.d.mts +16 -7
  195. package/dist/vite.d.ts +16 -7
  196. package/dist/vite.mjs +16 -14
  197. package/package.json +1 -1
  198. package/dist/analyzer-UJG4MIZW.cjs +0 -16
  199. package/dist/chunk-V3UOEWCB.cjs +0 -46
  200. package/dist/chunk-VE3FWJBO.mjs +0 -46
@@ -9,7 +9,7 @@ import {
9
9
  collectSSGPages,
10
10
  matchSSGPage,
11
11
  resolveRouteRenderingConfigFromFile
12
- } from "./chunk-DGNMXL2O.mjs";
12
+ } from "./chunk-B67CW2LM.mjs";
13
13
  import {
14
14
  createFarmMetadataImageResponse
15
15
  } from "./chunk-CROAFCMW.mjs";
@@ -40,11 +40,12 @@ import {
40
40
  renderFarmLocaleAlternateLinks,
41
41
  resolveDefaultErrorStatus,
42
42
  routeBoundaryCoversDirectory,
43
+ stripRouteGroups,
43
44
  takeFarmHoistedHead
44
- } from "./chunk-NV26EGMC.mjs";
45
+ } from "./chunk-SVQX5HYW.mjs";
45
46
  import {
46
47
  listFarmMCPLlmsTxtLinks
47
- } from "./chunk-645ENY7W.mjs";
48
+ } from "./chunk-GZOKWJIW.mjs";
48
49
  import {
49
50
  FARM_DEFAULT_MCP_PATH,
50
51
  collectFarmDefaultMCPPages,
@@ -52,7 +53,7 @@ import {
52
53
  farmConfigMountsMCP,
53
54
  isFarmDefaultMCPPathname,
54
55
  resolveFarmDefaultMCPServer
55
- } from "./chunk-JMFTKNBA.mjs";
56
+ } from "./chunk-UVZMSRHF.mjs";
56
57
  import {
57
58
  getFarmFormState,
58
59
  handleFarmFormActionRequest,
@@ -83,7 +84,7 @@ import {
83
84
  traceFarmSourceReads,
84
85
  usesFarmServerTree,
85
86
  withFarmSourceSnapshot
86
- } from "./chunk-3JN5M3T5.mjs";
87
+ } from "./chunk-IBVN7SW5.mjs";
87
88
  import {
88
89
  FARM_ISLAND_REPLAYABLE_SELECTOR
89
90
  } from "./chunk-S32PDOLO.mjs";
@@ -110,7 +111,7 @@ import {
110
111
  resolveFarmAgentCrawlers,
111
112
  resolveFarmAgentSitemap,
112
113
  resolveFarmPerformanceConfig
113
- } from "./chunk-REP6HWJN.mjs";
114
+ } from "./chunk-OBYM5S5G.mjs";
114
115
  import {
115
116
  collectFarmLlmsTxtPages,
116
117
  createFarmDefaultLlmsTxt,
@@ -120,7 +121,7 @@ import {
120
121
  renderFarmLlmsFullTxt,
121
122
  resolveFarmAgentOrigin,
122
123
  resolveFarmLlmsTxtConfig
123
- } from "./chunk-Z3GPAFIA.mjs";
124
+ } from "./chunk-HY6IVQ54.mjs";
124
125
  import {
125
126
  createFarmCspNonce,
126
127
  createFarmCspNonceRewriter,
@@ -161,10 +162,10 @@ import {
161
162
  import {
162
163
  createFarmMarkdownRouteModuleFromFile,
163
164
  loadFarmMdxComponents
164
- } from "./chunk-AYVGD3PK.mjs";
165
+ } from "./chunk-XI3OXOMK.mjs";
165
166
  import {
166
167
  isFarmMarkdownPageFile
167
- } from "./chunk-J5ASGNKF.mjs";
168
+ } from "./chunk-OIP62QEL.mjs";
168
169
  import {
169
170
  resolveFarmMdxComponentsModulePath,
170
171
  resolveMdxConfig
@@ -177,7 +178,7 @@ import {
177
178
  farmRequestWantsMarkdown,
178
179
  getFarmMarkdownAlternatePath,
179
180
  resolveMarkdownConfig
180
- } from "./chunk-KPJYBSHL.mjs";
181
+ } from "./chunk-CPMME66W.mjs";
181
182
  import {
182
183
  resolveWorkflowsConfig
183
184
  } from "./chunk-MGZVDX4R.mjs";
@@ -285,7 +286,7 @@ import {
285
286
  } from "./chunk-2DA7CLY7.mjs";
286
287
  import {
287
288
  FARM_VERSION
288
- } from "./chunk-77VNYVVX.mjs";
289
+ } from "./chunk-JMOCMXTQ.mjs";
289
290
  import {
290
291
  normalizeFarmAPIConfig
291
292
  } from "./chunk-W6QLRQ3V.mjs";
@@ -1834,6 +1835,58 @@ function toRealPath(filePath) {
1834
1835
  }
1835
1836
  }
1836
1837
 
1838
+ // src/server/dev-client-manifest.ts
1839
+ var FARM_DEV_CLIENT_MANIFEST_MODULE = "/@farm/manifest";
1840
+ function createFarmDevClientManifest(manifest, options) {
1841
+ const { boot } = options;
1842
+ const layoutPatterns = boot ? new Set(boot.layoutPatterns) : void 0;
1843
+ const owners = boot ? /* @__PURE__ */ new Set([...boot.routePattern ? [boot.routePattern] : [], ...boot.layoutPatterns]) : void 0;
1844
+ const clientManifest = {
1845
+ clientEntry: "/@farm/client.js",
1846
+ routes: {},
1847
+ layouts: {},
1848
+ slots: [],
1849
+ sharedAssets: options.sharedAssets,
1850
+ ...boot ? { module: FARM_DEV_CLIENT_MANIFEST_MODULE } : {}
1851
+ };
1852
+ for (const route of manifest.routes) {
1853
+ if (boot && route.pattern !== boot.routePattern && !route.search) continue;
1854
+ clientManifest.routes[route.pattern] = {
1855
+ modulePath: route.modulePath,
1856
+ pattern: route.pattern,
1857
+ ...route.directory ? { directory: route.directory } : {},
1858
+ segments: route.segments,
1859
+ search: route.search,
1860
+ isClientComponent: route.isClientComponent,
1861
+ shouldHydrate: route.shouldHydrate,
1862
+ islandStrategy: route.islandStrategy,
1863
+ renderPlan: route.renderPlan,
1864
+ preloads: [route.modulePath],
1865
+ assets: []
1866
+ };
1867
+ }
1868
+ for (const layout of manifest.layouts) {
1869
+ if (layoutPatterns && !layoutPatterns.has(layout.pattern)) continue;
1870
+ const groupScope = getRouteGroupScope(layout.pattern);
1871
+ clientManifest.layouts[layout.pattern] = {
1872
+ modulePath: layout.modulePath,
1873
+ pattern: layout.pattern,
1874
+ ...groupScope ? { urlPattern: stripRouteGroups(layout.pattern), groupScope } : {},
1875
+ shouldHydrate: layout.shouldHydrate,
1876
+ islandStrategy: layout.islandStrategy,
1877
+ // Islands mode: rebuilt from its server tree, so its module is never preloaded.
1878
+ ...layout.serverTree ? { serverTree: true } : {},
1879
+ preloads: layout.serverTree ? [] : [layout.modulePath],
1880
+ assets: []
1881
+ };
1882
+ }
1883
+ for (const slot of manifest.slots ?? []) {
1884
+ if (owners && !owners.has(slot.ownerPattern)) continue;
1885
+ clientManifest.slots.push({ ...slot, preloads: [slot.modulePath], assets: [] });
1886
+ }
1887
+ return clientManifest;
1888
+ }
1889
+
1837
1890
  // src/server/dev-styles.ts
1838
1891
  import * as fs from "fs";
1839
1892
  import * as path3 from "path";
@@ -3776,6 +3829,32 @@ var ServerRenderer = class {
3776
3829
  (href) => `<link rel="stylesheet" href="${escapeHtmlAttribute2(href)}">`
3777
3830
  );
3778
3831
  }
3832
+ /**
3833
+ * The client manifest a development document inlines: the entries its page reads before the
3834
+ * first navigation. Inlining every route made each document grow with the app (about 650 KB at
3835
+ * 1,000 routes); the client imports the whole manifest only when a navigation needs it.
3836
+ */
3837
+ createDevBootClientManifest(req, options) {
3838
+ const layouts = req.__FARM_LAYOUTS__ || [];
3839
+ return createFarmDevClientManifest(
3840
+ options.routeManifest ?? this.routeManager.generateClientManifest(this.config.root),
3841
+ {
3842
+ sharedAssets: [
3843
+ ...this.devGlobalStylesheetAssets(),
3844
+ ...this.collectDevStyleHrefs().map((href) => ({
3845
+ tag: "link",
3846
+ attrs: { rel: "stylesheet", href }
3847
+ }))
3848
+ ],
3849
+ boot: {
3850
+ routePattern: options.clientRoutePattern,
3851
+ layoutPatterns: layouts.flatMap(
3852
+ (layout) => typeof layout.pattern === "string" ? [layout.pattern] : []
3853
+ )
3854
+ }
3855
+ }
3856
+ );
3857
+ }
3779
3858
  /**
3780
3859
  * A layout's boundary. Islands mode keys it (the pattern with its params, as the production
3781
3860
  * server does), so a navigation can name the layouts the browser shows; a layout the browser
@@ -4870,6 +4949,7 @@ var ServerRenderer = class {
4870
4949
  {
4871
4950
  responseHeaders: pprHeaders,
4872
4951
  routeManifest,
4952
+ clientRoutePattern: route.pattern,
4873
4953
  captureStaticShell: Boolean(pprShellOptions),
4874
4954
  observabilityRoute: pathname,
4875
4955
  onSuspenseHoleDetected: pprShellOptions ? () => emitFarmEvent({
@@ -5372,7 +5452,7 @@ var ServerRenderer = class {
5372
5452
  const server = this.getDefaultMCPServer();
5373
5453
  const request2 = getCurrentRequestOrNull() ?? createWebRequestFromFarmRequest(req, { trustProxy: this.config.server?.trustProxy });
5374
5454
  try {
5375
- const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-VIT4GOSR.mjs");
5455
+ const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-RK7LDYEL.mjs");
5376
5456
  const origin = new URL(request2.url).origin;
5377
5457
  const i18n = this.i18nRuntime?.config;
5378
5458
  const metadataBase = await this.getRootMetadataBase();
@@ -5664,53 +5744,7 @@ var ServerRenderer = class {
5664
5744
  res.setHeader(key, value);
5665
5745
  }
5666
5746
  try {
5667
- const manifest = options.routeManifest ?? this.routeManager.generateClientManifest(this.config.root);
5668
- const clientManifest = {
5669
- clientEntry: "/@farm/client.js",
5670
- routes: {},
5671
- layouts: {},
5672
- slots: [],
5673
- sharedAssets: [
5674
- ...this.devGlobalStylesheetAssets(),
5675
- ...this.collectDevStyleHrefs().map((href) => ({
5676
- tag: "link",
5677
- attrs: { rel: "stylesheet", href }
5678
- }))
5679
- ]
5680
- };
5681
- for (const routeEntry of manifest.routes) {
5682
- clientManifest.routes[routeEntry.pattern] = {
5683
- modulePath: routeEntry.modulePath,
5684
- pattern: routeEntry.pattern,
5685
- segments: routeEntry.segments,
5686
- search: routeEntry.search,
5687
- isClientComponent: routeEntry.isClientComponent,
5688
- shouldHydrate: routeEntry.shouldHydrate,
5689
- islandStrategy: routeEntry.islandStrategy,
5690
- renderPlan: routeEntry.renderPlan,
5691
- preloads: [routeEntry.modulePath],
5692
- assets: []
5693
- };
5694
- }
5695
- for (const layoutEntry of manifest.layouts) {
5696
- clientManifest.layouts[layoutEntry.pattern] = {
5697
- modulePath: layoutEntry.modulePath,
5698
- pattern: layoutEntry.pattern,
5699
- shouldHydrate: layoutEntry.shouldHydrate,
5700
- islandStrategy: layoutEntry.islandStrategy,
5701
- // Islands mode: rebuilt from its server tree, so its module is never preloaded.
5702
- ...layoutEntry.serverTree ? { serverTree: true } : {},
5703
- preloads: layoutEntry.serverTree ? [] : [layoutEntry.modulePath],
5704
- assets: []
5705
- };
5706
- }
5707
- for (const slotEntry of manifest.slots ?? []) {
5708
- clientManifest.slots.push({
5709
- ...slotEntry,
5710
- preloads: [slotEntry.modulePath],
5711
- assets: []
5712
- });
5713
- }
5747
+ const clientManifest = this.createDevBootClientManifest(req, options);
5714
5748
  const routeSlots = (req.__FARM_ROUTE_SLOTS__ || []).map(
5715
5749
  (slot) => ({
5716
5750
  ...slot,
@@ -5934,53 +5968,7 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
5934
5968
  const pagePath = req.__FARM_PAGE_PATH__;
5935
5969
  const isClientComponent = req.__FARM_IS_CLIENT_COMPONENT__ === true;
5936
5970
  const relativePath = pagePath ? toViteModuleId(pagePath, this.config.root) : "/src/app/page.tsx";
5937
- const manifest = options.routeManifest ?? this.routeManager.generateClientManifest(this.config.root);
5938
- const clientManifest = {
5939
- clientEntry: "/@farm/client.js",
5940
- routes: {},
5941
- layouts: {},
5942
- slots: [],
5943
- sharedAssets: [
5944
- ...this.devGlobalStylesheetAssets(),
5945
- ...this.collectDevStyleHrefs().map((href) => ({
5946
- tag: "link",
5947
- attrs: { rel: "stylesheet", href }
5948
- }))
5949
- ]
5950
- };
5951
- for (const routeEntry of manifest.routes) {
5952
- clientManifest.routes[routeEntry.pattern] = {
5953
- modulePath: routeEntry.modulePath,
5954
- pattern: routeEntry.pattern,
5955
- segments: routeEntry.segments,
5956
- search: routeEntry.search,
5957
- isClientComponent: routeEntry.isClientComponent,
5958
- shouldHydrate: routeEntry.shouldHydrate,
5959
- islandStrategy: routeEntry.islandStrategy,
5960
- renderPlan: routeEntry.renderPlan,
5961
- preloads: [routeEntry.modulePath],
5962
- assets: []
5963
- };
5964
- }
5965
- for (const layoutEntry of manifest.layouts) {
5966
- clientManifest.layouts[layoutEntry.pattern] = {
5967
- modulePath: layoutEntry.modulePath,
5968
- pattern: layoutEntry.pattern,
5969
- shouldHydrate: layoutEntry.shouldHydrate,
5970
- islandStrategy: layoutEntry.islandStrategy,
5971
- // Islands mode: rebuilt from its server tree, so its module is never preloaded.
5972
- ...layoutEntry.serverTree ? { serverTree: true } : {},
5973
- preloads: layoutEntry.serverTree ? [] : [layoutEntry.modulePath],
5974
- assets: []
5975
- };
5976
- }
5977
- for (const slotEntry of manifest.slots ?? []) {
5978
- clientManifest.slots.push({
5979
- ...slotEntry,
5980
- preloads: [slotEntry.modulePath],
5981
- assets: []
5982
- });
5983
- }
5971
+ const clientManifest = this.createDevBootClientManifest(req, options);
5984
5972
  const routeSlotPayload = (req.__FARM_ROUTE_SLOTS__ || []).map(
5985
5973
  (slot) => ({
5986
5974
  ...slot,
@@ -7846,6 +7834,7 @@ ${FARM_DARK_VARIANT}
7846
7834
  export {
7847
7835
  inspectStaticMetadataImage,
7848
7836
  RouteManager,
7837
+ createFarmDevClientManifest,
7849
7838
  resolveDevGlobalStylesheetHref,
7850
7839
  collectDevStylesheetUrls,
7851
7840
  resolveFarmNotFoundComponentPath,
@@ -0,0 +1,58 @@
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(); } }
2
+
3
+
4
+
5
+ var _chunkKORZ6PREcjs = require('./chunk-KORZ6PRE.cjs');
6
+
7
+ // src/docs/engine.ts
8
+ var FARMING_LABS_DOCS_INSTALL_HINT = _chunkKORZ6PREcjs.formatOptionalPeerInstallHint.call(void 0,
9
+ "@farming-labs/docs",
10
+ "use the docs engine"
11
+ );
12
+ var engine;
13
+ var loading;
14
+ var loadingOpenApiDiscovery;
15
+ function loadFarmDocsEngine() {
16
+ _nullishCoalesce(loading, () => ( (loading = import("@farming-labs/docs").then(
17
+ (docs) => {
18
+ engine = docs;
19
+ return engine;
20
+ },
21
+ (error) => {
22
+ loading = void 0;
23
+ throw docsEngineLoadError(error);
24
+ }
25
+ ))));
26
+ return loading;
27
+ }
28
+ function loadFarmDocsOpenApiDiscovery() {
29
+ _nullishCoalesce(loadingOpenApiDiscovery, () => ( (loadingOpenApiDiscovery = import("@farming-labs/docs/server").then(
30
+ (server) => server.resolveApiReferenceOpenApiDiscovery,
31
+ (error) => {
32
+ loadingOpenApiDiscovery = void 0;
33
+ throw docsEngineLoadError(error);
34
+ }
35
+ ))));
36
+ return loadingOpenApiDiscovery;
37
+ }
38
+ function docsEngineLoadError(error) {
39
+ if (!_chunkKORZ6PREcjs.isMissingPackageError.call(void 0, error, "@farming-labs/docs")) return error;
40
+ return _chunkKORZ6PREcjs.withOptionalPeerCause.call(void 0,
41
+ new Error(
42
+ `docs is enabled, but @farming-labs/docs is not installed. ${FARMING_LABS_DOCS_INSTALL_HINT}`
43
+ ),
44
+ error
45
+ );
46
+ }
47
+ function docsEngine() {
48
+ if (!engine) {
49
+ throw new Error("Farm docs engine was used before loadFarmDocsEngine() resolved.");
50
+ }
51
+ return engine;
52
+ }
53
+
54
+
55
+
56
+
57
+
58
+ exports.loadFarmDocsEngine = loadFarmDocsEngine; exports.loadFarmDocsOpenApiDiscovery = loadFarmDocsOpenApiDiscovery; exports.docsEngine = docsEngine;
@@ -2,10 +2,10 @@ import {
2
2
  getFarmAgentPagePublicPath,
3
3
  isFarmMetadataNoIndex,
4
4
  resolveFarmAgentOrigin
5
- } from "./chunk-Z3GPAFIA.mjs";
5
+ } from "./chunk-HY6IVQ54.mjs";
6
6
  import {
7
7
  matchesFarmMarkdownRoutePattern
8
- } from "./chunk-KPJYBSHL.mjs";
8
+ } from "./chunk-CPMME66W.mjs";
9
9
  import {
10
10
  normalizeFarmTrailingSlashPathname
11
11
  } from "./chunk-4O26BPUY.mjs";
@@ -2,10 +2,10 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkO32QPFVVcjs = require('./chunk-O32QPFVV.cjs');
5
+ var _chunk5PDMBWAFcjs = require('./chunk-5PDMBWAF.cjs');
6
6
 
7
7
 
8
- var _chunkC2JOS77Zcjs = require('./chunk-C2JOS77Z.cjs');
8
+ var _chunkHGB4PM2Ccjs = require('./chunk-HGB4PM2C.cjs');
9
9
 
10
10
 
11
11
  var _chunkDVJM55D2cjs = require('./chunk-DVJM55D2.cjs');
@@ -166,22 +166,22 @@ function resolveRoutePatterns(value, key) {
166
166
  }
167
167
  function createFarmDefaultSitemap(sources, options) {
168
168
  const { include, exclude } = options.config;
169
- const base = _chunkO32QPFVVcjs.resolveFarmAgentOrigin.call(void 0, options.metadataBase, options.origin);
169
+ const base = _chunk5PDMBWAFcjs.resolveFarmAgentOrigin.call(void 0, options.metadataBase, options.origin);
170
170
  const entries = /* @__PURE__ */ new Map();
171
171
  for (const source of sources) {
172
172
  const path = source.pattern;
173
173
  if (path.includes("[") || path.includes("(") || entries.has(path)) continue;
174
- if (include.length && !include.some((pattern) => _chunkC2JOS77Zcjs.matchesFarmMarkdownRoutePattern.call(void 0, pattern, path))) {
174
+ if (include.length && !include.some((pattern) => _chunkHGB4PM2Ccjs.matchesFarmMarkdownRoutePattern.call(void 0, pattern, path))) {
175
175
  continue;
176
176
  }
177
- if (exclude.some((pattern) => _chunkC2JOS77Zcjs.matchesFarmMarkdownRoutePattern.call(void 0, pattern, path))) continue;
177
+ if (exclude.some((pattern) => _chunkHGB4PM2Ccjs.matchesFarmMarkdownRoutePattern.call(void 0, pattern, path))) continue;
178
178
  const module = isRecord(source.module) ? source.module : void 0;
179
- if (_chunkO32QPFVVcjs.isFarmMetadataNoIndex.call(void 0, _optionalChain([module, 'optionalAccess', _2 => _2.metadata]))) continue;
179
+ if (_chunk5PDMBWAFcjs.isFarmMetadataNoIndex.call(void 0, _optionalChain([module, 'optionalAccess', _2 => _2.metadata]))) continue;
180
180
  if (_optionalChain([module, 'optionalAccess', _3 => _3.__farmRouteGuard])) continue;
181
181
  entries.set(path, {
182
182
  url: new URL(
183
183
  _chunkDVJM55D2cjs.normalizeFarmTrailingSlashPathname.call(void 0,
184
- _chunkO32QPFVVcjs.getFarmAgentPagePublicPath.call(void 0, path, options),
184
+ _chunk5PDMBWAFcjs.getFarmAgentPagePublicPath.call(void 0, path, options),
185
185
  options.trailingSlash === true
186
186
  ),
187
187
  base
@@ -8,7 +8,7 @@ import {
8
8
  _resolveFarmMarkdownIndexAlias,
9
9
  createFarmMarkdownViewResponse,
10
10
  requestAcceptsMarkdown
11
- } from "./chunk-KPJYBSHL.mjs";
11
+ } from "./chunk-CPMME66W.mjs";
12
12
  import {
13
13
  withoutFarmDeploymentCookie
14
14
  } from "./chunk-IWJONXPF.mjs";
@@ -19,13 +19,13 @@ var _chunkSTF6VDYQcjs = require('./chunk-STF6VDYQ.cjs');
19
19
 
20
20
 
21
21
 
22
- var _chunkZUVAGMQ5cjs = require('./chunk-ZUVAGMQ5.cjs');
22
+ var _chunkODBM54RTcjs = require('./chunk-ODBM54RT.cjs');
23
23
 
24
24
 
25
25
  var _chunkBTVDYS4Bcjs = require('./chunk-BTVDYS4B.cjs');
26
26
 
27
27
 
28
- var _chunkO32QPFVVcjs = require('./chunk-O32QPFVV.cjs');
28
+ var _chunk5PDMBWAFcjs = require('./chunk-5PDMBWAF.cjs');
29
29
 
30
30
 
31
31
 
@@ -64,7 +64,7 @@ var _chunk3EIPOTZVcjs = require('./chunk-3EIPOTZV.cjs');
64
64
  var _chunk2HW5LWAHcjs = require('./chunk-2HW5LWAH.cjs');
65
65
 
66
66
 
67
- var _chunkC2JOS77Zcjs = require('./chunk-C2JOS77Z.cjs');
67
+ var _chunkHGB4PM2Ccjs = require('./chunk-HGB4PM2C.cjs');
68
68
 
69
69
 
70
70
  var _chunkASYOWPSRcjs = require('./chunk-ASYOWPSR.cjs');
@@ -422,13 +422,13 @@ function resolveFarmAgentConfig(input, context = {}) {
422
422
  const jsonLd = _optionalChain([input, 'optionalAccess', _17 => _17.jsonLd]);
423
423
  return {
424
424
  jsonLd: jsonLd === void 0 ? servesPages ? { ...DEFAULT_JSON_LD } : false : !jsonLd ? false : jsonLd === true ? {} : jsonLd,
425
- noindexPreviews: _chunkZUVAGMQ5cjs.resolveFarmNoindexPreviews.call(void 0, _optionalChain([input, 'optionalAccess', _18 => _18.noindexPreviews])),
425
+ noindexPreviews: _chunkODBM54RTcjs.resolveFarmNoindexPreviews.call(void 0, _optionalChain([input, 'optionalAccess', _18 => _18.noindexPreviews])),
426
426
  // The docs engine answers /llms.txt with its own pages; a default here would replace it.
427
427
  // llms-full.txt renders every listed page, so it stays opt-in.
428
- llmsTxt: _chunkO32QPFVVcjs.resolveFarmLlmsTxtConfig.call(void 0, _nullishCoalesce(_optionalChain([input, 'optionalAccess', _19 => _19.llmsTxt]), () => ( (pageDefaults ? { full: false } : false)))),
428
+ llmsTxt: _chunk5PDMBWAFcjs.resolveFarmLlmsTxtConfig.call(void 0, _nullishCoalesce(_optionalChain([input, 'optionalAccess', _19 => _19.llmsTxt]), () => ( (pageDefaults ? { full: false } : false)))),
429
429
  // Same rule as llms.txt: the docs engine answers /sitemap.xml with its own pages.
430
- sitemap: _chunkZUVAGMQ5cjs.resolveFarmAgentSitemap.call(void 0, _nullishCoalesce(_optionalChain([input, 'optionalAccess', _20 => _20.sitemap]), () => ( pageDefaults))),
431
- crawlers: _chunkZUVAGMQ5cjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([input, 'optionalAccess', _21 => _21.crawlers])),
430
+ sitemap: _chunkODBM54RTcjs.resolveFarmAgentSitemap.call(void 0, _nullishCoalesce(_optionalChain([input, 'optionalAccess', _20 => _20.sitemap]), () => ( pageDefaults))),
431
+ crawlers: _chunkODBM54RTcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([input, 'optionalAccess', _21 => _21.crawlers])),
432
432
  apiCatalog: resolveFarmAgentBoolean(_optionalChain([input, 'optionalAccess', _22 => _22.apiCatalog]), "apiCatalog", false),
433
433
  aiCatalog: resolveFarmAgentBoolean(_optionalChain([input, 'optionalAccess', _23 => _23.aiCatalog]), "aiCatalog", true),
434
434
  manifest: _chunkBTVDYS4Bcjs.resolveFarmAppManifestConfig.call(void 0, _optionalChain([input, 'optionalAccess', _24 => _24.manifest])),
@@ -1094,7 +1094,7 @@ async function resolveConfig(userConfig, mode) {
1094
1094
  const srcDir = userConfig.srcDir || "src";
1095
1095
  _chunkRE5E2G5Scjs.setFarmProjectSourceDir.call(void 0, root, srcDir);
1096
1096
  const docs = await resolveDocsConfig(userConfig.docs, { root, srcDir });
1097
- const md = _chunkC2JOS77Zcjs.resolveMarkdownConfig.call(void 0, userConfig.md);
1097
+ const md = _chunkHGB4PM2Ccjs.resolveMarkdownConfig.call(void 0, userConfig.md);
1098
1098
  const mdx = _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, userConfig.mdx);
1099
1099
  const env = _chunk3EIPOTZVcjs.resolveEnv.call(void 0, userConfig.env, process.env);
1100
1100
  _chunk3EIPOTZVcjs.setEnv.call(void 0, env);
@@ -1208,7 +1208,7 @@ async function resolveConfig(userConfig, mode) {
1208
1208
  userConfig.images,
1209
1209
  _chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, userConfig.renderer) ? "none" : void 0
1210
1210
  ),
1211
- performance: _chunkZUVAGMQ5cjs.resolveFarmPerformanceConfig.call(void 0, userConfig.performance),
1211
+ performance: _chunkODBM54RTcjs.resolveFarmPerformanceConfig.call(void 0, userConfig.performance),
1212
1212
  theme: _chunkWT6RAN2Icjs.resolveFarmThemeConfig.call(void 0, userConfig.theme, basePath),
1213
1213
  publicDir: userConfig.publicDir || "public",
1214
1214
  i18n: _chunkZMSVKVI3cjs.resolveFarmI18nConfig.call(void 0, userConfig.i18n, {
@@ -3,13 +3,13 @@
3
3
  var _chunkOWOUTKIJcjs = require('./chunk-OWOUTKIJ.cjs');
4
4
 
5
5
 
6
- var _chunkO32QPFVVcjs = require('./chunk-O32QPFVV.cjs');
6
+ var _chunk5PDMBWAFcjs = require('./chunk-5PDMBWAF.cjs');
7
7
 
8
8
 
9
9
  var _chunk6JHZPB52cjs = require('./chunk-6JHZPB52.cjs');
10
10
 
11
11
 
12
- var _chunkC2JOS77Zcjs = require('./chunk-C2JOS77Z.cjs');
12
+ var _chunkHGB4PM2Ccjs = require('./chunk-HGB4PM2C.cjs');
13
13
 
14
14
 
15
15
  var _chunkWT6RAN2Icjs = require('./chunk-WT6RAN2I.cjs');
@@ -651,12 +651,12 @@ function createFarmMetadataRouteResponse(kind, value, routeModule = {}, options
651
651
  return new Response(null, { status: 405, headers: { Allow: "GET, HEAD" } });
652
652
  }
653
653
  if ((kind === "llms" || kind === "llms-full") && options.request) {
654
- _chunkC2JOS77Zcjs.emitFarmAgentRead.call(void 0, options.request, kind, isResponse(value) ? value.status : 200);
654
+ _chunkHGB4PM2Ccjs.emitFarmAgentRead.call(void 0, options.request, kind, isResponse(value) ? value.status : 200);
655
655
  }
656
656
  if (isResponse(value)) {
657
657
  return method === "HEAD" ? _chunk4DCWVSL2cjs.omitFarmResponseBody.call(void 0, value) : value;
658
658
  }
659
- const body = kind === "sitemap" ? serializeSitemap(value) : kind === "robots" ? serializeRobots(value) : kind === "llms" || kind === "llms-full" ? _chunkO32QPFVVcjs.serializeFarmLlmsTxt.call(void 0, value) : serializeManifest(value);
659
+ const body = kind === "sitemap" ? serializeSitemap(value) : kind === "robots" ? serializeRobots(value) : kind === "llms" || kind === "llms-full" ? _chunk5PDMBWAFcjs.serializeFarmLlmsTxt.call(void 0, value) : serializeManifest(value);
660
660
  const contentType = kind === "sitemap" ? "application/xml; charset=utf-8" : kind === "robots" || kind === "llms" || kind === "llms-full" ? "text/plain; charset=utf-8" : "application/manifest+json; charset=utf-8";
661
661
  return new Response(method === "HEAD" ? null : body, {
662
662
  headers: {