@timber-js/app 0.2.0-alpha.23 → 0.2.0-alpha.231

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 (1575) hide show
  1. package/LICENSE +8 -0
  2. package/agent-skill.md +389 -0
  3. package/bin/timber.mjs +15 -1
  4. package/dist/_chunks/actions-CYjRMpZI.js +1273 -0
  5. package/dist/_chunks/actions-CYjRMpZI.js.map +1 -0
  6. package/dist/_chunks/als-registry-DpygwCp0.js +42 -0
  7. package/dist/_chunks/als-registry-DpygwCp0.js.map +1 -0
  8. package/dist/_chunks/als-slots-kbQrHTzm.js +25 -0
  9. package/dist/_chunks/als-slots-kbQrHTzm.js.map +1 -0
  10. package/dist/_chunks/base-path-DDIx0FXe.js +79 -0
  11. package/dist/_chunks/base-path-DDIx0FXe.js.map +1 -0
  12. package/dist/_chunks/build-output-helper-5UsltK-S.js +398 -0
  13. package/dist/_chunks/build-output-helper-5UsltK-S.js.map +1 -0
  14. package/dist/_chunks/cache-api-BZJNt01a.js +1282 -0
  15. package/dist/_chunks/cache-api-BZJNt01a.js.map +1 -0
  16. package/dist/_chunks/canonicalize-CqK135BN.js +117 -0
  17. package/dist/_chunks/canonicalize-CqK135BN.js.map +1 -0
  18. package/dist/_chunks/chains-D-RRc7CM.js +266 -0
  19. package/dist/_chunks/chains-D-RRc7CM.js.map +1 -0
  20. package/dist/_chunks/chains-KblEfYzm.js +1 -0
  21. package/dist/_chunks/classify-_W0RWa5w.js +146 -0
  22. package/dist/_chunks/classify-_W0RWa5w.js.map +1 -0
  23. package/dist/_chunks/cli-check-BAKOSTkg.js +251 -0
  24. package/dist/_chunks/cli-check-BAKOSTkg.js.map +1 -0
  25. package/dist/_chunks/cli-context-BPdyA7Fp.js +1 -0
  26. package/dist/_chunks/cli-context-CwTKMjVe.js +77 -0
  27. package/dist/_chunks/cli-context-CwTKMjVe.js.map +1 -0
  28. package/dist/_chunks/cli-dev-status-prPMLU8G.js +138 -0
  29. package/dist/_chunks/cli-dev-status-prPMLU8G.js.map +1 -0
  30. package/dist/_chunks/cli-init-BoXOYYil.js +196 -0
  31. package/dist/_chunks/cli-init-BoXOYYil.js.map +1 -0
  32. package/dist/_chunks/cli-schema-sync-CAllbqRB.js +289 -0
  33. package/dist/_chunks/cli-schema-sync-CAllbqRB.js.map +1 -0
  34. package/dist/_chunks/cli-schema-sync-y_8ijmzO.js +1 -0
  35. package/dist/_chunks/client-dep-entries-C9hv-3k9.js +109 -0
  36. package/dist/_chunks/client-dep-entries-C9hv-3k9.js.map +1 -0
  37. package/dist/_chunks/cloudflare-_2fhxQE8.js +1314 -0
  38. package/dist/_chunks/cloudflare-_2fhxQE8.js.map +1 -0
  39. package/dist/_chunks/codec-registry-C8hOGmZo.js +13 -0
  40. package/dist/_chunks/codec-registry-C8hOGmZo.js.map +1 -0
  41. package/dist/_chunks/codegen-vaCyFyVN.js +479 -0
  42. package/dist/_chunks/codegen-vaCyFyVN.js.map +1 -0
  43. package/dist/_chunks/convention-lint-D54k6uUM.js +578 -0
  44. package/dist/_chunks/convention-lint-D54k6uUM.js.map +1 -0
  45. package/dist/_chunks/dev-discovery-YnabkCKD.js +238 -0
  46. package/dist/_chunks/dev-discovery-YnabkCKD.js.map +1 -0
  47. package/dist/_chunks/dev-server-L8biS7Az.js +1 -0
  48. package/dist/_chunks/dev-server-Rq659RR1.js +2439 -0
  49. package/dist/_chunks/dev-server-Rq659RR1.js.map +1 -0
  50. package/dist/_chunks/dev-span-_NzMX-au.js +108 -0
  51. package/dist/_chunks/dev-span-_NzMX-au.js.map +1 -0
  52. package/dist/_chunks/dev-store-BvdqtHvK.js +327 -0
  53. package/dist/_chunks/dev-store-BvdqtHvK.js.map +1 -0
  54. package/dist/_chunks/dist-C1Rjlo6s.js +384 -0
  55. package/dist/_chunks/dist-C1Rjlo6s.js.map +1 -0
  56. package/dist/_chunks/error-boundary-OHK1mI99.js +1100 -0
  57. package/dist/_chunks/error-boundary-OHK1mI99.js.map +1 -0
  58. package/dist/_chunks/fast-hash-DddxkU5Y.js +40 -0
  59. package/dist/_chunks/fast-hash-DddxkU5Y.js.map +1 -0
  60. package/dist/_chunks/flight-source-node-BGanuoSS.js +516 -0
  61. package/dist/_chunks/flight-source-node-BGanuoSS.js.map +1 -0
  62. package/dist/_chunks/format-DuPOoXUP.js +13 -0
  63. package/dist/_chunks/format-DuPOoXUP.js.map +1 -0
  64. package/dist/_chunks/fs-identity-BmQ_Agg-.js +205 -0
  65. package/dist/_chunks/fs-identity-BmQ_Agg-.js.map +1 -0
  66. package/dist/_chunks/global-context-CFSSysdJ.js +77 -0
  67. package/dist/_chunks/global-context-CFSSysdJ.js.map +1 -0
  68. package/dist/_chunks/graph-cache-B1LAg4t7.js +219 -0
  69. package/dist/_chunks/graph-cache-B1LAg4t7.js.map +1 -0
  70. package/dist/_chunks/href-BtspoNc9.js +164 -0
  71. package/dist/_chunks/href-BtspoNc9.js.map +1 -0
  72. package/dist/_chunks/href-validation-DNg-zV7u.js +102 -0
  73. package/dist/_chunks/href-validation-DNg-zV7u.js.map +1 -0
  74. package/dist/_chunks/json-lossy-check-BXM45k8p.js +65 -0
  75. package/dist/_chunks/json-lossy-check-BXM45k8p.js.map +1 -0
  76. package/dist/_chunks/live-graph-C7-yA8W9.js +150 -0
  77. package/dist/_chunks/live-graph-C7-yA8W9.js.map +1 -0
  78. package/dist/_chunks/logger-YtMSKfft.js +755 -0
  79. package/dist/_chunks/logger-YtMSKfft.js.map +1 -0
  80. package/dist/_chunks/merge-search-params-7o_5yX0L.js +111 -0
  81. package/dist/_chunks/merge-search-params-7o_5yX0L.js.map +1 -0
  82. package/dist/_chunks/{metadata-routes-Cjmvi3rQ.js → metadata-routes-BL26HCDd.js} +71 -29
  83. package/dist/_chunks/metadata-routes-BL26HCDd.js.map +1 -0
  84. package/dist/_chunks/navigation-root-CoGHIMiE.js +239 -0
  85. package/dist/_chunks/navigation-root-CoGHIMiE.js.map +1 -0
  86. package/dist/_chunks/node-response-D3hXWb8y.js +267 -0
  87. package/dist/_chunks/node-response-D3hXWb8y.js.map +1 -0
  88. package/dist/_chunks/param-value-DqlGfF57.js +65 -0
  89. package/dist/_chunks/param-value-DqlGfF57.js.map +1 -0
  90. package/dist/_chunks/plugin-context-BfSRKJfz.js +1 -0
  91. package/dist/_chunks/plugin-context-FCkaNLUB.js +327 -0
  92. package/dist/_chunks/plugin-context-FCkaNLUB.js.map +1 -0
  93. package/dist/_chunks/poison-rules-Bmz-lCPi.js +109 -0
  94. package/dist/_chunks/poison-rules-Bmz-lCPi.js.map +1 -0
  95. package/dist/_chunks/poison-scan-CRSP06Es.js +98 -0
  96. package/dist/_chunks/poison-scan-CRSP06Es.js.map +1 -0
  97. package/dist/_chunks/purge-store-8BqLAYZ1.js +13 -0
  98. package/dist/_chunks/purge-store-8BqLAYZ1.js.map +1 -0
  99. package/dist/_chunks/render-timeout-MrrqD1wd.js +53 -0
  100. package/dist/_chunks/render-timeout-MrrqD1wd.js.map +1 -0
  101. package/dist/_chunks/resolve-schema-B-aCuTu3.js +49 -0
  102. package/dist/_chunks/resolve-schema-B-aCuTu3.js.map +1 -0
  103. package/dist/_chunks/route-methods-Dk2kZc0n.js +36 -0
  104. package/dist/_chunks/route-methods-Dk2kZc0n.js.map +1 -0
  105. package/dist/_chunks/rsc-cache-key-D0cb0Gmc.js +242 -0
  106. package/dist/_chunks/rsc-cache-key-D0cb0Gmc.js.map +1 -0
  107. package/dist/_chunks/rsc-media-type-m8jz9u6_.js +60 -0
  108. package/dist/_chunks/rsc-media-type-m8jz9u6_.js.map +1 -0
  109. package/dist/_chunks/rsc-payload-path-EphpDB-J.js +53 -0
  110. package/dist/_chunks/rsc-payload-path-EphpDB-J.js.map +1 -0
  111. package/dist/_chunks/scan-CyizcBiX.js +139 -0
  112. package/dist/_chunks/scan-CyizcBiX.js.map +1 -0
  113. package/dist/_chunks/scanner-BNQ4qnLX.js +2048 -0
  114. package/dist/_chunks/scanner-BNQ4qnLX.js.map +1 -0
  115. package/dist/_chunks/schema-bridge-DyRs3cqy.js +235 -0
  116. package/dist/_chunks/schema-bridge-DyRs3cqy.js.map +1 -0
  117. package/dist/_chunks/segment-classify-Ho8jXWeC.js +195 -0
  118. package/dist/_chunks/segment-classify-Ho8jXWeC.js.map +1 -0
  119. package/dist/_chunks/segment-context-GAyTjjtS.js +33 -0
  120. package/dist/_chunks/segment-context-GAyTjjtS.js.map +1 -0
  121. package/dist/_chunks/segment-keys-Y60KNc8C.js +61 -0
  122. package/dist/_chunks/segment-keys-Y60KNc8C.js.map +1 -0
  123. package/dist/_chunks/singleflight-CzoOVB9Y.js +53 -0
  124. package/dist/_chunks/singleflight-CzoOVB9Y.js.map +1 -0
  125. package/dist/_chunks/sizeof-Cmx6Fs-Y.js +35 -0
  126. package/dist/_chunks/sizeof-Cmx6Fs-Y.js.map +1 -0
  127. package/dist/_chunks/ssr-data-9hPtcNOr.js +48 -0
  128. package/dist/_chunks/ssr-data-9hPtcNOr.js.map +1 -0
  129. package/dist/_chunks/state-B-EBjeER.js +49 -0
  130. package/dist/_chunks/state-B-EBjeER.js.map +1 -0
  131. package/dist/_chunks/status-page-marker-U6B1aFMb.js +530 -0
  132. package/dist/_chunks/status-page-marker-U6B1aFMb.js.map +1 -0
  133. package/dist/_chunks/tree-match-Bqdr9szG.js +168 -0
  134. package/dist/_chunks/tree-match-Bqdr9szG.js.map +1 -0
  135. package/dist/_chunks/use-query-states-pkDV-jSg.js +223 -0
  136. package/dist/_chunks/use-query-states-pkDV-jSg.js.map +1 -0
  137. package/dist/_chunks/walkers-D_QHR_nf.js +142 -0
  138. package/dist/_chunks/walkers-D_QHR_nf.js.map +1 -0
  139. package/dist/_chunks/write-file-atomic-DW8m_Atv.js +31 -0
  140. package/dist/_chunks/write-file-atomic-DW8m_Atv.js.map +1 -0
  141. package/dist/adapters/build-output-helper.d.ts +81 -0
  142. package/dist/adapters/build-output-helper.d.ts.map +1 -0
  143. package/dist/adapters/canonicalize-module.d.ts +8 -0
  144. package/dist/adapters/canonicalize-module.d.ts.map +1 -0
  145. package/dist/adapters/cloudflare-dev.d.ts +109 -0
  146. package/dist/adapters/cloudflare-dev.d.ts.map +1 -0
  147. package/dist/adapters/cloudflare-dev.js +73 -0
  148. package/dist/adapters/cloudflare-dev.js.map +1 -0
  149. package/dist/adapters/cloudflare-kv-cache.d.ts +64 -0
  150. package/dist/adapters/cloudflare-kv-cache.d.ts.map +1 -0
  151. package/dist/adapters/cloudflare-kv-cache.js +122 -0
  152. package/dist/adapters/cloudflare-kv-cache.js.map +1 -0
  153. package/dist/adapters/cloudflare.d.ts +217 -24
  154. package/dist/adapters/cloudflare.d.ts.map +1 -1
  155. package/dist/adapters/cloudflare.js +1 -188
  156. package/dist/adapters/compress-module.d.ts +25 -4
  157. package/dist/adapters/compress-module.d.ts.map +1 -1
  158. package/dist/adapters/fs-identity.d.ts +63 -0
  159. package/dist/adapters/fs-identity.d.ts.map +1 -0
  160. package/dist/adapters/nitro-immutable-assets.d.ts +47 -0
  161. package/dist/adapters/nitro-immutable-assets.d.ts.map +1 -0
  162. package/dist/adapters/nitro-presets.d.ts +37 -0
  163. package/dist/adapters/nitro-presets.d.ts.map +1 -0
  164. package/dist/adapters/nitro-preview.d.ts +65 -0
  165. package/dist/adapters/nitro-preview.d.ts.map +1 -0
  166. package/dist/adapters/nitro.d.ts +69 -38
  167. package/dist/adapters/nitro.d.ts.map +1 -1
  168. package/dist/adapters/nitro.js +837 -347
  169. package/dist/adapters/nitro.js.map +1 -1
  170. package/dist/adapters/shared.d.ts +85 -0
  171. package/dist/adapters/shared.d.ts.map +1 -0
  172. package/dist/adapters/types.d.ts +124 -16
  173. package/dist/adapters/types.d.ts.map +1 -1
  174. package/dist/adapters/types.js +0 -0
  175. package/dist/analyze/chains.d.ts +124 -0
  176. package/dist/analyze/chains.d.ts.map +1 -0
  177. package/dist/analyze/classify.d.ts +153 -0
  178. package/dist/analyze/classify.d.ts.map +1 -0
  179. package/dist/analyze/crawl-entry.d.ts +17 -0
  180. package/dist/analyze/crawl-entry.d.ts.map +1 -0
  181. package/dist/analyze/crawl-entry.js +312 -0
  182. package/dist/analyze/crawl-entry.js.map +1 -0
  183. package/dist/analyze/crawl.d.ts +134 -0
  184. package/dist/analyze/crawl.d.ts.map +1 -0
  185. package/dist/analyze/graph-cache.d.ts +104 -0
  186. package/dist/analyze/graph-cache.d.ts.map +1 -0
  187. package/dist/analyze/graph-command.d.ts +43 -0
  188. package/dist/analyze/graph-command.d.ts.map +1 -0
  189. package/dist/analyze/graph-command.js +386 -0
  190. package/dist/analyze/graph-command.js.map +1 -0
  191. package/dist/analyze/live-graph.d.ts +81 -0
  192. package/dist/analyze/live-graph.d.ts.map +1 -0
  193. package/dist/analyze/poison-rules.d.ts +72 -0
  194. package/dist/analyze/poison-rules.d.ts.map +1 -0
  195. package/dist/analyze/poison-scan.d.ts +48 -0
  196. package/dist/analyze/poison-scan.d.ts.map +1 -0
  197. package/dist/analyze/scan.d.ts +73 -0
  198. package/dist/analyze/scan.d.ts.map +1 -0
  199. package/dist/cache/cache-api.d.ts +48 -0
  200. package/dist/cache/cache-api.d.ts.map +1 -0
  201. package/dist/cache/fast-hash.d.ts +5 -0
  202. package/dist/cache/fast-hash.d.ts.map +1 -1
  203. package/dist/cache/guarded-read.d.ts +29 -0
  204. package/dist/cache/guarded-read.d.ts.map +1 -0
  205. package/dist/cache/handler-store.d.ts +45 -0
  206. package/dist/cache/handler-store.d.ts.map +1 -0
  207. package/dist/cache/index.d.ts +32 -9
  208. package/dist/cache/index.d.ts.map +1 -1
  209. package/dist/cache/index.js +4 -326
  210. package/dist/cache/invalidation-epoch.d.ts +50 -0
  211. package/dist/cache/invalidation-epoch.d.ts.map +1 -0
  212. package/dist/cache/json-lossy-check.d.ts +11 -0
  213. package/dist/cache/json-lossy-check.d.ts.map +1 -0
  214. package/dist/cache/key-discipline.d.ts +61 -0
  215. package/dist/cache/key-discipline.d.ts.map +1 -0
  216. package/dist/cache/redis-handler.d.ts +140 -9
  217. package/dist/cache/redis-handler.d.ts.map +1 -1
  218. package/dist/cache/singleflight.d.ts +31 -2
  219. package/dist/cache/singleflight.d.ts.map +1 -1
  220. package/dist/cache/sizeof.d.ts +22 -0
  221. package/dist/cache/sizeof.d.ts.map +1 -0
  222. package/dist/cache/stable-stringify.d.ts +15 -0
  223. package/dist/cache/stable-stringify.d.ts.map +1 -1
  224. package/dist/cache/store.d.ts +53 -0
  225. package/dist/cache/store.d.ts.map +1 -0
  226. package/dist/cache/stores/cloudflare-kv.d.ts +38 -0
  227. package/dist/cache/stores/cloudflare-kv.d.ts.map +1 -0
  228. package/dist/cache/stores/cloudflare-kv.js +28 -0
  229. package/dist/cache/stores/cloudflare-kv.js.map +1 -0
  230. package/dist/cache/stores/memory.d.ts +42 -0
  231. package/dist/cache/stores/memory.d.ts.map +1 -0
  232. package/dist/cache/stores/memory.js +89 -0
  233. package/dist/cache/stores/memory.js.map +1 -0
  234. package/dist/cache/stores/redis.d.ts +69 -0
  235. package/dist/cache/stores/redis.d.ts.map +1 -0
  236. package/dist/cache/stores/redis.js +34 -0
  237. package/dist/cache/stores/redis.js.map +1 -0
  238. package/dist/cache/stores/vercel.d.ts +36 -0
  239. package/dist/cache/stores/vercel.d.ts.map +1 -0
  240. package/dist/cache/stores/vercel.js +32 -0
  241. package/dist/cache/stores/vercel.js.map +1 -0
  242. package/dist/cache/tag-aware-handler.d.ts +51 -0
  243. package/dist/cache/tag-aware-handler.d.ts.map +1 -0
  244. package/dist/cache/timber-cache.d.ts +25 -11
  245. package/dist/cache/timber-cache.d.ts.map +1 -1
  246. package/dist/cdn/cloudflare-purge.d.ts +23 -0
  247. package/dist/cdn/cloudflare-purge.d.ts.map +1 -0
  248. package/dist/cdn/cloudflare-purge.js +29 -0
  249. package/dist/cdn/cloudflare-purge.js.map +1 -0
  250. package/dist/cdn/fastly-purge.d.ts +25 -0
  251. package/dist/cdn/fastly-purge.d.ts.map +1 -0
  252. package/dist/cdn/fastly-purge.js +32 -0
  253. package/dist/cdn/fastly-purge.js.map +1 -0
  254. package/dist/cdn/headers.d.ts +97 -0
  255. package/dist/cdn/headers.d.ts.map +1 -0
  256. package/dist/cdn/index.d.ts +5 -0
  257. package/dist/cdn/index.d.ts.map +1 -0
  258. package/dist/cdn/index.js +93 -0
  259. package/dist/cdn/index.js.map +1 -0
  260. package/dist/cdn/purge-store.d.ts +32 -0
  261. package/dist/cdn/purge-store.d.ts.map +1 -0
  262. package/dist/cdn/workers-cache-purge.d.ts +20 -0
  263. package/dist/cdn/workers-cache-purge.d.ts.map +1 -0
  264. package/dist/cdn/workers-cache-purge.js +33 -0
  265. package/dist/cdn/workers-cache-purge.js.map +1 -0
  266. package/dist/cli-check.d.ts +133 -0
  267. package/dist/cli-check.d.ts.map +1 -0
  268. package/dist/cli-context.d.ts +62 -0
  269. package/dist/cli-context.d.ts.map +1 -0
  270. package/dist/cli-dev-status.d.ts +75 -0
  271. package/dist/cli-dev-status.d.ts.map +1 -0
  272. package/dist/cli-init.d.ts +72 -0
  273. package/dist/cli-init.d.ts.map +1 -0
  274. package/dist/cli-schema-sync.d.ts +59 -0
  275. package/dist/cli-schema-sync.d.ts.map +1 -0
  276. package/dist/cli.d.ts +80 -16
  277. package/dist/cli.d.ts.map +1 -1
  278. package/dist/cli.js +210 -69
  279. package/dist/cli.js.map +1 -1
  280. package/dist/client/browser-dev.d.ts +42 -2
  281. package/dist/client/browser-dev.d.ts.map +1 -1
  282. package/dist/client/browser-entry/action-dispatch.d.ts +19 -0
  283. package/dist/client/browser-entry/action-dispatch.d.ts.map +1 -0
  284. package/dist/client/browser-entry/action-queue.d.ts +64 -0
  285. package/dist/client/browser-entry/action-queue.d.ts.map +1 -0
  286. package/dist/client/browser-entry/form-state.d.ts +22 -0
  287. package/dist/client/browser-entry/form-state.d.ts.map +1 -0
  288. package/dist/client/browser-entry/hmr.d.ts +27 -0
  289. package/dist/client/browser-entry/hmr.d.ts.map +1 -0
  290. package/dist/client/browser-entry/hydrate.d.ts +61 -0
  291. package/dist/client/browser-entry/hydrate.d.ts.map +1 -0
  292. package/dist/client/browser-entry/index.d.ts +32 -0
  293. package/dist/client/browser-entry/index.d.ts.map +1 -0
  294. package/dist/client/browser-entry/post-hydration.d.ts +26 -0
  295. package/dist/client/browser-entry/post-hydration.d.ts.map +1 -0
  296. package/dist/client/browser-entry/router-init.d.ts +41 -0
  297. package/dist/client/browser-entry/router-init.d.ts.map +1 -0
  298. package/dist/client/browser-entry/rsc-stream.d.ts +35 -0
  299. package/dist/client/browser-entry/rsc-stream.d.ts.map +1 -0
  300. package/dist/client/browser-entry/scroll.d.ts +28 -0
  301. package/dist/client/browser-entry/scroll.d.ts.map +1 -0
  302. package/dist/client/deny-last-resort.d.ts +29 -0
  303. package/dist/client/deny-last-resort.d.ts.map +1 -0
  304. package/dist/client/dev-pill/index.d.ts +32 -0
  305. package/dist/client/dev-pill/index.d.ts.map +1 -0
  306. package/dist/client/dev-pill/store.d.ts +105 -0
  307. package/dist/client/dev-pill/store.d.ts.map +1 -0
  308. package/dist/client/dev-pill/view.d.ts +9 -0
  309. package/dist/client/dev-pill/view.d.ts.map +1 -0
  310. package/dist/client/error-boundary.d.ts +58 -9
  311. package/dist/client/error-boundary.d.ts.map +1 -1
  312. package/dist/client/error-boundary.js +1 -126
  313. package/dist/client/error-reconstituter.d.ts +55 -0
  314. package/dist/client/error-reconstituter.d.ts.map +1 -0
  315. package/dist/client/form.d.ts +38 -99
  316. package/dist/client/form.d.ts.map +1 -1
  317. package/dist/client/global-context.d.ts +35 -0
  318. package/dist/client/global-context.d.ts.map +1 -0
  319. package/dist/client/history.d.ts +50 -9
  320. package/dist/client/history.d.ts.map +1 -1
  321. package/dist/client/index.d.ts +23 -33
  322. package/dist/client/index.d.ts.map +1 -1
  323. package/dist/client/index.js +330 -1273
  324. package/dist/client/index.js.map +1 -1
  325. package/dist/client/internal.d.ts +20 -0
  326. package/dist/client/internal.d.ts.map +1 -0
  327. package/dist/client/internal.js +785 -0
  328. package/dist/client/internal.js.map +1 -0
  329. package/dist/client/link.d.ts +75 -71
  330. package/dist/client/link.d.ts.map +1 -1
  331. package/dist/client/location-search.d.ts +12 -0
  332. package/dist/client/location-search.d.ts.map +1 -0
  333. package/dist/client/navigation-api.d.ts +95 -0
  334. package/dist/client/navigation-api.d.ts.map +1 -0
  335. package/dist/client/navigation-commit.d.ts +111 -0
  336. package/dist/client/navigation-commit.d.ts.map +1 -0
  337. package/dist/client/navigation-context.d.ts +75 -37
  338. package/dist/client/navigation-context.d.ts.map +1 -1
  339. package/dist/client/navigation-root.d.ts +106 -0
  340. package/dist/client/navigation-root.d.ts.map +1 -0
  341. package/dist/client/navigation-transition.d.ts +255 -0
  342. package/dist/client/navigation-transition.d.ts.map +1 -0
  343. package/dist/client/nuqs-adapter.d.ts +5 -2
  344. package/dist/client/nuqs-adapter.d.ts.map +1 -1
  345. package/dist/client/params-context.d.ts +81 -0
  346. package/dist/client/params-context.d.ts.map +1 -0
  347. package/dist/client/react-root.d.ts +51 -0
  348. package/dist/client/react-root.d.ts.map +1 -0
  349. package/dist/client/router-effects.d.ts +203 -0
  350. package/dist/client/router-effects.d.ts.map +1 -0
  351. package/dist/client/router-lifecycle.d.ts +107 -0
  352. package/dist/client/router-lifecycle.d.ts.map +1 -0
  353. package/dist/client/router-pipeline.d.ts +81 -0
  354. package/dist/client/router-pipeline.d.ts.map +1 -0
  355. package/dist/client/router-ref.d.ts +2 -2
  356. package/dist/client/router-ref.d.ts.map +1 -1
  357. package/dist/client/router-skew.d.ts +21 -0
  358. package/dist/client/router-skew.d.ts.map +1 -0
  359. package/dist/client/router-types.d.ts +294 -0
  360. package/dist/client/router-types.d.ts.map +1 -0
  361. package/dist/client/router-url.d.ts +24 -0
  362. package/dist/client/router-url.d.ts.map +1 -0
  363. package/dist/client/router.d.ts +1 -97
  364. package/dist/client/router.d.ts.map +1 -1
  365. package/dist/client/rsc-fetch.d.ts +110 -28
  366. package/dist/client/rsc-fetch.d.ts.map +1 -1
  367. package/dist/client/segment-cache.d.ts +186 -25
  368. package/dist/client/segment-cache.d.ts.map +1 -1
  369. package/dist/client/segment-context.d.ts.map +1 -1
  370. package/dist/client/segment-outlet.d.ts +68 -0
  371. package/dist/client/segment-outlet.d.ts.map +1 -0
  372. package/dist/client/segment-update-context.d.ts +15 -0
  373. package/dist/client/segment-update-context.d.ts.map +1 -0
  374. package/dist/client/shallow-url.d.ts +10 -0
  375. package/dist/client/shallow-url.d.ts.map +1 -0
  376. package/dist/client/slot-content-cache-context.d.ts +35 -0
  377. package/dist/client/slot-content-cache-context.d.ts.map +1 -0
  378. package/dist/client/slot-context.d.ts +31 -0
  379. package/dist/client/slot-context.d.ts.map +1 -0
  380. package/dist/client/slot-outlet.d.ts +16 -0
  381. package/dist/client/slot-outlet.d.ts.map +1 -0
  382. package/dist/client/slot-provider.d.ts +25 -0
  383. package/dist/client/slot-provider.d.ts.map +1 -0
  384. package/dist/client/ssr-data.d.ts +26 -50
  385. package/dist/client/ssr-data.d.ts.map +1 -1
  386. package/dist/client/stale-client.d.ts +69 -0
  387. package/dist/client/stale-client.d.ts.map +1 -0
  388. package/dist/client/state.d.ts +21 -13
  389. package/dist/client/state.d.ts.map +1 -1
  390. package/dist/client/status-page-marker.d.ts +25 -0
  391. package/dist/client/status-page-marker.d.ts.map +1 -0
  392. package/dist/client/top-loader.d.ts +7 -6
  393. package/dist/client/top-loader.d.ts.map +1 -1
  394. package/dist/client/unload-guard.d.ts +5 -0
  395. package/dist/client/unload-guard.d.ts.map +1 -1
  396. package/dist/client/use-cookie.d.ts +25 -0
  397. package/dist/client/use-cookie.d.ts.map +1 -1
  398. package/dist/client/use-field-state.d.ts +42 -0
  399. package/dist/client/use-field-state.d.ts.map +1 -0
  400. package/dist/client/use-link-status.d.ts +5 -5
  401. package/dist/client/use-link-status.d.ts.map +1 -1
  402. package/dist/client/use-pathname.d.ts +13 -11
  403. package/dist/client/use-pathname.d.ts.map +1 -1
  404. package/dist/client/use-pending-navigation.d.ts +47 -0
  405. package/dist/client/use-pending-navigation.d.ts.map +1 -0
  406. package/dist/client/use-query-states.d.ts +10 -4
  407. package/dist/client/use-query-states.d.ts.map +1 -1
  408. package/dist/client/use-router.d.ts +15 -8
  409. package/dist/client/use-router.d.ts.map +1 -1
  410. package/dist/client/use-search-params.d.ts +15 -8
  411. package/dist/client/use-search-params.d.ts.map +1 -1
  412. package/dist/client/use-segment-params.d.ts +55 -0
  413. package/dist/client/use-segment-params.d.ts.map +1 -0
  414. package/dist/codec.d.ts +69 -0
  415. package/dist/codec.d.ts.map +1 -0
  416. package/dist/codec.js +75 -0
  417. package/dist/codec.js.map +1 -0
  418. package/dist/config-types.d.ts +366 -0
  419. package/dist/config-types.d.ts.map +1 -0
  420. package/dist/config-validation.d.ts +68 -0
  421. package/dist/config-validation.d.ts.map +1 -0
  422. package/dist/cookies/define-cookie.d.ts +58 -25
  423. package/dist/cookies/define-cookie.d.ts.map +1 -1
  424. package/dist/cookies/index.d.ts +3 -2
  425. package/dist/cookies/index.d.ts.map +1 -1
  426. package/dist/cookies/index.js +230 -37
  427. package/dist/cookies/index.js.map +1 -1
  428. package/dist/cookies/json-cookie.d.ts +64 -0
  429. package/dist/cookies/json-cookie.d.ts.map +1 -0
  430. package/dist/cookies/validation.d.ts +34 -0
  431. package/dist/cookies/validation.d.ts.map +1 -0
  432. package/dist/dev-tools/404-page.d.ts +50 -0
  433. package/dist/dev-tools/404-page.d.ts.map +1 -0
  434. package/dist/dev-tools/await-span.d.ts +17 -0
  435. package/dist/dev-tools/await-span.d.ts.map +1 -0
  436. package/dist/dev-tools/browser-logs.d.ts +40 -0
  437. package/dist/dev-tools/browser-logs.d.ts.map +1 -0
  438. package/dist/dev-tools/dev-page-shell.d.ts +95 -0
  439. package/dist/dev-tools/dev-page-shell.d.ts.map +1 -0
  440. package/dist/dev-tools/error-page.d.ts +32 -0
  441. package/dist/dev-tools/error-page.d.ts.map +1 -0
  442. package/dist/dev-tools/holding-server.d.ts +46 -0
  443. package/dist/dev-tools/holding-server.d.ts.map +1 -0
  444. package/dist/dev-tools/hydration-overlay.d.ts +11 -0
  445. package/dist/dev-tools/hydration-overlay.d.ts.map +1 -0
  446. package/dist/dev-tools/index.d.ts +31 -0
  447. package/dist/dev-tools/index.d.ts.map +1 -0
  448. package/dist/dev-tools/instrumentation.d.ts +74 -0
  449. package/dist/dev-tools/instrumentation.d.ts.map +1 -0
  450. package/dist/{server/dev-logger.d.ts → dev-tools/logger.d.ts} +1 -1
  451. package/dist/dev-tools/logger.d.ts.map +1 -0
  452. package/dist/{plugins/dev-logs.d.ts → dev-tools/logs.d.ts} +19 -5
  453. package/dist/dev-tools/logs.d.ts.map +1 -0
  454. package/dist/{plugins/dev-error-overlay.d.ts → dev-tools/overlay.d.ts} +15 -25
  455. package/dist/dev-tools/overlay.d.ts.map +1 -0
  456. package/dist/dev-tools/span-sink.d.ts +42 -0
  457. package/dist/dev-tools/span-sink.d.ts.map +1 -0
  458. package/dist/dev-tools/stack-classifier.d.ts +34 -0
  459. package/dist/dev-tools/stack-classifier.d.ts.map +1 -0
  460. package/dist/dev-tools/terminal.d.ts +28 -0
  461. package/dist/dev-tools/terminal.d.ts.map +1 -0
  462. package/dist/fonts/ast-walk.d.ts +68 -0
  463. package/dist/fonts/ast-walk.d.ts.map +1 -0
  464. package/dist/fonts/ast.d.ts +112 -8
  465. package/dist/fonts/ast.d.ts.map +1 -1
  466. package/dist/fonts/bundle.d.ts +50 -0
  467. package/dist/fonts/bundle.d.ts.map +1 -0
  468. package/dist/fonts/css.d.ts +1 -1
  469. package/dist/fonts/dev-middleware.d.ts +22 -0
  470. package/dist/fonts/dev-middleware.d.ts.map +1 -0
  471. package/dist/fonts/fallbacks.d.ts +0 -7
  472. package/dist/fonts/fallbacks.d.ts.map +1 -1
  473. package/dist/fonts/google.d.ts +5 -3
  474. package/dist/fonts/google.d.ts.map +1 -1
  475. package/dist/fonts/local.d.ts +5 -5
  476. package/dist/fonts/local.d.ts.map +1 -1
  477. package/dist/fonts/paths.d.ts +43 -0
  478. package/dist/fonts/paths.d.ts.map +1 -0
  479. package/dist/fonts/pipeline.d.ts +177 -0
  480. package/dist/fonts/pipeline.d.ts.map +1 -0
  481. package/dist/fonts/transform.d.ts +82 -0
  482. package/dist/fonts/transform.d.ts.map +1 -0
  483. package/dist/fonts/types.d.ts +47 -1
  484. package/dist/fonts/types.d.ts.map +1 -1
  485. package/dist/fonts/virtual-modules.d.ts +77 -0
  486. package/dist/fonts/virtual-modules.d.ts.map +1 -0
  487. package/dist/index.d.ts +37 -181
  488. package/dist/index.d.ts.map +1 -1
  489. package/dist/index.js +9952 -14264
  490. package/dist/index.js.map +1 -1
  491. package/dist/params/codec-registry.d.ts +36 -0
  492. package/dist/params/codec-registry.d.ts.map +1 -0
  493. package/dist/params/define-schema.d.ts +81 -0
  494. package/dist/params/define-schema.d.ts.map +1 -0
  495. package/dist/params/index.d.ts +4 -0
  496. package/dist/params/index.d.ts.map +1 -0
  497. package/dist/params/index.js +32 -0
  498. package/dist/params/index.js.map +1 -0
  499. package/dist/params/resolve-schema.d.ts +34 -0
  500. package/dist/params/resolve-schema.d.ts.map +1 -0
  501. package/dist/plugin-context.d.ts +269 -0
  502. package/dist/plugin-context.d.ts.map +1 -0
  503. package/dist/plugins/build-manifest.d.ts +7 -3
  504. package/dist/plugins/build-manifest.d.ts.map +1 -1
  505. package/dist/plugins/build-report.d.ts +61 -11
  506. package/dist/plugins/build-report.d.ts.map +1 -1
  507. package/dist/plugins/cache.d.ts +64 -0
  508. package/dist/plugins/cache.d.ts.map +1 -0
  509. package/dist/plugins/callsite-ast.d.ts +117 -0
  510. package/dist/plugins/callsite-ast.d.ts.map +1 -0
  511. package/dist/plugins/callsite-jsx.d.ts +35 -0
  512. package/dist/plugins/callsite-jsx.d.ts.map +1 -0
  513. package/dist/plugins/chunks.d.ts +11 -4
  514. package/dist/plugins/chunks.d.ts.map +1 -1
  515. package/dist/plugins/client-chunks.d.ts +40 -0
  516. package/dist/plugins/client-chunks.d.ts.map +1 -0
  517. package/dist/plugins/client-dep-entries.d.ts +80 -0
  518. package/dist/plugins/client-dep-entries.d.ts.map +1 -0
  519. package/dist/plugins/client-in-server-package-deps.d.ts +63 -0
  520. package/dist/plugins/client-in-server-package-deps.d.ts.map +1 -0
  521. package/dist/plugins/cloudflare-wasm.d.ts +21 -0
  522. package/dist/plugins/cloudflare-wasm.d.ts.map +1 -0
  523. package/dist/plugins/content.d.ts +1 -1
  524. package/dist/plugins/content.d.ts.map +1 -1
  525. package/dist/plugins/dev-await.d.ts +81 -0
  526. package/dist/plugins/dev-await.d.ts.map +1 -0
  527. package/dist/plugins/dev-discovery.d.ts +187 -0
  528. package/dist/plugins/dev-discovery.d.ts.map +1 -0
  529. package/dist/plugins/dev-hostname.d.ts +152 -0
  530. package/dist/plugins/dev-hostname.d.ts.map +1 -0
  531. package/dist/plugins/dev-server.d.ts +29 -2
  532. package/dist/plugins/dev-server.d.ts.map +1 -1
  533. package/dist/plugins/dev-store-clear.d.ts +83 -0
  534. package/dist/plugins/dev-store-clear.d.ts.map +1 -0
  535. package/dist/plugins/encryption-runtime.d.ts +13 -0
  536. package/dist/plugins/encryption-runtime.d.ts.map +1 -0
  537. package/dist/plugins/entries.d.ts +40 -4
  538. package/dist/plugins/entries.d.ts.map +1 -1
  539. package/dist/plugins/fonts.d.ts +35 -74
  540. package/dist/plugins/fonts.d.ts.map +1 -1
  541. package/dist/plugins/graph-endpoint.d.ts +114 -0
  542. package/dist/plugins/graph-endpoint.d.ts.map +1 -0
  543. package/dist/plugins/mdx.d.ts +18 -5
  544. package/dist/plugins/mdx.d.ts.map +1 -1
  545. package/dist/plugins/optimize-package-imports-defaults.d.ts +13 -0
  546. package/dist/plugins/optimize-package-imports-defaults.d.ts.map +1 -0
  547. package/dist/plugins/optimize-package-imports.d.ts +124 -0
  548. package/dist/plugins/optimize-package-imports.d.ts.map +1 -0
  549. package/dist/plugins/orphaned-modules.d.ts +57 -0
  550. package/dist/plugins/orphaned-modules.d.ts.map +1 -0
  551. package/dist/plugins/post-build.d.ts +110 -0
  552. package/dist/plugins/post-build.d.ts.map +1 -0
  553. package/dist/plugins/prebuilt-capture.d.ts +67 -0
  554. package/dist/plugins/prebuilt-capture.d.ts.map +1 -0
  555. package/dist/plugins/prebuilt-options-analysis.d.ts +40 -0
  556. package/dist/plugins/prebuilt-options-analysis.d.ts.map +1 -0
  557. package/dist/plugins/prebuilt.d.ts +98 -0
  558. package/dist/plugins/prebuilt.d.ts.map +1 -0
  559. package/dist/plugins/prerender-sugar.d.ts +39 -0
  560. package/dist/plugins/prerender-sugar.d.ts.map +1 -0
  561. package/dist/plugins/react-resolve.d.ts +49 -0
  562. package/dist/plugins/react-resolve.d.ts.map +1 -0
  563. package/dist/plugins/request-dep/analysis.d.ts +106 -0
  564. package/dist/plugins/request-dep/analysis.d.ts.map +1 -0
  565. package/dist/plugins/request-dep/index.d.ts +75 -0
  566. package/dist/plugins/request-dep/index.d.ts.map +1 -0
  567. package/dist/plugins/request-dep/origin.d.ts +61 -0
  568. package/dist/plugins/request-dep/origin.d.ts.map +1 -0
  569. package/dist/plugins/routing.d.ts +2 -2
  570. package/dist/plugins/routing.d.ts.map +1 -1
  571. package/dist/plugins/rsc-assets-manifest.d.ts +33 -0
  572. package/dist/plugins/rsc-assets-manifest.d.ts.map +1 -0
  573. package/dist/plugins/server-bundle.d.ts +1 -1
  574. package/dist/plugins/server-bundle.d.ts.map +1 -1
  575. package/dist/plugins/shims.d.ts +29 -5
  576. package/dist/plugins/shims.d.ts.map +1 -1
  577. package/dist/plugins/static-build.d.ts +246 -26
  578. package/dist/plugins/static-build.d.ts.map +1 -1
  579. package/dist/routes/href.d.ts +124 -0
  580. package/dist/routes/href.d.ts.map +1 -0
  581. package/dist/routes/index.d.ts +4 -0
  582. package/dist/routes/index.d.ts.map +1 -0
  583. package/dist/routes/index.js +8 -0
  584. package/dist/routes/index.js.map +1 -0
  585. package/dist/routing/codegen-shared.d.ts +26 -0
  586. package/dist/routing/codegen-shared.d.ts.map +1 -0
  587. package/dist/routing/codegen-types.d.ts +61 -0
  588. package/dist/routing/codegen-types.d.ts.map +1 -0
  589. package/dist/routing/codegen-write.d.ts +42 -0
  590. package/dist/routing/codegen-write.d.ts.map +1 -0
  591. package/dist/routing/codegen.d.ts +8 -3
  592. package/dist/routing/codegen.d.ts.map +1 -1
  593. package/dist/routing/collision-probe.d.ts +104 -0
  594. package/dist/routing/collision-probe.d.ts.map +1 -0
  595. package/dist/routing/collision-spaces.d.ts +26 -0
  596. package/dist/routing/collision-spaces.d.ts.map +1 -0
  597. package/dist/routing/convention-lint.d.ts +55 -0
  598. package/dist/routing/convention-lint.d.ts.map +1 -0
  599. package/dist/routing/export-detect.d.ts +91 -0
  600. package/dist/routing/export-detect.d.ts.map +1 -0
  601. package/dist/routing/file-cache.d.ts +8 -0
  602. package/dist/routing/file-cache.d.ts.map +1 -0
  603. package/dist/routing/index.d.ts +13 -7
  604. package/dist/routing/index.d.ts.map +1 -1
  605. package/dist/routing/index.js +5 -2
  606. package/dist/routing/interception-overlap.d.ts +35 -0
  607. package/dist/routing/interception-overlap.d.ts.map +1 -0
  608. package/dist/routing/interception.d.ts +234 -10
  609. package/dist/routing/interception.d.ts.map +1 -1
  610. package/dist/routing/link-codegen.d.ts +136 -0
  611. package/dist/routing/link-codegen.d.ts.map +1 -0
  612. package/dist/routing/manifest-codegen.d.ts +26 -0
  613. package/dist/routing/manifest-codegen.d.ts.map +1 -0
  614. package/dist/routing/scanner.d.ts +14 -10
  615. package/dist/routing/scanner.d.ts.map +1 -1
  616. package/dist/routing/schema-validation.d.ts +35 -0
  617. package/dist/routing/schema-validation.d.ts.map +1 -0
  618. package/dist/routing/segment-classify.d.ts +114 -0
  619. package/dist/routing/segment-classify.d.ts.map +1 -0
  620. package/dist/routing/segment-codegen.d.ts +38 -0
  621. package/dist/routing/segment-codegen.d.ts.map +1 -0
  622. package/dist/routing/segment-keys.d.ts +118 -0
  623. package/dist/routing/segment-keys.d.ts.map +1 -0
  624. package/dist/routing/slot-placement.d.ts +48 -0
  625. package/dist/routing/slot-placement.d.ts.map +1 -0
  626. package/dist/routing/types.d.ts +81 -26
  627. package/dist/routing/types.d.ts.map +1 -1
  628. package/dist/routing/walkers.d.ts +57 -0
  629. package/dist/routing/walkers.d.ts.map +1 -0
  630. package/dist/rsc-runtime/dev-reference-cache.d.ts +47 -0
  631. package/dist/rsc-runtime/dev-reference-cache.d.ts.map +1 -0
  632. package/dist/rsc-runtime/encryption-runtime.d.ts +25 -0
  633. package/dist/rsc-runtime/encryption-runtime.d.ts.map +1 -0
  634. package/dist/rsc-runtime/render-flight.d.ts +14 -0
  635. package/dist/rsc-runtime/render-flight.d.ts.map +1 -0
  636. package/dist/rsc-runtime/rsc.d.ts +3 -13
  637. package/dist/rsc-runtime/rsc.d.ts.map +1 -1
  638. package/dist/rsc-runtime/server-reference-load-error.d.ts +14 -0
  639. package/dist/rsc-runtime/server-reference-load-error.d.ts.map +1 -0
  640. package/dist/rsc-runtime/server-references.d.ts +19 -0
  641. package/dist/rsc-runtime/server-references.d.ts.map +1 -0
  642. package/dist/rsc-runtime/ssr.d.ts +7 -10
  643. package/dist/rsc-runtime/ssr.d.ts.map +1 -1
  644. package/dist/rsc-runtime/transforms.d.ts +13 -0
  645. package/dist/rsc-runtime/transforms.d.ts.map +1 -0
  646. package/dist/schema-bridge.d.ts +154 -0
  647. package/dist/schema-bridge.d.ts.map +1 -0
  648. package/dist/search-params/define.d.ts +262 -0
  649. package/dist/search-params/define.d.ts.map +1 -0
  650. package/dist/search-params/index.d.ts +3 -7
  651. package/dist/search-params/index.d.ts.map +1 -1
  652. package/dist/search-params/index.js +178 -362
  653. package/dist/search-params/index.js.map +1 -1
  654. package/dist/search-params/parse-total.d.ts +81 -0
  655. package/dist/search-params/parse-total.d.ts.map +1 -0
  656. package/dist/search-params/serialize-equal.d.ts +9 -0
  657. package/dist/search-params/serialize-equal.d.ts.map +1 -0
  658. package/dist/search-params/wrappers.d.ts +76 -0
  659. package/dist/search-params/wrappers.d.ts.map +1 -0
  660. package/dist/server/abort-scope.d.ts +27 -0
  661. package/dist/server/abort-scope.d.ts.map +1 -0
  662. package/dist/server/access-gate.d.ts +110 -10
  663. package/dist/server/access-gate.d.ts.map +1 -1
  664. package/dist/server/action-client.d.ts +20 -133
  665. package/dist/server/action-client.d.ts.map +1 -1
  666. package/dist/server/action-encryption.d.ts +76 -0
  667. package/dist/server/action-encryption.d.ts.map +1 -0
  668. package/dist/server/action-handler.d.ts +60 -11
  669. package/dist/server/action-handler.d.ts.map +1 -1
  670. package/dist/server/action-schema.d.ts +126 -0
  671. package/dist/server/action-schema.d.ts.map +1 -0
  672. package/dist/server/action-types.d.ts +108 -0
  673. package/dist/server/action-types.d.ts.map +1 -0
  674. package/dist/server/actions.d.ts +78 -40
  675. package/dist/server/actions.d.ts.map +1 -1
  676. package/dist/server/als-registry.d.ts +189 -17
  677. package/dist/server/als-registry.d.ts.map +1 -1
  678. package/dist/server/body-limits.d.ts.map +1 -1
  679. package/dist/server/build-manifest.d.ts +25 -30
  680. package/dist/server/build-manifest.d.ts.map +1 -1
  681. package/dist/server/canonicalize.d.ts +53 -0
  682. package/dist/server/canonicalize.d.ts.map +1 -1
  683. package/dist/server/chain-url-parts.d.ts +82 -0
  684. package/dist/server/chain-url-parts.d.ts.map +1 -0
  685. package/dist/server/children-interception.d.ts +49 -0
  686. package/dist/server/children-interception.d.ts.map +1 -0
  687. package/dist/server/client-error-message.d.ts +12 -0
  688. package/dist/server/client-error-message.d.ts.map +1 -0
  689. package/dist/server/coalesce-tick.d.ts +40 -0
  690. package/dist/server/coalesce-tick.d.ts.map +1 -0
  691. package/dist/server/compress.d.ts +2 -0
  692. package/dist/server/compress.d.ts.map +1 -1
  693. package/dist/server/cookie-context.d.ts +156 -0
  694. package/dist/server/cookie-context.d.ts.map +1 -0
  695. package/dist/server/cookie-parsing.d.ts +65 -0
  696. package/dist/server/cookie-parsing.d.ts.map +1 -0
  697. package/dist/server/csp-nonce.d.ts +36 -0
  698. package/dist/server/csp-nonce.d.ts.map +1 -0
  699. package/dist/server/csrf.d.ts +58 -15
  700. package/dist/server/csrf.d.ts.map +1 -1
  701. package/dist/server/debug.d.ts +0 -1
  702. package/dist/server/debug.d.ts.map +1 -1
  703. package/dist/server/default-logger.d.ts +23 -0
  704. package/dist/server/default-logger.d.ts.map +1 -0
  705. package/dist/server/default-status-page.d.ts +45 -0
  706. package/dist/server/default-status-page.d.ts.map +1 -0
  707. package/dist/server/deny-boundary.d.ts +257 -0
  708. package/dist/server/deny-boundary.d.ts.map +1 -0
  709. package/dist/server/deny-renderer.d.ts +22 -15
  710. package/dist/server/deny-renderer.d.ts.map +1 -1
  711. package/dist/server/early-hints-sender.d.ts.map +1 -1
  712. package/dist/server/early-hints.d.ts +14 -12
  713. package/dist/server/early-hints.d.ts.map +1 -1
  714. package/dist/server/error-boundary-wrapper.d.ts +102 -10
  715. package/dist/server/error-boundary-wrapper.d.ts.map +1 -1
  716. package/dist/server/error-response-headers.d.ts +3 -0
  717. package/dist/server/error-response-headers.d.ts.map +1 -0
  718. package/dist/server/fallback-error.d.ts +19 -7
  719. package/dist/server/fallback-error.d.ts.map +1 -1
  720. package/dist/server/flight-injection-state.d.ts +66 -0
  721. package/dist/server/flight-injection-state.d.ts.map +1 -0
  722. package/dist/server/flight-injector-core.d.ts +125 -0
  723. package/dist/server/flight-injector-core.d.ts.map +1 -0
  724. package/dist/server/flight-scripts.d.ts +63 -0
  725. package/dist/server/flight-scripts.d.ts.map +1 -0
  726. package/dist/server/flight-source-node.d.ts +105 -0
  727. package/dist/server/flight-source-node.d.ts.map +1 -0
  728. package/dist/server/flight-source.d.ts +136 -0
  729. package/dist/server/flight-source.d.ts.map +1 -0
  730. package/dist/server/form-data.d.ts +59 -2
  731. package/dist/server/form-data.d.ts.map +1 -1
  732. package/dist/server/form-state-flight.d.ts +32 -0
  733. package/dist/server/form-state-flight.d.ts.map +1 -0
  734. package/dist/server/head-response.d.ts +35 -0
  735. package/dist/server/head-response.d.ts.map +1 -0
  736. package/dist/server/html-injector-core.d.ts +169 -0
  737. package/dist/server/html-injector-core.d.ts.map +1 -0
  738. package/dist/server/html-injectors.d.ts +77 -47
  739. package/dist/server/html-injectors.d.ts.map +1 -1
  740. package/dist/server/index.d.ts +16 -54
  741. package/dist/server/index.d.ts.map +1 -1
  742. package/dist/server/index.js +621 -3009
  743. package/dist/server/index.js.map +1 -1
  744. package/dist/server/instrumentation.d.ts +13 -5
  745. package/dist/server/instrumentation.d.ts.map +1 -1
  746. package/dist/server/interception-gates.d.ts +49 -0
  747. package/dist/server/interception-gates.d.ts.map +1 -0
  748. package/dist/server/internal.d.ts +48 -0
  749. package/dist/server/internal.d.ts.map +1 -0
  750. package/dist/server/internal.js +5092 -0
  751. package/dist/server/internal.js.map +1 -0
  752. package/dist/server/json-status-response.d.ts +34 -0
  753. package/dist/server/json-status-response.d.ts.map +1 -0
  754. package/dist/server/logger.d.ts +105 -7
  755. package/dist/server/logger.d.ts.map +1 -1
  756. package/dist/server/metadata-collector.d.ts +75 -0
  757. package/dist/server/metadata-collector.d.ts.map +1 -0
  758. package/dist/server/metadata-platform.d.ts +2 -2
  759. package/dist/server/metadata-render.d.ts +2 -2
  760. package/dist/server/metadata-render.d.ts.map +1 -1
  761. package/dist/server/metadata-route-links.d.ts +70 -0
  762. package/dist/server/metadata-route-links.d.ts.map +1 -0
  763. package/dist/server/metadata-routes.d.ts +47 -11
  764. package/dist/server/metadata-routes.d.ts.map +1 -1
  765. package/dist/server/metadata-social.d.ts +2 -2
  766. package/dist/server/metadata.d.ts +10 -2
  767. package/dist/server/metadata.d.ts.map +1 -1
  768. package/dist/server/middleware-runner.d.ts +20 -5
  769. package/dist/server/middleware-runner.d.ts.map +1 -1
  770. package/dist/server/node-body-response.d.ts +55 -0
  771. package/dist/server/node-body-response.d.ts.map +1 -0
  772. package/dist/server/node-response.d.ts +62 -0
  773. package/dist/server/node-response.d.ts.map +1 -0
  774. package/dist/server/node-stream-transforms.d.ts +108 -0
  775. package/dist/server/node-stream-transforms.d.ts.map +1 -0
  776. package/dist/server/node-streams-platform.d.ts +21 -0
  777. package/dist/server/node-streams-platform.d.ts.map +1 -0
  778. package/dist/server/param-coercion.d.ts +84 -0
  779. package/dist/server/param-coercion.d.ts.map +1 -0
  780. package/dist/server/pipeline-helpers.d.ts +227 -0
  781. package/dist/server/pipeline-helpers.d.ts.map +1 -0
  782. package/dist/server/pipeline-interception.d.ts +100 -9
  783. package/dist/server/pipeline-interception.d.ts.map +1 -1
  784. package/dist/server/pipeline-metadata-route.d.ts +24 -0
  785. package/dist/server/pipeline-metadata-route.d.ts.map +1 -0
  786. package/dist/server/pipeline-metadata.d.ts +18 -2
  787. package/dist/server/pipeline-metadata.d.ts.map +1 -1
  788. package/dist/server/pipeline-outcome.d.ts +59 -0
  789. package/dist/server/pipeline-outcome.d.ts.map +1 -0
  790. package/dist/server/pipeline-phases.d.ts +76 -0
  791. package/dist/server/pipeline-phases.d.ts.map +1 -0
  792. package/dist/server/pipeline.d.ts +190 -23
  793. package/dist/server/pipeline.d.ts.map +1 -1
  794. package/dist/server/port-resolution.d.ts +22 -0
  795. package/dist/server/port-resolution.d.ts.map +1 -0
  796. package/dist/server/prebuilt/cache-key.d.ts +89 -0
  797. package/dist/server/prebuilt/cache-key.d.ts.map +1 -0
  798. package/dist/server/prebuilt/capture-render.d.ts +30 -0
  799. package/dist/server/prebuilt/capture-render.d.ts.map +1 -0
  800. package/dist/server/prebuilt/capture-routes.d.ts +37 -0
  801. package/dist/server/prebuilt/capture-routes.d.ts.map +1 -0
  802. package/dist/server/prebuilt/capture-state.d.ts +101 -0
  803. package/dist/server/prebuilt/capture-state.d.ts.map +1 -0
  804. package/dist/server/prebuilt/dev-store.d.ts +149 -0
  805. package/dist/server/prebuilt/dev-store.d.ts.map +1 -0
  806. package/dist/server/prebuilt/lifetime.d.ts +38 -0
  807. package/dist/server/prebuilt/lifetime.d.ts.map +1 -0
  808. package/dist/server/prebuilt/manifest-tag-index.d.ts +27 -0
  809. package/dist/server/prebuilt/manifest-tag-index.d.ts.map +1 -0
  810. package/dist/server/prebuilt/overlay.d.ts +119 -0
  811. package/dist/server/prebuilt/overlay.d.ts.map +1 -0
  812. package/dist/server/prebuilt/payload-source.d.ts +87 -0
  813. package/dist/server/prebuilt/payload-source.d.ts.map +1 -0
  814. package/dist/server/prebuilt/slots.d.ts +105 -0
  815. package/dist/server/prebuilt/slots.d.ts.map +1 -0
  816. package/dist/server/prebuilt/synthetic-store.d.ts +67 -0
  817. package/dist/server/prebuilt/synthetic-store.d.ts.map +1 -0
  818. package/dist/server/prebuilt-builder.d.ts +121 -0
  819. package/dist/server/prebuilt-builder.d.ts.map +1 -0
  820. package/dist/server/prebuilt-runtime.d.ts +105 -0
  821. package/dist/server/prebuilt-runtime.d.ts.map +1 -0
  822. package/dist/server/primitives.d.ts +114 -90
  823. package/dist/server/primitives.d.ts.map +1 -1
  824. package/dist/server/publish-params.d.ts +33 -0
  825. package/dist/server/publish-params.d.ts.map +1 -0
  826. package/dist/server/react-cache-bridge.d.ts +59 -0
  827. package/dist/server/react-cache-bridge.d.ts.map +1 -0
  828. package/dist/server/react-cache-scope.d.ts +49 -0
  829. package/dist/server/react-cache-scope.d.ts.map +1 -0
  830. package/dist/server/render-timeout.d.ts +66 -0
  831. package/dist/server/render-timeout.d.ts.map +1 -0
  832. package/dist/server/render-utils.d.ts +56 -0
  833. package/dist/server/render-utils.d.ts.map +1 -0
  834. package/dist/server/request-context.d.ts +167 -103
  835. package/dist/server/request-context.d.ts.map +1 -1
  836. package/dist/server/request-dep.d.ts +15 -0
  837. package/dist/server/request-dep.d.ts.map +1 -0
  838. package/dist/server/response-cache-policy.d.ts +3 -0
  839. package/dist/server/response-cache-policy.d.ts.map +1 -0
  840. package/dist/server/response-framing.d.ts +43 -0
  841. package/dist/server/response-framing.d.ts.map +1 -0
  842. package/dist/server/route-element-builder.d.ts +57 -30
  843. package/dist/server/route-element-builder.d.ts.map +1 -1
  844. package/dist/server/route-element-helpers.d.ts +12 -0
  845. package/dist/server/route-element-helpers.d.ts.map +1 -0
  846. package/dist/server/route-handler.d.ts +9 -3
  847. package/dist/server/route-handler.d.ts.map +1 -1
  848. package/dist/server/route-matcher.d.ts +75 -40
  849. package/dist/server/route-matcher.d.ts.map +1 -1
  850. package/dist/server/route-methods.d.ts +23 -0
  851. package/dist/server/route-methods.d.ts.map +1 -0
  852. package/dist/server/route-module-loader.d.ts +37 -0
  853. package/dist/server/route-module-loader.d.ts.map +1 -0
  854. package/dist/server/rsc-cache-key-guard.d.ts +78 -0
  855. package/dist/server/rsc-cache-key-guard.d.ts.map +1 -0
  856. package/dist/server/rsc-entry/action-dispatcher.d.ts +65 -0
  857. package/dist/server/rsc-entry/action-dispatcher.d.ts.map +1 -0
  858. package/dist/server/rsc-entry/action-middleware-runner.d.ts +66 -0
  859. package/dist/server/rsc-entry/action-middleware-runner.d.ts.map +1 -0
  860. package/dist/server/rsc-entry/api-handler.d.ts +19 -3
  861. package/dist/server/rsc-entry/api-handler.d.ts.map +1 -1
  862. package/dist/server/rsc-entry/deny-fallback.d.ts +55 -0
  863. package/dist/server/rsc-entry/deny-fallback.d.ts.map +1 -0
  864. package/dist/server/rsc-entry/error-renderer.d.ts +35 -21
  865. package/dist/server/rsc-entry/error-renderer.d.ts.map +1 -1
  866. package/dist/server/rsc-entry/helpers.d.ts +14 -59
  867. package/dist/server/rsc-entry/helpers.d.ts.map +1 -1
  868. package/dist/server/rsc-entry/index.d.ts +30 -6
  869. package/dist/server/rsc-entry/index.d.ts.map +1 -1
  870. package/dist/server/rsc-entry/render-route.d.ts +55 -0
  871. package/dist/server/rsc-entry/render-route.d.ts.map +1 -0
  872. package/dist/server/rsc-entry/render-signals.d.ts +65 -0
  873. package/dist/server/rsc-entry/render-signals.d.ts.map +1 -0
  874. package/dist/server/rsc-entry/revalidate-renderer.d.ts +98 -0
  875. package/dist/server/rsc-entry/revalidate-renderer.d.ts.map +1 -0
  876. package/dist/server/rsc-entry/rsc-payload.d.ts +38 -11
  877. package/dist/server/rsc-entry/rsc-payload.d.ts.map +1 -1
  878. package/dist/server/rsc-entry/rsc-stream.d.ts +18 -31
  879. package/dist/server/rsc-entry/rsc-stream.d.ts.map +1 -1
  880. package/dist/server/rsc-entry/ssr-bridge.d.ts +7 -2
  881. package/dist/server/rsc-entry/ssr-bridge.d.ts.map +1 -1
  882. package/dist/server/rsc-entry/ssr-renderer.d.ts +52 -8
  883. package/dist/server/rsc-entry/ssr-renderer.d.ts.map +1 -1
  884. package/dist/server/rsc-error-envelope.d.ts +11 -0
  885. package/dist/server/rsc-error-envelope.d.ts.map +1 -0
  886. package/dist/server/safe-load.d.ts +39 -0
  887. package/dist/server/safe-load.d.ts.map +1 -0
  888. package/dist/server/schema-introspection.d.ts +68 -0
  889. package/dist/server/schema-introspection.d.ts.map +1 -0
  890. package/dist/server/sensitive-fields.d.ts +88 -0
  891. package/dist/server/sensitive-fields.d.ts.map +1 -0
  892. package/dist/server/signal-identity.d.ts +49 -0
  893. package/dist/server/signal-identity.d.ts.map +1 -0
  894. package/dist/server/sitemap-generator.d.ts +130 -0
  895. package/dist/server/sitemap-generator.d.ts.map +1 -0
  896. package/dist/server/sitemap-handler.d.ts +22 -0
  897. package/dist/server/sitemap-handler.d.ts.map +1 -0
  898. package/dist/server/skippable-prefix.d.ts +29 -0
  899. package/dist/server/skippable-prefix.d.ts.map +1 -0
  900. package/dist/server/slot-interception.d.ts +80 -0
  901. package/dist/server/slot-interception.d.ts.map +1 -0
  902. package/dist/server/slot-resolver.d.ts +138 -7
  903. package/dist/server/slot-resolver.d.ts.map +1 -1
  904. package/dist/server/slot-subtree-contain.d.ts +54 -0
  905. package/dist/server/slot-subtree-contain.d.ts.map +1 -0
  906. package/dist/server/ssr-bridge-types.d.ts +213 -0
  907. package/dist/server/ssr-bridge-types.d.ts.map +1 -0
  908. package/dist/server/ssr-entry.d.ts +15 -51
  909. package/dist/server/ssr-entry.d.ts.map +1 -1
  910. package/dist/server/ssr-form-state.d.ts +30 -0
  911. package/dist/server/ssr-form-state.d.ts.map +1 -0
  912. package/dist/server/ssr-render.d.ts +42 -12
  913. package/dist/server/ssr-render.d.ts.map +1 -1
  914. package/dist/server/ssr-wrappers.d.ts +92 -0
  915. package/dist/server/ssr-wrappers.d.ts.map +1 -0
  916. package/dist/server/state-tree-diff.d.ts +44 -9
  917. package/dist/server/state-tree-diff.d.ts.map +1 -1
  918. package/dist/server/static-generator.d.ts +112 -0
  919. package/dist/server/static-generator.d.ts.map +1 -0
  920. package/dist/server/static-not-found.d.ts +52 -0
  921. package/dist/server/static-not-found.d.ts.map +1 -0
  922. package/dist/server/status-code-resolver.d.ts +26 -15
  923. package/dist/server/status-code-resolver.d.ts.map +1 -1
  924. package/dist/server/stream-utils.d.ts +93 -0
  925. package/dist/server/stream-utils.d.ts.map +1 -0
  926. package/dist/server/traced-access.d.ts +18 -0
  927. package/dist/server/traced-access.d.ts.map +1 -0
  928. package/dist/server/tracing.d.ts +72 -31
  929. package/dist/server/tracing.d.ts.map +1 -1
  930. package/dist/server/tree-match.d.ts +59 -0
  931. package/dist/server/tree-match.d.ts.map +1 -0
  932. package/dist/server/types.d.ts +90 -8
  933. package/dist/server/types.d.ts.map +1 -1
  934. package/dist/server/utils/element-type.d.ts +50 -0
  935. package/dist/server/utils/element-type.d.ts.map +1 -0
  936. package/dist/server/utils/escape-html.d.ts +14 -0
  937. package/dist/server/utils/escape-html.d.ts.map +1 -0
  938. package/dist/server/version-skew.d.ts +61 -0
  939. package/dist/server/version-skew.d.ts.map +1 -0
  940. package/dist/server/workers-cache-bridge.d.ts +26 -0
  941. package/dist/server/workers-cache-bridge.d.ts.map +1 -0
  942. package/dist/shared/als-slots.d.ts +42 -0
  943. package/dist/shared/als-slots.d.ts.map +1 -0
  944. package/dist/shared/base-path.d.ts +56 -0
  945. package/dist/shared/base-path.d.ts.map +1 -0
  946. package/dist/shared/csrf-reject.d.ts +16 -0
  947. package/dist/shared/csrf-reject.d.ts.map +1 -0
  948. package/dist/shared/dev-span.d.ts +99 -0
  949. package/dist/shared/dev-span.d.ts.map +1 -0
  950. package/dist/shared/error-digest.d.ts +28 -0
  951. package/dist/shared/error-digest.d.ts.map +1 -0
  952. package/dist/shared/flight-base64.d.ts +13 -0
  953. package/dist/shared/flight-base64.d.ts.map +1 -0
  954. package/dist/shared/flight-segment.d.ts +18 -0
  955. package/dist/shared/flight-segment.d.ts.map +1 -0
  956. package/dist/shared/form-state-flight.d.ts +32 -0
  957. package/dist/shared/form-state-flight.d.ts.map +1 -0
  958. package/dist/shared/href-validation.d.ts +49 -0
  959. package/dist/shared/href-validation.d.ts.map +1 -0
  960. package/dist/shared/href.d.ts +88 -0
  961. package/dist/shared/href.d.ts.map +1 -0
  962. package/dist/shared/merge-search-params.d.ts +22 -0
  963. package/dist/shared/merge-search-params.d.ts.map +1 -0
  964. package/dist/shared/param-value.d.ts +104 -0
  965. package/dist/shared/param-value.d.ts.map +1 -0
  966. package/dist/shared/payload-root.d.ts +110 -0
  967. package/dist/shared/payload-root.d.ts.map +1 -0
  968. package/dist/shared/redirect-type.d.ts +17 -0
  969. package/dist/shared/redirect-type.d.ts.map +1 -0
  970. package/dist/shared/rsc-cache-key.d.ts +163 -0
  971. package/dist/shared/rsc-cache-key.d.ts.map +1 -0
  972. package/dist/shared/rsc-error-envelope.d.ts +16 -0
  973. package/dist/shared/rsc-error-envelope.d.ts.map +1 -0
  974. package/dist/shared/rsc-manifest.d.ts +28 -0
  975. package/dist/shared/rsc-manifest.d.ts.map +1 -0
  976. package/dist/shared/rsc-media-type.d.ts +52 -0
  977. package/dist/shared/rsc-media-type.d.ts.map +1 -0
  978. package/dist/shared/rsc-payload-path.d.ts +48 -0
  979. package/dist/shared/rsc-payload-path.d.ts.map +1 -0
  980. package/dist/shared/segment-info.d.ts +66 -0
  981. package/dist/shared/segment-info.d.ts.map +1 -0
  982. package/dist/shared/slot-params.d.ts +52 -0
  983. package/dist/shared/slot-params.d.ts.map +1 -0
  984. package/dist/shared/static-platform-files.d.ts +71 -0
  985. package/dist/shared/static-platform-files.d.ts.map +1 -0
  986. package/dist/shared/status-reason-phrase.d.ts +26 -0
  987. package/dist/shared/status-reason-phrase.d.ts.map +1 -0
  988. package/dist/shims/font-google.d.ts +1 -1
  989. package/dist/shims/font-google.d.ts.map +1 -1
  990. package/dist/shims/font-google.js +41 -0
  991. package/dist/shims/font-google.js.map +1 -0
  992. package/dist/shims/font-local.d.ts +26 -0
  993. package/dist/shims/font-local.d.ts.map +1 -0
  994. package/dist/shims/font-local.js +19 -0
  995. package/dist/shims/font-local.js.map +1 -0
  996. package/dist/shims/headers.d.ts +60 -1
  997. package/dist/shims/headers.d.ts.map +1 -1
  998. package/dist/shims/image.d.ts +120 -120
  999. package/dist/shims/image.d.ts.map +1 -1
  1000. package/dist/shims/navigation-client.d.ts +25 -12
  1001. package/dist/shims/navigation-client.d.ts.map +1 -1
  1002. package/dist/shims/navigation-rsc.d.ts +21 -0
  1003. package/dist/shims/navigation-rsc.d.ts.map +1 -0
  1004. package/dist/shims/navigation.d.ts +10 -5
  1005. package/dist/shims/navigation.d.ts.map +1 -1
  1006. package/dist/utils/state-machine.d.ts +80 -0
  1007. package/dist/utils/state-machine.d.ts.map +1 -0
  1008. package/dist/utils/write-file-atomic.d.ts +17 -0
  1009. package/dist/utils/write-file-atomic.d.ts.map +1 -0
  1010. package/docs/api/30-api-server.mdx +241 -0
  1011. package/docs/api/31-api-client.mdx +225 -0
  1012. package/docs/api/32-api-cache.mdx +341 -0
  1013. package/docs/api/33-api-search-params.mdx +178 -0
  1014. package/docs/api/34-api-config.mdx +421 -0
  1015. package/docs/api/35-api-typescript.mdx +123 -0
  1016. package/docs/api/36-cli.mdx +272 -0
  1017. package/docs/learn/00-introduction.mdx +109 -0
  1018. package/docs/learn/01-quick-start.mdx +94 -0
  1019. package/docs/learn/02-pages-and-layouts.mdx +147 -0
  1020. package/docs/learn/03-fetching-data.mdx +227 -0
  1021. package/docs/learn/04-access-control.mdx +115 -0
  1022. package/docs/learn/05-the-flush-point.mdx +175 -0
  1023. package/docs/learn/06-typed-params.mdx +275 -0
  1024. package/docs/learn/07-typed-routes.mdx +173 -0
  1025. package/docs/learn/08-forms-and-actions.mdx +260 -0
  1026. package/docs/learn/09-streaming.mdx +146 -0
  1027. package/docs/learn/10-caching.mdx +303 -0
  1028. package/docs/learn/11-middleware.mdx +166 -0
  1029. package/docs/learn/12-error-handling.mdx +192 -0
  1030. package/docs/learn/13-deploying.mdx +289 -0
  1031. package/llms.txt +55 -0
  1032. package/package.json +124 -29
  1033. package/src/adapters/build-output-helper.ts +375 -0
  1034. package/src/adapters/canonicalize-module.ts +29 -0
  1035. package/src/adapters/cloudflare-dev.ts +183 -0
  1036. package/src/adapters/cloudflare-kv-cache.ts +203 -0
  1037. package/src/adapters/cloudflare.ts +799 -151
  1038. package/src/adapters/compress-module.ts +110 -86
  1039. package/src/adapters/fs-identity.ts +155 -0
  1040. package/src/adapters/nitro-immutable-assets.ts +142 -0
  1041. package/src/adapters/nitro-presets.ts +139 -0
  1042. package/src/adapters/nitro-preview.ts +565 -0
  1043. package/src/adapters/nitro.ts +349 -448
  1044. package/src/adapters/raw-imports.d.ts +5 -0
  1045. package/src/adapters/shared.ts +314 -0
  1046. package/src/adapters/types.ts +129 -17
  1047. package/src/adapters/wrangler.d.ts +7 -0
  1048. package/src/analyze/chains.ts +411 -0
  1049. package/src/analyze/classify.ts +259 -0
  1050. package/src/analyze/crawl-entry.ts +68 -0
  1051. package/src/analyze/crawl.ts +500 -0
  1052. package/src/analyze/graph-cache.ts +331 -0
  1053. package/src/analyze/graph-command.ts +654 -0
  1054. package/src/analyze/live-graph.ts +232 -0
  1055. package/src/analyze/poison-rules.ts +165 -0
  1056. package/src/analyze/poison-scan.ts +159 -0
  1057. package/src/analyze/scan.ts +149 -0
  1058. package/src/cache/cache-api.ts +113 -0
  1059. package/src/cache/fast-hash.ts +5 -0
  1060. package/src/cache/guarded-read.ts +44 -0
  1061. package/src/cache/handler-store.ts +113 -0
  1062. package/src/cache/index.ts +93 -20
  1063. package/src/cache/invalidation-epoch.ts +105 -0
  1064. package/src/cache/json-lossy-check.ts +69 -0
  1065. package/src/cache/key-discipline.ts +218 -0
  1066. package/src/cache/redis-handler.ts +193 -19
  1067. package/src/cache/singleflight.ts +85 -7
  1068. package/src/cache/sizeof.ts +35 -0
  1069. package/src/cache/stable-stringify.ts +118 -2
  1070. package/src/cache/store.ts +71 -0
  1071. package/src/cache/stores/cloudflare-kv.ts +52 -0
  1072. package/src/cache/stores/memory.ts +125 -0
  1073. package/src/cache/stores/redis.ts +97 -0
  1074. package/src/cache/stores/vercel.ts +59 -0
  1075. package/src/cache/tag-aware-handler.ts +250 -0
  1076. package/src/cache/timber-cache.ts +218 -47
  1077. package/src/cdn/cloudflare-purge.ts +50 -0
  1078. package/src/cdn/fastly-purge.ts +63 -0
  1079. package/src/cdn/headers.ts +153 -0
  1080. package/src/cdn/index.ts +23 -0
  1081. package/src/cdn/purge-store.ts +62 -0
  1082. package/src/cdn/workers-cache-purge.ts +34 -0
  1083. package/src/cli-check.ts +417 -0
  1084. package/src/cli-context.ts +128 -0
  1085. package/src/cli-dev-status.ts +196 -0
  1086. package/src/cli-init.ts +278 -0
  1087. package/src/cli-schema-sync.ts +401 -0
  1088. package/src/cli.ts +308 -84
  1089. package/src/client/browser-dev.ts +192 -5
  1090. package/src/client/browser-entry/action-dispatch.ts +317 -0
  1091. package/src/client/browser-entry/action-queue.ts +152 -0
  1092. package/src/client/browser-entry/form-state.ts +49 -0
  1093. package/src/client/browser-entry/hmr.ts +82 -0
  1094. package/src/client/browser-entry/hydrate.ts +152 -0
  1095. package/src/client/browser-entry/index.ts +153 -0
  1096. package/src/client/browser-entry/post-hydration.ts +99 -0
  1097. package/src/client/browser-entry/router-init.ts +391 -0
  1098. package/src/client/browser-entry/rsc-stream.ts +145 -0
  1099. package/src/client/browser-entry/scroll.ts +50 -0
  1100. package/src/client/deny-last-resort.tsx +54 -0
  1101. package/src/client/dev-pill/index.ts +128 -0
  1102. package/src/client/dev-pill/store.ts +254 -0
  1103. package/src/client/dev-pill/view.ts +326 -0
  1104. package/src/client/error-boundary.tsx +296 -61
  1105. package/src/client/error-reconstituter.tsx +84 -0
  1106. package/src/client/form.tsx +61 -173
  1107. package/src/client/global-context.ts +59 -0
  1108. package/src/client/history.ts +74 -11
  1109. package/src/client/index.ts +93 -53
  1110. package/src/client/internal.ts +54 -0
  1111. package/src/client/link.tsx +284 -204
  1112. package/src/client/location-search.ts +15 -0
  1113. package/src/client/navigation-api.ts +254 -0
  1114. package/src/client/navigation-commit.ts +318 -0
  1115. package/src/client/navigation-context.ts +71 -142
  1116. package/src/client/navigation-root.tsx +237 -0
  1117. package/src/client/navigation-transition.ts +401 -0
  1118. package/src/client/nuqs-adapter.tsx +62 -32
  1119. package/src/client/params-context.ts +175 -0
  1120. package/src/client/react-root.ts +105 -0
  1121. package/src/client/router-effects.ts +349 -0
  1122. package/src/client/router-lifecycle.ts +394 -0
  1123. package/src/client/router-pipeline.ts +443 -0
  1124. package/src/client/router-ref.ts +3 -3
  1125. package/src/client/router-skew.ts +30 -0
  1126. package/src/client/router-types.ts +326 -0
  1127. package/src/client/router-url.ts +32 -0
  1128. package/src/client/router.ts +491 -421
  1129. package/src/client/rsc-fetch.ts +510 -109
  1130. package/src/client/segment-cache.ts +362 -41
  1131. package/src/client/segment-context.ts +7 -4
  1132. package/src/client/segment-outlet.tsx +96 -0
  1133. package/src/client/segment-update-context.ts +23 -0
  1134. package/src/client/shallow-url.ts +22 -0
  1135. package/src/client/slot-content-cache-context.ts +43 -0
  1136. package/src/client/slot-context.ts +39 -0
  1137. package/src/client/slot-outlet.tsx +22 -0
  1138. package/src/client/slot-provider.tsx +32 -0
  1139. package/src/client/ssr-data.ts +27 -67
  1140. package/src/client/stale-client.ts +191 -0
  1141. package/src/client/state.ts +31 -24
  1142. package/src/client/status-page-marker.tsx +32 -0
  1143. package/src/client/top-loader.tsx +13 -10
  1144. package/src/client/unload-guard.ts +35 -3
  1145. package/src/client/use-cookie.ts +93 -29
  1146. package/src/client/use-field-state.ts +144 -0
  1147. package/src/client/use-link-status.ts +7 -7
  1148. package/src/client/use-pathname.ts +22 -31
  1149. package/src/client/use-pending-navigation.ts +119 -0
  1150. package/src/client/use-query-states.ts +206 -36
  1151. package/src/client/use-router.ts +31 -9
  1152. package/src/client/use-search-params.ts +38 -49
  1153. package/src/client/use-segment-params.ts +69 -0
  1154. package/src/client/use-selected-layout-segment.ts +2 -2
  1155. package/src/codec.ts +149 -0
  1156. package/src/config-types.ts +366 -0
  1157. package/src/config-validation.ts +511 -0
  1158. package/src/cookies/define-cookie.ts +186 -53
  1159. package/src/cookies/index.ts +13 -2
  1160. package/src/cookies/json-cookie.ts +105 -0
  1161. package/src/cookies/validation.ts +192 -0
  1162. package/src/dev-tools/404-page.ts +286 -0
  1163. package/src/dev-tools/await-span.ts +69 -0
  1164. package/src/dev-tools/browser-logs.ts +55 -0
  1165. package/src/dev-tools/dev-page-shell.ts +278 -0
  1166. package/src/dev-tools/error-page.ts +331 -0
  1167. package/src/dev-tools/holding-server.ts +185 -0
  1168. package/src/dev-tools/hydration-overlay.ts +158 -0
  1169. package/src/dev-tools/index.ts +79 -0
  1170. package/src/dev-tools/instrumentation.ts +281 -0
  1171. package/src/{server/dev-logger.ts → dev-tools/logger.ts} +36 -88
  1172. package/src/{plugins/dev-logs.ts → dev-tools/logs.ts} +158 -27
  1173. package/src/{plugins/dev-error-overlay.ts → dev-tools/overlay.ts} +25 -80
  1174. package/src/dev-tools/span-sink.ts +132 -0
  1175. package/src/dev-tools/stack-classifier.ts +75 -0
  1176. package/src/dev-tools/terminal.ts +182 -0
  1177. package/src/fonts/ast-walk.ts +235 -0
  1178. package/src/fonts/ast.ts +479 -128
  1179. package/src/fonts/bundle.ts +138 -0
  1180. package/src/fonts/css.ts +1 -1
  1181. package/src/fonts/dev-middleware.ts +85 -0
  1182. package/src/fonts/fallbacks.ts +0 -23
  1183. package/src/fonts/google.ts +101 -19
  1184. package/src/fonts/local.ts +12 -11
  1185. package/src/fonts/paths.ts +58 -0
  1186. package/src/fonts/pipeline.ts +348 -0
  1187. package/src/fonts/transform.ts +311 -0
  1188. package/src/fonts/types.ts +52 -1
  1189. package/src/fonts/virtual-modules.ts +179 -0
  1190. package/src/index.ts +501 -380
  1191. package/src/params/codec-registry.ts +47 -0
  1192. package/src/params/define-schema.ts +115 -0
  1193. package/src/params/index.ts +16 -0
  1194. package/src/params/resolve-schema.ts +84 -0
  1195. package/src/plugin-context.ts +509 -0
  1196. package/src/plugins/build-manifest.ts +189 -36
  1197. package/src/plugins/build-report.ts +299 -87
  1198. package/src/plugins/cache.ts +243 -0
  1199. package/src/plugins/callsite-ast.ts +472 -0
  1200. package/src/plugins/callsite-jsx.ts +243 -0
  1201. package/src/plugins/chunks.ts +74 -5
  1202. package/src/plugins/client-chunks.ts +185 -0
  1203. package/src/plugins/client-dep-entries.ts +124 -0
  1204. package/src/plugins/client-in-server-package-deps.ts +139 -0
  1205. package/src/plugins/cloudflare-wasm.ts +141 -0
  1206. package/src/plugins/content.ts +31 -2
  1207. package/src/plugins/dev-await.ts +415 -0
  1208. package/src/plugins/dev-discovery.ts +428 -0
  1209. package/src/plugins/dev-hostname.ts +322 -0
  1210. package/src/plugins/dev-server.ts +471 -100
  1211. package/src/plugins/dev-store-clear.ts +145 -0
  1212. package/src/plugins/encryption-runtime.ts +31 -0
  1213. package/src/plugins/entries.ts +158 -17
  1214. package/src/plugins/fonts.ts +260 -657
  1215. package/src/plugins/graph-endpoint.ts +544 -0
  1216. package/src/plugins/mdx.ts +108 -35
  1217. package/src/plugins/optimize-package-imports-defaults.ts +88 -0
  1218. package/src/plugins/optimize-package-imports.ts +439 -0
  1219. package/src/plugins/orphaned-modules.ts +78 -0
  1220. package/src/plugins/post-build.ts +327 -0
  1221. package/src/plugins/prebuilt-capture.ts +213 -0
  1222. package/src/plugins/prebuilt-options-analysis.ts +175 -0
  1223. package/src/plugins/prebuilt.ts +679 -0
  1224. package/src/plugins/prerender-sugar.ts +348 -0
  1225. package/src/plugins/react-resolve.ts +149 -0
  1226. package/src/plugins/request-dep/analysis.ts +447 -0
  1227. package/src/plugins/request-dep/index.ts +376 -0
  1228. package/src/plugins/request-dep/origin.ts +310 -0
  1229. package/src/plugins/routing.ts +296 -278
  1230. package/src/plugins/rsc-assets-manifest.ts +251 -0
  1231. package/src/plugins/server-bundle.ts +115 -15
  1232. package/src/plugins/shims.ts +267 -97
  1233. package/src/plugins/static-build.ts +681 -71
  1234. package/src/react-canary.d.ts +2 -0
  1235. package/src/routes/href.ts +171 -0
  1236. package/src/routes/index.ts +10 -0
  1237. package/src/routing/codegen-shared.ts +39 -0
  1238. package/src/routing/codegen-types.ts +62 -0
  1239. package/src/routing/codegen-write.ts +163 -0
  1240. package/src/routing/codegen.ts +356 -232
  1241. package/src/routing/collision-probe.ts +438 -0
  1242. package/src/routing/collision-spaces.ts +281 -0
  1243. package/src/routing/convention-lint.ts +649 -0
  1244. package/src/routing/export-detect.ts +536 -0
  1245. package/src/routing/file-cache.ts +23 -0
  1246. package/src/routing/index.ts +16 -7
  1247. package/src/routing/interception-overlap.ts +141 -0
  1248. package/src/routing/interception.ts +1044 -67
  1249. package/src/routing/link-codegen.ts +346 -0
  1250. package/src/routing/manifest-codegen.ts +232 -0
  1251. package/src/routing/scanner.ts +417 -223
  1252. package/src/routing/schema-validation.ts +155 -0
  1253. package/src/routing/segment-classify.ts +280 -0
  1254. package/src/routing/segment-codegen.ts +99 -0
  1255. package/src/routing/segment-keys.ts +186 -0
  1256. package/src/routing/slot-placement.ts +97 -0
  1257. package/src/routing/types.ts +82 -26
  1258. package/src/routing/walkers.ts +98 -0
  1259. package/src/rsc-runtime/dev-reference-cache.ts +115 -0
  1260. package/src/rsc-runtime/encryption-runtime.ts +78 -0
  1261. package/src/rsc-runtime/render-flight.ts +26 -0
  1262. package/src/rsc-runtime/rsc.ts +35 -5
  1263. package/src/rsc-runtime/server-reference-load-error.ts +16 -0
  1264. package/src/rsc-runtime/server-references.ts +135 -0
  1265. package/src/rsc-runtime/ssr.ts +23 -0
  1266. package/src/rsc-runtime/transforms.ts +13 -0
  1267. package/src/rsc-runtime/vendor-types.d.ts +87 -0
  1268. package/src/schema-bridge.ts +437 -0
  1269. package/src/search-params/define.ts +676 -0
  1270. package/src/search-params/index.ts +14 -20
  1271. package/src/search-params/parse-total.ts +91 -0
  1272. package/src/search-params/serialize-equal.ts +14 -0
  1273. package/src/search-params/wrappers.ts +150 -0
  1274. package/src/server/abort-scope.ts +49 -0
  1275. package/src/server/access-gate.tsx +208 -57
  1276. package/src/server/action-client.ts +175 -294
  1277. package/src/server/action-encryption.ts +144 -0
  1278. package/src/server/action-handler.ts +533 -150
  1279. package/src/server/action-schema.ts +203 -0
  1280. package/src/server/action-types.ts +145 -0
  1281. package/src/server/actions.ts +172 -85
  1282. package/src/server/als-registry.ts +245 -30
  1283. package/src/server/body-limits.ts +10 -2
  1284. package/src/server/build-manifest.ts +33 -57
  1285. package/src/server/canonicalize.ts +62 -3
  1286. package/src/server/chain-url-parts.ts +163 -0
  1287. package/src/server/children-interception.ts +116 -0
  1288. package/src/server/client-error-message.ts +18 -0
  1289. package/src/server/coalesce-tick.ts +75 -0
  1290. package/src/server/compress.ts +91 -19
  1291. package/src/server/cookie-context.ts +462 -0
  1292. package/src/server/cookie-parsing.ts +163 -0
  1293. package/src/server/csp-nonce.ts +58 -0
  1294. package/src/server/csrf.ts +238 -37
  1295. package/src/server/debug.ts +0 -1
  1296. package/src/server/default-logger.ts +100 -0
  1297. package/src/server/default-status-page.ts +88 -0
  1298. package/src/server/deny-boundary.ts +527 -0
  1299. package/src/server/deny-renderer.ts +210 -181
  1300. package/src/server/early-hints-sender.ts +4 -3
  1301. package/src/server/early-hints.ts +39 -29
  1302. package/src/server/error-boundary-wrapper.ts +160 -44
  1303. package/src/server/error-response-headers.ts +18 -0
  1304. package/src/server/fallback-error.ts +88 -104
  1305. package/src/server/flight-injection-state.ts +113 -0
  1306. package/src/server/flight-injector-core.ts +332 -0
  1307. package/src/server/flight-scripts.ts +92 -0
  1308. package/src/server/flight-source-node.ts +434 -0
  1309. package/src/server/flight-source.ts +289 -0
  1310. package/src/server/form-data.ts +191 -20
  1311. package/src/server/form-state-flight.ts +67 -0
  1312. package/src/server/head-response.ts +50 -0
  1313. package/src/server/html-injector-core.ts +320 -0
  1314. package/src/server/html-injectors.ts +241 -285
  1315. package/src/server/index.ts +42 -195
  1316. package/src/server/instrumentation.ts +42 -11
  1317. package/src/server/interception-gates.ts +94 -0
  1318. package/src/server/internal.ts +164 -0
  1319. package/src/server/json-status-response.ts +105 -0
  1320. package/src/server/logger.ts +163 -38
  1321. package/src/server/metadata-collector.ts +175 -0
  1322. package/src/server/metadata-platform.ts +2 -2
  1323. package/src/server/metadata-render.ts +30 -8
  1324. package/src/server/metadata-route-links.ts +200 -0
  1325. package/src/server/metadata-routes.ts +114 -24
  1326. package/src/server/metadata-social.ts +2 -2
  1327. package/src/server/metadata.ts +23 -2
  1328. package/src/server/middleware-runner.ts +32 -5
  1329. package/src/server/node-body-response.ts +236 -0
  1330. package/src/server/node-response.ts +93 -0
  1331. package/src/server/node-stream-transforms.ts +340 -0
  1332. package/src/server/node-streams-platform.ts +23 -0
  1333. package/src/server/param-coercion.ts +205 -0
  1334. package/src/server/pipeline-helpers.ts +554 -0
  1335. package/src/server/pipeline-interception.ts +301 -32
  1336. package/src/server/pipeline-metadata-route.ts +242 -0
  1337. package/src/server/pipeline-metadata.ts +30 -4
  1338. package/src/server/pipeline-outcome.ts +290 -0
  1339. package/src/server/pipeline-phases.ts +443 -0
  1340. package/src/server/pipeline.ts +474 -427
  1341. package/src/server/port-resolution.ts +43 -0
  1342. package/src/server/prebuilt/cache-key.ts +340 -0
  1343. package/src/server/prebuilt/capture-render.ts +122 -0
  1344. package/src/server/prebuilt/capture-routes.ts +104 -0
  1345. package/src/server/prebuilt/capture-state.ts +196 -0
  1346. package/src/server/prebuilt/dev-store.ts +252 -0
  1347. package/src/server/prebuilt/lifetime.ts +151 -0
  1348. package/src/server/prebuilt/manifest-tag-index.ts +46 -0
  1349. package/src/server/prebuilt/overlay.ts +290 -0
  1350. package/src/server/prebuilt/payload-source.ts +221 -0
  1351. package/src/server/prebuilt/slots.ts +201 -0
  1352. package/src/server/prebuilt/synthetic-store.ts +125 -0
  1353. package/src/server/prebuilt-builder.ts +515 -0
  1354. package/src/server/prebuilt-runtime.ts +830 -0
  1355. package/src/server/primitives.ts +167 -171
  1356. package/src/server/publish-params.ts +42 -0
  1357. package/src/server/react-cache-bridge.ts +124 -0
  1358. package/src/server/react-cache-scope.ts +104 -0
  1359. package/src/server/render-timeout.ts +123 -0
  1360. package/src/server/render-utils.ts +70 -0
  1361. package/src/server/request-context.ts +321 -323
  1362. package/src/server/request-dep.ts +37 -0
  1363. package/src/server/response-cache-policy.ts +45 -0
  1364. package/src/server/response-framing.ts +59 -0
  1365. package/src/server/route-element-builder.ts +539 -355
  1366. package/src/server/route-element-helpers.ts +37 -0
  1367. package/src/server/route-handler.ts +78 -48
  1368. package/src/server/route-matcher.ts +251 -265
  1369. package/src/server/route-methods.ts +37 -0
  1370. package/src/server/route-module-loader.ts +161 -0
  1371. package/src/server/rsc-cache-key-guard.ts +122 -0
  1372. package/src/server/rsc-entry/action-dispatcher.ts +146 -0
  1373. package/src/server/rsc-entry/action-middleware-runner.ts +130 -0
  1374. package/src/server/rsc-entry/api-handler.ts +30 -93
  1375. package/src/server/rsc-entry/deny-fallback.ts +151 -0
  1376. package/src/server/rsc-entry/error-renderer.ts +306 -113
  1377. package/src/server/rsc-entry/helpers.ts +90 -115
  1378. package/src/server/rsc-entry/index.ts +420 -350
  1379. package/src/server/rsc-entry/render-route.ts +248 -0
  1380. package/src/server/rsc-entry/render-signals.ts +108 -0
  1381. package/src/server/rsc-entry/revalidate-renderer.ts +349 -0
  1382. package/src/server/rsc-entry/rsc-payload.ts +212 -113
  1383. package/src/server/rsc-entry/rsc-stream.ts +143 -135
  1384. package/src/server/rsc-entry/ssr-bridge.ts +43 -8
  1385. package/src/server/rsc-entry/ssr-renderer.ts +311 -140
  1386. package/src/server/rsc-error-envelope.ts +18 -0
  1387. package/src/server/rsc-prop-warnings.ts +1 -1
  1388. package/src/server/safe-load.ts +53 -0
  1389. package/src/server/schema-introspection.ts +393 -0
  1390. package/src/server/sensitive-fields.ts +287 -0
  1391. package/src/server/server-only-guard-noop.js +3 -0
  1392. package/src/server/server-timing.ts +1 -1
  1393. package/src/server/signal-identity.ts +130 -0
  1394. package/src/server/sitemap-generator.ts +337 -0
  1395. package/src/server/sitemap-handler.ts +150 -0
  1396. package/src/server/skippable-prefix.ts +172 -0
  1397. package/src/server/slot-interception.ts +168 -0
  1398. package/src/server/slot-resolver.ts +747 -300
  1399. package/src/server/slot-subtree-contain.ts +273 -0
  1400. package/src/server/ssr-bridge-types.ts +217 -0
  1401. package/src/server/ssr-entry.ts +246 -109
  1402. package/src/server/ssr-form-state.ts +58 -0
  1403. package/src/server/ssr-render.ts +253 -113
  1404. package/src/server/ssr-wrappers.tsx +152 -0
  1405. package/src/server/state-tree-diff.ts +85 -30
  1406. package/src/server/static-generator.ts +680 -0
  1407. package/src/server/static-not-found.ts +134 -0
  1408. package/src/server/status-code-resolver.ts +107 -148
  1409. package/src/server/stream-utils.ts +398 -0
  1410. package/src/server/traced-access.ts +50 -0
  1411. package/src/server/tracing.ts +274 -128
  1412. package/src/server/tree-match.ts +494 -0
  1413. package/src/server/types.ts +97 -11
  1414. package/src/server/utils/element-type.ts +88 -0
  1415. package/src/server/utils/escape-html.ts +20 -0
  1416. package/src/server/version-skew.ts +104 -0
  1417. package/src/server/waituntil-bridge.ts +1 -1
  1418. package/src/server/workers-cache-bridge.ts +33 -0
  1419. package/src/shared/als-slots.ts +74 -0
  1420. package/src/shared/base-path.ts +80 -0
  1421. package/src/shared/csrf-reject.ts +15 -0
  1422. package/src/shared/dev-span.ts +188 -0
  1423. package/src/shared/error-digest.ts +46 -0
  1424. package/src/shared/flight-base64.ts +23 -0
  1425. package/src/shared/flight-segment.ts +35 -0
  1426. package/src/shared/form-state-flight.ts +59 -0
  1427. package/src/shared/href-validation.ts +159 -0
  1428. package/src/shared/href.ts +257 -0
  1429. package/src/shared/merge-search-params.ts +55 -0
  1430. package/src/shared/param-value.ts +281 -0
  1431. package/src/shared/payload-root.ts +153 -0
  1432. package/src/shared/redirect-type.ts +17 -0
  1433. package/src/shared/rsc-cache-key.ts +269 -0
  1434. package/src/shared/rsc-error-envelope.ts +16 -0
  1435. package/src/shared/rsc-manifest.ts +29 -0
  1436. package/src/shared/rsc-media-type.ts +59 -0
  1437. package/src/shared/rsc-payload-path.ts +52 -0
  1438. package/src/shared/segment-info.ts +67 -0
  1439. package/src/shared/slot-params.ts +109 -0
  1440. package/src/shared/static-platform-files.ts +75 -0
  1441. package/src/shared/status-reason-phrase.ts +61 -0
  1442. package/src/shims/font-google.ts +1 -1
  1443. package/src/shims/font-local.ts +34 -0
  1444. package/src/shims/headers.ts +130 -1
  1445. package/src/shims/navigation-client.ts +36 -32
  1446. package/src/shims/navigation-rsc.ts +47 -0
  1447. package/src/shims/navigation.ts +10 -7
  1448. package/src/utils/state-machine.ts +111 -0
  1449. package/src/utils/write-file-atomic.ts +32 -0
  1450. package/dist/_chunks/als-registry-B7DbZ2hS.js +0 -41
  1451. package/dist/_chunks/als-registry-B7DbZ2hS.js.map +0 -1
  1452. package/dist/_chunks/debug-B3Gypr3D.js +0 -108
  1453. package/dist/_chunks/debug-B3Gypr3D.js.map +0 -1
  1454. package/dist/_chunks/format-RyoGQL74.js +0 -164
  1455. package/dist/_chunks/format-RyoGQL74.js.map +0 -1
  1456. package/dist/_chunks/interception-BOoWmLUA.js +0 -676
  1457. package/dist/_chunks/interception-BOoWmLUA.js.map +0 -1
  1458. package/dist/_chunks/metadata-routes-Cjmvi3rQ.js.map +0 -1
  1459. package/dist/_chunks/request-context-BQUC8PHn.js +0 -330
  1460. package/dist/_chunks/request-context-BQUC8PHn.js.map +0 -1
  1461. package/dist/_chunks/ssr-data-MjmprTmO.js +0 -88
  1462. package/dist/_chunks/ssr-data-MjmprTmO.js.map +0 -1
  1463. package/dist/_chunks/tracing-CemImE6h.js +0 -187
  1464. package/dist/_chunks/tracing-CemImE6h.js.map +0 -1
  1465. package/dist/_chunks/use-cookie-DX-l1_5E.js +0 -91
  1466. package/dist/_chunks/use-cookie-DX-l1_5E.js.map +0 -1
  1467. package/dist/_chunks/use-query-states-D5KaffOK.js +0 -109
  1468. package/dist/_chunks/use-query-states-D5KaffOK.js.map +0 -1
  1469. package/dist/adapters/cloudflare.js.map +0 -1
  1470. package/dist/cache/index.js.map +0 -1
  1471. package/dist/cache/register-cached-function.d.ts +0 -17
  1472. package/dist/cache/register-cached-function.d.ts.map +0 -1
  1473. package/dist/client/browser-entry.d.ts +0 -21
  1474. package/dist/client/browser-entry.d.ts.map +0 -1
  1475. package/dist/client/error-boundary.js.map +0 -1
  1476. package/dist/client/head.d.ts +0 -16
  1477. package/dist/client/head.d.ts.map +0 -1
  1478. package/dist/client/link-status-provider.d.ts +0 -11
  1479. package/dist/client/link-status-provider.d.ts.map +0 -1
  1480. package/dist/client/segment-merger.d.ts +0 -119
  1481. package/dist/client/segment-merger.d.ts.map +0 -1
  1482. package/dist/client/stale-reload.d.ts +0 -44
  1483. package/dist/client/stale-reload.d.ts.map +0 -1
  1484. package/dist/client/transition-root.d.ts +0 -74
  1485. package/dist/client/transition-root.d.ts.map +0 -1
  1486. package/dist/client/types.d.ts +0 -14
  1487. package/dist/client/types.d.ts.map +0 -1
  1488. package/dist/client/use-navigation-pending.d.ts +0 -26
  1489. package/dist/client/use-navigation-pending.d.ts.map +0 -1
  1490. package/dist/client/use-params.d.ts +0 -92
  1491. package/dist/client/use-params.d.ts.map +0 -1
  1492. package/dist/content/index.d.ts +0 -11
  1493. package/dist/content/index.d.ts.map +0 -1
  1494. package/dist/content/index.js +0 -2
  1495. package/dist/plugins/adapter-build.d.ts +0 -18
  1496. package/dist/plugins/adapter-build.d.ts.map +0 -1
  1497. package/dist/plugins/cache-transform.d.ts +0 -36
  1498. package/dist/plugins/cache-transform.d.ts.map +0 -1
  1499. package/dist/plugins/dev-error-overlay.d.ts.map +0 -1
  1500. package/dist/plugins/dev-logs.d.ts.map +0 -1
  1501. package/dist/plugins/dynamic-transform.d.ts +0 -72
  1502. package/dist/plugins/dynamic-transform.d.ts.map +0 -1
  1503. package/dist/plugins/server-action-exports.d.ts +0 -26
  1504. package/dist/plugins/server-action-exports.d.ts.map +0 -1
  1505. package/dist/routing/status-file-lint.d.ts +0 -33
  1506. package/dist/routing/status-file-lint.d.ts.map +0 -1
  1507. package/dist/search-params/analyze.d.ts +0 -54
  1508. package/dist/search-params/analyze.d.ts.map +0 -1
  1509. package/dist/search-params/builtin-codecs.d.ts +0 -105
  1510. package/dist/search-params/builtin-codecs.d.ts.map +0 -1
  1511. package/dist/search-params/codecs.d.ts +0 -53
  1512. package/dist/search-params/codecs.d.ts.map +0 -1
  1513. package/dist/search-params/create.d.ts +0 -106
  1514. package/dist/search-params/create.d.ts.map +0 -1
  1515. package/dist/search-params/registry.d.ts +0 -20
  1516. package/dist/search-params/registry.d.ts.map +0 -1
  1517. package/dist/server/asset-headers.d.ts +0 -42
  1518. package/dist/server/asset-headers.d.ts.map +0 -1
  1519. package/dist/server/client-module-map.d.ts +0 -47
  1520. package/dist/server/client-module-map.d.ts.map +0 -1
  1521. package/dist/server/dev-fetch-instrumentation.d.ts +0 -22
  1522. package/dist/server/dev-fetch-instrumentation.d.ts.map +0 -1
  1523. package/dist/server/dev-logger.d.ts.map +0 -1
  1524. package/dist/server/dev-span-processor.d.ts +0 -29
  1525. package/dist/server/dev-span-processor.d.ts.map +0 -1
  1526. package/dist/server/dev-warnings.d.ts +0 -129
  1527. package/dist/server/dev-warnings.d.ts.map +0 -1
  1528. package/dist/server/flush.d.ts +0 -74
  1529. package/dist/server/flush.d.ts.map +0 -1
  1530. package/dist/server/form-flash.d.ts +0 -78
  1531. package/dist/server/form-flash.d.ts.map +0 -1
  1532. package/dist/server/manifest-status-resolver.d.ts +0 -58
  1533. package/dist/server/manifest-status-resolver.d.ts.map +0 -1
  1534. package/dist/server/nuqs-ssr-provider.d.ts +0 -28
  1535. package/dist/server/nuqs-ssr-provider.d.ts.map +0 -1
  1536. package/dist/server/prerender.d.ts +0 -77
  1537. package/dist/server/prerender.d.ts.map +0 -1
  1538. package/dist/server/tree-builder.d.ts +0 -126
  1539. package/dist/server/tree-builder.d.ts.map +0 -1
  1540. package/dist/utils/directive-parser.d.ts +0 -70
  1541. package/dist/utils/directive-parser.d.ts.map +0 -1
  1542. package/src/cache/register-cached-function.ts +0 -103
  1543. package/src/client/browser-entry.ts +0 -678
  1544. package/src/client/head.ts +0 -61
  1545. package/src/client/link-status-provider.tsx +0 -30
  1546. package/src/client/segment-merger.ts +0 -339
  1547. package/src/client/stale-reload.ts +0 -87
  1548. package/src/client/transition-root.tsx +0 -166
  1549. package/src/client/types.ts +0 -21
  1550. package/src/client/use-navigation-pending.ts +0 -38
  1551. package/src/client/use-params.ts +0 -141
  1552. package/src/content/index.ts +0 -13
  1553. package/src/plugins/adapter-build.ts +0 -118
  1554. package/src/plugins/cache-transform.ts +0 -199
  1555. package/src/plugins/dynamic-transform.ts +0 -161
  1556. package/src/plugins/server-action-exports.ts +0 -220
  1557. package/src/routing/status-file-lint.ts +0 -112
  1558. package/src/search-params/analyze.ts +0 -192
  1559. package/src/search-params/builtin-codecs.ts +0 -228
  1560. package/src/search-params/codecs.ts +0 -153
  1561. package/src/search-params/create.ts +0 -321
  1562. package/src/search-params/registry.ts +0 -31
  1563. package/src/server/asset-headers.ts +0 -81
  1564. package/src/server/client-module-map.ts +0 -58
  1565. package/src/server/dev-fetch-instrumentation.ts +0 -96
  1566. package/src/server/dev-span-processor.ts +0 -78
  1567. package/src/server/dev-warnings.ts +0 -283
  1568. package/src/server/flush.ts +0 -182
  1569. package/src/server/form-flash.ts +0 -89
  1570. package/src/server/manifest-status-resolver.ts +0 -215
  1571. package/src/server/nuqs-ssr-provider.tsx +0 -63
  1572. package/src/server/prerender.ts +0 -139
  1573. package/src/server/tree-builder.ts +0 -382
  1574. package/src/shims/server-only-noop.js +0 -6
  1575. package/src/utils/directive-parser.ts +0 -529
@@ -0,0 +1,1273 @@
1
+ import { i as canonicalize } from "./canonicalize-CqK135BN.js";
2
+ import { a as revalidationAls, i as requestContextAls, r as reactCacheScopeAls } from "./als-registry-DpygwCp0.js";
3
+ import { I as isDenySignal, L as isRedirectSignal, M as withSpan, N as DENY_BRAND, P as REDIRECT_BRAND, S as isDevMode, x as isDebug } from "./logger-YtMSKfft.js";
4
+ import { n as _setGetSegmentParamsFn, t as _setGetSearchParamsFn } from "./als-slots-kbQrHTzm.js";
5
+ import { r as appVisibleSearch } from "./rsc-cache-key-D0cb0Gmc.js";
6
+ import { n as resolveSegmentParams, t as mergePreservedSearchParams } from "./merge-search-params-7o_5yX0L.js";
7
+ import { a as assertValidCookieOptions, i as assertValidCookieName, n as parseSetCookie$1, o as assertValidCookieValue, r as stringifySetCookie, t as parseCookie } from "./dist-C1Rjlo6s.js";
8
+ import { _ as getWaitUntil, t as cache } from "./cache-api-BZJNt01a.js";
9
+ import { r as validateExternalRedirectUrl, t as assertRelativeRedirectPath } from "./href-validation-DNg-zV7u.js";
10
+ // src/server/react-cache-scope.ts
11
+ /**
12
+ * React.cache scopes — opening, resuming, and leaving the per-request
13
+ * `React.cache` scope that `react-cache-bridge.ts` makes Flight read.
14
+ *
15
+ * Kept apart from the bridge so request-context and cookie code can use
16
+ * it without importing `react`. See design/spike-TIM-1529-react-cache-bridge.md.
17
+ */
18
+ /** A new, empty `React.cache` scope. */
19
+ function createReactCacheScope() {
20
+ return /* @__PURE__ */ new Map();
21
+ }
22
+ /**
23
+ * Run `fn` in a `React.cache` scope — a fresh one unless `scope` is given.
24
+ * Every `React.cache` call made from `fn` — synchronously, in its async
25
+ * continuations, and in any Flight render it starts — shares one memo table.
26
+ *
27
+ * Opened by `runWithRequestContext`, so each request context gets its own
28
+ * scope. Pass `scope` to resume one across two ALS runs: the post-action
29
+ * revalidation opens a fresh scope for the target route's middleware and
30
+ * renders the revalidated tree in that same scope later.
31
+ */
32
+ function runWithReactCacheScope(fn, scope = createReactCacheScope()) {
33
+ return reactCacheScopeAls.run(scope, fn);
34
+ }
35
+ /**
36
+ * Run `fn` with no timber scope, so `React.cache` behaves as stock React:
37
+ * no dedupe outside a render, Flight's own per-render cache inside one.
38
+ *
39
+ * Used for server action bodies — an action reads, writes cookies, and
40
+ * mutates, so memoized reads would go stale mid-action (the same choice
41
+ * Next.js makes) — and for renders whose output outlives the request
42
+ * (`cache.component` capture), which must not bake request-memoized values
43
+ * into a cross-request cache entry.
44
+ */
45
+ function runOutsideReactCacheScope(fn) {
46
+ return reactCacheScopeAls.exit(fn);
47
+ }
48
+ var cookieReads = /* @__PURE__ */ new WeakMap();
49
+ var warnedScopes = /* @__PURE__ */ new WeakSet();
50
+ /**
51
+ * Dev-only: record that cookie `name` (or {@link ANY_COOKIE}) was read
52
+ * while `React.cache` held values in this request — the read may have
53
+ * happened inside a cached function.
54
+ */
55
+ function noteCookieReadForReactCache(name) {
56
+ if (!isDevMode()) return;
57
+ const scope = reactCacheScopeAls.getStore();
58
+ if (!scope || scope.size === 0) return;
59
+ let reads = cookieReads.get(scope);
60
+ if (!reads) {
61
+ reads = /* @__PURE__ */ new Set();
62
+ cookieReads.set(scope, reads);
63
+ }
64
+ reads.add(name);
65
+ }
66
+ /**
67
+ * Dev-only: warn (once per request) when a cookie recorded by
68
+ * {@link noteCookieReadForReactCache} is written. `name` is the written
69
+ * cookie, or {@link ANY_COOKIE} for `clear()`. Dev-only because reads are
70
+ * only recorded in dev.
71
+ */
72
+ function warnIfCachedCookieIsWritten(name) {
73
+ const scope = reactCacheScopeAls.getStore();
74
+ if (!scope || warnedScopes.has(scope)) return;
75
+ const reads = cookieReads.get(scope);
76
+ if (!reads) return;
77
+ if (!(name === "*" ? reads.size > 0 : reads.has(name) || reads.has("*"))) return;
78
+ warnedScopes.add(scope);
79
+ const which = name === "*" ? "Cookies were cleared" : `Cookie "${name}" was written`;
80
+ console.warn(`[timber] ${which} after being read while React.cache held values for this request. A cached function that read it keeps returning the old result — pass the cookie value in as an argument (e.g. getUser(sessionToken)) so a change is a new cache key.`);
81
+ }
82
+ // src/server/request-context.ts
83
+ /**
84
+ * Returns a read-only view of the current request's headers.
85
+ *
86
+ * Available in middleware, access checks, server components, and server actions.
87
+ * Throws if called outside a request context (security principle #2: no global fallback).
88
+ */
89
+ function getHeaders() {
90
+ const store = requestContextAls.getStore();
91
+ if (!store) throw new Error("[timber] getHeaders() called outside of a request context. It can only be used in middleware, access checks, server components, and server actions.");
92
+ return store.headers;
93
+ }
94
+ /**
95
+ * Returns the value of a single request header, or undefined if absent.
96
+ *
97
+ * Thin wrapper over `getHeaders().get(name)` for the common case where
98
+ * you need exactly one header.
99
+ *
100
+ * @internal — not part of the public API. Use `getHeaders().get(name)` instead.
101
+ */
102
+ function getHeader(name) {
103
+ return getHeaders().get(name) ?? void 0;
104
+ }
105
+ /**
106
+ * Returns the current request's raw URLSearchParams.
107
+ *
108
+ * @internal — not part of the public API. Use `defineSearchParams().get()` instead.
109
+ */
110
+ function getSearchParams() {
111
+ const store = requestContextAls.getStore();
112
+ if (!store) throw new Error("[timber] getSearchParams() called outside of a request context. It can only be used in middleware, access checks, server components, and server actions.");
113
+ return store.searchParams;
114
+ }
115
+ _setGetSearchParamsFn(getSearchParams);
116
+ _setGetSegmentParamsFn(getSegmentParams);
117
+ /**
118
+ * Returns the current request's coerced segment params.
119
+ *
120
+ * The optional `segmentPath` argument exists only for TypeScript narrowing —
121
+ * it does not affect the runtime return value. Pass a segment path
122
+ * (e.g. `'/(browse)/[artistSlug]/[year]'`) to narrow the return type to the
123
+ * exact params shape for that segment.
124
+ *
125
+ * Without an argument, returns all coerced params with optional types.
126
+ *
127
+ * See design/41-global-params.md §Function Signatures
128
+ */
129
+ function getSegmentParams(segmentPath) {
130
+ const store = requestContextAls.getStore();
131
+ if (!store) throw new Error("[timber] getSegmentParams() called outside of a request context. It can only be used in middleware, access checks, server components, and server actions.");
132
+ if (!store.segmentParams) throw new Error("[timber] getSegmentParams() called before route matching completed. Segment params are not available until after the route is matched.");
133
+ const slotResolved = resolveSegmentParams(store.segmentParams, store.slotParams, segmentPath);
134
+ if (slotResolved !== store.segmentParams) return slotResolved;
135
+ if (segmentPath && isDebug() && store.matchedSegmentPath) {
136
+ const expected = extractDynamicSegments(segmentPath);
137
+ const actual = extractDynamicSegments(store.matchedSegmentPath);
138
+ const missing = expected.filter((s) => !actual.includes(s));
139
+ if (missing.length > 0) console.warn(`[timber] getSegmentParams('${segmentPath}') called but current segment is '${store.matchedSegmentPath}'\n Missing params: ${missing.join(", ")}\n These will be undefined at runtime despite the type annotation.`);
140
+ }
141
+ return store.segmentParams;
142
+ }
143
+ /**
144
+ * Set the segment params on the current request context.
145
+ * Called by the pipeline after route matching and param coercion.
146
+ *
147
+ * @internal — framework use only
148
+ */
149
+ function setSegmentParams(params) {
150
+ const store = requestContextAls.getStore();
151
+ if (!store) throw new Error("[timber] setSegmentParams() called outside of a request context.");
152
+ store.segmentParams = params;
153
+ }
154
+ /**
155
+ * Run `fn` with exactly these segment params, and this matched segment
156
+ * path, standing in for the main route's — what a no-arg
157
+ * `getSegmentParams()` returns inside it.
158
+ *
159
+ * The parallel-slot scope above is one use. The other is an intercepted
160
+ * navigation (TIM-1607): the URL's own middleware and access.ts run while the
161
+ * request publishes the *rendered* route's params, and each must see the
162
+ * params of the route it was written for. Same Proxy, for the same reason:
163
+ * every write still reaches the live store.
164
+ *
165
+ * @internal — framework use only
166
+ */
167
+ function runWithSegmentParams(matchedSegmentPath, segmentParams, fn) {
168
+ const store = requestContextAls.getStore();
169
+ if (!store) return fn();
170
+ const scoped = new Proxy(store, { get(target, prop, receiver) {
171
+ if (prop === "segmentParams") return segmentParams;
172
+ if (prop === "matchedSegmentPath") return matchedSegmentPath;
173
+ return Reflect.get(target, prop, receiver);
174
+ } });
175
+ return requestContextAls.run(scoped, fn);
176
+ }
177
+ /**
178
+ * Store the matched segment path (e.g. '/(browse)/[artistSlug]/[year]') for
179
+ * dev-mode validation in getSegmentParams().
180
+ *
181
+ * @internal — framework use only
182
+ */
183
+ function setMatchedSegmentPath(segmentPath) {
184
+ const store = requestContextAls.getStore();
185
+ if (!store) return;
186
+ store.matchedSegmentPath = segmentPath;
187
+ }
188
+ /**
189
+ * Extract dynamic segment names from a route pattern.
190
+ * '/[artistSlug]/[year]' → ['artistSlug', 'year']
191
+ * '/docs/[...slug]' → ['slug']
192
+ */
193
+ function extractDynamicSegments(route) {
194
+ const segments = [];
195
+ const re = /\[{1,2}\.{0,3}(\w+)\]{1,2}/g;
196
+ let m;
197
+ while ((m = re.exec(route)) !== null) segments.push(m[1]);
198
+ return segments;
199
+ }
200
+ /**
201
+ * Returns the raw search string from the current request URL (e.g. "?foo=bar").
202
+ * Synchronous — safe for use in `redirect()` which throws synchronously.
203
+ *
204
+ * Returns empty string if called outside a request context (non-throwing for
205
+ * use in redirect's optional preserveSearchParams path).
206
+ *
207
+ * @internal — used by redirect() for preserveSearchParams support.
208
+ */
209
+ function getRequestSearchString() {
210
+ return requestContextAls.getStore()?.searchString ?? "";
211
+ }
212
+ /**
213
+ * Run a callback within a request context. Used by the pipeline to establish
214
+ * per-request ALS scope so that `getHeaders()` and `getCookies()` work.
215
+ *
216
+ * When `options.cookies` is given, the context's `parsedCookies` map is a
217
+ * copy of it and the raw `cookieHeader` is left empty, so
218
+ * `parseCookieHeader` never runs for that request. Re-entry callers pass the
219
+ * action's post-mutation cookie state this way (TIM-868).
220
+ *
221
+ * Each request context also opens its own `React.cache` scope, shared by
222
+ * everything that runs inside it — proxy.ts, middleware.ts, route handlers,
223
+ * and the render (design/02-rendering-pipeline.md §"Cache Scoping Model").
224
+ *
225
+ * @param req - The incoming Request object.
226
+ * @param fn - The function to run within the request context.
227
+ */
228
+ function runWithRequestContext(req, fn, { reactCacheScope, cookies, formState, actionError } = {}) {
229
+ const originalCopy = new Headers(req.headers);
230
+ const appVisible = appVisibleSearch(new URL(req.url));
231
+ const seed = cookies ? new Map(cookies) : void 0;
232
+ const store = {
233
+ request: req,
234
+ headers: freezeHeaders(req.headers),
235
+ originalHeaders: originalCopy,
236
+ cookieHeader: seed ? "" : req.headers.get("cookie") ?? "",
237
+ parsedCookies: seed,
238
+ searchParams: appVisible.params,
239
+ searchString: appVisible.search,
240
+ cookieJar: /* @__PURE__ */ new Map(),
241
+ flushed: false,
242
+ mutableContext: false,
243
+ formState,
244
+ actionError
245
+ };
246
+ return requestContextAls.run(store, () => runWithReactCacheScope(fn, reactCacheScope));
247
+ }
248
+ /**
249
+ * Enable cookie mutation for the current context. Called by the framework
250
+ * when entering middleware.ts, server actions, or route.ts handlers.
251
+ *
252
+ * See design/29-cookies.md §"Context Tracking"
253
+ */
254
+ function setMutableCookieContext(mutable) {
255
+ const store = requestContextAls.getStore();
256
+ if (store) store.mutableContext = mutable;
257
+ }
258
+ /**
259
+ * Mark the response as flushed (headers committed). After this point,
260
+ * cookie mutations log a warning instead of throwing.
261
+ *
262
+ * See design/29-cookies.md §"Streaming Constraint: Post-Flush Cookie Warning"
263
+ */
264
+ function markResponseFlushed() {
265
+ const store = requestContextAls.getStore();
266
+ if (store) store.flushed = true;
267
+ }
268
+ /**
269
+ * Apply middleware-injected request headers to the current request context.
270
+ *
271
+ * Called by the pipeline after middleware.ts runs. Merges overlay headers
272
+ * on top of the original request headers so downstream code (access.ts,
273
+ * server components, server actions) sees them via `getHeaders()`.
274
+ *
275
+ * The original request headers are never mutated — a new frozen Headers
276
+ * object is created with the overlay applied on top.
277
+ *
278
+ * See design/07-routing.md §"Request Header Injection"
279
+ */
280
+ function applyRequestHeaderOverlay(overlay) {
281
+ const store = requestContextAls.getStore();
282
+ if (!store) throw new Error("[timber] applyRequestHeaderOverlay() called outside of a request context.");
283
+ let hasOverlay = false;
284
+ overlay.forEach(() => {
285
+ hasOverlay = true;
286
+ });
287
+ if (!hasOverlay) return;
288
+ const merged = new Headers(store.originalHeaders);
289
+ overlay.forEach((value, key) => {
290
+ merged.set(key, value);
291
+ });
292
+ store.headers = freezeHeaders(merged);
293
+ }
294
+ var MUTATING_METHODS = /* @__PURE__ */ new Set([
295
+ "set",
296
+ "append",
297
+ "delete"
298
+ ]);
299
+ /**
300
+ * Wrap a Headers object in a Proxy that throws on mutating methods.
301
+ * Object.freeze doesn't work on Headers (native internal slots), so we
302
+ * intercept property access and reject set/append/delete at runtime.
303
+ *
304
+ * Read methods (get, has, entries, etc.) must be bound to the underlying
305
+ * Headers instance because they access private #headersList slots.
306
+ */
307
+ function freezeHeaders(source) {
308
+ const copy = new Headers(source);
309
+ return new Proxy(copy, { get(target, prop) {
310
+ if (typeof prop === "string" && MUTATING_METHODS.has(prop)) return () => {
311
+ throw new Error(`[timber] getHeaders() returns a read-only Headers object. Calling .${prop}() is not allowed. Use ctx.requestHeaders in middleware to inject headers for downstream components.`);
312
+ };
313
+ const value = Reflect.get(target, prop);
314
+ if (typeof value === "function") return value.bind(target);
315
+ return value;
316
+ } });
317
+ }
318
+ // src/server/cookie-parsing.ts
319
+ /**
320
+ * Cookie parsing and serialization helpers — pure string ↔ structure
321
+ * functions with no ALS dependency. Split out of `cookie-context.ts`
322
+ * (TIM-853) so the API surface and the wire-format codecs can each be
323
+ * read on their own.
324
+ *
325
+ * The functions in this module are total over arbitrary input. They
326
+ * never throw and never call `assertValid*` (the security validators
327
+ * live in the API surface — `cookie-context.ts` invokes them at every
328
+ * jar entry point so the smuggling-primitive invariant from TIM-868
329
+ * is enforced regardless of which path produced the bytes).
330
+ *
331
+ * Delegates to the `cookie` package (RFC 6265, dependency-free,
332
+ * browser-safe) for wire codecs. Adapts at the boundary to preserve
333
+ * timber's Map-based API and never-throw contract.
334
+ */
335
+ /**
336
+ * Parse a Cookie header string into a Map of name → value pairs.
337
+ * Follows RFC 6265 §4.2.1: cookies are semicolon-separated key=value pairs.
338
+ *
339
+ * Values are auto-decoded with `decodeURIComponent` so they round-trip
340
+ * losslessly with `getCookies().set()` (which auto-encodes). Malformed
341
+ * `%`-escapes from third-party cookies fall back to the raw byte sequence
342
+ * — the parser must be total over arbitrary inbound headers, including
343
+ * non-conforming values from other servers, browser extensions, etc.
344
+ */
345
+ function parseCookieHeader(header) {
346
+ const map = /* @__PURE__ */ new Map();
347
+ if (!header) return map;
348
+ const parsed = parseCookie(header);
349
+ for (const name in parsed) {
350
+ const value = parsed[name];
351
+ if (value !== void 0) map.set(name, value);
352
+ }
353
+ return map;
354
+ }
355
+ /**
356
+ * Decode a single cookie value with `decodeURIComponent`, falling back to
357
+ * the raw byte sequence if the input contains a malformed `%`-escape.
358
+ *
359
+ * Used by both `parseCookieHeader` (incoming Cookie: header) and the
360
+ * `setRaw` forwarding path (outgoing Set-Cookie from upstream services).
361
+ * Total — never throws.
362
+ *
363
+ * cookie's internal decode has identical semantics but is not exported,
364
+ * so we keep this standalone helper.
365
+ */
366
+ function safeDecodeCookieValue(raw) {
367
+ try {
368
+ return decodeURIComponent(raw);
369
+ } catch {
370
+ return raw;
371
+ }
372
+ }
373
+ /**
374
+ * Serialize a CookieEntry into a Set-Cookie header value.
375
+ *
376
+ * Total — never throws. If the cookie package's serializer rejects
377
+ * the input (e.g. non-integer maxAge, forbidden chars in name/value),
378
+ * falls back to a minimal hand-rolled serialization so the response
379
+ * path is never interrupted by a codec error.
380
+ */
381
+ function serializeCookieEntry(entry) {
382
+ try {
383
+ return stringifySetCookie({
384
+ name: entry.name,
385
+ value: entry.value,
386
+ domain: entry.options.domain,
387
+ path: entry.options.path,
388
+ expires: entry.options.expires,
389
+ maxAge: entry.options.maxAge,
390
+ httpOnly: entry.options.httpOnly,
391
+ secure: entry.options.secure,
392
+ sameSite: entry.options.sameSite,
393
+ partitioned: entry.options.partitioned
394
+ }, { encode: (v) => v });
395
+ } catch {
396
+ return serializeCookieEntryFallback(entry);
397
+ }
398
+ }
399
+ function serializeCookieEntryFallback(entry) {
400
+ const parts = [`${entry.name}=${entry.value}`];
401
+ const opts = entry.options;
402
+ if (opts.domain) parts.push(`Domain=${opts.domain}`);
403
+ if (opts.path) parts.push(`Path=${opts.path}`);
404
+ if (opts.expires) parts.push(`Expires=${opts.expires.toUTCString()}`);
405
+ if (opts.maxAge !== void 0) parts.push(`Max-Age=${opts.maxAge}`);
406
+ if (opts.httpOnly) parts.push("HttpOnly");
407
+ if (opts.secure) parts.push("Secure");
408
+ if (opts.sameSite) parts.push(`SameSite=${opts.sameSite.charAt(0).toUpperCase()}${opts.sameSite.slice(1)}`);
409
+ if (opts.partitioned) parts.push("Partitioned");
410
+ return parts.join("; ");
411
+ }
412
+ /**
413
+ * Parse a raw `Set-Cookie` header string into name, value, and options.
414
+ * Handles all standard attributes: Path, Domain, Max-Age, Expires,
415
+ * SameSite, Secure, HttpOnly, Partitioned.
416
+ *
417
+ * Does NOT apply DEFAULT_COOKIE_OPTIONS — the caller decides whether
418
+ * to merge defaults (e.g. `set()` does, but `setRaw()` should preserve
419
+ * the original header's intent).
420
+ */
421
+ function parseSetCookie(header) {
422
+ const parsed = parseSetCookie$1(header, { decode: (v) => v });
423
+ if (!parsed.name) return null;
424
+ const options = {};
425
+ if (parsed.path !== void 0) options.path = parsed.path || "/";
426
+ if (parsed.domain !== void 0) options.domain = parsed.domain;
427
+ if (parsed.maxAge !== void 0 && Number.isFinite(parsed.maxAge)) options.maxAge = parsed.maxAge;
428
+ if (parsed.expires !== void 0) options.expires = parsed.expires;
429
+ if (parsed.sameSite !== void 0 && parsed.sameSite !== true) {
430
+ const sameSite = parsed.sameSite.toLowerCase();
431
+ if (sameSite === "strict" || sameSite === "lax" || sameSite === "none") options.sameSite = sameSite;
432
+ }
433
+ if (parsed.secure) options.secure = true;
434
+ if (parsed.httpOnly) options.httpOnly = true;
435
+ if (parsed.partitioned) options.partitioned = true;
436
+ return {
437
+ name: parsed.name,
438
+ value: parsed.value ?? "",
439
+ options
440
+ };
441
+ }
442
+ // src/server/cookie-context.ts
443
+ /**
444
+ * Cookie Context — per-request cookie API and on-the-wire helpers.
445
+ *
446
+ * Split out of `request-context.ts` (TIM-853) so the cookie subsystem
447
+ * — encoding contract, options grammar, parser, serializer, and RYW map
448
+ * — lives in one file. The headers/scope/params APIs
449
+ * stay in `request-context.ts` and call into this module via the
450
+ * exported helpers.
451
+ *
452
+ * See design/29-cookies.md for the encoding contract and read-your-own-
453
+ * writes semantics. See ONGOING_SECURITY.md H-3 (TIM-868) for the
454
+ * smuggling primitive that the encoding contract closes.
455
+ */
456
+ /**
457
+ * Returns a cookie accessor for the current request.
458
+ *
459
+ * Available in middleware, access checks, server components, and server actions.
460
+ * Throws if called outside a request context (security principle #2: no global fallback).
461
+ *
462
+ * Read methods (.get, .has, .getAll) are always available and reflect
463
+ * read-your-own-writes from .set() calls in the same request.
464
+ *
465
+ * Mutation methods (.set, .delete, .clear) are only available in mutable
466
+ * contexts (middleware.ts, server actions, route.ts handlers). Calling them
467
+ * in read-only contexts (access.ts, server components) throws.
468
+ *
469
+ * This is the escape hatch for direct cookie jar operations. For typed
470
+ * cookie access, use `defineCookie()` instead.
471
+ *
472
+ * See design/29-cookies.md
473
+ */
474
+ function getCookieJar() {
475
+ const store = requestContextAls.getStore();
476
+ if (!store) throw new Error("[timber] getCookieJar() called outside of a request context. It can only be used in middleware, access checks, server components, and server actions.");
477
+ if (!store.parsedCookies) store.parsedCookies = parseCookieHeader(store.cookieHeader);
478
+ const map = store.parsedCookies;
479
+ return {
480
+ get(name) {
481
+ noteCookieReadForReactCache(name);
482
+ return map.get(name);
483
+ },
484
+ has(name) {
485
+ noteCookieReadForReactCache(name);
486
+ return map.has(name);
487
+ },
488
+ getAll() {
489
+ noteCookieReadForReactCache("*");
490
+ return Array.from(map.entries()).map(([name, value]) => ({
491
+ name,
492
+ value
493
+ }));
494
+ },
495
+ get size() {
496
+ noteCookieReadForReactCache("*");
497
+ return map.size;
498
+ },
499
+ set(name, value, options) {
500
+ assertMutable(store, "set");
501
+ assertValidCookieName(name);
502
+ if (typeof value !== "string") throw new Error(`[timber] getCookieJar().set(${JSON.stringify(name)}, …): value must be a string, got ${typeof value}.\n To store a JSON-serializable value, use defineCookie + jsonCookieCodec:\n\n import { defineCookie, jsonCookieCodec } from '@timber-js/app/cookies';\n\n export const ${name}Cookie = defineCookie(${JSON.stringify(name)}, {\n codec: jsonCookieCodec(),\n });\n\n ${name}Cookie.set(value);\n\n See design/29-cookies.md §"Typed Cookies with Schema Validation".`);
503
+ const raw = options?.raw === true;
504
+ const wireValue = raw ? value : encodeURIComponent(value);
505
+ if (raw) assertValidCookieValue(name, wireValue);
506
+ if (store.flushed) {
507
+ if (isDebug()) console.warn(`[timber] warn: getCookieJar().set('${name}') called after response headers were committed.\n The cookie will NOT be sent. Move cookie mutations to middleware.ts, a server action,\n or a route.ts handler.`);
508
+ return;
509
+ }
510
+ const { raw: _raw, ...attributeOptions } = options ?? {};
511
+ const opts = {
512
+ ...DEFAULT_COOKIE_OPTIONS,
513
+ ...attributeOptions
514
+ };
515
+ assertValidCookieOptions(opts);
516
+ store.cookieJar.set(name, {
517
+ name,
518
+ value: wireValue,
519
+ options: opts
520
+ });
521
+ map.set(name, raw ? wireValue : value);
522
+ warnIfCachedCookieIsWritten(name);
523
+ },
524
+ setFromHeaders(headers) {
525
+ assertMutable(store, "setFromHeaders");
526
+ if (store.flushed) {
527
+ console.warn("[timber] warn: getCookieJar().setFromHeaders() called after response headers were committed.\n The cookies will NOT be sent. Move cookie mutations to middleware.ts, a server action,\n or a route.ts handler.");
528
+ return;
529
+ }
530
+ for (const raw of headers.getSetCookie()) {
531
+ const parsed = parseSetCookie(raw);
532
+ if (parsed) setRaw(store, map, parsed.name, parsed.value, parsed.options);
533
+ }
534
+ },
535
+ delete(name, options) {
536
+ assertMutable(store, "delete");
537
+ assertValidCookieName(name);
538
+ if (store.flushed) {
539
+ if (isDebug()) console.warn(`[timber] warn: getCookieJar().delete('${name}') called after response headers were committed.\n The cookie will NOT be deleted. Move cookie mutations to middleware.ts, a server action,\n or a route.ts handler.`);
540
+ return;
541
+ }
542
+ const opts = {
543
+ ...DEFAULT_COOKIE_OPTIONS,
544
+ ...options,
545
+ maxAge: 0,
546
+ expires: /* @__PURE__ */ new Date(0)
547
+ };
548
+ assertValidCookieOptions(opts);
549
+ store.cookieJar.set(name, {
550
+ name,
551
+ value: "",
552
+ options: opts
553
+ });
554
+ map.delete(name);
555
+ warnIfCachedCookieIsWritten(name);
556
+ },
557
+ clear() {
558
+ assertMutable(store, "clear");
559
+ if (store.flushed) return;
560
+ for (const name of Array.from(map.keys())) store.cookieJar.set(name, {
561
+ name,
562
+ value: "",
563
+ options: {
564
+ ...DEFAULT_COOKIE_OPTIONS,
565
+ maxAge: 0,
566
+ expires: /* @__PURE__ */ new Date(0)
567
+ }
568
+ });
569
+ map.clear();
570
+ warnIfCachedCookieIsWritten("*");
571
+ },
572
+ toString() {
573
+ noteCookieReadForReactCache("*");
574
+ return Array.from(map.entries()).map(([name, value]) => `${name}=${encodeURIComponent(value)}`).join("; ");
575
+ }
576
+ };
577
+ }
578
+ /**
579
+ * Returns the value of a single cookie, or undefined if absent.
580
+ *
581
+ * @internal — not part of the public API. Use `defineCookie().get()` or `getCookieJar().get()` instead.
582
+ */
583
+ function getCookie(name) {
584
+ return getCookieJar().get(name);
585
+ }
586
+ var DEFAULT_COOKIE_OPTIONS = {
587
+ path: "/",
588
+ httpOnly: true,
589
+ secure: true,
590
+ sameSite: "lax"
591
+ };
592
+ /**
593
+ * Collect all Set-Cookie headers from the cookie jar.
594
+ * Called by the framework at flush time to apply cookies to the response.
595
+ *
596
+ * Returns an array of serialized Set-Cookie header values.
597
+ */
598
+ function getSetCookieHeaders() {
599
+ const store = requestContextAls.getStore();
600
+ if (!store) return [];
601
+ return Array.from(store.cookieJar.values()).map(serializeCookieEntry);
602
+ }
603
+ /** Throw if cookie mutation is attempted in a read-only context. */
604
+ function assertMutable(store, method) {
605
+ if (!store.mutableContext) throw new Error(`[timber] getCookieJar().${method}() cannot be called in this context.\n Set cookies in middleware.ts, server actions, or route.ts handlers.`);
606
+ }
607
+ /**
608
+ * Write a cookie to the jar WITHOUT merging DEFAULT_COOKIE_OPTIONS.
609
+ * Used by setFromHeaders to preserve the original header's attributes exactly.
610
+ *
611
+ * For deletion cookies (maxAge=0), the jar entry is still created so the
612
+ * Set-Cookie header is emitted, but the cookie is NOT added to the read map
613
+ * (it would be misleading — the cookie is being deleted).
614
+ */
615
+ function setRaw(store, readMap, name, value, options) {
616
+ assertValidCookieName(name);
617
+ assertValidCookieValue(name, value);
618
+ assertValidCookieOptions(options);
619
+ store.cookieJar.set(name, {
620
+ name,
621
+ value,
622
+ options
623
+ });
624
+ warnIfCachedCookieIsWritten(name);
625
+ if (options.maxAge === 0) readMap.delete(name);
626
+ else readMap.set(name, safeDecodeCookieValue(value));
627
+ }
628
+ // src/server/primitives.ts
629
+ /**
630
+ * Check if a value is JSON-serializable without data loss.
631
+ * Returns a description of the first non-serializable value found, or null if OK.
632
+ *
633
+ * @internal Exported for testing only.
634
+ */
635
+ function findNonSerializable(value, path = "data") {
636
+ if (value === null || value === void 0) return null;
637
+ switch (typeof value) {
638
+ case "string":
639
+ case "number":
640
+ case "boolean": return null;
641
+ case "bigint": return `${path} contains a BigInt — BigInt throws in JSON.stringify`;
642
+ case "function": return `${path} is a function — functions are not JSON-serializable`;
643
+ case "symbol": return `${path} is a symbol — symbols are not JSON-serializable`;
644
+ case "object": break;
645
+ default: return `${path} has unsupported type "${typeof value}"`;
646
+ }
647
+ if (value instanceof Date) return `${path} is a Date — Dates silently coerce to strings in JSON.stringify`;
648
+ if (value instanceof Map) return `${path} is a Map — Maps serialize as {} in JSON.stringify (data loss)`;
649
+ if (value instanceof Set) return `${path} is a Set — Sets serialize as {} in JSON.stringify (data loss)`;
650
+ if (value instanceof RegExp) return `${path} is a RegExp — RegExps serialize as {} in JSON.stringify`;
651
+ if (value instanceof Error) return `${path} is an Error — Errors serialize as {} in JSON.stringify`;
652
+ if (Array.isArray(value)) {
653
+ for (let i = 0; i < value.length; i++) {
654
+ const result = findNonSerializable(value[i], `${path}[${i}]`);
655
+ if (result) return result;
656
+ }
657
+ return null;
658
+ }
659
+ const proto = Object.getPrototypeOf(value);
660
+ if (proto === null) return `${path} is a null-prototype object — React Flight rejects null prototypes`;
661
+ if (proto !== Object.prototype) return `${path} is a ${value.constructor?.name ?? "unknown"} instance — class instances may lose data in JSON.stringify`;
662
+ for (const key of Object.keys(value)) {
663
+ const result = findNonSerializable(value[key], `${path}.${key}`);
664
+ if (result) return result;
665
+ }
666
+ return null;
667
+ }
668
+ /**
669
+ * Emit a dev-mode warning if data is not JSON-serializable.
670
+ * No-op in production.
671
+ */
672
+ function warnIfNotSerializable(data, callerName) {
673
+ if (!isDebug()) return;
674
+ if (data === void 0) return;
675
+ const issue = findNonSerializable(data);
676
+ if (issue) console.warn(`[timber] ${callerName}: ${issue}. Data passed to deny() must be JSON-serializable because the post-flush path uses JSON.stringify, not React Flight.`);
677
+ }
678
+ /**
679
+ * Render-phase signal thrown by `deny()`. Caught by the framework to produce
680
+ * the correct HTTP status code (segment context) or graceful degradation (slot context).
681
+ *
682
+ * Detect with `isDenySignal()`, never `instanceof` — see "Signal branding" in signal-identity.ts.
683
+ */
684
+ var DenySignal = class extends Error {
685
+ [DENY_BRAND] = true;
686
+ status;
687
+ data;
688
+ /**
689
+ * Ordered list of segment keys that own matching deny pages for this
690
+ * signal, best match first. Present = addressed (a boundary should
691
+ * render it); absent = unplaced (the re-render fallback serves it).
692
+ *
693
+ * In-tree hoists stamp a single-element list (`[entry.ownerKey]`) —
694
+ * identical to the pre-TIM-1450 `ownerKey`. Late addressing (TIM-1450)
695
+ * stamps the full candidate list so the client can find the first
696
+ * *reachable* owner via its ancestry context, eliminating the
697
+ * owner-below-throw-site escape.
698
+ *
699
+ * See design/04-authorization.md §"Where a Deny Page Renders", TIM-1356.
700
+ */
701
+ owners;
702
+ /**
703
+ * When true, the pipeline must respond with `rscErrorEnvelope` so the
704
+ * client hard-navigates instead of attempting to render a deny page
705
+ * from the RSC payload. Set by AccessGate when a skipped segment
706
+ * denies — rendering the deny page in-tree would appear inside the
707
+ * client's cached layout chrome (TIM-1074). See TIM-1363.
708
+ */
709
+ _hardNavigate;
710
+ /**
711
+ * When true, no boundary in the tree that threw this may place it: the
712
+ * denying gate guards a segment of the URL's own route that the rendered
713
+ * tree does not contain, so none of its deny pages, nor their layouts, are
714
+ * here. Set by the gate an intercepted navigation renders for each such
715
+ * segment (TIM-1607), together with `_hardNavigate`.
716
+ *
717
+ * Flight's `onError` does not late-address it, and its row carries
718
+ * `leaveSpa`, which every client boundary declines but the terminal, which
719
+ * leaves the SPA — so the document request for the URL renders the URL's
720
+ * own deny page with its real status, wherever the deny lands in time.
721
+ */
722
+ _leaveSpa;
723
+ constructor(status, data) {
724
+ super(`Access denied with status ${status}`);
725
+ this.name = "DenySignal";
726
+ this.status = status;
727
+ this.data = data;
728
+ }
729
+ /**
730
+ * Extract the file that called deny() from the stack trace.
731
+ * Returns a short path (e.g. "app/auth/access.ts") or undefined if
732
+ * the stack can't be parsed. Dev-only — used for dev log output.
733
+ */
734
+ get sourceFile() {
735
+ if (!this.stack) return void 0;
736
+ const frames = this.stack.split("\n");
737
+ for (let i = 2; i < frames.length; i++) {
738
+ const frame = frames[i];
739
+ if (!frame) continue;
740
+ if (frame.includes("primitives.ts") || frame.includes("node_modules")) continue;
741
+ const match = frame.match(/\(([^)]+?)(?::\d+:\d+)\)/) ?? frame.match(/at\s+([^\s]+?)(?::\d+:\d+)/);
742
+ if (match?.[1]) {
743
+ const full = match[1];
744
+ const appIdx = full.indexOf("/app/");
745
+ return appIdx >= 0 ? full.slice(appIdx + 1) : full;
746
+ }
747
+ }
748
+ }
749
+ };
750
+ /**
751
+ * Universal denial/error primitive. Throws a `DenySignal` that the framework catches.
752
+ *
753
+ * - In segment context (outside Suspense): produces HTTP status code
754
+ * - In slot context: graceful degradation → denied.tsx → default.tsx → null
755
+ * - Inside Suspense (hold window): promoted to pre-flush behavior
756
+ * - Inside Suspense (after flush): error boundary + noindex meta
757
+ *
758
+ * ```ts
759
+ * deny() // 403 (default)
760
+ * deny(404) // 404
761
+ * deny(503, { message: 'Maintenance' }) // server-only log message
762
+ * deny(404, { dangerouslyPassData: { resourceId: params.id } }) // explicit client opt-in
763
+ * ```
764
+ *
765
+ * Accepts any 4xx or 5xx status code — it is also how a page renders a 5xx
766
+ * status file with data. An unplanned throw needs no primitive: it renders
767
+ * the error page with a 500.
768
+ *
769
+ * @param status - HTTP status code (4xx or 5xx). Default: 403.
770
+ * @param options - Optional message and/or data to pass to the client.
771
+ */
772
+ function deny(status, options) {
773
+ const resolvedStatus = status ?? 403;
774
+ const resolvedData = options?.dangerouslyPassData;
775
+ if (resolvedStatus < 400 || resolvedStatus > 599) throw new Error(`deny() requires a 4xx or 5xx status code, got ${resolvedStatus}.`);
776
+ warnIfNotSerializable(resolvedData, "deny()");
777
+ throw new DenySignal(resolvedStatus, resolvedData);
778
+ }
779
+ /**
780
+ * Render-phase signal thrown by `redirect()` and `redirectExternal()`.
781
+ * Caught by the framework to produce a 3xx response or client-side navigation.
782
+ *
783
+ * Detect with `isRedirectSignal()`, never `instanceof` — see "Signal branding" in signal-identity.ts.
784
+ */
785
+ var RedirectSignal = class extends Error {
786
+ [REDIRECT_BRAND] = true;
787
+ location;
788
+ status;
789
+ constructor(location, status) {
790
+ super(`Redirect to ${location}`);
791
+ this.name = "RedirectSignal";
792
+ this.location = location;
793
+ this.status = status;
794
+ }
795
+ };
796
+ /**
797
+ * Redirect to a relative path. Rejects absolute and protocol-relative URLs.
798
+ * Use `redirectExternal()` for external redirects with an allow-list.
799
+ *
800
+ * @param path - Relative path (e.g. '/login', 'settings', '/login?returnTo=/dash')
801
+ * @param statusOrOptions - HTTP status code (3xx, default 302) or options object.
802
+ *
803
+ * @example
804
+ * // Simple redirect
805
+ * redirect('/login');
806
+ *
807
+ * // With status code
808
+ * redirect('/login', 301);
809
+ *
810
+ * // With preserved search params
811
+ * redirect(`/docs/${version}/${slug}`, { preserveSearchParams: ['foo'] });
812
+ */
813
+ function redirect(path, statusOrOptions) {
814
+ let status;
815
+ let preserveSearchParams;
816
+ if (typeof statusOrOptions === "number") status = statusOrOptions;
817
+ else if (statusOrOptions) {
818
+ status = statusOrOptions.status ?? (statusOrOptions.permanent ? 308 : 302);
819
+ preserveSearchParams = statusOrOptions.preserveSearchParams;
820
+ } else status = 302;
821
+ if (status < 300 || status > 399) throw new Error(`redirect() requires a 3xx status code, got ${status}.`);
822
+ assertRelativeRedirectPath(path);
823
+ let resolvedPath = path;
824
+ if (preserveSearchParams) {
825
+ const currentSearch = getRequestSearchString();
826
+ resolvedPath = mergePreservedSearchParams(path, currentSearch, preserveSearchParams);
827
+ }
828
+ throw new RedirectSignal(resolvedPath, status);
829
+ }
830
+ /**
831
+ * Redirect to an external URL. The origin must be in the provided allow-list.
832
+ *
833
+ * Only http: and https: schemes are permitted. The allow-list is matched
834
+ * against full origins (scheme + host + port), not bare hostnames.
835
+ *
836
+ * @param url - Absolute URL to redirect to.
837
+ * @param allowList - Array of allowed origins (e.g. ['https://example.com', 'https://auth.example.com']).
838
+ * @param status - HTTP redirect status code (3xx). Defaults to 302.
839
+ */
840
+ function redirectExternal(url, allowList, status = 302) {
841
+ if (status < 300 || status > 399) throw new Error(`redirectExternal() requires a 3xx status code, got ${status}.`);
842
+ throw new RedirectSignal(validateExternalRedirectUrl(url, allowList), status);
843
+ }
844
+ var _waitUntilWarned = false;
845
+ /**
846
+ * Register a promise to be kept alive after the response is sent.
847
+ * Maps to `ctx.waitUntil()` on Cloudflare Workers and similar platforms.
848
+ *
849
+ * The platform adapter installs a per-request waitUntil function via ALS
850
+ * (see waituntil-bridge.ts). If no ALS handler is available, a warning
851
+ * is logged once and the promise is left to resolve (or reject) without
852
+ * being tracked.
853
+ *
854
+ * @param promise - The background work to keep alive.
855
+ */
856
+ function waitUntil(promise) {
857
+ const alsFn = getWaitUntil();
858
+ if (alsFn) {
859
+ alsFn(promise);
860
+ return;
861
+ }
862
+ if (!_waitUntilWarned) {
863
+ _waitUntilWarned = true;
864
+ console.warn("[timber] waitUntil() is not supported by the current adapter. Background work will not be tracked. This warning is shown once.");
865
+ }
866
+ }
867
+ // src/server/form-data.ts
868
+ /**
869
+ * FormData preprocessing — schema-agnostic conversion of FormData to typed objects.
870
+ *
871
+ * FormData is all strings. Schema validation expects typed values. This module
872
+ * bridges the gap with intelligent coercion that runs *before* schema validation.
873
+ *
874
+ * Inspired by zod-form-data, but schema-agnostic — works with any Standard Schema
875
+ * library (Zod, Valibot, ArkType).
876
+ *
877
+ * See design/08-forms-and-actions.md §"parseFormData() and coerce helpers"
878
+ */
879
+ /**
880
+ * Convert FormData into a plain object with intelligent coercion.
881
+ *
882
+ * Handles:
883
+ * - **Duplicate keys → arrays**: `tags=js&tags=ts` → `{ tags: ["js", "ts"] }`
884
+ * - **Nested dot-paths**: `user.name=Alice` → `{ user: { name: "Alice" } }`
885
+ * - **Indexed lists → arrays**: `rows.0.name=A&rows.1.name=B` →
886
+ * `{ rows: [{ name: "A" }, { name: "B" }] }`, when the indexes are exactly
887
+ * `0..n-1`. A list with a gap stays an object keyed by index.
888
+ * - **Empty strings stay `""`**: a blank text input is `""`, so
889
+ * `z.string().min(1, 'Required')` reports its own message. Use
890
+ * `coerce.text` to make a blank optional field `undefined`
891
+ * - **Empty Files → undefined**: File inputs with no selection become `undefined`
892
+ * - **Strips `$ACTION_*` fields**: React's internal hidden fields are excluded
893
+ * - **Drops `__proto__` paths and names deeper than 32 segments**
894
+ *
895
+ * A field's shape follows its count: a name sent once is a scalar, several
896
+ * times an array, never at all absent. A `createActionClient` action with a
897
+ * schema then gives every field the schema declares as a list one shape
898
+ * (`normalizeListFields` in `schema-introspection.ts`). A raw call, and a raw
899
+ * `'use server'` action that calls this itself, keep the count-dependent
900
+ * shape.
901
+ */
902
+ function parseFormData(formData) {
903
+ const flat = {};
904
+ for (const key of new Set(formData.keys())) {
905
+ if (key.startsWith("$ACTION_")) continue;
906
+ if (DANGEROUS_KEYS.has(key)) continue;
907
+ const processed = formData.getAll(key).map(normalizeValue);
908
+ if (processed.length === 1) flat[key] = processed[0];
909
+ else flat[key] = processed.filter((v) => v !== void 0 && v !== "");
910
+ }
911
+ return expandDotPaths(flat);
912
+ }
913
+ /**
914
+ * Normalize a single FormData entry value.
915
+ * - Empty File objects (no selection) → undefined
916
+ * - Strings pass through as-is (empty strings stay as empty strings so
917
+ * schema validators like `z.string().min(1, 'Required')` can produce
918
+ * their custom error messages instead of a generic type mismatch)
919
+ * - Everything else passes through as-is
920
+ */
921
+ function normalizeValue(value) {
922
+ if (value instanceof File && value.size === 0 && value.name === "") return;
923
+ return value;
924
+ }
925
+ /**
926
+ * Expand dot-notation keys into nested objects.
927
+ * `{ "user.name": "Alice", "user.age": "30" }` → `{ user: { name: "Alice", age: "30" } }`
928
+ *
929
+ * Keys without dots are left as-is. Bracket notation (e.g. `items[0]`) is NOT
930
+ * supported — use dot notation (`items.0`) instead.
931
+ */
932
+ function expandDotPaths(flat) {
933
+ const result = {};
934
+ let hasDotPaths = false;
935
+ for (const key of Object.keys(flat)) if (key.includes(".")) {
936
+ hasDotPaths = true;
937
+ break;
938
+ }
939
+ if (!hasDotPaths) return flat;
940
+ for (const [key, value] of Object.entries(flat)) {
941
+ const parts = key.split(".");
942
+ if (parts.some((p) => DANGEROUS_KEYS.has(p))) continue;
943
+ if (parts.length > MAX_PATH_DEPTH) continue;
944
+ if (parts.length === 1) {
945
+ result[parts[0]] = value;
946
+ continue;
947
+ }
948
+ let current = result;
949
+ for (let i = 0; i < parts.length - 1; i++) {
950
+ const part = parts[i];
951
+ if (!isPlainObject(current[part])) current[part] = {};
952
+ current = current[part];
953
+ }
954
+ current[parts[parts.length - 1]] = value;
955
+ }
956
+ for (const [key, value] of Object.entries(result)) if (isPlainObject(value)) result[key] = indexedListsToArrays(value);
957
+ return result;
958
+ }
959
+ /**
960
+ * `node`, with every nested object whose keys are exactly `"0".."n-1"`
961
+ * turned into an array, depth first. Only a dense, canonical index set
962
+ * converts: `{ "0", "2" }` (a gap), `{ "01" }` and `{ "0", "name" }` stay
963
+ * objects. So a forged `rows.99999` stays one key instead of allocating a
964
+ * sparse array, and the array's length is bounded by the field count limit.
965
+ *
966
+ * Object.keys lists integer-like keys first, in ascending order, so a dense
967
+ * set reads as `0, 1, … n-1` and `Object.values` is already in index order.
968
+ */
969
+ function indexedListsToArrays(node) {
970
+ for (const [key, value] of Object.entries(node)) if (isPlainObject(value)) node[key] = indexedListsToArrays(value);
971
+ const keys = Object.keys(node);
972
+ return keys.length > 0 && keys.every((key, i) => key === String(i)) ? Object.values(node) : node;
973
+ }
974
+ /** An object the dot-path walk built — not an array, File or other instance. */
975
+ function isPlainObject(value) {
976
+ return typeof value === "object" && value !== null && Object.getPrototypeOf(value) === Object.prototype;
977
+ }
978
+ var DANGEROUS_KEYS = /* @__PURE__ */ new Set(["__proto__"]);
979
+ /**
980
+ * The most segments a dot-path field name may have. A deeper name is dropped,
981
+ * like a `__proto__` path, so no walk over the parsed value can exhaust the
982
+ * stack (TIM-1573).
983
+ */
984
+ var MAX_PATH_DEPTH = 32;
985
+ /**
986
+ * Schema-agnostic coercion primitives for common FormData patterns.
987
+ *
988
+ * These are plain transform functions — they compose with any schema library's
989
+ * `transform`/`preprocess` pipeline. In Zod, use `z.preprocess`: it runs on an
990
+ * absent key (an unchecked checkbox), where `z.unknown().transform()` fails
991
+ * with "expected nonoptional" before the transform runs.
992
+ *
993
+ * ```ts
994
+ * // Zod
995
+ * z.preprocess(coerce.number, z.number())
996
+ * // Valibot
997
+ * v.pipe(v.unknown(), v.transform(coerce.number), v.number())
998
+ * ```
999
+ */
1000
+ var coerce = {
1001
+ /**
1002
+ * Coerce an empty string to undefined for optional text fields.
1003
+ * Use with `.optional()` schemas where an empty input means "not provided".
1004
+ *
1005
+ * ```ts
1006
+ * // Zod — preprocess, not `z.unknown().transform(…)`: Zod 4 rejects an
1007
+ * // absent key before a transform runs ("expected nonoptional")
1008
+ * z.preprocess(coerce.text, z.string().optional())
1009
+ * // Valibot
1010
+ * v.pipe(v.unknown(), v.transform(coerce.text), v.optional(v.string()))
1011
+ * ```
1012
+ */
1013
+ text(value) {
1014
+ if (value === void 0 || value === null || value === "") return void 0;
1015
+ if (typeof value === "string") return value;
1016
+ },
1017
+ /**
1018
+ * Coerce a string to a number.
1019
+ * - `"42"` → `42`
1020
+ * - `"3.14"` → `3.14`
1021
+ * - `""` / `undefined` / `null` → `undefined`
1022
+ * - Non-numeric strings → `undefined` (schema validation will catch this)
1023
+ */
1024
+ number(value) {
1025
+ if (value === void 0 || value === null || value === "") return void 0;
1026
+ if (typeof value === "number") return value;
1027
+ if (typeof value !== "string") return void 0;
1028
+ const num = Number(value);
1029
+ if (Number.isNaN(num)) return void 0;
1030
+ return num;
1031
+ },
1032
+ /**
1033
+ * Coerce a checkbox value to a boolean.
1034
+ * HTML checkboxes submit "on" when checked and are absent when unchecked.
1035
+ * - `"on"` / any truthy string → `true`
1036
+ * - `undefined` / `null` / `""` → `false`
1037
+ */
1038
+ checkbox(value) {
1039
+ if (value === void 0 || value === null || value === "") return false;
1040
+ if (typeof value === "boolean") return value;
1041
+ return typeof value === "string" && value.length > 0;
1042
+ },
1043
+ /**
1044
+ * Parse a JSON string into an object.
1045
+ * - Valid JSON string → parsed object
1046
+ * - `""` / `undefined` / `null` → `undefined`
1047
+ * - Invalid JSON → `undefined` (schema validation will catch this)
1048
+ */
1049
+ json(value) {
1050
+ if (value === void 0 || value === null || value === "") return void 0;
1051
+ if (typeof value !== "string") return value;
1052
+ try {
1053
+ return JSON.parse(value);
1054
+ } catch {
1055
+ return;
1056
+ }
1057
+ },
1058
+ /**
1059
+ * Coerce a date string to a Date object.
1060
+ * Handles `<input type="date">` (`"2024-01-15"`), `<input type="datetime-local">`
1061
+ * (`"2024-01-15T10:30"`), and full ISO 8601 strings.
1062
+ * - Valid date string → `Date`
1063
+ * - `""` / `undefined` / `null` → `undefined`
1064
+ * - Invalid date strings → `undefined` (schema validation will catch this)
1065
+ * - Impossible dates that `new Date()` silently normalizes (e.g. Feb 31) → `undefined`
1066
+ */
1067
+ date(value) {
1068
+ if (value === void 0 || value === null || value === "") return void 0;
1069
+ if (value instanceof Date) return value;
1070
+ if (typeof value !== "string") return void 0;
1071
+ const date = new Date(value);
1072
+ if (Number.isNaN(date.getTime())) return void 0;
1073
+ const ymdMatch = value.match(/^(\d{4})-(\d{2})-(\d{2})/);
1074
+ if (ymdMatch) {
1075
+ const inputYear = Number(ymdMatch[1]);
1076
+ const inputMonth = Number(ymdMatch[2]);
1077
+ const inputDay = Number(ymdMatch[3]);
1078
+ const isUTC = value.length === 10 || value.endsWith("Z");
1079
+ const parsedYear = isUTC ? date.getUTCFullYear() : date.getFullYear();
1080
+ const parsedMonth = isUTC ? date.getUTCMonth() + 1 : date.getMonth() + 1;
1081
+ const parsedDay = isUTC ? date.getUTCDate() : date.getDate();
1082
+ if (inputYear !== parsedYear || inputMonth !== parsedMonth || inputDay !== parsedDay) return;
1083
+ }
1084
+ return date;
1085
+ },
1086
+ /**
1087
+ * Create a File coercion function with optional size and mime type validation.
1088
+ * Returns the File if valid, `undefined` otherwise.
1089
+ *
1090
+ * ```ts
1091
+ * // Basic — just checks it's a real File
1092
+ * z.preprocess(coerce.file(), z.instanceof(File))
1093
+ *
1094
+ * // With constraints
1095
+ * z.preprocess(
1096
+ * coerce.file({ maxSize: 5 * 1024 * 1024, accept: ['image/png', 'image/jpeg'] }),
1097
+ * z.instanceof(File)
1098
+ * )
1099
+ * ```
1100
+ */
1101
+ file(options) {
1102
+ return (value) => {
1103
+ if (value === void 0 || value === null || value === "") return void 0;
1104
+ if (!(value instanceof File)) return void 0;
1105
+ if (value.size === 0 && value.name === "") return void 0;
1106
+ if (options?.maxSize !== void 0 && value.size > options.maxSize) return;
1107
+ if (options?.accept !== void 0 && !options.accept.includes(value.type)) return;
1108
+ return value;
1109
+ };
1110
+ }
1111
+ };
1112
+ // src/server/actions.ts
1113
+ /**
1114
+ * Server action primitives: revalidatePath, revalidateTag, and the action handler.
1115
+ *
1116
+ * - revalidatePath(path) re-renders the route at that path and returns the RSC
1117
+ * flight payload for inline reconciliation. Server actions only.
1118
+ * - revalidateTag(tag) invalidates timber.cache entries by tag. Callable from
1119
+ * any server code: deferred to the end of the action inside one, immediate
1120
+ * anywhere else.
1121
+ *
1122
+ * The action handler processes incoming action requests, validates CSRF,
1123
+ * enforces body limits, executes the action, and returns the response
1124
+ * (with piggybacked RSC payload if revalidatePath was called).
1125
+ *
1126
+ * See design/08-forms-and-actions.md
1127
+ */
1128
+ /**
1129
+ * Thrown by a `RevalidateRenderer` that decided not to render: the path
1130
+ * was rejected, its params failed coercion, or its middleware answered
1131
+ * with a `Response` that cannot become an element tree. `executeAction`
1132
+ * drops the revalidation — the action result is still delivered, with no
1133
+ * `_tree` piggybacked — and, because the drop was a decision, does not
1134
+ * return it as an error to report. Identified by `instanceof`, so the
1135
+ * message text never reaches clients.
1136
+ */
1137
+ var RevalidationDropped = class extends Error {
1138
+ constructor(message) {
1139
+ super(message);
1140
+ this.name = "RevalidationDropped";
1141
+ }
1142
+ };
1143
+ /**
1144
+ * Re-render the route at `path` and include the RSC flight payload in the
1145
+ * action response. The client reconciles inline — no separate fetch needed.
1146
+ *
1147
+ * Only callable inside a server action: it attaches a render to the action
1148
+ * response, and nothing else has one. To refresh cached data from a
1149
+ * `route.ts` handler, a webhook, or a job, use `revalidateTag()` or
1150
+ * `cache.invalidate()`.
1151
+ *
1152
+ * @param path - The path to re-render (e.g. '/dashboard', '/todos').
1153
+ */
1154
+ function revalidatePath(path) {
1155
+ const state = revalidationAls.getStore();
1156
+ if (!state || state.closed) throw new Error("revalidatePath() can only be called inside a server action: it re-renders the route into the action response, and there is no action response here. To refresh cached data from a route handler or other server code, call revalidateTag() or cache.invalidate() for the tags the route reads.");
1157
+ if (!state.paths.includes(path)) state.paths.push(path);
1158
+ }
1159
+ /**
1160
+ * Invalidate all timber.cache entries tagged with `tag`, and tombstone the
1161
+ * pre-rendered component seeds that carry it.
1162
+ * Does not return a payload — the next request for an invalidated entry re-executes.
1163
+ *
1164
+ * Callable from any server code. Inside a server action the invalidation is
1165
+ * deferred until the action body returns, so a `revalidatePath()` render in
1166
+ * the same action reads fresh data; the returned promise resolves at once.
1167
+ * Anywhere else — a `route.ts` webhook, a job, or background work an action
1168
+ * started that runs after the action body returned — it is
1169
+ * `cache.invalidate({ tag })`, and the promise settles when the invalidation
1170
+ * has. Await it before responding.
1171
+ *
1172
+ * @param tag - The cache tag to invalidate (e.g. 'products', 'user:123').
1173
+ */
1174
+ function revalidateTag(tag) {
1175
+ const state = revalidationAls.getStore();
1176
+ if (!state || state.closed) return cache.invalidate({ tag });
1177
+ if (!state.tags.includes(tag)) state.tags.push(tag);
1178
+ return Promise.resolve();
1179
+ }
1180
+ /**
1181
+ * Execute a server action and process revalidation.
1182
+ *
1183
+ * 1. Sets up revalidation state
1184
+ * 2. Calls the action function
1185
+ * 3. Processes revalidateTag calls (invalidates cache entries)
1186
+ * 4. Processes revalidatePath calls (re-renders and captures RSC payload)
1187
+ * 5. Returns the action result + optional RSC payload
1188
+ *
1189
+ * @param actionFn - The server action function to execute.
1190
+ * @param args - Arguments to pass to the action.
1191
+ * @param config - Handler configuration (cache handler, renderer).
1192
+ */
1193
+ async function executeAction(actionFn, args, config = {}, spanMeta) {
1194
+ const state = {
1195
+ paths: [],
1196
+ tags: []
1197
+ };
1198
+ const revalidationErrors = [];
1199
+ let actionResult;
1200
+ let redirectTo;
1201
+ let redirectStatus;
1202
+ await revalidationAls.run(state, async () => {
1203
+ try {
1204
+ actionResult = await withSpan("timber.action", {
1205
+ ...spanMeta?.actionFile ? { "timber.action_file": spanMeta.actionFile } : {},
1206
+ ...spanMeta?.actionName ? { "timber.action_name": spanMeta.actionName } : {}
1207
+ }, () => actionFn(...args));
1208
+ } catch (error) {
1209
+ if (isRedirectSignal(error)) {
1210
+ redirectTo = error.location;
1211
+ redirectStatus = error.status;
1212
+ } else throw error;
1213
+ } finally {
1214
+ state.closed = true;
1215
+ }
1216
+ });
1217
+ if (state.tags.length > 0) {
1218
+ const results = await Promise.allSettled(state.tags.map((tag) => cache.invalidate({ tag })));
1219
+ for (const r of results) if (r.status === "rejected") {
1220
+ console.error("[timber] revalidateTag invalidation failed:", r.reason);
1221
+ revalidationErrors.push(r.reason);
1222
+ }
1223
+ }
1224
+ let revalidation;
1225
+ const { requestPathname, requestSearch } = config;
1226
+ const isCurrentPage = (path) => !requestPathname || revalidationPathMatches(path, requestPathname, requestSearch);
1227
+ const path = state.paths.find(isCurrentPage);
1228
+ const onlyOtherPagesNamed = state.paths.length > 0 && path === void 0;
1229
+ if (path !== void 0 && config.renderer) try {
1230
+ revalidation = await config.renderer(path);
1231
+ } catch (renderError) {
1232
+ if (isRedirectSignal(renderError)) {
1233
+ redirectTo = renderError.location;
1234
+ redirectStatus = renderError.status;
1235
+ } else if (isDenySignal(renderError)) console.error(`[timber] revalidatePath dropped — target middleware denied (status ${renderError.status})`);
1236
+ else if (renderError instanceof RevalidationDropped) console.error(`[timber] ${renderError.message}`);
1237
+ else {
1238
+ console.error("[timber] revalidatePath render failed:", renderError);
1239
+ revalidationErrors.push(renderError);
1240
+ }
1241
+ }
1242
+ return {
1243
+ actionResult,
1244
+ revalidation,
1245
+ onlyOtherPagesNamed,
1246
+ revalidationErrors,
1247
+ ...redirectTo ? {
1248
+ redirectTo,
1249
+ redirectStatus
1250
+ } : {}
1251
+ };
1252
+ }
1253
+ /**
1254
+ * Check if a `revalidatePath(path)` argument matches the request pathname.
1255
+ * Canonicalizes the revalidated path the same way the renderer does so
1256
+ * equivalent paths compare equal. Returns true when the paths match or
1257
+ * when comparison is inconclusive (validation failure → render to be safe).
1258
+ */
1259
+ function revalidationPathMatches(revalidatedPath, requestPathname, requestSearch) {
1260
+ const hashIdx = revalidatedPath.indexOf("#");
1261
+ const noFragment = hashIdx >= 0 ? revalidatedPath.slice(0, hashIdx) : revalidatedPath;
1262
+ const queryIdx = noFragment.indexOf("?");
1263
+ const pathnameOnly = queryIdx >= 0 ? noFragment.slice(0, queryIdx) : noFragment;
1264
+ const search = queryIdx >= 0 ? noFragment.slice(queryIdx) : "";
1265
+ const canonical = canonicalize(pathnameOnly, true);
1266
+ if (!canonical.ok) return true;
1267
+ if (canonical.pathname !== requestPathname) return false;
1268
+ if (search && search !== (requestSearch ?? "")) return false;
1269
+ return true;
1270
+ }
1271
+ export { setMatchedSegmentPath as C, runOutsideReactCacheScope as E, runWithSegmentParams as S, setSegmentParams as T, getHeaders as _, parseFormData as a, markResponseFlushed as b, deny as c, waitUntil as d, getCookie as f, getHeader as g, applyRequestHeaderOverlay as h, coerce as i, redirect as l, getSetCookieHeaders as m, revalidatePath as n, DenySignal as o, getCookieJar as p, revalidateTag as r, RedirectSignal as s, executeAction as t, redirectExternal as u, getSearchParams as v, setMutableCookieContext as w, runWithRequestContext as x, getSegmentParams as y };
1272
+
1273
+ //# sourceMappingURL=actions-CYjRMpZI.js.map