@ogygia/core 0.0.0 → 0.11.0

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 (548) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +7 -1
  3. package/ambient.d.ts +194 -0
  4. package/dist/ClientBindingStub.svelte +6 -0
  5. package/dist/ClientBindingStub.svelte.d.ts +26 -0
  6. package/dist/KeepHost.svelte +19 -0
  7. package/dist/KeepHost.svelte.d.ts +10 -0
  8. package/dist/LakeBoundary.svelte +16 -0
  9. package/dist/LakeBoundary.svelte.d.ts +11 -0
  10. package/dist/LateIsland.svelte +22 -0
  11. package/dist/LateIsland.svelte.d.ts +15 -0
  12. package/dist/LateIslandAwait.svelte +17 -0
  13. package/dist/LateIslandAwait.svelte.d.ts +15 -0
  14. package/dist/LiveHost.svelte +19 -0
  15. package/dist/LiveHost.svelte.d.ts +10 -0
  16. package/dist/NestedProvider.svelte +13 -0
  17. package/dist/NestedProvider.svelte.d.ts +8 -0
  18. package/dist/OgygiaBoundary.svelte +5 -0
  19. package/dist/OgygiaBoundary.svelte.d.ts +17 -0
  20. package/dist/PromiseRegion.svelte +40 -0
  21. package/dist/PromiseRegion.svelte.d.ts +15 -0
  22. package/dist/PromiseRegionAwait.svelte +27 -0
  23. package/dist/PromiseRegionAwait.svelte.d.ts +15 -0
  24. package/dist/Provide.svelte +27 -0
  25. package/dist/Provide.svelte.d.ts +8 -0
  26. package/dist/RawHtml.svelte +9 -0
  27. package/dist/RawHtml.svelte.d.ts +6 -0
  28. package/dist/Region.svelte +1173 -0
  29. package/dist/Region.svelte.d.ts +68 -0
  30. package/dist/SlotBoundary.svelte +13 -0
  31. package/dist/SlotBoundary.svelte.d.ts +7 -0
  32. package/dist/app.d.ts +4 -0
  33. package/dist/app.js +3 -0
  34. package/dist/boundary.d.ts +35 -0
  35. package/dist/boundary.js +127 -0
  36. package/dist/build-cache.d.ts +13 -0
  37. package/dist/build-cache.js +77 -0
  38. package/dist/compiler/blank-styles.d.ts +1 -0
  39. package/dist/compiler/blank-styles.js +63 -0
  40. package/dist/compiler/bom.d.ts +2 -0
  41. package/dist/compiler/bom.js +15 -0
  42. package/dist/compiler/browser-full.d.ts +8 -0
  43. package/dist/compiler/browser-full.js +8 -0
  44. package/dist/compiler/browser.d.ts +11 -0
  45. package/dist/compiler/browser.js +11 -0
  46. package/dist/compiler/content/transportables.d.ts +26 -0
  47. package/dist/compiler/content/transportables.js +219 -0
  48. package/dist/compiler/ctx.d.ts +180 -0
  49. package/dist/compiler/ctx.js +183 -0
  50. package/dist/compiler/debarrel/barrel.d.ts +55 -0
  51. package/dist/compiler/debarrel/barrel.js +248 -0
  52. package/dist/compiler/debarrel/options.d.ts +67 -0
  53. package/dist/compiler/debarrel/options.js +31 -0
  54. package/dist/compiler/debarrel/parse.d.ts +65 -0
  55. package/dist/compiler/debarrel/parse.js +256 -0
  56. package/dist/compiler/debarrel/plugin.d.ts +31 -0
  57. package/dist/compiler/debarrel/plugin.js +190 -0
  58. package/dist/compiler/debarrel/rewrite.d.ts +27 -0
  59. package/dist/compiler/debarrel/rewrite.js +118 -0
  60. package/dist/compiler/debarrel/svelte.d.ts +13 -0
  61. package/dist/compiler/debarrel/svelte.js +56 -0
  62. package/dist/compiler/dev/css-scope.d.ts +16 -0
  63. package/dist/compiler/dev/css-scope.js +38 -0
  64. package/dist/compiler/dev/dev-hmr.d.ts +25 -0
  65. package/dist/compiler/dev/dev-hmr.js +29 -0
  66. package/dist/compiler/dev/hmr.d.ts +34 -0
  67. package/dist/compiler/dev/hmr.js +57 -0
  68. package/dist/compiler/dev/region-bytes.d.ts +34 -0
  69. package/dist/compiler/dev/region-bytes.js +126 -0
  70. package/dist/compiler/driver.d.ts +280 -0
  71. package/dist/compiler/driver.js +1352 -0
  72. package/dist/compiler/flags.d.ts +16 -0
  73. package/dist/compiler/flags.js +101 -0
  74. package/dist/compiler/fouc-css.d.ts +97 -0
  75. package/dist/compiler/fouc-css.js +335 -0
  76. package/dist/compiler/free-vars.d.ts +20 -0
  77. package/dist/compiler/free-vars.js +327 -0
  78. package/dist/compiler/host.d.ts +65 -0
  79. package/dist/compiler/host.js +51 -0
  80. package/dist/compiler/ids.d.ts +84 -0
  81. package/dist/compiler/ids.js +86 -0
  82. package/dist/compiler/index.d.ts +11 -0
  83. package/dist/compiler/index.js +11 -0
  84. package/dist/compiler/kit.d.ts +129 -0
  85. package/dist/compiler/kit.js +563 -0
  86. package/dist/compiler/link/build-output.d.ts +44 -0
  87. package/dist/compiler/link/build-output.js +147 -0
  88. package/dist/compiler/link/caps.d.ts +48 -0
  89. package/dist/compiler/link/caps.js +64 -0
  90. package/dist/compiler/link/context-detect.d.ts +23 -0
  91. package/dist/compiler/link/context-detect.js +137 -0
  92. package/dist/compiler/link/emit-gate.d.ts +11 -0
  93. package/dist/compiler/link/emit-gate.js +40 -0
  94. package/dist/compiler/link/entry-shim.d.ts +4 -0
  95. package/dist/compiler/link/entry-shim.js +29 -0
  96. package/dist/compiler/link/island-deps.d.ts +142 -0
  97. package/dist/compiler/link/island-deps.js +525 -0
  98. package/dist/compiler/link/manifest.d.ts +5 -0
  99. package/dist/compiler/link/manifest.js +9 -0
  100. package/dist/compiler/link/page-keys.d.ts +64 -0
  101. package/dist/compiler/link/page-keys.js +683 -0
  102. package/dist/compiler/link/registry-stub.d.ts +41 -0
  103. package/dist/compiler/link/registry-stub.js +212 -0
  104. package/dist/compiler/link/router-config.d.ts +11 -0
  105. package/dist/compiler/link/router-config.js +15 -0
  106. package/dist/compiler/link/router-css.d.ts +22 -0
  107. package/dist/compiler/link/router-css.js +142 -0
  108. package/dist/compiler/link/runtime-entry.d.ts +71 -0
  109. package/dist/compiler/link/runtime-entry.js +132 -0
  110. package/dist/compiler/link/server-manifest.d.ts +12 -0
  111. package/dist/compiler/link/server-manifest.js +45 -0
  112. package/dist/compiler/link/speculation.d.ts +17 -0
  113. package/dist/compiler/link/speculation.js +36 -0
  114. package/dist/compiler/link/transport.d.ts +31 -0
  115. package/dist/compiler/link/transport.js +67 -0
  116. package/dist/compiler/macros/bake.d.ts +20 -0
  117. package/dist/compiler/macros/bake.js +317 -0
  118. package/dist/compiler/macros/browser.d.ts +11 -0
  119. package/dist/compiler/macros/browser.js +69 -0
  120. package/dist/compiler/macros/dedent.d.ts +12 -0
  121. package/dist/compiler/macros/dedent.js +36 -0
  122. package/dist/compiler/macros/dollar.d.ts +15 -0
  123. package/dist/compiler/macros/dollar.js +387 -0
  124. package/dist/compiler/macros/pipeline.d.ts +31 -0
  125. package/dist/compiler/macros/pipeline.js +106 -0
  126. package/dist/compiler/macros/source.d.ts +6 -0
  127. package/dist/compiler/macros/source.js +127 -0
  128. package/dist/compiler/macros/store.d.ts +17 -0
  129. package/dist/compiler/macros/store.js +244 -0
  130. package/dist/compiler/macros/wire.d.ts +14 -0
  131. package/dist/compiler/macros/wire.js +160 -0
  132. package/dist/compiler/ownership-stamps.d.ts +6 -0
  133. package/dist/compiler/ownership-stamps.js +144 -0
  134. package/dist/compiler/parse/oxc.d.ts +34 -0
  135. package/dist/compiler/parse/oxc.js +59 -0
  136. package/dist/compiler/parse/scan.d.ts +43 -0
  137. package/dist/compiler/parse/scan.js +232 -0
  138. package/dist/compiler/program.d.ts +140 -0
  139. package/dist/compiler/program.js +242 -0
  140. package/dist/compiler/region/emit.d.ts +169 -0
  141. package/dist/compiler/region/emit.js +286 -0
  142. package/dist/compiler/region/identity.d.ts +28 -0
  143. package/dist/compiler/region/identity.js +75 -0
  144. package/dist/compiler/region/ir.d.ts +65 -0
  145. package/dist/compiler/region/ir.js +0 -0
  146. package/dist/compiler/region/transform.d.ts +178 -0
  147. package/dist/compiler/region/transform.js +1933 -0
  148. package/dist/compiler/script-request.d.ts +1 -0
  149. package/dist/compiler/script-request.js +43 -0
  150. package/dist/context-bridge.d.ts +65 -0
  151. package/dist/context-bridge.js +217 -0
  152. package/dist/context-registry.d.ts +40 -0
  153. package/dist/context-registry.js +15 -0
  154. package/dist/context.d.ts +72 -0
  155. package/dist/context.js +158 -0
  156. package/dist/current-region.d.ts +14 -0
  157. package/dist/current-region.js +36 -0
  158. package/dist/document.d.ts +41 -0
  159. package/dist/document.js +125 -0
  160. package/dist/entry-hydrate.d.ts +5 -0
  161. package/dist/entry-hydrate.js +42 -0
  162. package/dist/escape.d.ts +18 -0
  163. package/dist/escape.js +37 -0
  164. package/dist/events/bus.d.ts +33 -0
  165. package/dist/events/bus.js +153 -0
  166. package/dist/events/index.d.ts +4 -0
  167. package/dist/events/index.js +4 -0
  168. package/dist/events/schema.d.ts +389 -0
  169. package/dist/events/schema.js +23 -0
  170. package/dist/events/server-registry.d.ts +7 -0
  171. package/dist/events/server-registry.js +13 -0
  172. package/dist/events/sinks.d.ts +64 -0
  173. package/dist/events/sinks.js +85 -0
  174. package/dist/fn-transport.d.ts +33 -0
  175. package/dist/fn-transport.js +140 -0
  176. package/dist/frame.d.ts +20 -0
  177. package/dist/frame.js +19 -0
  178. package/dist/holes-record.d.ts +6 -0
  179. package/dist/holes-record.js +8 -0
  180. package/dist/hooks.d.ts +43 -0
  181. package/dist/hooks.js +1191 -0
  182. package/dist/hydration-info.d.ts +1 -0
  183. package/dist/hydration-info.js +31 -0
  184. package/dist/index.d.ts +21 -0
  185. package/dist/index.js +17 -0
  186. package/dist/insights/attr-rules.d.ts +15 -0
  187. package/dist/insights/attr-rules.js +27 -0
  188. package/dist/insights/cpu.d.ts +82 -0
  189. package/dist/insights/cpu.js +177 -0
  190. package/dist/insights/fp-drift.d.ts +28 -0
  191. package/dist/insights/fp-drift.js +148 -0
  192. package/dist/insights/hole-segments.d.ts +26 -0
  193. package/dist/insights/hole-segments.js +50 -0
  194. package/dist/insights/html-diff.d.ts +25 -0
  195. package/dist/insights/html-diff.js +157 -0
  196. package/dist/insights/hydration-hazards.d.ts +36 -0
  197. package/dist/insights/hydration-hazards.js +136 -0
  198. package/dist/insights/hydration-status.d.ts +2 -0
  199. package/dist/insights/hydration-status.js +0 -0
  200. package/dist/insights/index.d.ts +14 -0
  201. package/dist/insights/index.js +12 -0
  202. package/dist/insights/page-assets.d.ts +211 -0
  203. package/dist/insights/page-assets.js +608 -0
  204. package/dist/insights/page-insights.d.ts +749 -0
  205. package/dist/insights/page-insights.js +2157 -0
  206. package/dist/insights/session-data.d.ts +108 -0
  207. package/dist/insights/session-data.js +0 -0
  208. package/dist/insights/session-insights.d.ts +121 -0
  209. package/dist/insights/session-insights.js +548 -0
  210. package/dist/insights/switch.d.ts +53 -0
  211. package/dist/insights/switch.js +91 -0
  212. package/dist/insights/testing-version.d.ts +19 -0
  213. package/dist/insights/testing-version.js +21 -0
  214. package/dist/insights/third-party.d.ts +75 -0
  215. package/dist/insights/third-party.js +160 -0
  216. package/dist/internal-instruments.d.ts +13 -0
  217. package/dist/internal-instruments.js +12 -0
  218. package/dist/internal-reconcile.d.ts +3 -0
  219. package/dist/internal-reconcile.js +3 -0
  220. package/dist/internal-register.d.ts +7 -0
  221. package/dist/internal-register.js +7 -0
  222. package/dist/internal-server.d.ts +7 -0
  223. package/dist/internal-server.js +7 -0
  224. package/dist/internal.d.ts +13 -0
  225. package/dist/internal.js +13 -0
  226. package/dist/island-graph.d.ts +36 -0
  227. package/dist/island-graph.js +89 -0
  228. package/dist/keep-fallback-marker.d.ts +7 -0
  229. package/dist/keep-fallback-marker.js +9 -0
  230. package/dist/keep-fallback.d.ts +13 -0
  231. package/dist/keep-fallback.js +39 -0
  232. package/dist/kit-paths.d.ts +2 -0
  233. package/dist/kit-paths.js +39 -0
  234. package/dist/late-region-registry.d.ts +40 -0
  235. package/dist/late-region-registry.js +36 -0
  236. package/dist/live-transport.d.ts +57 -0
  237. package/dist/live-transport.js +145 -0
  238. package/dist/markup.d.ts +4 -0
  239. package/dist/markup.js +4 -0
  240. package/dist/own-package.d.ts +15 -0
  241. package/dist/own-package.js +20 -0
  242. package/dist/page-defer.d.ts +33 -0
  243. package/dist/page-defer.js +35 -0
  244. package/dist/page-facts-script.d.ts +7 -0
  245. package/dist/page-facts-script.js +9 -0
  246. package/dist/page-seed-registry.d.ts +72 -0
  247. package/dist/page-seed-registry.js +31 -0
  248. package/dist/plugin/capability.d.ts +14 -0
  249. package/dist/plugin/capability.js +44 -0
  250. package/dist/plugin/client.d.ts +39 -0
  251. package/dist/plugin/client.js +6 -0
  252. package/dist/plugin/css.d.ts +3 -0
  253. package/dist/plugin/css.js +54 -0
  254. package/dist/plugin/facts.d.ts +42 -0
  255. package/dist/plugin/facts.js +37 -0
  256. package/dist/plugin/hooks.d.ts +33 -0
  257. package/dist/plugin/hooks.js +38 -0
  258. package/dist/plugin/index.d.ts +127 -0
  259. package/dist/plugin/index.js +26 -0
  260. package/dist/plugin/routes.d.ts +32 -0
  261. package/dist/plugin/routes.js +35 -0
  262. package/dist/plugin/server.d.ts +27 -0
  263. package/dist/plugin/server.js +92 -0
  264. package/dist/plugin/standard-schema.d.ts +27 -0
  265. package/dist/plugin/standard-schema.js +0 -0
  266. package/dist/plugin/testing.d.ts +13 -0
  267. package/dist/plugin/testing.js +54 -0
  268. package/dist/plugin/utils.d.ts +13 -0
  269. package/dist/plugin/utils.js +19 -0
  270. package/dist/portable-form.d.ts +22 -0
  271. package/dist/portable-form.js +52 -0
  272. package/dist/preference.d.ts +35 -0
  273. package/dist/preference.js +84 -0
  274. package/dist/preload.d.ts +1 -0
  275. package/dist/preload.js +21 -0
  276. package/dist/ref-watch.d.ts +31 -0
  277. package/dist/ref-watch.js +66 -0
  278. package/dist/ref.d.ts +124 -0
  279. package/dist/ref.js +272 -0
  280. package/dist/region-brand.d.ts +8 -0
  281. package/dist/region-brand.js +10 -0
  282. package/dist/region-core.d.ts +2 -0
  283. package/dist/region-core.js +1 -0
  284. package/dist/region-snippet.d.ts +73 -0
  285. package/dist/region-snippet.js +351 -0
  286. package/dist/region.d.ts +127 -0
  287. package/dist/region.js +162 -0
  288. package/dist/request-event.d.ts +1 -0
  289. package/dist/request-event.js +37 -0
  290. package/dist/router-css.d.ts +39 -0
  291. package/dist/router-css.js +66 -0
  292. package/dist/runtime/app-transport.d.ts +2 -0
  293. package/dist/runtime/app-transport.js +13 -0
  294. package/dist/runtime/beacon.d.ts +271 -0
  295. package/dist/runtime/beacon.js +2190 -0
  296. package/dist/runtime/boot-link.d.ts +1 -0
  297. package/dist/runtime/boot-link.js +44 -0
  298. package/dist/runtime/client-hooks.d.ts +5 -0
  299. package/dist/runtime/client-hooks.js +22 -0
  300. package/dist/runtime/client-plugins.d.ts +8 -0
  301. package/dist/runtime/client-plugins.js +34 -0
  302. package/dist/runtime/concurrency.d.ts +12 -0
  303. package/dist/runtime/concurrency.js +29 -0
  304. package/dist/runtime/connected.d.ts +12 -0
  305. package/dist/runtime/connected.js +16 -0
  306. package/dist/runtime/context.d.ts +1 -0
  307. package/dist/runtime/context.js +19 -0
  308. package/dist/runtime/core.d.ts +15 -0
  309. package/dist/runtime/core.js +1173 -0
  310. package/dist/runtime/drift-watch.d.ts +9 -0
  311. package/dist/runtime/drift-watch.js +60 -0
  312. package/dist/runtime/entry-locations.d.ts +33 -0
  313. package/dist/runtime/entry-locations.js +119 -0
  314. package/dist/runtime/foreign-props.d.ts +8 -0
  315. package/dist/runtime/foreign-props.js +14 -0
  316. package/dist/runtime/form-continuity.d.ts +10 -0
  317. package/dist/runtime/form-continuity.js +107 -0
  318. package/dist/runtime/frame-nav.d.ts +36 -0
  319. package/dist/runtime/frame-nav.js +225 -0
  320. package/dist/runtime/frame-store.d.ts +62 -0
  321. package/dist/runtime/frame-store.js +214 -0
  322. package/dist/runtime/frames.d.ts +1 -0
  323. package/dist/runtime/frames.js +25 -0
  324. package/dist/runtime/full.d.ts +4 -0
  325. package/dist/runtime/full.js +32 -0
  326. package/dist/runtime/hash.d.ts +41 -0
  327. package/dist/runtime/hash.js +79 -0
  328. package/dist/runtime/hole-facts.d.ts +8 -0
  329. package/dist/runtime/hole-facts.js +57 -0
  330. package/dist/runtime/host-classes.d.ts +24 -0
  331. package/dist/runtime/host-classes.js +43 -0
  332. package/dist/runtime/hydrate-core.d.ts +101 -0
  333. package/dist/runtime/hydrate-core.js +605 -0
  334. package/dist/runtime/index.d.ts +2 -0
  335. package/dist/runtime/index.js +1 -0
  336. package/dist/runtime/interaction-replay.d.ts +11 -0
  337. package/dist/runtime/interaction-replay.js +70 -0
  338. package/dist/runtime/interaction.d.ts +33 -0
  339. package/dist/runtime/interaction.js +217 -0
  340. package/dist/runtime/island-graph-preload.d.ts +13 -0
  341. package/dist/runtime/island-graph-preload.js +99 -0
  342. package/dist/runtime/kit-boot.d.ts +29 -0
  343. package/dist/runtime/kit-boot.js +60 -0
  344. package/dist/runtime/kit-page-thread.svelte.d.ts +1 -0
  345. package/dist/runtime/kit-page-thread.svelte.js +116 -0
  346. package/dist/runtime/lake-anchors.d.ts +13 -0
  347. package/dist/runtime/lake-anchors.js +19 -0
  348. package/dist/runtime/lakes.d.ts +15 -0
  349. package/dist/runtime/lakes.js +212 -0
  350. package/dist/runtime/live.d.ts +3 -0
  351. package/dist/runtime/live.js +17 -0
  352. package/dist/runtime/load-scheduler.d.ts +53 -0
  353. package/dist/runtime/load-scheduler.js +317 -0
  354. package/dist/runtime/morph.d.ts +42 -0
  355. package/dist/runtime/morph.js +671 -0
  356. package/dist/runtime/nav-handle.d.ts +25 -0
  357. package/dist/runtime/nav-handle.js +71 -0
  358. package/dist/runtime/nav-hooks.d.ts +2 -0
  359. package/dist/runtime/nav-hooks.js +23 -0
  360. package/dist/runtime/nearest-attr.d.ts +4 -0
  361. package/dist/runtime/nearest-attr.js +16 -0
  362. package/dist/runtime/observe.d.ts +27 -0
  363. package/dist/runtime/observe.js +63 -0
  364. package/dist/runtime/own-cost.d.ts +9 -0
  365. package/dist/runtime/own-cost.js +35 -0
  366. package/dist/runtime/ownership.d.ts +101 -0
  367. package/dist/runtime/ownership.js +115 -0
  368. package/dist/runtime/page-cache.d.ts +23 -0
  369. package/dist/runtime/page-cache.js +74 -0
  370. package/dist/runtime/page-defer.d.ts +14 -0
  371. package/dist/runtime/page-defer.js +103 -0
  372. package/dist/runtime/parse-html.d.ts +40 -0
  373. package/dist/runtime/parse-html.js +81 -0
  374. package/dist/runtime/reconcile.d.ts +41 -0
  375. package/dist/runtime/reconcile.js +194 -0
  376. package/dist/runtime/region-attrs.d.ts +95 -0
  377. package/dist/runtime/region-attrs.js +153 -0
  378. package/dist/runtime/region-endpoint-url.d.ts +76 -0
  379. package/dist/runtime/region-endpoint-url.js +169 -0
  380. package/dist/runtime/region-ids.d.ts +8 -0
  381. package/dist/runtime/region-ids.js +33 -0
  382. package/dist/runtime/remote-seeds.d.ts +2 -0
  383. package/dist/runtime/remote-seeds.js +21 -0
  384. package/dist/runtime/render-blocking.d.ts +2 -0
  385. package/dist/runtime/render-blocking.js +30 -0
  386. package/dist/runtime/restore.d.ts +34 -0
  387. package/dist/runtime/restore.js +390 -0
  388. package/dist/runtime/router-nav.d.ts +63 -0
  389. package/dist/runtime/router-nav.js +740 -0
  390. package/dist/runtime/router.d.ts +201 -0
  391. package/dist/runtime/router.js +593 -0
  392. package/dist/runtime/schedule.d.ts +49 -0
  393. package/dist/runtime/schedule.js +256 -0
  394. package/dist/runtime/seeds.d.ts +50 -0
  395. package/dist/runtime/seeds.js +208 -0
  396. package/dist/runtime/session.d.ts +52 -0
  397. package/dist/runtime/session.js +130 -0
  398. package/dist/runtime/sidecar.d.ts +3 -0
  399. package/dist/runtime/sidecar.js +56 -0
  400. package/dist/runtime/slots.d.ts +183 -0
  401. package/dist/runtime/slots.js +44 -0
  402. package/dist/runtime/spa-cacheable.d.ts +7 -0
  403. package/dist/runtime/spa-cacheable.js +18 -0
  404. package/dist/runtime/speculate-hint.d.ts +1 -0
  405. package/dist/runtime/speculate-hint.js +35 -0
  406. package/dist/runtime/svelte-warnings.d.ts +28 -0
  407. package/dist/runtime/svelte-warnings.js +71 -0
  408. package/dist/runtime/wire-classes.d.ts +3 -0
  409. package/dist/runtime/wire-classes.js +69 -0
  410. package/dist/runtime/wire-format.d.ts +7 -0
  411. package/dist/runtime/wire-format.js +22 -0
  412. package/dist/script.d.ts +134 -0
  413. package/dist/script.js +184 -0
  414. package/dist/seed-refs.d.ts +105 -0
  415. package/dist/seed-refs.js +487 -0
  416. package/dist/server/capability-lifetime.d.ts +28 -0
  417. package/dist/server/capability-lifetime.js +31 -0
  418. package/dist/server/dead-kit-resolves.d.ts +1 -0
  419. package/dist/server/dead-kit-resolves.js +39 -0
  420. package/dist/server/document-assembly.d.ts +30 -0
  421. package/dist/server/document-assembly.js +26 -0
  422. package/dist/server/document-tail.d.ts +113 -0
  423. package/dist/server/document-tail.js +208 -0
  424. package/dist/server/endpoint.d.ts +51 -0
  425. package/dist/server/endpoint.js +90 -0
  426. package/dist/server/entry-location.d.ts +8 -0
  427. package/dist/server/entry-location.js +29 -0
  428. package/dist/server/fingerprint.d.ts +1 -0
  429. package/dist/server/fingerprint.js +25 -0
  430. package/dist/server/head-presence.d.ts +45 -0
  431. package/dist/server/head-presence.js +156 -0
  432. package/dist/server/hmac.d.ts +38 -0
  433. package/dist/server/hmac.js +89 -0
  434. package/dist/server/hole-graph.d.ts +7 -0
  435. package/dist/server/hole-graph.js +71 -0
  436. package/dist/server/hole-urls.d.ts +3 -0
  437. package/dist/server/hole-urls.js +76 -0
  438. package/dist/server/html-scan.d.ts +19 -0
  439. package/dist/server/html-scan.js +60 -0
  440. package/dist/server/kit-context.d.ts +78 -0
  441. package/dist/server/kit-context.js +110 -0
  442. package/dist/server/late-wire.d.ts +22 -0
  443. package/dist/server/late-wire.js +28 -0
  444. package/dist/server/page-facts.d.ts +25 -0
  445. package/dist/server/page-facts.js +138 -0
  446. package/dist/server/page-seed.d.ts +33 -0
  447. package/dist/server/page-seed.js +60 -0
  448. package/dist/server/page-stream.d.ts +55 -0
  449. package/dist/server/page-stream.js +121 -0
  450. package/dist/server/payload.d.ts +6 -0
  451. package/dist/server/payload.js +22 -0
  452. package/dist/server/personal-response.d.ts +6 -0
  453. package/dist/server/personal-response.js +13 -0
  454. package/dist/server/props-wire.d.ts +56 -0
  455. package/dist/server/props-wire.js +178 -0
  456. package/dist/server/rate-limit.d.ts +22 -0
  457. package/dist/server/rate-limit.js +63 -0
  458. package/dist/server/region-css.d.ts +5 -0
  459. package/dist/server/region-css.js +30 -0
  460. package/dist/server/region-endpoint.d.ts +35 -0
  461. package/dist/server/region-endpoint.js +142 -0
  462. package/dist/server/region-props.d.ts +6 -0
  463. package/dist/server/region-props.js +44 -0
  464. package/dist/server/remote-seed-gate.d.ts +50 -0
  465. package/dist/server/remote-seed-gate.js +66 -0
  466. package/dist/server/render-cache.d.ts +26 -0
  467. package/dist/server/render-cache.js +51 -0
  468. package/dist/server/render-page.d.ts +51 -0
  469. package/dist/server/render-page.js +176 -0
  470. package/dist/server/render-region-html.d.ts +2 -0
  471. package/dist/server/render-region-html.js +19 -0
  472. package/dist/server/request-stats.d.ts +174 -0
  473. package/dist/server/request-stats.js +54 -0
  474. package/dist/server/reversible.d.ts +83 -0
  475. package/dist/server/reversible.js +994 -0
  476. package/dist/server/seed-shape.d.ts +22 -0
  477. package/dist/server/seed-shape.js +24 -0
  478. package/dist/server/shared-cache.d.ts +35 -0
  479. package/dist/server/shared-cache.js +104 -0
  480. package/dist/server/signing-key.d.ts +11 -0
  481. package/dist/server/signing-key.js +47 -0
  482. package/dist/server/sized-lru.d.ts +20 -0
  483. package/dist/server/sized-lru.js +68 -0
  484. package/dist/server/split-regions.d.ts +81 -0
  485. package/dist/server/split-regions.js +368 -0
  486. package/dist/server/stream-regions.d.ts +5 -0
  487. package/dist/server/stream-regions.js +36 -0
  488. package/dist/shared-state.d.ts +7 -0
  489. package/dist/shared-state.js +152 -0
  490. package/dist/shims/app-environment.d.ts +4 -0
  491. package/dist/shims/app-environment.js +6 -0
  492. package/dist/shims/app-navigation.d.ts +33 -0
  493. package/dist/shims/app-navigation.js +119 -0
  494. package/dist/shims/app-paths.d.ts +6 -0
  495. package/dist/shims/app-paths.js +18 -0
  496. package/dist/shims/app-state.svelte.d.ts +23 -0
  497. package/dist/shims/app-state.svelte.js +50 -0
  498. package/dist/shims/app-stores.d.ts +21 -0
  499. package/dist/shims/app-stores.js +54 -0
  500. package/dist/shims/kit-bridge.d.ts +29 -0
  501. package/dist/shims/kit-bridge.js +7 -0
  502. package/dist/shims/kit-remote/client-stub.d.ts +27 -0
  503. package/dist/shims/kit-remote/client-stub.js +43 -0
  504. package/dist/shims/kit-remote/paths-internal-stub.d.ts +3 -0
  505. package/dist/shims/kit-remote/paths-internal-stub.js +5 -0
  506. package/dist/shims/kit-remote/remote-cache.d.ts +49 -0
  507. package/dist/shims/kit-remote/remote-cache.js +73 -0
  508. package/dist/shims/kit-remote/state-stub.d.ts +8 -0
  509. package/dist/shims/kit-remote/state-stub.js +8 -0
  510. package/dist/shims/page-store.svelte.d.ts +39 -0
  511. package/dist/shims/page-store.svelte.js +77 -0
  512. package/dist/source.d.ts +29 -0
  513. package/dist/source.js +87 -0
  514. package/dist/store-transport.d.ts +86 -0
  515. package/dist/store-transport.js +229 -0
  516. package/dist/tool-fetches.d.ts +5 -0
  517. package/dist/tool-fetches.js +41 -0
  518. package/dist/transport.d.ts +48 -0
  519. package/dist/transport.js +181 -0
  520. package/dist/unscoped-css.d.ts +26 -0
  521. package/dist/unscoped-css.js +53 -0
  522. package/dist/vite/dev-maps.d.ts +33 -0
  523. package/dist/vite/dev-maps.js +140 -0
  524. package/dist/vite/index.d.ts +19 -0
  525. package/dist/vite/index.js +820 -0
  526. package/dist/vite/kit-dirs.d.ts +7 -0
  527. package/dist/vite/kit-dirs.js +67 -0
  528. package/dist/vite/late-island.d.ts +25 -0
  529. package/dist/vite/late-island.js +33 -0
  530. package/dist/vite/module-map.d.ts +8 -0
  531. package/dist/vite/module-map.js +144 -0
  532. package/dist/vite/options.d.ts +208 -0
  533. package/dist/vite/options.js +74 -0
  534. package/dist/vite/package-files.d.ts +3 -0
  535. package/dist/vite/package-files.js +84 -0
  536. package/dist/vite/paths.d.ts +45 -0
  537. package/dist/vite/paths.js +112 -0
  538. package/dist/vite/plugin-api.d.ts +166 -0
  539. package/dist/vite/plugin-api.js +212 -0
  540. package/dist/vite/profiler-maps.d.ts +23 -0
  541. package/dist/vite/profiler-maps.js +178 -0
  542. package/dist/vite/server-sourcemaps.d.ts +8 -0
  543. package/dist/vite/server-sourcemaps.js +80 -0
  544. package/dist/vite/sourcemaps.d.ts +18 -0
  545. package/dist/vite/sourcemaps.js +80 -0
  546. package/dist/vite/style-preprocess.d.ts +2 -0
  547. package/dist/vite/style-preprocess.js +96 -0
  548. package/package.json +180 -6
@@ -0,0 +1,563 @@
1
+ import { dir_entries, fs, path } from "./host.js";
2
+ import "./region/transform.js";
3
+ import { parse_module } from "./parse/oxc.js";
4
+ import { createRequire } from "node:module";
5
+ // src/compiler/kit.ts
6
+ /**
7
+ * Locate Kit's internal wire-protocol + client remote-functions modules by resolving `@sveltejs/kit`'s
8
+ * package.json (that IS exported) and joining the src path — deep-importing the file bypasses the exports
9
+ * map. Also finds the app's universal hooks. Resolved from the APP root (`createRequire` off a root path),
10
+ * so a monorepo sub-package still finds Kit. Never throws (a missing Kit → the devalue-codec fallback).
11
+ */
12
+ function resolve_kit_paths(root) {
13
+ let kit_wire_path = null;
14
+ let kit_remote_index = null;
15
+ let universal_hooks = null;
16
+ let kit_transport_init = null;
17
+ try {
18
+ const require = createRequire(path.join(root, "noop.js"));
19
+ const kitRoot = path.dirname(require.resolve("@sveltejs/kit/package.json"));
20
+ const candidate = path.join(kitRoot, "src", "runtime", "shared.js");
21
+ if (fs.existsSync(candidate)) kit_wire_path = candidate;
22
+ const codec = path.join(kitRoot, "src", "runtime", "app", "internal", "transport.js");
23
+ if (fs.existsSync(codec)) kit_transport_init = codec;
24
+ const remoteIdx = path.join(kitRoot, "src", "runtime", "client", "remote-functions", "index.js");
25
+ if (fs.existsSync(remoteIdx)) kit_remote_index = remoteIdx;
26
+ } catch {
27
+ kit_wire_path = null;
28
+ }
29
+ for (const f of ["hooks.ts", "hooks.js"]) {
30
+ const abs = path.join(root, "src", f);
31
+ if (fs.existsSync(abs)) {
32
+ universal_hooks = abs;
33
+ break;
34
+ }
35
+ }
36
+ let client_hooks = null;
37
+ for (const f of ["hooks.client.ts", "hooks.client.js"]) {
38
+ const abs = path.join(root, "src", f);
39
+ if (fs.existsSync(abs)) {
40
+ client_hooks = abs;
41
+ break;
42
+ }
43
+ }
44
+ return {
45
+ kit_wire_path,
46
+ kit_remote_index,
47
+ universal_hooks,
48
+ client_hooks,
49
+ kit_transport_init
50
+ };
51
+ }
52
+ /**
53
+ * The app's Kit MAJOR version (resolved off the app root, like {@link resolve_kit_paths}), or null when
54
+ * no Kit resolves. The one fact `kit_asset` needs: Kit 2's `asset()` takes a path with its leading
55
+ * slash, Kit 3's without — and no runtime probe can tell them apart (Kit 2 refuses a slash-less path
56
+ * only in dev; in a build it returns it page-relative, and every island entry on a nested page 404'd).
57
+ */
58
+ function kit_major(root) {
59
+ try {
60
+ const require = createRequire(path.join(root, "noop.js"));
61
+ const pkg = JSON.parse(fs.readFileSync(require.resolve("@sveltejs/kit/package.json"), "utf8"));
62
+ const major = Number.parseInt(pkg.version ?? "", 10);
63
+ return Number.isFinite(major) ? major : null;
64
+ } catch {
65
+ return null;
66
+ }
67
+ }
68
+ const DEFAULT_KIT_DIRS = {
69
+ routes: "src/routes",
70
+ out: ".svelte-kit"
71
+ };
72
+ const _kit_dirs = /* @__PURE__ */ new Map();
73
+ function set_kit_dirs(root, dirs) {
74
+ _kit_dirs.set(root, dirs);
75
+ }
76
+ function kit_dirs(root) {
77
+ return _kit_dirs.get(root) ?? {
78
+ routes_dir: path.join(root, DEFAULT_KIT_DIRS.routes),
79
+ out_dir: path.join(root, DEFAULT_KIT_DIRS.out)
80
+ };
81
+ }
82
+ const _kit_inline_style_threshold = /* @__PURE__ */ new Map();
83
+ function set_kit_inline_style_threshold(root, bytes) {
84
+ _kit_inline_style_threshold.set(root, bytes);
85
+ }
86
+ function kit_inline_style_threshold(root) {
87
+ return _kit_inline_style_threshold.get(root) ?? 0;
88
+ }
89
+ const CSR_EXPORT = /export\s+const\s+csr(?:\s*:\s*boolean)?\s*=\s*(true|false)/;
90
+ const BLOCK_COMMENT_G = /\/\*[\s\S]*?\*\//g;
91
+ const LINE_COMMENT_G = /^[ \t]*\/\/.*$/gm;
92
+ /** Each option file's `csr`, read once until a route file changes (`clear_route_csr_cache`): every
93
+ * transform asks for its route's chain of option files, cache hits included, and each read was a
94
+ * file read (or an ENOENT throw) per directory level. */
95
+ const _csr_of_file = /* @__PURE__ */ new Map();
96
+ /** Read `export const csr = true|false` from a route options file; `undefined` if unset/absent. */
97
+ function read_csr(file) {
98
+ if (_csr_of_file.has(file)) return _csr_of_file.get(file);
99
+ const v = read_csr_uncached(file);
100
+ _csr_of_file.set(file, v);
101
+ return v;
102
+ }
103
+ function read_csr_uncached(file) {
104
+ try {
105
+ let src = fs.readFileSync(file, "utf-8");
106
+ src = src.replace(BLOCK_COMMENT_G, "").replace(LINE_COMMENT_G, "");
107
+ const m = CSR_EXPORT.exec(src);
108
+ return m ? m[1] === "true" : void 0;
109
+ } catch {
110
+ return;
111
+ }
112
+ }
113
+ /** Each module's claimed `config` keys, read once until a route file changes (`clear_route_csr_cache`). */
114
+ const _config_of_file = /* @__PURE__ */ new Map();
115
+ /** `x as T` · `x satisfies T` · `<T>x` · `x!` · `(x)` → `x`. */
116
+ function unwrap_expression(node) {
117
+ let n = node ?? null;
118
+ while (n && (n.type === "TSAsExpression" || n.type === "TSSatisfiesExpression" || n.type === "TSTypeAssertion" || n.type === "TSNonNullExpression" || n.type === "ParenthesizedExpression")) n = n.expression;
119
+ return n;
120
+ }
121
+ /** The object literal `export const config = {…}` declares in `program`, or null. */
122
+ function config_object(program) {
123
+ for (const statement of program.body ?? []) {
124
+ if (statement.type !== "ExportNamedDeclaration") continue;
125
+ const declaration = statement.declaration;
126
+ if (declaration?.type !== "VariableDeclaration") continue;
127
+ for (const d of declaration.declarations ?? []) {
128
+ if (d.id?.type !== "Identifier" || d.id.name !== "config") continue;
129
+ const init = unwrap_expression(d.init);
130
+ return init?.type === "ObjectExpression" ? init : null;
131
+ }
132
+ }
133
+ return null;
134
+ }
135
+ /** A plain literal value (boolean, number, string, null), or `NOT_LITERAL`. */
136
+ const NOT_LITERAL = Symbol("not-literal");
137
+ function literal_value(node) {
138
+ const n = unwrap_expression(node);
139
+ if (n?.type !== "Literal" || n.regex || n.bigint !== void 0) return NOT_LITERAL;
140
+ return n.value;
141
+ }
142
+ /**
143
+ * The claimed keys `export const config = {…}` sets in one route module: its literal-valued top-level
144
+ * properties named in `keys`. `{}` when the file, the export or the keys are absent (a spread or a
145
+ * `config` that is not an object literal is Kit's to read, not ours). A claimed key with a computed
146
+ * value is a build error: it is read at build time, so ogygia could not honour it.
147
+ */
148
+ function read_route_config(file, keys) {
149
+ const memo = file + "\0" + keys.join(",");
150
+ let out = _config_of_file.get(memo);
151
+ if (!out) _config_of_file.set(memo, out = read_route_config_uncached(file, keys));
152
+ return out;
153
+ }
154
+ function read_route_config_uncached(file, keys) {
155
+ const out = {};
156
+ let src;
157
+ try {
158
+ src = fs.readFileSync(file, "utf-8");
159
+ } catch {
160
+ return out;
161
+ }
162
+ if (!src.includes("config") || !keys.some((k) => src.includes(k))) return out;
163
+ const { program } = parse_module(src, file);
164
+ const object = program && config_object(program);
165
+ if (!object) return out;
166
+ for (const property of object.properties ?? []) {
167
+ if (property.type !== "Property" || property.computed) continue;
168
+ const key = property.key?.type === "Identifier" ? property.key.name : property.key?.value;
169
+ if (typeof key !== "string" || !keys.includes(key)) continue;
170
+ const value = literal_value(property.value);
171
+ if (value === NOT_LITERAL) throw new Error(`[ogygia] ${file}: \`config.${key}\` must be a literal (true, false, a number, a string or null) — ogygia reads it at build time.`);
172
+ out[key] = value;
173
+ }
174
+ return out;
175
+ }
176
+ const CONFIG_FILES_PAGE = [
177
+ "+page.server.js",
178
+ "+page.server.ts",
179
+ "+page.js",
180
+ "+page.ts"
181
+ ];
182
+ const CONFIG_FILES_LAYOUT = [
183
+ "+layout.server.js",
184
+ "+layout.server.ts",
185
+ "+layout.js",
186
+ "+layout.ts"
187
+ ];
188
+ const OPTION_FILES_PAGE = [
189
+ "+page.js",
190
+ "+page.ts",
191
+ "+page.server.js",
192
+ "+page.server.ts"
193
+ ];
194
+ const OPTION_FILES_LAYOUT = [
195
+ "+layout.js",
196
+ "+layout.ts",
197
+ "+layout.server.js",
198
+ "+layout.server.ts"
199
+ ];
200
+ /**
201
+ * Own-chain Kit-effective `csr === false` for one route host — Kit's per-PAGE rule verbatim:
202
+ * walk the layout option files root → host dir (then the page's own option files), deepest
203
+ * declaration wins. `undefined` in sources means Kit's default (`true`).
204
+ */
205
+ function own_chain_csr_false(hostFile, routesDir, layouts_only = false) {
206
+ let csr;
207
+ const dir = path.dirname(hostFile);
208
+ const rel = path.relative(routesDir, dir);
209
+ const parts = rel ? rel.split(path.sep) : [];
210
+ let cur = routesDir;
211
+ const chain = [cur];
212
+ for (const p of parts) {
213
+ cur = path.join(cur, p);
214
+ chain.push(cur);
215
+ }
216
+ for (const d of chain) for (const f of OPTION_FILES_LAYOUT) {
217
+ const v = read_csr(path.join(d, f));
218
+ if (v !== void 0) csr = v;
219
+ }
220
+ if (!layouts_only && path.basename(hostFile) === "+page.svelte") for (const f of OPTION_FILES_PAGE) {
221
+ const v = read_csr(path.join(dir, f));
222
+ if (v !== void 0) csr = v;
223
+ }
224
+ return csr === false;
225
+ }
226
+ /**
227
+ * The ERROR-RENDER csr of every page route: Kit renders a page's `+error.svelte` with the LAYOUT
228
+ * branch only (`PageNodes(layouts)` in its server renderer — the page node is dropped), so `csr`
229
+ * for a 404 / 500 under a `csr = false` page is the layouts' answer, usually `true`. A document
230
+ * keyed on the page's csr there is rendered client-off while Kit hydrates it: the lakes came out
231
+ * in their bare form, Kit's hydration mismatched, and a site's header vanished on every error page
232
+ * (customer deploy, 2026-09-15). Same walk as {@link csrTrueRouteIds}, page option files ignored.
233
+ */
234
+ function errorCsrTrueRouteIds(routesDir) {
235
+ const ids = /* @__PURE__ */ new Set();
236
+ for (const page of pageLeaves(routesDir)) {
237
+ if (own_chain_csr_false(page, routesDir, true)) continue;
238
+ const rel = path.relative(routesDir, path.dirname(page));
239
+ const raw = "/" + (rel ? rel.split(path.sep).join("/") : "");
240
+ ids.add(normalize_route_id(raw));
241
+ }
242
+ return [...ids];
243
+ }
244
+ /** The error-render csr of a ROUTELESS response (no route matched: Kit renders the root layout and
245
+ * the root error page) — the root layout's own option, Kit's default `true` when unset. */
246
+ function rootLayoutCsrTrue(routesDir) {
247
+ return !own_chain_csr_false(path.join(routesDir, "+page.svelte"), routesDir, true);
248
+ }
249
+ const _page_worlds = /* @__PURE__ */ new Map();
250
+ function page_worlds(routesDir) {
251
+ let m = _page_worlds.get(routesDir);
252
+ if (!m) {
253
+ m = /* @__PURE__ */ new Map();
254
+ for (const page of pageLeaves(routesDir)) m.set(path.dirname(page), own_chain_csr_false(page, routesDir));
255
+ _page_worlds.set(routesDir, m);
256
+ }
257
+ return m;
258
+ }
259
+ /** The worlds of the pages a layout serves (its dir + everything below). */
260
+ function layout_page_worlds(layoutDir, routesDir) {
261
+ let any_false = false;
262
+ let any_true = false;
263
+ const prefix = layoutDir + path.sep;
264
+ for (const [dir, is_false] of page_worlds(routesDir)) {
265
+ if (dir !== layoutDir && !dir.startsWith(prefix)) continue;
266
+ if (is_false) any_false = true;
267
+ else any_true = true;
268
+ }
269
+ return {
270
+ any_false,
271
+ any_true
272
+ };
273
+ }
274
+ /**
275
+ * Kit-effective `csr === false` for a `+page.svelte` / `+layout.svelte` host. Pages use Kit's
276
+ * own-chain rule; a LAYOUT is csr=false exactly when EVERY page it serves is csr=false (a layout
277
+ * with no pages below — endpoint-only subtree — falls back to its own chain).
278
+ * @param hostFile abs path to a route `.svelte`
279
+ * @param routesDir abs `src/routes`
280
+ */
281
+ function routeCsrIsFalse(hostFile, routesDir) {
282
+ if (!hostFile.startsWith(routesDir)) return false;
283
+ const base = path.basename(hostFile);
284
+ if (base === "+page.svelte") return own_chain_csr_false(hostFile, routesDir);
285
+ if (base !== "+layout.svelte") return false;
286
+ const { any_false, any_true } = layout_page_worlds(path.dirname(hostFile), routesDir);
287
+ if (any_false && !any_true) return true;
288
+ if (any_false || any_true) return false;
289
+ return own_chain_csr_false(hostFile, routesDir);
290
+ }
291
+ /**
292
+ * True when `hostFile` is a route host whose islands ogygia must STRIP (Kit hydrates every page
293
+ * this host serves). Pages: Kit's own-chain rule (default true, or an explicit `csr = true` that
294
+ * beats a `false` up the chain). LAYOUTS: strippable ONLY when no page at/below them is
295
+ * csr=false — on a mixed layout both this and {@link routeCsrIsFalse} are false (shared world:
296
+ * islands kept, `documentIsCsrTrue` degrades them per document). `false` for non-route files
297
+ * (shared components): their csr depends on which page renders them, so they keep their islands.
298
+ */
299
+ function routeCsrIsTrue(hostFile, routesDir) {
300
+ const base = path.basename(hostFile);
301
+ if (base !== "+page.svelte" && base !== "+layout.svelte") return false;
302
+ if (!hostFile.startsWith(routesDir)) return false;
303
+ if (base === "+page.svelte") return !own_chain_csr_false(hostFile, routesDir);
304
+ const { any_false, any_true } = layout_page_worlds(path.dirname(hostFile), routesDir);
305
+ if (any_false) return false;
306
+ if (any_true) return true;
307
+ return !own_chain_csr_false(hostFile, routesDir);
308
+ }
309
+ /**
310
+ * A routes directory's entries with SYMLINKS RESOLVED — Kit parity. Kit discovers routes by name +
311
+ * `statSync` (which follows links), so a symlinked `+layout.ts` or a symlinked route directory is a
312
+ * real node to Kit; a dirent's `isFile()` / `isDirectory()` is false for a link, which made a
313
+ * linked root `+layout.ts` (csr=false) invisible here → "client build stays" predicted while Kit
314
+ * skipped it → the runtime 404'd. (An app sharing routes between two trees links them.)
315
+ */
316
+ function route_entries(dir) {
317
+ const out = [];
318
+ for (const e of dir_entries(dir)) {
319
+ let is_dir = e.isDirectory();
320
+ let is_file = e.isFile();
321
+ if (!is_dir && !is_file) try {
322
+ const st = fs.statSync(path.join(dir, e.name));
323
+ is_dir = st.isDirectory();
324
+ is_file = st.isFile();
325
+ } catch {
326
+ continue;
327
+ }
328
+ out.push({
329
+ name: e.name,
330
+ is_dir,
331
+ is_file
332
+ });
333
+ }
334
+ return out;
335
+ }
336
+ function pageLeaves(routesDir) {
337
+ const leaves = [];
338
+ const walk = (dir) => {
339
+ for (const e of route_entries(dir)) {
340
+ const full = path.join(dir, e.name);
341
+ if (e.is_dir) walk(full);
342
+ else if (e.name === "+page.svelte") leaves.push(full);
343
+ }
344
+ };
345
+ walk(routesDir);
346
+ return leaves;
347
+ }
348
+ /** Kit's `route.id` for a page host, with layout GROUP segments (`(app)`) stripped — the same
349
+ * normalization {@link csrTrueRouteIds} applies, so the two sides match whether or not Kit keeps
350
+ * groups in `route.id`. Root → `/`. */
351
+ function normalize_route_id(id) {
352
+ return "/" + id.split("/").filter(Boolean).filter((s) => !(s.startsWith("(") && s.endsWith(")"))).join("/");
353
+ }
354
+ /**
355
+ * The set of route ids (Kit `route.id`, group-stripped) whose EFFECTIVE csr is TRUE — i.e. Kit
356
+ * hydrates the whole document there. A csr=false layout's islands rendered under one of these must
357
+ * degrade to inline on BOTH legs (Kit owns hydration); Region reads this map on the server, and
358
+ * `kit_hydrates_page()` is the identical client signal. Empty for a fully csr=false app (the norm);
359
+ * only the csr=true exceptions land here.
360
+ */
361
+ function csrTrueRouteIds(routesDir) {
362
+ const ids = /* @__PURE__ */ new Set();
363
+ for (const [dir, is_false] of page_worlds(routesDir)) {
364
+ if (is_false) continue;
365
+ const rel = path.relative(routesDir, dir);
366
+ const raw = "/" + (rel ? rel.split(path.sep).join("/") : "");
367
+ ids.add(normalize_route_id(raw));
368
+ }
369
+ return [...ids];
370
+ }
371
+ const _page_config = /* @__PURE__ */ new Map();
372
+ const PAGE_FILE_RE = /^\+page(\.server)?\.(svelte|js|ts)$/;
373
+ /** Every route dir with a `+page.*` file — a route that produces a page response (rendered HTML or
374
+ * a stored redirect). Broader than {@link pageLeaves} (svelte-only) on purpose. */
375
+ function config_page_dirs(routesDir) {
376
+ const dirs = /* @__PURE__ */ new Set();
377
+ const walk = (dir) => {
378
+ for (const e of route_entries(dir)) {
379
+ const full = path.join(dir, e.name);
380
+ if (e.is_dir) walk(full);
381
+ else if (PAGE_FILE_RE.test(e.name)) dirs.add(dir);
382
+ }
383
+ };
384
+ walk(routesDir);
385
+ return [...dirs];
386
+ }
387
+ /** One page DIR's merged config, claimed keys only — Kit's own merge (`get_config`): the layout chain
388
+ * root → the dir (its own `+layout` included), then the page; at each level the server module, then
389
+ * the universal one; a later level replaces a key, top level only. A key no level sets is absent. */
390
+ function own_chain_config(pageDir, routesDir, keys) {
391
+ const rel = path.relative(routesDir, pageDir);
392
+ const parts = rel ? rel.split(path.sep) : [];
393
+ let cur = routesDir;
394
+ const chain = [cur];
395
+ for (const p of parts) {
396
+ cur = path.join(cur, p);
397
+ chain.push(cur);
398
+ }
399
+ let merged = {};
400
+ for (const d of chain) for (const f of CONFIG_FILES_LAYOUT) merged = {
401
+ ...merged,
402
+ ...read_route_config(path.join(d, f), keys)
403
+ };
404
+ for (const f of CONFIG_FILES_PAGE) merged = {
405
+ ...merged,
406
+ ...read_route_config(path.join(pageDir, f), keys)
407
+ };
408
+ return merged;
409
+ }
410
+ /** A page directory's Kit `route.id`, group-stripped (`normalize_route_id`). */
411
+ function page_route_id(dir, routesDir) {
412
+ const rel = path.relative(routesDir, dir);
413
+ return normalize_route_id("/" + (rel ? rel.split(path.sep).join("/") : ""));
414
+ }
415
+ /** Every page route id (group-stripped) → its merged config, claimed keys only. A key no level sets
416
+ * is absent, so the plugin applies its default; a page that sets none maps to `{}`. */
417
+ function page_route_config(routesDir, keys) {
418
+ const memo = routesDir + "\0" + keys.join(",");
419
+ let m = _page_config.get(memo);
420
+ if (!m) {
421
+ m = {};
422
+ for (const dir of config_page_dirs(routesDir)) m[page_route_id(dir, routesDir)] = own_chain_config(dir, routesDir, keys);
423
+ _page_config.set(memo, m);
424
+ }
425
+ return m;
426
+ }
427
+ const _has_csr_true = /* @__PURE__ */ new Map();
428
+ /**
429
+ * Does the app have ANY csr=true page (Kit hydrates the whole document there)? Drives whether a
430
+ * csr=false LAYOUT must link its island wrapper on the CLIENT leg: on a csr=true child page Kit
431
+ * hydrates the layout, so its chrome islands must be REAL wrappers (Region degrades them inline),
432
+ * not the thin stub the pure-csr=false path uses. A pure-csr=false app keeps the stub (thin client
433
+ * graph); only mixed apps pay for the layout wrappers.
434
+ */
435
+ function hasAnyCsrTrueRoute(routesDir) {
436
+ let v = _has_csr_true.get(routesDir);
437
+ if (v === void 0) {
438
+ v = csrTrueRouteIds(routesDir).length > 0;
439
+ _has_csr_true.set(routesDir, v);
440
+ }
441
+ return v;
442
+ }
443
+ /** Drop the memoized csr-topology answers (a route/`csr`-export add/remove invalidates them). */
444
+ function clear_route_csr_cache() {
445
+ _csr_of_file.clear();
446
+ _has_csr_true.clear();
447
+ _page_worlds.clear();
448
+ _page_config.clear();
449
+ _config_of_file.clear();
450
+ }
451
+ const KEEP_CLIENT_DIR = ".ogygia-keep-client";
452
+ const PAGE_UNIVERSAL = ["+page.js", "+page.ts"];
453
+ const PAGE_SERVER = ["+page.server.js", "+page.server.ts"];
454
+ const LAYOUT_UNIVERSAL = ["+layout.js", "+layout.ts"];
455
+ const LAYOUT_SERVER = ["+layout.server.js", "+layout.server.ts"];
456
+ /** A node's OWN csr (server module then universal wins), independent of the layout chain. */
457
+ function own_csr(dir, universal, server) {
458
+ let csr;
459
+ for (const f of server) {
460
+ const v = read_csr(path.join(dir, f));
461
+ if (v !== void 0) csr = v;
462
+ }
463
+ for (const f of universal) {
464
+ const v = read_csr(path.join(dir, f));
465
+ if (v !== void 0) csr = v;
466
+ }
467
+ return csr;
468
+ }
469
+ /**
470
+ * Collects every route node's EFFECTIVE csr the way Kit does — a node exists per `+page` and per
471
+ * `+layout` (component OR standalone module), and Kit's static analysis resolves each node's
472
+ * `page_options` through the LAYOUT CHAIN (`page_options = { ...parent_options, ...own }`), so a
473
+ * root-layout `csr = false` makes every option-less descendant node `csr === false` too. Layout
474
+ * groups like `(ogygia)/+layout.ts` count too.
475
+ *
476
+ * Issue #4/#1 root cause lived here: reading each node's OWN csr only, a fresh app with `csr =
477
+ * false` in nothing but the root layout looked like "client build runs" (pages read `undefined`),
478
+ * so the keepalive was never injected — while Kit, resolving the chain, skipped the client build
479
+ * and the runtime `<script src>` 404'd.
480
+ * @returns one entry per node (undefined = unset anywhere up-chain)
481
+ */
482
+ function collectNodeEffectiveCsr(routesDir) {
483
+ const nodes = [];
484
+ let saw_root_layout = false;
485
+ const walk = (dir, is_root, inherited) => {
486
+ const entries = route_entries(dir);
487
+ const names = new Set(entries.filter((e) => e.is_file).map((e) => e.name));
488
+ const has = (list) => list.some((f) => names.has(f));
489
+ const layout_own = own_csr(dir, LAYOUT_UNIVERSAL, LAYOUT_SERVER);
490
+ const chain = layout_own !== void 0 ? layout_own : inherited;
491
+ if (names.has("+layout.svelte") || has(LAYOUT_UNIVERSAL) || has(LAYOUT_SERVER)) {
492
+ if (is_root) saw_root_layout = true;
493
+ nodes.push(chain);
494
+ }
495
+ if (names.has("+page.svelte") || has(PAGE_UNIVERSAL) || has(PAGE_SERVER)) {
496
+ const page_own = own_csr(dir, PAGE_UNIVERSAL, PAGE_SERVER);
497
+ nodes.push(page_own !== void 0 ? page_own : chain);
498
+ }
499
+ for (const e of entries) {
500
+ if (!e.is_dir) continue;
501
+ if (e.name === ".ogygia-keep-client") continue;
502
+ walk(path.join(dir, e.name), false, chain);
503
+ }
504
+ };
505
+ walk(routesDir, true, void 0);
506
+ if (!saw_root_layout) nodes.push(void 0);
507
+ return nodes;
508
+ }
509
+ /**
510
+ * Replicates Kit's `manifest_data.nodes.every(n => n.page_options?.csr === false)` — the exact
511
+ * condition under which Kit skips the client build — with `page_options` CHAIN-RESOLVED exactly as
512
+ * Kit's static analysis resolves it. A single node whose effective csr is `true` or simply unset
513
+ * keeps the build alive. When this is true, ogygia's runtime is never emitted, so index.ts injects
514
+ * the keepalive. Deviations (a `+page@` reset, a statically-unanalysable option file) can only err
515
+ * toward injecting a keepalive Kit didn't need — a harmless extra client build, never a 404.
516
+ */
517
+ function clientBuildWillSkip(routesDir) {
518
+ if (!fs.existsSync(routesDir)) return false;
519
+ const nodes = collectNodeEffectiveCsr(routesDir);
520
+ if (nodes.length === 0) return false;
521
+ return nodes.every((csr) => csr === false);
522
+ }
523
+ /**
524
+ * True when AT LEAST ONE page route is csr=false. A pure csr=true app (this returns false) needs no
525
+ * ogygia runtime at all — Kit hydrates everything itself — so the runtime chunk is skipped entirely.
526
+ */
527
+ function hasAnyCsrFalseRoute(routesDir) {
528
+ if (!fs.existsSync(routesDir)) return false;
529
+ return pageLeaves(routesDir).some((page_file) => routeCsrIsFalse(page_file, routesDir));
530
+ }
531
+ /** On-disk path of the injected keepalive route for a given app root. */
532
+ function keep_client_dir(r) {
533
+ return path.join(kit_dirs(r).routes_dir, KEEP_CLIENT_DIR);
534
+ }
535
+ /** Write the URL-less `csr = true` keepalive layout into the app's routes (removed at process exit). */
536
+ function inject_keep_client_route(r) {
537
+ const dir = keep_client_dir(r);
538
+ fs.mkdirSync(dir, { recursive: true });
539
+ fs.writeFileSync(path.join(dir, "+layout.ts"), "// Generated by ogygia for the duration of the build, then removed. A layout-only node —\n// no +page, so no servable URL — that stops SvelteKit skipping its client build when every\n// real route is csr = false. Safe to delete (gitignored; ogygia self-heals it).\nexport const csr = true;\n");
540
+ }
541
+ /** Remove leftover on-disk `.ogygia` trees from an earlier materialization approach. */
542
+ function clean_stale_ogygia_dirs(dir) {
543
+ let entries;
544
+ try {
545
+ entries = dir_entries(dir);
546
+ } catch {
547
+ return;
548
+ }
549
+ for (const entry of entries) {
550
+ if (!entry.isDirectory()) continue;
551
+ const full = path.join(dir, entry.name);
552
+ if (entry.name === "node_modules") continue;
553
+ if (entry.name === ".ogygia") {
554
+ fs.rmSync(full, {
555
+ recursive: true,
556
+ force: true
557
+ });
558
+ continue;
559
+ }
560
+ clean_stale_ogygia_dirs(full);
561
+ }
562
+ }
563
+ export { DEFAULT_KIT_DIRS, KEEP_CLIENT_DIR, clean_stale_ogygia_dirs, clear_route_csr_cache, clientBuildWillSkip, csrTrueRouteIds, errorCsrTrueRouteIds, hasAnyCsrFalseRoute, hasAnyCsrTrueRoute, inject_keep_client_route, keep_client_dir, kit_dirs, kit_inline_style_threshold, kit_major, normalize_route_id, page_route_config, read_csr, read_route_config, resolve_kit_paths, rootLayoutCsrTrue, routeCsrIsFalse, routeCsrIsTrue, set_kit_dirs, set_kit_inline_style_threshold };
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Guardrail: a content collection must never reach a CLIENT chunk. Ground truth is the finished
3
+ * bundle. A compiled corpus module (.svx/.md) in a client chunk means a `content()` collection was
4
+ * imported into client-shipped code (usually an island), which drags its eager `import.meta.glob` —
5
+ * every doc — into the browser. On a csr=false site the corpus renders server-side and should never
6
+ * appear here, so any hit is a real leak. A warning, not a throw: the guardrail must never break a build.
7
+ */
8
+ export declare function warn_content_leaks(bundle: Record<string, unknown>, root: string, is_island_path: (id: string) => boolean): void;
9
+ /**
10
+ * Write the island-deps handoff JSON (the map SSR reads at render): the stable path under Kit's
11
+ * `outDir` (`.svelte-kit` unless the app configured `kit.outDir`), an adapter-friendly copy next
12
+ * to the server bundle, AND an in-place inline into every server chunk that carries the token slot
13
+ * — inlining is what makes it survive serverless tracing (@vercel/nft only bundles *imported*
14
+ * files, not runtime fs reads, so the co-located JSON is dropped there; that is why held/dual
15
+ * regions that cross the wire rendered unstyled on Vercel/Netlify). Unpatched builds keep the fs
16
+ * fallback (adapter-node, dev-preview).
17
+ */
18
+ export declare function emit_island_deps_handoff(root: string, json: string, out_dir: string): void;
19
+ /**
20
+ * SEED SHAPING report (client `writeBundle`): which islands read `page.data` through the shim, how
21
+ * many keys they were pinned to, and — the actionable part — the modules whose reads could not be
22
+ * pinned, each with its line and why, since one such module makes every page carrying that island
23
+ * ship its whole `page.data`. Same shape as the barrels report: a few lines, a count for the rest.
24
+ */
25
+ export declare function report_seed_shaping(map: {
26
+ page: Record<string, boolean>;
27
+ page_keys: Record<string, string[] | null>;
28
+ }, bundle: Record<string, {
29
+ type: string;
30
+ moduleIds?: string[];
31
+ imports?: string[];
32
+ }>, program: {
33
+ page_key_reasons: Map<string, {
34
+ why: string;
35
+ line: number | null;
36
+ }>;
37
+ }, root: string, file_of?: (identity: string) => string): Record<string, SeedWhy[]>;
38
+ /** a module that made an island ship all of `page.data`: where (root-relative when inside the app)
39
+ * and why — what the profiler points at when the island's own file reads nothing whole */
40
+ export interface SeedWhy {
41
+ file: string;
42
+ line: number | null;
43
+ why: string;
44
+ }