@reckona/mreact-router 0.0.140 → 0.0.142

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 (62) hide show
  1. package/README.md +4 -2
  2. package/dist/actions.d.ts +1 -1
  3. package/dist/actions.d.ts.map +1 -1
  4. package/dist/actions.js +28 -8
  5. package/dist/actions.js.map +1 -1
  6. package/dist/adapters/cloudflare.d.ts.map +1 -1
  7. package/dist/adapters/cloudflare.js +31 -12
  8. package/dist/adapters/cloudflare.js.map +1 -1
  9. package/dist/build.d.ts.map +1 -1
  10. package/dist/build.js +470 -12
  11. package/dist/build.js.map +1 -1
  12. package/dist/cli-options.js +1 -1
  13. package/dist/cli-options.js.map +1 -1
  14. package/dist/client-route-inference.d.ts +1 -1
  15. package/dist/client-route-inference.d.ts.map +1 -1
  16. package/dist/client-route-inference.js +1 -1
  17. package/dist/client-route-inference.js.map +1 -1
  18. package/dist/client.d.ts +8 -1
  19. package/dist/client.d.ts.map +1 -1
  20. package/dist/client.js +16 -0
  21. package/dist/client.js.map +1 -1
  22. package/dist/config.js +1 -1
  23. package/dist/config.js.map +1 -1
  24. package/dist/import-policy.js +7 -0
  25. package/dist/import-policy.js.map +1 -1
  26. package/dist/index.d.ts +2 -0
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +1 -0
  29. package/dist/index.js.map +1 -1
  30. package/dist/metadata.d.ts +1 -0
  31. package/dist/metadata.d.ts.map +1 -1
  32. package/dist/metadata.js +288 -1
  33. package/dist/metadata.js.map +1 -1
  34. package/dist/middleware.d.ts +5 -0
  35. package/dist/middleware.d.ts.map +1 -1
  36. package/dist/middleware.js +13 -0
  37. package/dist/middleware.js.map +1 -1
  38. package/dist/render.d.ts.map +1 -1
  39. package/dist/render.js +41 -9
  40. package/dist/render.js.map +1 -1
  41. package/dist/typed-routes.d.ts +24 -0
  42. package/dist/typed-routes.d.ts.map +1 -0
  43. package/dist/typed-routes.js +60 -0
  44. package/dist/typed-routes.js.map +1 -0
  45. package/dist/vite.d.ts.map +1 -1
  46. package/dist/vite.js +22 -1
  47. package/dist/vite.js.map +1 -1
  48. package/package.json +11 -11
  49. package/src/actions.ts +39 -12
  50. package/src/adapters/cloudflare.ts +48 -12
  51. package/src/build.ts +491 -11
  52. package/src/cli-options.ts +1 -1
  53. package/src/client-route-inference.ts +1 -0
  54. package/src/client.ts +28 -1
  55. package/src/config.ts +1 -1
  56. package/src/import-policy.ts +8 -0
  57. package/src/index.ts +9 -0
  58. package/src/metadata.ts +388 -1
  59. package/src/middleware.ts +22 -0
  60. package/src/render.ts +58 -7
  61. package/src/typed-routes.ts +121 -0
  62. package/src/vite.ts +25 -0
package/README.md CHANGED
@@ -41,12 +41,14 @@ export default defineConfig({
41
41
 
42
42
  `allowedSourceDirs` can be omitted for the common route roots: `routesDir: "src/app"` defaults to `["src"]`, and `routesDir: "app"` defaults to `["app"]`. Keep it explicit when shared server/client modules live in additional project-root-relative directories.
43
43
 
44
- `mreact-router build` reads this config. Pass `--target=node` for plain Node/container output, `--target=aws-lambda` for Lambda artifacts with a generated handler and import policy, or `--target=cloudflare` for Workers artifacts with a generated Worker module. Configure `buildTargets: ["node"]`, `["aws-lambda"]`, or `["cloudflare"]` in `mreactRouter()` when one deployment target should be the project default. Without an explicit target, build output includes Node-compatible server/client artifacts and Cloudflare route modules for backward compatibility. The legacy `appDir` shortcut remains available for tests and older direct programmatic usage, but it is deprecated. Use `projectRoot` + `routesDir` for new code. The shortcut is planned for removal after `0.1.0`.
44
+ `mreact-router build` reads this config. Pass `--target=node` for plain Node/container output, `--target=aws-lambda` for Lambda artifacts with a generated handler and import policy, or `--target=cloudflare` for Workers artifacts with a generated Worker module. Configure `buildTargets: ["aws-lambda"]`, `["cloudflare"]`, or another explicit target list in `mreactRouter()` when one deployment target should be the project default. Without an explicit target, build output includes only the Node-compatible server/client artifacts; Cloudflare and Lambda artifacts are opt-in. The legacy `appDir` shortcut remains available for tests and older direct programmatic usage, but it is deprecated. Use `projectRoot` + `routesDir` for new code. The shortcut is planned for removal after `0.1.0`.
45
45
 
46
46
  Production client source maps are disabled by default. Set `clientSourceMaps: "linked"` to emit public `.js.map` files beside route scripts and include `sourceMappingURL` comments, or set `clientSourceMaps: "hidden"` to emit upload-only maps under `.mreact/source-maps/client/` without exposing them in the client manifest. The CLI accepts the same modes with `mreact-router build --client-source-maps=hidden`, `linked`, or `none`.
47
47
 
48
48
  Production client route bundles can drop selected browser logging calls with `production.dropClientConsole`. Set it to `true` to remove `console.debug`, `console.info`, and `console.log` while preserving `console.warn` and `console.error`, or pass an array such as `["log"]` to choose specific methods.
49
49
 
50
+ Build output includes `.mreact/routes.d.ts`, which declares `AppRoutePath` and a typed `routes` map for discovered page and route-handler paths. The public `href()` helper accepts mreact route patterns such as `"/users/:id"` and `"/files/:...path"`, requires the matching params at compile time, and encodes params, search values, and hashes at runtime.
51
+
50
52
  `mreact-router dev` reads the same config, preserves route-agnostic Vite plugins and CSS settings, and uses `server.port` from `vite.config.ts` when neither `--port` nor `PORT` is set. Use `mreact-router dev --port 15174` for one-off E2E or local port overrides without creating a separate Vite config. This keeps Vite CSS transforms, Playwright `webServer` setups, and local dev commands on the same configured port.
51
53
 
52
54
  For TypeScript projects that type-check route modules directly, include the
@@ -101,7 +103,7 @@ client-only code. Navigation observers are available from
101
103
  - `generateStaticParams()` returns dynamic route params to prerender and can import modules transformed by configured Vite plugins.
102
104
  - `prerender = true` emits HTML at build time.
103
105
  - `"use client"` at the top of a page or layout forces a hydrated client route even when inference cannot see an event handler or client boundary.
104
- - Imported functions passed to `<form action={...}>` are inferred as server actions, including supported typed registry references such as `actions.save`. Inferred action implementations stay in the server graph and are stripped from production client route bundles. A top-level `"use server"` directive is still supported and marks every exported function in that module as a server action.
106
+ - Imported functions passed to `<form action={...}>` are inferred as server actions, including supported typed registry references such as `actions.save`. Inferred action implementations stay in the server graph and are stripped from production client route bundles. A top-level `"use server"` directive is still supported and marks every exported function in that module as a server action. Production dispatch is fail-closed without a generated or explicit action manifest; direct integrations that intentionally expose every registered action must pass `serverActions: { allowedActions: "any" }`.
105
107
  - Server actions reject `Content-Length` values over `10 MiB` by default. Pass `serverActions: { maxBodyBytes }` to configure the limit.
106
108
  - Route handlers may return or throw standard `Response` objects from method exports such as `GET`, `POST`, or `ALL`. Dynamic route handlers receive decoded params as the second argument: `GET(request, { params })`; catch-all `$...slug` params are arrays of decoded segments. The context also includes `request`, `route`, and adapter `env`; Cloudflare route handlers additionally receive the Worker execution `context`.
107
109
  - `redirect(location)` throws router control flow that defaults to HTTP 303 so auth and form flows continue as GET requests after the redirect. Use `redirect(location, { status: 307 })` when preserving the original method and body is required.
package/dist/actions.d.ts CHANGED
@@ -22,7 +22,7 @@ declare class BoundedReplayStore {
22
22
  export declare function __clearDefaultReplayStore(): void;
23
23
  export declare function __readDefaultReplayStore(): BoundedReplayStore;
24
24
  export interface AppRouterServerActionOptions {
25
- allowedActions?: readonly AppRouterAllowedServerAction[] | undefined;
25
+ allowedActions?: readonly AppRouterAllowedServerAction[] | "any" | undefined;
26
26
  authorize?: ServerActionHandlerOptions["authorize"] | undefined;
27
27
  maxBodyBytes?: number | undefined;
28
28
  maxFormFields?: number | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAQA,OAAO,EAEL,KAAK,0BAA0B,EAE/B,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EAElC,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,KAAK,cAAc,EAAyB,MAAM,YAAY,CAAC;AAExE,OAAO,EAAqC,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACnG,OAAO,EAAW,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,WAAW,CAAC;AAMnB,OAAO,EAEL,KA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AAG,SAAS,CAAC;CAC1D,GAAG,OAAO,CAAC,QAAQ,CAAC,CAMpB;AAosBD,wBAAgB,gCAAgC,IAAI,IAAI,CAGvD"}
package/dist/actions.js CHANGED
@@ -192,6 +192,10 @@ async function dispatchServerActionRequestWithoutCacheContext(options) {
192
192
  }
193
193
  const contentType = options.request.headers.get("content-type") ?? "";
194
194
  if (contentType.includes("application/json")) {
195
+ const manifestResponse = validateServerActionManifest(options.serverActions?.allowedActions);
196
+ if (manifestResponse !== undefined) {
197
+ return manifestResponse;
198
+ }
195
199
  // JSON path delegates CSRF/replay to createServerActionHandler. The
196
200
  // registry is still needed here, but the handler short-circuits on
197
201
  // CSRF mismatch before invoking the action.
@@ -207,7 +211,6 @@ async function dispatchServerActionRequestWithoutCacheContext(options) {
207
211
  return jsonResponse({ ok: false, error: error instanceof Error ? error.message : String(error) }, 500);
208
212
  }
209
213
  const replayStore = options.serverActions?.replayStore ?? usedFormActionNonces;
210
- warnIfUnrestrictedServerActions(options.serverActions?.allowedActions);
211
214
  const handle = createServerActionHandler(jsonServerActionRegistry({
212
215
  allowedActions: options.serverActions?.allowedActions,
213
216
  appDir: options.appDir,
@@ -216,7 +219,8 @@ async function dispatchServerActionRequestWithoutCacheContext(options) {
216
219
  ...(options.serverActions?.authorize === undefined
217
220
  ? {}
218
221
  : { authorize: options.serverActions.authorize }),
219
- ...(options.serverActions?.allowedActions === undefined
222
+ ...(options.serverActions?.allowedActions === undefined ||
223
+ options.serverActions.allowedActions === "any"
220
224
  ? {}
221
225
  : { allowedActions: jsonAllowedServerActions(options.serverActions.allowedActions) }),
222
226
  csrf: true,
@@ -229,6 +233,10 @@ async function dispatchServerActionRequestWithoutCacheContext(options) {
229
233
  !contentType.includes("multipart/form-data")) {
230
234
  return jsonResponse({ ok: false, error: "Unsupported server action content type." }, 415);
231
235
  }
236
+ const manifestResponse = validateServerActionManifest(options.serverActions?.allowedActions);
237
+ if (manifestResponse !== undefined) {
238
+ return manifestResponse;
239
+ }
232
240
  const formData = await options.request.formData();
233
241
  const fieldCountResponse = validateServerActionFormFieldCount(formData, options.serverActions?.maxFormFields ?? DEFAULT_ACTION_FORM_MAX_FIELDS);
234
242
  if (fieldCountResponse !== undefined) {
@@ -415,9 +423,11 @@ function jsonServerActionRegistry(options) {
415
423
  for (const reference of inferredServerActionReferencesForApp(options.appDir).values()) {
416
424
  inferredKeys.add(serverActionKey(reference));
417
425
  }
418
- for (const reference of options.allowedActions ?? []) {
419
- if (reference.inferred === true) {
420
- inferredKeys.add(serverActionKey(reference));
426
+ if (Array.isArray(options.allowedActions)) {
427
+ for (const reference of options.allowedActions) {
428
+ if (reference.inferred === true) {
429
+ inferredKeys.add(serverActionKey(reference));
430
+ }
421
431
  }
422
432
  }
423
433
  if (inferredKeys.size === 0) {
@@ -439,6 +449,9 @@ function isAllowedServerAction(reference, allowedActions) {
439
449
  warnIfUnrestrictedServerActions(allowedActions);
440
450
  return true;
441
451
  }
452
+ if (allowedActions === "any") {
453
+ return true;
454
+ }
442
455
  return allowedActions.some((allowed) => allowed.moduleId === reference.moduleId && allowed.exportName === reference.exportName);
443
456
  }
444
457
  function warnIfUnrestrictedServerActions(allowedActions) {
@@ -450,6 +463,12 @@ function warnIfUnrestrictedServerActions(allowedActions) {
450
463
  warnedUnrestrictedServerActions = true;
451
464
  console.warn("[mreact] Server actions are running without an allowedActions manifest. Built app-router deployments generate this manifest automatically; direct production integrations should pass serverActions.allowedActions.");
452
465
  }
466
+ function validateServerActionManifest(allowedActions) {
467
+ if (allowedActions !== undefined || !isProductionEnvironment()) {
468
+ return undefined;
469
+ }
470
+ return jsonResponse({ ok: false, error: "Server action manifest required." }, 403);
471
+ }
453
472
  function lowerFormActions(options) {
454
473
  let code = options.code;
455
474
  const formReferences = collectFormActionExpressionReferences({ code: options.code });
@@ -526,9 +545,10 @@ async function collectImportedServerActions(options) {
526
545
  });
527
546
  }
528
547
  function isInferredServerActionReference(options) {
529
- if (options.allowedActions?.some((allowed) => allowed.inferred === true &&
530
- allowed.moduleId === options.moduleId &&
531
- allowed.exportName === options.exportName) === true) {
548
+ if (Array.isArray(options.allowedActions) &&
549
+ options.allowedActions.some((allowed) => allowed.inferred === true &&
550
+ allowed.moduleId === options.moduleId &&
551
+ allowed.exportName === options.exportName)) {
532
552
  return true;
533
553
  }
534
554
  return inferredServerActionReferencesForApp(options.appDir).has(`${options.moduleId}#${options.exportName}`);
@@ -1 +1 @@
1
- {"version":3,"file":"actions.js","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC/F,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EACL,qCAAqC,EACrC,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,yBAAyB,GAM1B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAA6B,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAuB,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAC1F,OAAO,EAAE,iCAAiC,EAA8B,MAAM,oBAAoB,CAAC;AACnG,OAAO,EAAE,OAAO,EAAuB,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,iBAAiB,EACjB,yBAAyB,EACzB,gBAAgB,GACjB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL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,GAAG,EAAE,QAAQ,CAAC;SACzB,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC;SACvB,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AAC7B,CAAC","sourcesContent":["import { createHash, createHmac, randomBytes, randomUUID, timingSafeEqual } from \"node:crypto\";\nimport { access, readdir, readFile } from \"node:fs/promises\";\nimport { dirname, join, relative, sep } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport {\n collectFormActionExpressionReferences,\n hasModuleDirective,\n} from \"@reckona/mreact-compiler\";\nimport {\n createServerActionHandler,\n type ServerActionHandlerOptions,\n type ServerActionRegistry,\n type ServerActionReplayStore,\n type ServerActionRequestReference,\n type ServerActionValidationResult,\n} from \"@reckona/mreact-server\";\nimport { bundleRouterModule, type RouterCompatBuildApi } from \"./bundle-pipeline.js\";\nimport { type AppRouterCache, withRouteCacheContext } from \"./cache.js\";\nimport { fileImportMetaUrlPlugin, importAppRouterSourceModule } from \"./module-runner.js\";\nimport { createAppRouterImportPolicyPlugin, type AppRouterImportPolicy } from \"./import-policy.js\";\nimport { cookies, type RequestCookies } from \"./navigation.js\";\nexport {\n createFormCsrfToken,\n formCsrfCookie,\n formCsrfFieldName,\n serverActionCookie,\n validateFormCsrf,\n} from \"./csrf.js\";\nimport {\n formCsrfFieldName,\n readExistingFormCsrfToken,\n validateFormCsrf,\n} from \"./csrf.js\";\nimport {\n collectRuntimeInferredServerActions,\n type ServerActionInferenceDiagnostic,\n} from \"./server-action-inference.js\";\n\nfunction isProductionEnvironment(): boolean {\n return process.env.NODE_ENV === \"production\";\n}\nconst formFieldModuleId = \"__mreact_module_id\";\nconst formFieldExportName = \"__mreact_export_name\";\nconst formFieldNonce = \"__mreact_action_nonce\";\nconst formFieldActionToken = \"__mreact_action_token\";\nconst actionTokenSecret = process.env.MREACT_SERVER_ACTION_SECRET ?? defaultActionTokenSecret();\n// Bounded default replay store for form-action nonces. The previous\n// implementation was an unbounded Set that grew with every successful\n// submission (Issue 069). Production callers should still pass a shared\n// store (Redis / KV) via `serverActions.replayStore` for multi-instance\n// deployments -- this default only guarantees replay protection within\n// a single process and is the safe fallback for dev / single-node setups.\n//\n// Retention model:\n// - TTL: 10 minutes. Form nonces are minted at SSR time and the user\n// has to submit before the cookie's SameSite=Lax window anyway; this\n// is generous for any realistic submit cadence.\n// - Max size: 50_000 entries. Old entries are evicted FIFO once the cap\n// is reached so a flood cannot trigger OOM.\n//\n// Both bounds are intentional defaults -- tight enough that a single\n// process cannot leak unbounded RSS, loose enough that legitimate\n// traffic does not trip false-positive 409s.\nconst DEFAULT_REPLAY_TTL_MS = 10 * 60 * 1000;\nconst DEFAULT_REPLAY_MAX_ENTRIES = 50_000;\nconst DEFAULT_ACTION_BODY_MAX_BYTES = 10 * 1024 * 1024;\nconst DEFAULT_ACTION_FORM_MAX_FIELDS = 1_000;\nlet warnedUnrestrictedServerActions = false;\n\nexport interface ServerActionContext {\n clientIp?: string | undefined;\n cookies: RequestCookies;\n headers: Headers;\n request: Request;\n}\n\nfunction defaultActionTokenSecret(): string {\n if (isProductionEnvironment()) {\n console.warn(\n \"mreact-router: MREACT_SERVER_ACTION_SECRET is not set. Inferred server action tokens use a per-process secret and may fail across multiple production instances.\",\n );\n }\n\n return randomBytes(32).toString(\"base64url\");\n}\n\nclass BoundedReplayStore {\n private readonly entries = new Map<string, number>();\n\n constructor(\n private readonly ttlMs: number,\n private readonly maxEntries: number,\n ) {}\n\n has(value: string): boolean {\n const expiresAt = this.entries.get(value);\n if (expiresAt === undefined) return false;\n if (expiresAt < Date.now()) {\n this.entries.delete(value);\n return false;\n }\n return true;\n }\n\n add(value: string): void {\n const now = Date.now();\n if (this.entries.size >= this.maxEntries) {\n const oldest = this.entries.entries().next().value;\n if (oldest !== undefined) {\n const [key, expiresAt] = oldest;\n this.entries.delete(key);\n if (expiresAt < now) {\n while (this.entries.size >= this.maxEntries) {\n const nextOldest = this.entries.entries().next().value;\n if (nextOldest === undefined || nextOldest[1] >= now) {\n break;\n }\n this.entries.delete(nextOldest[0]);\n }\n }\n }\n }\n this.entries.set(value, now + this.ttlMs);\n }\n\n // Exposed for tests; not part of the ServerActionReplayStore interface.\n size(): number {\n return this.entries.size;\n }\n}\n\nconst usedFormActionNonces = new BoundedReplayStore(\n DEFAULT_REPLAY_TTL_MS,\n DEFAULT_REPLAY_MAX_ENTRIES,\n);\n\n// Test helpers: drop all entries between cases / expose the bounded store\n// so tests can drive its eviction semantics directly. Not part of the\n// public surface (prefixed with `__`).\nexport function __clearDefaultReplayStore(): void {\n (usedFormActionNonces as unknown as { entries: Map<string, number> }).entries.clear();\n}\n\nexport function __readDefaultReplayStore(): BoundedReplayStore {\n return usedFormActionNonces;\n}\n\nexport interface AppRouterServerActionOptions {\n allowedActions?: readonly AppRouterAllowedServerAction[] | undefined;\n authorize?: ServerActionHandlerOptions[\"authorize\"] | undefined;\n maxBodyBytes?: number | undefined;\n maxFormFields?: number | undefined;\n replayStore?: ServerActionReplayStore | undefined;\n}\n\nexport interface AppRouterAllowedServerAction extends ServerActionRequestReference {\n inferred?: boolean | undefined;\n}\n\nexport interface PreparedRouteActions {\n actionNonce?: string;\n code: string;\n csrfToken?: string;\n diagnostics?: ServerActionInferenceDiagnostic[] | undefined;\n // True when the cookie should be (re)set on the response. False means\n // the incoming request already carried a valid CSRF cookie that the\n // render is reusing -- skipping Set-Cookie avoids cookie thrash across\n // concurrent tabs (Issue 070).\n csrfTokenIsNew?: boolean;\n hasFormActions: boolean;\n}\n\ninterface ActionReference {\n exportName: string;\n inferred: boolean;\n moduleId: string;\n}\n\nexport interface PreparedFormActionReference {\n end: number;\n expression: string;\n expressionEnd: number;\n expressionStart: number;\n exportName: string;\n inferred: boolean;\n moduleId: string;\n sourceHash: string;\n start: number;\n}\n\nconst inferredServerActionReferences = new Map<string, Map<string, Map<string, ActionReference>>>();\n\nexport async function prepareRouteServerActions(options: {\n appDir: string;\n code: string;\n formActionReferences?: readonly PreparedFormActionReference[] | undefined;\n pageFile: string;\n request?: Request | undefined;\n}): Promise<PreparedRouteActions> {\n if (options.formActionReferences !== undefined && options.formActionReferences.length === 0) {\n replaceInferredServerActionReferences(options.appDir, options.pageFile, new Map());\n return { code: options.code, hasFormActions: false };\n }\n\n if (!hasFormActionCandidate(options.code, options.pageFile)) {\n replaceInferredServerActionReferences(options.appDir, options.pageFile, new Map());\n return { code: options.code, hasFormActions: false };\n }\n\n const inference =\n options.formActionReferences === undefined\n ? await collectImportedServerActions(options)\n : {\n diagnostics: [],\n references: formActionReferenceMap(options.code, options.formActionReferences),\n };\n const { diagnostics, references } = inference;\n\n if (references.size === 0) {\n replaceInferredServerActionReferences(options.appDir, options.pageFile, new Map());\n return diagnostics.length === 0\n ? { code: options.code, hasFormActions: false }\n : { code: options.code, diagnostics, hasFormActions: false };\n }\n\n // Reuse the existing CSRF token when the browser already sent one.\n // Rotating the cookie on every render (Issue 070) broke concurrent\n // forms because the older tab's hidden input no longer matched the\n // cookie value. The actionNonce stays per-render -- that is the field\n // tied to a specific submission via replay protection.\n const existingToken = readExistingFormCsrfToken(options.request);\n const csrfToken = existingToken ?? randomUUID();\n const csrfTokenIsNew = existingToken === undefined;\n const actionNonce = randomUUID();\n const lowered = lowerFormActions({\n actionNonce,\n code: options.code,\n csrfToken,\n references,\n });\n\n if (lowered === options.code) {\n replaceInferredServerActionReferences(options.appDir, options.pageFile, new Map());\n return diagnostics.length === 0\n ? { code: options.code, hasFormActions: false }\n : { code: options.code, diagnostics, hasFormActions: false };\n }\n\n replaceInferredServerActionReferences(options.appDir, options.pageFile, references);\n\n return {\n actionNonce,\n code: lowered,\n csrfToken,\n csrfTokenIsNew,\n diagnostics,\n hasFormActions: true,\n };\n}\n\nfunction formActionReferenceMap(\n code: string,\n references: readonly PreparedFormActionReference[],\n): Map<string, ActionReference> {\n const sourceHash = formActionSourceHash(code);\n\n return new Map(\n references\n .filter((reference) => reference.sourceHash === sourceHash)\n .map((reference) => [\n formActionOccurrenceKey(reference),\n {\n exportName: reference.exportName,\n inferred: reference.inferred,\n moduleId: reference.moduleId,\n },\n ]),\n );\n}\n\nfunction hasFormActionCandidate(code: string, filename: string): boolean {\n return collectFormActionExpressionReferences({ code, filename }).length > 0;\n}\n\nexport async function dispatchServerActionRequest(options: {\n appDir: string;\n importPolicy?: AppRouterImportPolicy | undefined;\n request: Request;\n routeCache?: AppRouterCache | undefined;\n serverActionCacheVersion?: string | undefined;\n serverActions?: AppRouterServerActionOptions | undefined;\n}): Promise<Response> {\n const { revalidatedPaths, value } = await withRouteCacheContext(options.routeCache, () =>\n dispatchServerActionRequestWithoutCacheContext(options),\n );\n\n return withRevalidationHeader(value, revalidatedPaths);\n}\n\nasync function dispatchServerActionRequestWithoutCacheContext(options: {\n appDir: string;\n importPolicy?: AppRouterImportPolicy | undefined;\n request: Request;\n serverActionCacheVersion?: string | undefined;\n serverActions?: AppRouterServerActionOptions | undefined;\n}): Promise<Response> {\n // Validate everything we can statically before touching the filesystem\n // / bundler. A flood of malformed POSTs must not pay the registry-load\n // cost (Issue 067).\n if (options.request.method !== \"POST\") {\n return jsonResponse({ ok: false, error: \"Method not allowed.\" }, 405);\n }\n\n const bodySizeResponse = validateServerActionBodySize(\n options.request,\n options.serverActions?.maxBodyBytes ?? DEFAULT_ACTION_BODY_MAX_BYTES,\n );\n if (bodySizeResponse !== undefined) {\n return bodySizeResponse;\n }\n\n const originResponse = validateServerActionRequestOrigin(options.request);\n if (originResponse !== undefined) {\n return originResponse;\n }\n\n const contentType = options.request.headers.get(\"content-type\") ?? \"\";\n\n if (contentType.includes(\"application/json\")) {\n // JSON path delegates CSRF/replay to createServerActionHandler. The\n // registry is still needed here, but the handler short-circuits on\n // CSRF mismatch before invoking the action.\n let registry: ServerActionRegistry;\n try {\n registry = await loadServerActionRegistry({\n appDir: options.appDir,\n cacheVersion: options.serverActionCacheVersion,\n importPolicy: options.importPolicy,\n });\n } catch (error) {\n return jsonResponse(\n { ok: false, error: error instanceof Error ? error.message : String(error) },\n 500,\n );\n }\n\n const replayStore = options.serverActions?.replayStore ?? usedFormActionNonces;\n warnIfUnrestrictedServerActions(options.serverActions?.allowedActions);\n const handle = createServerActionHandler(jsonServerActionRegistry({\n allowedActions: options.serverActions?.allowedActions,\n appDir: options.appDir,\n registry,\n }), {\n ...(options.serverActions?.authorize === undefined\n ? {}\n : { authorize: options.serverActions.authorize }),\n ...(options.serverActions?.allowedActions === undefined\n ? {}\n : { allowedActions: jsonAllowedServerActions(options.serverActions.allowedActions) }),\n csrf: true,\n maxBodyBytes: options.serverActions?.maxBodyBytes ?? DEFAULT_ACTION_BODY_MAX_BYTES,\n replayProtection: { seen: replayStore },\n });\n\n return handle(options.request);\n }\n\n if (\n !contentType.includes(\"application/x-www-form-urlencoded\") &&\n !contentType.includes(\"multipart/form-data\")\n ) {\n return jsonResponse({ ok: false, error: \"Unsupported server action content type.\" }, 415);\n }\n\n const formData = await options.request.formData();\n const fieldCountResponse = validateServerActionFormFieldCount(\n formData,\n options.serverActions?.maxFormFields ?? DEFAULT_ACTION_FORM_MAX_FIELDS,\n );\n\n if (fieldCountResponse !== undefined) {\n return fieldCountResponse;\n }\n\n const csrfResponse = validateFormCsrf(options.request, formData);\n\n if (csrfResponse !== undefined) {\n return csrfResponse;\n }\n\n const moduleId = stringFormValue(formData.get(formFieldModuleId));\n const exportName = stringFormValue(formData.get(formFieldExportName));\n const nonce = stringFormValue(formData.get(formFieldNonce));\n\n if (moduleId === undefined || exportName === undefined || nonce === undefined) {\n return jsonResponse({ ok: false, error: \"Invalid server action reference.\" }, 400);\n }\n\n if (!isAllowedServerAction({ moduleId, exportName }, options.serverActions?.allowedActions)) {\n return jsonResponse({ ok: false, error: \"Unknown server action.\" }, 404);\n }\n\n if (\n isInferredServerActionReference({\n allowedActions: options.serverActions?.allowedActions,\n appDir: options.appDir,\n exportName,\n moduleId,\n }) &&\n !isValidFormActionToken({\n csrfToken: stringFormValue(formData.get(formCsrfFieldName)),\n exportName,\n moduleId,\n nonce,\n token: stringFormValue(formData.get(formFieldActionToken)),\n })\n ) {\n return jsonResponse({ ok: false, error: \"Unknown server action.\" }, 404);\n }\n\n const nonceResponse = validateFormNonce(\n formData,\n options.serverActions?.replayStore ?? usedFormActionNonces,\n );\n\n if (nonceResponse !== undefined) {\n return nonceResponse;\n }\n\n let registry: ServerActionRegistry;\n try {\n registry = await loadServerActionRegistry({\n appDir: options.appDir,\n cacheVersion: options.serverActionCacheVersion,\n importPolicy: options.importPolicy,\n });\n } catch (error) {\n return jsonResponse(\n { ok: false, error: error instanceof Error ? error.message : String(error) },\n 500,\n );\n }\n\n const action = registry[`${moduleId}#${exportName}`];\n\n if (typeof action !== \"function\") {\n return jsonResponse({ ok: false, error: \"Unknown server action.\" }, 404);\n }\n\n const actionFormData = cleanActionFormData(formData);\n const authorizationResponse = await authorizeFormAction({\n args: [actionFormData],\n authorize: options.serverActions?.authorize,\n exportName,\n moduleId,\n request: options.request,\n });\n\n if (authorizationResponse !== undefined) {\n return authorizationResponse;\n }\n\n try {\n const value = await action(actionFormData, createServerActionContext(options.request));\n\n if (value instanceof Response) {\n return value;\n }\n\n if (value === undefined || value === null) {\n return redirectToFormReferer(options.request);\n }\n\n return jsonResponse({ ok: true, value }, 200);\n } catch (error) {\n return jsonResponse(\n { ok: false, error: error instanceof Error ? error.message : String(error) },\n 500,\n );\n }\n}\n\nfunction createServerActionContext(request: Request): ServerActionContext {\n const clientIp = clientIpFromRequest(request);\n\n return {\n ...(clientIp === undefined ? {} : { clientIp }),\n cookies: cookies(request),\n headers: request.headers,\n request,\n };\n}\n\nfunction clientIpFromRequest(request: Request): string | undefined {\n const forwarded = request.headers.get(\"x-forwarded-for\")?.split(\",\")[0]?.trim();\n\n if (forwarded !== undefined && forwarded !== \"\") {\n return forwarded;\n }\n\n const realIp = request.headers.get(\"x-real-ip\")?.trim();\n return realIp === \"\" ? undefined : realIp;\n}\n\nfunction validateServerActionBodySize(\n request: Request,\n maxBodyBytes: number,\n): Response | undefined {\n if (!Number.isFinite(maxBodyBytes) || maxBodyBytes < 0) {\n return undefined;\n }\n\n const contentLength = request.headers.get(\"content-length\");\n if (contentLength === null) {\n return undefined;\n }\n\n const bytes = Number(contentLength);\n if (!Number.isFinite(bytes) || bytes < 0) {\n return jsonResponse({ ok: false, error: \"Invalid Content-Length header.\" }, 400);\n }\n\n if (bytes > maxBodyBytes) {\n return jsonResponse({ ok: false, error: \"Server action request body is too large.\" }, 413);\n }\n\n return undefined;\n}\n\nfunction validateServerActionFormFieldCount(\n formData: FormData,\n maxFormFields: number,\n): Response | undefined {\n if (!Number.isFinite(maxFormFields) || maxFormFields < 0) {\n return undefined;\n }\n\n let count = 0;\n for (const _ of formData.keys()) {\n count += 1;\n if (count > maxFormFields) {\n return jsonResponse({\n ok: false,\n error: \"Server action form field count is too large.\",\n }, 413);\n }\n }\n\n return undefined;\n}\n\nfunction redirectToFormReferer(request: Request): Response {\n return new Response(null, {\n status: 303,\n headers: {\n location: sameOriginRefererPath(request) ?? \"/\",\n },\n });\n}\n\nfunction sameOriginRefererPath(request: Request): string | undefined {\n const referer = request.headers.get(\"referer\");\n\n if (referer === null) {\n return undefined;\n }\n\n try {\n const requestUrl = new URL(request.url);\n const refererUrl = new URL(referer, requestUrl);\n\n return refererUrl.origin === requestUrl.origin\n ? `${refererUrl.pathname}${refererUrl.search}`\n : undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction withRevalidationHeader(response: Response, paths: string[]): Response {\n if (paths.length > 0) {\n response.headers.set(\"x-mreact-revalidate\", paths.join(\",\"));\n }\n\n return response;\n}\n\nasync function authorizeFormAction(options: {\n args: unknown[];\n authorize?: ServerActionHandlerOptions[\"authorize\"];\n exportName: string;\n moduleId: string;\n request: Request;\n}): Promise<Response | undefined> {\n const reference: ServerActionRequestReference = {\n exportName: options.exportName,\n moduleId: options.moduleId,\n };\n const authorizationResult = await options.authorize?.(options.request, reference, options.args);\n\n return authorizationResult !== undefined && authorizationResult !== true\n ? jsonResponse(\n {\n ok: false,\n error: authorizationError(authorizationResult),\n },\n 403,\n )\n : undefined;\n}\n\nfunction authorizationError(result: Exclude<ServerActionValidationResult, true>): string {\n return typeof result === \"string\" ? result : \"Server action not authorized.\";\n}\n\nfunction jsonAllowedServerActions(\n allowedActions: readonly AppRouterAllowedServerAction[],\n): ServerActionRequestReference[] {\n return allowedActions\n .filter((reference) => reference.inferred !== true)\n .map((reference) => ({\n exportName: reference.exportName,\n moduleId: reference.moduleId,\n }));\n}\n\nfunction jsonServerActionRegistry(options: {\n allowedActions: readonly AppRouterAllowedServerAction[] | undefined;\n appDir: string;\n registry: ServerActionRegistry;\n}): ServerActionRegistry {\n const inferredKeys = new Set<string>();\n\n for (const reference of inferredServerActionReferencesForApp(options.appDir).values()) {\n inferredKeys.add(serverActionKey(reference));\n }\n\n for (const reference of options.allowedActions ?? []) {\n if (reference.inferred === true) {\n inferredKeys.add(serverActionKey(reference));\n }\n }\n\n if (inferredKeys.size === 0) {\n return options.registry;\n }\n\n const registry: ServerActionRegistry = {};\n\n for (const [key, value] of Object.entries(options.registry)) {\n if (!inferredKeys.has(key)) {\n registry[key] = value;\n }\n }\n\n return registry;\n}\n\nfunction serverActionKey(reference: ServerActionRequestReference): string {\n return `${reference.moduleId}#${reference.exportName}`;\n}\n\nfunction isAllowedServerAction(\n reference: ServerActionRequestReference,\n allowedActions: readonly AppRouterAllowedServerAction[] | undefined,\n): boolean {\n if (allowedActions === undefined) {\n warnIfUnrestrictedServerActions(allowedActions);\n return true;\n }\n\n return allowedActions.some(\n (allowed) =>\n allowed.moduleId === reference.moduleId && allowed.exportName === reference.exportName,\n );\n}\n\nfunction warnIfUnrestrictedServerActions(\n allowedActions: readonly AppRouterAllowedServerAction[] | undefined,\n): void {\n if (\n allowedActions !== undefined ||\n !isProductionEnvironment() ||\n warnedUnrestrictedServerActions\n ) {\n return;\n }\n\n warnedUnrestrictedServerActions = true;\n console.warn(\n \"[mreact] Server actions are running without an allowedActions manifest. Built app-router deployments generate this manifest automatically; direct production integrations should pass serverActions.allowedActions.\",\n );\n}\n\nfunction lowerFormActions(options: {\n actionNonce: string;\n code: string;\n csrfToken: string;\n references: Map<string, ActionReference>;\n}): string {\n let code = options.code;\n const formReferences = collectFormActionExpressionReferences({ code: options.code });\n\n for (const formReference of [...formReferences].reverse()) {\n const reference = options.references.get(formActionOccurrenceKey(formReference));\n\n if (reference === undefined) {\n continue;\n }\n\n const opening = code.slice(formReference.start, formReference.end);\n const loweredOpening = lowerFormActionOpening({\n actionNonce: options.actionNonce,\n csrfToken: options.csrfToken,\n opening,\n reference,\n referenceName: formReference.expression,\n });\n\n if (loweredOpening === opening) {\n continue;\n }\n\n code = `${code.slice(0, formReference.start)}${loweredOpening}${code.slice(formReference.end)}`;\n }\n\n return code;\n}\n\nfunction formActionOccurrenceKey(reference: {\n end: number;\n expression: string;\n expressionEnd: number;\n expressionStart: number;\n start: number;\n}): string {\n return [\n reference.start,\n reference.end,\n reference.expressionStart,\n reference.expressionEnd,\n reference.expression,\n ].join(\":\");\n}\n\nfunction formActionSourceHash(code: string): string {\n return createHash(\"sha256\").update(code).digest(\"base64url\");\n}\n\nfunction lowerFormActionOpening(options: {\n actionNonce: string;\n csrfToken: string;\n opening: string;\n reference: ActionReference;\n referenceName: string;\n}): string {\n const actionPattern = new RegExp(\n `^(?<prefix><form\\\\b[\\\\s\\\\S]*?)\\\\saction=\\\\{${escapeRegExp(options.referenceName)}\\\\}(?<suffix>[\\\\s\\\\S]*?)>$`,\n \"u\",\n );\n const match = options.opening.match(actionPattern);\n const prefix = match?.groups?.prefix;\n const suffix = match?.groups?.suffix;\n\n if (prefix === undefined || suffix === undefined) {\n return options.opening;\n }\n\n const attrs = `${prefix.slice(\"<form\".length)}${suffix}`.replace(\n /\\s+method=(?:\"[^\"]*\"|'[^']*'|\\{[^}]*\\})/g,\n \"\",\n );\n const hidden = [\n hiddenInput(formFieldModuleId, options.reference.moduleId),\n hiddenInput(formFieldExportName, options.reference.exportName),\n hiddenInput(formCsrfFieldName, options.csrfToken),\n hiddenInput(formFieldNonce, options.actionNonce),\n hiddenInput(\n formFieldActionToken,\n formActionToken({\n csrfToken: options.csrfToken,\n exportName: options.reference.exportName,\n moduleId: options.reference.moduleId,\n nonce: options.actionNonce,\n }),\n ),\n ].join(\"\");\n\n return `<form${attrs} method=\"post\" action=\"/_mreact/actions\">${hidden}`;\n}\n\nfunction escapeRegExp(value: string): string {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n\nfunction hiddenInput(name: string, value: string): string {\n return `<input type=\"hidden\" name=\"${escapeAttribute(name)}\" value=\"${escapeAttribute(value)}\" />`;\n}\n\nasync function collectImportedServerActions(options: {\n appDir: string;\n code: string;\n pageFile: string;\n}): Promise<{\n diagnostics: ServerActionInferenceDiagnostic[];\n references: Map<string, ActionReference>;\n}> {\n return await collectRuntimeInferredServerActions({\n appDir: options.appDir,\n code: options.code,\n fileSystem: {\n isUseServerFile,\n resolveSourceFile,\n },\n pageFile: options.pageFile,\n });\n}\n\nfunction isInferredServerActionReference(options: {\n allowedActions: readonly AppRouterAllowedServerAction[] | undefined;\n appDir: string;\n exportName: string;\n moduleId: string;\n}): boolean {\n if (\n options.allowedActions?.some(\n (allowed) =>\n allowed.inferred === true &&\n allowed.moduleId === options.moduleId &&\n allowed.exportName === options.exportName,\n ) === true\n ) {\n return true;\n }\n\n return inferredServerActionReferencesForApp(options.appDir).has(\n `${options.moduleId}#${options.exportName}`,\n );\n}\n\nfunction formActionToken(options: {\n csrfToken: string;\n exportName: string;\n moduleId: string;\n nonce: string;\n}): string {\n return createHmac(\"sha256\", actionTokenSecret)\n .update(options.moduleId)\n .update(\"\\0\")\n .update(options.exportName)\n .update(\"\\0\")\n .update(options.csrfToken)\n .update(\"\\0\")\n .update(options.nonce)\n .digest(\"base64url\");\n}\n\nfunction isValidFormActionToken(options: {\n csrfToken: string | undefined;\n exportName: string;\n moduleId: string;\n nonce: string;\n token: string | undefined;\n}): boolean {\n if (options.csrfToken === undefined || options.token === undefined) {\n return false;\n }\n\n const expected = Buffer.from(\n formActionToken({\n csrfToken: options.csrfToken,\n exportName: options.exportName,\n moduleId: options.moduleId,\n nonce: options.nonce,\n }),\n );\n const actual = Buffer.from(options.token);\n\n return actual.length === expected.length && timingSafeEqual(actual, expected);\n}\n\nfunction replaceInferredServerActionReferences(\n appDir: string,\n pageFile: string,\n references: ReadonlyMap<string, ActionReference>,\n): void {\n const nextReferences = new Map(\n Array.from(references.values())\n .filter((reference) => reference.inferred)\n .map((reference) => [`${reference.moduleId}#${reference.exportName}`, reference]),\n );\n let appReferencesByPage = inferredServerActionReferences.get(appDir);\n const previousReferences = appReferencesByPage?.get(pageFile) ?? new Map();\n const changed = !sameActionReferenceKeys(previousReferences, nextReferences);\n\n if (!changed) {\n return;\n }\n\n if (nextReferences.size === 0) {\n appReferencesByPage?.delete(pageFile);\n if (appReferencesByPage?.size === 0) {\n inferredServerActionReferences.delete(appDir);\n }\n } else {\n if (appReferencesByPage === undefined) {\n appReferencesByPage = new Map();\n inferredServerActionReferences.set(appDir, appReferencesByPage);\n }\n appReferencesByPage.set(pageFile, nextReferences);\n }\n\n clearServerActionRegistryCacheForApp(appDir);\n}\n\n// Cache the (expensive) collect+bundle+evaluate work keyed by appDir +\n// caller-supplied version. Production callers pass the build-time hash\n// (serverModuleCacheVersion) so the registry is reused for the lifetime\n// of one deployment. Dev callers omit the version; the entry is then\n// keyed on \"dev\" so the work happens once per process — restarts handle\n// invalidation. Concurrent callers share a single in-flight promise.\nconst serverActionRegistryCache = new Map<string, Promise<ServerActionRegistry>>();\n\nasync function loadServerActionRegistry(options: {\n appDir: string;\n cacheVersion?: string | undefined;\n importPolicy?: AppRouterImportPolicy | undefined;\n}): Promise<ServerActionRegistry> {\n const cacheKey = `${options.appDir}::${options.cacheVersion ?? \"dev\"}`;\n const cached = serverActionRegistryCache.get(cacheKey);\n\n if (cached !== undefined) {\n return cached;\n }\n\n const pending = buildServerActionRegistry(options).catch((error) => {\n // Drop the failed promise so a retry can re-run the load.\n serverActionRegistryCache.delete(cacheKey);\n throw error;\n });\n serverActionRegistryCache.set(cacheKey, pending);\n return pending;\n}\n\nasync function buildServerActionRegistry(options: {\n appDir: string;\n importPolicy?: AppRouterImportPolicy | undefined;\n}): Promise<ServerActionRegistry> {\n const files = await collectFiles(options.appDir);\n const registry: ServerActionRegistry = {};\n const inferredReferences = inferredServerActionReferencesForApp(options.appDir);\n\n for (const file of files) {\n const moduleId = moduleIdForFile(options.appDir, file);\n const inferredExportNames = inferredExportNamesForModule(inferredReferences, moduleId);\n const useServerFile = await isUseServerFile(file);\n\n if (!useServerFile && inferredExportNames.size === 0) {\n continue;\n }\n\n const module = await importServerActionModule({\n appDir: options.appDir,\n file,\n importPolicy: options.importPolicy,\n });\n\n for (const [exportName, value] of Object.entries(module)) {\n if (typeof value === \"function\" && (useServerFile || inferredExportNames.has(exportName))) {\n registry[`${moduleId}#${exportName}`] = value as (...args: unknown[]) => unknown;\n }\n }\n }\n\n return registry;\n}\n\n// Exposed for tests that need a clean slate between cases (in-process state).\nexport function __clearServerActionRegistryCache(): void {\n serverActionRegistryCache.clear();\n inferredServerActionReferences.clear();\n}\n\nfunction clearServerActionRegistryCacheForApp(appDir: string): void {\n const prefix = `${appDir}::`;\n\n for (const key of serverActionRegistryCache.keys()) {\n if (key.startsWith(prefix)) {\n serverActionRegistryCache.delete(key);\n }\n }\n}\n\nfunction sameActionReferenceKeys(\n left: ReadonlyMap<string, ActionReference>,\n right: ReadonlyMap<string, ActionReference>,\n): boolean {\n if (left.size !== right.size) {\n return false;\n }\n\n for (const key of left.keys()) {\n if (!right.has(key)) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction inferredServerActionReferencesForApp(appDir: string): Map<string, ActionReference> {\n const references = new Map<string, ActionReference>();\n const appReferencesByPage = inferredServerActionReferences.get(appDir);\n\n if (appReferencesByPage === undefined) {\n return references;\n }\n\n for (const pageReferences of appReferencesByPage.values()) {\n for (const [key, reference] of pageReferences) {\n references.set(key, reference);\n }\n }\n\n return references;\n}\n\nfunction inferredExportNamesForModule(\n references: ReadonlyMap<string, ActionReference>,\n moduleId: string,\n): Set<string> {\n const names = new Set<string>();\n\n for (const reference of references.values()) {\n if (reference.moduleId === moduleId) {\n names.add(reference.exportName);\n }\n }\n\n return names;\n}\n\nasync function importServerActionModule(options: {\n appDir: string;\n file: string;\n importPolicy?: AppRouterImportPolicy | undefined;\n}): Promise<Record<string, unknown>> {\n const bundled = await bundleRouterModule({\n code: `export * from ${JSON.stringify(options.file)};`,\n filename: options.file,\n platform: \"node\",\n plugins: [\n fileImportMetaUrlPlugin(),\n serverActionRuntimePlugin(),\n createAppRouterImportPolicyPlugin({\n appDir: options.appDir,\n importPolicy: options.importPolicy,\n label: \"Server action\",\n }),\n ],\n });\n const code = bundled.code;\n\n if (code === undefined) {\n throw new Error(`Failed to compile server action module ${options.file}.`);\n }\n\n return importAppRouterSourceModule<Record<string, unknown>>({\n code,\n label: `server-action:${options.file}`,\n });\n}\n\nfunction serverActionRuntimePlugin() {\n const currentDir = dirname(fileURLToPath(import.meta.url));\n const cachePath = join(currentDir, currentDir.endsWith(`${sep}dist`) ? \"cache.js\" : \"cache.ts\");\n\n return {\n name: \"mreact-router-server-action-runtime\",\n setup(buildApi: RouterCompatBuildApi) {\n buildApi.onResolve({ filter: /^@reckona\\/mreact-router$/ }, () => ({\n namespace: \"mreact-router-server-api\",\n path: \"index\",\n }));\n buildApi.onLoad({ filter: /^index$/, namespace: \"mreact-router-server-api\" }, () => ({\n contents: `export { revalidatePath } from ${JSON.stringify(cachePath)};`,\n loader: \"ts\",\n resolveDir: dirname(cachePath),\n }));\n },\n };\n}\n\nasync function collectFiles(directory: string): Promise<string[]> {\n const entries = await readdir(directory, { withFileTypes: true });\n const files: string[] = [];\n\n for (const entry of entries) {\n const path = join(directory, entry.name);\n\n if (entry.isDirectory()) {\n files.push(...(await collectFiles(path)));\n continue;\n }\n\n if (entry.isFile() && /\\.(?:mreact\\.tsx|tsx|ts)$/.test(entry.name)) {\n files.push(path);\n }\n }\n\n return files;\n}\n\nasync function resolveSourceFile(directory: string, source: string): Promise<string | undefined> {\n const base = join(directory, source);\n const tsEsmBase = /\\.[cm]?js$/.test(base) ? base.replace(/\\.[cm]?js$/, \"\") : undefined;\n const candidates = [\n base,\n ...(tsEsmBase === undefined\n ? []\n : [\n `${tsEsmBase}.ts`,\n `${tsEsmBase}.tsx`,\n `${tsEsmBase}.mreact.tsx`,\n join(tsEsmBase, \"index.ts\"),\n join(tsEsmBase, \"index.tsx\"),\n ]),\n `${base}.ts`,\n `${base}.tsx`,\n `${base}.mreact.tsx`,\n join(base, \"index.ts\"),\n join(base, \"index.tsx\"),\n ];\n\n for (const candidate of candidates) {\n try {\n await access(candidate);\n return candidate;\n } catch {\n // Try the next candidate.\n }\n }\n\n return undefined;\n}\n\nasync function isUseServerFile(file: string): Promise<boolean> {\n const code = await readFile(file, \"utf8\");\n\n return hasModuleDirective({ code, directive: \"use server\", filename: file });\n}\n\nfunction moduleIdForFile(appDir: string, file: string): string {\n return relative(appDir, file).split(sep).join(\"/\");\n}\n\nfunction validateServerActionRequestOrigin(request: Request): Response | undefined {\n if (!isProductionEnvironment()) {\n return undefined;\n }\n\n const expectedOrigin = new URL(request.url).origin;\n const origin = request.headers.get(\"origin\");\n\n if (origin !== null) {\n return origin === expectedOrigin\n ? undefined\n : jsonResponse({ ok: false, error: \"Origin not allowed.\" }, 403);\n }\n\n const referer = request.headers.get(\"referer\");\n\n if (referer === null) {\n return jsonResponse({ ok: false, error: \"Origin not allowed.\" }, 403);\n }\n\n try {\n return new URL(referer).origin === expectedOrigin\n ? undefined\n : jsonResponse({ ok: false, error: \"Origin not allowed.\" }, 403);\n } catch {\n return jsonResponse({ ok: false, error: \"Origin not allowed.\" }, 403);\n }\n}\n\nfunction validateFormNonce(\n formData: FormData,\n replayStore: ServerActionReplayStore,\n): Response | undefined {\n const nonce = stringFormValue(formData.get(formFieldNonce));\n\n if (nonce === undefined || nonce.length === 0) {\n return jsonResponse({ ok: false, error: \"Missing server action nonce.\" }, 400);\n }\n\n if (replayStore.has(nonce)) {\n return jsonResponse({ ok: false, error: \"Server action nonce was already used.\" }, 409);\n }\n\n replayStore.add(nonce);\n return undefined;\n}\n\nfunction cleanActionFormData(formData: FormData): FormData {\n const cleaned = new FormData();\n\n for (const [name, value] of formData.entries()) {\n if (\n name !== formFieldModuleId &&\n name !== formFieldExportName &&\n name !== formCsrfFieldName &&\n name !== formFieldNonce &&\n name !== formFieldActionToken\n ) {\n cleaned.append(name, value);\n }\n }\n\n return cleaned;\n}\n\nfunction stringFormValue(value: FormDataEntryValue | null): string | undefined {\n return typeof value === \"string\" ? value : undefined;\n}\n\nfunction jsonResponse(payload: unknown, status: number): Response {\n return new Response(JSON.stringify(payload), {\n headers: { \"content-type\": \"application/json; charset=utf-8\" },\n status,\n });\n}\n\nfunction escapeAttribute(value: string): string {\n return value\n .replaceAll(\"&\", \"&amp;\")\n .replaceAll('\"', \"&quot;\")\n .replaceAll(\"<\", \"&lt;\")\n .replaceAll(\">\", \"&gt;\");\n}\n"]}
1
+ {"version":3,"file":"actions.js","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC/F,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EACL,qCAAqC,EACrC,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,yBAAyB,GAM1B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAA6B,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAuB,qBA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M,CAAC;SACvB,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AAC7B,CAAC","sourcesContent":["import { createHash, createHmac, randomBytes, randomUUID, timingSafeEqual } from \"node:crypto\";\nimport { access, readdir, readFile } from \"node:fs/promises\";\nimport { dirname, join, relative, sep } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport {\n collectFormActionExpressionReferences,\n hasModuleDirective,\n} from \"@reckona/mreact-compiler\";\nimport {\n createServerActionHandler,\n type ServerActionHandlerOptions,\n type ServerActionRegistry,\n type ServerActionReplayStore,\n type ServerActionRequestReference,\n type ServerActionValidationResult,\n} from \"@reckona/mreact-server\";\nimport { bundleRouterModule, type RouterCompatBuildApi } from \"./bundle-pipeline.js\";\nimport { type AppRouterCache, withRouteCacheContext } from \"./cache.js\";\nimport { fileImportMetaUrlPlugin, importAppRouterSourceModule } from \"./module-runner.js\";\nimport { createAppRouterImportPolicyPlugin, type AppRouterImportPolicy } from \"./import-policy.js\";\nimport { cookies, type RequestCookies } from \"./navigation.js\";\nexport {\n createFormCsrfToken,\n formCsrfCookie,\n formCsrfFieldName,\n serverActionCookie,\n validateFormCsrf,\n} from \"./csrf.js\";\nimport {\n formCsrfFieldName,\n readExistingFormCsrfToken,\n validateFormCsrf,\n} from \"./csrf.js\";\nimport {\n collectRuntimeInferredServerActions,\n type ServerActionInferenceDiagnostic,\n} from \"./server-action-inference.js\";\n\nfunction isProductionEnvironment(): boolean {\n return process.env.NODE_ENV === \"production\";\n}\nconst formFieldModuleId = \"__mreact_module_id\";\nconst formFieldExportName = \"__mreact_export_name\";\nconst formFieldNonce = \"__mreact_action_nonce\";\nconst formFieldActionToken = \"__mreact_action_token\";\nconst actionTokenSecret = process.env.MREACT_SERVER_ACTION_SECRET ?? defaultActionTokenSecret();\n// Bounded default replay store for form-action nonces. The previous\n// implementation was an unbounded Set that grew with every successful\n// submission (Issue 069). Production callers should still pass a shared\n// store (Redis / KV) via `serverActions.replayStore` for multi-instance\n// deployments -- this default only guarantees replay protection within\n// a single process and is the safe fallback for dev / single-node setups.\n//\n// Retention model:\n// - TTL: 10 minutes. Form nonces are minted at SSR time and the user\n// has to submit before the cookie's SameSite=Lax window anyway; this\n// is generous for any realistic submit cadence.\n// - Max size: 50_000 entries. Old entries are evicted FIFO once the cap\n// is reached so a flood cannot trigger OOM.\n//\n// Both bounds are intentional defaults -- tight enough that a single\n// process cannot leak unbounded RSS, loose enough that legitimate\n// traffic does not trip false-positive 409s.\nconst DEFAULT_REPLAY_TTL_MS = 10 * 60 * 1000;\nconst DEFAULT_REPLAY_MAX_ENTRIES = 50_000;\nconst DEFAULT_ACTION_BODY_MAX_BYTES = 10 * 1024 * 1024;\nconst DEFAULT_ACTION_FORM_MAX_FIELDS = 1_000;\nlet warnedUnrestrictedServerActions = false;\n\nexport interface ServerActionContext {\n clientIp?: string | undefined;\n cookies: RequestCookies;\n headers: Headers;\n request: Request;\n}\n\nfunction defaultActionTokenSecret(): string {\n if (isProductionEnvironment()) {\n console.warn(\n \"mreact-router: MREACT_SERVER_ACTION_SECRET is not set. Inferred server action tokens use a per-process secret and may fail across multiple production instances.\",\n );\n }\n\n return randomBytes(32).toString(\"base64url\");\n}\n\nclass BoundedReplayStore {\n private readonly entries = new Map<string, number>();\n\n constructor(\n private readonly ttlMs: number,\n private readonly maxEntries: number,\n ) {}\n\n has(value: string): boolean {\n const expiresAt = this.entries.get(value);\n if (expiresAt === undefined) return false;\n if (expiresAt < Date.now()) {\n this.entries.delete(value);\n return false;\n }\n return true;\n }\n\n add(value: string): void {\n const now = Date.now();\n if (this.entries.size >= this.maxEntries) {\n const oldest = this.entries.entries().next().value;\n if (oldest !== undefined) {\n const [key, expiresAt] = oldest;\n this.entries.delete(key);\n if (expiresAt < now) {\n while (this.entries.size >= this.maxEntries) {\n const nextOldest = this.entries.entries().next().value;\n if (nextOldest === undefined || nextOldest[1] >= now) {\n break;\n }\n this.entries.delete(nextOldest[0]);\n }\n }\n }\n }\n this.entries.set(value, now + this.ttlMs);\n }\n\n // Exposed for tests; not part of the ServerActionReplayStore interface.\n size(): number {\n return this.entries.size;\n }\n}\n\nconst usedFormActionNonces = new BoundedReplayStore(\n DEFAULT_REPLAY_TTL_MS,\n DEFAULT_REPLAY_MAX_ENTRIES,\n);\n\n// Test helpers: drop all entries between cases / expose the bounded store\n// so tests can drive its eviction semantics directly. Not part of the\n// public surface (prefixed with `__`).\nexport function __clearDefaultReplayStore(): void {\n (usedFormActionNonces as unknown as { entries: Map<string, number> }).entries.clear();\n}\n\nexport function __readDefaultReplayStore(): BoundedReplayStore {\n return usedFormActionNonces;\n}\n\nexport interface AppRouterServerActionOptions {\n allowedActions?: readonly AppRouterAllowedServerAction[] | \"any\" | undefined;\n authorize?: ServerActionHandlerOptions[\"authorize\"] | undefined;\n maxBodyBytes?: number | undefined;\n maxFormFields?: number | undefined;\n replayStore?: ServerActionReplayStore | undefined;\n}\n\nexport interface AppRouterAllowedServerAction extends ServerActionRequestReference {\n inferred?: boolean | undefined;\n}\n\nexport interface PreparedRouteActions {\n actionNonce?: string;\n code: string;\n csrfToken?: string;\n diagnostics?: ServerActionInferenceDiagnostic[] | undefined;\n // True when the cookie should be (re)set on the response. False means\n // the incoming request already carried a valid CSRF cookie that the\n // render is reusing -- skipping Set-Cookie avoids cookie thrash across\n // concurrent tabs (Issue 070).\n csrfTokenIsNew?: boolean;\n hasFormActions: boolean;\n}\n\ninterface ActionReference {\n exportName: string;\n inferred: boolean;\n moduleId: string;\n}\n\nexport interface PreparedFormActionReference {\n end: number;\n expression: string;\n expressionEnd: number;\n expressionStart: number;\n exportName: string;\n inferred: boolean;\n moduleId: string;\n sourceHash: string;\n start: number;\n}\n\nconst inferredServerActionReferences = new Map<string, Map<string, Map<string, ActionReference>>>();\n\nexport async function prepareRouteServerActions(options: {\n appDir: string;\n code: string;\n formActionReferences?: readonly PreparedFormActionReference[] | undefined;\n pageFile: string;\n request?: Request | undefined;\n}): Promise<PreparedRouteActions> {\n if (options.formActionReferences !== undefined && options.formActionReferences.length === 0) {\n replaceInferredServerActionReferences(options.appDir, options.pageFile, new Map());\n return { code: options.code, hasFormActions: false };\n }\n\n if (!hasFormActionCandidate(options.code, options.pageFile)) {\n replaceInferredServerActionReferences(options.appDir, options.pageFile, new Map());\n return { code: options.code, hasFormActions: false };\n }\n\n const inference =\n options.formActionReferences === undefined\n ? await collectImportedServerActions(options)\n : {\n diagnostics: [],\n references: formActionReferenceMap(options.code, options.formActionReferences),\n };\n const { diagnostics, references } = inference;\n\n if (references.size === 0) {\n replaceInferredServerActionReferences(options.appDir, options.pageFile, new Map());\n return diagnostics.length === 0\n ? { code: options.code, hasFormActions: false }\n : { code: options.code, diagnostics, hasFormActions: false };\n }\n\n // Reuse the existing CSRF token when the browser already sent one.\n // Rotating the cookie on every render (Issue 070) broke concurrent\n // forms because the older tab's hidden input no longer matched the\n // cookie value. The actionNonce stays per-render -- that is the field\n // tied to a specific submission via replay protection.\n const existingToken = readExistingFormCsrfToken(options.request);\n const csrfToken = existingToken ?? randomUUID();\n const csrfTokenIsNew = existingToken === undefined;\n const actionNonce = randomUUID();\n const lowered = lowerFormActions({\n actionNonce,\n code: options.code,\n csrfToken,\n references,\n });\n\n if (lowered === options.code) {\n replaceInferredServerActionReferences(options.appDir, options.pageFile, new Map());\n return diagnostics.length === 0\n ? { code: options.code, hasFormActions: false }\n : { code: options.code, diagnostics, hasFormActions: false };\n }\n\n replaceInferredServerActionReferences(options.appDir, options.pageFile, references);\n\n return {\n actionNonce,\n code: lowered,\n csrfToken,\n csrfTokenIsNew,\n diagnostics,\n hasFormActions: true,\n };\n}\n\nfunction formActionReferenceMap(\n code: string,\n references: readonly PreparedFormActionReference[],\n): Map<string, ActionReference> {\n const sourceHash = formActionSourceHash(code);\n\n return new Map(\n references\n .filter((reference) => reference.sourceHash === sourceHash)\n .map((reference) => [\n formActionOccurrenceKey(reference),\n {\n exportName: reference.exportName,\n inferred: reference.inferred,\n moduleId: reference.moduleId,\n },\n ]),\n );\n}\n\nfunction hasFormActionCandidate(code: string, filename: string): boolean {\n return collectFormActionExpressionReferences({ code, filename }).length > 0;\n}\n\nexport async function dispatchServerActionRequest(options: {\n appDir: string;\n importPolicy?: AppRouterImportPolicy | undefined;\n request: Request;\n routeCache?: AppRouterCache | undefined;\n serverActionCacheVersion?: string | undefined;\n serverActions?: AppRouterServerActionOptions | undefined;\n}): Promise<Response> {\n const { revalidatedPaths, value } = await withRouteCacheContext(options.routeCache, () =>\n dispatchServerActionRequestWithoutCacheContext(options),\n );\n\n return withRevalidationHeader(value, revalidatedPaths);\n}\n\nasync function dispatchServerActionRequestWithoutCacheContext(options: {\n appDir: string;\n importPolicy?: AppRouterImportPolicy | undefined;\n request: Request;\n serverActionCacheVersion?: string | undefined;\n serverActions?: AppRouterServerActionOptions | undefined;\n}): Promise<Response> {\n // Validate everything we can statically before touching the filesystem\n // / bundler. A flood of malformed POSTs must not pay the registry-load\n // cost (Issue 067).\n if (options.request.method !== \"POST\") {\n return jsonResponse({ ok: false, error: \"Method not allowed.\" }, 405);\n }\n\n const bodySizeResponse = validateServerActionBodySize(\n options.request,\n options.serverActions?.maxBodyBytes ?? DEFAULT_ACTION_BODY_MAX_BYTES,\n );\n if (bodySizeResponse !== undefined) {\n return bodySizeResponse;\n }\n\n const originResponse = validateServerActionRequestOrigin(options.request);\n if (originResponse !== undefined) {\n return originResponse;\n }\n\n const contentType = options.request.headers.get(\"content-type\") ?? \"\";\n\n if (contentType.includes(\"application/json\")) {\n const manifestResponse = validateServerActionManifest(options.serverActions?.allowedActions);\n if (manifestResponse !== undefined) {\n return manifestResponse;\n }\n\n // JSON path delegates CSRF/replay to createServerActionHandler. The\n // registry is still needed here, but the handler short-circuits on\n // CSRF mismatch before invoking the action.\n let registry: ServerActionRegistry;\n try {\n registry = await loadServerActionRegistry({\n appDir: options.appDir,\n cacheVersion: options.serverActionCacheVersion,\n importPolicy: options.importPolicy,\n });\n } catch (error) {\n return jsonResponse(\n { ok: false, error: error instanceof Error ? error.message : String(error) },\n 500,\n );\n }\n\n const replayStore = options.serverActions?.replayStore ?? usedFormActionNonces;\n const handle = createServerActionHandler(jsonServerActionRegistry({\n allowedActions: options.serverActions?.allowedActions,\n appDir: options.appDir,\n registry,\n }), {\n ...(options.serverActions?.authorize === undefined\n ? {}\n : { authorize: options.serverActions.authorize }),\n ...(options.serverActions?.allowedActions === undefined ||\n options.serverActions.allowedActions === \"any\"\n ? {}\n : { allowedActions: jsonAllowedServerActions(options.serverActions.allowedActions) }),\n csrf: true,\n maxBodyBytes: options.serverActions?.maxBodyBytes ?? DEFAULT_ACTION_BODY_MAX_BYTES,\n replayProtection: { seen: replayStore },\n });\n\n return handle(options.request);\n }\n\n if (\n !contentType.includes(\"application/x-www-form-urlencoded\") &&\n !contentType.includes(\"multipart/form-data\")\n ) {\n return jsonResponse({ ok: false, error: \"Unsupported server action content type.\" }, 415);\n }\n\n const manifestResponse = validateServerActionManifest(options.serverActions?.allowedActions);\n if (manifestResponse !== undefined) {\n return manifestResponse;\n }\n\n const formData = await options.request.formData();\n const fieldCountResponse = validateServerActionFormFieldCount(\n formData,\n options.serverActions?.maxFormFields ?? DEFAULT_ACTION_FORM_MAX_FIELDS,\n );\n\n if (fieldCountResponse !== undefined) {\n return fieldCountResponse;\n }\n\n const csrfResponse = validateFormCsrf(options.request, formData);\n\n if (csrfResponse !== undefined) {\n return csrfResponse;\n }\n\n const moduleId = stringFormValue(formData.get(formFieldModuleId));\n const exportName = stringFormValue(formData.get(formFieldExportName));\n const nonce = stringFormValue(formData.get(formFieldNonce));\n\n if (moduleId === undefined || exportName === undefined || nonce === undefined) {\n return jsonResponse({ ok: false, error: \"Invalid server action reference.\" }, 400);\n }\n\n if (!isAllowedServerAction({ moduleId, exportName }, options.serverActions?.allowedActions)) {\n return jsonResponse({ ok: false, error: \"Unknown server action.\" }, 404);\n }\n\n if (\n isInferredServerActionReference({\n allowedActions: options.serverActions?.allowedActions,\n appDir: options.appDir,\n exportName,\n moduleId,\n }) &&\n !isValidFormActionToken({\n csrfToken: stringFormValue(formData.get(formCsrfFieldName)),\n exportName,\n moduleId,\n nonce,\n token: stringFormValue(formData.get(formFieldActionToken)),\n })\n ) {\n return jsonResponse({ ok: false, error: \"Unknown server action.\" }, 404);\n }\n\n const nonceResponse = validateFormNonce(\n formData,\n options.serverActions?.replayStore ?? usedFormActionNonces,\n );\n\n if (nonceResponse !== undefined) {\n return nonceResponse;\n }\n\n let registry: ServerActionRegistry;\n try {\n registry = await loadServerActionRegistry({\n appDir: options.appDir,\n cacheVersion: options.serverActionCacheVersion,\n importPolicy: options.importPolicy,\n });\n } catch (error) {\n return jsonResponse(\n { ok: false, error: error instanceof Error ? error.message : String(error) },\n 500,\n );\n }\n\n const action = registry[`${moduleId}#${exportName}`];\n\n if (typeof action !== \"function\") {\n return jsonResponse({ ok: false, error: \"Unknown server action.\" }, 404);\n }\n\n const actionFormData = cleanActionFormData(formData);\n const authorizationResponse = await authorizeFormAction({\n args: [actionFormData],\n authorize: options.serverActions?.authorize,\n exportName,\n moduleId,\n request: options.request,\n });\n\n if (authorizationResponse !== undefined) {\n return authorizationResponse;\n }\n\n try {\n const value = await action(actionFormData, createServerActionContext(options.request));\n\n if (value instanceof Response) {\n return value;\n }\n\n if (value === undefined || value === null) {\n return redirectToFormReferer(options.request);\n }\n\n return jsonResponse({ ok: true, value }, 200);\n } catch (error) {\n return jsonResponse(\n { ok: false, error: error instanceof Error ? error.message : String(error) },\n 500,\n );\n }\n}\n\nfunction createServerActionContext(request: Request): ServerActionContext {\n const clientIp = clientIpFromRequest(request);\n\n return {\n ...(clientIp === undefined ? {} : { clientIp }),\n cookies: cookies(request),\n headers: request.headers,\n request,\n };\n}\n\nfunction clientIpFromRequest(request: Request): string | undefined {\n const forwarded = request.headers.get(\"x-forwarded-for\")?.split(\",\")[0]?.trim();\n\n if (forwarded !== undefined && forwarded !== \"\") {\n return forwarded;\n }\n\n const realIp = request.headers.get(\"x-real-ip\")?.trim();\n return realIp === \"\" ? undefined : realIp;\n}\n\nfunction validateServerActionBodySize(\n request: Request,\n maxBodyBytes: number,\n): Response | undefined {\n if (!Number.isFinite(maxBodyBytes) || maxBodyBytes < 0) {\n return undefined;\n }\n\n const contentLength = request.headers.get(\"content-length\");\n if (contentLength === null) {\n return undefined;\n }\n\n const bytes = Number(contentLength);\n if (!Number.isFinite(bytes) || bytes < 0) {\n return jsonResponse({ ok: false, error: \"Invalid Content-Length header.\" }, 400);\n }\n\n if (bytes > maxBodyBytes) {\n return jsonResponse({ ok: false, error: \"Server action request body is too large.\" }, 413);\n }\n\n return undefined;\n}\n\nfunction validateServerActionFormFieldCount(\n formData: FormData,\n maxFormFields: number,\n): Response | undefined {\n if (!Number.isFinite(maxFormFields) || maxFormFields < 0) {\n return undefined;\n }\n\n let count = 0;\n for (const _ of formData.keys()) {\n count += 1;\n if (count > maxFormFields) {\n return jsonResponse({\n ok: false,\n error: \"Server action form field count is too large.\",\n }, 413);\n }\n }\n\n return undefined;\n}\n\nfunction redirectToFormReferer(request: Request): Response {\n return new Response(null, {\n status: 303,\n headers: {\n location: sameOriginRefererPath(request) ?? \"/\",\n },\n });\n}\n\nfunction sameOriginRefererPath(request: Request): string | undefined {\n const referer = request.headers.get(\"referer\");\n\n if (referer === null) {\n return undefined;\n }\n\n try {\n const requestUrl = new URL(request.url);\n const refererUrl = new URL(referer, requestUrl);\n\n return refererUrl.origin === requestUrl.origin\n ? `${refererUrl.pathname}${refererUrl.search}`\n : undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction withRevalidationHeader(response: Response, paths: string[]): Response {\n if (paths.length > 0) {\n response.headers.set(\"x-mreact-revalidate\", paths.join(\",\"));\n }\n\n return response;\n}\n\nasync function authorizeFormAction(options: {\n args: unknown[];\n authorize?: ServerActionHandlerOptions[\"authorize\"];\n exportName: string;\n moduleId: string;\n request: Request;\n}): Promise<Response | undefined> {\n const reference: ServerActionRequestReference = {\n exportName: options.exportName,\n moduleId: options.moduleId,\n };\n const authorizationResult = await options.authorize?.(options.request, reference, options.args);\n\n return authorizationResult !== undefined && authorizationResult !== true\n ? jsonResponse(\n {\n ok: false,\n error: authorizationError(authorizationResult),\n },\n 403,\n )\n : undefined;\n}\n\nfunction authorizationError(result: Exclude<ServerActionValidationResult, true>): string {\n return typeof result === \"string\" ? result : \"Server action not authorized.\";\n}\n\nfunction jsonAllowedServerActions(\n allowedActions: readonly AppRouterAllowedServerAction[],\n): ServerActionRequestReference[] {\n return allowedActions\n .filter((reference) => reference.inferred !== true)\n .map((reference) => ({\n exportName: reference.exportName,\n moduleId: reference.moduleId,\n }));\n}\n\nfunction jsonServerActionRegistry(options: {\n allowedActions: readonly AppRouterAllowedServerAction[] | \"any\" | undefined;\n appDir: string;\n registry: ServerActionRegistry;\n}): ServerActionRegistry {\n const inferredKeys = new Set<string>();\n\n for (const reference of inferredServerActionReferencesForApp(options.appDir).values()) {\n inferredKeys.add(serverActionKey(reference));\n }\n\n if (Array.isArray(options.allowedActions)) {\n for (const reference of options.allowedActions) {\n if (reference.inferred === true) {\n inferredKeys.add(serverActionKey(reference));\n }\n }\n }\n\n if (inferredKeys.size === 0) {\n return options.registry;\n }\n\n const registry: ServerActionRegistry = {};\n\n for (const [key, value] of Object.entries(options.registry)) {\n if (!inferredKeys.has(key)) {\n registry[key] = value;\n }\n }\n\n return registry;\n}\n\nfunction serverActionKey(reference: ServerActionRequestReference): string {\n return `${reference.moduleId}#${reference.exportName}`;\n}\n\nfunction isAllowedServerAction(\n reference: ServerActionRequestReference,\n allowedActions: readonly AppRouterAllowedServerAction[] | \"any\" | undefined,\n): boolean {\n if (allowedActions === undefined) {\n warnIfUnrestrictedServerActions(allowedActions);\n return true;\n }\n\n if (allowedActions === \"any\") {\n return true;\n }\n\n return allowedActions.some(\n (allowed) =>\n allowed.moduleId === reference.moduleId && allowed.exportName === reference.exportName,\n );\n}\n\nfunction warnIfUnrestrictedServerActions(\n allowedActions: readonly AppRouterAllowedServerAction[] | \"any\" | undefined,\n): void {\n if (\n allowedActions !== undefined ||\n !isProductionEnvironment() ||\n warnedUnrestrictedServerActions\n ) {\n return;\n }\n\n warnedUnrestrictedServerActions = true;\n console.warn(\n \"[mreact] Server actions are running without an allowedActions manifest. Built app-router deployments generate this manifest automatically; direct production integrations should pass serverActions.allowedActions.\",\n );\n}\n\nfunction validateServerActionManifest(\n allowedActions: readonly AppRouterAllowedServerAction[] | \"any\" | undefined,\n): Response | undefined {\n if (allowedActions !== undefined || !isProductionEnvironment()) {\n return undefined;\n }\n\n return jsonResponse({ ok: false, error: \"Server action manifest required.\" }, 403);\n}\n\nfunction lowerFormActions(options: {\n actionNonce: string;\n code: string;\n csrfToken: string;\n references: Map<string, ActionReference>;\n}): string {\n let code = options.code;\n const formReferences = collectFormActionExpressionReferences({ code: options.code });\n\n for (const formReference of [...formReferences].reverse()) {\n const reference = options.references.get(formActionOccurrenceKey(formReference));\n\n if (reference === undefined) {\n continue;\n }\n\n const opening = code.slice(formReference.start, formReference.end);\n const loweredOpening = lowerFormActionOpening({\n actionNonce: options.actionNonce,\n csrfToken: options.csrfToken,\n opening,\n reference,\n referenceName: formReference.expression,\n });\n\n if (loweredOpening === opening) {\n continue;\n }\n\n code = `${code.slice(0, formReference.start)}${loweredOpening}${code.slice(formReference.end)}`;\n }\n\n return code;\n}\n\nfunction formActionOccurrenceKey(reference: {\n end: number;\n expression: string;\n expressionEnd: number;\n expressionStart: number;\n start: number;\n}): string {\n return [\n reference.start,\n reference.end,\n reference.expressionStart,\n reference.expressionEnd,\n reference.expression,\n ].join(\":\");\n}\n\nfunction formActionSourceHash(code: string): string {\n return createHash(\"sha256\").update(code).digest(\"base64url\");\n}\n\nfunction lowerFormActionOpening(options: {\n actionNonce: string;\n csrfToken: string;\n opening: string;\n reference: ActionReference;\n referenceName: string;\n}): string {\n const actionPattern = new RegExp(\n `^(?<prefix><form\\\\b[\\\\s\\\\S]*?)\\\\saction=\\\\{${escapeRegExp(options.referenceName)}\\\\}(?<suffix>[\\\\s\\\\S]*?)>$`,\n \"u\",\n );\n const match = options.opening.match(actionPattern);\n const prefix = match?.groups?.prefix;\n const suffix = match?.groups?.suffix;\n\n if (prefix === undefined || suffix === undefined) {\n return options.opening;\n }\n\n const attrs = `${prefix.slice(\"<form\".length)}${suffix}`.replace(\n /\\s+method=(?:\"[^\"]*\"|'[^']*'|\\{[^}]*\\})/g,\n \"\",\n );\n const hidden = [\n hiddenInput(formFieldModuleId, options.reference.moduleId),\n hiddenInput(formFieldExportName, options.reference.exportName),\n hiddenInput(formCsrfFieldName, options.csrfToken),\n hiddenInput(formFieldNonce, options.actionNonce),\n hiddenInput(\n formFieldActionToken,\n formActionToken({\n csrfToken: options.csrfToken,\n exportName: options.reference.exportName,\n moduleId: options.reference.moduleId,\n nonce: options.actionNonce,\n }),\n ),\n ].join(\"\");\n\n return `<form${attrs} method=\"post\" action=\"/_mreact/actions\">${hidden}`;\n}\n\nfunction escapeRegExp(value: string): string {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n\nfunction hiddenInput(name: string, value: string): string {\n return `<input type=\"hidden\" name=\"${escapeAttribute(name)}\" value=\"${escapeAttribute(value)}\" />`;\n}\n\nasync function collectImportedServerActions(options: {\n appDir: string;\n code: string;\n pageFile: string;\n}): Promise<{\n diagnostics: ServerActionInferenceDiagnostic[];\n references: Map<string, ActionReference>;\n}> {\n return await collectRuntimeInferredServerActions({\n appDir: options.appDir,\n code: options.code,\n fileSystem: {\n isUseServerFile,\n resolveSourceFile,\n },\n pageFile: options.pageFile,\n });\n}\n\nfunction isInferredServerActionReference(options: {\n allowedActions: readonly AppRouterAllowedServerAction[] | \"any\" | undefined;\n appDir: string;\n exportName: string;\n moduleId: string;\n}): boolean {\n if (\n Array.isArray(options.allowedActions) &&\n options.allowedActions.some(\n (allowed) =>\n allowed.inferred === true &&\n allowed.moduleId === options.moduleId &&\n allowed.exportName === options.exportName,\n )\n ) {\n return true;\n }\n\n return inferredServerActionReferencesForApp(options.appDir).has(\n `${options.moduleId}#${options.exportName}`,\n );\n}\n\nfunction formActionToken(options: {\n csrfToken: string;\n exportName: string;\n moduleId: string;\n nonce: string;\n}): string {\n return createHmac(\"sha256\", actionTokenSecret)\n .update(options.moduleId)\n .update(\"\\0\")\n .update(options.exportName)\n .update(\"\\0\")\n .update(options.csrfToken)\n .update(\"\\0\")\n .update(options.nonce)\n .digest(\"base64url\");\n}\n\nfunction isValidFormActionToken(options: {\n csrfToken: string | undefined;\n exportName: string;\n moduleId: string;\n nonce: string;\n token: string | undefined;\n}): boolean {\n if (options.csrfToken === undefined || options.token === undefined) {\n return false;\n }\n\n const expected = Buffer.from(\n formActionToken({\n csrfToken: options.csrfToken,\n exportName: options.exportName,\n moduleId: options.moduleId,\n nonce: options.nonce,\n }),\n );\n const actual = Buffer.from(options.token);\n\n return actual.length === expected.length && timingSafeEqual(actual, expected);\n}\n\nfunction replaceInferredServerActionReferences(\n appDir: string,\n pageFile: string,\n references: ReadonlyMap<string, ActionReference>,\n): void {\n const nextReferences = new Map(\n Array.from(references.values())\n .filter((reference) => reference.inferred)\n .map((reference) => [`${reference.moduleId}#${reference.exportName}`, reference]),\n );\n let appReferencesByPage = inferredServerActionReferences.get(appDir);\n const previousReferences = appReferencesByPage?.get(pageFile) ?? new Map();\n const changed = !sameActionReferenceKeys(previousReferences, nextReferences);\n\n if (!changed) {\n return;\n }\n\n if (nextReferences.size === 0) {\n appReferencesByPage?.delete(pageFile);\n if (appReferencesByPage?.size === 0) {\n inferredServerActionReferences.delete(appDir);\n }\n } else {\n if (appReferencesByPage === undefined) {\n appReferencesByPage = new Map();\n inferredServerActionReferences.set(appDir, appReferencesByPage);\n }\n appReferencesByPage.set(pageFile, nextReferences);\n }\n\n clearServerActionRegistryCacheForApp(appDir);\n}\n\n// Cache the (expensive) collect+bundle+evaluate work keyed by appDir +\n// caller-supplied version. Production callers pass the build-time hash\n// (serverModuleCacheVersion) so the registry is reused for the lifetime\n// of one deployment. Dev callers omit the version; the entry is then\n// keyed on \"dev\" so the work happens once per process — restarts handle\n// invalidation. Concurrent callers share a single in-flight promise.\nconst serverActionRegistryCache = new Map<string, Promise<ServerActionRegistry>>();\n\nasync function loadServerActionRegistry(options: {\n appDir: string;\n cacheVersion?: string | undefined;\n importPolicy?: AppRouterImportPolicy | undefined;\n}): Promise<ServerActionRegistry> {\n const cacheKey = `${options.appDir}::${options.cacheVersion ?? \"dev\"}`;\n const cached = serverActionRegistryCache.get(cacheKey);\n\n if (cached !== undefined) {\n return cached;\n }\n\n const pending = buildServerActionRegistry(options).catch((error) => {\n // Drop the failed promise so a retry can re-run the load.\n serverActionRegistryCache.delete(cacheKey);\n throw error;\n });\n serverActionRegistryCache.set(cacheKey, pending);\n return pending;\n}\n\nasync function buildServerActionRegistry(options: {\n appDir: string;\n importPolicy?: AppRouterImportPolicy | undefined;\n}): Promise<ServerActionRegistry> {\n const files = await collectFiles(options.appDir);\n const registry: ServerActionRegistry = {};\n const inferredReferences = inferredServerActionReferencesForApp(options.appDir);\n\n for (const file of files) {\n const moduleId = moduleIdForFile(options.appDir, file);\n const inferredExportNames = inferredExportNamesForModule(inferredReferences, moduleId);\n const useServerFile = await isUseServerFile(file);\n\n if (!useServerFile && inferredExportNames.size === 0) {\n continue;\n }\n\n const module = await importServerActionModule({\n appDir: options.appDir,\n file,\n importPolicy: options.importPolicy,\n });\n\n for (const [exportName, value] of Object.entries(module)) {\n if (typeof value === \"function\" && (useServerFile || inferredExportNames.has(exportName))) {\n registry[`${moduleId}#${exportName}`] = value as (...args: unknown[]) => unknown;\n }\n }\n }\n\n return registry;\n}\n\n// Exposed for tests that need a clean slate between cases (in-process state).\nexport function __clearServerActionRegistryCache(): void {\n serverActionRegistryCache.clear();\n inferredServerActionReferences.clear();\n}\n\nfunction clearServerActionRegistryCacheForApp(appDir: string): void {\n const prefix = `${appDir}::`;\n\n for (const key of serverActionRegistryCache.keys()) {\n if (key.startsWith(prefix)) {\n serverActionRegistryCache.delete(key);\n }\n }\n}\n\nfunction sameActionReferenceKeys(\n left: ReadonlyMap<string, ActionReference>,\n right: ReadonlyMap<string, ActionReference>,\n): boolean {\n if (left.size !== right.size) {\n return false;\n }\n\n for (const key of left.keys()) {\n if (!right.has(key)) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction inferredServerActionReferencesForApp(appDir: string): Map<string, ActionReference> {\n const references = new Map<string, ActionReference>();\n const appReferencesByPage = inferredServerActionReferences.get(appDir);\n\n if (appReferencesByPage === undefined) {\n return references;\n }\n\n for (const pageReferences of appReferencesByPage.values()) {\n for (const [key, reference] of pageReferences) {\n references.set(key, reference);\n }\n }\n\n return references;\n}\n\nfunction inferredExportNamesForModule(\n references: ReadonlyMap<string, ActionReference>,\n moduleId: string,\n): Set<string> {\n const names = new Set<string>();\n\n for (const reference of references.values()) {\n if (reference.moduleId === moduleId) {\n names.add(reference.exportName);\n }\n }\n\n return names;\n}\n\nasync function importServerActionModule(options: {\n appDir: string;\n file: string;\n importPolicy?: AppRouterImportPolicy | undefined;\n}): Promise<Record<string, unknown>> {\n const bundled = await bundleRouterModule({\n code: `export * from ${JSON.stringify(options.file)};`,\n filename: options.file,\n platform: \"node\",\n plugins: [\n fileImportMetaUrlPlugin(),\n serverActionRuntimePlugin(),\n createAppRouterImportPolicyPlugin({\n appDir: options.appDir,\n importPolicy: options.importPolicy,\n label: \"Server action\",\n }),\n ],\n });\n const code = bundled.code;\n\n if (code === undefined) {\n throw new Error(`Failed to compile server action module ${options.file}.`);\n }\n\n return importAppRouterSourceModule<Record<string, unknown>>({\n code,\n label: `server-action:${options.file}`,\n });\n}\n\nfunction serverActionRuntimePlugin() {\n const currentDir = dirname(fileURLToPath(import.meta.url));\n const cachePath = join(currentDir, currentDir.endsWith(`${sep}dist`) ? \"cache.js\" : \"cache.ts\");\n\n return {\n name: \"mreact-router-server-action-runtime\",\n setup(buildApi: RouterCompatBuildApi) {\n buildApi.onResolve({ filter: /^@reckona\\/mreact-router$/ }, () => ({\n namespace: \"mreact-router-server-api\",\n path: \"index\",\n }));\n buildApi.onLoad({ filter: /^index$/, namespace: \"mreact-router-server-api\" }, () => ({\n contents: `export { revalidatePath } from ${JSON.stringify(cachePath)};`,\n loader: \"ts\",\n resolveDir: dirname(cachePath),\n }));\n },\n };\n}\n\nasync function collectFiles(directory: string): Promise<string[]> {\n const entries = await readdir(directory, { withFileTypes: true });\n const files: string[] = [];\n\n for (const entry of entries) {\n const path = join(directory, entry.name);\n\n if (entry.isDirectory()) {\n files.push(...(await collectFiles(path)));\n continue;\n }\n\n if (entry.isFile() && /\\.(?:mreact\\.tsx|tsx|ts)$/.test(entry.name)) {\n files.push(path);\n }\n }\n\n return files;\n}\n\nasync function resolveSourceFile(directory: string, source: string): Promise<string | undefined> {\n const base = join(directory, source);\n const tsEsmBase = /\\.[cm]?js$/.test(base) ? base.replace(/\\.[cm]?js$/, \"\") : undefined;\n const candidates = [\n base,\n ...(tsEsmBase === undefined\n ? []\n : [\n `${tsEsmBase}.ts`,\n `${tsEsmBase}.tsx`,\n `${tsEsmBase}.mreact.tsx`,\n join(tsEsmBase, \"index.ts\"),\n join(tsEsmBase, \"index.tsx\"),\n ]),\n `${base}.ts`,\n `${base}.tsx`,\n `${base}.mreact.tsx`,\n join(base, \"index.ts\"),\n join(base, \"index.tsx\"),\n ];\n\n for (const candidate of candidates) {\n try {\n await access(candidate);\n return candidate;\n } catch {\n // Try the next candidate.\n }\n }\n\n return undefined;\n}\n\nasync function isUseServerFile(file: string): Promise<boolean> {\n const code = await readFile(file, \"utf8\");\n\n return hasModuleDirective({ code, directive: \"use server\", filename: file });\n}\n\nfunction moduleIdForFile(appDir: string, file: string): string {\n return relative(appDir, file).split(sep).join(\"/\");\n}\n\nfunction validateServerActionRequestOrigin(request: Request): Response | undefined {\n if (!isProductionEnvironment()) {\n return undefined;\n }\n\n const expectedOrigin = new URL(request.url).origin;\n const origin = request.headers.get(\"origin\");\n\n if (origin !== null) {\n return origin === expectedOrigin\n ? undefined\n : jsonResponse({ ok: false, error: \"Origin not allowed.\" }, 403);\n }\n\n const referer = request.headers.get(\"referer\");\n\n if (referer === null) {\n return jsonResponse({ ok: false, error: \"Origin not allowed.\" }, 403);\n }\n\n try {\n return new URL(referer).origin === expectedOrigin\n ? undefined\n : jsonResponse({ ok: false, error: \"Origin not allowed.\" }, 403);\n } catch {\n return jsonResponse({ ok: false, error: \"Origin not allowed.\" }, 403);\n }\n}\n\nfunction validateFormNonce(\n formData: FormData,\n replayStore: ServerActionReplayStore,\n): Response | undefined {\n const nonce = stringFormValue(formData.get(formFieldNonce));\n\n if (nonce === undefined || nonce.length === 0) {\n return jsonResponse({ ok: false, error: \"Missing server action nonce.\" }, 400);\n }\n\n if (replayStore.has(nonce)) {\n return jsonResponse({ ok: false, error: \"Server action nonce was already used.\" }, 409);\n }\n\n replayStore.add(nonce);\n return undefined;\n}\n\nfunction cleanActionFormData(formData: FormData): FormData {\n const cleaned = new FormData();\n\n for (const [name, value] of formData.entries()) {\n if (\n name !== formFieldModuleId &&\n name !== formFieldExportName &&\n name !== formCsrfFieldName &&\n name !== formFieldNonce &&\n name !== formFieldActionToken\n ) {\n cleaned.append(name, value);\n }\n }\n\n return cleaned;\n}\n\nfunction stringFormValue(value: FormDataEntryValue | null): string | undefined {\n return typeof value === \"string\" ? value : undefined;\n}\n\nfunction jsonResponse(payload: unknown, status: number): Response {\n return new Response(JSON.stringify(payload), {\n headers: { \"content-type\": \"application/json; charset=utf-8\" },\n status,\n });\n}\n\nfunction escapeAttribute(value: string): string {\n return value\n .replaceAll(\"&\", \"&amp;\")\n .replaceAll('\"', \"&quot;\")\n .replaceAll(\"<\", \"&lt;\")\n .replaceAll(\">\", \"&gt;\");\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"cloudflare.d.ts","sourceRoot":"","sources":["../../src/adapters/cloudflare.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAyB,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAA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