@farm.js/core 0.1.26 → 0.1.28

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 (231) hide show
  1. package/dist/agent-runtime.d.mts +8 -9
  2. package/dist/agent-runtime.d.ts +8 -9
  3. package/dist/api/client.cjs +5 -7
  4. package/dist/api/client.d.mts +5 -5
  5. package/dist/api/client.d.ts +5 -5
  6. package/dist/api/client.mjs +4 -6
  7. package/dist/api/route-manager.cjs +12 -10
  8. package/dist/api/route-manager.d.mts +7 -8
  9. package/dist/api/route-manager.d.ts +7 -8
  10. package/dist/api/route-manager.mjs +11 -9
  11. package/dist/api/runtime.cjs +15 -8
  12. package/dist/api/runtime.d.mts +36 -3
  13. package/dist/api/runtime.d.ts +36 -3
  14. package/dist/api/runtime.mjs +14 -7
  15. package/dist/{api-client-Cx54IR5g.d.mts → api-client-BjMmY8OD.d.mts} +2 -3
  16. package/dist/{api-client-DykpaKcY.d.ts → api-client-CyFtZFJ4.d.ts} +2 -3
  17. package/dist/api.cjs +16 -14
  18. package/dist/api.d.mts +9 -10
  19. package/dist/api.d.ts +9 -10
  20. package/dist/api.mjs +16 -14
  21. package/dist/{app-29vG5tmY.d.mts → app-DSSq6wiN.d.mts} +3 -4
  22. package/dist/{app-Cx71s_PT.d.ts → app-M8nVWvNU.d.ts} +3 -4
  23. package/dist/app-markdown.cjs +10 -4
  24. package/dist/app-markdown.d.mts +9 -10
  25. package/dist/app-markdown.d.ts +9 -10
  26. package/dist/app-markdown.mjs +9 -3
  27. package/dist/cache-invalidation-BD0z_lfu.d.mts +4 -0
  28. package/dist/cache-invalidation-BD0z_lfu.d.ts +4 -0
  29. package/dist/cache.cjs +6 -4
  30. package/dist/cache.d.mts +11 -6
  31. package/dist/cache.d.ts +11 -6
  32. package/dist/cache.mjs +7 -5
  33. package/dist/{chunk-OFKG57MZ.mjs → chunk-2CNBR3EB.mjs} +2 -2
  34. package/dist/{chunk-JM5GQL4H.mjs → chunk-2DLN6HG4.mjs} +1 -1
  35. package/dist/{chunk-UUYF3CHN.mjs → chunk-2N5PX3LS.mjs} +2 -2
  36. package/dist/{chunk-H6G5INWM.cjs → chunk-2SDO73HK.cjs} +14 -156
  37. package/dist/{chunk-3TQWUUNP.cjs → chunk-3LUF2PE2.cjs} +10 -5
  38. package/dist/{chunk-SYGGPS4A.mjs → chunk-4IEPYMHF.mjs} +3 -3
  39. package/dist/{chunk-WD5PNSOB.mjs → chunk-4V7GIE2U.mjs} +6 -4
  40. package/dist/{chunk-2CT6XUNO.cjs → chunk-55ZY4ZA7.cjs} +4 -4
  41. package/dist/chunk-5MKEDGLD.cjs +53 -0
  42. package/dist/{chunk-I7PUUDGY.cjs → chunk-63H6BKXG.cjs} +2 -2
  43. package/dist/{chunk-FG5H2VCJ.mjs → chunk-6ZCMSZ5U.mjs} +2 -2
  44. package/dist/{chunk-ZMN3H73H.cjs → chunk-75DYEVXI.cjs} +13 -11
  45. package/dist/{chunk-QJ4D3UKJ.cjs → chunk-A672WZEG.cjs} +4 -4
  46. package/dist/{chunk-IXTFU4PL.cjs → chunk-BJPBQNIE.cjs} +14 -14
  47. package/dist/{chunk-QGG336NI.mjs → chunk-BXFWA23T.mjs} +2 -2
  48. package/dist/chunk-CNOQY6Z7.mjs +156 -0
  49. package/dist/{chunk-DW34V5SM.cjs → chunk-CTV2TTNP.cjs} +4 -4
  50. package/dist/{chunk-OAVTUMJP.cjs → chunk-D4JE5NNV.cjs} +12 -12
  51. package/dist/{chunk-KLSSO6YD.mjs → chunk-E76XC6ZG.mjs} +2 -2
  52. package/dist/{chunk-G3HRIVEY.cjs → chunk-ES4B2IXW.cjs} +2 -2
  53. package/dist/{chunk-W2HZKYES.cjs → chunk-EWZ3XHKQ.cjs} +2 -2
  54. package/dist/{chunk-BD2U4ZL6.cjs → chunk-EXLKRR4U.cjs} +10 -10
  55. package/dist/{chunk-SZ4LYNUX.cjs → chunk-F52CDFJM.cjs} +89 -83
  56. package/dist/{chunk-ARXCHQLX.mjs → chunk-FB3H4INL.mjs} +4 -4
  57. package/dist/{chunk-QPPQHB6X.mjs → chunk-FVCSLZWT.mjs} +19 -13
  58. package/dist/{chunk-WD4YXVLV.mjs → chunk-GZYH4OER.mjs} +1 -1
  59. package/dist/{chunk-DX4VKYAJ.cjs → chunk-I26CZYPV.cjs} +6 -4
  60. package/dist/{chunk-3TQG7CGC.cjs → chunk-ID6OVSLH.cjs} +164 -129
  61. package/dist/{chunk-F6SJAKFJ.mjs → chunk-IV6CQY7O.mjs} +12 -154
  62. package/dist/{chunk-6D242YGO.mjs → chunk-JATSG2ZO.mjs} +1 -1
  63. package/dist/{chunk-U74A3P2P.cjs → chunk-JLRDISQL.cjs} +7 -7
  64. package/dist/{chunk-H7CJRJ4L.cjs → chunk-JUFRXDTK.cjs} +18 -18
  65. package/dist/{chunk-OOIL3BWR.mjs → chunk-K3YEZLSY.mjs} +65 -8
  66. package/dist/{chunk-Y4YWHNKU.cjs → chunk-KH7BN726.cjs} +9 -9
  67. package/dist/{chunk-WFPRVVF2.cjs → chunk-KOQ555NR.cjs} +22 -14
  68. package/dist/{chunk-VZWO3XVL.mjs → chunk-KXGDXYUC.mjs} +3 -3
  69. package/dist/{chunk-3IL5UC5I.cjs → chunk-KZLND3D2.cjs} +2 -2
  70. package/dist/{chunk-QLXEYIAW.cjs → chunk-MH24QDVJ.cjs} +13 -13
  71. package/dist/{chunk-TKDY6AJP.mjs → chunk-MKMBQSNQ.mjs} +1 -1
  72. package/dist/{chunk-OCE65DDM.mjs → chunk-MNUGPHLN.mjs} +1 -1
  73. package/dist/{chunk-74RZNRY6.mjs → chunk-NVBS5WSZ.mjs} +1 -1
  74. package/dist/chunk-NYJMY3JA.cjs +156 -0
  75. package/dist/{chunk-VVJCWBIE.mjs → chunk-O3DTUAX2.mjs} +2 -2
  76. package/dist/chunk-O6XNAMBV.mjs +53 -0
  77. package/dist/{chunk-YAOX43YI.cjs → chunk-PZNCMPJF.cjs} +5 -5
  78. package/dist/{chunk-YMUH2BLR.mjs → chunk-PZPDGOU5.mjs} +14 -6
  79. package/dist/{chunk-52SH7TKB.mjs → chunk-QG5HNS7P.mjs} +2 -2
  80. package/dist/{chunk-CEYUWDWA.mjs → chunk-QZCT2CQ4.mjs} +10 -5
  81. package/dist/{chunk-RAI7NULA.mjs → chunk-REGFZJEJ.mjs} +1 -1
  82. package/dist/{chunk-QMV4QELL.mjs → chunk-S5GDHOE4.mjs} +4 -2
  83. package/dist/{chunk-CRQPYWLK.cjs → chunk-SORB3MAR.cjs} +14 -14
  84. package/dist/{chunk-DU2CASV6.mjs → chunk-T7HQ3I4C.mjs} +1 -1
  85. package/dist/{chunk-RCYINC4A.cjs → chunk-TII23GJC.cjs} +3 -3
  86. package/dist/{chunk-PPIW3MH6.mjs → chunk-UX2DD2VK.mjs} +1 -1
  87. package/dist/{chunk-I4J452B7.cjs → chunk-VHJGDMCG.cjs} +3 -3
  88. package/dist/{chunk-3WSWXPYM.cjs → chunk-VQXDC5UV.cjs} +4 -4
  89. package/dist/{chunk-B6ZCT36X.cjs → chunk-WNLBF77X.cjs} +4 -4
  90. package/dist/{chunk-GDUYXFIS.mjs → chunk-X7WVQMIB.mjs} +4 -4
  91. package/dist/{chunk-5SPPCN5J.mjs → chunk-XNPDONUH.mjs} +1 -1
  92. package/dist/{chunk-QIH2HD6H.cjs → chunk-XSPGWQWA.cjs} +86 -29
  93. package/dist/{chunk-ALIFMS4A.cjs → chunk-Y7GW7J46.cjs} +1 -1
  94. package/dist/{chunk-L6V3P73N.mjs → chunk-YDQZGSDS.mjs} +5 -5
  95. package/dist/{chunk-C3VRMB6H.cjs → chunk-ZCU4NZ3M.cjs} +6 -6
  96. package/dist/{chunk-UXQXGB5A.mjs → chunk-ZRIE4KMG.mjs} +63 -28
  97. package/dist/{client-plugins-B8RPJnot.d.mts → client-plugins-CgYNY7jF.d.mts} +1656 -1477
  98. package/dist/{client-plugins-bPBf4haK.d.ts → client-plugins-Fl9Og3yB.d.ts} +1656 -1477
  99. package/dist/client-plugins.d.mts +8 -9
  100. package/dist/client-plugins.d.ts +8 -9
  101. package/dist/client.cjs +12 -13
  102. package/dist/client.d.mts +10 -11
  103. package/dist/client.d.ts +10 -11
  104. package/dist/client.mjs +11 -12
  105. package/dist/config.d.mts +8 -9
  106. package/dist/config.d.ts +8 -9
  107. package/dist/{devtools-5D4ZDRPR.mjs → devtools-3E7ZANMZ.mjs} +7 -4
  108. package/dist/{devtools-QZJEUOJW.cjs → devtools-5AREISIA.cjs} +8 -5
  109. package/dist/docs.cjs +10 -7
  110. package/dist/docs.mjs +9 -6
  111. package/dist/{endpoint-1zA994xL.d.ts → endpoint-CA-TNX60.d.ts} +1 -1
  112. package/dist/{endpoint-DAc96i93.d.mts → endpoint-CCHFqyTE.d.mts} +1 -1
  113. package/dist/index.cjs +58 -55
  114. package/dist/index.d.mts +17 -18
  115. package/dist/index.d.ts +17 -18
  116. package/dist/index.mjs +69 -66
  117. package/dist/{integration-api-BbaiokCC.d.ts → integration-api-0y4FXJpC.d.mts} +128 -1
  118. package/dist/{integration-api-BbaiokCC.d.mts → integration-api-BPJo5oXb.d.ts} +128 -1
  119. package/dist/integrations.d.mts +8 -9
  120. package/dist/integrations.d.ts +8 -9
  121. package/dist/internal/app-markdown-runtime.cjs +9 -3
  122. package/dist/internal/app-markdown-runtime.d.mts +9 -9
  123. package/dist/internal/app-markdown-runtime.d.ts +9 -9
  124. package/dist/internal/app-markdown-runtime.mjs +8 -2
  125. package/dist/internal/build-runtime.cjs +26 -24
  126. package/dist/internal/build-runtime.d.mts +10 -11
  127. package/dist/internal/build-runtime.d.ts +10 -11
  128. package/dist/internal/build-runtime.mjs +25 -23
  129. package/dist/internal/cli-runtime.cjs +16 -12
  130. package/dist/internal/cli-runtime.mjs +15 -11
  131. package/dist/internal/client-error-overlay.cjs +4 -4
  132. package/dist/internal/client-error-overlay.mjs +1 -1
  133. package/dist/internal/client-runtime.cjs +5 -1
  134. package/dist/internal/client-runtime.d.mts +1 -0
  135. package/dist/internal/client-runtime.d.ts +1 -0
  136. package/dist/internal/client-runtime.mjs +4 -0
  137. package/dist/internal/compression-runtime.d.mts +8 -9
  138. package/dist/internal/compression-runtime.d.ts +8 -9
  139. package/dist/internal/config-runtime.cjs +8 -5
  140. package/dist/internal/config-runtime.d.mts +9 -10
  141. package/dist/internal/config-runtime.d.ts +9 -10
  142. package/dist/internal/config-runtime.mjs +7 -4
  143. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  144. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  145. package/dist/internal/production-runtime.cjs +20 -16
  146. package/dist/internal/production-runtime.d.mts +13 -14
  147. package/dist/internal/production-runtime.d.ts +13 -14
  148. package/dist/internal/production-runtime.mjs +20 -16
  149. package/dist/markdown.cjs +8 -2
  150. package/dist/markdown.d.mts +36 -153
  151. package/dist/markdown.d.ts +36 -153
  152. package/dist/markdown.mjs +7 -1
  153. package/dist/{metadata-C3na4CBj.d.mts → metadata-B0X-qtcQ.d.mts} +1 -1
  154. package/dist/{metadata-CzBP4Mfp.d.ts → metadata-BdDKgd7K.d.ts} +1 -1
  155. package/dist/middleware.cjs +4 -4
  156. package/dist/middleware.d.mts +9 -10
  157. package/dist/middleware.d.ts +9 -10
  158. package/dist/middleware.mjs +3 -3
  159. package/dist/navigation.cjs +5 -5
  160. package/dist/navigation.d.mts +10 -11
  161. package/dist/navigation.d.ts +10 -11
  162. package/dist/navigation.mjs +4 -4
  163. package/dist/{nitro-ZKLGOTVY.mjs → nitro-NAKCRVHX.mjs} +4 -3
  164. package/dist/{nitro-KQDU7CFE.cjs → nitro-VYDZGYFY.cjs} +4 -3
  165. package/dist/plugin.cjs +26 -21
  166. package/dist/plugin.d.mts +9 -10
  167. package/dist/plugin.d.ts +9 -10
  168. package/dist/plugin.mjs +26 -21
  169. package/dist/{production-runtime-DP94hPGe.d.mts → production-runtime-BjgFgDIg.d.mts} +1 -1
  170. package/dist/{production-runtime-CYg4wM4E.d.ts → production-runtime-Dx_qMA3t.d.ts} +1 -1
  171. package/dist/query/client.cjs +6 -6
  172. package/dist/query/client.mjs +2 -2
  173. package/dist/{render-plan-Bl6Fzg5z.d.ts → render-plan-B41EWmBb.d.ts} +1 -1
  174. package/dist/{render-plan-CKAJg0jC.d.mts → render-plan-_1TAWODt.d.mts} +1 -1
  175. package/dist/renderer-client.cjs +13 -14
  176. package/dist/renderer-client.d.mts +6 -7
  177. package/dist/renderer-client.d.ts +6 -7
  178. package/dist/renderer-client.mjs +6 -7
  179. package/dist/{request-CrBCcPZZ.d.mts → request-BhE4luLv.d.mts} +1 -1
  180. package/dist/{request-CR-Bp1Px.d.ts → request-Dbf3G0zM.d.ts} +1 -1
  181. package/dist/request.d.mts +9 -10
  182. package/dist/request.d.ts +9 -10
  183. package/dist/{route-rendering-CZH5FegB.d.ts → route-rendering-Z7PveTZE.d.ts} +1 -1
  184. package/dist/{route-rendering-C1NAHo-C.d.mts → route-rendering-zzfx_GHf.d.mts} +1 -1
  185. package/dist/{router-B57eDJ3u.d.mts → router-BatNMsa1.d.mts} +1 -1
  186. package/dist/{router-Cg_kD3Bd.d.ts → router-DtNRhQl3.d.ts} +1 -1
  187. package/dist/routes.cjs +6 -5
  188. package/dist/routes.d.mts +6 -7
  189. package/dist/routes.d.ts +6 -7
  190. package/dist/routes.mjs +5 -4
  191. package/dist/server-fn-client.d.mts +4 -4
  192. package/dist/server-fn-client.d.ts +4 -4
  193. package/dist/server-fn.cjs +6 -5
  194. package/dist/server-fn.d.mts +2 -1
  195. package/dist/server-fn.d.ts +2 -1
  196. package/dist/server-fn.mjs +5 -4
  197. package/dist/server-plugins.d.mts +8 -9
  198. package/dist/server-plugins.d.ts +8 -9
  199. package/dist/server-query-client.cjs +5 -7
  200. package/dist/server-query-client.d.mts +2 -1
  201. package/dist/server-query-client.d.ts +2 -1
  202. package/dist/server-query-client.mjs +4 -6
  203. package/dist/server-query.cjs +7 -6
  204. package/dist/server-query.d.mts +2 -1
  205. package/dist/server-query.d.ts +2 -1
  206. package/dist/server-query.mjs +6 -5
  207. package/dist/server.cjs +235 -131
  208. package/dist/server.d.mts +14 -15
  209. package/dist/server.d.ts +14 -15
  210. package/dist/server.mjs +222 -118
  211. package/dist/{spa-router-BstQUO6Q.d.ts → spa-router-BE3bwU-J.d.ts} +2 -2
  212. package/dist/{spa-router-DTdbuinx.d.mts → spa-router-DQOnHZVj.d.mts} +2 -2
  213. package/dist/testing.cjs +17 -15
  214. package/dist/testing.d.mts +7 -8
  215. package/dist/testing.d.ts +7 -8
  216. package/dist/testing.mjs +14 -12
  217. package/dist/{utils-CS3ZLnEJ.d.mts → utils-DLK1ERNl.d.mts} +1 -1
  218. package/dist/{utils-D3rdsIvM.d.ts → utils-u7ZBSWAK.d.ts} +1 -1
  219. package/dist/version.cjs +2 -2
  220. package/dist/version.mjs +1 -1
  221. package/dist/vite.cjs +22 -20
  222. package/dist/vite.d.mts +8 -9
  223. package/dist/vite.d.ts +8 -9
  224. package/dist/vite.mjs +21 -19
  225. package/package.json +1 -1
  226. package/dist/route-B0XrsrFk.d.mts +0 -128
  227. package/dist/route-DOEpbyWZ.d.ts +0 -128
  228. package/dist/{chunk-YOYF2E4U.mjs → chunk-LNZ7JZUS.mjs} +0 -0
  229. package/dist/{chunk-N4RLRSWW.cjs → chunk-SUIBNSNO.cjs} +0 -0
  230. package/dist/{chunk-TIKNUAU7.mjs → chunk-VUMAE7NC.mjs} +3 -3
  231. package/dist/{chunk-WM6HL7E7.cjs → chunk-ZHVYQL3H.cjs} +2 -2
package/dist/cache.d.ts CHANGED
@@ -1,5 +1,13 @@
1
- type FarmCacheInvalidationSource = "local" | "broadcast" | "live";
2
- declare function applyFarmCacheInvalidations(keys: unknown, source?: FarmCacheInvalidationSource): void;
1
+ export { a as applyFarmCacheInvalidations } from './cache-invalidation-BD0z_lfu.js';
2
+
3
+ /**
4
+ * Cache key serialization, kept free of server imports: browser code such as
5
+ * the client data cache builds the same keys, and importing `./cache` would
6
+ * pull observability and OpenTelemetry into client bundles.
7
+ */
8
+ type RouteDataCacheKey = string | readonly unknown[];
9
+ declare function createRouteDataCacheKey(key: RouteDataCacheKey): string;
10
+ declare function createFarmCacheKey(parts: readonly unknown[]): string;
3
11
 
4
12
  interface FarmCacheInvalidationStreamOptions {
5
13
  /** Stop the stream when the owning request is aborted. */
@@ -38,7 +46,6 @@ interface FarmCacheOptions {
38
46
  interface FarmCacheSetOptions extends FarmCacheOptions {
39
47
  createdAt?: number;
40
48
  }
41
- type RouteDataCacheKey = string | readonly unknown[];
42
49
  type FarmCacheInvalidationTarget = {
43
50
  key: RouteDataCacheKey;
44
51
  } | {
@@ -290,8 +297,6 @@ declare function invalidateRouteData(key: RouteDataCacheKey): void | Promise<voi
290
297
  declare function applyFarmCacheInvalidationTargets(targets: readonly FarmCacheInvalidationTarget[]): Promise<readonly string[]>;
291
298
  declare function createPathCacheTag(routePath: string): string;
292
299
  declare function createRouteDataCacheTag(key: RouteDataCacheKey): string;
293
- declare function createRouteDataCacheKey(key: RouteDataCacheKey): string;
294
300
  declare function normalizeRevalidatePath(routePath: string): string;
295
- declare function createFarmCacheKey(parts: readonly unknown[]): string;
296
301
 
297
- export { type CacheKeyFactory, type DefinedCacheKey, type FarmCacheAdapter, type FarmCacheEntry, type FarmCacheInvalidationStreamOptions, type FarmCacheInvalidationTarget, type FarmCacheOptions, type FarmCacheSetOptions, type FarmCacheStorage, type FarmCacheUserConfig, type FarmClientCacheUserConfig, FarmDataCache, type GetFarmCacheEntryOptions, type InferCacheKeyData, type RevalidateTagProfile, type RouteDataCacheKey, type StorageFarmCacheAdapterOptions, applyFarmCacheInvalidationTargets, applyFarmCacheInvalidations, configureFarmCache, createFarmCacheInvalidationStream, createFarmCacheKey, createPathCacheTag, createRouteDataCacheKey, createRouteDataCacheTag, defineCacheKey, getFarmDataCache, invalidate, invalidateRouteData, normalizeRevalidatePath, revalidatePath, revalidateTag, storageCacheAdapter, unstable_cache, updateTag };
302
+ export { type CacheKeyFactory, type DefinedCacheKey, type FarmCacheAdapter, type FarmCacheEntry, type FarmCacheInvalidationStreamOptions, type FarmCacheInvalidationTarget, type FarmCacheOptions, type FarmCacheSetOptions, type FarmCacheStorage, type FarmCacheUserConfig, type FarmClientCacheUserConfig, FarmDataCache, type GetFarmCacheEntryOptions, type InferCacheKeyData, type RevalidateTagProfile, type RouteDataCacheKey, type StorageFarmCacheAdapterOptions, applyFarmCacheInvalidationTargets, configureFarmCache, createFarmCacheInvalidationStream, createFarmCacheKey, createPathCacheTag, createRouteDataCacheKey, createRouteDataCacheTag, defineCacheKey, getFarmDataCache, invalidate, invalidateRouteData, normalizeRevalidatePath, revalidatePath, revalidateTag, storageCacheAdapter, unstable_cache, updateTag };
package/dist/cache.mjs CHANGED
@@ -3,9 +3,7 @@ import {
3
3
  applyFarmCacheInvalidationTargets,
4
4
  configureFarmCache,
5
5
  createFarmCacheInvalidationStream,
6
- createFarmCacheKey,
7
6
  createPathCacheTag,
8
- createRouteDataCacheKey,
9
7
  createRouteDataCacheTag,
10
8
  defineCacheKey,
11
9
  getFarmDataCache,
@@ -17,12 +15,16 @@ import {
17
15
  storageCacheAdapter,
18
16
  unstable_cache,
19
17
  updateTag
20
- } from "./chunk-F6SJAKFJ.mjs";
18
+ } from "./chunk-IV6CQY7O.mjs";
19
+ import "./chunk-FUZEBRP3.mjs";
20
+ import "./chunk-C4NCTZLM.mjs";
21
+ import {
22
+ createFarmCacheKey,
23
+ createRouteDataCacheKey
24
+ } from "./chunk-CNOQY6Z7.mjs";
21
25
  import {
22
26
  applyFarmCacheInvalidations
23
27
  } from "./chunk-4SIYUGRY.mjs";
24
- import "./chunk-C4NCTZLM.mjs";
25
- import "./chunk-FUZEBRP3.mjs";
26
28
  import "./chunk-LPEX4YW6.mjs";
27
29
  export {
28
30
  FarmDataCache,
@@ -3,14 +3,14 @@ import {
3
3
  loadFarmDocsPage,
4
4
  resolveFarmDocsContentDir,
5
5
  toFarmDocsMarkdownPage
6
- } from "./chunk-DU2CASV6.mjs";
6
+ } from "./chunk-T7HQ3I4C.mjs";
7
7
  import {
8
8
  docsEngine,
9
9
  loadFarmDocsEngine
10
10
  } from "./chunk-2VQKKQ6D.mjs";
11
11
  import {
12
12
  resolveDocsConfig
13
- } from "./chunk-YMUH2BLR.mjs";
13
+ } from "./chunk-PZPDGOU5.mjs";
14
14
  import {
15
15
  getFarmDocsAdapterConfigModule
16
16
  } from "./chunk-VVBO3QH7.mjs";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createFarmMarkdownViewResponse,
3
3
  requestAcceptsMarkdown
4
- } from "./chunk-OOIL3BWR.mjs";
4
+ } from "./chunk-K3YEZLSY.mjs";
5
5
  import {
6
6
  __name
7
7
  } from "./chunk-LPEX4YW6.mjs";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  getFarmClientDataCache,
3
3
  trackFarmClientCacheInvalidations
4
- } from "./chunk-5SPPCN5J.mjs";
4
+ } from "./chunk-XNPDONUH.mjs";
5
5
  import {
6
6
  isFarmServerQueryResult
7
7
  } from "./chunk-KGB5UXJJ.mjs";
8
8
  import {
9
9
  createFarmCacheKey
10
- } from "./chunk-F6SJAKFJ.mjs";
10
+ } from "./chunk-CNOQY6Z7.mjs";
11
11
  import {
12
12
  __name
13
13
  } from "./chunk-LPEX4YW6.mjs";
@@ -1,15 +1,20 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
+ var _chunkE3UK5IIBcjs = require('./chunk-E3UK5IIB.cjs');
3
4
 
4
5
 
6
+ var _chunkLIUGYUX3cjs = require('./chunk-LIUGYUX3.cjs');
5
7
 
6
- var _chunkZEG3OPIBcjs = require('./chunk-ZEG3OPIB.cjs');
7
8
 
8
9
 
9
- var _chunkLIUGYUX3cjs = require('./chunk-LIUGYUX3.cjs');
10
+
11
+ var _chunkNYJMY3JAcjs = require('./chunk-NYJMY3JA.cjs');
10
12
 
11
13
 
12
- var _chunkE3UK5IIBcjs = require('./chunk-E3UK5IIB.cjs');
14
+
15
+
16
+
17
+ var _chunkZEG3OPIBcjs = require('./chunk-ZEG3OPIB.cjs');
13
18
 
14
19
 
15
20
  var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
@@ -727,9 +732,9 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, configureFarmCache, "configureFarmCache");
727
732
  function unstable_cache(fn, keyParts = [], options = {}) {
728
733
  return async (...args) => {
729
734
  const locale = _optionalChain([_chunkLIUGYUX3cjs.getActiveFarmI18nSnapshot.call(void 0, ), 'optionalAccess', _50 => _50.locale]);
730
- const key = createFarmCacheKey([
735
+ const key = _chunkNYJMY3JAcjs.createFarmCacheKey.call(void 0, [
731
736
  "unstable_cache",
732
- getFunctionCacheIdentity(fn),
737
+ _chunkNYJMY3JAcjs.getFunctionCacheIdentity.call(void 0, fn),
733
738
  locale ? ["locale", locale] : null,
734
739
  keyParts,
735
740
  args
@@ -775,7 +780,7 @@ function revalidatePath(routePath) {
775
780
  }
776
781
  _chunkS3JO3N4Hcjs.__name.call(void 0, revalidatePath, "revalidatePath");
777
782
  function invalidate(key) {
778
- const clientKey = createRouteDataCacheKey(key);
783
+ const clientKey = _chunkNYJMY3JAcjs.createRouteDataCacheKey.call(void 0, key);
779
784
  const task = updateTag(createRouteDataCacheTag(key));
780
785
  _chunkZEG3OPIBcjs.notifyFarmCacheInvalidation.call(void 0, clientKey);
781
786
  return task;
@@ -794,7 +799,7 @@ async function applyFarmCacheInvalidationTargets(targets) {
794
799
  assertFarmCacheInvalidationTarget(target);
795
800
  if ("key" in target) {
796
801
  await invalidate(target.key);
797
- clientKeys.push(createRouteDataCacheKey(target.key));
802
+ clientKeys.push(_chunkNYJMY3JAcjs.createRouteDataCacheKey.call(void 0, target.key));
798
803
  } else if ("path" in target) {
799
804
  await revalidatePath(target.path);
800
805
  } else {
@@ -809,13 +814,9 @@ function createPathCacheTag(routePath) {
809
814
  }
810
815
  _chunkS3JO3N4Hcjs.__name.call(void 0, createPathCacheTag, "createPathCacheTag");
811
816
  function createRouteDataCacheTag(key) {
812
- return `route-data:${createRouteDataCacheKey(key)}`;
817
+ return `route-data:${_chunkNYJMY3JAcjs.createRouteDataCacheKey.call(void 0, key)}`;
813
818
  }
814
819
  _chunkS3JO3N4Hcjs.__name.call(void 0, createRouteDataCacheTag, "createRouteDataCacheTag");
815
- function createRouteDataCacheKey(key) {
816
- return createFarmCacheKey(Array.isArray(key) ? key : [key]);
817
- }
818
- _chunkS3JO3N4Hcjs.__name.call(void 0, createRouteDataCacheKey, "createRouteDataCacheKey");
819
820
  function normalizeRevalidatePath(routePath) {
820
821
  if (typeof routePath !== "string") {
821
822
  throw new TypeError("revalidatePath expects a path string.");
@@ -840,10 +841,6 @@ function normalizeRevalidatePath(routePath) {
840
841
  return normalized || "/";
841
842
  }
842
843
  _chunkS3JO3N4Hcjs.__name.call(void 0, normalizeRevalidatePath, "normalizeRevalidatePath");
843
- function createFarmCacheKey(parts) {
844
- return stableSerialize(parts);
845
- }
846
- _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmCacheKey, "createFarmCacheKey");
847
844
  function normalizeRevalidate(revalidate) {
848
845
  if (revalidate === false || revalidate === void 0) {
849
846
  return revalidate;
@@ -934,145 +931,6 @@ function assertFarmCacheInvalidationTarget(target) {
934
931
  throw new TypeError("Cache invalidation targets must contain a string/array key, path, or tag.");
935
932
  }
936
933
  _chunkS3JO3N4Hcjs.__name.call(void 0, assertFarmCacheInvalidationTarget, "assertFarmCacheInvalidationTarget");
937
- function getFunctionCacheIdentity(fn) {
938
- const name = fn.name || "anonymous";
939
- return `${name}:${hashFunctionSource(String(fn))}`;
940
- }
941
- _chunkS3JO3N4Hcjs.__name.call(void 0, getFunctionCacheIdentity, "getFunctionCacheIdentity");
942
- function hashFunctionSource(source) {
943
- let hash = 2166136261;
944
- for (let index = 0; index < source.length; index++) {
945
- hash ^= source.charCodeAt(index);
946
- hash = Math.imul(hash, 16777619);
947
- }
948
- return (hash >>> 0).toString(36);
949
- }
950
- _chunkS3JO3N4Hcjs.__name.call(void 0, hashFunctionSource, "hashFunctionSource");
951
- function compareCodepoint(a, b) {
952
- return a < b ? -1 : a > b ? 1 : 0;
953
- }
954
- _chunkS3JO3N4Hcjs.__name.call(void 0, compareCodepoint, "compareCodepoint");
955
- function serializeBinaryBytes(bytes) {
956
- return Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("");
957
- }
958
- _chunkS3JO3N4Hcjs.__name.call(void 0, serializeBinaryBytes, "serializeBinaryBytes");
959
- function serializeCanonicalStringEntries(entries, seen) {
960
- const valuesByKey = /* @__PURE__ */ new Map();
961
- for (const [key, item] of entries) {
962
- const values = valuesByKey.get(key);
963
- if (values) values.push(item);
964
- else valuesByKey.set(key, [item]);
965
- }
966
- return Array.from(valuesByKey.keys()).sort(compareCodepoint).flatMap(
967
- (key) => valuesByKey.get(key).map((item) => `[${stableSerialize(key, seen)},${stableSerialize(item, seen)}]`)
968
- ).join(",");
969
- }
970
- _chunkS3JO3N4Hcjs.__name.call(void 0, serializeCanonicalStringEntries, "serializeCanonicalStringEntries");
971
- function isPlainCacheKeyObject(value) {
972
- const prototype = Object.getPrototypeOf(value);
973
- if (prototype === null) return true;
974
- const constructor = _optionalChain([Object, 'access', _51 => _51.getOwnPropertyDescriptor, 'call', _52 => _52(prototype, "constructor"), 'optionalAccess', _53 => _53.value]);
975
- return Object.getPrototypeOf(prototype) === null && typeof constructor === "function" && constructor.name === "Object";
976
- }
977
- _chunkS3JO3N4Hcjs.__name.call(void 0, isPlainCacheKeyObject, "isPlainCacheKeyObject");
978
- function getCacheKeyValueType(value) {
979
- const prototype = Object.getPrototypeOf(value);
980
- const constructor = prototype ? _optionalChain([Object, 'access', _54 => _54.getOwnPropertyDescriptor, 'call', _55 => _55(prototype, "constructor"), 'optionalAccess', _56 => _56.value]) : void 0;
981
- if (typeof constructor === "function" && constructor.name) {
982
- return constructor.name;
983
- }
984
- return Object.prototype.toString.call(value).slice(8, -1) || "object";
985
- }
986
- _chunkS3JO3N4Hcjs.__name.call(void 0, getCacheKeyValueType, "getCacheKeyValueType");
987
- function stableSerialize(value, seen = /* @__PURE__ */ new WeakSet()) {
988
- if (value === null) return "null";
989
- if (value === void 0) return "undefined";
990
- const valueType = typeof value;
991
- if (valueType === "string") return JSON.stringify(value);
992
- if (valueType === "number" || valueType === "boolean" || valueType === "bigint") {
993
- return `${valueType}:${String(value)}`;
994
- }
995
- if (valueType === "symbol") {
996
- return `symbol:${String(value)}`;
997
- }
998
- if (valueType === "function") {
999
- return `function:${getFunctionCacheIdentity(value)}`;
1000
- }
1001
- if (value instanceof Date) {
1002
- return Number.isNaN(value.getTime()) ? "date:invalid" : `date:${value.toISOString()}`;
1003
- }
1004
- if (value instanceof URL) {
1005
- return `url:${value.toString()}`;
1006
- }
1007
- if (value instanceof RegExp) {
1008
- return `regexp:${value.toString()}`;
1009
- }
1010
- if (value instanceof ArrayBuffer) {
1011
- return `arraybuffer:${serializeBinaryBytes(new Uint8Array(value))}`;
1012
- }
1013
- if (typeof SharedArrayBuffer !== "undefined" && value instanceof SharedArrayBuffer) {
1014
- return `sharedarraybuffer:${serializeBinaryBytes(new Uint8Array(value))}`;
1015
- }
1016
- if (ArrayBuffer.isView(value)) {
1017
- const viewType = Object.prototype.toString.call(value).slice(8, -1);
1018
- const bytes = new Uint8Array(value.buffer, value.byteOffset, value.byteLength);
1019
- return `binary:${viewType}:${serializeBinaryBytes(bytes)}`;
1020
- }
1021
- if (value && typeof value === "object") {
1022
- if (seen.has(value)) {
1023
- return "[Circular]";
1024
- }
1025
- seen.add(value);
1026
- if (Array.isArray(value)) {
1027
- const items = [];
1028
- for (let index = 0; index < value.length; index++) {
1029
- items.push(
1030
- Object.prototype.hasOwnProperty.call(value, index) ? stableSerialize(value[index], seen) : "[Hole]"
1031
- );
1032
- }
1033
- seen.delete(value);
1034
- return `[${items.join(",")}]`;
1035
- }
1036
- if (value instanceof Set) {
1037
- const items = Array.from(value, (item) => stableSerialize(item, seen)).sort(compareCodepoint);
1038
- seen.delete(value);
1039
- return `set:[${items.join(",")}]`;
1040
- }
1041
- if (value instanceof Map) {
1042
- const items = Array.from(
1043
- value,
1044
- ([key, item]) => `[${stableSerialize(key, seen)},${stableSerialize(item, seen)}]`
1045
- ).sort(compareCodepoint);
1046
- seen.delete(value);
1047
- return `map:[${items.join(",")}]`;
1048
- }
1049
- if (value instanceof URLSearchParams) {
1050
- const serialized2 = serializeCanonicalStringEntries(value, seen);
1051
- seen.delete(value);
1052
- return `urlsearchparams:[${serialized2}]`;
1053
- }
1054
- if (value instanceof Headers) {
1055
- const serialized2 = serializeCanonicalStringEntries(value, seen);
1056
- seen.delete(value);
1057
- return `headers:[${serialized2}]`;
1058
- }
1059
- if (!isPlainCacheKeyObject(value)) {
1060
- throw new TypeError(
1061
- `Cache keys do not support ${getCacheKeyValueType(value)} values. Convert the value to an explicit stable string or structured key before caching.`
1062
- );
1063
- }
1064
- const entries = Object.entries(value).sort(
1065
- ([a], [b]) => compareCodepoint(a, b)
1066
- );
1067
- const serialized = entries.map(([key, item]) => `${JSON.stringify(key)}:${stableSerialize(item, seen)}`).join(",");
1068
- seen.delete(value);
1069
- return `{${serialized}}`;
1070
- }
1071
- return String(value);
1072
- }
1073
- _chunkS3JO3N4Hcjs.__name.call(void 0, stableSerialize, "stableSerialize");
1074
-
1075
-
1076
934
 
1077
935
 
1078
936
 
@@ -1091,4 +949,4 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, stableSerialize, "stableSerialize");
1091
949
 
1092
950
 
1093
951
 
1094
- exports.createFarmCacheInvalidationStream = createFarmCacheInvalidationStream; exports.defineCacheKey = defineCacheKey; exports.storageCacheAdapter = storageCacheAdapter; exports.FarmDataCache = FarmDataCache; exports.getFarmDataCache = getFarmDataCache; exports.configureFarmCache = configureFarmCache; exports.unstable_cache = unstable_cache; exports.revalidateTag = revalidateTag; exports.updateTag = updateTag; exports.revalidatePath = revalidatePath; exports.invalidate = invalidate; exports.invalidateRouteData = invalidateRouteData; exports.applyFarmCacheInvalidationTargets = applyFarmCacheInvalidationTargets; exports.createPathCacheTag = createPathCacheTag; exports.createRouteDataCacheTag = createRouteDataCacheTag; exports.createRouteDataCacheKey = createRouteDataCacheKey; exports.normalizeRevalidatePath = normalizeRevalidatePath; exports.createFarmCacheKey = createFarmCacheKey;
952
+ exports.createFarmCacheInvalidationStream = createFarmCacheInvalidationStream; exports.defineCacheKey = defineCacheKey; exports.storageCacheAdapter = storageCacheAdapter; exports.FarmDataCache = FarmDataCache; exports.getFarmDataCache = getFarmDataCache; exports.configureFarmCache = configureFarmCache; exports.unstable_cache = unstable_cache; exports.revalidateTag = revalidateTag; exports.updateTag = updateTag; exports.revalidatePath = revalidatePath; exports.invalidate = invalidate; exports.invalidateRouteData = invalidateRouteData; exports.applyFarmCacheInvalidationTargets = applyFarmCacheInvalidationTargets; exports.createPathCacheTag = createPathCacheTag; exports.createRouteDataCacheTag = createRouteDataCacheTag; exports.normalizeRevalidatePath = normalizeRevalidatePath;
@@ -182,7 +182,10 @@ function renderMetadataHead(metadata, options = {}) {
182
182
  );
183
183
  }
184
184
  appendNamedMetaRecord(tags, resolvedMetadata.other);
185
- appendOpenGraph(tags, resolvedMetadata.openGraph, metadataBase);
185
+ appendOpenGraph(tags, resolvedMetadata.openGraph, metadataBase, {
186
+ title: explicitTitle,
187
+ description: resolvedMetadata.description
188
+ });
186
189
  appendTwitter(tags, resolvedMetadata.twitter, metadataBase);
187
190
  appendVerification(tags, resolvedMetadata.verification);
188
191
  if (options.jsonLd) {
@@ -220,10 +223,12 @@ function mergeNestedMetadata(base, next) {
220
223
  return _nullishCoalesce(next, () => ( base));
221
224
  }
222
225
  _chunkS3JO3N4Hcjs.__name.call(void 0, mergeNestedMetadata, "mergeNestedMetadata");
223
- function appendOpenGraph(tags, openGraph, metadataBase) {
224
- if (!isRecord(openGraph)) return;
225
- appendMetaProperty(tags, "og:title", openGraph.title);
226
- appendMetaProperty(tags, "og:description", openGraph.description);
226
+ function appendOpenGraph(tags, input, metadataBase, page) {
227
+ const description = typeof page.description === "string" ? page.description : void 0;
228
+ if (!isRecord(input) && !page.title && !description) return;
229
+ const openGraph = isRecord(input) ? input : {};
230
+ appendMetaProperty(tags, "og:title", _nullishCoalesce(openGraph.title, () => ( page.title)));
231
+ appendMetaProperty(tags, "og:description", _nullishCoalesce(openGraph.description, () => ( description)));
227
232
  appendMetaProperty(tags, "og:url", resolveMetadataUrl(openGraph.url, metadataBase));
228
233
  appendMetaProperty(tags, "og:site_name", openGraph.siteName);
229
234
  appendMetaProperty(tags, "og:type", _nullishCoalesce(openGraph.type, () => ( "website")));
@@ -1,9 +1,9 @@
1
+ import {
2
+ applyFarmCacheInvalidationTargets
3
+ } from "./chunk-IV6CQY7O.mjs";
1
4
  import {
2
5
  isMultipartSchema
3
6
  } from "./chunk-EMLAPBEM.mjs";
4
- import {
5
- applyFarmCacheInvalidationTargets
6
- } from "./chunk-F6SJAKFJ.mjs";
7
7
  import {
8
8
  assertBrowserStableRoutePath,
9
9
  assertUniqueRouteParameters,
@@ -4,7 +4,7 @@ import {
4
4
  _runServerFunctionForCaller,
5
5
  createServerFn,
6
6
  createServerFunctionDescriptor
7
- } from "./chunk-WD4YXVLV.mjs";
7
+ } from "./chunk-GZYH4OER.mjs";
8
8
  import {
9
9
  createFarmServerQueryResult
10
10
  } from "./chunk-KGB5UXJJ.mjs";
@@ -12,11 +12,13 @@ import {
12
12
  getServerActionExecutionContext
13
13
  } from "./chunk-QCFFHV5H.mjs";
14
14
  import {
15
- createFarmCacheKey,
16
- createRouteDataCacheKey,
17
15
  createRouteDataCacheTag,
18
16
  getFarmDataCache
19
- } from "./chunk-F6SJAKFJ.mjs";
17
+ } from "./chunk-IV6CQY7O.mjs";
18
+ import {
19
+ createFarmCacheKey,
20
+ createRouteDataCacheKey
21
+ } from "./chunk-CNOQY6Z7.mjs";
20
22
  import {
21
23
  __name
22
24
  } from "./chunk-LPEX4YW6.mjs";
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkQIH2HD6Hcjs = require('./chunk-QIH2HD6H.cjs');
5
+ var _chunkXSPGWQWAcjs = require('./chunk-XSPGWQWA.cjs');
6
6
 
7
7
 
8
8
  var _chunkJ63ZH5OQcjs = require('./chunk-J63ZH5OQ.cjs');
@@ -66,12 +66,12 @@ function collectFarmLlmsTxtPages(sources, options) {
66
66
  for (const source of sources) {
67
67
  const path = source.pattern;
68
68
  if (path.includes("[") || pages.has(path)) continue;
69
- if (include.length && !include.some((pattern) => _chunkQIH2HD6Hcjs.matchesFarmMarkdownRoutePattern.call(void 0, pattern, path))) {
69
+ if (include.length && !include.some((pattern) => _chunkXSPGWQWAcjs.matchesFarmMarkdownRoutePattern.call(void 0, pattern, path))) {
70
70
  continue;
71
71
  }
72
- if (exclude.some((pattern) => _chunkQIH2HD6Hcjs.matchesFarmMarkdownRoutePattern.call(void 0, pattern, path))) continue;
72
+ if (exclude.some((pattern) => _chunkXSPGWQWAcjs.matchesFarmMarkdownRoutePattern.call(void 0, pattern, path))) continue;
73
73
  if (isMetadataNoIndex(source.metadata)) continue;
74
- const target = _chunkQIH2HD6Hcjs.isFarmMarkdownMirrorExposed.call(void 0, options.markdown, path) ? _chunkQIH2HD6Hcjs.getFarmMarkdownMirrorPath.call(void 0, path) : path;
74
+ const target = _chunkXSPGWQWAcjs.isFarmMarkdownMirrorExposed.call(void 0, options.markdown, path) ? _chunkXSPGWQWAcjs.getFarmMarkdownMirrorPath.call(void 0, path) : path;
75
75
  const description = readMetadataString(source.metadata, "description");
76
76
  pages.set(path, {
77
77
  path,
@@ -0,0 +1,53 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
+
3
+
4
+ var _chunkWPYFSQKKcjs = require('./chunk-WPYFSQKK.cjs');
5
+
6
+
7
+ var _chunkG7HXGLECcjs = require('./chunk-G7HXGLEC.cjs');
8
+
9
+
10
+ var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
11
+
12
+ // src/mcp-catalog.ts
13
+ var CATALOGS = /* @__PURE__ */ Symbol.for("farm.mcp.catalogs");
14
+ function catalogs() {
15
+ const state = globalThis;
16
+ return _nullishCoalesce(state[CATALOGS], () => ( (state[CATALOGS] = /* @__PURE__ */ new Map())));
17
+ }
18
+ _chunkS3JO3N4Hcjs.__name.call(void 0, catalogs, "catalogs");
19
+ function _publishFarmMCPCatalog(server, tools) {
20
+ const entry = { server, tools };
21
+ catalogs().set(server.path, entry);
22
+ return () => {
23
+ if (catalogs().get(server.path) === entry) catalogs().delete(server.path);
24
+ };
25
+ }
26
+ _chunkS3JO3N4Hcjs.__name.call(void 0, _publishFarmMCPCatalog, "_publishFarmMCPCatalog");
27
+ function _findFarmMCPEndpointTool(method, pathname, serverBasePath) {
28
+ const upperMethod = method.toUpperCase();
29
+ for (const { server, tools } of catalogs().values()) {
30
+ const routes = /* @__PURE__ */ new Map();
31
+ for (const tool of tools) {
32
+ if (tool.kind === "endpoint" && tool.method === upperMethod) {
33
+ routes.set(tool.path, { path: tool.path, name: tool.name });
34
+ }
35
+ }
36
+ if (routes.size === 0) continue;
37
+ const canonical = serverBasePath ? _chunkWPYFSQKKcjs.resolveFarmAPICanonicalPathname.call(void 0, pathname, serverBasePath) : pathname;
38
+ const match = _chunkG7HXGLECcjs.matchAPIRoute.call(void 0, routes, canonical);
39
+ if (match) {
40
+ return {
41
+ name: match.route.name,
42
+ endpoint: _chunkWPYFSQKKcjs.resolveFarmAPIServerRoutePath.call(void 0, server.path, serverBasePath)
43
+ };
44
+ }
45
+ }
46
+ return void 0;
47
+ }
48
+ _chunkS3JO3N4Hcjs.__name.call(void 0, _findFarmMCPEndpointTool, "_findFarmMCPEndpointTool");
49
+
50
+
51
+
52
+
53
+ exports._publishFarmMCPCatalog = _publishFarmMCPCatalog; exports._findFarmMCPEndpointTool = _findFarmMCPEndpointTool;
@@ -1,6 +1,6 @@
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
- var _chunkH6G5INWMcjs = require('./chunk-H6G5INWM.cjs');
3
+ var _chunkNYJMY3JAcjs = require('./chunk-NYJMY3JA.cjs');
4
4
 
5
5
 
6
6
  var _chunkZEG3OPIBcjs = require('./chunk-ZEG3OPIB.cjs');
@@ -377,7 +377,7 @@ function getFarmClientDataCache() {
377
377
  }
378
378
  _chunkS3JO3N4Hcjs.__name.call(void 0, getFarmClientDataCache, "getFarmClientDataCache");
379
379
  function normalizeFarmClientCacheKey(key) {
380
- return typeof key === "string" ? key : _chunkH6G5INWMcjs.createRouteDataCacheKey.call(void 0, key);
380
+ return typeof key === "string" ? key : _chunkNYJMY3JAcjs.createRouteDataCacheKey.call(void 0, key);
381
381
  }
382
382
  _chunkS3JO3N4Hcjs.__name.call(void 0, normalizeFarmClientCacheKey, "normalizeFarmClientCacheKey");
383
383
 
@@ -2,10 +2,10 @@ import {
2
2
  attachRevalidationListeners,
3
3
  createServerQueryCallKey,
4
4
  fetchServerQuery
5
- } from "./chunk-UUYF3CHN.mjs";
5
+ } from "./chunk-2N5PX3LS.mjs";
6
6
  import {
7
7
  getFarmClientDataCache
8
- } from "./chunk-5SPPCN5J.mjs";
8
+ } from "./chunk-XNPDONUH.mjs";
9
9
  import {
10
10
  __name
11
11
  } from "./chunk-LPEX4YW6.mjs";
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkG3HRIVEYcjs = require('./chunk-G3HRIVEY.cjs');
7
+ var _chunkES4B2IXWcjs = require('./chunk-ES4B2IXW.cjs');
8
8
 
9
9
 
10
10
  var _chunkSK35NQKKcjs = require('./chunk-SK35NQKK.cjs');
@@ -14,9 +14,11 @@ var _chunkT5CERMEHcjs = require('./chunk-T5CERMEH.cjs');
14
14
 
15
15
 
16
16
 
17
+ var _chunk2SDO73HKcjs = require('./chunk-2SDO73HK.cjs');
17
18
 
18
19
 
19
- var _chunkH6G5INWMcjs = require('./chunk-H6G5INWM.cjs');
20
+
21
+ var _chunkNYJMY3JAcjs = require('./chunk-NYJMY3JA.cjs');
20
22
 
21
23
 
22
24
  var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
@@ -33,17 +35,17 @@ function createServerQuery(options) {
33
35
  throw new TypeError("createServerQuery requires a key function");
34
36
  }
35
37
  const staleTime = normalizeServerQueryStaleTime(options.staleTime);
36
- const execute = _chunkG3HRIVEYcjs.createServerFn.call(void 0, {
38
+ const execute = _chunkES4B2IXWcjs.createServerFn.call(void 0, {
37
39
  input: options.input,
38
40
  middleware: options.middleware,
39
41
  handler: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (context) => {
40
42
  const routeKey = await options.key(context);
41
43
  assertServerQueryKey(routeKey);
42
- const clientKey = _chunkH6G5INWMcjs.createRouteDataCacheKey.call(void 0, routeKey);
43
- const cacheKey = _chunkH6G5INWMcjs.createFarmCacheKey.call(void 0, ["route-data", routeKey]);
44
+ const clientKey = _chunkNYJMY3JAcjs.createRouteDataCacheKey.call(void 0, routeKey);
45
+ const cacheKey = _chunkNYJMY3JAcjs.createFarmCacheKey.call(void 0, ["route-data", routeKey]);
44
46
  const producer = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
45
47
  const value = await options.handler(context);
46
- return _chunkG3HRIVEYcjs._parseServerFnSchema.call(void 0, options.output, value, "output", "createServerQuery");
48
+ return _chunkES4B2IXWcjs._parseServerFnSchema.call(void 0, options.output, value, "output", "createServerQuery");
47
49
  }, "producer");
48
50
  let data;
49
51
  let updatedAt;
@@ -51,9 +53,9 @@ function createServerQuery(options) {
51
53
  data = await dedupeServerQueryRequest(cacheKey, context.request, producer);
52
54
  updatedAt = Date.now();
53
55
  } else {
54
- const cache = _chunkH6G5INWMcjs.getFarmDataCache.call(void 0, );
56
+ const cache = _chunk2SDO73HKcjs.getFarmDataCache.call(void 0, );
55
57
  data = await cache.getOrSet(cacheKey, producer, {
56
- tags: [_chunkH6G5INWMcjs.createRouteDataCacheTag.call(void 0, routeKey)],
58
+ tags: [_chunk2SDO73HKcjs.createRouteDataCacheTag.call(void 0, routeKey)],
57
59
  revalidate: staleTime === false ? false : staleTime / 1e3
58
60
  });
59
61
  updatedAt = await _asyncNullishCoalesce(await _asyncOptionalChain([(await cache.getEntryAsync(cacheKey, { allowStale: true })), 'optionalAccess', async _ => _.createdAt]), async () => ( Date.now()));
@@ -88,10 +90,10 @@ function createServerQuery(options) {
88
90
  enumerable: false
89
91
  }
90
92
  });
91
- _chunkG3HRIVEYcjs._attachServerFunctionDescriptor.call(void 0,
93
+ _chunkES4B2IXWcjs._attachServerFunctionDescriptor.call(void 0,
92
94
  query,
93
- _chunkG3HRIVEYcjs.createServerFunctionDescriptor.call(void 0, "query", options, async (value) => {
94
- const result = await _chunkG3HRIVEYcjs._runServerFunctionForCaller.call(void 0,
95
+ _chunkES4B2IXWcjs.createServerFunctionDescriptor.call(void 0, "query", options, async (value) => {
96
+ const result = await _chunkES4B2IXWcjs._runServerFunctionForCaller.call(void 0,
95
97
  execute,
96
98
  value
97
99
  );
@@ -3,7 +3,7 @@
3
3
  var _chunkOWOUTKIJcjs = require('./chunk-OWOUTKIJ.cjs');
4
4
 
5
5
 
6
- var _chunk2CT6XUNOcjs = require('./chunk-2CT6XUNO.cjs');
6
+ var _chunk55ZY4ZA7cjs = require('./chunk-55ZY4ZA7.cjs');
7
7
 
8
8
 
9
9
  var _chunkJ63ZH5OQcjs = require('./chunk-J63ZH5OQ.cjs');
@@ -12,11 +12,11 @@ var _chunkJ63ZH5OQcjs = require('./chunk-J63ZH5OQ.cjs');
12
12
  var _chunkOI6CMLWXcjs = require('./chunk-OI6CMLWX.cjs');
13
13
 
14
14
 
15
+ var _chunkTKJZFIMLcjs = require('./chunk-TKJZFIML.cjs');
15
16
 
16
- var _chunkWPYFSQKKcjs = require('./chunk-WPYFSQKK.cjs');
17
17
 
18
18
 
19
- var _chunkTKJZFIMLcjs = require('./chunk-TKJZFIML.cjs');
19
+ var _chunkWPYFSQKKcjs = require('./chunk-WPYFSQKK.cjs');
20
20
 
21
21
 
22
22
  var _chunkBIDYX3SLcjs = require('./chunk-BIDYX3SL.cjs');
@@ -210,7 +210,7 @@ function createFarmMetadataRouteResponse(kind, value, routeModule = {}, options
210
210
  if (isResponse(value)) {
211
211
  return method === "HEAD" ? _chunkTKJZFIMLcjs.omitFarmResponseBody.call(void 0, value) : value;
212
212
  }
213
- const body = kind === "sitemap" ? serializeSitemap(value) : kind === "robots" ? serializeRobots(value) : kind === "llms" || kind === "llms-full" ? _chunk2CT6XUNOcjs.serializeFarmLlmsTxt.call(void 0, value) : serializeManifest(value);
213
+ const body = kind === "sitemap" ? serializeSitemap(value) : kind === "robots" ? serializeRobots(value) : kind === "llms" || kind === "llms-full" ? _chunk55ZY4ZA7cjs.serializeFarmLlmsTxt.call(void 0, value) : serializeManifest(value);
214
214
  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";
215
215
  return new Response(method === "HEAD" ? null : body, {
216
216
  headers: {