@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
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Puru Vijayvargia
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,9 @@
1
1
  # @ogygia/core
2
2
 
3
- Reserved for [ogygia](https://ogygia.puruvj.dev). The first release is on its way.
3
+ The core of [ogygia](https://ogygiajs.dev): SSR islands for SvelteKit, no Kit patches.
4
+
5
+ Apps install [`ogygia`](https://www.npmjs.com/package/ogygia), which re-exports this package subpath for
6
+ subpath. Plugin packages (`@ogygia/flags`, `@ogygia/devtools`, …) build on `@ogygia/core` and its
7
+ `@ogygia/core/plugin` door.
8
+
9
+ Docs: [ogygiajs.dev](https://ogygiajs.dev)
package/ambient.d.ts ADDED
@@ -0,0 +1,194 @@
1
+ // Ambient types for ogygia's build-time virtual modules. The library ships `.svelte`/`.ts` source
2
+ // (Region, OgygiaRouter, …) that import these; the ogygia vite plugin provides them at build time,
3
+ // but a consumer's `svelte-check`/`tsc` needs the declarations to type-check the imports. Keep in sync
4
+ // with packages/core/src/types.d.ts (the library's own build copy). Apps reach this file through
5
+ // `ogygia/types` (the `ogygia` package's ambient.d.ts references it).
6
+ declare module 'virtual:ogygia/runtime-url' {
7
+ const url: string;
8
+ export default url;
9
+ }
10
+ declare module 'virtual:ogygia/runtime-entry' {
11
+ export const __features: string[];
12
+ }
13
+ declare module 'virtual:ogygia/dev-hmr' {
14
+ /* side-effect only — CSS HMR bridge under csr=false */
15
+ }
16
+ declare module 'virtual:ogygia/dev-hmr-url' {
17
+ const url: string;
18
+ export default url;
19
+ }
20
+ declare module 'virtual:ogygia/island-deps' {
21
+ export function islandDeps(entry: string): string[];
22
+ /** Public URLs of the CSS assets an island entry (+ its dep chunks) owns — carried with a
23
+ * region response so a server-picked component styles a page that never imported it. */
24
+ export function islandCss(entry: string): string[];
25
+ /** og.$ hoisted factories (tag → self-contained source) for the page-inline registration
26
+ * script — prod SSR only; null in dev/client (dev uses the fn-manifest virtual). */
27
+ export function fnManifest(): Record<string, string> | null;
28
+ /** An entry's identity (its stable URL) → the content-hashed file it is served from; `null`: none known. */
29
+ export function entryLocation(identity: string): string | null;
30
+ }
31
+ declare module 'virtual:ogygia/manifest' {
32
+ export const dev: boolean;
33
+ export const regions: Record<
34
+ string,
35
+ { kind: 'hydrate' | 'defer' | 'lake'; load?: () => Promise<{ default: unknown }> }
36
+ >;
37
+ }
38
+ declare module 'virtual:ogygia/server-manifest' {
39
+ /** The server islands' loaders, one dynamic import away. */
40
+ export function load_islands(): Promise<typeof import('virtual:ogygia/server-islands')>;
41
+ /** Server-island id → its built client-chunk URL (the key `islandCss()` is keyed by). */
42
+ export const island_url: Record<string, string>;
43
+ /** Server-island id → its component name (`SlowHole`), where the component file is known. */
44
+ export const island_name: Record<string, string>;
45
+ export const island_render: Record<string, string>;
46
+ export const render_island: Record<string, string>;
47
+ }
48
+ declare module 'virtual:ogygia/server-islands' {
49
+ export const islands: Record<string, () => Promise<{ default: unknown }>>;
50
+ }
51
+ declare module 'virtual:ogygia/region-endpoint' {
52
+ export function makeRegionEndpoint(entry: string, props?: Record<string, unknown>): string;
53
+ export function mintServerIsland(
54
+ entry: string,
55
+ props: Record<string, unknown>,
56
+ ttl?: number
57
+ ): string;
58
+ }
59
+ declare module 'virtual:ogygia/secret' {
60
+ export const buildKey: string;
61
+ export const buildHadSecret: boolean;
62
+ }
63
+ declare module 'virtual:ogygia/sign' {
64
+ export function sign(secret: string, message: string): string;
65
+ export function verify(secret: string, message: string, sig: string): boolean;
66
+ export function region_mac_message(
67
+ id: string,
68
+ exp: number | string,
69
+ props: string,
70
+ session?: string,
71
+ ttl?: number | string,
72
+ render?: string
73
+ ): string;
74
+ }
75
+ declare module 'virtual:ogygia/request-event' {
76
+ export function getRequestEvent(): {
77
+ cookies: { get: (name: string) => string | undefined };
78
+ [key: string]: unknown;
79
+ };
80
+ }
81
+ declare module 'virtual:ogygia/rate-limit' {
82
+ export const rateLimit: { max: number; windowMs: number };
83
+ }
84
+ declare module 'virtual:ogygia/router-config' {
85
+ export const enabled: boolean;
86
+ export const viewTransitions: boolean;
87
+ }
88
+ declare module 'virtual:ogygia/session-cookie' {
89
+ export const sessionCookie: string;
90
+ }
91
+ declare module 'virtual:ogygia/region-ttl' {
92
+ export const regionTtl: number;
93
+ export const renewWindow: number;
94
+ }
95
+ declare module 'virtual:ogygia/transport' {
96
+ export const transport: Record<
97
+ string,
98
+ { encode: (v: unknown) => unknown; decode: (v: unknown) => unknown }
99
+ >;
100
+ }
101
+ declare module 'virtual:ogygia/kit-wire' {
102
+ export function stringify_remote_arg(value: unknown, transport: unknown): string;
103
+ export function stringify_command_arg(value: unknown, transport: unknown): Promise<string>;
104
+ export function create_remote_key(id: string, payload: string): string;
105
+ }
106
+
107
+ // ── the `import.meta.og` compile surface ─────────────────────────────────────────────
108
+ // ogygia's build-time constructs, under ONE short key — platform-feeling like `import.meta.glob`,
109
+ // collision-proof by ownership, one autocomplete entry for the whole family. They are not runtime
110
+ // calls: the ogygia vite plugin rewrites each at transform time; these declarations are only types.
111
+ // The rule for what belongs here: literal inputs + a build-determined result.
112
+ interface ImportMeta {
113
+ readonly og: ImportMetaOg;
114
+ }
115
+
116
+ /**
117
+ * The `import.meta.og.*` constructs: core's below, plus each plugin's — a plugin package's own
118
+ * types (`/// <reference types="@ogygia/content/types" />`) merge its macros into this interface.
119
+ */
120
+ interface ImportMetaOg {
121
+ /**
122
+ * The transportable mark — `static wire = import.meta.og.wire({ encode, decode })` on a
123
+ * class lets its instances cross island boundaries as props. A compile construct: the
124
+ * plugin CONSUMES the member and mints the symbol key (`static [Symbol.for('ogygia.wire')]
125
+ * = codec`), so the key never exists in source. STRICT: that member shape is the only
126
+ * legal position — any other use is a build error. ONE contract, always explicit:
127
+ * `{ encode, decode }` (+ optional `id`/`merge` for session continuity — see
128
+ * `TransportCodec` in `ogygia`).
129
+ */
130
+ wire<T = unknown, D = unknown>(
131
+ codec: import('@ogygia/core').TransportCodec<T, D>
132
+ ): import('@ogygia/core').TransportCodec<T, D>;
133
+ /**
134
+ * Run `fn` at BUILD, serialize its result, and inline it as a constant — "run at build, ship
135
+ * the answer." `fn` may use this module's IMPORTS and literals and `await` freely, but must be
136
+ * self-contained (no closing over the module's other locals). Its result must be
137
+ * devalue-serializable (JSON + Date/Map/Set/RegExp/BigInt) — a function, Promise, or class
138
+ * instance in the result is a build error. At runtime there is no function and no work, even in
139
+ * client code.
140
+ */
141
+ bake<T>(fn: () => T | Promise<T>): T;
142
+ /**
143
+ * Brand a value as TRANSPORTABLE so it crosses an island boundary LIVE — most often a closure
144
+ * (the wire's fn kind: the plugin hoists it to a self-contained factory, its captured locals
145
+ * becoming bound params), but also a store or an `og.wire` class instance the drop-in
146
+ * `setContext`/`og_derived` should carry live rather than freeze. Returns the SAME value (and
147
+ * type) — at the call site it reads as identity; the transform does the branding/hoisting. A
148
+ * branded closure must be self-contained (only its own captured locals + module imports, no
149
+ * `$app/*`).
150
+ */
151
+ $<T>(value: T): T;
152
+ /**
153
+ * Mark an imported component as a region — the macro alternative to `import X from '…' with
154
+ * { … }`, and the escape hatch for BARRELS. The import-attribute form only reaches a DEFAULT
155
+ * import of one file; `asRegion` marks ANY imported component, including a NAMED export from a
156
+ * barrel (`import { Header } from '@design/system'`). It is a transparent escape hatch: the
157
+ * `options` accept EXACTLY what an import attribute accepts — no more, no less — and the output
158
+ * is identical, only importing the component by its export name. Every mode works: a placed
159
+ * island (`wake`), a deferred/live server hole (`render`), a lake (`wake: 'none'`), a held
160
+ * region (`region: 'raw'`), or a named `preset`.
161
+ *
162
+ * `component` must be a bare identifier bound to a top-level import, and the call must be a
163
+ * TOP-LEVEL `const Name = import.meta.og.asRegion(Comp, …)` in the instance `<script>`. Returns
164
+ * a component with the SAME props. Compile construct — rewritten to a hoisted binding import;
165
+ * there is no runtime `asRegion`.
166
+ */
167
+ asRegion<C>(
168
+ component: C,
169
+ options: {
170
+ /** hydrate schedule (placed island / lake at `'none'`); the fetch schedule for `render`. */
171
+ wake?: 'load' | 'idle' | 'visible' | 'interaction' | 'none' | (string & {});
172
+ /** delivery mode: a static island (default), or a `'deferred'` / `'live'` server hole. */
173
+ render?: 'static' | 'deferred' | 'live';
174
+ /** a held region handed to `region()` — must be the ONLY option (`'raw'`). */
175
+ region?: 'raw';
176
+ /** a named preset from `ogygia({ presets })` — must be the ONLY option. */
177
+ preset?: string;
178
+ /** keep the live island (DOM + state) across SPA navigations. */
179
+ keep?: string;
180
+ }
181
+ ): C;
182
+ /**
183
+ * Declare a data source: `export const loadContent = import.meta.og.source(async (…) => …)`.
184
+ * Each call during a server render files a receipt (the source's `file#export` id plus a
185
+ * fingerprint of its arguments), so an invalidation names the function and its arguments
186
+ * instead of URL strings. Returns the SAME function. `opts.key` canonicalizes exotic
187
+ * arguments yourself (the default fingerprint is structural). Legal only as a top-level
188
+ * `export const`; anything else is a build error.
189
+ */
190
+ source<A extends unknown[], R>(
191
+ fn: (...args: A) => R,
192
+ opts?: { key?: (...args: A) => string }
193
+ ): (...args: A) => R;
194
+ }
@@ -0,0 +1,6 @@
1
+ <script>
2
+ // csr=false CLIENT host stand-in for a portable island binding.
3
+ // SSR / csr=true keep the real wrapper; hydrate loads via import(entry) only.
4
+ // Beside this stub the transform emits `import 'virtual:ogygia/fouc-css/…'` so Kit still
5
+ // collects island CSS into the page stylesheet graph — without dual-owning component JS.
6
+ </script>
@@ -0,0 +1,26 @@
1
+ export default ClientBindingStub;
2
+ type ClientBindingStub = SvelteComponent<{
3
+ [x: string]: never;
4
+ }, {
5
+ [evt: string]: CustomEvent<any>;
6
+ }, {}> & {
7
+ $$bindings?: string | undefined;
8
+ };
9
+ declare const ClientBindingStub: $$__sveltets_2_IsomorphicComponent<{
10
+ [x: string]: never;
11
+ }, {
12
+ [evt: string]: CustomEvent<any>;
13
+ }, {}, {}, string>;
14
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
15
+ new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
16
+ $$bindings?: Bindings;
17
+ } & Exports;
18
+ (internal: unknown, props: {
19
+ $$events?: Events;
20
+ $$slots?: Slots;
21
+ }): Exports & {
22
+ $set?: any;
23
+ $on?: any;
24
+ };
25
+ z_$$bindings?: Bindings;
26
+ }
@@ -0,0 +1,19 @@
1
+ <script>// Keep-alive host for a KEPT island (`keep:`): LiveHost's props-pushable host — the "inside an
2
+ // island" context, `$state` props, `setProps` so the next page's props reach the relocated island —
3
+ // in the SSR shape of a placed island (Region.svelte's `{#if Component}<Component {...props} />{/if}`,
4
+ // as NestedProvider mirrors it). LiveHost has no `{#if}`: it hydrates a live region's render()
5
+ // output, and a kept island hydrated through it met the server's `[0` branch marker where it
6
+ // expected the component's own, discarding the server DOM on every load. NOT part of the public API.
7
+ import { setNested } from "./context.js";
8
+ let { component: Component, initialProps } = $props();
9
+ // Seed once from the incoming prop; later pages replace it via setProps(). Intentional initial read.
10
+ // svelte-ignore state_referenced_locally
11
+ let current = $state(initialProps);
12
+ /** Called by the runtime when the island crosses to the next page — reactive prop push. */
13
+ export function setProps(next) {
14
+ current = next;
15
+ }
16
+ setNested();
17
+ </script>
18
+
19
+ {#if Component}<Component {...current} />{/if}
@@ -0,0 +1,10 @@
1
+ import { SvelteComponent } from "svelte";
2
+ type $$ComponentProps = {
3
+ component: SvelteComponent<Record<string, unknown>>;
4
+ initialProps: Record<string, unknown>;
5
+ };
6
+ declare const KeepHost: import("svelte").Component<$$ComponentProps, {
7
+ setProps: (next: Record<string, unknown>) => void;
8
+ }, "">;
9
+ type KeepHost = ReturnType<typeof KeepHost>;
10
+ export default KeepHost;
@@ -0,0 +1,16 @@
1
+ <script>
2
+ // Wraps a frozen region's content to RESET the "inside an awake region" context to false. A
3
+ // `hydrate="none"` boundary makes its subtree dead again (DESIGN.md), so a waking region authored
4
+ // inside it sees `isNested() === false` during SSR and emits its own `<ogygia-region hydrate>` —
5
+ // it then self-runs when the runtime restores the frozen DOM (its region reconnects). Renders
6
+ // nothing of its own, so the lift/restore DOM is unchanged.
7
+ // It also MARKS the subtree as a lake's inside: on a Kit-hydrated (csr=true) document the lake is
8
+ // adopted as opaque DOM, so a waking region inside it must still emit its real `<ogygia-region>`
9
+ // (Region reads `isInLake()` to skip its csr=true inline degradation there).
10
+ import { setNested, setInLake } from './context.js';
11
+ let { children } = $props();
12
+ setNested(false);
13
+ setInLake();
14
+ </script>
15
+
16
+ {@render children?.()}
@@ -0,0 +1,11 @@
1
+ export default LakeBoundary;
2
+ type LakeBoundary = {
3
+ $on?(type: string, callback: (e: any) => void): () => void;
4
+ $set?(props: Partial<$$ComponentProps>): void;
5
+ };
6
+ declare const LakeBoundary: import("svelte").Component<{
7
+ children: any;
8
+ }, {}, "">;
9
+ type $$ComponentProps = {
10
+ children: any;
11
+ };
@@ -0,0 +1,22 @@
1
+ <script>
2
+ /**
3
+ * AN INLINE ISLAND A CLIENT NAVIGATION CREATED — Kit made its wrapper in the browser, with no
4
+ * rendered stamp, so its component was not loaded yet. Load it, and render it when it lands: the
5
+ * navigation shows an empty place first, then the island. A client render, nothing to mismatch.
6
+ *
7
+ * Where the app runs Svelte's async mode, the build imports LateIslandAwait.svelte in this one's
8
+ * place, which holds the navigation until the code is in (vite/late-island.ts).
9
+ */
10
+ /** @type {{ load: () => Promise<import('svelte').Component>, props: Record<string, unknown>, children?: import('svelte').Snippet }} */
11
+ let { load, props, children } = $props();
12
+ /** @type {import('svelte').Component | undefined} */
13
+ let Component = $state(undefined);
14
+ // (a failed load renders nothing)
15
+ // svelte-ignore state_referenced_locally
16
+ load().then(
17
+ (c) => (Component = c),
18
+ () => {}
19
+ );
20
+ </script>
21
+
22
+ {#if Component}<Component {...props}>{@render children?.()}</Component>{/if}
@@ -0,0 +1,15 @@
1
+ export default LateIsland;
2
+ type LateIsland = {
3
+ $on?(type: string, callback: (e: any) => void): () => void;
4
+ $set?(props: Partial<$$ComponentProps>): void;
5
+ };
6
+ declare const LateIsland: import("svelte").Component<{
7
+ load: () => Promise<import("svelte").Component>;
8
+ props: Record<string, unknown>;
9
+ children?: import("svelte").Snippet;
10
+ }, {}, "">;
11
+ type $$ComponentProps = {
12
+ load: () => Promise<import("svelte").Component>;
13
+ props: Record<string, unknown>;
14
+ children?: import("svelte").Snippet;
15
+ };
@@ -0,0 +1,17 @@
1
+ <script>
2
+ /**
3
+ * LateIsland.svelte, for an app that runs Svelte's async mode: the build imports this one in its
4
+ * place (vite/late-island.ts). The load is awaited, so the navigation's update batch waits for it
5
+ * and Kit keeps the old page until the island's code is in — then swaps the whole new page at once
6
+ * (an island nested in it awaits in the same batch). Without async mode this file does not compile,
7
+ * which is why it is never the default.
8
+ */
9
+ /** @type {{ load: () => Promise<import('svelte').Component>, props: Record<string, unknown>, children?: import('svelte').Snippet }} */
10
+ let { load, props, children } = $props();
11
+ // (a failed load renders nothing)
12
+ // one load per island, read once on purpose (as in LateIsland.svelte)
13
+ // svelte-ignore state_referenced_locally
14
+ const Component = await load().catch(() => undefined);
15
+ </script>
16
+
17
+ {#if Component}<Component {...props}>{@render children?.()}</Component>{/if}
@@ -0,0 +1,15 @@
1
+ export default LateIslandAwait;
2
+ type LateIslandAwait = {
3
+ $on?(type: string, callback: (e: any) => void): () => void;
4
+ $set?(props: Partial<$$ComponentProps>): void;
5
+ };
6
+ declare const LateIslandAwait: import("svelte").Component<{
7
+ load: () => Promise<import("svelte").Component>;
8
+ props: Record<string, unknown>;
9
+ children?: import("svelte").Snippet;
10
+ }, {}, "">;
11
+ type $$ComponentProps = {
12
+ load: () => Promise<import("svelte").Component>;
13
+ props: Record<string, unknown>;
14
+ children?: import("svelte").Snippet;
15
+ };
@@ -0,0 +1,19 @@
1
+ <script>// Keep-alive host for an INTERACTIVE live region (`query.live` yielding `region(C, props)`
2
+ // with a wake schedule). Like NestedProvider, it sets the "inside an island" context and renders
3
+ // the component with no DOM of its own (so it hydrates the server render() output cleanly). Unlike
4
+ // NestedProvider, its props are `$state` and it exposes `setProps` — so a live tick updates the
5
+ // MOUNTED component reactively instead of tearing it down and re-hydrating. Focus and local island
6
+ // state survive; Svelte reconciles the view. NOT part of the public API.
7
+ import { setNested } from "./context.js";
8
+ let { component: Component, initialProps } = $props();
9
+ // Seed once from the incoming prop; later ticks replace it via setProps(). Intentional initial read.
10
+ // svelte-ignore state_referenced_locally
11
+ let current = $state(initialProps);
12
+ /** Called by the runtime on each live tick with the same component — reactive prop push. */
13
+ export function setProps(next) {
14
+ current = next;
15
+ }
16
+ setNested();
17
+ </script>
18
+
19
+ <Component {...current} />
@@ -0,0 +1,10 @@
1
+ import { SvelteComponent } from "svelte";
2
+ type $$ComponentProps = {
3
+ component: SvelteComponent<Record<string, unknown>>;
4
+ initialProps: Record<string, unknown>;
5
+ };
6
+ declare const LiveHost: import("svelte").Component<$$ComponentProps, {
7
+ setProps: (next: Record<string, unknown>) => void;
8
+ }, "">;
9
+ type LiveHost = ReturnType<typeof LiveHost>;
10
+ export default LiveHost;
@@ -0,0 +1,13 @@
1
+ <script>// Passthrough the runtime hydrates a top-level island into, so descendants see the
2
+ // "inside an island" context. Mirrors Region.svelte's island SSR shape EXACTLY
3
+ // (`{#if Component}<Component {...props} />{/if}`) so Svelte adopts the SSR nodes in place instead
4
+ // of discarding and re-creating the island root (a re-created root is class-less for a tick → a
5
+ // `class:`-driven `position: fixed` drops to `static` for a frame). SELF-CLOSING on purpose: any
6
+ // slot content here would pass an implicit `children` snippet that OVERRIDES the decoded
7
+ // `props.children` (the revived slot/region snippet) and desyncs hydration with an extra anchor.
8
+ import { setNested } from "./context.js";
9
+ let { component: Component, props } = $props();
10
+ setNested();
11
+ </script>
12
+
13
+ {#if Component}<Component {...props} />{/if}
@@ -0,0 +1,8 @@
1
+ import { SvelteComponent } from "svelte";
2
+ type $$ComponentProps = {
3
+ component: SvelteComponent<Record<string, unknown>>;
4
+ props: Record<string, unknown>;
5
+ };
6
+ declare const NestedProvider: import("svelte").Component<$$ComponentProps, {}, "">;
7
+ type NestedProvider = ReturnType<typeof NestedProvider>;
8
+ export default NestedProvider;
@@ -0,0 +1,5 @@
1
+ <script>let { children } = $props();
2
+ export {};
3
+ </script>
4
+
5
+ {@render children?.()}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Optional public annotation wrapper around a region usage.
3
+ *
4
+ * Renders {@linkcode children} only — no extra DOM, no nested-island context, and no
5
+ * `hydrate` / `render` attributes. Use it when you want to mark an island in source for
6
+ * humans (or a future hook). It is **not** `<svelte:boundary>` and **not** the internal
7
+ * lake context reset (`LakeBoundary`).
8
+ *
9
+ * @component
10
+ */
11
+ import type { Snippet } from 'svelte';
12
+ type $$ComponentProps = {
13
+ children?: Snippet;
14
+ };
15
+ declare const OgygiaBoundary: import("svelte").Component<$$ComponentProps, {}, "">;
16
+ type OgygiaBoundary = ReturnType<typeof OgygiaBoundary>;
17
+ export default OgygiaBoundary;
@@ -0,0 +1,40 @@
1
+ <script>
2
+ /**
3
+ * A `<Region of={promise}>` (Region.svelte hands the promise here): the region owns the whole wait.
4
+ * This one works anywhere — the server cannot wait without Svelte's async mode, so it renders the
5
+ * placeholder and the browser resolves the promise after hydration (where the app runs async mode,
6
+ * PromiseRegionAwait.svelte awaits it in the render instead: vite/late-island.ts).
7
+ *
8
+ * LATE SLOT: inside a document that delivers late chunks (the server router's streamed document
9
+ * opens that scope), the placeholder is wrapped in an `og-late-slot` the response fills when the
10
+ * promise settles. Nowhere else: a slot nothing fills stays empty forever.
11
+ *
12
+ * LAG, don't clear: a NEW promise (a re-search) keeps the previous value on screen until it lands,
13
+ * so the old content morphs instead of flashing through empty.
14
+ */
15
+ import Region from './Region.svelte';
16
+ import { register_late_region } from './late-region-registry.js';
17
+
18
+ /** @type {{ of: Promise<import('./region.js').RegionValue>, placeholder?: import('svelte').Snippet, children?: import('svelte').Snippet }} */
19
+ let { of, placeholder, children } = $props();
20
+
21
+ // svelte-ignore state_referenced_locally
22
+ const late_slot = typeof window === 'undefined' ? register_late_region(of) : null;
23
+ /** @type {import('./region.js').RegionValue | undefined} */
24
+ let awaited = $state(undefined);
25
+ $effect(() => {
26
+ const p = of;
27
+ let live = true;
28
+ Promise.resolve(p).then((r) => {
29
+ if (live) awaited = r;
30
+ });
31
+ return () => {
32
+ live = false;
33
+ };
34
+ });
35
+ </script>
36
+
37
+ {#if awaited}<Region of={awaited} {placeholder} {children} />{:else if late_slot}<og-late-slot
38
+ data-og-slot={late_slot}
39
+ style="display:contents">{@render placeholder?.()}</og-late-slot
40
+ >{:else}{@render placeholder?.()}{/if}
@@ -0,0 +1,15 @@
1
+ export default PromiseRegion;
2
+ type PromiseRegion = {
3
+ $on?(type: string, callback: (e: any) => void): () => void;
4
+ $set?(props: Partial<$$ComponentProps>): void;
5
+ };
6
+ declare const PromiseRegion: import("svelte").Component<{
7
+ of: Promise<import("./region.js").RegionValue>;
8
+ placeholder?: import("svelte").Snippet;
9
+ children?: import("svelte").Snippet;
10
+ }, {}, "">;
11
+ type $$ComponentProps = {
12
+ of: Promise<import("./region.js").RegionValue>;
13
+ placeholder?: import("svelte").Snippet;
14
+ children?: import("svelte").Snippet;
15
+ };
@@ -0,0 +1,27 @@
1
+ <script>
2
+ /**
3
+ * PromiseRegion.svelte, for an app that runs Svelte's async mode: the build imports this one in its
4
+ * place (vite/late-island.ts). The promise is AWAITED IN THE RENDER: the server render waits for it
5
+ * (Kit seeds a remote query's result into the page), hydration awaits the same value, and the page
6
+ * arrives with the region in it — no placeholder flash, no client fetch. The value renders in its
7
+ * WIRE form on both sides (`wire_form`: what crossed, as the browser has it), baked: its first HTML
8
+ * is in the page, and every later value (a refresh) morphs in.
9
+ *
10
+ * Inside a document that delivers late chunks (the server router's streamed document), the late
11
+ * slot still wins: the document streams instead of waiting. Without async mode this file does not
12
+ * compile, which is why it is never the default.
13
+ */
14
+ import Region from './Region.svelte';
15
+ import { register_late_region } from './late-region-registry.js';
16
+ import { wire_form } from './transport.js';
17
+
18
+ /** @type {{ of: Promise<import('./region.js').RegionValue>, placeholder?: import('svelte').Snippet, children?: import('svelte').Snippet }} */
19
+ let { of, placeholder, children } = $props();
20
+
21
+ // svelte-ignore state_referenced_locally
22
+ const late_slot = typeof window === 'undefined' ? register_late_region(of) : null;
23
+ </script>
24
+
25
+ {#if late_slot}<og-late-slot data-og-slot={late_slot} style="display:contents"
26
+ >{@render placeholder?.()}</og-late-slot
27
+ >{:else}<Region of={wire_form(await of)} {placeholder} {children} __baked />{/if}
@@ -0,0 +1,15 @@
1
+ export default PromiseRegionAwait;
2
+ type PromiseRegionAwait = {
3
+ $on?(type: string, callback: (e: any) => void): () => void;
4
+ $set?(props: Partial<$$ComponentProps>): void;
5
+ };
6
+ declare const PromiseRegionAwait: import("svelte").Component<{
7
+ of: Promise<import("./region.js").RegionValue>;
8
+ placeholder?: import("svelte").Snippet;
9
+ children?: import("svelte").Snippet;
10
+ }, {}, "">;
11
+ type $$ComponentProps = {
12
+ of: Promise<import("./region.js").RegionValue>;
13
+ placeholder?: import("svelte").Snippet;
14
+ children?: import("svelte").Snippet;
15
+ };
@@ -0,0 +1,27 @@
1
+ <script>// Cross-island context provider for PLAIN `getContext(key)` — no `createContext` handle needed, no
2
+ // change to the consumer islands. Writes `values` into the DOM once (so islands below, which
3
+ // hydrate as separate roots on a csr=false page, get them seeded into their own context at hydrate)
4
+ // AND sets Svelte's native context (so the SSR-nested tree + any non-island descendants read the
5
+ // same values in the server pass). Values must be SERIALIZABLE (devalue + ogygia codecs): plain
6
+ // data, `[ogygia.wire]` live values, region snippets — never a function or a live store.
7
+ import { setContext } from "svelte";
8
+ import { serialize_context } from "./context-bridge.js";
9
+ let { values, children } = $props();
10
+ // clsx-like: an object is used as-is; an array is flattened + merged left→right (falsy entries
11
+ // skipped, later keys win). A typed `createContext('k')('v')` returns `{ k: 'v' }`, so typed and
12
+ // raw entries mix freely: `values={[ { locale }, theme('dark'), cond && { x: 1 } ]}`.
13
+ // A provider's values are fixed for its lifetime — resolved once (server pass).
14
+ // svelte-ignore state_referenced_locally
15
+ const resolved = Array.isArray(values) ? Object.assign({}, ...values.filter(Boolean)) : values;
16
+ // svelte-ignore state_referenced_locally
17
+ for (const k in resolved) setContext(k, resolved[k]);
18
+ // Angle brackets built without literals so Svelte's raw-text lexer never sees a stray tag.
19
+ const LT = String.fromCharCode(60);
20
+ const GT = String.fromCharCode(62);
21
+ // Serialize on the SERVER only — a csr=false provider never runs on the client; the payload is
22
+ // already in the SSR HTML for islands to read at hydrate.
23
+ // svelte-ignore state_referenced_locally
24
+ const script = typeof window === "undefined" ? LT + "script data-ogygia-provide" + GT + serialize_context(resolved) + LT + "/script" + GT : "";
25
+ </script>
26
+
27
+ <ogygia-provide style="display:contents">{@html script}{@render children?.()}</ogygia-provide>
@@ -0,0 +1,8 @@
1
+ import type { Snippet } from 'svelte';
2
+ type $$ComponentProps = {
3
+ values: Record<string, unknown> | Array<Record<string, unknown> | false | null | undefined>;
4
+ children?: Snippet;
5
+ };
6
+ declare const Provide: import("svelte").Component<$$ComponentProps, {}, "">;
7
+ type Provide = ReturnType<typeof Provide>;
8
+ export default Provide;
@@ -0,0 +1,9 @@
1
+ <script>/**
2
+ * The component behind a pure-HTML region — what `import.meta.og.code()` / `.md()` render. The
3
+ * html is baked at build (Shiki / markdown); this just drops it in. Static: ships as HTML, no
4
+ * client JS of its own beyond the region wrapper.
5
+ */
6
+ let { html } = $props();
7
+ </script>
8
+
9
+ {@html html}
@@ -0,0 +1,6 @@
1
+ type $$ComponentProps = {
2
+ html: string;
3
+ };
4
+ declare const RawHtml: import("svelte").Component<$$ComponentProps, {}, "">;
5
+ type RawHtml = ReturnType<typeof RawHtml>;
6
+ export default RawHtml;