@ogygia/core 0.0.0 → 0.11.1

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 +185 -0
  49. package/dist/compiler/ctx.js +203 -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,153 @@
1
+ // src/runtime/region-attrs.ts
2
+ /**
3
+ * DOM attribute vocabulary for `<ogygia-region>` (DESIGN.md two axes).
4
+ *
5
+ * - `wake` — when JS wakes: `none` | `load` | `idle` | `visible` | `interaction` | media query
6
+ * - `render` — when HTML arrives: omit/`page` | `defer`
7
+ * - `when` — schedule for `render="defer"` OR `remount="swr"` revalidate
8
+ * - `hydrate-margin` — IntersectionObserver rootMargin for phase-2 `wake="visible"`
9
+ * - `remount` — `{#if}` re-creation of `wake="none"`: `cache` | `empty` | `swr`
10
+ * - `max-age` — client lake-cache TTL in ms (optional)
11
+ * - `on-expire` — past max-age: `empty` | `fetch` (swr default `fetch`, cache default `empty`)
12
+ *
13
+ * No "island" / "lake" attribute names — those are nicknames, not the mechanism.
14
+ */
15
+ /** CSS selector for frozen regions (`hydrate: 'none'`). */
16
+ const FROZEN_SELECTOR = "ogygia-region[wake=\"none\"]";
17
+ /** True if this region is a wake boundary (JS will / did run for its subtree). */
18
+ function is_awake(el) {
19
+ const h = el.getAttribute("wake");
20
+ return h != null && h !== "none";
21
+ }
22
+ /** True if this region freezes its subtree (SSR DOM preserved; no client module). */
23
+ function is_frozen(el) {
24
+ return el.getAttribute("wake") === "none";
25
+ }
26
+ /** True if this region fetches HTML later (`render="defer"`). */
27
+ function is_deferred(el) {
28
+ return el.getAttribute("render") === "defer";
29
+ }
30
+ /**
31
+ * The regions whose INSIDE Kit's hydration never walks — OPAQUE to it, adopted as one element: a lake
32
+ * (frozen server HTML), a hole (a fallback, then an answer fetched after load — a region found inside
33
+ * one on a Kit-hydrated document came with that answer: the page's own fallback renders its islands
34
+ * inline, as Kit's), and a BAKED live region (its first HTML is server-only, morphed in after by the
35
+ * runtime). Their insides are ogygia's on every page: nothing else will wake them. The server twins:
36
+ * `isInLake()` (context.ts — set by LakeBoundary and on every render root whose HTML lands in one) and
37
+ * `region_kind` (reversible.ts).
38
+ */
39
+ const OPAQUE_SELECTOR = "ogygia-region[wake=\"none\"],ogygia-region[render=\"defer\"],ogygia-region[data-og-baked]";
40
+ /** True if this region sits inside an {@link OPAQUE_SELECTOR opaque} region: on a Kit-hydrated
41
+ * document nothing but the runtime will ever wake it. */
42
+ function inside_opaque(el) {
43
+ return !!el.parentElement?.closest(OPAQUE_SELECTOR);
44
+ }
45
+ /** Mixed mode (a csr=true document): Kit hydrates the tree, so an island there is Kit's — EXCEPT
46
+ * what Kit never sees: a deferred region (its HTML is fetched after load) and anything inside an
47
+ * opaque region (a lake, a hole's answer, a baked region's first HTML). Those are ours. */
48
+ function ours_on_kit_document(el) {
49
+ return is_deferred(el) || inside_opaque(el);
50
+ }
51
+ /** `{#if}` remount policy for `wake="none"` regions. Default `cache`. */
52
+ function region_remount(el) {
53
+ const r = el.getAttribute("remount");
54
+ if (r === "empty" || r === "swr") return r;
55
+ return "cache";
56
+ }
57
+ /** Client lake-cache TTL in ms from `max-age`. `0` = no expiry. */
58
+ function region_max_age_ms(el) {
59
+ const raw = el.getAttribute("max-age");
60
+ if (raw == null || raw === "") return 0;
61
+ const n = Number(raw);
62
+ return Number.isFinite(n) && n > 0 ? n : 0;
63
+ }
64
+ /**
65
+ * Past-maxAge behavior. Defaults: `cache` → `empty`, `swr` → `fetch`.
66
+ * `fetch` is only meaningful with `remount="swr"` (endpoint present).
67
+ */
68
+ function region_on_expire(el) {
69
+ const raw = el.getAttribute("on-expire");
70
+ if (raw === "empty" || raw === "fetch") return raw;
71
+ return region_remount(el) === "swr" ? "fetch" : "empty";
72
+ }
73
+ /**
74
+ * True when a frozen region has only Svelte placeholder anchors (comments / whitespace).
75
+ * Used by remount: a text-only lake is still "filled" — `querySelector('*')` would miss it and
76
+ * double-append the cache on reconnect (REMOUNT-VACANT).
77
+ */
78
+ function region_is_vacant(el) {
79
+ for (const n of el.childNodes) {
80
+ if (n.nodeType === 1) return false;
81
+ if (n.nodeType === 3 && (n.textContent?.trim() ?? "") !== "") return false;
82
+ }
83
+ return true;
84
+ }
85
+ /** True when this document was SERVED FROM a page store (a plugin stamps the hit/join copies with
86
+ * `STORED_DOCUMENT_META`). A stored copy is a cached render by definition — swr lakes read this to
87
+ * revalidate on FIRST mount, not only on remounts. */
88
+ function document_is_stored() {
89
+ return typeof document !== "undefined" && !!document.querySelector("meta[name=\"ogygia-stored\"]");
90
+ }
91
+ /**
92
+ * True when the browser's HTML parser tore this placed island's SSR content OUT of the region —
93
+ * the invalid-nesting hoist.
94
+ *
95
+ * A block-rendering island authored INLINE inside a `<p>` (e.g. a `<Counter/>` sitting in a markdown
96
+ * sentence, where the component renders `<div>…</div>`) is invalid HTML: a `<div>` start tag while a
97
+ * `<p>` is in button scope makes the parser CLOSE the paragraph, popping this `<ogygia-region>` with
98
+ * it — the region is left holding only its opening Svelte hydration anchors (`<!--[-->`), while the
99
+ * rendered nodes (and the closing anchors) become siblings of the paragraph. Hydrating that empty
100
+ * region then fresh-mounts a SECOND copy, and the hoisted server copy lingers as an orphan → the
101
+ * page shows the island twice.
102
+ *
103
+ * Detected as an UNBALANCED hydration envelope: strictly more `[` open anchors than `]` close anchors
104
+ * among the region's descendants. A validly-nested region (inline content, or block content in block
105
+ * context) always balances; a region that renders nothing balances (0 == 0); a not-yet-swapped
106
+ * deferred/live region carries no anchors at all (0 == 0). So this never false-positives on a
107
+ * correctly-parsed region — only the parser-truncated envelope reads open > close.
108
+ */
109
+ function region_ssr_truncated(el) {
110
+ let open = 0;
111
+ let close = 0;
112
+ const scan = (parent) => {
113
+ for (const n of parent.childNodes) if (n.nodeType === 8) {
114
+ const d = (n.textContent ?? "").trim();
115
+ if (d[0] === "[") open++;
116
+ else if (d[0] === "]") close++;
117
+ } else if (n.nodeType === 1) scan(n);
118
+ };
119
+ scan(el);
120
+ return open > close;
121
+ }
122
+ /**
123
+ * Schedule string for the shared scheduler.
124
+ * Deferred regions use `when`; waking regions use `wake`; default `load`.
125
+ */
126
+ function region_schedule(el) {
127
+ if (is_deferred(el)) return el.getAttribute("when") || "load";
128
+ const h = el.getAttribute("wake");
129
+ if (h && h !== "none") return h;
130
+ return "load";
131
+ }
132
+ /**
133
+ * Wake schedule from `wake`, or `null` when this region does not run JS
134
+ * (`wake` absent / `'none'`). Used after a deferred HTML swap for phase 2.
135
+ */
136
+ function region_hydrate_schedule(el) {
137
+ const h = el.getAttribute("wake");
138
+ if (h == null || h === "none") return null;
139
+ return h;
140
+ }
141
+ /**
142
+ * Phase-2 (post-swap) hydrate schedule for a deferred client island.
143
+ *
144
+ * - Matching schedules (`load`/`load`, `idle`/`idle`, `visible`/`visible`, same media) → `'load'`
145
+ * (hydrate immediately; do not re-arm the same idle / IO / MQ).
146
+ * - `hydrate: 'load'` after any defer → `'load'` (ASAP after swap).
147
+ * - Otherwise arm hydrate’s own schedule only.
148
+ */
149
+ function phase2_hydrate_schedule(defer_when, hydrate) {
150
+ if (hydrate === "load" || hydrate === defer_when) return "load";
151
+ return hydrate;
152
+ }
153
+ export { FROZEN_SELECTOR, OPAQUE_SELECTOR, document_is_stored, inside_opaque, is_awake, is_deferred, is_frozen, ours_on_kit_document, phase2_hydrate_schedule, region_hydrate_schedule, region_is_vacant, region_max_age_ms, region_on_expire, region_remount, region_schedule, region_ssr_truncated };
@@ -0,0 +1,76 @@
1
+ import { LoadClass } from "./load-scheduler.js";
2
+ /** Hoisted (hot paths — connectedCallback/hydrate run per region); shared with core's
3
+ * foreign-origin checks. */
4
+ export declare const ABSOLUTE_URL_SCHEME: RegExp;
5
+ /**
6
+ * Defense-in-depth: only fetch region HTML from same-origin capability URLs.
7
+ * Mint always emits a path-only URL (`resolve(DEFAULT_ISLANDS_ENDPOINT)?…`). Absolute /
8
+ * protocol-relative endpoints would require prior HTML injection — still reject them so the
9
+ * runtime is not an XSS amplifier. See INVARIANTS.md · HOLE-TRUST.
10
+ */
11
+ /** True when `endpoint` resolves to same-origin http(s). */
12
+ export declare function is_allowed_region_endpoint(endpoint: string, page_origin?: string): boolean;
13
+ /**
14
+ * Has this hole's capability (probably) EXPIRED — worth one retry with `&renew=1` after a 403? Its
15
+ * document outlived it in a cache (server/shared-cache.ts). Read from the signed `exp` in the URL,
16
+ * with {@link CLOCK_SKEW_SEC} of slack for a slow clock; a URL that has not expired never renews
17
+ * (the server refuses it), so a wrong guess costs one refused request.
18
+ */
19
+ export declare function capability_expired(endpoint: string, now_ms?: number, page_origin?: string): boolean;
20
+ /** The renewal request for an expired capability `endpoint` (the handle re-signs it, anonymous
21
+ * holes only, and answers the fresh capability in `x-ogygia-capability`). */
22
+ export declare function renewal_url(endpoint: string): string;
23
+ /**
24
+ * Is this hole answer a WHOLE DOCUMENT rather than the region's fragment? ogygia's handle answers a
25
+ * region request in place — a fragment, a 204, an error status — never with a page. A page here
26
+ * means a handle in front of `ogygia.handle()` took the request instead (an auth wall, a locale
27
+ * bounce, a 404 handler) and the browser followed it: a customer's signed-in visitors had every
28
+ * hole of the header filled with the account area's page — its scripts, its skeletons, a second
29
+ * header. Refused, the fallback stands; the redirect twin is {@link is_redirected_answer}.
30
+ */
31
+ export declare function is_document_answer(text: string): boolean;
32
+ /** A region request that was redirected (same origin — cross-origin is refused earlier) did not
33
+ * reach the endpoint it named: whatever answered is not the region. */
34
+ export declare function is_redirected_answer(res: Response): boolean;
35
+ /**
36
+ * Why a hole's answer was refused:
37
+ * - `redirected` / `document`: something in front of ogygia's handle answered instead;
38
+ * - `forbidden`: the handle refused the capability (a 403, `deny` says why — `foreign-key` when the
39
+ * page and the islands endpoint came from different deployments).
40
+ */
41
+ export type RegionRefusal = "redirected" | "document" | "forbidden";
42
+ /** The error a refused answer throws: the fetch loop does not retry it (the answer is
43
+ * deterministic — a redirect rule, a refused capability, not a flaky network) and DEV names the
44
+ * culprit. */
45
+ export declare class RegionAnswerRefused extends Error {
46
+ override name: string;
47
+ readonly reason: RegionRefusal;
48
+ readonly final_url: string;
49
+ /** `forbidden`: the server's `x-ogygia-deny`, with its key fingerprint and the capability's */
50
+ readonly deny?: string;
51
+ constructor(reason: RegionRefusal, final_url: string, deny?: string);
52
+ }
53
+ /** The reason a 403 without `x-ogygia-deny` gets: ogygia's handle never answered it. */
54
+ export declare const NOT_OGYGIA_403 = "not ogygia: a proxy, CDN or firewall in front answered (a 403 without x-ogygia-deny)";
55
+ /**
56
+ * A 403 from the islands endpoint, as one line: its `x-ogygia-deny` reason, and for `foreign-key`
57
+ * the two keys (the capability's `&k=`, the answering server's `x-ogygia-key`). A 403 with no reason
58
+ * came from something in front of the handle (a bot wall), or from a server before reasons.
59
+ */
60
+ export declare function deny_of(res: Response, endpoint: string): string;
61
+ /** After fetch: reject opaque redirects that left the page origin. */
62
+ export declare function is_same_origin_response(res: Response, page_origin?: string): boolean;
63
+ /**
64
+ * Normalize a hydrate `entry` for `import()`.
65
+ *
66
+ * Root-absolute paths (`/@id/…`, `/_app/…`) and absolute URLs import as-is. Relative specs
67
+ * (`./_app/…`, `../_app/…`) must resolve against the **document** URL — `import()` would
68
+ * otherwise resolve them against the runtime module (`/_app/immutable/og-runtime.*`)
69
+ * and produce `/_app/_app/…` 404s on nested routes.
70
+ */
71
+ export declare function island_module_url(entry: string, base?: string): string;
72
+ /** Fire-and-forget `import()` of an island's module, deduped by resolved URL. */
73
+ export declare function warm_island_module(entry: string, base?: string, cls?: LoadClass): void;
74
+ /** Has this island module already been warmed (or imported through the warmer)? `entry` resolves
75
+ * the way `warm_island_module` resolves it; `base` for an href read off a foreign document. */
76
+ export declare function is_warmed_module(entry: string, base?: string): boolean;
@@ -0,0 +1,169 @@
1
+ import { preload_island_graph } from "./island-graph-preload.js";
2
+ import { fetch_priority_of, load_slot } from "./load-scheduler.js";
3
+ import { entry_location } from "./entry-locations.js";
4
+ // src/runtime/region-endpoint-url.ts
5
+ /** Hoisted (hot paths — connectedCallback/hydrate run per region); shared with core's
6
+ * foreign-origin checks. */
7
+ const ABSOLUTE_URL_SCHEME = /^[a-z][a-z0-9+.-]*:/i;
8
+ /**
9
+ * Defense-in-depth: only fetch region HTML from same-origin capability URLs.
10
+ * Mint always emits a path-only URL (`resolve(DEFAULT_ISLANDS_ENDPOINT)?…`). Absolute /
11
+ * protocol-relative endpoints would require prior HTML injection — still reject them so the
12
+ * runtime is not an XSS amplifier. See INVARIANTS.md · HOLE-TRUST.
13
+ */
14
+ /** True when `endpoint` resolves to same-origin http(s). */
15
+ function is_allowed_region_endpoint(endpoint, page_origin = location.origin) {
16
+ if (typeof endpoint !== "string" || endpoint.length === 0) return false;
17
+ try {
18
+ const url = new URL(endpoint, page_origin);
19
+ if (url.protocol !== "http:" && url.protocol !== "https:") return false;
20
+ if (url.origin !== page_origin) return false;
21
+ return true;
22
+ } catch {
23
+ return false;
24
+ }
25
+ }
26
+ /** How far this browser's clock may run behind the server's and still see an expiry. */
27
+ const CLOCK_SKEW_SEC = 300;
28
+ /**
29
+ * Has this hole's capability (probably) EXPIRED — worth one retry with `&renew=1` after a 403? Its
30
+ * document outlived it in a cache (server/shared-cache.ts). Read from the signed `exp` in the URL,
31
+ * with {@link CLOCK_SKEW_SEC} of slack for a slow clock; a URL that has not expired never renews
32
+ * (the server refuses it), so a wrong guess costs one refused request.
33
+ */
34
+ function capability_expired(endpoint, now_ms = Date.now(), page_origin = location.origin) {
35
+ try {
36
+ const exp = Number(new URL(endpoint, page_origin).searchParams.get("exp"));
37
+ return Number.isFinite(exp) && exp > 0 && exp <= now_ms / 1e3 + CLOCK_SKEW_SEC;
38
+ } catch {
39
+ return false;
40
+ }
41
+ }
42
+ /** The renewal request for an expired capability `endpoint` (the handle re-signs it, anonymous
43
+ * holes only, and answers the fresh capability in `x-ogygia-capability`). */
44
+ function renewal_url(endpoint) {
45
+ return endpoint + (endpoint.includes("?") ? "&" : "?") + "renew=1";
46
+ }
47
+ /** A whole HTML document starts with a doctype or `<html>`; a region answer never does. */
48
+ const DOCUMENT_START_RE = /^\s*(?:<!doctype\b|<html\b)/i;
49
+ /**
50
+ * Is this hole answer a WHOLE DOCUMENT rather than the region's fragment? ogygia's handle answers a
51
+ * region request in place — a fragment, a 204, an error status — never with a page. A page here
52
+ * means a handle in front of `ogygia.handle()` took the request instead (an auth wall, a locale
53
+ * bounce, a 404 handler) and the browser followed it: a customer's signed-in visitors had every
54
+ * hole of the header filled with the account area's page — its scripts, its skeletons, a second
55
+ * header. Refused, the fallback stands; the redirect twin is {@link is_redirected_answer}.
56
+ */
57
+ function is_document_answer(text) {
58
+ return DOCUMENT_START_RE.test(text.slice(0, 256));
59
+ }
60
+ /** A region request that was redirected (same origin — cross-origin is refused earlier) did not
61
+ * reach the endpoint it named: whatever answered is not the region. */
62
+ function is_redirected_answer(res) {
63
+ return res.redirected === true;
64
+ }
65
+ /** The error a refused answer throws: the fetch loop does not retry it (the answer is
66
+ * deterministic — a redirect rule, a refused capability, not a flaky network) and DEV names the
67
+ * culprit. */
68
+ var RegionAnswerRefused = class extends Error {
69
+ name = "RegionAnswerRefused";
70
+ reason;
71
+ final_url;
72
+ /** `forbidden`: the server's `x-ogygia-deny`, with its key fingerprint and the capability's */
73
+ deny;
74
+ constructor(reason, final_url, deny) {
75
+ super(`region answer refused: ${reason}${deny ? ` (${deny})` : ""} (${final_url})`);
76
+ this.reason = reason;
77
+ this.final_url = final_url;
78
+ this.deny = deny;
79
+ }
80
+ };
81
+ /** The reason a 403 without `x-ogygia-deny` gets: ogygia's handle never answered it. */
82
+ const NOT_OGYGIA_403 = "not ogygia: a proxy, CDN or firewall in front answered (a 403 without x-ogygia-deny)";
83
+ /**
84
+ * A 403 from the islands endpoint, as one line: its `x-ogygia-deny` reason, and for `foreign-key`
85
+ * the two keys (the capability's `&k=`, the answering server's `x-ogygia-key`). A 403 with no reason
86
+ * came from something in front of the handle (a bot wall), or from a server before reasons.
87
+ */
88
+ function deny_of(res, endpoint) {
89
+ const why = res.headers.get("x-ogygia-deny");
90
+ if (why === null) return NOT_OGYGIA_403;
91
+ if (why !== "foreign-key") return why;
92
+ let minted = "";
93
+ try {
94
+ minted = new URL(endpoint, location.href).searchParams.get("k") ?? "";
95
+ } catch {}
96
+ return `foreign-key: signed by ${minted || "?"}, answered by ${res.headers.get("x-ogygia-key") ?? "?"}`;
97
+ }
98
+ /** After fetch: reject opaque redirects that left the page origin. */
99
+ function is_same_origin_response(res, page_origin = location.origin) {
100
+ if (!res.url) return true;
101
+ try {
102
+ return new URL(res.url).origin === page_origin;
103
+ } catch {
104
+ return false;
105
+ }
106
+ }
107
+ /**
108
+ * Normalize a hydrate `entry` for `import()`.
109
+ *
110
+ * Root-absolute paths (`/@id/…`, `/_app/…`) and absolute URLs import as-is. Relative specs
111
+ * (`./_app/…`, `../_app/…`) must resolve against the **document** URL — `import()` would
112
+ * otherwise resolve them against the runtime module (`/_app/immutable/og-runtime.*`)
113
+ * and produce `/_app/_app/…` 404s on nested routes.
114
+ */
115
+ function island_module_url(entry, base) {
116
+ if (!entry) return entry;
117
+ const located = entry_location(entry, base);
118
+ if (located) return located;
119
+ if (entry.startsWith("/") || ABSOLUTE_URL_SCHEME.test(entry)) return entry;
120
+ const b = base ?? location.href;
121
+ const key = b + "\n" + entry;
122
+ const hit = module_urls.get(key);
123
+ if (hit !== void 0) return hit;
124
+ const resolved = new URL(entry, b);
125
+ const out = resolved.pathname + resolved.search + resolved.hash;
126
+ if (module_urls.size > 4e3) module_urls.clear();
127
+ module_urls.set(key, out);
128
+ return out;
129
+ }
130
+ /** A relative entry resolved against its document, by base + entry (asked on every wake and warm). */
131
+ const module_urls = /* @__PURE__ */ new Map();
132
+ const warmed_modules = /* @__PURE__ */ new Set();
133
+ /** The warmer's key: the resolved module as an absolute URL (a location arrives absolute, an href
134
+ * off a page root-relative — the same file must be one key). */
135
+ function warm_key(url) {
136
+ try {
137
+ return new URL(url, location.href).href;
138
+ } catch {
139
+ return url;
140
+ }
141
+ }
142
+ /** Fire-and-forget `import()` of an island's module, deduped by resolved URL. */
143
+ function warm_island_module(entry, base, cls = "speculative") {
144
+ const url = island_module_url(entry, base);
145
+ if (!url) return;
146
+ const key = warm_key(url);
147
+ if (warmed_modules.has(key)) return;
148
+ warmed_modules.add(key);
149
+ load_slot({
150
+ kind: "code",
151
+ cls,
152
+ label: entry
153
+ }).ready.then((release) => {
154
+ preload_island_graph(entry, base, fetch_priority_of(cls));
155
+ import(
156
+ /* @vite-ignore */
157
+ url
158
+ ).catch(() => {
159
+ warmed_modules.delete(key);
160
+ }).finally(release);
161
+ });
162
+ }
163
+ /** Has this island module already been warmed (or imported through the warmer)? `entry` resolves
164
+ * the way `warm_island_module` resolves it; `base` for an href read off a foreign document. */
165
+ function is_warmed_module(entry, base) {
166
+ const url = island_module_url(entry, base);
167
+ return !!url && warmed_modules.has(warm_key(url));
168
+ }
169
+ export { ABSOLUTE_URL_SCHEME, NOT_OGYGIA_403, RegionAnswerRefused, capability_expired, deny_of, is_allowed_region_endpoint, is_document_answer, is_redirected_answer, is_same_origin_response, is_warmed_module, island_module_url, renewal_url, warm_island_module };
@@ -0,0 +1,8 @@
1
+ /** Record that `region`'s island resolved page id `id` (called via the resolve-sink). */
2
+ export declare function record_region_id(region: Element, id: string): void;
3
+ /** The page ids a region's island owns, or undefined. */
4
+ export declare function region_owned_ids(region: Element): Set<string> | undefined;
5
+ /** Run `fn` with the hub's resolve-sink funneling every page id it resolves to `region`'s owned
6
+ * set, then restore the previous sink (finally, so a throw can't strand it). Wrap an island's
7
+ * SYNC prop/context decode so the reconciler learns which ids that island owns. */
8
+ export declare function capture_region_ids<T>(region: Element, fn: () => T): T;
@@ -0,0 +1,33 @@
1
+ import { set_resolve_sink } from "../ref.js";
2
+ // src/runtime/region-ids.ts
3
+ /**
4
+ * R3 OWNERSHIP: which page-scoped hub ids each region's island resolved during hydration. The
5
+ * hydrate core installs a resolve-sink (ref.set_resolve_sink) around each island's sync prop +
6
+ * context decode that funnels ids here, keyed by the region element; the reconciler (a navigation)
7
+ * disposes exactly the ids of REMOVED regions. WeakMap → a removed element's set is GC'd with it.
8
+ * Its own module so the boot-time reconciler and the lazily loaded hydrate core share one map
9
+ * without either importing the other.
10
+ */
11
+ const owned_ids = /* @__PURE__ */ new WeakMap();
12
+ /** Record that `region`'s island resolved page id `id` (called via the resolve-sink). */
13
+ function record_region_id(region, id) {
14
+ let set = owned_ids.get(region);
15
+ if (set === void 0) owned_ids.set(region, set = /* @__PURE__ */ new Set());
16
+ set.add(id);
17
+ }
18
+ /** The page ids a region's island owns, or undefined. */
19
+ function region_owned_ids(region) {
20
+ return owned_ids.get(region);
21
+ }
22
+ /** Run `fn` with the hub's resolve-sink funneling every page id it resolves to `region`'s owned
23
+ * set, then restore the previous sink (finally, so a throw can't strand it). Wrap an island's
24
+ * SYNC prop/context decode so the reconciler learns which ids that island owns. */
25
+ function capture_region_ids(region, fn) {
26
+ set_resolve_sink((id) => record_region_id(region, id));
27
+ try {
28
+ return fn();
29
+ } finally {
30
+ set_resolve_sink(null);
31
+ }
32
+ }
33
+ export { capture_region_ids, record_region_id, region_owned_ids };
@@ -0,0 +1,2 @@
1
+ /** Feature entry: fill the `remoteSeeds` slot. */
2
+ export declare function install(): void;
@@ -0,0 +1,21 @@
1
+ import { slots } from "./slots.js";
2
+ import { seed_query_responses } from "../shims/kit-remote/client-stub.js";
3
+ import { clear_remote_instances, clear_remote_seeds } from "../shims/kit-remote/remote-cache.js";
4
+ // src/runtime/remote-seeds.ts
5
+ /**
6
+ * Remote-seeds feature: seed the reused Kit client query cache from the server's
7
+ * `application/ogygia-remote` side-channel (zero-flash hydration), and clear it across SPA swaps.
8
+ *
9
+ * A HYDRATE-phase feature (link/runtime-entry.ts): installed by the hydrate core, never the boot —
10
+ * only `seeds.ts` (hydrate core) reads the slot, and the decoder imports the APP's transport codecs
11
+ * (its own `src/hooks.ts`), which reach Svelte.
12
+ */
13
+ /** Feature entry: fill the `remoteSeeds` slot. */
14
+ function install() {
15
+ slots.remoteSeeds = {
16
+ seed_query_responses,
17
+ clear_remote_seeds,
18
+ clear_remote_instances
19
+ };
20
+ }
21
+ export { install };
@@ -0,0 +1,2 @@
1
+ /** `(r) => did r hold the first paint`, read once for a pass over many entries */
2
+ export declare function paint_blocker(): (r: PerformanceResourceTiming) => boolean;
@@ -0,0 +1,30 @@
1
+ // src/runtime/render-blocking.ts
2
+ /** whether this browser says per file what blocked the paint */
3
+ function status_known() {
4
+ return typeof PerformanceResourceTiming !== "undefined" && "renderBlockingStatus" in PerformanceResourceTiming.prototype;
5
+ }
6
+ /** the URLs the head makes blocking, or null where the browser says it itself */
7
+ function head_blockers() {
8
+ if (status_known() || typeof document === "undefined" || !document.head) return null;
9
+ const out = /* @__PURE__ */ new Set();
10
+ for (const el of document.head.querySelectorAll("link[href],script[src]")) {
11
+ const marked = (el.getAttribute("blocking") ?? "").split(" ").includes("render");
12
+ if (el instanceof HTMLLinkElement) {
13
+ if (!el.relList.contains("stylesheet") || el.disabled) continue;
14
+ const media = el.media.trim();
15
+ if (marked || !media || media === "all" || matchMedia(media).matches) out.add(el.href);
16
+ } else if (el instanceof HTMLScriptElement) {
17
+ const type = el.type.trim().toLowerCase();
18
+ if (marked || (!type || type === "text/javascript" || type === "application/javascript") && !el.async && !el.defer) out.add(el.src);
19
+ }
20
+ }
21
+ return out;
22
+ }
23
+ /** `(r) => did r hold the first paint`, read once for a pass over many entries */
24
+ function paint_blocker() {
25
+ const head = head_blockers();
26
+ if (!head) return (r) => r.renderBlockingStatus === "blocking";
27
+ const parsed = performance.getEntriesByType("navigation")[0]?.domInteractive || Infinity;
28
+ return (r) => head.has(r.name) && r.startTime < parsed;
29
+ }
30
+ export { paint_blocker };
@@ -0,0 +1,34 @@
1
+ /**
2
+ * THE RESTORER — the browser half of reversible transforms (server/reversible.ts). An app's server
3
+ * transform rendered each planned custom element (`og-h`) in scoped form: its rendered tree in the
4
+ * host's light DOM, Svelte's children moved into `<slot>` wrappers inside it. This puts it back into
5
+ * the form hydration and the component's runtime both expect:
6
+ *
7
+ * 1. stand-ins (`<og-as tag="a">`: tags the HTML parser would have restructured) become their real
8
+ * element, in place — a DOM operation, which no content-model rule applies to;
9
+ * 2. for each planned host, innermost first: an open shadow root with the host's keyed sheets, the
10
+ * rendered tree moved into it (its `<slot>` wrappers become real slots), Svelte's children back
11
+ * in the light DOM in their original order and exactly as Svelte rendered them (attributes reset,
12
+ * trimmed or dropped text put back), the host's attributes back to Svelte's (except `og-keep`).
13
+ *
14
+ * The page stays painted the same throughout: the scoped form and the shadow form render alike, and
15
+ * each host is restored in one task. It must run before anything reads the markup — before an island
16
+ * snapshots or hydrates, before Kit starts, before a web-component runtime upgrades a host. So the
17
+ * handle inlines it at the end of the document's body (`restore.toString()`: this function is
18
+ * self-contained, no imports, no outer names), and the runtime calls it on a hole / lake answer before
19
+ * insertion and on an incoming page before a router swap.
20
+ *
21
+ * A host that already has a shadow root when it is reached was upgraded first — the restore came
22
+ * too late. It is left as served and reported (`ogygia:restore-late` on the host), never restored into
23
+ * a root the component's own constructor made (that tree would render twice).
24
+ */
25
+ export declare function restore(root: Document | DocumentFragment | Element): number;
26
+ /** Adopt the sheets of roots restored outside the page, now that their hosts are in it (after a hole
27
+ * answer's insertion or a router swap, in the same task: no paint in between). Each root is one of
28
+ * three: IN THE PAGE (adopted now); in a fragment not inserted yet (another hole's answer still
29
+ * waiting for its stylesheet: kept for the call after its insertion); or in ANOTHER DOCUMENT — the
30
+ * incoming page's parsed copy, where the swap left what it did not take (a morph kept the live
31
+ * host): dropped. That last one counts as connected (its document is its root), and adopting a page
32
+ * sheet into it throws — which stopped every root after it from getting its sheets. A fragment root
33
+ * still out after 30 s never goes in (a morph took a copy of it, the hole left): dropped. */
34
+ export declare function restore_adopt(): void;