@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,25 @@
1
+ import { AfterNavigateCallback, BeforeNavigateCallback } from "./router.js";
2
+ export declare const NAV_HANDLE_KEY: unique symbol;
3
+ export type NavHandle = {
4
+ goto(url: string | URL, opts?: {
5
+ replaceState?: boolean;
6
+ external?: boolean;
7
+ }): Promise<void>;
8
+ invalidate(): Promise<void>;
9
+ invalidateAll(): Promise<void>;
10
+ preloadData(url: string | URL): Promise<unknown>;
11
+ preloadCode(url?: string | URL): Promise<void>;
12
+ disableScrollHandling(): void;
13
+ pushState(): void;
14
+ replaceState(): void;
15
+ beforeNavigate(fn: BeforeNavigateCallback): () => void;
16
+ afterNavigate(fn: AfterNavigateCallback): () => void;
17
+ bust_page_cache(): void;
18
+ };
19
+ /** Publish the document's navigation handle (the router's replaces the MPA one). */
20
+ export declare function publish_nav(handle: NavHandle): void;
21
+ /**
22
+ * The handle when the router feature is not in this runtime (`router: false`): the browser owns
23
+ * navigation. Same contract the router's own functions had for that case.
24
+ */
25
+ export declare function mpa_nav(): NavHandle;
@@ -0,0 +1,71 @@
1
+ import { speculate_url } from "./speculate-hint.js";
2
+ // src/runtime/nav-handle.ts
3
+ /**
4
+ * THE NAVIGATION HANDLE — how ISLAND-SIDE code (the `$app/navigation` shim, `ogygia/app`, the
5
+ * remote-functions client stub, the lifecycle hooks) reaches the running runtime's navigation
6
+ * WITHOUT importing a runtime module.
7
+ *
8
+ * Why not just import the router: island code is bundled apart from the runtime (an island chunk
9
+ * can load on a csr=true page where the runtime never boots). A runtime module island code imports
10
+ * is SHARED between the two graphs, so the bundler must keep it out of the runtime chunk — and with
11
+ * it everything that module's own lazy chunks need. One `import … from '../runtime/router.ts'` in the
12
+ * navigation shim split the runtime's boot into a dozen files. So island code reads this handle
13
+ * from the global realm (the same pattern as the Kit page bridge, `Symbol.for('ogygia.kit-page')`),
14
+ * and `test/runtime-boot-svelte-free.test.ts` pins that no island-side module imports a boot module.
15
+ *
16
+ * Who publishes it, always, on a document ogygia boots:
17
+ * - the ROUTER feature (./router.ts `install`) — the SPA router's API;
18
+ * - otherwise core (`boot`) publishes {@link mpa_nav}: the browser navigates, preloads become
19
+ * Speculation Rules hints, and `invalidateAll` is still the soft seed refresh (./router-nav.ts,
20
+ * loaded on first use) — exactly what `router: false` apps got before.
21
+ *
22
+ * Island code reads it as `globalThis[Symbol.for('ogygia.nav')]` (the key is repeated there on
23
+ * purpose: importing {@link NAV_HANDLE_KEY} would be the very edge this module exists to avoid).
24
+ */
25
+ const NAV_HANDLE_KEY = Symbol.for("ogygia.nav");
26
+ /** Publish the document's navigation handle (the router's replaces the MPA one). */
27
+ function publish_nav(handle) {
28
+ globalThis[NAV_HANDLE_KEY] = handle;
29
+ }
30
+ const NO_UNSUBSCRIBE = () => {};
31
+ /**
32
+ * The handle when the router feature is not in this runtime (`router: false`): the browser owns
33
+ * navigation. Same contract the router's own functions had for that case.
34
+ */
35
+ function mpa_nav() {
36
+ return {
37
+ goto(url, opts = {}) {
38
+ const target = new URL(url, location.href);
39
+ if (target.protocol !== "http:" && target.protocol !== "https:") throw new Error("[ogygia] goto() only supports http(s) URLs");
40
+ if (target.origin !== location.origin && !opts.external) throw new Error("[ogygia] goto() only supports same-origin URLs (pass { external: true } to leave)");
41
+ if (opts.replaceState) location.replace(target.href);
42
+ else location.assign(target.href);
43
+ return Promise.resolve();
44
+ },
45
+ invalidate: () => import("./router-nav.js").then((n) => n.invalidate_all()),
46
+ invalidateAll: () => import("./router-nav.js").then((n) => n.invalidate_all()),
47
+ preloadData(url) {
48
+ speculate_url(url, "prerender");
49
+ return Promise.resolve({
50
+ type: "loaded",
51
+ status: 200,
52
+ data: {}
53
+ });
54
+ },
55
+ preloadCode(url) {
56
+ if (url != null) speculate_url(url, "prefetch");
57
+ return Promise.resolve();
58
+ },
59
+ disableScrollHandling() {},
60
+ pushState() {
61
+ console.warn("[ogygia] pushState() shallow routing is not supported; use goto().");
62
+ },
63
+ replaceState() {
64
+ console.warn("[ogygia] replaceState() shallow routing is not supported; use goto().");
65
+ },
66
+ beforeNavigate: () => NO_UNSUBSCRIBE,
67
+ afterNavigate: () => NO_UNSUBSCRIBE,
68
+ bust_page_cache() {}
69
+ };
70
+ }
71
+ export { NAV_HANDLE_KEY, mpa_nav, publish_nav };
@@ -0,0 +1,2 @@
1
+ /** Tie a registration's unsubscribe to the calling component's lifetime; returns it too. */
2
+ export declare function bind_to_component(off: () => void): () => void;
@@ -0,0 +1,23 @@
1
+ import { onDestroy } from "svelte";
2
+ // src/runtime/nav-hooks.ts
3
+ /**
4
+ * `beforeNavigate` / `afterNavigate` as a COMPONENT sees them (`$app/navigation`, `ogygia/app`):
5
+ * lifecycle-bound like Kit's — the hook is unsubscribed when the calling component is destroyed.
6
+ * The raw registrations (the runtime's navigation handle, ./nav-handle.ts) return an unsubscribe and
7
+ * nothing else; a component that called them on every mount (an island re-mounting on each
8
+ * navigation) left one more callback behind per visit. This module imports `onDestroy` from Svelte,
9
+ * so it lives beside the shims (in an island's chunk, where Svelte already is) — never in the
10
+ * runtime's boot chunk — and it imports nothing from the runtime (island code reaches it only
11
+ * through the navigation handle).
12
+ *
13
+ * Outside a component (a plain module, a test) Svelte throws on `onDestroy`; the registration
14
+ * still stands and the returned unsubscribe is the caller's to call, exactly as before.
15
+ */
16
+ /** Tie a registration's unsubscribe to the calling component's lifetime; returns it too. */
17
+ function bind_to_component(off) {
18
+ try {
19
+ onDestroy(off);
20
+ } catch {}
21
+ return off;
22
+ }
23
+ export { bind_to_component };
@@ -0,0 +1,4 @@
1
+ /** The value of `attr` on `el` or its NEAREST ancestor that has it, crossing shadow-root boundaries (an
2
+ * island inside a web component's shadow tree still finds the block around the component; a link a
3
+ * component renders in its shadow tree, the router's `data-sveltekit-reload` around the component). */
4
+ export declare function nearest_attr(el: Element, attr: string): string | null;
@@ -0,0 +1,16 @@
1
+ // src/runtime/nearest-attr.ts
2
+ /** The value of `attr` on `el` or its NEAREST ancestor that has it, crossing shadow-root boundaries (an
3
+ * island inside a web component's shadow tree still finds the block around the component; a link a
4
+ * component renders in its shadow tree, the router's `data-sveltekit-reload` around the component). */
5
+ function nearest_attr(el, attr) {
6
+ const sel = `[${typeof CSS !== "undefined" && CSS.escape ? CSS.escape(attr) : attr}]`;
7
+ let at = el;
8
+ while (at) {
9
+ const hit = at.closest(sel);
10
+ if (hit) return hit.getAttribute(attr);
11
+ const root = at.getRootNode();
12
+ at = root instanceof ShadowRoot ? root.host : null;
13
+ }
14
+ return null;
15
+ }
16
+ export { nearest_attr };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * ONE IntersectionObserver per distinct `rootMargin`, shared by every element that wants to know
3
+ * when it enters the viewport — `wake:'visible'` islands, `when="visible"` holes, the hydration
4
+ * scheduler's viewport snapshot. An observer per island (150 of them on a measured page) is 150
5
+ * observers the browser walks on every scroll; one per margin is a handful, each walking the same
6
+ * targets in one pass. Callbacks live on a per-observer `WeakMap` keyed by the target, so a
7
+ * disconnected element drops out with its callbacks.
8
+ *
9
+ * SEVERAL callbacks per element per margin. It was one, a second `observe` replacing the first —
10
+ * and the hydration scheduler's viewport snapshot and a `wake:'visible'` island both watch the
11
+ * island at the default margin: the wake replaced the snapshot, so the scheduler never learned
12
+ * where a visible island was and held every one of them for its whole 48 ms snapshot wait (200
13
+ * islands scrolled into view: each woke 62–84 ms late, with nothing ahead of it).
14
+ */
15
+ type Callback = (intersecting: boolean) => void;
16
+ /**
17
+ * Observe `el` under the shared observer for `rootMargin`; `cb` sees every intersection change
18
+ * (the initial one included) until the returned unobserve is called. Any number of callbacks per
19
+ * element: a later one gets the element's last known state at once (the browser reports an
20
+ * element it already watches only on a change), or the first report with the others.
21
+ */
22
+ export declare function observe(el: Element, rootMargin: string, cb: Callback): () => void;
23
+ /** Test seam: how many observers exist (one per distinct rootMargin, ever). */
24
+ export declare function observer_count(): number;
25
+ /** Observe until the FIRST time `el` intersects, then fire once and stop. */
26
+ export declare function once_visible(el: Element, rootMargin: string, fire: () => void): () => void;
27
+ export {};
@@ -0,0 +1,63 @@
1
+ // src/runtime/observe.ts
2
+ const observers = /* @__PURE__ */ new Map();
3
+ function shared(rootMargin) {
4
+ let s = observers.get(rootMargin);
5
+ if (!s) {
6
+ const callbacks = /* @__PURE__ */ new WeakMap();
7
+ const last = /* @__PURE__ */ new WeakMap();
8
+ s = {
9
+ io: new IntersectionObserver((entries) => {
10
+ for (const e of entries) {
11
+ last.set(e.target, e.isIntersecting);
12
+ const set = callbacks.get(e.target);
13
+ if (set) for (const cb of Array.from(set)) cb(e.isIntersecting);
14
+ }
15
+ }, { rootMargin }),
16
+ callbacks,
17
+ last
18
+ };
19
+ observers.set(rootMargin, s);
20
+ }
21
+ return s;
22
+ }
23
+ /**
24
+ * Observe `el` under the shared observer for `rootMargin`; `cb` sees every intersection change
25
+ * (the initial one included) until the returned unobserve is called. Any number of callbacks per
26
+ * element: a later one gets the element's last known state at once (the browser reports an
27
+ * element it already watches only on a change), or the first report with the others.
28
+ */
29
+ function observe(el, rootMargin, cb) {
30
+ const s = shared(rootMargin);
31
+ let set = s.callbacks.get(el);
32
+ if (!set) s.callbacks.set(el, set = /* @__PURE__ */ new Set());
33
+ const first = set.size === 0;
34
+ set.add(cb);
35
+ if (first) s.io.observe(el);
36
+ else if (s.last.has(el)) {
37
+ const state = s.last.get(el);
38
+ queueMicrotask(() => {
39
+ if (s.callbacks.get(el)?.has(cb)) cb(state);
40
+ });
41
+ }
42
+ return () => {
43
+ const now = s.callbacks.get(el);
44
+ if (!now?.delete(cb) || now.size) return;
45
+ s.callbacks.delete(el);
46
+ s.last.delete(el);
47
+ s.io.unobserve(el);
48
+ };
49
+ }
50
+ /** Test seam: how many observers exist (one per distinct rootMargin, ever). */
51
+ function observer_count() {
52
+ return observers.size;
53
+ }
54
+ /** Observe until the FIRST time `el` intersects, then fire once and stop. */
55
+ function once_visible(el, rootMargin, fire) {
56
+ const stop = observe(el, rootMargin, (intersecting) => {
57
+ if (!intersecting) return;
58
+ stop();
59
+ fire();
60
+ });
61
+ return stop;
62
+ }
63
+ export { observe, observer_count, once_visible };
@@ -0,0 +1,9 @@
1
+ /** Add the time since `t0` to `phase`. */
2
+ export declare function charge(phase: string, t0: number): void;
3
+ /** Run `fn`, charging its time to `phase`. */
4
+ export declare function metered<T>(phase: string, fn: () => T): T;
5
+ /** The cost so far, rounded: `{ ms, phases }`. */
6
+ export declare function own_cost(): {
7
+ ms: number;
8
+ phases: Record<string, number>;
9
+ };
@@ -0,0 +1,35 @@
1
+ // src/runtime/own-cost.ts
2
+ /**
3
+ * What MEASURING costs the page's main thread, by phase (ms): the work devtools and the profiler's
4
+ * beacon do only because someone measures — checking each island's markup as it hydrates, building the
5
+ * visit, the testing API's reports. A visitor with devtools off pays none of it, so a test subtracts it
6
+ * (`page().ogygia`) and a CPU comparison across ogygia versions stays about the page.
7
+ */
8
+ const spent = globalThis[Symbol.for("ogygia.own-cost")] ??= {};
9
+ /** Add the time since `t0` to `phase`. */
10
+ function charge(phase, t0) {
11
+ spent[phase] = (spent[phase] ?? 0) + (performance.now() - t0);
12
+ }
13
+ /** Run `fn`, charging its time to `phase`. */
14
+ function metered(phase, fn) {
15
+ const t0 = performance.now();
16
+ try {
17
+ return fn();
18
+ } finally {
19
+ charge(phase, t0);
20
+ }
21
+ }
22
+ /** The cost so far, rounded: `{ ms, phases }`. */
23
+ function own_cost() {
24
+ const phases = {};
25
+ let ms = 0;
26
+ for (const k in spent) {
27
+ phases[k] = Math.round(spent[k] * 10) / 10;
28
+ ms += spent[k];
29
+ }
30
+ return {
31
+ ms: Math.round(ms * 10) / 10,
32
+ phases
33
+ };
34
+ }
35
+ export { charge, metered, own_cost };
@@ -0,0 +1,101 @@
1
+ /**
2
+ * # DOM ownership — who owns a node inside a region (internal/notes/dom-ownership.md)
3
+ *
4
+ * Every ogygia DOM writer (the pre-hydration drift check and repair, the morph behind hole answers /
5
+ * live ticks / navigations, drift-watch) asks THIS module whether it may touch an element, instead of
6
+ * re-deriving the answer from its own subset of signals. One answer per element, one precedence:
7
+ *
8
+ * | owner | what |
9
+ * |-----------|-----------------------------------------------------------------------|
10
+ * | `foreign` | a subtree the app declared the live DOM's own (`data-ogygia-keep` / `data-persist` on a plain element) |
11
+ * | `region` | a hydrated region root: Svelte's reactivity owns it now, not a morph |
12
+ * | `page` | `<ogygia-slot>`: host-page content an island adopts whole |
13
+ * | `static` | an element the compiler stamped `data-og-opaque` — render output Svelte's hydration never walks into (`{@html}`, `bind:innerHTML`, a custom element with static children) — or a child element of one stamped `data-og-html` (it may be `{@html}` content) |
14
+ * | `walk` | everything else: render output Svelte's walk binds by position |
15
+ *
16
+ * (Lakes are the sixth owner; the hydrate core lifts them out of both trees before any comparison,
17
+ * so no writer here meets one.) What each writer does with each owner is the contract table in the
18
+ * note; the short form:
19
+ * - the DRIFT CHECK and the REPAIR keep only `walk` in the server's shape — every other owner is one
20
+ * sibling to Svelte's walk (tag + position), never entered;
21
+ * - the MORPH never enters `foreign` or `region` (nor a morph ROOT that is `foreign`), and patches
22
+ * `static` / `page` / `walk` toward the answer;
23
+ * - DRIFT-WATCH ignores a change made inside a non-`walk` subtree (a widget upgrading its own light
24
+ * DOM is not the island drifting).
25
+ *
26
+ * `data-ogygia-keep` on an `<ogygia-region>` is NOT `foreign`: there it names an island that survives
27
+ * navigation (KeepHost) — Svelte owns that island, and it is repaired and hydrated like any other.
28
+ *
29
+ * FACETS (note §11): `owner_of` answers who writes INSIDE an element; the same module answers who
30
+ * writes its ATTRIBUTES (`attributes_writer`, `REGION_RENDER_ATTRS`), who ORDERS its children
31
+ * (`order_owner`), and whether a child EXISTS by the render's doing (`render_made`): one element, four
32
+ * facets, one place. The morph's matching, attribute sync and removal all read them.
33
+ */
34
+ /** The owner of an element, for the writers that consult it. */
35
+ export type Owner = "foreign" | "region" | "page" | "static" | "walk";
36
+ /** The compiler's server-only stamp: Svelte's hydration never walks inside this element. */
37
+ export declare const OPAQUE_ATTR = "data-og-opaque";
38
+ /** The compiler's server-only stamp on an element holding an `{@html}` BESIDE other children: its
39
+ * child elements may be `{@html}` content, which Svelte never walks into. (PROD output opens an
40
+ * `{@html}` block with the same `<!---->` as any separator, so the exact range is not knowable from
41
+ * the DOM; its child elements are compared by tag and position only, never entered.) */
42
+ export declare const HTML_PARENT_ATTR = "data-og-html";
43
+ /** The app declared this subtree the live DOM's own: a plain element carrying `data-ogygia-keep` or
44
+ * `data-persist` (on a region, keep names a navigation-surviving island instead — not foreign). */
45
+ export declare function is_declared_foreign(el: Element): boolean;
46
+ /** A region whose subtree Svelte's reactivity owns (hydrated), or a kept island (it survives a
47
+ * navigation untouched) — matched by a morph, never entered. `data-hydrated` is only ever set on
48
+ * hyphenated roots, so its probe sits behind a cheap hyphen test. */
49
+ export declare function is_region_owned(el: Element): boolean;
50
+ /**
51
+ * Who owns `el`. First match wins: `foreign` (declared) → `region` → `page` → `static` → `walk`.
52
+ * `foreign` outranks `region` for plain elements only (a region never answers `foreign`), so a kept
53
+ * island is `region` and a kept widget is `foreign`.
54
+ */
55
+ export declare function owner_of(el: Element): Owner;
56
+ /** True when Svelte's hydration walk binds `el`'s CHILDREN by position — the only subtrees the drift
57
+ * check and the repair keep in the server's shape. */
58
+ export declare function walk_enters(el: Element): boolean;
59
+ /**
60
+ * An UPGRADED CUSTOM ELEMENT: a live web component whose own runtime owns its host. Detected
61
+ * STRUCTURALLY — a hyphenated name with a shadow root or a registered definition — never by a
62
+ * library-specific attribute. The ONE detection every writer uses (the morph's attribute skip and
63
+ * self-owned children, the repair's conflict report).
64
+ */
65
+ export declare function is_upgraded_ce(el: Element): boolean;
66
+ /**
67
+ * An element whose CHILDREN are partly its own doing, not the render's: an upgraded custom element
68
+ * (it slots / rewrites its light DOM), or a `<dialog>` / `<details>` whose `open` the browser flips.
69
+ * A child it gave itself is `foreign` content inside a `walk`-owned element: the live morph keeps it;
70
+ * the repair removes it only where Svelte's walk needs the position (and reports the conflict).
71
+ */
72
+ export declare function is_self_owned(el: Element): boolean;
73
+ /** Who writes an element's attributes: its own runtime (an upgraded custom element's host), Svelte's
74
+ * reactivity (a hydrated region root — but see {@link REGION_RENDER_ATTRS}), or the render. */
75
+ export declare function attributes_writer(el: Element): "render" | "element" | "region";
76
+ /** The attributes of a region root that stay the render's: its ADDRESS, which the render that minted
77
+ * it writes (a re-minted hole fetches its new answer there); its content is its answer's. */
78
+ export declare const REGION_RENDER_ATTRS: readonly string[];
79
+ /** Who orders an element's children: the render (positions are its sequence), or the element itself
80
+ * (a self-owned element relocates and wraps its light DOM — positions are not the render's). */
81
+ export declare function order_owner(el: Element): "render" | "element";
82
+ /**
83
+ * Does a self-owned element SLOT its light DOM — show it through a shadow root's `<slot>`s, in
84
+ * document order — rather than render it itself? Then it has no reason to move a child: the children
85
+ * are partly its own (it may add some), but the RENDER's nodes keep the render's order (morph.ts
86
+ * `reconcile_by_identity`). One with no shadow root may relocate and wrap them: its arrangement stands.
87
+ * (a closed shadow root is invisible here: such an element is taken to arrange, the safe side)
88
+ */
89
+ export declare function slots_light_dom(el: Element): boolean;
90
+ /** A live region whose first HTML was baked into the page by Svelte's `{@html}` (Region.svelte,
91
+ * PromiseRegionAwait): kept for the element's life — Svelte's block anchors stay among its children. */
92
+ export declare const BAKED_ATTR = "data-og-baked";
93
+ /** Record that the render placed `node` (it may remove it once the render stops producing it). */
94
+ export declare function mark_render_made(node: Node): void;
95
+ /**
96
+ * Does `node`, a child of an element-ordered parent, EXIST by the render's doing? Marked by ogygia, or
97
+ * structurally: an `<ogygia-region>` is always render output, and an element whose tag the render
98
+ * produces at this level (`render_tags`) is render output — a runtime does not make the render's
99
+ * elements. Anything else is the element's own: never matched, never removed.
100
+ */
101
+ export declare function render_made(node: Node, render_tags: ReadonlySet<string>): boolean;
@@ -0,0 +1,115 @@
1
+ // src/runtime/ownership.ts
2
+ /** The compiler's server-only stamp: Svelte's hydration never walks inside this element. */
3
+ const OPAQUE_ATTR = "data-og-opaque";
4
+ /** The compiler's server-only stamp on an element holding an `{@html}` BESIDE other children: its
5
+ * child elements may be `{@html}` content, which Svelte never walks into. (PROD output opens an
6
+ * `{@html}` block with the same `<!---->` as any separator, so the exact range is not knowable from
7
+ * the DOM; its child elements are compared by tag and position only, never entered.) */
8
+ const HTML_PARENT_ATTR = "data-og-html";
9
+ const REGION = "ogygia-region";
10
+ const SLOT = "ogygia-slot";
11
+ /** The app declared this subtree the live DOM's own: a plain element carrying `data-ogygia-keep` or
12
+ * `data-persist` (on a region, keep names a navigation-surviving island instead — not foreign). */
13
+ function is_declared_foreign(el) {
14
+ return el.localName !== REGION && (el.hasAttribute("data-ogygia-keep") || el.hasAttribute("data-persist"));
15
+ }
16
+ /** A region whose subtree Svelte's reactivity owns (hydrated), or a kept island (it survives a
17
+ * navigation untouched) — matched by a morph, never entered. `data-hydrated` is only ever set on
18
+ * hyphenated roots, so its probe sits behind a cheap hyphen test. */
19
+ function is_region_owned(el) {
20
+ const name = el.localName;
21
+ if (!name.includes("-")) return false;
22
+ if (el.hasAttribute("data-hydrated")) return true;
23
+ return name === REGION && el.hasAttribute("data-ogygia-keep");
24
+ }
25
+ /**
26
+ * Who owns `el`. First match wins: `foreign` (declared) → `region` → `page` → `static` → `walk`.
27
+ * `foreign` outranks `region` for plain elements only (a region never answers `foreign`), so a kept
28
+ * island is `region` and a kept widget is `foreign`.
29
+ */
30
+ function owner_of(el) {
31
+ if (is_declared_foreign(el)) return "foreign";
32
+ if (is_region_owned(el)) return "region";
33
+ if (el.localName === SLOT) return "page";
34
+ if (el.hasAttribute("data-og-opaque") || el.parentElement?.hasAttribute("data-og-html")) return "static";
35
+ return "walk";
36
+ }
37
+ /** True when Svelte's hydration walk binds `el`'s CHILDREN by position — the only subtrees the drift
38
+ * check and the repair keep in the server's shape. */
39
+ function walk_enters(el) {
40
+ return owner_of(el) === "walk";
41
+ }
42
+ /**
43
+ * An UPGRADED CUSTOM ELEMENT: a live web component whose own runtime owns its host. Detected
44
+ * STRUCTURALLY — a hyphenated name with a shadow root or a registered definition — never by a
45
+ * library-specific attribute. The ONE detection every writer uses (the morph's attribute skip and
46
+ * self-owned children, the repair's conflict report).
47
+ */
48
+ function is_upgraded_ce(el) {
49
+ const name = el.localName;
50
+ if (!name.includes("-")) return false;
51
+ if (el.shadowRoot) return true;
52
+ return typeof customElements !== "undefined" && customElements.get(name) !== void 0;
53
+ }
54
+ /**
55
+ * An element whose CHILDREN are partly its own doing, not the render's: an upgraded custom element
56
+ * (it slots / rewrites its light DOM), or a `<dialog>` / `<details>` whose `open` the browser flips.
57
+ * A child it gave itself is `foreign` content inside a `walk`-owned element: the live morph keeps it;
58
+ * the repair removes it only where Svelte's walk needs the position (and reports the conflict).
59
+ */
60
+ function is_self_owned(el) {
61
+ const name = el.localName;
62
+ return name === "dialog" || name === "details" || is_upgraded_ce(el);
63
+ }
64
+ /** Who writes an element's attributes: its own runtime (an upgraded custom element's host), Svelte's
65
+ * reactivity (a hydrated region root — but see {@link REGION_RENDER_ATTRS}), or the render. */
66
+ function attributes_writer(el) {
67
+ if (el.localName === REGION || is_region_owned(el)) return "region";
68
+ return is_upgraded_ce(el) ? "element" : "render";
69
+ }
70
+ /** The attributes of a region root that stay the render's: its ADDRESS, which the render that minted
71
+ * it writes (a re-minted hole fetches its new answer there); its content is its answer's. */
72
+ const REGION_RENDER_ATTRS = ["endpoint"];
73
+ /** Who orders an element's children: the render (positions are its sequence), or the element itself
74
+ * (a self-owned element relocates and wraps its light DOM — positions are not the render's). */
75
+ function order_owner(el) {
76
+ if (el.localName === REGION) return el.hasAttribute("data-og-baked") ? "element" : "render";
77
+ return is_self_owned(el) ? "element" : "render";
78
+ }
79
+ /**
80
+ * Does a self-owned element SLOT its light DOM — show it through a shadow root's `<slot>`s, in
81
+ * document order — rather than render it itself? Then it has no reason to move a child: the children
82
+ * are partly its own (it may add some), but the RENDER's nodes keep the render's order (morph.ts
83
+ * `reconcile_by_identity`). One with no shadow root may relocate and wrap them: its arrangement stands.
84
+ * (a closed shadow root is invisible here: such an element is taken to arrange, the safe side)
85
+ */
86
+ function slots_light_dom(el) {
87
+ return el.shadowRoot !== null && is_upgraded_ce(el);
88
+ }
89
+ /** A live region whose first HTML was baked into the page by Svelte's `{@html}` (Region.svelte,
90
+ * PromiseRegionAwait): kept for the element's life — Svelte's block anchors stay among its children. */
91
+ const BAKED_ATTR = "data-og-baked";
92
+ /** The nodes ogygia placed under an element-ordered parent (a morph's claim or insertion, the restore
93
+ * putting Svelte's children back into a planned host). One per document across bundles: the inlined
94
+ * restorer fills the same set (`window.__og_rendered`). */
95
+ function rendered() {
96
+ const w = globalThis;
97
+ return w.__og_rendered ??= /* @__PURE__ */ new WeakSet();
98
+ }
99
+ /** Record that the render placed `node` (it may remove it once the render stops producing it). */
100
+ function mark_render_made(node) {
101
+ rendered().add(node);
102
+ }
103
+ /**
104
+ * Does `node`, a child of an element-ordered parent, EXIST by the render's doing? Marked by ogygia, or
105
+ * structurally: an `<ogygia-region>` is always render output, and an element whose tag the render
106
+ * produces at this level (`render_tags`) is render output — a runtime does not make the render's
107
+ * elements. Anything else is the element's own: never matched, never removed.
108
+ */
109
+ function render_made(node, render_tags) {
110
+ if (rendered().has(node)) return true;
111
+ if (node.nodeType !== 1) return false;
112
+ const name = node.localName;
113
+ return name === REGION || render_tags.has(name);
114
+ }
115
+ export { BAKED_ATTR, HTML_PARENT_ATTR, OPAQUE_ATTR, REGION_RENDER_ATTRS, attributes_writer, is_declared_foreign, is_region_owned, is_self_owned, is_upgraded_ce, mark_render_made, order_owner, owner_of, render_made, slots_light_dom, walk_enters };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Bounded SPA HTML cache: TTL + max entries + approximate byte budget.
3
+ * Expired entries are dropped on read/insert; overflow drops oldest by timestamp.
4
+ */
5
+ export type PageCacheEntry = {
6
+ html: string;
7
+ t: number;
8
+ bytes: number;
9
+ };
10
+ export declare class PageCache {
11
+ #private;
12
+ constructor(opts?: {
13
+ ttlMs?: number;
14
+ maxEntries?: number;
15
+ maxBytes?: number;
16
+ });
17
+ get(href: string): string | null;
18
+ set(href: string, html: string): void;
19
+ delete(href: string): void;
20
+ clear(): void;
21
+ get size(): number;
22
+ get bytes(): number;
23
+ }
@@ -0,0 +1,74 @@
1
+ // src/runtime/page-cache.ts
2
+ var PageCache = class {
3
+ #map = /* @__PURE__ */ new Map();
4
+ #total_bytes = 0;
5
+ #ttlMs;
6
+ #maxEntries;
7
+ #maxBytes;
8
+ constructor(opts) {
9
+ this.#ttlMs = opts?.ttlMs ?? 8e3;
10
+ this.#maxEntries = opts?.maxEntries ?? 32;
11
+ this.#maxBytes = opts?.maxBytes ?? 4e6;
12
+ }
13
+ #drop(href) {
14
+ const e = this.#map.get(href);
15
+ if (!e) return;
16
+ this.#map.delete(href);
17
+ this.#total_bytes -= e.bytes;
18
+ }
19
+ #evict_expired(now) {
20
+ for (const [href, e] of this.#map) if (now - e.t >= this.#ttlMs) this.#drop(href);
21
+ }
22
+ #evict_overflow() {
23
+ while (this.#map.size > this.#maxEntries || this.#total_bytes > this.#maxBytes) {
24
+ let oldest_href = null;
25
+ let oldest_t = Infinity;
26
+ for (const [href, e] of this.#map) if (e.t < oldest_t) {
27
+ oldest_t = e.t;
28
+ oldest_href = href;
29
+ }
30
+ if (!oldest_href) break;
31
+ this.#drop(oldest_href);
32
+ }
33
+ }
34
+ get(href) {
35
+ const now = Date.now();
36
+ const e = this.#map.get(href);
37
+ if (!e) return null;
38
+ if (now - e.t >= this.#ttlMs) {
39
+ this.#drop(href);
40
+ return null;
41
+ }
42
+ this.#map.delete(href);
43
+ e.t = now;
44
+ this.#map.set(href, e);
45
+ return e.html;
46
+ }
47
+ set(href, html) {
48
+ const now = Date.now();
49
+ this.#evict_expired(now);
50
+ this.#drop(href);
51
+ const bytes = html.length * 2;
52
+ this.#map.set(href, {
53
+ html,
54
+ t: now,
55
+ bytes
56
+ });
57
+ this.#total_bytes += bytes;
58
+ this.#evict_overflow();
59
+ }
60
+ delete(href) {
61
+ this.#drop(href);
62
+ }
63
+ clear() {
64
+ this.#map.clear();
65
+ this.#total_bytes = 0;
66
+ }
67
+ get size() {
68
+ return this.#map.size;
69
+ }
70
+ get bytes() {
71
+ return this.#total_bytes;
72
+ }
73
+ };
74
+ export { PageCache };
@@ -0,0 +1,14 @@
1
+ import { PAGE_DEFER_BOOTSTRAP } from "../page-defer.js";
2
+ /** Reviver: a defer marker `[id]` becomes a real Promise, pending until its resolve script lands (or
3
+ * already-resolved if the resolve raced ahead of the seed). */
4
+ export declare function create_deferred(id: number): Promise<unknown>;
5
+ /** Install the live resolver (which parses the encoded value) and drain anything the inline bootstrap
6
+ * queued before the runtime loaded. `extra_revivers` are the app's transport decoders (custom types in
7
+ * a streamed value). Idempotent — safe to call on every boot; the first call's revivers win. */
8
+ export declare function install_page_defer(extra_revivers?: Record<string, (payload: never) => unknown>): void;
9
+ /** devalue reviver map for the page seed. A DEFER marker becomes a pending Promise (streaming path); a
10
+ * SETTLED marker becomes an already resolved/rejected Promise (non-navigate path). Both keep
11
+ * `page.data.x` a Promise, so `{#await}` works identically regardless of how the page was requested.
12
+ * `extra` merges the app's transport decoders; ogygia's own keys always win on any name clash. */
13
+ export declare function page_defer_revivers(extra?: Record<string, (payload: never) => unknown>): Record<string, (payload: never) => unknown>;
14
+ export { PAGE_DEFER_BOOTSTRAP };