@timber-js/app 0.2.0-alpha.98 → 0.2.0-alpha.99

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 (322) hide show
  1. package/LICENSE +8 -0
  2. package/dist/_chunks/actions-CQ8Z8VGL.js +1061 -0
  3. package/dist/_chunks/actions-CQ8Z8VGL.js.map +1 -0
  4. package/dist/_chunks/build-output-helper-DXnW0qjz.js +61 -0
  5. package/dist/_chunks/build-output-helper-DXnW0qjz.js.map +1 -0
  6. package/dist/_chunks/{define-Itxvcd7F.js → define-B-Q_UMOD.js} +19 -23
  7. package/dist/_chunks/define-B-Q_UMOD.js.map +1 -0
  8. package/dist/_chunks/{define-C77ScO0m.js → define-CfBPoJb0.js} +24 -7
  9. package/dist/_chunks/define-CfBPoJb0.js.map +1 -0
  10. package/dist/_chunks/define-cookie-BjpIt4UC.js +194 -0
  11. package/dist/_chunks/define-cookie-BjpIt4UC.js.map +1 -0
  12. package/dist/_chunks/{format-CYBGxKtc.js → format-Bcn-Iv1x.js} +1 -1
  13. package/dist/_chunks/{format-CYBGxKtc.js.map → format-Bcn-Iv1x.js.map} +1 -1
  14. package/dist/_chunks/handler-store-B-lqaGyh.js +54 -0
  15. package/dist/_chunks/handler-store-B-lqaGyh.js.map +1 -0
  16. package/dist/_chunks/logger-0m8MsKdc.js +291 -0
  17. package/dist/_chunks/logger-0m8MsKdc.js.map +1 -0
  18. package/dist/_chunks/merge-search-params-BphMdht_.js +122 -0
  19. package/dist/_chunks/merge-search-params-BphMdht_.js.map +1 -0
  20. package/dist/_chunks/navigation-root-BCYczjml.js +96 -0
  21. package/dist/_chunks/navigation-root-BCYczjml.js.map +1 -0
  22. package/dist/_chunks/registry-I2ss-lvy.js +20 -0
  23. package/dist/_chunks/registry-I2ss-lvy.js.map +1 -0
  24. package/dist/_chunks/router-ref-h3-UaCQv.js +28 -0
  25. package/dist/_chunks/router-ref-h3-UaCQv.js.map +1 -0
  26. package/dist/_chunks/{schema-bridge-C3xl_vfb.js → schema-bridge-Cxu4l-7p.js} +1 -1
  27. package/dist/_chunks/{schema-bridge-C3xl_vfb.js.map → schema-bridge-Cxu4l-7p.js.map} +1 -1
  28. package/dist/_chunks/{segment-context-fHFLF1PE.js → segment-context-Dx_OizxD.js} +1 -1
  29. package/dist/_chunks/{segment-context-fHFLF1PE.js.map → segment-context-Dx_OizxD.js.map} +1 -1
  30. package/dist/_chunks/{router-ref-C8OCm7g7.js → ssr-data-B4CdH7rE.js} +2 -26
  31. package/dist/_chunks/ssr-data-B4CdH7rE.js.map +1 -0
  32. package/dist/_chunks/{stale-reload-BX5gL1r-.js → stale-reload-Bab885FO.js} +1 -1
  33. package/dist/_chunks/{stale-reload-BX5gL1r-.js.map → stale-reload-Bab885FO.js.map} +1 -1
  34. package/dist/_chunks/tracing-C8V-YGsP.js +329 -0
  35. package/dist/_chunks/tracing-C8V-YGsP.js.map +1 -0
  36. package/dist/_chunks/{use-query-states-BiV5GJgm.js → use-query-states-B2XTqxDR.js} +3 -19
  37. package/dist/_chunks/use-query-states-B2XTqxDR.js.map +1 -0
  38. package/dist/_chunks/{use-params-IOPu7E8t.js → use-segment-params-BkpKAQ7D.js} +9 -95
  39. package/dist/_chunks/use-segment-params-BkpKAQ7D.js.map +1 -0
  40. package/dist/_chunks/{walkers-VOXgavMF.js → walkers-Tg0Alwcg.js} +6 -3
  41. package/dist/_chunks/walkers-Tg0Alwcg.js.map +1 -0
  42. package/dist/_chunks/{dev-warnings-DpGRGoDi.js → warnings-Cg47l5sk.js} +3 -3
  43. package/dist/_chunks/warnings-Cg47l5sk.js.map +1 -0
  44. package/dist/adapters/build-output-helper.d.ts +28 -0
  45. package/dist/adapters/build-output-helper.d.ts.map +1 -0
  46. package/dist/adapters/cloudflare.d.ts.map +1 -1
  47. package/dist/adapters/cloudflare.js +8 -28
  48. package/dist/adapters/cloudflare.js.map +1 -1
  49. package/dist/adapters/nitro.d.ts.map +1 -1
  50. package/dist/adapters/nitro.js +8 -26
  51. package/dist/adapters/nitro.js.map +1 -1
  52. package/dist/adapters/shared.d.ts +16 -0
  53. package/dist/adapters/shared.d.ts.map +1 -0
  54. package/dist/cache/index.js +9 -2
  55. package/dist/cache/index.js.map +1 -1
  56. package/dist/cache/timber-cache.d.ts.map +1 -1
  57. package/dist/client/error-boundary.js +2 -1
  58. package/dist/client/error-boundary.js.map +1 -1
  59. package/dist/client/form.d.ts +10 -24
  60. package/dist/client/form.d.ts.map +1 -1
  61. package/dist/client/index.d.ts +1 -5
  62. package/dist/client/index.d.ts.map +1 -1
  63. package/dist/client/index.js +40 -90
  64. package/dist/client/index.js.map +1 -1
  65. package/dist/client/internal.d.ts +2 -1
  66. package/dist/client/internal.d.ts.map +1 -1
  67. package/dist/client/internal.js +81 -7
  68. package/dist/client/internal.js.map +1 -1
  69. package/dist/client/rsc-fetch.d.ts.map +1 -1
  70. package/dist/client/state.d.ts +1 -1
  71. package/dist/client/use-cookie.d.ts +8 -0
  72. package/dist/client/use-cookie.d.ts.map +1 -1
  73. package/dist/client/{use-params.d.ts → use-segment-params.d.ts} +1 -1
  74. package/dist/client/use-segment-params.d.ts.map +1 -0
  75. package/dist/codec.d.ts +1 -1
  76. package/dist/codec.d.ts.map +1 -1
  77. package/dist/codec.js +2 -2
  78. package/dist/config-types.d.ts +28 -0
  79. package/dist/config-types.d.ts.map +1 -1
  80. package/dist/cookies/define-cookie.d.ts +87 -35
  81. package/dist/cookies/define-cookie.d.ts.map +1 -1
  82. package/dist/cookies/index.d.ts +2 -1
  83. package/dist/cookies/index.d.ts.map +1 -1
  84. package/dist/cookies/index.js +48 -2
  85. package/dist/cookies/index.js.map +1 -0
  86. package/dist/cookies/json-cookie.d.ts +64 -0
  87. package/dist/cookies/json-cookie.d.ts.map +1 -0
  88. package/dist/cookies/validation.d.ts +46 -0
  89. package/dist/cookies/validation.d.ts.map +1 -0
  90. package/dist/{plugins/dev-404-page.d.ts → dev-tools/404-page.d.ts} +1 -1
  91. package/dist/dev-tools/404-page.d.ts.map +1 -0
  92. package/dist/{plugins/dev-browser-logs.d.ts → dev-tools/browser-logs.d.ts} +1 -1
  93. package/dist/dev-tools/browser-logs.d.ts.map +1 -0
  94. package/dist/{plugins/dev-error-page.d.ts → dev-tools/error-page.d.ts} +2 -2
  95. package/dist/dev-tools/error-page.d.ts.map +1 -0
  96. package/dist/{server/dev-holding-server.d.ts → dev-tools/holding-server.d.ts} +1 -1
  97. package/dist/dev-tools/holding-server.d.ts.map +1 -0
  98. package/dist/dev-tools/index.d.ts +31 -0
  99. package/dist/dev-tools/index.d.ts.map +1 -0
  100. package/dist/{server/dev-span-processor.d.ts → dev-tools/instrumentation.d.ts} +26 -6
  101. package/dist/dev-tools/instrumentation.d.ts.map +1 -0
  102. package/dist/{server/dev-logger.d.ts → dev-tools/logger.d.ts} +1 -1
  103. package/dist/dev-tools/logger.d.ts.map +1 -0
  104. package/dist/{plugins/dev-logs.d.ts → dev-tools/logs.d.ts} +1 -1
  105. package/dist/dev-tools/logs.d.ts.map +1 -0
  106. package/dist/{plugins/dev-error-overlay.d.ts → dev-tools/overlay.d.ts} +3 -12
  107. package/dist/dev-tools/overlay.d.ts.map +1 -0
  108. package/dist/dev-tools/stack-classifier.d.ts +34 -0
  109. package/dist/dev-tools/stack-classifier.d.ts.map +1 -0
  110. package/dist/{plugins/dev-terminal-error.d.ts → dev-tools/terminal.d.ts} +2 -2
  111. package/dist/dev-tools/terminal.d.ts.map +1 -0
  112. package/dist/{server/dev-warnings.d.ts → dev-tools/warnings.d.ts} +1 -1
  113. package/dist/dev-tools/warnings.d.ts.map +1 -0
  114. package/dist/index.d.ts +1 -0
  115. package/dist/index.d.ts.map +1 -1
  116. package/dist/index.js +97 -72
  117. package/dist/index.js.map +1 -1
  118. package/dist/plugin-context.d.ts +1 -1
  119. package/dist/plugin-context.d.ts.map +1 -1
  120. package/dist/plugins/adapter-build.d.ts.map +1 -1
  121. package/dist/routing/convention-lint.d.ts.map +1 -1
  122. package/dist/routing/index.js +1 -1
  123. package/dist/routing/scanner.d.ts.map +1 -1
  124. package/dist/routing/status-file-lint.d.ts.map +1 -1
  125. package/dist/search-params/define.d.ts +25 -7
  126. package/dist/search-params/define.d.ts.map +1 -1
  127. package/dist/search-params/index.js +5 -3
  128. package/dist/search-params/index.js.map +1 -1
  129. package/dist/search-params/wrappers.d.ts +2 -2
  130. package/dist/search-params/wrappers.d.ts.map +1 -1
  131. package/dist/segment-params/define.d.ts +23 -6
  132. package/dist/segment-params/define.d.ts.map +1 -1
  133. package/dist/segment-params/index.js +1 -1
  134. package/dist/server/access-gate.d.ts +4 -3
  135. package/dist/server/access-gate.d.ts.map +1 -1
  136. package/dist/server/action-handler.d.ts +15 -6
  137. package/dist/server/action-handler.d.ts.map +1 -1
  138. package/dist/server/als-registry.d.ts +5 -5
  139. package/dist/server/als-registry.d.ts.map +1 -1
  140. package/dist/server/asset-headers.d.ts +1 -15
  141. package/dist/server/asset-headers.d.ts.map +1 -1
  142. package/dist/server/cookie-context.d.ts +170 -0
  143. package/dist/server/cookie-context.d.ts.map +1 -0
  144. package/dist/server/cookie-parsing.d.ts +51 -0
  145. package/dist/server/cookie-parsing.d.ts.map +1 -0
  146. package/dist/server/deny-boundary.d.ts +90 -0
  147. package/dist/server/deny-boundary.d.ts.map +1 -0
  148. package/dist/server/deny-renderer.d.ts.map +1 -1
  149. package/dist/server/early-hints-sender.d.ts.map +1 -1
  150. package/dist/server/index.d.ts +5 -4
  151. package/dist/server/index.d.ts.map +1 -1
  152. package/dist/server/index.js +4 -149
  153. package/dist/server/index.js.map +1 -1
  154. package/dist/server/internal.d.ts +6 -4
  155. package/dist/server/internal.d.ts.map +1 -1
  156. package/dist/server/internal.js +261 -408
  157. package/dist/server/internal.js.map +1 -1
  158. package/dist/server/logger.d.ts +14 -0
  159. package/dist/server/logger.d.ts.map +1 -1
  160. package/dist/server/middleware-runner.d.ts +17 -0
  161. package/dist/server/middleware-runner.d.ts.map +1 -1
  162. package/dist/server/param-coercion.d.ts +26 -0
  163. package/dist/server/param-coercion.d.ts.map +1 -0
  164. package/dist/server/pipeline-helpers.d.ts +14 -7
  165. package/dist/server/pipeline-helpers.d.ts.map +1 -1
  166. package/dist/server/pipeline-outcome.d.ts +49 -0
  167. package/dist/server/pipeline-outcome.d.ts.map +1 -0
  168. package/dist/server/pipeline-phases.d.ts +4 -49
  169. package/dist/server/pipeline-phases.d.ts.map +1 -1
  170. package/dist/server/pipeline.d.ts +0 -2
  171. package/dist/server/pipeline.d.ts.map +1 -1
  172. package/dist/server/request-context.d.ts +22 -159
  173. package/dist/server/request-context.d.ts.map +1 -1
  174. package/dist/server/route-element-builder.d.ts.map +1 -1
  175. package/dist/server/rsc-entry/action-middleware-runner.d.ts +66 -0
  176. package/dist/server/rsc-entry/action-middleware-runner.d.ts.map +1 -0
  177. package/dist/server/rsc-entry/helpers.d.ts +1 -1
  178. package/dist/server/rsc-entry/helpers.d.ts.map +1 -1
  179. package/dist/server/rsc-entry/index.d.ts.map +1 -1
  180. package/dist/server/rsc-entry/render-route.d.ts +50 -0
  181. package/dist/server/rsc-entry/render-route.d.ts.map +1 -0
  182. package/dist/server/rsc-entry/wrap-action-dispatch.d.ts +59 -14
  183. package/dist/server/rsc-entry/wrap-action-dispatch.d.ts.map +1 -1
  184. package/dist/server/state-tree-diff.d.ts.map +1 -1
  185. package/dist/server/tracing.d.ts +1 -1
  186. package/dist/server/tracing.d.ts.map +1 -1
  187. package/dist/server/tree-builder.d.ts +45 -16
  188. package/dist/server/tree-builder.d.ts.map +1 -1
  189. package/dist/server/types.d.ts +48 -0
  190. package/dist/server/types.d.ts.map +1 -1
  191. package/dist/server/utils/escape-html.d.ts +14 -0
  192. package/dist/server/utils/escape-html.d.ts.map +1 -0
  193. package/dist/shims/headers.d.ts +2 -2
  194. package/dist/shims/headers.d.ts.map +1 -1
  195. package/dist/shims/navigation-client.d.ts +3 -1
  196. package/dist/shims/navigation-client.d.ts.map +1 -1
  197. package/dist/shims/navigation.d.ts +9 -4
  198. package/dist/shims/navigation.d.ts.map +1 -1
  199. package/package.json +6 -7
  200. package/src/adapters/build-output-helper.ts +77 -0
  201. package/src/adapters/cloudflare.ts +10 -50
  202. package/src/adapters/nitro.ts +11 -45
  203. package/src/adapters/shared.ts +40 -0
  204. package/src/cache/timber-cache.ts +3 -2
  205. package/src/cli.ts +0 -0
  206. package/src/client/form.tsx +17 -25
  207. package/src/client/index.ts +16 -9
  208. package/src/client/internal.ts +3 -2
  209. package/src/client/router.ts +1 -1
  210. package/src/client/rsc-fetch.ts +15 -0
  211. package/src/client/state.ts +2 -2
  212. package/src/client/use-cookie.ts +29 -0
  213. package/src/codec.ts +3 -7
  214. package/src/config-types.ts +28 -0
  215. package/src/cookies/define-cookie.ts +271 -78
  216. package/src/cookies/index.ts +11 -8
  217. package/src/cookies/json-cookie.ts +105 -0
  218. package/src/cookies/validation.ts +134 -0
  219. package/src/{plugins/dev-404-page.ts → dev-tools/404-page.ts} +2 -7
  220. package/src/{plugins/dev-error-page.ts → dev-tools/error-page.ts} +5 -32
  221. package/src/dev-tools/index.ts +90 -0
  222. package/src/dev-tools/instrumentation.ts +176 -0
  223. package/src/{plugins/dev-logs.ts → dev-tools/logs.ts} +2 -2
  224. package/src/{plugins/dev-error-overlay.ts → dev-tools/overlay.ts} +5 -23
  225. package/src/dev-tools/stack-classifier.ts +75 -0
  226. package/src/{plugins/dev-terminal-error.ts → dev-tools/terminal.ts} +4 -38
  227. package/src/{server/dev-warnings.ts → dev-tools/warnings.ts} +1 -1
  228. package/src/index.ts +11 -3
  229. package/src/plugin-context.ts +1 -1
  230. package/src/plugins/adapter-build.ts +3 -1
  231. package/src/plugins/dev-server.ts +3 -3
  232. package/src/plugins/shims.ts +1 -1
  233. package/src/plugins/static-build.ts +1 -1
  234. package/src/routing/convention-lint.ts +5 -4
  235. package/src/routing/scanner.ts +5 -2
  236. package/src/routing/status-file-lint.ts +4 -2
  237. package/src/search-params/define.ts +71 -15
  238. package/src/search-params/wrappers.ts +9 -2
  239. package/src/segment-params/define.ts +66 -13
  240. package/src/server/access-gate.tsx +9 -8
  241. package/src/server/action-handler.ts +28 -38
  242. package/src/server/als-registry.ts +5 -5
  243. package/src/server/asset-headers.ts +8 -34
  244. package/src/server/cookie-context.ts +468 -0
  245. package/src/server/cookie-parsing.ts +135 -0
  246. package/src/server/{deny-page-resolver.ts → deny-boundary.ts} +78 -14
  247. package/src/server/deny-renderer.ts +2 -7
  248. package/src/server/early-hints-sender.ts +3 -2
  249. package/src/server/fallback-error.ts +1 -1
  250. package/src/server/index.ts +13 -14
  251. package/src/server/internal.ts +10 -3
  252. package/src/server/logger.ts +23 -0
  253. package/src/server/middleware-runner.ts +44 -0
  254. package/src/server/param-coercion.ts +76 -0
  255. package/src/server/pipeline-helpers.ts +37 -13
  256. package/src/server/pipeline-outcome.ts +167 -0
  257. package/src/server/pipeline-phases.ts +27 -209
  258. package/src/server/pipeline.ts +2 -9
  259. package/src/server/request-context.ts +46 -451
  260. package/src/server/route-element-builder.ts +7 -3
  261. package/src/server/rsc-entry/action-middleware-runner.ts +167 -0
  262. package/src/server/rsc-entry/error-renderer.ts +1 -1
  263. package/src/server/rsc-entry/helpers.ts +2 -7
  264. package/src/server/rsc-entry/index.ts +34 -273
  265. package/src/server/rsc-entry/render-route.ts +304 -0
  266. package/src/server/rsc-entry/rsc-payload.ts +1 -1
  267. package/src/server/rsc-entry/ssr-renderer.ts +2 -2
  268. package/src/server/rsc-entry/wrap-action-dispatch.ts +316 -23
  269. package/src/server/ssr-entry.ts +1 -1
  270. package/src/server/state-tree-diff.ts +4 -1
  271. package/src/server/tracing.ts +3 -3
  272. package/src/server/tree-builder.ts +128 -52
  273. package/src/server/types.ts +52 -0
  274. package/src/server/utils/escape-html.ts +20 -0
  275. package/src/shims/headers.ts +3 -3
  276. package/src/shims/navigation-client.ts +4 -3
  277. package/src/shims/navigation.ts +9 -7
  278. package/dist/_chunks/actions-DLnUaR65.js +0 -421
  279. package/dist/_chunks/actions-DLnUaR65.js.map +0 -1
  280. package/dist/_chunks/als-registry-HS0LGUl2.js +0 -41
  281. package/dist/_chunks/als-registry-HS0LGUl2.js.map +0 -1
  282. package/dist/_chunks/debug-ECi_61pb.js +0 -108
  283. package/dist/_chunks/debug-ECi_61pb.js.map +0 -1
  284. package/dist/_chunks/define-C77ScO0m.js.map +0 -1
  285. package/dist/_chunks/define-Itxvcd7F.js.map +0 -1
  286. package/dist/_chunks/define-cookie-BowvzoP0.js +0 -94
  287. package/dist/_chunks/define-cookie-BowvzoP0.js.map +0 -1
  288. package/dist/_chunks/dev-warnings-DpGRGoDi.js.map +0 -1
  289. package/dist/_chunks/merge-search-params-Cm_KIWDX.js +0 -41
  290. package/dist/_chunks/merge-search-params-Cm_KIWDX.js.map +0 -1
  291. package/dist/_chunks/request-context-CK5tZqIP.js +0 -478
  292. package/dist/_chunks/request-context-CK5tZqIP.js.map +0 -1
  293. package/dist/_chunks/router-ref-C8OCm7g7.js.map +0 -1
  294. package/dist/_chunks/tracing-CCYbKn5n.js +0 -238
  295. package/dist/_chunks/tracing-CCYbKn5n.js.map +0 -1
  296. package/dist/_chunks/use-params-IOPu7E8t.js.map +0 -1
  297. package/dist/_chunks/use-query-states-BiV5GJgm.js.map +0 -1
  298. package/dist/_chunks/walkers-VOXgavMF.js.map +0 -1
  299. package/dist/client/use-params.d.ts.map +0 -1
  300. package/dist/plugins/dev-404-page.d.ts.map +0 -1
  301. package/dist/plugins/dev-browser-logs.d.ts.map +0 -1
  302. package/dist/plugins/dev-error-overlay.d.ts.map +0 -1
  303. package/dist/plugins/dev-error-page.d.ts.map +0 -1
  304. package/dist/plugins/dev-logs.d.ts.map +0 -1
  305. package/dist/plugins/dev-terminal-error.d.ts.map +0 -1
  306. package/dist/server/deny-page-resolver.d.ts +0 -52
  307. package/dist/server/deny-page-resolver.d.ts.map +0 -1
  308. package/dist/server/dev-fetch-instrumentation.d.ts +0 -22
  309. package/dist/server/dev-fetch-instrumentation.d.ts.map +0 -1
  310. package/dist/server/dev-holding-server.d.ts.map +0 -1
  311. package/dist/server/dev-logger.d.ts.map +0 -1
  312. package/dist/server/dev-span-processor.d.ts.map +0 -1
  313. package/dist/server/dev-warnings.d.ts.map +0 -1
  314. package/dist/server/page-deny-boundary.d.ts +0 -31
  315. package/dist/server/page-deny-boundary.d.ts.map +0 -1
  316. package/src/server/dev-fetch-instrumentation.ts +0 -96
  317. package/src/server/dev-span-processor.ts +0 -78
  318. package/src/server/page-deny-boundary.tsx +0 -56
  319. /package/src/client/{use-params.ts → use-segment-params.ts} +0 -0
  320. /package/src/{plugins/dev-browser-logs.ts → dev-tools/browser-logs.ts} +0 -0
  321. /package/src/{server/dev-holding-server.ts → dev-tools/holding-server.ts} +0 -0
  322. /package/src/{server/dev-logger.ts → dev-tools/logger.ts} +0 -0
@@ -11,7 +11,7 @@ import type { RouteTree } from './routing/types';
11
11
  import type { BuildManifest } from './server/build-manifest';
12
12
  import type { StartupTimer } from './utils/startup-timer';
13
13
  import type { TimberUserConfig } from './config-types.js';
14
- import type { HoldingServer } from './server/dev-holding-server.js';
14
+ import type { HoldingServer } from './dev-tools/holding-server.js';
15
15
  export type { TimberUserConfig, ClientJavascriptConfig } from './config-types.js';
16
16
  /** Fully resolved client JavaScript configuration (no optionals). */
17
17
  export interface ResolvedClientJavascript {
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-context.d.ts","sourceRoot":"","sources":["../src/plugin-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,KAAK,EAAE,gBAAgB,EAA0B,MAAM,mBAAmB,CAAC;AAClF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAGpE,YAAY,EAAE,gBA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M,CAAC;AAGnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAG1D,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CA0D7D"}
1
+ {"version":3,"file":"adapter-build.d.ts","sourceRoot":"","sources":["../../src/plugins/adapter-build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAI1D,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CA0D7D"}
@@ -1 +1 @@
1
- {"version":3,"file":"convention-lint.d.ts","sourceRoot":"","sources":["../../src/routing/convention-lint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,YAAY,CAAC;AAIzD,MAAM,WAAW,iBAAiB;IAChC,kDAAkD;IAClD,EAAE,EAAE,MAAM,CAAC;IACX,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,OAAO,EAAE,MAAM,CAAC;IAChB,qFAAqF;IACrF,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;CACzB;AAID;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,iBAAiB,EAAE,CAqBpF;AAwOD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI,CAe1E;AAUD;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,iBAAiB,EAAE,GAAG,MAAM,CAgC9E"}
1
+ {"version":3,"file":"convention-lint.d.ts","sourceRoot":"","sources":["../../src/routing/convention-lint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,YAAY,CAAC;AAKzD,MAAM,WAAW,iBAAiB;IAChC,kDAAkD;IAClD,EAAE,EAAE,MAAM,CAAC;IACX,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,OAAO,EAAE,MAAM,CAAC;IAChB,qFAAqF;IACrF,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;CACzB;AAID;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,iBAAiB,EAAE,CAqBpF;AAwOD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI,CAe1E;AAUD;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,iBAAiB,EAAE,GAAG,MAAM,CAgC9E"}
@@ -1,3 +1,3 @@
1
1
  import { i as INTERCEPTION_MARKERS, n as classifyUrlSegment, r as DEFAULT_PAGE_EXTENSIONS, t as classifySegment } from "../_chunks/segment-classify-BjfuctV2.js";
2
- import { i as scanRoutes, n as collectInterceptionRewrites, r as generateRouteMap, t as collectLeafRoutes } from "../_chunks/walkers-VOXgavMF.js";
2
+ import { i as scanRoutes, n as collectInterceptionRewrites, r as generateRouteMap, t as collectLeafRoutes } from "../_chunks/walkers-Tg0Alwcg.js";
3
3
  export { DEFAULT_PAGE_EXTENSIONS, INTERCEPTION_MARKERS, classifySegment, classifyUrlSegment, collectInterceptionRewrites, collectLeafRoutes, generateRouteMap, scanRoutes };
@@ -1 +1 @@
1
- {"version":3,"file":"scanner.d.ts","sourceRoot":"","sources":["../../src/routing/scanner.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EACV,SAAS,EAIT,aAAa,EAEd,MAAM,YAAY,CAAC;AA8CpB;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,GAAE,aAAkB,GAAG,SAAS,CAoChF"}
1
+ {"version":3,"file":"scanner.d.ts","sourceRoot":"","sources":["../../src/routing/scanner.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EACV,SAAS,EAIT,aAAa,EAEd,MAAM,YAAY,CAAC;AA+CpB;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,GAAE,aAAkB,GAAG,SAAS,CAoChF"}
@@ -1 +1 @@
1
- {"version":3,"file":"status-file-lint.d.ts","sourceRoot":"","sources":["../../src/routing/status-file-lint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,YAAY,CAAC;AAMzD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,SAAS,GAAG,qBAAqB,EAAE,CAIjF;AAoDD;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,qBAAqB,EAAE,GAAG,MAAM,CAiBtF"}
1
+ {"version":3,"file":"status-file-lint.d.ts","sourceRoot":"","sources":["../../src/routing/status-file-lint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,YAAY,CAAC;AAOzD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,SAAS,GAAG,qBAAqB,EAAE,CAIjF;AAqDD;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,qBAAqB,EAAE,GAAG,MAAM,CAiBtF"}
@@ -16,7 +16,7 @@ import type { Codec } from '../codec.js';
16
16
  * from request-context.ts to avoid dynamic import at call time.
17
17
  * @internal
18
18
  */
19
- export declare function _setGetSearchParamsFn(fn: () => Promise<URLSearchParams>): void;
19
+ export declare function _setGetSearchParamsFn(fn: () => URLSearchParams): void;
20
20
  /**
21
21
  * A codec that converts between URL string values and typed values.
22
22
  *
@@ -72,19 +72,18 @@ export interface SearchParamsDefinition<T extends Record<string, unknown>> {
72
72
  /**
73
73
  * Get typed search params from the current request context (ALS-backed).
74
74
  *
75
- * Server-only reads getSearchParams() from ALS and parses through codecs.
76
- * Throws on client. Eliminates the naming conflict between the definition
77
- * export and the server helper.
75
+ * Server-only, sync. Reads getSearchParams() from ALS and parses through codecs.
76
+ * Throws on client.
78
77
  *
79
78
  * ```tsx
80
79
  * // app/products/page.tsx
81
80
  * import { searchParams } from './params'
82
- * export default async function Page() {
83
- * const { page, category } = await searchParams.get()
81
+ * export default function Page() {
82
+ * const { page, category } = searchParams.get()
84
83
  * }
85
84
  * ```
86
85
  */
87
- get(): Promise<T>;
86
+ get(): T;
88
87
  /** Client hook — reads current URL params and returns typed values + setter. */
89
88
  useQueryStates(options?: QueryStatesOptions): [T, SetParams<T>];
90
89
  /** Extend with additional codecs or Standard Schema objects. */
@@ -133,6 +132,25 @@ export type SearchParamField<T = unknown> = SearchParamCodec<T> | StandardSchema
133
132
  * })
134
133
  * ```
135
134
  */
135
+ /**
136
+ * Overload: accept a Standard Schema object schema (e.g., z.object({...})).
137
+ *
138
+ * The schema must have a `.shape` property whose values are themselves
139
+ * Standard Schema objects. Each shape property becomes a field codec
140
+ * via fromSchema().
141
+ *
142
+ * ```ts
143
+ * const searchParams = defineSearchParams(
144
+ * z.object({ page: z.coerce.number().default(1), q: z.string().optional() })
145
+ * )
146
+ * ```
147
+ */
148
+ export declare function defineSearchParams<T extends Record<string, unknown>>(schema: StandardSchemaV1<T> & {
149
+ shape: Record<string, StandardSchemaV1<unknown>>;
150
+ }): SearchParamsDefinition<T>;
151
+ /**
152
+ * Overload: accept a map of codecs and/or Standard Schema objects.
153
+ */
136
154
  export declare function defineSearchParams<C extends Record<string, SearchParamField>>(codecs: C): SearchParamsDefinition<{
137
155
  [K in keyof C]: InferField<C[K]>;
138
156
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"define.d.ts","sourceRoot":"","sources":["../../src/search-params/define.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAYzC;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,MAAM,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI,CAE9E;AAgBD;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC,CAAE,SAAQ,KAAK,CAAC,CAAC,CAAC;IACnD,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,8DAA8D;AAC9D,MAAM,WAAW,0BAA0B,CAAC,CAAC,CAAE,SAAQ,gBAAgB,CAAC,CAAC,CAAC;IACxE,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wCAAwC;AACxC,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,SAAS,gBAAgB,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAE5E,uCAAuC;AACvC,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI;KACvD,CAAC,IAAI,MAAM,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACvC,CAAC;AAEF,yCAAyC;AACzC,MAAM,WAAW,gBAAgB;IAC/B,4DAA4D;IAC5D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kDAAkD;IAClD,MAAM,CAAC,EAAE,OAAO,CAAC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AC,GAAG,OAAO,IAAI,gBAAgB,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;AAmFtF;;;;;;;;;;;;;;;;GAgBG;AACH;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClE,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAA;CAAE,GACjF,sBAAsB,CAAC,CAAC,CAAC,CAAC;AAE7B;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,EAC3E,MAAM,EAAE,CAAC,GACR,sBAAsB,CAAC;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC,CAAC"}
@@ -1,5 +1,6 @@
1
- import { i as registerSearchParams, r as getSearchParamsDefinition } from "../_chunks/use-query-states-BiV5GJgm.js";
2
- import { n as defineSearchParams } from "../_chunks/define-Itxvcd7F.js";
1
+ import { n as registerSearchParams, t as getSearchParamsDefinition } from "../_chunks/registry-I2ss-lvy.js";
2
+ import { i as isStandardSchema, n as fromSchema, r as isCodec } from "../_chunks/schema-bridge-Cxu4l-7p.js";
3
+ import { n as defineSearchParams } from "../_chunks/define-B-Q_UMOD.js";
3
4
  //#region src/search-params/wrappers.ts
4
5
  /**
5
6
  * Wrap a nullable codec with a default value. When the inner codec returns
@@ -52,7 +53,8 @@ function withDefault(codec, defaultValue) {
52
53
  * withUrlKey(withDefault(parseAsInteger, 1), 'p')
53
54
  * ```
54
55
  */
55
- function withUrlKey(codec, urlKey) {
56
+ function withUrlKey(codecOrSchema, urlKey) {
57
+ const codec = isCodec(codecOrSchema) ? codecOrSchema : isStandardSchema(codecOrSchema) ? fromSchema(codecOrSchema) : codecOrSchema;
56
58
  return {
57
59
  parse: codec.parse.bind(codec),
58
60
  serialize: codec.serialize.bind(codec),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/search-params/wrappers.ts"],"sourcesContent":["/**\n * Codec wrappers — withDefault and withUrlKey.\n *\n * These are timber-specific utilities that work with any SearchParamCodec.\n * For actual codecs (string, integer, boolean, etc.), use nuqs parsers\n * or Standard Schema objects (Zod, Valibot, ArkType) with auto-detection.\n *\n * Design doc: design/23-search-params.md\n */\n\nimport type { SearchParamCodec, SearchParamCodecWithUrlKey } from './define.js';\n\n// ---------------------------------------------------------------------------\n// withDefault\n// ---------------------------------------------------------------------------\n\n/**\n * Wrap a nullable codec with a default value. When the inner codec returns\n * null, the default is used instead. The output type becomes non-nullable.\n *\n * Works with any codec — nuqs parsers, custom codecs, fromSchema results.\n *\n * ```ts\n * import { parseAsInteger } from 'nuqs'\n * import { withDefault } from '@timber-js/app/search-params'\n *\n * const page = withDefault(parseAsInteger, 1)\n * // page.parse(undefined) → 1 (not null)\n * // page.parse('5') → 5\n * ```\n */\nexport function withDefault<T>(\n codec: SearchParamCodec<T | null>,\n defaultValue: T\n): SearchParamCodec<T> {\n return {\n parse(value: string | string[] | undefined): T {\n const result = codec.parse(value);\n return result === null ? defaultValue : result;\n },\n serialize(value: T): string | null {\n return codec.serialize(value);\n },\n };\n}\n\n// ---------------------------------------------------------------------------\n// withUrlKey\n// ---------------------------------------------------------------------------\n\n/**\n * Attach a URL key alias to a codec. The alias determines what query\n * parameter key is used in the URL, while the TypeScript property name\n * stays descriptive.\n *\n * Aliases travel with codecs through object spread composition — when\n * you spread a bundle containing aliased codecs into defineSearchParams,\n * the aliases come along automatically.\n *\n * ```ts\n * import { parseAsString } from 'nuqs'\n * import { withUrlKey } from '@timber-js/app/search-params'\n *\n * export const searchable = {\n * q: withUrlKey(parseAsString, 'search'),\n * // ?search=shoes → { q: 'shoes' }\n * }\n * ```\n *\n * Composes with withDefault:\n * ```ts\n * import { parseAsInteger } from 'nuqs'\n * withUrlKey(withDefault(parseAsInteger, 1), 'p')\n * ```\n */\nexport function withUrlKey<T>(\n codec: SearchParamCodec<T>,\n urlKey: string\n): SearchParamCodecWithUrlKey<T> {\n return {\n parse: codec.parse.bind(codec),\n serialize: codec.serialize.bind(codec),\n urlKey,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA+BA,SAAgB,YACd,OACA,cACqB;AACrB,QAAO;EACL,MAAM,OAAyC;GAC7C,MAAM,SAAS,MAAM,MAAM,MAAM;AACjC,UAAO,WAAW,OAAO,eAAe;;EAE1C,UAAU,OAAyB;AACjC,UAAO,MAAM,UAAU,MAAM;;EAEhC;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCH,SAAgB,WACd,OACA,QAC+B;AAC/B,QAAO;EACL,OAAO,MAAM,MAAM,KAAK,MAAM;EAC9B,WAAW,MAAM,UAAU,KAAK,MAAM;EACtC;EACD"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/search-params/wrappers.ts"],"sourcesContent":["/**\n * Codec wrappers — withDefault and withUrlKey.\n *\n * These are timber-specific utilities that work with any SearchParamCodec.\n * For actual codecs (string, integer, boolean, etc.), use nuqs parsers\n * or Standard Schema objects (Zod, Valibot, ArkType) with auto-detection.\n *\n * Design doc: design/23-search-params.md\n */\n\nimport type { SearchParamCodec, SearchParamCodecWithUrlKey, SearchParamField } from './define.js';\nimport { isCodec, isStandardSchema, fromSchema } from '../schema-bridge.js';\n\n// ---------------------------------------------------------------------------\n// withDefault\n// ---------------------------------------------------------------------------\n\n/**\n * Wrap a nullable codec with a default value. When the inner codec returns\n * null, the default is used instead. The output type becomes non-nullable.\n *\n * Works with any codec — nuqs parsers, custom codecs, fromSchema results.\n *\n * ```ts\n * import { parseAsInteger } from 'nuqs'\n * import { withDefault } from '@timber-js/app/search-params'\n *\n * const page = withDefault(parseAsInteger, 1)\n * // page.parse(undefined) → 1 (not null)\n * // page.parse('5') → 5\n * ```\n */\nexport function withDefault<T>(\n codec: SearchParamCodec<T | null>,\n defaultValue: T\n): SearchParamCodec<T> {\n return {\n parse(value: string | string[] | undefined): T {\n const result = codec.parse(value);\n return result === null ? defaultValue : result;\n },\n serialize(value: T): string | null {\n return codec.serialize(value);\n },\n };\n}\n\n// ---------------------------------------------------------------------------\n// withUrlKey\n// ---------------------------------------------------------------------------\n\n/**\n * Attach a URL key alias to a codec. The alias determines what query\n * parameter key is used in the URL, while the TypeScript property name\n * stays descriptive.\n *\n * Aliases travel with codecs through object spread composition — when\n * you spread a bundle containing aliased codecs into defineSearchParams,\n * the aliases come along automatically.\n *\n * ```ts\n * import { parseAsString } from 'nuqs'\n * import { withUrlKey } from '@timber-js/app/search-params'\n *\n * export const searchable = {\n * q: withUrlKey(parseAsString, 'search'),\n * // ?search=shoes → { q: 'shoes' }\n * }\n * ```\n *\n * Composes with withDefault:\n * ```ts\n * import { parseAsInteger } from 'nuqs'\n * withUrlKey(withDefault(parseAsInteger, 1), 'p')\n * ```\n */\nexport function withUrlKey<T>(\n codecOrSchema: SearchParamField<T>,\n urlKey: string\n): SearchParamCodecWithUrlKey<T> {\n // Auto-detect Standard Schema (Zod, Valibot, ArkType) and wrap\n const codec: SearchParamCodec<T> = isCodec(codecOrSchema)\n ? codecOrSchema\n : isStandardSchema(codecOrSchema)\n ? fromSchema(codecOrSchema)\n : (codecOrSchema as SearchParamCodec<T>);\n return {\n parse: codec.parse.bind(codec),\n serialize: codec.serialize.bind(codec),\n urlKey,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAgCA,SAAgB,YACd,OACA,cACqB;AACrB,QAAO;EACL,MAAM,OAAyC;GAC7C,MAAM,SAAS,MAAM,MAAM,MAAM;AACjC,UAAO,WAAW,OAAO,eAAe;;EAE1C,UAAU,OAAyB;AACjC,UAAO,MAAM,UAAU,MAAM;;EAEhC;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCH,SAAgB,WACd,eACA,QAC+B;CAE/B,MAAM,QAA6B,QAAQ,cAAc,GACrD,gBACA,iBAAiB,cAAc,GAC7B,WAAW,cAAc,GACxB;AACP,QAAO;EACL,OAAO,MAAM,MAAM,KAAK,MAAM;EAC9B,WAAW,MAAM,UAAU,KAAK,MAAM;EACtC;EACD"}
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * Design doc: design/23-search-params.md
9
9
  */
10
- import type { SearchParamCodec, SearchParamCodecWithUrlKey } from './define.js';
10
+ import type { SearchParamCodec, SearchParamCodecWithUrlKey, SearchParamField } from './define.js';
11
11
  /**
12
12
  * Wrap a nullable codec with a default value. When the inner codec returns
13
13
  * null, the default is used instead. The output type becomes non-nullable.
@@ -49,5 +49,5 @@ export declare function withDefault<T>(codec: SearchParamCodec<T | null>, defaul
49
49
  * withUrlKey(withDefault(parseAsInteger, 1), 'p')
50
50
  * ```
51
51
  */
52
- export declare function withUrlKey<T>(codec: SearchParamCodec<T>, urlKey: string): SearchParamCodecWithUrlKey<T>;
52
+ export declare function withUrlKey<T>(codecOrSchema: SearchParamField<T>, urlKey: string): SearchParamCodecWithUrlKey<T>;
53
53
  //# sourceMappingURL=wrappers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"wrappers.d.ts","sourceRoot":"","sources":["../../src/search-params/wrappers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAMhF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,KAAK,EAAE,gBAAgB,CAAC,CAAC,GAAG,IAAI,CAAC,EACjC,YAAY,EAAE,CAAC,GACd,gBAAgB,CAAC,CAAC,CAAC,CAUrB;AAMD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAC1B,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAC1B,MAAM,EAAE,MAAM,GACb,0BAA0B,CAAC,CAAC,CAAC,CAM/B"}
1
+ {"version":3,"file":"wrappers.d.ts","sourceRoot":"","sources":["../../src/search-params/wrappers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAOlG;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,KAAK,EAAE,gBAAgB,CAAC,CAAC,GAAG,IAAI,CAAC,EACjC,YAAY,EAAE,CAAC,GACd,gBAAgB,CAAC,CAAC,CAAC,CAUrB;AAMD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAC1B,aAAa,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAClC,MAAM,EAAE,MAAM,GACb,0BAA0B,CAAC,CAAC,CAAC,CAY/B"}
@@ -14,12 +14,18 @@
14
14
  */
15
15
  import type { Codec } from '../codec.js';
16
16
  import { type StandardSchemaV1 } from '../schema-bridge.js';
17
+ /**
18
+ * Register the client useSegmentParams hook.
19
+ * Called by client entry at module load time to avoid require() at call time.
20
+ * @internal
21
+ */
22
+ export declare function _registerUseSegmentParams(hook: () => Record<string, string | string[]>): void;
17
23
  /**
18
24
  * Register the getSegmentParams function. Called once at module load time
19
25
  * from request-context.ts to avoid dynamic import at call time.
20
26
  * @internal
21
27
  */
22
- export declare function _setGetSegmentParamsFn(fn: () => Promise<Record<string, string | string[]>>): void;
28
+ export declare function _setGetSegmentParamsFn(fn: () => Record<string, string | string[]>): void;
23
29
  /** Infer the output type from a Codec or StandardSchemaV1. */
24
30
  export type InferParamField<V> = V extends Codec<infer T> ? T : V extends StandardSchemaV1<infer T> ? T : never;
25
31
  /** Acceptable field value for defineParams: a Codec or a Standard Schema. */
@@ -39,8 +45,7 @@ export interface ParamsDefinition<T extends Record<string, unknown>> {
39
45
  /**
40
46
  * Get typed segment params from the current request context (ALS).
41
47
  *
42
- * Server-only. Reads getSegmentParams() from ALS and coerces through
43
- * this definition's codecs, returning fully typed params.
48
+ * Server-only, sync.
44
49
  *
45
50
  * ```ts
46
51
  * // app/products/[id]/params.ts
@@ -48,12 +53,24 @@ export interface ParamsDefinition<T extends Record<string, unknown>> {
48
53
  *
49
54
  * // app/products/[id]/page.tsx
50
55
  * import { segmentParams } from './params'
51
- * export default async function Page() {
52
- * const { id } = await segmentParams.get() // id: number
56
+ * export default function Page() {
57
+ * const { id } = segmentParams.get() // id: number
58
+ * }
59
+ * ```
60
+ */
61
+ get(): T;
62
+ /**
63
+ * Client hook for accessing typed segment params reactively.
64
+ *
65
+ * ```tsx
66
+ * 'use client'
67
+ * import { segmentParams } from './params'
68
+ * export function ProductHeader() {
69
+ * const { id } = segmentParams.useSegmentParams()
53
70
  * }
54
71
  * ```
55
72
  */
56
- get(): Promise<T>;
73
+ useSegmentParams(): T;
57
74
  /** Read-only codec map. */
58
75
  codecs: {
59
76
  [K in keyof T]: Codec<T[K]>;
@@ -1 +1 @@
1
- {"version":3,"file":"define.d.ts","sourceRoot":"","sources":["../../src/segment-params/define.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,KAAK,gBAAgB,EAItB,MAAM,qBAAqB,CAAC;AAU7B;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC,GAAG,IAAI,CAEjG;AAgBD,8DAA8D;AAC9D,MAAM,MAAM,eAAe,CAAC,CAAC,IAC3B,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,gBAAgB,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAEjF,6EA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GACR,gBAAgB,CAAC;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC,CA0F7D"}
@@ -1,2 +1,2 @@
1
- import { n as defineSegmentParams } from "../_chunks/define-C77ScO0m.js";
1
+ import { r as defineSegmentParams } from "../_chunks/define-CfBPoJb0.js";
2
2
  export { defineSegmentParams };
@@ -12,7 +12,8 @@
12
12
  *
13
13
  * See design/04-authorization.md and design/02-rendering-pipeline.md §"AccessGate"
14
14
  */
15
- import type { AccessGateProps, SlotAccessGateProps, ReactElement } from './tree-builder.js';
15
+ import type { AccessGateProps, SlotAccessGateProps } from './tree-builder.js';
16
+ import type { ReactNode } from 'react';
16
17
  /**
17
18
  * Framework-injected access gate for segments.
18
19
  *
@@ -27,7 +28,7 @@ import type { AccessGateProps, SlotAccessGateProps, ReactElement } from './tree-
27
28
  * access.ts is a pure gate — return values are discarded. The layout below
28
29
  * gets the same data by calling the same cached functions (React.cache dedup).
29
30
  */
30
- export declare function AccessGate(props: AccessGateProps): ReactElement | Promise<ReactElement>;
31
+ export declare function AccessGate(props: AccessGateProps): ReactNode | Promise<ReactNode>;
31
32
  /**
32
33
  * Framework-injected access gate for parallel slots.
33
34
  *
@@ -42,5 +43,5 @@ export declare function AccessGate(props: AccessGateProps): ReactElement | Promi
42
43
  * redirect() in slot access.ts is a dev-mode error — redirecting from a
43
44
  * slot doesn't make architectural sense.
44
45
  */
45
- export declare function SlotAccessGate(props: SlotAccessGateProps): Promise<ReactElement>;
46
+ export declare function SlotAccessGate(props: SlotAccessGateProps): Promise<ReactNode>;
46
47
  //# sourceMappingURL=access-gate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"access-gate.d.ts","sourceRoot":"","sources":["../../src/server/access-gate.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAQ5F;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAevF;AAiDD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,YAAY,CAAC,CAkDtF"}
1
+ {"version":3,"file":"access-gate.d.ts","sourceRoot":"","sources":["../../src/server/access-gate.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAK9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAejF;AAiDD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,SAAS,CAAC,CAkDnF"}
@@ -39,6 +39,12 @@ export interface ActionDispatchConfig {
39
39
  * - With JS: POST with `x-rsc-action` header (client callServer dispatch)
40
40
  * - Without JS: POST with form data containing `$ACTION_REF` or `$ACTION_KEY`
41
41
  * (React's progressive enhancement hidden fields)
42
+ *
43
+ * **Important:** This function returns true for ANY POST with a form
44
+ * Content-Type, including non-action POSTs to route.ts API handlers.
45
+ * The caller (wrap-action-dispatch.ts) MUST check the matched route type
46
+ * before entering the action path — route.ts matches skip action detection
47
+ * entirely so their body is not pre-parsed. See TIM-870.
42
48
  */
43
49
  export declare function isActionRequest(req: Request): boolean;
44
50
  /**
@@ -52,16 +58,19 @@ export declare function isActionRequest(req: Request): boolean;
52
58
  * final HTML response. Without this, cookies set inside the action are
53
59
  * silently dropped from the response. See TIM-836 (LOCAL-740).
54
60
  *
55
- * - `cookieHeader`: the post-action read-your-own-writes view of the
56
- * cookie jar, serialized as a `Cookie:` request header. The rerender
57
- * pipeline uses this to clone the request before re-rendering, so the
58
- * page server components see the action's cookie writes immediately
59
- * instead of the stale pre-action state. See TIM-837.
61
+ * - `cookies`: the post-action read-your-own-writes view of the cookie
62
+ * jar, as the same `Map<string, string>` shape used by the request
63
+ * context's `parsedCookies`. The rerender dispatcher seeds this map
64
+ * directly into the rerender request context via `seedRequestCookies`,
65
+ * bypassing any string round-trip through a `Cookie:` header. The
66
+ * direct-Map seed eliminates the value-smuggling primitive that the
67
+ * previous `cookieHeader: string` shape carried — see
68
+ * ONGOING_SECURITY.md H-3 (TIM-868) and TIM-837.
60
69
  */
61
70
  export interface FormRerender {
62
71
  rerender: FormFlashData;
63
72
  setCookieHeaders: string[];
64
- cookieHeader: string;
73
+ cookies: Map<string, string>;
65
74
  }
66
75
  /**
67
76
  * Handle a server action request.
@@ -1 +1 @@
1
- {"version":3,"file":"action-handler.d.ts","sourceRoot":"","sources":["../../src/server/action-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AASH,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAQtE,OAAO,EAAwC,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAE/F,OAAO,EAIL,KAAK,qBAAqB,EAC3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAMrD,4CAA4C;AAC5C,MAAM,WAAW,oBAAoB;IACnC,0BAA0B;IAC1B,IAAI,EAAE,UAAU,CAAC;IACjB,kEAAkE;IAClE,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,gDAAgD;IAChD,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B;;;;OAIG;IACH,eAAe,CAAC,EAAE,qBAAqB,CAAC;CACzC;AAQD;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AgB,EAAE,MAAM,EAAE,CAAC;IAC3B,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,QAAQ,GAAG,YAAY,GAAG,IAAI,CAAC,CA6EzC"}
@@ -33,25 +33,25 @@ export interface RequestContextStore {
33
33
  /** Original (pre-overlay) frozen headers, kept for overlay merging. */
34
34
  originalHeaders: Headers;
35
35
  /**
36
- * Promise resolving to the raw URLSearchParams for the current request.
36
+ * Raw URLSearchParams for the current request.
37
37
  * To get typed parsed params, import a search params definition and
38
38
  * call `.parse(searchParams())`.
39
39
  */
40
- searchParamsPromise: Promise<URLSearchParams>;
40
+ searchParams: URLSearchParams;
41
41
  /**
42
42
  * Raw search string from the request URL (e.g. "?foo=bar&baz=1").
43
43
  * Available synchronously for use in `redirect()` with `preserveSearchParams`.
44
44
  */
45
45
  searchString: string;
46
46
  /**
47
- * Promise resolving to the coerced segment params for the current request.
47
+ * Coerced segment params for the current request.
48
48
  * Set by the pipeline after route matching and param coercion, before
49
49
  * middleware and rendering. Pages and layouts read params via
50
50
  * `getSegmentParams()` instead of receiving them as a prop.
51
51
  *
52
52
  * See design/07-routing.md §"params.ts — Convention File for Typed Params"
53
53
  */
54
- segmentParamsPromise?: Promise<Record<string, string | string[]>>;
54
+ segmentParams?: Record<string, string | string[]>;
55
55
  /** Outgoing Set-Cookie entries (name → serialized value + options). Last write wins. */
56
56
  cookieJar: Map<string, CookieEntry>;
57
57
  /** Whether the response has flushed (headers committed). */
@@ -76,7 +76,7 @@ export interface RequestContextStore {
76
76
  export interface CookieEntry {
77
77
  name: string;
78
78
  value: string;
79
- options: import('./request-context.js').CookieOptions;
79
+ options: import('./cookie-context.js').CookieOptions;
80
80
  }
81
81
  export interface TraceStore {
82
82
  /** 32-char lowercase hex trace ID (OTEL or UUID fallback).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AAM,EAAE,CAAC;CAChB;AAED,mDAAmD;AACnD,eAAO,MAAM,eAAe,sCAA6C,CAAC;AAM1E,sDAAsD;AACtD,eAAO,MAAM,YAAY,4DAAmE,CAAC;AAM7F,4EAA4E;AAC5E,MAAM,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;AAE3D,8DAA8D;AAC9D,eAAO,MAAM,mBAAmB,uCAA8C,CAAC;AAM/E,6EAA6E;AAC7E,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;AAE9D,4DAA4D;AAC5D,eAAO,MAAM,YAAY,gCAAuC,CAAC"}
@@ -14,10 +14,7 @@
14
14
  *
15
15
  * Design docs: 18-build-system.md, 06-caching.md
16
16
  */
17
- /** Cache-Control value for hashed (immutable) assets. */
18
- export declare const IMMUTABLE_CACHE = "public, max-age=31536000, immutable";
19
- /** Cache-Control value for unhashed static assets. */
20
- export declare const STATIC_CACHE = "public, max-age=3600, must-revalidate";
17
+ export { IMMUTABLE_CACHE, STATIC_CACHE, generateHeadersFile } from '../adapters/shared.js';
21
18
  /**
22
19
  * Check if a URL path looks like a hashed asset.
23
20
  */
@@ -28,15 +25,4 @@ export declare function isHashedAsset(pathname: string): boolean;
28
25
  * Returns `immutable` for hashed assets, short-lived for unhashed.
29
26
  */
30
27
  export declare function getAssetCacheControl(pathname: string): string;
31
- /**
32
- * Generate a `_headers` file for static asset cache control.
33
- *
34
- * The `_headers` file is a platform convention supported by Cloudflare Workers
35
- * Static Assets, Cloudflare Pages, and Netlify. It maps URL patterns to
36
- * HTTP response headers.
37
- *
38
- * Vite places all hashed chunks under `/assets/` — these get immutable caching.
39
- * Everything else (favicon.ico, robots.txt, etc.) gets a shorter cache.
40
- */
41
- export declare function generateHeadersFile(): string;
42
28
  //# sourceMappingURL=asset-headers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"asset-headers.d.ts","sourceRoot":"","sources":["../../src/server/asset-headers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAuBH,yDAAyD;AACzD,eAAO,MAAM,eAAe,wCAA2C,CAAC;AAExE,sDAAsD;AACtD,eAAO,MAAM,YAAY,0CAAiD,CAAC;AAE3E;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAU5C"}
1
+ {"version":3,"file":"asset-headers.d.ts","sourceRoot":"","sources":["../../src/server/asset-headers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAQH,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAiB3F;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE7D"}
@@ -0,0 +1,170 @@
1
+ /**
2
+ * Cookie Context — per-request cookie API and on-the-wire helpers.
3
+ *
4
+ * Split out of `request-context.ts` (TIM-853) so the cookie subsystem
5
+ * — encoding contract, options grammar, parser, serializer, RYW map,
6
+ * and rerender seed — lives in one file. The headers/scope/params APIs
7
+ * stay in `request-context.ts` and call into this module via the
8
+ * exported helpers.
9
+ *
10
+ * See design/29-cookies.md for the encoding contract and read-your-own-
11
+ * writes semantics. See ONGOING_SECURITY.md H-3 (TIM-868) for the
12
+ * smuggling primitive that the encoding contract closes.
13
+ */
14
+ import { assertValidCookieName, assertValidCookieValue } from '../cookies/validation.js';
15
+ export { assertValidCookieName, assertValidCookieValue };
16
+ /**
17
+ * Returns a cookie accessor for the current request.
18
+ *
19
+ * Available in middleware, access checks, server components, and server actions.
20
+ * Throws if called outside a request context (security principle #2: no global fallback).
21
+ *
22
+ * Read methods (.get, .has, .getAll) are always available and reflect
23
+ * read-your-own-writes from .set() calls in the same request.
24
+ *
25
+ * Mutation methods (.set, .delete, .clear) are only available in mutable
26
+ * contexts (middleware.ts, server actions, route.ts handlers). Calling them
27
+ * in read-only contexts (access.ts, server components) throws.
28
+ *
29
+ * This is the escape hatch for direct cookie jar operations. For typed
30
+ * cookie access, use `defineCookie()` instead.
31
+ *
32
+ * See design/29-cookies.md
33
+ */
34
+ export declare function getCookieJar(): RequestCookies;
35
+ /**
36
+ * Returns the value of a single cookie, or undefined if absent.
37
+ *
38
+ * @internal — not part of the public API. Use `defineCookie().get()` or `getCookieJar().get()` instead.
39
+ */
40
+ export declare function getCookie(name: string): string | undefined;
41
+ /**
42
+ * Per-call options for `getCookies().set()`. Extends the persistent
43
+ * `CookieOptions` (HTTP cookie attributes) with framework-only flags
44
+ * that are NOT serialized into the Set-Cookie header.
45
+ *
46
+ * The `raw` flag is the escape hatch for the auto-encoding contract.
47
+ * See design/29-cookies.md §"Encoding Contract".
48
+ */
49
+ export interface SetCookieOptions extends CookieOptions {
50
+ /**
51
+ * Skip the framework's `encodeURIComponent` pass and store the value
52
+ * verbatim. The value is then validated against the strict RFC 6265
53
+ * §4.1.1 `cookie-octet` grammar — the H-3 smuggling primitive cannot
54
+ * sneak in via this opt-out.
55
+ *
56
+ * Use this when forwarding a cookie value that is already in its
57
+ * intended on-the-wire form (e.g. mirroring an upstream service's
58
+ * Set-Cookie). Default: `false` (auto-encode).
59
+ */
60
+ raw?: boolean;
61
+ }
62
+ /** Options for setting a cookie. See design/29-cookies.md. */
63
+ export interface CookieOptions {
64
+ /** Domain scope. Default: omitted (current domain only). */
65
+ domain?: string;
66
+ /** URL path scope. Default: '/'. */
67
+ path?: string;
68
+ /** Expiration date. Mutually exclusive with maxAge. */
69
+ expires?: Date;
70
+ /** Max age in seconds. Mutually exclusive with expires. */
71
+ maxAge?: number;
72
+ /** Prevent client-side JS access. Default: true. */
73
+ httpOnly?: boolean;
74
+ /** Only send over HTTPS. Default: true. */
75
+ secure?: boolean;
76
+ /** Cross-site request policy. Default: 'lax'. */
77
+ sameSite?: 'strict' | 'lax' | 'none';
78
+ /** Partitioned (CHIPS) — isolate cookie per top-level site. Default: false. */
79
+ partitioned?: boolean;
80
+ }
81
+ /**
82
+ * Cookie accessor returned by `getCookies()`.
83
+ *
84
+ * Read methods are always available. Mutation methods throw in read-only
85
+ * contexts (access.ts, server components).
86
+ */
87
+ export interface RequestCookies {
88
+ /** Get a cookie value by name. Returns undefined if not present. */
89
+ get(name: string): string | undefined;
90
+ /** Check if a cookie exists. */
91
+ has(name: string): boolean;
92
+ /** Get all cookies as an array of { name, value } pairs. */
93
+ getAll(): Array<{
94
+ name: string;
95
+ value: string;
96
+ }>;
97
+ /** Number of cookies. */
98
+ readonly size: number;
99
+ /**
100
+ * Set a cookie. Only available in mutable contexts (middleware, actions,
101
+ * route handlers).
102
+ *
103
+ * The value is auto-encoded with `encodeURIComponent` so the on-the-wire
104
+ * bytes always satisfy RFC 6265 §4.1.1 cookie-octet — `cookies().get()`
105
+ * returns the same logical value the developer wrote. Pass `{ raw: true }`
106
+ * to skip the encoder; the raw path validates against the strict
107
+ * cookie-octet grammar instead. See design/29-cookies.md §"Encoding
108
+ * Contract" and ONGOING_SECURITY.md H-3 (TIM-868).
109
+ */
110
+ set(name: string, value: string, options?: SetCookieOptions): void;
111
+ /**
112
+ * Copy all `Set-Cookie` headers from a `Headers` object.
113
+ * Parses each header and forwards name, value, and all attributes
114
+ * (path, domain, max-age, expires, sameSite, secure, httpOnly, partitioned).
115
+ *
116
+ * Useful when forwarding cookies from an internal `fetch()` or auth handler:
117
+ * ```ts
118
+ * const response = await auth.handler(req);
119
+ * getCookies().then(c => c.setFromHeaders(response.headers));
120
+ * ```
121
+ */
122
+ setFromHeaders(headers: Headers): void;
123
+ /** Delete a cookie. Only available in mutable contexts. */
124
+ delete(name: string, options?: Pick<CookieOptions, 'path' | 'domain'>): void;
125
+ /** Delete all cookies. Only available in mutable contexts. */
126
+ clear(): void;
127
+ /** Serialize cookies as a Cookie header string. */
128
+ toString(): string;
129
+ }
130
+ /**
131
+ * Register a pre-parsed cookie map to use as the request context seed for
132
+ * the next `runWithRequestContext(req, …)` call with this exact `req`.
133
+ *
134
+ * Used by the no-JS form-rerender dispatcher in
135
+ * `rsc-entry/wrap-action-dispatch.ts` to thread the action's post-mutation
136
+ * cookie state into the rerender scope without serializing back through a
137
+ * `Cookie:` header. See TIM-868 / TIM-837.
138
+ *
139
+ * @internal — framework use only.
140
+ */
141
+ export declare function seedRequestCookies(req: Request, cookies: Map<string, string>): void;
142
+ /**
143
+ * Pop the seed (if any) for `req` and return it. Called from
144
+ * `runWithRequestContext` exactly once per request — the seed is consumed
145
+ * eagerly so it cannot leak into a hypothetical future re-use of the same
146
+ * Request reference.
147
+ *
148
+ * @internal — framework use only.
149
+ */
150
+ export declare function consumeSeededCookies(req: Request): Map<string, string> | undefined;
151
+ /**
152
+ * Build a Map of cookie name → value reflecting the current request's
153
+ * read-your-own-writes state. Includes incoming cookies plus any
154
+ * mutations from getCookies().set() / getCookies().delete() in the same request.
155
+ *
156
+ * Used by SSR renderers to populate NavContext.cookies so that
157
+ * useCookie()'s server snapshot matches the actual response state.
158
+ *
159
+ * See design/29-cookies.md §"Read-Your-Own-Writes"
160
+ * See design/triage/TIM-441-cookie-api-triage.md §4
161
+ */
162
+ export declare function getCookiesForSsr(): Map<string, string>;
163
+ /**
164
+ * Collect all Set-Cookie headers from the cookie jar.
165
+ * Called by the framework at flush time to apply cookies to the response.
166
+ *
167
+ * Returns an array of serialized Set-Cookie header values.
168
+ */
169
+ export declare function getSetCookieHeaders(): string[];
170
+ //# sourceMappingURL=cookie-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cookie-context.d.ts","sourceRoot":"","sources":["../../src/server/cookie-context.ts"],"names":[],"mappings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