@timber-js/app 0.2.0-alpha.21 → 0.2.0-alpha.211

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 (1393) hide show
  1. package/LICENSE +8 -0
  2. package/agent-skill.md +346 -0
  3. package/bin/timber.mjs +15 -1
  4. package/dist/_chunks/actions-Rjk4htmA.js +1199 -0
  5. package/dist/_chunks/actions-Rjk4htmA.js.map +1 -0
  6. package/dist/_chunks/als-registry-DaxkVjt5.js +45 -0
  7. package/dist/_chunks/als-registry-DaxkVjt5.js.map +1 -0
  8. package/dist/_chunks/als-slots-BEEIPKYm.js +26 -0
  9. package/dist/_chunks/als-slots-BEEIPKYm.js.map +1 -0
  10. package/dist/_chunks/base-path-DaQrzbez.js +80 -0
  11. package/dist/_chunks/base-path-DaQrzbez.js.map +1 -0
  12. package/dist/_chunks/build-manifest-DWppEdLB.js +86 -0
  13. package/dist/_chunks/build-manifest-DWppEdLB.js.map +1 -0
  14. package/dist/_chunks/build-output-helper-RV_BRcF1.js +367 -0
  15. package/dist/_chunks/build-output-helper-RV_BRcF1.js.map +1 -0
  16. package/dist/_chunks/cache-api-DGdYfNJn.js +1182 -0
  17. package/dist/_chunks/cache-api-DGdYfNJn.js.map +1 -0
  18. package/dist/_chunks/canonicalize-CgHoscYO.js +66 -0
  19. package/dist/_chunks/canonicalize-CgHoscYO.js.map +1 -0
  20. package/dist/_chunks/chains-DGX9zmg9.js +272 -0
  21. package/dist/_chunks/chains-DGX9zmg9.js.map +1 -0
  22. package/dist/_chunks/classify-QwG5rxKI.js +147 -0
  23. package/dist/_chunks/classify-QwG5rxKI.js.map +1 -0
  24. package/dist/_chunks/cli-check-ajNY3B2e.js +252 -0
  25. package/dist/_chunks/cli-check-ajNY3B2e.js.map +1 -0
  26. package/dist/_chunks/cli-context-By7k2xVo.js +70 -0
  27. package/dist/_chunks/cli-context-By7k2xVo.js.map +1 -0
  28. package/dist/_chunks/cli-schema-sync-D2eI8jEg.js +299 -0
  29. package/dist/_chunks/cli-schema-sync-D2eI8jEg.js.map +1 -0
  30. package/dist/_chunks/client-dep-entries-2HCF09no.js +66 -0
  31. package/dist/_chunks/client-dep-entries-2HCF09no.js.map +1 -0
  32. package/dist/_chunks/cloudflare-Byxl8FWP.js +1333 -0
  33. package/dist/_chunks/cloudflare-Byxl8FWP.js.map +1 -0
  34. package/dist/_chunks/codec-registry-oOUxugz3.js +21 -0
  35. package/dist/_chunks/codec-registry-oOUxugz3.js.map +1 -0
  36. package/dist/_chunks/codegen-Bps1sLKJ.js +432 -0
  37. package/dist/_chunks/codegen-Bps1sLKJ.js.map +1 -0
  38. package/dist/_chunks/convention-lint-DLmhGsRS.js +590 -0
  39. package/dist/_chunks/convention-lint-DLmhGsRS.js.map +1 -0
  40. package/dist/_chunks/dev-server-TFpEwm3H.js +2039 -0
  41. package/dist/_chunks/dev-server-TFpEwm3H.js.map +1 -0
  42. package/dist/_chunks/dist-DtrJyBbw.js +386 -0
  43. package/dist/_chunks/dist-DtrJyBbw.js.map +1 -0
  44. package/dist/_chunks/error-boundary-DsNScGRM.js +1024 -0
  45. package/dist/_chunks/error-boundary-DsNScGRM.js.map +1 -0
  46. package/dist/_chunks/fast-hash-C-tVYrLb.js +41 -0
  47. package/dist/_chunks/fast-hash-C-tVYrLb.js.map +1 -0
  48. package/dist/_chunks/format-BKclgVbk.js +14 -0
  49. package/dist/_chunks/format-BKclgVbk.js.map +1 -0
  50. package/dist/_chunks/fs-identity-BRKuL215.js +207 -0
  51. package/dist/_chunks/fs-identity-BRKuL215.js.map +1 -0
  52. package/dist/_chunks/graph-cache-CYiUS2aS.js +303 -0
  53. package/dist/_chunks/graph-cache-CYiUS2aS.js.map +1 -0
  54. package/dist/_chunks/href-validation-BIrxavIy.js +213 -0
  55. package/dist/_chunks/href-validation-BIrxavIy.js.map +1 -0
  56. package/dist/_chunks/json-lossy-check-CVuRs2hG.js +66 -0
  57. package/dist/_chunks/json-lossy-check-CVuRs2hG.js.map +1 -0
  58. package/dist/_chunks/live-graph-cNuWMYQI.js +151 -0
  59. package/dist/_chunks/live-graph-cNuWMYQI.js.map +1 -0
  60. package/dist/_chunks/logger-BP0LN6vP.js +662 -0
  61. package/dist/_chunks/logger-BP0LN6vP.js.map +1 -0
  62. package/dist/_chunks/{metadata-routes-Cjmvi3rQ.js → metadata-routes-DSDjM_hJ.js} +71 -27
  63. package/dist/_chunks/metadata-routes-DSDjM_hJ.js.map +1 -0
  64. package/dist/_chunks/navigation-root-BQfo1-kG.js +126 -0
  65. package/dist/_chunks/navigation-root-BQfo1-kG.js.map +1 -0
  66. package/dist/_chunks/param-value-C8TNYchQ.js +66 -0
  67. package/dist/_chunks/param-value-C8TNYchQ.js.map +1 -0
  68. package/dist/_chunks/plugin-context-BPBPc3lL.js +345 -0
  69. package/dist/_chunks/plugin-context-BPBPc3lL.js.map +1 -0
  70. package/dist/_chunks/poison-rules-DoEhbqaY.js +110 -0
  71. package/dist/_chunks/poison-rules-DoEhbqaY.js.map +1 -0
  72. package/dist/_chunks/poison-scan-CfQ3unZR.js +99 -0
  73. package/dist/_chunks/poison-scan-CfQ3unZR.js.map +1 -0
  74. package/dist/_chunks/purge-store-Byr8XOjU.js +14 -0
  75. package/dist/_chunks/purge-store-Byr8XOjU.js.map +1 -0
  76. package/dist/_chunks/render-timeout-DOf_BBcO.js +46 -0
  77. package/dist/_chunks/render-timeout-DOf_BBcO.js.map +1 -0
  78. package/dist/_chunks/resolve-schema-CBR6Lm4i.js +50 -0
  79. package/dist/_chunks/resolve-schema-CBR6Lm4i.js.map +1 -0
  80. package/dist/_chunks/rolldown-runtime-D7D4PA-g.js +13 -0
  81. package/dist/_chunks/rsc-cache-key-ClUiXQnK.js +243 -0
  82. package/dist/_chunks/rsc-cache-key-ClUiXQnK.js.map +1 -0
  83. package/dist/_chunks/rsc-media-type-DDc7duTD.js +61 -0
  84. package/dist/_chunks/rsc-media-type-DDc7duTD.js.map +1 -0
  85. package/dist/_chunks/rsc-payload-path-dffcs4jp.js +54 -0
  86. package/dist/_chunks/rsc-payload-path-dffcs4jp.js.map +1 -0
  87. package/dist/_chunks/scan-BoP17W3w.js +140 -0
  88. package/dist/_chunks/scan-BoP17W3w.js.map +1 -0
  89. package/dist/_chunks/scanner-DmqdxzbW.js +2056 -0
  90. package/dist/_chunks/scanner-DmqdxzbW.js.map +1 -0
  91. package/dist/_chunks/schema-bridge-C83xa9lT.js +199 -0
  92. package/dist/_chunks/schema-bridge-C83xa9lT.js.map +1 -0
  93. package/dist/_chunks/segment-classify-C539Pa2O.js +197 -0
  94. package/dist/_chunks/segment-classify-C539Pa2O.js.map +1 -0
  95. package/dist/_chunks/segment-context-xtPUGfdq.js +137 -0
  96. package/dist/_chunks/segment-context-xtPUGfdq.js.map +1 -0
  97. package/dist/_chunks/segment-keys-D5hu1hz4.js +62 -0
  98. package/dist/_chunks/segment-keys-D5hu1hz4.js.map +1 -0
  99. package/dist/_chunks/singleflight-BeVMMKi0.js +55 -0
  100. package/dist/_chunks/singleflight-BeVMMKi0.js.map +1 -0
  101. package/dist/_chunks/sizeof-BM1409x2.js +36 -0
  102. package/dist/_chunks/sizeof-BM1409x2.js.map +1 -0
  103. package/dist/_chunks/ssr-data-nA3I70_n.js +49 -0
  104. package/dist/_chunks/ssr-data-nA3I70_n.js.map +1 -0
  105. package/dist/_chunks/state-BhNGPsdi.js +50 -0
  106. package/dist/_chunks/state-BhNGPsdi.js.map +1 -0
  107. package/dist/_chunks/status-page-marker-BRX9Ib-d.js +564 -0
  108. package/dist/_chunks/status-page-marker-BRX9Ib-d.js.map +1 -0
  109. package/dist/_chunks/tree-match-6yihorhk.js +169 -0
  110. package/dist/_chunks/tree-match-6yihorhk.js.map +1 -0
  111. package/dist/_chunks/use-query-states-I3JMng6J.js +226 -0
  112. package/dist/_chunks/use-query-states-I3JMng6J.js.map +1 -0
  113. package/dist/_chunks/walkers-Czu2jXFq.js +144 -0
  114. package/dist/_chunks/walkers-Czu2jXFq.js.map +1 -0
  115. package/dist/_chunks/write-file-atomic-D1qWqHb4.js +32 -0
  116. package/dist/_chunks/write-file-atomic-D1qWqHb4.js.map +1 -0
  117. package/dist/adapters/build-output-helper.d.ts +72 -0
  118. package/dist/adapters/build-output-helper.d.ts.map +1 -0
  119. package/dist/adapters/canonicalize-module.d.ts +8 -0
  120. package/dist/adapters/canonicalize-module.d.ts.map +1 -0
  121. package/dist/adapters/cloudflare-dev.d.ts +109 -0
  122. package/dist/adapters/cloudflare-dev.d.ts.map +1 -0
  123. package/dist/adapters/cloudflare-dev.js +74 -0
  124. package/dist/adapters/cloudflare-dev.js.map +1 -0
  125. package/dist/adapters/cloudflare-kv-cache.d.ts +65 -0
  126. package/dist/adapters/cloudflare-kv-cache.d.ts.map +1 -0
  127. package/dist/adapters/cloudflare-kv-cache.js +123 -0
  128. package/dist/adapters/cloudflare-kv-cache.js.map +1 -0
  129. package/dist/adapters/cloudflare.d.ts +224 -24
  130. package/dist/adapters/cloudflare.d.ts.map +1 -1
  131. package/dist/adapters/cloudflare.js +2 -188
  132. package/dist/adapters/compress-module.d.ts +25 -4
  133. package/dist/adapters/compress-module.d.ts.map +1 -1
  134. package/dist/adapters/fs-identity.d.ts +63 -0
  135. package/dist/adapters/fs-identity.d.ts.map +1 -0
  136. package/dist/adapters/nitro-presets.d.ts +31 -0
  137. package/dist/adapters/nitro-presets.d.ts.map +1 -0
  138. package/dist/adapters/nitro-preview.d.ts +64 -0
  139. package/dist/adapters/nitro-preview.d.ts.map +1 -0
  140. package/dist/adapters/nitro.d.ts +54 -37
  141. package/dist/adapters/nitro.d.ts.map +1 -1
  142. package/dist/adapters/nitro.js +631 -359
  143. package/dist/adapters/nitro.js.map +1 -1
  144. package/dist/adapters/shared.d.ts +67 -0
  145. package/dist/adapters/shared.d.ts.map +1 -0
  146. package/dist/adapters/types.d.ts +122 -16
  147. package/dist/adapters/types.d.ts.map +1 -1
  148. package/dist/adapters/types.js +0 -0
  149. package/dist/analyze/chains.d.ts +124 -0
  150. package/dist/analyze/chains.d.ts.map +1 -0
  151. package/dist/analyze/classify.d.ts +153 -0
  152. package/dist/analyze/classify.d.ts.map +1 -0
  153. package/dist/analyze/crawl-entry.d.ts +17 -0
  154. package/dist/analyze/crawl-entry.d.ts.map +1 -0
  155. package/dist/analyze/crawl-entry.js +314 -0
  156. package/dist/analyze/crawl-entry.js.map +1 -0
  157. package/dist/analyze/crawl.d.ts +134 -0
  158. package/dist/analyze/crawl.d.ts.map +1 -0
  159. package/dist/analyze/graph-cache.d.ts +104 -0
  160. package/dist/analyze/graph-cache.d.ts.map +1 -0
  161. package/dist/analyze/graph-command.d.ts +43 -0
  162. package/dist/analyze/graph-command.d.ts.map +1 -0
  163. package/dist/analyze/graph-command.js +472 -0
  164. package/dist/analyze/graph-command.js.map +1 -0
  165. package/dist/analyze/live-graph.d.ts +81 -0
  166. package/dist/analyze/live-graph.d.ts.map +1 -0
  167. package/dist/analyze/poison-rules.d.ts +72 -0
  168. package/dist/analyze/poison-rules.d.ts.map +1 -0
  169. package/dist/analyze/poison-scan.d.ts +48 -0
  170. package/dist/analyze/poison-scan.d.ts.map +1 -0
  171. package/dist/analyze/scan.d.ts +73 -0
  172. package/dist/analyze/scan.d.ts.map +1 -0
  173. package/dist/cache/cache-api.d.ts +48 -0
  174. package/dist/cache/cache-api.d.ts.map +1 -0
  175. package/dist/cache/fast-hash.d.ts +5 -0
  176. package/dist/cache/fast-hash.d.ts.map +1 -1
  177. package/dist/cache/handler-store.d.ts +33 -0
  178. package/dist/cache/handler-store.d.ts.map +1 -0
  179. package/dist/cache/index.d.ts +32 -9
  180. package/dist/cache/index.d.ts.map +1 -1
  181. package/dist/cache/index.js +3 -326
  182. package/dist/cache/invalidation-epoch.d.ts +43 -0
  183. package/dist/cache/invalidation-epoch.d.ts.map +1 -0
  184. package/dist/cache/json-lossy-check.d.ts +11 -0
  185. package/dist/cache/json-lossy-check.d.ts.map +1 -0
  186. package/dist/cache/redis-handler.d.ts +141 -9
  187. package/dist/cache/redis-handler.d.ts.map +1 -1
  188. package/dist/cache/singleflight.d.ts +21 -2
  189. package/dist/cache/singleflight.d.ts.map +1 -1
  190. package/dist/cache/sizeof.d.ts +22 -0
  191. package/dist/cache/sizeof.d.ts.map +1 -0
  192. package/dist/cache/stable-stringify.d.ts +9 -0
  193. package/dist/cache/stable-stringify.d.ts.map +1 -1
  194. package/dist/cache/store.d.ts +53 -0
  195. package/dist/cache/store.d.ts.map +1 -0
  196. package/dist/cache/stores/cloudflare-kv.d.ts +38 -0
  197. package/dist/cache/stores/cloudflare-kv.d.ts.map +1 -0
  198. package/dist/cache/stores/cloudflare-kv.js +29 -0
  199. package/dist/cache/stores/cloudflare-kv.js.map +1 -0
  200. package/dist/cache/stores/memory.d.ts +42 -0
  201. package/dist/cache/stores/memory.d.ts.map +1 -0
  202. package/dist/cache/stores/memory.js +90 -0
  203. package/dist/cache/stores/memory.js.map +1 -0
  204. package/dist/cache/stores/redis.d.ts +69 -0
  205. package/dist/cache/stores/redis.d.ts.map +1 -0
  206. package/dist/cache/stores/redis.js +35 -0
  207. package/dist/cache/stores/redis.js.map +1 -0
  208. package/dist/cache/stores/vercel.d.ts +36 -0
  209. package/dist/cache/stores/vercel.d.ts.map +1 -0
  210. package/dist/cache/stores/vercel.js +33 -0
  211. package/dist/cache/stores/vercel.js.map +1 -0
  212. package/dist/cache/tag-aware-handler.d.ts +52 -0
  213. package/dist/cache/tag-aware-handler.d.ts.map +1 -0
  214. package/dist/cache/timber-cache.d.ts +21 -11
  215. package/dist/cache/timber-cache.d.ts.map +1 -1
  216. package/dist/cdn/cloudflare-purge.d.ts +23 -0
  217. package/dist/cdn/cloudflare-purge.d.ts.map +1 -0
  218. package/dist/cdn/cloudflare-purge.js +30 -0
  219. package/dist/cdn/cloudflare-purge.js.map +1 -0
  220. package/dist/cdn/fastly-purge.d.ts +25 -0
  221. package/dist/cdn/fastly-purge.d.ts.map +1 -0
  222. package/dist/cdn/fastly-purge.js +33 -0
  223. package/dist/cdn/fastly-purge.js.map +1 -0
  224. package/dist/cdn/headers.d.ts +97 -0
  225. package/dist/cdn/headers.d.ts.map +1 -0
  226. package/dist/cdn/index.d.ts +5 -0
  227. package/dist/cdn/index.d.ts.map +1 -0
  228. package/dist/cdn/index.js +94 -0
  229. package/dist/cdn/index.js.map +1 -0
  230. package/dist/cdn/purge-store.d.ts +23 -0
  231. package/dist/cdn/purge-store.d.ts.map +1 -0
  232. package/dist/cdn/workers-cache-purge.d.ts +20 -0
  233. package/dist/cdn/workers-cache-purge.d.ts.map +1 -0
  234. package/dist/cdn/workers-cache-purge.js +35 -0
  235. package/dist/cdn/workers-cache-purge.js.map +1 -0
  236. package/dist/cli-check.d.ts +133 -0
  237. package/dist/cli-check.d.ts.map +1 -0
  238. package/dist/cli-context.d.ts +54 -0
  239. package/dist/cli-context.d.ts.map +1 -0
  240. package/dist/cli-schema-sync.d.ts +59 -0
  241. package/dist/cli-schema-sync.d.ts.map +1 -0
  242. package/dist/cli.d.ts +85 -13
  243. package/dist/cli.d.ts.map +1 -1
  244. package/dist/cli.js +224 -63
  245. package/dist/cli.js.map +1 -1
  246. package/dist/client/browser-dev.d.ts +42 -2
  247. package/dist/client/browser-dev.d.ts.map +1 -1
  248. package/dist/client/browser-entry/action-dispatch.d.ts +19 -0
  249. package/dist/client/browser-entry/action-dispatch.d.ts.map +1 -0
  250. package/dist/client/browser-entry/action-queue.d.ts +63 -0
  251. package/dist/client/browser-entry/action-queue.d.ts.map +1 -0
  252. package/dist/client/browser-entry/hmr.d.ts +21 -0
  253. package/dist/client/browser-entry/hmr.d.ts.map +1 -0
  254. package/dist/client/browser-entry/hydrate.d.ts +53 -0
  255. package/dist/client/browser-entry/hydrate.d.ts.map +1 -0
  256. package/dist/client/browser-entry/index.d.ts +30 -0
  257. package/dist/client/browser-entry/index.d.ts.map +1 -0
  258. package/dist/client/browser-entry/post-hydration.d.ts +26 -0
  259. package/dist/client/browser-entry/post-hydration.d.ts.map +1 -0
  260. package/dist/client/browser-entry/router-init.d.ts +41 -0
  261. package/dist/client/browser-entry/router-init.d.ts.map +1 -0
  262. package/dist/client/browser-entry/rsc-stream.d.ts +32 -0
  263. package/dist/client/browser-entry/rsc-stream.d.ts.map +1 -0
  264. package/dist/client/browser-entry/scroll.d.ts +28 -0
  265. package/dist/client/browser-entry/scroll.d.ts.map +1 -0
  266. package/dist/client/deny-last-resort.d.ts +29 -0
  267. package/dist/client/deny-last-resort.d.ts.map +1 -0
  268. package/dist/client/error-boundary.d.ts +58 -9
  269. package/dist/client/error-boundary.d.ts.map +1 -1
  270. package/dist/client/error-boundary.js +2 -126
  271. package/dist/client/error-reconstituter.d.ts +55 -0
  272. package/dist/client/error-reconstituter.d.ts.map +1 -0
  273. package/dist/client/form.d.ts +16 -27
  274. package/dist/client/form.d.ts.map +1 -1
  275. package/dist/client/global-context.d.ts +15 -0
  276. package/dist/client/global-context.d.ts.map +1 -0
  277. package/dist/client/history.d.ts +50 -9
  278. package/dist/client/history.d.ts.map +1 -1
  279. package/dist/client/index.d.ts +20 -33
  280. package/dist/client/index.d.ts.map +1 -1
  281. package/dist/client/index.js +330 -1150
  282. package/dist/client/index.js.map +1 -1
  283. package/dist/client/internal.d.ts +20 -0
  284. package/dist/client/internal.d.ts.map +1 -0
  285. package/dist/client/internal.js +792 -0
  286. package/dist/client/internal.js.map +1 -0
  287. package/dist/client/link.d.ts +85 -60
  288. package/dist/client/link.d.ts.map +1 -1
  289. package/dist/client/location-search.d.ts +12 -0
  290. package/dist/client/location-search.d.ts.map +1 -0
  291. package/dist/client/navigation-api.d.ts +133 -0
  292. package/dist/client/navigation-api.d.ts.map +1 -0
  293. package/dist/client/navigation-commit.d.ts +111 -0
  294. package/dist/client/navigation-commit.d.ts.map +1 -0
  295. package/dist/client/navigation-context.d.ts +54 -36
  296. package/dist/client/navigation-context.d.ts.map +1 -1
  297. package/dist/client/navigation-root.d.ts +106 -0
  298. package/dist/client/navigation-root.d.ts.map +1 -0
  299. package/dist/client/navigation-transition.d.ts +192 -0
  300. package/dist/client/navigation-transition.d.ts.map +1 -0
  301. package/dist/client/nuqs-adapter.d.ts +1 -1
  302. package/dist/client/nuqs-adapter.d.ts.map +1 -1
  303. package/dist/client/params-context.d.ts +81 -0
  304. package/dist/client/params-context.d.ts.map +1 -0
  305. package/dist/client/react-root.d.ts +45 -0
  306. package/dist/client/react-root.d.ts.map +1 -0
  307. package/dist/client/router-effects.d.ts +137 -0
  308. package/dist/client/router-effects.d.ts.map +1 -0
  309. package/dist/client/router-lifecycle.d.ts +98 -0
  310. package/dist/client/router-lifecycle.d.ts.map +1 -0
  311. package/dist/client/router-pipeline.d.ts +84 -0
  312. package/dist/client/router-pipeline.d.ts.map +1 -0
  313. package/dist/client/router-ref.d.ts +2 -2
  314. package/dist/client/router-ref.d.ts.map +1 -1
  315. package/dist/client/router-skew.d.ts +21 -0
  316. package/dist/client/router-skew.d.ts.map +1 -0
  317. package/dist/client/router-types.d.ts +334 -0
  318. package/dist/client/router-types.d.ts.map +1 -0
  319. package/dist/client/router-url.d.ts +24 -0
  320. package/dist/client/router-url.d.ts.map +1 -0
  321. package/dist/client/router.d.ts +1 -97
  322. package/dist/client/router.d.ts.map +1 -1
  323. package/dist/client/rsc-fetch.d.ts +110 -28
  324. package/dist/client/rsc-fetch.d.ts.map +1 -1
  325. package/dist/client/segment-cache.d.ts +186 -25
  326. package/dist/client/segment-cache.d.ts.map +1 -1
  327. package/dist/client/segment-context.d.ts.map +1 -1
  328. package/dist/client/segment-outlet.d.ts +68 -0
  329. package/dist/client/segment-outlet.d.ts.map +1 -0
  330. package/dist/client/segment-update-context.d.ts +15 -0
  331. package/dist/client/segment-update-context.d.ts.map +1 -0
  332. package/dist/client/shallow-url.d.ts +10 -0
  333. package/dist/client/shallow-url.d.ts.map +1 -0
  334. package/dist/client/slot-content-cache-context.d.ts +35 -0
  335. package/dist/client/slot-content-cache-context.d.ts.map +1 -0
  336. package/dist/client/slot-context.d.ts +31 -0
  337. package/dist/client/slot-context.d.ts.map +1 -0
  338. package/dist/client/slot-outlet.d.ts +16 -0
  339. package/dist/client/slot-outlet.d.ts.map +1 -0
  340. package/dist/client/slot-provider.d.ts +25 -0
  341. package/dist/client/slot-provider.d.ts.map +1 -0
  342. package/dist/client/ssr-data.d.ts +26 -50
  343. package/dist/client/ssr-data.d.ts.map +1 -1
  344. package/dist/client/stale-client.d.ts +69 -0
  345. package/dist/client/stale-client.d.ts.map +1 -0
  346. package/dist/client/state.d.ts +21 -13
  347. package/dist/client/state.d.ts.map +1 -1
  348. package/dist/client/status-page-marker.d.ts +25 -0
  349. package/dist/client/status-page-marker.d.ts.map +1 -0
  350. package/dist/client/top-loader.d.ts +7 -6
  351. package/dist/client/top-loader.d.ts.map +1 -1
  352. package/dist/client/unload-guard.d.ts +5 -0
  353. package/dist/client/unload-guard.d.ts.map +1 -1
  354. package/dist/client/use-cookie.d.ts +12 -0
  355. package/dist/client/use-cookie.d.ts.map +1 -1
  356. package/dist/client/use-link-status.d.ts +5 -5
  357. package/dist/client/use-link-status.d.ts.map +1 -1
  358. package/dist/client/use-pathname.d.ts +13 -11
  359. package/dist/client/use-pathname.d.ts.map +1 -1
  360. package/dist/client/use-pending-navigation.d.ts +23 -0
  361. package/dist/client/use-pending-navigation.d.ts.map +1 -0
  362. package/dist/client/use-query-states.d.ts +10 -4
  363. package/dist/client/use-query-states.d.ts.map +1 -1
  364. package/dist/client/use-router.d.ts +15 -8
  365. package/dist/client/use-router.d.ts.map +1 -1
  366. package/dist/client/use-search-params.d.ts +15 -8
  367. package/dist/client/use-search-params.d.ts.map +1 -1
  368. package/dist/client/use-segment-params.d.ts +55 -0
  369. package/dist/client/use-segment-params.d.ts.map +1 -0
  370. package/dist/codec.d.ts +69 -0
  371. package/dist/codec.d.ts.map +1 -0
  372. package/dist/codec.js +76 -0
  373. package/dist/codec.js.map +1 -0
  374. package/dist/config-types.d.ts +323 -0
  375. package/dist/config-types.d.ts.map +1 -0
  376. package/dist/config-validation.d.ts +68 -0
  377. package/dist/config-validation.d.ts.map +1 -0
  378. package/dist/cookies/define-cookie.d.ts +58 -25
  379. package/dist/cookies/define-cookie.d.ts.map +1 -1
  380. package/dist/cookies/index.d.ts +3 -2
  381. package/dist/cookies/index.d.ts.map +1 -1
  382. package/dist/cookies/index.js +256 -36
  383. package/dist/cookies/index.js.map +1 -1
  384. package/dist/cookies/json-cookie.d.ts +64 -0
  385. package/dist/cookies/json-cookie.d.ts.map +1 -0
  386. package/dist/cookies/validation.d.ts +34 -0
  387. package/dist/cookies/validation.d.ts.map +1 -0
  388. package/dist/dev-tools/404-page.d.ts +50 -0
  389. package/dist/dev-tools/404-page.d.ts.map +1 -0
  390. package/dist/dev-tools/browser-logs.d.ts +40 -0
  391. package/dist/dev-tools/browser-logs.d.ts.map +1 -0
  392. package/dist/dev-tools/dev-page-shell.d.ts +95 -0
  393. package/dist/dev-tools/dev-page-shell.d.ts.map +1 -0
  394. package/dist/dev-tools/error-page.d.ts +32 -0
  395. package/dist/dev-tools/error-page.d.ts.map +1 -0
  396. package/dist/dev-tools/holding-server.d.ts +46 -0
  397. package/dist/dev-tools/holding-server.d.ts.map +1 -0
  398. package/dist/dev-tools/hydration-overlay.d.ts +11 -0
  399. package/dist/dev-tools/hydration-overlay.d.ts.map +1 -0
  400. package/dist/dev-tools/index.d.ts +31 -0
  401. package/dist/dev-tools/index.d.ts.map +1 -0
  402. package/dist/dev-tools/instrumentation.d.ts +74 -0
  403. package/dist/dev-tools/instrumentation.d.ts.map +1 -0
  404. package/dist/{server/dev-logger.d.ts → dev-tools/logger.d.ts} +1 -1
  405. package/dist/dev-tools/logger.d.ts.map +1 -0
  406. package/dist/{plugins/dev-logs.d.ts → dev-tools/logs.d.ts} +17 -3
  407. package/dist/dev-tools/logs.d.ts.map +1 -0
  408. package/dist/{plugins/dev-error-overlay.d.ts → dev-tools/overlay.d.ts} +15 -25
  409. package/dist/dev-tools/overlay.d.ts.map +1 -0
  410. package/dist/dev-tools/stack-classifier.d.ts +34 -0
  411. package/dist/dev-tools/stack-classifier.d.ts.map +1 -0
  412. package/dist/dev-tools/terminal.d.ts +28 -0
  413. package/dist/dev-tools/terminal.d.ts.map +1 -0
  414. package/dist/fonts/ast-walk.d.ts +68 -0
  415. package/dist/fonts/ast-walk.d.ts.map +1 -0
  416. package/dist/fonts/ast.d.ts +112 -8
  417. package/dist/fonts/ast.d.ts.map +1 -1
  418. package/dist/fonts/bundle.d.ts +50 -0
  419. package/dist/fonts/bundle.d.ts.map +1 -0
  420. package/dist/fonts/css.d.ts +1 -1
  421. package/dist/fonts/dev-middleware.d.ts +22 -0
  422. package/dist/fonts/dev-middleware.d.ts.map +1 -0
  423. package/dist/fonts/fallbacks.d.ts +0 -7
  424. package/dist/fonts/fallbacks.d.ts.map +1 -1
  425. package/dist/fonts/google.d.ts +5 -3
  426. package/dist/fonts/google.d.ts.map +1 -1
  427. package/dist/fonts/local.d.ts +5 -5
  428. package/dist/fonts/local.d.ts.map +1 -1
  429. package/dist/fonts/paths.d.ts +43 -0
  430. package/dist/fonts/paths.d.ts.map +1 -0
  431. package/dist/fonts/pipeline.d.ts +177 -0
  432. package/dist/fonts/pipeline.d.ts.map +1 -0
  433. package/dist/fonts/transform.d.ts +82 -0
  434. package/dist/fonts/transform.d.ts.map +1 -0
  435. package/dist/fonts/types.d.ts +47 -1
  436. package/dist/fonts/types.d.ts.map +1 -1
  437. package/dist/fonts/virtual-modules.d.ts +77 -0
  438. package/dist/fonts/virtual-modules.d.ts.map +1 -0
  439. package/dist/index.d.ts +35 -181
  440. package/dist/index.d.ts.map +1 -1
  441. package/dist/index.js +8871 -14233
  442. package/dist/index.js.map +1 -1
  443. package/dist/params/codec-registry.d.ts +26 -0
  444. package/dist/params/codec-registry.d.ts.map +1 -0
  445. package/dist/params/define-schema.d.ts +81 -0
  446. package/dist/params/define-schema.d.ts.map +1 -0
  447. package/dist/params/index.d.ts +5 -0
  448. package/dist/params/index.d.ts.map +1 -0
  449. package/dist/params/index.js +34 -0
  450. package/dist/params/index.js.map +1 -0
  451. package/dist/params/resolve-schema.d.ts +34 -0
  452. package/dist/params/resolve-schema.d.ts.map +1 -0
  453. package/dist/plugin-context.d.ts +262 -0
  454. package/dist/plugin-context.d.ts.map +1 -0
  455. package/dist/plugins/build-manifest.d.ts +7 -3
  456. package/dist/plugins/build-manifest.d.ts.map +1 -1
  457. package/dist/plugins/build-report.d.ts +61 -11
  458. package/dist/plugins/build-report.d.ts.map +1 -1
  459. package/dist/plugins/cache.d.ts +64 -0
  460. package/dist/plugins/cache.d.ts.map +1 -0
  461. package/dist/plugins/callsite-ast.d.ts +117 -0
  462. package/dist/plugins/callsite-ast.d.ts.map +1 -0
  463. package/dist/plugins/callsite-jsx.d.ts +35 -0
  464. package/dist/plugins/callsite-jsx.d.ts.map +1 -0
  465. package/dist/plugins/chunks.d.ts +11 -4
  466. package/dist/plugins/chunks.d.ts.map +1 -1
  467. package/dist/plugins/client-chunks.d.ts +40 -0
  468. package/dist/plugins/client-chunks.d.ts.map +1 -0
  469. package/dist/plugins/client-dep-entries.d.ts +44 -0
  470. package/dist/plugins/client-dep-entries.d.ts.map +1 -0
  471. package/dist/plugins/cloudflare-wasm.d.ts +21 -0
  472. package/dist/plugins/cloudflare-wasm.d.ts.map +1 -0
  473. package/dist/plugins/content.d.ts +1 -1
  474. package/dist/plugins/content.d.ts.map +1 -1
  475. package/dist/plugins/dev-discovery.d.ts +123 -0
  476. package/dist/plugins/dev-discovery.d.ts.map +1 -0
  477. package/dist/plugins/dev-server.d.ts +24 -1
  478. package/dist/plugins/dev-server.d.ts.map +1 -1
  479. package/dist/plugins/entries.d.ts +34 -4
  480. package/dist/plugins/entries.d.ts.map +1 -1
  481. package/dist/plugins/fonts.d.ts +35 -74
  482. package/dist/plugins/fonts.d.ts.map +1 -1
  483. package/dist/plugins/graph-endpoint.d.ts +112 -0
  484. package/dist/plugins/graph-endpoint.d.ts.map +1 -0
  485. package/dist/plugins/mdx.d.ts +18 -5
  486. package/dist/plugins/mdx.d.ts.map +1 -1
  487. package/dist/plugins/post-build.d.ts +110 -0
  488. package/dist/plugins/post-build.d.ts.map +1 -0
  489. package/dist/plugins/prebuilt-capture.d.ts +67 -0
  490. package/dist/plugins/prebuilt-capture.d.ts.map +1 -0
  491. package/dist/plugins/prebuilt-options-analysis.d.ts +40 -0
  492. package/dist/plugins/prebuilt-options-analysis.d.ts.map +1 -0
  493. package/dist/plugins/prebuilt.d.ts +98 -0
  494. package/dist/plugins/prebuilt.d.ts.map +1 -0
  495. package/dist/plugins/prerender-sugar.d.ts +39 -0
  496. package/dist/plugins/prerender-sugar.d.ts.map +1 -0
  497. package/dist/plugins/react-resolve.d.ts +49 -0
  498. package/dist/plugins/react-resolve.d.ts.map +1 -0
  499. package/dist/plugins/request-dep/analysis.d.ts +106 -0
  500. package/dist/plugins/request-dep/analysis.d.ts.map +1 -0
  501. package/dist/plugins/request-dep/index.d.ts +75 -0
  502. package/dist/plugins/request-dep/index.d.ts.map +1 -0
  503. package/dist/plugins/request-dep/origin.d.ts +61 -0
  504. package/dist/plugins/request-dep/origin.d.ts.map +1 -0
  505. package/dist/plugins/routing.d.ts +1 -1
  506. package/dist/plugins/routing.d.ts.map +1 -1
  507. package/dist/plugins/rsc-assets-manifest.d.ts +33 -0
  508. package/dist/plugins/rsc-assets-manifest.d.ts.map +1 -0
  509. package/dist/plugins/server-bundle.d.ts.map +1 -1
  510. package/dist/plugins/shims.d.ts +29 -5
  511. package/dist/plugins/shims.d.ts.map +1 -1
  512. package/dist/plugins/static-build.d.ts +246 -26
  513. package/dist/plugins/static-build.d.ts.map +1 -1
  514. package/dist/routing/codegen-shared.d.ts +26 -0
  515. package/dist/routing/codegen-shared.d.ts.map +1 -0
  516. package/dist/routing/codegen-types.d.ts +61 -0
  517. package/dist/routing/codegen-types.d.ts.map +1 -0
  518. package/dist/routing/codegen-write.d.ts +42 -0
  519. package/dist/routing/codegen-write.d.ts.map +1 -0
  520. package/dist/routing/codegen.d.ts +8 -3
  521. package/dist/routing/codegen.d.ts.map +1 -1
  522. package/dist/routing/collision-probe.d.ts +104 -0
  523. package/dist/routing/collision-probe.d.ts.map +1 -0
  524. package/dist/routing/collision-spaces.d.ts +26 -0
  525. package/dist/routing/collision-spaces.d.ts.map +1 -0
  526. package/dist/routing/convention-lint.d.ts +55 -0
  527. package/dist/routing/convention-lint.d.ts.map +1 -0
  528. package/dist/routing/export-detect.d.ts +91 -0
  529. package/dist/routing/export-detect.d.ts.map +1 -0
  530. package/dist/routing/file-cache.d.ts +8 -0
  531. package/dist/routing/file-cache.d.ts.map +1 -0
  532. package/dist/routing/index.d.ts +13 -7
  533. package/dist/routing/index.d.ts.map +1 -1
  534. package/dist/routing/index.js +5 -2
  535. package/dist/routing/interception-overlap.d.ts +35 -0
  536. package/dist/routing/interception-overlap.d.ts.map +1 -0
  537. package/dist/routing/interception.d.ts +234 -10
  538. package/dist/routing/interception.d.ts.map +1 -1
  539. package/dist/routing/link-codegen.d.ts +105 -0
  540. package/dist/routing/link-codegen.d.ts.map +1 -0
  541. package/dist/routing/manifest-codegen.d.ts +26 -0
  542. package/dist/routing/manifest-codegen.d.ts.map +1 -0
  543. package/dist/routing/scanner.d.ts +14 -10
  544. package/dist/routing/scanner.d.ts.map +1 -1
  545. package/dist/routing/schema-validation.d.ts +35 -0
  546. package/dist/routing/schema-validation.d.ts.map +1 -0
  547. package/dist/routing/segment-classify.d.ts +114 -0
  548. package/dist/routing/segment-classify.d.ts.map +1 -0
  549. package/dist/routing/segment-codegen.d.ts +38 -0
  550. package/dist/routing/segment-codegen.d.ts.map +1 -0
  551. package/dist/routing/segment-keys.d.ts +118 -0
  552. package/dist/routing/segment-keys.d.ts.map +1 -0
  553. package/dist/routing/slot-placement.d.ts +48 -0
  554. package/dist/routing/slot-placement.d.ts.map +1 -0
  555. package/dist/routing/types.d.ts +81 -26
  556. package/dist/routing/types.d.ts.map +1 -1
  557. package/dist/routing/walkers.d.ts +57 -0
  558. package/dist/routing/walkers.d.ts.map +1 -0
  559. package/dist/rsc-runtime/rsc.d.ts +1 -1
  560. package/dist/rsc-runtime/rsc.d.ts.map +1 -1
  561. package/dist/rsc-runtime/ssr.d.ts +14 -0
  562. package/dist/rsc-runtime/ssr.d.ts.map +1 -1
  563. package/dist/rsc-runtime/transforms.d.ts +13 -0
  564. package/dist/rsc-runtime/transforms.d.ts.map +1 -0
  565. package/dist/schema-bridge.d.ts +145 -0
  566. package/dist/schema-bridge.d.ts.map +1 -0
  567. package/dist/search-params/define.d.ts +262 -0
  568. package/dist/search-params/define.d.ts.map +1 -0
  569. package/dist/search-params/index.d.ts +3 -7
  570. package/dist/search-params/index.d.ts.map +1 -1
  571. package/dist/search-params/index.js +179 -360
  572. package/dist/search-params/index.js.map +1 -1
  573. package/dist/search-params/parse-total.d.ts +81 -0
  574. package/dist/search-params/parse-total.d.ts.map +1 -0
  575. package/dist/search-params/serialize-equal.d.ts +9 -0
  576. package/dist/search-params/serialize-equal.d.ts.map +1 -0
  577. package/dist/search-params/wrappers.d.ts +76 -0
  578. package/dist/search-params/wrappers.d.ts.map +1 -0
  579. package/dist/server/access-gate.d.ts +98 -10
  580. package/dist/server/access-gate.d.ts.map +1 -1
  581. package/dist/server/action-client.d.ts +44 -9
  582. package/dist/server/action-client.d.ts.map +1 -1
  583. package/dist/server/action-encryption.d.ts +76 -0
  584. package/dist/server/action-encryption.d.ts.map +1 -0
  585. package/dist/server/action-handler.d.ts +40 -5
  586. package/dist/server/action-handler.d.ts.map +1 -1
  587. package/dist/server/actions.d.ts +78 -40
  588. package/dist/server/actions.d.ts.map +1 -1
  589. package/dist/server/als-registry.d.ts +166 -16
  590. package/dist/server/als-registry.d.ts.map +1 -1
  591. package/dist/server/body-limits.d.ts.map +1 -1
  592. package/dist/server/build-manifest.d.ts +25 -30
  593. package/dist/server/build-manifest.d.ts.map +1 -1
  594. package/dist/server/canonicalize.d.ts +10 -0
  595. package/dist/server/canonicalize.d.ts.map +1 -1
  596. package/dist/server/chain-url-parts.d.ts +82 -0
  597. package/dist/server/chain-url-parts.d.ts.map +1 -0
  598. package/dist/server/children-interception.d.ts +49 -0
  599. package/dist/server/children-interception.d.ts.map +1 -0
  600. package/dist/server/coalesce-tick.d.ts +40 -0
  601. package/dist/server/coalesce-tick.d.ts.map +1 -0
  602. package/dist/server/compress.d.ts.map +1 -1
  603. package/dist/server/cookie-context.d.ts +149 -0
  604. package/dist/server/cookie-context.d.ts.map +1 -0
  605. package/dist/server/cookie-parsing.d.ts +65 -0
  606. package/dist/server/cookie-parsing.d.ts.map +1 -0
  607. package/dist/server/csp-nonce.d.ts +36 -0
  608. package/dist/server/csp-nonce.d.ts.map +1 -0
  609. package/dist/server/csrf.d.ts +58 -15
  610. package/dist/server/csrf.d.ts.map +1 -1
  611. package/dist/server/debug.d.ts +0 -1
  612. package/dist/server/debug.d.ts.map +1 -1
  613. package/dist/server/default-logger.d.ts +23 -0
  614. package/dist/server/default-logger.d.ts.map +1 -0
  615. package/dist/server/default-status-page.d.ts +45 -0
  616. package/dist/server/default-status-page.d.ts.map +1 -0
  617. package/dist/server/deny-boundary.d.ts +257 -0
  618. package/dist/server/deny-boundary.d.ts.map +1 -0
  619. package/dist/server/deny-renderer.d.ts +21 -15
  620. package/dist/server/deny-renderer.d.ts.map +1 -1
  621. package/dist/server/early-hints-sender.d.ts.map +1 -1
  622. package/dist/server/early-hints.d.ts +14 -12
  623. package/dist/server/early-hints.d.ts.map +1 -1
  624. package/dist/server/error-boundary-wrapper.d.ts +102 -10
  625. package/dist/server/error-boundary-wrapper.d.ts.map +1 -1
  626. package/dist/server/error-response-headers.d.ts +3 -0
  627. package/dist/server/error-response-headers.d.ts.map +1 -0
  628. package/dist/server/fallback-error.d.ts +19 -7
  629. package/dist/server/fallback-error.d.ts.map +1 -1
  630. package/dist/server/flight-injection-state.d.ts +66 -0
  631. package/dist/server/flight-injection-state.d.ts.map +1 -0
  632. package/dist/server/flight-scripts.d.ts +45 -0
  633. package/dist/server/flight-scripts.d.ts.map +1 -0
  634. package/dist/server/form-data.d.ts +41 -0
  635. package/dist/server/form-data.d.ts.map +1 -1
  636. package/dist/server/form-flash.d.ts +2 -2
  637. package/dist/server/head-response.d.ts +35 -0
  638. package/dist/server/head-response.d.ts.map +1 -0
  639. package/dist/server/html-injector-core.d.ts +257 -0
  640. package/dist/server/html-injector-core.d.ts.map +1 -0
  641. package/dist/server/html-injectors.d.ts +84 -42
  642. package/dist/server/html-injectors.d.ts.map +1 -1
  643. package/dist/server/index.d.ts +17 -54
  644. package/dist/server/index.d.ts.map +1 -1
  645. package/dist/server/index.js +195 -2922
  646. package/dist/server/index.js.map +1 -1
  647. package/dist/server/instrumentation.d.ts +11 -4
  648. package/dist/server/instrumentation.d.ts.map +1 -1
  649. package/dist/server/internal.d.ts +47 -0
  650. package/dist/server/internal.d.ts.map +1 -0
  651. package/dist/server/internal.js +4645 -0
  652. package/dist/server/internal.js.map +1 -0
  653. package/dist/server/json-status-response.d.ts +34 -0
  654. package/dist/server/json-status-response.d.ts.map +1 -0
  655. package/dist/server/logger.d.ts +78 -7
  656. package/dist/server/logger.d.ts.map +1 -1
  657. package/dist/server/metadata-collector.d.ts +73 -0
  658. package/dist/server/metadata-collector.d.ts.map +1 -0
  659. package/dist/server/metadata-platform.d.ts +2 -2
  660. package/dist/server/metadata-render.d.ts +2 -2
  661. package/dist/server/metadata-render.d.ts.map +1 -1
  662. package/dist/server/metadata-routes.d.ts +71 -11
  663. package/dist/server/metadata-routes.d.ts.map +1 -1
  664. package/dist/server/metadata-social.d.ts +2 -2
  665. package/dist/server/metadata.d.ts +10 -2
  666. package/dist/server/metadata.d.ts.map +1 -1
  667. package/dist/server/middleware-runner.d.ts +20 -5
  668. package/dist/server/middleware-runner.d.ts.map +1 -1
  669. package/dist/server/node-stream-transforms.d.ts +105 -0
  670. package/dist/server/node-stream-transforms.d.ts.map +1 -0
  671. package/dist/server/nuqs-ssr-provider.d.ts +7 -3
  672. package/dist/server/nuqs-ssr-provider.d.ts.map +1 -1
  673. package/dist/server/param-coercion.d.ts +83 -0
  674. package/dist/server/param-coercion.d.ts.map +1 -0
  675. package/dist/server/pipeline-helpers.d.ts +193 -0
  676. package/dist/server/pipeline-helpers.d.ts.map +1 -0
  677. package/dist/server/pipeline-interception.d.ts +70 -9
  678. package/dist/server/pipeline-interception.d.ts.map +1 -1
  679. package/dist/server/pipeline-metadata.d.ts +7 -1
  680. package/dist/server/pipeline-metadata.d.ts.map +1 -1
  681. package/dist/server/pipeline-outcome.d.ts +59 -0
  682. package/dist/server/pipeline-outcome.d.ts.map +1 -0
  683. package/dist/server/pipeline-phases.d.ts +70 -0
  684. package/dist/server/pipeline-phases.d.ts.map +1 -0
  685. package/dist/server/pipeline.d.ts +147 -23
  686. package/dist/server/pipeline.d.ts.map +1 -1
  687. package/dist/server/port-resolution.d.ts +31 -0
  688. package/dist/server/port-resolution.d.ts.map +1 -0
  689. package/dist/server/prebuilt/cache-key.d.ts +63 -0
  690. package/dist/server/prebuilt/cache-key.d.ts.map +1 -0
  691. package/dist/server/prebuilt/capture-render.d.ts +25 -0
  692. package/dist/server/prebuilt/capture-render.d.ts.map +1 -0
  693. package/dist/server/prebuilt/capture-routes.d.ts +37 -0
  694. package/dist/server/prebuilt/capture-routes.d.ts.map +1 -0
  695. package/dist/server/prebuilt/capture-state.d.ts +101 -0
  696. package/dist/server/prebuilt/capture-state.d.ts.map +1 -0
  697. package/dist/server/prebuilt/key-discipline.d.ts +52 -0
  698. package/dist/server/prebuilt/key-discipline.d.ts.map +1 -0
  699. package/dist/server/prebuilt/lifetime.d.ts +38 -0
  700. package/dist/server/prebuilt/lifetime.d.ts.map +1 -0
  701. package/dist/server/prebuilt/manifest-tag-index.d.ts +27 -0
  702. package/dist/server/prebuilt/manifest-tag-index.d.ts.map +1 -0
  703. package/dist/server/prebuilt/overlay.d.ts +100 -0
  704. package/dist/server/prebuilt/overlay.d.ts.map +1 -0
  705. package/dist/server/prebuilt/payload-source.d.ts +79 -0
  706. package/dist/server/prebuilt/payload-source.d.ts.map +1 -0
  707. package/dist/server/prebuilt/slots.d.ts +106 -0
  708. package/dist/server/prebuilt/slots.d.ts.map +1 -0
  709. package/dist/server/prebuilt/synthetic-store.d.ts +67 -0
  710. package/dist/server/prebuilt/synthetic-store.d.ts.map +1 -0
  711. package/dist/server/prebuilt-builder.d.ts +121 -0
  712. package/dist/server/prebuilt-builder.d.ts.map +1 -0
  713. package/dist/server/prebuilt-runtime.d.ts +111 -0
  714. package/dist/server/prebuilt-runtime.d.ts.map +1 -0
  715. package/dist/server/primitives.d.ts +101 -90
  716. package/dist/server/primitives.d.ts.map +1 -1
  717. package/dist/server/publish-params.d.ts +33 -0
  718. package/dist/server/publish-params.d.ts.map +1 -0
  719. package/dist/server/react-cache-bridge.d.ts +59 -0
  720. package/dist/server/react-cache-bridge.d.ts.map +1 -0
  721. package/dist/server/react-cache-scope.d.ts +49 -0
  722. package/dist/server/react-cache-scope.d.ts.map +1 -0
  723. package/dist/server/render-timeout.d.ts +66 -0
  724. package/dist/server/render-timeout.d.ts.map +1 -0
  725. package/dist/server/render-utils.d.ts +35 -0
  726. package/dist/server/render-utils.d.ts.map +1 -0
  727. package/dist/server/request-context.d.ts +128 -103
  728. package/dist/server/request-context.d.ts.map +1 -1
  729. package/dist/server/request-dep.d.ts +15 -0
  730. package/dist/server/request-dep.d.ts.map +1 -0
  731. package/dist/server/response-cache-policy.d.ts +3 -0
  732. package/dist/server/response-cache-policy.d.ts.map +1 -0
  733. package/dist/server/route-element-builder.d.ts +57 -30
  734. package/dist/server/route-element-builder.d.ts.map +1 -1
  735. package/dist/server/route-element-helpers.d.ts +12 -0
  736. package/dist/server/route-element-helpers.d.ts.map +1 -0
  737. package/dist/server/route-handler.d.ts +1 -1
  738. package/dist/server/route-handler.d.ts.map +1 -1
  739. package/dist/server/route-matcher.d.ts +55 -38
  740. package/dist/server/route-matcher.d.ts.map +1 -1
  741. package/dist/server/route-module-loader.d.ts +37 -0
  742. package/dist/server/route-module-loader.d.ts.map +1 -0
  743. package/dist/server/rsc-cache-key-guard.d.ts +78 -0
  744. package/dist/server/rsc-cache-key-guard.d.ts.map +1 -0
  745. package/dist/server/rsc-entry/action-dispatcher.d.ts +67 -0
  746. package/dist/server/rsc-entry/action-dispatcher.d.ts.map +1 -0
  747. package/dist/server/rsc-entry/action-middleware-runner.d.ts +66 -0
  748. package/dist/server/rsc-entry/action-middleware-runner.d.ts.map +1 -0
  749. package/dist/server/rsc-entry/api-handler.d.ts +19 -3
  750. package/dist/server/rsc-entry/api-handler.d.ts.map +1 -1
  751. package/dist/server/rsc-entry/deny-fallback.d.ts +55 -0
  752. package/dist/server/rsc-entry/deny-fallback.d.ts.map +1 -0
  753. package/dist/server/rsc-entry/error-renderer.d.ts +35 -21
  754. package/dist/server/rsc-entry/error-renderer.d.ts.map +1 -1
  755. package/dist/server/rsc-entry/helpers.d.ts +14 -59
  756. package/dist/server/rsc-entry/helpers.d.ts.map +1 -1
  757. package/dist/server/rsc-entry/index.d.ts +30 -6
  758. package/dist/server/rsc-entry/index.d.ts.map +1 -1
  759. package/dist/server/rsc-entry/render-route.d.ts +50 -0
  760. package/dist/server/rsc-entry/render-route.d.ts.map +1 -0
  761. package/dist/server/rsc-entry/render-signals.d.ts +65 -0
  762. package/dist/server/rsc-entry/render-signals.d.ts.map +1 -0
  763. package/dist/server/rsc-entry/revalidate-renderer.d.ts +98 -0
  764. package/dist/server/rsc-entry/revalidate-renderer.d.ts.map +1 -0
  765. package/dist/server/rsc-entry/rsc-payload.d.ts +30 -6
  766. package/dist/server/rsc-entry/rsc-payload.d.ts.map +1 -1
  767. package/dist/server/rsc-entry/rsc-stream.d.ts +12 -30
  768. package/dist/server/rsc-entry/rsc-stream.d.ts.map +1 -1
  769. package/dist/server/rsc-entry/ssr-bridge.d.ts +6 -2
  770. package/dist/server/rsc-entry/ssr-bridge.d.ts.map +1 -1
  771. package/dist/server/rsc-entry/ssr-renderer.d.ts +44 -7
  772. package/dist/server/rsc-entry/ssr-renderer.d.ts.map +1 -1
  773. package/dist/server/rsc-error-envelope.d.ts +11 -0
  774. package/dist/server/rsc-error-envelope.d.ts.map +1 -0
  775. package/dist/server/safe-load.d.ts +39 -0
  776. package/dist/server/safe-load.d.ts.map +1 -0
  777. package/dist/server/sensitive-fields.d.ts +74 -0
  778. package/dist/server/sensitive-fields.d.ts.map +1 -0
  779. package/dist/server/signal-identity.d.ts +43 -0
  780. package/dist/server/signal-identity.d.ts.map +1 -0
  781. package/dist/server/sitemap-generator.d.ts +130 -0
  782. package/dist/server/sitemap-generator.d.ts.map +1 -0
  783. package/dist/server/sitemap-handler.d.ts +22 -0
  784. package/dist/server/sitemap-handler.d.ts.map +1 -0
  785. package/dist/server/skippable-prefix.d.ts +29 -0
  786. package/dist/server/skippable-prefix.d.ts.map +1 -0
  787. package/dist/server/slot-interception.d.ts +80 -0
  788. package/dist/server/slot-interception.d.ts.map +1 -0
  789. package/dist/server/slot-resolver.d.ts +138 -7
  790. package/dist/server/slot-resolver.d.ts.map +1 -1
  791. package/dist/server/slot-subtree-contain.d.ts +54 -0
  792. package/dist/server/slot-subtree-contain.d.ts.map +1 -0
  793. package/dist/server/ssr-bridge-types.d.ts +198 -0
  794. package/dist/server/ssr-bridge-types.d.ts.map +1 -0
  795. package/dist/server/ssr-entry.d.ts +8 -47
  796. package/dist/server/ssr-entry.d.ts.map +1 -1
  797. package/dist/server/ssr-render.d.ts +60 -27
  798. package/dist/server/ssr-render.d.ts.map +1 -1
  799. package/dist/server/ssr-wrappers.d.ts +93 -0
  800. package/dist/server/ssr-wrappers.d.ts.map +1 -0
  801. package/dist/server/state-tree-diff.d.ts +44 -9
  802. package/dist/server/state-tree-diff.d.ts.map +1 -1
  803. package/dist/server/static-generator.d.ts +112 -0
  804. package/dist/server/static-generator.d.ts.map +1 -0
  805. package/dist/server/static-not-found.d.ts +52 -0
  806. package/dist/server/static-not-found.d.ts.map +1 -0
  807. package/dist/server/status-code-resolver.d.ts +26 -15
  808. package/dist/server/status-code-resolver.d.ts.map +1 -1
  809. package/dist/server/stream-utils.d.ts +59 -0
  810. package/dist/server/stream-utils.d.ts.map +1 -0
  811. package/dist/server/tracing.d.ts +57 -26
  812. package/dist/server/tracing.d.ts.map +1 -1
  813. package/dist/server/tree-match.d.ts +59 -0
  814. package/dist/server/tree-match.d.ts.map +1 -0
  815. package/dist/server/types.d.ts +89 -8
  816. package/dist/server/types.d.ts.map +1 -1
  817. package/dist/server/utils/element-type.d.ts +50 -0
  818. package/dist/server/utils/element-type.d.ts.map +1 -0
  819. package/dist/server/utils/escape-html.d.ts +14 -0
  820. package/dist/server/utils/escape-html.d.ts.map +1 -0
  821. package/dist/server/version-skew.d.ts +61 -0
  822. package/dist/server/version-skew.d.ts.map +1 -0
  823. package/dist/server/workers-cache-bridge.d.ts +26 -0
  824. package/dist/server/workers-cache-bridge.d.ts.map +1 -0
  825. package/dist/shared/als-slots.d.ts +42 -0
  826. package/dist/shared/als-slots.d.ts.map +1 -0
  827. package/dist/shared/base-path.d.ts +56 -0
  828. package/dist/shared/base-path.d.ts.map +1 -0
  829. package/dist/shared/csrf-reject.d.ts +16 -0
  830. package/dist/shared/csrf-reject.d.ts.map +1 -0
  831. package/dist/shared/error-digest.d.ts +28 -0
  832. package/dist/shared/error-digest.d.ts.map +1 -0
  833. package/dist/shared/href-validation.d.ts +49 -0
  834. package/dist/shared/href-validation.d.ts.map +1 -0
  835. package/dist/shared/merge-search-params.d.ts +22 -0
  836. package/dist/shared/merge-search-params.d.ts.map +1 -0
  837. package/dist/shared/param-value.d.ts +104 -0
  838. package/dist/shared/param-value.d.ts.map +1 -0
  839. package/dist/shared/payload-root.d.ts +110 -0
  840. package/dist/shared/payload-root.d.ts.map +1 -0
  841. package/dist/shared/redirect-type.d.ts +17 -0
  842. package/dist/shared/redirect-type.d.ts.map +1 -0
  843. package/dist/shared/rsc-cache-key.d.ts +163 -0
  844. package/dist/shared/rsc-cache-key.d.ts.map +1 -0
  845. package/dist/shared/rsc-error-envelope.d.ts +16 -0
  846. package/dist/shared/rsc-error-envelope.d.ts.map +1 -0
  847. package/dist/shared/rsc-manifest.d.ts +28 -0
  848. package/dist/shared/rsc-manifest.d.ts.map +1 -0
  849. package/dist/shared/rsc-media-type.d.ts +52 -0
  850. package/dist/shared/rsc-media-type.d.ts.map +1 -0
  851. package/dist/shared/rsc-payload-path.d.ts +48 -0
  852. package/dist/shared/rsc-payload-path.d.ts.map +1 -0
  853. package/dist/shared/segment-info.d.ts +66 -0
  854. package/dist/shared/segment-info.d.ts.map +1 -0
  855. package/dist/shared/slot-params.d.ts +52 -0
  856. package/dist/shared/slot-params.d.ts.map +1 -0
  857. package/dist/shared/static-platform-files.d.ts +71 -0
  858. package/dist/shared/static-platform-files.d.ts.map +1 -0
  859. package/dist/shared/status-reason-phrase.d.ts +26 -0
  860. package/dist/shared/status-reason-phrase.d.ts.map +1 -0
  861. package/dist/shims/font-google.d.ts +1 -1
  862. package/dist/shims/font-google.d.ts.map +1 -1
  863. package/dist/shims/font-google.js +42 -0
  864. package/dist/shims/font-google.js.map +1 -0
  865. package/dist/shims/font-local.d.ts +26 -0
  866. package/dist/shims/font-local.d.ts.map +1 -0
  867. package/dist/shims/font-local.js +20 -0
  868. package/dist/shims/font-local.js.map +1 -0
  869. package/dist/shims/headers.d.ts +53 -1
  870. package/dist/shims/headers.d.ts.map +1 -1
  871. package/dist/shims/image.d.ts +120 -120
  872. package/dist/shims/image.d.ts.map +1 -1
  873. package/dist/shims/navigation-client.d.ts +25 -12
  874. package/dist/shims/navigation-client.d.ts.map +1 -1
  875. package/dist/shims/navigation-rsc.d.ts +21 -0
  876. package/dist/shims/navigation-rsc.d.ts.map +1 -0
  877. package/dist/shims/navigation.d.ts +10 -5
  878. package/dist/shims/navigation.d.ts.map +1 -1
  879. package/dist/utils/state-machine.d.ts +80 -0
  880. package/dist/utils/state-machine.d.ts.map +1 -0
  881. package/dist/utils/write-file-atomic.d.ts +17 -0
  882. package/dist/utils/write-file-atomic.d.ts.map +1 -0
  883. package/docs/api/30-api-server.mdx +239 -0
  884. package/docs/api/31-api-client.mdx +170 -0
  885. package/docs/api/32-api-cache.mdx +339 -0
  886. package/docs/api/33-api-search-params.mdx +176 -0
  887. package/docs/api/34-api-config.mdx +359 -0
  888. package/docs/api/35-api-typescript.mdx +91 -0
  889. package/docs/api/36-cli.mdx +202 -0
  890. package/docs/learn/00-introduction.mdx +109 -0
  891. package/docs/learn/01-quick-start.mdx +94 -0
  892. package/docs/learn/02-pages-and-layouts.mdx +147 -0
  893. package/docs/learn/03-fetching-data.mdx +227 -0
  894. package/docs/learn/04-access-control.mdx +115 -0
  895. package/docs/learn/05-the-flush-point.mdx +175 -0
  896. package/docs/learn/06-typed-params.mdx +275 -0
  897. package/docs/learn/07-typed-routes.mdx +108 -0
  898. package/docs/learn/08-forms-and-actions.mdx +146 -0
  899. package/docs/learn/09-streaming.mdx +140 -0
  900. package/docs/learn/10-caching.mdx +270 -0
  901. package/docs/learn/11-middleware.mdx +164 -0
  902. package/docs/learn/12-error-handling.mdx +192 -0
  903. package/docs/learn/13-deploying.mdx +287 -0
  904. package/llms.txt +55 -0
  905. package/package.json +120 -29
  906. package/src/adapters/build-output-helper.ts +353 -0
  907. package/src/adapters/canonicalize-module.ts +29 -0
  908. package/src/adapters/cloudflare-dev.ts +183 -0
  909. package/src/adapters/cloudflare-kv-cache.ts +207 -0
  910. package/src/adapters/cloudflare.ts +809 -150
  911. package/src/adapters/compress-module.ts +110 -86
  912. package/src/adapters/fs-identity.ts +155 -0
  913. package/src/adapters/nitro-presets.ts +124 -0
  914. package/src/adapters/nitro-preview.ts +476 -0
  915. package/src/adapters/nitro.ts +317 -457
  916. package/src/adapters/raw-imports.d.ts +5 -0
  917. package/src/adapters/shared.ts +283 -0
  918. package/src/adapters/types.ts +127 -17
  919. package/src/adapters/wrangler.d.ts +7 -0
  920. package/src/analyze/chains.ts +411 -0
  921. package/src/analyze/classify.ts +259 -0
  922. package/src/analyze/crawl-entry.ts +68 -0
  923. package/src/analyze/crawl.ts +500 -0
  924. package/src/analyze/graph-cache.ts +331 -0
  925. package/src/analyze/graph-command.ts +762 -0
  926. package/src/analyze/live-graph.ts +232 -0
  927. package/src/analyze/poison-rules.ts +165 -0
  928. package/src/analyze/poison-scan.ts +159 -0
  929. package/src/analyze/scan.ts +149 -0
  930. package/src/cache/cache-api.ts +107 -0
  931. package/src/cache/fast-hash.ts +5 -0
  932. package/src/cache/handler-store.ts +76 -0
  933. package/src/cache/index.ts +115 -22
  934. package/src/cache/invalidation-epoch.ts +93 -0
  935. package/src/cache/json-lossy-check.ts +69 -0
  936. package/src/cache/redis-handler.ts +198 -20
  937. package/src/cache/singleflight.ts +72 -6
  938. package/src/cache/sizeof.ts +35 -0
  939. package/src/cache/stable-stringify.ts +65 -2
  940. package/src/cache/store.ts +71 -0
  941. package/src/cache/stores/cloudflare-kv.ts +52 -0
  942. package/src/cache/stores/memory.ts +125 -0
  943. package/src/cache/stores/redis.ts +97 -0
  944. package/src/cache/stores/vercel.ts +59 -0
  945. package/src/cache/tag-aware-handler.ts +254 -0
  946. package/src/cache/timber-cache.ts +165 -40
  947. package/src/cdn/cloudflare-purge.ts +50 -0
  948. package/src/cdn/fastly-purge.ts +63 -0
  949. package/src/cdn/headers.ts +153 -0
  950. package/src/cdn/index.ts +23 -0
  951. package/src/cdn/purge-store.ts +34 -0
  952. package/src/cdn/workers-cache-purge.ts +34 -0
  953. package/src/cli-check.ts +417 -0
  954. package/src/cli-context.ts +119 -0
  955. package/src/cli-schema-sync.ts +401 -0
  956. package/src/cli.ts +330 -78
  957. package/src/client/browser-dev.ts +192 -5
  958. package/src/client/browser-entry/action-dispatch.ts +237 -0
  959. package/src/client/browser-entry/action-queue.ts +152 -0
  960. package/src/client/browser-entry/hmr.ts +70 -0
  961. package/src/client/browser-entry/hydrate.ts +143 -0
  962. package/src/client/browser-entry/index.ts +120 -0
  963. package/src/client/browser-entry/post-hydration.ts +99 -0
  964. package/src/client/browser-entry/router-init.ts +406 -0
  965. package/src/client/browser-entry/rsc-stream.ts +145 -0
  966. package/src/client/browser-entry/scroll.ts +50 -0
  967. package/src/client/deny-last-resort.tsx +54 -0
  968. package/src/client/error-boundary.tsx +279 -61
  969. package/src/client/error-reconstituter.tsx +84 -0
  970. package/src/client/form.tsx +36 -32
  971. package/src/client/global-context.ts +31 -0
  972. package/src/client/history.ts +74 -11
  973. package/src/client/index.ts +89 -53
  974. package/src/client/internal.ts +54 -0
  975. package/src/client/link.tsx +468 -151
  976. package/src/client/location-search.ts +15 -0
  977. package/src/client/navigation-api.ts +380 -0
  978. package/src/client/navigation-commit.ts +318 -0
  979. package/src/client/navigation-context.ts +67 -134
  980. package/src/client/navigation-root.tsx +236 -0
  981. package/src/client/navigation-transition.ts +337 -0
  982. package/src/client/nuqs-adapter.tsx +21 -9
  983. package/src/client/params-context.ts +187 -0
  984. package/src/client/react-root.ts +82 -0
  985. package/src/client/router-effects.ts +235 -0
  986. package/src/client/router-lifecycle.ts +354 -0
  987. package/src/client/router-pipeline.ts +458 -0
  988. package/src/client/router-ref.ts +3 -3
  989. package/src/client/router-skew.ts +30 -0
  990. package/src/client/router-types.ts +370 -0
  991. package/src/client/router-url.ts +32 -0
  992. package/src/client/router.ts +491 -424
  993. package/src/client/rsc-fetch.ts +510 -109
  994. package/src/client/segment-cache.ts +362 -41
  995. package/src/client/segment-context.ts +7 -4
  996. package/src/client/segment-outlet.tsx +96 -0
  997. package/src/client/segment-update-context.ts +23 -0
  998. package/src/client/shallow-url.ts +22 -0
  999. package/src/client/slot-content-cache-context.ts +43 -0
  1000. package/src/client/slot-context.ts +50 -0
  1001. package/src/client/slot-outlet.tsx +22 -0
  1002. package/src/client/slot-provider.tsx +32 -0
  1003. package/src/client/ssr-data.ts +27 -67
  1004. package/src/client/stale-client.ts +191 -0
  1005. package/src/client/state.ts +31 -24
  1006. package/src/client/status-page-marker.tsx +32 -0
  1007. package/src/client/top-loader.tsx +13 -10
  1008. package/src/client/unload-guard.ts +35 -3
  1009. package/src/client/use-cookie.ts +70 -18
  1010. package/src/client/use-link-status.ts +7 -7
  1011. package/src/client/use-pathname.ts +22 -31
  1012. package/src/client/use-pending-navigation.ts +40 -0
  1013. package/src/client/use-query-states.ts +206 -36
  1014. package/src/client/use-router.ts +31 -9
  1015. package/src/client/use-search-params.ts +38 -49
  1016. package/src/client/use-segment-params.ts +69 -0
  1017. package/src/client/use-selected-layout-segment.ts +2 -2
  1018. package/src/codec.ts +149 -0
  1019. package/src/config-types.ts +323 -0
  1020. package/src/config-validation.ts +464 -0
  1021. package/src/cookies/define-cookie.ts +222 -53
  1022. package/src/cookies/index.ts +13 -2
  1023. package/src/cookies/json-cookie.ts +105 -0
  1024. package/src/cookies/validation.ts +192 -0
  1025. package/src/dev-tools/404-page.ts +286 -0
  1026. package/src/dev-tools/browser-logs.ts +55 -0
  1027. package/src/dev-tools/dev-page-shell.ts +278 -0
  1028. package/src/dev-tools/error-page.ts +331 -0
  1029. package/src/dev-tools/holding-server.ts +185 -0
  1030. package/src/dev-tools/hydration-overlay.ts +158 -0
  1031. package/src/dev-tools/index.ts +79 -0
  1032. package/src/dev-tools/instrumentation.ts +261 -0
  1033. package/src/{server/dev-logger.ts → dev-tools/logger.ts} +33 -51
  1034. package/src/{plugins/dev-logs.ts → dev-tools/logs.ts} +122 -26
  1035. package/src/{plugins/dev-error-overlay.ts → dev-tools/overlay.ts} +25 -80
  1036. package/src/dev-tools/stack-classifier.ts +75 -0
  1037. package/src/dev-tools/terminal.ts +182 -0
  1038. package/src/fonts/ast-walk.ts +235 -0
  1039. package/src/fonts/ast.ts +479 -128
  1040. package/src/fonts/bundle.ts +138 -0
  1041. package/src/fonts/css.ts +1 -1
  1042. package/src/fonts/dev-middleware.ts +85 -0
  1043. package/src/fonts/fallbacks.ts +0 -23
  1044. package/src/fonts/google.ts +101 -19
  1045. package/src/fonts/local.ts +12 -11
  1046. package/src/fonts/paths.ts +58 -0
  1047. package/src/fonts/pipeline.ts +348 -0
  1048. package/src/fonts/transform.ts +311 -0
  1049. package/src/fonts/types.ts +52 -1
  1050. package/src/fonts/virtual-modules.ts +179 -0
  1051. package/src/index.ts +513 -380
  1052. package/src/params/codec-registry.ts +34 -0
  1053. package/src/params/define-schema.ts +115 -0
  1054. package/src/params/index.ts +17 -0
  1055. package/src/params/resolve-schema.ts +84 -0
  1056. package/src/plugin-context.ts +502 -0
  1057. package/src/plugins/build-manifest.ts +204 -36
  1058. package/src/plugins/build-report.ts +299 -87
  1059. package/src/plugins/cache.ts +243 -0
  1060. package/src/plugins/callsite-ast.ts +472 -0
  1061. package/src/plugins/callsite-jsx.ts +243 -0
  1062. package/src/plugins/chunks.ts +74 -5
  1063. package/src/plugins/client-chunks.ts +185 -0
  1064. package/src/plugins/client-dep-entries.ts +78 -0
  1065. package/src/plugins/cloudflare-wasm.ts +141 -0
  1066. package/src/plugins/content.ts +31 -2
  1067. package/src/plugins/dev-discovery.ts +218 -0
  1068. package/src/plugins/dev-server.ts +360 -97
  1069. package/src/plugins/entries.ts +149 -16
  1070. package/src/plugins/fonts.ts +260 -657
  1071. package/src/plugins/graph-endpoint.ts +532 -0
  1072. package/src/plugins/mdx.ts +108 -35
  1073. package/src/plugins/post-build.ts +327 -0
  1074. package/src/plugins/prebuilt-capture.ts +213 -0
  1075. package/src/plugins/prebuilt-options-analysis.ts +175 -0
  1076. package/src/plugins/prebuilt.ts +670 -0
  1077. package/src/plugins/prerender-sugar.ts +316 -0
  1078. package/src/plugins/react-resolve.ts +149 -0
  1079. package/src/plugins/request-dep/analysis.ts +447 -0
  1080. package/src/plugins/request-dep/index.ts +376 -0
  1081. package/src/plugins/request-dep/origin.ts +310 -0
  1082. package/src/plugins/routing.ts +273 -277
  1083. package/src/plugins/rsc-assets-manifest.ts +251 -0
  1084. package/src/plugins/server-bundle.ts +99 -14
  1085. package/src/plugins/shims.ts +260 -97
  1086. package/src/plugins/static-build.ts +681 -71
  1087. package/src/react-canary.d.ts +2 -0
  1088. package/src/routing/codegen-shared.ts +39 -0
  1089. package/src/routing/codegen-types.ts +62 -0
  1090. package/src/routing/codegen-write.ts +163 -0
  1091. package/src/routing/codegen.ts +349 -232
  1092. package/src/routing/collision-probe.ts +438 -0
  1093. package/src/routing/collision-spaces.ts +281 -0
  1094. package/src/routing/convention-lint.ts +651 -0
  1095. package/src/routing/export-detect.ts +536 -0
  1096. package/src/routing/file-cache.ts +23 -0
  1097. package/src/routing/index.ts +16 -7
  1098. package/src/routing/interception-overlap.ts +141 -0
  1099. package/src/routing/interception.ts +1044 -67
  1100. package/src/routing/link-codegen.ts +280 -0
  1101. package/src/routing/manifest-codegen.ts +232 -0
  1102. package/src/routing/scanner.ts +417 -223
  1103. package/src/routing/schema-validation.ts +155 -0
  1104. package/src/routing/segment-classify.ts +280 -0
  1105. package/src/routing/segment-codegen.ts +99 -0
  1106. package/src/routing/segment-keys.ts +186 -0
  1107. package/src/routing/slot-placement.ts +97 -0
  1108. package/src/routing/types.ts +82 -26
  1109. package/src/routing/walkers.ts +98 -0
  1110. package/src/rsc-runtime/rsc.ts +9 -0
  1111. package/src/rsc-runtime/ssr.ts +51 -0
  1112. package/src/rsc-runtime/transforms.ts +13 -0
  1113. package/src/rsc-runtime/vendor-types.d.ts +27 -0
  1114. package/src/schema-bridge.ts +382 -0
  1115. package/src/search-params/define.ts +677 -0
  1116. package/src/search-params/index.ts +14 -20
  1117. package/src/search-params/parse-total.ts +91 -0
  1118. package/src/search-params/serialize-equal.ts +14 -0
  1119. package/src/search-params/wrappers.ts +150 -0
  1120. package/src/server/access-gate.tsx +195 -56
  1121. package/src/server/action-client.ts +126 -33
  1122. package/src/server/action-encryption.ts +144 -0
  1123. package/src/server/action-handler.ts +457 -111
  1124. package/src/server/actions.ts +172 -85
  1125. package/src/server/als-registry.ts +224 -25
  1126. package/src/server/body-limits.ts +10 -2
  1127. package/src/server/build-manifest.ts +33 -57
  1128. package/src/server/canonicalize.ts +6 -3
  1129. package/src/server/chain-url-parts.ts +163 -0
  1130. package/src/server/children-interception.ts +116 -0
  1131. package/src/server/coalesce-tick.ts +75 -0
  1132. package/src/server/compress.ts +43 -8
  1133. package/src/server/cookie-context.ts +454 -0
  1134. package/src/server/cookie-parsing.ts +163 -0
  1135. package/src/server/csp-nonce.ts +58 -0
  1136. package/src/server/csrf.ts +228 -35
  1137. package/src/server/debug.ts +0 -1
  1138. package/src/server/default-logger.ts +100 -0
  1139. package/src/server/default-status-page.ts +88 -0
  1140. package/src/server/deny-boundary.ts +527 -0
  1141. package/src/server/deny-renderer.ts +201 -179
  1142. package/src/server/early-hints-sender.ts +4 -3
  1143. package/src/server/early-hints.ts +39 -29
  1144. package/src/server/error-boundary-wrapper.ts +160 -44
  1145. package/src/server/error-response-headers.ts +18 -0
  1146. package/src/server/fallback-error.ts +88 -104
  1147. package/src/server/flight-injection-state.ts +113 -0
  1148. package/src/server/flight-scripts.ts +67 -0
  1149. package/src/server/form-data.ts +124 -12
  1150. package/src/server/form-flash.ts +3 -3
  1151. package/src/server/head-response.ts +54 -0
  1152. package/src/server/html-injector-core.ts +512 -0
  1153. package/src/server/html-injectors.ts +270 -255
  1154. package/src/server/index.ts +36 -192
  1155. package/src/server/instrumentation.ts +11 -4
  1156. package/src/server/internal.ts +168 -0
  1157. package/src/server/json-status-response.ts +105 -0
  1158. package/src/server/logger.ts +126 -38
  1159. package/src/server/metadata-collector.ts +177 -0
  1160. package/src/server/metadata-platform.ts +2 -2
  1161. package/src/server/metadata-render.ts +30 -8
  1162. package/src/server/metadata-routes.ts +220 -24
  1163. package/src/server/metadata-social.ts +2 -2
  1164. package/src/server/metadata.ts +23 -2
  1165. package/src/server/middleware-runner.ts +32 -5
  1166. package/src/server/node-stream-transforms.ts +323 -0
  1167. package/src/server/nuqs-ssr-provider.tsx +8 -7
  1168. package/src/server/param-coercion.ts +201 -0
  1169. package/src/server/pipeline-helpers.ts +485 -0
  1170. package/src/server/pipeline-interception.ts +241 -32
  1171. package/src/server/pipeline-metadata.ts +15 -1
  1172. package/src/server/pipeline-outcome.ts +290 -0
  1173. package/src/server/pipeline-phases.ts +496 -0
  1174. package/src/server/pipeline.ts +385 -427
  1175. package/src/server/port-resolution.ts +53 -0
  1176. package/src/server/prebuilt/cache-key.ts +299 -0
  1177. package/src/server/prebuilt/capture-render.ts +118 -0
  1178. package/src/server/prebuilt/capture-routes.ts +104 -0
  1179. package/src/server/prebuilt/capture-state.ts +196 -0
  1180. package/src/server/prebuilt/key-discipline.ts +122 -0
  1181. package/src/server/prebuilt/lifetime.ts +151 -0
  1182. package/src/server/prebuilt/manifest-tag-index.ts +46 -0
  1183. package/src/server/prebuilt/overlay.ts +256 -0
  1184. package/src/server/prebuilt/payload-source.ts +202 -0
  1185. package/src/server/prebuilt/slots.ts +202 -0
  1186. package/src/server/prebuilt/synthetic-store.ts +125 -0
  1187. package/src/server/prebuilt-builder.ts +514 -0
  1188. package/src/server/prebuilt-runtime.ts +813 -0
  1189. package/src/server/primitives.ts +153 -171
  1190. package/src/server/publish-params.ts +42 -0
  1191. package/src/server/react-cache-bridge.ts +124 -0
  1192. package/src/server/react-cache-scope.ts +104 -0
  1193. package/src/server/render-timeout.ts +128 -0
  1194. package/src/server/render-utils.ts +45 -0
  1195. package/src/server/request-context.ts +269 -332
  1196. package/src/server/request-dep.ts +37 -0
  1197. package/src/server/response-cache-policy.ts +45 -0
  1198. package/src/server/route-element-builder.ts +514 -355
  1199. package/src/server/route-element-helpers.ts +37 -0
  1200. package/src/server/route-handler.ts +67 -27
  1201. package/src/server/route-matcher.ts +238 -267
  1202. package/src/server/route-module-loader.ts +161 -0
  1203. package/src/server/rsc-cache-key-guard.ts +122 -0
  1204. package/src/server/rsc-entry/action-dispatcher.ts +142 -0
  1205. package/src/server/rsc-entry/action-middleware-runner.ts +130 -0
  1206. package/src/server/rsc-entry/api-handler.ts +49 -81
  1207. package/src/server/rsc-entry/deny-fallback.ts +151 -0
  1208. package/src/server/rsc-entry/error-renderer.ts +301 -113
  1209. package/src/server/rsc-entry/helpers.ts +90 -115
  1210. package/src/server/rsc-entry/index.ts +370 -350
  1211. package/src/server/rsc-entry/render-route.ts +229 -0
  1212. package/src/server/rsc-entry/render-signals.ts +108 -0
  1213. package/src/server/rsc-entry/revalidate-renderer.ts +349 -0
  1214. package/src/server/rsc-entry/rsc-payload.ts +192 -72
  1215. package/src/server/rsc-entry/rsc-stream.ts +128 -131
  1216. package/src/server/rsc-entry/ssr-bridge.ts +19 -6
  1217. package/src/server/rsc-entry/ssr-renderer.ts +300 -137
  1218. package/src/server/rsc-error-envelope.ts +18 -0
  1219. package/src/server/rsc-prop-warnings.ts +1 -1
  1220. package/src/server/safe-load.ts +53 -0
  1221. package/src/server/sensitive-fields.ts +230 -0
  1222. package/src/server/server-only-guard-noop.js +3 -0
  1223. package/src/server/server-timing.ts +1 -1
  1224. package/src/server/signal-identity.ts +112 -0
  1225. package/src/server/sitemap-generator.ts +337 -0
  1226. package/src/server/sitemap-handler.ts +157 -0
  1227. package/src/server/skippable-prefix.ts +172 -0
  1228. package/src/server/slot-interception.ts +168 -0
  1229. package/src/server/slot-resolver.ts +707 -300
  1230. package/src/server/slot-subtree-contain.ts +273 -0
  1231. package/src/server/ssr-bridge-types.ts +201 -0
  1232. package/src/server/ssr-entry.ts +225 -104
  1233. package/src/server/ssr-render.ts +354 -91
  1234. package/src/server/ssr-wrappers.tsx +162 -0
  1235. package/src/server/state-tree-diff.ts +85 -30
  1236. package/src/server/static-generator.ts +680 -0
  1237. package/src/server/static-not-found.ts +134 -0
  1238. package/src/server/status-code-resolver.ts +107 -148
  1239. package/src/server/stream-utils.ts +343 -0
  1240. package/src/server/tracing.ts +163 -68
  1241. package/src/server/tree-match.ts +494 -0
  1242. package/src/server/types.ts +96 -11
  1243. package/src/server/utils/element-type.ts +88 -0
  1244. package/src/server/utils/escape-html.ts +20 -0
  1245. package/src/server/version-skew.ts +104 -0
  1246. package/src/server/waituntil-bridge.ts +1 -1
  1247. package/src/server/workers-cache-bridge.ts +33 -0
  1248. package/src/shared/als-slots.ts +74 -0
  1249. package/src/shared/base-path.ts +80 -0
  1250. package/src/shared/csrf-reject.ts +15 -0
  1251. package/src/shared/error-digest.ts +46 -0
  1252. package/src/shared/href-validation.ts +159 -0
  1253. package/src/shared/merge-search-params.ts +55 -0
  1254. package/src/shared/param-value.ts +281 -0
  1255. package/src/shared/payload-root.ts +153 -0
  1256. package/src/shared/redirect-type.ts +17 -0
  1257. package/src/shared/rsc-cache-key.ts +269 -0
  1258. package/src/shared/rsc-error-envelope.ts +16 -0
  1259. package/src/shared/rsc-manifest.ts +29 -0
  1260. package/src/shared/rsc-media-type.ts +59 -0
  1261. package/src/shared/rsc-payload-path.ts +52 -0
  1262. package/src/shared/segment-info.ts +67 -0
  1263. package/src/shared/slot-params.ts +109 -0
  1264. package/src/shared/static-platform-files.ts +75 -0
  1265. package/src/shared/status-reason-phrase.ts +61 -0
  1266. package/src/shims/font-google.ts +1 -1
  1267. package/src/shims/font-local.ts +34 -0
  1268. package/src/shims/headers.ts +122 -1
  1269. package/src/shims/navigation-client.ts +36 -32
  1270. package/src/shims/navigation-rsc.ts +47 -0
  1271. package/src/shims/navigation.ts +10 -7
  1272. package/src/utils/state-machine.ts +111 -0
  1273. package/src/utils/write-file-atomic.ts +32 -0
  1274. package/dist/_chunks/als-registry-B7DbZ2hS.js +0 -41
  1275. package/dist/_chunks/als-registry-B7DbZ2hS.js.map +0 -1
  1276. package/dist/_chunks/debug-B3Gypr3D.js +0 -108
  1277. package/dist/_chunks/debug-B3Gypr3D.js.map +0 -1
  1278. package/dist/_chunks/format-RyoGQL74.js +0 -164
  1279. package/dist/_chunks/format-RyoGQL74.js.map +0 -1
  1280. package/dist/_chunks/interception-BOoWmLUA.js +0 -676
  1281. package/dist/_chunks/interception-BOoWmLUA.js.map +0 -1
  1282. package/dist/_chunks/metadata-routes-Cjmvi3rQ.js.map +0 -1
  1283. package/dist/_chunks/request-context-BQUC8PHn.js +0 -330
  1284. package/dist/_chunks/request-context-BQUC8PHn.js.map +0 -1
  1285. package/dist/_chunks/ssr-data-MjmprTmO.js +0 -88
  1286. package/dist/_chunks/ssr-data-MjmprTmO.js.map +0 -1
  1287. package/dist/_chunks/tracing-CemImE6h.js +0 -187
  1288. package/dist/_chunks/tracing-CemImE6h.js.map +0 -1
  1289. package/dist/_chunks/use-cookie-DX-l1_5E.js +0 -91
  1290. package/dist/_chunks/use-cookie-DX-l1_5E.js.map +0 -1
  1291. package/dist/_chunks/use-query-states-D5KaffOK.js +0 -109
  1292. package/dist/_chunks/use-query-states-D5KaffOK.js.map +0 -1
  1293. package/dist/adapters/cloudflare.js.map +0 -1
  1294. package/dist/cache/index.js.map +0 -1
  1295. package/dist/cache/register-cached-function.d.ts +0 -17
  1296. package/dist/cache/register-cached-function.d.ts.map +0 -1
  1297. package/dist/client/browser-entry.d.ts +0 -21
  1298. package/dist/client/browser-entry.d.ts.map +0 -1
  1299. package/dist/client/error-boundary.js.map +0 -1
  1300. package/dist/client/head.d.ts +0 -16
  1301. package/dist/client/head.d.ts.map +0 -1
  1302. package/dist/client/link-status-provider.d.ts +0 -11
  1303. package/dist/client/link-status-provider.d.ts.map +0 -1
  1304. package/dist/client/segment-merger.d.ts +0 -119
  1305. package/dist/client/segment-merger.d.ts.map +0 -1
  1306. package/dist/client/stale-reload.d.ts +0 -44
  1307. package/dist/client/stale-reload.d.ts.map +0 -1
  1308. package/dist/client/transition-root.d.ts +0 -74
  1309. package/dist/client/transition-root.d.ts.map +0 -1
  1310. package/dist/client/types.d.ts +0 -14
  1311. package/dist/client/types.d.ts.map +0 -1
  1312. package/dist/client/use-navigation-pending.d.ts +0 -26
  1313. package/dist/client/use-navigation-pending.d.ts.map +0 -1
  1314. package/dist/client/use-params.d.ts +0 -92
  1315. package/dist/client/use-params.d.ts.map +0 -1
  1316. package/dist/content/index.d.ts +0 -11
  1317. package/dist/content/index.d.ts.map +0 -1
  1318. package/dist/content/index.js +0 -2
  1319. package/dist/plugins/adapter-build.d.ts +0 -18
  1320. package/dist/plugins/adapter-build.d.ts.map +0 -1
  1321. package/dist/plugins/cache-transform.d.ts +0 -36
  1322. package/dist/plugins/cache-transform.d.ts.map +0 -1
  1323. package/dist/plugins/dev-error-overlay.d.ts.map +0 -1
  1324. package/dist/plugins/dev-logs.d.ts.map +0 -1
  1325. package/dist/plugins/dynamic-transform.d.ts +0 -72
  1326. package/dist/plugins/dynamic-transform.d.ts.map +0 -1
  1327. package/dist/plugins/server-action-exports.d.ts +0 -26
  1328. package/dist/plugins/server-action-exports.d.ts.map +0 -1
  1329. package/dist/routing/status-file-lint.d.ts +0 -33
  1330. package/dist/routing/status-file-lint.d.ts.map +0 -1
  1331. package/dist/search-params/analyze.d.ts +0 -54
  1332. package/dist/search-params/analyze.d.ts.map +0 -1
  1333. package/dist/search-params/builtin-codecs.d.ts +0 -105
  1334. package/dist/search-params/builtin-codecs.d.ts.map +0 -1
  1335. package/dist/search-params/codecs.d.ts +0 -53
  1336. package/dist/search-params/codecs.d.ts.map +0 -1
  1337. package/dist/search-params/create.d.ts +0 -106
  1338. package/dist/search-params/create.d.ts.map +0 -1
  1339. package/dist/search-params/registry.d.ts +0 -20
  1340. package/dist/search-params/registry.d.ts.map +0 -1
  1341. package/dist/server/asset-headers.d.ts +0 -42
  1342. package/dist/server/asset-headers.d.ts.map +0 -1
  1343. package/dist/server/client-module-map.d.ts +0 -47
  1344. package/dist/server/client-module-map.d.ts.map +0 -1
  1345. package/dist/server/dev-fetch-instrumentation.d.ts +0 -22
  1346. package/dist/server/dev-fetch-instrumentation.d.ts.map +0 -1
  1347. package/dist/server/dev-logger.d.ts.map +0 -1
  1348. package/dist/server/dev-span-processor.d.ts +0 -29
  1349. package/dist/server/dev-span-processor.d.ts.map +0 -1
  1350. package/dist/server/dev-warnings.d.ts +0 -129
  1351. package/dist/server/dev-warnings.d.ts.map +0 -1
  1352. package/dist/server/flush.d.ts +0 -74
  1353. package/dist/server/flush.d.ts.map +0 -1
  1354. package/dist/server/manifest-status-resolver.d.ts +0 -58
  1355. package/dist/server/manifest-status-resolver.d.ts.map +0 -1
  1356. package/dist/server/prerender.d.ts +0 -77
  1357. package/dist/server/prerender.d.ts.map +0 -1
  1358. package/dist/server/tree-builder.d.ts +0 -126
  1359. package/dist/server/tree-builder.d.ts.map +0 -1
  1360. package/dist/utils/directive-parser.d.ts +0 -70
  1361. package/dist/utils/directive-parser.d.ts.map +0 -1
  1362. package/src/cache/register-cached-function.ts +0 -103
  1363. package/src/client/browser-entry.ts +0 -678
  1364. package/src/client/head.ts +0 -61
  1365. package/src/client/link-status-provider.tsx +0 -30
  1366. package/src/client/segment-merger.ts +0 -339
  1367. package/src/client/stale-reload.ts +0 -87
  1368. package/src/client/transition-root.tsx +0 -166
  1369. package/src/client/types.ts +0 -21
  1370. package/src/client/use-navigation-pending.ts +0 -38
  1371. package/src/client/use-params.ts +0 -141
  1372. package/src/content/index.ts +0 -13
  1373. package/src/plugins/adapter-build.ts +0 -118
  1374. package/src/plugins/cache-transform.ts +0 -199
  1375. package/src/plugins/dynamic-transform.ts +0 -161
  1376. package/src/plugins/server-action-exports.ts +0 -220
  1377. package/src/routing/status-file-lint.ts +0 -112
  1378. package/src/search-params/analyze.ts +0 -192
  1379. package/src/search-params/builtin-codecs.ts +0 -228
  1380. package/src/search-params/codecs.ts +0 -153
  1381. package/src/search-params/create.ts +0 -321
  1382. package/src/search-params/registry.ts +0 -31
  1383. package/src/server/asset-headers.ts +0 -81
  1384. package/src/server/client-module-map.ts +0 -58
  1385. package/src/server/dev-fetch-instrumentation.ts +0 -96
  1386. package/src/server/dev-span-processor.ts +0 -78
  1387. package/src/server/dev-warnings.ts +0 -283
  1388. package/src/server/flush.ts +0 -182
  1389. package/src/server/manifest-status-resolver.ts +0 -215
  1390. package/src/server/prerender.ts +0 -139
  1391. package/src/server/tree-builder.ts +0 -382
  1392. package/src/shims/server-only-noop.js +0 -6
  1393. package/src/utils/directive-parser.ts +0 -529
@@ -0,0 +1,564 @@
1
+ import { n as createSingleflight } from "./singleflight-BeVMMKi0.js";
2
+ import { a as _setStatusPageRendered, f as statusPageRendered, r as _setOnStatusPageRendered, u as onStatusPageRendered } from "./state-BhNGPsdi.js";
3
+ import { useLayoutEffect } from "react";
4
+ //#region src/shared/rsc-error-envelope.ts
5
+ /**
6
+ * The hard-navigate error envelope shared by the server and the client router.
7
+ *
8
+ * A client-navigation (RSC) request cannot carry an error *page* — the response
9
+ * body must be Flight data or the decoder crashes. Instead the server answers
10
+ * with this envelope: an `X-Timber-Error: 1` header and a minimal JSON body.
11
+ * The client treats it as "give up on SPA navigation and hard-navigate", and
12
+ * the resulting document request renders the real error page as HTML.
13
+ *
14
+ * The header name lives here so the four server producers and the single
15
+ * client consumer cannot drift apart. See design/10-error-handling.md
16
+ * §"Error Page Rendering for Client Navigation".
17
+ */
18
+ /** Header the client checks to decide whether to hard-navigate. */
19
+ var TIMBER_ERROR_HEADER = "X-Timber-Error";
20
+ //#endregion
21
+ //#region src/client/segment-cache.ts
22
+ /**
23
+ * Maintains the client-side segment tree representing currently mounted
24
+ * layouts and pages. Used for navigation reconciliation — the router diffs
25
+ * new routes against this tree to determine which segments to re-fetch.
26
+ */
27
+ var SegmentCache = class {
28
+ root;
29
+ /**
30
+ * Monotonic counter. Bumped by `invalidateReuse()` (TIM-1466).
31
+ * `serializeStateTree` suppresses `segments` and `slots` when
32
+ * `reuseInvalidatedAt > reuseRestoredAt`. Only `restoreReuse()`
33
+ * advances `reuseRestoredAt` — `set()` does not, because a
34
+ * pre-invalidation navigation's commit thunk would lift suppression
35
+ * before a post-invalidation request has been sent (codex on #1167).
36
+ */
37
+ reuseInvalidatedAt = 0;
38
+ reuseRestoredAt = 0;
39
+ get(segment) {
40
+ if (segment === "/" || segment === this.root?.segment) return this.root;
41
+ }
42
+ set(segment, node) {
43
+ if (segment === "/" || !this.root) this.root = node;
44
+ }
45
+ clear() {
46
+ this.root = void 0;
47
+ this.reuseRestoredAt = this.reuseInvalidatedAt;
48
+ }
49
+ /**
50
+ * Suppress segment and slot reuse without destroying the tree
51
+ * structure (TIM-1466). `serializeStateTree` sends empty
52
+ * `segments`/`slots` (forcing a full render) while `treePaths`
53
+ * still reflects the mounted tree for interception scoping.
54
+ * Call `restoreReuse()` once post-invalidation data has been
55
+ * fetched and committed.
56
+ */
57
+ invalidateReuse() {
58
+ this.reuseInvalidatedAt++;
59
+ }
60
+ /**
61
+ * Lift reuse suppression. Called after the segment cache has been
62
+ * rebuilt from a response that was fetched with suppression active
63
+ * (i.e. the server sent a full render). Safe to call idempotently.
64
+ */
65
+ restoreReuse() {
66
+ this.reuseRestoredAt = this.reuseInvalidatedAt;
67
+ }
68
+ /** Whether segment/slot reuse is currently suppressed (TIM-1466). */
69
+ isReuseSuppressed() {
70
+ return this.reuseInvalidatedAt > this.reuseRestoredAt;
71
+ }
72
+ /**
73
+ * Serialize the mounted segment tree for the X-Timber-State-Tree header.
74
+ * Only includes sync segments — async segments are excluded because the
75
+ * server must always re-render them (they may depend on request context).
76
+ *
77
+ * When mergeableFilter is provided, only segments whose paths are in the
78
+ * set are included. This ensures the server only skips segments that the
79
+ * client can actually merge (i.e., segments whose cached element tree
80
+ * contains an inner SegmentProvider the merger can splice into).
81
+ *
82
+ * `treePaths` is collected UNFILTERED, unlike `segments` and `slots`. Those
83
+ * two answer "what may the server skip re-rendering?", so every reason a
84
+ * segment cannot be reused is a reason to leave it out. `treePaths` answers
85
+ * "what is mounted right now?" for interception scoping — a request-dependent
86
+ * layout is still on screen, and dropping it would silently narrow the scope
87
+ * the server sees and cancel a modal that should open (TIM-1282).
88
+ *
89
+ * This is a performance optimization only, NOT a security boundary.
90
+ * The server always runs all access.ts files regardless of the state tree.
91
+ */
92
+ serializeStateTree(mergeableFilter) {
93
+ const segments = [];
94
+ const slots = [];
95
+ const treePaths = [];
96
+ const suppressed = this.reuseInvalidatedAt > this.reuseRestoredAt;
97
+ if (this.root) {
98
+ if (!suppressed) {
99
+ collectSyncSegments(this.root, segments, mergeableFilter);
100
+ collectSyncSlots(this.root, slots);
101
+ }
102
+ collectTreePaths(this.root, treePaths);
103
+ }
104
+ const tree = { segments };
105
+ if (slots.length > 0) tree.slots = slots;
106
+ if (treePaths.length > 0) tree.treePaths = treePaths;
107
+ return tree;
108
+ }
109
+ };
110
+ /** Recursively collect sync segment paths from the tree */
111
+ function collectSyncSegments(node, out, mergeableFilter) {
112
+ if (!node.isRequestDependent && (!mergeableFilter || mergeableFilter.has(node.segment))) out.push(node.segment);
113
+ for (const child of node.children.values()) collectSyncSegments(child, out, mergeableFilter);
114
+ }
115
+ /**
116
+ * Recursively collect the `app/` directory path of every mounted segment.
117
+ *
118
+ * Slots are not walked: a slot's own sub-tree can never own an intercepting
119
+ * slot's scope, because scopes are always ordinary segments (`interception.ts`
120
+ * derives one from the slot owner's ancestor chain).
121
+ */
122
+ function collectTreePaths(node, out) {
123
+ if (node.treePath) out.push(node.treePath);
124
+ for (const child of node.children.values()) collectTreePaths(child, out);
125
+ }
126
+ /**
127
+ * Recursively collect content keys from cacheable slots.
128
+ *
129
+ * The server advertises a content key per slot on every render (TIM-1370),
130
+ * encoding the owner's URL parts, the slot name, the matched entry file,
131
+ * and the slot's params. The client stores this key and sends it back on
132
+ * the next navigation so the server can decide skips by key membership —
133
+ * no departing URL reconstruction needed.
134
+ */
135
+ function collectSyncSlots(node, out) {
136
+ if (node.slots) {
137
+ for (const slot of node.slots.values()) if (!slot.isRequestDependent && !slot.denied && slot.contentKey) out.push(slot.contentKey);
138
+ }
139
+ for (const child of node.children.values()) collectSyncSlots(child, out);
140
+ }
141
+ /**
142
+ * Build a SegmentNode tree from flat segment metadata.
143
+ *
144
+ * Takes an ordered list of segment descriptors (root → leaf) from the
145
+ * server's X-Timber-Segments header and constructs the hierarchical
146
+ * tree structure that SegmentCache expects.
147
+ *
148
+ * Each segment is nested as a child of the previous one, forming a
149
+ * linear chain from root to leaf. The leaf segment (page) is excluded
150
+ * from the tree — pages are never cached across navigations.
151
+ */
152
+ function buildSegmentTree(segments) {
153
+ if (segments.length === 0) return void 0;
154
+ const segmentEntries = [];
155
+ const slotEntries = [];
156
+ for (const info of segments) if (info.slot) slotEntries.push(info);
157
+ else segmentEntries.push(info);
158
+ let root;
159
+ let parent;
160
+ const nodeById = /* @__PURE__ */ new Map();
161
+ for (const info of segmentEntries) {
162
+ const id = info.segmentId ?? info.path;
163
+ const node = {
164
+ segment: id,
165
+ treePath: info.treePath,
166
+ payload: null,
167
+ isRequestDependent: info.isRequestDependent,
168
+ children: /* @__PURE__ */ new Map()
169
+ };
170
+ nodeById.set(id, node);
171
+ if (!root) root = node;
172
+ if (parent) parent.children.set(id, node);
173
+ parent = node;
174
+ }
175
+ for (const slotInfo of slotEntries) {
176
+ const parentId = slotInfo.parentSegment;
177
+ const parentNode = parentId ? nodeById.get(parentId) : root;
178
+ if (!parentNode) continue;
179
+ const slotId = slotInfo.segmentId ?? slotInfo.path;
180
+ const slotNode = {
181
+ segment: slotId,
182
+ payload: null,
183
+ isRequestDependent: slotInfo.isRequestDependent,
184
+ children: /* @__PURE__ */ new Map(),
185
+ denied: slotInfo.denied,
186
+ contentKey: slotInfo.contentKey
187
+ };
188
+ if (!parentNode.slots) parentNode.slots = /* @__PURE__ */ new Map();
189
+ parentNode.slots.set(slotId, slotNode);
190
+ }
191
+ return root;
192
+ }
193
+ /** Sentinel value for negative cache entries (URL is not a route). */
194
+ var NEGATIVE_ENTRY = Object.freeze({ payload: null });
195
+ /**
196
+ * Timeout for the in-flight singleflight (TIM-1438). Per CLAUDE.md's
197
+ * singleflight rule: "Never write a coalescing Map without a timeout."
198
+ * A hung prefetch cannot block clicks or suppress hovers forever.
199
+ */
200
+ var PREFETCH_SINGLEFLIGHT_TIMEOUT_MS = 5e3;
201
+ /**
202
+ * Compose the map key. Length-prefixed rather than delimiter-joined for the
203
+ * same reason `shared/rsc-cache-key.ts` is: any delimiter is forgeable by a
204
+ * value containing it, and a URL may contain any character a delimiter could.
205
+ */
206
+ function prefetchMapKey(key) {
207
+ return `${key.from.length}:${key.from}:${key.scope.length}:${key.scope}:${key.url}`;
208
+ }
209
+ /**
210
+ * The `scope` half of a `PrefetchKey`, derived from the state tree that will
211
+ * actually be sent. Taking it from the header value rather than re-walking the
212
+ * cache is the point: the key varies by exactly what the request varies by.
213
+ */
214
+ function prefetchScopeOf(stateTree) {
215
+ return stateTree?.treePaths?.join("\0") ?? "";
216
+ }
217
+ /**
218
+ * Short-lived cache for hover-triggered prefetches. Entries expire after
219
+ * 30 seconds. When a link is clicked, the prefetched payload is consumed
220
+ * (moved to the history stack) and removed from this cache.
221
+ *
222
+ * In-flight dedup (TIM-1438): concurrent fetches for the same key are
223
+ * coalesced by a `createSingleflight` instance. A hover starts a flight;
224
+ * a click for the same key joins it instead of issuing a duplicate. The
225
+ * singleflight enforces a 5-second timeout and cleans up automatically
226
+ * on settlement.
227
+ *
228
+ * timber.js does NOT prefetch on viewport intersection — only explicit
229
+ * hover on <Link prefetch> triggers a prefetch.
230
+ */
231
+ var PrefetchCache = class PrefetchCache {
232
+ static TTL_MS = 3e4;
233
+ entries = /* @__PURE__ */ new Map();
234
+ flights = createSingleflight({ timeoutMs: PREFETCH_SINGLEFLIGHT_TIMEOUT_MS });
235
+ evictionGen = 0;
236
+ set(key, result) {
237
+ this.entries.set(prefetchMapKey(key), {
238
+ result,
239
+ expiresAt: Date.now() + PrefetchCache.TTL_MS
240
+ });
241
+ }
242
+ get(key) {
243
+ const mapKey = prefetchMapKey(key);
244
+ const entry = this.entries.get(mapKey);
245
+ if (!entry) return void 0;
246
+ if (Date.now() >= entry.expiresAt) {
247
+ this.entries.delete(mapKey);
248
+ return;
249
+ }
250
+ return entry.result;
251
+ }
252
+ /** True if a ready or negative entry exists for this key. */
253
+ has(key) {
254
+ return this.get(key) !== void 0;
255
+ }
256
+ /** Get and remove the entry (used when navigation consumes a prefetch) */
257
+ consume(key) {
258
+ const result = this.get(key);
259
+ if (result !== void 0) this.entries.delete(prefetchMapKey(key));
260
+ return result;
261
+ }
262
+ /**
263
+ * Fetch or coalesce with an in-flight fetch for this key (TIM-1438).
264
+ *
265
+ * Concurrent callers (hover + click, repeated hovers) get the same
266
+ * promise. On success the result is stored as a ready entry. On
267
+ * NonRscResponse a negative entry is stored and the outcome is
268
+ * `{ kind: 'non-route' }`. Other errors (network, version skew)
269
+ * reject — the singleflight cleans up the key and subsequent callers
270
+ * retry.
271
+ *
272
+ * The singleflight signal is passed to `doFetch` so a timed-out flight
273
+ * aborts the underlying fetch rather than leaving it running.
274
+ */
275
+ fetchOrCoalesce(key, doFetch, isNonRoute) {
276
+ const genAtStart = this.evictionGen;
277
+ return this.flights.do(prefetchMapKey(key), async (signal) => {
278
+ try {
279
+ const result = await doFetch(signal);
280
+ if (!signal.aborted && this.evictionGen === genAtStart) this.set(key, result);
281
+ return {
282
+ kind: "ready",
283
+ result,
284
+ startGen: genAtStart
285
+ };
286
+ } catch (err) {
287
+ if (isNonRoute(err)) {
288
+ if (!signal.aborted && this.evictionGen === genAtStart) this.setNegative(key);
289
+ return {
290
+ kind: "non-route",
291
+ startGen: genAtStart
292
+ };
293
+ }
294
+ throw err;
295
+ }
296
+ });
297
+ }
298
+ /**
299
+ * Join an in-flight singleflight fetch if one exists for this key.
300
+ * Returns the in-flight promise or undefined. Used by the click path to
301
+ * coalesce with a hover prefetch without starting a new flight — when no
302
+ * flight exists, the click issues its own fetch with the navigation's
303
+ * abort signal so superseded navigations abort immediately (TIM-1438).
304
+ */
305
+ joinInflight(key) {
306
+ return this.flights.get(prefetchMapKey(key));
307
+ }
308
+ /**
309
+ * Store a negative entry — the URL is not a route (non-RSC Content-Type).
310
+ *
311
+ * Keyed like every other entry even though "not a route" does not actually
312
+ * vary by departing URL: a source-independent negative would be a second
313
+ * keying rule to keep correct, and the only cost of the uniform one is a
314
+ * repeated fetch for a link hovered from a second page.
315
+ */
316
+ setNegative(key) {
317
+ this.set(key, NEGATIVE_ENTRY);
318
+ }
319
+ /** Check if the entry is a negative cache entry (URL is not a route). */
320
+ isNegative(key) {
321
+ return this.get(key) === NEGATIVE_ENTRY;
322
+ }
323
+ /**
324
+ * Evict all ready entries and fence in-flight singleflights (TIM-1476).
325
+ * Called after a server action that revalidated data — the mutation may
326
+ * affect any route, not just the paths the server named. In-flight
327
+ * singleflights are not aborted (they may carry post-mutation data),
328
+ * but their results are discarded if they complete after eviction:
329
+ * `fetchOrCoalesce` captures the generation before the flight and
330
+ * skips the store when it has been bumped.
331
+ *
332
+ * Consumers that join an in-flight flight via `joinInflight` must
333
+ * check `getEvictionGen()` before and after the await: if the gen
334
+ * changed, the result predates the eviction and must be discarded
335
+ * (codex on #1131 round 2).
336
+ */
337
+ clearReady() {
338
+ this.entries.clear();
339
+ this.evictionGen++;
340
+ }
341
+ getEvictionGen() {
342
+ return this.evictionGen;
343
+ }
344
+ };
345
+ //#endregion
346
+ //#region src/client/router-url.ts
347
+ /**
348
+ * How the client router reads the URLs it is handed.
349
+ *
350
+ * One parser, so the places that key or compare by URL — the history stack,
351
+ * the navigation state a page renders with, the departing page sent as
352
+ * `X-Timber-URL` — cannot disagree about what a URL says. They did: a
353
+ * history entry stored under `navigate('/café')`'s spelling was looked up
354
+ * under the address bar's `/caf%C3%A9`, and missed (TIM-1541).
355
+ */
356
+ var BASE = "http://localhost";
357
+ /**
358
+ * Parse a router URL. A URL that starts with "/" is a path — including one
359
+ * that starts with "//": that is the pathname a document at
360
+ * `https://host//a/b` reports, and resolved against a base it would parse as
361
+ * a scheme-relative reference to host `a`. Anything else resolves against a
362
+ * placeholder origin, so an absolute URL keeps its own.
363
+ */
364
+ function parseRouterUrl(url) {
365
+ return url.startsWith("/") ? new URL(BASE + url) : new URL(url, BASE);
366
+ }
367
+ /**
368
+ * The spelling a URL is stored and looked up under: the browser's own
369
+ * pathname + search, so `/a?` and `/a`, `/café` and `/caf%C3%A9`, are one
370
+ * key. The fragment is dropped — it is client-only.
371
+ */
372
+ function routerUrlKey(url) {
373
+ const parsed = parseRouterUrl(url);
374
+ return parsed.pathname + parsed.search;
375
+ }
376
+ //#endregion
377
+ //#region src/client/navigation-commit.ts
378
+ /**
379
+ * What it means for a page to be "current" on the client.
380
+ *
381
+ * One module owns every write that makes a navigation's destination the
382
+ * current page, and the read that describes the current page back to the
383
+ * server. Keeping them together is the point: `X-Timber-State-Tree` is
384
+ * derived from the segment cache, so the thing that publishes and the thing
385
+ * that reports have to agree about when a page becomes current.
386
+ *
387
+ * See design/19-client-navigation.md §"State Update Invariants".
388
+ */
389
+ /**
390
+ * Record that a status page for the main route is on screen. Called from
391
+ * `StatusPageMarker`'s layout effect; consumed by the commit of the
392
+ * navigation whose tree it belongs to, and acted on immediately for the
393
+ * commits that have none.
394
+ */
395
+ function reportStatusPageRendered() {
396
+ _setStatusPageRendered(true);
397
+ onStatusPageRendered?.();
398
+ }
399
+ /** Whether a response skipped layouts — its payload merges over the tree on screen. */
400
+ function isPartialNavigation(skippedSegments) {
401
+ return skippedSegments != null && skippedSegments.length > 0;
402
+ }
403
+ /**
404
+ * Whether a payload can stand on its own when replayed from the history
405
+ * stack. See `NavigationCommitInput.skippedSegments`.
406
+ */
407
+ function isReplayable(opts) {
408
+ return !isPartialNavigation(opts.skippedSegments) && !hasSkippedSlot(opts.segmentInfo);
409
+ }
410
+ function hasSkippedSlot(segmentInfo) {
411
+ return segmentInfo?.some((s) => s.slot && s.skipped) ?? false;
412
+ }
413
+ /**
414
+ * The metadata a committed page keeps — on its history entry, and as the
415
+ * current page's `committedSegmentInfo()`. `skipped` describes the
416
+ * *response* — "this slot's content was omitted" — and neither stores such
417
+ * a payload (the entry stores null). Kept, the flag outlives the response:
418
+ * `applyActionResult()` reuses the current page's metadata beside a full
419
+ * re-render and would have that judged non-replayable too.
420
+ */
421
+ function storedSegmentInfo(segmentInfo) {
422
+ if (!hasSkippedSlot(segmentInfo)) return segmentInfo;
423
+ return segmentInfo.map(({ skipped: _skipped, ...rest }) => rest);
424
+ }
425
+ /**
426
+ * Derive the navigation state (pathname + search) a URL renders with.
427
+ *
428
+ * Pure. The value travels with the tree it describes — callers pass it to
429
+ * `wrapPayload`, and the router's record of the displayed tree keeps it
430
+ * beside that tree — so there is no store to publish it to (TIM-1541).
431
+ */
432
+ function deriveNavigationState(url) {
433
+ const parsed = parseRouterUrl(url);
434
+ return {
435
+ pathname: parsed.pathname || "/",
436
+ search: parsed.search
437
+ };
438
+ }
439
+ function createNavigationCommitter(deps) {
440
+ const { segmentCache, historyStack } = deps;
441
+ let committedSegmentInfo = null;
442
+ _setOnStatusPageRendered(() => segmentCache.clear());
443
+ /**
444
+ * Update the segment cache from server-provided segment metadata.
445
+ *
446
+ * Runs whether or not `clientSegmentCache` is enabled: the tree is also
447
+ * where the mounted tree paths come from, and those cross on every
448
+ * navigation. What the flag gates is which parts get serialized — see
449
+ * `currentStateTree`.
450
+ */
451
+ function updateSegmentCache(segmentInfo) {
452
+ const tree = buildSegmentTree(segmentInfo);
453
+ if (tree) segmentCache.set("/", tree);
454
+ }
455
+ return {
456
+ committedSegmentInfo: () => committedSegmentInfo,
457
+ isSegmentReuseSuppressed: () => segmentCache.isReuseSuppressed(),
458
+ restoreSegmentReuse: () => segmentCache.restoreReuse(),
459
+ /**
460
+ * The X-Timber-State-Tree to send with the next RSC request.
461
+ *
462
+ * Two different things travel on one header. `segments`/`slots` are the
463
+ * caching opt-in and are omitted unless `clientSegmentCache` is on.
464
+ * `treePaths` is how the server learns which route is actually mounted,
465
+ * which stops being derivable from the address bar as soon as a modal is
466
+ * open — so it crosses regardless (TIM-1282). Undefined when there is
467
+ * nothing to say, so a no-op header never enters the `_rsc` cache key.
468
+ *
469
+ * Reads what the last *committed* navigation published, so a superseded
470
+ * navigation's destination can never end up describing the mounted tree
471
+ * (TIM-1301).
472
+ */
473
+ currentStateTree() {
474
+ const tree = segmentCache.serializeStateTree();
475
+ if (deps.clientSegmentCache()) return tree;
476
+ return tree.treePaths ? {
477
+ segments: [],
478
+ treePaths: tree.treePaths
479
+ } : void 0;
480
+ },
481
+ /**
482
+ * Prepare all navigation-owned state for a new page — without publishing
483
+ * any of it. Every code path that changes the "current page" must go
484
+ * through this function, which is what makes "forgot a field" impossible
485
+ * by construction.
486
+ *
487
+ * Returns the destination's `NavigationState`, which is a pure function of
488
+ * the URL and is what the incoming tree is *rendered* with, plus a
489
+ * `commit` thunk that performs the writes that make a page current:
490
+ * 1. Segment cache — update from server-provided segment metadata
491
+ * 2. The current page's segment metadata (`committedSegmentInfo`)
492
+ * 3. History stack — store the payload for instant back/forward replay
493
+ *
494
+ * Pathname and search are not written here: they are the returned
495
+ * `navState`, which the tree renders with and the router's record of the
496
+ * displayed tree keeps (browser-entry/router-init.ts `publishTree`).
497
+ *
498
+ * Nothing is written until `commit()` runs, and on a transitioned
499
+ * navigation it runs only once the transition is known to have won — see
500
+ * `renderViaTransition` and `NavigationRoot`. A navigation superseded
501
+ * while its payload was in flight never calls it, so the cache, the
502
+ * pathname the client reports and the history stack all keep describing
503
+ * the route still on screen (TIM-1301).
504
+ *
505
+ * Callers with state of their own to publish — the address bar, the
506
+ * client's record of the mounted tree — wrap this thunk rather than
507
+ * commit beside it, so there stays exactly one moment at which a page
508
+ * becomes current.
509
+ */
510
+ prepareNavigation(url, opts) {
511
+ const navState = deriveNavigationState(url);
512
+ const payload = isReplayable(opts) ? opts.payload : null;
513
+ _setStatusPageRendered(false);
514
+ return {
515
+ navState,
516
+ commit() {
517
+ const cacheable = !statusPageRendered;
518
+ _setStatusPageRendered(false);
519
+ const segmentInfo = cacheable ? opts.segmentInfo : [];
520
+ if (segmentInfo && segmentInfo.length > 0) updateSegmentCache(segmentInfo);
521
+ else if (segmentInfo?.length === 0 || opts.clearSegmentCacheOnEmpty) segmentCache.clear();
522
+ committedSegmentInfo = storedSegmentInfo(segmentInfo) ?? null;
523
+ historyStack.push(url, {
524
+ payload,
525
+ params: opts.params,
526
+ segmentInfo: committedSegmentInfo
527
+ });
528
+ }
529
+ };
530
+ }
531
+ };
532
+ }
533
+ //#endregion
534
+ //#region src/client/status-page-marker.tsx
535
+ /**
536
+ * The one way a status page tells the router it is on screen.
537
+ *
538
+ * A status page replaces a subtree, and the segment cache must not learn a
539
+ * chain that never mounted (see `navigation-commit.ts` §"What a status page
540
+ * teaches the cache"). Status pages are produced in three places — an
541
+ * in-tree catch site rendering the page it owns, the server's fallback
542
+ * renderers, and a client boundary rendering its fallback for a Flight row —
543
+ * and every one of them wraps the page in this marker, so the report does
544
+ * not depend on which producer it was. In particular the in-tree case, the
545
+ * common `access.ts` deny, never involves a client boundary at all.
546
+ *
547
+ * A layout effect, on every commit that renders the marker rather than on
548
+ * mount only: React reuses the fiber when one status page is replaced by
549
+ * another at the same position, and the second one must report too. Layout
550
+ * effects run child-before-parent, so the report lands before the ancestor
551
+ * `NavigationRoot` publishes the same commit, and never for a render React
552
+ * discards. Idempotent, so StrictMode's double invocation and a status page
553
+ * re-rendering on its own state are harmless. See TIM-1495.
554
+ */
555
+ function StatusPageMarker({ children }) {
556
+ useLayoutEffect(() => {
557
+ reportStatusPageRendered();
558
+ });
559
+ return children;
560
+ }
561
+ //#endregion
562
+ export { routerUrlKey as a, prefetchScopeOf as c, parseRouterUrl as i, TIMBER_ERROR_HEADER as l, createNavigationCommitter as n, PrefetchCache as o, isPartialNavigation as r, SegmentCache as s, StatusPageMarker as t };
563
+
564
+ //# sourceMappingURL=status-page-marker-BRX9Ib-d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status-page-marker-BRX9Ib-d.js","names":[],"sources":["../../src/shared/rsc-error-envelope.ts","../../src/client/segment-cache.ts","../../src/client/router-url.ts","../../src/client/navigation-commit.ts","../../src/client/status-page-marker.tsx"],"sourcesContent":["/**\n * The hard-navigate error envelope shared by the server and the client router.\n *\n * A client-navigation (RSC) request cannot carry an error *page* — the response\n * body must be Flight data or the decoder crashes. Instead the server answers\n * with this envelope: an `X-Timber-Error: 1` header and a minimal JSON body.\n * The client treats it as \"give up on SPA navigation and hard-navigate\", and\n * the resulting document request renders the real error page as HTML.\n *\n * The header name lives here so the four server producers and the single\n * client consumer cannot drift apart. See design/10-error-handling.md\n * §\"Error Page Rendering for Client Navigation\".\n */\n\n/** Header the client checks to decide whether to hard-navigate. */\nexport const TIMBER_ERROR_HEADER = 'X-Timber-Error';\n","// Segment Cache — stores the mounted segment tree and prefetched payloads\n// See design/19-client-navigation.md for architecture details.\n\nimport type { PublishedParams } from '../shared/payload-root.ts';\nimport type { SegmentInfo, StateTree } from '../shared/segment-info.ts';\nimport { createSingleflight } from '../cache/singleflight.ts';\n\n// ─── Types ───────────────────────────────────────────────────────\n\n/** A prefetched RSC result with optional segment metadata. */\nexport interface PrefetchResult {\n payload: unknown;\n /**\n * Completion of the full Flight stream, when the prefetch is still decoding.\n * Carried through to the navigation that consumes the entry so a decode\n * failure reaches *that* navigation's recovery rather than dying with the\n * prefetch (TIM-1275).\n */\n decodePromise?: Promise<void> | null;\n /** Segment metadata from X-Timber-Segments header for populating the segment cache. */\n segmentInfo?: SegmentInfo[] | null;\n /**\n * The params published beside `payload`, split off the same payload root.\n * Carried so a consumed prefetch publishes the params of the tree it is\n * about to render, and not the ones already on screen.\n */\n params?: PublishedParams | Promise<PublishedParams>;\n /** Segment paths skipped by the server (for client-side merging). */\n skippedSegments?: string[] | null;\n}\n\n/**\n * A node in the client-side segment tree. Each node represents a mounted\n * layout or page segment with its RSC flight payload.\n */\nexport interface SegmentNode {\n /** The segment's URL pattern (e.g., \"/\", \"/dashboard\", \"/projects/[id]\") */\n segment: string;\n /**\n * The segment's `app/` directory path, groups included (e.g. `/(browse)/feed`).\n * Undefined for slot nodes and for servers that predate the field.\n */\n treePath?: string;\n /** The RSC flight payload for this segment (opaque to the cache) */\n payload: unknown;\n /**\n * Whether the segment/slot is request-dependent (calls getHeaders,\n * getSearchParams, cookies, etc.). Request-dependent segments always\n * re-render on navigation. For segments, this is still based on the\n * AsyncFunction heuristic (to be replaced separately). For slots,\n * this is taint-tracked via ALS.\n */\n isRequestDependent: boolean;\n /** Child segments keyed by segment path */\n children: Map<string, SegmentNode>;\n /** Parallel route slots keyed by slot path (e.g., \"/@sidebar\") */\n slots?: Map<string, SegmentNode>;\n /** Whether this slot's access.ts denied on its last render. */\n denied?: boolean;\n /**\n * Content key for slot nodes — opaque string the server computed from\n * owner parts, slot name, entry file, and slot params. Advertised back\n * to the server so it can decide skips by key membership (TIM-1370).\n */\n contentKey?: string;\n}\n\n// ─── Segment Cache ───────────────────────────────────────────────\n\n/**\n * Maintains the client-side segment tree representing currently mounted\n * layouts and pages. Used for navigation reconciliation — the router diffs\n * new routes against this tree to determine which segments to re-fetch.\n */\nexport class SegmentCache {\n private root: SegmentNode | undefined;\n /**\n * Monotonic counter. Bumped by `invalidateReuse()` (TIM-1466).\n * `serializeStateTree` suppresses `segments` and `slots` when\n * `reuseInvalidatedAt > reuseRestoredAt`. Only `restoreReuse()`\n * advances `reuseRestoredAt` — `set()` does not, because a\n * pre-invalidation navigation's commit thunk would lift suppression\n * before a post-invalidation request has been sent (codex on #1167).\n */\n private reuseInvalidatedAt = 0;\n private reuseRestoredAt = 0;\n\n get(segment: string): SegmentNode | undefined {\n if (segment === '/' || segment === this.root?.segment) {\n return this.root;\n }\n return undefined;\n }\n\n set(segment: string, node: SegmentNode): void {\n if (segment === '/' || !this.root) {\n this.root = node;\n }\n }\n\n clear(): void {\n this.root = undefined;\n this.reuseRestoredAt = this.reuseInvalidatedAt;\n }\n\n /**\n * Suppress segment and slot reuse without destroying the tree\n * structure (TIM-1466). `serializeStateTree` sends empty\n * `segments`/`slots` (forcing a full render) while `treePaths`\n * still reflects the mounted tree for interception scoping.\n * Call `restoreReuse()` once post-invalidation data has been\n * fetched and committed.\n */\n invalidateReuse(): void {\n this.reuseInvalidatedAt++;\n }\n\n /**\n * Lift reuse suppression. Called after the segment cache has been\n * rebuilt from a response that was fetched with suppression active\n * (i.e. the server sent a full render). Safe to call idempotently.\n */\n restoreReuse(): void {\n this.reuseRestoredAt = this.reuseInvalidatedAt;\n }\n\n /** Whether segment/slot reuse is currently suppressed (TIM-1466). */\n isReuseSuppressed(): boolean {\n return this.reuseInvalidatedAt > this.reuseRestoredAt;\n }\n\n /**\n * Serialize the mounted segment tree for the X-Timber-State-Tree header.\n * Only includes sync segments — async segments are excluded because the\n * server must always re-render them (they may depend on request context).\n *\n * When mergeableFilter is provided, only segments whose paths are in the\n * set are included. This ensures the server only skips segments that the\n * client can actually merge (i.e., segments whose cached element tree\n * contains an inner SegmentProvider the merger can splice into).\n *\n * `treePaths` is collected UNFILTERED, unlike `segments` and `slots`. Those\n * two answer \"what may the server skip re-rendering?\", so every reason a\n * segment cannot be reused is a reason to leave it out. `treePaths` answers\n * \"what is mounted right now?\" for interception scoping — a request-dependent\n * layout is still on screen, and dropping it would silently narrow the scope\n * the server sees and cancel a modal that should open (TIM-1282).\n *\n * This is a performance optimization only, NOT a security boundary.\n * The server always runs all access.ts files regardless of the state tree.\n */\n serializeStateTree(mergeableFilter?: Set<string>): StateTree {\n const segments: string[] = [];\n const slots: string[] = [];\n const treePaths: string[] = [];\n const suppressed = this.reuseInvalidatedAt > this.reuseRestoredAt;\n if (this.root) {\n if (!suppressed) {\n collectSyncSegments(this.root, segments, mergeableFilter);\n collectSyncSlots(this.root, slots);\n }\n collectTreePaths(this.root, treePaths);\n }\n const tree: StateTree = { segments };\n if (slots.length > 0) {\n tree.slots = slots;\n }\n if (treePaths.length > 0) {\n tree.treePaths = treePaths;\n }\n return tree;\n }\n}\n\n/** Recursively collect sync segment paths from the tree */\nfunction collectSyncSegments(\n node: SegmentNode,\n out: string[],\n mergeableFilter?: Set<string>\n): void {\n if (!node.isRequestDependent && (!mergeableFilter || mergeableFilter.has(node.segment))) {\n out.push(node.segment);\n }\n for (const child of node.children.values()) {\n collectSyncSegments(child, out, mergeableFilter);\n }\n}\n\n/**\n * Recursively collect the `app/` directory path of every mounted segment.\n *\n * Slots are not walked: a slot's own sub-tree can never own an intercepting\n * slot's scope, because scopes are always ordinary segments (`interception.ts`\n * derives one from the slot owner's ancestor chain).\n */\nfunction collectTreePaths(node: SegmentNode, out: string[]): void {\n if (node.treePath) out.push(node.treePath);\n for (const child of node.children.values()) {\n collectTreePaths(child, out);\n }\n}\n\n/**\n * Recursively collect content keys from cacheable slots.\n *\n * The server advertises a content key per slot on every render (TIM-1370),\n * encoding the owner's URL parts, the slot name, the matched entry file,\n * and the slot's params. The client stores this key and sends it back on\n * the next navigation so the server can decide skips by key membership —\n * no departing URL reconstruction needed.\n */\nfunction collectSyncSlots(node: SegmentNode, out: string[]): void {\n if (node.slots) {\n for (const slot of node.slots.values()) {\n if (!slot.isRequestDependent && !slot.denied && slot.contentKey) {\n out.push(slot.contentKey);\n }\n }\n }\n for (const child of node.children.values()) {\n collectSyncSlots(child, out);\n }\n}\n\n// ─── Segment Tree Builder ────────────────────────────────────────\n\n/**\n * Build a SegmentNode tree from flat segment metadata.\n *\n * Takes an ordered list of segment descriptors (root → leaf) from the\n * server's X-Timber-Segments header and constructs the hierarchical\n * tree structure that SegmentCache expects.\n *\n * Each segment is nested as a child of the previous one, forming a\n * linear chain from root to leaf. The leaf segment (page) is excluded\n * from the tree — pages are never cached across navigations.\n */\nexport function buildSegmentTree(segments: SegmentInfo[]): SegmentNode | undefined {\n // Need at least a root segment to build a tree\n if (segments.length === 0) return undefined;\n\n // Separate slot entries from segment entries. Slots are attached to\n // their parent segment node after the main chain is built.\n const segmentEntries: SegmentInfo[] = [];\n const slotEntries: SegmentInfo[] = [];\n for (const info of segments) {\n if (info.slot) {\n slotEntries.push(info);\n } else {\n segmentEntries.push(info);\n }\n }\n\n // Build the main segment chain.\n let root: SegmentNode | undefined;\n let parent: SegmentNode | undefined;\n const nodeById = new Map<string, SegmentNode>();\n\n for (const info of segmentEntries) {\n const id = info.segmentId ?? info.path;\n const node: SegmentNode = {\n segment: id,\n treePath: info.treePath,\n payload: null,\n isRequestDependent: info.isRequestDependent,\n children: new Map(),\n };\n\n nodeById.set(id, node);\n\n if (!root) {\n root = node;\n }\n\n if (parent) {\n parent.children.set(id, node);\n }\n\n parent = node;\n }\n\n // Attach slot entries to their parent segment nodes.\n for (const slotInfo of slotEntries) {\n const parentId = slotInfo.parentSegment;\n const parentNode = parentId ? nodeById.get(parentId) : root;\n if (!parentNode) continue;\n\n const slotId = slotInfo.segmentId ?? slotInfo.path;\n const slotNode: SegmentNode = {\n segment: slotId,\n payload: null,\n isRequestDependent: slotInfo.isRequestDependent,\n children: new Map(),\n denied: slotInfo.denied,\n contentKey: slotInfo.contentKey,\n };\n\n if (!parentNode.slots) {\n parentNode.slots = new Map();\n }\n parentNode.slots.set(slotId, slotNode);\n }\n\n return root;\n}\n\n// ─── Prefetch Cache ──────────────────────────────────────────────\n\ninterface ReadyEntry {\n result: PrefetchResult;\n expiresAt: number;\n}\n\n/** Sentinel value for negative cache entries (URL is not a route). */\nconst NEGATIVE_ENTRY: PrefetchResult = Object.freeze({ payload: null });\n\n/**\n * Timeout for the in-flight singleflight (TIM-1438). Per CLAUDE.md's\n * singleflight rule: \"Never write a coalescing Map without a timeout.\"\n * A hung prefetch cannot block clicks or suppress hovers forever.\n */\nconst PREFETCH_SINGLEFLIGHT_TIMEOUT_MS = 5_000;\n\n/**\n * Identifies a prefetched payload. A payload is addressed by *every* input that\n * changes the server's answer, not by the destination alone.\n *\n * The server's answer for a destination depends on where the request came\n * from — that is the whole mechanism behind intercepting routes, and it also\n * drives slot-skip resolution. A prefetch issued from `/gallery` is a modal\n * payload; the same URL prefetched from `/` is the full page. Keying on the\n * destination alone let the first click after a hover be answered with\n * whichever variant happened to be fetched (TIM-1265).\n *\n * `from` alone stopped being enough in TIM-1282. It is a pathname, and once\n * interception scope comes from the rendered tree rather than the address, one\n * pathname no longer names one source tree: `/photo/1` is the address both for\n * a modal open over `(browse)` and for `(landing)`'s canonical page. A key\n * without the scope hands the modal payload to the canonical page's click,\n * which renders it without the server's scope check ever running.\n *\n * The two reads happen at different instants — `scope` is sampled at hover and\n * again at click — which is why a tree that changed in between produces a\n * *miss* and a refetch rather than a wrong hit.\n */\nexport interface PrefetchKey {\n /** Destination URL — hash-less `pathname + search`, as navigate() fetches it. */\n url: string;\n /** Departing pathname — the `X-Timber-URL` the prefetch was issued with. */\n from: string;\n /**\n * The rendered scope the prefetch was issued with — the `treePaths` half of\n * `X-Timber-State-Tree`, joined. Empty when none crossed.\n */\n scope: string;\n}\n\n/**\n * Compose the map key. Length-prefixed rather than delimiter-joined for the\n * same reason `shared/rsc-cache-key.ts` is: any delimiter is forgeable by a\n * value containing it, and a URL may contain any character a delimiter could.\n */\nfunction prefetchMapKey(key: PrefetchKey): string {\n return `${key.from.length}:${key.from}:${key.scope.length}:${key.scope}:${key.url}`;\n}\n\n/**\n * The `scope` half of a `PrefetchKey`, derived from the state tree that will\n * actually be sent. Taking it from the header value rather than re-walking the\n * cache is the point: the key varies by exactly what the request varies by.\n */\nexport function prefetchScopeOf(stateTree: StateTree | undefined): string {\n return stateTree?.treePaths?.join('\\u0000') ?? '';\n}\n\n/** Outcome of a prefetch flight — discriminated so NonRscResponse is a\n * success (stores a negative entry) rather than a rejection.\n * `startGen` is the eviction generation at flight start — joiners that\n * started after a gen bump must reject pre-invalidation results (TIM-1464). */\nexport type FlightOutcome =\n | { kind: 'ready'; result: PrefetchResult; startGen: number }\n | { kind: 'non-route'; startGen: number };\n\n/**\n * Short-lived cache for hover-triggered prefetches. Entries expire after\n * 30 seconds. When a link is clicked, the prefetched payload is consumed\n * (moved to the history stack) and removed from this cache.\n *\n * In-flight dedup (TIM-1438): concurrent fetches for the same key are\n * coalesced by a `createSingleflight` instance. A hover starts a flight;\n * a click for the same key joins it instead of issuing a duplicate. The\n * singleflight enforces a 5-second timeout and cleans up automatically\n * on settlement.\n *\n * timber.js does NOT prefetch on viewport intersection — only explicit\n * hover on <Link prefetch> triggers a prefetch.\n */\nexport class PrefetchCache {\n private static readonly TTL_MS = 30_000;\n private entries = new Map<string, ReadyEntry>();\n private flights = createSingleflight({ timeoutMs: PREFETCH_SINGLEFLIGHT_TIMEOUT_MS });\n private evictionGen = 0;\n\n set(key: PrefetchKey, result: PrefetchResult): void {\n this.entries.set(prefetchMapKey(key), {\n result,\n expiresAt: Date.now() + PrefetchCache.TTL_MS,\n });\n }\n\n get(key: PrefetchKey): PrefetchResult | undefined {\n const mapKey = prefetchMapKey(key);\n const entry = this.entries.get(mapKey);\n if (!entry) return undefined;\n if (Date.now() >= entry.expiresAt) {\n this.entries.delete(mapKey);\n return undefined;\n }\n return entry.result;\n }\n\n /** True if a ready or negative entry exists for this key. */\n has(key: PrefetchKey): boolean {\n return this.get(key) !== undefined;\n }\n\n /** Get and remove the entry (used when navigation consumes a prefetch) */\n consume(key: PrefetchKey): PrefetchResult | undefined {\n const result = this.get(key);\n if (result !== undefined) {\n this.entries.delete(prefetchMapKey(key));\n }\n return result;\n }\n\n /**\n * Fetch or coalesce with an in-flight fetch for this key (TIM-1438).\n *\n * Concurrent callers (hover + click, repeated hovers) get the same\n * promise. On success the result is stored as a ready entry. On\n * NonRscResponse a negative entry is stored and the outcome is\n * `{ kind: 'non-route' }`. Other errors (network, version skew)\n * reject — the singleflight cleans up the key and subsequent callers\n * retry.\n *\n * The singleflight signal is passed to `doFetch` so a timed-out flight\n * aborts the underlying fetch rather than leaving it running.\n */\n fetchOrCoalesce(\n key: PrefetchKey,\n doFetch: (signal: AbortSignal) => Promise<PrefetchResult>,\n isNonRoute: (error: unknown) => boolean\n ): Promise<FlightOutcome> {\n // Capture the eviction generation before the flight starts. If an\n // action evicts caches while this flight is in progress, the gen\n // will have bumped and the stale result is discarded (TIM-1476).\n // The starting gen is also included in the outcome so joiners\n // that started after a gen bump can detect pre-invalidation\n // results (TIM-1464).\n const genAtStart = this.evictionGen;\n return this.flights.do(prefetchMapKey(key), async (signal) => {\n try {\n const result = await doFetch(signal);\n if (!signal.aborted && this.evictionGen === genAtStart) this.set(key, result);\n return { kind: 'ready' as const, result, startGen: genAtStart };\n } catch (err) {\n if (isNonRoute(err)) {\n if (!signal.aborted && this.evictionGen === genAtStart) this.setNegative(key);\n return { kind: 'non-route' as const, startGen: genAtStart };\n }\n throw err;\n }\n });\n }\n\n /**\n * Join an in-flight singleflight fetch if one exists for this key.\n * Returns the in-flight promise or undefined. Used by the click path to\n * coalesce with a hover prefetch without starting a new flight — when no\n * flight exists, the click issues its own fetch with the navigation's\n * abort signal so superseded navigations abort immediately (TIM-1438).\n */\n joinInflight(key: PrefetchKey): Promise<FlightOutcome> | undefined {\n return this.flights.get(prefetchMapKey(key)) as Promise<FlightOutcome> | undefined;\n }\n\n /**\n * Store a negative entry — the URL is not a route (non-RSC Content-Type).\n *\n * Keyed like every other entry even though \"not a route\" does not actually\n * vary by departing URL: a source-independent negative would be a second\n * keying rule to keep correct, and the only cost of the uniform one is a\n * repeated fetch for a link hovered from a second page.\n */\n setNegative(key: PrefetchKey): void {\n this.set(key, NEGATIVE_ENTRY);\n }\n\n /** Check if the entry is a negative cache entry (URL is not a route). */\n isNegative(key: PrefetchKey): boolean {\n return this.get(key) === NEGATIVE_ENTRY;\n }\n\n /**\n * Evict all ready entries and fence in-flight singleflights (TIM-1476).\n * Called after a server action that revalidated data — the mutation may\n * affect any route, not just the paths the server named. In-flight\n * singleflights are not aborted (they may carry post-mutation data),\n * but their results are discarded if they complete after eviction:\n * `fetchOrCoalesce` captures the generation before the flight and\n * skips the store when it has been bumped.\n *\n * Consumers that join an in-flight flight via `joinInflight` must\n * check `getEvictionGen()` before and after the await: if the gen\n * changed, the result predates the eviction and must be discarded\n * (codex on #1131 round 2).\n */\n clearReady(): void {\n this.entries.clear();\n this.evictionGen++;\n }\n\n getEvictionGen(): number {\n return this.evictionGen;\n }\n}\n","/**\n * How the client router reads the URLs it is handed.\n *\n * One parser, so the places that key or compare by URL — the history stack,\n * the navigation state a page renders with, the departing page sent as\n * `X-Timber-URL` — cannot disagree about what a URL says. They did: a\n * history entry stored under `navigate('/café')`'s spelling was looked up\n * under the address bar's `/caf%C3%A9`, and missed (TIM-1541).\n */\n\nconst BASE = 'http://localhost';\n\n/**\n * Parse a router URL. A URL that starts with \"/\" is a path — including one\n * that starts with \"//\": that is the pathname a document at\n * `https://host//a/b` reports, and resolved against a base it would parse as\n * a scheme-relative reference to host `a`. Anything else resolves against a\n * placeholder origin, so an absolute URL keeps its own.\n */\nexport function parseRouterUrl(url: string): URL {\n return url.startsWith('/') ? new URL(BASE + url) : new URL(url, BASE);\n}\n\n/**\n * The spelling a URL is stored and looked up under: the browser's own\n * pathname + search, so `/a?` and `/a`, `/café` and `/caf%C3%A9`, are one\n * key. The fragment is dropped — it is client-only.\n */\nexport function routerUrlKey(url: string): string {\n const parsed = parseRouterUrl(url);\n return parsed.pathname + parsed.search;\n}\n","/**\n * What it means for a page to be \"current\" on the client.\n *\n * One module owns every write that makes a navigation's destination the\n * current page, and the read that describes the current page back to the\n * server. Keeping them together is the point: `X-Timber-State-Tree` is\n * derived from the segment cache, so the thing that publishes and the thing\n * that reports have to agree about when a page becomes current.\n *\n * See design/19-client-navigation.md §\"State Update Invariants\".\n */\n\nimport { buildSegmentTree, type SegmentCache } from './segment-cache.ts';\nimport type { HistoryStack } from './history.ts';\nimport type { SegmentInfo, StateTree } from '../shared/segment-info.ts';\nimport type { ParamsSource } from '../shared/payload-root.ts';\nimport type { NavigationState } from './navigation-context.ts';\nimport { parseRouterUrl } from './router-url.ts';\nimport {\n statusPageRendered,\n _setStatusPageRendered,\n onStatusPageRendered,\n _setOnStatusPageRendered,\n} from './state.ts';\n\n// ─── What a status page teaches the cache ─────────────────────────────────\n//\n// A status page replaces a subtree: a deny page lands at the segment owning\n// the matched file and nothing below it mounts; an `error.tsx` fallback\n// discards everything under the boundary that rendered it. `X-Timber-Segments`\n// nonetheless describes the whole chain the payload was built against — it\n// must, because a partial navigation picks its merge point out of it — so the\n// cache has to be told not to learn from such a tree.\n//\n// The HTTP status used to say so, and could not be trusted to: an RSC payload\n// response commits one macrotask after its first chunk, and a nested\n// component that denies after I/O puts its row in the stream after the\n// status line has gone out (TIM-1489). The only thing that reliably knows a\n// status page rendered is the status page itself, and the only moment that\n// matters is the commit that puts it on screen — so every status page the\n// framework produces is wrapped in `StatusPageMarker`, whose layout effect\n// reports on each commit that renders it. Layout effects run child-before-\n// parent, so the report lands before `NavigationRoot`'s publish of that\n// same commit, and never for a render React discards. Without Suspense\n// around the row, the transition cannot commit until the row has arrived, so\n// this covers the delayed nested case too, which no status ever could.\n//\n// The report also clears the cache on the spot, because not every commit\n// has a navigation to consume it: a deny row arriving inside a Suspense\n// boundary after its navigation published, or a status document being\n// hydrated, would otherwise leave a tree in the cache that is no longer on\n// screen. Consuming the flag at commit is what keeps the same navigation from\n// re-seeding it a moment later. Both are over-approximations — a page-level\n// deny leaves every layout standing — at the cost of one full render on the\n// next navigation.\n//\n// Slot boundaries do not report: a slot degrading is the page staying, and\n// the chain it mounted is the chain the header describes. See TIM-1356,\n// TIM-1495, design/04-authorization.md §\"Where a Deny Page Renders\".\n\n/**\n * Record that a status page for the main route is on screen. Called from\n * `StatusPageMarker`'s layout effect; consumed by the commit of the\n * navigation whose tree it belongs to, and acted on immediately for the\n * commits that have none.\n */\nexport function reportStatusPageRendered(): void {\n _setStatusPageRendered(true);\n onStatusPageRendered?.();\n}\n\n/** Everything a commit needs to describe the page it makes current. */\nexport interface NavigationCommitInput {\n payload: unknown;\n /** The params that payload published — replayed with it on popstate. */\n params: ParamsSource;\n /**\n * The rendered chain's metadata, or null/undefined when this commit\n * carries none at all — a revalidation payload, or a history entry\n * stored before the channel existed.\n *\n * An empty *array* is a different statement from an absent one: the\n * server rendered a route with no layout-bearing segments (a layoutless\n * app — the missing-root-layout check is a warning, not an error), so\n * the correct tree is the empty one. Collapsing the two left the\n * departing route's tree in place, which `treePaths` then reported as\n * mounted — enough to select an intercepting rewrite whose slot is not\n * on screen (TIM-1282).\n */\n segmentInfo?: SegmentInfo[] | null;\n /** When true, clear the segment cache if segmentInfo is absent\n * (popstate replay for entries without layout metadata). */\n clearSegmentCacheOnEmpty?: boolean;\n /**\n * Layouts the server skipped on this response (`X-Timber-Skipped-Segments`),\n * when it came from a fetch. Omitted by replays and revalidation.\n *\n * Together with `skipped` slot entries in `segmentInfo`, this decides\n * whether the payload can be *replayed*. A partial payload only renders\n * merged over the tree on screen, and a `skip=true` outlet resolves against\n * the slot content cache at render time — so a stored copy of either,\n * replayed later, shows whatever the client holds *then*, not what was on\n * screen when the entry committed. Such entries store a null payload and\n * traversals to them fetch instead. Decided here, not at the fetch call\n * sites, because there are three of those (`performNavigationFetch`,\n * `refresh()`, and uncached traversal) and a rule applied at one of them\n * holds by accident: `performNavigationFetch` had the check and\n * `fetchCommitAndRender` did not, so a back/forward fetch that was\n * answered with skips stored the holes (TIM-1432).\n */\n skippedSegments?: string[] | null;\n}\n\n/** Whether a response skipped layouts — its payload merges over the tree on screen. */\nexport function isPartialNavigation(skippedSegments: string[] | null | undefined): boolean {\n return skippedSegments != null && skippedSegments.length > 0;\n}\n\n/**\n * Whether a payload can stand on its own when replayed from the history\n * stack. See `NavigationCommitInput.skippedSegments`.\n */\nfunction isReplayable(opts: NavigationCommitInput): boolean {\n return !isPartialNavigation(opts.skippedSegments) && !hasSkippedSlot(opts.segmentInfo);\n}\n\nfunction hasSkippedSlot(segmentInfo: SegmentInfo[] | null | undefined): boolean {\n return segmentInfo?.some((s) => s.slot && s.skipped) ?? false;\n}\n\n/**\n * The metadata a committed page keeps — on its history entry, and as the\n * current page's `committedSegmentInfo()`. `skipped` describes the\n * *response* — \"this slot's content was omitted\" — and neither stores such\n * a payload (the entry stores null). Kept, the flag outlives the response:\n * `applyActionResult()` reuses the current page's metadata beside a full\n * re-render and would have that judged non-replayable too.\n */\nfunction storedSegmentInfo(segmentInfo: SegmentInfo[] | null | undefined) {\n if (!hasSkippedSlot(segmentInfo)) return segmentInfo;\n return segmentInfo!.map(({ skipped: _skipped, ...rest }) => rest);\n}\n\n/**\n * A navigation's destination, split into what a render needs and what a\n * commit publishes.\n */\nexport interface PreparedNavigation {\n /** The state the incoming tree renders with. Pure — safe before winning. */\n navState: NavigationState;\n /** Publishes the destination. Call only once the render has won. */\n commit: () => void;\n}\n\nexport interface NavigationCommitter {\n prepareNavigation(url: string, opts: NavigationCommitInput): PreparedNavigation;\n currentStateTree(): StateTree | undefined;\n /**\n * The segment metadata of the page the last commit made current, as that\n * commit recorded it — null when it carried none.\n *\n * Server-action responses carry no segment metadata, so a revalidation\n * re-renders the current page with this. It is the committer's own record\n * rather than a history-stack lookup: the stack is keyed by the URL string\n * a navigation was asked for, and the current page is known by\n * `window.location`'s spelling of it, and the two need not agree\n * (`/a?` against `/a`, a percent-encoded path against a decoded one).\n */\n committedSegmentInfo(): SegmentInfo[] | null;\n /** Whether segment reuse is currently suppressed (TIM-1466). */\n isSegmentReuseSuppressed(): boolean;\n /** Lift segment reuse suppression after fresh data has been fetched (TIM-1466). */\n restoreSegmentReuse(): void;\n}\n\n/**\n * Derive the navigation state (pathname + search) a URL renders with.\n *\n * Pure. The value travels with the tree it describes — callers pass it to\n * `wrapPayload`, and the router's record of the displayed tree keeps it\n * beside that tree — so there is no store to publish it to (TIM-1541).\n */\nexport function deriveNavigationState(url: string): NavigationState {\n // Params are not part of it. They travel with the payload and are published\n // by the one client-owned `ParamsProvider` as the new tree renders, which is\n // also what clears the previous route's — a route with no params of its own\n // still publishes an empty record (TIM-1294/TIM-1297, and the clearing\n // requirement from TIM-1285).\n const parsed = parseRouterUrl(url);\n return { pathname: parsed.pathname || '/', search: parsed.search };\n}\n\nexport function createNavigationCommitter(deps: {\n segmentCache: SegmentCache;\n historyStack: HistoryStack;\n /** Read at call time — the router's `clientSegmentCache` opt-in. */\n clientSegmentCache: () => boolean | undefined;\n}): NavigationCommitter {\n const { segmentCache, historyStack } = deps;\n\n // See `committedSegmentInfo`. Written only by a commit.\n let committedSegmentInfo: SegmentInfo[] | null = null;\n\n // See `reportStatusPageRendered`: a status page that commits with no\n // navigation to consume the report still empties the cache.\n _setOnStatusPageRendered(() => segmentCache.clear());\n\n /**\n * Update the segment cache from server-provided segment metadata.\n *\n * Runs whether or not `clientSegmentCache` is enabled: the tree is also\n * where the mounted tree paths come from, and those cross on every\n * navigation. What the flag gates is which parts get serialized — see\n * `currentStateTree`.\n */\n function updateSegmentCache(segmentInfo: SegmentInfo[]): void {\n const tree = buildSegmentTree(segmentInfo);\n if (tree) {\n segmentCache.set('/', tree);\n }\n }\n\n return {\n committedSegmentInfo: () => committedSegmentInfo,\n isSegmentReuseSuppressed: () => segmentCache.isReuseSuppressed(),\n restoreSegmentReuse: () => segmentCache.restoreReuse(),\n\n /**\n * The X-Timber-State-Tree to send with the next RSC request.\n *\n * Two different things travel on one header. `segments`/`slots` are the\n * caching opt-in and are omitted unless `clientSegmentCache` is on.\n * `treePaths` is how the server learns which route is actually mounted,\n * which stops being derivable from the address bar as soon as a modal is\n * open — so it crosses regardless (TIM-1282). Undefined when there is\n * nothing to say, so a no-op header never enters the `_rsc` cache key.\n *\n * Reads what the last *committed* navigation published, so a superseded\n * navigation's destination can never end up describing the mounted tree\n * (TIM-1301).\n */\n currentStateTree(): StateTree | undefined {\n const tree = segmentCache.serializeStateTree();\n if (deps.clientSegmentCache()) return tree;\n return tree.treePaths ? { segments: [], treePaths: tree.treePaths } : undefined;\n },\n\n /**\n * Prepare all navigation-owned state for a new page — without publishing\n * any of it. Every code path that changes the \"current page\" must go\n * through this function, which is what makes \"forgot a field\" impossible\n * by construction.\n *\n * Returns the destination's `NavigationState`, which is a pure function of\n * the URL and is what the incoming tree is *rendered* with, plus a\n * `commit` thunk that performs the writes that make a page current:\n * 1. Segment cache — update from server-provided segment metadata\n * 2. The current page's segment metadata (`committedSegmentInfo`)\n * 3. History stack — store the payload for instant back/forward replay\n *\n * Pathname and search are not written here: they are the returned\n * `navState`, which the tree renders with and the router's record of the\n * displayed tree keeps (browser-entry/router-init.ts `publishTree`).\n *\n * Nothing is written until `commit()` runs, and on a transitioned\n * navigation it runs only once the transition is known to have won — see\n * `renderViaTransition` and `NavigationRoot`. A navigation superseded\n * while its payload was in flight never calls it, so the cache, the\n * pathname the client reports and the history stack all keep describing\n * the route still on screen (TIM-1301).\n *\n * Callers with state of their own to publish — the address bar, the\n * client's record of the mounted tree — wrap this thunk rather than\n * commit beside it, so there stays exactly one moment at which a page\n * becomes current.\n */\n prepareNavigation(url: string, opts: NavigationCommitInput): PreparedNavigation {\n const navState = deriveNavigationState(url);\n const payload = isReplayable(opts) ? opts.payload : null;\n\n // The tree this navigation renders has not rendered yet. Whatever a\n // boundary reported before now belongs to a commit that had no\n // navigation to consume it — a hydration, a row that arrived inside a\n // Suspense boundary after its navigation had published — and must not\n // be charged to this one.\n _setStatusPageRendered(false);\n\n return {\n navState,\n commit() {\n // A tree in which a boundary rendered a status page is not one to\n // cache — see the module note. Read at commit rather than at\n // prepare because that is when the boundary has spoken: the row it\n // renders may not have existed when the response headers were read.\n // The history entry records the same thing, or a traversal back to\n // this URL would replay the metadata this drops.\n const cacheable = !statusPageRendered;\n _setStatusPageRendered(false);\n const segmentInfo = cacheable ? opts.segmentInfo : [];\n\n if (segmentInfo && segmentInfo.length > 0) {\n updateSegmentCache(segmentInfo);\n } else if (segmentInfo?.length === 0 || opts.clearSegmentCacheOnEmpty) {\n segmentCache.clear();\n }\n\n committedSegmentInfo = storedSegmentInfo(segmentInfo) ?? null;\n\n historyStack.push(url, {\n payload,\n params: opts.params,\n segmentInfo: committedSegmentInfo,\n });\n },\n };\n },\n };\n}\n","'use client';\n\n/**\n * The one way a status page tells the router it is on screen.\n *\n * A status page replaces a subtree, and the segment cache must not learn a\n * chain that never mounted (see `navigation-commit.ts` §\"What a status page\n * teaches the cache\"). Status pages are produced in three places — an\n * in-tree catch site rendering the page it owns, the server's fallback\n * renderers, and a client boundary rendering its fallback for a Flight row —\n * and every one of them wraps the page in this marker, so the report does\n * not depend on which producer it was. In particular the in-tree case, the\n * common `access.ts` deny, never involves a client boundary at all.\n *\n * A layout effect, on every commit that renders the marker rather than on\n * mount only: React reuses the fiber when one status page is replaced by\n * another at the same position, and the second one must report too. Layout\n * effects run child-before-parent, so the report lands before the ancestor\n * `NavigationRoot` publishes the same commit, and never for a render React\n * discards. Idempotent, so StrictMode's double invocation and a status page\n * re-rendering on its own state are harmless. See TIM-1495.\n */\n\nimport { useLayoutEffect, type ReactNode } from 'react';\nimport { reportStatusPageRendered } from './navigation-commit.ts';\n\nexport function StatusPageMarker({ children }: { children: ReactNode }): ReactNode {\n useLayoutEffect(() => {\n reportStatusPageRendered();\n });\n return children;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAeA,IAAa,sBAAsB;;;;;;;;AC2DnC,IAAa,eAAb,MAA0B;CACxB;;;;;;;;;CASA,qBAA6B;CAC7B,kBAA0B;CAE1B,IAAI,SAA0C;EAC5C,IAAI,YAAY,OAAO,YAAY,KAAK,MAAM,SAC5C,OAAO,KAAK;CAGhB;CAEA,IAAI,SAAiB,MAAyB;EAC5C,IAAI,YAAY,OAAO,CAAC,KAAK,MAC3B,KAAK,OAAO;CAEhB;CAEA,QAAc;EACZ,KAAK,OAAO,KAAA;EACZ,KAAK,kBAAkB,KAAK;CAC9B;;;;;;;;;CAUA,kBAAwB;EACtB,KAAK;CACP;;;;;;CAOA,eAAqB;EACnB,KAAK,kBAAkB,KAAK;CAC9B;;CAGA,oBAA6B;EAC3B,OAAO,KAAK,qBAAqB,KAAK;CACxC;;;;;;;;;;;;;;;;;;;;;CAsBA,mBAAmB,iBAA0C;EAC3D,MAAM,WAAqB,CAAC;EAC5B,MAAM,QAAkB,CAAC;EACzB,MAAM,YAAsB,CAAC;EAC7B,MAAM,aAAa,KAAK,qBAAqB,KAAK;EAClD,IAAI,KAAK,MAAM;GACb,IAAI,CAAC,YAAY;IACf,oBAAoB,KAAK,MAAM,UAAU,eAAe;IACxD,iBAAiB,KAAK,MAAM,KAAK;GACnC;GACA,iBAAiB,KAAK,MAAM,SAAS;EACvC;EACA,MAAM,OAAkB,EAAE,SAAS;EACnC,IAAI,MAAM,SAAS,GACjB,KAAK,QAAQ;EAEf,IAAI,UAAU,SAAS,GACrB,KAAK,YAAY;EAEnB,OAAO;CACT;AACF;;AAGA,SAAS,oBACP,MACA,KACA,iBACM;CACN,IAAI,CAAC,KAAK,uBAAuB,CAAC,mBAAmB,gBAAgB,IAAI,KAAK,OAAO,IACnF,IAAI,KAAK,KAAK,OAAO;CAEvB,KAAK,MAAM,SAAS,KAAK,SAAS,OAAO,GACvC,oBAAoB,OAAO,KAAK,eAAe;AAEnD;;;;;;;;AASA,SAAS,iBAAiB,MAAmB,KAAqB;CAChE,IAAI,KAAK,UAAU,IAAI,KAAK,KAAK,QAAQ;CACzC,KAAK,MAAM,SAAS,KAAK,SAAS,OAAO,GACvC,iBAAiB,OAAO,GAAG;AAE/B;;;;;;;;;;AAWA,SAAS,iBAAiB,MAAmB,KAAqB;CAChE,IAAI,KAAK,OACF;OAAA,MAAM,QAAQ,KAAK,MAAM,OAAO,GACnC,IAAI,CAAC,KAAK,sBAAsB,CAAC,KAAK,UAAU,KAAK,YACnD,IAAI,KAAK,KAAK,UAAU;CAAA;CAI9B,KAAK,MAAM,SAAS,KAAK,SAAS,OAAO,GACvC,iBAAiB,OAAO,GAAG;AAE/B;;;;;;;;;;;;AAeA,SAAgB,iBAAiB,UAAkD;CAEjF,IAAI,SAAS,WAAW,GAAG,OAAO,KAAA;CAIlC,MAAM,iBAAgC,CAAC;CACvC,MAAM,cAA6B,CAAC;CACpC,KAAK,MAAM,QAAQ,UACjB,IAAI,KAAK,MACP,YAAY,KAAK,IAAI;MAErB,eAAe,KAAK,IAAI;CAK5B,IAAI;CACJ,IAAI;CACJ,MAAM,2BAAW,IAAI,IAAyB;CAE9C,KAAK,MAAM,QAAQ,gBAAgB;EACjC,MAAM,KAAK,KAAK,aAAa,KAAK;EAClC,MAAM,OAAoB;GACxB,SAAS;GACT,UAAU,KAAK;GACf,SAAS;GACT,oBAAoB,KAAK;GACzB,0BAAU,IAAI,IAAI;EACpB;EAEA,SAAS,IAAI,IAAI,IAAI;EAErB,IAAI,CAAC,MACH,OAAO;EAGT,IAAI,QACF,OAAO,SAAS,IAAI,IAAI,IAAI;EAG9B,SAAS;CACX;CAGA,KAAK,MAAM,YAAY,aAAa;EAClC,MAAM,WAAW,SAAS;EAC1B,MAAM,aAAa,WAAW,SAAS,IAAI,QAAQ,IAAI;EACvD,IAAI,CAAC,YAAY;EAEjB,MAAM,SAAS,SAAS,aAAa,SAAS;EAC9C,MAAM,WAAwB;GAC5B,SAAS;GACT,SAAS;GACT,oBAAoB,SAAS;GAC7B,0BAAU,IAAI,IAAI;GAClB,QAAQ,SAAS;GACjB,YAAY,SAAS;EACvB;EAEA,IAAI,CAAC,WAAW,OACd,WAAW,wBAAQ,IAAI,IAAI;EAE7B,WAAW,MAAM,IAAI,QAAQ,QAAQ;CACvC;CAEA,OAAO;AACT;;AAUA,IAAM,iBAAiC,OAAO,OAAO,EAAE,SAAS,KAAK,CAAC;;;;;;AAOtE,IAAM,mCAAmC;;;;;;AAyCzC,SAAS,eAAe,KAA0B;CAChD,OAAO,GAAG,IAAI,KAAK,OAAO,GAAG,IAAI,KAAK,GAAG,IAAI,MAAM,OAAO,GAAG,IAAI,MAAM,GAAG,IAAI;AAChF;;;;;;AAOA,SAAgB,gBAAgB,WAA0C;CACxE,OAAO,WAAW,WAAW,KAAK,IAAQ,KAAK;AACjD;;;;;;;;;;;;;;;AAwBA,IAAa,gBAAb,MAAa,cAAc;CACzB,OAAwB,SAAS;CACjC,0BAAkB,IAAI,IAAwB;CAC9C,UAAkB,mBAAmB,EAAE,WAAW,iCAAiC,CAAC;CACpF,cAAsB;CAEtB,IAAI,KAAkB,QAA8B;EAClD,KAAK,QAAQ,IAAI,eAAe,GAAG,GAAG;GACpC;GACA,WAAW,KAAK,IAAI,IAAI,cAAc;EACxC,CAAC;CACH;CAEA,IAAI,KAA8C;EAChD,MAAM,SAAS,eAAe,GAAG;EACjC,MAAM,QAAQ,KAAK,QAAQ,IAAI,MAAM;EACrC,IAAI,CAAC,OAAO,OAAO,KAAA;EACnB,IAAI,KAAK,IAAI,KAAK,MAAM,WAAW;GACjC,KAAK,QAAQ,OAAO,MAAM;GAC1B;EACF;EACA,OAAO,MAAM;CACf;;CAGA,IAAI,KAA2B;EAC7B,OAAO,KAAK,IAAI,GAAG,MAAM,KAAA;CAC3B;;CAGA,QAAQ,KAA8C;EACpD,MAAM,SAAS,KAAK,IAAI,GAAG;EAC3B,IAAI,WAAW,KAAA,GACb,KAAK,QAAQ,OAAO,eAAe,GAAG,CAAC;EAEzC,OAAO;CACT;;;;;;;;;;;;;;CAeA,gBACE,KACA,SACA,YACwB;EAOxB,MAAM,aAAa,KAAK;EACxB,OAAO,KAAK,QAAQ,GAAG,eAAe,GAAG,GAAG,OAAO,WAAW;GAC5D,IAAI;IACF,MAAM,SAAS,MAAM,QAAQ,MAAM;IACnC,IAAI,CAAC,OAAO,WAAW,KAAK,gBAAgB,YAAY,KAAK,IAAI,KAAK,MAAM;IAC5E,OAAO;KAAE,MAAM;KAAkB;KAAQ,UAAU;IAAW;GAChE,SAAS,KAAK;IACZ,IAAI,WAAW,GAAG,GAAG;KACnB,IAAI,CAAC,OAAO,WAAW,KAAK,gBAAgB,YAAY,KAAK,YAAY,GAAG;KAC5E,OAAO;MAAE,MAAM;MAAsB,UAAU;KAAW;IAC5D;IACA,MAAM;GACR;EACF,CAAC;CACH;;;;;;;;CASA,aAAa,KAAsD;EACjE,OAAO,KAAK,QAAQ,IAAI,eAAe,GAAG,CAAC;CAC7C;;;;;;;;;CAUA,YAAY,KAAwB;EAClC,KAAK,IAAI,KAAK,cAAc;CAC9B;;CAGA,WAAW,KAA2B;EACpC,OAAO,KAAK,IAAI,GAAG,MAAM;CAC3B;;;;;;;;;;;;;;;CAgBA,aAAmB;EACjB,KAAK,QAAQ,MAAM;EACnB,KAAK;CACP;CAEA,iBAAyB;EACvB,OAAO,KAAK;CACd;AACF;;;;;;;;;;;;ACngBA,IAAM,OAAO;;;;;;;;AASb,SAAgB,eAAe,KAAkB;CAC/C,OAAO,IAAI,WAAW,GAAG,IAAI,IAAI,IAAI,OAAO,GAAG,IAAI,IAAI,IAAI,KAAK,IAAI;AACtE;;;;;;AAOA,SAAgB,aAAa,KAAqB;CAChD,MAAM,SAAS,eAAe,GAAG;CACjC,OAAO,OAAO,WAAW,OAAO;AAClC;;;;;;;;;;;;;;;;;;;;ACmCA,SAAgB,2BAAiC;CAC/C,uBAAuB,IAAI;CAC3B,uBAAuB;AACzB;;AA6CA,SAAgB,oBAAoB,iBAAuD;CACzF,OAAO,mBAAmB,QAAQ,gBAAgB,SAAS;AAC7D;;;;;AAMA,SAAS,aAAa,MAAsC;CAC1D,OAAO,CAAC,oBAAoB,KAAK,eAAe,KAAK,CAAC,eAAe,KAAK,WAAW;AACvF;AAEA,SAAS,eAAe,aAAwD;CAC9E,OAAO,aAAa,MAAM,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK;AAC1D;;;;;;;;;AAUA,SAAS,kBAAkB,aAA+C;CACxE,IAAI,CAAC,eAAe,WAAW,GAAG,OAAO;CACzC,OAAO,YAAa,KAAK,EAAE,SAAS,UAAU,GAAG,WAAW,IAAI;AAClE;;;;;;;;AAyCA,SAAgB,sBAAsB,KAA8B;CAMlE,MAAM,SAAS,eAAe,GAAG;CACjC,OAAO;EAAE,UAAU,OAAO,YAAY;EAAK,QAAQ,OAAO;CAAO;AACnE;AAEA,SAAgB,0BAA0B,MAKlB;CACtB,MAAM,EAAE,cAAc,iBAAiB;CAGvC,IAAI,uBAA6C;CAIjD,+BAA+B,aAAa,MAAM,CAAC;;;;;;;;;CAUnD,SAAS,mBAAmB,aAAkC;EAC5D,MAAM,OAAO,iBAAiB,WAAW;EACzC,IAAI,MACF,aAAa,IAAI,KAAK,IAAI;CAE9B;CAEA,OAAO;EACL,4BAA4B;EAC5B,gCAAgC,aAAa,kBAAkB;EAC/D,2BAA2B,aAAa,aAAa;;;;;;;;;;;;;;;EAgBrD,mBAA0C;GACxC,MAAM,OAAO,aAAa,mBAAmB;GAC7C,IAAI,KAAK,mBAAmB,GAAG,OAAO;GACtC,OAAO,KAAK,YAAY;IAAE,UAAU,CAAC;IAAG,WAAW,KAAK;GAAU,IAAI,KAAA;EACxE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+BA,kBAAkB,KAAa,MAAiD;GAC9E,MAAM,WAAW,sBAAsB,GAAG;GAC1C,MAAM,UAAU,aAAa,IAAI,IAAI,KAAK,UAAU;GAOpD,uBAAuB,KAAK;GAE5B,OAAO;IACL;IACA,SAAS;KAOP,MAAM,YAAY,CAAC;KACnB,uBAAuB,KAAK;KAC5B,MAAM,cAAc,YAAY,KAAK,cAAc,CAAC;KAEpD,IAAI,eAAe,YAAY,SAAS,GACtC,mBAAmB,WAAW;UACzB,IAAI,aAAa,WAAW,KAAK,KAAK,0BAC3C,aAAa,MAAM;KAGrB,uBAAuB,kBAAkB,WAAW,KAAK;KAEzD,aAAa,KAAK,KAAK;MACrB;MACA,QAAQ,KAAK;MACb,aAAa;KACf,CAAC;IACH;GACF;EACF;CACF;AACF;;;;;;;;;;;;;;;;;;;;;;;ACnSA,SAAgB,iBAAiB,EAAE,YAAgD;CACjF,sBAAsB;EACpB,yBAAyB;CAC3B,CAAC;CACD,OAAO;AACT"}