@farm.js/core 0.1.0-beta.11 → 0.1.0-beta.13

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 (237) hide show
  1. package/dist/{chunk-5EVQFRL2.mjs → chunk-3WIRO3N7.mjs} +2 -2
  2. package/dist/chunk-3WIRO3N7.mjs.map +1 -0
  3. package/dist/chunk-53MVSX3R.mjs +168 -0
  4. package/dist/chunk-53MVSX3R.mjs.map +1 -0
  5. package/dist/{chunk-AW6I64AP.mjs → chunk-6ZXIQSXE.mjs} +16 -1
  6. package/dist/chunk-6ZXIQSXE.mjs.map +1 -0
  7. package/dist/chunk-7ZVN3YZI.mjs +333 -0
  8. package/dist/chunk-7ZVN3YZI.mjs.map +1 -0
  9. package/dist/{chunk-7N62DNSO.mjs → chunk-H3TE3LOV.mjs} +2 -2
  10. package/dist/{chunk-QTZZ2ISQ.mjs → chunk-KLA67WKG.mjs} +1 -1
  11. package/dist/chunk-KLA67WKG.mjs.map +1 -0
  12. package/dist/{chunk-K5ZTUF22.mjs → chunk-L2PE36GQ.mjs} +7 -3
  13. package/dist/chunk-L2PE36GQ.mjs.map +1 -0
  14. package/dist/{chunk-4LND3PXF.mjs → chunk-OPHK6OJN.mjs} +513 -48
  15. package/dist/chunk-OPHK6OJN.mjs.map +1 -0
  16. package/dist/chunk-USLFXFFH.mjs +46 -0
  17. package/dist/chunk-USLFXFFH.mjs.map +1 -0
  18. package/dist/{chunk-4677KXB7.mjs → chunk-VSDZEB5M.mjs} +368 -103
  19. package/dist/chunk-VSDZEB5M.mjs.map +1 -0
  20. package/dist/{chunk-77BOAQHI.mjs → chunk-Z3YG4OZT.mjs} +725 -147
  21. package/dist/chunk-Z3YG4OZT.mjs.map +1 -0
  22. package/dist/client.cjs.map +1 -1
  23. package/dist/client.mjs +1 -1
  24. package/dist/{devtools-A22KUJZT.mjs → devtools-GAZ7F3KL.mjs} +4 -3
  25. package/dist/{devtools-A22KUJZT.mjs.map → devtools-GAZ7F3KL.mjs.map} +1 -1
  26. package/dist/docs.cjs +622 -124
  27. package/dist/docs.cjs.map +1 -1
  28. package/dist/docs.mjs +5 -3
  29. package/dist/font.cjs +19 -2
  30. package/dist/font.cjs.map +1 -1
  31. package/dist/font.mjs +7 -3
  32. package/dist/index.cjs +2206 -680
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/index.mjs +27 -19
  35. package/dist/index.mjs.map +1 -1
  36. package/dist/internal/build-runtime.cjs +2033 -516
  37. package/dist/internal/build-runtime.cjs.map +1 -1
  38. package/dist/internal/build-runtime.mjs +13 -10
  39. package/dist/internal/client-runtime.cjs +169 -2
  40. package/dist/internal/client-runtime.cjs.map +1 -1
  41. package/dist/internal/client-runtime.mjs +170 -2
  42. package/dist/internal/client-runtime.mjs.map +1 -1
  43. package/dist/internal/config-runtime.cjs +22 -0
  44. package/dist/internal/config-runtime.cjs.map +1 -1
  45. package/dist/internal/config-runtime.mjs +3 -2
  46. package/dist/internal/metadata-image-runtime.cjs +199 -0
  47. package/dist/internal/metadata-image-runtime.cjs.map +1 -0
  48. package/dist/internal/metadata-image-runtime.mjs +8 -0
  49. package/dist/internal/metadata-image-runtime.mjs.map +1 -0
  50. package/dist/internal/production-runtime.cjs +310 -0
  51. package/dist/internal/production-runtime.cjs.map +1 -1
  52. package/dist/internal/production-runtime.mjs +10 -0
  53. package/dist/internal/production-runtime.mjs.map +1 -1
  54. package/dist/navigation.cjs.map +1 -1
  55. package/dist/navigation.mjs +2 -2
  56. package/dist/plugin.cjs +1521 -339
  57. package/dist/plugin.cjs.map +1 -1
  58. package/dist/plugin.mjs +9 -5
  59. package/dist/server.cjs +1634 -410
  60. package/dist/server.cjs.map +1 -1
  61. package/dist/server.mjs +17 -19
  62. package/dist/server.mjs.map +1 -1
  63. package/dist/version.cjs +1 -1
  64. package/dist/version.cjs.map +1 -1
  65. package/dist/version.mjs +1 -1
  66. package/dist/vite.cjs +1575 -349
  67. package/dist/vite.cjs.map +1 -1
  68. package/dist/vite.mjs +9 -5
  69. package/package.json +10 -1
  70. package/dist/after.d.mts +0 -25
  71. package/dist/after.d.ts +0 -25
  72. package/dist/agent-runtime.d.mts +0 -94
  73. package/dist/agent-runtime.d.ts +0 -94
  74. package/dist/api/route-manager.d.mts +0 -66
  75. package/dist/api/route-manager.d.ts +0 -66
  76. package/dist/api/runtime.d.mts +0 -3
  77. package/dist/api/runtime.d.ts +0 -3
  78. package/dist/api.d.mts +0 -48
  79. package/dist/api.d.ts +0 -48
  80. package/dist/app-BNE2FoZ4.d.mts +0 -302
  81. package/dist/app-DRGUmJ3s.d.ts +0 -302
  82. package/dist/app-markdown.d.mts +0 -22
  83. package/dist/app-markdown.d.ts +0 -22
  84. package/dist/cache.d.mts +0 -192
  85. package/dist/cache.d.ts +0 -192
  86. package/dist/chunk-4677KXB7.mjs.map +0 -1
  87. package/dist/chunk-4LND3PXF.mjs.map +0 -1
  88. package/dist/chunk-5EVQFRL2.mjs.map +0 -1
  89. package/dist/chunk-77BOAQHI.mjs.map +0 -1
  90. package/dist/chunk-AW6I64AP.mjs.map +0 -1
  91. package/dist/chunk-K5ZTUF22.mjs.map +0 -1
  92. package/dist/chunk-QM746KUO.mjs +0 -56
  93. package/dist/chunk-QM746KUO.mjs.map +0 -1
  94. package/dist/chunk-QTZZ2ISQ.mjs.map +0 -1
  95. package/dist/client-BT1mFQas.d.mts +0 -447
  96. package/dist/client-Nn0q4eO4.d.ts +0 -447
  97. package/dist/client-cache-CIlyBlmx.d.ts +0 -6
  98. package/dist/client-cache-D-EZ7XVW.d.mts +0 -6
  99. package/dist/client-plugins-Bc5jHcNr.d.ts +0 -1927
  100. package/dist/client-plugins-jsk-ZLzJ.d.mts +0 -1927
  101. package/dist/client-plugins.d.mts +0 -22
  102. package/dist/client-plugins.d.ts +0 -22
  103. package/dist/client.d.mts +0 -447
  104. package/dist/client.d.ts +0 -447
  105. package/dist/config.d.mts +0 -29
  106. package/dist/config.d.ts +0 -29
  107. package/dist/cron.d.mts +0 -78
  108. package/dist/cron.d.ts +0 -78
  109. package/dist/deferred.d.mts +0 -42
  110. package/dist/deferred.d.ts +0 -42
  111. package/dist/deployment.d.mts +0 -34
  112. package/dist/deployment.d.ts +0 -34
  113. package/dist/docs.d.mts +0 -69
  114. package/dist/docs.d.ts +0 -69
  115. package/dist/env-types.d.mts +0 -12
  116. package/dist/env-types.d.ts +0 -12
  117. package/dist/env.d.mts +0 -45
  118. package/dist/env.d.ts +0 -45
  119. package/dist/environment/vite.d.mts +0 -22
  120. package/dist/environment/vite.d.ts +0 -22
  121. package/dist/environment.d.mts +0 -18
  122. package/dist/environment.d.ts +0 -18
  123. package/dist/font.d.mts +0 -70
  124. package/dist/font.d.ts +0 -70
  125. package/dist/headers.d.mts +0 -22
  126. package/dist/headers.d.ts +0 -22
  127. package/dist/i18n/client.d.mts +0 -32
  128. package/dist/i18n/client.d.ts +0 -32
  129. package/dist/i18n/index.d.mts +0 -20
  130. package/dist/i18n/index.d.ts +0 -20
  131. package/dist/i18n/server.d.mts +0 -30
  132. package/dist/i18n/server.d.ts +0 -30
  133. package/dist/image/server.d.mts +0 -37
  134. package/dist/image/server.d.ts +0 -37
  135. package/dist/image/sharp.d.mts +0 -7
  136. package/dist/image/sharp.d.ts +0 -7
  137. package/dist/image-config-Duob7wER.d.mts +0 -50
  138. package/dist/image-config-Duob7wER.d.ts +0 -50
  139. package/dist/image.d.mts +0 -39
  140. package/dist/image.d.ts +0 -39
  141. package/dist/index.d.mts +0 -455
  142. package/dist/index.d.ts +0 -455
  143. package/dist/integration-api-CHT2OKAf.d.mts +0 -93
  144. package/dist/integration-api-CHT2OKAf.d.ts +0 -93
  145. package/dist/integrations.d.mts +0 -22
  146. package/dist/integrations.d.ts +0 -22
  147. package/dist/internal/build-runtime.d.mts +0 -39
  148. package/dist/internal/build-runtime.d.ts +0 -39
  149. package/dist/internal/client-runtime.d.mts +0 -2
  150. package/dist/internal/client-runtime.d.ts +0 -2
  151. package/dist/internal/config-runtime.d.mts +0 -39
  152. package/dist/internal/config-runtime.d.ts +0 -39
  153. package/dist/internal/production-node-env.d.mts +0 -12
  154. package/dist/internal/production-node-env.d.ts +0 -12
  155. package/dist/internal/production-runtime.d.mts +0 -41
  156. package/dist/internal/production-runtime.d.ts +0 -41
  157. package/dist/markdown.d.mts +0 -60
  158. package/dist/markdown.d.ts +0 -60
  159. package/dist/metadata-7ffpT3jr.d.mts +0 -22
  160. package/dist/metadata-JHn-8eht.d.ts +0 -22
  161. package/dist/middleware.d.mts +0 -164
  162. package/dist/middleware.d.ts +0 -164
  163. package/dist/navigation-errors-Dvwpzaer.d.mts +0 -13
  164. package/dist/navigation-errors-Dvwpzaer.d.ts +0 -13
  165. package/dist/navigation.d.mts +0 -14
  166. package/dist/navigation.d.ts +0 -14
  167. package/dist/observability.d.mts +0 -335
  168. package/dist/observability.d.ts +0 -335
  169. package/dist/params-BALtrRim.d.ts +0 -15
  170. package/dist/params-ry-lxqmy.d.mts +0 -15
  171. package/dist/plugin-BJDf43dc.d.mts +0 -165
  172. package/dist/plugin-BJDf43dc.d.ts +0 -165
  173. package/dist/plugin.d.mts +0 -22
  174. package/dist/plugin.d.ts +0 -22
  175. package/dist/production-runtime-9KG7GuvW.d.ts +0 -79
  176. package/dist/production-runtime-B-fweKts.d.mts +0 -79
  177. package/dist/production-runtime-C_B79w2P.d.mts +0 -28
  178. package/dist/production-runtime-DDEM1D2q.d.ts +0 -28
  179. package/dist/query/client.d.mts +0 -61
  180. package/dist/query/client.d.ts +0 -61
  181. package/dist/query/index.d.mts +0 -90
  182. package/dist/query/index.d.ts +0 -90
  183. package/dist/query/parsers.d.mts +0 -25
  184. package/dist/query/parsers.d.ts +0 -25
  185. package/dist/query/server.d.mts +0 -55
  186. package/dist/query/server.d.ts +0 -55
  187. package/dist/request-Dsq4kGW0.d.mts +0 -6
  188. package/dist/request-udtobOLv.d.ts +0 -6
  189. package/dist/request.d.mts +0 -2
  190. package/dist/request.d.ts +0 -2
  191. package/dist/resolver-DJqjLMg_.d.mts +0 -14
  192. package/dist/resolver-IH4RmPEl.d.ts +0 -14
  193. package/dist/route-runtime-DoOHzCAD.d.mts +0 -38
  194. package/dist/route-runtime-DoOHzCAD.d.ts +0 -38
  195. package/dist/router.d.mts +0 -36
  196. package/dist/router.d.ts +0 -36
  197. package/dist/routes.d.mts +0 -224
  198. package/dist/routes.d.ts +0 -224
  199. package/dist/runtime-9nQjVM7X.d.mts +0 -206
  200. package/dist/runtime-Cxpq6xZN.d.mts +0 -27
  201. package/dist/runtime-DgeS2skB.d.ts +0 -206
  202. package/dist/runtime-bv63eUiO.d.ts +0 -27
  203. package/dist/server-action-security.d.mts +0 -43
  204. package/dist/server-action-security.d.ts +0 -43
  205. package/dist/server-fn-client.d.mts +0 -32
  206. package/dist/server-fn-client.d.ts +0 -32
  207. package/dist/server-fn.d.mts +0 -93
  208. package/dist/server-fn.d.ts +0 -93
  209. package/dist/server-plugins.d.mts +0 -55
  210. package/dist/server-plugins.d.ts +0 -55
  211. package/dist/server-query-client.d.mts +0 -50
  212. package/dist/server-query-client.d.ts +0 -50
  213. package/dist/server-query.d.mts +0 -36
  214. package/dist/server-query.d.ts +0 -36
  215. package/dist/server.d.mts +0 -48
  216. package/dist/server.d.ts +0 -48
  217. package/dist/storage.d.mts +0 -52
  218. package/dist/storage.d.ts +0 -52
  219. package/dist/testing.d.mts +0 -101
  220. package/dist/testing.d.ts +0 -101
  221. package/dist/transport-BmbGTXA5.d.mts +0 -49
  222. package/dist/transport-BmbGTXA5.d.ts +0 -49
  223. package/dist/types-BMxWr97v.d.mts +0 -81
  224. package/dist/types-BMxWr97v.d.ts +0 -81
  225. package/dist/types-C9N-nk5R.d.mts +0 -53
  226. package/dist/types-C9N-nk5R.d.ts +0 -53
  227. package/dist/types-D1A6-XvH.d.mts +0 -73
  228. package/dist/types-D1A6-XvH.d.ts +0 -73
  229. package/dist/utils-CA0z0c-2.d.ts +0 -23
  230. package/dist/utils-mYVkSOt2.d.mts +0 -23
  231. package/dist/version.d.mts +0 -3
  232. package/dist/version.d.ts +0 -3
  233. package/dist/vite.d.mts +0 -22
  234. package/dist/vite.d.ts +0 -22
  235. package/dist/workflows.d.mts +0 -110
  236. package/dist/workflows.d.ts +0 -110
  237. /package/dist/{chunk-7N62DNSO.mjs.map → chunk-H3TE3LOV.mjs.map} +0 -0
package/dist/vite.mjs CHANGED
@@ -3,19 +3,23 @@ import {
3
3
  farmI18nClientBridgePlugin,
4
4
  farmPlugin,
5
5
  rewriteEarlySsrRelativeImports
6
- } from "./chunk-77BOAQHI.mjs";
6
+ } from "./chunk-Z3YG4OZT.mjs";
7
7
  import "./chunk-LGHEOHBU.mjs";
8
8
  import "./chunk-FRPWCMMG.mjs";
9
+ import "./chunk-53MVSX3R.mjs";
10
+ import "./chunk-6ZXIQSXE.mjs";
9
11
  import "./chunk-V6WE6JSZ.mjs";
10
12
  import "./chunk-3XNTL3FQ.mjs";
11
13
  import "./chunk-CGIXMLSY.mjs";
12
14
  import "./chunk-USWZZUEH.mjs";
13
- import "./chunk-7N62DNSO.mjs";
15
+ import "./chunk-H3TE3LOV.mjs";
14
16
  import "./chunk-7HO6AEOP.mjs";
17
+ import "./chunk-USLFXFFH.mjs";
15
18
  import "./chunk-I4CUBGVF.mjs";
19
+ import "./chunk-7MABZJIM.mjs";
16
20
  import "./chunk-YW7OBE6Q.mjs";
17
21
  import "./chunk-74YTBPTY.mjs";
18
- import "./chunk-7MABZJIM.mjs";
22
+ import "./chunk-7ZVN3YZI.mjs";
19
23
  import "./chunk-GY2STC2S.mjs";
20
24
  import "./chunk-UB5UOSHB.mjs";
21
25
  import "./chunk-ZVWA4ZQ3.mjs";
@@ -39,8 +43,8 @@ import "./chunk-J4FNJ5IU.mjs";
39
43
  import "./chunk-PFE6GMNE.mjs";
40
44
  import "./chunk-RHIFZZUI.mjs";
41
45
  import "./chunk-LM2YNO4U.mjs";
42
- import "./chunk-5EVQFRL2.mjs";
43
- import "./chunk-QTZZ2ISQ.mjs";
46
+ import "./chunk-3WIRO3N7.mjs";
47
+ import "./chunk-KLA67WKG.mjs";
44
48
  import "./chunk-ITN462YM.mjs";
45
49
  import "./chunk-B232I2GP.mjs";
46
50
  import "./chunk-JK25YEN6.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farm.js/core",
3
- "version": "0.1.0-beta.11",
3
+ "version": "0.1.0-beta.13",
4
4
  "description": "Core Farm.js framework for modern integrated apps",
5
5
  "keywords": [
6
6
  "@farm.js/core",
@@ -133,6 +133,9 @@
133
133
  "internal/production-runtime": [
134
134
  "./dist/internal/production-runtime.d.ts"
135
135
  ],
136
+ "internal/metadata-image-runtime": [
137
+ "./dist/internal/metadata-image-runtime.d.ts"
138
+ ],
136
139
  "internal/client-runtime": [
137
140
  "./dist/internal/client-runtime.d.ts"
138
141
  ],
@@ -449,6 +452,11 @@
449
452
  "import": "./dist/internal/production-runtime.mjs",
450
453
  "require": "./dist/internal/production-runtime.cjs"
451
454
  },
455
+ "./internal/metadata-image-runtime": {
456
+ "types": "./dist/internal/metadata-image-runtime.d.ts",
457
+ "import": "./dist/internal/metadata-image-runtime.mjs",
458
+ "require": "./dist/internal/metadata-image-runtime.cjs"
459
+ },
452
460
  "./internal/client-runtime": {
453
461
  "types": "./dist/internal/client-runtime.d.ts",
454
462
  "import": "./dist/internal/client-runtime.mjs",
@@ -482,6 +490,7 @@
482
490
  "@scalar/api-reference": "^1.38.1",
483
491
  "@scalar/openapi-parser": "^0.22.3",
484
492
  "@tailwindcss/vite": "4.1.18",
493
+ "@vercel/og": "0.11.1",
485
494
  "@vitejs/plugin-react": "^4.2.1",
486
495
  "better-call": "^1.0.19",
487
496
  "db0": "^0.3.4",
package/dist/after.d.mts DELETED
@@ -1,25 +0,0 @@
1
- import { ServerResponse, IncomingMessage } from 'node:http';
2
-
3
- type AfterCallback = () => void | Promise<void>;
4
- /** Runtime hooks supplied by a deployment adapter. */
5
- interface FarmAfterPlatformContext {
6
- /** Keep a serverless invocation alive until the scheduled work settles. */
7
- waitUntil?: (promise: Promise<void>) => void;
8
- /** Register a callback that runs once the response has finished. */
9
- onResponseFinished?: (callback: () => void) => void;
10
- }
11
- /**
12
- * Schedule non-blocking work for after the current response finishes.
13
- *
14
- * Callbacks run in registration order. A callback failure is reported without
15
- * changing the response or preventing later callbacks from running.
16
- */
17
- declare function after(callback: AfterCallback): void;
18
- /** @internal Run a Web Request handler inside Farm's post-response lifecycle. */
19
- declare function _runWithAfterRequest(request: Request, handler: () => Response | Promise<Response>, context?: FarmAfterPlatformContext): Promise<Response>;
20
- /** @internal Run a Node response handler inside Farm's post-response lifecycle. */
21
- declare function _runWithAfterNodeResponse<T>(response: ServerResponse, handler: () => T | Promise<T>, context?: Pick<FarmAfterPlatformContext, "waitUntil">): Promise<T>;
22
- /** @internal Add Farm's post-response lifecycle to a Node middleware. */
23
- declare function _withAfterNodeMiddleware(handler: (request: IncomingMessage, response: ServerResponse, next: (error?: unknown) => void) => void | Promise<void>): (request: IncomingMessage, response: ServerResponse, next: (error?: unknown) => void) => Promise<void>;
24
-
25
- export { type AfterCallback, type FarmAfterPlatformContext, _runWithAfterNodeResponse, _runWithAfterRequest, _withAfterNodeMiddleware, after };
package/dist/after.d.ts DELETED
@@ -1,25 +0,0 @@
1
- import { ServerResponse, IncomingMessage } from 'node:http';
2
-
3
- type AfterCallback = () => void | Promise<void>;
4
- /** Runtime hooks supplied by a deployment adapter. */
5
- interface FarmAfterPlatformContext {
6
- /** Keep a serverless invocation alive until the scheduled work settles. */
7
- waitUntil?: (promise: Promise<void>) => void;
8
- /** Register a callback that runs once the response has finished. */
9
- onResponseFinished?: (callback: () => void) => void;
10
- }
11
- /**
12
- * Schedule non-blocking work for after the current response finishes.
13
- *
14
- * Callbacks run in registration order. A callback failure is reported without
15
- * changing the response or preventing later callbacks from running.
16
- */
17
- declare function after(callback: AfterCallback): void;
18
- /** @internal Run a Web Request handler inside Farm's post-response lifecycle. */
19
- declare function _runWithAfterRequest(request: Request, handler: () => Response | Promise<Response>, context?: FarmAfterPlatformContext): Promise<Response>;
20
- /** @internal Run a Node response handler inside Farm's post-response lifecycle. */
21
- declare function _runWithAfterNodeResponse<T>(response: ServerResponse, handler: () => T | Promise<T>, context?: Pick<FarmAfterPlatformContext, "waitUntil">): Promise<T>;
22
- /** @internal Add Farm's post-response lifecycle to a Node middleware. */
23
- declare function _withAfterNodeMiddleware(handler: (request: IncomingMessage, response: ServerResponse, next: (error?: unknown) => void) => void | Promise<void>): (request: IncomingMessage, response: ServerResponse, next: (error?: unknown) => void) => Promise<void>;
24
-
25
- export { type AfterCallback, type FarmAfterPlatformContext, _runWithAfterNodeResponse, _runWithAfterRequest, _withAfterNodeMiddleware, after };
@@ -1,94 +0,0 @@
1
- import { ChildProcess } from 'node:child_process';
2
- import { U as BundleResultPayload, V as FarmPlugin, W as FarmIntegration } from './client-plugins-jsk-ZLzJ.mjs';
3
- import './plugin-BJDf43dc.mjs';
4
- import 'react';
5
- import 'http';
6
- import './types-D1A6-XvH.mjs';
7
- import 'db0';
8
- import 'unstorage';
9
- import './integration-api-CHT2OKAf.mjs';
10
- import '@farming-labs/orm';
11
- import './types-C9N-nk5R.mjs';
12
- import '@farming-labs/docs';
13
- import './markdown.mjs';
14
- import './observability.mjs';
15
- import 'vite';
16
- import './workflows.mjs';
17
- import './cron.mjs';
18
- import './env.mjs';
19
- import './server-action-security.mjs';
20
- import './image-config-Duob7wER.mjs';
21
- import './types-BMxWr97v.mjs';
22
- import './cache.mjs';
23
- import './route-runtime-DoOHzCAD.mjs';
24
-
25
- interface FarmAgentRuntimeInstance {
26
- readonly provider: string;
27
- readonly routePrefix: string;
28
- readonly routePrefixes: readonly string[];
29
- getOrigin(): string | undefined;
30
- }
31
- interface FarmManagedAgentRuntime {
32
- readonly origin: string;
33
- readonly process?: ChildProcess;
34
- stop(): Promise<void>;
35
- }
36
- interface FarmAgentRuntimeStartContext {
37
- readonly root: string;
38
- readonly log: {
39
- info(message: string, meta?: Record<string, unknown>): void;
40
- warn(message: string, meta?: Record<string, unknown>): void;
41
- error(message: string, meta?: Record<string, unknown>): void;
42
- };
43
- }
44
- interface FarmAgentRuntimeBuildContext extends BundleResultPayload {
45
- readonly provider: string;
46
- readonly routePrefix: string;
47
- readonly routePrefixes: readonly string[];
48
- }
49
- interface FarmAgentRuntimeIntegrationOptions {
50
- provider: string;
51
- routePrefix: string;
52
- /** Whether Farm's production server must dispatch this runtime's proxy routes. */
53
- serverRuntime?: boolean;
54
- additionalRoutePrefixes?: readonly string[];
55
- origin?: string;
56
- originEnv?: string | readonly string[];
57
- webSockets?: boolean;
58
- startDev?(context: FarmAgentRuntimeStartContext): Promise<FarmManagedAgentRuntime>;
59
- afterBuild?(context: FarmAgentRuntimeBuildContext): Promise<void> | void;
60
- plugins?: readonly FarmPlugin[];
61
- instance?: Record<string, unknown>;
62
- }
63
- interface FarmManagedProcessOptions {
64
- command: string;
65
- args?: readonly string[];
66
- cwd: string;
67
- env?: Record<string, string | undefined>;
68
- label: string;
69
- origin?: string;
70
- resolveOrigin?(output: string): string | undefined;
71
- healthPath?: string;
72
- timeoutMs?: number;
73
- stopTimeoutMs?: number;
74
- onOutput?(line: string, stream: "stdout" | "stderr"): void;
75
- }
76
- interface FarmAgentProxyOptions {
77
- fetch?: typeof globalThis.fetch;
78
- }
79
- declare function createAgentRuntimeIntegration(options: FarmAgentRuntimeIntegrationOptions): FarmIntegration;
80
- declare function applyAgentRuntimeViteProxy(config: {
81
- vite?: Record<string, any>;
82
- }, input: {
83
- origin: string;
84
- routePrefix: string;
85
- webSockets?: boolean;
86
- }): void;
87
- declare function proxyAgentRuntimeRequest(request: Request, origin: string, options?: FarmAgentProxyOptions): Promise<Response>;
88
- declare function startManagedAgentRuntime(options: FarmManagedProcessOptions): Promise<FarmManagedAgentRuntime>;
89
- declare function findAvailableAgentRuntimePort(host?: string): Promise<number>;
90
- declare function resolveProjectPackageBin(projectRoot: string, packageName: string, binName?: string): Promise<string>;
91
- declare function normalizeAgentOrigin(value: string): string;
92
- declare function normalizeAgentRoutePrefix(value: string): string;
93
-
94
- export { type FarmAgentProxyOptions, type FarmAgentRuntimeBuildContext, type FarmAgentRuntimeInstance, type FarmAgentRuntimeIntegrationOptions, type FarmAgentRuntimeStartContext, type FarmManagedAgentRuntime, type FarmManagedProcessOptions, applyAgentRuntimeViteProxy, createAgentRuntimeIntegration, findAvailableAgentRuntimePort, normalizeAgentOrigin, normalizeAgentRoutePrefix, proxyAgentRuntimeRequest, resolveProjectPackageBin, startManagedAgentRuntime };
@@ -1,94 +0,0 @@
1
- import { ChildProcess } from 'node:child_process';
2
- import { U as BundleResultPayload, V as FarmPlugin, W as FarmIntegration } from './client-plugins-Bc5jHcNr.js';
3
- import './plugin-BJDf43dc.js';
4
- import 'react';
5
- import 'http';
6
- import './types-D1A6-XvH.js';
7
- import 'db0';
8
- import 'unstorage';
9
- import './integration-api-CHT2OKAf.js';
10
- import '@farming-labs/orm';
11
- import './types-C9N-nk5R.js';
12
- import '@farming-labs/docs';
13
- import './markdown.js';
14
- import './observability.js';
15
- import 'vite';
16
- import './workflows.js';
17
- import './cron.js';
18
- import './env.js';
19
- import './server-action-security.js';
20
- import './image-config-Duob7wER.js';
21
- import './types-BMxWr97v.js';
22
- import './cache.js';
23
- import './route-runtime-DoOHzCAD.js';
24
-
25
- interface FarmAgentRuntimeInstance {
26
- readonly provider: string;
27
- readonly routePrefix: string;
28
- readonly routePrefixes: readonly string[];
29
- getOrigin(): string | undefined;
30
- }
31
- interface FarmManagedAgentRuntime {
32
- readonly origin: string;
33
- readonly process?: ChildProcess;
34
- stop(): Promise<void>;
35
- }
36
- interface FarmAgentRuntimeStartContext {
37
- readonly root: string;
38
- readonly log: {
39
- info(message: string, meta?: Record<string, unknown>): void;
40
- warn(message: string, meta?: Record<string, unknown>): void;
41
- error(message: string, meta?: Record<string, unknown>): void;
42
- };
43
- }
44
- interface FarmAgentRuntimeBuildContext extends BundleResultPayload {
45
- readonly provider: string;
46
- readonly routePrefix: string;
47
- readonly routePrefixes: readonly string[];
48
- }
49
- interface FarmAgentRuntimeIntegrationOptions {
50
- provider: string;
51
- routePrefix: string;
52
- /** Whether Farm's production server must dispatch this runtime's proxy routes. */
53
- serverRuntime?: boolean;
54
- additionalRoutePrefixes?: readonly string[];
55
- origin?: string;
56
- originEnv?: string | readonly string[];
57
- webSockets?: boolean;
58
- startDev?(context: FarmAgentRuntimeStartContext): Promise<FarmManagedAgentRuntime>;
59
- afterBuild?(context: FarmAgentRuntimeBuildContext): Promise<void> | void;
60
- plugins?: readonly FarmPlugin[];
61
- instance?: Record<string, unknown>;
62
- }
63
- interface FarmManagedProcessOptions {
64
- command: string;
65
- args?: readonly string[];
66
- cwd: string;
67
- env?: Record<string, string | undefined>;
68
- label: string;
69
- origin?: string;
70
- resolveOrigin?(output: string): string | undefined;
71
- healthPath?: string;
72
- timeoutMs?: number;
73
- stopTimeoutMs?: number;
74
- onOutput?(line: string, stream: "stdout" | "stderr"): void;
75
- }
76
- interface FarmAgentProxyOptions {
77
- fetch?: typeof globalThis.fetch;
78
- }
79
- declare function createAgentRuntimeIntegration(options: FarmAgentRuntimeIntegrationOptions): FarmIntegration;
80
- declare function applyAgentRuntimeViteProxy(config: {
81
- vite?: Record<string, any>;
82
- }, input: {
83
- origin: string;
84
- routePrefix: string;
85
- webSockets?: boolean;
86
- }): void;
87
- declare function proxyAgentRuntimeRequest(request: Request, origin: string, options?: FarmAgentProxyOptions): Promise<Response>;
88
- declare function startManagedAgentRuntime(options: FarmManagedProcessOptions): Promise<FarmManagedAgentRuntime>;
89
- declare function findAvailableAgentRuntimePort(host?: string): Promise<number>;
90
- declare function resolveProjectPackageBin(projectRoot: string, packageName: string, binName?: string): Promise<string>;
91
- declare function normalizeAgentOrigin(value: string): string;
92
- declare function normalizeAgentRoutePrefix(value: string): string;
93
-
94
- export { type FarmAgentProxyOptions, type FarmAgentRuntimeBuildContext, type FarmAgentRuntimeInstance, type FarmAgentRuntimeIntegrationOptions, type FarmAgentRuntimeStartContext, type FarmManagedAgentRuntime, type FarmManagedProcessOptions, applyAgentRuntimeViteProxy, createAgentRuntimeIntegration, findAvailableAgentRuntimePort, normalizeAgentOrigin, normalizeAgentRoutePrefix, proxyAgentRuntimeRequest, resolveProjectPackageBin, startManagedAgentRuntime };
@@ -1,66 +0,0 @@
1
- import { ViteDevServer } from 'vite';
2
- import { F as FarmRouteRuntimeConfig } from '../route-runtime-DoOHzCAD.mjs';
3
- import '../types-BMxWr97v.mjs';
4
- import { F as FarmI18nRuntime } from '../runtime-Cxpq6xZN.mjs';
5
- import { A as APIRouteMatch } from '../runtime-9nQjVM7X.mjs';
6
- export { c as APIRouteParamValue, b as APIRouteParams, i as invokeAPIRouteEndpoint, a as isWebResponse, m as matchAPIRoute, n as normalizeRouteResponse } from '../runtime-9nQjVM7X.mjs';
7
- import '../resolver-DJqjLMg_.mjs';
8
- import '../cache.mjs';
9
- import '../transport-BmbGTXA5.mjs';
10
-
11
- interface APIRoute extends FarmRouteRuntimeConfig {
12
- path: string;
13
- filePath: string;
14
- methods: string[];
15
- endpoints: Record<string, any>;
16
- }
17
- interface APIRouteManagerOptions {
18
- throwOnLoadError?: boolean;
19
- i18n?: FarmI18nRuntime;
20
- }
21
- declare const API_ROUTE_METHODS: readonly ["GET", "HEAD", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"];
22
- declare class APIRouteManager {
23
- private routes;
24
- private viteServer?;
25
- private appDirs;
26
- private throwOnLoadError;
27
- private i18n?;
28
- constructor(appDir: string | readonly string[], viteServer?: ViteDevServer, options?: APIRouteManagerOptions);
29
- /**
30
- * Discover route.ts files in /app/api and explicit endpoints in root routes.ts
31
- */
32
- discoverRoutes(): Promise<void>;
33
- /**
34
- * Recursively find all route.ts files
35
- */
36
- private findRouteFiles;
37
- /**
38
- * Load a route.ts file and extract HTTP method exports
39
- */
40
- private loadRoute;
41
- /**
42
- * Load explicit-path endpoints from src/routes.ts-style files.
43
- */
44
- private loadRootRoutes;
45
- private loadProgrammaticApiRoutes;
46
- private handleLoadError;
47
- private findRootRoutesFile;
48
- private loadModule;
49
- private addEndpoint;
50
- private addProgrammaticApiRoute;
51
- /**
52
- * Get the handler that directly invokes endpoint handlers
53
- */
54
- getHandler(): ((req: Request) => Promise<Response>) | null;
55
- /**
56
- * Check if a path is an API route
57
- */
58
- isAPIRoute(pathname: string): boolean;
59
- matchRoute(pathname: string): APIRouteMatch<APIRoute> | null;
60
- /**
61
- * Get all routes for client type generation
62
- */
63
- getRoutes(): Map<string, APIRoute>;
64
- }
65
-
66
- export { type APIRoute, APIRouteManager, type APIRouteManagerOptions, APIRouteMatch, API_ROUTE_METHODS };
@@ -1,66 +0,0 @@
1
- import { ViteDevServer } from 'vite';
2
- import { F as FarmRouteRuntimeConfig } from '../route-runtime-DoOHzCAD.js';
3
- import '../types-BMxWr97v.js';
4
- import { F as FarmI18nRuntime } from '../runtime-bv63eUiO.js';
5
- import { A as APIRouteMatch } from '../runtime-DgeS2skB.js';
6
- export { c as APIRouteParamValue, b as APIRouteParams, i as invokeAPIRouteEndpoint, a as isWebResponse, m as matchAPIRoute, n as normalizeRouteResponse } from '../runtime-DgeS2skB.js';
7
- import '../resolver-IH4RmPEl.js';
8
- import '../cache.js';
9
- import '../transport-BmbGTXA5.js';
10
-
11
- interface APIRoute extends FarmRouteRuntimeConfig {
12
- path: string;
13
- filePath: string;
14
- methods: string[];
15
- endpoints: Record<string, any>;
16
- }
17
- interface APIRouteManagerOptions {
18
- throwOnLoadError?: boolean;
19
- i18n?: FarmI18nRuntime;
20
- }
21
- declare const API_ROUTE_METHODS: readonly ["GET", "HEAD", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"];
22
- declare class APIRouteManager {
23
- private routes;
24
- private viteServer?;
25
- private appDirs;
26
- private throwOnLoadError;
27
- private i18n?;
28
- constructor(appDir: string | readonly string[], viteServer?: ViteDevServer, options?: APIRouteManagerOptions);
29
- /**
30
- * Discover route.ts files in /app/api and explicit endpoints in root routes.ts
31
- */
32
- discoverRoutes(): Promise<void>;
33
- /**
34
- * Recursively find all route.ts files
35
- */
36
- private findRouteFiles;
37
- /**
38
- * Load a route.ts file and extract HTTP method exports
39
- */
40
- private loadRoute;
41
- /**
42
- * Load explicit-path endpoints from src/routes.ts-style files.
43
- */
44
- private loadRootRoutes;
45
- private loadProgrammaticApiRoutes;
46
- private handleLoadError;
47
- private findRootRoutesFile;
48
- private loadModule;
49
- private addEndpoint;
50
- private addProgrammaticApiRoute;
51
- /**
52
- * Get the handler that directly invokes endpoint handlers
53
- */
54
- getHandler(): ((req: Request) => Promise<Response>) | null;
55
- /**
56
- * Check if a path is an API route
57
- */
58
- isAPIRoute(pathname: string): boolean;
59
- matchRoute(pathname: string): APIRouteMatch<APIRoute> | null;
60
- /**
61
- * Get all routes for client type generation
62
- */
63
- getRoutes(): Map<string, APIRoute>;
64
- }
65
-
66
- export { type APIRoute, APIRouteManager, type APIRouteManagerOptions, APIRouteMatch, API_ROUTE_METHODS };
@@ -1,3 +0,0 @@
1
- export { A as APIRouteMatch, c as APIRouteParamValue, b as APIRouteParams, z as createEndpointFailureResponse, i as invokeAPIRouteEndpoint, a as isWebResponse, m as matchAPIRoute, n as normalizeRouteResponse } from '../runtime-9nQjVM7X.mjs';
2
- import '../cache.mjs';
3
- import '../transport-BmbGTXA5.mjs';
@@ -1,3 +0,0 @@
1
- export { A as APIRouteMatch, c as APIRouteParamValue, b as APIRouteParams, z as createEndpointFailureResponse, i as invokeAPIRouteEndpoint, a as isWebResponse, m as matchAPIRoute, n as normalizeRouteResponse } from '../runtime-DgeS2skB.js';
2
- import '../cache.js';
3
- import '../transport-BmbGTXA5.js';
package/dist/api.d.mts DELETED
@@ -1,48 +0,0 @@
1
- export { A as APIRouteMatch, c as APIRouteParamValue, b as APIRouteParams, q as AnyEndpointMiddleware, D as DELETE, e as EndpointErrorContracts, E as EndpointErrorDefinition, d as EndpointErrorDefinitions, f as EndpointFail, g as EndpointFailure, v as EndpointHandler, s as EndpointInvalidationContext, r as EndpointInvalidationTarget, t as EndpointInvalidations, p as EndpointMiddleware, l as EndpointMiddlewareContext, o as EndpointMiddlewareResult, u as EndpointOptions, j as EndpointParamValue, k as EndpointParams, G as GET, H as HEAD, I as InferEndpointMiddlewareContext, O as OPTIONS, y as PATCH, P as POST, x as PUT, T as TypedEndpoint, w as createEndpoint, i as invokeAPIRouteEndpoint, h as isEndpointFailure, a as isWebResponse, m as matchAPIRoute, n as normalizeRouteResponse } from './runtime-9nQjVM7X.mjs';
2
- export { APIRoute, APIRouteManager, APIRouteManagerOptions, API_ROUTE_METHODS } from './api/route-manager.mjs';
3
- export { r as APIClient, h as APIClientError, b as APIClientOptions, i as APIClientSystemError, c as APIClientWithoutIntegrationsOptions, g as APIResult, A as APIRouteRefMetadata, C as CacheKey, l as CacheOptions, k as CachePolicy, p as ClientOptions, a as FARM_API_ROUTE_META_SYMBOL, F as FARM_API_ROUTE_REF_SYMBOL, n as InvalidateOptions, I as InvalidateTarget, o as OptimisticOptions, O as OptimisticUpdate, R as RequestEvent, j as ResponseEvent, m as RetryOptions, q as RouteAPIClient, s as ServerAPIClient, S as ServerAPIClientOptions, d as ServerAPIClientWithoutIntegrationsOptions, f as StatusEvent, e as StatusPhase, t as createAPIClient, w as createServerAPIClient, v as getAPIRouteRefMetadata, u as isAPIRouteRef } from './client-BT1mFQas.mjs';
4
- export { F as FarmAPIStream, c as FarmStreamResponse, a as MultipartField, M as MultipartSchema, b as MultipartValues, T as TypedFormData, e as isFarmAPIStream, d as isJSONStreamResponse, i as isMultipartSchema, j as jsonStream, m as multipart, r as readJSONStream, t as toFormData } from './transport-BmbGTXA5.mjs';
5
- import { Plugin } from 'vite';
6
- import './cache.mjs';
7
- import './route-runtime-DoOHzCAD.mjs';
8
- import './types-BMxWr97v.mjs';
9
- import './runtime-Cxpq6xZN.mjs';
10
- import './resolver-DJqjLMg_.mjs';
11
- import './integration-api-CHT2OKAf.mjs';
12
- import './client-cache-D-EZ7XVW.mjs';
13
-
14
- /**
15
- * Farm.js API Routes Vite Plugin
16
- *
17
- * Standalone API route support that works with any Vite setup.
18
- * Discovers and handles route.ts files in the api directory.
19
- * Also supports root routes.ts for custom route definitions.
20
- *
21
- * @example
22
- * ```ts
23
- * import { farmApiPlugin } from '@farm.js/core'
24
- *
25
- * export default defineConfig({
26
- * plugins: [farmApiPlugin({ srcDir: 'src' })],
27
- * })
28
- * ```
29
- */
30
-
31
- interface FarmApiPluginOptions {
32
- /** Source directory containing the api folder (default: 'src') */
33
- srcDir?: string;
34
- /** Enable debug logging */
35
- debug?: boolean;
36
- }
37
- interface ApiRoute {
38
- path: string;
39
- filePath: string;
40
- methods: string[];
41
- endpoints: Record<string, any>;
42
- }
43
- /**
44
- * Farm.js API Routes Vite Plugin
45
- */
46
- declare function farmApiPlugin(options?: FarmApiPluginOptions): Plugin;
47
-
48
- export { type ApiRoute, type FarmApiPluginOptions, farmApiPlugin };
package/dist/api.d.ts DELETED
@@ -1,48 +0,0 @@
1
- export { A as APIRouteMatch, c as APIRouteParamValue, b as APIRouteParams, q as AnyEndpointMiddleware, D as DELETE, e as EndpointErrorContracts, E as EndpointErrorDefinition, d as EndpointErrorDefinitions, f as EndpointFail, g as EndpointFailure, v as EndpointHandler, s as EndpointInvalidationContext, r as EndpointInvalidationTarget, t as EndpointInvalidations, p as EndpointMiddleware, l as EndpointMiddlewareContext, o as EndpointMiddlewareResult, u as EndpointOptions, j as EndpointParamValue, k as EndpointParams, G as GET, H as HEAD, I as InferEndpointMiddlewareContext, O as OPTIONS, y as PATCH, P as POST, x as PUT, T as TypedEndpoint, w as createEndpoint, i as invokeAPIRouteEndpoint, h as isEndpointFailure, a as isWebResponse, m as matchAPIRoute, n as normalizeRouteResponse } from './runtime-DgeS2skB.js';
2
- export { APIRoute, APIRouteManager, APIRouteManagerOptions, API_ROUTE_METHODS } from './api/route-manager.js';
3
- export { r as APIClient, h as APIClientError, b as APIClientOptions, i as APIClientSystemError, c as APIClientWithoutIntegrationsOptions, g as APIResult, A as APIRouteRefMetadata, C as CacheKey, l as CacheOptions, k as CachePolicy, p as ClientOptions, a as FARM_API_ROUTE_META_SYMBOL, F as FARM_API_ROUTE_REF_SYMBOL, n as InvalidateOptions, I as InvalidateTarget, o as OptimisticOptions, O as OptimisticUpdate, R as RequestEvent, j as ResponseEvent, m as RetryOptions, q as RouteAPIClient, s as ServerAPIClient, S as ServerAPIClientOptions, d as ServerAPIClientWithoutIntegrationsOptions, f as StatusEvent, e as StatusPhase, t as createAPIClient, w as createServerAPIClient, v as getAPIRouteRefMetadata, u as isAPIRouteRef } from './client-Nn0q4eO4.js';
4
- export { F as FarmAPIStream, c as FarmStreamResponse, a as MultipartField, M as MultipartSchema, b as MultipartValues, T as TypedFormData, e as isFarmAPIStream, d as isJSONStreamResponse, i as isMultipartSchema, j as jsonStream, m as multipart, r as readJSONStream, t as toFormData } from './transport-BmbGTXA5.js';
5
- import { Plugin } from 'vite';
6
- import './cache.js';
7
- import './route-runtime-DoOHzCAD.js';
8
- import './types-BMxWr97v.js';
9
- import './runtime-bv63eUiO.js';
10
- import './resolver-IH4RmPEl.js';
11
- import './integration-api-CHT2OKAf.js';
12
- import './client-cache-CIlyBlmx.js';
13
-
14
- /**
15
- * Farm.js API Routes Vite Plugin
16
- *
17
- * Standalone API route support that works with any Vite setup.
18
- * Discovers and handles route.ts files in the api directory.
19
- * Also supports root routes.ts for custom route definitions.
20
- *
21
- * @example
22
- * ```ts
23
- * import { farmApiPlugin } from '@farm.js/core'
24
- *
25
- * export default defineConfig({
26
- * plugins: [farmApiPlugin({ srcDir: 'src' })],
27
- * })
28
- * ```
29
- */
30
-
31
- interface FarmApiPluginOptions {
32
- /** Source directory containing the api folder (default: 'src') */
33
- srcDir?: string;
34
- /** Enable debug logging */
35
- debug?: boolean;
36
- }
37
- interface ApiRoute {
38
- path: string;
39
- filePath: string;
40
- methods: string[];
41
- endpoints: Record<string, any>;
42
- }
43
- /**
44
- * Farm.js API Routes Vite Plugin
45
- */
46
- declare function farmApiPlugin(options?: FarmApiPluginOptions): Plugin;
47
-
48
- export { type ApiRoute, type FarmApiPluginOptions, farmApiPlugin };