@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,130 @@
1
+ import { ConcurrencyGate } from "./concurrency.js";
2
+ import { FROZEN_SELECTOR } from "./region-attrs.js";
3
+ // src/runtime/session.ts
4
+ /**
5
+ * Document-scoped runtime session: lake caches, seed flags, kit-page probe, server-island gate.
6
+ * Cleared on SPA body swap via `reset()` so connecting regions never see the previous page.
7
+ */
8
+ /** Soft cap on lake cache entries (unique lake ids). Evict oldest insertion on overflow. */
9
+ const LAKE_CACHE_MAX = 64;
10
+ /**
11
+ * WHO OWNS EACH NODE IN `<head>` — the rule every head write and removal follows.
12
+ *
13
+ * - The PAGE owns the head the server sent and everything the router or the runtime puts there for
14
+ * the page (merged heads, hoisted region sheets, preload links, hints). A navigation replaces
15
+ * page-owned nodes, and only those.
16
+ * - An ISLAND owns what its `<svelte:head>` renders live (csr=false: the island hydrates alone, so
17
+ * its head block renders fresh — hydrate-core.ts `neutralize_head_hydration_markers`). Only the
18
+ * island's own teardown removes those: Svelte deletes a head block by walking from its first node
19
+ * to its last, and if anyone else removes the last one first, the walk runs to the end of <head>
20
+ * and deletes the next page's tags with it (field: description / canonical / og:* gone after a
21
+ * client navigation).
22
+ * - Anything else (a third-party or dev-tooling inject) is not ours and is never removed — the rule
23
+ * SvelteKit's own router follows.
24
+ *
25
+ * And ONE copy: while an island's head content is live, the page's identical server copy of it is
26
+ * retired (field: two identical JSON-LD blocks, duplicated inline CSS and preloads). Only page-owned
27
+ * copies are ever retired — never an island's live node — and never a stylesheet link (removing either
28
+ * copy could unstyle the page for a frame; a doubled sheet is harmless).
29
+ */
30
+ const STYLESHEET_REL_RE = /(?:^|\s)stylesheet(?:\s|$)/i;
31
+ var RuntimeSession = class {
32
+ /** Page-owned head nodes (see above). Survives `reset()`: it is the document's, not a page's. */
33
+ page_head = /* @__PURE__ */ new WeakSet();
34
+ /** Island-owned head ELEMENTS still to watch (pruned when they leave the document). */
35
+ island_head = /* @__PURE__ */ new Set();
36
+ /** Mark a node this document's page owns (the router / runtime inserted it for the page). */
37
+ claim_page_head(node) {
38
+ this.page_head.add(node);
39
+ }
40
+ /** At boot: everything already in <head> came from the server — the page owns it. */
41
+ adopt_document_head() {
42
+ if (typeof document === "undefined") return;
43
+ for (const n of document.head.children) this.page_head.add(n);
44
+ }
45
+ /** After an island's hydrate: the head elements it added (not in `before`, not page-owned) are
46
+ * that island's; then retire the page's copies of them. */
47
+ record_island_head(before) {
48
+ let added = false;
49
+ for (const n of document.head.children) if (!before.has(n) && !this.page_head.has(n)) {
50
+ this.island_head.add(n);
51
+ added = true;
52
+ }
53
+ if (added) this.retire_page_head_copies();
54
+ }
55
+ /**
56
+ * Remove every PAGE-owned head element that duplicates a live island-owned one (same markup), and
57
+ * the page's `<title>` once an island renders its own (the browser honours the first title, and
58
+ * the island's is the reactive one). Runs after an island hydrates and after a navigation merge.
59
+ */
60
+ retire_page_head_copies() {
61
+ const live = /* @__PURE__ */ new Set();
62
+ let island_title = false;
63
+ for (const el of this.island_head) {
64
+ if (!el.isConnected) {
65
+ this.island_head.delete(el);
66
+ continue;
67
+ }
68
+ live.add(el.outerHTML);
69
+ if (el.localName === "title") island_title = true;
70
+ }
71
+ if (live.size === 0) return;
72
+ for (const el of Array.from(document.head.children)) {
73
+ if (!this.page_head.has(el)) continue;
74
+ if (el.localName === "link" && STYLESHEET_REL_RE.test(el.getAttribute("rel") ?? "")) continue;
75
+ if (island_title && el.localName === "title" || live.has(el.outerHTML)) el.remove();
76
+ }
77
+ }
78
+ lake_cache = /* @__PURE__ */ new Map();
79
+ settled_lakes = /* @__PURE__ */ new WeakSet();
80
+ initialized_lakes = /* @__PURE__ */ new Set();
81
+ server_gate = new ConcurrencyGate(3);
82
+ /** The page facts answers rendered with (server/render-page.ts), queued at the answer seam
83
+ * (`region_fragment`) for the next hydrate to merge into the page store (seeds.ts). */
84
+ page_facts = [];
85
+ #remote_seeded = false;
86
+ #page_seeded = false;
87
+ #kit_page;
88
+ get remote_seeded() {
89
+ return this.#remote_seeded;
90
+ }
91
+ mark_remote_seeded() {
92
+ this.#remote_seeded = true;
93
+ }
94
+ get page_seeded() {
95
+ return this.#page_seeded;
96
+ }
97
+ mark_page_seeded() {
98
+ this.#page_seeded = true;
99
+ }
100
+ get kit_page() {
101
+ return this.#kit_page;
102
+ }
103
+ set kit_page(v) {
104
+ this.#kit_page = v;
105
+ }
106
+ /** Insert/replace a lake cache entry; evict oldest if over LAKE_CACHE_MAX. */
107
+ set_lake_cache(id, entry) {
108
+ if (this.lake_cache.has(id)) this.lake_cache.delete(id);
109
+ this.lake_cache.set(id, entry);
110
+ while (this.lake_cache.size > LAKE_CACHE_MAX) {
111
+ const oldest = this.lake_cache.keys().next().value;
112
+ if (oldest == null) break;
113
+ this.lake_cache.delete(oldest);
114
+ }
115
+ }
116
+ settle_lakes_in(root) {
117
+ if (root instanceof Element && root.matches?.("ogygia-region[wake=\"none\"]")) this.settled_lakes.add(root);
118
+ for (const lake of root.querySelectorAll(FROZEN_SELECTOR)) this.settled_lakes.add(lake);
119
+ }
120
+ reset() {
121
+ this.#kit_page = void 0;
122
+ this.#remote_seeded = false;
123
+ this.#page_seeded = false;
124
+ this.lake_cache.clear();
125
+ this.initialized_lakes.clear();
126
+ }
127
+ };
128
+ /** Process-wide session for the islands runtime (one client module graph). */
129
+ const runtime_session = new RuntimeSession();
130
+ export { RuntimeSession, runtime_session };
@@ -0,0 +1,3 @@
1
+ /** Attach a remembered props sidecar to a region whose DOM carries none (see above). */
2
+ export declare function restore_props_sidecar(region: Element, sidecar: HTMLScriptElement): void;
3
+ export declare function props_sidecar_of(region: Element): HTMLScriptElement | null;
@@ -0,0 +1,56 @@
1
+ // src/runtime/sidecar.ts
2
+ /**
3
+ * Where a region's props sidecar (`<script type="application/ogygia-props" data-ogygia-props>`) is.
4
+ *
5
+ * Two placements, ONE lookup:
6
+ * - KEYED, at the end of `<body>`: an island rendered in Kit's own page pass records its sidecar
7
+ * into the request (Region.svelte → the handle), which emits every island's props once, after
8
+ * the content, keyed by the region's fingerprint (`data-og-fp` on the element ==
9
+ * `data-ogygia-props="<fp>"` AND `id="og-props-<fp>"` on the script). Bytes the browser must
10
+ * download before the hero used to sit right after each island — a landing page carried 480 KB
11
+ * of props above its LCP image. Identical islands (same entry + props → same fp) share one script.
12
+ * Found by `getElementById` — the browser's id map, O(1); an attribute `querySelector` per island
13
+ * was a full light-DOM walk each (150 islands × 2,000 elements on a measured page).
14
+ * - ADJACENT, the next element sibling (skipping `<link>` CSS hints): every other render root —
15
+ * a hole response, a baked held region, a streamed late region, a router document, a foreign
16
+ * fragment, a snippet crossing into an island — keeps the sidecar right after the region, so the
17
+ * HTML stays self-contained wherever it is spliced. Keyed by attribute only, NEVER by id: its
18
+ * fingerprint may repeat one the tail (or another root) carries, and an id must be unique.
19
+ * The tail's id lookup runs first, then the sibling walk; a whole-tree attribute query only on a
20
+ * miss. Server islands and held deferred regions carry no `data-og-fp` and always ride adjacent.
21
+ *
22
+ * A third source, checked first: a sidecar RESTORED onto a region that has none in the DOM — a
23
+ * hydrating hole Kit rendered again in the browser after it gave up hydrating the document (the
24
+ * client leg renders no sidecar; the runtime remembered the SSR one under the hole's identity and
25
+ * attaches the clone here, off the DOM, so Kit's tree is never edited under it).
26
+ */
27
+ const restored_sidecars = /* @__PURE__ */ new WeakMap();
28
+ /** Attach a remembered props sidecar to a region whose DOM carries none (see above). */
29
+ function restore_props_sidecar(region, sidecar) {
30
+ restored_sidecars.set(region, sidecar);
31
+ }
32
+ function props_sidecar_of(region) {
33
+ const restored = restored_sidecars.get(region);
34
+ if (restored) return restored;
35
+ const fp = region.getAttribute("data-og-fp");
36
+ const root = region.getRootNode();
37
+ if (fp && "getElementById" in root) {
38
+ const keyed = root.getElementById("og-props-" + fp);
39
+ if (keyed) return keyed;
40
+ }
41
+ let sib = region.nextElementSibling;
42
+ while (sib) {
43
+ if (sib.tagName === "SCRIPT" && sib.hasAttribute("data-ogygia-props")) return sib;
44
+ if (sib.tagName === "LINK") {
45
+ sib = sib.nextElementSibling;
46
+ continue;
47
+ }
48
+ break;
49
+ }
50
+ if (fp) {
51
+ const found = root.querySelector?.(`script[data-ogygia-props="${fp}"]`);
52
+ if (found) return found;
53
+ }
54
+ return null;
55
+ }
56
+ export { props_sidecar_of, restore_props_sidecar };
@@ -0,0 +1,183 @@
1
+ import { KitBoot, kit_hydrates_page } from "./kit-boot.js";
2
+ import { register_island_graph } from "./island-graph-preload.js";
3
+ import { is_warmed_module, warm_island_module } from "./region-endpoint-url.js";
4
+ import { note_entry_location } from "./entry-locations.js";
5
+ import { props_sidecar_of } from "./sidecar.js";
6
+ import { parse_region_html } from "./parse-html.js";
7
+ import { runtime_session } from "./session.js";
8
+ import { regions_in_shadow } from "./connected.js";
9
+ import { yield_task } from "./schedule.js";
10
+ import { beacon_nav } from "./beacon.js";
11
+ import { load_slot } from "./load-scheduler.js";
12
+ import { is_self_owned, walk_enters } from "./ownership.js";
13
+ import { document_key, jump_to_hash, push_state, replace_state } from "./router.js";
14
+ import { resolve_address } from "./interaction.js";
15
+ import { sync_attributes } from "./morph.js";
16
+ import { Frame } from "../frame.js";
17
+ import { Component } from "svelte";
18
+ /** Frozen SSR DOM detached before hydrate. */
19
+ export type LiftedLake = {
20
+ id: string;
21
+ frag: DocumentFragment;
22
+ endpoint: string;
23
+ when: string;
24
+ maxAgeMs: number;
25
+ };
26
+ /** Region schedule hooks lakes need without importing the custom element. */
27
+ export type LakeArm = {
28
+ idle: (fire: () => void) => void;
29
+ visible: (fire: () => void, margin?: string) => void;
30
+ media: (when: string, fire: () => void) => void;
31
+ fetch_revalidate: () => void;
32
+ wake_children: () => void;
33
+ };
34
+ export type LakeOps = {
35
+ on_frozen_connect(el: HTMLElement, arm: LakeArm): boolean;
36
+ wait_for_boundary(el: HTMLElement, boundary: Element | null): boolean;
37
+ lift(parent: Element): LiftedLake[];
38
+ restore(parent: Element, lifted: LiftedLake[]): void;
39
+ settle_in(root: ParentNode): void;
40
+ mark_frozen_settled(region: HTMLElement): void;
41
+ after_html_swap(region: HTMLElement, opts: {
42
+ revalidate?: boolean;
43
+ }): void;
44
+ after_fetch_exhausted(region: HTMLElement, opts: {
45
+ revalidate?: boolean;
46
+ }, wake_children: () => void): void;
47
+ };
48
+ export type FormOps = {
49
+ enabled: boolean;
50
+ snapshot(root: ParentNode, pathKey: string): void;
51
+ restore(pathKey: string): void;
52
+ };
53
+ /** Wake a cold island when interaction lands inside it; returns a disarm fn. */
54
+ export type ArmFn = (el: HTMLElement, fire: () => void) => void | (() => void);
55
+ /** `target: 'walk'` = the hydration repair (the server sequence Svelte's walk binds); default = a live
56
+ * morph toward a new answer. Same ownership rules either way (runtime/ownership.ts). */
57
+ export type MorphFn = (parent: Element, nodes: ArrayLike<Node>, options?: {
58
+ target?: "live" | "walk";
59
+ }) => void;
60
+ export type WireOps = {
61
+ /** THE hub key (`OgygiaRef`) — every transportable kind crosses under it. */
62
+ REF_WIRE_KEY: string;
63
+ /** Hub resolve: ref → live value (kind-dispatched; browser remembers, server never). */
64
+ resolve: (ref: never, remember: boolean) => unknown;
65
+ };
66
+ export type RemoteSeedOps = {
67
+ seed_query_responses(text: string): void;
68
+ clear_remote_seeds(): void;
69
+ clear_remote_instances(): void;
70
+ };
71
+ /**
72
+ * The client frame store, filled by the `frames` feature. Core reads it ONLY on the deferred /
73
+ * live / SWR-lake paths (a region with a signed `endpoint`), so a plain load-hydrated app never
74
+ * bundles the store. Null until the feature installs → core's frame calls are optional-chained.
75
+ */
76
+ export type FrameOps = {
77
+ subscribe(a: string, cb: (f: Frame) => void): () => void;
78
+ ensure(a: string, fetcher: (signal: AbortSignal) => Promise<string>, opts?: {
79
+ force?: boolean;
80
+ }): Promise<string>;
81
+ abandon(a: string): void;
82
+ /**
83
+ * SINGLE-FLIGHT NAVIGATION: batch a page's signed deferred endpoints into the store as one streamed response. Lives
84
+ * on the seam (not a static router import) so an app with `router` but no deferred/live/lake region
85
+ * — hence no `frames` feature — never bundles the frame store. The router optional-chains this: no
86
+ * frames feature ⇒ no `render="defer"` holes to batch ⇒ the call never fires anyway.
87
+ */
88
+ stream(endpoints: string[]): Promise<void>;
89
+ /** Holes that start fetching in the same task go out as one batch (frame-nav.ts `join_batch`);
90
+ * await it, then `ensure` joins the batch's reservation. */
91
+ join?(endpoint: string): Promise<void>;
92
+ /** How the batch that carried a hole timed it (frame-nav.ts; the measuring browser only). */
93
+ batch_times?(endpoint: string): {
94
+ left: number;
95
+ at: number;
96
+ size: number;
97
+ } | undefined;
98
+ };
99
+ /**
100
+ * SPA navigation, filled by the router feature. Read by the kit-remote client stub (used by the
101
+ * always-on remote-seeds feature) so a remote COMMAND can navigate/invalidate WITHOUT the stub
102
+ * statically importing `router.js` (~10 KB). Null when no router loaded → callers full-page fallback.
103
+ */
104
+ export type NavOps = {
105
+ goto(url: string | URL, opts?: unknown): Promise<void>;
106
+ invalidateAll(): Promise<void>;
107
+ };
108
+ /**
109
+ * BOOT → LAZY LINKS. The runtime's lazy chunks — the hydrate core, the router's navigation,
110
+ * interaction replay — use a handful of boot helpers and the boot's session state. They reach them
111
+ * HERE, never by importing a boot module: a module the boot and a lazy chunk both import is shared,
112
+ * and Kit's client build (`preserveEntrySignatures: 'strict'`) forbids the runtime chunk from
113
+ * exporting it, so the bundler splits every such module into a file of its own — the runtime's
114
+ * boot arrived as nine. Each link is filled before its lazy chunk can load: `boot` by core's boot
115
+ * (./boot-link.ts), `router_link` and `interaction_link` by the very loader that imports their chunk
116
+ * (the router's `nav()`, interaction's `replay()`), `sync_attributes` by morph's install. Types only
117
+ * below (erased), so this registry imports none of them.
118
+ * `test/runtime-boot-svelte-free.test.ts` pins that no lazy chunk imports a boot module.
119
+ */
120
+ export type BootLink = {
121
+ kit_hydrates_page: typeof kit_hydrates_page;
122
+ KitBoot: typeof KitBoot;
123
+ ABSOLUTE_URL_SCHEME: RegExp;
124
+ register_island_graph: typeof register_island_graph;
125
+ is_warmed_module: typeof is_warmed_module;
126
+ warm_island_module: typeof warm_island_module;
127
+ note_entry_location: typeof note_entry_location;
128
+ props_sidecar_of: typeof props_sidecar_of;
129
+ parse_region_html: typeof parse_region_html;
130
+ runtime_session: typeof runtime_session;
131
+ regions_in_shadow: typeof regions_in_shadow;
132
+ yield_task: typeof yield_task;
133
+ /** the router's navigation, timed for the profiler's beacon (a no-op without it) */
134
+ beacon_nav: typeof beacon_nav;
135
+ /** the load scheduler's queue (./load-scheduler.ts) */
136
+ load_slot: typeof load_slot;
137
+ /** DOM ownership (./ownership.ts): which children Svelte's walk enters, and self-owned elements */
138
+ walk_enters: typeof walk_enters;
139
+ is_self_owned: typeof is_self_owned;
140
+ };
141
+ export type RouterLink = {
142
+ document_key: typeof document_key;
143
+ jump_to_hash: typeof jump_to_hash;
144
+ push_state: typeof push_state;
145
+ replace_state: typeof replace_state;
146
+ };
147
+ export type InteractionLink = {
148
+ resolve_address: typeof resolve_address;
149
+ };
150
+ export type Slots = {
151
+ lakes: LakeOps;
152
+ forms: FormOps;
153
+ interaction: ArmFn | null;
154
+ morph: MorphFn | null;
155
+ live: Component<Record<string, unknown>> | null;
156
+ /** a kept island's host (the live feature fills it beside `live`) */
157
+ keep: Component<Record<string, unknown>> | null;
158
+ wire: WireOps | null;
159
+ remoteSeeds: RemoteSeedOps | null;
160
+ frames: FrameOps | null;
161
+ nav: NavOps | null;
162
+ /**
163
+ * Cross-island context bridge, filled by the `context` feature. Walks the DOM from an island up
164
+ * to seed its `getContext` from a `<Provide>` / drop-in-`setContext` marker above it. Null when the
165
+ * build detected no ogygia context provider — a plain app never bundles the ~4.7 kB bridge, and
166
+ * core's call optional-chains to `undefined` (exactly "no provider above", the existing empty case).
167
+ */
168
+ context: ((start: Element | null) => Map<string, unknown> | undefined) | null;
169
+ /** Boot helpers + session for the lazy chunks (see {@link BootLink}). */
170
+ boot: BootLink | null;
171
+ /** The router's history/scroll helpers for its navigation chunk (see {@link RouterLink}). */
172
+ router_link: RouterLink | null;
173
+ /** Interaction's address resolver for its replay chunk (see {@link InteractionLink}). */
174
+ interaction_link: InteractionLink | null;
175
+ /** Morph's attribute sync, for the navigation's body reconcile. */
176
+ sync_attributes: typeof sync_attributes | null;
177
+ };
178
+ /** The live registry. A feature's `install()` assigns its slot; core/router read them. */
179
+ export declare const slots: Slots;
180
+ export declare const boot_link: () => BootLink;
181
+ export declare const router_link: () => RouterLink;
182
+ export declare const interaction_link: () => InteractionLink;
183
+ export declare const morph_sync_attributes: () => NonNullable<Slots["sync_attributes"]>;
@@ -0,0 +1,44 @@
1
+ import { is_frozen } from "./region-attrs.js";
2
+ // src/runtime/slots.ts
3
+ /** The live registry. A feature's `install()` assigns its slot; core/router read them. */
4
+ const slots = {
5
+ lakes: {
6
+ on_frozen_connect: (el) => is_frozen(el),
7
+ wait_for_boundary: () => false,
8
+ lift: () => [],
9
+ restore: () => {},
10
+ settle_in: () => {},
11
+ mark_frozen_settled: () => {},
12
+ after_html_swap: () => {},
13
+ after_fetch_exhausted: () => {}
14
+ },
15
+ forms: {
16
+ enabled: false,
17
+ snapshot: () => {},
18
+ restore: () => {}
19
+ },
20
+ interaction: null,
21
+ morph: null,
22
+ live: null,
23
+ keep: null,
24
+ wire: null,
25
+ remoteSeeds: null,
26
+ frames: null,
27
+ nav: null,
28
+ context: null,
29
+ boot: null,
30
+ router_link: null,
31
+ interaction_link: null,
32
+ sync_attributes: null
33
+ };
34
+ /** A link a lazy chunk needs, or a loud error: every link is filled before its chunk can load, so a
35
+ * missing one means a chunk ran without the boot that owns it (a test that skipped `link_boot()`). */
36
+ function linked(link, name) {
37
+ if (link === null) throw new Error(`[ogygia] runtime chunk used \`slots.${name}\` before the boot linked it`);
38
+ return link;
39
+ }
40
+ const boot_link = () => linked(slots.boot, "boot");
41
+ const router_link = () => linked(slots.router_link, "router_link");
42
+ const interaction_link = () => linked(slots.interaction_link, "interaction_link");
43
+ const morph_sync_attributes = () => linked(slots.sync_attributes, "sync_attributes");
44
+ export { boot_link, interaction_link, morph_sync_attributes, router_link, slots };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Whether a fetch response may warm the SPA page-HTML cache.
3
+ * @param cacheControl - Response `Cache-Control` header value.
4
+ * @param setCookie - True if the response included `Set-Cookie`.
5
+ * @returns False when the response is private / no-store / no-cache or set a cookie.
6
+ */
7
+ export declare function spa_html_cacheable(cacheControl: string, setCookie: boolean): boolean;
@@ -0,0 +1,18 @@
1
+ // src/runtime/spa-cacheable.ts
2
+ /**
3
+ * Whether an SPA navigation's HTML response may warm the page cache. A dependency-free leaf: the
4
+ * lazy navigation chunk (./router-nav.ts) applies it, and `ogygia/app` exports it — island code —
5
+ * so it must not live in the router's boot module (island code never imports a boot module).
6
+ */
7
+ /** Responses that must never warm the SPA HTML cache (personalized / must revalidate). */
8
+ const CC_UNCACHEABLE = /(?:^|,)\s*(?:private|no-store|no-cache)\b/i;
9
+ /**
10
+ * Whether a fetch response may warm the SPA page-HTML cache.
11
+ * @param cacheControl - Response `Cache-Control` header value.
12
+ * @param setCookie - True if the response included `Set-Cookie`.
13
+ * @returns False when the response is private / no-store / no-cache or set a cookie.
14
+ */
15
+ function spa_html_cacheable(cacheControl, setCookie) {
16
+ return !CC_UNCACHEABLE.test(cacheControl || "") && !setCookie;
17
+ }
18
+ export { spa_html_cacheable };
@@ -0,0 +1 @@
1
+ export declare function speculate_url(url: string | URL, kind: "prefetch" | "prerender"): void;
@@ -0,0 +1,35 @@
1
+ // src/runtime/speculate-hint.ts
2
+ /**
3
+ * Per-URL Speculation Rules hints — the MPA-mode (`router: false`) legs of `preloadData` /
4
+ * `preloadCode`. With no SPA router there is no swap-readable page cache to warm, and the browser
5
+ * owns navigation — so the honest preload primitives are the platform's: `preloadData(url)`
6
+ * speculates a PRERENDER (Chromium activates it on the real navigation — instant), `preloadCode(url)`
7
+ * a PREFETCH (Firefox supports this leg; a prerender-capable browser treats prefetch as its first
8
+ * stage). Where Speculation Rules are unsupported (Safari) this is a silent no-op — a hint API has
9
+ * no failure mode, and the un-hinted navigation still works.
10
+ *
11
+ * LEAF module: no feature imports (usable from the `$app/navigation` shim without dragging the
12
+ * router graph). List rules (not document rules) so each hint targets exactly the asked URL.
13
+ */
14
+ const hinted = /* @__PURE__ */ new Set();
15
+ function speculate_url(url, kind) {
16
+ if (typeof document === "undefined") return;
17
+ if (!HTMLScriptElement.supports || !HTMLScriptElement.supports("speculationrules")) return;
18
+ let target;
19
+ try {
20
+ target = new URL(url, location.href);
21
+ } catch {
22
+ return;
23
+ }
24
+ if (target.origin !== location.origin) return;
25
+ const href = target.pathname + target.search;
26
+ const key = kind + "\0" + href;
27
+ if (hinted.has(key)) return;
28
+ hinted.add(key);
29
+ const script = document.createElement("script");
30
+ script.type = "speculationrules";
31
+ script.setAttribute("data-ogygia-speculate-hint", "");
32
+ script.textContent = JSON.stringify({ [kind]: [{ urls: [href] }] });
33
+ document.head.appendChild(script);
34
+ }
35
+ export { speculate_url };
@@ -0,0 +1,28 @@
1
+ /**
2
+ * SVELTE'S HYDRATION WARNINGS, KEPT — in dev, Svelte says in the console when the server and the
3
+ * browser disagreed while an island hydrated (`hydration_html_changed`, `hydration_attribute_changed`,
4
+ * `hydration_mismatch`…). Svelte keeps the server's value, so nothing on screen shows it: the console
5
+ * line is the only trace. This keeps each one (with the island hydrating at the time) for the devtools
6
+ * and the profiler's browser half. Dev only (production Svelte has no such warnings); the console line
7
+ * itself goes out unchanged. No regex: warnings are rare, read by string search.
8
+ */
9
+ export interface SvelteWarning {
10
+ code: string;
11
+ message: string;
12
+ file?: string;
13
+ fp?: string;
14
+ t: number;
15
+ }
16
+ /** core.ts marks the island whose hydrate step is running. Svelte raises some warnings as the
17
+ * step's effects flush (a microtask after it returns): the mark holds until the task ends, and
18
+ * islands hydrate one per task, so the next one never inherits it. */
19
+ export declare function set_hydrating(el: Element): void;
20
+ export declare function svelte_warnings(): SvelteWarning[];
21
+ export declare function on_svelte_warning(cb: (w: SvelteWarning) => void): void;
22
+ /** `%c[svelte] code\n%cmessage …` → the parts (null: not a Svelte hydration warning). */
23
+ export declare function parse_svelte_warning(text: string): {
24
+ code: string;
25
+ message: string;
26
+ file?: string;
27
+ } | null;
28
+ export declare function tap_svelte_warnings(): void;
@@ -0,0 +1,71 @@
1
+ // src/runtime/svelte-warnings.ts
2
+ let tapped = false;
3
+ let hydrating = null;
4
+ const kept = [];
5
+ const listeners = [];
6
+ /** core.ts marks the island whose hydrate step is running. Svelte raises some warnings as the
7
+ * step's effects flush (a microtask after it returns): the mark holds until the task ends, and
8
+ * islands hydrate one per task, so the next one never inherits it. */
9
+ function set_hydrating(el) {
10
+ hydrating = el;
11
+ setTimeout(() => {
12
+ if (hydrating === el) hydrating = null;
13
+ }, 0);
14
+ }
15
+ function svelte_warnings() {
16
+ return kept.slice();
17
+ }
18
+ function on_svelte_warning(cb) {
19
+ listeners.push(cb);
20
+ }
21
+ /** `%c[svelte] code\n%cmessage …` → the parts (null: not a Svelte hydration warning). */
22
+ function parse_svelte_warning(text) {
23
+ const at = text.indexOf("[svelte] ");
24
+ if (at === -1) return null;
25
+ let rest = text.slice(at + 9);
26
+ let end = 0;
27
+ while (end < rest.length && rest.charCodeAt(end) > 32) end++;
28
+ const code = rest.slice(0, end);
29
+ if (!code.startsWith("hydration")) return null;
30
+ rest = rest.slice(end).trim();
31
+ if (rest.startsWith("%c")) rest = rest.slice(2);
32
+ const line_end = rest.indexOf("\nhttps://");
33
+ const message = (line_end === -1 ? rest : rest.slice(0, line_end)).trim().slice(0, 400);
34
+ let file;
35
+ const dot = message.indexOf(".svelte");
36
+ if (dot !== -1) {
37
+ let start = dot;
38
+ while (start > 0 && message.charCodeAt(start - 1) > 32 && message[start - 1] !== "`") start--;
39
+ file = message.slice(start, dot + 7).split("​").join("");
40
+ }
41
+ return {
42
+ code,
43
+ message,
44
+ ...file ? { file } : {}
45
+ };
46
+ }
47
+ function tap_svelte_warnings() {
48
+ if (tapped || typeof console === "undefined") return;
49
+ tapped = true;
50
+ const warn = console.warn;
51
+ console.warn = function(...args) {
52
+ try {
53
+ const first = args[0];
54
+ if (typeof first === "string" && first.includes("[svelte] hydration")) {
55
+ const p = parse_svelte_warning(args.filter((a) => typeof a === "string").join("\n"));
56
+ if (p && kept.length < 100) {
57
+ const fp = hydrating?.getAttribute("data-og-fp") ?? void 0;
58
+ const w = {
59
+ ...p,
60
+ ...fp ? { fp } : {},
61
+ t: Math.round(performance.now() * 10) / 10
62
+ };
63
+ kept.push(w);
64
+ for (const cb of listeners) cb(w);
65
+ }
66
+ }
67
+ } catch {}
68
+ return warn.apply(this, args);
69
+ };
70
+ }
71
+ export { on_svelte_warning, parse_svelte_warning, set_hydrating, svelte_warnings, tap_svelte_warnings };
@@ -0,0 +1,3 @@
1
+ /** The loads this island's props, context and page seeds need, or `null` when none (the common
2
+ * case: an app without transportables, or an island that carries none). */
3
+ export declare function wire_classes_for(region: Element): Promise<unknown> | null;
@@ -0,0 +1,69 @@
1
+ import { props_sidecar_of } from "./sidecar.js";
2
+ import { yield_task } from "./schedule.js";
3
+ import { wire_all, wire_loaders } from "virtual:ogygia/transportables";
4
+ // src/runtime/wire-classes.ts
5
+ /**
6
+ * THE TRANSPORTABLE CLASSES AN ISLAND NEEDS, loaded before it decodes its props. An `[ogygia.wire]`
7
+ * class revives through its registered codec, and its module registers it when it loads. Every island
8
+ * page used to load every transportable class of the app up front (each island entry imported them
9
+ * all); now the client build carries only a map of lazy loaders (`virtual:ogygia/transportables`), and
10
+ * an island loads just what it carries:
11
+ * - its props: the server stamped the classes on the props sidecar (`data-og-wire`, tag paths);
12
+ * - the context it reads: the `<ogygia-provide>` payloads around it and the page's context root;
13
+ * - the page's seeds (`page.data`, the remote-query seed), checked once per document.
14
+ * The small texts are checked for each class's tag path (`"<path>#`). An app that sends wired values
15
+ * through Kit's `transport` (`wire_all`: remote functions, loads) gets every class with every island,
16
+ * as before: those values decode synchronously whenever they arrive. Each module loads once.
17
+ */
18
+ const loaders = wire_loaders;
19
+ const paths = Object.keys(loaders);
20
+ const loading = /* @__PURE__ */ new Map();
21
+ function load(path) {
22
+ let p = loading.get(path);
23
+ if (!p) {
24
+ const loader = loaders[path];
25
+ p = loader ? yield_task().then(loader).catch(() => void 0) : Promise.resolve();
26
+ loading.set(path, p);
27
+ }
28
+ return p;
29
+ }
30
+ /** The classes a text names (`"<tag path>#…` appears in it), into `want`. */
31
+ function scan(text, want) {
32
+ if (!text) return;
33
+ for (const p of paths) if (!want.has(p) && text.indexOf("\"" + p + "#") !== -1) want.add(p);
34
+ }
35
+ /** The document's seeds, checked once per document (a router swap brings new ones). */
36
+ let seed_classes = null;
37
+ function classes_in_seeds(doc) {
38
+ if (seed_classes?.doc === doc) return seed_classes.want;
39
+ const want = /* @__PURE__ */ new Set();
40
+ for (const s of doc.querySelectorAll("script[type=\"application/ogygia-page\"], script[type=\"application/ogygia-remote\"]")) scan(s.textContent, want);
41
+ seed_classes = {
42
+ doc,
43
+ want
44
+ };
45
+ return want;
46
+ }
47
+ if (typeof document !== "undefined") document.addEventListener("og:after-swap", () => seed_classes = null);
48
+ /** The loads this island's props, context and page seeds need, or `null` when none (the common
49
+ * case: an app without transportables, or an island that carries none). */
50
+ function wire_classes_for(region) {
51
+ if (!paths.length) return null;
52
+ const want = /* @__PURE__ */ new Set();
53
+ if (wire_all) for (const p of paths) want.add(p);
54
+ else {
55
+ const stamp = props_sidecar_of(region)?.getAttribute("data-og-wire");
56
+ if (stamp) {
57
+ for (const p of stamp.split(" ")) if (p) want.add(p);
58
+ }
59
+ for (let el = region.parentElement; el; el = el.parentElement) if (el.tagName === "OGYGIA-PROVIDE") scan(el.querySelector(":scope > script[data-ogygia-provide]")?.textContent, want);
60
+ const doc = region.ownerDocument;
61
+ scan(doc.querySelector("script[data-ogygia-provide-page]")?.textContent, want);
62
+ for (const p of classes_in_seeds(doc)) want.add(p);
63
+ }
64
+ if (!want.size) return null;
65
+ const pending = [];
66
+ for (const p of want) pending.push(load(p));
67
+ return Promise.all(pending);
68
+ }
69
+ export { wire_classes_for };