@timber-js/app 0.2.0-alpha.19 → 0.2.0-alpha.190

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 (1192) hide show
  1. package/LICENSE +8 -0
  2. package/agent-skill.md +344 -0
  3. package/dist/_chunks/actions-35jnMdeJ.js +318 -0
  4. package/dist/_chunks/actions-35jnMdeJ.js.map +1 -0
  5. package/dist/_chunks/als-registry-C6kcfprT.js +41 -0
  6. package/dist/_chunks/als-registry-C6kcfprT.js.map +1 -0
  7. package/dist/_chunks/als-slots-BEEIPKYm.js +26 -0
  8. package/dist/_chunks/als-slots-BEEIPKYm.js.map +1 -0
  9. package/dist/_chunks/base-path-DaQrzbez.js +80 -0
  10. package/dist/_chunks/base-path-DaQrzbez.js.map +1 -0
  11. package/dist/_chunks/build-manifest-DWppEdLB.js +86 -0
  12. package/dist/_chunks/build-manifest-DWppEdLB.js.map +1 -0
  13. package/dist/_chunks/build-output-helper-C3DrfzZR.js +369 -0
  14. package/dist/_chunks/build-output-helper-C3DrfzZR.js.map +1 -0
  15. package/dist/_chunks/cache-api-DjNrIWRR.js +1196 -0
  16. package/dist/_chunks/cache-api-DjNrIWRR.js.map +1 -0
  17. package/dist/_chunks/cli-check-CpmN7Nh-.js +256 -0
  18. package/dist/_chunks/cli-check-CpmN7Nh-.js.map +1 -0
  19. package/dist/_chunks/cli-schema-sync-CGMp_Psg.js +298 -0
  20. package/dist/_chunks/cli-schema-sync-CGMp_Psg.js.map +1 -0
  21. package/dist/_chunks/cloudflare-CGP6BZKO.js +1284 -0
  22. package/dist/_chunks/cloudflare-CGP6BZKO.js.map +1 -0
  23. package/dist/_chunks/codec-registry-oOUxugz3.js +21 -0
  24. package/dist/_chunks/codec-registry-oOUxugz3.js.map +1 -0
  25. package/dist/_chunks/convention-lint-kXsgc_-7.js +784 -0
  26. package/dist/_chunks/convention-lint-kXsgc_-7.js.map +1 -0
  27. package/dist/_chunks/dist-BA3u1z3W.js +423 -0
  28. package/dist/_chunks/dist-BA3u1z3W.js.map +1 -0
  29. package/dist/_chunks/error-boundary-D-ODYX41.js +353 -0
  30. package/dist/_chunks/error-boundary-D-ODYX41.js.map +1 -0
  31. package/dist/_chunks/fast-hash-C-tVYrLb.js +41 -0
  32. package/dist/_chunks/fast-hash-C-tVYrLb.js.map +1 -0
  33. package/dist/_chunks/file-cache-DmX7OqZP.js +454 -0
  34. package/dist/_chunks/file-cache-DmX7OqZP.js.map +1 -0
  35. package/dist/_chunks/format-CfwjgPz9.js +14 -0
  36. package/dist/_chunks/format-CfwjgPz9.js.map +1 -0
  37. package/dist/_chunks/fs-identity-D7vb6GdI.js +208 -0
  38. package/dist/_chunks/fs-identity-D7vb6GdI.js.map +1 -0
  39. package/dist/_chunks/href-validation-CMc5JRls.js +141 -0
  40. package/dist/_chunks/href-validation-CMc5JRls.js.map +1 -0
  41. package/dist/_chunks/json-lossy-check-ClNvBM_3.js +63 -0
  42. package/dist/_chunks/json-lossy-check-ClNvBM_3.js.map +1 -0
  43. package/dist/_chunks/logger-D8xJZXIN.js +1451 -0
  44. package/dist/_chunks/logger-D8xJZXIN.js.map +1 -0
  45. package/dist/_chunks/mdx-file-C005ay-P.js +25 -0
  46. package/dist/_chunks/mdx-file-C005ay-P.js.map +1 -0
  47. package/dist/_chunks/plugin-context-rCinWLiE.js +321 -0
  48. package/dist/_chunks/plugin-context-rCinWLiE.js.map +1 -0
  49. package/dist/_chunks/purge-store-Byr8XOjU.js +14 -0
  50. package/dist/_chunks/purge-store-Byr8XOjU.js.map +1 -0
  51. package/dist/_chunks/resolve-schema-CBR6Lm4i.js +50 -0
  52. package/dist/_chunks/resolve-schema-CBR6Lm4i.js.map +1 -0
  53. package/dist/_chunks/router-ref-DuYuV_0Q.js +28 -0
  54. package/dist/_chunks/router-ref-DuYuV_0Q.js.map +1 -0
  55. package/dist/_chunks/rsc-cache-key-DD0fl_-s.js +243 -0
  56. package/dist/_chunks/rsc-cache-key-DD0fl_-s.js.map +1 -0
  57. package/dist/_chunks/rsc-error-envelope-tT5PJs4q.js +40 -0
  58. package/dist/_chunks/rsc-error-envelope-tT5PJs4q.js.map +1 -0
  59. package/dist/_chunks/rsc-media-type-DRqE_lD_.js +46 -0
  60. package/dist/_chunks/rsc-media-type-DRqE_lD_.js.map +1 -0
  61. package/dist/_chunks/rsc-payload-path-B_LBodc2.js +48 -0
  62. package/dist/_chunks/rsc-payload-path-B_LBodc2.js.map +1 -0
  63. package/dist/_chunks/scanner-C8b0Gcw3.js +1564 -0
  64. package/dist/_chunks/scanner-C8b0Gcw3.js.map +1 -0
  65. package/dist/_chunks/schema-bridge-C83xa9lT.js +199 -0
  66. package/dist/_chunks/schema-bridge-C83xa9lT.js.map +1 -0
  67. package/dist/_chunks/segment-classify-C539Pa2O.js +197 -0
  68. package/dist/_chunks/segment-classify-C539Pa2O.js.map +1 -0
  69. package/dist/_chunks/segment-context-CjOlyB8Y.js +97 -0
  70. package/dist/_chunks/segment-context-CjOlyB8Y.js.map +1 -0
  71. package/dist/_chunks/segment-keys-BawYuNFO.js +307 -0
  72. package/dist/_chunks/segment-keys-BawYuNFO.js.map +1 -0
  73. package/dist/_chunks/sizeof-lXffQ1Vr.js +35 -0
  74. package/dist/_chunks/sizeof-lXffQ1Vr.js.map +1 -0
  75. package/dist/_chunks/slot-params-BCTmZkQB.js +76 -0
  76. package/dist/_chunks/slot-params-BCTmZkQB.js.map +1 -0
  77. package/dist/_chunks/{ssr-data-MjmprTmO.js → ssr-data-14MXm7Pj.js} +17 -2
  78. package/dist/_chunks/ssr-data-14MXm7Pj.js.map +1 -0
  79. package/dist/_chunks/use-query-states-I3JMng6J.js +226 -0
  80. package/dist/_chunks/use-query-states-I3JMng6J.js.map +1 -0
  81. package/dist/_chunks/use-segment-params-C4r4BD9T.js +398 -0
  82. package/dist/_chunks/use-segment-params-C4r4BD9T.js.map +1 -0
  83. package/dist/_chunks/walkers-RzN6AFjr.js +141 -0
  84. package/dist/_chunks/walkers-RzN6AFjr.js.map +1 -0
  85. package/dist/adapters/build-output-helper.d.ts +72 -0
  86. package/dist/adapters/build-output-helper.d.ts.map +1 -0
  87. package/dist/adapters/cloudflare-dev.d.ts +109 -0
  88. package/dist/adapters/cloudflare-dev.d.ts.map +1 -0
  89. package/dist/adapters/cloudflare-dev.js +73 -0
  90. package/dist/adapters/cloudflare-dev.js.map +1 -0
  91. package/dist/adapters/cloudflare-kv-cache.d.ts +65 -0
  92. package/dist/adapters/cloudflare-kv-cache.d.ts.map +1 -0
  93. package/dist/adapters/cloudflare-kv-cache.js +124 -0
  94. package/dist/adapters/cloudflare-kv-cache.js.map +1 -0
  95. package/dist/adapters/cloudflare.d.ts +199 -21
  96. package/dist/adapters/cloudflare.d.ts.map +1 -1
  97. package/dist/adapters/cloudflare.js +2 -188
  98. package/dist/adapters/compress-module.d.ts +17 -4
  99. package/dist/adapters/compress-module.d.ts.map +1 -1
  100. package/dist/adapters/fs-identity.d.ts +64 -0
  101. package/dist/adapters/fs-identity.d.ts.map +1 -0
  102. package/dist/adapters/nitro.d.ts +55 -3
  103. package/dist/adapters/nitro.d.ts.map +1 -1
  104. package/dist/adapters/nitro.js +287 -171
  105. package/dist/adapters/nitro.js.map +1 -1
  106. package/dist/adapters/shared.d.ts +62 -0
  107. package/dist/adapters/shared.d.ts.map +1 -0
  108. package/dist/adapters/types.d.ts +28 -6
  109. package/dist/adapters/types.d.ts.map +1 -1
  110. package/dist/cache/cache-api.d.ts +48 -0
  111. package/dist/cache/cache-api.d.ts.map +1 -0
  112. package/dist/cache/fast-hash.d.ts +5 -0
  113. package/dist/cache/fast-hash.d.ts.map +1 -1
  114. package/dist/cache/handler-store.d.ts +33 -0
  115. package/dist/cache/handler-store.d.ts.map +1 -0
  116. package/dist/cache/index.d.ts +31 -8
  117. package/dist/cache/index.d.ts.map +1 -1
  118. package/dist/cache/index.js +3 -326
  119. package/dist/cache/invalidation-epoch.d.ts +43 -0
  120. package/dist/cache/invalidation-epoch.d.ts.map +1 -0
  121. package/dist/cache/json-lossy-check.d.ts +11 -0
  122. package/dist/cache/json-lossy-check.d.ts.map +1 -0
  123. package/dist/cache/redis-handler.d.ts +140 -8
  124. package/dist/cache/redis-handler.d.ts.map +1 -1
  125. package/dist/cache/singleflight.d.ts +19 -2
  126. package/dist/cache/singleflight.d.ts.map +1 -1
  127. package/dist/cache/sizeof.d.ts +22 -0
  128. package/dist/cache/sizeof.d.ts.map +1 -0
  129. package/dist/cache/stable-stringify.d.ts +9 -0
  130. package/dist/cache/stable-stringify.d.ts.map +1 -1
  131. package/dist/cache/store.d.ts +53 -0
  132. package/dist/cache/store.d.ts.map +1 -0
  133. package/dist/cache/stores/cloudflare-kv.d.ts +38 -0
  134. package/dist/cache/stores/cloudflare-kv.d.ts.map +1 -0
  135. package/dist/cache/stores/cloudflare-kv.js +29 -0
  136. package/dist/cache/stores/cloudflare-kv.js.map +1 -0
  137. package/dist/cache/stores/memory.d.ts +42 -0
  138. package/dist/cache/stores/memory.d.ts.map +1 -0
  139. package/dist/cache/stores/memory.js +90 -0
  140. package/dist/cache/stores/memory.js.map +1 -0
  141. package/dist/cache/stores/redis.d.ts +69 -0
  142. package/dist/cache/stores/redis.d.ts.map +1 -0
  143. package/dist/cache/stores/redis.js +35 -0
  144. package/dist/cache/stores/redis.js.map +1 -0
  145. package/dist/cache/stores/vercel.d.ts +36 -0
  146. package/dist/cache/stores/vercel.d.ts.map +1 -0
  147. package/dist/cache/stores/vercel.js +33 -0
  148. package/dist/cache/stores/vercel.js.map +1 -0
  149. package/dist/cache/tag-aware-handler.d.ts +52 -0
  150. package/dist/cache/tag-aware-handler.d.ts.map +1 -0
  151. package/dist/cache/timber-cache.d.ts +20 -10
  152. package/dist/cache/timber-cache.d.ts.map +1 -1
  153. package/dist/cdn/cloudflare-purge.d.ts +23 -0
  154. package/dist/cdn/cloudflare-purge.d.ts.map +1 -0
  155. package/dist/cdn/cloudflare-purge.js +30 -0
  156. package/dist/cdn/cloudflare-purge.js.map +1 -0
  157. package/dist/cdn/fastly-purge.d.ts +25 -0
  158. package/dist/cdn/fastly-purge.d.ts.map +1 -0
  159. package/dist/cdn/fastly-purge.js +33 -0
  160. package/dist/cdn/fastly-purge.js.map +1 -0
  161. package/dist/cdn/headers.d.ts +97 -0
  162. package/dist/cdn/headers.d.ts.map +1 -0
  163. package/dist/cdn/index.d.ts +5 -0
  164. package/dist/cdn/index.d.ts.map +1 -0
  165. package/dist/cdn/index.js +94 -0
  166. package/dist/cdn/index.js.map +1 -0
  167. package/dist/cdn/purge-store.d.ts +23 -0
  168. package/dist/cdn/purge-store.d.ts.map +1 -0
  169. package/dist/cdn/workers-cache-purge.d.ts +16 -0
  170. package/dist/cdn/workers-cache-purge.d.ts.map +1 -0
  171. package/dist/cdn/workers-cache-purge.js +35 -0
  172. package/dist/cdn/workers-cache-purge.js.map +1 -0
  173. package/dist/cli-check.d.ts +153 -0
  174. package/dist/cli-check.d.ts.map +1 -0
  175. package/dist/cli-schema-sync.d.ts +59 -0
  176. package/dist/cli-schema-sync.d.ts.map +1 -0
  177. package/dist/cli.d.ts +66 -7
  178. package/dist/cli.d.ts.map +1 -1
  179. package/dist/cli.js +151 -47
  180. package/dist/cli.js.map +1 -1
  181. package/dist/client/browser-dev.d.ts +37 -1
  182. package/dist/client/browser-dev.d.ts.map +1 -1
  183. package/dist/client/browser-entry/action-dispatch.d.ts +17 -0
  184. package/dist/client/browser-entry/action-dispatch.d.ts.map +1 -0
  185. package/dist/client/browser-entry/hmr.d.ts +21 -0
  186. package/dist/client/browser-entry/hmr.d.ts.map +1 -0
  187. package/dist/client/browser-entry/hydrate.d.ts +57 -0
  188. package/dist/client/browser-entry/hydrate.d.ts.map +1 -0
  189. package/dist/client/browser-entry/index.d.ts +29 -0
  190. package/dist/client/browser-entry/index.d.ts.map +1 -0
  191. package/dist/client/browser-entry/post-hydration.d.ts +29 -0
  192. package/dist/client/browser-entry/post-hydration.d.ts.map +1 -0
  193. package/dist/client/browser-entry/router-init.d.ts +30 -0
  194. package/dist/client/browser-entry/router-init.d.ts.map +1 -0
  195. package/dist/client/browser-entry/rsc-stream.d.ts +32 -0
  196. package/dist/client/browser-entry/rsc-stream.d.ts.map +1 -0
  197. package/dist/client/browser-entry/scroll.d.ts +28 -0
  198. package/dist/client/browser-entry/scroll.d.ts.map +1 -0
  199. package/dist/client/error-boundary.d.ts +19 -5
  200. package/dist/client/error-boundary.d.ts.map +1 -1
  201. package/dist/client/error-boundary.js +1 -125
  202. package/dist/client/error-reconstituter.d.ts +61 -0
  203. package/dist/client/error-reconstituter.d.ts.map +1 -0
  204. package/dist/client/form.d.ts +16 -27
  205. package/dist/client/form.d.ts.map +1 -1
  206. package/dist/client/history.d.ts +29 -7
  207. package/dist/client/history.d.ts.map +1 -1
  208. package/dist/client/index.d.ts +11 -24
  209. package/dist/client/index.d.ts.map +1 -1
  210. package/dist/client/index.js +186 -1134
  211. package/dist/client/index.js.map +1 -1
  212. package/dist/client/internal.d.ts +20 -0
  213. package/dist/client/internal.d.ts.map +1 -0
  214. package/dist/client/internal.js +1624 -0
  215. package/dist/client/internal.js.map +1 -0
  216. package/dist/client/link.d.ts +63 -60
  217. package/dist/client/link.d.ts.map +1 -1
  218. package/dist/client/navigation-api.d.ts +121 -0
  219. package/dist/client/navigation-api.d.ts.map +1 -0
  220. package/dist/client/navigation-commit.d.ts +87 -0
  221. package/dist/client/navigation-commit.d.ts.map +1 -0
  222. package/dist/client/navigation-context.d.ts +38 -20
  223. package/dist/client/navigation-context.d.ts.map +1 -1
  224. package/dist/client/navigation-root.d.ts +159 -0
  225. package/dist/client/navigation-root.d.ts.map +1 -0
  226. package/dist/client/nuqs-adapter.d.ts +1 -1
  227. package/dist/client/nuqs-adapter.d.ts.map +1 -1
  228. package/dist/client/params-context.d.ts +81 -0
  229. package/dist/client/params-context.d.ts.map +1 -0
  230. package/dist/client/router-effects.d.ts +129 -0
  231. package/dist/client/router-effects.d.ts.map +1 -0
  232. package/dist/client/router-lifecycle.d.ts +55 -0
  233. package/dist/client/router-lifecycle.d.ts.map +1 -0
  234. package/dist/client/router-pipeline.d.ts +84 -0
  235. package/dist/client/router-pipeline.d.ts.map +1 -0
  236. package/dist/client/router-ref.d.ts +2 -2
  237. package/dist/client/router-ref.d.ts.map +1 -1
  238. package/dist/client/router-skew.d.ts +21 -0
  239. package/dist/client/router-skew.d.ts.map +1 -0
  240. package/dist/client/router-types.d.ts +207 -0
  241. package/dist/client/router-types.d.ts.map +1 -0
  242. package/dist/client/router.d.ts +1 -97
  243. package/dist/client/router.d.ts.map +1 -1
  244. package/dist/client/rsc-fetch.d.ts +113 -26
  245. package/dist/client/rsc-fetch.d.ts.map +1 -1
  246. package/dist/client/segment-cache.d.ts +107 -25
  247. package/dist/client/segment-cache.d.ts.map +1 -1
  248. package/dist/client/segment-outlet.d.ts +57 -0
  249. package/dist/client/segment-outlet.d.ts.map +1 -0
  250. package/dist/client/segment-update-context.d.ts +21 -0
  251. package/dist/client/segment-update-context.d.ts.map +1 -0
  252. package/dist/client/shallow-url.d.ts +10 -0
  253. package/dist/client/shallow-url.d.ts.map +1 -0
  254. package/dist/client/slot-context.d.ts +31 -0
  255. package/dist/client/slot-context.d.ts.map +1 -0
  256. package/dist/client/slot-outlet.d.ts +16 -0
  257. package/dist/client/slot-outlet.d.ts.map +1 -0
  258. package/dist/client/slot-provider.d.ts +25 -0
  259. package/dist/client/slot-provider.d.ts.map +1 -0
  260. package/dist/client/ssr-data.d.ts +19 -4
  261. package/dist/client/ssr-data.d.ts.map +1 -1
  262. package/dist/client/stale-client.d.ts +69 -0
  263. package/dist/client/stale-client.d.ts.map +1 -0
  264. package/dist/client/state.d.ts +11 -2
  265. package/dist/client/state.d.ts.map +1 -1
  266. package/dist/client/top-loader.d.ts +7 -6
  267. package/dist/client/top-loader.d.ts.map +1 -1
  268. package/dist/client/unload-guard.d.ts +5 -0
  269. package/dist/client/unload-guard.d.ts.map +1 -1
  270. package/dist/client/use-cookie.d.ts +12 -0
  271. package/dist/client/use-cookie.d.ts.map +1 -1
  272. package/dist/client/use-link-status.d.ts +5 -5
  273. package/dist/client/use-link-status.d.ts.map +1 -1
  274. package/dist/client/use-pathname.d.ts.map +1 -1
  275. package/dist/client/use-pending-navigation.d.ts +23 -0
  276. package/dist/client/use-pending-navigation.d.ts.map +1 -0
  277. package/dist/client/use-query-states.d.ts +10 -4
  278. package/dist/client/use-query-states.d.ts.map +1 -1
  279. package/dist/client/use-router.d.ts +2 -2
  280. package/dist/client/use-router.d.ts.map +1 -1
  281. package/dist/client/use-search-params.d.ts +12 -5
  282. package/dist/client/use-search-params.d.ts.map +1 -1
  283. package/dist/client/{use-params.d.ts → use-segment-params.d.ts} +26 -14
  284. package/dist/client/use-segment-params.d.ts.map +1 -0
  285. package/dist/codec.d.ts +69 -0
  286. package/dist/codec.d.ts.map +1 -0
  287. package/dist/codec.js +76 -0
  288. package/dist/codec.js.map +1 -0
  289. package/dist/config-types.d.ts +284 -0
  290. package/dist/config-types.d.ts.map +1 -0
  291. package/dist/config-validation.d.ts +51 -0
  292. package/dist/config-validation.d.ts.map +1 -0
  293. package/dist/content/index.d.ts +1 -10
  294. package/dist/content/index.d.ts.map +1 -1
  295. package/dist/content/index.js +0 -2
  296. package/dist/cookies/define-cookie.d.ts +58 -25
  297. package/dist/cookies/define-cookie.d.ts.map +1 -1
  298. package/dist/cookies/index.d.ts +2 -1
  299. package/dist/cookies/index.d.ts.map +1 -1
  300. package/dist/cookies/index.js +257 -36
  301. package/dist/cookies/index.js.map +1 -1
  302. package/dist/cookies/json-cookie.d.ts +64 -0
  303. package/dist/cookies/json-cookie.d.ts.map +1 -0
  304. package/dist/cookies/validation.d.ts +34 -0
  305. package/dist/cookies/validation.d.ts.map +1 -0
  306. package/dist/dev-tools/404-page.d.ts +50 -0
  307. package/dist/dev-tools/404-page.d.ts.map +1 -0
  308. package/dist/dev-tools/browser-logs.d.ts +40 -0
  309. package/dist/dev-tools/browser-logs.d.ts.map +1 -0
  310. package/dist/dev-tools/dev-page-shell.d.ts +78 -0
  311. package/dist/dev-tools/dev-page-shell.d.ts.map +1 -0
  312. package/dist/dev-tools/error-page.d.ts +32 -0
  313. package/dist/dev-tools/error-page.d.ts.map +1 -0
  314. package/dist/dev-tools/holding-server.d.ts +54 -0
  315. package/dist/dev-tools/holding-server.d.ts.map +1 -0
  316. package/dist/dev-tools/hydration-overlay.d.ts +11 -0
  317. package/dist/dev-tools/hydration-overlay.d.ts.map +1 -0
  318. package/dist/dev-tools/index.d.ts +31 -0
  319. package/dist/dev-tools/index.d.ts.map +1 -0
  320. package/dist/dev-tools/instrumentation.d.ts +59 -0
  321. package/dist/dev-tools/instrumentation.d.ts.map +1 -0
  322. package/dist/{server/dev-logger.d.ts → dev-tools/logger.d.ts} +1 -1
  323. package/dist/dev-tools/logger.d.ts.map +1 -0
  324. package/dist/{plugins/dev-logs.d.ts → dev-tools/logs.d.ts} +17 -3
  325. package/dist/dev-tools/logs.d.ts.map +1 -0
  326. package/dist/dev-tools/overlay.d.ts +91 -0
  327. package/dist/dev-tools/overlay.d.ts.map +1 -0
  328. package/dist/dev-tools/stack-classifier.d.ts +34 -0
  329. package/dist/dev-tools/stack-classifier.d.ts.map +1 -0
  330. package/dist/dev-tools/terminal.d.ts +28 -0
  331. package/dist/dev-tools/terminal.d.ts.map +1 -0
  332. package/dist/fonts/ast-walk.d.ts +68 -0
  333. package/dist/fonts/ast-walk.d.ts.map +1 -0
  334. package/dist/fonts/ast.d.ts +110 -6
  335. package/dist/fonts/ast.d.ts.map +1 -1
  336. package/dist/fonts/bundle.d.ts +50 -0
  337. package/dist/fonts/bundle.d.ts.map +1 -0
  338. package/dist/fonts/dev-middleware.d.ts +22 -0
  339. package/dist/fonts/dev-middleware.d.ts.map +1 -0
  340. package/dist/fonts/fallbacks.d.ts +0 -7
  341. package/dist/fonts/fallbacks.d.ts.map +1 -1
  342. package/dist/fonts/google.d.ts +4 -2
  343. package/dist/fonts/google.d.ts.map +1 -1
  344. package/dist/fonts/local.d.ts +4 -4
  345. package/dist/fonts/local.d.ts.map +1 -1
  346. package/dist/fonts/paths.d.ts +43 -0
  347. package/dist/fonts/paths.d.ts.map +1 -0
  348. package/dist/fonts/pipeline.d.ts +177 -0
  349. package/dist/fonts/pipeline.d.ts.map +1 -0
  350. package/dist/fonts/transform.d.ts +82 -0
  351. package/dist/fonts/transform.d.ts.map +1 -0
  352. package/dist/fonts/types.d.ts +47 -1
  353. package/dist/fonts/types.d.ts.map +1 -1
  354. package/dist/fonts/virtual-modules.d.ts +77 -0
  355. package/dist/fonts/virtual-modules.d.ts.map +1 -0
  356. package/dist/index.d.ts +50 -181
  357. package/dist/index.d.ts.map +1 -1
  358. package/dist/index.js +9805 -14134
  359. package/dist/index.js.map +1 -1
  360. package/dist/params/codec-registry.d.ts +26 -0
  361. package/dist/params/codec-registry.d.ts.map +1 -0
  362. package/dist/params/define-schema.d.ts +81 -0
  363. package/dist/params/define-schema.d.ts.map +1 -0
  364. package/dist/params/index.d.ts +5 -0
  365. package/dist/params/index.d.ts.map +1 -0
  366. package/dist/params/index.js +34 -0
  367. package/dist/params/index.js.map +1 -0
  368. package/dist/params/resolve-schema.d.ts +34 -0
  369. package/dist/params/resolve-schema.d.ts.map +1 -0
  370. package/dist/plugin-context.d.ts +276 -0
  371. package/dist/plugin-context.d.ts.map +1 -0
  372. package/dist/plugins/adapter-build.d.ts +21 -1
  373. package/dist/plugins/adapter-build.d.ts.map +1 -1
  374. package/dist/plugins/build-manifest.d.ts +7 -3
  375. package/dist/plugins/build-manifest.d.ts.map +1 -1
  376. package/dist/plugins/build-report.d.ts +47 -10
  377. package/dist/plugins/build-report.d.ts.map +1 -1
  378. package/dist/plugins/cache.d.ts +64 -0
  379. package/dist/plugins/cache.d.ts.map +1 -0
  380. package/dist/plugins/callsite-ast.d.ts +117 -0
  381. package/dist/plugins/callsite-ast.d.ts.map +1 -0
  382. package/dist/plugins/callsite-jsx.d.ts +35 -0
  383. package/dist/plugins/callsite-jsx.d.ts.map +1 -0
  384. package/dist/plugins/chunks.d.ts +11 -4
  385. package/dist/plugins/chunks.d.ts.map +1 -1
  386. package/dist/plugins/client-chunks.d.ts +40 -0
  387. package/dist/plugins/client-chunks.d.ts.map +1 -0
  388. package/dist/plugins/cloudflare-wasm.d.ts +21 -0
  389. package/dist/plugins/cloudflare-wasm.d.ts.map +1 -0
  390. package/dist/plugins/content.d.ts +1 -1
  391. package/dist/plugins/content.d.ts.map +1 -1
  392. package/dist/plugins/dev-server.d.ts +17 -1
  393. package/dist/plugins/dev-server.d.ts.map +1 -1
  394. package/dist/plugins/entries.d.ts +28 -4
  395. package/dist/plugins/entries.d.ts.map +1 -1
  396. package/dist/plugins/fonts.d.ts +16 -73
  397. package/dist/plugins/fonts.d.ts.map +1 -1
  398. package/dist/plugins/mdx.d.ts +1 -1
  399. package/dist/plugins/mdx.d.ts.map +1 -1
  400. package/dist/plugins/prebuilt-capture.d.ts +60 -0
  401. package/dist/plugins/prebuilt-capture.d.ts.map +1 -0
  402. package/dist/plugins/prebuilt-options-analysis.d.ts +40 -0
  403. package/dist/plugins/prebuilt-options-analysis.d.ts.map +1 -0
  404. package/dist/plugins/prebuilt.d.ts +82 -0
  405. package/dist/plugins/prebuilt.d.ts.map +1 -0
  406. package/dist/plugins/prerender-sugar.d.ts +42 -0
  407. package/dist/plugins/prerender-sugar.d.ts.map +1 -0
  408. package/dist/plugins/request-dep/analysis.d.ts +106 -0
  409. package/dist/plugins/request-dep/analysis.d.ts.map +1 -0
  410. package/dist/plugins/request-dep/index.d.ts +75 -0
  411. package/dist/plugins/request-dep/index.d.ts.map +1 -0
  412. package/dist/plugins/request-dep/origin.d.ts +61 -0
  413. package/dist/plugins/request-dep/origin.d.ts.map +1 -0
  414. package/dist/plugins/routing.d.ts +1 -1
  415. package/dist/plugins/routing.d.ts.map +1 -1
  416. package/dist/plugins/server-bundle.d.ts.map +1 -1
  417. package/dist/plugins/shims.d.ts +29 -5
  418. package/dist/plugins/shims.d.ts.map +1 -1
  419. package/dist/plugins/static-build.d.ts +218 -21
  420. package/dist/plugins/static-build.d.ts.map +1 -1
  421. package/dist/routing/codegen-shared.d.ts +26 -0
  422. package/dist/routing/codegen-shared.d.ts.map +1 -0
  423. package/dist/routing/codegen-types.d.ts +61 -0
  424. package/dist/routing/codegen-types.d.ts.map +1 -0
  425. package/dist/routing/codegen-write.d.ts +51 -0
  426. package/dist/routing/codegen-write.d.ts.map +1 -0
  427. package/dist/routing/codegen.d.ts +7 -2
  428. package/dist/routing/codegen.d.ts.map +1 -1
  429. package/dist/routing/collision-probe.d.ts +104 -0
  430. package/dist/routing/collision-probe.d.ts.map +1 -0
  431. package/dist/routing/collision-spaces.d.ts +26 -0
  432. package/dist/routing/collision-spaces.d.ts.map +1 -0
  433. package/dist/routing/convention-lint.d.ts +55 -0
  434. package/dist/routing/convention-lint.d.ts.map +1 -0
  435. package/dist/routing/export-detect.d.ts +72 -0
  436. package/dist/routing/export-detect.d.ts.map +1 -0
  437. package/dist/routing/file-cache.d.ts +8 -0
  438. package/dist/routing/file-cache.d.ts.map +1 -0
  439. package/dist/routing/index.d.ts +7 -1
  440. package/dist/routing/index.d.ts.map +1 -1
  441. package/dist/routing/index.js +5 -2
  442. package/dist/routing/interception.d.ts +234 -10
  443. package/dist/routing/interception.d.ts.map +1 -1
  444. package/dist/routing/link-codegen.d.ts +105 -0
  445. package/dist/routing/link-codegen.d.ts.map +1 -0
  446. package/dist/routing/manifest-codegen.d.ts +26 -0
  447. package/dist/routing/manifest-codegen.d.ts.map +1 -0
  448. package/dist/routing/scanner.d.ts +1 -10
  449. package/dist/routing/scanner.d.ts.map +1 -1
  450. package/dist/routing/schema-validation.d.ts +35 -0
  451. package/dist/routing/schema-validation.d.ts.map +1 -0
  452. package/dist/routing/segment-classify.d.ts +114 -0
  453. package/dist/routing/segment-classify.d.ts.map +1 -0
  454. package/dist/routing/segment-codegen.d.ts +38 -0
  455. package/dist/routing/segment-codegen.d.ts.map +1 -0
  456. package/dist/routing/segment-keys.d.ts +117 -0
  457. package/dist/routing/segment-keys.d.ts.map +1 -0
  458. package/dist/routing/slot-placement.d.ts +48 -0
  459. package/dist/routing/slot-placement.d.ts.map +1 -0
  460. package/dist/routing/types.d.ts +74 -26
  461. package/dist/routing/types.d.ts.map +1 -1
  462. package/dist/routing/walkers.d.ts +57 -0
  463. package/dist/routing/walkers.d.ts.map +1 -0
  464. package/dist/rsc-runtime/rsc.d.ts +1 -1
  465. package/dist/rsc-runtime/rsc.d.ts.map +1 -1
  466. package/dist/rsc-runtime/ssr.d.ts +12 -0
  467. package/dist/rsc-runtime/ssr.d.ts.map +1 -1
  468. package/dist/schema-bridge.d.ts +145 -0
  469. package/dist/schema-bridge.d.ts.map +1 -0
  470. package/dist/search-params/define.d.ts +262 -0
  471. package/dist/search-params/define.d.ts.map +1 -0
  472. package/dist/search-params/index.d.ts +3 -7
  473. package/dist/search-params/index.d.ts.map +1 -1
  474. package/dist/search-params/index.js +179 -360
  475. package/dist/search-params/index.js.map +1 -1
  476. package/dist/search-params/parse-total.d.ts +81 -0
  477. package/dist/search-params/parse-total.d.ts.map +1 -0
  478. package/dist/search-params/serialize-equal.d.ts +9 -0
  479. package/dist/search-params/serialize-equal.d.ts.map +1 -0
  480. package/dist/search-params/wrappers.d.ts +76 -0
  481. package/dist/search-params/wrappers.d.ts.map +1 -0
  482. package/dist/server/access-gate.d.ts +26 -10
  483. package/dist/server/access-gate.d.ts.map +1 -1
  484. package/dist/server/action-client.d.ts +42 -7
  485. package/dist/server/action-client.d.ts.map +1 -1
  486. package/dist/server/action-encryption.d.ts +76 -0
  487. package/dist/server/action-encryption.d.ts.map +1 -0
  488. package/dist/server/action-handler.d.ts +35 -1
  489. package/dist/server/action-handler.d.ts.map +1 -1
  490. package/dist/server/actions.d.ts +12 -33
  491. package/dist/server/actions.d.ts.map +1 -1
  492. package/dist/server/als-registry.d.ts +110 -11
  493. package/dist/server/als-registry.d.ts.map +1 -1
  494. package/dist/server/asset-headers.d.ts +8 -18
  495. package/dist/server/asset-headers.d.ts.map +1 -1
  496. package/dist/server/body-limits.d.ts.map +1 -1
  497. package/dist/server/build-manifest.d.ts +25 -30
  498. package/dist/server/build-manifest.d.ts.map +1 -1
  499. package/dist/server/canonicalize.d.ts +10 -0
  500. package/dist/server/canonicalize.d.ts.map +1 -1
  501. package/dist/server/chain-url-parts.d.ts +81 -0
  502. package/dist/server/chain-url-parts.d.ts.map +1 -0
  503. package/dist/server/children-interception.d.ts +49 -0
  504. package/dist/server/children-interception.d.ts.map +1 -0
  505. package/dist/server/coalesce-tick.d.ts +40 -0
  506. package/dist/server/coalesce-tick.d.ts.map +1 -0
  507. package/dist/server/compress.d.ts.map +1 -1
  508. package/dist/server/cookie-context.d.ts +170 -0
  509. package/dist/server/cookie-context.d.ts.map +1 -0
  510. package/dist/server/cookie-parsing.d.ts +65 -0
  511. package/dist/server/cookie-parsing.d.ts.map +1 -0
  512. package/dist/server/csrf.d.ts +3 -2
  513. package/dist/server/csrf.d.ts.map +1 -1
  514. package/dist/server/default-logger.d.ts +22 -0
  515. package/dist/server/default-logger.d.ts.map +1 -0
  516. package/dist/server/default-status-page.d.ts +45 -0
  517. package/dist/server/default-status-page.d.ts.map +1 -0
  518. package/dist/server/deny-boundary.d.ts +247 -0
  519. package/dist/server/deny-boundary.d.ts.map +1 -0
  520. package/dist/server/deny-renderer.d.ts +16 -5
  521. package/dist/server/deny-renderer.d.ts.map +1 -1
  522. package/dist/server/dev-source-map.d.ts +22 -0
  523. package/dist/server/dev-source-map.d.ts.map +1 -0
  524. package/dist/server/early-hints-sender.d.ts.map +1 -1
  525. package/dist/server/early-hints.d.ts +13 -11
  526. package/dist/server/early-hints.d.ts.map +1 -1
  527. package/dist/server/error-boundary-wrapper.d.ts +86 -10
  528. package/dist/server/error-boundary-wrapper.d.ts.map +1 -1
  529. package/dist/server/fallback-error.d.ts +12 -7
  530. package/dist/server/fallback-error.d.ts.map +1 -1
  531. package/dist/server/flight-injection-state.d.ts +66 -0
  532. package/dist/server/flight-injection-state.d.ts.map +1 -0
  533. package/dist/server/flight-scripts.d.ts +42 -0
  534. package/dist/server/flight-scripts.d.ts.map +1 -0
  535. package/dist/server/form-data.d.ts +41 -0
  536. package/dist/server/form-data.d.ts.map +1 -1
  537. package/dist/server/head-response.d.ts +35 -0
  538. package/dist/server/head-response.d.ts.map +1 -0
  539. package/dist/server/html-injector-core.d.ts +242 -0
  540. package/dist/server/html-injector-core.d.ts.map +1 -0
  541. package/dist/server/html-injectors.d.ts +82 -41
  542. package/dist/server/html-injectors.d.ts.map +1 -1
  543. package/dist/server/index.d.ts +10 -47
  544. package/dist/server/index.d.ts.map +1 -1
  545. package/dist/server/index.js +183 -2906
  546. package/dist/server/index.js.map +1 -1
  547. package/dist/server/internal.d.ts +51 -0
  548. package/dist/server/internal.d.ts.map +1 -0
  549. package/dist/server/internal.js +4154 -0
  550. package/dist/server/internal.js.map +1 -0
  551. package/dist/server/logger.d.ts +39 -7
  552. package/dist/server/logger.d.ts.map +1 -1
  553. package/dist/server/metadata-collector.d.ts +52 -0
  554. package/dist/server/metadata-collector.d.ts.map +1 -0
  555. package/dist/server/metadata-routes.d.ts +60 -11
  556. package/dist/server/metadata-routes.d.ts.map +1 -1
  557. package/dist/server/metadata.d.ts +8 -0
  558. package/dist/server/metadata.d.ts.map +1 -1
  559. package/dist/server/middleware-runner.d.ts +19 -4
  560. package/dist/server/middleware-runner.d.ts.map +1 -1
  561. package/dist/server/node-stream-transforms.d.ts +119 -0
  562. package/dist/server/node-stream-transforms.d.ts.map +1 -0
  563. package/dist/server/param-coercion.d.ts +70 -0
  564. package/dist/server/param-coercion.d.ts.map +1 -0
  565. package/dist/server/pipeline-helpers.d.ts +77 -0
  566. package/dist/server/pipeline-helpers.d.ts.map +1 -0
  567. package/dist/server/pipeline-interception.d.ts +59 -9
  568. package/dist/server/pipeline-interception.d.ts.map +1 -1
  569. package/dist/server/pipeline-metadata.d.ts +6 -0
  570. package/dist/server/pipeline-metadata.d.ts.map +1 -1
  571. package/dist/server/pipeline-outcome.d.ts +49 -0
  572. package/dist/server/pipeline-outcome.d.ts.map +1 -0
  573. package/dist/server/pipeline-phases.d.ts +59 -0
  574. package/dist/server/pipeline-phases.d.ts.map +1 -0
  575. package/dist/server/pipeline.d.ts +151 -19
  576. package/dist/server/pipeline.d.ts.map +1 -1
  577. package/dist/server/port-resolution.d.ts +117 -0
  578. package/dist/server/port-resolution.d.ts.map +1 -0
  579. package/dist/server/prebuilt/cache-key.d.ts +62 -0
  580. package/dist/server/prebuilt/cache-key.d.ts.map +1 -0
  581. package/dist/server/prebuilt/capture-state.d.ts +57 -0
  582. package/dist/server/prebuilt/capture-state.d.ts.map +1 -0
  583. package/dist/server/prebuilt/key-discipline.d.ts +23 -0
  584. package/dist/server/prebuilt/key-discipline.d.ts.map +1 -0
  585. package/dist/server/prebuilt/manifest-tag-index.d.ts +27 -0
  586. package/dist/server/prebuilt/manifest-tag-index.d.ts.map +1 -0
  587. package/dist/server/prebuilt/overlay.d.ts +100 -0
  588. package/dist/server/prebuilt/overlay.d.ts.map +1 -0
  589. package/dist/server/prebuilt/payload-source.d.ts +78 -0
  590. package/dist/server/prebuilt/payload-source.d.ts.map +1 -0
  591. package/dist/server/prebuilt/slots.d.ts +99 -0
  592. package/dist/server/prebuilt/slots.d.ts.map +1 -0
  593. package/dist/server/prebuilt/synthetic-store.d.ts +66 -0
  594. package/dist/server/prebuilt/synthetic-store.d.ts.map +1 -0
  595. package/dist/server/prebuilt-builder.d.ts +120 -0
  596. package/dist/server/prebuilt-builder.d.ts.map +1 -0
  597. package/dist/server/prebuilt-runtime.d.ts +111 -0
  598. package/dist/server/prebuilt-runtime.d.ts.map +1 -0
  599. package/dist/server/primitives.d.ts +100 -44
  600. package/dist/server/primitives.d.ts.map +1 -1
  601. package/dist/server/publish-params.d.ts +33 -0
  602. package/dist/server/publish-params.d.ts.map +1 -0
  603. package/dist/server/render-timeout.d.ts +51 -0
  604. package/dist/server/render-timeout.d.ts.map +1 -0
  605. package/dist/server/render-utils.d.ts +25 -0
  606. package/dist/server/render-utils.d.ts.map +1 -0
  607. package/dist/server/request-context.d.ts +109 -106
  608. package/dist/server/request-context.d.ts.map +1 -1
  609. package/dist/server/request-dep.d.ts +15 -0
  610. package/dist/server/request-dep.d.ts.map +1 -0
  611. package/dist/server/route-element-builder.d.ts +74 -27
  612. package/dist/server/route-element-builder.d.ts.map +1 -1
  613. package/dist/server/route-handler.d.ts.map +1 -1
  614. package/dist/server/route-matcher.d.ts +38 -36
  615. package/dist/server/route-matcher.d.ts.map +1 -1
  616. package/dist/server/rsc-cache-key-guard.d.ts +78 -0
  617. package/dist/server/rsc-cache-key-guard.d.ts.map +1 -0
  618. package/dist/server/rsc-entry/action-middleware-runner.d.ts +66 -0
  619. package/dist/server/rsc-entry/action-middleware-runner.d.ts.map +1 -0
  620. package/dist/server/rsc-entry/api-handler.d.ts +12 -3
  621. package/dist/server/rsc-entry/api-handler.d.ts.map +1 -1
  622. package/dist/server/rsc-entry/deny-fallback.d.ts +29 -0
  623. package/dist/server/rsc-entry/deny-fallback.d.ts.map +1 -0
  624. package/dist/server/rsc-entry/error-renderer.d.ts +38 -13
  625. package/dist/server/rsc-entry/error-renderer.d.ts.map +1 -1
  626. package/dist/server/rsc-entry/helpers.d.ts +59 -42
  627. package/dist/server/rsc-entry/helpers.d.ts.map +1 -1
  628. package/dist/server/rsc-entry/index.d.ts +39 -6
  629. package/dist/server/rsc-entry/index.d.ts.map +1 -1
  630. package/dist/server/rsc-entry/render-route.d.ts +51 -0
  631. package/dist/server/rsc-entry/render-route.d.ts.map +1 -0
  632. package/dist/server/rsc-entry/revalidate-renderer.d.ts +108 -0
  633. package/dist/server/rsc-entry/revalidate-renderer.d.ts.map +1 -0
  634. package/dist/server/rsc-entry/rsc-payload.d.ts +5 -6
  635. package/dist/server/rsc-entry/rsc-payload.d.ts.map +1 -1
  636. package/dist/server/rsc-entry/rsc-stream.d.ts +40 -3
  637. package/dist/server/rsc-entry/rsc-stream.d.ts.map +1 -1
  638. package/dist/server/rsc-entry/ssr-bridge.d.ts +5 -1
  639. package/dist/server/rsc-entry/ssr-bridge.d.ts.map +1 -1
  640. package/dist/server/rsc-entry/ssr-renderer.d.ts +36 -4
  641. package/dist/server/rsc-entry/ssr-renderer.d.ts.map +1 -1
  642. package/dist/server/rsc-entry/wrap-action-dispatch.d.ts +89 -0
  643. package/dist/server/rsc-entry/wrap-action-dispatch.d.ts.map +1 -0
  644. package/dist/server/safe-load.d.ts +46 -0
  645. package/dist/server/safe-load.d.ts.map +1 -0
  646. package/dist/server/sensitive-fields.d.ts +74 -0
  647. package/dist/server/sensitive-fields.d.ts.map +1 -0
  648. package/dist/server/sitemap-generator.d.ts +129 -0
  649. package/dist/server/sitemap-generator.d.ts.map +1 -0
  650. package/dist/server/sitemap-handler.d.ts +22 -0
  651. package/dist/server/sitemap-handler.d.ts.map +1 -0
  652. package/dist/server/skippable-prefix.d.ts +26 -0
  653. package/dist/server/skippable-prefix.d.ts.map +1 -0
  654. package/dist/server/slot-interception.d.ts +80 -0
  655. package/dist/server/slot-interception.d.ts.map +1 -0
  656. package/dist/server/slot-resolver.d.ts +139 -5
  657. package/dist/server/slot-resolver.d.ts.map +1 -1
  658. package/dist/server/ssr-bridge-types.d.ts +138 -0
  659. package/dist/server/ssr-bridge-types.d.ts.map +1 -0
  660. package/dist/server/ssr-entry.d.ts +1 -43
  661. package/dist/server/ssr-entry.d.ts.map +1 -1
  662. package/dist/server/ssr-render.d.ts +64 -21
  663. package/dist/server/ssr-render.d.ts.map +1 -1
  664. package/dist/server/ssr-wrappers.d.ts +61 -0
  665. package/dist/server/ssr-wrappers.d.ts.map +1 -0
  666. package/dist/server/state-tree-diff.d.ts +44 -9
  667. package/dist/server/state-tree-diff.d.ts.map +1 -1
  668. package/dist/server/static-generator.d.ts +112 -0
  669. package/dist/server/static-generator.d.ts.map +1 -0
  670. package/dist/server/static-not-found.d.ts +52 -0
  671. package/dist/server/static-not-found.d.ts.map +1 -0
  672. package/dist/server/status-code-resolver.d.ts +26 -15
  673. package/dist/server/status-code-resolver.d.ts.map +1 -1
  674. package/dist/server/stream-utils.d.ts +47 -0
  675. package/dist/server/stream-utils.d.ts.map +1 -0
  676. package/dist/server/tracing.d.ts +44 -9
  677. package/dist/server/tracing.d.ts.map +1 -1
  678. package/dist/server/tree-builder.d.ts +66 -42
  679. package/dist/server/tree-builder.d.ts.map +1 -1
  680. package/dist/server/tree-match.d.ts +49 -0
  681. package/dist/server/tree-match.d.ts.map +1 -0
  682. package/dist/server/types.d.ts +76 -6
  683. package/dist/server/types.d.ts.map +1 -1
  684. package/dist/server/utils/element-type.d.ts +40 -0
  685. package/dist/server/utils/element-type.d.ts.map +1 -0
  686. package/dist/server/utils/escape-html.d.ts +14 -0
  687. package/dist/server/utils/escape-html.d.ts.map +1 -0
  688. package/dist/server/utils/mdx-file.d.ts +15 -0
  689. package/dist/server/utils/mdx-file.d.ts.map +1 -0
  690. package/dist/server/version-skew.d.ts +61 -0
  691. package/dist/server/version-skew.d.ts.map +1 -0
  692. package/dist/server/workers-cache-bridge.d.ts +26 -0
  693. package/dist/server/workers-cache-bridge.d.ts.map +1 -0
  694. package/dist/shared/als-slots.d.ts +41 -0
  695. package/dist/shared/als-slots.d.ts.map +1 -0
  696. package/dist/shared/base-path.d.ts +56 -0
  697. package/dist/shared/base-path.d.ts.map +1 -0
  698. package/dist/shared/href-validation.d.ts +49 -0
  699. package/dist/shared/href-validation.d.ts.map +1 -0
  700. package/dist/shared/merge-search-params.d.ts +22 -0
  701. package/dist/shared/merge-search-params.d.ts.map +1 -0
  702. package/dist/shared/param-value.d.ts +80 -0
  703. package/dist/shared/param-value.d.ts.map +1 -0
  704. package/dist/shared/payload-root.d.ts +108 -0
  705. package/dist/shared/payload-root.d.ts.map +1 -0
  706. package/dist/shared/redirect-type.d.ts +17 -0
  707. package/dist/shared/redirect-type.d.ts.map +1 -0
  708. package/dist/shared/rsc-cache-key.d.ts +163 -0
  709. package/dist/shared/rsc-cache-key.d.ts.map +1 -0
  710. package/dist/shared/rsc-error-envelope.d.ts +25 -0
  711. package/dist/shared/rsc-error-envelope.d.ts.map +1 -0
  712. package/dist/shared/rsc-manifest.d.ts +28 -0
  713. package/dist/shared/rsc-manifest.d.ts.map +1 -0
  714. package/dist/shared/rsc-media-type.d.ts +40 -0
  715. package/dist/shared/rsc-media-type.d.ts.map +1 -0
  716. package/dist/shared/rsc-payload-path.d.ts +42 -0
  717. package/dist/shared/rsc-payload-path.d.ts.map +1 -0
  718. package/dist/shared/segment-info.d.ts +66 -0
  719. package/dist/shared/segment-info.d.ts.map +1 -0
  720. package/dist/shared/slot-params.d.ts +51 -0
  721. package/dist/shared/slot-params.d.ts.map +1 -0
  722. package/dist/shared/static-platform-files.d.ts +71 -0
  723. package/dist/shared/static-platform-files.d.ts.map +1 -0
  724. package/dist/shims/font-google.d.ts +1 -1
  725. package/dist/shims/font-google.d.ts.map +1 -1
  726. package/dist/shims/font-google.js +42 -0
  727. package/dist/shims/font-google.js.map +1 -0
  728. package/dist/shims/font-local.d.ts +26 -0
  729. package/dist/shims/font-local.d.ts.map +1 -0
  730. package/dist/shims/font-local.js +20 -0
  731. package/dist/shims/font-local.js.map +1 -0
  732. package/dist/shims/headers.d.ts +53 -1
  733. package/dist/shims/headers.d.ts.map +1 -1
  734. package/dist/shims/image.d.ts +120 -120
  735. package/dist/shims/image.d.ts.map +1 -1
  736. package/dist/shims/navigation-client.d.ts +25 -12
  737. package/dist/shims/navigation-client.d.ts.map +1 -1
  738. package/dist/shims/navigation.d.ts +10 -5
  739. package/dist/shims/navigation.d.ts.map +1 -1
  740. package/dist/utils/state-machine.d.ts +80 -0
  741. package/dist/utils/state-machine.d.ts.map +1 -0
  742. package/docs/api/30-api-server.mdx +233 -0
  743. package/docs/api/31-api-client.mdx +163 -0
  744. package/docs/api/32-api-cache.mdx +311 -0
  745. package/docs/api/33-api-search-params.mdx +176 -0
  746. package/docs/api/34-api-config.mdx +325 -0
  747. package/docs/api/35-api-typescript.mdx +170 -0
  748. package/docs/api/36-cli.mdx +170 -0
  749. package/docs/learn/00-introduction.mdx +109 -0
  750. package/docs/learn/01-quick-start.mdx +94 -0
  751. package/docs/learn/02-pages-and-layouts.mdx +147 -0
  752. package/docs/learn/03-fetching-data.mdx +211 -0
  753. package/docs/learn/03b-access-control.mdx +130 -0
  754. package/docs/learn/04-loading-states.mdx +67 -0
  755. package/docs/learn/04b-the-flush-point.mdx +115 -0
  756. package/docs/learn/05-typed-params.mdx +275 -0
  757. package/docs/learn/06-forms-and-actions.mdx +146 -0
  758. package/docs/learn/07-typed-routes.mdx +132 -0
  759. package/docs/learn/08-streaming.mdx +146 -0
  760. package/docs/learn/09-caching.mdx +252 -0
  761. package/docs/learn/10-middleware.mdx +157 -0
  762. package/docs/learn/11-error-handling.mdx +173 -0
  763. package/docs/learn/12-client-navigation.mdx +176 -0
  764. package/docs/learn/13-configuration.mdx +166 -0
  765. package/docs/learn/14-deploying.mdx +287 -0
  766. package/docs/more/01-advanced-routing.mdx +343 -0
  767. package/docs/more/02-advanced-forms.mdx +137 -0
  768. package/docs/more/03-coming-from-nextjs.mdx +186 -0
  769. package/docs/more/04-metadata-and-fonts.mdx +193 -0
  770. package/docs/more/04b-mdx.mdx +209 -0
  771. package/docs/more/05-content-collections.mdx +90 -0
  772. package/docs/more/06-instrumentation.mdx +214 -0
  773. package/docs/more/07-security.mdx +129 -0
  774. package/docs/more/08-developer-experience.mdx +134 -0
  775. package/docs/more/40-why-timber.mdx +50 -0
  776. package/docs/more/41-timber-vs-nextjs.mdx +81 -0
  777. package/docs/more/42-timber-vs-others.mdx +68 -0
  778. package/docs/more/50-ai-agent-instructions.mdx +171 -0
  779. package/llms.txt +55 -0
  780. package/package.json +108 -26
  781. package/src/adapters/build-output-helper.ts +351 -0
  782. package/src/adapters/cloudflare-dev.ts +177 -0
  783. package/src/adapters/cloudflare-kv-cache.ts +204 -0
  784. package/src/adapters/cloudflare.ts +740 -129
  785. package/src/adapters/compress-module.ts +101 -88
  786. package/src/adapters/fs-identity.ts +156 -0
  787. package/src/adapters/nitro.ts +320 -120
  788. package/src/adapters/raw-imports.d.ts +5 -0
  789. package/src/adapters/shared.ts +274 -0
  790. package/src/adapters/types.ts +28 -7
  791. package/src/adapters/wrangler.d.ts +7 -0
  792. package/src/cache/cache-api.ts +107 -0
  793. package/src/cache/fast-hash.ts +5 -0
  794. package/src/cache/handler-store.ts +76 -0
  795. package/src/cache/index.ts +114 -21
  796. package/src/cache/invalidation-epoch.ts +93 -0
  797. package/src/cache/json-lossy-check.ts +75 -0
  798. package/src/cache/redis-handler.ts +197 -19
  799. package/src/cache/singleflight.ts +64 -6
  800. package/src/cache/sizeof.ts +33 -0
  801. package/src/cache/stable-stringify.ts +65 -2
  802. package/src/cache/store.ts +71 -0
  803. package/src/cache/stores/cloudflare-kv.ts +52 -0
  804. package/src/cache/stores/memory.ts +125 -0
  805. package/src/cache/stores/redis.ts +97 -0
  806. package/src/cache/stores/vercel.ts +59 -0
  807. package/src/cache/tag-aware-handler.ts +237 -0
  808. package/src/cache/timber-cache.ts +161 -36
  809. package/src/cdn/cloudflare-purge.ts +50 -0
  810. package/src/cdn/fastly-purge.ts +63 -0
  811. package/src/cdn/headers.ts +153 -0
  812. package/src/cdn/index.ts +17 -0
  813. package/src/cdn/purge-store.ts +34 -0
  814. package/src/cdn/workers-cache-purge.ts +30 -0
  815. package/src/cli-check.ts +458 -0
  816. package/src/cli-schema-sync.ts +401 -0
  817. package/src/cli.ts +221 -53
  818. package/src/client/browser-dev.ts +156 -1
  819. package/src/client/browser-entry/action-dispatch.ts +130 -0
  820. package/src/client/browser-entry/hmr.ts +70 -0
  821. package/src/client/browser-entry/hydrate.ts +198 -0
  822. package/src/client/browser-entry/index.ts +121 -0
  823. package/src/client/browser-entry/post-hydration.ts +122 -0
  824. package/src/client/browser-entry/router-init.ts +342 -0
  825. package/src/client/browser-entry/rsc-stream.ts +166 -0
  826. package/src/client/browser-entry/scroll.ts +50 -0
  827. package/src/client/error-boundary.tsx +210 -36
  828. package/src/client/error-reconstituter.tsx +79 -0
  829. package/src/client/form.tsx +31 -32
  830. package/src/client/history.ts +29 -7
  831. package/src/client/index.ts +78 -45
  832. package/src/client/internal.ts +59 -0
  833. package/src/client/link.tsx +397 -150
  834. package/src/client/navigation-api.ts +345 -0
  835. package/src/client/navigation-commit.ts +197 -0
  836. package/src/client/navigation-context.ts +43 -62
  837. package/src/client/navigation-root.tsx +580 -0
  838. package/src/client/nuqs-adapter.tsx +16 -3
  839. package/src/client/params-context.ts +192 -0
  840. package/src/client/router-effects.ts +231 -0
  841. package/src/client/router-lifecycle.ts +288 -0
  842. package/src/client/router-pipeline.ts +393 -0
  843. package/src/client/router-ref.ts +2 -2
  844. package/src/client/router-skew.ts +30 -0
  845. package/src/client/router-types.ts +230 -0
  846. package/src/client/router.ts +339 -410
  847. package/src/client/rsc-fetch.ts +530 -73
  848. package/src/client/segment-cache.ts +224 -38
  849. package/src/client/segment-outlet.tsx +141 -0
  850. package/src/client/segment-update-context.ts +42 -0
  851. package/src/client/shallow-url.ts +22 -0
  852. package/src/client/slot-context.ts +50 -0
  853. package/src/client/slot-outlet.tsx +22 -0
  854. package/src/client/slot-provider.tsx +32 -0
  855. package/src/client/ssr-data.ts +19 -5
  856. package/src/client/stale-client.ts +191 -0
  857. package/src/client/state.ts +16 -3
  858. package/src/client/top-loader.tsx +13 -10
  859. package/src/client/unload-guard.ts +34 -2
  860. package/src/client/use-cookie.ts +69 -17
  861. package/src/client/use-link-status.ts +7 -7
  862. package/src/client/use-pathname.ts +1 -0
  863. package/src/client/use-pending-navigation.ts +40 -0
  864. package/src/client/use-query-states.ts +206 -36
  865. package/src/client/use-router.ts +5 -2
  866. package/src/client/use-search-params.ts +31 -44
  867. package/src/client/{use-params.ts → use-segment-params.ts} +49 -23
  868. package/src/codec.ts +149 -0
  869. package/src/config-types.ts +282 -0
  870. package/src/config-validation.ts +330 -0
  871. package/src/content/index.ts +5 -13
  872. package/src/cookies/define-cookie.ts +222 -53
  873. package/src/cookies/index.ts +12 -1
  874. package/src/cookies/json-cookie.ts +105 -0
  875. package/src/cookies/validation.ts +192 -0
  876. package/src/dev-tools/404-page.ts +286 -0
  877. package/src/dev-tools/browser-logs.ts +55 -0
  878. package/src/dev-tools/dev-page-shell.ts +260 -0
  879. package/src/dev-tools/error-page.ts +331 -0
  880. package/src/dev-tools/holding-server.ts +187 -0
  881. package/src/dev-tools/hydration-overlay.ts +158 -0
  882. package/src/dev-tools/index.ts +83 -0
  883. package/src/dev-tools/instrumentation.ts +213 -0
  884. package/src/{server/dev-logger.ts → dev-tools/logger.ts} +33 -51
  885. package/src/{plugins/dev-logs.ts → dev-tools/logs.ts} +122 -26
  886. package/src/dev-tools/overlay.ts +469 -0
  887. package/src/dev-tools/stack-classifier.ts +75 -0
  888. package/src/dev-tools/terminal.ts +182 -0
  889. package/src/fonts/ast-walk.ts +235 -0
  890. package/src/fonts/ast.ts +477 -126
  891. package/src/fonts/bundle.ts +138 -0
  892. package/src/fonts/dev-middleware.ts +85 -0
  893. package/src/fonts/fallbacks.ts +0 -23
  894. package/src/fonts/google.ts +100 -18
  895. package/src/fonts/local.ts +9 -8
  896. package/src/fonts/paths.ts +58 -0
  897. package/src/fonts/pipeline.ts +348 -0
  898. package/src/fonts/transform.ts +311 -0
  899. package/src/fonts/types.ts +52 -1
  900. package/src/fonts/virtual-modules.ts +179 -0
  901. package/src/index.ts +468 -353
  902. package/src/params/codec-registry.ts +34 -0
  903. package/src/params/define-schema.ts +115 -0
  904. package/src/params/index.ts +17 -0
  905. package/src/params/resolve-schema.ts +84 -0
  906. package/src/plugin-context.ts +503 -0
  907. package/src/plugins/adapter-build.ts +229 -7
  908. package/src/plugins/build-manifest.ts +201 -26
  909. package/src/plugins/build-report.ts +259 -47
  910. package/src/plugins/cache.ts +243 -0
  911. package/src/plugins/callsite-ast.ts +472 -0
  912. package/src/plugins/callsite-jsx.ts +243 -0
  913. package/src/plugins/chunks.ts +74 -5
  914. package/src/plugins/client-chunks.ts +185 -0
  915. package/src/plugins/cloudflare-wasm.ts +141 -0
  916. package/src/plugins/content.ts +1 -1
  917. package/src/plugins/dev-server.ts +284 -94
  918. package/src/plugins/entries.ts +138 -16
  919. package/src/plugins/fonts.ts +228 -660
  920. package/src/plugins/mdx.ts +47 -10
  921. package/src/plugins/prebuilt-capture.ts +217 -0
  922. package/src/plugins/prebuilt-options-analysis.ts +175 -0
  923. package/src/plugins/prebuilt.ts +655 -0
  924. package/src/plugins/prerender-sugar.ts +328 -0
  925. package/src/plugins/request-dep/analysis.ts +447 -0
  926. package/src/plugins/request-dep/index.ts +376 -0
  927. package/src/plugins/request-dep/origin.ts +310 -0
  928. package/src/plugins/routing.ts +268 -277
  929. package/src/plugins/server-bundle.ts +89 -12
  930. package/src/plugins/shims.ts +240 -64
  931. package/src/plugins/static-build.ts +704 -66
  932. package/src/routing/codegen-shared.ts +39 -0
  933. package/src/routing/codegen-types.ts +62 -0
  934. package/src/routing/codegen-write.ts +139 -0
  935. package/src/routing/codegen.ts +339 -231
  936. package/src/routing/collision-probe.ts +438 -0
  937. package/src/routing/collision-spaces.ts +281 -0
  938. package/src/routing/convention-lint.ts +493 -0
  939. package/src/routing/export-detect.ts +448 -0
  940. package/src/routing/file-cache.ts +23 -0
  941. package/src/routing/index.ts +10 -1
  942. package/src/routing/interception.ts +894 -67
  943. package/src/routing/link-codegen.ts +280 -0
  944. package/src/routing/manifest-codegen.ts +226 -0
  945. package/src/routing/scanner.ts +368 -218
  946. package/src/routing/schema-validation.ts +155 -0
  947. package/src/routing/segment-classify.ts +280 -0
  948. package/src/routing/segment-codegen.ts +98 -0
  949. package/src/routing/segment-keys.ts +183 -0
  950. package/src/routing/slot-placement.ts +97 -0
  951. package/src/routing/types.ts +75 -26
  952. package/src/routing/walkers.ts +98 -0
  953. package/src/rsc-runtime/rsc.ts +9 -0
  954. package/src/rsc-runtime/ssr.ts +50 -0
  955. package/src/rsc-runtime/vendor-types.d.ts +7 -0
  956. package/src/schema-bridge.ts +380 -0
  957. package/src/search-params/define.ts +677 -0
  958. package/src/search-params/index.ts +14 -20
  959. package/src/search-params/parse-total.ts +91 -0
  960. package/src/search-params/serialize-equal.ts +14 -0
  961. package/src/search-params/wrappers.ts +150 -0
  962. package/src/server/access-gate.tsx +121 -51
  963. package/src/server/action-client.ts +120 -29
  964. package/src/server/action-encryption.ts +144 -0
  965. package/src/server/action-handler.ts +127 -38
  966. package/src/server/actions.ts +54 -57
  967. package/src/server/als-registry.ts +154 -20
  968. package/src/server/asset-headers.ts +15 -37
  969. package/src/server/body-limits.ts +10 -2
  970. package/src/server/build-manifest.ts +33 -57
  971. package/src/server/canonicalize.ts +6 -3
  972. package/src/server/chain-url-parts.ts +162 -0
  973. package/src/server/children-interception.ts +115 -0
  974. package/src/server/coalesce-tick.ts +75 -0
  975. package/src/server/compress.ts +43 -8
  976. package/src/server/cookie-context.ts +484 -0
  977. package/src/server/cookie-parsing.ts +163 -0
  978. package/src/server/csrf.ts +39 -6
  979. package/src/server/default-logger.ts +99 -0
  980. package/src/server/default-status-page.ts +127 -0
  981. package/src/server/deny-boundary.ts +516 -0
  982. package/src/server/deny-renderer.ts +181 -101
  983. package/src/server/dev-source-map.ts +31 -0
  984. package/src/server/early-hints-sender.ts +3 -2
  985. package/src/server/early-hints.ts +37 -27
  986. package/src/server/error-boundary-wrapper.ts +170 -44
  987. package/src/server/fallback-error.ts +79 -102
  988. package/src/server/flight-injection-state.ts +113 -0
  989. package/src/server/flight-scripts.ts +62 -0
  990. package/src/server/form-data.ts +124 -12
  991. package/src/server/head-response.ts +54 -0
  992. package/src/server/html-injector-core.ts +495 -0
  993. package/src/server/html-injectors.ts +271 -254
  994. package/src/server/index.ts +29 -185
  995. package/src/server/internal.ts +181 -0
  996. package/src/server/logger.ts +72 -36
  997. package/src/server/metadata-collector.ts +115 -0
  998. package/src/server/metadata-routes.ts +205 -24
  999. package/src/server/metadata.ts +21 -0
  1000. package/src/server/middleware-runner.ts +31 -4
  1001. package/src/server/node-stream-transforms.ts +336 -0
  1002. package/src/server/param-coercion.ts +189 -0
  1003. package/src/server/pipeline-helpers.ts +159 -0
  1004. package/src/server/pipeline-interception.ts +109 -33
  1005. package/src/server/pipeline-metadata.ts +14 -0
  1006. package/src/server/pipeline-outcome.ts +196 -0
  1007. package/src/server/pipeline-phases.ts +597 -0
  1008. package/src/server/pipeline.ts +321 -382
  1009. package/src/server/port-resolution.ts +215 -0
  1010. package/src/server/prebuilt/cache-key.ts +298 -0
  1011. package/src/server/prebuilt/capture-state.ts +89 -0
  1012. package/src/server/prebuilt/key-discipline.ts +53 -0
  1013. package/src/server/prebuilt/manifest-tag-index.ts +46 -0
  1014. package/src/server/prebuilt/overlay.ts +256 -0
  1015. package/src/server/prebuilt/payload-source.ts +201 -0
  1016. package/src/server/prebuilt/slots.ts +190 -0
  1017. package/src/server/prebuilt/synthetic-store.ts +121 -0
  1018. package/src/server/prebuilt-builder.ts +803 -0
  1019. package/src/server/prebuilt-runtime.ts +815 -0
  1020. package/src/server/primitives.ts +174 -90
  1021. package/src/server/publish-params.ts +42 -0
  1022. package/src/server/render-timeout.ts +108 -0
  1023. package/src/server/render-utils.ts +31 -0
  1024. package/src/server/request-context.ts +245 -333
  1025. package/src/server/request-dep.ts +37 -0
  1026. package/src/server/route-element-builder.ts +687 -307
  1027. package/src/server/route-handler.ts +39 -12
  1028. package/src/server/route-matcher.ts +162 -269
  1029. package/src/server/rsc-cache-key-guard.ts +164 -0
  1030. package/src/server/rsc-entry/action-middleware-runner.ts +167 -0
  1031. package/src/server/rsc-entry/api-handler.ts +67 -32
  1032. package/src/server/rsc-entry/deny-fallback.ts +93 -0
  1033. package/src/server/rsc-entry/error-renderer.ts +370 -94
  1034. package/src/server/rsc-entry/helpers.ts +226 -95
  1035. package/src/server/rsc-entry/index.ts +357 -330
  1036. package/src/server/rsc-entry/render-route.ts +308 -0
  1037. package/src/server/rsc-entry/revalidate-renderer.ts +350 -0
  1038. package/src/server/rsc-entry/rsc-payload.ts +188 -55
  1039. package/src/server/rsc-entry/rsc-stream.ts +122 -18
  1040. package/src/server/rsc-entry/ssr-bridge.ts +18 -5
  1041. package/src/server/rsc-entry/ssr-renderer.ts +299 -80
  1042. package/src/server/rsc-entry/wrap-action-dispatch.ts +186 -0
  1043. package/src/server/safe-load.ts +60 -0
  1044. package/src/server/sensitive-fields.ts +230 -0
  1045. package/src/server/server-only-guard-noop.js +3 -0
  1046. package/src/server/sitemap-generator.ts +339 -0
  1047. package/src/server/sitemap-handler.ts +157 -0
  1048. package/src/server/skippable-prefix.ts +74 -0
  1049. package/src/server/slot-interception.ts +168 -0
  1050. package/src/server/slot-resolver.ts +677 -294
  1051. package/src/server/ssr-bridge-types.ts +142 -0
  1052. package/src/server/ssr-entry.ts +216 -78
  1053. package/src/server/ssr-render.ts +345 -82
  1054. package/src/server/ssr-wrappers.tsx +142 -0
  1055. package/src/server/state-tree-diff.ts +85 -30
  1056. package/src/server/static-generator.ts +715 -0
  1057. package/src/server/static-not-found.ts +134 -0
  1058. package/src/server/status-code-resolver.ts +107 -148
  1059. package/src/server/stream-utils.ts +288 -0
  1060. package/src/server/tracing.ts +126 -14
  1061. package/src/server/tree-builder.ts +99 -168
  1062. package/src/server/tree-match.ts +262 -0
  1063. package/src/server/types.ts +83 -9
  1064. package/src/server/utils/element-type.ts +72 -0
  1065. package/src/server/utils/escape-html.ts +20 -0
  1066. package/src/server/utils/mdx-file.ts +22 -0
  1067. package/src/server/version-skew.ts +104 -0
  1068. package/src/server/workers-cache-bridge.ts +33 -0
  1069. package/src/shared/als-slots.ts +72 -0
  1070. package/src/shared/base-path.ts +80 -0
  1071. package/src/shared/href-validation.ts +159 -0
  1072. package/src/shared/merge-search-params.ts +55 -0
  1073. package/src/shared/param-value.ts +244 -0
  1074. package/src/shared/payload-root.ts +151 -0
  1075. package/src/shared/redirect-type.ts +17 -0
  1076. package/src/shared/rsc-cache-key.ts +269 -0
  1077. package/src/shared/rsc-error-envelope.ts +31 -0
  1078. package/src/shared/rsc-manifest.ts +29 -0
  1079. package/src/shared/rsc-media-type.ts +43 -0
  1080. package/src/shared/rsc-payload-path.ts +45 -0
  1081. package/src/shared/segment-info.ts +67 -0
  1082. package/src/shared/slot-params.ts +111 -0
  1083. package/src/shared/static-platform-files.ts +75 -0
  1084. package/src/shims/font-google.ts +1 -1
  1085. package/src/shims/font-local.ts +34 -0
  1086. package/src/shims/headers.ts +122 -1
  1087. package/src/shims/navigation-client.ts +36 -32
  1088. package/src/shims/navigation.ts +10 -7
  1089. package/src/utils/state-machine.ts +111 -0
  1090. package/dist/_chunks/als-registry-B7DbZ2hS.js +0 -41
  1091. package/dist/_chunks/als-registry-B7DbZ2hS.js.map +0 -1
  1092. package/dist/_chunks/debug-B3Gypr3D.js +0 -108
  1093. package/dist/_chunks/debug-B3Gypr3D.js.map +0 -1
  1094. package/dist/_chunks/format-RyoGQL74.js +0 -164
  1095. package/dist/_chunks/format-RyoGQL74.js.map +0 -1
  1096. package/dist/_chunks/interception-BOoWmLUA.js +0 -676
  1097. package/dist/_chunks/interception-BOoWmLUA.js.map +0 -1
  1098. package/dist/_chunks/metadata-routes-Cjmvi3rQ.js +0 -153
  1099. package/dist/_chunks/metadata-routes-Cjmvi3rQ.js.map +0 -1
  1100. package/dist/_chunks/request-context-BQUC8PHn.js +0 -330
  1101. package/dist/_chunks/request-context-BQUC8PHn.js.map +0 -1
  1102. package/dist/_chunks/ssr-data-MjmprTmO.js.map +0 -1
  1103. package/dist/_chunks/tracing-CemImE6h.js +0 -187
  1104. package/dist/_chunks/tracing-CemImE6h.js.map +0 -1
  1105. package/dist/_chunks/use-cookie-DX-l1_5E.js +0 -91
  1106. package/dist/_chunks/use-cookie-DX-l1_5E.js.map +0 -1
  1107. package/dist/_chunks/use-query-states-D5KaffOK.js +0 -109
  1108. package/dist/_chunks/use-query-states-D5KaffOK.js.map +0 -1
  1109. package/dist/adapters/cloudflare.js.map +0 -1
  1110. package/dist/cache/index.js.map +0 -1
  1111. package/dist/cache/register-cached-function.d.ts +0 -17
  1112. package/dist/cache/register-cached-function.d.ts.map +0 -1
  1113. package/dist/client/browser-entry.d.ts +0 -21
  1114. package/dist/client/browser-entry.d.ts.map +0 -1
  1115. package/dist/client/error-boundary.js.map +0 -1
  1116. package/dist/client/head.d.ts +0 -16
  1117. package/dist/client/head.d.ts.map +0 -1
  1118. package/dist/client/link-status-provider.d.ts +0 -11
  1119. package/dist/client/link-status-provider.d.ts.map +0 -1
  1120. package/dist/client/segment-merger.d.ts +0 -119
  1121. package/dist/client/segment-merger.d.ts.map +0 -1
  1122. package/dist/client/stale-reload.d.ts +0 -44
  1123. package/dist/client/stale-reload.d.ts.map +0 -1
  1124. package/dist/client/transition-root.d.ts +0 -74
  1125. package/dist/client/transition-root.d.ts.map +0 -1
  1126. package/dist/client/use-navigation-pending.d.ts +0 -26
  1127. package/dist/client/use-navigation-pending.d.ts.map +0 -1
  1128. package/dist/client/use-params.d.ts.map +0 -1
  1129. package/dist/plugins/cache-transform.d.ts +0 -36
  1130. package/dist/plugins/cache-transform.d.ts.map +0 -1
  1131. package/dist/plugins/dev-error-overlay.d.ts +0 -60
  1132. package/dist/plugins/dev-error-overlay.d.ts.map +0 -1
  1133. package/dist/plugins/dev-logs.d.ts.map +0 -1
  1134. package/dist/plugins/dynamic-transform.d.ts +0 -72
  1135. package/dist/plugins/dynamic-transform.d.ts.map +0 -1
  1136. package/dist/plugins/server-action-exports.d.ts +0 -26
  1137. package/dist/plugins/server-action-exports.d.ts.map +0 -1
  1138. package/dist/routing/status-file-lint.d.ts +0 -33
  1139. package/dist/routing/status-file-lint.d.ts.map +0 -1
  1140. package/dist/search-params/analyze.d.ts +0 -54
  1141. package/dist/search-params/analyze.d.ts.map +0 -1
  1142. package/dist/search-params/builtin-codecs.d.ts +0 -105
  1143. package/dist/search-params/builtin-codecs.d.ts.map +0 -1
  1144. package/dist/search-params/codecs.d.ts +0 -53
  1145. package/dist/search-params/codecs.d.ts.map +0 -1
  1146. package/dist/search-params/create.d.ts +0 -106
  1147. package/dist/search-params/create.d.ts.map +0 -1
  1148. package/dist/search-params/registry.d.ts +0 -20
  1149. package/dist/search-params/registry.d.ts.map +0 -1
  1150. package/dist/server/client-module-map.d.ts +0 -47
  1151. package/dist/server/client-module-map.d.ts.map +0 -1
  1152. package/dist/server/dev-fetch-instrumentation.d.ts +0 -22
  1153. package/dist/server/dev-fetch-instrumentation.d.ts.map +0 -1
  1154. package/dist/server/dev-logger.d.ts.map +0 -1
  1155. package/dist/server/dev-span-processor.d.ts +0 -29
  1156. package/dist/server/dev-span-processor.d.ts.map +0 -1
  1157. package/dist/server/dev-warnings.d.ts +0 -129
  1158. package/dist/server/dev-warnings.d.ts.map +0 -1
  1159. package/dist/server/flush.d.ts +0 -74
  1160. package/dist/server/flush.d.ts.map +0 -1
  1161. package/dist/server/manifest-status-resolver.d.ts +0 -58
  1162. package/dist/server/manifest-status-resolver.d.ts.map +0 -1
  1163. package/dist/server/prerender.d.ts +0 -77
  1164. package/dist/server/prerender.d.ts.map +0 -1
  1165. package/dist/utils/directive-parser.d.ts +0 -70
  1166. package/dist/utils/directive-parser.d.ts.map +0 -1
  1167. package/src/cache/register-cached-function.ts +0 -103
  1168. package/src/client/browser-entry.ts +0 -678
  1169. package/src/client/head.ts +0 -61
  1170. package/src/client/link-status-provider.tsx +0 -30
  1171. package/src/client/segment-merger.ts +0 -339
  1172. package/src/client/stale-reload.ts +0 -87
  1173. package/src/client/transition-root.tsx +0 -166
  1174. package/src/client/use-navigation-pending.ts +0 -38
  1175. package/src/plugins/cache-transform.ts +0 -199
  1176. package/src/plugins/dev-error-overlay.ts +0 -230
  1177. package/src/plugins/dynamic-transform.ts +0 -161
  1178. package/src/plugins/server-action-exports.ts +0 -220
  1179. package/src/routing/status-file-lint.ts +0 -112
  1180. package/src/search-params/analyze.ts +0 -192
  1181. package/src/search-params/builtin-codecs.ts +0 -228
  1182. package/src/search-params/codecs.ts +0 -153
  1183. package/src/search-params/create.ts +0 -321
  1184. package/src/search-params/registry.ts +0 -31
  1185. package/src/server/client-module-map.ts +0 -58
  1186. package/src/server/dev-fetch-instrumentation.ts +0 -96
  1187. package/src/server/dev-span-processor.ts +0 -78
  1188. package/src/server/dev-warnings.ts +0 -283
  1189. package/src/server/flush.ts +0 -182
  1190. package/src/server/manifest-status-resolver.ts +0 -215
  1191. package/src/server/prerender.ts +0 -139
  1192. package/src/utils/directive-parser.ts +0 -529
@@ -16,33 +16,77 @@
16
16
  * See design/02-rendering-pipeline.md §"Parallel Slots"
17
17
  */
18
18
 
19
- import { TimberErrorBoundary } from '#/client/error-boundary.js';
20
- import SlotErrorFallback from '#/client/slot-error-fallback.js';
19
+ import { TimberErrorBoundary } from '../client/error-boundary.js';
20
+ import SlotErrorFallback from '../client/slot-error-fallback.js';
21
21
  import { SlotAccessGate } from './access-gate.js';
22
22
  import { wrapSegmentWithErrorBoundaries } from './error-boundary-wrapper.js';
23
+ import { isClientReference } from './route-element-builder.js';
24
+ import { loadModule } from './safe-load.js';
23
25
  import type { InterceptionContext, RouteMatch } from './pipeline.js';
24
- import { DenySignal } from './primitives.js';
26
+ import { DenySignal, RedirectSignal } from './primitives.js';
27
+ import { logRenderError } from './logger.js';
25
28
  import type { ManifestSegmentNode } from './route-matcher.js';
29
+ import { setSlotParams, runWithSlotSegmentParams } from './request-context.js';
30
+ import { coerceSlotParams } from './param-coercion.js';
31
+ import { matchUrlParts } from './tree-match.js';
32
+ import { extractUrlParts, consumedPartsThroughSegment } from './chain-url-parts.js';
33
+ import { findInterceptingMatch } from './slot-interception.js';
34
+ import { SegmentOutlet } from '../client/segment-outlet.js';
35
+ import { shouldSkipSlot, type ClientStateTree } from './state-tree-diff.js';
36
+ import { computeSlotKey, computeSlotContentKey } from '../routing/segment-keys.js';
37
+ import { isStaticRequestDependent } from './request-dep.js';
26
38
 
27
39
  type CreateElementFn = (...args: unknown[]) => React.ReactElement;
28
40
 
41
+ // ─── Module Loading Helpers ─────────────────────────────────────────────────
42
+
43
+ /**
44
+ * Load a module and extract its default export as a component function.
45
+ * Returns undefined if no default export exists.
46
+ */
47
+ async function loadComponent(loader: {
48
+ load: () => Promise<unknown>;
49
+ filePath: string;
50
+ }): Promise<((...args: unknown[]) => unknown) | undefined> {
51
+ const mod = await loadModule(loader);
52
+ return mod.default as ((...args: unknown[]) => unknown) | undefined;
53
+ }
54
+
55
+ /**
56
+ * Load and render the default.tsx fallback for a slot node.
57
+ * Returns null if the slot has no default.tsx or it has no default export.
58
+ */
59
+ async function renderDefaultFallback(
60
+ slotNode: ManifestSegmentNode,
61
+ h: CreateElementFn
62
+ ): Promise<React.ReactElement | null> {
63
+ if (!slotNode.default) return null;
64
+ const DefaultComp = await loadComponent(slotNode.default);
65
+ if (!DefaultComp) return null;
66
+ return h(DefaultComp, {});
67
+ }
68
+
69
+ // ─── Slot Element Resolution ────────────────────────────────────────────────
70
+
29
71
  /**
30
72
  * Resolve the element for a parallel slot.
31
73
  *
32
74
  * Finds a matching page in the slot's sub-tree for the current route.
33
75
  * Falls back to default.tsx if no match, or null if no default.
34
76
  *
35
- * When a match is found, the element is wrapped with:
36
- * 1. Error boundaries from each segment in the slot's matched chain
37
- * 2. Layouts from each segment in the slot's matched chain
38
- * 3. SlotAccessGate if the slot root has access.ts
77
+ * When a match is found, the element is wrapped per segment in the slot's
78
+ * matched chain with (innermost → outermost):
79
+ * 1. Error boundaries
80
+ * 2. Layout
81
+ * 3. SlotAccessGate if the segment has access.ts (gate OUTSIDE the layout,
82
+ * so a denied layout never executes — see TIM-1074)
39
83
  */
40
84
  export async function resolveSlotElement(
41
85
  slotNode: ManifestSegmentNode,
42
86
  match: RouteMatch,
43
- paramsPromise: Promise<Record<string, string | string[]>>,
44
87
  h: CreateElementFn,
45
- interception?: InterceptionContext
88
+ interception?: InterceptionContext,
89
+ parentTreePath?: string
46
90
  ): Promise<React.ReactElement | null> {
47
91
  // When interception is active, try to match intercepting children in this
48
92
  // slot against the target pathname. If an intercepting child matches, render
@@ -54,133 +98,109 @@ export async function resolveSlotElement(
54
98
  : findSlotMatch(slotNode, match);
55
99
 
56
100
  if (slotMatch) {
57
- const mod = (await slotMatch.page.load()) as Record<string, unknown>;
58
- if (mod.default) {
59
- const SlotPage = mod.default as (...args: unknown[]) => unknown;
101
+ // Coerce the slot's own chain params through the global schema codecs
102
+ // (same as the main route) and expose them two ways:
103
+ //
104
+ // - keyed, in the ALS slot map, so `getSegmentParams(slotPath)` resolves
105
+ // from anywhere in the request;
106
+ // - scoped, around every component this resolver invokes from the slot's
107
+ // matched chain, so a no-arg `getSegmentParams()` inside the slot
108
+ // returns the slot's params instead of the main route's. An
109
+ // intercepting page has no other way to see its own params: the
110
+ // pipeline re-matched the SOURCE pathname, so the main params describe
111
+ // the page rendering *behind* the modal (TIM-1283).
112
+ //
113
+ // Both derive from the same coerced record, so the keyed overload and the
114
+ // no-arg call inside the slot can never disagree.
115
+ const coerced = coerceSlotParams(slotMatch.chain, slotMatch.slotParams);
116
+ const fullSlotPath = computeSlotSegmentPath(slotMatch.chain, parentTreePath);
117
+
118
+ if (fullSlotPath && Object.keys(coerced).length > 0) {
119
+ setSlotParams(fullSlotPath, coerced);
120
+ }
121
+ const scope = <T>(fn: () => T): T => runWithSlotSegmentParams(fullSlotPath, coerced, fn);
60
122
 
123
+ const SlotPage = await loadComponent(slotMatch.page);
124
+ if (SlotPage) {
61
125
  // Load default.tsx fallback for notFound() handling in the slot page.
62
126
  // When a slot page calls notFound() or deny(), it should gracefully
63
127
  // degrade to default.tsx or null — not crash the page. This matches
64
128
  // Next.js behavior. See design/02-rendering-pipeline.md
65
129
  // §"Slot Access Failure = Graceful Degradation"
66
- let denyFallback: React.ReactElement | null = null;
67
- if (slotNode.default) {
68
- const defaultMod = (await slotNode.default.load()) as Record<string, unknown>;
69
- const DefaultComp = defaultMod.default as ((...args: unknown[]) => unknown) | undefined;
70
- if (DefaultComp) {
71
- denyFallback = h(DefaultComp, { params: paramsPromise, searchParams: {} });
72
- }
73
- }
74
-
75
- // Wrap the slot page to catch DenySignal (from notFound() or deny())
76
- // at the component level. This prevents the signal from reaching the
77
- // RSC onError callback and being tracked as a page-level denial, which
78
- // would cause the pipeline to replace the entire successful SSR response
79
- // with a deny page. Instead, the slot gracefully degrades.
80
- const denyFallbackCapture = denyFallback;
81
- const SafeSlotPage = async (props: Record<string, unknown>) => {
82
- try {
83
- return await (SlotPage as (props: Record<string, unknown>) => unknown)(props);
84
- } catch (error) {
85
- if (error instanceof DenySignal) {
86
- return denyFallbackCapture;
87
- }
88
- throw error;
89
- }
90
- };
91
-
92
- let element: React.ReactElement = h(SafeSlotPage, {
93
- params: paramsPromise,
94
- searchParams: {},
95
- });
96
-
97
- // Wrap with error boundaries and layouts from intermediate slot segments
98
- // (everything between slot root and leaf). Process innermost-first, same
99
- // order as route-element-builder.ts handles main segments. The slot root
100
- // (index 0) is handled separately after the access gate below.
101
- for (let i = slotMatch.chain.length - 1; i > 0; i--) {
102
- const seg = slotMatch.chain[i];
103
-
104
- // Error boundaries from this segment
105
- element = await wrapSegmentWithErrorBoundaries(seg, element, h);
106
-
107
- // Layout from this segment
108
- if (seg.layout) {
109
- const layoutMod = (await seg.layout.load()) as Record<string, unknown>;
110
- if (layoutMod.default) {
111
- const Layout = layoutMod.default as (...args: unknown[]) => unknown;
112
- element = h(Layout, {
113
- params: paramsPromise,
114
- searchParams: {},
115
- children: element,
116
- });
117
- }
118
- }
119
- }
120
-
121
- // Wrap in SlotAccessGate if slot root has access.ts.
122
- // On denial: denied.tsx → default.tsx → null (graceful degradation).
123
- // See design/04-authorization.md §"Slot-Level Auth".
124
- if (slotNode.access) {
125
- const accessMod = (await slotNode.access.load()) as Record<string, unknown>;
126
- const accessFn = accessMod.default as
127
- | ((ctx: { params: Record<string, string | string[]>; searchParams: unknown }) => unknown)
128
- | undefined;
129
- if (accessFn) {
130
- // Load denied.tsx fallback
131
- let deniedFallback: React.ReactElement | null = null;
132
- if (slotNode.denied) {
133
- const deniedMod = (await slotNode.denied.load()) as Record<string, unknown>;
134
- const DeniedComponent = deniedMod.default as
135
- | ((...args: unknown[]) => unknown)
136
- | undefined;
137
- if (DeniedComponent) {
138
- deniedFallback = h(DeniedComponent, {});
130
+ const denyFallback = await renderDefaultFallback(slotNode, h);
131
+
132
+ // Build the slot page element.
133
+ // Client references ('use client' pages) must NOT be called as functions —
134
+ // they are proxy objects that throw when invoked. For client references,
135
+ // use createElement directly. Error catching is unnecessary because client
136
+ // references are serialized as references in the RSC Flight stream — they
137
+ // don't execute on the server. See TIM-627.
138
+ //
139
+ // For server components, wrap in SafeSlotPage to catch ALL errors at the
140
+ // component level. This prevents errors from leaving unresolved Flight
141
+ // rows in the RSC stream — see TIM-524 for details.
142
+ let element: React.ReactElement;
143
+ if (isClientReference(SlotPage)) {
144
+ element = h(SlotPage, {});
145
+ } else {
146
+ const SafeSlotPage = async (props: Record<string, unknown>) => {
147
+ try {
148
+ return await scope(() =>
149
+ (SlotPage as (props: Record<string, unknown>) => unknown)(props)
150
+ );
151
+ } catch (error) {
152
+ // RedirectSignal must propagate — the pipeline handles redirects
153
+ // at the top level. Swallowing it here would silently return
154
+ // fallback content instead of redirecting. See TIM-554.
155
+ if (error instanceof RedirectSignal) {
156
+ throw error;
139
157
  }
140
- }
141
-
142
- // Load default.tsx fallback
143
- let defaultFallback: React.ReactElement | null = null;
144
- if (slotNode.default) {
145
- const defaultMod = (await slotNode.default.load()) as Record<string, unknown>;
146
- const DefaultComp = defaultMod.default as ((...args: unknown[]) => unknown) | undefined;
147
- if (DefaultComp) {
148
- defaultFallback = h(DefaultComp, { params: paramsPromise, searchParams: {} });
158
+ if (error instanceof DenySignal) {
159
+ return denyFallback;
149
160
  }
161
+ // Log the error but don't re-throw — returning fallback ensures
162
+ // the Flight row is resolved and the page hydrates correctly.
163
+ logRenderError({
164
+ method: '',
165
+ path: '',
166
+ error,
167
+ });
168
+ return denyFallback;
150
169
  }
151
-
152
- const params = await paramsPromise;
153
- element = h(SlotAccessGate, {
154
- accessFn,
155
- params,
156
- searchParams: {},
157
- deniedFallback,
158
- defaultFallback,
159
- children: element,
160
- });
161
- }
170
+ };
171
+ element = h(SafeSlotPage, {});
162
172
  }
163
173
 
164
- // Wrap with slot root's layout (outermost, outside access gate)
165
- if (slotNode.layout) {
166
- const layoutMod = (await slotNode.layout.load()) as Record<string, unknown>;
167
- if (layoutMod.default) {
168
- const Layout = layoutMod.default as (...args: unknown[]) => unknown;
169
- element = h(Layout, {
170
- params: paramsPromise,
171
- searchParams: {},
172
- children: element,
173
- });
174
- }
175
- }
174
+ // Wrap with error boundaries, layouts, and access gates from
175
+ // intermediate slot segments (everything between slot root and leaf).
176
+ // Process innermost-first, same order as route-element-builder.ts
177
+ // handles main segments. The slot root (index 0) is handled below.
178
+ element = await wrapWithIntermediateSegments(slotMatch.chain, element, h, scope);
179
+
180
+ // Wrap with slot root's layout — INSIDE the access gate, so the layout
181
+ // server component never executes when access.ts denies. See TIM-1074.
182
+ element = await wrapWithLayout(slotNode, element, h, scope);
183
+
184
+ // Wrap in SlotAccessGate if slot root has access.ts. The gate is
185
+ // OUTSIDE the layout, matching the segment model in
186
+ // route-element-builder.ts: a denied layout must not render, or it
187
+ // would fetch/serialize protected data into the RSC Flight stream.
188
+ // On denial: denied.tsx → default.tsx → null (graceful degradation),
189
+ // rendered WITHOUT the denied slot's own layout.
190
+ // See design/04-authorization.md §"Slot-Level Auth".
191
+ element = await wrapWithAccessGate(slotNode, element, h, scope);
176
192
 
177
193
  // Wrap with slot root's error boundaries (outermost)
178
- element = await wrapSegmentWithErrorBoundaries(slotNode, element, h);
194
+ element = await wrapSegmentWithErrorBoundaries(slotNode, element, {
195
+ loadModule,
196
+ createElement: h,
197
+ errorBoundaryComponent: TimberErrorBoundary,
198
+ });
179
199
 
180
200
  // Catch-all error boundary: ensures slot errors NEVER propagate to the
181
201
  // parent layout. Without this, a slot without error.tsx that throws
182
202
  // causes SSR's renderToReadableStream to reject, triggering renderDenyPage
183
- // which re-executes all layout server components (including headers() calls
203
+ // which re-executes all layout server components (including getHeaders() calls
184
204
  // that fail in the SSR environment). The null fallback means the slot
185
205
  // degrades to nothing — consistent with the slot access denial behavior.
186
206
  // See design/02-rendering-pipeline.md §"Slot Access Failure = Graceful Degradation"
@@ -194,25 +214,185 @@ export async function resolveSlotElement(
194
214
  }
195
215
  }
196
216
 
197
- // No matching page — render default.tsx fallback
198
- if (slotNode.default) {
199
- const mod = (await slotNode.default.load()) as Record<string, unknown>;
200
- if (mod.default) {
201
- const DefaultComponent = mod.default as (...args: unknown[]) => unknown;
202
- return h(DefaultComponent, { params: paramsPromise, searchParams: {} });
203
- }
217
+ // No matching page — render default.tsx fallback.
218
+ // Per design/02-rendering-pipeline.md: "No access check for default.tsx."
219
+ // Access verdicts from the eager evaluation are not applied here.
220
+ // Pass taintKey so accessor calls inside default.tsx are scoped to this
221
+ return renderDefaultFallback(slotNode, h);
222
+ }
223
+
224
+ /**
225
+ * The full tree path of a slot's matched chain — the key both the ALS slot
226
+ * params map and the generated `getSegmentParams` overloads use.
227
+ *
228
+ * Built from the parent's tree path plus each chain node's directory name,
229
+ * so an intercepting node contributes its marker
230
+ * (`/gallery/@modal/(.)photo/[id]`) and a route group contributes its
231
+ * parentheses. Returns undefined when the caller has no parent tree path,
232
+ * which is how the resolver's test callers and any path-less entry point opt
233
+ * out of keyed lookups.
234
+ *
235
+ * One definition for both the render path and the eager access path: they
236
+ * key the same map, and a divergence would silently strand one of them.
237
+ */
238
+ function computeSlotSegmentPath(
239
+ chain: ManifestSegmentNode[],
240
+ parentTreePath: string | undefined
241
+ ): string | undefined {
242
+ if (!parentTreePath) return undefined;
243
+ const slotSuffix = chain
244
+ .map((s) => s.segmentName)
245
+ .filter(Boolean)
246
+ .join('/');
247
+ const prefix = parentTreePath === '/' ? '' : parentTreePath;
248
+ return `${prefix}/${slotSuffix}`;
249
+ }
250
+
251
+ // ─── Element Wrapping Helpers ───────────────────────────────────────────────
252
+
253
+ /**
254
+ * Wrap an element with error boundaries, access gates, and layouts from
255
+ * intermediate slot segments (indices 1..n, skipping the slot root at index 0).
256
+ * Processes innermost-first to match route-element-builder.ts ordering.
257
+ *
258
+ * Access gates are enforced for every intermediate segment that has access.ts,
259
+ * not just the slot root. Without this, nested slot children (e.g.,
260
+ * @admin/reports/access.ts) and intercepting route children with access.ts
261
+ * would bypass authorization. See TIM-999.
262
+ *
263
+ * Wrap order per segment (innermost → outermost): error boundaries → layout
264
+ * → access gate. The gate must be OUTSIDE the layout so a denying access.ts
265
+ * prevents the layout server component from executing — otherwise the layout
266
+ * would fetch/serialize protected data into the RSC Flight stream. Matches
267
+ * route-element-builder.ts. See TIM-1074.
268
+ */
269
+ async function wrapWithIntermediateSegments(
270
+ chain: ManifestSegmentNode[],
271
+ element: React.ReactElement,
272
+ h: CreateElementFn,
273
+ scope?: SlotParamScope
274
+ ): Promise<React.ReactElement> {
275
+ for (let i = chain.length - 1; i > 0; i--) {
276
+ const seg = chain[i];
277
+ element = await wrapSegmentWithErrorBoundaries(seg, element, {
278
+ loadModule,
279
+ createElement: h,
280
+ errorBoundaryComponent: TimberErrorBoundary,
281
+ });
282
+ element = await wrapWithLayout(seg, element, h, scope);
283
+ element = await wrapWithAccessGate(seg, element, h, scope);
284
+ }
285
+ return element;
286
+ }
287
+
288
+ /**
289
+ * Runs a function with the slot's own segment params in scope.
290
+ *
291
+ * Applied to every component this module invokes from a slot's matched chain
292
+ * — page, layouts, access functions — so all of them agree on what a no-arg
293
+ * `getSegmentParams()` means inside a slot. A partial application would be
294
+ * worse than none: a layout and the page under it would disagree about the
295
+ * params of the same render.
296
+ */
297
+ type SlotParamScope = <T>(fn: () => T) => T;
298
+
299
+ /**
300
+ * Invokes a slot layout inside that slot's param scope.
301
+ *
302
+ * Declared at module scope, and given the layout and the scope as props,
303
+ * so its component identity is the same on every render. A closure created
304
+ * per render would be a new component type each time, and React would
305
+ * unmount and remount the whole layout subtree — including client
306
+ * components' state — on every navigation that re-renders the slot.
307
+ *
308
+ * Server component: the function-valued props are called here on the server
309
+ * and never reach the Flight stream, the same way `SlotAccessGate` takes
310
+ * `accessFn`.
311
+ */
312
+ function ScopedSlotLayout(props: {
313
+ layout: (props: Record<string, unknown>) => unknown;
314
+ scope: SlotParamScope;
315
+ children: React.ReactElement;
316
+ }): unknown {
317
+ return props.scope(() => props.layout({ children: props.children }));
318
+ }
319
+
320
+ /**
321
+ * Wrap an element with a segment's layout component, if present.
322
+ *
323
+ * A server-component layout is invoked through the slot param scope, so it
324
+ * sees the slot's params rather than the main route's — a layout and the
325
+ * page beneath it must not disagree about the params of one render. A
326
+ * client-reference layout is passed through untouched: it never executes on
327
+ * the server, and its params arrive over the client channel
328
+ * (`useSegmentParams`).
329
+ */
330
+ async function wrapWithLayout(
331
+ node: ManifestSegmentNode,
332
+ element: React.ReactElement,
333
+ h: CreateElementFn,
334
+ scope?: SlotParamScope
335
+ ): Promise<React.ReactElement> {
336
+ if (!node.layout) return element;
337
+ const Layout = await loadComponent(node.layout);
338
+ if (!Layout) return element;
339
+ if (!scope || isClientReference(Layout)) return h(Layout, { children: element });
340
+
341
+ return h(ScopedSlotLayout, {
342
+ layout: Layout as (props: Record<string, unknown>) => unknown,
343
+ scope,
344
+ children: element,
345
+ });
346
+ }
347
+
348
+ /**
349
+ * Wrap an element with a SlotAccessGate if the node has access.ts.
350
+ * On denial: denied.tsx → default.tsx → null (graceful degradation).
351
+ */
352
+ async function wrapWithAccessGate(
353
+ slotNode: ManifestSegmentNode,
354
+ element: React.ReactElement,
355
+ h: CreateElementFn,
356
+ scope?: SlotParamScope
357
+ ): Promise<React.ReactElement> {
358
+ if (!slotNode.access) return element;
359
+
360
+ const loaded = await loadComponent(slotNode.access);
361
+ if (!loaded) return element;
362
+
363
+ // The gate calls this during render, so the scope has to travel with the
364
+ // function rather than wrap the call site.
365
+ const accessFn = scope ? () => scope(() => loaded()) : loaded;
366
+
367
+ let DeniedComponent: ((...args: unknown[]) => unknown) | null = null;
368
+ if (slotNode.denied) {
369
+ DeniedComponent = (await loadComponent(slotNode.denied)) ?? null;
204
370
  }
205
371
 
206
- // No page and no default — slot renders nothing
207
- return null;
372
+ const slotName = slotNode.segmentName?.replace(/^@/, '') ?? '';
373
+
374
+ const defaultFallback = await renderDefaultFallback(slotNode, h);
375
+
376
+ return h(SlotAccessGate, {
377
+ accessFn,
378
+ DeniedComponent,
379
+ slotName,
380
+ createElement: h,
381
+ defaultFallback,
382
+ children: element,
383
+ });
208
384
  }
209
385
 
386
+ // ─── Slot Matching ──────────────────────────────────────────────────────────
387
+
210
388
  /** Result of matching a slot's sub-tree against the current route. */
211
- interface SlotMatchResult {
389
+ export interface SlotMatchResult {
212
390
  /** The page file at the matched leaf. */
213
391
  page: NonNullable<ManifestSegmentNode['page']>;
214
392
  /** The full chain of slot nodes traversed (slot root → … → leaf with page). */
215
393
  chain: ManifestSegmentNode[];
394
+ /** Params collected from the slot's segment chain (may differ from main route params). */
395
+ slotParams: Record<string, string | string[]>;
216
396
  }
217
397
 
218
398
  /**
@@ -230,205 +410,408 @@ interface SlotMatchResult {
230
410
  * We compare the matched route's segment chain against the slot's children
231
411
  * to find the deepest matching page.
232
412
  */
233
- function findSlotMatch(slotNode: ManifestSegmentNode, match: RouteMatch): SlotMatchResult | null {
234
- const segments = match.segments as unknown as ManifestSegmentNode[];
235
-
236
- // Find the parent segment that owns this slot by comparing urlPaths.
237
- // The slot's urlPath matches its parent's urlPath (slots don't add URL depth).
238
- // Search BACKWARDS to find the deepest (last) matching segment. Multiple
239
- // segments can share the same urlPath when route groups are involved (e.g.,
240
- // Root urlPath='/' and (browse) urlPath='/'). The slot's parent is always
241
- // the deepest one — searching forward would incorrectly pick the root,
242
- // making remainingSegments too long and breaking slot matching.
243
- const slotUrlPath = slotNode.urlPath;
244
- let parentIndex = -1;
413
+ /**
414
+ * The index in the matched chain of the segment that owns this slot.
415
+ *
416
+ * **By identity**, because `urlPath` cannot answer it. Slots add no URL depth,
417
+ * so the owner shares the slot's `urlPath` — but so does every route group
418
+ * above it (`/` for both the root and `(browse)`), and since TIM-1280 so does
419
+ * an intercepting node on the children path, which sits *below* the owner.
420
+ * Picking the deepest urlPath match — the rule before this — therefore chose
421
+ * the intercepting node for a tree like `(browse)/@sidebar/` +
422
+ * `(browse)/(.)item/[id]/`, slicing one segment too many off the chain and
423
+ * handing `@sidebar` a shorter URL than it matches against. It would render
424
+ * its `default.tsx` where a page exists.
425
+ *
426
+ * The index must also agree with `slotUrlParts`, which slices the destination
427
+ * pathname at the same point and already used `indexOf(owner)`. Two derivations
428
+ * of one index is how they came apart; this is the shared one.
429
+ *
430
+ * The `urlPath` search survives only as a fallback for a `slotNode` that is not
431
+ * attached to any segment in the chain. Production never does that —
432
+ * `resolveSlotProps` iterates `segment.slots` — but unit tests construct a slot
433
+ * node standalone, and for those the old behaviour is still the right answer.
434
+ */
435
+ export function findSlotOwnerIndex(
436
+ slotNode: ManifestSegmentNode,
437
+ segments: ManifestSegmentNode[]
438
+ ): number {
245
439
  for (let i = segments.length - 1; i >= 0; i--) {
246
- if (segments[i].urlPath === slotUrlPath) {
247
- parentIndex = i;
248
- break;
440
+ for (const candidate of Object.values(segments[i].slots ?? {})) {
441
+ if (candidate === slotNode) return i;
249
442
  }
250
443
  }
251
444
 
445
+ for (let i = segments.length - 1; i >= 0; i--) {
446
+ if (segments[i].urlPath === slotNode.urlPath) return i;
447
+ }
448
+
449
+ return -1;
450
+ }
451
+
452
+ function findSlotMatch(slotNode: ManifestSegmentNode, match: RouteMatch): SlotMatchResult | null {
453
+ const segments = match.segments;
454
+
455
+ const parentIndex = findSlotOwnerIndex(slotNode, segments);
456
+
252
457
  // The remaining segments after the parent are what we need to match
253
458
  // against the slot's children.
254
459
  const remainingSegments = parentIndex >= 0 ? segments.slice(parentIndex + 1) : [];
255
460
 
256
- // If no remaining segments, the slot's own page matches
257
- if (remainingSegments.length === 0) {
258
- if (slotNode.page) {
259
- return { page: slotNode.page, chain: [slotNode] };
260
- }
261
- // Check for optional-catch-all child — [[...slug]] matches zero segments
262
- for (const child of slotNode.children ?? []) {
263
- if (child.segmentType === 'optional-catch-all' && child.page) {
264
- return { page: child.page, chain: [slotNode, child] };
265
- }
266
- }
267
- return null;
268
- }
461
+ // Extract raw URL parts from the remaining main-route segments.
462
+ // Use rawSegmentParams (pre-coercion) to ensure we get actual URL strings,
463
+ // not codec-transformed values. Fall back to segmentParams for tests/compat.
464
+ const rawParams = match.rawSegmentParams ?? match.segmentParams ?? {};
465
+ const urlParts = extractUrlParts(remainingSegments, rawParams);
269
466
 
270
- // Walk the slot's children to match remaining URL segments.
271
- // Track the chain so we can apply error boundaries and layouts.
272
- const chain: ManifestSegmentNode[] = [slotNode];
273
- let currentNode = slotNode;
274
- for (const seg of remainingSegments) {
275
- const childName = seg.segmentName;
276
- const directChildren = currentNode.children ?? [];
277
-
278
- let found: ManifestSegmentNode | null = null;
279
- for (const child of directChildren) {
280
- // Exact static match
281
- if (child.segmentType === 'static' && child.segmentName === childName) {
282
- found = child;
283
- break;
284
- }
285
- }
467
+ // Match URL parts against the slot's segment tree using the shared walker.
468
+ // Handles zero parts (slot's own page), catch-all, optional-catch-all,
469
+ // groups, backtracking, and correct priority ordering.
470
+ const result = matchUrlParts(slotNode, urlParts);
471
+ if (!result) return null;
286
472
 
287
- // Try dynamic segments if no static match
288
- if (!found) {
289
- for (const child of directChildren) {
290
- if (child.segmentType === 'dynamic') {
291
- found = child;
292
- break;
293
- }
294
- }
295
- }
473
+ const leaf = result.chain[result.chain.length - 1];
474
+ if (!leaf.page) return null;
296
475
 
297
- // Try catch-all segments — these consume ALL remaining URL segments,
298
- // so we break out of the outer loop immediately.
299
- if (!found) {
300
- for (const child of directChildren) {
301
- if (child.segmentType === 'catch-all' || child.segmentType === 'optional-catch-all') {
302
- found = child;
303
- break;
304
- }
305
- }
306
- if (found) {
307
- chain.push(found);
308
- currentNode = found;
309
- break;
310
- }
476
+ return { page: leaf.page, chain: result.chain, slotParams: result.params };
477
+ }
478
+
479
+ // ─── Slot Caching ──────────────────────────────────────────────────────────
480
+
481
+ export interface SlotSkipEntry {
482
+ slotKey: string;
483
+ parentSegmentId: string;
484
+ /**
485
+ * Whether the slot's components called request accessors (getHeaders,
486
+ * getSearchParams, cookies) during their last render. Replaces the
487
+ * unreliable AsyncFunction heuristic — taint-tracked via ALS.
488
+ */
489
+ isRequestDependent: boolean;
490
+ /** Whether the slot's access.ts denied on this render. */
491
+ denied: boolean;
492
+ /** Whether the slot was skipped (content not rendered, client keeps cached). */
493
+ skipped?: boolean;
494
+ /**
495
+ * Content key encoding owner parts + slot name + entry file + slot params.
496
+ * Sent to the client via X-Timber-Segments; the client advertises it back
497
+ * so the server can decide skips by key membership (TIM-1370).
498
+ */
499
+ contentKey: string;
500
+ }
501
+
502
+ /**
503
+ * The destination URL parts a segment's slots match against.
504
+ *
505
+ * A slot walks its own sub-tree starting where its owning segment stopped
506
+ * consuming the URL, so the parts are sliced at the length its ancestors
507
+ * consumed. Shared by `resolveSlotProps` and `publishSlotSegmentParams` — both
508
+ * have to slice identically or the two would disagree about which page a slot
509
+ * matched, and only one of them would be right.
510
+ *
511
+ * @internal
512
+ */
513
+ export function slotUrlParts(
514
+ segment: ManifestSegmentNode,
515
+ match: RouteMatch,
516
+ url: string
517
+ ): string[] {
518
+ const pathname = new URL(url, 'http://localhost').pathname;
519
+ // Slice through the owning segment inclusive, to match findSlotMatch, which
520
+ // walks the chain from parentIndex + 1. `consumedUrlParts` drops the root
521
+ // (it consumes no URL part) and honors the interception anchor, so a slot on
522
+ // a retained owner above a climbing marker is not handed parts the target
523
+ // does not contain.
524
+ const sliceAt = consumedPartsThroughSegment(segment, match).length;
525
+ const all = pathname === '/' ? [] : pathname.slice(1).split('/');
526
+ return all.slice(sliceAt);
527
+ }
528
+
529
+ /**
530
+ * Seed per-slot segment params for a segment whose layout is being SKIPPED.
531
+ *
532
+ * `resolveSlotProps` seeds these as part of resolving slot props, but a skipped
533
+ * layout never gets there — `route-element-builder` continues past it. Its
534
+ * slots are still mounted on the client, though, so leaving them out of the
535
+ * published map made `useSegmentParams(slotPath)` fall back to the main route's
536
+ * record after any navigation that skipped their parent (TIM-1285).
537
+ *
538
+ * Only the params are seeded. Nothing renders, no access chain runs — a skipped
539
+ * layout's slots are unchanged by definition, which is what made it skippable.
540
+ *
541
+ * @internal
542
+ */
543
+ export function publishSlotSegmentParams(
544
+ segment: ManifestSegmentNode,
545
+ match: RouteMatch,
546
+ destinationUrl: string,
547
+ parentTreePath: string | undefined
548
+ ): void {
549
+ const slotEntries = Object.entries(segment.slots ?? {});
550
+ if (slotEntries.length === 0) return;
551
+ const destinationParts = slotUrlParts(segment, match, destinationUrl);
552
+
553
+ for (const [, slotNode] of slotEntries) {
554
+ const destMatch = matchUrlParts(slotNode as ManifestSegmentNode, destinationParts);
555
+ if (!destMatch) continue;
556
+ const coerced = coerceSlotParams(destMatch.chain, destMatch.params);
557
+ const fullSlotPath = computeSlotSegmentPath(destMatch.chain, parentTreePath);
558
+ if (fullSlotPath && Object.keys(coerced).length > 0) {
559
+ setSlotParams(fullSlotPath, coerced);
311
560
  }
561
+ }
562
+ }
312
563
 
313
- // Try group children (transparent)
314
- if (!found) {
315
- for (const child of directChildren) {
316
- if (child.segmentType === 'group') {
317
- for (const groupChild of child.children ?? []) {
318
- if (groupChild.segmentName === childName) {
319
- found = groupChild;
564
+ /**
565
+ * Emit slot metadata for a layout whose rendering was SKIPPED.
566
+ *
567
+ * Skipped layouts never reach `resolveSlotProps`, but the client rebuilds
568
+ * its segment tree from each navigation's X-Timber-Segments response. If
569
+ * skipped slots are absent, the client loses their contentKeys and can't
570
+ * advertise them on the next navigation — breaking key-based slot skipping.
571
+ *
572
+ * This computes contentKey and isRequestDependent for each slot without
573
+ * rendering anything, using the same derivation as `resolveSlotProps`.
574
+ */
575
+ export function emitSlotInfoForSkippedLayout(
576
+ segment: ManifestSegmentNode,
577
+ segmentId: string,
578
+ match: RouteMatch,
579
+ destinationUrl: string,
580
+ slotSkipInfo: SlotSkipEntry[]
581
+ ): void {
582
+ const slotEntries = Object.entries(segment.slots ?? {});
583
+ if (slotEntries.length === 0) return;
584
+
585
+ const destinationParts = slotUrlParts(segment, match, destinationUrl);
586
+ const ownerParts = consumedPartsThroughSegment(segment, match);
587
+
588
+ for (const [slotName, slotNode] of slotEntries) {
589
+ const slotManifest = slotNode as ManifestSegmentNode;
590
+ const slotKey = computeSlotKey(segmentId, `@${slotName}`);
591
+ const destMatch = matchUrlParts(slotManifest, destinationParts);
592
+
593
+ const destLeaf = destMatch?.chain[destMatch.chain.length - 1];
594
+ const entryFile = destLeaf?.page?.filePath ?? null;
595
+ const contentKey = computeSlotContentKey(
596
+ slotKey,
597
+ ownerParts,
598
+ entryFile,
599
+ destMatch?.params ?? {}
600
+ );
601
+
602
+ const hasAccessInChain =
603
+ !!slotManifest.access || (destMatch?.chain.some((seg) => seg.access) ?? false);
604
+
605
+ let slotRequestDep = hasAccessInChain;
606
+ if (!slotRequestDep) {
607
+ const hasRenderedPage = destMatch && destLeaf?.page;
608
+ if (hasRenderedPage) {
609
+ if (
610
+ slotManifest.layout?.filePath &&
611
+ isStaticRequestDependent(slotManifest.layout.filePath)
612
+ ) {
613
+ slotRequestDep = true;
614
+ }
615
+ if (!slotRequestDep) {
616
+ for (const seg of destMatch.chain) {
617
+ if (seg.layout?.filePath && isStaticRequestDependent(seg.layout.filePath)) {
618
+ slotRequestDep = true;
320
619
  break;
321
620
  }
322
621
  }
323
- if (found) break;
622
+ }
623
+ if (!slotRequestDep && destLeaf?.page?.filePath) {
624
+ slotRequestDep = isStaticRequestDependent(destLeaf.page.filePath);
625
+ }
626
+ } else {
627
+ const defaultFile = slotManifest.default?.filePath;
628
+ if (!defaultFile) {
629
+ slotRequestDep = true;
630
+ } else {
631
+ slotRequestDep = isStaticRequestDependent(defaultFile);
324
632
  }
325
633
  }
326
634
  }
327
635
 
328
- if (!found) {
329
- // No matching child in slot tree — slot doesn't match this URL
330
- return null;
331
- }
332
- chain.push(found);
333
- currentNode = found;
636
+ slotSkipInfo.push({
637
+ slotKey,
638
+ parentSegmentId: segmentId,
639
+ isRequestDependent: slotRequestDep,
640
+ denied: false,
641
+ contentKey,
642
+ });
334
643
  }
644
+ }
335
645
 
336
- if (currentNode.page) {
337
- return { page: currentNode.page, chain };
338
- }
339
- return null;
646
+ interface ResolveSlotPropsArgs {
647
+ segment: ManifestSegmentNode;
648
+ segmentId: string;
649
+ match: RouteMatch;
650
+ h: CreateElementFn;
651
+ interception?: InterceptionContext;
652
+ parentTreePath: string;
653
+ destinationUrl: string;
654
+ clientStateTree: ClientStateTree | null;
655
+ slotSkipInfo: SlotSkipEntry[];
340
656
  }
341
657
 
342
658
  /**
343
- * Find a matching intercepting route in a slot's children for the target pathname.
344
- *
345
- * When interception is active, the pipeline has already re-matched the source URL.
346
- * Here we check the slot's intercepting children (e.g. `(.)photo/[id]`) against
347
- * the target pathname to find which intercepting page to render.
659
+ * Resolve all parallel route slots for a layout, wrapping each in a
660
+ * SegmentOutlet for client-side caching. Slots whose content key matches
661
+ * one the client advertised are rendered with `skip=true` so the client
662
+ * keeps its cached content.
348
663
  *
349
- * The interceptedSegmentName tells us the first URL segment to look for in the
350
- * target pathname. We then walk the intercepting child's sub-tree to match
351
- * remaining segments.
664
+ * The skip decision is key-based (TIM-1370): the server computes a content
665
+ * key per slot from the owning segment's URL parts, the slot name, the
666
+ * matched entry file, and the slot's own params. The client advertises
667
+ * the keys it has cached; the server checks membership. This replaces
668
+ * the previous approach of reconstructing the client's state from a
669
+ * departing URL.
352
670
  */
353
- function findInterceptingMatch(
354
- slotNode: ManifestSegmentNode,
355
- targetPathname: string
356
- ): SlotMatchResult | null {
357
- const targetParts = targetPathname === '/' ? [] : targetPathname.slice(1).split('/');
358
-
359
- for (const child of slotNode.children) {
360
- if (child.segmentType !== 'intercepting' || !child.interceptedSegmentName) continue;
361
-
362
- const segName = child.interceptedSegmentName;
363
-
364
- // Find where the intercepted segment name appears in the target parts.
365
- // Search from the end since intercepted routes match the URL tail.
366
- let matchIdx = -1;
367
- for (let i = targetParts.length - 1; i >= 0; i--) {
368
- if (targetParts[i] === segName) {
369
- matchIdx = i;
370
- break;
371
- }
372
- }
373
- if (matchIdx < 0) continue;
374
-
375
- // Walk the intercepting child's sub-tree to match remaining target parts
376
- const remaining = targetParts.slice(matchIdx + 1);
377
- const chain: ManifestSegmentNode[] = [slotNode, child];
378
-
379
- if (remaining.length === 0) {
380
- if (child.page) {
381
- return { page: child.page, chain };
382
- }
383
- continue;
384
- }
385
-
386
- let currentNode = child;
387
- let matched = true;
388
- for (const part of remaining) {
389
- const children = currentNode.children ?? [];
390
- let found: ManifestSegmentNode | null = null;
391
-
392
- // Static match
393
- for (const c of children) {
394
- if (c.segmentType === 'static' && c.segmentName === part) {
395
- found = c;
396
- break;
671
+ export async function resolveSlotProps({
672
+ segment,
673
+ segmentId,
674
+ match,
675
+ h,
676
+ interception,
677
+ parentTreePath,
678
+ destinationUrl,
679
+ clientStateTree,
680
+ slotSkipInfo,
681
+ }: ResolveSlotPropsArgs): Promise<Record<string, unknown>> {
682
+ const slotProps: Record<string, unknown> = {};
683
+ const slotEntries = Object.entries(segment.slots ?? {});
684
+ if (slotEntries.length === 0) return slotProps;
685
+
686
+ const destinationParts = slotUrlParts(segment, match, destinationUrl);
687
+ const clientSlotKeys = clientStateTree?.slots ?? null;
688
+
689
+ // Owner URL parts — the URL values consumed through this segment.
690
+ // These are part of the content key because the slot's page may read
691
+ // parent params (e.g., via getSegmentParams).
692
+ const ownerParts = consumedPartsThroughSegment(segment, match);
693
+
694
+ for (const [slotName, slotNode] of slotEntries) {
695
+ const slotManifest = slotNode as ManifestSegmentNode;
696
+ const slotKey = computeSlotKey(segmentId, `@${slotName}`);
697
+
698
+ // Match the slot's sub-tree against the destination URL parts.
699
+ const destMatch = matchUrlParts(slotManifest, destinationParts);
700
+
701
+ // Compute the content key for this slot at the destination URL.
702
+ const destLeaf = destMatch?.chain[destMatch.chain.length - 1];
703
+ const entryFile = destLeaf?.page?.filePath ?? null;
704
+ const contentKey = computeSlotContentKey(
705
+ slotKey,
706
+ ownerParts,
707
+ entryFile,
708
+ destMatch?.params ?? {}
709
+ );
710
+
711
+ // Auth-bearing slots are inherently request-dependent — their content
712
+ // changes based on user state. Skipping them would require eager
713
+ // evaluation of access.ts outside React.cache scope, causing double
714
+ // execution (TIM-1364). Instead, exclude them from skip candidates
715
+ // entirely and let SlotAccessGate handle access during render.
716
+ // The client filters these out via isRequestDependent, so their keys
717
+ // are never advertised — but checking here is defense-in-depth.
718
+ const hasAccessInChain =
719
+ !!slotManifest.access || (destMatch?.chain.some((seg) => seg.access) ?? false);
720
+ const hasInterceptingChildren = slotManifest.children.some(
721
+ (c) => c.segmentType === 'intercepting'
722
+ );
723
+ const canSkip =
724
+ !interception &&
725
+ !hasInterceptingChildren &&
726
+ !hasAccessInChain &&
727
+ shouldSkipSlot(contentKey, clientSlotKeys);
728
+
729
+ if (canSkip) {
730
+ // No access.ts in this slot's chain (excluded above), so no gate needed.
731
+ slotProps[slotName] = h(SegmentOutlet, {
732
+ segmentPath: slotKey,
733
+ skip: true,
734
+ children: null,
735
+ });
736
+ slotSkipInfo.push({
737
+ slotKey,
738
+ parentSegmentId: segmentId,
739
+ isRequestDependent: false,
740
+ denied: false,
741
+ skipped: true,
742
+ contentKey,
743
+ });
744
+ } else {
745
+ const resolvedElement = await resolveSlotElement(
746
+ slotManifest,
747
+ match,
748
+ h,
749
+ interception,
750
+ parentTreePath
751
+ );
752
+ slotProps[slotName] = h(SegmentOutlet, {
753
+ segmentPath: slotKey,
754
+ children: resolvedElement,
755
+ });
756
+ // Static analysis: check if any file in the slot's RENDERED tree
757
+ // is request-dependent. Only check layouts when destMatch exists —
758
+ // unmatched slots render default.tsx directly without layouts.
759
+ // Slots with access.ts are inherently request-dependent — their
760
+ // content varies with user state (TIM-1364).
761
+ let slotRequestDep = hasAccessInChain;
762
+ const hasRenderedPage = destMatch && destLeaf?.page;
763
+ if (slotRequestDep) {
764
+ // Already marked — skip static analysis
765
+ } else if (interception) {
766
+ // `destMatch` walks the slot's ordinary children against the
767
+ // destination URL; the interception resolver renders an intercepting
768
+ // child instead, which that walk never sees. So the files analyzed
769
+ // below are not the files that rendered — and `false` here tells the
770
+ // client the slot is reusable. Stay conservative: a needlessly
771
+ // request-dependent slot is a wasted refetch, a wrongly static one is
772
+ // a stale modal.
773
+ slotRequestDep = true;
774
+ } else if (hasRenderedPage) {
775
+ // Check slot root layout (rendered by wrapWithLayout)
776
+ if (
777
+ slotManifest.layout?.filePath &&
778
+ isStaticRequestDependent(slotManifest.layout.filePath)
779
+ ) {
780
+ slotRequestDep = true;
397
781
  }
398
- }
399
-
400
- // Dynamic match
401
- if (!found) {
402
- for (const c of children) {
403
- if (c.segmentType === 'dynamic') {
404
- found = c;
405
- break;
782
+ // Check intermediate slot layouts
783
+ if (!slotRequestDep) {
784
+ for (const seg of destMatch.chain) {
785
+ if (seg.layout?.filePath && isStaticRequestDependent(seg.layout.filePath)) {
786
+ slotRequestDep = true;
787
+ break;
788
+ }
406
789
  }
407
790
  }
408
- }
409
-
410
- // Catch-all match
411
- if (!found) {
412
- for (const c of children) {
413
- if (c.segmentType === 'catch-all' || c.segmentType === 'optional-catch-all') {
414
- found = c;
415
- break;
791
+ // Check leaf page
792
+ if (!slotRequestDep) {
793
+ if (destLeaf?.page?.filePath && isStaticRequestDependent(destLeaf.page.filePath)) {
794
+ slotRequestDep = true;
416
795
  }
417
796
  }
797
+ } else {
798
+ // No match — only default.tsx is rendered (no layouts)
799
+ const defaultFile = slotManifest.default?.filePath;
800
+ if (!defaultFile) {
801
+ slotRequestDep = true; // No entry file → conservative
802
+ } else {
803
+ slotRequestDep = isStaticRequestDependent(defaultFile);
804
+ }
418
805
  }
419
-
420
- if (!found) {
421
- matched = false;
422
- break;
423
- }
424
- chain.push(found);
425
- currentNode = found;
426
- }
427
-
428
- if (matched && currentNode.page) {
429
- return { page: currentNode.page, chain };
806
+ slotSkipInfo.push({
807
+ slotKey,
808
+ parentSegmentId: segmentId,
809
+ isRequestDependent: slotRequestDep,
810
+ denied: false,
811
+ contentKey,
812
+ });
430
813
  }
431
814
  }
432
815
 
433
- return null;
816
+ return slotProps;
434
817
  }