@farm.js/core 0.2.0 → 0.2.2

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 (227) hide show
  1. package/dist/{agent-mcp.d-xPua9Zdz.d.ts → agent-mcp.d-DuZjglYX.d.ts} +1 -1
  2. package/dist/{agent-mcp.d-DhZf5-v0.d.mts → agent-mcp.d-gI3ahrF6.d.mts} +1 -1
  3. package/dist/agent-runtime.d.mts +4 -4
  4. package/dist/agent-runtime.d.ts +4 -4
  5. package/dist/analyzer-ENHO4SA5.cjs +17 -0
  6. package/dist/{analyzer-LQ4LVDCW.mjs → analyzer-UXWYUTBK.mjs} +2 -2
  7. package/dist/api/node.d.mts +6 -6
  8. package/dist/api/node.d.ts +6 -6
  9. package/dist/api/route-manager.cjs +3 -3
  10. package/dist/api/route-manager.d.mts +6 -6
  11. package/dist/api/route-manager.d.ts +6 -6
  12. package/dist/api/route-manager.mjs +2 -2
  13. package/dist/api/runtime.d.mts +5 -5
  14. package/dist/api/runtime.d.ts +5 -5
  15. package/dist/api.cjs +4 -4
  16. package/dist/api.d.mts +7 -7
  17. package/dist/api.d.ts +7 -7
  18. package/dist/api.mjs +3 -3
  19. package/dist/{app-manifest.d-D6l1Wkn6.d.ts → app-manifest.d-B3h89j6a.d.ts} +1 -1
  20. package/dist/{app-manifest.d-Bq9VWtpk.d.mts → app-manifest.d-bHK9EGPI.d.mts} +1 -1
  21. package/dist/app-markdown.d.mts +5 -5
  22. package/dist/app-markdown.d.ts +5 -5
  23. package/dist/{app.d-gnTrW72o.d.ts → app.d-C3uyET_L.d.ts} +4 -4
  24. package/dist/{app.d-Bn1bqBkf.d.mts → app.d-Cr7fXGvJ.d.mts} +4 -4
  25. package/dist/{chunk-MUQP2APN.cjs → chunk-2T4GGCQT.cjs} +2 -2
  26. package/dist/{chunk-VFZQXADS.cjs → chunk-56F4CDKE.cjs} +139 -137
  27. package/dist/{chunk-O47IT4CS.cjs → chunk-5AOARZJT.cjs} +4 -4
  28. package/dist/{chunk-YQXLBYY2.cjs → chunk-5B2Y4EVS.cjs} +32 -8
  29. package/dist/{chunk-JKNQMGZE.cjs → chunk-5CG2UD6B.cjs} +12 -12
  30. package/dist/{chunk-QCVP22KW.cjs → chunk-5RYBQKBY.cjs} +3 -3
  31. package/dist/{chunk-MEIZIRMK.mjs → chunk-6VMBLDWY.mjs} +1 -1
  32. package/dist/{chunk-DVL3UVYT.mjs → chunk-6XABTMXR.mjs} +2 -2
  33. package/dist/chunk-7QGA6UX6.cjs +26 -0
  34. package/dist/{chunk-Z7YIQ7AJ.cjs → chunk-A4AYTO2E.cjs} +1 -1
  35. package/dist/{chunk-V36K4TSU.mjs → chunk-ADKPJZPP.mjs} +1 -1
  36. package/dist/{chunk-ZVEKOMZS.mjs → chunk-ALGAGXWB.mjs} +1 -1
  37. package/dist/{chunk-2LHO4HTP.cjs → chunk-B7CZ7T2I.cjs} +2 -2
  38. package/dist/{chunk-VWPGK6UV.cjs → chunk-BEAQVRMQ.cjs} +58 -58
  39. package/dist/{chunk-WOPQQCP3.mjs → chunk-CPL7WIMP.mjs} +1 -1
  40. package/dist/{chunk-RMLXUVR5.cjs → chunk-CS6GXE42.cjs} +91 -21
  41. package/dist/{chunk-MLMDOIBY.mjs → chunk-CZMMU3FP.mjs} +2 -2
  42. package/dist/{chunk-ZTNU4XCC.cjs → chunk-D2VLHRBN.cjs} +3 -3
  43. package/dist/{chunk-4ER5KYSC.cjs → chunk-FDS6U2NT.cjs} +3 -3
  44. package/dist/{chunk-54INSSWI.mjs → chunk-FEWGKBMM.mjs} +32 -19
  45. package/dist/chunk-G7LNCHTS.mjs +21 -0
  46. package/dist/{chunk-FFROR7QD.mjs → chunk-GKDOKES3.mjs} +1 -1
  47. package/dist/{chunk-T4VF6BYV.cjs → chunk-GL4SPJTE.cjs} +2 -2
  48. package/dist/{chunk-ZF7N222A.mjs → chunk-IEXZMDF4.mjs} +2 -2
  49. package/dist/{chunk-SIHHYNX4.mjs → chunk-JCERO6YF.mjs} +1 -1
  50. package/dist/{chunk-LGL5QKUJ.cjs → chunk-JM5VSEYC.cjs} +2 -2
  51. package/dist/{chunk-MZG5M4JS.cjs → chunk-L7Z6OAE2.cjs} +4 -4
  52. package/dist/{chunk-RDT2LJES.mjs → chunk-MEXGQE4T.mjs} +6 -6
  53. package/dist/{chunk-KKXGBQ2K.mjs → chunk-MYJPW4XN.mjs} +2 -2
  54. package/dist/{chunk-GK2RCRT2.mjs → chunk-NPR6SCEV.mjs} +1 -1
  55. package/dist/chunk-O77EKGAS.mjs +36 -0
  56. package/dist/{chunk-GAD63TH7.mjs → chunk-Q4CPBKPT.mjs} +4 -4
  57. package/dist/{chunk-DNERKYN4.cjs → chunk-Q4FHYBFT.cjs} +11 -11
  58. package/dist/{chunk-ZCT6B5PQ.cjs → chunk-SJQ24IB5.cjs} +6 -6
  59. package/dist/{chunk-HYYOVRED.mjs → chunk-SPVXL37B.mjs} +1 -1
  60. package/dist/{chunk-D7KBMJ7L.mjs → chunk-ST3U7XVO.mjs} +1 -1
  61. package/dist/{chunk-MX4G24YS.mjs → chunk-TK2JJCP5.mjs} +17 -15
  62. package/dist/{chunk-LO5BNR6Y.mjs → chunk-W5T3ZAFU.mjs} +25 -1
  63. package/dist/{chunk-ADCVSTFV.cjs → chunk-WAQIO2VD.cjs} +2 -2
  64. package/dist/{chunk-KJW6KEOZ.mjs → chunk-WRT775N6.mjs} +92 -22
  65. package/dist/{chunk-MNBFSAWF.cjs → chunk-YCGOQKVC.cjs} +20 -1
  66. package/dist/{chunk-J6JAUJPC.cjs → chunk-ZND5D4IC.cjs} +163 -150
  67. package/dist/{chunk-PATIHHC7.cjs → chunk-ZQOHL6TX.cjs} +2 -2
  68. package/dist/{chunk-RP55BUJM.mjs → chunk-ZVT2F3JU.mjs} +1 -1
  69. package/dist/{client-component.d-DT5OKBZu.d.ts → client-component.d-BavTzqsn.d.ts} +1 -1
  70. package/dist/{client-component.d-34DDMZcl.d.mts → client-component.d-X3j9FOZ2.d.mts} +1 -1
  71. package/dist/{client-plugins.d-D9CnUvZ5.d.ts → client-plugins.d-CqTr5IrQ.d.ts} +64 -4
  72. package/dist/{client-plugins.d-D7k9t9Ge.d.mts → client-plugins.d-DnnAopKG.d.mts} +64 -4
  73. package/dist/client-plugins.d.mts +4 -4
  74. package/dist/client-plugins.d.ts +4 -4
  75. package/dist/client.d.mts +10 -10
  76. package/dist/client.d.ts +10 -10
  77. package/dist/config.d.mts +4 -4
  78. package/dist/config.d.ts +4 -4
  79. package/dist/desktop.cjs +5 -1
  80. package/dist/desktop.d.mts +11 -7
  81. package/dist/desktop.d.ts +11 -7
  82. package/dist/desktop.mjs +4 -0
  83. package/dist/{dev-guard-M3ZCDWCK.cjs → dev-guard-5NUIX6IZ.cjs} +4 -3
  84. package/dist/{dev-guard-TFVWJNIB.mjs → dev-guard-L42ZZRCZ.mjs} +2 -1
  85. package/dist/{devtools-IUU4SWQL.cjs → devtools-4LMM3DDJ.cjs} +2 -2
  86. package/dist/{devtools-R77KAJA4.mjs → devtools-RFVGDHXH.mjs} +1 -1
  87. package/dist/docs.cjs +3 -3
  88. package/dist/docs.d.mts +6 -6
  89. package/dist/docs.d.ts +6 -6
  90. package/dist/docs.mjs +2 -2
  91. package/dist/environment/vite.cjs +3 -3
  92. package/dist/environment/vite.d.mts +1 -1
  93. package/dist/environment/vite.d.ts +1 -1
  94. package/dist/environment/vite.mjs +2 -2
  95. package/dist/{generate-route-types.d-BFOMM8Ef.d.mts → generate-route-types.d-CAiRw4N0.d.mts} +1 -1
  96. package/dist/{generate-route-types.d-C2m8myHb.d.ts → generate-route-types.d-Dz8MOQ3u.d.ts} +1 -1
  97. package/dist/{handler.d-fxTjv3Nn.d.mts → handler.d-BSlpYCDB.d.mts} +2 -2
  98. package/dist/{handler.d-DbZvbwNi.d.ts → handler.d-DgX7gPO6.d.ts} +2 -2
  99. package/dist/{headers.d-OBHpGTF_.d.mts → headers.d-Cf8l5LMo.d.mts} +1 -1
  100. package/dist/{headers.d-oeWybIk8.d.ts → headers.d-CmxW42R2.d.ts} +1 -1
  101. package/dist/index.cjs +25 -24
  102. package/dist/{index.d-CRrPQwlO.d.mts → index.d-7xoJqKRZ.d.mts} +1 -1
  103. package/dist/{index.d-BM-dKdzH.d.ts → index.d-BZZt7kxO.d.ts} +1 -1
  104. package/dist/index.d.mts +27 -27
  105. package/dist/index.d.ts +27 -27
  106. package/dist/index.mjs +20 -19
  107. package/dist/integrations/orm.d.mts +4 -4
  108. package/dist/integrations/orm.d.ts +4 -4
  109. package/dist/integrations.d.mts +4 -4
  110. package/dist/integrations.d.ts +4 -4
  111. package/dist/internal/app-markdown-runtime.d.mts +5 -5
  112. package/dist/internal/app-markdown-runtime.d.ts +5 -5
  113. package/dist/internal/build-runtime.cjs +21 -20
  114. package/dist/internal/build-runtime.d.mts +7 -7
  115. package/dist/internal/build-runtime.d.ts +7 -7
  116. package/dist/internal/build-runtime.mjs +20 -19
  117. package/dist/internal/cli-runtime.cjs +8 -5
  118. package/dist/internal/cli-runtime.d.mts +20 -12
  119. package/dist/internal/cli-runtime.d.ts +20 -12
  120. package/dist/internal/cli-runtime.mjs +7 -4
  121. package/dist/internal/client-error-overlay.cjs +4 -4
  122. package/dist/internal/client-error-overlay.mjs +1 -1
  123. package/dist/internal/client-runtime.d.mts +8 -8
  124. package/dist/internal/client-runtime.d.ts +8 -8
  125. package/dist/internal/compression-runtime.d.mts +4 -4
  126. package/dist/internal/compression-runtime.d.ts +4 -4
  127. package/dist/internal/config-runtime.cjs +5 -4
  128. package/dist/internal/config-runtime.d.mts +8 -8
  129. package/dist/internal/config-runtime.d.ts +8 -8
  130. package/dist/internal/config-runtime.mjs +4 -3
  131. package/dist/internal/infra-analytics-runtime.cjs +6 -6
  132. package/dist/internal/infra-analytics-runtime.mjs +4 -4
  133. package/dist/internal/native-server-fns.cjs +4 -4
  134. package/dist/internal/native-server-fns.mjs +3 -3
  135. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  136. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  137. package/dist/internal/production-runtime.cjs +4 -4
  138. package/dist/internal/production-runtime.d.mts +13 -13
  139. package/dist/internal/production-runtime.d.ts +13 -13
  140. package/dist/internal/production-runtime.mjs +3 -3
  141. package/dist/internal/spa-router.d.mts +6 -6
  142. package/dist/internal/spa-router.d.ts +6 -6
  143. package/dist/internal/start-manifest.d.mts +4 -4
  144. package/dist/internal/start-manifest.d.ts +4 -4
  145. package/dist/{layers.d-CH0bC4QL.d.ts → layers.d-dNBkiNE9.d.mts} +1 -1
  146. package/dist/{layers.d-CH0bC4QL.d.mts → layers.d-dNBkiNE9.d.ts} +1 -1
  147. package/dist/{manager-STAB5TVZ.cjs → manager-YRIENS63.cjs} +4 -4
  148. package/dist/{manager-EFPBRS3U.mjs → manager-YTJOAHII.mjs} +3 -3
  149. package/dist/markdown.d.mts +4 -4
  150. package/dist/markdown.d.ts +4 -4
  151. package/dist/middleware.d.mts +4 -4
  152. package/dist/middleware.d.ts +4 -4
  153. package/dist/mobile.d.mts +4 -4
  154. package/dist/mobile.d.ts +4 -4
  155. package/dist/{mount.d-TnD-Mebk.d.ts → mount.d-CD-xVBu7.d.ts} +1 -1
  156. package/dist/{mount.d-B7RiwjiO.d.mts → mount.d-Dd0xeRMl.d.mts} +1 -1
  157. package/dist/{navigation-delegate.d-VBCF0EeN.d.ts → navigation-delegate.d-Bses_F-y.d.ts} +1 -1
  158. package/dist/{navigation-delegate.d-Boz2511c.d.mts → navigation-delegate.d-dBNg976E.d.mts} +1 -1
  159. package/dist/navigation.d.mts +7 -7
  160. package/dist/navigation.d.ts +7 -7
  161. package/dist/plugin.cjs +16 -15
  162. package/dist/plugin.d.mts +8 -8
  163. package/dist/plugin.d.ts +8 -8
  164. package/dist/plugin.mjs +15 -14
  165. package/dist/{render-plan.d-BrumV_ZE.d.ts → render-plan.d-DaIwnRK2.d.ts} +1 -1
  166. package/dist/{render-plan.d-BwnmyfNk.d.mts → render-plan.d-vOdZHHLI.d.mts} +1 -1
  167. package/dist/renderer-client.d.mts +8 -8
  168. package/dist/renderer-client.d.ts +8 -8
  169. package/dist/{request.d-Dd5nRTO5.d.mts → request.d-B8U4pVFP.d.mts} +1 -1
  170. package/dist/{request.d-NUi01-5e.d.ts → request.d-CgXp3EEc.d.ts} +1 -1
  171. package/dist/request.d.mts +5 -5
  172. package/dist/request.d.ts +5 -5
  173. package/dist/{route-rendering.d-BK0Pf7_k.d.mts → route-rendering.d-BQvNYQqu.d.mts} +1 -1
  174. package/dist/{route-rendering.d-CJR5BPXV.d.ts → route-rendering.d-Di0AxFix.d.ts} +1 -1
  175. package/dist/{router.d-C-JSFCPU.d.ts → router.d-BJVGhSAJ.d.ts} +1 -1
  176. package/dist/{router.d-CNUS3x1j.d.mts → router.d-hNedVdoB.d.mts} +1 -1
  177. package/dist/{routes.d-D7RWvfqL.d.ts → routes.d-CYe98R_8.d.ts} +1 -1
  178. package/dist/{routes.d-BWvpUoYu.d.mts → routes.d-DBGnKaUQ.d.mts} +1 -1
  179. package/dist/routes.d.mts +4 -4
  180. package/dist/routes.d.ts +4 -4
  181. package/dist/{rsc-pipeline-UBWVU3NF.cjs → rsc-pipeline-HT4G3QGT.cjs} +7 -6
  182. package/dist/{rsc-pipeline-DHISDFT7.mjs → rsc-pipeline-NCJ3NIE5.mjs} +6 -5
  183. package/dist/{runtime-XKRQW3YT.cjs → runtime-6UF5XKUP.cjs} +4 -4
  184. package/dist/{runtime-VUKMY44G.mjs → runtime-VHXIEXL7.mjs} +2 -2
  185. package/dist/{runtime.d-B2T4bM5_.d.ts → runtime.d-0R8nHCM6.d.ts} +1 -1
  186. package/dist/{runtime.d-CsOpO6yQ.d.mts → runtime.d-DpeuF_T-.d.mts} +1 -1
  187. package/dist/{cli-runtime.d-LwIb0swO.d.mts → schema-dependencies.d-_Wyey4Wv.d.mts} +21 -13
  188. package/dist/{cli-runtime.d-Vvxf-Z8a.d.ts → schema-dependencies.d-tkUHREqz.d.ts} +21 -13
  189. package/dist/{schema.d-BM-uVGpx.d.mts → schema.d-HlGSe1on.d.mts} +1 -1
  190. package/dist/{schema.d-BM-uVGpx.d.ts → schema.d-HlGSe1on.d.ts} +1 -1
  191. package/dist/schema.d.mts +1 -1
  192. package/dist/schema.d.ts +1 -1
  193. package/dist/{server-components-status.d-DOYt4E_Q.d.ts → server-components-status.d-B2Z5WvO5.d.ts} +2 -2
  194. package/dist/{server-components-status.d-Cc5rir0l.d.mts → server-components-status.d-sN7ju-ie.d.mts} +2 -2
  195. package/dist/server-plugins.d.mts +6 -6
  196. package/dist/server-plugins.d.ts +6 -6
  197. package/dist/server.cjs +43 -42
  198. package/dist/server.d.mts +14 -14
  199. package/dist/server.d.ts +14 -14
  200. package/dist/server.mjs +17 -16
  201. package/dist/{spa-router.d-Cq5UFJvq.d.mts → spa-router.d-D3AtR2Bc.d.mts} +2 -2
  202. package/dist/{spa-router.d-C7FcpLxU.d.ts → spa-router.d-MjT6sGb9.d.ts} +2 -2
  203. package/dist/{ssg.d-BzNZemk7.d.mts → ssg.d-B32Cp_XW.d.mts} +3 -3
  204. package/dist/{ssg.d-DUhacIxj.d.ts → ssg.d-C1SNuPz5.d.ts} +3 -3
  205. package/dist/storage.d.mts +2 -2
  206. package/dist/storage.d.ts +2 -2
  207. package/dist/{store-core.d-BX3yXrxA.d.ts → store-core.d-BZ3YXs70.d.ts} +2 -2
  208. package/dist/{store-core.d-DbUAtSBK.d.mts → store-core.d-BbVdaoA0.d.mts} +2 -2
  209. package/dist/testing.cjs +2 -2
  210. package/dist/testing.d.mts +4 -4
  211. package/dist/testing.d.ts +4 -4
  212. package/dist/testing.mjs +2 -2
  213. package/dist/{types.d-C5hlNbHa.d.mts → types.d-CRiwa0jj.d.mts} +1 -1
  214. package/dist/{types.d-C5hlNbHa.d.ts → types.d-CRiwa0jj.d.ts} +1 -1
  215. package/dist/{utils.d-BhJJEXzo.d.ts → utils.d-Bjbm44fP.d.ts} +1 -1
  216. package/dist/{utils.d-NOMkLFpC.d.mts → utils.d-CoLozp7-.d.mts} +1 -1
  217. package/dist/version.cjs +2 -2
  218. package/dist/version.mjs +1 -1
  219. package/dist/vite.cjs +16 -15
  220. package/dist/vite.d.mts +9 -9
  221. package/dist/vite.d.ts +9 -9
  222. package/dist/vite.mjs +15 -14
  223. package/package.json +1 -1
  224. package/dist/analyzer-ZFC2L6NZ.cjs +0 -17
  225. package/dist/chunk-OZAVCLXY.mjs +0 -17
  226. /package/dist/{chunk-OAAVIFOJ.cjs → chunk-COXMHCIV.cjs} +0 -0
  227. /package/dist/{chunk-ZRTBDHO2.mjs → chunk-JL2HNLMC.mjs} +0 -0
@@ -3,7 +3,9 @@
3
3
  var _chunkB6JPBPBQcjs = require('./chunk-B6JPBPBQ.cjs');
4
4
 
5
5
 
6
- var _chunkMNBFSAWFcjs = require('./chunk-MNBFSAWF.cjs');
6
+
7
+
8
+ var _chunkYCGOQKVCcjs = require('./chunk-YCGOQKVC.cjs');
7
9
 
8
10
 
9
11
  var _chunkSGBEJBBBcjs = require('./chunk-SGBEJBBB.cjs');
@@ -19,16 +21,45 @@ var _module = require('module');
19
21
  var _path = require('path');
20
22
  var _esmodulelexer = require('es-module-lexer');
21
23
  var moduleLexerInitialized = false;
24
+ var HTTP_METHODS = ["GET", "HEAD", "QUERY", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"];
22
25
  var JSX_ROUTE_LANGS = { ".jsx": "jsx", ".tsx": "tsx" };
23
- var oxcTransformSync;
24
- function transformJSXRoute(content, lang, filePath) {
25
- _nullishCoalesce(oxcTransformSync, () => ( (oxcTransformSync = _module.createRequire.call(void 0, typeof __filename === "string" ? __filename : _chunkUGL4BDNBcjs.define_import_meta_default.url)(
26
+ var oxcUtils;
27
+ function loadOxcUtils() {
28
+ return _nullishCoalesce(oxcUtils, () => ( (oxcUtils = _module.createRequire.call(void 0, typeof __filename === "string" ? __filename : _chunkUGL4BDNBcjs.define_import_meta_default.url)(
26
29
  "rolldown/utils"
27
- ).transformSync)));
28
- const result = oxcTransformSync(filePath, content, { lang, sourceType: "module" });
30
+ ))));
31
+ }
32
+ function transformJSXRoute(content, lang, filePath) {
33
+ const result = loadOxcUtils().transformSync(filePath, content, { lang, sourceType: "module" });
29
34
  if (result.errors.length > 0) throw result.errors[0];
30
35
  return result.code;
31
36
  }
37
+ function extractDeclaredMethods(content, filePath) {
38
+ const { program, errors } = loadOxcUtils().parseSync(filePath, content, { lang: "dts" });
39
+ if (errors.length > 0) throw new Error(`${filePath}: ${errors[0].message}`);
40
+ const names = /* @__PURE__ */ new Set();
41
+ for (const statement of program.body) {
42
+ if (statement.type !== "ExportNamedDeclaration") continue;
43
+ const declaration = statement.declaration;
44
+ if (_optionalChain([declaration, 'optionalAccess', _ => _.type]) === "VariableDeclaration") {
45
+ for (const declarator of declaration.declarations) {
46
+ if (declarator.id.type === "Identifier") names.add(declarator.id.name);
47
+ }
48
+ } else if ((_optionalChain([declaration, 'optionalAccess', _2 => _2.type]) === "FunctionDeclaration" || _optionalChain([declaration, 'optionalAccess', _3 => _3.type]) === "TSDeclareFunction") && declaration.id) {
49
+ names.add(declaration.id.name);
50
+ } else if (!declaration && statement.exportKind !== "type") {
51
+ for (const specifier of statement.specifiers) {
52
+ if (specifier.exportKind === "type") continue;
53
+ const exported = specifier.exported;
54
+ names.add(exported.type === "Literal" ? String(exported.value) : exported.name);
55
+ }
56
+ }
57
+ }
58
+ return HTTP_METHODS.filter((method) => names.has(method));
59
+ }
60
+ function isFile(filePath) {
61
+ return _optionalChain([_fs.statSync.call(void 0, filePath, { throwIfNoEntry: false }), 'optionalAccess', _4 => _4.isFile, 'call', _5 => _5()]) === true;
62
+ }
32
63
  var API_CLIENT_METHOD_SEGMENTS = /* @__PURE__ */ new Set([
33
64
  "get",
34
65
  "head",
@@ -40,8 +71,9 @@ var API_CLIENT_METHOD_SEGMENTS = /* @__PURE__ */ new Set([
40
71
  "options"
41
72
  ]);
42
73
  var APITypeGenerator = class {
43
- constructor(appDir) {
74
+ constructor(appDir, options = {}) {
44
75
  this.appDirs = Array.isArray(appDir) ? [...appDir] : [appDir];
76
+ this.polyroute = options.polyroute === true;
45
77
  }
46
78
  /**
47
79
  * Scan all API route files and extract route information
@@ -89,7 +121,7 @@ var APITypeGenerator = class {
89
121
  if (item.isDirectory()) {
90
122
  const newBasePath = basePath ? `${basePath}/${item.name}` : item.name;
91
123
  this.scanDirectory(fullPath, appDir, routes, newBasePath);
92
- } else if (_chunkMNBFSAWFcjs.isFarmAPIRouteFileName.call(void 0, item.name)) {
124
+ } else if (_chunkYCGOQKVCcjs.isFarmAPIRouteFileName.call(void 0, item.name, this.polyroute)) {
93
125
  const routeInfo = this.extractRouteInfo(fullPath, appDir, basePath);
94
126
  if (routeInfo) {
95
127
  routes.push(routeInfo);
@@ -98,14 +130,44 @@ var APITypeGenerator = class {
98
130
  }
99
131
  }
100
132
  extractRouteInfo(filePath, appDir, basePath) {
133
+ const relativePath = _path.relative.call(void 0, appDir, filePath);
134
+ const apiPath = basePath ? `/api/${basePath}` : "/api";
135
+ const fileName = _path.basename.call(void 0, filePath);
136
+ if (_chunkYCGOQKVCcjs.isPolyrouteRouteFileName.call(void 0, fileName)) {
137
+ const declarationPath = _path.join.call(void 0,
138
+ _path.dirname.call(void 0, filePath),
139
+ _chunkYCGOQKVCcjs.getPolyrouteRouteDeclarationFileName.call(void 0, fileName)
140
+ );
141
+ if (!isFile(declarationPath)) {
142
+ return { path: apiPath, methods: [...HTTP_METHODS], filePath, relativePath };
143
+ }
144
+ try {
145
+ const methods = extractDeclaredMethods(
146
+ _fs.readFileSync.call(void 0, declarationPath, "utf-8"),
147
+ declarationPath
148
+ );
149
+ if (methods.length === 0) return null;
150
+ return {
151
+ path: apiPath,
152
+ methods,
153
+ filePath,
154
+ relativePath,
155
+ declaration: {
156
+ filePath: declarationPath,
157
+ relativePath: _path.relative.call(void 0, appDir, declarationPath)
158
+ }
159
+ };
160
+ } catch (error) {
161
+ console.warn(`Failed to read route declaration ${declarationPath}:`, error);
162
+ return null;
163
+ }
164
+ }
101
165
  try {
102
166
  const content = _fs.readFileSync.call(void 0, filePath, "utf-8");
103
167
  const methods = this.extractExportedMethods(content, filePath);
104
168
  if (methods.length === 0) {
105
169
  return null;
106
170
  }
107
- const relativePath = _path.relative.call(void 0, appDir, filePath);
108
- const apiPath = basePath ? `/api/${basePath}` : "/api";
109
171
  return {
110
172
  path: apiPath,
111
173
  methods,
@@ -122,7 +184,7 @@ var APITypeGenerator = class {
122
184
  _esmodulelexer.initSync.call(void 0, );
123
185
  moduleLexerInitialized = true;
124
186
  }
125
- const httpMethods = ["GET", "HEAD", "QUERY", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"];
187
+ const httpMethods = HTTP_METHODS;
126
188
  const lang = JSX_ROUTE_LANGS[_path.extname.call(void 0, filePath)];
127
189
  const source = lang ? transformJSXRoute(content, lang, filePath) : content;
128
190
  const [, exports] = _esmodulelexer.parse.call(void 0, source);
@@ -159,9 +221,10 @@ var APITypeGenerator = class {
159
221
  */
160
222
  generateAPIRouter(routes, options = {}) {
161
223
  const imports = [];
224
+ const coreAPITypes = [];
162
225
  const pluginTypes = [];
163
- if (_optionalChain([options, 'access', _ => _.pluginConfigs, 'optionalAccess', _2 => _2.length])) {
164
- imports.push('import type { PluginAPIRouter } from "@farm.js/core/api";');
226
+ if (_optionalChain([options, 'access', _6 => _6.pluginConfigs, 'optionalAccess', _7 => _7.length])) {
227
+ coreAPITypes.push("PluginAPIRouter");
165
228
  options.pluginConfigs.forEach((filePath, index) => {
166
229
  const importPath = this.getRouteImportPath({ filePath }, options.outFile);
167
230
  imports.push(`import type FarmPluginConfig${index} from ${JSON.stringify(importPath)};`);
@@ -202,25 +265,31 @@ var APITypeGenerator = class {
202
265
  for (const method of route.methods) methodSources.set(method, route);
203
266
  }
204
267
  const allMethods = [...methodSources.keys()];
268
+ const methodTypes = /* @__PURE__ */ new Map();
205
269
  for (const method of allMethods) {
206
- const importPath = this.getRouteImportPath(methodSources.get(method), options.outFile);
270
+ const source = methodSources.get(method);
271
+ if (!source.declaration && _chunkYCGOQKVCcjs.isPolyrouteRouteFileName.call(void 0, _path.basename.call(void 0, source.filePath))) {
272
+ if (!coreAPITypes.includes("TypedEndpoint")) coreAPITypes.push("TypedEndpoint");
273
+ methodTypes.set(method, "TypedEndpoint<any, any>");
274
+ continue;
275
+ }
276
+ const importPath = this.getRouteImportPath(_nullishCoalesce(source.declaration, () => ( source)), options.outFile);
207
277
  const importName = `${method}_${routeName}`;
208
278
  imports.push(
209
279
  `import type { ${method} as ${importName} } from ${JSON.stringify(importPath)};`
210
280
  );
281
+ methodTypes.set(method, `typeof ${importName}`);
211
282
  }
212
283
  if (parts.length === 0) {
213
284
  for (const method of allMethods) {
214
- const importName = `${method}_${routeName}`;
215
- const methodName = method.toLowerCase();
216
- nestedStructure[methodName] = `typeof ${importName}`;
285
+ nestedStructure[method.toLowerCase()] = methodTypes.get(method);
217
286
  }
218
287
  } else {
219
288
  const hasMethodCollision = parts.some((part, index) => {
220
289
  if (part === "$params" || index === 0 && part === "integrations") return true;
221
290
  if (!API_CLIENT_METHOD_SEGMENTS.has(part)) return false;
222
291
  const parentPath = parts.slice(0, index).join("/");
223
- return _optionalChain([routeMethodsByPath, 'access', _3 => _3.get, 'call', _4 => _4(parentPath), 'optionalAccess', _5 => _5.has, 'call', _6 => _6(part)]) === true;
292
+ return _optionalChain([routeMethodsByPath, 'access', _8 => _8.get, 'call', _9 => _9(parentPath), 'optionalAccess', _10 => _10.has, 'call', _11 => _11(part)]) === true;
224
293
  });
225
294
  const typePath = hasMethodCollision ? [`/${cleanPath}`] : parts;
226
295
  let current = nestedStructure;
@@ -229,9 +298,7 @@ var APITypeGenerator = class {
229
298
  if (i === typePath.length - 1) {
230
299
  current[part] = createRouteTreeNode();
231
300
  for (const method of allMethods) {
232
- const importName = `${method}_${routeName}`;
233
- const methodName = method.toLowerCase();
234
- current[part][methodName] = `typeof ${importName}`;
301
+ current[part][method.toLowerCase()] = methodTypes.get(method);
235
302
  }
236
303
  } else {
237
304
  if (!Object.prototype.hasOwnProperty.call(current, part)) {
@@ -268,6 +335,9 @@ ${routeManifest.map(
268
335
  },`
269
336
  ).join("\n")}
270
337
  ]` : "[]";
338
+ if (coreAPITypes.length) {
339
+ imports.unshift(`import type { ${coreAPITypes.join(", ")} } from "@farm.js/core/api";`);
340
+ }
271
341
  return `/**
272
342
  * Auto-generated API router types
273
343
  * This file is automatically generated - do not edit manually
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-PZ5ZJAAO.mjs";
5
5
  import {
6
6
  APITypeGenerator
7
- } from "./chunk-KJW6KEOZ.mjs";
7
+ } from "./chunk-WRT775N6.mjs";
8
8
  import {
9
9
  getOptionalCatchAllParameterNames,
10
10
  materializeSSGRoutePath,
@@ -841,7 +841,7 @@ async function generateFarmTypeArtifacts(options) {
841
841
  }
842
842
  }
843
843
  if (shouldGenerateApi) {
844
- const generator = new APITypeGenerator(appDirs);
844
+ const generator = new APITypeGenerator(appDirs, { polyroute: options.polyroute });
845
845
  const apiRoutes = generator.scanAPIRoutes();
846
846
  const apiTypesPath = options.apiTypesOutFile ? resolve3(root, options.apiTypesOutFile) : join3(root, srcDir, "lib", "api.generated.ts");
847
847
  const pluginRoutes = resolvePluginRoutes(
@@ -7,7 +7,7 @@ var _chunkPRKFECGTcjs = require('./chunk-PRKFECGT.cjs');
7
7
 
8
8
 
9
9
 
10
- var _chunkMNBFSAWFcjs = require('./chunk-MNBFSAWF.cjs');
10
+ var _chunkYCGOQKVCcjs = require('./chunk-YCGOQKVC.cjs');
11
11
 
12
12
 
13
13
  var _chunkYCIFGYBYcjs = require('./chunk-YCIFGYBY.cjs');
@@ -142,7 +142,7 @@ var APIRouteManager = class _APIRouteManager {
142
142
  /**
143
143
  * Recursively find all route.ts files
144
144
  */
145
- findRouteFiles(dir, polyroute = _chunkMNBFSAWFcjs.hasPolyroutePlugin.call(void 0, _optionalChain([this, 'access', _ => _.viteServer, 'optionalAccess', _2 => _2.config, 'optionalAccess', _3 => _3.plugins]))) {
145
+ findRouteFiles(dir, polyroute = _chunkYCGOQKVCcjs.hasPolyroutePlugin.call(void 0, _optionalChain([this, 'access', _ => _.viteServer, 'optionalAccess', _2 => _2.config, 'optionalAccess', _3 => _3.plugins]))) {
146
146
  const files = [];
147
147
  if (!fs.existsSync(dir)) {
148
148
  return files;
@@ -152,7 +152,7 @@ var APIRouteManager = class _APIRouteManager {
152
152
  const fullPath = path.join(dir, entry.name);
153
153
  if (entry.isDirectory()) {
154
154
  files.push(...this.findRouteFiles(fullPath, polyroute));
155
- } else if (_chunkMNBFSAWFcjs.isFarmAPIRouteFileName.call(void 0, entry.name, polyroute)) {
155
+ } else if (_chunkYCGOQKVCcjs.isFarmAPIRouteFileName.call(void 0, entry.name, polyroute)) {
156
156
  files.push(fullPath);
157
157
  }
158
158
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
3
 
4
- var _chunkLGL5QKUJcjs = require('./chunk-LGL5QKUJ.cjs');
4
+ var _chunkJM5VSEYCcjs = require('./chunk-JM5VSEYC.cjs');
5
5
 
6
6
 
7
7
  var _chunk7O3YJ6NPcjs = require('./chunk-7O3YJ6NP.cjs');
@@ -68,7 +68,7 @@ function findFarmNativeScreenFiles(appDirs) {
68
68
  }
69
69
  function collectFarmNativeServerFns(options) {
70
70
  const { root, srcDir } = options;
71
- const aliases = _chunkLGL5QKUJcjs.readAliases.call(void 0, root, srcDir);
71
+ const aliases = _chunkJM5VSEYCcjs.readAliases.call(void 0, root, srcDir);
72
72
  const seen = /* @__PURE__ */ new Set();
73
73
  const found = /* @__PURE__ */ new Map();
74
74
  const queue = [...options.entries];
@@ -102,7 +102,7 @@ function collectFarmNativeServerFns(options) {
102
102
  }
103
103
  }
104
104
  for (const candidate of _nullishCoalesce(candidates, () => ( []))) {
105
- const resolved = _chunkLGL5QKUJcjs.resolveFile.call(void 0, candidate);
105
+ const resolved = _chunkJM5VSEYCcjs.resolveFile.call(void 0, candidate);
106
106
  if (resolved && SCRIPT.test(resolved) && !resolved.includes(`${_path2.default.sep}node_modules${_path2.default.sep}`)) {
107
107
  queue.push(resolved);
108
108
  break;
@@ -2,7 +2,7 @@ import {
2
2
  createFarmReactRefreshPlugins,
3
3
  farmDesktopDevGuardPlugin,
4
4
  isFarmReactRefreshActive
5
- } from "./chunk-DVL3UVYT.mjs";
5
+ } from "./chunk-6XABTMXR.mjs";
6
6
  import {
7
7
  _listFarmRegisteredMCPServerTools,
8
8
  _observeFarmRegisteredMCPResponse,
@@ -44,25 +44,25 @@ import {
44
44
  resolveFarmIslxActionsMode,
45
45
  resolveFarmRouteRootStrategy,
46
46
  toBakedMarkdownSourcePath
47
- } from "./chunk-RDT2LJES.mjs";
47
+ } from "./chunk-MEXGQE4T.mjs";
48
48
  import {
49
49
  generateFarmClientPluginEntryCode,
50
50
  hasFarmServerRuntimePlugins,
51
51
  loadTailwindVitePlugin
52
- } from "./chunk-V36K4TSU.mjs";
52
+ } from "./chunk-ADKPJZPP.mjs";
53
53
  import {
54
54
  FARM_NODE_RESPONSE_END_PENDING
55
55
  } from "./chunk-6IKUYFNQ.mjs";
56
56
  import {
57
57
  resolveFarmPlatform
58
- } from "./chunk-LO5BNR6Y.mjs";
58
+ } from "./chunk-W5T3ZAFU.mjs";
59
59
  import {
60
60
  generateFarmTypeArtifacts,
61
61
  resolveRouteRenderingConfig
62
- } from "./chunk-MLMDOIBY.mjs";
62
+ } from "./chunk-CZMMU3FP.mjs";
63
63
  import {
64
64
  _setFarmInfraAnalyticsWebMCPRoute
65
- } from "./chunk-D7KBMJ7L.mjs";
65
+ } from "./chunk-ST3U7XVO.mjs";
66
66
  import {
67
67
  createFarmRouteRenderPlan,
68
68
  farmPathGuardCoversEndpoint,
@@ -89,13 +89,13 @@ import {
89
89
  resolveFarmMCPRouteLabel,
90
90
  resolveFarmMarkdownRouteLabel,
91
91
  setFarmRouteLabel
92
- } from "./chunk-ZF7N222A.mjs";
92
+ } from "./chunk-IEXZMDF4.mjs";
93
93
  import {
94
94
  FARM_DEFAULT_MCP_PATH
95
95
  } from "./chunk-WABOJXAA.mjs";
96
96
  import {
97
97
  isFarmPreviewDeploymentEnvironment
98
- } from "./chunk-GK2RCRT2.mjs";
98
+ } from "./chunk-NPR6SCEV.mjs";
99
99
  import {
100
100
  createFarmServerFnBoundaryModule,
101
101
  isFarmServerFnBoundaryId,
@@ -148,7 +148,7 @@ import {
148
148
  usePackageScanCacheFile,
149
149
  withFarmSourceSnapshotOf,
150
150
  wrapFarmIslandContainers
151
- } from "./chunk-RP55BUJM.mjs";
151
+ } from "./chunk-ZVT2F3JU.mjs";
152
152
  import {
153
153
  generateFarmDocsAdapterClientRuntime,
154
154
  getFarmDocsAdapterConfigModule
@@ -253,11 +253,12 @@ import {
253
253
  } from "./chunk-IYEY3JWJ.mjs";
254
254
  import {
255
255
  APIRouteManager
256
- } from "./chunk-WOPQQCP3.mjs";
256
+ } from "./chunk-CPL7WIMP.mjs";
257
257
  import {
258
258
  hasPolyroutePlugin,
259
- isFarmAPIRouteFileName
260
- } from "./chunk-OZAVCLXY.mjs";
259
+ isFarmAPIRouteFileName,
260
+ isPolyrouteRouteDeclarationFileName
261
+ } from "./chunk-O77EKGAS.mjs";
261
262
  import {
262
263
  getFarmI18nClientSnapshot
263
264
  } from "./chunk-O7JEFGUV.mjs";
@@ -320,7 +321,7 @@ import {
320
321
  } from "./chunk-EILUVBKS.mjs";
321
322
  import {
322
323
  FARM_VERSION
323
- } from "./chunk-MEIZIRMK.mjs";
324
+ } from "./chunk-6VMBLDWY.mjs";
324
325
  import {
325
326
  DEFAULT_FARM_API_BASE_PATH
326
327
  } from "./chunk-W6QLRQ3V.mjs";
@@ -1296,13 +1297,13 @@ function loadFarmDocsSearchDevRuntime() {
1296
1297
  return import("./search-client-HN3ZY6AK.mjs");
1297
1298
  }
1298
1299
  function loadFarmOpenAPIDevRuntime() {
1299
- return import("./manager-EFPBRS3U.mjs");
1300
+ return import("./manager-YTJOAHII.mjs");
1300
1301
  }
1301
1302
  function loadFarmWorkflowsDevRuntime() {
1302
1303
  return import("./workflows.mjs");
1303
1304
  }
1304
1305
  function loadFarmDevtoolsSnapshotRuntime() {
1305
- return import("./devtools-R77KAJA4.mjs");
1306
+ return import("./devtools-RFVGDHXH.mjs");
1306
1307
  }
1307
1308
  function loadFarmDevtoolsUIRuntime() {
1308
1309
  return import("./devtools-ui-UYEVDADD.mjs");
@@ -2031,7 +2032,9 @@ function isResolvedEnvScope(value) {
2031
2032
  );
2032
2033
  }
2033
2034
  function isPotentialProgrammaticRouteSourceFile(normalizedFile, srcDirSlug) {
2034
- return normalizedFile.startsWith(`${srcDirSlug}/`) && /\.(ts|tsx|js|jsx)$/.test(normalizedFile) && !normalizedFile.endsWith(".d.ts") && !normalizedFile.endsWith("/farm-routes.d.ts") && !normalizedFile.endsWith("/farm-env.d.ts") && !normalizedFile.endsWith("/lib/api.generated.ts");
2035
+ return normalizedFile.startsWith(`${srcDirSlug}/`) && /\.(ts|tsx|js|jsx)$/.test(normalizedFile) && // A declaration file, including TypeScript's `.d.<ext>.ts` form such as a
2036
+ // Polyroute `route.d.rs.ts`, has no runtime code to register a route.
2037
+ !/\.d(\.[^./]+)?\.ts$/.test(normalizedFile) && !normalizedFile.endsWith("/farm-routes.d.ts") && !normalizedFile.endsWith("/farm-env.d.ts") && !normalizedFile.endsWith("/lib/api.generated.ts");
2035
2038
  }
2036
2039
  function fileContainsProgrammaticPageRoute(file) {
2037
2040
  if (!fs2.existsSync(file)) {
@@ -2347,6 +2350,11 @@ function toFarmRuntimeModuleId(specifier) {
2347
2350
  function getFarmCoreFile() {
2348
2351
  return typeof __filename === "string" ? __filename : fileURLToPath(import.meta.url);
2349
2352
  }
2353
+ var farmCoreModuleDirectory;
2354
+ function isFarmCoreModule(id) {
2355
+ farmCoreModuleDirectory ?? (farmCoreModuleDirectory = `${toPosixPath(path6.dirname(getFarmCoreFile()))}/`);
2356
+ return toPosixPath(id.split("?", 1)[0]).startsWith(farmCoreModuleDirectory);
2357
+ }
2350
2358
  var FARM_SOURCE_ALIAS_PROBES = [
2351
2359
  "@/x",
2352
2360
  "@/index.ts",
@@ -2614,6 +2622,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2614
2622
  const appDirSlugs = sourceRoots.map(
2615
2623
  (source) => path6.join(source.root, source.srcDir, "app").replace(/\\/g, "/")
2616
2624
  );
2625
+ const polyroute = hasPolyroutePlugin(server.config.plugins);
2617
2626
  const generateTypeArtifacts = async (reason, selection = ALL_TYPE_ARTIFACTS, log = false) => {
2618
2627
  try {
2619
2628
  const result = await generateFarmTypeArtifacts({
@@ -2627,6 +2636,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2627
2636
  componentExtensions: farmConfig.renderer.componentExtensions,
2628
2637
  renderer: farmConfig.renderer,
2629
2638
  i18nConfig: farmConfig.i18n,
2639
+ polyroute,
2630
2640
  ...selection
2631
2641
  });
2632
2642
  if (log) {
@@ -2670,11 +2680,14 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2670
2680
  const match = /\/(?:page|layout|loading|error)(\.[^./]+)$/.exec(normalized);
2671
2681
  return appDirSlugs.some((appDir) => normalized.startsWith(`${appDir}/`)) && !!match && routeModuleExtensions.has(match[1].toLowerCase());
2672
2682
  };
2673
- const polyroute = hasPolyroutePlugin(server.config.plugins);
2674
2683
  const isApiRouteFile = (file) => {
2675
2684
  const normalized = file.replace(/\\/g, "/");
2676
2685
  return appDirSlugs.some((appDir) => normalized.startsWith(`${appDir}/api/`)) && isFarmAPIRouteFileName(path6.posix.basename(normalized), polyroute);
2677
2686
  };
2687
+ const isApiRouteDeclarationFile = (file) => {
2688
+ const normalized = file.replace(/\\/g, "/");
2689
+ return polyroute && appDirSlugs.some((appDir) => normalized.startsWith(`${appDir}/api/`)) && isPolyrouteRouteDeclarationFileName(path6.posix.basename(normalized));
2690
+ };
2678
2691
  const isProgrammaticRouteFile = (file) => {
2679
2692
  const normalized = file.replace(/\\/g, "/");
2680
2693
  return srcDirSlugs.some((srcDir) => normalized.startsWith(`${srcDir}/`)) && isProgrammaticRoutesFileName(normalized);
@@ -2724,7 +2737,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2724
2737
  const programmaticRouteChanged = isProgrammaticRouteFile(file) || isProgrammaticRouteSourceFile(file) && (ev === "unlink" || fileContainsProgrammaticPageRoute(file));
2725
2738
  const typeArtifacts = configChanged ? ALL_TYPE_ARTIFACTS : {
2726
2739
  routes: ev !== "change" && (isRouteModuleFile(file) || isRendererRouteFile(file)) || programmaticRouteChanged,
2727
- api: isApiRouteFile(file) || programmaticRouteChanged,
2740
+ api: isApiRouteFile(file) || isApiRouteDeclarationFile(file) || programmaticRouteChanged,
2728
2741
  env: false,
2729
2742
  images: false,
2730
2743
  i18n: isI18nCatalogFile(file)
@@ -5051,7 +5064,7 @@ export { manifest };
5051
5064
  const runtimeModule = !isBuild && transformOptions?.ssr === true && isOutsideAppRoot(id) ? toFarmRuntimeModuleId : void 0;
5052
5065
  const actionConfig = farmApp?.getConfig() ?? options;
5053
5066
  let rewrotePackageImports = false;
5054
- if (resolveFarmServerComponentsMode(readFarmServerComponentsConfig(actionConfig)) === "islands" && (!id.includes("/node_modules/") || transformOptions?.ssr === true && farmReactServerFiles.has(id.split("?", 1)[0])) && !id.startsWith("\0") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id) && !hasUseClientDirective(code)) {
5067
+ if (resolveFarmServerComponentsMode(readFarmServerComponentsConfig(actionConfig)) === "islands" && (!id.includes("/node_modules/") && !isFarmCoreModule(id) || transformOptions?.ssr === true && farmReactServerFiles.has(id.split("?", 1)[0])) && !id.startsWith("\0") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id) && !hasUseClientDirective(code)) {
5055
5068
  const file = id.split("?", 1)[0];
5056
5069
  const projectRoot = actionConfig.root || server?.config.root || process.cwd();
5057
5070
  const buildSnapshot = isBuild ? options.sourceSnapshot : void 0;
@@ -0,0 +1,21 @@
1
+ // src/desktop/permissions.ts
2
+ var FARM_DESKTOP_PERMISSIONS = [
3
+ "microphone",
4
+ "camera",
5
+ "location",
6
+ "speechRecognition",
7
+ "bluetooth",
8
+ "contacts",
9
+ "calendars",
10
+ "reminders",
11
+ "photos",
12
+ "music",
13
+ "motion",
14
+ "documents",
15
+ "downloads",
16
+ "desktop"
17
+ ];
18
+
19
+ export {
20
+ FARM_DESKTOP_PERMISSIONS
21
+ };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  readAliases,
3
3
  resolveFile
4
- } from "./chunk-ZVEKOMZS.mjs";
4
+ } from "./chunk-ALGAGXWB.mjs";
5
5
  import {
6
6
  transformFarmServerFns
7
7
  } from "./chunk-GNZIAJGB.mjs";
@@ -4,7 +4,7 @@
4
4
  var _chunkWXPY5FRFcjs = require('./chunk-WXPY5FRF.cjs');
5
5
 
6
6
 
7
- var _chunkRMLXUVR5cjs = require('./chunk-RMLXUVR5.cjs');
7
+ var _chunkCS6GXE42cjs = require('./chunk-CS6GXE42.cjs');
8
8
 
9
9
 
10
10
 
@@ -850,7 +850,7 @@ async function generateFarmTypeArtifacts(options) {
850
850
  }
851
851
  }
852
852
  if (shouldGenerateApi) {
853
- const generator = new (0, _chunkRMLXUVR5cjs.APITypeGenerator)(appDirs);
853
+ const generator = new (0, _chunkCS6GXE42cjs.APITypeGenerator)(appDirs, { polyroute: options.polyroute });
854
854
  const apiRoutes = generator.scanAPIRoutes();
855
855
  const apiTypesPath = options.apiTypesOutFile ? _path.resolve.call(void 0, root, options.apiTypesOutFile) : _path.join.call(void 0, root, srcDir, "lib", "api.generated.ts");
856
856
  const pluginRoutes = _chunk4JCX33RZcjs.resolvePluginRoutes.call(void 0,
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-WABOJXAA.mjs";
5
5
  import {
6
6
  normalizeFarmProductionSiteOrigin
7
- } from "./chunk-GK2RCRT2.mjs";
7
+ } from "./chunk-NPR6SCEV.mjs";
8
8
  import {
9
9
  resolveFarmAppManifestConfig
10
10
  } from "./chunk-SQ5O7I3L.mjs";
@@ -29,7 +29,7 @@ import {
29
29
  } from "./chunk-YT2ZMLXK.mjs";
30
30
  import {
31
31
  FARM_VERSION
32
- } from "./chunk-MEIZIRMK.mjs";
32
+ } from "./chunk-6VMBLDWY.mjs";
33
33
  import {
34
34
  applyFarmBasePath
35
35
  } from "./chunk-SF3JB56B.mjs";
@@ -18,7 +18,7 @@ import {
18
18
  } from "./chunk-LRPPXKCX.mjs";
19
19
  import {
20
20
  resolveDocsConfig
21
- } from "./chunk-ZRTBDHO2.mjs";
21
+ } from "./chunk-JL2HNLMC.mjs";
22
22
  import {
23
23
  getFarmDocsAdapterConfigModule,
24
24
  isSecretDocsConfigKey
@@ -18,7 +18,7 @@ var _chunkBRWSQDKOcjs = require('./chunk-BRWSQDKO.cjs');
18
18
  var _chunkJ3RIMCBDcjs = require('./chunk-J3RIMCBD.cjs');
19
19
 
20
20
 
21
- var _chunkZ7YIQ7AJcjs = require('./chunk-Z7YIQ7AJ.cjs');
21
+ var _chunkA4AYTO2Ecjs = require('./chunk-A4AYTO2E.cjs');
22
22
 
23
23
 
24
24
  var _chunkUGL4BDNBcjs = require('./chunk-UGL4BDNB.cjs');
@@ -29,7 +29,7 @@ var _crypto = require('crypto');
29
29
  var _fs = require('fs');
30
30
  var _promises = require('fs/promises');
31
31
  var _path = require('path'); var path = _interopRequireWildcard(_path);
32
- var ANALYZER_VERSION = `8:${_chunkZ7YIQ7AJcjs.FARM_VERSION}`;
32
+ var ANALYZER_VERSION = `8:${_chunkA4AYTO2Ecjs.FARM_VERSION}`;
33
33
  var INTRINSIC_KINDS = {};
34
34
  for (const tag of "div section main article header footer nav aside figure hr li".split(" ")) {
35
35
  INTRINSIC_KINDS[tag] = "View";
@@ -4,7 +4,7 @@
4
4
  var _chunkR6GOH5CHcjs = require('./chunk-R6GOH5CH.cjs');
5
5
 
6
6
 
7
- var _chunkMUQP2APNcjs = require('./chunk-MUQP2APN.cjs');
7
+ var _chunk2T4GGCQTcjs = require('./chunk-2T4GGCQT.cjs');
8
8
 
9
9
 
10
10
  var _chunk6QCZWAGOcjs = require('./chunk-6QCZWAGO.cjs');
@@ -29,7 +29,7 @@ var _chunkH5AC3XSEcjs = require('./chunk-H5AC3XSE.cjs');
29
29
  var _chunk7GKZDRY2cjs = require('./chunk-7GKZDRY2.cjs');
30
30
 
31
31
 
32
- var _chunkZ7YIQ7AJcjs = require('./chunk-Z7YIQ7AJ.cjs');
32
+ var _chunkA4AYTO2Ecjs = require('./chunk-A4AYTO2E.cjs');
33
33
 
34
34
 
35
35
  var _chunkTFCBJFP7cjs = require('./chunk-TFCBJFP7.cjs');
@@ -294,7 +294,7 @@ function createFarmAppManifest(input, registered = []) {
294
294
  return {
295
295
  schemaVersion: 1,
296
296
  app: app ? {
297
- ...app.version ? { farm: _chunkZ7YIQ7AJcjs.FARM_VERSION } : {},
297
+ ...app.version ? { farm: _chunkA4AYTO2Ecjs.FARM_VERSION } : {},
298
298
  ...app.renderer ? { renderer: input.renderer } : {},
299
299
  basePath: input.basePath,
300
300
  ...app.build ? { build: input.build } : {}
@@ -325,7 +325,7 @@ function resolveFarmSiteUrl() {
325
325
  asUrl(read("RAILWAY_PUBLIC_DOMAIN"))
326
326
  ];
327
327
  for (const candidate of candidates) {
328
- const origin = candidate ? _chunkMUQP2APNcjs.normalizeFarmProductionSiteOrigin.call(void 0, candidate) : void 0;
328
+ const origin = candidate ? _chunk2T4GGCQTcjs.normalizeFarmProductionSiteOrigin.call(void 0, candidate) : void 0;
329
329
  if (origin) return origin;
330
330
  }
331
331
  return null;
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  resolveFarmAppClientEntry,
3
3
  resolveFarmClientPlugins
4
- } from "./chunk-V36K4TSU.mjs";
4
+ } from "./chunk-ADKPJZPP.mjs";
5
5
  import {
6
6
  resolveFarmPlatform
7
- } from "./chunk-LO5BNR6Y.mjs";
7
+ } from "./chunk-W5T3ZAFU.mjs";
8
8
  import {
9
9
  collectSSGPages,
10
10
  matchSSGPage,
11
11
  resolveRouteRenderingConfigFromFile
12
- } from "./chunk-MLMDOIBY.mjs";
12
+ } from "./chunk-CZMMU3FP.mjs";
13
13
  import {
14
14
  resolveFarmRendererRoutes
15
15
  } from "./chunk-PZ5ZJAAO.mjs";
@@ -59,7 +59,7 @@ import {
59
59
  } from "./chunk-LP6DIYGA.mjs";
60
60
  import {
61
61
  listFarmMCPLlmsTxtLinks
62
- } from "./chunk-ZF7N222A.mjs";
62
+ } from "./chunk-IEXZMDF4.mjs";
63
63
  import {
64
64
  FARM_DEFAULT_MCP_PATH,
65
65
  collectFarmDefaultMCPPages,
@@ -108,7 +108,7 @@ import {
108
108
  usesFarmServerTree,
109
109
  withFarmSourceSnapshot,
110
110
  withFarmSourceSnapshotAside
111
- } from "./chunk-RP55BUJM.mjs";
111
+ } from "./chunk-ZVT2F3JU.mjs";
112
112
  import {
113
113
  _setDefaultFarmThemeConfig,
114
114
  getTheme
@@ -312,7 +312,7 @@ import {
312
312
  } from "./chunk-EILUVBKS.mjs";
313
313
  import {
314
314
  FARM_VERSION
315
- } from "./chunk-MEIZIRMK.mjs";
315
+ } from "./chunk-6VMBLDWY.mjs";
316
316
  import {
317
317
  normalizeFarmAPIConfig
318
318
  } from "./chunk-W6QLRQ3V.mjs";
@@ -9,14 +9,14 @@ import {
9
9
  } from "./chunk-IYEY3JWJ.mjs";
10
10
  import {
11
11
  APIRouteConflictError
12
- } from "./chunk-WOPQQCP3.mjs";
12
+ } from "./chunk-CPL7WIMP.mjs";
13
13
  import {
14
14
  findProgrammaticRouteFilesInDir
15
15
  } from "./chunk-LQZXCSYG.mjs";
16
16
  import {
17
17
  hasPolyroutePlugin,
18
18
  isFarmAPIRouteFileName
19
- } from "./chunk-OZAVCLXY.mjs";
19
+ } from "./chunk-O77EKGAS.mjs";
20
20
  import {
21
21
  API_ROUTE_METHODS,
22
22
  FARM_INTERNAL_SERVER_ERROR_BODY,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  FARM_VERSION
3
- } from "./chunk-MEIZIRMK.mjs";
3
+ } from "./chunk-6VMBLDWY.mjs";
4
4
 
5
5
  // src/deployment-environment.ts
6
6
  function isFarmProductionDeploymentEnvironment(env = process.env) {