void 1.6.2 → 1.8.0

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 (361) hide show
  1. package/dist/{account-cmd-D903EEWQ.mjs → account-cmd-CZKntRH2.mjs} +6 -6
  2. package/dist/action-key-ByZ6DDld.mjs +64 -0
  3. package/dist/{application-analysis-DlUG-XNT.mjs → application-analysis-CyTagJQM.mjs} +31 -10
  4. package/dist/{application-routing-GCBSwXA9.mjs → application-routing-BLrMVpqi.mjs} +2 -1
  5. package/dist/{auth-CL-p_rqV.mjs → auth-BN0NU9dz.mjs} +1 -1
  6. package/dist/{auth-CH4PLAX1.d.mts → auth-Bk9VGtQW.d.mts} +9 -2
  7. package/dist/{auth-Dy8svcqQ.mjs → auth-CCk9Seol.mjs} +2 -2
  8. package/dist/{auth-YVjBX5NY.mjs → auth-DyWp-fSo.mjs} +7 -1
  9. package/dist/{auth-link-g9J7MSmP.mjs → auth-link-BOaQWMKw.mjs} +6 -6
  10. package/dist/{auth-router-DMZbG9Qn.mjs → auth-router-D0-VcmDs.mjs} +3 -3
  11. package/dist/{better-auth-shared-BJyG2mH0.d.mts → better-auth-shared-CQFdtguU.d.mts} +2 -2
  12. package/dist/{better-auth-shared-C958aM7W.mjs → better-auth-shared-CdVyCUou.mjs} +1 -1
  13. package/dist/boundary-plans-CRmWH68v.d.mts +25 -0
  14. package/dist/{build-cmd-DmjbuT6d.mjs → build-cmd-JTsXXf2F.mjs} +5 -5
  15. package/dist/{cache-2khBO1MR.mjs → cache-D0m3Z_Xf.mjs} +5 -5
  16. package/dist/{cancel-deploy-_itbbvY3.mjs → cancel-deploy-Ce6Os4fa.mjs} +4 -4
  17. package/dist/{cf-build-output-B1C8U83u.mjs → cf-build-output-CWNOH-KA.mjs} +2 -1
  18. package/dist/cf-build-output-DUZnAeZ1.mjs +1 -0
  19. package/dist/{cf-config-migrate-Dy8MrKgF.mjs → cf-config-migrate-Bb-EdAQq.mjs} +5 -1
  20. package/dist/cli/cli.mjs +68 -1868
  21. package/dist/cli/cloudflare-operation-process.mjs +101 -26
  22. package/dist/cli/env-schema-probe.d.mts +1 -1
  23. package/dist/cli/env-schema-probe.mjs +3 -3
  24. package/dist/cli-main-rkrJy2Ge.mjs +1889 -0
  25. package/dist/client-D1Vz1Zep.mjs +1 -0
  26. package/dist/{client-CoxPEhJq.mjs → client-SZPyj4X_.mjs} +10 -4
  27. package/dist/{cloudflare-auth-CuS42-9A.mjs → cloudflare-auth-7jTqy9Bx.mjs} +1 -1
  28. package/dist/{cloudflare-cmd-DTF19-j-.mjs → cloudflare-cmd-ChPLQcTP.mjs} +5 -5
  29. package/dist/{cloudflare-config-Ce8j5S7V.mjs → cloudflare-config-DtOGAbeB.mjs} +2 -2
  30. package/dist/{cloudflare-connect-BN4dHp8i.mjs → cloudflare-connect-Co93VYTo.mjs} +3 -3
  31. package/dist/{cloudflare-operations-DrZGzQap.mjs → cloudflare-operations-CXaDKYj2.mjs} +6 -6
  32. package/dist/{cloudflare-operations-laxRA8HN.mjs → cloudflare-operations-DATekLwI.mjs} +1 -1
  33. package/dist/{cloudflare-process-D9aC-jXr.mjs → cloudflare-process-DmTxZR-N.mjs} +2 -2
  34. package/dist/{config-hL-S-Y9D.mjs → config-5oSQhZNj.mjs} +3 -1
  35. package/dist/{config-CPxJmt4M.d.mts → config-CTlUaXWZ.d.mts} +3 -1
  36. package/dist/{config-CNDjO-15.mjs → config-DcqUBGCb.mjs} +1 -1
  37. package/dist/config-entry.d.mts +1 -1
  38. package/dist/{config-DMR0i3Z2.mjs → config-wo2EaH0X.mjs} +1 -1
  39. package/dist/{connect-DHepM7Xs.mjs → connect-DlvXt1JR.mjs} +7 -7
  40. package/dist/{create-project-Bq0M8MtO.mjs → create-project-CC_7hmYJ.mjs} +5 -5
  41. package/dist/{create-project-BiMmR5wA.mjs → create-project-DzY05xqC.mjs} +1 -1
  42. package/dist/{db-CqfT6lhV.mjs → db-FhyYGcJJ.mjs} +39 -39
  43. package/dist/{db-types-DRmxBJ2K.mjs → db-types-sVwEpyPR.mjs} +4 -2
  44. package/dist/{delete-CY4L8fi2.mjs → delete-CModjyOC.mjs} +5 -5
  45. package/dist/{deploy-La_Ly8g_.mjs → deploy-Cz9TEzZy.mjs} +502 -110
  46. package/dist/deploy-DMieisRu.mjs +2 -0
  47. package/dist/{deploy-managed-static-CESLfKHN.mjs → deploy-managed-static-DlxxXkAM.mjs} +16 -16
  48. package/dist/{deploy-transport-DcI6LXhY.mjs → deploy-transport-DUvm6-CR.mjs} +3 -3
  49. package/dist/deploy.mjs +8 -8
  50. package/dist/{dispatch-DM4Xdd2l.mjs → dispatch-CCiaAnSK.mjs} +7 -7
  51. package/dist/{dist-eV_Ep60B.mjs → dist-Cp4b1_T9.mjs} +1 -1
  52. package/dist/{dist-D23AAMxT.mjs → dist-STQXl8ck.mjs} +86 -138
  53. package/dist/{domain-BD1KOQL3.mjs → domain-DvdZPA50.mjs} +6 -6
  54. package/dist/{drizzle-C8MPqt5m.mjs → drizzle-D4V_06-B.mjs} +1 -1
  55. package/dist/{drizzle-lFdzSEa9.mjs → drizzle-DBSpPpU1.mjs} +34 -8
  56. package/dist/{email-XAspopcj.mjs → email-ASpNrfLd.mjs} +10 -10
  57. package/dist/{email-cloudflare-RxIQoPc9.mjs → email-cloudflare-kqoN9jst.mjs} +25 -16
  58. package/dist/{entry-DFBca6aS.mjs → entry-BweGTCgj.mjs} +1 -1
  59. package/dist/{env-DrYUh55t.mjs → env-Bpkg3G5i.mjs} +7 -7
  60. package/dist/{env-CuzZZyjB.mjs → env-UqS-21xi.mjs} +8 -1
  61. package/dist/env-mask-D31Qztl9.mjs +46 -0
  62. package/dist/{env-public-CeNeO_AT.d.mts → env-public-DtJL_hZq.d.mts} +8 -7
  63. package/dist/{env-validation-Del3C8AY.mjs → env-validation-BpCCQE_6.mjs} +6 -6
  64. package/dist/{env-validation-Bosj7EVg.mjs → env-validation-CN386Utu.mjs} +1 -1
  65. package/dist/{fetch-C8yhLoF3.mjs → fetch-CAIVkLvW.mjs} +1 -1
  66. package/dist/{fetch-B-gLGYVl.d.mts → fetch-CbI6lNnk.d.mts} +6 -4
  67. package/dist/{fetch-stream-DafNtVJC.mjs → fetch-stream-6Op0qlLd.mjs} +1 -1
  68. package/dist/{fetch-stream-DuwxWmBM.d.mts → fetch-stream-DoED9atq.d.mts} +1 -1
  69. package/dist/gen-M5fNQKfH.mjs +1 -0
  70. package/dist/{gen-DSkScMIz.mjs → gen-upKJChvd.mjs} +7 -7
  71. package/dist/{github-cmd-CA-lBdkn.mjs → github-cmd-BvMOlb8Z.mjs} +6 -6
  72. package/dist/{handler-BR6Tvjkp.d.mts → handler-BO7Od-z9.d.mts} +22 -8
  73. package/dist/{handler-DnI_au0K.mjs → handler-C9SnmeW1.mjs} +5 -4
  74. package/dist/{headers--cbz6iZ8.mjs → headers-COGEDoMN.mjs} +11 -2
  75. package/dist/help-CItQVDL4.mjs +1 -0
  76. package/dist/{help-1OCFDsRr.mjs → help-TPCjTu6e.mjs} +7 -3
  77. package/dist/index.d.mts +5 -5
  78. package/dist/index.mjs +379 -265
  79. package/dist/{info-BpxpsX0B.mjs → info-EsDyihwf.mjs} +4 -4
  80. package/dist/{init-DpVXO5S-.mjs → init-a4lVagrb.mjs} +33 -32
  81. package/dist/{link-DAXOT-G_.mjs → link-CE55DDzS.mjs} +6 -6
  82. package/dist/{list-BFQ0gcML.mjs → list-CxRthQks.mjs} +7 -7
  83. package/dist/{live-DF4HUl2m.mjs → live-CYJ4KGoR.mjs} +2 -2
  84. package/dist/{live-0xrcVpyq.d.mts → live-Kc55iuOQ.d.mts} +2 -2
  85. package/dist/{local-d1-CLVPP6v7.mjs → local-d1-CFcH9Bx3.mjs} +2 -2
  86. package/dist/{login-RIw7ffPe.mjs → login-AfcSGSmE.mjs} +5 -5
  87. package/dist/login-ZHsAm-I6.mjs +1 -0
  88. package/dist/{logs-B2OeLS4X.mjs → logs-BgRJuvb1.mjs} +6 -6
  89. package/dist/{migrate-DiI50Chz.mjs → migrate-BNAh6m_C.mjs} +5 -5
  90. package/dist/migrate-BflbbZQK.mjs +1 -0
  91. package/dist/nitro.d.mts +5 -0
  92. package/dist/nitro.mjs +27 -8
  93. package/dist/{node-Bc-dBAGL.mjs → node-CXFUw0Uz.mjs} +5 -5
  94. package/dist/{operator-args-D79WQP70.mjs → operator-args-DGTuCdSE.mjs} +9 -1
  95. package/dist/{operator-auth-CfDcmzpo.mjs → operator-auth-CD3pap65.mjs} +1 -1
  96. package/dist/{operator-client-BIY4-N_6.mjs → operator-client-XvXTkea6.mjs} +2 -2
  97. package/dist/{operator-cmd-CEI5Aaza.mjs → operator-cmd-C-viB7Si.mjs} +7 -7
  98. package/dist/operator-cmd-D6qNuJ_z.mjs +1 -0
  99. package/dist/output-BsdnNpxa.mjs +1 -0
  100. package/dist/{output-BCdLioKP.mjs → output-DNVILSz2.mjs} +1 -1
  101. package/dist/pages/client.d.mts +43 -15
  102. package/dist/pages/client.mjs +165 -80
  103. package/dist/pages/index.d.mts +6 -4
  104. package/dist/pages/index.mjs +6 -6
  105. package/dist/pages/islands-plugin.d.mts +1 -1
  106. package/dist/pages/islands-plugin.mjs +13 -2
  107. package/dist/pages/protocol.d.mts +2 -2
  108. package/dist/pages/protocol.mjs +1 -1
  109. package/dist/pages/serialize.d.mts +2 -2
  110. package/dist/pages/serialize.mjs +1 -1
  111. package/dist/{platform-args-Cx1M-7bq.mjs → platform-args-CiYeZmc5.mjs} +1 -1
  112. package/dist/platform-args-DJvF1-kl.mjs +1 -0
  113. package/dist/{platform-auth-config-ZrYm8KVs.mjs → platform-auth-config-Dt2qEc2w.mjs} +10 -10
  114. package/dist/{platform-auth-protection-t6mdY4nn.mjs → platform-auth-protection-B7TaF-PZ.mjs} +8 -8
  115. package/dist/{platform-auth-recovery-XeBmPTXx.mjs → platform-auth-recovery-suXSteJ6.mjs} +7 -7
  116. package/dist/{platform-cmd-EXehmSYA.mjs → platform-cmd-9rvYBBtr.mjs} +9 -9
  117. package/dist/{platform-cmd-C7BevP9b.mjs → platform-cmd-DuAsIxbU.mjs} +1 -1
  118. package/dist/{platform-domain-DR263ObA.mjs → platform-domain-DhH_vDr6.mjs} +5 -5
  119. package/dist/{platform-lifecycle-CN4aXldN.mjs → platform-lifecycle-3uI-E2bF.mjs} +1 -1
  120. package/dist/{platform-lifecycle-BvU_TNji.mjs → platform-lifecycle-CXmXe2xt.mjs} +17 -17
  121. package/dist/{platform-management-_UE1_GM8.mjs → platform-management-BBCHfwji.mjs} +4 -4
  122. package/dist/{platform-management-yS2sve3V.mjs → platform-management-PdrgDQTe.mjs} +1 -1
  123. package/dist/{platform-plans-config-Dx1agneU.mjs → platform-plans-config-BGwkXYDM.mjs} +5 -5
  124. package/dist/{platform-recovery-CPVk9-Q4.mjs → platform-recovery-C8NxXGRR.mjs} +3 -3
  125. package/dist/{platform-setup-Vw1AaUN8.mjs → platform-setup-Casiffqj.mjs} +3 -3
  126. package/dist/{plugin-inference-bQ1Be840.mjs → plugin-inference-CErfTgEx.mjs} +4 -4
  127. package/dist/{prepare-D8L9AQbw.mjs → prepare-BDKWZgfL.mjs} +12 -9
  128. package/dist/{prepare-BkRhDnxw.mjs → prepare-BLrzXjIl.mjs} +3 -3
  129. package/dist/prepare-a1_5usAn.mjs +1 -0
  130. package/dist/{prerender-render-RlAj6hh8.mjs → prerender-render-BAdYhivW.mjs} +44 -15
  131. package/dist/prerender-render.d.mts +12 -2
  132. package/dist/prerender-render.mjs +1 -1
  133. package/dist/{project-cmd-DH3CuFC6.mjs → project-cmd-DzGvxXKH.mjs} +18 -18
  134. package/dist/{project-team-MjT5K4rQ.mjs → project-team-C5XtHbZk.mjs} +5 -5
  135. package/dist/{project-token-BKHGwY3k.mjs → project-token-B4D5yhHQ.mjs} +5 -5
  136. package/dist/{project-tsconfig-BMveFb4b.mjs → project-tsconfig-nhnTWO_Y.mjs} +3 -1
  137. package/dist/{project-zero-trust-Bzdd05-h.mjs → project-zero-trust--0LvktDg.mjs} +5 -5
  138. package/dist/{protocol-COyySMki.mjs → protocol-B1Tvc9-x.mjs} +232 -74
  139. package/dist/{protocol-CkwjASep.d.mts → protocol-Cg2I81NA.d.mts} +13 -4
  140. package/dist/{provision-B0HqoRuI.mjs → provision-C3yiHdld.mjs} +2 -2
  141. package/dist/{provision-CYhZR_Mn.mjs → provision-CAcrauvr.mjs} +1 -1
  142. package/dist/{requests-daJmVpjk.mjs → requests-CrRiTgQA.mjs} +4 -4
  143. package/dist/resolve-project-C5wC-Hoi.mjs +1 -0
  144. package/dist/{resolve-project-D0YNnJfm.mjs → resolve-project-Da3OgCU1.mjs} +1 -1
  145. package/dist/{rollback-AVwiMAkk.mjs → rollback-BsmQyj-Q.mjs} +7 -7
  146. package/dist/{route-types-e69EqY88.mjs → route-types-CgtlFCDz.mjs} +268 -14
  147. package/dist/{route-url-C_YIH_zO.d.mts → route-url-C3JwYrER.d.mts} +8 -3
  148. package/dist/{route-url-CRDF-I0I.mjs → route-url-CfCR4oMj.mjs} +4 -3
  149. package/dist/routes-stub.d.mts +14 -4
  150. package/dist/routes-stub.mjs +1 -1
  151. package/dist/{runner-QMeOpScZ.mjs → runner-CTk21HrO.mjs} +1 -1
  152. package/dist/{runner-mysql-0zVmB1JW.mjs → runner-mysql-CHvEg_sy.mjs} +1 -1
  153. package/dist/runtime/ai.mjs +1 -1
  154. package/dist/runtime/auth.d.mts +2 -2
  155. package/dist/runtime/auth.mjs +1 -1
  156. package/dist/runtime/better-auth-mysql.d.mts +1 -1
  157. package/dist/runtime/better-auth-mysql.mjs +1 -1
  158. package/dist/runtime/better-auth-pg.d.mts +1 -1
  159. package/dist/runtime/better-auth-pg.mjs +1 -1
  160. package/dist/runtime/better-auth.d.mts +1 -1
  161. package/dist/runtime/better-auth.mjs +1 -1
  162. package/dist/runtime/client-react.d.mts +3 -3
  163. package/dist/runtime/client-react.mjs +2 -2
  164. package/dist/runtime/client-solid.d.mts +3 -3
  165. package/dist/runtime/client-solid.mjs +2 -2
  166. package/dist/runtime/client-svelte.d.mts +3 -3
  167. package/dist/runtime/client-svelte.mjs +2 -2
  168. package/dist/runtime/client-vue.d.mts +3 -3
  169. package/dist/runtime/client-vue.mjs +2 -2
  170. package/dist/runtime/client.d.mts +3 -3
  171. package/dist/runtime/client.mjs +2 -2
  172. package/dist/runtime/db.d.mts +6 -3
  173. package/dist/runtime/db.mjs +2 -2
  174. package/dist/runtime/email/testing.mjs +2 -2
  175. package/dist/runtime/email.mjs +3 -3
  176. package/dist/runtime/env-public.d.mts +1 -1
  177. package/dist/runtime/env-public.mjs +55 -85
  178. package/dist/runtime/fetch-server.d.mts +1 -1
  179. package/dist/runtime/fetch-server.mjs +1 -1
  180. package/dist/runtime/fetch-stream.d.mts +2 -2
  181. package/dist/runtime/fetch-stream.mjs +1 -1
  182. package/dist/runtime/fetch.d.mts +1 -1
  183. package/dist/runtime/fetch.mjs +1 -1
  184. package/dist/runtime/handler.d.mts +1 -1
  185. package/dist/runtime/handler.mjs +1 -1
  186. package/dist/runtime/isr.d.mts +3 -1
  187. package/dist/runtime/live-client.d.mts +11 -2
  188. package/dist/runtime/live-client.mjs +8 -0
  189. package/dist/runtime/live-server.mjs +1 -1
  190. package/dist/runtime/live.d.mts +1 -1
  191. package/dist/runtime/live.mjs +1 -1
  192. package/dist/runtime/log.mjs +1 -1
  193. package/dist/runtime/remote/index.mjs +1 -1
  194. package/dist/runtime/route-url.d.mts +2 -2
  195. package/dist/runtime/route-url.mjs +1 -1
  196. package/dist/runtime/routing.d.mts +21 -5
  197. package/dist/runtime/routing.mjs +251 -29
  198. package/dist/runtime/sandbox.mjs +1 -1
  199. package/dist/runtime/sse-client.d.mts +9 -1
  200. package/dist/runtime/sse-client.mjs +7 -0
  201. package/dist/runtime/validator.d.mts +1 -1
  202. package/dist/runtime/validator.mjs +1 -1
  203. package/dist/runtime/ws-server.d.mts +3 -3
  204. package/dist/runtime/ws-server.mjs +1 -1
  205. package/dist/runtime/ws.d.mts +1 -1
  206. package/dist/runtime/ws.mjs +1 -1
  207. package/dist/{scan-F0psanp7.mjs → scan-BJ3bj6aP.mjs} +236 -32
  208. package/dist/{secret-szNdoeKa.mjs → secret-D0g5oBsP.mjs} +7 -7
  209. package/dist/serialize-DN-envGQ.d.mts +18 -0
  210. package/dist/serialize-Pf-CIQK_.mjs +39 -0
  211. package/dist/{skills-D393E4lB.mjs → skills-CoBB9_Ao.mjs} +1 -1
  212. package/dist/{ast-bindings-BkivMJIo.mjs → static-exports-DFkzL-NX.mjs} +96 -33
  213. package/dist/{subcommand-prompt-CxJXporl.mjs → subcommand-prompt-0yIARXf2.mjs} +2 -2
  214. package/dist/{types-agfx0alu.d.mts → types-IPut3_Yx.d.mts} +15 -1
  215. package/dist/url-CuoEn0o3.mjs +43 -0
  216. package/dist/validator-8-NZs2Xr.mjs +168 -0
  217. package/dist/{version-metadata-BC3LK7Y-.mjs → version-metadata-eUd6Ar_U.mjs} +1 -1
  218. package/dist/wrangler-R3kMdJfw.mjs +1 -0
  219. package/dist/{wrangler-Gn4EoY4-.mjs → wrangler-k40T7XTQ.mjs} +2 -2
  220. package/dist/{wrapper-B9W9RE8z.mjs → wrapper-CVMZarxf.mjs} +11 -8
  221. package/dist/{ws-Dmjg5NH2.d.mts → ws--U7QicYy.d.mts} +2 -2
  222. package/docs/guide/ai.md +3 -0
  223. package/docs/guide/app-types.md +1 -0
  224. package/docs/guide/auth.md +63 -0
  225. package/docs/guide/database/d1.md +16 -1
  226. package/docs/guide/database/mysql.md +1 -0
  227. package/docs/guide/database/postgresql.md +1 -0
  228. package/docs/guide/database.md +34 -0
  229. package/docs/guide/deployment.md +9 -0
  230. package/docs/guide/durable-state.md +1 -0
  231. package/docs/guide/edge/headers.md +1 -0
  232. package/docs/guide/edge/prerendering.md +10 -4
  233. package/docs/guide/edge/redirects.md +1 -0
  234. package/docs/guide/edge/revalidation.md +6 -0
  235. package/docs/guide/edge/rewrites.md +1 -0
  236. package/docs/guide/edge/static-assets.md +1 -0
  237. package/docs/guide/email/domains.md +1 -0
  238. package/docs/guide/email/receiving.md +3 -2
  239. package/docs/guide/email/sending.md +3 -2
  240. package/docs/guide/email.md +1 -0
  241. package/docs/guide/env-vars.md +4 -0
  242. package/docs/guide/index.md +1 -0
  243. package/docs/guide/jobs.md +1 -0
  244. package/docs/guide/kv.md +1 -0
  245. package/docs/guide/live.md +3 -0
  246. package/docs/guide/pages-routing/actions-and-forms.md +51 -28
  247. package/docs/guide/pages-routing/errors.md +101 -0
  248. package/docs/guide/pages-routing/head.md +4 -1
  249. package/docs/guide/pages-routing/islands.md +2 -1
  250. package/docs/guide/pages-routing/layouts.md +3 -0
  251. package/docs/guide/pages-routing/loaders.md +3 -0
  252. package/docs/guide/pages-routing/markdown.md +3 -3
  253. package/docs/guide/pages-routing/overview.md +142 -10
  254. package/docs/guide/pages-routing/view-transitions.md +1 -0
  255. package/docs/guide/platform/administration/access.md +1 -0
  256. package/docs/guide/platform/administration/connected-apps.md +4 -0
  257. package/docs/guide/platform/administration/email.md +1 -0
  258. package/docs/guide/platform/administration/operations.md +1 -0
  259. package/docs/guide/platform/administration/plans.md +1 -0
  260. package/docs/guide/platform/administration/projects.md +11 -0
  261. package/docs/guide/platform/administration/zero-trust.md +1 -0
  262. package/docs/guide/platform/development/local.md +1 -0
  263. package/docs/guide/platform/development/runtime.md +1 -0
  264. package/docs/guide/platform/development/schema-ci.md +1 -0
  265. package/docs/guide/platform/installation/ci.md +1 -0
  266. package/docs/guide/platform/installation/credentials.md +1 -0
  267. package/docs/guide/platform/installation/domains.md +1 -0
  268. package/docs/guide/platform/installation/first-deployment.md +1 -0
  269. package/docs/guide/platform/installation/maintenance.md +1 -0
  270. package/docs/guide/platform/installation/prerequisites.md +1 -0
  271. package/docs/guide/platform/installation/setup.md +1 -0
  272. package/docs/guide/platform/installation/uninstall.md +1 -0
  273. package/docs/guide/platform-administration.md +1 -0
  274. package/docs/guide/platform-development.md +1 -0
  275. package/docs/guide/project-collaboration.md +1 -0
  276. package/docs/guide/queues.md +3 -0
  277. package/docs/guide/quickstart.md +4 -2
  278. package/docs/guide/remote-dev.md +1 -0
  279. package/docs/guide/sandboxes.md +1 -0
  280. package/docs/guide/self-hosted-platform.md +1 -0
  281. package/docs/guide/server-routing.md +1 -0
  282. package/docs/guide/sse.md +3 -0
  283. package/docs/guide/ssg.md +24 -2
  284. package/docs/guide/ssr.md +1 -0
  285. package/docs/guide/storage.md +7 -2
  286. package/docs/guide/testing.md +62 -0
  287. package/docs/guide/type-safety.md +308 -26
  288. package/docs/guide/typed-fetch.md +8 -3
  289. package/docs/guide/websockets.md +6 -5
  290. package/docs/index.md +1 -0
  291. package/docs/integrations/agents.md +1 -0
  292. package/docs/integrations/cloudflare.md +11 -10
  293. package/docs/integrations/frameworks/analog.md +1 -0
  294. package/docs/integrations/frameworks/astro.md +1 -0
  295. package/docs/integrations/frameworks/nuxt.md +3 -0
  296. package/docs/integrations/frameworks/overview.md +3 -0
  297. package/docs/integrations/frameworks/react-router.md +1 -0
  298. package/docs/integrations/frameworks/sveltekit.md +1 -0
  299. package/docs/integrations/frameworks/tanstack-start.md +1 -0
  300. package/docs/integrations/hono.md +1 -0
  301. package/docs/integrations/nodejs-bun-deno.md +66 -0
  302. package/docs/reference/api/auth.md +20 -0
  303. package/docs/reference/api/client.md +7 -4
  304. package/docs/reference/api/database.md +24 -1
  305. package/docs/reference/api/deploy.md +4 -0
  306. package/docs/reference/api/durable.md +1 -0
  307. package/docs/reference/api/env.md +1 -0
  308. package/docs/reference/api/handlers.md +4 -1
  309. package/docs/reference/api/pages.md +30 -12
  310. package/docs/reference/api/plugin.md +1 -0
  311. package/docs/reference/api/resources.md +4 -1
  312. package/docs/reference/api/rewrites.md +18 -5
  313. package/docs/reference/api/types.md +10 -2
  314. package/docs/reference/api.md +1 -0
  315. package/docs/reference/cli/auth.md +1 -0
  316. package/docs/reference/cli/database.md +3 -0
  317. package/docs/reference/cli/deploy.md +18 -11
  318. package/docs/reference/cli/domains.md +1 -0
  319. package/docs/reference/cli/email.md +1 -0
  320. package/docs/reference/cli/generate.md +1 -0
  321. package/docs/reference/cli/github.md +1 -0
  322. package/docs/reference/cli/platform-config.md +1 -0
  323. package/docs/reference/cli/platform-email.md +1 -0
  324. package/docs/reference/cli/platform-installation.md +1 -0
  325. package/docs/reference/cli/platform-operations.md +1 -0
  326. package/docs/reference/cli/platform-users.md +23 -0
  327. package/docs/reference/cli/platform-zero-trust.md +1 -0
  328. package/docs/reference/cli/platform.md +1 -0
  329. package/docs/reference/cli/project.md +1 -0
  330. package/docs/reference/cli/secrets.md +1 -0
  331. package/docs/reference/cli/setup.md +1 -0
  332. package/docs/reference/cli.md +6 -0
  333. package/docs/reference/config.md +25 -2
  334. package/docs/reference/resource-inference.md +1 -0
  335. package/docs/reference/structure.md +1 -0
  336. package/package.json +27 -25
  337. package/schema.json +4 -0
  338. package/skills/void/SKILL.md +7 -0
  339. package/dist/action-key-XtKKbbsi.mjs +0 -25
  340. package/dist/cf-build-output-CmDOcA7K.mjs +0 -1
  341. package/dist/client-CEtr5UOR.mjs +0 -1
  342. package/dist/deploy-DMhOyebt.mjs +0 -2
  343. package/dist/gen-BbT1Ku1P.mjs +0 -1
  344. package/dist/help-Ba8Dq5-r.mjs +0 -1
  345. package/dist/login-BX2gzHUt.mjs +0 -1
  346. package/dist/migrate-CUGMGaIM.mjs +0 -1
  347. package/dist/operator-cmd-oTT2MA9G.mjs +0 -1
  348. package/dist/output-E6gecbbV.mjs +0 -1
  349. package/dist/platform-args-C7XUw9mw.mjs +0 -1
  350. package/dist/prepare-CZRVGNld.mjs +0 -1
  351. package/dist/resolve-project-CgfjtOwz.mjs +0 -1
  352. package/dist/serialize-DUuYuaY3.mjs +0 -29
  353. package/dist/serialize-I4EmS-Wf.d.mts +0 -16
  354. package/dist/validator-CTfmzZYb.mjs +0 -69
  355. package/dist/wrangler-CQ5c-MtJ.mjs +0 -1
  356. package/dist/{cf-access-BmBT2h8_.mjs → cf-access-Dnyw8KFY.mjs} +1 -1
  357. package/dist/{config-s6TkpSat.mjs → config-eeDzKBS9.mjs} +1 -1
  358. package/dist/{env-types-Bd8DkQhl.mjs → env-types-Dz9qkiOn.mjs} +1 -1
  359. package/dist/{inbound-CdO-qY0w.mjs → inbound-C2H6Dzz1.mjs} +2 -2
  360. package/dist/{runner-5MCSimKx.mjs → runner-CMZb7jNU.mjs} +1 -1
  361. package/dist/{runner-mysql-Bdmsp_x4.mjs → runner-mysql-BXfcQQj3.mjs} +1 -1
@@ -1,14 +1,17 @@
1
+ import { a as queryKey, i as markActionKey, n as actionKeySegment, o as searchWithoutActionKey, r as hasActionKey, s as searchWithoutPreservedQuery, t as PRESERVED_QUERY_HEADER } from "../action-key-ByZ6DDld.mjs";
2
+ import { i as authDependentRequests, n as markStaticAsset, r as SHARED_CACHE_HEADERS, t as isUnchangedStaticAsset } from "../static-asset-marker-DsQKz6lt.mjs";
3
+ import { t as VoidAssetRewriteError } from "../handler-C9SnmeW1.mjs";
4
+ import { t as convertReturnValue } from "../response-HmNjB30w.mjs";
5
+ import { r as toUrlString, t as interpolateRouteParams } from "../route-url-CfCR4oMj.mjs";
1
6
  import { n as createClientAssetTags, r as createManifestLoader, t as ASSET_EXTENSIONS } from "../routing-assets-DJIVOrCh.mjs";
7
+ import { a as handlesPageLoaderNotFound, n as handlePageGet, r as handlePageMutation } from "../protocol-B1Tvc9-x.mjs";
8
+ import { t as decodePagePath } from "../url-CuoEn0o3.mjs";
2
9
  import { t as renderDefaultErrorPage } from "../error-pages-COVBnzK7.mjs";
3
- import { t as convertReturnValue } from "../response-HmNjB30w.mjs";
4
- import { i as searchWithoutActionKey, n as hasActionKey, r as markActionKey, t as actionKeySegment } from "../action-key-XtKKbbsi.mjs";
5
- import { n as handlePageGet, r as handlePageMutation } from "../protocol-COyySMki.mjs";
6
- import { t as VoidAssetRewriteError } from "../handler-DnI_au0K.mjs";
7
- import { i as authDependentRequests, n as markStaticAsset, r as SHARED_CACHE_HEADERS, t as isUnchangedStaticAsset } from "../static-asset-marker-DsQKz6lt.mjs";
8
- import { r as toUrlString } from "../route-url-CRDF-I0I.mjs";
9
10
  import { AsyncLocalStorage } from "node:async_hooks";
10
11
  import { compilePattern, matchPattern, matchPatternCaptures, mergeQueryIntoLocation, redirectToHttps, substituteParams } from "@void/edge";
12
+ import { Context } from "hono";
11
13
  // src/runtime/routing-worker.ts
14
+ const intentionalNotFoundRequests = /* @__PURE__ */ new WeakSet();
12
15
  const ASSET_CONTENT_TYPES = {
13
16
  ".avif": "image/avif",
14
17
  ".css": "text/css; charset=utf-8",
@@ -68,7 +71,7 @@ function createAssetCachePolicy(assetsDir, loadManifest = createManifestLoader()
68
71
  function createAssetFallback(options = {}) {
69
72
  const cachePolicy = createAssetCachePolicy(options.assetsDir);
70
73
  return async (request, env, response) => {
71
- if (response.status !== 404 || !env.ASSETS || request.method !== "GET" && request.method !== "HEAD") return response;
74
+ if (response.status !== 404 || intentionalNotFoundRequests.has(request) || !env.ASSETS || request.method !== "GET" && request.method !== "HEAD") return response;
72
75
  const asset = await env.ASSETS.fetch(new Request(request.url, {
73
76
  method: request.method,
74
77
  headers: request.headers
@@ -105,11 +108,23 @@ function filterInternalBindings(env, prefixes, exactNames = []) {
105
108
  getOwnPropertyDescriptor: (target, prop) => hidden(prop) ? void 0 : Reflect.getOwnPropertyDescriptor(target, prop)
106
109
  });
107
110
  }
111
+ /**
112
+ * Answer the prerender runner. A getPrerenderPaths() error is returned in the
113
+ * body so the build can show which page and entry to fix, not only HTTP 500.
114
+ */
115
+ async function prerenderPathsResponse(collect) {
116
+ try {
117
+ return Response.json({ paths: await collect() });
118
+ } catch (error) {
119
+ return Response.json({ error: error instanceof Error ? error.message : String(error) }, { status: 500 });
120
+ }
121
+ }
108
122
  function createWorkerFetch(options) {
109
123
  return async (request, originalEnv, ctx) => {
110
124
  const url = new URL(request.url);
111
125
  const discovery = request.method === "POST" && url.pathname === "/__void/prerender-paths" && originalEnv.__VOID_PRERENDER === "1";
112
- if (options.validateEnv && !discovery) await options.validateEnv(originalEnv);
126
+ const staticNotFound = request.method === "GET" && url.pathname === "/__void/static-not-found" && originalEnv.__VOID_PRERENDER === "1";
127
+ if (options.validateEnv && !discovery && !staticNotFound) await options.validateEnv(originalEnv);
113
128
  const env = options.remoteEnv && originalEnv.__VOID_REMOTE === "1" ? options.remoteEnv(originalEnv) : originalEnv;
114
129
  if (options.isr) {
115
130
  env.__VOID_ISR_DEPLOYMENT_ID ??= options.isr.deploymentId;
@@ -124,9 +139,10 @@ function createWorkerFetch(options) {
124
139
  ...options.versionMetadataBinding ? { versionId: metadata?.id } : {}
125
140
  }, options.versionMetadataBinding ? { headers: { "cache-control": "no-store" } } : void 0);
126
141
  }
142
+ if (staticNotFound) return options.staticNotFound ? options.staticNotFound(request, env) : new Response(null, { status: 204 });
127
143
  const internal = await options.internalRoute(request, env, ctx);
128
144
  if (internal) return internal;
129
- if (discovery) return Response.json({ paths: await options.collectPrerenderPaths(request, env, ctx) });
145
+ if (discovery) return prerenderPathsResponse(() => options.collectPrerenderPaths(request, env, ctx));
130
146
  if (options.alwaysUseHttps) {
131
147
  const redirect = redirectToHttps(request);
132
148
  if (redirect) return redirect;
@@ -142,8 +158,19 @@ function createWorkerFetch(options) {
142
158
  };
143
159
  }
144
160
  // src/runtime/routing-pages.ts
145
- function actionNameOf(url) {
146
- return new URL(url).searchParams.keys().next().value;
161
+ function preparePageRequest(c, options) {
162
+ if (!options.trailingSlash) return true;
163
+ if (!c.req.path.endsWith("/")) return false;
164
+ if (options.catchAllParam) {
165
+ const params = c.req.param();
166
+ params[options.catchAllParam] = params[options.catchAllParam].slice(0, -1);
167
+ c.req.param = ((key) => key ? params[key] : { ...params });
168
+ }
169
+ return true;
170
+ }
171
+ function actionNameOf(request) {
172
+ const search = searchWithoutPreservedQuery(new URL(request.url).search, request.headers.get(PRESERVED_QUERY_HEADER));
173
+ return new URLSearchParams(search).keys().next().value;
147
174
  }
148
175
  const routeHandlers = /* @__PURE__ */ new WeakSet();
149
176
  const namedActionHandlers = /* @__PURE__ */ new WeakSet();
@@ -163,20 +190,48 @@ function markRouteHandler(handler) {
163
190
  function createNamedActionMarker(matchedRoutes) {
164
191
  return async (c, next) => {
165
192
  const answer = matchedRoutes(c).slice(c.req.routeIndex + 1).find((route) => routeHandlers.has(route.handler));
166
- if (answer && namedActionHandlers.has(answer.handler) && actionNameOf(c.req.url)) markActionKey(c.req.raw);
193
+ if (answer && namedActionHandlers.has(answer.handler) && actionNameOf(c.req.raw)) markActionKey(c.req.raw);
167
194
  await next();
168
195
  };
169
196
  }
170
197
  function createPageGetHandler(options) {
171
198
  return markRouteHandler(async (context) => {
172
- const mod = options.load ? await options.load() : { head: options.head };
199
+ if (!preparePageRequest(context, options)) return context.notFound();
200
+ let mod;
201
+ try {
202
+ mod = options.load ? await options.load() : { head: options.head };
203
+ } catch (error) {
204
+ mod = { loader: () => {
205
+ throw error;
206
+ } };
207
+ }
173
208
  return handlePageGet(mod.loader, mod.head, context, options.componentId, options.render, options.assets, options.headConfig ?? void 0, options.renderOptions);
174
209
  });
175
210
  }
211
+ /** Build-only rendering bypasses application middleware and serializes no request data. */
212
+ function createStaticNotFound(options) {
213
+ const handle = createPageGetHandler({
214
+ ...options,
215
+ renderOptions: {
216
+ ...options.renderOptions,
217
+ renderMode: "server"
218
+ },
219
+ render: (page, assets, url) => options.render({
220
+ ...page,
221
+ documentOnly: true
222
+ }, {
223
+ ...assets,
224
+ body: "",
225
+ preloads: ""
226
+ }, url)
227
+ });
228
+ return (request, env) => handle(new Context(new Request(new URL("/404", request.url)), { env }));
229
+ }
176
230
  function createPageMutationHandler(options) {
177
231
  const mutationHandler = async (context) => {
232
+ if (!preparePageRequest(context, options)) return context.notFound();
178
233
  const mod = options.load ? await options.load() : {};
179
- const actionName = options.namedActions ? actionNameOf(context.req.url) : void 0;
234
+ const actionName = options.namedActions ? actionNameOf(context.req.raw) : void 0;
180
235
  const name = actionName || "default";
181
236
  const named = mod.actions;
182
237
  const candidate = named && Object.hasOwn(named, name) ? named[name] : void 0;
@@ -191,20 +246,45 @@ function createPageMutationHandler(options) {
191
246
  function createPagesFallback(options) {
192
247
  const cachePolicy = createAssetCachePolicy(options.assetsDir);
193
248
  return async (c) => {
249
+ if (handlesPageLoaderNotFound(c)) return c.newResponse(null, 404);
194
250
  const path = c.req.path;
195
251
  if (path === "/api" || path.startsWith("/api/") || c.req.method !== "GET" && c.req.method !== "HEAD") return c.text("Not Found", 404);
196
252
  const assets = c.env?.ASSETS;
197
253
  const assetResponse = assets && typeof assets.fetch === "function" ? await assets.fetch(c.req.raw) : options.routing.markNoMatch(c.req.raw, new Response("Not Found", { status: 404 }));
254
+ const filePath = path.includes("/.") || path.substring(path.lastIndexOf("/") + 1).includes(".");
255
+ const pageNeedsSlash = options.trailingSlash && !path.endsWith("/") && options.pagePatterns?.some((pattern) => pattern.test(decodePagePath(`${path}/`)));
256
+ let directoryIndex = false;
257
+ if (pageNeedsSlash && assetResponse.status === 200 && assetResponse.headers.get("Content-Type")?.split(";")[0] === "text/html" && assets) {
258
+ const url = new URL(c.req.url);
259
+ url.pathname += "/";
260
+ const index = await assets.fetch(new Request(url, {
261
+ method: c.req.method,
262
+ headers: c.req.raw.headers,
263
+ redirect: c.req.raw.redirect,
264
+ signal: c.req.raw.signal
265
+ }));
266
+ directoryIndex = index.status === 200;
267
+ await index.body?.cancel();
268
+ }
269
+ if (pageNeedsSlash && (assetResponse.status === 404 || directoryIndex)) {
270
+ await assetResponse.body?.cancel();
271
+ const url = new URL(c.req.url);
272
+ url.pathname += "/";
273
+ return Response.redirect(url.href, 301);
274
+ }
198
275
  if (assetResponse.status !== 404) return markStaticAsset(c, await cachePolicy(c.req.raw, c.env, assetResponse));
199
276
  const fallback = options.fallbackRules ? await options.routing.applyFallback(c, options.fallbackRules) : void 0;
200
277
  if (fallback) return fallback;
201
- if (path.includes("/.") || path.substring(path.lastIndexOf("/") + 1).includes(".")) return options.errors.serveCustomPage(c, 404, "Not Found");
202
- if (path !== "/" && path.endsWith("/")) {
278
+ if (filePath) return options.errors.serveCustomPage(c, 404, "Not Found");
279
+ if (path !== "/" && (options.trailingSlash ? !path.endsWith("/") : path.endsWith("/"))) {
203
280
  const url = new URL(c.req.url);
204
- url.pathname = path.slice(0, -1);
281
+ url.pathname = options.trailingSlash ? `${path}/` : path.slice(0, -1);
205
282
  return Response.redirect(url.href, 301);
206
283
  }
207
- return options.routing.markNoMatch(c.req.raw, await options.errors.serveCustomPage(c, 404, "Not Found"));
284
+ const destination = c.req.header("Sec-Fetch-Dest");
285
+ const accept = c.req.header("Accept");
286
+ const pageRequest = c.req.header("X-VoidPages") === "true" || (!destination || destination === "document" || destination === "empty") && (!accept || accept.includes("text/html") || accept.includes("*/*"));
287
+ return options.routing.markNoMatch(c.req.raw, await (options.pageNotFound && pageRequest ? options.pageNotFound(c) : options.errors.serveCustomPage(c, 404, "Not Found")));
208
288
  };
209
289
  }
210
290
  function createSsrFallback(options) {
@@ -233,7 +313,7 @@ function createSsrFallback(options) {
233
313
  const mod = await options.load();
234
314
  const render = typeof mod.render === "function" ? mod.render : mod.default;
235
315
  if (typeof render !== "function") throw new Error("ssr: Invalid entry. Export render(c, assetTags).");
236
- return render(c, await options.assets(c.req.raw, c.env));
316
+ return options.routing.preserveNotFound(await render(c, await options.assets(c.req.raw, c.env)));
237
317
  };
238
318
  }
239
319
  function createAssetNotFound(options) {
@@ -742,6 +822,43 @@ function createErrorRenderer(options) {
742
822
  }
743
823
  };
744
824
  }
825
+ // src/runtime/prerender-path.ts
826
+ const ROUTE_TOKEN = /(?:^|\/)(?::([^/{}]+)(\{\.\+\})?|\*)(?=\/|$)/g;
827
+ function describeValue(value) {
828
+ if (value === null) return "null";
829
+ if (Array.isArray(value)) return "an array";
830
+ if (value === void 0) return "undefined";
831
+ return typeof value === "object" ? "an object" : `a ${typeof value}`;
832
+ }
833
+ /** Validate one `getPrerenderPaths()` entry and convert the values its pattern uses to strings. */
834
+ function routeParams(pattern, params) {
835
+ if (typeof params !== "object" || params === null || Array.isArray(params)) throw new TypeError(`Expected an object of route params, got ${describeValue(params)}.`);
836
+ const values = Object.create(null);
837
+ for (const [, paramName, catchAll] of pattern.matchAll(ROUTE_TOKEN)) {
838
+ const name = paramName ?? "*";
839
+ if (!Object.hasOwn(params, name)) continue;
840
+ const value = params[name];
841
+ if (typeof value !== "string" && typeof value !== "number") throw new TypeError(`Route param "${name}" must be a string or number.`);
842
+ const text = String(value);
843
+ if (paramName !== void 0 && !catchAll && text.includes("/")) throw new TypeError(`Route param "${name}" cannot contain "/". Use a catch-all page ([...${name}]) for nested paths.`);
844
+ values[name] = text;
845
+ }
846
+ return values;
847
+ }
848
+ /**
849
+ * Build the URL for one entry a page's `getPrerenderPaths()` returned. Values
850
+ * are percent-encoded like `routeUrl()`. Errors name the server file and the
851
+ * entry index, and fail the build: a wrong entry must not silently produce a
852
+ * missing or misplaced page.
853
+ */
854
+ function buildPrerenderPath(pattern, params, file, index) {
855
+ try {
856
+ return interpolateRouteParams(pattern, routeParams(pattern, params), true);
857
+ } catch (error) {
858
+ const message = error instanceof Error ? error.message : String(error);
859
+ throw new TypeError(`${file} getPrerenderPaths()[${index}]: ${message}`);
860
+ }
861
+ }
745
862
  // src/runtime/routing.ts
746
863
  /** One state owner per generated app: recursive dispatch shares rewrite and fallback guards. */
747
864
  function createRoutingRuntime(app, options = {}) {
@@ -749,6 +866,79 @@ function createRoutingRuntime(app, options = {}) {
749
866
  const fallbackHandled = /* @__PURE__ */ new WeakSet();
750
867
  const fallbackServed = /* @__PURE__ */ new WeakSet();
751
868
  const headerApplied = /* @__PURE__ */ new WeakSet();
869
+ const explicitNotFound = /* @__PURE__ */ new WeakSet();
870
+ let trackAssetMisses = false;
871
+ const intentionalResponses = /* @__PURE__ */ new WeakSet();
872
+ const routeMisses = /* @__PURE__ */ new WeakMap();
873
+ const missBodies = /* @__PURE__ */ new WeakMap();
874
+ const trackMissBody = (c, body) => {
875
+ if (!body) return;
876
+ let bodies = missBodies.get(c);
877
+ if (!bodies) {
878
+ bodies = /* @__PURE__ */ new WeakSet();
879
+ missBodies.set(c, bodies);
880
+ }
881
+ if (bodies.has(body)) return;
882
+ bodies.add(body);
883
+ if (Object.isExtensible(body)) {
884
+ const pipeThrough = body.pipeThrough;
885
+ Object.defineProperty(body, "pipeThrough", {
886
+ configurable: true,
887
+ writable: true,
888
+ value(...args) {
889
+ const transformed = pipeThrough.apply(this, args);
890
+ if (this === body) trackMissBody(c, transformed);
891
+ return transformed;
892
+ }
893
+ });
894
+ }
895
+ };
896
+ const recordMiss = (c, response) => {
897
+ const misses = routeMisses.get(c) ?? [];
898
+ if (misses.includes(response)) return;
899
+ misses.push(response);
900
+ routeMisses.set(c, misses);
901
+ trackMissBody(c, response.body);
902
+ trackResponseCopies(c);
903
+ if (Object.isExtensible(response)) {
904
+ const clone = response.clone;
905
+ Object.defineProperty(response, "clone", {
906
+ configurable: true,
907
+ writable: true,
908
+ value() {
909
+ const copy = clone.call(this);
910
+ if (this === response) {
911
+ trackMissBody(c, this.body);
912
+ recordMiss(c, copy);
913
+ }
914
+ return copy;
915
+ }
916
+ });
917
+ }
918
+ };
919
+ const isRouteMiss = (c, response) => routeMisses.get(c)?.some((miss) => miss === response || miss.body !== null && miss.body === response.body) === true || response.body !== null && missBodies.get(c)?.has(response.body) === true;
920
+ const tracksResponseCopies = /* @__PURE__ */ new WeakSet();
921
+ const trackResponseCopies = (c) => {
922
+ if (tracksResponseCopies.has(c)) return;
923
+ tracksResponseCopies.add(c);
924
+ const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(c), "res");
925
+ if (descriptor?.get && descriptor.set) {
926
+ const set = descriptor.set;
927
+ Object.defineProperty(c, "res", {
928
+ ...descriptor,
929
+ set(response) {
930
+ set.call(c, response);
931
+ if (response && isRouteMiss(c, response) && c.res !== response) recordMiss(c, c.res);
932
+ }
933
+ });
934
+ }
935
+ const header = c.header.bind(c);
936
+ c.header = (...args) => {
937
+ const before = c.finalized ? c.res : void 0;
938
+ header(...args);
939
+ if (before && c.res !== before && isRouteMiss(c, before)) recordMiss(c, c.res);
940
+ };
941
+ };
752
942
  const warnedPatterns = /* @__PURE__ */ new Set();
753
943
  const requestContext = new AsyncLocalStorage();
754
944
  const assetExtensions = options.blockedAssetExtensions ?? ASSET_EXTENSIONS;
@@ -766,6 +956,10 @@ function createRoutingRuntime(app, options = {}) {
766
956
  const dispatch = async (request, c, trace) => {
767
957
  const response = annotate(await (options.nodeTarget ? app.fetch(request, c.env) : app.fetch(request, c.env, c.executionCtx)), trace);
768
958
  if (authDependentRequests.has(request)) authDependentRequests.add(c.req.raw);
959
+ if (trackAssetMisses && response.status === 404) {
960
+ if (intentionalNotFoundRequests.has(request)) intentionalResponses.add(response);
961
+ else recordMiss(c, response);
962
+ }
769
963
  return response;
770
964
  };
771
965
  const rememberOriginal = (request, c) => {
@@ -798,7 +992,7 @@ function createRoutingRuntime(app, options = {}) {
798
992
  if (search) rewriteUrl.search = search;
799
993
  const request = new Request(rewriteUrl.toString(), c.req.raw);
800
994
  rememberOriginal(request, c);
801
- keepActionKey(c.req.raw, request, search);
995
+ keepActionQuery(c.req.raw, request, search);
802
996
  if (fallback) {
803
997
  fallbackHandled.add(request);
804
998
  fallbackServed.add(c.req.raw);
@@ -812,6 +1006,18 @@ function createRoutingRuntime(app, options = {}) {
812
1006
  };
813
1007
  const contextMiddleware = async (context, next) => {
814
1008
  const c = context;
1009
+ if (trackAssetMisses) {
1010
+ intentionalNotFoundRequests.delete(c.req.raw);
1011
+ const notFound = c.notFound.bind(c);
1012
+ c.notFound = () => {
1013
+ explicitNotFound.add(c);
1014
+ try {
1015
+ return notFound();
1016
+ } finally {
1017
+ explicitNotFound.delete(c);
1018
+ }
1019
+ };
1020
+ }
815
1021
  if (options.managedDispatch && !originalUrls.has(c.req.raw)) {
816
1022
  const original = c.req.raw.headers.get("X-Void-Original-URL");
817
1023
  if (original != null) try {
@@ -832,7 +1038,7 @@ function createRoutingRuntime(app, options = {}) {
832
1038
  if (search) url.search = search;
833
1039
  const request = new Request(url.toString(), c.req.raw);
834
1040
  rememberOriginal(request, c);
835
- keepActionKey(c.req.raw, request, search);
1041
+ keepActionQuery(c.req.raw, request, search);
836
1042
  return dispatch(request, c, `c.rewrite -> ${path} (middleware)`);
837
1043
  };
838
1044
  const redirect = context.redirect.bind(context);
@@ -844,10 +1050,28 @@ function createRoutingRuntime(app, options = {}) {
844
1050
  c.originalUrl = () => originalUrls.get(c.req.raw) ?? null;
845
1051
  c.isRewritten = () => originalUrls.has(c.req.raw);
846
1052
  await next();
1053
+ if (!trackAssetMisses) return;
1054
+ if (c.res.status === 404 && !isRouteMiss(c, c.res)) intentionalNotFoundRequests.add(c.req.raw);
847
1055
  };
848
1056
  return {
849
1057
  requestContext,
850
1058
  contextMiddleware,
1059
+ trackNotFound: (handler = (c) => c.text("404 Not Found", 404)) => {
1060
+ trackAssetMisses = true;
1061
+ return (c) => {
1062
+ const explicit = explicitNotFound.has(c);
1063
+ const response = handler(c);
1064
+ if (explicit) return response;
1065
+ return Promise.resolve(response).then((miss) => {
1066
+ if (miss.status === 404 && !intentionalResponses.has(miss)) recordMiss(c, miss);
1067
+ return miss;
1068
+ });
1069
+ };
1070
+ },
1071
+ preserveNotFound: (response) => {
1072
+ if (trackAssetMisses && response.status === 404) intentionalResponses.add(response);
1073
+ return response;
1074
+ },
851
1075
  requestMiddleware: async (c, next) => {
852
1076
  await requestContext.run(options.nodeTarget ? { request: c.req.raw } : {
853
1077
  request: c.req.raw,
@@ -904,7 +1128,7 @@ function createRoutingRuntime(app, options = {}) {
904
1128
  }
905
1129
  function redirectLocation(request, location, status) {
906
1130
  const url = new URL(request.url);
907
- const search = url.search;
1131
+ const search = searchWithoutPreservedQuery(url.search, request.headers.get(PRESERVED_QUERY_HEADER));
908
1132
  if (!hasActionKey(request)) return mergeQueryIntoLocation(location, search);
909
1133
  if (status === 303 || (status === void 0 || status === 301 || status === 302) && request.method === "POST") return mergeQueryIntoLocation(location, searchWithoutActionKey(search));
910
1134
  const hash = location.indexOf("#");
@@ -925,12 +1149,10 @@ function redirectLocation(request, location, status) {
925
1149
  const rest = segments.join("&");
926
1150
  return base.slice(0, q === -1 ? base.length : q) + "?" + first + (rest ? "&" + rest : "") + fragment;
927
1151
  }
928
- function queryKey(segment) {
929
- return new URLSearchParams(segment).keys().next().value;
930
- }
931
- /** A rewrite that keeps the query keeps the action key in it too. */
932
- function keepActionKey(from, to, destinationSearch) {
933
- if (!destinationSearch && hasActionKey(from)) markActionKey(to);
1152
+ /** Action metadata follows a rewrite only when it keeps the request query. */
1153
+ function keepActionQuery(from, to, destinationSearch) {
1154
+ if (destinationSearch) to.headers.delete(PRESERVED_QUERY_HEADER);
1155
+ else if (hasActionKey(from)) markActionKey(to);
934
1156
  }
935
1157
  function markNoMatch(request, response) {
936
1158
  const url = new URL(request.url);
@@ -954,4 +1176,4 @@ function createModuleLoader(load, cache = true) {
954
1176
  return module;
955
1177
  };
956
1178
  }
957
- export { createAssetFallback, createAssetNotFound, createClientAssetTags, createErrorRenderer, createHttpRouteHandler, createManifestLoader, createModuleLoader, createNamedActionMarker, createPageGetHandler, createPageMutationHandler, createPagesFallback, createRoutingRuntime, createSsrFallback, createWorkerFetch, filterInternalBindings, markNoMatch, markRouteHandler };
1179
+ export { buildPrerenderPath, createAssetFallback, createAssetNotFound, createClientAssetTags, createErrorRenderer, createHttpRouteHandler, createManifestLoader, createModuleLoader, createNamedActionMarker, createPageGetHandler, createPageMutationHandler, createPagesFallback, createRoutingRuntime, createSsrFallback, createStaticNotFound, createWorkerFetch, filterInternalBindings, markNoMatch, markRouteHandler, prerenderPathsResponse };
@@ -1,6 +1,6 @@
1
1
  import { a as getRawRuntimeEnv } from "../env-raw-e8qgqAzQ.mjs";
2
- import { t as UsageLimit } from "../limits-CrHLm5Tk.mjs";
3
2
  import { a as requireRuntimeBinding } from "../env-DtKg5G26.mjs";
3
+ import { t as UsageLimit } from "../limits-CrHLm5Tk.mjs";
4
4
  import { i as validateSandboxOptions, n as SANDBOX_PORT_HEADER, r as SandboxContainer } from "../sandbox-container-BuxhwCgt.mjs";
5
5
  export * from "@cloudflare/sandbox";
6
6
  // src/runtime/sandbox.ts
@@ -1,3 +1,4 @@
1
+ import { n as RequestUrl } from "../route-url-C3JwYrER.mjs";
1
2
  export type SseClientEvent<T = unknown> = {
2
3
  data: T;
3
4
  event: string;
@@ -20,4 +21,11 @@ export type ConnectEventStreamOptions = {
20
21
  events?: Array<string>;
21
22
  parse?: "json" | "text" | ((data: string) => unknown);
22
23
  };
23
- export declare function connectEventStream<Events extends SseEventMap = SseEventMap>(url: string | URL, options?: ConnectEventStreamOptions): SseClient<Events>;
24
+ /**
25
+ * Open an `EventSource` to a route that returns `eventStream()`.
26
+ *
27
+ * With `routing.typedRoutes`, a string `url` must match one of the app's routes
28
+ * or be an absolute `http://`/`https://` URL. Cast a path built at runtime with
29
+ * `as RouteUrl`.
30
+ */
31
+ export declare function connectEventStream<Events extends SseEventMap = SseEventMap>(url: RequestUrl | URL, options?: ConnectEventStreamOptions): SseClient<Events>;
@@ -1,4 +1,11 @@
1
1
  // src/runtime/sse-client.ts
2
+ /**
3
+ * Open an `EventSource` to a route that returns `eventStream()`.
4
+ *
5
+ * With `routing.typedRoutes`, a string `url` must match one of the app's routes
6
+ * or be an absolute `http://`/`https://` URL. Cast a path built at runtime with
7
+ * `as RouteUrl`.
8
+ */
2
9
  function connectEventStream(url, options = {}) {
3
10
  const EventSourceCtor = globalThis.EventSource;
4
11
  if (!EventSourceCtor) throw new Error("sse: EventSource is not available in this runtime.");
@@ -1,2 +1,2 @@
1
- import { D as runValidation, E as ValidatorSlots, T as HandlerInput } from "../handler-BR6Tvjkp.mjs";
1
+ import { D as runValidation, E as ValidatorSlots, T as HandlerInput } from "../handler-BO7Od-z9.mjs";
2
2
  export { HandlerInput, ValidatorSlots, runValidation };
@@ -1 +1 @@
1
- export { t as runValidation } from "../validator-CTfmzZYb.mjs";
1
+ export { t as runValidation } from "../validator-8-NZs2Xr.mjs";
@@ -1,6 +1,6 @@
1
- import { n as AuthState } from "../auth-CH4PLAX1.mjs";
2
- import { r as VoidAuthRuntimeOptions, t as VoidAuthEnv } from "../better-auth-shared-BJyG2mH0.mjs";
3
- import { f as WebSocketInstanceKey, t as AnyWebSocketDefinition } from "../ws-Dmjg5NH2.mjs";
1
+ import { r as AuthState } from "../auth-Bk9VGtQW.mjs";
2
+ import { r as VoidAuthRuntimeOptions, t as VoidAuthEnv } from "../better-auth-shared-CQFdtguU.mjs";
3
+ import { f as WebSocketInstanceKey, t as AnyWebSocketDefinition } from "../ws--U7QicYy.mjs";
4
4
  export type WebSocketRouteMeta = {
5
5
  name?: string;
6
6
  key?: WebSocketInstanceKey;
@@ -1,4 +1,4 @@
1
- import { t as authContext } from "../auth-YVjBX5NY.mjs";
1
+ import { t as authContext } from "../auth-DyWp-fSo.mjs";
2
2
  import { o as withRuntimeEnv } from "../env-DtKg5G26.mjs";
3
3
  // src/runtime/ws-server.ts
4
4
  function matchRoute(pattern, pathname) {
@@ -1,2 +1,2 @@
1
- import { a as RoomDefinition, c as VoidSocket, d as WebSocketConnection, f as WebSocketInstanceKey, h as defineWebSocket, i as RoomController, l as VoidSocketCloseEvent, m as defineRoom, n as ConnectCommonOptions, o as SocketContext, p as connect, r as RoomContext, s as SocketDefinition, t as AnyWebSocketDefinition, u as WebSocketBaseContext } from "../ws-Dmjg5NH2.mjs";
1
+ import { a as RoomDefinition, c as VoidSocket, d as WebSocketConnection, f as WebSocketInstanceKey, h as defineWebSocket, i as RoomController, l as VoidSocketCloseEvent, m as defineRoom, n as ConnectCommonOptions, o as SocketContext, p as connect, r as RoomContext, s as SocketDefinition, t as AnyWebSocketDefinition, u as WebSocketBaseContext } from "../ws--U7QicYy.mjs";
2
2
  export { AnyWebSocketDefinition, ConnectCommonOptions, RoomContext, RoomController, RoomDefinition, SocketContext, SocketDefinition, VoidSocket, VoidSocketCloseEvent, WebSocketBaseContext, WebSocketConnection, WebSocketInstanceKey, connect, defineRoom, defineWebSocket };
@@ -1,5 +1,5 @@
1
1
  import { t as isResourceName } from "../resource-name-DlJ9QXzg.mjs";
2
- import { t as interpolateRouteParams } from "../route-url-CRDF-I0I.mjs";
2
+ import { t as interpolateRouteParams } from "../route-url-CfCR4oMj.mjs";
3
3
  // src/runtime/ws.ts
4
4
  function defineRoom(definition) {
5
5
  assertResourceName(definition.name);