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

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 (1560) hide show
  1. package/LICENSE +8 -0
  2. package/agent-skill.md +376 -0
  3. package/bin/timber.mjs +15 -1
  4. package/dist/_chunks/actions-DHum77eH.js +1272 -0
  5. package/dist/_chunks/actions-DHum77eH.js.map +1 -0
  6. package/dist/_chunks/als-registry-DpygwCp0.js +42 -0
  7. package/dist/_chunks/als-registry-DpygwCp0.js.map +1 -0
  8. package/dist/_chunks/als-slots-kbQrHTzm.js +25 -0
  9. package/dist/_chunks/als-slots-kbQrHTzm.js.map +1 -0
  10. package/dist/_chunks/base-path-DDIx0FXe.js +79 -0
  11. package/dist/_chunks/base-path-DDIx0FXe.js.map +1 -0
  12. package/dist/_chunks/build-output-helper-5UsltK-S.js +398 -0
  13. package/dist/_chunks/build-output-helper-5UsltK-S.js.map +1 -0
  14. package/dist/_chunks/cache-api-BZJNt01a.js +1282 -0
  15. package/dist/_chunks/cache-api-BZJNt01a.js.map +1 -0
  16. package/dist/_chunks/canonicalize-CqK135BN.js +117 -0
  17. package/dist/_chunks/canonicalize-CqK135BN.js.map +1 -0
  18. package/dist/_chunks/chains-D-RRc7CM.js +266 -0
  19. package/dist/_chunks/chains-D-RRc7CM.js.map +1 -0
  20. package/dist/_chunks/chains-KblEfYzm.js +1 -0
  21. package/dist/_chunks/classify-_W0RWa5w.js +146 -0
  22. package/dist/_chunks/classify-_W0RWa5w.js.map +1 -0
  23. package/dist/_chunks/cli-check-B-JZkpBD.js +251 -0
  24. package/dist/_chunks/cli-check-B-JZkpBD.js.map +1 -0
  25. package/dist/_chunks/cli-context-BPdyA7Fp.js +1 -0
  26. package/dist/_chunks/cli-context-CwTKMjVe.js +77 -0
  27. package/dist/_chunks/cli-context-CwTKMjVe.js.map +1 -0
  28. package/dist/_chunks/cli-dev-status-prPMLU8G.js +138 -0
  29. package/dist/_chunks/cli-dev-status-prPMLU8G.js.map +1 -0
  30. package/dist/_chunks/cli-init-BoXOYYil.js +196 -0
  31. package/dist/_chunks/cli-init-BoXOYYil.js.map +1 -0
  32. package/dist/_chunks/cli-schema-sync-CAllbqRB.js +289 -0
  33. package/dist/_chunks/cli-schema-sync-CAllbqRB.js.map +1 -0
  34. package/dist/_chunks/cli-schema-sync-y_8ijmzO.js +1 -0
  35. package/dist/_chunks/client-dep-entries-C9hv-3k9.js +109 -0
  36. package/dist/_chunks/client-dep-entries-C9hv-3k9.js.map +1 -0
  37. package/dist/_chunks/cloudflare-_2fhxQE8.js +1314 -0
  38. package/dist/_chunks/cloudflare-_2fhxQE8.js.map +1 -0
  39. package/dist/_chunks/codec-registry-CPc6bjVl.js +20 -0
  40. package/dist/_chunks/codec-registry-CPc6bjVl.js.map +1 -0
  41. package/dist/_chunks/codegen-B9oWkWGf.js +429 -0
  42. package/dist/_chunks/codegen-B9oWkWGf.js.map +1 -0
  43. package/dist/_chunks/convention-lint-CrDKERHg.js +578 -0
  44. package/dist/_chunks/convention-lint-CrDKERHg.js.map +1 -0
  45. package/dist/_chunks/dev-discovery-YnabkCKD.js +238 -0
  46. package/dist/_chunks/dev-discovery-YnabkCKD.js.map +1 -0
  47. package/dist/_chunks/dev-server-L8biS7Az.js +1 -0
  48. package/dist/_chunks/dev-server-Rq659RR1.js +2439 -0
  49. package/dist/_chunks/dev-server-Rq659RR1.js.map +1 -0
  50. package/dist/_chunks/dev-span-_NzMX-au.js +108 -0
  51. package/dist/_chunks/dev-span-_NzMX-au.js.map +1 -0
  52. package/dist/_chunks/dev-store-BvdqtHvK.js +327 -0
  53. package/dist/_chunks/dev-store-BvdqtHvK.js.map +1 -0
  54. package/dist/_chunks/dist-C1Rjlo6s.js +384 -0
  55. package/dist/_chunks/dist-C1Rjlo6s.js.map +1 -0
  56. package/dist/_chunks/error-boundary-OHK1mI99.js +1100 -0
  57. package/dist/_chunks/error-boundary-OHK1mI99.js.map +1 -0
  58. package/dist/_chunks/fast-hash-DddxkU5Y.js +40 -0
  59. package/dist/_chunks/fast-hash-DddxkU5Y.js.map +1 -0
  60. package/dist/_chunks/flight-source-node-BGanuoSS.js +516 -0
  61. package/dist/_chunks/flight-source-node-BGanuoSS.js.map +1 -0
  62. package/dist/_chunks/format-DuPOoXUP.js +13 -0
  63. package/dist/_chunks/format-DuPOoXUP.js.map +1 -0
  64. package/dist/_chunks/fs-identity-BmQ_Agg-.js +205 -0
  65. package/dist/_chunks/fs-identity-BmQ_Agg-.js.map +1 -0
  66. package/dist/_chunks/global-context-CFSSysdJ.js +77 -0
  67. package/dist/_chunks/global-context-CFSSysdJ.js.map +1 -0
  68. package/dist/_chunks/graph-cache-B1LAg4t7.js +219 -0
  69. package/dist/_chunks/graph-cache-B1LAg4t7.js.map +1 -0
  70. package/dist/_chunks/href-validation-CEZy1V-k.js +210 -0
  71. package/dist/_chunks/href-validation-CEZy1V-k.js.map +1 -0
  72. package/dist/_chunks/json-lossy-check-BXM45k8p.js +65 -0
  73. package/dist/_chunks/json-lossy-check-BXM45k8p.js.map +1 -0
  74. package/dist/_chunks/live-graph-C7-yA8W9.js +150 -0
  75. package/dist/_chunks/live-graph-C7-yA8W9.js.map +1 -0
  76. package/dist/_chunks/logger-YtMSKfft.js +755 -0
  77. package/dist/_chunks/logger-YtMSKfft.js.map +1 -0
  78. package/dist/_chunks/{metadata-routes-Cjmvi3rQ.js → metadata-routes-BL26HCDd.js} +71 -29
  79. package/dist/_chunks/metadata-routes-BL26HCDd.js.map +1 -0
  80. package/dist/_chunks/navigation-root-CoGHIMiE.js +239 -0
  81. package/dist/_chunks/navigation-root-CoGHIMiE.js.map +1 -0
  82. package/dist/_chunks/node-response-D3hXWb8y.js +267 -0
  83. package/dist/_chunks/node-response-D3hXWb8y.js.map +1 -0
  84. package/dist/_chunks/param-value-DqlGfF57.js +65 -0
  85. package/dist/_chunks/param-value-DqlGfF57.js.map +1 -0
  86. package/dist/_chunks/plugin-context-BfSRKJfz.js +1 -0
  87. package/dist/_chunks/plugin-context-FCkaNLUB.js +327 -0
  88. package/dist/_chunks/plugin-context-FCkaNLUB.js.map +1 -0
  89. package/dist/_chunks/poison-rules-Bmz-lCPi.js +109 -0
  90. package/dist/_chunks/poison-rules-Bmz-lCPi.js.map +1 -0
  91. package/dist/_chunks/poison-scan-CRSP06Es.js +98 -0
  92. package/dist/_chunks/poison-scan-CRSP06Es.js.map +1 -0
  93. package/dist/_chunks/purge-store-8BqLAYZ1.js +13 -0
  94. package/dist/_chunks/purge-store-8BqLAYZ1.js.map +1 -0
  95. package/dist/_chunks/render-timeout-MrrqD1wd.js +53 -0
  96. package/dist/_chunks/render-timeout-MrrqD1wd.js.map +1 -0
  97. package/dist/_chunks/resolve-schema-B-aCuTu3.js +49 -0
  98. package/dist/_chunks/resolve-schema-B-aCuTu3.js.map +1 -0
  99. package/dist/_chunks/route-methods-Dk2kZc0n.js +36 -0
  100. package/dist/_chunks/route-methods-Dk2kZc0n.js.map +1 -0
  101. package/dist/_chunks/rsc-cache-key-D0cb0Gmc.js +242 -0
  102. package/dist/_chunks/rsc-cache-key-D0cb0Gmc.js.map +1 -0
  103. package/dist/_chunks/rsc-media-type-m8jz9u6_.js +60 -0
  104. package/dist/_chunks/rsc-media-type-m8jz9u6_.js.map +1 -0
  105. package/dist/_chunks/rsc-payload-path-EphpDB-J.js +53 -0
  106. package/dist/_chunks/rsc-payload-path-EphpDB-J.js.map +1 -0
  107. package/dist/_chunks/scan-CyizcBiX.js +139 -0
  108. package/dist/_chunks/scan-CyizcBiX.js.map +1 -0
  109. package/dist/_chunks/scanner-BNQ4qnLX.js +2048 -0
  110. package/dist/_chunks/scanner-BNQ4qnLX.js.map +1 -0
  111. package/dist/_chunks/schema-bridge-DyRs3cqy.js +235 -0
  112. package/dist/_chunks/schema-bridge-DyRs3cqy.js.map +1 -0
  113. package/dist/_chunks/segment-classify-Ho8jXWeC.js +195 -0
  114. package/dist/_chunks/segment-classify-Ho8jXWeC.js.map +1 -0
  115. package/dist/_chunks/segment-context-GAyTjjtS.js +33 -0
  116. package/dist/_chunks/segment-context-GAyTjjtS.js.map +1 -0
  117. package/dist/_chunks/segment-keys-Y60KNc8C.js +61 -0
  118. package/dist/_chunks/segment-keys-Y60KNc8C.js.map +1 -0
  119. package/dist/_chunks/singleflight-CzoOVB9Y.js +53 -0
  120. package/dist/_chunks/singleflight-CzoOVB9Y.js.map +1 -0
  121. package/dist/_chunks/sizeof-Cmx6Fs-Y.js +35 -0
  122. package/dist/_chunks/sizeof-Cmx6Fs-Y.js.map +1 -0
  123. package/dist/_chunks/ssr-data-9hPtcNOr.js +48 -0
  124. package/dist/_chunks/ssr-data-9hPtcNOr.js.map +1 -0
  125. package/dist/_chunks/state-B-EBjeER.js +49 -0
  126. package/dist/_chunks/state-B-EBjeER.js.map +1 -0
  127. package/dist/_chunks/status-page-marker-U6B1aFMb.js +530 -0
  128. package/dist/_chunks/status-page-marker-U6B1aFMb.js.map +1 -0
  129. package/dist/_chunks/tree-match-Bqdr9szG.js +168 -0
  130. package/dist/_chunks/tree-match-Bqdr9szG.js.map +1 -0
  131. package/dist/_chunks/use-query-states-pkDV-jSg.js +223 -0
  132. package/dist/_chunks/use-query-states-pkDV-jSg.js.map +1 -0
  133. package/dist/_chunks/walkers-D_QHR_nf.js +142 -0
  134. package/dist/_chunks/walkers-D_QHR_nf.js.map +1 -0
  135. package/dist/_chunks/write-file-atomic-DW8m_Atv.js +31 -0
  136. package/dist/_chunks/write-file-atomic-DW8m_Atv.js.map +1 -0
  137. package/dist/adapters/build-output-helper.d.ts +81 -0
  138. package/dist/adapters/build-output-helper.d.ts.map +1 -0
  139. package/dist/adapters/canonicalize-module.d.ts +8 -0
  140. package/dist/adapters/canonicalize-module.d.ts.map +1 -0
  141. package/dist/adapters/cloudflare-dev.d.ts +109 -0
  142. package/dist/adapters/cloudflare-dev.d.ts.map +1 -0
  143. package/dist/adapters/cloudflare-dev.js +73 -0
  144. package/dist/adapters/cloudflare-dev.js.map +1 -0
  145. package/dist/adapters/cloudflare-kv-cache.d.ts +64 -0
  146. package/dist/adapters/cloudflare-kv-cache.d.ts.map +1 -0
  147. package/dist/adapters/cloudflare-kv-cache.js +122 -0
  148. package/dist/adapters/cloudflare-kv-cache.js.map +1 -0
  149. package/dist/adapters/cloudflare.d.ts +217 -24
  150. package/dist/adapters/cloudflare.d.ts.map +1 -1
  151. package/dist/adapters/cloudflare.js +1 -188
  152. package/dist/adapters/compress-module.d.ts +25 -4
  153. package/dist/adapters/compress-module.d.ts.map +1 -1
  154. package/dist/adapters/fs-identity.d.ts +63 -0
  155. package/dist/adapters/fs-identity.d.ts.map +1 -0
  156. package/dist/adapters/nitro-immutable-assets.d.ts +47 -0
  157. package/dist/adapters/nitro-immutable-assets.d.ts.map +1 -0
  158. package/dist/adapters/nitro-presets.d.ts +37 -0
  159. package/dist/adapters/nitro-presets.d.ts.map +1 -0
  160. package/dist/adapters/nitro-preview.d.ts +65 -0
  161. package/dist/adapters/nitro-preview.d.ts.map +1 -0
  162. package/dist/adapters/nitro.d.ts +69 -38
  163. package/dist/adapters/nitro.d.ts.map +1 -1
  164. package/dist/adapters/nitro.js +837 -347
  165. package/dist/adapters/nitro.js.map +1 -1
  166. package/dist/adapters/shared.d.ts +85 -0
  167. package/dist/adapters/shared.d.ts.map +1 -0
  168. package/dist/adapters/types.d.ts +124 -16
  169. package/dist/adapters/types.d.ts.map +1 -1
  170. package/dist/adapters/types.js +0 -0
  171. package/dist/analyze/chains.d.ts +124 -0
  172. package/dist/analyze/chains.d.ts.map +1 -0
  173. package/dist/analyze/classify.d.ts +153 -0
  174. package/dist/analyze/classify.d.ts.map +1 -0
  175. package/dist/analyze/crawl-entry.d.ts +17 -0
  176. package/dist/analyze/crawl-entry.d.ts.map +1 -0
  177. package/dist/analyze/crawl-entry.js +312 -0
  178. package/dist/analyze/crawl-entry.js.map +1 -0
  179. package/dist/analyze/crawl.d.ts +134 -0
  180. package/dist/analyze/crawl.d.ts.map +1 -0
  181. package/dist/analyze/graph-cache.d.ts +104 -0
  182. package/dist/analyze/graph-cache.d.ts.map +1 -0
  183. package/dist/analyze/graph-command.d.ts +43 -0
  184. package/dist/analyze/graph-command.d.ts.map +1 -0
  185. package/dist/analyze/graph-command.js +386 -0
  186. package/dist/analyze/graph-command.js.map +1 -0
  187. package/dist/analyze/live-graph.d.ts +81 -0
  188. package/dist/analyze/live-graph.d.ts.map +1 -0
  189. package/dist/analyze/poison-rules.d.ts +72 -0
  190. package/dist/analyze/poison-rules.d.ts.map +1 -0
  191. package/dist/analyze/poison-scan.d.ts +48 -0
  192. package/dist/analyze/poison-scan.d.ts.map +1 -0
  193. package/dist/analyze/scan.d.ts +73 -0
  194. package/dist/analyze/scan.d.ts.map +1 -0
  195. package/dist/cache/cache-api.d.ts +48 -0
  196. package/dist/cache/cache-api.d.ts.map +1 -0
  197. package/dist/cache/fast-hash.d.ts +5 -0
  198. package/dist/cache/fast-hash.d.ts.map +1 -1
  199. package/dist/cache/guarded-read.d.ts +29 -0
  200. package/dist/cache/guarded-read.d.ts.map +1 -0
  201. package/dist/cache/handler-store.d.ts +45 -0
  202. package/dist/cache/handler-store.d.ts.map +1 -0
  203. package/dist/cache/index.d.ts +32 -9
  204. package/dist/cache/index.d.ts.map +1 -1
  205. package/dist/cache/index.js +4 -326
  206. package/dist/cache/invalidation-epoch.d.ts +50 -0
  207. package/dist/cache/invalidation-epoch.d.ts.map +1 -0
  208. package/dist/cache/json-lossy-check.d.ts +11 -0
  209. package/dist/cache/json-lossy-check.d.ts.map +1 -0
  210. package/dist/cache/key-discipline.d.ts +61 -0
  211. package/dist/cache/key-discipline.d.ts.map +1 -0
  212. package/dist/cache/redis-handler.d.ts +140 -9
  213. package/dist/cache/redis-handler.d.ts.map +1 -1
  214. package/dist/cache/singleflight.d.ts +31 -2
  215. package/dist/cache/singleflight.d.ts.map +1 -1
  216. package/dist/cache/sizeof.d.ts +22 -0
  217. package/dist/cache/sizeof.d.ts.map +1 -0
  218. package/dist/cache/stable-stringify.d.ts +15 -0
  219. package/dist/cache/stable-stringify.d.ts.map +1 -1
  220. package/dist/cache/store.d.ts +53 -0
  221. package/dist/cache/store.d.ts.map +1 -0
  222. package/dist/cache/stores/cloudflare-kv.d.ts +38 -0
  223. package/dist/cache/stores/cloudflare-kv.d.ts.map +1 -0
  224. package/dist/cache/stores/cloudflare-kv.js +28 -0
  225. package/dist/cache/stores/cloudflare-kv.js.map +1 -0
  226. package/dist/cache/stores/memory.d.ts +42 -0
  227. package/dist/cache/stores/memory.d.ts.map +1 -0
  228. package/dist/cache/stores/memory.js +89 -0
  229. package/dist/cache/stores/memory.js.map +1 -0
  230. package/dist/cache/stores/redis.d.ts +69 -0
  231. package/dist/cache/stores/redis.d.ts.map +1 -0
  232. package/dist/cache/stores/redis.js +34 -0
  233. package/dist/cache/stores/redis.js.map +1 -0
  234. package/dist/cache/stores/vercel.d.ts +36 -0
  235. package/dist/cache/stores/vercel.d.ts.map +1 -0
  236. package/dist/cache/stores/vercel.js +32 -0
  237. package/dist/cache/stores/vercel.js.map +1 -0
  238. package/dist/cache/tag-aware-handler.d.ts +51 -0
  239. package/dist/cache/tag-aware-handler.d.ts.map +1 -0
  240. package/dist/cache/timber-cache.d.ts +25 -11
  241. package/dist/cache/timber-cache.d.ts.map +1 -1
  242. package/dist/cdn/cloudflare-purge.d.ts +23 -0
  243. package/dist/cdn/cloudflare-purge.d.ts.map +1 -0
  244. package/dist/cdn/cloudflare-purge.js +29 -0
  245. package/dist/cdn/cloudflare-purge.js.map +1 -0
  246. package/dist/cdn/fastly-purge.d.ts +25 -0
  247. package/dist/cdn/fastly-purge.d.ts.map +1 -0
  248. package/dist/cdn/fastly-purge.js +32 -0
  249. package/dist/cdn/fastly-purge.js.map +1 -0
  250. package/dist/cdn/headers.d.ts +97 -0
  251. package/dist/cdn/headers.d.ts.map +1 -0
  252. package/dist/cdn/index.d.ts +5 -0
  253. package/dist/cdn/index.d.ts.map +1 -0
  254. package/dist/cdn/index.js +93 -0
  255. package/dist/cdn/index.js.map +1 -0
  256. package/dist/cdn/purge-store.d.ts +32 -0
  257. package/dist/cdn/purge-store.d.ts.map +1 -0
  258. package/dist/cdn/workers-cache-purge.d.ts +20 -0
  259. package/dist/cdn/workers-cache-purge.d.ts.map +1 -0
  260. package/dist/cdn/workers-cache-purge.js +33 -0
  261. package/dist/cdn/workers-cache-purge.js.map +1 -0
  262. package/dist/cli-check.d.ts +133 -0
  263. package/dist/cli-check.d.ts.map +1 -0
  264. package/dist/cli-context.d.ts +62 -0
  265. package/dist/cli-context.d.ts.map +1 -0
  266. package/dist/cli-dev-status.d.ts +75 -0
  267. package/dist/cli-dev-status.d.ts.map +1 -0
  268. package/dist/cli-init.d.ts +72 -0
  269. package/dist/cli-init.d.ts.map +1 -0
  270. package/dist/cli-schema-sync.d.ts +59 -0
  271. package/dist/cli-schema-sync.d.ts.map +1 -0
  272. package/dist/cli.d.ts +80 -16
  273. package/dist/cli.d.ts.map +1 -1
  274. package/dist/cli.js +210 -69
  275. package/dist/cli.js.map +1 -1
  276. package/dist/client/browser-dev.d.ts +42 -2
  277. package/dist/client/browser-dev.d.ts.map +1 -1
  278. package/dist/client/browser-entry/action-dispatch.d.ts +19 -0
  279. package/dist/client/browser-entry/action-dispatch.d.ts.map +1 -0
  280. package/dist/client/browser-entry/action-queue.d.ts +64 -0
  281. package/dist/client/browser-entry/action-queue.d.ts.map +1 -0
  282. package/dist/client/browser-entry/form-state.d.ts +22 -0
  283. package/dist/client/browser-entry/form-state.d.ts.map +1 -0
  284. package/dist/client/browser-entry/hmr.d.ts +27 -0
  285. package/dist/client/browser-entry/hmr.d.ts.map +1 -0
  286. package/dist/client/browser-entry/hydrate.d.ts +61 -0
  287. package/dist/client/browser-entry/hydrate.d.ts.map +1 -0
  288. package/dist/client/browser-entry/index.d.ts +32 -0
  289. package/dist/client/browser-entry/index.d.ts.map +1 -0
  290. package/dist/client/browser-entry/post-hydration.d.ts +26 -0
  291. package/dist/client/browser-entry/post-hydration.d.ts.map +1 -0
  292. package/dist/client/browser-entry/router-init.d.ts +41 -0
  293. package/dist/client/browser-entry/router-init.d.ts.map +1 -0
  294. package/dist/client/browser-entry/rsc-stream.d.ts +35 -0
  295. package/dist/client/browser-entry/rsc-stream.d.ts.map +1 -0
  296. package/dist/client/browser-entry/scroll.d.ts +28 -0
  297. package/dist/client/browser-entry/scroll.d.ts.map +1 -0
  298. package/dist/client/deny-last-resort.d.ts +29 -0
  299. package/dist/client/deny-last-resort.d.ts.map +1 -0
  300. package/dist/client/dev-pill/index.d.ts +32 -0
  301. package/dist/client/dev-pill/index.d.ts.map +1 -0
  302. package/dist/client/dev-pill/store.d.ts +105 -0
  303. package/dist/client/dev-pill/store.d.ts.map +1 -0
  304. package/dist/client/dev-pill/view.d.ts +9 -0
  305. package/dist/client/dev-pill/view.d.ts.map +1 -0
  306. package/dist/client/error-boundary.d.ts +58 -9
  307. package/dist/client/error-boundary.d.ts.map +1 -1
  308. package/dist/client/error-boundary.js +1 -126
  309. package/dist/client/error-reconstituter.d.ts +55 -0
  310. package/dist/client/error-reconstituter.d.ts.map +1 -0
  311. package/dist/client/form.d.ts +38 -99
  312. package/dist/client/form.d.ts.map +1 -1
  313. package/dist/client/global-context.d.ts +35 -0
  314. package/dist/client/global-context.d.ts.map +1 -0
  315. package/dist/client/history.d.ts +50 -9
  316. package/dist/client/history.d.ts.map +1 -1
  317. package/dist/client/index.d.ts +22 -33
  318. package/dist/client/index.d.ts.map +1 -1
  319. package/dist/client/index.js +416 -1241
  320. package/dist/client/index.js.map +1 -1
  321. package/dist/client/internal.d.ts +20 -0
  322. package/dist/client/internal.d.ts.map +1 -0
  323. package/dist/client/internal.js +785 -0
  324. package/dist/client/internal.js.map +1 -0
  325. package/dist/client/link.d.ts +85 -60
  326. package/dist/client/link.d.ts.map +1 -1
  327. package/dist/client/location-search.d.ts +12 -0
  328. package/dist/client/location-search.d.ts.map +1 -0
  329. package/dist/client/navigation-api.d.ts +95 -0
  330. package/dist/client/navigation-api.d.ts.map +1 -0
  331. package/dist/client/navigation-commit.d.ts +111 -0
  332. package/dist/client/navigation-commit.d.ts.map +1 -0
  333. package/dist/client/navigation-context.d.ts +75 -37
  334. package/dist/client/navigation-context.d.ts.map +1 -1
  335. package/dist/client/navigation-root.d.ts +106 -0
  336. package/dist/client/navigation-root.d.ts.map +1 -0
  337. package/dist/client/navigation-transition.d.ts +255 -0
  338. package/dist/client/navigation-transition.d.ts.map +1 -0
  339. package/dist/client/nuqs-adapter.d.ts +5 -2
  340. package/dist/client/nuqs-adapter.d.ts.map +1 -1
  341. package/dist/client/params-context.d.ts +81 -0
  342. package/dist/client/params-context.d.ts.map +1 -0
  343. package/dist/client/react-root.d.ts +51 -0
  344. package/dist/client/react-root.d.ts.map +1 -0
  345. package/dist/client/router-effects.d.ts +203 -0
  346. package/dist/client/router-effects.d.ts.map +1 -0
  347. package/dist/client/router-lifecycle.d.ts +107 -0
  348. package/dist/client/router-lifecycle.d.ts.map +1 -0
  349. package/dist/client/router-pipeline.d.ts +81 -0
  350. package/dist/client/router-pipeline.d.ts.map +1 -0
  351. package/dist/client/router-ref.d.ts +2 -2
  352. package/dist/client/router-ref.d.ts.map +1 -1
  353. package/dist/client/router-skew.d.ts +21 -0
  354. package/dist/client/router-skew.d.ts.map +1 -0
  355. package/dist/client/router-types.d.ts +294 -0
  356. package/dist/client/router-types.d.ts.map +1 -0
  357. package/dist/client/router-url.d.ts +24 -0
  358. package/dist/client/router-url.d.ts.map +1 -0
  359. package/dist/client/router.d.ts +1 -97
  360. package/dist/client/router.d.ts.map +1 -1
  361. package/dist/client/rsc-fetch.d.ts +110 -28
  362. package/dist/client/rsc-fetch.d.ts.map +1 -1
  363. package/dist/client/segment-cache.d.ts +186 -25
  364. package/dist/client/segment-cache.d.ts.map +1 -1
  365. package/dist/client/segment-context.d.ts.map +1 -1
  366. package/dist/client/segment-outlet.d.ts +68 -0
  367. package/dist/client/segment-outlet.d.ts.map +1 -0
  368. package/dist/client/segment-update-context.d.ts +15 -0
  369. package/dist/client/segment-update-context.d.ts.map +1 -0
  370. package/dist/client/shallow-url.d.ts +10 -0
  371. package/dist/client/shallow-url.d.ts.map +1 -0
  372. package/dist/client/slot-content-cache-context.d.ts +35 -0
  373. package/dist/client/slot-content-cache-context.d.ts.map +1 -0
  374. package/dist/client/slot-context.d.ts +31 -0
  375. package/dist/client/slot-context.d.ts.map +1 -0
  376. package/dist/client/slot-outlet.d.ts +16 -0
  377. package/dist/client/slot-outlet.d.ts.map +1 -0
  378. package/dist/client/slot-provider.d.ts +25 -0
  379. package/dist/client/slot-provider.d.ts.map +1 -0
  380. package/dist/client/ssr-data.d.ts +26 -50
  381. package/dist/client/ssr-data.d.ts.map +1 -1
  382. package/dist/client/stale-client.d.ts +69 -0
  383. package/dist/client/stale-client.d.ts.map +1 -0
  384. package/dist/client/state.d.ts +21 -13
  385. package/dist/client/state.d.ts.map +1 -1
  386. package/dist/client/status-page-marker.d.ts +25 -0
  387. package/dist/client/status-page-marker.d.ts.map +1 -0
  388. package/dist/client/top-loader.d.ts +7 -6
  389. package/dist/client/top-loader.d.ts.map +1 -1
  390. package/dist/client/unload-guard.d.ts +5 -0
  391. package/dist/client/unload-guard.d.ts.map +1 -1
  392. package/dist/client/use-cookie.d.ts +25 -0
  393. package/dist/client/use-cookie.d.ts.map +1 -1
  394. package/dist/client/use-field-state.d.ts +42 -0
  395. package/dist/client/use-field-state.d.ts.map +1 -0
  396. package/dist/client/use-link-status.d.ts +5 -5
  397. package/dist/client/use-link-status.d.ts.map +1 -1
  398. package/dist/client/use-pathname.d.ts +13 -11
  399. package/dist/client/use-pathname.d.ts.map +1 -1
  400. package/dist/client/use-pending-navigation.d.ts +47 -0
  401. package/dist/client/use-pending-navigation.d.ts.map +1 -0
  402. package/dist/client/use-query-states.d.ts +10 -4
  403. package/dist/client/use-query-states.d.ts.map +1 -1
  404. package/dist/client/use-router.d.ts +15 -8
  405. package/dist/client/use-router.d.ts.map +1 -1
  406. package/dist/client/use-search-params.d.ts +15 -8
  407. package/dist/client/use-search-params.d.ts.map +1 -1
  408. package/dist/client/use-segment-params.d.ts +55 -0
  409. package/dist/client/use-segment-params.d.ts.map +1 -0
  410. package/dist/codec.d.ts +69 -0
  411. package/dist/codec.d.ts.map +1 -0
  412. package/dist/codec.js +75 -0
  413. package/dist/codec.js.map +1 -0
  414. package/dist/config-types.d.ts +366 -0
  415. package/dist/config-types.d.ts.map +1 -0
  416. package/dist/config-validation.d.ts +68 -0
  417. package/dist/config-validation.d.ts.map +1 -0
  418. package/dist/cookies/define-cookie.d.ts +58 -25
  419. package/dist/cookies/define-cookie.d.ts.map +1 -1
  420. package/dist/cookies/index.d.ts +3 -2
  421. package/dist/cookies/index.d.ts.map +1 -1
  422. package/dist/cookies/index.js +230 -37
  423. package/dist/cookies/index.js.map +1 -1
  424. package/dist/cookies/json-cookie.d.ts +64 -0
  425. package/dist/cookies/json-cookie.d.ts.map +1 -0
  426. package/dist/cookies/validation.d.ts +34 -0
  427. package/dist/cookies/validation.d.ts.map +1 -0
  428. package/dist/dev-tools/404-page.d.ts +50 -0
  429. package/dist/dev-tools/404-page.d.ts.map +1 -0
  430. package/dist/dev-tools/await-span.d.ts +17 -0
  431. package/dist/dev-tools/await-span.d.ts.map +1 -0
  432. package/dist/dev-tools/browser-logs.d.ts +40 -0
  433. package/dist/dev-tools/browser-logs.d.ts.map +1 -0
  434. package/dist/dev-tools/dev-page-shell.d.ts +95 -0
  435. package/dist/dev-tools/dev-page-shell.d.ts.map +1 -0
  436. package/dist/dev-tools/error-page.d.ts +32 -0
  437. package/dist/dev-tools/error-page.d.ts.map +1 -0
  438. package/dist/dev-tools/holding-server.d.ts +46 -0
  439. package/dist/dev-tools/holding-server.d.ts.map +1 -0
  440. package/dist/dev-tools/hydration-overlay.d.ts +11 -0
  441. package/dist/dev-tools/hydration-overlay.d.ts.map +1 -0
  442. package/dist/dev-tools/index.d.ts +31 -0
  443. package/dist/dev-tools/index.d.ts.map +1 -0
  444. package/dist/dev-tools/instrumentation.d.ts +74 -0
  445. package/dist/dev-tools/instrumentation.d.ts.map +1 -0
  446. package/dist/{server/dev-logger.d.ts → dev-tools/logger.d.ts} +1 -1
  447. package/dist/dev-tools/logger.d.ts.map +1 -0
  448. package/dist/{plugins/dev-logs.d.ts → dev-tools/logs.d.ts} +19 -5
  449. package/dist/dev-tools/logs.d.ts.map +1 -0
  450. package/dist/{plugins/dev-error-overlay.d.ts → dev-tools/overlay.d.ts} +15 -25
  451. package/dist/dev-tools/overlay.d.ts.map +1 -0
  452. package/dist/dev-tools/span-sink.d.ts +42 -0
  453. package/dist/dev-tools/span-sink.d.ts.map +1 -0
  454. package/dist/dev-tools/stack-classifier.d.ts +34 -0
  455. package/dist/dev-tools/stack-classifier.d.ts.map +1 -0
  456. package/dist/dev-tools/terminal.d.ts +28 -0
  457. package/dist/dev-tools/terminal.d.ts.map +1 -0
  458. package/dist/fonts/ast-walk.d.ts +68 -0
  459. package/dist/fonts/ast-walk.d.ts.map +1 -0
  460. package/dist/fonts/ast.d.ts +112 -8
  461. package/dist/fonts/ast.d.ts.map +1 -1
  462. package/dist/fonts/bundle.d.ts +50 -0
  463. package/dist/fonts/bundle.d.ts.map +1 -0
  464. package/dist/fonts/css.d.ts +1 -1
  465. package/dist/fonts/dev-middleware.d.ts +22 -0
  466. package/dist/fonts/dev-middleware.d.ts.map +1 -0
  467. package/dist/fonts/fallbacks.d.ts +0 -7
  468. package/dist/fonts/fallbacks.d.ts.map +1 -1
  469. package/dist/fonts/google.d.ts +5 -3
  470. package/dist/fonts/google.d.ts.map +1 -1
  471. package/dist/fonts/local.d.ts +5 -5
  472. package/dist/fonts/local.d.ts.map +1 -1
  473. package/dist/fonts/paths.d.ts +43 -0
  474. package/dist/fonts/paths.d.ts.map +1 -0
  475. package/dist/fonts/pipeline.d.ts +177 -0
  476. package/dist/fonts/pipeline.d.ts.map +1 -0
  477. package/dist/fonts/transform.d.ts +82 -0
  478. package/dist/fonts/transform.d.ts.map +1 -0
  479. package/dist/fonts/types.d.ts +47 -1
  480. package/dist/fonts/types.d.ts.map +1 -1
  481. package/dist/fonts/virtual-modules.d.ts +77 -0
  482. package/dist/fonts/virtual-modules.d.ts.map +1 -0
  483. package/dist/index.d.ts +35 -181
  484. package/dist/index.d.ts.map +1 -1
  485. package/dist/index.js +9949 -14264
  486. package/dist/index.js.map +1 -1
  487. package/dist/params/codec-registry.d.ts +26 -0
  488. package/dist/params/codec-registry.d.ts.map +1 -0
  489. package/dist/params/define-schema.d.ts +81 -0
  490. package/dist/params/define-schema.d.ts.map +1 -0
  491. package/dist/params/index.d.ts +5 -0
  492. package/dist/params/index.d.ts.map +1 -0
  493. package/dist/params/index.js +33 -0
  494. package/dist/params/index.js.map +1 -0
  495. package/dist/params/resolve-schema.d.ts +34 -0
  496. package/dist/params/resolve-schema.d.ts.map +1 -0
  497. package/dist/plugin-context.d.ts +269 -0
  498. package/dist/plugin-context.d.ts.map +1 -0
  499. package/dist/plugins/build-manifest.d.ts +7 -3
  500. package/dist/plugins/build-manifest.d.ts.map +1 -1
  501. package/dist/plugins/build-report.d.ts +61 -11
  502. package/dist/plugins/build-report.d.ts.map +1 -1
  503. package/dist/plugins/cache.d.ts +64 -0
  504. package/dist/plugins/cache.d.ts.map +1 -0
  505. package/dist/plugins/callsite-ast.d.ts +117 -0
  506. package/dist/plugins/callsite-ast.d.ts.map +1 -0
  507. package/dist/plugins/callsite-jsx.d.ts +35 -0
  508. package/dist/plugins/callsite-jsx.d.ts.map +1 -0
  509. package/dist/plugins/chunks.d.ts +11 -4
  510. package/dist/plugins/chunks.d.ts.map +1 -1
  511. package/dist/plugins/client-chunks.d.ts +40 -0
  512. package/dist/plugins/client-chunks.d.ts.map +1 -0
  513. package/dist/plugins/client-dep-entries.d.ts +80 -0
  514. package/dist/plugins/client-dep-entries.d.ts.map +1 -0
  515. package/dist/plugins/client-in-server-package-deps.d.ts +63 -0
  516. package/dist/plugins/client-in-server-package-deps.d.ts.map +1 -0
  517. package/dist/plugins/cloudflare-wasm.d.ts +21 -0
  518. package/dist/plugins/cloudflare-wasm.d.ts.map +1 -0
  519. package/dist/plugins/content.d.ts +1 -1
  520. package/dist/plugins/content.d.ts.map +1 -1
  521. package/dist/plugins/dev-await.d.ts +81 -0
  522. package/dist/plugins/dev-await.d.ts.map +1 -0
  523. package/dist/plugins/dev-discovery.d.ts +187 -0
  524. package/dist/plugins/dev-discovery.d.ts.map +1 -0
  525. package/dist/plugins/dev-hostname.d.ts +152 -0
  526. package/dist/plugins/dev-hostname.d.ts.map +1 -0
  527. package/dist/plugins/dev-server.d.ts +29 -2
  528. package/dist/plugins/dev-server.d.ts.map +1 -1
  529. package/dist/plugins/dev-store-clear.d.ts +83 -0
  530. package/dist/plugins/dev-store-clear.d.ts.map +1 -0
  531. package/dist/plugins/encryption-runtime.d.ts +13 -0
  532. package/dist/plugins/encryption-runtime.d.ts.map +1 -0
  533. package/dist/plugins/entries.d.ts +40 -4
  534. package/dist/plugins/entries.d.ts.map +1 -1
  535. package/dist/plugins/fonts.d.ts +35 -74
  536. package/dist/plugins/fonts.d.ts.map +1 -1
  537. package/dist/plugins/graph-endpoint.d.ts +114 -0
  538. package/dist/plugins/graph-endpoint.d.ts.map +1 -0
  539. package/dist/plugins/mdx.d.ts +18 -5
  540. package/dist/plugins/mdx.d.ts.map +1 -1
  541. package/dist/plugins/optimize-package-imports-defaults.d.ts +13 -0
  542. package/dist/plugins/optimize-package-imports-defaults.d.ts.map +1 -0
  543. package/dist/plugins/optimize-package-imports.d.ts +124 -0
  544. package/dist/plugins/optimize-package-imports.d.ts.map +1 -0
  545. package/dist/plugins/orphaned-modules.d.ts +57 -0
  546. package/dist/plugins/orphaned-modules.d.ts.map +1 -0
  547. package/dist/plugins/post-build.d.ts +110 -0
  548. package/dist/plugins/post-build.d.ts.map +1 -0
  549. package/dist/plugins/prebuilt-capture.d.ts +67 -0
  550. package/dist/plugins/prebuilt-capture.d.ts.map +1 -0
  551. package/dist/plugins/prebuilt-options-analysis.d.ts +40 -0
  552. package/dist/plugins/prebuilt-options-analysis.d.ts.map +1 -0
  553. package/dist/plugins/prebuilt.d.ts +98 -0
  554. package/dist/plugins/prebuilt.d.ts.map +1 -0
  555. package/dist/plugins/prerender-sugar.d.ts +39 -0
  556. package/dist/plugins/prerender-sugar.d.ts.map +1 -0
  557. package/dist/plugins/react-resolve.d.ts +49 -0
  558. package/dist/plugins/react-resolve.d.ts.map +1 -0
  559. package/dist/plugins/request-dep/analysis.d.ts +106 -0
  560. package/dist/plugins/request-dep/analysis.d.ts.map +1 -0
  561. package/dist/plugins/request-dep/index.d.ts +75 -0
  562. package/dist/plugins/request-dep/index.d.ts.map +1 -0
  563. package/dist/plugins/request-dep/origin.d.ts +61 -0
  564. package/dist/plugins/request-dep/origin.d.ts.map +1 -0
  565. package/dist/plugins/routing.d.ts +2 -2
  566. package/dist/plugins/routing.d.ts.map +1 -1
  567. package/dist/plugins/rsc-assets-manifest.d.ts +33 -0
  568. package/dist/plugins/rsc-assets-manifest.d.ts.map +1 -0
  569. package/dist/plugins/server-bundle.d.ts +1 -1
  570. package/dist/plugins/server-bundle.d.ts.map +1 -1
  571. package/dist/plugins/shims.d.ts +29 -5
  572. package/dist/plugins/shims.d.ts.map +1 -1
  573. package/dist/plugins/static-build.d.ts +246 -26
  574. package/dist/plugins/static-build.d.ts.map +1 -1
  575. package/dist/routing/codegen-shared.d.ts +26 -0
  576. package/dist/routing/codegen-shared.d.ts.map +1 -0
  577. package/dist/routing/codegen-types.d.ts +61 -0
  578. package/dist/routing/codegen-types.d.ts.map +1 -0
  579. package/dist/routing/codegen-write.d.ts +42 -0
  580. package/dist/routing/codegen-write.d.ts.map +1 -0
  581. package/dist/routing/codegen.d.ts +8 -3
  582. package/dist/routing/codegen.d.ts.map +1 -1
  583. package/dist/routing/collision-probe.d.ts +104 -0
  584. package/dist/routing/collision-probe.d.ts.map +1 -0
  585. package/dist/routing/collision-spaces.d.ts +26 -0
  586. package/dist/routing/collision-spaces.d.ts.map +1 -0
  587. package/dist/routing/convention-lint.d.ts +55 -0
  588. package/dist/routing/convention-lint.d.ts.map +1 -0
  589. package/dist/routing/export-detect.d.ts +91 -0
  590. package/dist/routing/export-detect.d.ts.map +1 -0
  591. package/dist/routing/file-cache.d.ts +8 -0
  592. package/dist/routing/file-cache.d.ts.map +1 -0
  593. package/dist/routing/index.d.ts +13 -7
  594. package/dist/routing/index.d.ts.map +1 -1
  595. package/dist/routing/index.js +5 -2
  596. package/dist/routing/interception-overlap.d.ts +35 -0
  597. package/dist/routing/interception-overlap.d.ts.map +1 -0
  598. package/dist/routing/interception.d.ts +234 -10
  599. package/dist/routing/interception.d.ts.map +1 -1
  600. package/dist/routing/link-codegen.d.ts +105 -0
  601. package/dist/routing/link-codegen.d.ts.map +1 -0
  602. package/dist/routing/manifest-codegen.d.ts +26 -0
  603. package/dist/routing/manifest-codegen.d.ts.map +1 -0
  604. package/dist/routing/scanner.d.ts +14 -10
  605. package/dist/routing/scanner.d.ts.map +1 -1
  606. package/dist/routing/schema-validation.d.ts +35 -0
  607. package/dist/routing/schema-validation.d.ts.map +1 -0
  608. package/dist/routing/segment-classify.d.ts +114 -0
  609. package/dist/routing/segment-classify.d.ts.map +1 -0
  610. package/dist/routing/segment-codegen.d.ts +38 -0
  611. package/dist/routing/segment-codegen.d.ts.map +1 -0
  612. package/dist/routing/segment-keys.d.ts +118 -0
  613. package/dist/routing/segment-keys.d.ts.map +1 -0
  614. package/dist/routing/slot-placement.d.ts +48 -0
  615. package/dist/routing/slot-placement.d.ts.map +1 -0
  616. package/dist/routing/types.d.ts +81 -26
  617. package/dist/routing/types.d.ts.map +1 -1
  618. package/dist/routing/walkers.d.ts +57 -0
  619. package/dist/routing/walkers.d.ts.map +1 -0
  620. package/dist/rsc-runtime/dev-reference-cache.d.ts +47 -0
  621. package/dist/rsc-runtime/dev-reference-cache.d.ts.map +1 -0
  622. package/dist/rsc-runtime/encryption-runtime.d.ts +25 -0
  623. package/dist/rsc-runtime/encryption-runtime.d.ts.map +1 -0
  624. package/dist/rsc-runtime/render-flight.d.ts +14 -0
  625. package/dist/rsc-runtime/render-flight.d.ts.map +1 -0
  626. package/dist/rsc-runtime/rsc.d.ts +3 -13
  627. package/dist/rsc-runtime/rsc.d.ts.map +1 -1
  628. package/dist/rsc-runtime/server-reference-load-error.d.ts +14 -0
  629. package/dist/rsc-runtime/server-reference-load-error.d.ts.map +1 -0
  630. package/dist/rsc-runtime/server-references.d.ts +19 -0
  631. package/dist/rsc-runtime/server-references.d.ts.map +1 -0
  632. package/dist/rsc-runtime/ssr.d.ts +7 -10
  633. package/dist/rsc-runtime/ssr.d.ts.map +1 -1
  634. package/dist/rsc-runtime/transforms.d.ts +13 -0
  635. package/dist/rsc-runtime/transforms.d.ts.map +1 -0
  636. package/dist/schema-bridge.d.ts +154 -0
  637. package/dist/schema-bridge.d.ts.map +1 -0
  638. package/dist/search-params/define.d.ts +262 -0
  639. package/dist/search-params/define.d.ts.map +1 -0
  640. package/dist/search-params/index.d.ts +3 -7
  641. package/dist/search-params/index.d.ts.map +1 -1
  642. package/dist/search-params/index.js +178 -362
  643. package/dist/search-params/index.js.map +1 -1
  644. package/dist/search-params/parse-total.d.ts +81 -0
  645. package/dist/search-params/parse-total.d.ts.map +1 -0
  646. package/dist/search-params/serialize-equal.d.ts +9 -0
  647. package/dist/search-params/serialize-equal.d.ts.map +1 -0
  648. package/dist/search-params/wrappers.d.ts +76 -0
  649. package/dist/search-params/wrappers.d.ts.map +1 -0
  650. package/dist/server/abort-scope.d.ts +27 -0
  651. package/dist/server/abort-scope.d.ts.map +1 -0
  652. package/dist/server/access-gate.d.ts +110 -10
  653. package/dist/server/access-gate.d.ts.map +1 -1
  654. package/dist/server/action-client.d.ts +20 -133
  655. package/dist/server/action-client.d.ts.map +1 -1
  656. package/dist/server/action-encryption.d.ts +76 -0
  657. package/dist/server/action-encryption.d.ts.map +1 -0
  658. package/dist/server/action-handler.d.ts +60 -11
  659. package/dist/server/action-handler.d.ts.map +1 -1
  660. package/dist/server/action-schema.d.ts +126 -0
  661. package/dist/server/action-schema.d.ts.map +1 -0
  662. package/dist/server/action-types.d.ts +108 -0
  663. package/dist/server/action-types.d.ts.map +1 -0
  664. package/dist/server/actions.d.ts +78 -40
  665. package/dist/server/actions.d.ts.map +1 -1
  666. package/dist/server/als-registry.d.ts +189 -17
  667. package/dist/server/als-registry.d.ts.map +1 -1
  668. package/dist/server/body-limits.d.ts.map +1 -1
  669. package/dist/server/build-manifest.d.ts +25 -30
  670. package/dist/server/build-manifest.d.ts.map +1 -1
  671. package/dist/server/canonicalize.d.ts +53 -0
  672. package/dist/server/canonicalize.d.ts.map +1 -1
  673. package/dist/server/chain-url-parts.d.ts +82 -0
  674. package/dist/server/chain-url-parts.d.ts.map +1 -0
  675. package/dist/server/children-interception.d.ts +49 -0
  676. package/dist/server/children-interception.d.ts.map +1 -0
  677. package/dist/server/client-error-message.d.ts +12 -0
  678. package/dist/server/client-error-message.d.ts.map +1 -0
  679. package/dist/server/coalesce-tick.d.ts +40 -0
  680. package/dist/server/coalesce-tick.d.ts.map +1 -0
  681. package/dist/server/compress.d.ts +2 -0
  682. package/dist/server/compress.d.ts.map +1 -1
  683. package/dist/server/cookie-context.d.ts +156 -0
  684. package/dist/server/cookie-context.d.ts.map +1 -0
  685. package/dist/server/cookie-parsing.d.ts +65 -0
  686. package/dist/server/cookie-parsing.d.ts.map +1 -0
  687. package/dist/server/csp-nonce.d.ts +36 -0
  688. package/dist/server/csp-nonce.d.ts.map +1 -0
  689. package/dist/server/csrf.d.ts +58 -15
  690. package/dist/server/csrf.d.ts.map +1 -1
  691. package/dist/server/debug.d.ts +0 -1
  692. package/dist/server/debug.d.ts.map +1 -1
  693. package/dist/server/default-logger.d.ts +23 -0
  694. package/dist/server/default-logger.d.ts.map +1 -0
  695. package/dist/server/default-status-page.d.ts +45 -0
  696. package/dist/server/default-status-page.d.ts.map +1 -0
  697. package/dist/server/deny-boundary.d.ts +257 -0
  698. package/dist/server/deny-boundary.d.ts.map +1 -0
  699. package/dist/server/deny-renderer.d.ts +22 -15
  700. package/dist/server/deny-renderer.d.ts.map +1 -1
  701. package/dist/server/early-hints-sender.d.ts.map +1 -1
  702. package/dist/server/early-hints.d.ts +14 -12
  703. package/dist/server/early-hints.d.ts.map +1 -1
  704. package/dist/server/error-boundary-wrapper.d.ts +102 -10
  705. package/dist/server/error-boundary-wrapper.d.ts.map +1 -1
  706. package/dist/server/error-response-headers.d.ts +3 -0
  707. package/dist/server/error-response-headers.d.ts.map +1 -0
  708. package/dist/server/fallback-error.d.ts +19 -7
  709. package/dist/server/fallback-error.d.ts.map +1 -1
  710. package/dist/server/flight-injection-state.d.ts +66 -0
  711. package/dist/server/flight-injection-state.d.ts.map +1 -0
  712. package/dist/server/flight-injector-core.d.ts +125 -0
  713. package/dist/server/flight-injector-core.d.ts.map +1 -0
  714. package/dist/server/flight-scripts.d.ts +63 -0
  715. package/dist/server/flight-scripts.d.ts.map +1 -0
  716. package/dist/server/flight-source-node.d.ts +105 -0
  717. package/dist/server/flight-source-node.d.ts.map +1 -0
  718. package/dist/server/flight-source.d.ts +136 -0
  719. package/dist/server/flight-source.d.ts.map +1 -0
  720. package/dist/server/form-data.d.ts +59 -2
  721. package/dist/server/form-data.d.ts.map +1 -1
  722. package/dist/server/form-state-flight.d.ts +32 -0
  723. package/dist/server/form-state-flight.d.ts.map +1 -0
  724. package/dist/server/head-response.d.ts +35 -0
  725. package/dist/server/head-response.d.ts.map +1 -0
  726. package/dist/server/html-injector-core.d.ts +169 -0
  727. package/dist/server/html-injector-core.d.ts.map +1 -0
  728. package/dist/server/html-injectors.d.ts +77 -47
  729. package/dist/server/html-injectors.d.ts.map +1 -1
  730. package/dist/server/index.d.ts +16 -54
  731. package/dist/server/index.d.ts.map +1 -1
  732. package/dist/server/index.js +621 -3009
  733. package/dist/server/index.js.map +1 -1
  734. package/dist/server/instrumentation.d.ts +13 -5
  735. package/dist/server/instrumentation.d.ts.map +1 -1
  736. package/dist/server/interception-gates.d.ts +49 -0
  737. package/dist/server/interception-gates.d.ts.map +1 -0
  738. package/dist/server/internal.d.ts +48 -0
  739. package/dist/server/internal.d.ts.map +1 -0
  740. package/dist/server/internal.js +5094 -0
  741. package/dist/server/internal.js.map +1 -0
  742. package/dist/server/json-status-response.d.ts +34 -0
  743. package/dist/server/json-status-response.d.ts.map +1 -0
  744. package/dist/server/logger.d.ts +105 -7
  745. package/dist/server/logger.d.ts.map +1 -1
  746. package/dist/server/metadata-collector.d.ts +75 -0
  747. package/dist/server/metadata-collector.d.ts.map +1 -0
  748. package/dist/server/metadata-platform.d.ts +2 -2
  749. package/dist/server/metadata-render.d.ts +2 -2
  750. package/dist/server/metadata-render.d.ts.map +1 -1
  751. package/dist/server/metadata-route-links.d.ts +70 -0
  752. package/dist/server/metadata-route-links.d.ts.map +1 -0
  753. package/dist/server/metadata-routes.d.ts +47 -11
  754. package/dist/server/metadata-routes.d.ts.map +1 -1
  755. package/dist/server/metadata-social.d.ts +2 -2
  756. package/dist/server/metadata.d.ts +10 -2
  757. package/dist/server/metadata.d.ts.map +1 -1
  758. package/dist/server/middleware-runner.d.ts +20 -5
  759. package/dist/server/middleware-runner.d.ts.map +1 -1
  760. package/dist/server/node-body-response.d.ts +55 -0
  761. package/dist/server/node-body-response.d.ts.map +1 -0
  762. package/dist/server/node-response.d.ts +62 -0
  763. package/dist/server/node-response.d.ts.map +1 -0
  764. package/dist/server/node-stream-transforms.d.ts +108 -0
  765. package/dist/server/node-stream-transforms.d.ts.map +1 -0
  766. package/dist/server/node-streams-platform.d.ts +21 -0
  767. package/dist/server/node-streams-platform.d.ts.map +1 -0
  768. package/dist/server/param-coercion.d.ts +91 -0
  769. package/dist/server/param-coercion.d.ts.map +1 -0
  770. package/dist/server/pipeline-helpers.d.ts +227 -0
  771. package/dist/server/pipeline-helpers.d.ts.map +1 -0
  772. package/dist/server/pipeline-interception.d.ts +100 -9
  773. package/dist/server/pipeline-interception.d.ts.map +1 -1
  774. package/dist/server/pipeline-metadata-route.d.ts +24 -0
  775. package/dist/server/pipeline-metadata-route.d.ts.map +1 -0
  776. package/dist/server/pipeline-metadata.d.ts +18 -2
  777. package/dist/server/pipeline-metadata.d.ts.map +1 -1
  778. package/dist/server/pipeline-outcome.d.ts +59 -0
  779. package/dist/server/pipeline-outcome.d.ts.map +1 -0
  780. package/dist/server/pipeline-phases.d.ts +76 -0
  781. package/dist/server/pipeline-phases.d.ts.map +1 -0
  782. package/dist/server/pipeline.d.ts +190 -23
  783. package/dist/server/pipeline.d.ts.map +1 -1
  784. package/dist/server/port-resolution.d.ts +22 -0
  785. package/dist/server/port-resolution.d.ts.map +1 -0
  786. package/dist/server/prebuilt/cache-key.d.ts +89 -0
  787. package/dist/server/prebuilt/cache-key.d.ts.map +1 -0
  788. package/dist/server/prebuilt/capture-render.d.ts +30 -0
  789. package/dist/server/prebuilt/capture-render.d.ts.map +1 -0
  790. package/dist/server/prebuilt/capture-routes.d.ts +37 -0
  791. package/dist/server/prebuilt/capture-routes.d.ts.map +1 -0
  792. package/dist/server/prebuilt/capture-state.d.ts +101 -0
  793. package/dist/server/prebuilt/capture-state.d.ts.map +1 -0
  794. package/dist/server/prebuilt/dev-store.d.ts +149 -0
  795. package/dist/server/prebuilt/dev-store.d.ts.map +1 -0
  796. package/dist/server/prebuilt/lifetime.d.ts +38 -0
  797. package/dist/server/prebuilt/lifetime.d.ts.map +1 -0
  798. package/dist/server/prebuilt/manifest-tag-index.d.ts +27 -0
  799. package/dist/server/prebuilt/manifest-tag-index.d.ts.map +1 -0
  800. package/dist/server/prebuilt/overlay.d.ts +119 -0
  801. package/dist/server/prebuilt/overlay.d.ts.map +1 -0
  802. package/dist/server/prebuilt/payload-source.d.ts +87 -0
  803. package/dist/server/prebuilt/payload-source.d.ts.map +1 -0
  804. package/dist/server/prebuilt/slots.d.ts +105 -0
  805. package/dist/server/prebuilt/slots.d.ts.map +1 -0
  806. package/dist/server/prebuilt/synthetic-store.d.ts +67 -0
  807. package/dist/server/prebuilt/synthetic-store.d.ts.map +1 -0
  808. package/dist/server/prebuilt-builder.d.ts +121 -0
  809. package/dist/server/prebuilt-builder.d.ts.map +1 -0
  810. package/dist/server/prebuilt-runtime.d.ts +105 -0
  811. package/dist/server/prebuilt-runtime.d.ts.map +1 -0
  812. package/dist/server/primitives.d.ts +114 -90
  813. package/dist/server/primitives.d.ts.map +1 -1
  814. package/dist/server/publish-params.d.ts +33 -0
  815. package/dist/server/publish-params.d.ts.map +1 -0
  816. package/dist/server/react-cache-bridge.d.ts +59 -0
  817. package/dist/server/react-cache-bridge.d.ts.map +1 -0
  818. package/dist/server/react-cache-scope.d.ts +49 -0
  819. package/dist/server/react-cache-scope.d.ts.map +1 -0
  820. package/dist/server/render-timeout.d.ts +66 -0
  821. package/dist/server/render-timeout.d.ts.map +1 -0
  822. package/dist/server/render-utils.d.ts +56 -0
  823. package/dist/server/render-utils.d.ts.map +1 -0
  824. package/dist/server/request-context.d.ts +167 -103
  825. package/dist/server/request-context.d.ts.map +1 -1
  826. package/dist/server/request-dep.d.ts +15 -0
  827. package/dist/server/request-dep.d.ts.map +1 -0
  828. package/dist/server/response-cache-policy.d.ts +3 -0
  829. package/dist/server/response-cache-policy.d.ts.map +1 -0
  830. package/dist/server/response-framing.d.ts +43 -0
  831. package/dist/server/response-framing.d.ts.map +1 -0
  832. package/dist/server/route-element-builder.d.ts +57 -30
  833. package/dist/server/route-element-builder.d.ts.map +1 -1
  834. package/dist/server/route-element-helpers.d.ts +12 -0
  835. package/dist/server/route-element-helpers.d.ts.map +1 -0
  836. package/dist/server/route-handler.d.ts +9 -3
  837. package/dist/server/route-handler.d.ts.map +1 -1
  838. package/dist/server/route-matcher.d.ts +75 -40
  839. package/dist/server/route-matcher.d.ts.map +1 -1
  840. package/dist/server/route-methods.d.ts +23 -0
  841. package/dist/server/route-methods.d.ts.map +1 -0
  842. package/dist/server/route-module-loader.d.ts +37 -0
  843. package/dist/server/route-module-loader.d.ts.map +1 -0
  844. package/dist/server/rsc-cache-key-guard.d.ts +78 -0
  845. package/dist/server/rsc-cache-key-guard.d.ts.map +1 -0
  846. package/dist/server/rsc-entry/action-dispatcher.d.ts +65 -0
  847. package/dist/server/rsc-entry/action-dispatcher.d.ts.map +1 -0
  848. package/dist/server/rsc-entry/action-middleware-runner.d.ts +66 -0
  849. package/dist/server/rsc-entry/action-middleware-runner.d.ts.map +1 -0
  850. package/dist/server/rsc-entry/api-handler.d.ts +19 -3
  851. package/dist/server/rsc-entry/api-handler.d.ts.map +1 -1
  852. package/dist/server/rsc-entry/deny-fallback.d.ts +55 -0
  853. package/dist/server/rsc-entry/deny-fallback.d.ts.map +1 -0
  854. package/dist/server/rsc-entry/error-renderer.d.ts +35 -21
  855. package/dist/server/rsc-entry/error-renderer.d.ts.map +1 -1
  856. package/dist/server/rsc-entry/helpers.d.ts +14 -59
  857. package/dist/server/rsc-entry/helpers.d.ts.map +1 -1
  858. package/dist/server/rsc-entry/index.d.ts +30 -6
  859. package/dist/server/rsc-entry/index.d.ts.map +1 -1
  860. package/dist/server/rsc-entry/render-route.d.ts +55 -0
  861. package/dist/server/rsc-entry/render-route.d.ts.map +1 -0
  862. package/dist/server/rsc-entry/render-signals.d.ts +65 -0
  863. package/dist/server/rsc-entry/render-signals.d.ts.map +1 -0
  864. package/dist/server/rsc-entry/revalidate-renderer.d.ts +98 -0
  865. package/dist/server/rsc-entry/revalidate-renderer.d.ts.map +1 -0
  866. package/dist/server/rsc-entry/rsc-payload.d.ts +38 -11
  867. package/dist/server/rsc-entry/rsc-payload.d.ts.map +1 -1
  868. package/dist/server/rsc-entry/rsc-stream.d.ts +18 -31
  869. package/dist/server/rsc-entry/rsc-stream.d.ts.map +1 -1
  870. package/dist/server/rsc-entry/ssr-bridge.d.ts +7 -2
  871. package/dist/server/rsc-entry/ssr-bridge.d.ts.map +1 -1
  872. package/dist/server/rsc-entry/ssr-renderer.d.ts +52 -8
  873. package/dist/server/rsc-entry/ssr-renderer.d.ts.map +1 -1
  874. package/dist/server/rsc-error-envelope.d.ts +11 -0
  875. package/dist/server/rsc-error-envelope.d.ts.map +1 -0
  876. package/dist/server/safe-load.d.ts +39 -0
  877. package/dist/server/safe-load.d.ts.map +1 -0
  878. package/dist/server/schema-introspection.d.ts +68 -0
  879. package/dist/server/schema-introspection.d.ts.map +1 -0
  880. package/dist/server/sensitive-fields.d.ts +88 -0
  881. package/dist/server/sensitive-fields.d.ts.map +1 -0
  882. package/dist/server/signal-identity.d.ts +49 -0
  883. package/dist/server/signal-identity.d.ts.map +1 -0
  884. package/dist/server/sitemap-generator.d.ts +130 -0
  885. package/dist/server/sitemap-generator.d.ts.map +1 -0
  886. package/dist/server/sitemap-handler.d.ts +22 -0
  887. package/dist/server/sitemap-handler.d.ts.map +1 -0
  888. package/dist/server/skippable-prefix.d.ts +29 -0
  889. package/dist/server/skippable-prefix.d.ts.map +1 -0
  890. package/dist/server/slot-interception.d.ts +80 -0
  891. package/dist/server/slot-interception.d.ts.map +1 -0
  892. package/dist/server/slot-resolver.d.ts +138 -7
  893. package/dist/server/slot-resolver.d.ts.map +1 -1
  894. package/dist/server/slot-subtree-contain.d.ts +54 -0
  895. package/dist/server/slot-subtree-contain.d.ts.map +1 -0
  896. package/dist/server/ssr-bridge-types.d.ts +213 -0
  897. package/dist/server/ssr-bridge-types.d.ts.map +1 -0
  898. package/dist/server/ssr-entry.d.ts +15 -51
  899. package/dist/server/ssr-entry.d.ts.map +1 -1
  900. package/dist/server/ssr-form-state.d.ts +30 -0
  901. package/dist/server/ssr-form-state.d.ts.map +1 -0
  902. package/dist/server/ssr-render.d.ts +42 -12
  903. package/dist/server/ssr-render.d.ts.map +1 -1
  904. package/dist/server/ssr-wrappers.d.ts +92 -0
  905. package/dist/server/ssr-wrappers.d.ts.map +1 -0
  906. package/dist/server/state-tree-diff.d.ts +44 -9
  907. package/dist/server/state-tree-diff.d.ts.map +1 -1
  908. package/dist/server/static-generator.d.ts +112 -0
  909. package/dist/server/static-generator.d.ts.map +1 -0
  910. package/dist/server/static-not-found.d.ts +52 -0
  911. package/dist/server/static-not-found.d.ts.map +1 -0
  912. package/dist/server/status-code-resolver.d.ts +26 -15
  913. package/dist/server/status-code-resolver.d.ts.map +1 -1
  914. package/dist/server/stream-utils.d.ts +93 -0
  915. package/dist/server/stream-utils.d.ts.map +1 -0
  916. package/dist/server/traced-access.d.ts +18 -0
  917. package/dist/server/traced-access.d.ts.map +1 -0
  918. package/dist/server/tracing.d.ts +72 -31
  919. package/dist/server/tracing.d.ts.map +1 -1
  920. package/dist/server/tree-match.d.ts +59 -0
  921. package/dist/server/tree-match.d.ts.map +1 -0
  922. package/dist/server/types.d.ts +90 -8
  923. package/dist/server/types.d.ts.map +1 -1
  924. package/dist/server/utils/element-type.d.ts +50 -0
  925. package/dist/server/utils/element-type.d.ts.map +1 -0
  926. package/dist/server/utils/escape-html.d.ts +14 -0
  927. package/dist/server/utils/escape-html.d.ts.map +1 -0
  928. package/dist/server/version-skew.d.ts +61 -0
  929. package/dist/server/version-skew.d.ts.map +1 -0
  930. package/dist/server/workers-cache-bridge.d.ts +26 -0
  931. package/dist/server/workers-cache-bridge.d.ts.map +1 -0
  932. package/dist/shared/als-slots.d.ts +42 -0
  933. package/dist/shared/als-slots.d.ts.map +1 -0
  934. package/dist/shared/base-path.d.ts +56 -0
  935. package/dist/shared/base-path.d.ts.map +1 -0
  936. package/dist/shared/csrf-reject.d.ts +16 -0
  937. package/dist/shared/csrf-reject.d.ts.map +1 -0
  938. package/dist/shared/dev-span.d.ts +99 -0
  939. package/dist/shared/dev-span.d.ts.map +1 -0
  940. package/dist/shared/error-digest.d.ts +28 -0
  941. package/dist/shared/error-digest.d.ts.map +1 -0
  942. package/dist/shared/flight-base64.d.ts +13 -0
  943. package/dist/shared/flight-base64.d.ts.map +1 -0
  944. package/dist/shared/flight-segment.d.ts +18 -0
  945. package/dist/shared/flight-segment.d.ts.map +1 -0
  946. package/dist/shared/form-state-flight.d.ts +32 -0
  947. package/dist/shared/form-state-flight.d.ts.map +1 -0
  948. package/dist/shared/href-validation.d.ts +49 -0
  949. package/dist/shared/href-validation.d.ts.map +1 -0
  950. package/dist/shared/merge-search-params.d.ts +22 -0
  951. package/dist/shared/merge-search-params.d.ts.map +1 -0
  952. package/dist/shared/param-value.d.ts +104 -0
  953. package/dist/shared/param-value.d.ts.map +1 -0
  954. package/dist/shared/payload-root.d.ts +110 -0
  955. package/dist/shared/payload-root.d.ts.map +1 -0
  956. package/dist/shared/redirect-type.d.ts +17 -0
  957. package/dist/shared/redirect-type.d.ts.map +1 -0
  958. package/dist/shared/rsc-cache-key.d.ts +163 -0
  959. package/dist/shared/rsc-cache-key.d.ts.map +1 -0
  960. package/dist/shared/rsc-error-envelope.d.ts +16 -0
  961. package/dist/shared/rsc-error-envelope.d.ts.map +1 -0
  962. package/dist/shared/rsc-manifest.d.ts +28 -0
  963. package/dist/shared/rsc-manifest.d.ts.map +1 -0
  964. package/dist/shared/rsc-media-type.d.ts +52 -0
  965. package/dist/shared/rsc-media-type.d.ts.map +1 -0
  966. package/dist/shared/rsc-payload-path.d.ts +48 -0
  967. package/dist/shared/rsc-payload-path.d.ts.map +1 -0
  968. package/dist/shared/segment-info.d.ts +66 -0
  969. package/dist/shared/segment-info.d.ts.map +1 -0
  970. package/dist/shared/slot-params.d.ts +52 -0
  971. package/dist/shared/slot-params.d.ts.map +1 -0
  972. package/dist/shared/static-platform-files.d.ts +71 -0
  973. package/dist/shared/static-platform-files.d.ts.map +1 -0
  974. package/dist/shared/status-reason-phrase.d.ts +26 -0
  975. package/dist/shared/status-reason-phrase.d.ts.map +1 -0
  976. package/dist/shims/font-google.d.ts +1 -1
  977. package/dist/shims/font-google.d.ts.map +1 -1
  978. package/dist/shims/font-google.js +41 -0
  979. package/dist/shims/font-google.js.map +1 -0
  980. package/dist/shims/font-local.d.ts +26 -0
  981. package/dist/shims/font-local.d.ts.map +1 -0
  982. package/dist/shims/font-local.js +19 -0
  983. package/dist/shims/font-local.js.map +1 -0
  984. package/dist/shims/headers.d.ts +60 -1
  985. package/dist/shims/headers.d.ts.map +1 -1
  986. package/dist/shims/image.d.ts +120 -120
  987. package/dist/shims/image.d.ts.map +1 -1
  988. package/dist/shims/navigation-client.d.ts +25 -12
  989. package/dist/shims/navigation-client.d.ts.map +1 -1
  990. package/dist/shims/navigation-rsc.d.ts +21 -0
  991. package/dist/shims/navigation-rsc.d.ts.map +1 -0
  992. package/dist/shims/navigation.d.ts +10 -5
  993. package/dist/shims/navigation.d.ts.map +1 -1
  994. package/dist/utils/state-machine.d.ts +80 -0
  995. package/dist/utils/state-machine.d.ts.map +1 -0
  996. package/dist/utils/write-file-atomic.d.ts +17 -0
  997. package/dist/utils/write-file-atomic.d.ts.map +1 -0
  998. package/docs/api/30-api-server.mdx +241 -0
  999. package/docs/api/31-api-client.mdx +225 -0
  1000. package/docs/api/32-api-cache.mdx +341 -0
  1001. package/docs/api/33-api-search-params.mdx +178 -0
  1002. package/docs/api/34-api-config.mdx +421 -0
  1003. package/docs/api/35-api-typescript.mdx +91 -0
  1004. package/docs/api/36-cli.mdx +272 -0
  1005. package/docs/learn/00-introduction.mdx +109 -0
  1006. package/docs/learn/01-quick-start.mdx +94 -0
  1007. package/docs/learn/02-pages-and-layouts.mdx +147 -0
  1008. package/docs/learn/03-fetching-data.mdx +227 -0
  1009. package/docs/learn/04-access-control.mdx +115 -0
  1010. package/docs/learn/05-the-flush-point.mdx +175 -0
  1011. package/docs/learn/06-typed-params.mdx +275 -0
  1012. package/docs/learn/07-typed-routes.mdx +108 -0
  1013. package/docs/learn/08-forms-and-actions.mdx +260 -0
  1014. package/docs/learn/09-streaming.mdx +146 -0
  1015. package/docs/learn/10-caching.mdx +303 -0
  1016. package/docs/learn/11-middleware.mdx +166 -0
  1017. package/docs/learn/12-error-handling.mdx +192 -0
  1018. package/docs/learn/13-deploying.mdx +289 -0
  1019. package/llms.txt +55 -0
  1020. package/package.json +120 -29
  1021. package/src/adapters/build-output-helper.ts +375 -0
  1022. package/src/adapters/canonicalize-module.ts +29 -0
  1023. package/src/adapters/cloudflare-dev.ts +183 -0
  1024. package/src/adapters/cloudflare-kv-cache.ts +203 -0
  1025. package/src/adapters/cloudflare.ts +799 -151
  1026. package/src/adapters/compress-module.ts +110 -86
  1027. package/src/adapters/fs-identity.ts +155 -0
  1028. package/src/adapters/nitro-immutable-assets.ts +142 -0
  1029. package/src/adapters/nitro-presets.ts +139 -0
  1030. package/src/adapters/nitro-preview.ts +565 -0
  1031. package/src/adapters/nitro.ts +349 -448
  1032. package/src/adapters/raw-imports.d.ts +5 -0
  1033. package/src/adapters/shared.ts +314 -0
  1034. package/src/adapters/types.ts +129 -17
  1035. package/src/adapters/wrangler.d.ts +7 -0
  1036. package/src/analyze/chains.ts +411 -0
  1037. package/src/analyze/classify.ts +259 -0
  1038. package/src/analyze/crawl-entry.ts +68 -0
  1039. package/src/analyze/crawl.ts +500 -0
  1040. package/src/analyze/graph-cache.ts +331 -0
  1041. package/src/analyze/graph-command.ts +654 -0
  1042. package/src/analyze/live-graph.ts +232 -0
  1043. package/src/analyze/poison-rules.ts +165 -0
  1044. package/src/analyze/poison-scan.ts +159 -0
  1045. package/src/analyze/scan.ts +149 -0
  1046. package/src/cache/cache-api.ts +113 -0
  1047. package/src/cache/fast-hash.ts +5 -0
  1048. package/src/cache/guarded-read.ts +44 -0
  1049. package/src/cache/handler-store.ts +113 -0
  1050. package/src/cache/index.ts +93 -20
  1051. package/src/cache/invalidation-epoch.ts +105 -0
  1052. package/src/cache/json-lossy-check.ts +69 -0
  1053. package/src/cache/key-discipline.ts +218 -0
  1054. package/src/cache/redis-handler.ts +193 -19
  1055. package/src/cache/singleflight.ts +85 -7
  1056. package/src/cache/sizeof.ts +35 -0
  1057. package/src/cache/stable-stringify.ts +118 -2
  1058. package/src/cache/store.ts +71 -0
  1059. package/src/cache/stores/cloudflare-kv.ts +52 -0
  1060. package/src/cache/stores/memory.ts +125 -0
  1061. package/src/cache/stores/redis.ts +97 -0
  1062. package/src/cache/stores/vercel.ts +59 -0
  1063. package/src/cache/tag-aware-handler.ts +250 -0
  1064. package/src/cache/timber-cache.ts +218 -47
  1065. package/src/cdn/cloudflare-purge.ts +50 -0
  1066. package/src/cdn/fastly-purge.ts +63 -0
  1067. package/src/cdn/headers.ts +153 -0
  1068. package/src/cdn/index.ts +23 -0
  1069. package/src/cdn/purge-store.ts +62 -0
  1070. package/src/cdn/workers-cache-purge.ts +34 -0
  1071. package/src/cli-check.ts +417 -0
  1072. package/src/cli-context.ts +128 -0
  1073. package/src/cli-dev-status.ts +196 -0
  1074. package/src/cli-init.ts +278 -0
  1075. package/src/cli-schema-sync.ts +401 -0
  1076. package/src/cli.ts +308 -84
  1077. package/src/client/browser-dev.ts +192 -5
  1078. package/src/client/browser-entry/action-dispatch.ts +317 -0
  1079. package/src/client/browser-entry/action-queue.ts +152 -0
  1080. package/src/client/browser-entry/form-state.ts +49 -0
  1081. package/src/client/browser-entry/hmr.ts +82 -0
  1082. package/src/client/browser-entry/hydrate.ts +152 -0
  1083. package/src/client/browser-entry/index.ts +153 -0
  1084. package/src/client/browser-entry/post-hydration.ts +99 -0
  1085. package/src/client/browser-entry/router-init.ts +391 -0
  1086. package/src/client/browser-entry/rsc-stream.ts +145 -0
  1087. package/src/client/browser-entry/scroll.ts +50 -0
  1088. package/src/client/deny-last-resort.tsx +54 -0
  1089. package/src/client/dev-pill/index.ts +128 -0
  1090. package/src/client/dev-pill/store.ts +254 -0
  1091. package/src/client/dev-pill/view.ts +326 -0
  1092. package/src/client/error-boundary.tsx +296 -61
  1093. package/src/client/error-reconstituter.tsx +84 -0
  1094. package/src/client/form.tsx +61 -173
  1095. package/src/client/global-context.ts +59 -0
  1096. package/src/client/history.ts +74 -11
  1097. package/src/client/index.ts +91 -53
  1098. package/src/client/internal.ts +54 -0
  1099. package/src/client/link.tsx +464 -151
  1100. package/src/client/location-search.ts +15 -0
  1101. package/src/client/navigation-api.ts +254 -0
  1102. package/src/client/navigation-commit.ts +318 -0
  1103. package/src/client/navigation-context.ts +71 -142
  1104. package/src/client/navigation-root.tsx +237 -0
  1105. package/src/client/navigation-transition.ts +401 -0
  1106. package/src/client/nuqs-adapter.tsx +62 -32
  1107. package/src/client/params-context.ts +175 -0
  1108. package/src/client/react-root.ts +105 -0
  1109. package/src/client/router-effects.ts +349 -0
  1110. package/src/client/router-lifecycle.ts +394 -0
  1111. package/src/client/router-pipeline.ts +443 -0
  1112. package/src/client/router-ref.ts +3 -3
  1113. package/src/client/router-skew.ts +30 -0
  1114. package/src/client/router-types.ts +326 -0
  1115. package/src/client/router-url.ts +32 -0
  1116. package/src/client/router.ts +491 -421
  1117. package/src/client/rsc-fetch.ts +510 -109
  1118. package/src/client/segment-cache.ts +362 -41
  1119. package/src/client/segment-context.ts +7 -4
  1120. package/src/client/segment-outlet.tsx +96 -0
  1121. package/src/client/segment-update-context.ts +23 -0
  1122. package/src/client/shallow-url.ts +22 -0
  1123. package/src/client/slot-content-cache-context.ts +43 -0
  1124. package/src/client/slot-context.ts +39 -0
  1125. package/src/client/slot-outlet.tsx +22 -0
  1126. package/src/client/slot-provider.tsx +32 -0
  1127. package/src/client/ssr-data.ts +27 -67
  1128. package/src/client/stale-client.ts +191 -0
  1129. package/src/client/state.ts +31 -24
  1130. package/src/client/status-page-marker.tsx +32 -0
  1131. package/src/client/top-loader.tsx +13 -10
  1132. package/src/client/unload-guard.ts +35 -3
  1133. package/src/client/use-cookie.ts +93 -29
  1134. package/src/client/use-field-state.ts +144 -0
  1135. package/src/client/use-link-status.ts +7 -7
  1136. package/src/client/use-pathname.ts +22 -31
  1137. package/src/client/use-pending-navigation.ts +119 -0
  1138. package/src/client/use-query-states.ts +206 -36
  1139. package/src/client/use-router.ts +31 -9
  1140. package/src/client/use-search-params.ts +38 -49
  1141. package/src/client/use-segment-params.ts +69 -0
  1142. package/src/client/use-selected-layout-segment.ts +2 -2
  1143. package/src/codec.ts +149 -0
  1144. package/src/config-types.ts +366 -0
  1145. package/src/config-validation.ts +511 -0
  1146. package/src/cookies/define-cookie.ts +186 -53
  1147. package/src/cookies/index.ts +13 -2
  1148. package/src/cookies/json-cookie.ts +105 -0
  1149. package/src/cookies/validation.ts +192 -0
  1150. package/src/dev-tools/404-page.ts +286 -0
  1151. package/src/dev-tools/await-span.ts +69 -0
  1152. package/src/dev-tools/browser-logs.ts +55 -0
  1153. package/src/dev-tools/dev-page-shell.ts +278 -0
  1154. package/src/dev-tools/error-page.ts +331 -0
  1155. package/src/dev-tools/holding-server.ts +185 -0
  1156. package/src/dev-tools/hydration-overlay.ts +158 -0
  1157. package/src/dev-tools/index.ts +79 -0
  1158. package/src/dev-tools/instrumentation.ts +281 -0
  1159. package/src/{server/dev-logger.ts → dev-tools/logger.ts} +36 -88
  1160. package/src/{plugins/dev-logs.ts → dev-tools/logs.ts} +158 -27
  1161. package/src/{plugins/dev-error-overlay.ts → dev-tools/overlay.ts} +25 -80
  1162. package/src/dev-tools/span-sink.ts +132 -0
  1163. package/src/dev-tools/stack-classifier.ts +75 -0
  1164. package/src/dev-tools/terminal.ts +182 -0
  1165. package/src/fonts/ast-walk.ts +235 -0
  1166. package/src/fonts/ast.ts +479 -128
  1167. package/src/fonts/bundle.ts +138 -0
  1168. package/src/fonts/css.ts +1 -1
  1169. package/src/fonts/dev-middleware.ts +85 -0
  1170. package/src/fonts/fallbacks.ts +0 -23
  1171. package/src/fonts/google.ts +101 -19
  1172. package/src/fonts/local.ts +12 -11
  1173. package/src/fonts/paths.ts +58 -0
  1174. package/src/fonts/pipeline.ts +348 -0
  1175. package/src/fonts/transform.ts +311 -0
  1176. package/src/fonts/types.ts +52 -1
  1177. package/src/fonts/virtual-modules.ts +179 -0
  1178. package/src/index.ts +498 -380
  1179. package/src/params/codec-registry.ts +34 -0
  1180. package/src/params/define-schema.ts +115 -0
  1181. package/src/params/index.ts +17 -0
  1182. package/src/params/resolve-schema.ts +84 -0
  1183. package/src/plugin-context.ts +509 -0
  1184. package/src/plugins/build-manifest.ts +189 -36
  1185. package/src/plugins/build-report.ts +299 -87
  1186. package/src/plugins/cache.ts +243 -0
  1187. package/src/plugins/callsite-ast.ts +472 -0
  1188. package/src/plugins/callsite-jsx.ts +243 -0
  1189. package/src/plugins/chunks.ts +74 -5
  1190. package/src/plugins/client-chunks.ts +185 -0
  1191. package/src/plugins/client-dep-entries.ts +124 -0
  1192. package/src/plugins/client-in-server-package-deps.ts +139 -0
  1193. package/src/plugins/cloudflare-wasm.ts +141 -0
  1194. package/src/plugins/content.ts +31 -2
  1195. package/src/plugins/dev-await.ts +415 -0
  1196. package/src/plugins/dev-discovery.ts +428 -0
  1197. package/src/plugins/dev-hostname.ts +322 -0
  1198. package/src/plugins/dev-server.ts +471 -100
  1199. package/src/plugins/dev-store-clear.ts +145 -0
  1200. package/src/plugins/encryption-runtime.ts +31 -0
  1201. package/src/plugins/entries.ts +158 -17
  1202. package/src/plugins/fonts.ts +260 -657
  1203. package/src/plugins/graph-endpoint.ts +544 -0
  1204. package/src/plugins/mdx.ts +108 -35
  1205. package/src/plugins/optimize-package-imports-defaults.ts +88 -0
  1206. package/src/plugins/optimize-package-imports.ts +439 -0
  1207. package/src/plugins/orphaned-modules.ts +78 -0
  1208. package/src/plugins/post-build.ts +327 -0
  1209. package/src/plugins/prebuilt-capture.ts +213 -0
  1210. package/src/plugins/prebuilt-options-analysis.ts +175 -0
  1211. package/src/plugins/prebuilt.ts +679 -0
  1212. package/src/plugins/prerender-sugar.ts +348 -0
  1213. package/src/plugins/react-resolve.ts +149 -0
  1214. package/src/plugins/request-dep/analysis.ts +447 -0
  1215. package/src/plugins/request-dep/index.ts +376 -0
  1216. package/src/plugins/request-dep/origin.ts +310 -0
  1217. package/src/plugins/routing.ts +296 -278
  1218. package/src/plugins/rsc-assets-manifest.ts +251 -0
  1219. package/src/plugins/server-bundle.ts +115 -15
  1220. package/src/plugins/shims.ts +257 -97
  1221. package/src/plugins/static-build.ts +681 -71
  1222. package/src/react-canary.d.ts +2 -0
  1223. package/src/routing/codegen-shared.ts +39 -0
  1224. package/src/routing/codegen-types.ts +62 -0
  1225. package/src/routing/codegen-write.ts +163 -0
  1226. package/src/routing/codegen.ts +349 -232
  1227. package/src/routing/collision-probe.ts +438 -0
  1228. package/src/routing/collision-spaces.ts +281 -0
  1229. package/src/routing/convention-lint.ts +649 -0
  1230. package/src/routing/export-detect.ts +536 -0
  1231. package/src/routing/file-cache.ts +23 -0
  1232. package/src/routing/index.ts +16 -7
  1233. package/src/routing/interception-overlap.ts +141 -0
  1234. package/src/routing/interception.ts +1044 -67
  1235. package/src/routing/link-codegen.ts +280 -0
  1236. package/src/routing/manifest-codegen.ts +232 -0
  1237. package/src/routing/scanner.ts +417 -223
  1238. package/src/routing/schema-validation.ts +155 -0
  1239. package/src/routing/segment-classify.ts +280 -0
  1240. package/src/routing/segment-codegen.ts +99 -0
  1241. package/src/routing/segment-keys.ts +186 -0
  1242. package/src/routing/slot-placement.ts +97 -0
  1243. package/src/routing/types.ts +82 -26
  1244. package/src/routing/walkers.ts +98 -0
  1245. package/src/rsc-runtime/dev-reference-cache.ts +115 -0
  1246. package/src/rsc-runtime/encryption-runtime.ts +78 -0
  1247. package/src/rsc-runtime/render-flight.ts +26 -0
  1248. package/src/rsc-runtime/rsc.ts +35 -5
  1249. package/src/rsc-runtime/server-reference-load-error.ts +16 -0
  1250. package/src/rsc-runtime/server-references.ts +135 -0
  1251. package/src/rsc-runtime/ssr.ts +23 -0
  1252. package/src/rsc-runtime/transforms.ts +13 -0
  1253. package/src/rsc-runtime/vendor-types.d.ts +87 -0
  1254. package/src/schema-bridge.ts +437 -0
  1255. package/src/search-params/define.ts +676 -0
  1256. package/src/search-params/index.ts +14 -20
  1257. package/src/search-params/parse-total.ts +91 -0
  1258. package/src/search-params/serialize-equal.ts +14 -0
  1259. package/src/search-params/wrappers.ts +150 -0
  1260. package/src/server/abort-scope.ts +49 -0
  1261. package/src/server/access-gate.tsx +208 -57
  1262. package/src/server/action-client.ts +175 -294
  1263. package/src/server/action-encryption.ts +144 -0
  1264. package/src/server/action-handler.ts +533 -150
  1265. package/src/server/action-schema.ts +203 -0
  1266. package/src/server/action-types.ts +145 -0
  1267. package/src/server/actions.ts +172 -85
  1268. package/src/server/als-registry.ts +245 -30
  1269. package/src/server/body-limits.ts +10 -2
  1270. package/src/server/build-manifest.ts +33 -57
  1271. package/src/server/canonicalize.ts +62 -3
  1272. package/src/server/chain-url-parts.ts +163 -0
  1273. package/src/server/children-interception.ts +116 -0
  1274. package/src/server/client-error-message.ts +18 -0
  1275. package/src/server/coalesce-tick.ts +75 -0
  1276. package/src/server/compress.ts +91 -19
  1277. package/src/server/cookie-context.ts +462 -0
  1278. package/src/server/cookie-parsing.ts +163 -0
  1279. package/src/server/csp-nonce.ts +58 -0
  1280. package/src/server/csrf.ts +238 -37
  1281. package/src/server/debug.ts +0 -1
  1282. package/src/server/default-logger.ts +100 -0
  1283. package/src/server/default-status-page.ts +88 -0
  1284. package/src/server/deny-boundary.ts +527 -0
  1285. package/src/server/deny-renderer.ts +210 -181
  1286. package/src/server/early-hints-sender.ts +4 -3
  1287. package/src/server/early-hints.ts +39 -29
  1288. package/src/server/error-boundary-wrapper.ts +160 -44
  1289. package/src/server/error-response-headers.ts +18 -0
  1290. package/src/server/fallback-error.ts +88 -104
  1291. package/src/server/flight-injection-state.ts +113 -0
  1292. package/src/server/flight-injector-core.ts +332 -0
  1293. package/src/server/flight-scripts.ts +92 -0
  1294. package/src/server/flight-source-node.ts +434 -0
  1295. package/src/server/flight-source.ts +289 -0
  1296. package/src/server/form-data.ts +191 -20
  1297. package/src/server/form-state-flight.ts +67 -0
  1298. package/src/server/head-response.ts +50 -0
  1299. package/src/server/html-injector-core.ts +320 -0
  1300. package/src/server/html-injectors.ts +241 -285
  1301. package/src/server/index.ts +42 -195
  1302. package/src/server/instrumentation.ts +42 -11
  1303. package/src/server/interception-gates.ts +94 -0
  1304. package/src/server/internal.ts +164 -0
  1305. package/src/server/json-status-response.ts +105 -0
  1306. package/src/server/logger.ts +163 -38
  1307. package/src/server/metadata-collector.ts +175 -0
  1308. package/src/server/metadata-platform.ts +2 -2
  1309. package/src/server/metadata-render.ts +30 -8
  1310. package/src/server/metadata-route-links.ts +200 -0
  1311. package/src/server/metadata-routes.ts +114 -24
  1312. package/src/server/metadata-social.ts +2 -2
  1313. package/src/server/metadata.ts +23 -2
  1314. package/src/server/middleware-runner.ts +32 -5
  1315. package/src/server/node-body-response.ts +236 -0
  1316. package/src/server/node-response.ts +93 -0
  1317. package/src/server/node-stream-transforms.ts +340 -0
  1318. package/src/server/node-streams-platform.ts +23 -0
  1319. package/src/server/param-coercion.ts +223 -0
  1320. package/src/server/pipeline-helpers.ts +554 -0
  1321. package/src/server/pipeline-interception.ts +301 -32
  1322. package/src/server/pipeline-metadata-route.ts +242 -0
  1323. package/src/server/pipeline-metadata.ts +30 -4
  1324. package/src/server/pipeline-outcome.ts +290 -0
  1325. package/src/server/pipeline-phases.ts +443 -0
  1326. package/src/server/pipeline.ts +474 -427
  1327. package/src/server/port-resolution.ts +43 -0
  1328. package/src/server/prebuilt/cache-key.ts +340 -0
  1329. package/src/server/prebuilt/capture-render.ts +122 -0
  1330. package/src/server/prebuilt/capture-routes.ts +104 -0
  1331. package/src/server/prebuilt/capture-state.ts +196 -0
  1332. package/src/server/prebuilt/dev-store.ts +252 -0
  1333. package/src/server/prebuilt/lifetime.ts +151 -0
  1334. package/src/server/prebuilt/manifest-tag-index.ts +46 -0
  1335. package/src/server/prebuilt/overlay.ts +290 -0
  1336. package/src/server/prebuilt/payload-source.ts +221 -0
  1337. package/src/server/prebuilt/slots.ts +201 -0
  1338. package/src/server/prebuilt/synthetic-store.ts +125 -0
  1339. package/src/server/prebuilt-builder.ts +515 -0
  1340. package/src/server/prebuilt-runtime.ts +830 -0
  1341. package/src/server/primitives.ts +167 -171
  1342. package/src/server/publish-params.ts +42 -0
  1343. package/src/server/react-cache-bridge.ts +124 -0
  1344. package/src/server/react-cache-scope.ts +104 -0
  1345. package/src/server/render-timeout.ts +123 -0
  1346. package/src/server/render-utils.ts +70 -0
  1347. package/src/server/request-context.ts +321 -323
  1348. package/src/server/request-dep.ts +37 -0
  1349. package/src/server/response-cache-policy.ts +45 -0
  1350. package/src/server/response-framing.ts +59 -0
  1351. package/src/server/route-element-builder.ts +539 -355
  1352. package/src/server/route-element-helpers.ts +37 -0
  1353. package/src/server/route-handler.ts +78 -48
  1354. package/src/server/route-matcher.ts +251 -265
  1355. package/src/server/route-methods.ts +37 -0
  1356. package/src/server/route-module-loader.ts +161 -0
  1357. package/src/server/rsc-cache-key-guard.ts +122 -0
  1358. package/src/server/rsc-entry/action-dispatcher.ts +146 -0
  1359. package/src/server/rsc-entry/action-middleware-runner.ts +130 -0
  1360. package/src/server/rsc-entry/api-handler.ts +30 -93
  1361. package/src/server/rsc-entry/deny-fallback.ts +151 -0
  1362. package/src/server/rsc-entry/error-renderer.ts +306 -113
  1363. package/src/server/rsc-entry/helpers.ts +90 -115
  1364. package/src/server/rsc-entry/index.ts +417 -350
  1365. package/src/server/rsc-entry/render-route.ts +248 -0
  1366. package/src/server/rsc-entry/render-signals.ts +108 -0
  1367. package/src/server/rsc-entry/revalidate-renderer.ts +349 -0
  1368. package/src/server/rsc-entry/rsc-payload.ts +212 -113
  1369. package/src/server/rsc-entry/rsc-stream.ts +143 -135
  1370. package/src/server/rsc-entry/ssr-bridge.ts +43 -8
  1371. package/src/server/rsc-entry/ssr-renderer.ts +311 -140
  1372. package/src/server/rsc-error-envelope.ts +18 -0
  1373. package/src/server/rsc-prop-warnings.ts +1 -1
  1374. package/src/server/safe-load.ts +53 -0
  1375. package/src/server/schema-introspection.ts +393 -0
  1376. package/src/server/sensitive-fields.ts +287 -0
  1377. package/src/server/server-only-guard-noop.js +3 -0
  1378. package/src/server/server-timing.ts +1 -1
  1379. package/src/server/signal-identity.ts +130 -0
  1380. package/src/server/sitemap-generator.ts +337 -0
  1381. package/src/server/sitemap-handler.ts +150 -0
  1382. package/src/server/skippable-prefix.ts +172 -0
  1383. package/src/server/slot-interception.ts +168 -0
  1384. package/src/server/slot-resolver.ts +747 -300
  1385. package/src/server/slot-subtree-contain.ts +273 -0
  1386. package/src/server/ssr-bridge-types.ts +217 -0
  1387. package/src/server/ssr-entry.ts +246 -109
  1388. package/src/server/ssr-form-state.ts +58 -0
  1389. package/src/server/ssr-render.ts +253 -113
  1390. package/src/server/ssr-wrappers.tsx +152 -0
  1391. package/src/server/state-tree-diff.ts +85 -30
  1392. package/src/server/static-generator.ts +680 -0
  1393. package/src/server/static-not-found.ts +134 -0
  1394. package/src/server/status-code-resolver.ts +107 -148
  1395. package/src/server/stream-utils.ts +398 -0
  1396. package/src/server/traced-access.ts +50 -0
  1397. package/src/server/tracing.ts +274 -128
  1398. package/src/server/tree-match.ts +494 -0
  1399. package/src/server/types.ts +97 -11
  1400. package/src/server/utils/element-type.ts +88 -0
  1401. package/src/server/utils/escape-html.ts +20 -0
  1402. package/src/server/version-skew.ts +104 -0
  1403. package/src/server/waituntil-bridge.ts +1 -1
  1404. package/src/server/workers-cache-bridge.ts +33 -0
  1405. package/src/shared/als-slots.ts +74 -0
  1406. package/src/shared/base-path.ts +80 -0
  1407. package/src/shared/csrf-reject.ts +15 -0
  1408. package/src/shared/dev-span.ts +188 -0
  1409. package/src/shared/error-digest.ts +46 -0
  1410. package/src/shared/flight-base64.ts +23 -0
  1411. package/src/shared/flight-segment.ts +35 -0
  1412. package/src/shared/form-state-flight.ts +59 -0
  1413. package/src/shared/href-validation.ts +159 -0
  1414. package/src/shared/merge-search-params.ts +55 -0
  1415. package/src/shared/param-value.ts +281 -0
  1416. package/src/shared/payload-root.ts +153 -0
  1417. package/src/shared/redirect-type.ts +17 -0
  1418. package/src/shared/rsc-cache-key.ts +269 -0
  1419. package/src/shared/rsc-error-envelope.ts +16 -0
  1420. package/src/shared/rsc-manifest.ts +29 -0
  1421. package/src/shared/rsc-media-type.ts +59 -0
  1422. package/src/shared/rsc-payload-path.ts +52 -0
  1423. package/src/shared/segment-info.ts +67 -0
  1424. package/src/shared/slot-params.ts +109 -0
  1425. package/src/shared/static-platform-files.ts +75 -0
  1426. package/src/shared/status-reason-phrase.ts +61 -0
  1427. package/src/shims/font-google.ts +1 -1
  1428. package/src/shims/font-local.ts +34 -0
  1429. package/src/shims/headers.ts +130 -1
  1430. package/src/shims/navigation-client.ts +36 -32
  1431. package/src/shims/navigation-rsc.ts +47 -0
  1432. package/src/shims/navigation.ts +10 -7
  1433. package/src/utils/state-machine.ts +111 -0
  1434. package/src/utils/write-file-atomic.ts +32 -0
  1435. package/dist/_chunks/als-registry-B7DbZ2hS.js +0 -41
  1436. package/dist/_chunks/als-registry-B7DbZ2hS.js.map +0 -1
  1437. package/dist/_chunks/debug-B3Gypr3D.js +0 -108
  1438. package/dist/_chunks/debug-B3Gypr3D.js.map +0 -1
  1439. package/dist/_chunks/format-RyoGQL74.js +0 -164
  1440. package/dist/_chunks/format-RyoGQL74.js.map +0 -1
  1441. package/dist/_chunks/interception-BOoWmLUA.js +0 -676
  1442. package/dist/_chunks/interception-BOoWmLUA.js.map +0 -1
  1443. package/dist/_chunks/metadata-routes-Cjmvi3rQ.js.map +0 -1
  1444. package/dist/_chunks/request-context-BQUC8PHn.js +0 -330
  1445. package/dist/_chunks/request-context-BQUC8PHn.js.map +0 -1
  1446. package/dist/_chunks/ssr-data-MjmprTmO.js +0 -88
  1447. package/dist/_chunks/ssr-data-MjmprTmO.js.map +0 -1
  1448. package/dist/_chunks/tracing-CemImE6h.js +0 -187
  1449. package/dist/_chunks/tracing-CemImE6h.js.map +0 -1
  1450. package/dist/_chunks/use-cookie-DX-l1_5E.js +0 -91
  1451. package/dist/_chunks/use-cookie-DX-l1_5E.js.map +0 -1
  1452. package/dist/_chunks/use-query-states-D5KaffOK.js +0 -109
  1453. package/dist/_chunks/use-query-states-D5KaffOK.js.map +0 -1
  1454. package/dist/adapters/cloudflare.js.map +0 -1
  1455. package/dist/cache/index.js.map +0 -1
  1456. package/dist/cache/register-cached-function.d.ts +0 -17
  1457. package/dist/cache/register-cached-function.d.ts.map +0 -1
  1458. package/dist/client/browser-entry.d.ts +0 -21
  1459. package/dist/client/browser-entry.d.ts.map +0 -1
  1460. package/dist/client/error-boundary.js.map +0 -1
  1461. package/dist/client/head.d.ts +0 -16
  1462. package/dist/client/head.d.ts.map +0 -1
  1463. package/dist/client/link-status-provider.d.ts +0 -11
  1464. package/dist/client/link-status-provider.d.ts.map +0 -1
  1465. package/dist/client/segment-merger.d.ts +0 -119
  1466. package/dist/client/segment-merger.d.ts.map +0 -1
  1467. package/dist/client/stale-reload.d.ts +0 -44
  1468. package/dist/client/stale-reload.d.ts.map +0 -1
  1469. package/dist/client/transition-root.d.ts +0 -74
  1470. package/dist/client/transition-root.d.ts.map +0 -1
  1471. package/dist/client/types.d.ts +0 -14
  1472. package/dist/client/types.d.ts.map +0 -1
  1473. package/dist/client/use-navigation-pending.d.ts +0 -26
  1474. package/dist/client/use-navigation-pending.d.ts.map +0 -1
  1475. package/dist/client/use-params.d.ts +0 -92
  1476. package/dist/client/use-params.d.ts.map +0 -1
  1477. package/dist/content/index.d.ts +0 -11
  1478. package/dist/content/index.d.ts.map +0 -1
  1479. package/dist/content/index.js +0 -2
  1480. package/dist/plugins/adapter-build.d.ts +0 -18
  1481. package/dist/plugins/adapter-build.d.ts.map +0 -1
  1482. package/dist/plugins/cache-transform.d.ts +0 -36
  1483. package/dist/plugins/cache-transform.d.ts.map +0 -1
  1484. package/dist/plugins/dev-error-overlay.d.ts.map +0 -1
  1485. package/dist/plugins/dev-logs.d.ts.map +0 -1
  1486. package/dist/plugins/dynamic-transform.d.ts +0 -72
  1487. package/dist/plugins/dynamic-transform.d.ts.map +0 -1
  1488. package/dist/plugins/server-action-exports.d.ts +0 -26
  1489. package/dist/plugins/server-action-exports.d.ts.map +0 -1
  1490. package/dist/routing/status-file-lint.d.ts +0 -33
  1491. package/dist/routing/status-file-lint.d.ts.map +0 -1
  1492. package/dist/search-params/analyze.d.ts +0 -54
  1493. package/dist/search-params/analyze.d.ts.map +0 -1
  1494. package/dist/search-params/builtin-codecs.d.ts +0 -105
  1495. package/dist/search-params/builtin-codecs.d.ts.map +0 -1
  1496. package/dist/search-params/codecs.d.ts +0 -53
  1497. package/dist/search-params/codecs.d.ts.map +0 -1
  1498. package/dist/search-params/create.d.ts +0 -106
  1499. package/dist/search-params/create.d.ts.map +0 -1
  1500. package/dist/search-params/registry.d.ts +0 -20
  1501. package/dist/search-params/registry.d.ts.map +0 -1
  1502. package/dist/server/asset-headers.d.ts +0 -42
  1503. package/dist/server/asset-headers.d.ts.map +0 -1
  1504. package/dist/server/client-module-map.d.ts +0 -47
  1505. package/dist/server/client-module-map.d.ts.map +0 -1
  1506. package/dist/server/dev-fetch-instrumentation.d.ts +0 -22
  1507. package/dist/server/dev-fetch-instrumentation.d.ts.map +0 -1
  1508. package/dist/server/dev-logger.d.ts.map +0 -1
  1509. package/dist/server/dev-span-processor.d.ts +0 -29
  1510. package/dist/server/dev-span-processor.d.ts.map +0 -1
  1511. package/dist/server/dev-warnings.d.ts +0 -129
  1512. package/dist/server/dev-warnings.d.ts.map +0 -1
  1513. package/dist/server/flush.d.ts +0 -74
  1514. package/dist/server/flush.d.ts.map +0 -1
  1515. package/dist/server/form-flash.d.ts +0 -78
  1516. package/dist/server/form-flash.d.ts.map +0 -1
  1517. package/dist/server/manifest-status-resolver.d.ts +0 -58
  1518. package/dist/server/manifest-status-resolver.d.ts.map +0 -1
  1519. package/dist/server/nuqs-ssr-provider.d.ts +0 -28
  1520. package/dist/server/nuqs-ssr-provider.d.ts.map +0 -1
  1521. package/dist/server/prerender.d.ts +0 -77
  1522. package/dist/server/prerender.d.ts.map +0 -1
  1523. package/dist/server/tree-builder.d.ts +0 -126
  1524. package/dist/server/tree-builder.d.ts.map +0 -1
  1525. package/dist/utils/directive-parser.d.ts +0 -70
  1526. package/dist/utils/directive-parser.d.ts.map +0 -1
  1527. package/src/cache/register-cached-function.ts +0 -103
  1528. package/src/client/browser-entry.ts +0 -678
  1529. package/src/client/head.ts +0 -61
  1530. package/src/client/link-status-provider.tsx +0 -30
  1531. package/src/client/segment-merger.ts +0 -339
  1532. package/src/client/stale-reload.ts +0 -87
  1533. package/src/client/transition-root.tsx +0 -166
  1534. package/src/client/types.ts +0 -21
  1535. package/src/client/use-navigation-pending.ts +0 -38
  1536. package/src/client/use-params.ts +0 -141
  1537. package/src/content/index.ts +0 -13
  1538. package/src/plugins/adapter-build.ts +0 -118
  1539. package/src/plugins/cache-transform.ts +0 -199
  1540. package/src/plugins/dynamic-transform.ts +0 -161
  1541. package/src/plugins/server-action-exports.ts +0 -220
  1542. package/src/routing/status-file-lint.ts +0 -112
  1543. package/src/search-params/analyze.ts +0 -192
  1544. package/src/search-params/builtin-codecs.ts +0 -228
  1545. package/src/search-params/codecs.ts +0 -153
  1546. package/src/search-params/create.ts +0 -321
  1547. package/src/search-params/registry.ts +0 -31
  1548. package/src/server/asset-headers.ts +0 -81
  1549. package/src/server/client-module-map.ts +0 -58
  1550. package/src/server/dev-fetch-instrumentation.ts +0 -96
  1551. package/src/server/dev-span-processor.ts +0 -78
  1552. package/src/server/dev-warnings.ts +0 -283
  1553. package/src/server/flush.ts +0 -182
  1554. package/src/server/form-flash.ts +0 -89
  1555. package/src/server/manifest-status-resolver.ts +0 -215
  1556. package/src/server/nuqs-ssr-provider.tsx +0 -63
  1557. package/src/server/prerender.ts +0 -139
  1558. package/src/server/tree-builder.ts +0 -382
  1559. package/src/shims/server-only-noop.js +0 -6
  1560. package/src/utils/directive-parser.ts +0 -529
@@ -0,0 +1,2439 @@
1
+ import { n as RENDER_TIMEOUT_CEILING_MS, t as DEFAULT_RENDER_TIMEOUT_MS } from "./render-timeout-MrrqD1wd.js";
2
+ import { n as STATUS_ENDPOINT_PATH, r as devRecordRoot, s as registerDevDiscovery } from "./dev-discovery-YnabkCKD.js";
3
+ import { n as isScannableSourceFile, t as buildSourceExtensions } from "./scan-CyizcBiX.js";
4
+ import "./graph-cache-B1LAg4t7.js";
5
+ import { t as RSC_CONTENT_TYPE } from "./rsc-media-type-m8jz9u6_.js";
6
+ import { o as isMetadataRouteServePath } from "./metadata-routes-BL26HCDd.js";
7
+ import { a as requestTargetUrl, i as canonicalize } from "./canonicalize-CqK135BN.js";
8
+ import { t as PREBUILT_DEV_CLEAR_EVENT } from "./dev-store-BvdqtHvK.js";
9
+ import { t as matchUrlParts } from "./tree-match-Bqdr9szG.js";
10
+ import { loadConfigFromFile, normalizePath } from "vite";
11
+ import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
12
+ import { createRequire } from "node:module";
13
+ import { existsSync, readFileSync, realpathSync, statSync } from "node:fs";
14
+ import "node:http";
15
+ import { Readable, pipeline } from "node:stream";
16
+ import { pipeline as pipeline$1 } from "node:stream/promises";
17
+ import "node:https";
18
+ import "node:http2";
19
+ import { pathToFileURL } from "node:url";
20
+ import { styleText } from "node:util";
21
+ import { X509Certificate } from "node:crypto";
22
+ import { realpath, stat } from "node:fs/promises";
23
+ import { isIP } from "node:net";
24
+ import { constants, createGzip } from "node:zlib";
25
+ // ../../node_modules/.pnpm/srvx@1.0.8/node_modules/srvx/dist/adapters/node.mjs
26
+ function sendNodeResponse(nodeRes, webRes) {
27
+ try {
28
+ return _sendNodeResponse(nodeRes, webRes, false) || Promise.resolve();
29
+ } catch (error) {
30
+ return Promise.reject(error);
31
+ }
32
+ }
33
+ function _sendNodeResponse(nodeRes, webRes, detached) {
34
+ if (!webRes) {
35
+ nodeRes.statusCode = 500;
36
+ return endNodeResponse(nodeRes, detached);
37
+ }
38
+ if (webRes._toNodeResponse) {
39
+ const res = webRes._toNodeResponse();
40
+ if (res.body) {
41
+ if (res.body instanceof ReadableStream) {
42
+ writeHead(nodeRes, res.status, res.statusText, res.headers);
43
+ return streamBody(res.body, nodeRes);
44
+ } else if (typeof res.body?.pipe === "function") return pipeBody(res.body, nodeRes, res.status, res.statusText, res.headers);
45
+ writeHead(nodeRes, res.status, res.statusText, res.headers);
46
+ nodeRes.write(res.body);
47
+ } else writeHead(nodeRes, res.status, res.statusText, res.headers);
48
+ return endNodeResponse(nodeRes, detached);
49
+ }
50
+ const rawHeaders = [];
51
+ for (const [key, value] of webRes.headers) rawHeaders.push(key, value);
52
+ writeHead(nodeRes, webRes.status, webRes.statusText, rawHeaders);
53
+ return webRes.body ? streamBody(webRes.body, nodeRes) : endNodeResponse(nodeRes, detached);
54
+ }
55
+ function writeHead(nodeRes, status, statusText, rawHeaders) {
56
+ if (!nodeRes.headersSent) {
57
+ if (nodeRes.req?.httpVersion === "2.0") nodeRes.writeHead(status, rawHeaders);
58
+ else nodeRes.writeHead(status, safeStatusText(statusText), rawHeaders);
59
+ }
60
+ }
61
+ var INVALID_REASON_PHRASE_RE = /[^\t\u0020-\u007E\u0080-\u00FF]/g;
62
+ function safeStatusText(statusText) {
63
+ return typeof statusText === "string" && statusText ? statusText.replace(INVALID_REASON_PHRASE_RE, "") : statusText;
64
+ }
65
+ function endNodeResponse(nodeRes, detached) {
66
+ if (detached) {
67
+ nodeRes.end();
68
+ return;
69
+ }
70
+ return new Promise((resolve) => nodeRes.end(resolve));
71
+ }
72
+ function pipeBody(stream, nodeRes, status, statusText, headers) {
73
+ if (nodeRes.destroyed) {
74
+ stream.destroy?.();
75
+ return;
76
+ }
77
+ if (nodeRes.req?.method === "HEAD") {
78
+ if (typeof stream.destroy === "function") stream.destroy();
79
+ else stream.abort?.();
80
+ writeHead(nodeRes, status, statusText, headers);
81
+ return endNodeResponse(nodeRes);
82
+ }
83
+ if (typeof stream.on !== "function" || typeof stream.destroy !== "function") {
84
+ writeHead(nodeRes, status, statusText, headers);
85
+ stream.pipe(nodeRes);
86
+ return new Promise((resolve) => nodeRes.on("close", resolve));
87
+ }
88
+ if (stream.readableEnded && !stream.errored) {
89
+ writeHead(nodeRes, status, statusText, headers);
90
+ return endNodeResponse(nodeRes);
91
+ }
92
+ if (stream.destroyed) {
93
+ writeHead(nodeRes, 500, "Internal Server Error", []);
94
+ return endNodeResponse(nodeRes);
95
+ }
96
+ return new Promise((resolve) => {
97
+ function cleanup() {
98
+ stream.off("error", onEarlyError);
99
+ stream.off("readable", onReadable);
100
+ stream.off("end", onEnd);
101
+ nodeRes.off("close", onResClose);
102
+ }
103
+ function onEarlyError() {
104
+ cleanup();
105
+ stream.destroy();
106
+ writeHead(nodeRes, 500, "Internal Server Error", []);
107
+ endNodeResponse(nodeRes).then(resolve);
108
+ }
109
+ function onReadable() {
110
+ cleanup();
111
+ if (nodeRes.destroyed) {
112
+ stream.destroy();
113
+ return resolve();
114
+ }
115
+ writeHead(nodeRes, status, statusText, headers);
116
+ pipeline$1(stream, nodeRes).catch(() => {}).then(() => resolve());
117
+ }
118
+ function onEnd() {
119
+ cleanup();
120
+ if (nodeRes.destroyed) return resolve();
121
+ writeHead(nodeRes, status, statusText, headers);
122
+ endNodeResponse(nodeRes).then(resolve);
123
+ }
124
+ function onResClose() {
125
+ cleanup();
126
+ stream.destroy();
127
+ resolve();
128
+ }
129
+ stream.once("error", onEarlyError);
130
+ stream.once("readable", onReadable);
131
+ stream.once("end", onEnd);
132
+ nodeRes.once("close", onResClose);
133
+ });
134
+ }
135
+ function streamBody(stream, nodeRes) {
136
+ if (nodeRes.destroyed) {
137
+ stream.cancel().catch(() => {});
138
+ return;
139
+ }
140
+ if (nodeRes.req?.method === "HEAD") {
141
+ stream.cancel().catch(() => {});
142
+ return endNodeResponse(nodeRes);
143
+ }
144
+ const reader = stream.getReader();
145
+ function streamCancel(error) {
146
+ reader.cancel(error).catch(() => {});
147
+ if (error) nodeRes.destroy(error);
148
+ }
149
+ function streamHandle({ done, value }) {
150
+ try {
151
+ if (done) nodeRes.end();
152
+ else if (nodeRes.write(value)) reader.read().then(streamHandle, streamCancel);
153
+ else nodeRes.once("drain", () => reader.read().then(streamHandle, streamCancel));
154
+ } catch (error) {
155
+ streamCancel(error instanceof Error ? error : void 0);
156
+ }
157
+ }
158
+ nodeRes.on("close", streamCancel);
159
+ nodeRes.on("error", streamCancel);
160
+ reader.read().then(streamHandle, streamCancel);
161
+ return reader.closed.catch(streamCancel).finally(() => {
162
+ nodeRes.off("close", streamCancel);
163
+ nodeRes.off("error", streamCancel);
164
+ });
165
+ }
166
+ // src/dev-tools/stack-classifier.ts
167
+ /** Parse file/line/col from a stack frame line. */
168
+ function parseFrame(frameLine) {
169
+ const parenMatch = /\(([^)]+):(\d+):(\d+)\)/.exec(frameLine);
170
+ if (parenMatch) return {
171
+ file: parenMatch[1],
172
+ line: Number(parenMatch[2]),
173
+ col: Number(parenMatch[3])
174
+ };
175
+ const bareMatch = /at (\/[^:]+):(\d+):(\d+)/.exec(frameLine);
176
+ if (bareMatch) return {
177
+ file: bareMatch[1],
178
+ line: Number(bareMatch[2]),
179
+ col: Number(bareMatch[3])
180
+ };
181
+ return {};
182
+ }
183
+ /**
184
+ * Classify a single stack frame line by origin.
185
+ *
186
+ * - 'app': user application code (in project root, not node_modules)
187
+ * - 'framework': timber-app internal code
188
+ * - 'internal': node_modules, Node.js internals
189
+ */
190
+ function classifyFrame(frameLine, projectRoot) {
191
+ const trimmed = frameLine.trim();
192
+ if (trimmed.includes("packages/timber-app/")) return "framework";
193
+ if (trimmed.includes("node_modules/")) return "internal";
194
+ if (trimmed.startsWith("at node:") || trimmed.includes("(node:")) return "internal";
195
+ if (trimmed.includes(projectRoot)) return "app";
196
+ return "internal";
197
+ }
198
+ /**
199
+ * Classify all frames in a full stack trace string.
200
+ *
201
+ * Parses the stack, skips the first line (error message), filters to
202
+ * lines starting with "at ", and returns classified frames with optional
203
+ * file/line/col metadata.
204
+ */
205
+ function classifyStack(stack, projectRoot) {
206
+ return stack.split("\n").slice(1).filter((line) => line.trim().startsWith("at ")).map((raw) => {
207
+ const type = classifyFrame(raw, projectRoot);
208
+ const { file, line, col } = parseFrame(raw);
209
+ return {
210
+ raw,
211
+ type,
212
+ file,
213
+ line,
214
+ col
215
+ };
216
+ });
217
+ }
218
+ // src/dev-tools/terminal.ts
219
+ /**
220
+ * Terminal error formatting — boxed, color-coded error output for dev mode.
221
+ *
222
+ * Produces a visually scannable error block with:
223
+ * - Unicode box-drawing border around the error
224
+ * - Phase badge and error message
225
+ * - First app frame highlighted as the primary action item
226
+ * - OSC 8 clickable file:line links (VSCode terminal, iTerm2, etc.)
227
+ * - Internal/framework frames collapsed with a count
228
+ * - Component stack (for React render errors)
229
+ *
230
+ * Dev-only: this module is only imported by dev-error-overlay.ts.
231
+ *
232
+ * Design doc: 21-dev-server.md §"Error Overlay"
233
+ */
234
+ var noValidate = { validateStream: false };
235
+ var style = (fmt, text) => styleText(fmt, text, noValidate);
236
+ /**
237
+ * Wrap text in an OSC 8 hyperlink escape sequence.
238
+ *
239
+ * Terminals that support OSC 8 (VSCode, iTerm2, Windows Terminal, etc.)
240
+ * render this as a clickable link. Others ignore the escape sequences
241
+ * and show the text normally.
242
+ *
243
+ * Format: \x1b]8;;URL\x07TEXT\x1b]8;;\x07
244
+ */
245
+ function hyperlink(text, url) {
246
+ return `\x1b]8;;${url}\x07${text}\x1b]8;;\x07`;
247
+ }
248
+ /**
249
+ * Format a file:line:col reference as a clickable terminal link.
250
+ *
251
+ * Uses file:// URLs so terminals open the file in the configured editor.
252
+ * The link text is styled with cyan + underline for visibility.
253
+ */
254
+ function fileLink(filePath, line, col) {
255
+ const display = line ? `${filePath}:${line}${col ? `:${col}` : ""}` : filePath;
256
+ const base = pathToFileURL(filePath).href;
257
+ return style(["cyan", "underline"], hyperlink(display, line ? `${base}:${line}${col ? `:${col}` : ""}` : base));
258
+ }
259
+ var BOX = {
260
+ topLeft: "╭",
261
+ topRight: "╮",
262
+ bottomLeft: "╰",
263
+ bottomRight: "╯",
264
+ horizontal: "─",
265
+ vertical: "│"
266
+ };
267
+ /**
268
+ * Wrap lines of text in a Unicode box with a colored left border.
269
+ *
270
+ * @param lines - Content lines (no ANSI length calculation — keeps it simple)
271
+ * @param width - Box width (characters). Lines longer than this are not truncated.
272
+ */
273
+ function box(lines, borderFormat, width = 80) {
274
+ const bar = BOX.horizontal.repeat(width - 2);
275
+ const output = [];
276
+ output.push(style(borderFormat, `${BOX.topLeft}${bar}${BOX.topRight}`));
277
+ for (const line of lines) output.push(`${style(borderFormat, BOX.vertical)} ${line}`);
278
+ output.push(style(borderFormat, `${BOX.bottomLeft}${bar}${BOX.bottomRight}`));
279
+ return output.join("\n");
280
+ }
281
+ /**
282
+ * Format an error for terminal output with a boxed layout.
283
+ *
284
+ * The output is designed to be scannable at a glance:
285
+ * 1. Red box with phase badge and error message
286
+ * 2. First app frame as a clickable link (the primary action item)
287
+ * 3. App frames listed normally
288
+ * 4. Internal/framework frames collapsed with count
289
+ * 5. Component stack (if present)
290
+ */
291
+ function formatTerminalError$1(error, phase, projectRoot) {
292
+ const sections = [];
293
+ const componentStack = extractComponentStack(error);
294
+ const loc = parseFirstAppFrame(error.stack ?? "", projectRoot);
295
+ const frames = error.stack ? classifyStack(error.stack, projectRoot) : [];
296
+ const appFrames = frames.filter((f) => f.type === "app");
297
+ const internalCount = frames.filter((f) => f.type !== "app").length;
298
+ const boxLines = [];
299
+ boxLines.push(style(["red", "bold"], `${PHASE_LABELS$1[phase]} Error`));
300
+ boxLines.push("");
301
+ for (const msgLine of error.message.split("\n")) boxLines.push(style("red", msgLine));
302
+ if (loc) {
303
+ boxLines.push("");
304
+ const relPath = loc.file.startsWith(projectRoot) ? loc.file.slice(projectRoot.length + 1) : loc.file;
305
+ boxLines.push(`${style("bold", "→")} ${fileLink(loc.file, loc.line, loc.column)} ${style("dim", `(${relPath})`)}`);
306
+ }
307
+ sections.push(box(boxLines, "red"));
308
+ if (componentStack) {
309
+ sections.push("");
310
+ sections.push(` ${style("bold", "Component Stack:")}`);
311
+ for (const csLine of componentStack.trim().split("\n")) sections.push(` ${style("dim", csLine.trim())}`);
312
+ }
313
+ if (appFrames.length > 0) {
314
+ sections.push("");
315
+ sections.push(` ${style("bold", "Application Frames:")}`);
316
+ for (let i = 0; i < appFrames.length; i++) {
317
+ const f = appFrames[i];
318
+ if (f.file && f.line) {
319
+ const prefix = i === 0 ? style("bold", "▸") : " ";
320
+ sections.push(` ${prefix} ${fileLink(f.file, f.line, f.col)} ${style("dim", extractFnName(f.raw))}`);
321
+ } else sections.push(` ${f.raw}`);
322
+ }
323
+ }
324
+ if (internalCount > 0) sections.push(` ${style("dim", `… ${internalCount} internal frame${internalCount !== 1 ? "s" : ""} hidden`)}`);
325
+ sections.push("");
326
+ return sections.join("\n");
327
+ }
328
+ /** Extract the function name from a stack frame line like " at fnName (/path:1:2)". */
329
+ function extractFnName(frameLine) {
330
+ const match = /at\s+(\S+)\s+\(/.exec(frameLine.trim());
331
+ return match ? match[1] : "";
332
+ }
333
+ // src/dev-tools/overlay.ts
334
+ /** Labels for terminal output. */
335
+ var PHASE_LABELS$1 = {
336
+ "module-transform": "Module Transform",
337
+ "proxy": "Proxy",
338
+ "middleware": "Middleware",
339
+ "access": "Access Check",
340
+ "render": "RSC Render",
341
+ "handler": "Route Handler"
342
+ };
343
+ /**
344
+ * Extract the React component stack from an error, if present.
345
+ * React attaches this as `componentStack` during renderToReadableStream errors.
346
+ */
347
+ function extractComponentStack(error) {
348
+ if (error && typeof error === "object" && "componentStack" in error && typeof error.componentStack === "string") return error.componentStack;
349
+ return null;
350
+ }
351
+ /**
352
+ * Parse the first application frame from a stack trace.
353
+ * Returns file/line/column for the overlay's `loc` field.
354
+ */
355
+ function parseFirstAppFrame(stack, projectRoot) {
356
+ const lines = stack.split("\n");
357
+ const parenRegex = /\(([^)]+):(\d+):(\d+)\)/;
358
+ const bareRegex = /at (\/[^:]+):(\d+):(\d+)/;
359
+ for (const line of lines) {
360
+ if (classifyFrame(line, projectRoot) !== "app") continue;
361
+ const match = parenRegex.exec(line) ?? bareRegex.exec(line);
362
+ if (!match) continue;
363
+ const [, file, lineNum, col] = match;
364
+ if (file && lineNum && col) return {
365
+ file,
366
+ line: parseInt(lineNum, 10),
367
+ column: parseInt(col, 10)
368
+ };
369
+ }
370
+ return null;
371
+ }
372
+ /**
373
+ * Classify the error phase by inspecting the error's stack trace.
374
+ * Falls back to 'render' if no specific phase can be determined.
375
+ */
376
+ function classifyErrorPhase(error, projectRoot) {
377
+ const stack = error.stack ?? "";
378
+ if (extractComponentStack(error)) return "render";
379
+ const appRoot = projectRoot.replace(/\/$/, "");
380
+ if (stack.includes(`${appRoot}/app/`) || stack.includes("/app/")) {
381
+ if (stack.includes("/middleware.ts") || stack.includes("/middleware.js")) return "middleware";
382
+ if (stack.includes("/access.ts") || stack.includes("/access.js")) return "access";
383
+ if (stack.includes("/route.ts") || stack.includes("/route.js")) return "handler";
384
+ }
385
+ return "render";
386
+ }
387
+ var formatTerminalError = formatTerminalError$1;
388
+ /**
389
+ * Send an error to Vite's browser overlay and log it to stderr.
390
+ *
391
+ * Reads `error` and never writes it: the pipeline may render the same object
392
+ * on the fallback error page after reporting it here.
393
+ *
394
+ * The dev server remains running — errors are handled, not fatal.
395
+ */
396
+ function sendErrorToOverlay(server, error, phase, projectRoot) {
397
+ const formatted = formatTerminalError(error, phase, projectRoot);
398
+ process.stderr.write(`${formatted}\n`);
399
+ const loc = parseFirstAppFrame(error.stack ?? "", projectRoot);
400
+ const componentStack = extractComponentStack(error);
401
+ let message = error.message;
402
+ if (componentStack) message = `${error.message}\n\nComponent Stack:\n${componentStack.trim()}`;
403
+ try {
404
+ server.hot.send({
405
+ type: "error",
406
+ err: {
407
+ message,
408
+ stack: error.stack ?? "",
409
+ id: loc?.file,
410
+ plugin: `timber (${PHASE_LABELS$1[phase]})`,
411
+ loc: loc ? {
412
+ file: loc.file,
413
+ line: loc.line,
414
+ column: loc.column
415
+ } : void 0
416
+ }
417
+ });
418
+ } catch (e) {
419
+ console.debug("[timber] overlay error send failed:", e instanceof Error ? e.message : e);
420
+ }
421
+ }
422
+ // src/server/utils/escape-html.ts
423
+ /**
424
+ * Shared HTML escaping utility.
425
+ *
426
+ * Used by both dev-only paths (error pages, 404 page) and production
427
+ * paths (deny-renderer, RSC helpers). Lives in server/utils/ because
428
+ * it's not dev-only.
429
+ */
430
+ /**
431
+ * Escape a string for safe embedding in HTML content or attributes.
432
+ *
433
+ * Replaces `&`, `<`, `>`, and `"` with their HTML entity equivalents.
434
+ */
435
+ function escapeHtml(str) {
436
+ return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
437
+ }
438
+ // src/dev-tools/dev-page-shell.ts
439
+ /**
440
+ * Shared scaffold for dev-mode HTML pages (dev error page, dev 404 page).
441
+ *
442
+ * Both pages are self-contained HTML documents served when the normal
443
+ * render pipeline can't produce a page. They share:
444
+ * - The document scaffold (head, container, footer)
445
+ * - Base CSS (layout, light/dark variables, common components)
446
+ * - The HMR auto-reload script that watches Vite's WebSocket and reloads
447
+ * when the developer fixes the error / adds the missing route
448
+ *
449
+ * Dev-only: this module is only imported by dev-mode code paths. It is
450
+ * never included in production builds.
451
+ *
452
+ * Design doc: 21-dev-server.md §"Error Overlay", §"Dev 404 Page"
453
+ */
454
+ /**
455
+ * Extract HMR connection options from a Vite resolved config.
456
+ * Used by the dev server to pass HMR config to the dev page generators
457
+ * so the auto-reload WebSocket connects to the correct endpoint.
458
+ */
459
+ function extractHmrOptions(config) {
460
+ const hmr = config.server?.hmr;
461
+ if (hmr === false) return void 0;
462
+ const hmrOpts = typeof hmr === "object" ? hmr : {};
463
+ const opts = {
464
+ protocol: hmrOpts.protocol,
465
+ host: hmrOpts.host,
466
+ port: hmrOpts.clientPort || hmrOpts.port,
467
+ path: hmrOpts.path,
468
+ token: config.webSocketToken
469
+ };
470
+ if (!opts.protocol && !opts.host && !opts.port && !opts.path && !opts.token) return;
471
+ return opts;
472
+ }
473
+ /**
474
+ * Build the inline auto-reload script for dev pages.
475
+ *
476
+ * The page is static HTML, not a Vite-managed module, so the normal HMR
477
+ * update flow can't reach it. Instead we connect to Vite's HMR WebSocket
478
+ * directly and reload on any update event.
479
+ *
480
+ * URL construction mirrors Vite's own client.mjs: explicitly configured
481
+ * values win, and the browser's location fills any gaps at runtime. This
482
+ * matters because Vite 8 requires a `?token=` on browser WS upgrades in
483
+ * every config — a config with only a token still needs the host and port
484
+ * from `location` (TIM-1067).
485
+ */
486
+ function buildReloadScript(hmrOptions) {
487
+ return ` (function() {
488
+ try {
489
+ var o = ${JSON.stringify(hmrOptions ?? {}).replace(/</g, "\\u003c")};
490
+ var protocol = o.protocol || (location.protocol === 'https:' ? 'wss' : 'ws');
491
+ var host = o.host || location.hostname;
492
+ var port = o.port || location.port;
493
+ var url = protocol + '://' + host + (port ? ':' + port : '') + (o.path || '')
494
+ + (o.token ? '?token=' + encodeURIComponent(o.token) : '');
495
+ var ws = new WebSocket(url, 'vite-hmr');
496
+ ws.addEventListener('message', function(e) {
497
+ try {
498
+ var data = JSON.parse(e.data);
499
+ if (data.type === 'full-reload' || data.type === 'update') {
500
+ location.reload();
501
+ }
502
+ } catch (ex) {}
503
+ });
504
+ } catch (ex) {}
505
+ })();`;
506
+ }
507
+ /**
508
+ * Render a self-contained dev page: scaffold + shared CSS + footer +
509
+ * HMR auto-reload script.
510
+ */
511
+ function renderDevPageShell(opts) {
512
+ return `<!DOCTYPE html>
513
+ <html lang="en">
514
+ <head>
515
+ <meta charset="utf-8">
516
+ <meta name="viewport" content="width=device-width, initial-scale=1">
517
+ <title>${escapeHtml(opts.title)}</title>
518
+ <style>${SHARED_CSS}${opts.extraCss ?? ""}</style>
519
+ </head>
520
+ <body>
521
+ <div class="container">
522
+ ${opts.bodyHtml}
523
+
524
+ <footer class="footer">
525
+ <span class="timber-logo">🪵 timber.js</span>
526
+ <span class="footer-hint">${opts.footerHint}</span>
527
+ </footer>
528
+ </div>
529
+
530
+ <script>
531
+ ${opts.extraScript ?? ""}
532
+ // Auto-reload when Vite HMR signals an update (file fixed, route added).
533
+ ${buildReloadScript(opts.hmrOptions)}
534
+ <\/script>
535
+ </body>
536
+ </html>`;
537
+ }
538
+ /**
539
+ * Base CSS shared by all dev pages. Pages override the --badge-* variables
540
+ * (and add their own component styles) via `extraCss`.
541
+ */
542
+ var SHARED_CSS = `
543
+ :root {
544
+ --bg: #fff;
545
+ --fg: #1a1a1a;
546
+ --fg-dim: #6b7280;
547
+ --border: #e5e7eb;
548
+ --source-bg: #fafafa;
549
+ --link: #2563eb;
550
+ --code-bg: #f3f4f6;
551
+ --btn-bg: #f3f4f6;
552
+ --btn-fg: #374151;
553
+ --btn-border: #d1d5db;
554
+ --code-font: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
555
+ }
556
+
557
+ @media (prefers-color-scheme: dark) {
558
+ :root {
559
+ --bg: #0a0a0a;
560
+ --fg: #f5f5f5;
561
+ --fg-dim: #9ca3af;
562
+ --border: #27272a;
563
+ --source-bg: #18181b;
564
+ --link: #60a5fa;
565
+ --code-bg: #27272a;
566
+ --btn-bg: #27272a;
567
+ --btn-fg: #e5e7eb;
568
+ --btn-border: #3f3f46;
569
+ }
570
+ }
571
+
572
+ * { margin: 0; padding: 0; box-sizing: border-box; }
573
+
574
+ body {
575
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
576
+ background: var(--bg);
577
+ color: var(--fg);
578
+ line-height: 1.6;
579
+ padding: 2rem;
580
+ }
581
+
582
+ .container { max-width: 56rem; margin: 0 auto; }
583
+ .header { margin-bottom: 1.5rem; }
584
+
585
+ .badge {
586
+ display: inline-block;
587
+ font-size: 0.75rem;
588
+ font-weight: 600;
589
+ text-transform: uppercase;
590
+ letter-spacing: 0.05em;
591
+ padding: 0.25rem 0.625rem;
592
+ border-radius: 0.375rem;
593
+ background: var(--badge-bg);
594
+ color: var(--badge-fg);
595
+ border: 1px solid var(--badge-border);
596
+ margin-bottom: 0.75rem;
597
+ }
598
+
599
+ .message {
600
+ font-size: 1.375rem;
601
+ font-weight: 600;
602
+ line-height: 1.3;
603
+ word-break: break-word;
604
+ }
605
+
606
+ .hint {
607
+ margin-top: 0.5rem;
608
+ color: var(--fg-dim);
609
+ font-size: 0.875rem;
610
+ }
611
+
612
+ .section {
613
+ margin-bottom: 1rem;
614
+ border: 1px solid var(--border);
615
+ border-radius: 0.5rem;
616
+ overflow: hidden;
617
+ }
618
+
619
+ .section-header {
620
+ font-size: 0.75rem;
621
+ font-weight: 600;
622
+ text-transform: uppercase;
623
+ letter-spacing: 0.05em;
624
+ padding: 0.5rem 0.75rem;
625
+ background: var(--source-bg);
626
+ border-bottom: 1px solid var(--border);
627
+ color: var(--fg-dim);
628
+ }
629
+
630
+ .footer {
631
+ display: flex;
632
+ align-items: center;
633
+ gap: 0.75rem;
634
+ padding-top: 1rem;
635
+ border-top: 1px solid var(--border);
636
+ font-size: 0.75rem;
637
+ color: var(--fg-dim);
638
+ }
639
+
640
+ .timber-logo { font-weight: 600; white-space: nowrap; }
641
+ `;
642
+ // src/dev-tools/error-page.ts
643
+ /**
644
+ * Dev error page — self-contained HTML error page for dev server 500s.
645
+ *
646
+ * Generates a styled, self-contained HTML page when the RSC pipeline fails
647
+ * and the Vite error overlay can't fire (e.g., first page load before HMR
648
+ * WebSocket connects, RSC entry module crash, early pipeline errors).
649
+ *
650
+ * This is NOT a replacement for Vite's error overlay — it's the fallback
651
+ * for when the overlay's transport (WebSocket) isn't available yet.
652
+ *
653
+ * Dev-only: this module is only imported by dev-server.ts (apply: 'serve')
654
+ * and via dynamic import from fallback-error.ts in dev mode. It is never
655
+ * included in production builds.
656
+ *
657
+ * Design doc: 21-dev-server.md §"Error Overlay"
658
+ */
659
+ var PHASE_LABELS = {
660
+ "module-transform": "Module Transform",
661
+ "proxy": "Proxy",
662
+ "middleware": "Middleware",
663
+ "access": "Access Check",
664
+ "render": "RSC Render",
665
+ "handler": "Route Handler"
666
+ };
667
+ var PHASE_HINTS = {
668
+ "module-transform": "This error occurred while Vite was transforming a module. Check for syntax errors or missing imports.",
669
+ "proxy": "This error occurred in proxy.ts. Check your proxy configuration.",
670
+ "middleware": "This error occurred in a middleware.ts file. Check the middleware function for unhandled exceptions.",
671
+ "access": "This error occurred in an access.ts file. Check your access control logic.",
672
+ "render": "This error occurred while rendering a server component. Check the component for runtime errors.",
673
+ "handler": "This error occurred in a route handler (route.ts). Check the handler function."
674
+ };
675
+ /**
676
+ * Try to read a few lines of source code around the error location.
677
+ * Returns null if the file can't be read (e.g., virtual modules).
678
+ *
679
+ * Uses a top-level `node:fs` import — this module is dev-server-only and
680
+ * Node-only. A bare `require()` here would throw in the ESM build and the
681
+ * code frame would silently never render (TIM-1067, B48).
682
+ */
683
+ function readSourceContext(filePath, line, contextLines = 3) {
684
+ try {
685
+ const allLines = readFileSync(filePath, "utf-8").split("\n");
686
+ const start = Math.max(0, line - 1 - contextLines);
687
+ const end = Math.min(allLines.length, line + contextLines);
688
+ return {
689
+ startLine: start + 1,
690
+ lines: allLines.slice(start, end).map((text, i) => ({
691
+ num: start + 1 + i,
692
+ text,
693
+ highlight: start + 1 + i === line
694
+ }))
695
+ };
696
+ } catch (e) {
697
+ console.debug("[timber] source context extraction failed:", e instanceof Error ? e.message : e);
698
+ return null;
699
+ }
700
+ }
701
+ var esc = escapeHtml;
702
+ /**
703
+ * Escape a JSON string for safe embedding in an HTML `<script>` block.
704
+ *
705
+ * `JSON.stringify` does not escape `<\/script>`, so error text containing
706
+ * that sequence breaks out of the script block — an XSS vector.
707
+ * We replace all `<` with the equivalent unicode escape, which is valid in
708
+ * JSON strings and prevents the HTML parser from seeing a closing
709
+ * `<\/script>` tag.
710
+ *
711
+ * Security: TIM-788
712
+ */
713
+ function escJsonForScript(json) {
714
+ return json.replace(/</g, "\\u003c");
715
+ }
716
+ /**
717
+ * Generate a self-contained HTML error page for dev server 500 responses.
718
+ *
719
+ * The page includes:
720
+ * - Error message and phase label
721
+ * - Source code context around the first app frame (if readable)
722
+ * - Component stack (for React render errors)
723
+ * - Classified stack trace (app frames highlighted, internals collapsed)
724
+ * - Copy button for the full error
725
+ * - Dark/light mode via prefers-color-scheme
726
+ * - Auto-reconnect script that watches for Vite HMR and reloads
727
+ */
728
+ function generateDevErrorPage(error, phase, projectRoot, hmrOptions) {
729
+ const message = error.message || "Unknown error";
730
+ const phaseLabel = PHASE_LABELS[phase];
731
+ const phaseHint = PHASE_HINTS[phase];
732
+ const componentStack = extractComponentStack(error);
733
+ const loc = parseFirstAppFrame(error.stack ?? "", projectRoot);
734
+ const frames = error.stack ? classifyStack(error.stack, projectRoot) : [];
735
+ const appFrames = frames.filter((f) => f.type === "app");
736
+ const internalFrameCount = frames.filter((f) => f.type !== "app").length;
737
+ let sourceContext = null;
738
+ if (loc) sourceContext = readSourceContext(loc.file, loc.line);
739
+ const relPath = loc?.file.startsWith(projectRoot) ? loc.file.slice(projectRoot.length + 1) : loc?.file;
740
+ const bodyHtml = `<header class="header">
741
+ <div class="badge">${esc(phaseLabel)} Error</div>
742
+ <h1 class="message">${esc(message)}</h1>
743
+ ${phaseHint ? `<p class="hint">${esc(phaseHint)}</p>` : ""}
744
+ </header>
745
+
746
+ ${relPath ? `<div class="location">${esc(relPath)}${loc ? `:${loc.line}:${loc.column}` : ""}</div>` : ""}
747
+
748
+ ${sourceContext ? `<div class="source-context">
749
+ <div class="section-header">Source</div>
750
+ <pre class="source-code"><code>${sourceContext.lines.map((l) => `<span class="source-line${l.highlight ? " source-line-highlight" : ""}"><span class="line-num">${l.num}</span>${esc(l.text)}</span>`).join("\n")}</code></pre>
751
+ </div>` : ""}
752
+
753
+ ${componentStack ? `<div class="section">
754
+ <div class="section-header">Component Stack</div>
755
+ <pre class="component-stack">${esc(componentStack.trim())}</pre>
756
+ </div>` : ""}
757
+
758
+ ${appFrames.length > 0 ? `<div class="section">
759
+ <div class="section-header">Application Frames</div>
760
+ <pre class="stack">${appFrames.map((f) => esc(f.raw)).join("\n")}</pre>
761
+ </div>` : ""}
762
+
763
+ ${internalFrameCount > 0 ? `<details class="section internal-frames">
764
+ <summary class="section-header clickable">${internalFrameCount} internal frame${internalFrameCount !== 1 ? "s" : ""}</summary>
765
+ <pre class="stack dimmed">${frames.filter((f) => f.type !== "app").map((f) => esc(f.raw)).join("\n")}</pre>
766
+ </details>` : ""}
767
+
768
+ <div class="actions">
769
+ <button class="btn" onclick="copyError()">Copy Error</button>
770
+ </div>`;
771
+ const copyScript = ` function copyError() {
772
+ var text = ${escJsonForScript(JSON.stringify(`${phaseLabel} Error: ${message}\n\n` + (relPath ? `File: ${relPath}${loc ? `:${loc.line}:${loc.column}` : ""}\n\n` : "") + (componentStack ? `Component Stack:\n${componentStack.trim()}\n\n` : "") + `Stack Trace:\n${error.stack ?? ""}`))};
773
+ navigator.clipboard.writeText(text).then(function() {
774
+ var btn = document.querySelector('.btn');
775
+ if (btn) { btn.textContent = 'Copied!'; setTimeout(function() { btn.textContent = 'Copy Error'; }, 1500); }
776
+ });
777
+ }
778
+ `;
779
+ return renderDevPageShell({
780
+ title: `Error — ${phaseLabel} | timber.js`,
781
+ extraCss: ERROR_CSS,
782
+ bodyHtml,
783
+ footerHint: "Fix the error and save — the page will reload automatically via HMR.",
784
+ extraScript: copyScript,
785
+ hmrOptions
786
+ });
787
+ }
788
+ var ERROR_CSS = `
789
+ :root {
790
+ --badge-bg: #fef2f2;
791
+ --badge-fg: #991b1b;
792
+ --badge-border: #fecaca;
793
+ --highlight-bg: #fef2f2;
794
+ --highlight-border: #ef4444;
795
+ --line-num: #9ca3af;
796
+ }
797
+
798
+ @media (prefers-color-scheme: dark) {
799
+ :root {
800
+ --badge-bg: #450a0a;
801
+ --badge-fg: #fca5a5;
802
+ --badge-border: #7f1d1d;
803
+ --highlight-bg: #450a0a;
804
+ --highlight-border: #dc2626;
805
+ --line-num: #6b7280;
806
+ }
807
+ }
808
+
809
+ .location {
810
+ font-family: var(--code-font);
811
+ font-size: 0.8125rem;
812
+ color: var(--link);
813
+ margin-bottom: 1rem;
814
+ padding: 0.5rem 0.75rem;
815
+ background: var(--source-bg);
816
+ border-radius: 0.375rem;
817
+ border: 1px solid var(--border);
818
+ }
819
+
820
+ .source-context {
821
+ margin-bottom: 1rem;
822
+ border: 1px solid var(--border);
823
+ border-radius: 0.5rem;
824
+ overflow: hidden;
825
+ }
826
+
827
+ .source-code {
828
+ overflow-x: auto;
829
+ font-family: var(--code-font);
830
+ font-size: 0.8125rem;
831
+ line-height: 1.7;
832
+ padding: 0;
833
+ margin: 0;
834
+ }
835
+
836
+ .source-code code {
837
+ display: block;
838
+ }
839
+
840
+ .source-line {
841
+ display: block;
842
+ padding: 0 0.75rem;
843
+ border-left: 3px solid transparent;
844
+ }
845
+
846
+ .source-line-highlight {
847
+ background: var(--highlight-bg);
848
+ border-left-color: var(--highlight-border);
849
+ }
850
+
851
+ .line-num {
852
+ display: inline-block;
853
+ width: 3rem;
854
+ text-align: right;
855
+ margin-right: 1rem;
856
+ color: var(--line-num);
857
+ user-select: none;
858
+ }
859
+
860
+ .clickable { cursor: pointer; }
861
+ .clickable:hover { background: var(--btn-bg); }
862
+
863
+ .component-stack, .stack {
864
+ font-family: var(--code-font);
865
+ font-size: 0.8125rem;
866
+ line-height: 1.7;
867
+ padding: 0.75rem;
868
+ overflow-x: auto;
869
+ white-space: pre;
870
+ margin: 0;
871
+ }
872
+
873
+ .dimmed { color: var(--fg-dim); }
874
+
875
+ .actions {
876
+ margin: 1.5rem 0;
877
+ }
878
+
879
+ .btn {
880
+ font-family: inherit;
881
+ font-size: 0.8125rem;
882
+ font-weight: 500;
883
+ padding: 0.5rem 1rem;
884
+ border-radius: 0.375rem;
885
+ border: 1px solid var(--btn-border);
886
+ background: var(--btn-bg);
887
+ color: var(--btn-fg);
888
+ cursor: pointer;
889
+ transition: background 0.15s;
890
+ }
891
+
892
+ .btn:hover { opacity: 0.85; }
893
+ `;
894
+ // src/plugins/dev-hostname.ts
895
+ /**
896
+ * Per-app dev hostnames — print and open `<name>.localhost:<port>`.
897
+ *
898
+ * Cookies are not scoped by port, so every app served on `localhost` shares
899
+ * one cookie jar: two apps on :3000 and :3001 overwrite each other's
900
+ * sessions, and service workers stuck to `localhost:3000` carry over to
901
+ * whichever project next gets that port. Browsers resolve
902
+ * `*.localhost` (at any depth) to loopback with no DNS or `/etc/hosts` setup,
903
+ * so giving each app its own name gives it its own cookie jar.
904
+ *
905
+ * This only changes the URL Vite prints, opens, and records for discovery.
906
+ * Nothing is proxied, no `Host` is rewritten, and plain `localhost:<port>`
907
+ * keeps working. Vite's host check already accepts `*.localhost`.
908
+ *
909
+ * See design/21-dev-server.md §"Dev Hostnames" (TIM-1613).
910
+ */
911
+ var LOCALHOST = "localhost";
912
+ var LOCALHOST_SUFFIX = `.${LOCALHOST}`;
913
+ /** RFC 1035 label limit. */
914
+ var MAX_LABEL_LENGTH = 63;
915
+ /** RFC 1035 name limit, `.localhost` included. */
916
+ var MAX_HOSTNAME_LENGTH = 253;
917
+ /**
918
+ * Package names that say nothing about the app: the create-timber-app
919
+ * default (`packages/create-timber-app/src/index.ts`) and the generic names
920
+ * people leave in templates. They would put every unrenamed app on the same
921
+ * hostname, and so the same cookie jar, which is exactly what this
922
+ * feature is for avoiding. The directory name is used instead.
923
+ */
924
+ var PLACEHOLDER_PACKAGE_NAMES = /* @__PURE__ */ new Set([
925
+ "app",
926
+ "my-app",
927
+ "my-timber-app"
928
+ ]);
929
+ var LABEL_RE = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/;
930
+ /**
931
+ * Reduce arbitrary text to one DNS label: lowercase, anything outside
932
+ * `[a-z0-9-]` becomes `-`, runs of `-` collapse, no leading or trailing
933
+ * `-`, at most 63 characters. May return '' when nothing usable is left.
934
+ */
935
+ function sanitizeLabel(raw) {
936
+ return raw.toLowerCase().replace(/[^a-z0-9-]+/g, "-").replace(/-{2,}/g, "-").replace(/^-+/, "").slice(0, MAX_LABEL_LENGTH).replace(/-+$/, "");
937
+ }
938
+ /**
939
+ * Labels for a package name, most specific first: `@acme/web` →
940
+ * `['web', 'acme']` (so `web.acme.localhost`), `example-blog` →
941
+ * `['example-blog']`. Placeholders and non-strings give `[]`.
942
+ */
943
+ function packageNameLabels(name) {
944
+ if (typeof name !== "string") return [];
945
+ if (PLACEHOLDER_PACKAGE_NAMES.has(name.trim().toLowerCase())) return [];
946
+ const scoped = /^@([^/]+)\/(.+)$/.exec(name);
947
+ return (scoped ? [scoped[2], scoped[1]] : [name]).map(sanitizeLabel).filter(Boolean);
948
+ }
949
+ /**
950
+ * Why a `dev.hostname` value is unusable, or null when it is fine. Accepts
951
+ * `false` (opt out: keep plain `localhost`) or a dot-separated sequence of
952
+ * DNS labels, case-insensitively, with or without a trailing `.localhost`.
953
+ */
954
+ function devHostnameError(value) {
955
+ if (value === false) return null;
956
+ if (typeof value !== "string") return `must be a string like "blog" or false, got ${JSON.stringify(value)}.`;
957
+ const labels = stripLocalhost(value.toLowerCase());
958
+ if (labels === "") return `${JSON.stringify(value)} names no app. Use a name like "blog", or false to keep plain localhost.`;
959
+ const bad = labels.split(".").find((label) => !LABEL_RE.test(label));
960
+ if (bad !== void 0) return `${JSON.stringify(value)} is not a valid hostname: label ${JSON.stringify(bad)} must be 1-63 characters of a-z, 0-9 and "-", not starting or ending with "-".`;
961
+ if (labels.length + LOCALHOST_SUFFIX.length > MAX_HOSTNAME_LENGTH) return `${JSON.stringify(value)} is longer than a hostname can be (253 characters with .localhost).`;
962
+ return null;
963
+ }
964
+ function stripLocalhost(name) {
965
+ if (name === LOCALHOST) return "";
966
+ return name.endsWith(LOCALHOST_SUFFIX) ? name.slice(0, -LOCALHOST_SUFFIX.length) : name;
967
+ }
968
+ /**
969
+ * The dev hostname for an app. In order:
970
+ *
971
+ * 1. `dev.hostname`, when set (`false` → plain `localhost`). An invalid value
972
+ * throws; config validation reports it as fatal before this runs.
973
+ * 2. package.json `name`, unless it is a placeholder. Preferred over the
974
+ * directory because it is stable across clones and worktrees, so OAuth
975
+ * callback URLs registered against it keep working, and because monorepo
976
+ * directories are generic (`apps/web` everywhere).
977
+ * 3. The directory name.
978
+ * 4. Plain `localhost`, when nothing usable is left after sanitizing.
979
+ */
980
+ function deriveDevHostname(source) {
981
+ const { override } = source;
982
+ if (override === false) return LOCALHOST;
983
+ if (override !== void 0) {
984
+ const error = devHostnameError(override);
985
+ if (error) throw new Error(`[timber] dev.hostname ${error}`);
986
+ return `${stripLocalhost(override.toLowerCase())}${LOCALHOST_SUFFIX}`;
987
+ }
988
+ let labels = packageNameLabels(source.packageName);
989
+ if (labels.length === 0) labels = [sanitizeLabel(source.dirName)].filter(Boolean);
990
+ return labels.length === 0 ? LOCALHOST : `${labels.join(".")}${LOCALHOST_SUFFIX}`;
991
+ }
992
+ /**
993
+ * `deriveDevHostname` for the app in `appDir` — the directory its
994
+ * `.timber/` lives in (`devRecordRoot`), where its package.json is. A
995
+ * missing or unreadable package.json falls through to the directory name.
996
+ */
997
+ function resolveDevHostname(appDir, override) {
998
+ let packageName;
999
+ try {
1000
+ packageName = JSON.parse(readFileSync(join(appDir, "package.json"), "utf8")).name;
1001
+ } catch {
1002
+ packageName = void 0;
1003
+ }
1004
+ return deriveDevHostname({
1005
+ override,
1006
+ packageName,
1007
+ dirName: basename(appDir)
1008
+ });
1009
+ }
1010
+ /**
1011
+ * A `cert` entry as Vite reads it (`readFileIfExists` in its
1012
+ * `resolveHttpsConfig`): a string is first tried as a file path, resolved
1013
+ * against the cwd, and is PEM text only when no such file can be read.
1014
+ * `config.server.https` keeps the raw option, so the path is read here too.
1015
+ */
1016
+ function certBytes(entry) {
1017
+ if (entry instanceof Uint8Array) return entry;
1018
+ if (typeof entry !== "string") return null;
1019
+ try {
1020
+ return readFileSync(resolve(entry));
1021
+ } catch {
1022
+ return entry;
1023
+ }
1024
+ }
1025
+ /**
1026
+ * Whether a TLS `cert` option (PEM string or Buffer, a path to one, or an
1027
+ * array of them — Node's `tls` shape plus Vite's paths) names `hostname`.
1028
+ * A `pfx`-only config has no `cert` and so keeps `localhost`. An https dev server prints the
1029
+ * named URL only when it does: a trusted certificate issued for `localhost`
1030
+ * alone (mkcert's default) would turn a working URL into a certificate error.
1031
+ */
1032
+ function certCoversHostname(cert, hostname) {
1033
+ return (Array.isArray(cert) ? cert : [cert]).some((entry) => {
1034
+ const pem = certBytes(entry);
1035
+ if (pem === null) return false;
1036
+ try {
1037
+ return new X509Certificate(pem).checkHost(hostname) !== void 0;
1038
+ } catch {
1039
+ return false;
1040
+ }
1041
+ });
1042
+ }
1043
+ /**
1044
+ * The hostname to print for this server, after the https check. `https` is
1045
+ * Vite's resolved `server.https` (undefined for plain http).
1046
+ */
1047
+ function effectiveDevHostname(hostname, https) {
1048
+ if (hostname === LOCALHOST || !https) return hostname;
1049
+ return certCoversHostname(https.cert, hostname) ? hostname : LOCALHOST;
1050
+ }
1051
+ /**
1052
+ * Rename the `localhost` entries of `urls.local` to `hostname`. Only those:
1053
+ * an explicit loopback IP (`host: '127.0.0.1'`) is what the developer asked
1054
+ * to see, certificate-derived names already name a host, and network URLs
1055
+ * are other machines' way in. Idempotent: a renamed URL is no longer a
1056
+ * `localhost` URL.
1057
+ */
1058
+ function withDevHostname(urls, hostname) {
1059
+ if (hostname === LOCALHOST) return urls;
1060
+ const local = urls.local.map((href) => {
1061
+ const url = new URL(href);
1062
+ if (url.hostname !== LOCALHOST) return href;
1063
+ url.hostname = hostname;
1064
+ return url.href;
1065
+ });
1066
+ return {
1067
+ ...urls,
1068
+ local: [...new Set(local)]
1069
+ };
1070
+ }
1071
+ /**
1072
+ * The same URL through plain `localhost`: what a non-browser HTTP client can
1073
+ * reach. Browsers and curl resolve `*.localhost` themselves, but Node, Python
1074
+ * and other clients ask the OS, and not every resolver (glibc without
1075
+ * systemd-resolved) maps `*.localhost` to loopback. The server answers both
1076
+ * names, so only the hostname changes. Other URLs are returned unchanged.
1077
+ *
1078
+ * Under https the swap also has to survive TLS hostname verification: a
1079
+ * certificate issued for `blog.localhost` alone fails for `localhost`
1080
+ * (`ERR_TLS_CERT_ALTNAME_INVALID`), so the named URL is kept unless the
1081
+ * certificate covers `localhost` too. `https` is Vite's `server.https`.
1082
+ */
1083
+ function loopbackUrl(href, https) {
1084
+ const url = new URL(href);
1085
+ if (!url.hostname.endsWith(LOCALHOST_SUFFIX)) return href;
1086
+ if (url.protocol === "https:" && !certCoversHostname(https?.cert, LOCALHOST)) return href;
1087
+ url.hostname = LOCALHOST;
1088
+ return url.href;
1089
+ }
1090
+ /**
1091
+ * The URL a server is opened at, after the rename: Vite's own choice, as its
1092
+ * `getServerUrlByHost` makes it for `server.open` — the first URL containing
1093
+ * a string `server.host`, else `local[0]`, else `network[0]`. The discovery
1094
+ * record stores this, so `timber dev status` reports the URL Vite opens.
1095
+ */
1096
+ function primaryServerUrl(urls, hostname, serverHost) {
1097
+ if (!urls) return void 0;
1098
+ const named = withDevHostname(urls, hostname);
1099
+ const all = [...named.local, ...named.network];
1100
+ return (typeof serverHost === "string" ? all.find((url) => url.includes(serverHost)) : void 0) ?? named.local[0] ?? named.network[0];
1101
+ }
1102
+ /**
1103
+ * The record's URLs, computed by the server, which alone knows its
1104
+ * certificate. `server` is Vite's resolved `server` config.
1105
+ */
1106
+ function advertisedUrls(urls, hostname, server) {
1107
+ const url = primaryServerUrl(urls, hostname, server?.host);
1108
+ return url === void 0 ? void 0 : {
1109
+ url,
1110
+ loopbackUrl: loopbackUrl(url, server?.https)
1111
+ };
1112
+ }
1113
+ /**
1114
+ * Resolve the app's dev hostname and rename the printed/opened URL once the
1115
+ * server is listening. Returns the hostname so the discovery record can
1116
+ * describe the same URL (`primaryServerUrl`).
1117
+ *
1118
+ * Vite assigns `resolvedUrls` in a `listening` listener it *prepends* in
1119
+ * `listen()`, after every `configureServer` hook has run, so this listener
1120
+ * always sees them; `printUrls()` and `openBrowser()` run after `listen()`
1121
+ * resolves. Middleware mode has no `httpServer` and prints nothing.
1122
+ */
1123
+ function applyDevHostname(server, appDir, override) {
1124
+ const hostname = effectiveDevHostname(resolveDevHostname(appDir, override), server.config.server?.https);
1125
+ if (server.httpServer && hostname !== LOCALHOST) server.httpServer.on("listening", () => {
1126
+ if (server.resolvedUrls) server.resolvedUrls = withDevHostname(server.resolvedUrls, hostname);
1127
+ });
1128
+ return hostname;
1129
+ }
1130
+ // src/config-validation.ts
1131
+ /**
1132
+ * Config validation — validates timber.config.ts at startup.
1133
+ *
1134
+ * Runs in the plugin's configResolved hook (once, at startup/build).
1135
+ * Each check produces a clear error message with the invalid value,
1136
+ * what's expected, and how to fix it.
1137
+ *
1138
+ * Design doc: 18-build-system.md
1139
+ */
1140
+ var knownKeys = new Set(Object.keys({
1141
+ output: true,
1142
+ debug: true,
1143
+ clientJavascript: true,
1144
+ adapter: true,
1145
+ allowedOrigins: true,
1146
+ csrf: true,
1147
+ limits: true,
1148
+ forms: true,
1149
+ pageExtensions: true,
1150
+ optimizePackageImports: true,
1151
+ slowRequestMs: true,
1152
+ renderTimeoutMs: true,
1153
+ devBrowserLogs: true,
1154
+ dev: true,
1155
+ serverTiming: true,
1156
+ appDir: true,
1157
+ mdx: true,
1158
+ actionEncryption: true,
1159
+ reactCompiler: true,
1160
+ sitemap: true,
1161
+ buildDir: true,
1162
+ cache: true,
1163
+ clientSegmentCache: true,
1164
+ topLoader: true,
1165
+ budget: true
1166
+ }));
1167
+ /**
1168
+ * Validate a TimberUserConfig object.
1169
+ *
1170
+ * Returns an array of errors. Empty array means the config is valid.
1171
+ * Does not throw — the caller decides how to surface errors.
1172
+ */
1173
+ function validateConfig(config) {
1174
+ const errors = [];
1175
+ if (config.output !== void 0 && config.output !== "server" && config.output !== "static") errors.push({
1176
+ field: "output",
1177
+ message: `Invalid output mode: "${String(config.output)}". Must be "server" or "static".`,
1178
+ value: config.output,
1179
+ suggestion: "Use output: \"server\" (default) or output: \"static\" for static site generation."
1180
+ });
1181
+ if (config.pageExtensions !== void 0) {
1182
+ if (!Array.isArray(config.pageExtensions)) errors.push({
1183
+ field: "pageExtensions",
1184
+ message: "pageExtensions must be an array of strings.",
1185
+ value: config.pageExtensions,
1186
+ suggestion: "Example: pageExtensions: [\"tsx\", \"ts\", \"jsx\", \"js\", \"mdx\"]"
1187
+ });
1188
+ else for (const ext of config.pageExtensions) {
1189
+ if (typeof ext !== "string") {
1190
+ errors.push({
1191
+ field: "pageExtensions",
1192
+ message: `pageExtensions contains a non-string value: ${JSON.stringify(ext)}`,
1193
+ value: ext
1194
+ });
1195
+ break;
1196
+ }
1197
+ if (ext.startsWith(".")) {
1198
+ errors.push({
1199
+ field: "pageExtensions",
1200
+ message: `pageExtensions should not include the leading dot: "${ext}"`,
1201
+ value: ext,
1202
+ suggestion: `Use "${ext.slice(1)}" instead of "${ext}".`
1203
+ });
1204
+ break;
1205
+ }
1206
+ }
1207
+ }
1208
+ if (config.optimizePackageImports !== void 0) {
1209
+ const list = config.optimizePackageImports;
1210
+ const badIndex = Array.isArray(list) ? list.findIndex((entry) => typeof entry !== "string" || entry.trim() === "") : -1;
1211
+ if (!Array.isArray(list) || badIndex !== -1) {
1212
+ const value = Array.isArray(list) ? list[badIndex] : list;
1213
+ errors.push({
1214
+ field: "optimizePackageImports",
1215
+ message: Array.isArray(list) ? `optimizePackageImports contains an invalid entry: ${String(JSON.stringify(value))}` : "optimizePackageImports must be an array of import specifiers.",
1216
+ value,
1217
+ suggestion: "Example: optimizePackageImports: [\"@acme/icons\", \"react-icons/fa\"]"
1218
+ });
1219
+ }
1220
+ }
1221
+ if (config.allowedOrigins !== void 0) {
1222
+ if (!Array.isArray(config.allowedOrigins)) errors.push({
1223
+ field: "allowedOrigins",
1224
+ message: "allowedOrigins must be an array of origin strings.",
1225
+ value: config.allowedOrigins,
1226
+ fatal: true,
1227
+ suggestion: "Example: allowedOrigins: [\"https://app.example.com\"]"
1228
+ });
1229
+ else for (const entry of config.allowedOrigins) {
1230
+ const error = allowedOriginError(entry);
1231
+ if (error) errors.push(error);
1232
+ }
1233
+ }
1234
+ if (config.slowRequestMs !== void 0) {
1235
+ if (typeof config.slowRequestMs !== "number" || config.slowRequestMs < 0) errors.push({
1236
+ field: "slowRequestMs",
1237
+ message: `slowRequestMs must be a non-negative number (got ${JSON.stringify(config.slowRequestMs)}).`,
1238
+ value: config.slowRequestMs,
1239
+ suggestion: "Use slowRequestMs: 3000 (default) or slowRequestMs: 0 to disable."
1240
+ });
1241
+ }
1242
+ if (config.renderTimeoutMs !== void 0) {
1243
+ if (typeof config.renderTimeoutMs !== "number" || config.renderTimeoutMs < 0) errors.push({
1244
+ field: "renderTimeoutMs",
1245
+ message: `renderTimeoutMs must be a non-negative number (got ${JSON.stringify(config.renderTimeoutMs)}).`,
1246
+ value: config.renderTimeoutMs,
1247
+ suggestion: `Use renderTimeoutMs: ${DEFAULT_RENDER_TIMEOUT_MS} (default). Setting 0 uses a ${RENDER_TIMEOUT_CEILING_MS / 1e3}s safety ceiling.`
1248
+ });
1249
+ }
1250
+ if (config.serverTiming !== void 0) {
1251
+ if (config.serverTiming !== "detailed" && config.serverTiming !== "total" && config.serverTiming !== false) errors.push({
1252
+ field: "serverTiming",
1253
+ message: `Invalid serverTiming value: ${JSON.stringify(config.serverTiming)}.`,
1254
+ value: config.serverTiming,
1255
+ suggestion: "Use \"detailed\", \"total\", or false."
1256
+ });
1257
+ }
1258
+ if (config.devBrowserLogs !== void 0) {
1259
+ const valid = [
1260
+ "error",
1261
+ "warn",
1262
+ "info",
1263
+ "none"
1264
+ ];
1265
+ if (!valid.includes(config.devBrowserLogs)) errors.push({
1266
+ field: "devBrowserLogs",
1267
+ message: `Invalid devBrowserLogs value: ${JSON.stringify(config.devBrowserLogs)}.`,
1268
+ value: config.devBrowserLogs,
1269
+ suggestion: `Use one of: ${valid.map((v) => `"${v}"`).join(", ")}.`
1270
+ });
1271
+ }
1272
+ if (config.dev?.requestPill !== void 0 && typeof config.dev.requestPill !== "boolean") errors.push({
1273
+ field: "dev.requestPill",
1274
+ message: `dev.requestPill must be a boolean, got ${JSON.stringify(config.dev.requestPill)}.`,
1275
+ value: config.dev.requestPill,
1276
+ suggestion: "Use dev: { requestPill: false } to turn the dev request pill off."
1277
+ });
1278
+ if (config.dev?.hostname !== void 0) {
1279
+ const problem = devHostnameError(config.dev.hostname);
1280
+ if (problem) errors.push({
1281
+ field: "dev.hostname",
1282
+ message: `dev.hostname ${problem}`,
1283
+ value: config.dev.hostname,
1284
+ suggestion: "Use DNS labels separated by dots, e.g. dev: { hostname: \"blog\" } for blog.localhost, or false to keep plain localhost."
1285
+ });
1286
+ }
1287
+ if (config.sitemap != null && typeof config.sitemap === "object") {
1288
+ if (config.sitemap.enabled && !config.sitemap.baseUrl) errors.push({
1289
+ field: "sitemap.baseUrl",
1290
+ message: "sitemap.baseUrl is required when sitemap is enabled.",
1291
+ suggestion: "Add sitemap: { enabled: true, baseUrl: \"https://example.com\" }."
1292
+ });
1293
+ if (config.sitemap.defaultPriority !== void 0 && (config.sitemap.defaultPriority < 0 || config.sitemap.defaultPriority > 1)) errors.push({
1294
+ field: "sitemap.defaultPriority",
1295
+ message: `sitemap.defaultPriority must be between 0.0 and 1.0 (got ${config.sitemap.defaultPriority}).`,
1296
+ value: config.sitemap.defaultPriority
1297
+ });
1298
+ }
1299
+ if (config.budget != null && typeof config.budget === "object") {
1300
+ if (config.budget.firstLoadJs !== void 0 && (typeof config.budget.firstLoadJs !== "number" || config.budget.firstLoadJs <= 0)) errors.push({
1301
+ field: "budget.firstLoadJs",
1302
+ message: `budget.firstLoadJs must be a positive number in bytes (got ${JSON.stringify(config.budget.firstLoadJs)}).`,
1303
+ value: config.budget.firstLoadJs,
1304
+ suggestion: "Example: budget: { firstLoadJs: 150_000 } for a ~150 kB limit."
1305
+ });
1306
+ }
1307
+ if (config.cache != null && typeof config.cache === "object") {
1308
+ if (config.cache.strictKeyDiscipline !== void 0 && typeof config.cache.strictKeyDiscipline !== "boolean") errors.push({
1309
+ field: "cache.strictKeyDiscipline",
1310
+ message: `cache.strictKeyDiscipline must be a boolean (got ${JSON.stringify(config.cache.strictKeyDiscipline)}).`,
1311
+ value: config.cache.strictKeyDiscipline,
1312
+ suggestion: "Use cache: { strictKeyDiscipline: true } to promote key-discipline warnings to errors."
1313
+ });
1314
+ }
1315
+ const MOVED_TO_CACHE_FILE = /* @__PURE__ */ new Set(["cacheHandler", "cdnPurge"]);
1316
+ for (const key of Object.keys(config)) if (!knownKeys.has(key)) errors.push({
1317
+ field: key,
1318
+ message: `Unknown config option: "${key}".`,
1319
+ suggestion: MOVED_TO_CACHE_FILE.has(key) ? `"${key}" has moved to timber.cache.ts. Export cacheHandler as default, cdnPurge as a named export.` : `Check for typos. Known options: ${[...knownKeys].sort().join(", ")}.`
1320
+ });
1321
+ return errors;
1322
+ }
1323
+ /**
1324
+ * Why one `allowedOrigins` entry can never match, or null when it can.
1325
+ *
1326
+ * The CSRF check compares entries to the request's `Origin` header by
1327
+ * exact string, and browsers send only the canonical form — scheme, host,
1328
+ * and non-default port, lowercased, no path. So an entry that is not its
1329
+ * own `new URL(x).origin` (`https://example.com/`, `https://Example.com`,
1330
+ * `example.com`) silently matches nothing. `"null"` is refused outright:
1331
+ * it is the `Origin` of every opaque context at once.
1332
+ */
1333
+ function allowedOriginError(entry) {
1334
+ const field = "allowedOrigins";
1335
+ const fatal = true;
1336
+ if (typeof entry !== "string") return {
1337
+ field,
1338
+ message: `allowedOrigins contains a non-string value: ${JSON.stringify(entry)}.`,
1339
+ value: entry,
1340
+ fatal
1341
+ };
1342
+ if (entry === "null") return {
1343
+ field,
1344
+ message: "allowedOrigins cannot contain \"null\". Browsers send Origin: null from every opaque context — sandboxed iframes (an attacker's <iframe sandbox> included), POSTs redirected across origins, and file: pages — so allowing it allows all of them.",
1345
+ value: entry,
1346
+ suggestion: "To accept a cross-site POST on one endpoint, handle it in a route.ts that exports `const csrf = false` instead.",
1347
+ fatal
1348
+ };
1349
+ if (entry.includes("*")) return {
1350
+ field,
1351
+ message: `allowedOrigins entry ${JSON.stringify(entry)} uses a wildcard. Matching is exact; wildcards are not supported.`,
1352
+ value: entry,
1353
+ suggestion: "List each origin, e.g. [\"https://app.example.com\", \"https://admin.example.com\"].",
1354
+ fatal
1355
+ };
1356
+ const canonical = canonicalOrigin(entry) ?? canonicalOrigin(`https://${entry}`);
1357
+ if (canonical === entry) return null;
1358
+ return {
1359
+ field,
1360
+ message: `allowedOrigins entry ${JSON.stringify(entry)} is not a canonical origin, so it can never match a request's Origin header.`,
1361
+ value: entry,
1362
+ suggestion: canonical ? `Did you mean "${canonical}"? An origin is scheme://host[:port] — lowercase, no path or trailing slash.` : "An origin is scheme://host[:port], e.g. \"https://app.example.com\".",
1363
+ fatal
1364
+ };
1365
+ }
1366
+ /** `new URL(x).origin` for an http(s) URL, or null. Opaque origins are not origins here. */
1367
+ function canonicalOrigin(value) {
1368
+ try {
1369
+ const url = new URL(value);
1370
+ return url.protocol === "http:" || url.protocol === "https:" ? url.origin : null;
1371
+ } catch {
1372
+ return null;
1373
+ }
1374
+ }
1375
+ var RED = "\x1B[31m";
1376
+ var BOLD = "\x1B[1m";
1377
+ var DIM = "\x1B[2m";
1378
+ var RESET = "\x1B[0m";
1379
+ /**
1380
+ * Format config errors for terminal output. Pass `color: false` for text
1381
+ * that goes into a thrown `Error` — escapes there reach CI logs and the
1382
+ * Vite overlay as raw bytes.
1383
+ */
1384
+ function formatConfigErrors(errors, { color = true } = {}) {
1385
+ if (errors.length === 0) return "";
1386
+ const [red, bold, dim, reset] = color ? [
1387
+ RED,
1388
+ BOLD,
1389
+ DIM,
1390
+ RESET
1391
+ ] : [
1392
+ "",
1393
+ "",
1394
+ "",
1395
+ ""
1396
+ ];
1397
+ const lines = [];
1398
+ lines.push(`${red}${bold}[timber]${reset} ${red}${errors.length} config error${errors.length !== 1 ? "s" : ""} in timber.config.ts:${reset}`);
1399
+ for (const err of errors) {
1400
+ lines.push("");
1401
+ lines.push(` ${red}✗${reset} ${bold}${err.field}${reset}: ${err.message}`);
1402
+ if (err.suggestion) lines.push(` ${dim}${err.suggestion}${reset}`);
1403
+ }
1404
+ return lines.join("\n");
1405
+ }
1406
+ /**
1407
+ * Surface config errors at startup: non-fatal ones are written to stderr
1408
+ * (Vite may still work partially, and the message guides the fix); fatal
1409
+ * ones then stop startup with a thrown error. Non-fatal errors are written
1410
+ * first so a fatal one does not hide them.
1411
+ */
1412
+ function reportConfigErrors(errors, write = (text) => process.stderr.write(text)) {
1413
+ const warnings = errors.filter((e) => !e.fatal);
1414
+ if (warnings.length > 0) write(`${formatConfigErrors(warnings)}\n\n`);
1415
+ const fatal = errors.filter((e) => e.fatal);
1416
+ if (fatal.length > 0) throw new Error(formatConfigErrors(fatal, { color: false }));
1417
+ }
1418
+ var VIRTUAL_MODULE_NAMES = {
1419
+ "virtual:timber-rsc-entry": "RSC entry (server component handler)",
1420
+ "virtual:timber-ssr-entry": "SSR entry (HTML renderer)",
1421
+ "virtual:timber-browser-entry": "Browser entry (client hydration)",
1422
+ "virtual:timber-config": "Runtime config (timber.config.ts)",
1423
+ "virtual:timber-route-manifest": "Route manifest (app/ file tree)",
1424
+ "virtual:timber-instrumentation": "Instrumentation (instrumentation.ts)",
1425
+ "virtual:timber-cache-handler": "Cache handler (timber.cache.ts)",
1426
+ "virtual:timber-build-manifest": "Build manifest (asset mapping)"
1427
+ };
1428
+ /**
1429
+ * Add timber-specific context to an error message that references virtual modules.
1430
+ *
1431
+ * If the error message contains a `virtual:timber-*` ID, appends a
1432
+ * human-readable explanation. Does not replace the original message.
1433
+ */
1434
+ function addVirtualModuleContext(errorMessage) {
1435
+ for (const [id, name] of Object.entries(VIRTUAL_MODULE_NAMES)) if (errorMessage.includes(id)) return `${errorMessage}\n\n [timber] This error references "${id}" — timber's ${name}.\n This is an internal module. The issue is likely in your app code or timber configuration.`;
1436
+ return errorMessage;
1437
+ }
1438
+ /**
1439
+ * Required (non-optional) peer dependencies that must be installed.
1440
+ */
1441
+ var REQUIRED_PEERS = [
1442
+ "react",
1443
+ "react-dom",
1444
+ "@vitejs/plugin-react",
1445
+ "@vitejs/plugin-rsc"
1446
+ ];
1447
+ /**
1448
+ * Check that required peer dependencies are installed.
1449
+ *
1450
+ * Uses require.resolve with a try/catch — no fs scanning.
1451
+ * Returns only the missing packages.
1452
+ */
1453
+ function checkPeerDependencies(projectRoot) {
1454
+ const results = [];
1455
+ const userRequire = createRequire(`${projectRoot}/package.json`);
1456
+ for (const name of REQUIRED_PEERS) try {
1457
+ userRequire.resolve(name);
1458
+ results.push({
1459
+ name,
1460
+ status: "ok"
1461
+ });
1462
+ } catch {
1463
+ results.push({
1464
+ name,
1465
+ status: "missing"
1466
+ });
1467
+ }
1468
+ return results;
1469
+ }
1470
+ /**
1471
+ * Format missing peer dependencies as an actionable warning.
1472
+ */
1473
+ function formatMissingPeers(results) {
1474
+ const missing = results.filter((r) => r.status === "missing");
1475
+ if (missing.length === 0) return "";
1476
+ const names = missing.map((r) => r.name);
1477
+ const lines = [];
1478
+ lines.push(`${RED}${BOLD}[timber]${RESET} ${RED}Missing required dependencies:${RESET}`);
1479
+ lines.push("");
1480
+ for (const name of names) lines.push(` ${RED}✗${RESET} ${name}`);
1481
+ lines.push("");
1482
+ lines.push(` ${DIM}Install with:${RESET}`);
1483
+ lines.push(` ${BOLD}pnpm add ${names.join(" ")}${RESET}`);
1484
+ return lines.join("\n");
1485
+ }
1486
+ /** HMR custom event name for graph-affecting file changes. */
1487
+ var GRAPH_UPDATE_EVENT = "timber:graph-update";
1488
+ /**
1489
+ * Host-header allowlist check, ported branch-for-branch from Vite's
1490
+ * host-validation middleware (`isHostAllowedWithoutCache`) so this
1491
+ * endpoint's reachability matches the rest of the dev server:
1492
+ *
1493
+ * - `allowedHosts: true` allows everything
1494
+ * - a MISSING Host header is allowed (Vite parity — HTTP/1.0 probes)
1495
+ * - any IP-literal host is allowed (`vite --host` LAN access sends
1496
+ * `Host: 192.168.x.x:port`; rejecting it would 403 this endpoint
1497
+ * while every other dev route works)
1498
+ * - `localhost` and `*.localhost` are always allowed
1499
+ * - allowedHosts entries: exact match, or `.suffix` subdomain entries
1500
+ */
1501
+ function isAllowedGraphHost(hostHeader, allowedHosts) {
1502
+ if (allowedHosts === true) return true;
1503
+ if (hostHeader === void 0) return true;
1504
+ let host = hostHeader;
1505
+ const bracket = host.match(/^\[([^\]]+)\](?::\d+)?$/);
1506
+ if (bracket) return isIP(bracket[1]) === 6;
1507
+ const colon = host.lastIndexOf(":");
1508
+ if (colon !== -1) host = host.slice(0, colon);
1509
+ host = host.toLowerCase();
1510
+ if (isIP(host) !== 0) return true;
1511
+ if (host === "localhost" || host.endsWith(".localhost")) return true;
1512
+ for (const entry of allowedHosts ?? []) {
1513
+ const allowed = entry.toLowerCase();
1514
+ if (allowed.startsWith(".")) {
1515
+ if (host === allowed.slice(1) || host.endsWith(allowed)) return true;
1516
+ } else if (host === allowed) return true;
1517
+ }
1518
+ return false;
1519
+ }
1520
+ /**
1521
+ * Non-http(s) origins admitted without a host check: Vite's own
1522
+ * `file:` / `*-extension:` set (its host-validation regex), plus
1523
+ * `vscode-webview:` — VS Code webviews fetch with that Origin, and the
1524
+ * extension is this endpoint's primary consumer. Vite itself never
1525
+ * origin-checks plain HTTP GETs (only WebSocket upgrades), so this
1526
+ * layer is strictly additional; the additions keep it from rejecting
1527
+ * consumers Vite would serve.
1528
+ *
1529
+ * NOT admitted: `Origin: null`. Browsers serialize file:// pages'
1530
+ * opaque origin as the literal string `null` — but so do sandboxed
1531
+ * iframes and data: documents, exactly the untrusted embedders the
1532
+ * check exists to stop, and the header offers nothing to tell them
1533
+ * apart. file:// pages therefore cannot use this endpoint from a
1534
+ * browser; the `file:` scheme entry covers non-browser clients that
1535
+ * send a real scheme-form Origin (Vite admits the same set).
1536
+ */
1537
+ var TRUSTED_ORIGIN_SCHEMES = /^(?:file|vscode-webview|.+-extension):/i;
1538
+ /** Origin check: absent is fine (CLI probe); present must pass the host allowlist. */
1539
+ function isAllowedGraphOrigin(originHeader, allowedHosts) {
1540
+ if (originHeader === void 0) return true;
1541
+ if (TRUSTED_ORIGIN_SCHEMES.test(originHeader)) return true;
1542
+ let originUrl;
1543
+ try {
1544
+ originUrl = new URL(originHeader);
1545
+ } catch {
1546
+ return false;
1547
+ }
1548
+ if (originUrl.host === "") return false;
1549
+ const bareHost = originUrl.hostname.replace(/^\[|\]$/g, "");
1550
+ if (isIP(bareHost) !== 0) {
1551
+ if (bareHost === "127.0.0.1" || bareHost === "::1") return true;
1552
+ if (allowedHosts === true) return true;
1553
+ return (allowedHosts ?? []).some((entry) => entry.toLowerCase() === bareHost);
1554
+ }
1555
+ return isAllowedGraphHost(originUrl.host, allowedHosts);
1556
+ }
1557
+ function sendJson(res, status, body) {
1558
+ res.statusCode = status;
1559
+ res.setHeader("content-type", "application/json; charset=utf-8");
1560
+ res.end(JSON.stringify(body));
1561
+ }
1562
+ /**
1563
+ * Echo an ADMITTED origin back as CORS headers. A webview fetch from
1564
+ * `vscode-webview://…` passes the origin check but the browser rejects
1565
+ * the response body without `Access-Control-Allow-Origin` — the exact
1566
+ * transport design/47 specifies for the extension. Only the validated
1567
+ * origin is echoed (never `*`), with `Vary: Origin` for any cache in
1568
+ * between; unadmitted origins were already 403'd and get nothing.
1569
+ */
1570
+ function reflectCors(res, origin) {
1571
+ if (!origin) return;
1572
+ res.setHeader("Access-Control-Allow-Origin", origin);
1573
+ res.setHeader("Vary", "Origin");
1574
+ }
1575
+ /**
1576
+ * Create the Connect middleware handling GET /__timber/graph and the
1577
+ * GET /__timber/status identity probe.
1578
+ *
1579
+ * Query surface: `?file=<path>` (absolute or project-root-relative) or
1580
+ * `?all=1`. Anything else is a 400 — fail loudly, like the CLI.
1581
+ */
1582
+ function createGraphEndpointMiddleware(server, ctx) {
1583
+ const sourceExtensions = buildSourceExtensions(ctx.config.pageExtensions);
1584
+ return async (req, res, next) => {
1585
+ const rawUrl = req.url;
1586
+ if (!rawUrl || !rawUrl.startsWith("/__timber/")) {
1587
+ next();
1588
+ return;
1589
+ }
1590
+ const url = new URL(rawUrl, "http://placeholder.invalid");
1591
+ const isStatus = url.pathname === STATUS_ENDPOINT_PATH;
1592
+ if (!isStatus && url.pathname !== "/__timber/graph") {
1593
+ sendJson(res, 404, { error: `unknown /__timber/ endpoint: ${url.pathname}` });
1594
+ return;
1595
+ }
1596
+ if (req.method !== "GET") {
1597
+ res.setHeader("Allow", "GET");
1598
+ sendJson(res, 405, { error: "GET only" });
1599
+ return;
1600
+ }
1601
+ const origin = req.headers.origin;
1602
+ const allowedHosts = server.config.server.allowedHosts;
1603
+ if (!server.config.server.https && !isAllowedGraphHost(req.headers.host, allowedHosts)) {
1604
+ sendJson(res, 403, { error: "host not allowed" });
1605
+ return;
1606
+ }
1607
+ if (!isAllowedGraphOrigin(origin, allowedHosts)) {
1608
+ sendJson(res, 403, { error: "origin not allowed" });
1609
+ return;
1610
+ }
1611
+ reflectCors(res, origin);
1612
+ if (isStatus) {
1613
+ sendJson(res, 200, { pid: process.pid });
1614
+ return;
1615
+ }
1616
+ try {
1617
+ const { classifyLiveFile, classifyLiveProject } = await import("./live-graph-C7-yA8W9.js");
1618
+ const preserveSymlinks = server.config.resolve.preserveSymlinks;
1619
+ const root = normalizePath(preserveSymlinks ? ctx.root : await realpath(ctx.root));
1620
+ const appDir = normalizePath(preserveSymlinks ? ctx.appDir : await realpath(ctx.appDir).catch(() => join(root, relative(ctx.root, ctx.appDir))));
1621
+ const liveCtx = {
1622
+ rsc: server.environments.rsc.moduleGraph,
1623
+ ssr: server.environments.ssr.moduleGraph,
1624
+ client: server.environments.client.moduleGraph,
1625
+ root,
1626
+ appDir,
1627
+ pageExtensions: ctx.config.pageExtensions
1628
+ };
1629
+ const allParam = url.searchParams.get("all");
1630
+ if (allParam !== null && allParam !== "1") {
1631
+ sendJson(res, 400, { error: `unsupported all value: ${allParam} (use ?all=1)` });
1632
+ return;
1633
+ }
1634
+ if (allParam === "1") {
1635
+ sendJson(res, 200, {
1636
+ version: 1,
1637
+ source: "dev-server",
1638
+ cached: false,
1639
+ ...await classifyLiveProject(liveCtx)
1640
+ });
1641
+ return;
1642
+ }
1643
+ const fileParam = url.searchParams.get("file");
1644
+ if (!fileParam) {
1645
+ sendJson(res, 400, { error: "missing ?file=<path> (or ?all=1)" });
1646
+ return;
1647
+ }
1648
+ const absolute = normalizePath(isAbsolute(fileParam) ? resolve(fileParam) : resolve(root, fileParam));
1649
+ let target;
1650
+ try {
1651
+ const physical = normalizePath(await realpath(absolute));
1652
+ const rootPhysical = preserveSymlinks ? normalizePath(await realpath(root)) : root;
1653
+ if (physical !== rootPhysical && !physical.startsWith(rootPhysical + "/") && !physical.startsWith(rootPhysical + "\\")) {
1654
+ sendJson(res, 404, { error: `not a project file under ${root}` });
1655
+ return;
1656
+ }
1657
+ if (preserveSymlinks) {
1658
+ if (physical !== rootPhysical + absolute.slice(root.length)) {
1659
+ sendJson(res, 404, { error: `not a project source file: ${absolute}` });
1660
+ return;
1661
+ }
1662
+ }
1663
+ target = normalizePath(preserveSymlinks ? absolute : physical);
1664
+ } catch {
1665
+ sendJson(res, 404, { error: `file not found: ${absolute}` });
1666
+ return;
1667
+ }
1668
+ if (target !== root && !target.startsWith(root + "/") && !target.startsWith(root + "\\")) {
1669
+ sendJson(res, 404, { error: `not a project file under ${root}` });
1670
+ return;
1671
+ }
1672
+ if (!(await stat(target).catch(() => null))?.isFile() || !isScannableSourceFile(normalizePath(target), normalizePath(root), sourceExtensions)) {
1673
+ sendJson(res, 404, { error: `not a project source file: ${target}` });
1674
+ return;
1675
+ }
1676
+ const errors = [];
1677
+ const module = await classifyLiveFile(target, liveCtx, void 0, errors);
1678
+ sendJson(res, 200, {
1679
+ version: 1,
1680
+ source: "dev-server",
1681
+ cached: false,
1682
+ target: {
1683
+ input: fileParam,
1684
+ resolved: target
1685
+ },
1686
+ kind: module.kind,
1687
+ pending: module.pending,
1688
+ subtreeUnknown: module.subtreeUnknown,
1689
+ envs: module.envs,
1690
+ boundary: module.boundary,
1691
+ chains: module.chains,
1692
+ poisonings: module.poisonings,
1693
+ errors
1694
+ });
1695
+ } catch (error) {
1696
+ sendJson(res, 500, { error: error instanceof Error ? error.message : String(error) });
1697
+ }
1698
+ };
1699
+ }
1700
+ /**
1701
+ * Build the push channel: `timber:graph-update` custom HMR events per
1702
+ * project-source change. Consumers (the VS Code extension) re-query
1703
+ * and debounce on their side; the channel just emits. Non-source noise
1704
+ * (build output, dotdirs) is filtered by the same extension set the
1705
+ * scanners use.
1706
+ *
1707
+ * Two phases per edit, because one is not enough (codex review, PR
1708
+ * #1057): the `invalidated` event fires from the plugin's `hotUpdate`
1709
+ * hook — after Vite clears the module's transform result, but its
1710
+ * importer EDGES are only rebuilt when the module is next transformed.
1711
+ * The `transformed` event fires for exactly the files with a pending
1712
+ * invalidation, and only once the node's `transformResult` is set
1713
+ * again — the plugin transform hook itself runs BEFORE Vite's trailing
1714
+ * `vite:import-analysis` (which rebuilds the edges), so the hook only
1715
+ * marks the file "settling" and a short bounded timer confirms
1716
+ * completion via `isTransformed` before emitting. (A module nothing
1717
+ * re-requests never re-transforms — its `transformed` event waits for
1718
+ * the next render, which is also when the graph has new information.)
1719
+ */
1720
+ function makeGraphUpdateChannel(ctx, send, isTransformed, canonicalize = (file) => file) {
1721
+ /** Files invalidated but not yet re-transformed, per environment. */
1722
+ const pending = /* @__PURE__ */ new Set();
1723
+ const key = (file, environment) => `${environment}\0${file}`;
1724
+ const root = normalizePath(canonicalize(ctx.root));
1725
+ const extensions = buildSourceExtensions(ctx.config.pageExtensions);
1726
+ const emitTransformed = (file, environment, structural) => {
1727
+ send({
1728
+ type: "custom",
1729
+ event: GRAPH_UPDATE_EVENT,
1730
+ data: structural ? {
1731
+ file,
1732
+ event: "update",
1733
+ environment,
1734
+ phase: "transformed",
1735
+ structural: true
1736
+ } : {
1737
+ file,
1738
+ event: "update",
1739
+ environment,
1740
+ phase: "transformed"
1741
+ }
1742
+ });
1743
+ };
1744
+ /**
1745
+ * Confirm the transform request finished (transformResult set again)
1746
+ * before emitting phase `transformed`. If confirmation never arrives
1747
+ * within the bounded schedule below, the pending key is RE-ARMED
1748
+ * rather than emitted — a `transformed` event over a still-stale
1749
+ * graph would be a false all-clear with no corrective event.
1750
+ */
1751
+ /**
1752
+ * Delays between confirmation re-checks: dense while a normal
1753
+ * transform request finishes, then exponential backoff for slow
1754
+ * import-analysis passes (large graphs, cold dep optimizer) — a
1755
+ * completed slow transform is CACHED, so no later transform hook may
1756
+ * ever fire for it and the tail checks are the only chance to emit.
1757
+ * Total window ≈ 16 s, then give up (bounded — the async-safety
1758
+ * rules ban open-ended polling) and re-arm the pending key.
1759
+ */
1760
+ const CONFIRM_DELAYS_MS = [
1761
+ ...Array.from({ length: 25 }, () => 20),
1762
+ 500,
1763
+ 1e3,
1764
+ 2e3,
1765
+ 4e3,
1766
+ 8e3
1767
+ ];
1768
+ const confirmAndEmit = (file, environment, attempt = 0, structural = false) => {
1769
+ if (!isTransformed || isTransformed(file, environment)) {
1770
+ emitTransformed(file, environment, structural);
1771
+ return;
1772
+ }
1773
+ if (attempt >= CONFIRM_DELAYS_MS.length) {
1774
+ if (!structural) pending.add(key(file, environment));
1775
+ return;
1776
+ }
1777
+ setTimeout(() => confirmAndEmit(file, environment, attempt + 1, structural), CONFIRM_DELAYS_MS[attempt]);
1778
+ };
1779
+ return {
1780
+ onHotUpdate(update) {
1781
+ const file = normalizePath(canonicalize(update.file));
1782
+ if (!isScannableSourceFile(file, root, extensions)) return;
1783
+ if (update.type === "delete") pending.delete(key(file, update.environment));
1784
+ else pending.add(key(file, update.environment));
1785
+ send({
1786
+ type: "custom",
1787
+ event: GRAPH_UPDATE_EVENT,
1788
+ data: {
1789
+ file,
1790
+ event: update.type,
1791
+ environment: update.environment,
1792
+ phase: "invalidated"
1793
+ }
1794
+ });
1795
+ },
1796
+ onTransform(id, environment) {
1797
+ const file = normalizePath(id.split("?")[0]);
1798
+ if (file.includes("virtual:timber-route-manifest")) {
1799
+ confirmAndEmit(file, environment, 25, true);
1800
+ return;
1801
+ }
1802
+ const pendingKey = key(file, environment);
1803
+ if (!pending.has(pendingKey)) return;
1804
+ pending.delete(pendingKey);
1805
+ confirmAndEmit(file, environment);
1806
+ }
1807
+ };
1808
+ }
1809
+ // src/server/compress.ts
1810
+ /**
1811
+ * MIME types that benefit from compression.
1812
+ * text/* is handled via prefix matching; these are the specific
1813
+ * application/* and image/* types that are compressible.
1814
+ */
1815
+ var COMPRESSIBLE_TYPES = /* @__PURE__ */ new Set([
1816
+ "text/html",
1817
+ "text/css",
1818
+ "text/plain",
1819
+ "text/xml",
1820
+ "text/javascript",
1821
+ RSC_CONTENT_TYPE,
1822
+ "application/json",
1823
+ "application/javascript",
1824
+ "application/xml",
1825
+ "application/xhtml+xml",
1826
+ "application/rss+xml",
1827
+ "application/atom+xml",
1828
+ "image/svg+xml"
1829
+ ]);
1830
+ /**
1831
+ * Status codes that should never be compressed (no body or special semantics).
1832
+ */
1833
+ var NO_COMPRESS_STATUSES = /* @__PURE__ */ new Set([204, 304]);
1834
+ /**
1835
+ * Parse Accept-Encoding and return the best supported encoding.
1836
+ * Returns 'gzip' if the client accepts it, null otherwise.
1837
+ *
1838
+ * Brotli (br) is intentionally not handled at the application level.
1839
+ * At the streaming-friendly quality levels (0–4), brotli's compression
1840
+ * ratio advantage over gzip is marginal, and node:zlib's brotli transform
1841
+ * buffers output internally — turning smooth streaming responses into
1842
+ * large infrequent bursts. Brotli's real wins come from offline/static
1843
+ * compression at higher quality levels (5–11), which CDNs and reverse
1844
+ * proxies (Cloudflare, nginx, Caddy) apply on cached responses.
1845
+ *
1846
+ * See design/25-production-deployments.md.
1847
+ */
1848
+ function negotiateEncoding(acceptEncoding) {
1849
+ if (!acceptEncoding) return null;
1850
+ const parts = acceptEncoding.split(",");
1851
+ for (const part of parts) {
1852
+ const [token, ...params] = part.split(";");
1853
+ if (token.trim().toLowerCase() !== "gzip") continue;
1854
+ let qValue = 1;
1855
+ for (const param of params) {
1856
+ const trimmed = param.trim().toLowerCase();
1857
+ if (trimmed.startsWith("q=")) {
1858
+ qValue = parseFloat(trimmed.slice(2));
1859
+ if (Number.isNaN(qValue)) qValue = 1;
1860
+ break;
1861
+ }
1862
+ }
1863
+ if (qValue > 0) return "gzip";
1864
+ }
1865
+ return null;
1866
+ }
1867
+ /**
1868
+ * Determine if a response should be compressed.
1869
+ *
1870
+ * Returns false for:
1871
+ * - Responses without a body (204, 304, null body)
1872
+ * - Already-encoded responses (Content-Encoding set)
1873
+ * - Non-compressible content types (images, binary)
1874
+ * - SSE streams (text/event-stream — must not be buffered)
1875
+ */
1876
+ function shouldCompress(response) {
1877
+ const nodeBody = nodeBodyThrough(response);
1878
+ if (nodeBody ? !nodeBody.hasBody : !response.body) return false;
1879
+ if (NO_COMPRESS_STATUSES.has(response.status)) return false;
1880
+ if (response.headers.has("Content-Encoding")) return false;
1881
+ const contentType = response.headers.get("Content-Type");
1882
+ if (!contentType) return false;
1883
+ const mimeType = contentType.split(";")[0].trim().toLowerCase();
1884
+ if (mimeType === "text/event-stream") return false;
1885
+ return COMPRESSIBLE_TYPES.has(mimeType);
1886
+ }
1887
+ /**
1888
+ * Compress a Web Response if the client supports it and the content is compressible.
1889
+ *
1890
+ * Returns the original response unchanged if compression is not applicable.
1891
+ * Returns a new Response with the compressed body, Content-Encoding, and Vary headers.
1892
+ *
1893
+ * The body is piped through a compression stream — no buffering of the full response.
1894
+ * This preserves streaming behavior for HTML shell + deferred Suspense chunks.
1895
+ */
1896
+ function compressResponse(request, response) {
1897
+ if (!shouldCompress(response)) return response;
1898
+ const encoding = negotiateEncoding(request.headers.get("Accept-Encoding") ?? "");
1899
+ if (!encoding) return response;
1900
+ const headers = new Headers(response.headers);
1901
+ headers.set("Content-Encoding", encoding);
1902
+ headers.delete("Content-Length");
1903
+ const existingVary = headers.get("Vary");
1904
+ if (existingVary) {
1905
+ if (!existingVary.toLowerCase().includes("accept-encoding")) headers.set("Vary", `${existingVary}, Accept-Encoding`);
1906
+ } else headers.set("Vary", "Accept-Encoding");
1907
+ const init = {
1908
+ status: response.status,
1909
+ statusText: response.statusText,
1910
+ headers
1911
+ };
1912
+ const nodeBody = nodeBodyThrough(response);
1913
+ if (nodeBody) return nodeBody.through(createSyncFlushGzip(), init);
1914
+ return new Response(compressWithGzip(response.body), init);
1915
+ }
1916
+ /** Registry key of the Node-body brand; must equal `NODE_BODY` in node-response.ts. */
1917
+ var NODE_BODY_KEY = "timber.response.nodeBody";
1918
+ function isNodeBodyThrough(value) {
1919
+ return typeof value === "object" && value !== null && "through" in value && typeof value.through === "function" && "hasBody" in value && typeof value.hasBody === "boolean";
1920
+ }
1921
+ function nodeBodyThrough(response) {
1922
+ const ops = Reflect.get(response, Symbol.for(NODE_BODY_KEY));
1923
+ return isNodeBodyThrough(ops) ? ops : null;
1924
+ }
1925
+ /** gzip that flushes every chunk as it arrives. */
1926
+ function createSyncFlushGzip() {
1927
+ return createGzip({ flush: constants.Z_SYNC_FLUSH });
1928
+ }
1929
+ /**
1930
+ * Compress a ReadableStream with gzip, flushing each chunk immediately.
1931
+ *
1932
+ * Uses node:zlib's createGzip with Z_SYNC_FLUSH to ensure each HTML chunk
1933
+ * (shell, Suspense resolution, RSC payload) is delivered to the browser
1934
+ * as soon as it's available — preserving streaming semantics.
1935
+ */
1936
+ function compressWithGzip(body) {
1937
+ const gzip = createSyncFlushGzip();
1938
+ const nodeInput = Readable.fromWeb(body);
1939
+ pipeline(nodeInput, gzip, () => {});
1940
+ return Readable.toWeb(gzip);
1941
+ }
1942
+ // src/plugins/dev-store-clear.ts
1943
+ /**
1944
+ * Comfortably past the throttle window. Both are timers started in the same
1945
+ * synchronous emit, so this one always fires after the throttle has expired,
1946
+ * however late the event loop runs them.
1947
+ */
1948
+ var TRAILING_CLEAR_DELAY_MS = 100;
1949
+ function clearDevStoreOnWatcherEvents(watcher, clear) {
1950
+ let trailing;
1951
+ let burst = /* @__PURE__ */ new Set();
1952
+ watcher.on("all", (event, path) => {
1953
+ const changed = event === "change" ? /* @__PURE__ */ new Set([path]) : null;
1954
+ clear(changed);
1955
+ if (changed === null) burst = null;
1956
+ else burst?.add(path);
1957
+ clearTimeout(trailing);
1958
+ trailing = setTimeout(() => {
1959
+ const covered = burst;
1960
+ burst = /* @__PURE__ */ new Set();
1961
+ clear(covered);
1962
+ }, TRAILING_CLEAR_DELAY_MS);
1963
+ trailing.unref?.();
1964
+ });
1965
+ }
1966
+ /**
1967
+ * The cache.component IDs whose output the changed paths could have
1968
+ * changed: those declared in each changed module and its transitive
1969
+ * importers. Null means every component — a path the graph does not know.
1970
+ *
1971
+ * `componentIds` maps a module ID to the IDs its last transform declared
1972
+ * (`PluginContext.devPrebuiltComponentIds`). `toGraphPath` puts a watcher
1973
+ * path in the graph's path space (symlinks resolved, `/` separators).
1974
+ */
1975
+ function componentsChangedBy(changed, graph, componentIds, toGraphPath) {
1976
+ if (changed === null) return null;
1977
+ const affected = /* @__PURE__ */ new Set();
1978
+ const visited = /* @__PURE__ */ new Set();
1979
+ const pending = [];
1980
+ for (const path of changed) {
1981
+ const nodes = [...graph.getModulesByFile(toGraphPath(path)) ?? []];
1982
+ if (!nodes.some((node) => node.id !== null)) return null;
1983
+ pending.push(...nodes);
1984
+ }
1985
+ while (pending.length > 0) {
1986
+ const module = pending.pop();
1987
+ if (visited.has(module)) continue;
1988
+ visited.add(module);
1989
+ if (module.id !== null) for (const id of componentIds.get(module.id) ?? []) affected.add(id);
1990
+ pending.push(...module.importers);
1991
+ }
1992
+ return [...affected];
1993
+ }
1994
+ // src/plugins/dev-server.ts
1995
+ /**
1996
+ * timber-dev-server — Vite sub-plugin for dev server request handling.
1997
+ *
1998
+ * Registers a configureServer middleware that intercepts requests and
1999
+ * routes them through the timber pipeline:
2000
+ * proxy.ts → canonicalize → route match → middleware → access → render → flush
2001
+ *
2002
+ * The RSC entry module is loaded via Vite's ssrLoadModule, which uses
2003
+ * Vite's dev module graph instead of built bundles. The full pipeline
2004
+ * (including proxy.ts) runs on every request.
2005
+ *
2006
+ * Design docs: 18-build-system.md §"Dev Server", 02-rendering-pipeline.md
2007
+ */
2008
+ var RSC_ENTRY_ID = "virtual:timber-rsc-entry";
2009
+ /**
2010
+ * Exit code used to signal the CLI supervisor that the dev server needs
2011
+ * a full process restart (e.g. timber.config.ts changed). The supervisor
2012
+ * in cli.ts respawns the worker on this code. 75 = EX_TEMPFAIL (sysexits).
2013
+ * See TIM-1444.
2014
+ */
2015
+ var RESTART_EXIT_CODE = 75;
2016
+ /**
2017
+ * Config file names that trigger a full dev server restart when changed.
2018
+ * See 21-dev-server.md §HMR Wiring — config is loaded once at startup.
2019
+ */
2020
+ var CONFIG_FILE_NAMES = [
2021
+ "timber.config.ts",
2022
+ "timber.config.js",
2023
+ "timber.config.mjs"
2024
+ ];
2025
+ /**
2026
+ * URL prefixes that are Vite-internal and should never be intercepted.
2027
+ * These are passed through to Vite's built-in middleware.
2028
+ */
2029
+ var VITE_INTERNAL_PREFIXES = [
2030
+ "/@",
2031
+ "/__vite",
2032
+ "/node_modules/"
2033
+ ];
2034
+ /**
2035
+ * File extensions that indicate static asset requests.
2036
+ * These are passed through to Vite's static file serving.
2037
+ */
2038
+ var ASSET_EXTENSIONS = /\.(?:js|ts|tsx|jsx|css|map|json|svg|png|jpg|jpeg|gif|webp|avif|ico|woff|woff2|ttf|eot|mp4|webm|ogg|mp3|wav)(?:\?.*)?$/;
2039
+ /**
2040
+ * Create the timber-dev-server Vite plugin.
2041
+ *
2042
+ * Hook: configureServer (returns post-hook to register after Vite's middleware)
2043
+ */
2044
+ function timberDevServer(ctx) {
2045
+ let graphChannel = null;
2046
+ return {
2047
+ name: "timber-dev-server",
2048
+ apply: "serve",
2049
+ /**
2050
+ * Push channel for the graph endpoint, phase 1: `invalidated`, one
2051
+ * per (file, environment). Emitted from hotUpdate — which runs
2052
+ * AFTER Vite invalidates the environment module graphs — never
2053
+ * from a raw watcher listener, which would race consumers into
2054
+ * querying pre-invalidation memberships (design/47 §"Dev-server
2055
+ * endpoint").
2056
+ */
2057
+ hotUpdate({ file, type }) {
2058
+ graphChannel?.onHotUpdate({
2059
+ file,
2060
+ type,
2061
+ environment: this.environment.name
2062
+ });
2063
+ },
2064
+ /**
2065
+ * Push channel phase 2: `transformed`, when a pending-invalidated
2066
+ * module's import edges are actually rebuilt. A Set lookup for
2067
+ * everything without a pending invalidation — free on the hot
2068
+ * path. Returning nothing leaves the code untouched.
2069
+ */
2070
+ transform(_code, id) {
2071
+ graphChannel?.onTransform(id, this.environment.name);
2072
+ },
2073
+ /**
2074
+ * Register the dev server middleware and config file watcher.
2075
+ *
2076
+ * Registers as a pre-hook (no return value) so our middleware runs
2077
+ * before Vite's built-in SPA fallback / historyApiFallback. This
2078
+ * ensures we see the original URL (e.g. /blog) rather than a
2079
+ * rewritten /index.html. Vite-internal and asset requests are
2080
+ * filtered out explicitly and passed through to Vite.
2081
+ */
2082
+ async configureServer(server) {
2083
+ const configPaths = CONFIG_FILE_NAMES.map((name) => join(ctx.root, name));
2084
+ server.watcher.add(configPaths);
2085
+ const configPathSet = new Set(configPaths);
2086
+ const hasSupervisor = Boolean(process.env.__TIMBER_DEV_WORKER);
2087
+ const onConfigChange = (filePath) => {
2088
+ if (!configPathSet.has(filePath)) return;
2089
+ if (hasSupervisor) {
2090
+ console.log(`\n[timber] ${basename(filePath)} changed — restarting dev server...\n`);
2091
+ process.exit(75);
2092
+ } else console.warn(`\n[timber] ${basename(filePath)} changed. Restart the dev server to apply it, or run \`timber dev\` instead of \`vite dev\` to restart automatically.\n`);
2093
+ };
2094
+ server.watcher.on("change", onConfigChange);
2095
+ server.watcher.on("add", onConfigChange);
2096
+ server.watcher.on("unlink", onConfigChange);
2097
+ if (hasSupervisor) server.restart = async () => {
2098
+ const { configFile, mode, root, logger } = server.config;
2099
+ try {
2100
+ await loadConfigFromFile({
2101
+ command: "serve",
2102
+ mode
2103
+ }, configFile || void 0, root, "silent");
2104
+ } catch (error) {
2105
+ logger.error(`[timber] ${configFile ? basename(configFile) : "Vite config"} failed to load — keeping the running server.\n${error instanceof Error ? error.message : String(error)}`, { timestamp: true });
2106
+ return;
2107
+ }
2108
+ console.log("\n[timber] Restarting the dev server process...\n");
2109
+ process.exit(75);
2110
+ };
2111
+ listenForClientErrors(server, ctx.root);
2112
+ server.middlewares.use((req, _res, next) => {
2113
+ if (req.url && !req.url.startsWith("/")) {
2114
+ const url = requestTargetUrl("http://localhost", req.url);
2115
+ if (url) req.url = url.pathname + url.search;
2116
+ }
2117
+ next();
2118
+ });
2119
+ server.middlewares.use(createGraphEndpointMiddleware(server, ctx));
2120
+ const toGraphPath = (file) => {
2121
+ if (server.config?.resolve?.preserveSymlinks || file.includes("virtual:")) return file;
2122
+ try {
2123
+ return realpathSync(file);
2124
+ } catch {
2125
+ try {
2126
+ return join(realpathSync(dirname(file)), basename(file));
2127
+ } catch {
2128
+ return file;
2129
+ }
2130
+ }
2131
+ };
2132
+ const rsc = server.environments.rsc;
2133
+ clearDevStoreOnWatcherEvents(server.watcher, (changed) => {
2134
+ if (!rsc) return;
2135
+ const componentIds = componentsChangedBy(changed, rsc.moduleGraph, ctx.devPrebuiltComponentIds ?? /* @__PURE__ */ new Map(), (path) => normalizePath(toGraphPath(path)));
2136
+ const data = componentIds === null ? {} : { componentIds };
2137
+ rsc.hot.send({
2138
+ type: "custom",
2139
+ event: PREBUILT_DEV_CLEAR_EVENT,
2140
+ data
2141
+ });
2142
+ });
2143
+ graphChannel = makeGraphUpdateChannel(ctx, (payload) => server.hot.send(payload), (file, environment) => {
2144
+ const graph = server.environments[environment]?.moduleGraph;
2145
+ if (!graph) return false;
2146
+ const nodes = graph.getModulesByFile(file);
2147
+ if (nodes) {
2148
+ for (const node of nodes) if (node.transformResult != null) return true;
2149
+ return false;
2150
+ }
2151
+ return graph.getModuleById(file)?.transformResult != null;
2152
+ }, toGraphPath);
2153
+ server.middlewares.use(createTimberMiddleware(server, ctx));
2154
+ const hostname = applyDevHostname(server, devRecordRoot(ctx.root, server.config.configFile), ctx.config.dev?.hostname);
2155
+ registerDevDiscovery(server.httpServer, ctx.root, () => advertisedUrls(server.resolvedUrls, hostname, server.config.server), server.config);
2156
+ if (ctx.holdingServer) {
2157
+ await ctx.holdingServer.close().catch(() => {});
2158
+ ctx.holdingServer = null;
2159
+ }
2160
+ ctx.timer.end("dev-server-setup");
2161
+ const summary = ctx.timer.formatSummary();
2162
+ if (summary) console.log(summary);
2163
+ }
2164
+ };
2165
+ }
2166
+ /**
2167
+ * Create the Connect middleware that routes requests through the timber pipeline.
2168
+ *
2169
+ * For route requests (HTML pages, API endpoints), the middleware:
2170
+ * 1. Loads the RSC entry via ssrLoadModule
2171
+ * 2. Converts the Node request to a Web Request
2172
+ * 3. Passes it through the RSC handler (which runs the full pipeline)
2173
+ * 4. Converts the Web Response back to a Node response
2174
+ *
2175
+ * For non-route requests (assets, Vite internals, HMR), the middleware
2176
+ * calls next() to let Vite handle them.
2177
+ */
2178
+ function createTimberMiddleware(server, ctx) {
2179
+ const projectRoot = ctx.root;
2180
+ const hmrOptions = extractHmrOptions(server.config);
2181
+ return async (req, res, next) => {
2182
+ const url = req.url;
2183
+ if (!url) {
2184
+ next();
2185
+ return;
2186
+ }
2187
+ if (isViteInternal(url)) {
2188
+ next();
2189
+ return;
2190
+ }
2191
+ if (isPublicFile(server, url)) {
2192
+ next();
2193
+ return;
2194
+ }
2195
+ if (isAssetRequest(url) && !isMetadataRouteServePath(url) && !isRouteOwnedAsset(ctx.routeTree, server, url)) {
2196
+ next();
2197
+ return;
2198
+ }
2199
+ let handler;
2200
+ try {
2201
+ const rscEnv = server.environments.rsc;
2202
+ if (!rscEnv?.runner?.import) throw new Error("[timber] RSC environment is not runnable");
2203
+ const rscModule = await rscEnv.runner.import(RSC_ENTRY_ID);
2204
+ handler = rscModule.default;
2205
+ const setDevHooks = rscModule.setDevHooks;
2206
+ setDevHooks?.({
2207
+ onPipelineError: (error) => {
2208
+ sendErrorToOverlay(server, error, classifyErrorPhase(error, projectRoot), projectRoot);
2209
+ },
2210
+ hmrOptions
2211
+ });
2212
+ } catch (error) {
2213
+ if (error instanceof Error) {
2214
+ addTimberContext(error);
2215
+ sendErrorToOverlay(server, error, "module-transform", projectRoot);
2216
+ }
2217
+ respond500(res, error, "module-transform", projectRoot, hmrOptions);
2218
+ return;
2219
+ }
2220
+ if (typeof handler !== "function") {
2221
+ console.error("[timber] RSC entry module does not export a default function");
2222
+ next();
2223
+ return;
2224
+ }
2225
+ try {
2226
+ const webRequest = toWebRequest(req);
2227
+ if (!webRequest) {
2228
+ res.writeHead(400, { "content-type": "text/plain; charset=utf-8" });
2229
+ res.end("Bad Request");
2230
+ return;
2231
+ }
2232
+ const wrapper = server[Symbol.for("timber:dev-request-wrapper")];
2233
+ const finalResponse = compressResponse(webRequest, wrapper ? await wrapper(() => handler(webRequest)) : await handler(webRequest));
2234
+ res.writeHead(finalResponse.status, [...finalResponse.headers].flat());
2235
+ res.flushHeaders();
2236
+ await sendNodeResponse(res, finalResponse);
2237
+ } catch (error) {
2238
+ if (error instanceof Error) {
2239
+ const phase = classifyErrorPhase(error, projectRoot);
2240
+ sendErrorToOverlay(server, error, phase, projectRoot);
2241
+ respond500(res, error, phase, projectRoot, hmrOptions);
2242
+ } else {
2243
+ process.stderr.write(`\x1b[31m[timber] Dev server error:\x1b[0m ${String(error)}\n`);
2244
+ respond500(res, error, "render", projectRoot, hmrOptions);
2245
+ }
2246
+ }
2247
+ };
2248
+ }
2249
+ /**
2250
+ * Send a 500 response without crashing the dev server.
2251
+ *
2252
+ * In dev mode, renders a styled HTML error page with source context,
2253
+ * classified stack trace, and auto-reload on HMR. Falls back to
2254
+ * text/plain if the HTML generator fails (must never crash).
2255
+ */
2256
+ function respond500(res, error, phase, projectRoot, hmrOptions) {
2257
+ if (res.headersSent) return;
2258
+ if (error instanceof Error) try {
2259
+ const html = generateDevErrorPage(error, phase, projectRoot, hmrOptions);
2260
+ res.statusCode = 500;
2261
+ res.setHeader("content-type", "text/html; charset=utf-8");
2262
+ res.end(html);
2263
+ return;
2264
+ } catch (e) {
2265
+ console.debug("[timber] dev error page generation failed, falling back to text/plain:", e instanceof Error ? e.message : e);
2266
+ }
2267
+ res.statusCode = 500;
2268
+ res.setHeader("content-type", "text/plain");
2269
+ res.end(`[timber] Internal server error\n\n${error instanceof Error ? error.stack ?? error.message : String(error)}`);
2270
+ }
2271
+ /**
2272
+ * Add timber-specific context to an error's message if it references
2273
+ * internal virtual modules (virtual:timber-*). Mutates the error in place.
2274
+ */
2275
+ function addTimberContext(error) {
2276
+ const enriched = addVirtualModuleContext(error.message);
2277
+ if (enriched !== error.message) error.message = enriched;
2278
+ }
2279
+ /**
2280
+ * Convert a Node IncomingMessage to a Web Request.
2281
+ *
2282
+ * Constructs the full URL from the Host header and request URL,
2283
+ * and forwards the method, headers, and body.
2284
+ *
2285
+ * The scheme comes from the socket's TLS state — with `server.https` the
2286
+ * browser sends `Origin: https://host`, and a hardcoded `http://` would
2287
+ * fail CSRF origin comparison on every POST. X-Forwarded-Proto is NOT
2288
+ * consulted: dev connections are direct, so the header would be
2289
+ * attacker-controlled. (TIM-1067, B32)
2290
+ *
2291
+ * Returns null for a request that names no URL — a Host that is not a bare
2292
+ * host[:port], or a request target that does not parse — which the caller
2293
+ * answers with 400. (TIM-1600)
2294
+ *
2295
+ * Exported for tests.
2296
+ */
2297
+ function toWebRequest(nodeReq) {
2298
+ const protocol = nodeReq.socket?.encrypted ? "https" : "http";
2299
+ const host = nodeReq.headers.host ?? nodeReq.headers[":authority"] ?? "localhost";
2300
+ const origin = /[/?#@\\]/.test(host) ? null : URL.parse(`${protocol}://${host}`)?.origin;
2301
+ const url = origin ? requestTargetUrl(origin, nodeReq.url || "/") : null;
2302
+ if (!url) return null;
2303
+ const headers = new Headers();
2304
+ for (const [key, value] of Object.entries(nodeReq.headers)) {
2305
+ if (value === void 0) continue;
2306
+ if (key.startsWith(":")) continue;
2307
+ if (Array.isArray(value)) for (const v of value) headers.append(key, v);
2308
+ else headers.set(key, value);
2309
+ }
2310
+ if (!headers.has("host")) headers.set("host", host);
2311
+ const method = nodeReq.method ?? "GET";
2312
+ const hasBody = method !== "GET" && method !== "HEAD";
2313
+ return new Request(url, {
2314
+ method,
2315
+ headers,
2316
+ body: hasBody ? nodeReadableToWebStream(nodeReq) : void 0,
2317
+ duplex: hasBody ? "half" : void 0
2318
+ });
2319
+ }
2320
+ /**
2321
+ * Convert a Node Readable stream to a Web ReadableStream.
2322
+ */
2323
+ function nodeReadableToWebStream(nodeStream) {
2324
+ return new ReadableStream({ start(controller) {
2325
+ nodeStream.on("data", (chunk) => {
2326
+ controller.enqueue(new Uint8Array(chunk));
2327
+ });
2328
+ nodeStream.on("end", () => {
2329
+ controller.close();
2330
+ });
2331
+ nodeStream.on("error", (err) => {
2332
+ controller.error(err);
2333
+ });
2334
+ } });
2335
+ }
2336
+ /**
2337
+ * Check if a URL is a Vite-internal request that should be passed through.
2338
+ */
2339
+ function isViteInternal(url) {
2340
+ return VITE_INTERNAL_PREFIXES.some((prefix) => url.startsWith(prefix));
2341
+ }
2342
+ /**
2343
+ * Check if a URL looks like a static asset request.
2344
+ */
2345
+ function isAssetRequest(url) {
2346
+ return ASSET_EXTENSIONS.test(url);
2347
+ }
2348
+ /**
2349
+ * Check if a URL maps to a real file in the project's public/ directory.
2350
+ * Vite serves public/ files as static assets — if a file exists there it
2351
+ * must be passed through to Vite regardless of extension.
2352
+ */
2353
+ function isPublicFile(server, url) {
2354
+ const { publicDir } = server.config;
2355
+ if (!publicDir) return false;
2356
+ const pathname = url.split("?")[0];
2357
+ const relativePath = pathname.startsWith("/") ? pathname.slice(1) : pathname;
2358
+ if (!relativePath) return false;
2359
+ const fullPath = join(publicDir, relativePath);
2360
+ try {
2361
+ return statSync(fullPath).isFile();
2362
+ } catch {
2363
+ return false;
2364
+ }
2365
+ }
2366
+ /**
2367
+ * Check whether an asset-extension URL belongs to a scanned route rather
2368
+ * than a static file.
2369
+ *
2370
+ * Route handlers may live at paths ending in asset-like extensions
2371
+ * (app/feed.json/route.ts → /feed.json), which the asset bypass would
2372
+ * otherwise hand to Vite — 404ing in dev while working in production.
2373
+ * Uses the same canonicalization and tree walker as the runtime matcher
2374
+ * so dev classification agrees with what the pipeline would match.
2375
+ *
2376
+ * A file that actually exists on disk wins over the route match: the
2377
+ * production server serves public/ statics before the RSC handler (see
2378
+ * adapters/nitro.ts), and Vite serves root-relative source files (e.g.
2379
+ * /app/global.css) in dev. Without this, a broad catch-all route like
2380
+ * app/[...slug] would shadow every static asset. Joining the canonical
2381
+ * pathname is traversal-safe — canonicalize() resolves `..` segments and
2382
+ * rejects root escapes and encoded separators.
2383
+ *
2384
+ * Reads ctx.routeTree per request — the routing plugin rescans it on
2385
+ * file add/unlink/change, so newly created routes are picked up live.
2386
+ */
2387
+ function isRouteOwnedAsset(routeTree, server, url) {
2388
+ if (!routeTree) return false;
2389
+ const rawPathname = url.split("?")[0];
2390
+ const result = canonicalize(rawPathname);
2391
+ if (!result.ok) return false;
2392
+ const parts = result.pathname === "/" ? [] : result.pathname.slice(1).split("/");
2393
+ if (matchUrlParts(routeTree.root, parts) === null) return false;
2394
+ const relativePath = result.pathname.slice(1);
2395
+ const { publicDir, root } = server.config;
2396
+ if (publicDir && existsSync(join(publicDir, relativePath))) return false;
2397
+ if (existsSync(join(root, relativePath))) return false;
2398
+ return true;
2399
+ }
2400
+ /**
2401
+ * Listen for client-side errors forwarded from the browser via HMR.
2402
+ *
2403
+ * The browser entry catches uncaught errors and unhandled rejections,
2404
+ * then sends them as 'timber:client-error' custom events. We parse
2405
+ * the first app frame for the overlay's loc field and forward the
2406
+ * error to Vite's overlay protocol.
2407
+ */
2408
+ function listenForClientErrors(server, projectRoot) {
2409
+ server.hot.on("timber:client-error", (data) => {
2410
+ const loc = parseFirstAppFrame(data.stack, projectRoot);
2411
+ let message = data.message;
2412
+ if (data.componentStack) message = `${data.message}\n\nComponent Stack:\n${data.componentStack.trim()}`;
2413
+ const RED = "\x1B[31m";
2414
+ const BOLD = "\x1B[1m";
2415
+ const RESET = "\x1B[0m";
2416
+ process.stderr.write(`${RED}${BOLD}[timber] Client Error${RESET}\n${RED}${data.message}${RESET}\n\n`);
2417
+ try {
2418
+ server.hot.send({
2419
+ type: "error",
2420
+ err: {
2421
+ message,
2422
+ stack: data.stack,
2423
+ id: loc?.file,
2424
+ plugin: "timber (Client)",
2425
+ loc: loc ? {
2426
+ file: loc.file,
2427
+ line: loc.line,
2428
+ column: loc.column
2429
+ } : void 0
2430
+ }
2431
+ });
2432
+ } catch (e) {
2433
+ console.debug("[timber] overlay send failed:", e instanceof Error ? e.message : e);
2434
+ }
2435
+ });
2436
+ }
2437
+ export { formatMissingPeers as a, checkPeerDependencies as i, timberDevServer as n, reportConfigErrors as o, toWebRequest as r, validateConfig as s, RESTART_EXIT_CODE as t };
2438
+
2439
+ //# sourceMappingURL=dev-server-Rq659RR1.js.map