@timber-js/app 0.2.0-alpha.221 → 0.2.0-alpha.223

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 (380) hide show
  1. package/agent-skill.md +21 -5
  2. package/dist/_chunks/{actions-BDqn4Oxj.js → actions-7dTXYJfu.js} +53 -24
  3. package/dist/_chunks/actions-7dTXYJfu.js.map +1 -0
  4. package/dist/_chunks/{als-registry-BZqHCtq-.js → als-registry-DpygwCp0.js} +2 -3
  5. package/dist/_chunks/{als-registry-BZqHCtq-.js.map → als-registry-DpygwCp0.js.map} +1 -1
  6. package/dist/_chunks/{als-slots-BEEIPKYm.js → als-slots-kbQrHTzm.js} +2 -3
  7. package/dist/_chunks/{als-slots-BEEIPKYm.js.map → als-slots-kbQrHTzm.js.map} +1 -1
  8. package/dist/_chunks/{base-path-DaQrzbez.js → base-path-DDIx0FXe.js} +2 -3
  9. package/dist/_chunks/{base-path-DaQrzbez.js.map → base-path-DDIx0FXe.js.map} +1 -1
  10. package/dist/_chunks/{build-manifest-DWppEdLB.js → build-manifest-Y4jl7nwU.js} +2 -3
  11. package/dist/_chunks/{build-manifest-DWppEdLB.js.map → build-manifest-Y4jl7nwU.js.map} +1 -1
  12. package/dist/_chunks/{build-output-helper-RV_BRcF1.js → build-output-helper-B7wWGTfR.js} +14 -10
  13. package/dist/_chunks/build-output-helper-B7wWGTfR.js.map +1 -0
  14. package/dist/_chunks/{cache-api-GE4AOe2H.js → cache-api-TDZ4hlDc.js} +237 -37
  15. package/dist/_chunks/cache-api-TDZ4hlDc.js.map +1 -0
  16. package/dist/_chunks/{canonicalize-BAWkWiKK.js → canonicalize-CqK135BN.js} +29 -4
  17. package/dist/_chunks/{canonicalize-BAWkWiKK.js.map → canonicalize-CqK135BN.js.map} +1 -1
  18. package/dist/_chunks/chains-CwOr3Myj.js +1 -0
  19. package/dist/_chunks/{chains-e_Buf9vg.js → chains-Dgm3PrMe.js} +3 -4
  20. package/dist/_chunks/{chains-e_Buf9vg.js.map → chains-Dgm3PrMe.js.map} +1 -1
  21. package/dist/_chunks/{classify-2Yp3xJY1.js → classify--_kINHQV.js} +4 -5
  22. package/dist/_chunks/{classify-2Yp3xJY1.js.map → classify--_kINHQV.js.map} +1 -1
  23. package/dist/_chunks/{cli-check-DDwCkeDY.js → cli-check-Dv3f8d2j.js} +5 -6
  24. package/dist/_chunks/{cli-check-DDwCkeDY.js.map → cli-check-Dv3f8d2j.js.map} +1 -1
  25. package/dist/_chunks/{cli-context-_mPttGGY.js → cli-context-CbZp32SK.js} +3 -4
  26. package/dist/_chunks/{cli-context-_mPttGGY.js.map → cli-context-CbZp32SK.js.map} +1 -1
  27. package/dist/_chunks/cli-context-n5hmkdla.js +1 -0
  28. package/dist/_chunks/cli-dev-status-prPMLU8G.js +138 -0
  29. package/dist/_chunks/cli-dev-status-prPMLU8G.js.map +1 -0
  30. package/dist/_chunks/cli-init-BoXOYYil.js +196 -0
  31. package/dist/_chunks/cli-init-BoXOYYil.js.map +1 -0
  32. package/dist/_chunks/{cli-schema-sync-BdIebmk3.js → cli-schema-sync-DIPurq7X.js} +4 -5
  33. package/dist/_chunks/{cli-schema-sync-BdIebmk3.js.map → cli-schema-sync-DIPurq7X.js.map} +1 -1
  34. package/dist/_chunks/{cli-schema-sync-CLNfXQDK.js → cli-schema-sync-uq72EZmD.js} +1 -1
  35. package/dist/_chunks/{client-dep-entries-BOkpKjj1.js → client-dep-entries-CP7AkMCM.js} +4 -5
  36. package/dist/_chunks/{client-dep-entries-BOkpKjj1.js.map → client-dep-entries-CP7AkMCM.js.map} +1 -1
  37. package/dist/_chunks/{cloudflare-Byxl8FWP.js → cloudflare-B75X6u4O.js} +10 -13
  38. package/dist/_chunks/{cloudflare-Byxl8FWP.js.map → cloudflare-B75X6u4O.js.map} +1 -1
  39. package/dist/_chunks/{codec-registry-oOUxugz3.js → codec-registry-CPc6bjVl.js} +2 -3
  40. package/dist/_chunks/{codec-registry-oOUxugz3.js.map → codec-registry-CPc6bjVl.js.map} +1 -1
  41. package/dist/_chunks/{codegen-Bps1sLKJ.js → codegen-B9oWkWGf.js} +5 -8
  42. package/dist/_chunks/{codegen-Bps1sLKJ.js.map → codegen-B9oWkWGf.js.map} +1 -1
  43. package/dist/_chunks/{convention-lint-ByKJ6aqD.js → convention-lint-hZwz5wd4.js} +8 -11
  44. package/dist/_chunks/{convention-lint-ByKJ6aqD.js.map → convention-lint-hZwz5wd4.js.map} +1 -1
  45. package/dist/_chunks/dev-discovery-YnabkCKD.js +238 -0
  46. package/dist/_chunks/dev-discovery-YnabkCKD.js.map +1 -0
  47. package/dist/_chunks/{dev-server-DIy-SY-J.js → dev-server-C61GWpGg.js} +409 -51
  48. package/dist/_chunks/dev-server-C61GWpGg.js.map +1 -0
  49. package/dist/_chunks/dev-server-CBvvM7Lr.js +1 -0
  50. package/dist/_chunks/{dev-store-BOa304m_.js → dev-store-BvdqtHvK.js} +82 -38
  51. package/dist/_chunks/dev-store-BvdqtHvK.js.map +1 -0
  52. package/dist/_chunks/{dist-DtrJyBbw.js → dist-C1Rjlo6s.js} +3 -5
  53. package/dist/_chunks/{dist-DtrJyBbw.js.map → dist-C1Rjlo6s.js.map} +1 -1
  54. package/dist/_chunks/{error-boundary-Bc8QPZuq.js → error-boundary-DRQXGWCp.js} +20 -27
  55. package/dist/_chunks/{error-boundary-Bc8QPZuq.js.map → error-boundary-DRQXGWCp.js.map} +1 -1
  56. package/dist/_chunks/{fast-hash-C-tVYrLb.js → fast-hash-DddxkU5Y.js} +2 -3
  57. package/dist/_chunks/{fast-hash-C-tVYrLb.js.map → fast-hash-DddxkU5Y.js.map} +1 -1
  58. package/dist/_chunks/{flight-source-node-HptmGMT8.js → flight-source-node-0Tp6evlz.js} +6 -8
  59. package/dist/_chunks/flight-source-node-0Tp6evlz.js.map +1 -0
  60. package/dist/_chunks/{format-BKclgVbk.js → format-DuPOoXUP.js} +2 -3
  61. package/dist/_chunks/{format-BKclgVbk.js.map → format-DuPOoXUP.js.map} +1 -1
  62. package/dist/_chunks/{fs-identity-BRKuL215.js → fs-identity-BmQ_Agg-.js} +3 -5
  63. package/dist/_chunks/{fs-identity-BRKuL215.js.map → fs-identity-BmQ_Agg-.js.map} +1 -1
  64. package/dist/_chunks/global-context-DbxNWeBP.js +47 -0
  65. package/dist/_chunks/global-context-DbxNWeBP.js.map +1 -0
  66. package/dist/_chunks/{graph-cache-CYiUS2aS.js → graph-cache-B1LAg4t7.js} +5 -89
  67. package/dist/_chunks/graph-cache-B1LAg4t7.js.map +1 -0
  68. package/dist/_chunks/{href-validation-BIrxavIy.js → href-validation-CEZy1V-k.js} +4 -7
  69. package/dist/_chunks/{href-validation-BIrxavIy.js.map → href-validation-CEZy1V-k.js.map} +1 -1
  70. package/dist/_chunks/{json-lossy-check-C8zBY2uZ.js → json-lossy-check-DVkLUlfC.js} +3 -4
  71. package/dist/_chunks/{json-lossy-check-C8zBY2uZ.js.map → json-lossy-check-DVkLUlfC.js.map} +1 -1
  72. package/dist/_chunks/{live-graph-tSWrv8eH.js → live-graph-BcVjQ1Te.js} +6 -7
  73. package/dist/_chunks/{live-graph-tSWrv8eH.js.map → live-graph-BcVjQ1Te.js.map} +1 -1
  74. package/dist/_chunks/{logger-CbLdcy-W.js → logger-CWk44DLp.js} +97 -47
  75. package/dist/_chunks/logger-CWk44DLp.js.map +1 -0
  76. package/dist/_chunks/{metadata-routes-B3XJNyIH.js → metadata-routes-BL26HCDd.js} +2 -3
  77. package/dist/_chunks/{metadata-routes-B3XJNyIH.js.map → metadata-routes-BL26HCDd.js.map} +1 -1
  78. package/dist/_chunks/{navigation-root-BQfo1-kG.js → navigation-root-M3B2ZrdO.js} +6 -10
  79. package/dist/_chunks/{navigation-root-BQfo1-kG.js.map → navigation-root-M3B2ZrdO.js.map} +1 -1
  80. package/dist/_chunks/{node-response-rkQqcFGq.js → node-response-B9aviPDa.js} +43 -9
  81. package/dist/_chunks/node-response-B9aviPDa.js.map +1 -0
  82. package/dist/_chunks/{param-value-C8TNYchQ.js → param-value-DqlGfF57.js} +2 -3
  83. package/dist/_chunks/{param-value-C8TNYchQ.js.map → param-value-DqlGfF57.js.map} +1 -1
  84. package/dist/_chunks/{plugin-context-uDHFqHHJ.js → plugin-context-BfSRKJfz.js} +1 -1
  85. package/dist/_chunks/{plugin-context-DxMMvjUt.js → plugin-context-FCkaNLUB.js} +4 -6
  86. package/dist/_chunks/plugin-context-FCkaNLUB.js.map +1 -0
  87. package/dist/_chunks/{poison-rules-DoEhbqaY.js → poison-rules-Bmz-lCPi.js} +2 -3
  88. package/dist/_chunks/{poison-rules-DoEhbqaY.js.map → poison-rules-Bmz-lCPi.js.map} +1 -1
  89. package/dist/_chunks/{poison-scan-C4FgMxFl.js → poison-scan-DJYxZc_7.js} +4 -5
  90. package/dist/_chunks/{poison-scan-C4FgMxFl.js.map → poison-scan-DJYxZc_7.js.map} +1 -1
  91. package/dist/_chunks/{purge-store-WZaxu-3m.js → purge-store-8BqLAYZ1.js} +2 -3
  92. package/dist/_chunks/{purge-store-WZaxu-3m.js.map → purge-store-8BqLAYZ1.js.map} +1 -1
  93. package/dist/_chunks/{render-timeout-joFhz4KH.js → render-timeout-MrrqD1wd.js} +20 -4
  94. package/dist/_chunks/{render-timeout-joFhz4KH.js.map → render-timeout-MrrqD1wd.js.map} +1 -1
  95. package/dist/_chunks/{resolve-schema-CBR6Lm4i.js → resolve-schema-B-aCuTu3.js} +3 -4
  96. package/dist/_chunks/{resolve-schema-CBR6Lm4i.js.map → resolve-schema-B-aCuTu3.js.map} +1 -1
  97. package/dist/_chunks/{rsc-cache-key-ClUiXQnK.js → rsc-cache-key-D0cb0Gmc.js} +2 -3
  98. package/dist/_chunks/{rsc-cache-key-ClUiXQnK.js.map → rsc-cache-key-D0cb0Gmc.js.map} +1 -1
  99. package/dist/_chunks/{rsc-media-type-DDc7duTD.js → rsc-media-type-m8jz9u6_.js} +2 -3
  100. package/dist/_chunks/{rsc-media-type-DDc7duTD.js.map → rsc-media-type-m8jz9u6_.js.map} +1 -1
  101. package/dist/_chunks/{rsc-payload-path-dffcs4jp.js → rsc-payload-path-EphpDB-J.js} +2 -3
  102. package/dist/_chunks/{rsc-payload-path-dffcs4jp.js.map → rsc-payload-path-EphpDB-J.js.map} +1 -1
  103. package/dist/_chunks/{scan-BoP17W3w.js → scan-CyizcBiX.js} +2 -3
  104. package/dist/_chunks/{scan-BoP17W3w.js.map → scan-CyizcBiX.js.map} +1 -1
  105. package/dist/_chunks/{scanner-Cb3fSjAC.js → scanner-CJC-ScJU.js} +15 -23
  106. package/dist/_chunks/{scanner-Cb3fSjAC.js.map → scanner-CJC-ScJU.js.map} +1 -1
  107. package/dist/_chunks/{schema-bridge-C83xa9lT.js → schema-bridge-DyRs3cqy.js} +61 -25
  108. package/dist/_chunks/schema-bridge-DyRs3cqy.js.map +1 -0
  109. package/dist/_chunks/{segment-classify-C539Pa2O.js → segment-classify-Ho8jXWeC.js} +3 -5
  110. package/dist/_chunks/{segment-classify-C539Pa2O.js.map → segment-classify-Ho8jXWeC.js.map} +1 -1
  111. package/dist/_chunks/{segment-context-xtPUGfdq.js → segment-context-CYiGTi3K.js} +6 -12
  112. package/dist/_chunks/segment-context-CYiGTi3K.js.map +1 -0
  113. package/dist/_chunks/{segment-keys-D5hu1hz4.js → segment-keys-Y60KNc8C.js} +2 -3
  114. package/dist/_chunks/{segment-keys-D5hu1hz4.js.map → segment-keys-Y60KNc8C.js.map} +1 -1
  115. package/dist/_chunks/{singleflight-BeVMMKi0.js → singleflight-BChPMjwH.js} +2 -3
  116. package/dist/_chunks/{singleflight-BeVMMKi0.js.map → singleflight-BChPMjwH.js.map} +1 -1
  117. package/dist/_chunks/{sizeof-QPE5nd3u.js → sizeof-DG4W40lv.js} +3 -4
  118. package/dist/_chunks/{sizeof-QPE5nd3u.js.map → sizeof-DG4W40lv.js.map} +1 -1
  119. package/dist/_chunks/{ssr-data-nA3I70_n.js → ssr-data-9hPtcNOr.js} +3 -4
  120. package/dist/_chunks/{ssr-data-nA3I70_n.js.map → ssr-data-9hPtcNOr.js.map} +1 -1
  121. package/dist/_chunks/{state-BhNGPsdi.js → state-B-EBjeER.js} +2 -3
  122. package/dist/_chunks/{state-BhNGPsdi.js.map → state-B-EBjeER.js.map} +1 -1
  123. package/dist/_chunks/{status-page-marker-BRX9Ib-d.js → status-page-marker-XIQXlTOb.js} +8 -13
  124. package/dist/_chunks/{status-page-marker-BRX9Ib-d.js.map → status-page-marker-XIQXlTOb.js.map} +1 -1
  125. package/dist/_chunks/{tree-match-6yihorhk.js → tree-match-Bqdr9szG.js} +2 -3
  126. package/dist/_chunks/{tree-match-6yihorhk.js.map → tree-match-Bqdr9szG.js.map} +1 -1
  127. package/dist/_chunks/{use-query-states-I3JMng6J.js → use-query-states-pkDV-jSg.js} +4 -7
  128. package/dist/_chunks/{use-query-states-I3JMng6J.js.map → use-query-states-pkDV-jSg.js.map} +1 -1
  129. package/dist/_chunks/{walkers-qu8TpiLh.js → walkers-DIE203ir.js} +6 -8
  130. package/dist/_chunks/{walkers-qu8TpiLh.js.map → walkers-DIE203ir.js.map} +1 -1
  131. package/dist/_chunks/{write-file-atomic-D1qWqHb4.js → write-file-atomic-DW8m_Atv.js} +2 -3
  132. package/dist/_chunks/{write-file-atomic-D1qWqHb4.js.map → write-file-atomic-DW8m_Atv.js.map} +1 -1
  133. package/dist/adapters/build-output-helper.d.ts +10 -1
  134. package/dist/adapters/build-output-helper.d.ts.map +1 -1
  135. package/dist/adapters/cloudflare-dev.js +2 -3
  136. package/dist/adapters/cloudflare-kv-cache.js +3 -4
  137. package/dist/adapters/cloudflare.d.ts.map +1 -1
  138. package/dist/adapters/cloudflare.js +1 -1
  139. package/dist/adapters/nitro-presets.d.ts +6 -0
  140. package/dist/adapters/nitro-presets.d.ts.map +1 -1
  141. package/dist/adapters/nitro-preview.d.ts.map +1 -1
  142. package/dist/adapters/nitro.d.ts.map +1 -1
  143. package/dist/adapters/nitro.js +94 -57
  144. package/dist/adapters/nitro.js.map +1 -1
  145. package/dist/analyze/crawl-entry.js +7 -9
  146. package/dist/analyze/crawl-entry.js.map +1 -1
  147. package/dist/analyze/graph-command.d.ts.map +1 -1
  148. package/dist/analyze/graph-command.js +19 -105
  149. package/dist/analyze/graph-command.js.map +1 -1
  150. package/dist/cache/guarded-read.d.ts +29 -0
  151. package/dist/cache/guarded-read.d.ts.map +1 -0
  152. package/dist/cache/index.js +3 -3
  153. package/dist/cache/key-discipline.d.ts +61 -0
  154. package/dist/cache/key-discipline.d.ts.map +1 -0
  155. package/dist/cache/stores/cloudflare-kv.js +1 -2
  156. package/dist/cache/stores/memory.js +2 -3
  157. package/dist/cache/stores/redis.js +1 -2
  158. package/dist/cache/stores/vercel.js +1 -2
  159. package/dist/cache/timber-cache.d.ts +5 -1
  160. package/dist/cache/timber-cache.d.ts.map +1 -1
  161. package/dist/cdn/cloudflare-purge.js +1 -2
  162. package/dist/cdn/fastly-purge.js +1 -2
  163. package/dist/cdn/index.js +2 -3
  164. package/dist/cdn/workers-cache-purge.js +3 -5
  165. package/dist/cdn/workers-cache-purge.js.map +1 -1
  166. package/dist/cli-dev-status.d.ts +75 -0
  167. package/dist/cli-dev-status.d.ts.map +1 -0
  168. package/dist/cli-init.d.ts +72 -0
  169. package/dist/cli-init.d.ts.map +1 -0
  170. package/dist/cli.d.ts +4 -12
  171. package/dist/cli.d.ts.map +1 -1
  172. package/dist/cli.js +27 -54
  173. package/dist/cli.js.map +1 -1
  174. package/dist/client/error-boundary.d.ts.map +1 -1
  175. package/dist/client/error-boundary.js +1 -1
  176. package/dist/client/global-context.d.ts +21 -1
  177. package/dist/client/global-context.d.ts.map +1 -1
  178. package/dist/client/index.js +23 -44
  179. package/dist/client/index.js.map +1 -1
  180. package/dist/client/internal.js +13 -18
  181. package/dist/client/internal.js.map +1 -1
  182. package/dist/client/navigation-context.d.ts.map +1 -1
  183. package/dist/client/params-context.d.ts.map +1 -1
  184. package/dist/client/slot-context.d.ts +2 -2
  185. package/dist/client/slot-context.d.ts.map +1 -1
  186. package/dist/client/use-cookie.d.ts +18 -5
  187. package/dist/client/use-cookie.d.ts.map +1 -1
  188. package/dist/codec.js +2 -3
  189. package/dist/config-types.d.ts +22 -5
  190. package/dist/config-types.d.ts.map +1 -1
  191. package/dist/config-validation.d.ts.map +1 -1
  192. package/dist/cookies/define-cookie.d.ts.map +1 -1
  193. package/dist/cookies/index.js +40 -67
  194. package/dist/cookies/index.js.map +1 -1
  195. package/dist/cookies/json-cookie.d.ts +4 -4
  196. package/dist/index.js +266 -229
  197. package/dist/index.js.map +1 -1
  198. package/dist/params/index.js +3 -4
  199. package/dist/plugin-context.d.ts +7 -0
  200. package/dist/plugin-context.d.ts.map +1 -1
  201. package/dist/plugins/dev-discovery.d.ts +69 -5
  202. package/dist/plugins/dev-discovery.d.ts.map +1 -1
  203. package/dist/plugins/dev-hostname.d.ts +152 -0
  204. package/dist/plugins/dev-hostname.d.ts.map +1 -0
  205. package/dist/plugins/dev-server.d.ts +6 -2
  206. package/dist/plugins/dev-server.d.ts.map +1 -1
  207. package/dist/plugins/dev-store-clear.d.ts +83 -0
  208. package/dist/plugins/dev-store-clear.d.ts.map +1 -0
  209. package/dist/plugins/graph-endpoint.d.ts +4 -2
  210. package/dist/plugins/graph-endpoint.d.ts.map +1 -1
  211. package/dist/plugins/prebuilt.d.ts.map +1 -1
  212. package/dist/routing/index.js +4 -4
  213. package/dist/rsc-runtime/rsc.d.ts +2 -1
  214. package/dist/rsc-runtime/rsc.d.ts.map +1 -1
  215. package/dist/rsc-runtime/server-references.d.ts +8 -0
  216. package/dist/rsc-runtime/server-references.d.ts.map +1 -0
  217. package/dist/schema-bridge.d.ts +28 -19
  218. package/dist/schema-bridge.d.ts.map +1 -1
  219. package/dist/search-params/define.d.ts +1 -1
  220. package/dist/search-params/define.d.ts.map +1 -1
  221. package/dist/search-params/index.js +11 -14
  222. package/dist/search-params/index.js.map +1 -1
  223. package/dist/search-params/wrappers.d.ts +3 -3
  224. package/dist/server/access-gate.d.ts +12 -0
  225. package/dist/server/access-gate.d.ts.map +1 -1
  226. package/dist/server/canonicalize.d.ts +21 -0
  227. package/dist/server/canonicalize.d.ts.map +1 -1
  228. package/dist/server/cookie-context.d.ts +8 -1
  229. package/dist/server/cookie-context.d.ts.map +1 -1
  230. package/dist/server/flight-source-node.d.ts.map +1 -1
  231. package/dist/server/flight-source.d.ts.map +1 -1
  232. package/dist/server/index.d.ts +1 -1
  233. package/dist/server/index.d.ts.map +1 -1
  234. package/dist/server/index.js +8 -13
  235. package/dist/server/index.js.map +1 -1
  236. package/dist/server/interception-gates.d.ts +49 -0
  237. package/dist/server/interception-gates.d.ts.map +1 -0
  238. package/dist/server/internal.js +1080 -959
  239. package/dist/server/internal.js.map +1 -1
  240. package/dist/server/logger.d.ts +26 -0
  241. package/dist/server/logger.d.ts.map +1 -1
  242. package/dist/server/param-coercion.d.ts +8 -0
  243. package/dist/server/param-coercion.d.ts.map +1 -1
  244. package/dist/server/pipeline-interception.d.ts +34 -4
  245. package/dist/server/pipeline-interception.d.ts.map +1 -1
  246. package/dist/server/pipeline-metadata-route.d.ts +24 -0
  247. package/dist/server/pipeline-metadata-route.d.ts.map +1 -0
  248. package/dist/server/pipeline-metadata.d.ts +3 -2
  249. package/dist/server/pipeline-metadata.d.ts.map +1 -1
  250. package/dist/server/pipeline-phases.d.ts +9 -3
  251. package/dist/server/pipeline-phases.d.ts.map +1 -1
  252. package/dist/server/pipeline.d.ts +18 -0
  253. package/dist/server/pipeline.d.ts.map +1 -1
  254. package/dist/server/prebuilt/dev-store.d.ts +68 -22
  255. package/dist/server/prebuilt/dev-store.d.ts.map +1 -1
  256. package/dist/server/prebuilt/overlay.d.ts +17 -3
  257. package/dist/server/prebuilt/overlay.d.ts.map +1 -1
  258. package/dist/server/prebuilt-runtime.d.ts.map +1 -1
  259. package/dist/server/primitives.d.ts +13 -0
  260. package/dist/server/primitives.d.ts.map +1 -1
  261. package/dist/server/render-utils.d.ts +21 -0
  262. package/dist/server/render-utils.d.ts.map +1 -1
  263. package/dist/server/request-context.d.ts +14 -0
  264. package/dist/server/request-context.d.ts.map +1 -1
  265. package/dist/server/route-element-builder.d.ts.map +1 -1
  266. package/dist/server/route-handler.d.ts +7 -0
  267. package/dist/server/route-handler.d.ts.map +1 -1
  268. package/dist/server/route-matcher.d.ts +14 -3
  269. package/dist/server/route-matcher.d.ts.map +1 -1
  270. package/dist/server/rsc-entry/api-handler.d.ts.map +1 -1
  271. package/dist/server/rsc-entry/index.d.ts.map +1 -1
  272. package/dist/server/rsc-entry/rsc-stream.d.ts.map +1 -1
  273. package/dist/server/signal-identity.d.ts +6 -0
  274. package/dist/server/signal-identity.d.ts.map +1 -1
  275. package/dist/server/traced-access.d.ts +18 -0
  276. package/dist/server/traced-access.d.ts.map +1 -0
  277. package/dist/server/tracing.d.ts.map +1 -1
  278. package/dist/server/types.d.ts +5 -4
  279. package/dist/server/types.d.ts.map +1 -1
  280. package/dist/shims/font-google.js +1 -2
  281. package/dist/shims/font-local.js +1 -2
  282. package/dist/shims/headers.d.ts +11 -4
  283. package/dist/shims/headers.d.ts.map +1 -1
  284. package/docs/api/30-api-server.mdx +3 -1
  285. package/docs/api/32-api-cache.mdx +1 -1
  286. package/docs/api/33-api-search-params.mdx +3 -1
  287. package/docs/api/34-api-config.mdx +22 -0
  288. package/docs/api/36-cli.mdx +72 -6
  289. package/docs/learn/01-quick-start.mdx +1 -1
  290. package/docs/learn/06-typed-params.mdx +4 -4
  291. package/docs/learn/10-caching.mdx +26 -5
  292. package/llms.txt +1 -1
  293. package/package.json +12 -12
  294. package/src/adapters/build-output-helper.ts +26 -4
  295. package/src/adapters/cloudflare.ts +1 -0
  296. package/src/adapters/nitro-presets.ts +15 -0
  297. package/src/adapters/nitro-preview.ts +66 -34
  298. package/src/adapters/nitro.ts +14 -6
  299. package/src/analyze/graph-command.ts +25 -133
  300. package/src/cache/guarded-read.ts +44 -0
  301. package/src/cache/key-discipline.ts +218 -0
  302. package/src/cache/timber-cache.ts +46 -7
  303. package/src/cli-dev-status.ts +196 -0
  304. package/src/cli-init.ts +278 -0
  305. package/src/cli.ts +33 -79
  306. package/src/client/error-boundary.tsx +19 -2
  307. package/src/client/global-context.ts +42 -14
  308. package/src/client/navigation-context.ts +4 -11
  309. package/src/client/params-context.ts +5 -17
  310. package/src/client/segment-update-context.ts +1 -1
  311. package/src/client/slot-content-cache-context.ts +1 -1
  312. package/src/client/slot-context.ts +6 -17
  313. package/src/client/use-cookie.ts +33 -21
  314. package/src/config-types.ts +22 -5
  315. package/src/config-validation.ts +17 -0
  316. package/src/cookies/define-cookie.ts +10 -46
  317. package/src/cookies/json-cookie.ts +4 -4
  318. package/src/plugin-context.ts +7 -0
  319. package/src/plugins/dev-discovery.ts +216 -6
  320. package/src/plugins/dev-hostname.ts +322 -0
  321. package/src/plugins/dev-server.ts +130 -37
  322. package/src/plugins/dev-store-clear.ts +145 -0
  323. package/src/plugins/graph-endpoint.ts +15 -3
  324. package/src/plugins/prebuilt.ts +9 -0
  325. package/src/rsc-runtime/rsc.ts +7 -3
  326. package/src/rsc-runtime/server-references.ts +73 -0
  327. package/src/rsc-runtime/vendor-types.d.ts +17 -0
  328. package/src/schema-bridge.ts +93 -38
  329. package/src/search-params/define.ts +5 -6
  330. package/src/search-params/wrappers.ts +3 -3
  331. package/src/server/access-gate.tsx +32 -20
  332. package/src/server/action-handler.ts +58 -36
  333. package/src/server/canonicalize.ts +27 -0
  334. package/src/server/cookie-context.ts +11 -3
  335. package/src/server/flight-source-node.ts +5 -2
  336. package/src/server/flight-source.ts +4 -3
  337. package/src/server/index.ts +6 -1
  338. package/src/server/interception-gates.ts +94 -0
  339. package/src/server/logger.ts +32 -0
  340. package/src/server/param-coercion.ts +22 -0
  341. package/src/server/pipeline-interception.ts +64 -4
  342. package/src/server/pipeline-metadata-route.ts +242 -0
  343. package/src/server/pipeline-metadata.ts +7 -5
  344. package/src/server/pipeline-phases.ts +71 -131
  345. package/src/server/pipeline.ts +20 -2
  346. package/src/server/prebuilt/dev-store.ts +113 -34
  347. package/src/server/prebuilt/overlay.ts +32 -4
  348. package/src/server/prebuilt-runtime.ts +63 -45
  349. package/src/server/primitives.ts +14 -0
  350. package/src/server/render-utils.ts +25 -0
  351. package/src/server/request-context.ts +27 -3
  352. package/src/server/route-element-builder.ts +15 -2
  353. package/src/server/route-handler.ts +3 -2
  354. package/src/server/route-matcher.ts +48 -33
  355. package/src/server/rsc-entry/api-handler.ts +2 -33
  356. package/src/server/rsc-entry/index.ts +8 -3
  357. package/src/server/rsc-entry/rsc-stream.ts +7 -1
  358. package/src/server/signal-identity.ts +30 -12
  359. package/src/server/traced-access.ts +50 -0
  360. package/src/server/tracing.ts +18 -1
  361. package/src/server/types.ts +5 -4
  362. package/src/shims/headers.ts +12 -4
  363. package/dist/_chunks/actions-BDqn4Oxj.js.map +0 -1
  364. package/dist/_chunks/build-output-helper-RV_BRcF1.js.map +0 -1
  365. package/dist/_chunks/cache-api-GE4AOe2H.js.map +0 -1
  366. package/dist/_chunks/chains-CDK1AWZQ.js +0 -1
  367. package/dist/_chunks/cli-context-BJQB6rtF.js +0 -1
  368. package/dist/_chunks/dev-server-BiWNMBVU.js +0 -1
  369. package/dist/_chunks/dev-server-DIy-SY-J.js.map +0 -1
  370. package/dist/_chunks/dev-store-BOa304m_.js.map +0 -1
  371. package/dist/_chunks/flight-source-node-HptmGMT8.js.map +0 -1
  372. package/dist/_chunks/graph-cache-CYiUS2aS.js.map +0 -1
  373. package/dist/_chunks/logger-CbLdcy-W.js.map +0 -1
  374. package/dist/_chunks/node-response-rkQqcFGq.js.map +0 -1
  375. package/dist/_chunks/plugin-context-DxMMvjUt.js.map +0 -1
  376. package/dist/_chunks/schema-bridge-C83xa9lT.js.map +0 -1
  377. package/dist/_chunks/segment-context-xtPUGfdq.js.map +0 -1
  378. package/dist/server/prebuilt/key-discipline.d.ts +0 -52
  379. package/dist/server/prebuilt/key-discipline.d.ts.map +0 -1
  380. package/src/server/prebuilt/key-discipline.ts +0 -122
@@ -1,12 +1,13 @@
1
- import { _ as isCacheHandlerConfigured, f as currentInvalidationEpoch, g as getCacheHandler, h as wasInvalidatedSince, i as devOverlayNamespace, m as recordInvalidation, p as lastInvalidationEpochFor, r as devDataCacheKey, s as invalidateDevSeedsByTag } from "./dev-store-BOa304m_.js";
2
- import { c as waitUntilAls } from "./als-registry-BZqHCtq-.js";
3
- import { D as addSpanEventSync, m as logSwrRefetchFailed, v as swallow } from "./logger-CbLdcy-W.js";
4
- import { t as fnv1aHash } from "./fast-hash-C-tVYrLb.js";
5
- import { n as createSingleflight } from "./singleflight-BeVMMKi0.js";
6
- import { t as estimateByteSize } from "./sizeof-QPE5nd3u.js";
7
- import { t as warnLossyJsonValue } from "./json-lossy-check-C8zBY2uZ.js";
8
- import { t as getCdnPurgeHandler } from "./purge-store-WZaxu-3m.js";
9
- //#region src/server/waituntil-bridge.ts
1
+ import { a as withTimeout$1 } from "./render-timeout-MrrqD1wd.js";
2
+ import { _ as wasInvalidatedSince, g as recordInvalidation, h as lastInvalidationEpochFor, i as devDataCacheKey, l as invalidateDevSeedsByTag, m as currentInvalidationEpoch, o as devOverlayNamespace, v as getCacheHandler, y as isCacheHandlerConfigured } from "./dev-store-BvdqtHvK.js";
3
+ import { c as waitUntilAls, i as requestContextAls } from "./als-registry-DpygwCp0.js";
4
+ import { a as logKeyDisciplineViolation, b as swallow, g as logSwrRefetchFailed, n as logCacheMiss, r as logCacheReadFailed, w as addSpanEventSync } from "./logger-CWk44DLp.js";
5
+ import { t as fnv1aHash } from "./fast-hash-DddxkU5Y.js";
6
+ import { n as createSingleflight } from "./singleflight-BChPMjwH.js";
7
+ import { t as estimateByteSize } from "./sizeof-DG4W40lv.js";
8
+ import { t as warnLossyJsonValue } from "./json-lossy-check-DVkLUlfC.js";
9
+ import { t as getCdnPurgeHandler } from "./purge-store-8BqLAYZ1.js";
10
+ // src/server/waituntil-bridge.ts
10
11
  /**
11
12
  * Per-request waitUntil bridge — ALS bridge for platform adapters.
12
13
  *
@@ -28,8 +29,7 @@ import { t as getCdnPurgeHandler } from "./purge-store-WZaxu-3m.js";
28
29
  function getWaitUntil() {
29
30
  return waitUntilAls.getStore();
30
31
  }
31
- //#endregion
32
- //#region src/cache/stable-stringify.ts
32
+ // src/cache/stable-stringify.ts
33
33
  /**
34
34
  * Deterministic JSON serialization with sorted object keys.
35
35
  * Used for cache key generation — ensures { a: 1, b: 2 } and { b: 2, a: 1 }
@@ -74,8 +74,184 @@ function stableStringify(value) {
74
74
  }
75
75
  return "{" + pairs.join(",") + "}";
76
76
  }
77
- //#endregion
78
- //#region src/cache/timber-cache.ts
77
+ // src/cache/guarded-read.ts
78
+ /**
79
+ * Cache reads never fail a request.
80
+ *
81
+ * A cache is an optimization: when the store is down, slow, or returns
82
+ * garbage, the request must still succeed by doing the work the cache would
83
+ * have skipped. Writes already follow this rule (timber-cache.ts swallows a
84
+ * failed handler.set, TIM-1046); reads go through here so a throwing or hung
85
+ * handler.get costs a live fetch or render, never a failed or stalled request.
86
+ *
87
+ * The timeout matters as much as the catch. Shared-store clients often queue
88
+ * commands while disconnected (ioredis retries each one up to 20 times by
89
+ * default), so an outage shows up as a read that never settles, not an error.
90
+ *
91
+ * Invalidation is deliberately NOT guarded: a failed invalidate that looked
92
+ * like success would leave stale data in place silently.
93
+ *
94
+ * See design/06-caching.md §"Store failures".
95
+ */
96
+ /** Ceiling for a single cache read. A healthy store answers in milliseconds. */
97
+ var CACHE_READ_TIMEOUT_MS = 1e3;
98
+ /**
99
+ * Run a cache read. A throw, a rejection, or no answer within
100
+ * CACHE_READ_TIMEOUT_MS logs a warning and resolves to `onFailure`, which the
101
+ * caller picks: `null` where a failed read means "miss", a distinct value
102
+ * where a miss would fall back to something the failed read might have
103
+ * overridden (an invalidated build seed — server/prebuilt/overlay.ts).
104
+ */
105
+ async function guardedRead(cacheKey, read, onFailure) {
106
+ try {
107
+ return await withTimeout$1(read(), CACHE_READ_TIMEOUT_MS, `cache read for "${cacheKey}"`);
108
+ } catch (error) {
109
+ logCacheReadFailed({
110
+ cacheKey,
111
+ error
112
+ });
113
+ return onFailure;
114
+ }
115
+ }
116
+ // src/cache/key-discipline.ts
117
+ /**
118
+ * Key-discipline diagnostic for both cache tiers (design/45 §Enforcement).
119
+ *
120
+ * A cached value is stored under a key computed from declared inputs only —
121
+ * props and segment params for `cache.component`, the function's arguments
122
+ * for `cache.data`. A request-context read while the value is being computed
123
+ * is the data-leak danger zone (design/06 security note): the result varies
124
+ * by user but the key does not. While the cached work runs, the ALS store is
125
+ * wrapped in a transparent observing proxy; any request-context read
126
+ * produces a structured, rate-limited production diagnostic.
127
+ *
128
+ * The diagnostic fires per offending callsite, rate-limited to once per
129
+ * interval (default 60 s) — not once per process. This ensures the
130
+ * signal stays visible in log aggregators across restarts and deploys.
131
+ *
132
+ * When `strictKeyDiscipline` is enabled (via timber.config.ts
133
+ * `cache.strictKeyDiscipline: true`), the diagnostic is promoted to a
134
+ * thrown error that prevents the tainted value from being cached.
135
+ */
136
+ /** Store fields every tier's key leaves out, by the API that reads them. */
137
+ var REQUEST_FIELDS = /* @__PURE__ */ new Map([
138
+ ["headers", "headers()"],
139
+ ["parsedCookies", "cookies()"],
140
+ ["searchParams", "searchParams"]
141
+ ]);
142
+ /**
143
+ * The data tier also leaves out segment params: a cache.component key
144
+ * includes them, a cache.data key holds only the function's arguments.
145
+ */
146
+ var DATA_TIER_FIELDS = new Map([
147
+ ...REQUEST_FIELDS,
148
+ ["segmentParams", "segment params"],
149
+ ["slotParams", "segment params"]
150
+ ]);
151
+ var TIERS = {
152
+ "cache.component": {
153
+ observed: REQUEST_FIELDS,
154
+ keyedBy: "props and segment params",
155
+ passAs: "as props",
156
+ work: "a cache capture render"
157
+ },
158
+ "cache.data": {
159
+ observed: DATA_TIER_FIELDS,
160
+ keyedBy: "the function's arguments",
161
+ passAs: "as an argument",
162
+ work: "a cached call"
163
+ }
164
+ };
165
+ /** Rate-limit interval: one diagnostic per callsite per 60 seconds. */
166
+ var RATE_LIMIT_MS = 6e4;
167
+ /**
168
+ * Last emission timestamp per `${tier}:${id}`. Past this many entries,
169
+ * ones whose window has elapsed are pruned — an untransformed callsite
170
+ * re-created per request gets a fresh fallback id each time.
171
+ */
172
+ var lastEmitted = /* @__PURE__ */ new Map();
173
+ var PRUNE_AT = 1e3;
174
+ /**
175
+ * Thrown in strict mode. A distinct class so a caller holding an earlier
176
+ * result computed by the same fn (a stale SWR entry) can drop it.
177
+ */
178
+ var KeyDisciplineViolation = class extends Error {
179
+ name = "KeyDisciplineViolation";
180
+ };
181
+ var strict = false;
182
+ /**
183
+ * Run a cached callsite's work under the observing proxy, then report any
184
+ * request-context read it made. The proxy is transparent — it forwards all
185
+ * reads and writes; it only observes.
186
+ *
187
+ * Outside a request context `run` executes as-is: there is nothing to read,
188
+ * and cache.data must keep working there. In default mode a callsite that
189
+ * reported within the rate-limit window is not observed at all. In strict
190
+ * mode a violation rejects after `run` resolves, so the caller never stores
191
+ * the value.
192
+ */
193
+ async function observeKeyDiscipline(site, run) {
194
+ const store = requestContextAls.getStore();
195
+ if (!store || !shouldCheck(site)) return run();
196
+ const { proxy, accessedApis } = createObservingProxy(store, TIERS[site.tier].observed);
197
+ const result = await requestContextAls.run(proxy, run);
198
+ if (accessedApis.size > 0) reportViolation(site, accessedApis);
199
+ return result;
200
+ }
201
+ function rateLimitKey(site) {
202
+ return `${site.tier}:${site.id}`;
203
+ }
204
+ /**
205
+ * Whether to observe this callsite on this call. Always in strict mode;
206
+ * otherwise only once the rate-limit window since its last report elapsed.
207
+ */
208
+ function shouldCheck(site) {
209
+ if (strict) return true;
210
+ const last = lastEmitted.get(rateLimitKey(site));
211
+ if (last === void 0) return true;
212
+ return Date.now() - last >= RATE_LIMIT_MS;
213
+ }
214
+ function createObservingProxy(store, observed) {
215
+ const accessedApis = /* @__PURE__ */ new Set();
216
+ return {
217
+ proxy: new Proxy(store, { get(target, prop, receiver) {
218
+ const api = observed.get(prop);
219
+ if (api) accessedApis.add(api);
220
+ return Reflect.get(target, prop, receiver);
221
+ } }),
222
+ accessedApis
223
+ };
224
+ }
225
+ /**
226
+ * Throw in strict mode; otherwise emit a structured error-level diagnostic
227
+ * through the logger (same path as render errors), rate-limited per callsite.
228
+ */
229
+ function reportViolation(site, apis) {
230
+ const { tier, id } = site;
231
+ const name = site.label ?? id;
232
+ const apiList = Array.from(apis).join(", ");
233
+ const wording = TIERS[tier];
234
+ const remedy = `Either pass request-derived values ${wording.passAs} (included in the cache key) or remove the ${apiList} call.`;
235
+ if (strict) throw new KeyDisciplineViolation(`[timber] ${tier} key-discipline violation: "${name}" reads ${apiList} during ${wording.work}. The cache key is computed from ${wording.keyedBy} only — caching this result would serve one user's data to another. ${remedy} To downgrade this to a warning, set cache.strictKeyDiscipline: false in timber.config.ts.`);
236
+ const now = Date.now();
237
+ const key = rateLimitKey(site);
238
+ const last = lastEmitted.get(key);
239
+ if (last !== void 0 && now - last < RATE_LIMIT_MS) return;
240
+ if (lastEmitted.size >= PRUNE_AT) {
241
+ for (const [k, t] of lastEmitted) if (now - t >= RATE_LIMIT_MS) lastEmitted.delete(k);
242
+ }
243
+ lastEmitted.set(key, now);
244
+ logKeyDisciplineViolation(`${tier} cross-user data leak risk`, {
245
+ ...tier === "cache.component" ? { component: name } : {
246
+ fn: name,
247
+ id,
248
+ cacheKey: site.cacheKey
249
+ },
250
+ accessedApis: Array.from(apis),
251
+ message: `${tier} "${name}" reads ${apiList} but the cache key is computed from ${wording.keyedBy} only. If the result varies by ${apiList}, different users may see each other's cached data. ${remedy}`
252
+ });
253
+ }
254
+ // src/cache/timber-cache.ts
79
255
  var defaultSingleflight = createSingleflight();
80
256
  /**
81
257
  * Per-key monotonic generation counter for CAS writes (TIM-1158).
@@ -164,20 +340,25 @@ function deriveFallbackFnId(fn) {
164
340
  * configured handler once it arrives (TIM-1029)
165
341
  * - No ALS dependency for correctness — cache() works outside a request
166
342
  * context. The waitUntil ALS bridge is read optionally so the SWR
167
- * background refetch survives handler return on Workers/Lambda.
343
+ * background refetch survives handler return on Workers/Lambda, and
344
+ * inside one, fn runs under the key-discipline observer (design/45
345
+ * §Enforcement): the key comes from the arguments only, so a
346
+ * request-context read in fn is reported, or rejected in strict mode
347
+ * before the result is stored.
168
348
  *
169
349
  * Cache hits/misses are recorded as OTEL span events on the enclosing
170
350
  * span (not child spans). The DevSpanProcessor reads these for dev log output.
171
351
  */
172
352
  function createCache(fn, opts, getHandler, stableId) {
173
353
  const fnId = stableId ?? (opts.key ? void 0 : deriveFallbackFnId(fn));
354
+ const disciplineId = fnId ?? `key-fn:${fnv1aHash(fn.toString())}`;
174
355
  const perCallSf = opts.timeoutMs !== void 0 ? createSingleflight({ timeoutMs: opts.timeoutMs }) : void 0;
175
356
  return (async (...args) => {
176
357
  const sf = perCallSf ?? defaultSingleflight;
177
358
  const key = opts.key ? opts.key(...args) : defaultKeyGenerator(fnId, args);
178
359
  const storeKey = devDataCacheKey(key);
179
360
  const cacheStart = performance.now();
180
- const cached = await getHandler().get(storeKey);
361
+ const cached = await guardedRead(key, () => getHandler().get(storeKey), null);
181
362
  if (cached && !cached.stale) {
182
363
  addSpanEventSync("timber.cache.hit", {
183
364
  key,
@@ -186,7 +367,7 @@ function createCache(fn, opts, getHandler, stableId) {
186
367
  return cached.value;
187
368
  }
188
369
  const tags = resolveTags(opts, args);
189
- const flightKey = `${key}\u0000${lastInvalidationEpochFor(key, tags)}`;
370
+ const flightKey = `${storeKey}\u0000${lastInvalidationEpochFor(key, tags)}`;
190
371
  /**
191
372
  * Run fn and store the result — exactly once per coalesced execution,
192
373
  * inside the singleflight callback. The write is skipped when:
@@ -200,7 +381,18 @@ function createCache(fn, opts, getHandler, stableId) {
200
381
  const executeAndStore = async (signal) => {
201
382
  const startEpoch = currentInvalidationEpoch();
202
383
  const generation = nextGeneration(key);
203
- const result = await fn(...args);
384
+ let result;
385
+ try {
386
+ result = await observeKeyDiscipline({
387
+ tier: "cache.data",
388
+ id: disciplineId,
389
+ label: fn.name || void 0,
390
+ cacheKey: key
391
+ }, () => fn(...args));
392
+ } catch (err) {
393
+ if (err instanceof KeyDisciplineViolation && !signal.aborted && writeGenerations.get(key) === generation) await getHandler().invalidate({ key: storeKey }).catch((e) => swallow(e, `cache invalidate failed for key "${key}"`));
394
+ throw err;
395
+ }
204
396
  if (!signal.aborted && !wasInvalidatedSince(startEpoch, key, tags)) try {
205
397
  await getHandler().set(storeKey, result, {
206
398
  ttl: opts.ttl,
@@ -236,11 +428,11 @@ function createCache(fn, opts, getHandler, stableId) {
236
428
  key,
237
429
  duration_ms: Math.round(performance.now() - cacheStart)
238
430
  });
431
+ logCacheMiss({ cacheKey: key });
239
432
  return result;
240
433
  });
241
434
  }
242
- //#endregion
243
- //#region src/cache/redis-handler.ts
435
+ // src/cache/redis-handler.ts
244
436
  var KEY_PREFIX = "timber:cache:";
245
437
  var TAG_PREFIX = "timber:tag:";
246
438
  /**
@@ -356,8 +548,7 @@ var RedisCacheHandler = class {
356
548
  }
357
549
  }
358
550
  };
359
- //#endregion
360
- //#region src/cache/tag-aware-handler.ts
551
+ // src/cache/tag-aware-handler.ts
361
552
  var DATA_PREFIX = "d:";
362
553
  var TAG_SET_PREFIX = "ts:";
363
554
  var TAG_VERSION_PREFIX = "tv:";
@@ -502,8 +693,7 @@ var TagAwareCacheHandler = class {
502
693
  await this.store.set(key, String(version), 31536e3);
503
694
  }
504
695
  };
505
- //#endregion
506
- //#region src/cache/index.ts
696
+ // src/cache/index.ts
507
697
  var MemoryCacheHandler = class {
508
698
  store = /* @__PURE__ */ new Map();
509
699
  generations = /* @__PURE__ */ new Map();
@@ -591,8 +781,7 @@ var MemoryCacheHandler = class {
591
781
  }
592
782
  }
593
783
  };
594
- //#endregion
595
- //#region src/server/version-skew.ts
784
+ // src/server/version-skew.ts
596
785
  /**
597
786
  * Version Skew Detection — graceful recovery when stale clients hit new deployments.
598
787
  *
@@ -667,8 +856,7 @@ function checkVersionSkew(req) {
667
856
  function applyReloadHeaders(headers) {
668
857
  headers.set(RELOAD_HEADER, "1");
669
858
  }
670
- //#endregion
671
- //#region src/server/prebuilt/manifest-tag-index.ts
859
+ // src/server/prebuilt/manifest-tag-index.ts
672
860
  /**
673
861
  * Build the inverted tag → seed key index from the manifest.
674
862
  *
@@ -697,8 +885,7 @@ function buildTagIndex(manifest) {
697
885
  }
698
886
  return index;
699
887
  }
700
- //#endregion
701
- //#region src/server/prebuilt/payload-source.ts
888
+ // src/server/prebuilt/payload-source.ts
702
889
  /**
703
890
  * Prebuilt payload source — the adapter seam through which the runtime
704
891
  * reads build-time flight artifacts (`.timber/dist/prebuilt/`).
@@ -837,8 +1024,7 @@ async function lookupArtifactSeed(id, cacheKey, needsTimestamp) {
837
1024
  capturedAt: (needsTimestamp ? await getManifestEntry(id, cacheKey) : null)?.buildTimestamp ?? 0
838
1025
  };
839
1026
  }
840
- //#endregion
841
- //#region src/server/prebuilt/overlay.ts
1027
+ // src/server/prebuilt/overlay.ts
842
1028
  /**
843
1029
  * Component cache overlay — runtime CacheHandler layer for ISR.
844
1030
  *
@@ -872,13 +1058,29 @@ function overlayKey(componentId, cacheKey) {
872
1058
  return `timber:c:${getDeploymentId() ?? devOverlayNamespace() ?? "dev"}:${componentId}:${cacheKey}`;
873
1059
  }
874
1060
  /**
1061
+ * Whether a re-render that started at `startEpoch` may store its capture
1062
+ * under `oKey`: nothing invalidated the key or its tags meanwhile
1063
+ * (TIM-1028), and the overlay key has not moved on. In dev a save moves it
1064
+ * to a new namespace, and the bytes may come from the pre-save code: stored,
1065
+ * they would answer every request after the save.
1066
+ */
1067
+ function mayStoreRerender(startEpoch, componentId, cacheKey, oKey, tags) {
1068
+ return !wasInvalidatedSince(startEpoch, oKey, tags) && overlayKey(componentId, cacheKey) === oKey;
1069
+ }
1070
+ var READ_FAILED = Symbol("overlay read failed");
1071
+ /**
875
1072
  * Look up an overlay entry in the cache handler.
876
1073
  * Returns null on a clean miss (no overlay entry at all).
877
1074
  */
878
1075
  async function lookupOverlay(componentId, cacheKey) {
879
1076
  const handler = getCacheHandler();
880
1077
  const key = overlayKey(componentId, cacheKey);
881
- const result = await handler.get(key);
1078
+ const result = await guardedRead(key, () => handler.get(key), READ_FAILED);
1079
+ if (result === READ_FAILED) return {
1080
+ kind: "unreadable",
1081
+ record: null,
1082
+ payload: null
1083
+ };
882
1084
  if (!result) return null;
883
1085
  const value = result.value;
884
1086
  if (isTombstone(value)) return {
@@ -983,8 +1185,7 @@ function bytesToBase64(bytes) {
983
1185
  function base64ToBytes(b64) {
984
1186
  return new Uint8Array(Buffer.from(b64, "base64"));
985
1187
  }
986
- //#endregion
987
- //#region src/cache/cache-api.ts
1188
+ // src/cache/cache-api.ts
988
1189
  var componentFallbackWarned = /* @__PURE__ */ new WeakSet();
989
1190
  /**
990
1191
  * Cache namespace — `cache.data`, `cache.component`, `cache.invalidate`.
@@ -1055,7 +1256,6 @@ var cache = {
1055
1256
  return componentFn;
1056
1257
  }
1057
1258
  };
1058
- //#endregion
1059
- export { hasPrebuiltPayloadSource as a, setPrebuiltPayloadSource as c, MemoryCacheHandler as d, TagAwareCacheHandler as f, getWaitUntil as h, storeOverlayEntry as i, applyReloadHeaders as l, setDefaultSingleflightTimeout as m, lookupOverlay as n, isParamIndependent as o, RedisCacheHandler as p, overlayKey as r, lookupArtifactSeed as s, cache as t, checkVersionSkew as u };
1259
+ export { getWaitUntil as _, storeOverlayEntry as a, lookupArtifactSeed as c, checkVersionSkew as d, MemoryCacheHandler as f, observeKeyDiscipline as g, setDefaultSingleflightTimeout as h, overlayKey as i, setPrebuiltPayloadSource as l, RedisCacheHandler as m, lookupOverlay as n, hasPrebuiltPayloadSource as o, TagAwareCacheHandler as p, mayStoreRerender as r, isParamIndependent as s, cache as t, applyReloadHeaders as u };
1060
1260
 
1061
- //# sourceMappingURL=cache-api-GE4AOe2H.js.map
1261
+ //# sourceMappingURL=cache-api-TDZ4hlDc.js.map