@ogygia/core 0.0.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (548) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +7 -1
  3. package/ambient.d.ts +194 -0
  4. package/dist/ClientBindingStub.svelte +6 -0
  5. package/dist/ClientBindingStub.svelte.d.ts +26 -0
  6. package/dist/KeepHost.svelte +19 -0
  7. package/dist/KeepHost.svelte.d.ts +10 -0
  8. package/dist/LakeBoundary.svelte +16 -0
  9. package/dist/LakeBoundary.svelte.d.ts +11 -0
  10. package/dist/LateIsland.svelte +22 -0
  11. package/dist/LateIsland.svelte.d.ts +15 -0
  12. package/dist/LateIslandAwait.svelte +17 -0
  13. package/dist/LateIslandAwait.svelte.d.ts +15 -0
  14. package/dist/LiveHost.svelte +19 -0
  15. package/dist/LiveHost.svelte.d.ts +10 -0
  16. package/dist/NestedProvider.svelte +13 -0
  17. package/dist/NestedProvider.svelte.d.ts +8 -0
  18. package/dist/OgygiaBoundary.svelte +5 -0
  19. package/dist/OgygiaBoundary.svelte.d.ts +17 -0
  20. package/dist/PromiseRegion.svelte +40 -0
  21. package/dist/PromiseRegion.svelte.d.ts +15 -0
  22. package/dist/PromiseRegionAwait.svelte +27 -0
  23. package/dist/PromiseRegionAwait.svelte.d.ts +15 -0
  24. package/dist/Provide.svelte +27 -0
  25. package/dist/Provide.svelte.d.ts +8 -0
  26. package/dist/RawHtml.svelte +9 -0
  27. package/dist/RawHtml.svelte.d.ts +6 -0
  28. package/dist/Region.svelte +1173 -0
  29. package/dist/Region.svelte.d.ts +68 -0
  30. package/dist/SlotBoundary.svelte +13 -0
  31. package/dist/SlotBoundary.svelte.d.ts +7 -0
  32. package/dist/app.d.ts +4 -0
  33. package/dist/app.js +3 -0
  34. package/dist/boundary.d.ts +35 -0
  35. package/dist/boundary.js +127 -0
  36. package/dist/build-cache.d.ts +13 -0
  37. package/dist/build-cache.js +77 -0
  38. package/dist/compiler/blank-styles.d.ts +1 -0
  39. package/dist/compiler/blank-styles.js +63 -0
  40. package/dist/compiler/bom.d.ts +2 -0
  41. package/dist/compiler/bom.js +15 -0
  42. package/dist/compiler/browser-full.d.ts +8 -0
  43. package/dist/compiler/browser-full.js +8 -0
  44. package/dist/compiler/browser.d.ts +11 -0
  45. package/dist/compiler/browser.js +11 -0
  46. package/dist/compiler/content/transportables.d.ts +26 -0
  47. package/dist/compiler/content/transportables.js +219 -0
  48. package/dist/compiler/ctx.d.ts +180 -0
  49. package/dist/compiler/ctx.js +183 -0
  50. package/dist/compiler/debarrel/barrel.d.ts +55 -0
  51. package/dist/compiler/debarrel/barrel.js +248 -0
  52. package/dist/compiler/debarrel/options.d.ts +67 -0
  53. package/dist/compiler/debarrel/options.js +31 -0
  54. package/dist/compiler/debarrel/parse.d.ts +65 -0
  55. package/dist/compiler/debarrel/parse.js +256 -0
  56. package/dist/compiler/debarrel/plugin.d.ts +31 -0
  57. package/dist/compiler/debarrel/plugin.js +190 -0
  58. package/dist/compiler/debarrel/rewrite.d.ts +27 -0
  59. package/dist/compiler/debarrel/rewrite.js +118 -0
  60. package/dist/compiler/debarrel/svelte.d.ts +13 -0
  61. package/dist/compiler/debarrel/svelte.js +56 -0
  62. package/dist/compiler/dev/css-scope.d.ts +16 -0
  63. package/dist/compiler/dev/css-scope.js +38 -0
  64. package/dist/compiler/dev/dev-hmr.d.ts +25 -0
  65. package/dist/compiler/dev/dev-hmr.js +29 -0
  66. package/dist/compiler/dev/hmr.d.ts +34 -0
  67. package/dist/compiler/dev/hmr.js +57 -0
  68. package/dist/compiler/dev/region-bytes.d.ts +34 -0
  69. package/dist/compiler/dev/region-bytes.js +126 -0
  70. package/dist/compiler/driver.d.ts +280 -0
  71. package/dist/compiler/driver.js +1352 -0
  72. package/dist/compiler/flags.d.ts +16 -0
  73. package/dist/compiler/flags.js +101 -0
  74. package/dist/compiler/fouc-css.d.ts +97 -0
  75. package/dist/compiler/fouc-css.js +335 -0
  76. package/dist/compiler/free-vars.d.ts +20 -0
  77. package/dist/compiler/free-vars.js +327 -0
  78. package/dist/compiler/host.d.ts +65 -0
  79. package/dist/compiler/host.js +51 -0
  80. package/dist/compiler/ids.d.ts +84 -0
  81. package/dist/compiler/ids.js +86 -0
  82. package/dist/compiler/index.d.ts +11 -0
  83. package/dist/compiler/index.js +11 -0
  84. package/dist/compiler/kit.d.ts +129 -0
  85. package/dist/compiler/kit.js +563 -0
  86. package/dist/compiler/link/build-output.d.ts +44 -0
  87. package/dist/compiler/link/build-output.js +147 -0
  88. package/dist/compiler/link/caps.d.ts +48 -0
  89. package/dist/compiler/link/caps.js +64 -0
  90. package/dist/compiler/link/context-detect.d.ts +23 -0
  91. package/dist/compiler/link/context-detect.js +137 -0
  92. package/dist/compiler/link/emit-gate.d.ts +11 -0
  93. package/dist/compiler/link/emit-gate.js +40 -0
  94. package/dist/compiler/link/entry-shim.d.ts +4 -0
  95. package/dist/compiler/link/entry-shim.js +29 -0
  96. package/dist/compiler/link/island-deps.d.ts +142 -0
  97. package/dist/compiler/link/island-deps.js +525 -0
  98. package/dist/compiler/link/manifest.d.ts +5 -0
  99. package/dist/compiler/link/manifest.js +9 -0
  100. package/dist/compiler/link/page-keys.d.ts +64 -0
  101. package/dist/compiler/link/page-keys.js +683 -0
  102. package/dist/compiler/link/registry-stub.d.ts +41 -0
  103. package/dist/compiler/link/registry-stub.js +212 -0
  104. package/dist/compiler/link/router-config.d.ts +11 -0
  105. package/dist/compiler/link/router-config.js +15 -0
  106. package/dist/compiler/link/router-css.d.ts +22 -0
  107. package/dist/compiler/link/router-css.js +142 -0
  108. package/dist/compiler/link/runtime-entry.d.ts +71 -0
  109. package/dist/compiler/link/runtime-entry.js +132 -0
  110. package/dist/compiler/link/server-manifest.d.ts +12 -0
  111. package/dist/compiler/link/server-manifest.js +45 -0
  112. package/dist/compiler/link/speculation.d.ts +17 -0
  113. package/dist/compiler/link/speculation.js +36 -0
  114. package/dist/compiler/link/transport.d.ts +31 -0
  115. package/dist/compiler/link/transport.js +67 -0
  116. package/dist/compiler/macros/bake.d.ts +20 -0
  117. package/dist/compiler/macros/bake.js +317 -0
  118. package/dist/compiler/macros/browser.d.ts +11 -0
  119. package/dist/compiler/macros/browser.js +69 -0
  120. package/dist/compiler/macros/dedent.d.ts +12 -0
  121. package/dist/compiler/macros/dedent.js +36 -0
  122. package/dist/compiler/macros/dollar.d.ts +15 -0
  123. package/dist/compiler/macros/dollar.js +387 -0
  124. package/dist/compiler/macros/pipeline.d.ts +31 -0
  125. package/dist/compiler/macros/pipeline.js +106 -0
  126. package/dist/compiler/macros/source.d.ts +6 -0
  127. package/dist/compiler/macros/source.js +127 -0
  128. package/dist/compiler/macros/store.d.ts +17 -0
  129. package/dist/compiler/macros/store.js +244 -0
  130. package/dist/compiler/macros/wire.d.ts +14 -0
  131. package/dist/compiler/macros/wire.js +160 -0
  132. package/dist/compiler/ownership-stamps.d.ts +6 -0
  133. package/dist/compiler/ownership-stamps.js +144 -0
  134. package/dist/compiler/parse/oxc.d.ts +34 -0
  135. package/dist/compiler/parse/oxc.js +59 -0
  136. package/dist/compiler/parse/scan.d.ts +43 -0
  137. package/dist/compiler/parse/scan.js +232 -0
  138. package/dist/compiler/program.d.ts +140 -0
  139. package/dist/compiler/program.js +242 -0
  140. package/dist/compiler/region/emit.d.ts +169 -0
  141. package/dist/compiler/region/emit.js +286 -0
  142. package/dist/compiler/region/identity.d.ts +28 -0
  143. package/dist/compiler/region/identity.js +75 -0
  144. package/dist/compiler/region/ir.d.ts +65 -0
  145. package/dist/compiler/region/ir.js +0 -0
  146. package/dist/compiler/region/transform.d.ts +178 -0
  147. package/dist/compiler/region/transform.js +1933 -0
  148. package/dist/compiler/script-request.d.ts +1 -0
  149. package/dist/compiler/script-request.js +43 -0
  150. package/dist/context-bridge.d.ts +65 -0
  151. package/dist/context-bridge.js +217 -0
  152. package/dist/context-registry.d.ts +40 -0
  153. package/dist/context-registry.js +15 -0
  154. package/dist/context.d.ts +72 -0
  155. package/dist/context.js +158 -0
  156. package/dist/current-region.d.ts +14 -0
  157. package/dist/current-region.js +36 -0
  158. package/dist/document.d.ts +41 -0
  159. package/dist/document.js +125 -0
  160. package/dist/entry-hydrate.d.ts +5 -0
  161. package/dist/entry-hydrate.js +42 -0
  162. package/dist/escape.d.ts +18 -0
  163. package/dist/escape.js +37 -0
  164. package/dist/events/bus.d.ts +33 -0
  165. package/dist/events/bus.js +153 -0
  166. package/dist/events/index.d.ts +4 -0
  167. package/dist/events/index.js +4 -0
  168. package/dist/events/schema.d.ts +389 -0
  169. package/dist/events/schema.js +23 -0
  170. package/dist/events/server-registry.d.ts +7 -0
  171. package/dist/events/server-registry.js +13 -0
  172. package/dist/events/sinks.d.ts +64 -0
  173. package/dist/events/sinks.js +85 -0
  174. package/dist/fn-transport.d.ts +33 -0
  175. package/dist/fn-transport.js +140 -0
  176. package/dist/frame.d.ts +20 -0
  177. package/dist/frame.js +19 -0
  178. package/dist/holes-record.d.ts +6 -0
  179. package/dist/holes-record.js +8 -0
  180. package/dist/hooks.d.ts +43 -0
  181. package/dist/hooks.js +1191 -0
  182. package/dist/hydration-info.d.ts +1 -0
  183. package/dist/hydration-info.js +31 -0
  184. package/dist/index.d.ts +21 -0
  185. package/dist/index.js +17 -0
  186. package/dist/insights/attr-rules.d.ts +15 -0
  187. package/dist/insights/attr-rules.js +27 -0
  188. package/dist/insights/cpu.d.ts +82 -0
  189. package/dist/insights/cpu.js +177 -0
  190. package/dist/insights/fp-drift.d.ts +28 -0
  191. package/dist/insights/fp-drift.js +148 -0
  192. package/dist/insights/hole-segments.d.ts +26 -0
  193. package/dist/insights/hole-segments.js +50 -0
  194. package/dist/insights/html-diff.d.ts +25 -0
  195. package/dist/insights/html-diff.js +157 -0
  196. package/dist/insights/hydration-hazards.d.ts +36 -0
  197. package/dist/insights/hydration-hazards.js +136 -0
  198. package/dist/insights/hydration-status.d.ts +2 -0
  199. package/dist/insights/hydration-status.js +0 -0
  200. package/dist/insights/index.d.ts +14 -0
  201. package/dist/insights/index.js +12 -0
  202. package/dist/insights/page-assets.d.ts +211 -0
  203. package/dist/insights/page-assets.js +608 -0
  204. package/dist/insights/page-insights.d.ts +749 -0
  205. package/dist/insights/page-insights.js +2157 -0
  206. package/dist/insights/session-data.d.ts +108 -0
  207. package/dist/insights/session-data.js +0 -0
  208. package/dist/insights/session-insights.d.ts +121 -0
  209. package/dist/insights/session-insights.js +548 -0
  210. package/dist/insights/switch.d.ts +53 -0
  211. package/dist/insights/switch.js +91 -0
  212. package/dist/insights/testing-version.d.ts +19 -0
  213. package/dist/insights/testing-version.js +21 -0
  214. package/dist/insights/third-party.d.ts +75 -0
  215. package/dist/insights/third-party.js +160 -0
  216. package/dist/internal-instruments.d.ts +13 -0
  217. package/dist/internal-instruments.js +12 -0
  218. package/dist/internal-reconcile.d.ts +3 -0
  219. package/dist/internal-reconcile.js +3 -0
  220. package/dist/internal-register.d.ts +7 -0
  221. package/dist/internal-register.js +7 -0
  222. package/dist/internal-server.d.ts +7 -0
  223. package/dist/internal-server.js +7 -0
  224. package/dist/internal.d.ts +13 -0
  225. package/dist/internal.js +13 -0
  226. package/dist/island-graph.d.ts +36 -0
  227. package/dist/island-graph.js +89 -0
  228. package/dist/keep-fallback-marker.d.ts +7 -0
  229. package/dist/keep-fallback-marker.js +9 -0
  230. package/dist/keep-fallback.d.ts +13 -0
  231. package/dist/keep-fallback.js +39 -0
  232. package/dist/kit-paths.d.ts +2 -0
  233. package/dist/kit-paths.js +39 -0
  234. package/dist/late-region-registry.d.ts +40 -0
  235. package/dist/late-region-registry.js +36 -0
  236. package/dist/live-transport.d.ts +57 -0
  237. package/dist/live-transport.js +145 -0
  238. package/dist/markup.d.ts +4 -0
  239. package/dist/markup.js +4 -0
  240. package/dist/own-package.d.ts +15 -0
  241. package/dist/own-package.js +20 -0
  242. package/dist/page-defer.d.ts +33 -0
  243. package/dist/page-defer.js +35 -0
  244. package/dist/page-facts-script.d.ts +7 -0
  245. package/dist/page-facts-script.js +9 -0
  246. package/dist/page-seed-registry.d.ts +72 -0
  247. package/dist/page-seed-registry.js +31 -0
  248. package/dist/plugin/capability.d.ts +14 -0
  249. package/dist/plugin/capability.js +44 -0
  250. package/dist/plugin/client.d.ts +39 -0
  251. package/dist/plugin/client.js +6 -0
  252. package/dist/plugin/css.d.ts +3 -0
  253. package/dist/plugin/css.js +54 -0
  254. package/dist/plugin/facts.d.ts +42 -0
  255. package/dist/plugin/facts.js +37 -0
  256. package/dist/plugin/hooks.d.ts +33 -0
  257. package/dist/plugin/hooks.js +38 -0
  258. package/dist/plugin/index.d.ts +127 -0
  259. package/dist/plugin/index.js +26 -0
  260. package/dist/plugin/routes.d.ts +32 -0
  261. package/dist/plugin/routes.js +35 -0
  262. package/dist/plugin/server.d.ts +27 -0
  263. package/dist/plugin/server.js +92 -0
  264. package/dist/plugin/standard-schema.d.ts +27 -0
  265. package/dist/plugin/standard-schema.js +0 -0
  266. package/dist/plugin/testing.d.ts +13 -0
  267. package/dist/plugin/testing.js +54 -0
  268. package/dist/plugin/utils.d.ts +13 -0
  269. package/dist/plugin/utils.js +19 -0
  270. package/dist/portable-form.d.ts +22 -0
  271. package/dist/portable-form.js +52 -0
  272. package/dist/preference.d.ts +35 -0
  273. package/dist/preference.js +84 -0
  274. package/dist/preload.d.ts +1 -0
  275. package/dist/preload.js +21 -0
  276. package/dist/ref-watch.d.ts +31 -0
  277. package/dist/ref-watch.js +66 -0
  278. package/dist/ref.d.ts +124 -0
  279. package/dist/ref.js +272 -0
  280. package/dist/region-brand.d.ts +8 -0
  281. package/dist/region-brand.js +10 -0
  282. package/dist/region-core.d.ts +2 -0
  283. package/dist/region-core.js +1 -0
  284. package/dist/region-snippet.d.ts +73 -0
  285. package/dist/region-snippet.js +351 -0
  286. package/dist/region.d.ts +127 -0
  287. package/dist/region.js +162 -0
  288. package/dist/request-event.d.ts +1 -0
  289. package/dist/request-event.js +37 -0
  290. package/dist/router-css.d.ts +39 -0
  291. package/dist/router-css.js +66 -0
  292. package/dist/runtime/app-transport.d.ts +2 -0
  293. package/dist/runtime/app-transport.js +13 -0
  294. package/dist/runtime/beacon.d.ts +271 -0
  295. package/dist/runtime/beacon.js +2190 -0
  296. package/dist/runtime/boot-link.d.ts +1 -0
  297. package/dist/runtime/boot-link.js +44 -0
  298. package/dist/runtime/client-hooks.d.ts +5 -0
  299. package/dist/runtime/client-hooks.js +22 -0
  300. package/dist/runtime/client-plugins.d.ts +8 -0
  301. package/dist/runtime/client-plugins.js +34 -0
  302. package/dist/runtime/concurrency.d.ts +12 -0
  303. package/dist/runtime/concurrency.js +29 -0
  304. package/dist/runtime/connected.d.ts +12 -0
  305. package/dist/runtime/connected.js +16 -0
  306. package/dist/runtime/context.d.ts +1 -0
  307. package/dist/runtime/context.js +19 -0
  308. package/dist/runtime/core.d.ts +15 -0
  309. package/dist/runtime/core.js +1173 -0
  310. package/dist/runtime/drift-watch.d.ts +9 -0
  311. package/dist/runtime/drift-watch.js +60 -0
  312. package/dist/runtime/entry-locations.d.ts +33 -0
  313. package/dist/runtime/entry-locations.js +119 -0
  314. package/dist/runtime/foreign-props.d.ts +8 -0
  315. package/dist/runtime/foreign-props.js +14 -0
  316. package/dist/runtime/form-continuity.d.ts +10 -0
  317. package/dist/runtime/form-continuity.js +107 -0
  318. package/dist/runtime/frame-nav.d.ts +36 -0
  319. package/dist/runtime/frame-nav.js +225 -0
  320. package/dist/runtime/frame-store.d.ts +62 -0
  321. package/dist/runtime/frame-store.js +214 -0
  322. package/dist/runtime/frames.d.ts +1 -0
  323. package/dist/runtime/frames.js +25 -0
  324. package/dist/runtime/full.d.ts +4 -0
  325. package/dist/runtime/full.js +32 -0
  326. package/dist/runtime/hash.d.ts +41 -0
  327. package/dist/runtime/hash.js +79 -0
  328. package/dist/runtime/hole-facts.d.ts +8 -0
  329. package/dist/runtime/hole-facts.js +57 -0
  330. package/dist/runtime/host-classes.d.ts +24 -0
  331. package/dist/runtime/host-classes.js +43 -0
  332. package/dist/runtime/hydrate-core.d.ts +101 -0
  333. package/dist/runtime/hydrate-core.js +605 -0
  334. package/dist/runtime/index.d.ts +2 -0
  335. package/dist/runtime/index.js +1 -0
  336. package/dist/runtime/interaction-replay.d.ts +11 -0
  337. package/dist/runtime/interaction-replay.js +70 -0
  338. package/dist/runtime/interaction.d.ts +33 -0
  339. package/dist/runtime/interaction.js +217 -0
  340. package/dist/runtime/island-graph-preload.d.ts +13 -0
  341. package/dist/runtime/island-graph-preload.js +99 -0
  342. package/dist/runtime/kit-boot.d.ts +29 -0
  343. package/dist/runtime/kit-boot.js +60 -0
  344. package/dist/runtime/kit-page-thread.svelte.d.ts +1 -0
  345. package/dist/runtime/kit-page-thread.svelte.js +116 -0
  346. package/dist/runtime/lake-anchors.d.ts +13 -0
  347. package/dist/runtime/lake-anchors.js +19 -0
  348. package/dist/runtime/lakes.d.ts +15 -0
  349. package/dist/runtime/lakes.js +212 -0
  350. package/dist/runtime/live.d.ts +3 -0
  351. package/dist/runtime/live.js +17 -0
  352. package/dist/runtime/load-scheduler.d.ts +53 -0
  353. package/dist/runtime/load-scheduler.js +317 -0
  354. package/dist/runtime/morph.d.ts +42 -0
  355. package/dist/runtime/morph.js +671 -0
  356. package/dist/runtime/nav-handle.d.ts +25 -0
  357. package/dist/runtime/nav-handle.js +71 -0
  358. package/dist/runtime/nav-hooks.d.ts +2 -0
  359. package/dist/runtime/nav-hooks.js +23 -0
  360. package/dist/runtime/nearest-attr.d.ts +4 -0
  361. package/dist/runtime/nearest-attr.js +16 -0
  362. package/dist/runtime/observe.d.ts +27 -0
  363. package/dist/runtime/observe.js +63 -0
  364. package/dist/runtime/own-cost.d.ts +9 -0
  365. package/dist/runtime/own-cost.js +35 -0
  366. package/dist/runtime/ownership.d.ts +101 -0
  367. package/dist/runtime/ownership.js +115 -0
  368. package/dist/runtime/page-cache.d.ts +23 -0
  369. package/dist/runtime/page-cache.js +74 -0
  370. package/dist/runtime/page-defer.d.ts +14 -0
  371. package/dist/runtime/page-defer.js +103 -0
  372. package/dist/runtime/parse-html.d.ts +40 -0
  373. package/dist/runtime/parse-html.js +81 -0
  374. package/dist/runtime/reconcile.d.ts +41 -0
  375. package/dist/runtime/reconcile.js +194 -0
  376. package/dist/runtime/region-attrs.d.ts +95 -0
  377. package/dist/runtime/region-attrs.js +153 -0
  378. package/dist/runtime/region-endpoint-url.d.ts +76 -0
  379. package/dist/runtime/region-endpoint-url.js +169 -0
  380. package/dist/runtime/region-ids.d.ts +8 -0
  381. package/dist/runtime/region-ids.js +33 -0
  382. package/dist/runtime/remote-seeds.d.ts +2 -0
  383. package/dist/runtime/remote-seeds.js +21 -0
  384. package/dist/runtime/render-blocking.d.ts +2 -0
  385. package/dist/runtime/render-blocking.js +30 -0
  386. package/dist/runtime/restore.d.ts +34 -0
  387. package/dist/runtime/restore.js +390 -0
  388. package/dist/runtime/router-nav.d.ts +63 -0
  389. package/dist/runtime/router-nav.js +740 -0
  390. package/dist/runtime/router.d.ts +201 -0
  391. package/dist/runtime/router.js +593 -0
  392. package/dist/runtime/schedule.d.ts +49 -0
  393. package/dist/runtime/schedule.js +256 -0
  394. package/dist/runtime/seeds.d.ts +50 -0
  395. package/dist/runtime/seeds.js +208 -0
  396. package/dist/runtime/session.d.ts +52 -0
  397. package/dist/runtime/session.js +130 -0
  398. package/dist/runtime/sidecar.d.ts +3 -0
  399. package/dist/runtime/sidecar.js +56 -0
  400. package/dist/runtime/slots.d.ts +183 -0
  401. package/dist/runtime/slots.js +44 -0
  402. package/dist/runtime/spa-cacheable.d.ts +7 -0
  403. package/dist/runtime/spa-cacheable.js +18 -0
  404. package/dist/runtime/speculate-hint.d.ts +1 -0
  405. package/dist/runtime/speculate-hint.js +35 -0
  406. package/dist/runtime/svelte-warnings.d.ts +28 -0
  407. package/dist/runtime/svelte-warnings.js +71 -0
  408. package/dist/runtime/wire-classes.d.ts +3 -0
  409. package/dist/runtime/wire-classes.js +69 -0
  410. package/dist/runtime/wire-format.d.ts +7 -0
  411. package/dist/runtime/wire-format.js +22 -0
  412. package/dist/script.d.ts +134 -0
  413. package/dist/script.js +184 -0
  414. package/dist/seed-refs.d.ts +105 -0
  415. package/dist/seed-refs.js +487 -0
  416. package/dist/server/capability-lifetime.d.ts +28 -0
  417. package/dist/server/capability-lifetime.js +31 -0
  418. package/dist/server/dead-kit-resolves.d.ts +1 -0
  419. package/dist/server/dead-kit-resolves.js +39 -0
  420. package/dist/server/document-assembly.d.ts +30 -0
  421. package/dist/server/document-assembly.js +26 -0
  422. package/dist/server/document-tail.d.ts +113 -0
  423. package/dist/server/document-tail.js +208 -0
  424. package/dist/server/endpoint.d.ts +51 -0
  425. package/dist/server/endpoint.js +90 -0
  426. package/dist/server/entry-location.d.ts +8 -0
  427. package/dist/server/entry-location.js +29 -0
  428. package/dist/server/fingerprint.d.ts +1 -0
  429. package/dist/server/fingerprint.js +25 -0
  430. package/dist/server/head-presence.d.ts +45 -0
  431. package/dist/server/head-presence.js +156 -0
  432. package/dist/server/hmac.d.ts +38 -0
  433. package/dist/server/hmac.js +89 -0
  434. package/dist/server/hole-graph.d.ts +7 -0
  435. package/dist/server/hole-graph.js +71 -0
  436. package/dist/server/hole-urls.d.ts +3 -0
  437. package/dist/server/hole-urls.js +76 -0
  438. package/dist/server/html-scan.d.ts +19 -0
  439. package/dist/server/html-scan.js +60 -0
  440. package/dist/server/kit-context.d.ts +78 -0
  441. package/dist/server/kit-context.js +110 -0
  442. package/dist/server/late-wire.d.ts +22 -0
  443. package/dist/server/late-wire.js +28 -0
  444. package/dist/server/page-facts.d.ts +25 -0
  445. package/dist/server/page-facts.js +138 -0
  446. package/dist/server/page-seed.d.ts +33 -0
  447. package/dist/server/page-seed.js +60 -0
  448. package/dist/server/page-stream.d.ts +55 -0
  449. package/dist/server/page-stream.js +121 -0
  450. package/dist/server/payload.d.ts +6 -0
  451. package/dist/server/payload.js +22 -0
  452. package/dist/server/personal-response.d.ts +6 -0
  453. package/dist/server/personal-response.js +13 -0
  454. package/dist/server/props-wire.d.ts +56 -0
  455. package/dist/server/props-wire.js +178 -0
  456. package/dist/server/rate-limit.d.ts +22 -0
  457. package/dist/server/rate-limit.js +63 -0
  458. package/dist/server/region-css.d.ts +5 -0
  459. package/dist/server/region-css.js +30 -0
  460. package/dist/server/region-endpoint.d.ts +35 -0
  461. package/dist/server/region-endpoint.js +142 -0
  462. package/dist/server/region-props.d.ts +6 -0
  463. package/dist/server/region-props.js +44 -0
  464. package/dist/server/remote-seed-gate.d.ts +50 -0
  465. package/dist/server/remote-seed-gate.js +66 -0
  466. package/dist/server/render-cache.d.ts +26 -0
  467. package/dist/server/render-cache.js +51 -0
  468. package/dist/server/render-page.d.ts +51 -0
  469. package/dist/server/render-page.js +176 -0
  470. package/dist/server/render-region-html.d.ts +2 -0
  471. package/dist/server/render-region-html.js +19 -0
  472. package/dist/server/request-stats.d.ts +174 -0
  473. package/dist/server/request-stats.js +54 -0
  474. package/dist/server/reversible.d.ts +83 -0
  475. package/dist/server/reversible.js +994 -0
  476. package/dist/server/seed-shape.d.ts +22 -0
  477. package/dist/server/seed-shape.js +24 -0
  478. package/dist/server/shared-cache.d.ts +35 -0
  479. package/dist/server/shared-cache.js +104 -0
  480. package/dist/server/signing-key.d.ts +11 -0
  481. package/dist/server/signing-key.js +47 -0
  482. package/dist/server/sized-lru.d.ts +20 -0
  483. package/dist/server/sized-lru.js +68 -0
  484. package/dist/server/split-regions.d.ts +81 -0
  485. package/dist/server/split-regions.js +368 -0
  486. package/dist/server/stream-regions.d.ts +5 -0
  487. package/dist/server/stream-regions.js +36 -0
  488. package/dist/shared-state.d.ts +7 -0
  489. package/dist/shared-state.js +152 -0
  490. package/dist/shims/app-environment.d.ts +4 -0
  491. package/dist/shims/app-environment.js +6 -0
  492. package/dist/shims/app-navigation.d.ts +33 -0
  493. package/dist/shims/app-navigation.js +119 -0
  494. package/dist/shims/app-paths.d.ts +6 -0
  495. package/dist/shims/app-paths.js +18 -0
  496. package/dist/shims/app-state.svelte.d.ts +23 -0
  497. package/dist/shims/app-state.svelte.js +50 -0
  498. package/dist/shims/app-stores.d.ts +21 -0
  499. package/dist/shims/app-stores.js +54 -0
  500. package/dist/shims/kit-bridge.d.ts +29 -0
  501. package/dist/shims/kit-bridge.js +7 -0
  502. package/dist/shims/kit-remote/client-stub.d.ts +27 -0
  503. package/dist/shims/kit-remote/client-stub.js +43 -0
  504. package/dist/shims/kit-remote/paths-internal-stub.d.ts +3 -0
  505. package/dist/shims/kit-remote/paths-internal-stub.js +5 -0
  506. package/dist/shims/kit-remote/remote-cache.d.ts +49 -0
  507. package/dist/shims/kit-remote/remote-cache.js +73 -0
  508. package/dist/shims/kit-remote/state-stub.d.ts +8 -0
  509. package/dist/shims/kit-remote/state-stub.js +8 -0
  510. package/dist/shims/page-store.svelte.d.ts +39 -0
  511. package/dist/shims/page-store.svelte.js +77 -0
  512. package/dist/source.d.ts +29 -0
  513. package/dist/source.js +87 -0
  514. package/dist/store-transport.d.ts +86 -0
  515. package/dist/store-transport.js +229 -0
  516. package/dist/tool-fetches.d.ts +5 -0
  517. package/dist/tool-fetches.js +41 -0
  518. package/dist/transport.d.ts +48 -0
  519. package/dist/transport.js +181 -0
  520. package/dist/unscoped-css.d.ts +26 -0
  521. package/dist/unscoped-css.js +53 -0
  522. package/dist/vite/dev-maps.d.ts +33 -0
  523. package/dist/vite/dev-maps.js +140 -0
  524. package/dist/vite/index.d.ts +19 -0
  525. package/dist/vite/index.js +820 -0
  526. package/dist/vite/kit-dirs.d.ts +7 -0
  527. package/dist/vite/kit-dirs.js +67 -0
  528. package/dist/vite/late-island.d.ts +25 -0
  529. package/dist/vite/late-island.js +33 -0
  530. package/dist/vite/module-map.d.ts +8 -0
  531. package/dist/vite/module-map.js +144 -0
  532. package/dist/vite/options.d.ts +208 -0
  533. package/dist/vite/options.js +74 -0
  534. package/dist/vite/package-files.d.ts +3 -0
  535. package/dist/vite/package-files.js +84 -0
  536. package/dist/vite/paths.d.ts +45 -0
  537. package/dist/vite/paths.js +112 -0
  538. package/dist/vite/plugin-api.d.ts +166 -0
  539. package/dist/vite/plugin-api.js +212 -0
  540. package/dist/vite/profiler-maps.d.ts +23 -0
  541. package/dist/vite/profiler-maps.js +178 -0
  542. package/dist/vite/server-sourcemaps.d.ts +8 -0
  543. package/dist/vite/server-sourcemaps.js +80 -0
  544. package/dist/vite/sourcemaps.d.ts +18 -0
  545. package/dist/vite/sourcemaps.js +80 -0
  546. package/dist/vite/style-preprocess.d.ts +2 -0
  547. package/dist/vite/style-preprocess.js +96 -0
  548. package/package.json +180 -6
@@ -0,0 +1,40 @@
1
+ /**
2
+ * LATE-REGION capture — the registry front for streamed `<Region of={promise}>` holes. Same shape
3
+ * as the page-seed / setContext recorders: the SERVER installs a request-scoped recorder (ALS-backed
4
+ * in `hooks.ts`), Region.svelte calls the plain function during SSR, and on the client (or with no
5
+ * recorder armed) it is a no-op returning `null` — the region keeps today's placeholder behavior.
6
+ *
7
+ * When armed, registering a promise returns the SLOT ID the region wraps its placeholder in
8
+ * (`<og-late-slot data-og-slot=…>`); the router's streamed-document path later drains the request's
9
+ * registered promises in completion order, baking each resolved region into a late template chunk
10
+ * down the same response. That is "streamed load data" in ogygia's model: a load hands a promise to
11
+ * a region, and the region resolves over the initial connection — no client refetch, no second
12
+ * round trip, islands inside waking on adoption.
13
+ */
14
+ type LateRecorder = (promise: Promise<unknown>) => string | null;
15
+ type ScopeOpener = () => void;
16
+ /** Server (`hooks.ts`) installs the request-scoped scope opener. */
17
+ export declare function set_late_scope_opener(fn: ScopeOpener | null): void;
18
+ /**
19
+ * ONLY A RENDERER THAT DELIVERS LATE CHUNKS ARMS THEM. The server router's streamed document opens
20
+ * this request's late scope before it renders (and drains it after); anywhere else — a Kit page render
21
+ * — a promise `of` registers nothing, because nothing would ever fill its slot (a Kit page's header
22
+ * sat in an empty slot forever).
23
+ */
24
+ export declare function open_late_scope(): void;
25
+ /** Server (`hooks.ts`) installs the request-scoped recorder. */
26
+ export declare function set_late_recorder(fn: LateRecorder | null): void;
27
+ /** Region.svelte calls this with a promise `of` during SSR. `null` = not armed → no streaming. */
28
+ export declare function register_late_region(promise: Promise<unknown>): string | null;
29
+ export interface LateRegion {
30
+ id: string;
31
+ promise: Promise<unknown>;
32
+ }
33
+ type LateTaker = () => LateRegion[] | null;
34
+ /** Server (`hooks.ts`) installs the request-scoped drain alongside the recorder. */
35
+ export declare function set_late_taker(fn: LateTaker | null): void;
36
+ /** The router drains THIS request's registered late regions after the document render (through
37
+ * this seam, never by importing hooks — its `virtual:` imports don't resolve outside Vite).
38
+ * `null` when nothing registered / nothing armed. Draining clears the request's list. */
39
+ export declare function take_late_regions(): LateRegion[] | null;
40
+ export {};
@@ -0,0 +1,36 @@
1
+ // src/late-region-registry.ts
2
+ let opener = null;
3
+ /** Server (`hooks.ts`) installs the request-scoped scope opener. */
4
+ function set_late_scope_opener(fn) {
5
+ opener = fn;
6
+ }
7
+ /**
8
+ * ONLY A RENDERER THAT DELIVERS LATE CHUNKS ARMS THEM. The server router's streamed document opens
9
+ * this request's late scope before it renders (and drains it after); anywhere else — a Kit page render
10
+ * — a promise `of` registers nothing, because nothing would ever fill its slot (a Kit page's header
11
+ * sat in an empty slot forever).
12
+ */
13
+ function open_late_scope() {
14
+ opener?.();
15
+ }
16
+ let recorder = null;
17
+ /** Server (`hooks.ts`) installs the request-scoped recorder. */
18
+ function set_late_recorder(fn) {
19
+ recorder = fn;
20
+ }
21
+ /** Region.svelte calls this with a promise `of` during SSR. `null` = not armed → no streaming. */
22
+ function register_late_region(promise) {
23
+ return recorder ? recorder(promise) : null;
24
+ }
25
+ let taker = null;
26
+ /** Server (`hooks.ts`) installs the request-scoped drain alongside the recorder. */
27
+ function set_late_taker(fn) {
28
+ taker = fn;
29
+ }
30
+ /** The router drains THIS request's registered late regions after the document render (through
31
+ * this seam, never by importing hooks — its `virtual:` imports don't resolve outside Vite).
32
+ * `null` when nothing registered / nothing armed. Draining clears the request's list. */
33
+ function take_late_regions() {
34
+ return taker ? taker() : null;
35
+ }
36
+ export { open_late_scope, register_late_region, set_late_recorder, set_late_scope_opener, set_late_taker, take_late_regions };
@@ -0,0 +1,57 @@
1
+ /** Feature entry: register every props-seam kind, then fill the `wire` slot so core resolves
2
+ * ANY transportable kind from `data-ogygia-props` through the one hub key. */
3
+ export declare function install(): void;
4
+ /** Reserved key for the static codec — what `import.meta.og.wire` rewrites to. `Symbol.for` so it's
5
+ * identical across every bundle. Internal: the public opt-in is the construct, not this symbol. */
6
+ export declare const wire: unique symbol;
7
+ /** The codec `import.meta.og.wire({ … })` carries (or a static method returning it). */
8
+ export interface TransportCodec<T = unknown, D = unknown> {
9
+ /** Sending side: turn the live instance into devalue-safe data. */
10
+ encode: (value: T) => D;
11
+ /** Receiving side: rebuild a live instance from that data. */
12
+ decode: (data: D) => T;
13
+ /**
14
+ * CONTINUITY — a stable session name. Naming the codec promotes the instance from page
15
+ * lifetime to SESSION lifetime: it becomes a singleton in this browser tab, and a navigation
16
+ * reunites the next page's decode with the SAME live instance instead of rebuilding it. Tab-
17
+ * scoped only — the server stays per-request (never remembers), a reload starts fresh.
18
+ */
19
+ id?: string;
20
+ /**
21
+ * Reconcile a navigation: the tab already holds the live named instance and the new page's
22
+ * server snapshot just arrived (decoded as `fresh`). Apply whatever should carry over INTO
23
+ * `live` — its identity is preserved; `fresh` is discarded afterwards. Default: do nothing
24
+ * (live wins — continuity is the point; a cart mid-edit beats a server re-read). Override to
25
+ * pull server truth in (prices, stock, auth state).
26
+ */
27
+ merge?: (live: T, fresh: T) => void;
28
+ }
29
+ /** Devalue custom-type name used for transportable payloads on the wire. */
30
+ export declare const TRANSPORT_WIRE_KEY = "OgygiaT";
31
+ /** Legacy wire shape (`t` tag, `i` id, `d` data) — a hub Ref minus its kind discriminator. */
32
+ interface TransportPayload {
33
+ t: string;
34
+ i: string;
35
+ d: unknown;
36
+ }
37
+ /**
38
+ * Register a class under a stable build-derived tag (root-relative module path + export
39
+ * name). Called by generated code appended to every exported class in app source; a class
40
+ * without a `[wire]` codec is silently skipped, so over-registration is harmless.
41
+ */
42
+ export declare function __register_transportable(tag: string, cls: unknown): void;
43
+ /** The hub kind: `[og.wire]` class instances. Identity/reunify/Keep live in the hub. */
44
+ export declare function register_wire_kind(): void;
45
+ /**
46
+ * Devalue reducer: encode a transportable instance, or return undefined to fall through to
47
+ * devalue's normal handling. Same instance → same wire id (hub-memoized), which is what lets
48
+ * the client reunite every copy of the prop into one live object.
49
+ */
50
+ export declare function reduce_transportable(value: unknown): TransportPayload | undefined;
51
+ /**
52
+ * Devalue reviver: rebuild a live instance from the wire payload via the hub.
53
+ * `remember: true` (browser) memoizes by wire id + honors the session Keep; `remember: false`
54
+ * (server, defer/streaming renders) always decodes fresh — per-request isolation.
55
+ */
56
+ export declare function revive_transportable(payload: TransportPayload, remember: boolean): unknown;
57
+ export {};
@@ -0,0 +1,145 @@
1
+ import { slots } from "./runtime/slots.js";
2
+ import { register_snippet_kind } from "./region-snippet.js";
3
+ import { register_derived_kind, register_store_kind } from "./store-transport.js";
4
+ import { register_fn_kind } from "./fn-transport.js";
5
+ import { REF_WIRE_KEY, mint, register_kind, resolve } from "./ref.js";
6
+ // src/live-transport.ts
7
+ /**
8
+ * Transportable objects — `static [import.meta.og.wire]` codecs, as the hub's WIRE kind.
9
+ *
10
+ * A class instance normally cannot cross an island boundary (devalue rejects it). A class
11
+ * opts in by declaring how it travels:
12
+ *
13
+ * ```ts
14
+ * export class Cart {
15
+ * items = $state<Item[]>([]);
16
+ * add(item: Item) { this.items.push(item); }
17
+ *
18
+ * static wire = import.meta.og.wire({
19
+ * encode: (c: Cart) => $state.snapshot(c.items),
20
+ * decode: (items: Item[]) => Object.assign(new Cart(), { items })
21
+ * });
22
+ * }
23
+ * ```
24
+ *
25
+ * `import.meta.og.wire()` is a COMPILE construct — the plugin consumes the member and mints the
26
+ * key: `static [Symbol.for('ogygia.wire')] = <codec>`. No import, no value to pass around, and
27
+ * STRICT: that member shape is the only legal position (build error anywhere else). ONE contract,
28
+ * always explicit — `{ encode, decode }`, plus optional `id`/`merge` for session continuity.
29
+ *
30
+ * IDENTITY IS THE HUB'S (see ref.ts): mint memoizes one id per instance; the browser resolves
31
+ * by id so five islands share one live object; `codec.id` names the ref into the session Keep
32
+ * (a navigation reunites with the SAME instance, `codec.merge` reconciling fresh server data);
33
+ * the server never remembers. This module owns only what is wire-SPECIFIC: the class registry
34
+ * (build tag → class) and the codec protocol.
35
+ */
36
+ /** Feature entry: register every props-seam kind, then fill the `wire` slot so core resolves
37
+ * ANY transportable kind from `data-ogygia-props` through the one hub key. */
38
+ function install() {
39
+ register_wire_kind();
40
+ register_snippet_kind();
41
+ register_store_kind();
42
+ register_fn_kind();
43
+ register_derived_kind();
44
+ slots.wire = {
45
+ REF_WIRE_KEY,
46
+ resolve: (ref, remember) => resolve(ref, remember)
47
+ };
48
+ }
49
+ /** Reserved key for the static codec — what `import.meta.og.wire` rewrites to. `Symbol.for` so it's
50
+ * identical across every bundle. Internal: the public opt-in is the construct, not this symbol. */
51
+ const wire = Symbol.for("ogygia.wire");
52
+ const REGISTRY_KEY = Symbol.for("ogygia.transportables");
53
+ function wire_registry() {
54
+ const g = globalThis;
55
+ return g[REGISTRY_KEY] ??= {
56
+ classes: /* @__PURE__ */ new Map(),
57
+ tags: /* @__PURE__ */ new WeakMap()
58
+ };
59
+ }
60
+ /** Devalue custom-type name used for transportable payloads on the wire. */
61
+ const TRANSPORT_WIRE_KEY = "OgygiaT";
62
+ /**
63
+ * Register a class under a stable build-derived tag (root-relative module path + export
64
+ * name). Called by generated code appended to every exported class in app source; a class
65
+ * without a `[wire]` codec is silently skipped, so over-registration is harmless.
66
+ */
67
+ function __register_transportable(tag, cls) {
68
+ if (typeof cls !== "function") return;
69
+ const candidate = cls;
70
+ if (!candidate[wire]) return;
71
+ const reg = wire_registry();
72
+ reg.classes.set(tag, candidate);
73
+ reg.tags.set(cls, tag);
74
+ }
75
+ function codec_of(cls) {
76
+ const raw = cls[wire];
77
+ return typeof raw === "function" ? raw.call(cls) : raw;
78
+ }
79
+ function class_for(tag) {
80
+ const cls = tag === void 0 ? void 0 : wire_registry().classes.get(tag);
81
+ if (cls === void 0) throw new Error(`[ogygia] cannot revive transportable "${tag}": its class is not loaded on this side. The island must import the class as a VALUE (not \`import type\`) so its codec travels with the island's bundle.`);
82
+ return cls;
83
+ }
84
+ /** The hub kind: `[og.wire]` class instances. Identity/reunify/Keep live in the hub. */
85
+ function register_wire_kind() {
86
+ register_kind({
87
+ k: "wire",
88
+ match(value) {
89
+ const cls = value.constructor;
90
+ return typeof cls === "function" && !!cls[wire];
91
+ },
92
+ encode(value) {
93
+ const cls = value.constructor;
94
+ const tag = wire_registry().tags.get(cls);
95
+ if (tag === void 0) throw new Error(`[ogygia] class "${cls.name ?? "?"}" has a [import.meta.og.wire] codec but was never registered. Transportable classes must be declared in a module the ogygia vite plugin transforms (an \`export class\` in your app source, not node_modules or a dynamic eval).`);
96
+ return {
97
+ t: tag,
98
+ d: codec_of(cls).encode(value)
99
+ };
100
+ },
101
+ decode(ref) {
102
+ return codec_of(class_for(ref.t)).decode(ref.d);
103
+ },
104
+ keep_name(ref) {
105
+ const codec = codec_of(class_for(ref.t));
106
+ return typeof codec.id === "string" ? codec.id : void 0;
107
+ },
108
+ merge(kept, ref) {
109
+ const codec = codec_of(class_for(ref.t));
110
+ if (typeof codec.merge === "function") codec.merge(kept, codec.decode(ref.d));
111
+ }
112
+ });
113
+ }
114
+ const WIRE_ONLY = /* @__PURE__ */ new Set(["wire"]);
115
+ /**
116
+ * Devalue reducer: encode a transportable instance, or return undefined to fall through to
117
+ * devalue's normal handling. Same instance → same wire id (hub-memoized), which is what lets
118
+ * the client reunite every copy of the prop into one live object.
119
+ */
120
+ function reduce_transportable(value) {
121
+ register_wire_kind();
122
+ const ref = mint(value, WIRE_ONLY);
123
+ if (ref === void 0) return void 0;
124
+ return {
125
+ t: ref.t,
126
+ i: ref.i,
127
+ d: ref.d
128
+ };
129
+ }
130
+ /**
131
+ * Devalue reviver: rebuild a live instance from the wire payload via the hub.
132
+ * `remember: true` (browser) memoizes by wire id + honors the session Keep; `remember: false`
133
+ * (server, defer/streaming renders) always decodes fresh — per-request isolation.
134
+ */
135
+ function revive_transportable(payload, remember) {
136
+ register_wire_kind();
137
+ const ref = {
138
+ k: "wire",
139
+ i: payload.i,
140
+ t: payload.t,
141
+ d: payload.d
142
+ };
143
+ return resolve(ref, remember);
144
+ }
145
+ export { TRANSPORT_WIRE_KEY, __register_transportable, install, reduce_transportable, register_wire_kind, revive_transportable, wire };
@@ -0,0 +1,4 @@
1
+ import { LiftResult, LiftedRegion, RegionKind, RegionSpan, liftRegions, restoreRegions, scanRegions } from "./server/split-regions.js";
2
+ import { Settled, TransformKind, check_script, localizeMarks, transformMarkup } from "./server/reversible.js";
3
+ import { restore } from "./runtime/restore.js";
4
+ export { type LiftResult, type LiftedRegion, type RegionKind, type RegionSpan, type Settled, type TransformKind, check_script as checkScript, liftRegions, localizeMarks, restore, restoreRegions, scanRegions, transformMarkup };
package/dist/markup.js ADDED
@@ -0,0 +1,4 @@
1
+ import { liftRegions, restoreRegions, scanRegions } from "./server/split-regions.js";
2
+ import { check_script, localizeMarks, transformMarkup } from "./server/reversible.js";
3
+ import { restore } from "./runtime/restore.js";
4
+ export { check_script as checkScript, liftRegions, localizeMarks, restore, restoreRegions, scanRegions, transformMarkup };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Core's own identity. Core is reached by two package names: `ogygia`, the package apps install (a
3
+ * thin layer that re-exports core subpath for subpath), and `@ogygia/core`, what plugins import.
4
+ * Every "is this ogygia itself" check asks here instead of comparing one literal name.
5
+ */
6
+ /** The package names core answers to. */
7
+ export declare const OWN_PACKAGE_NAMES: readonly string[];
8
+ /** A bare specifier that names core, by either name, or one of its subpaths. */
9
+ export declare function is_own_specifier(spec: string): boolean;
10
+ /** Core's names as a regex alternation, for import-clause scanners (`from 'ogygia'`). */
11
+ export declare const OWN_SPECIFIER_SOURCE = "(?:ogygia|@ogygia/core)";
12
+ /** A file inside core or the `ogygia` package, source or build: `…/node_modules/ogygia/dist/…`,
13
+ * `…/node_modules/@ogygia/core/dist/…`, and a checkout's `packages/ogygia/src/…` and
14
+ * `packages/core/src/…`. Either separator. */
15
+ export declare const OWN_FILE_RE: RegExp;
@@ -0,0 +1,20 @@
1
+ // src/own-package.ts
2
+ /**
3
+ * Core's own identity. Core is reached by two package names: `ogygia`, the package apps install (a
4
+ * thin layer that re-exports core subpath for subpath), and `@ogygia/core`, what plugins import.
5
+ * Every "is this ogygia itself" check asks here instead of comparing one literal name.
6
+ */
7
+ /** The package names core answers to. */
8
+ const OWN_PACKAGE_NAMES = ["ogygia", "@ogygia/core"];
9
+ /** A bare specifier that names core, by either name, or one of its subpaths. */
10
+ function is_own_specifier(spec) {
11
+ for (const name of OWN_PACKAGE_NAMES) if (spec === name || spec.startsWith(name + "/")) return true;
12
+ return false;
13
+ }
14
+ /** Core's names as a regex alternation, for import-clause scanners (`from 'ogygia'`). */
15
+ const OWN_SPECIFIER_SOURCE = "(?:ogygia|@ogygia/core)";
16
+ /** A file inside core or the `ogygia` package, source or build: `…/node_modules/ogygia/dist/…`,
17
+ * `…/node_modules/@ogygia/core/dist/…`, and a checkout's `packages/ogygia/src/…` and
18
+ * `packages/core/src/…`. Either separator. */
19
+ const OWN_FILE_RE = /[\\/](?:ogygia|@ogygia[\\/]core|packages[\\/]core)[\\/](?:src|dist)[\\/]/;
20
+ export { OWN_FILE_RE, OWN_PACKAGE_NAMES, OWN_SPECIFIER_SOURCE, is_own_specifier };
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Shared constants for streaming a load `Promise` in `$page.data` into an island on a csr=false page.
3
+ *
4
+ * Kit lets `load` return a Promise at any level of `data` and STREAMS its resolution to the client
5
+ * (render the shell with `{#await}` pending, then flush `<script>` chunks that settle it). A csr=false
6
+ * page has no hydration, so Kit's own stream is dead there — but an ISLAND has a client. We mirror
7
+ * Kit's shape with our OWN registry: the page seed carries a DEFER MARKER for each pending promise
8
+ * (a real pending Promise on the client), and streamed resolve `<script>`s settle them live.
9
+ *
10
+ * Constants only — safe to import from both the server (staging/serialization) and the client
11
+ * (registry/reviver), with no code crossing the boundary.
12
+ */
13
+ /** devalue reducer/reviver name for a deferred-promise leaf in the page seed. The encoded payload is
14
+ * the promise's integer id (assigned in walk order). */
15
+ export declare const PAGE_DEFER_KEY = "OgygiaDefer";
16
+ /** devalue reducer/reviver name for an already-SETTLED promise leaf — used on the non-navigate
17
+ * (SPA/router) path, which can't run streamed scripts, so each promise is awaited server-side and
18
+ * revived as a resolved/rejected Promise at parse time. Keeps `page.data.x` a Promise on BOTH paths
19
+ * (matches Kit) and lets a rejection show `{#await …:catch}` without ever crashing the render. */
20
+ export declare const PAGE_SETTLED_KEY = "OgygiaSettled";
21
+ /** Global the streamed resolve `<script>`s call: `__ogygia_page_resolve(id, ok, encoded)` where
22
+ * `encoded` is the devalue-stringified resolved value (or the error). Installed by an inline
23
+ * bootstrap in the first body chunk so it exists BEFORE any resolve script runs. */
24
+ export declare const PAGE_DEFER_GLOBAL = "__ogygia_page_resolve";
25
+ /** One registry per document, shared by the inline bootstrap and the runtime reviver via globalThis
26
+ * (dev serves the runtime twice; a Symbol.for handle stays one instance — PAGE-STATE-SINGLETON). */
27
+ export declare const PAGE_DEFER_REGISTRY_KEY: unique symbol;
28
+ /** Inline bootstrap the handle emits in the body (before the resolve scripts, which stream after
29
+ * `</body>`): defines the resolve global, queuing calls into the shared registry until the runtime
30
+ * installs the live parser. Each call stamps when it arrived (`t[id]`, ms from the navigation): the
31
+ * devtools Page tab names the streamed `page.data` key that held the document open. Emitted as a classic `<script>` so it runs during parse, before any
32
+ * streamed resolve script. Kept in sync with the runtime's `install_page_defer` registry shape. */
33
+ export declare const PAGE_DEFER_BOOTSTRAP: string;
@@ -0,0 +1,35 @@
1
+ // src/page-defer.ts
2
+ /**
3
+ * Shared constants for streaming a load `Promise` in `$page.data` into an island on a csr=false page.
4
+ *
5
+ * Kit lets `load` return a Promise at any level of `data` and STREAMS its resolution to the client
6
+ * (render the shell with `{#await}` pending, then flush `<script>` chunks that settle it). A csr=false
7
+ * page has no hydration, so Kit's own stream is dead there — but an ISLAND has a client. We mirror
8
+ * Kit's shape with our OWN registry: the page seed carries a DEFER MARKER for each pending promise
9
+ * (a real pending Promise on the client), and streamed resolve `<script>`s settle them live.
10
+ *
11
+ * Constants only — safe to import from both the server (staging/serialization) and the client
12
+ * (registry/reviver), with no code crossing the boundary.
13
+ */
14
+ /** devalue reducer/reviver name for a deferred-promise leaf in the page seed. The encoded payload is
15
+ * the promise's integer id (assigned in walk order). */
16
+ const PAGE_DEFER_KEY = "OgygiaDefer";
17
+ /** devalue reducer/reviver name for an already-SETTLED promise leaf — used on the non-navigate
18
+ * (SPA/router) path, which can't run streamed scripts, so each promise is awaited server-side and
19
+ * revived as a resolved/rejected Promise at parse time. Keeps `page.data.x` a Promise on BOTH paths
20
+ * (matches Kit) and lets a rejection show `{#await …:catch}` without ever crashing the render. */
21
+ const PAGE_SETTLED_KEY = "OgygiaSettled";
22
+ /** Global the streamed resolve `<script>`s call: `__ogygia_page_resolve(id, ok, encoded)` where
23
+ * `encoded` is the devalue-stringified resolved value (or the error). Installed by an inline
24
+ * bootstrap in the first body chunk so it exists BEFORE any resolve script runs. */
25
+ const PAGE_DEFER_GLOBAL = "__ogygia_page_resolve";
26
+ /** One registry per document, shared by the inline bootstrap and the runtime reviver via globalThis
27
+ * (dev serves the runtime twice; a Symbol.for handle stays one instance — PAGE-STATE-SINGLETON). */
28
+ const PAGE_DEFER_REGISTRY_KEY = Symbol.for("ogygia.page-defer");
29
+ /** Inline bootstrap the handle emits in the body (before the resolve scripts, which stream after
30
+ * `</body>`): defines the resolve global, queuing calls into the shared registry until the runtime
31
+ * installs the live parser. Each call stamps when it arrived (`t[id]`, ms from the navigation): the
32
+ * devtools Page tab names the streamed `page.data` key that held the document open. Emitted as a classic `<script>` so it runs during parse, before any
33
+ * streamed resolve script. Kept in sync with the runtime's `install_page_defer` registry shape. */
34
+ const PAGE_DEFER_BOOTSTRAP = `(function(){var K=Symbol.for('ogygia.page-defer'),r=globalThis[K]||(globalThis[K]={});r.q=r.q||[];globalThis.${PAGE_DEFER_GLOBAL}=function(i,o,e){(r.t||(r.t={}))[i]=performance.now();if(r.live)r.live(i,o,e);else r.q.push([i,o,e]);};})();`;
35
+ export { PAGE_DEFER_BOOTSTRAP, PAGE_DEFER_GLOBAL, PAGE_DEFER_KEY, PAGE_DEFER_REGISTRY_KEY, PAGE_SETTLED_KEY };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The script an answer carries with the page facts it rendered with (server/render-page.ts writes it,
3
+ * the runtime's answer seam `region_fragment` takes it out, seeds.ts merges it). Isomorphic: both
4
+ * halves name it from here.
5
+ */
6
+ export declare const PAGE_FACTS_SCRIPT_TYPE = "application/ogygia-page-facts";
7
+ export declare const PAGE_FACTS_SELECTOR: `script[type="${typeof PAGE_FACTS_SCRIPT_TYPE}"]`;
@@ -0,0 +1,9 @@
1
+ // src/page-facts-script.ts
2
+ /**
3
+ * The script an answer carries with the page facts it rendered with (server/render-page.ts writes it,
4
+ * the runtime's answer seam `region_fragment` takes it out, seeds.ts merges it). Isomorphic: both
5
+ * halves name it from here.
6
+ */
7
+ const PAGE_FACTS_SCRIPT_TYPE = "application/ogygia-page-facts";
8
+ const PAGE_FACTS_SELECTOR = `script[type="${PAGE_FACTS_SCRIPT_TYPE}"]`;
9
+ export { PAGE_FACTS_SCRIPT_TYPE, PAGE_FACTS_SELECTOR };
@@ -0,0 +1,72 @@
1
+ import { SeedAsk as SeedAsk$1, SeedKeys } from "./server/seed-shape.js";
2
+ /**
3
+ * Server-side capture for the page snapshot ($page.data / form / error / status) islands read through
4
+ * the `$app/state` shim. The handle CANNOT read the resolved load data: Kit merges it locally in
5
+ * `render.js` (`data = { ...data, ...branch[i].data }`) and never stores it on `RequestState`, and
6
+ * reading `$app/state`'s `page` inside a handle hook throws `lifecycle_outside_component`. So a
7
+ * COMPONENT rendered during SSR (Region.svelte) — where Kit's REAL `$app/state` page is available —
8
+ * records it HERE, and the handle merges it into the `application/ogygia-page` seed. That's how
9
+ * `$page.data` works inside islands on a csr=false page (boundary law: page.data crosses).
10
+ *
11
+ * Same shape as the setContext recorder: the server installs the recorder (request-scoped in
12
+ * `hooks.ts`), so it is universal-safe — on the client `record_page` is a no-op (no recorder
13
+ * installed).
14
+ */
15
+ export type PageSnapshot = {
16
+ data?: unknown;
17
+ form?: unknown;
18
+ error?: unknown;
19
+ status?: number;
20
+ /** Set by the routeless document root (the router's seed) so nested island renders under the
21
+ * server router see the page's real url/params/route, not the request's bare event. */
22
+ url?: {
23
+ href?: string;
24
+ };
25
+ params?: Record<string, string | undefined>;
26
+ route?: {
27
+ id: string | null;
28
+ };
29
+ };
30
+ /**
31
+ * `seed` — does this record WANT the client seed shipped? Region.svelte passes the build's answer
32
+ * for its island (`islandReadsPage`); the snapshot itself is always recorded (the handle also
33
+ * reads it for the postrender verdict — a load with a streaming promise is per-request by intent — and
34
+ * for server-side page reads), only the serialized seed is gated on it. Whether the seed ships is
35
+ * read ONCE, by the handle, when the document tail renders — no region asks during the render.
36
+ *
37
+ * `remotes` — the same question for the REMOTE seed (`application/ogygia-remote`): which remote
38
+ * modules (Kit id-hashes) this region's client code can call (`islandRemotes`, the build's chunk-
39
+ * closure answer). `[]` = none (a lake, a static hole, the routeless document root); `null` =
40
+ * fail-open, "may call anything" (a promise `of` whose module SSR cannot see, an entry the handoff
41
+ * does not know, dev). The handle unions every record and seeds only the remotes some region can
42
+ * reach — REMOTE SEED ONLY WHEN REACHABLE.
43
+ */
44
+ /**
45
+ * `seed` is now an ASK, not a flag (SEED SHAPING): `false` — this region's client never reads the
46
+ * page (record the snapshot, ship nothing for it); `'all'` — it reads the page and the build could
47
+ * not pin its `page.data` reads to literal keys (or does not know the entry: a promise `of`, a
48
+ * foreign fragment, dev); a `string[]` — exactly these top-level `page.data` keys. The handle
49
+ * unions the asks: any `'all'` ships the whole `page.data`, otherwise the union of keys.
50
+ */
51
+ export type SeedAsk = SeedAsk$1;
52
+ type Recorder = (snapshot: PageSnapshot, seed: SeedAsk, remotes: readonly string[] | null, entry: string) => void;
53
+ /** Server (`hooks.ts`) installs a request-scoped recorder. */
54
+ export declare function set_page_recorder(fn: Recorder | null): void;
55
+ /** What the page's regions asked for so far this request: whether any wants the seed, and which
56
+ * `page.data` keys (`'all'` or a set; `null` until one asks). Undefined outside a request the
57
+ * handle owns (no reader installed, or no bag). The server router's document reads it after its
58
+ * render, so a router page seeds like a Kit page: only when an island reads it, only what is read. */
59
+ type AskReader = () => {
60
+ wanted: boolean;
61
+ keys: SeedKeys | null;
62
+ } | undefined;
63
+ /** Server (`hooks.ts`) installs the reader beside the recorder. */
64
+ export declare function set_seed_ask_reader(fn: AskReader | null): void;
65
+ export declare function read_seed_ask(): ReturnType<AskReader>;
66
+ export declare function set_ask_scope_opener(fn: (() => void) | null): void;
67
+ export declare function open_ask_scope(): void;
68
+ /** Region.svelte calls this during SSR with Kit's real page; the client is a no-op. `seed: false`
69
+ * records the snapshot without asking for the client seed (no island on the page reads it);
70
+ * `remotes` names the remote modules this region's client can call (`null` = any). */
71
+ export declare function record_page(snapshot: PageSnapshot, seed?: SeedAsk, remotes?: readonly string[] | null, entry?: string): void;
72
+ export {};
@@ -0,0 +1,31 @@
1
+ // src/page-seed-registry.ts
2
+ let recorder = null;
3
+ /** Server (`hooks.ts`) installs a request-scoped recorder. */
4
+ function set_page_recorder(fn) {
5
+ recorder = fn;
6
+ }
7
+ let ask_reader = null;
8
+ /** Server (`hooks.ts`) installs the reader beside the recorder. */
9
+ function set_seed_ask_reader(fn) {
10
+ ask_reader = fn;
11
+ }
12
+ function read_seed_ask() {
13
+ return ask_reader?.();
14
+ }
15
+ /** Start collecting the regions' asks for a render outside a Kit page (the server router's document,
16
+ * answered before a Kit page bag exists): the next `record_page` calls of this request count, and
17
+ * `read_seed_ask` returns them. A no-op on the client or outside a request. */
18
+ let ask_opener = null;
19
+ function set_ask_scope_opener(fn) {
20
+ ask_opener = fn;
21
+ }
22
+ function open_ask_scope() {
23
+ ask_opener?.();
24
+ }
25
+ /** Region.svelte calls this during SSR with Kit's real page; the client is a no-op. `seed: false`
26
+ * records the snapshot without asking for the client seed (no island on the page reads it);
27
+ * `remotes` names the remote modules this region's client can call (`null` = any). */
28
+ function record_page(snapshot, seed = "all", remotes = null, entry = "") {
29
+ recorder?.(snapshot, seed, remotes, entry);
30
+ }
31
+ export { open_ask_scope, read_seed_ask, record_page, set_ask_scope_opener, set_page_recorder, set_seed_ask_reader };
@@ -0,0 +1,14 @@
1
+ import { PluginCapabilities } from "./index.js";
2
+ import { CapabilityLifetime } from "../server/capability-lifetime.js";
3
+ /** Why a plugin capability is refused (the region endpoint's reasons of the same name). */
4
+ export type CapabilityDeny = "expired" | "renew-window" | "sig";
5
+ /** What the handle hands in: the app's key, its hole lifetime, and the refusal a region request
6
+ * gets. (Handed in, never imported: this module stays free of the app's virtual modules, so the
7
+ * plugin test harness runs it as it is.) */
8
+ export interface CapabilitySigner {
9
+ sign(message: string): string;
10
+ verify(message: string, signature: string): boolean;
11
+ lifetime: CapabilityLifetime;
12
+ deny(why: CapabilityDeny): Response;
13
+ }
14
+ export declare function plugin_capabilities(name: string, signer: CapabilitySigner): PluginCapabilities;
@@ -0,0 +1,44 @@
1
+ import { expiry_refusal } from "../server/shared-cache.js";
2
+ // src/plugin/capability.ts
3
+ function plugin_capabilities(name, signer) {
4
+ const scoped = (message) => `cap.${name}.${message}`;
5
+ const { lifetime } = signer;
6
+ return {
7
+ mint(message) {
8
+ const exp = String(lifetime.mint_expiry(""));
9
+ return {
10
+ exp,
11
+ sig: signer.sign(scoped(message(exp)))
12
+ };
13
+ },
14
+ open(url, message) {
15
+ const params = url.searchParams;
16
+ const exp = params.get("exp") ?? "";
17
+ const renewal = params.get("renew") === "1";
18
+ const now = Math.floor(Date.now() / 1e3);
19
+ const refused = expiry_refusal(exp, now, renewal, lifetime.renew_window);
20
+ if (refused) return {
21
+ ok: false,
22
+ response: signer.deny(refused)
23
+ };
24
+ if (!signer.verify(scoped(message(exp)), params.get("sig") ?? "")) return {
25
+ ok: false,
26
+ response: signer.deny("sig")
27
+ };
28
+ if (!renewal) return {
29
+ ok: true,
30
+ headers: {}
31
+ };
32
+ const fresh = String(lifetime.renewed_expiry());
33
+ const next = new URLSearchParams(params);
34
+ next.delete("renew");
35
+ next.set("exp", fresh);
36
+ next.set("sig", signer.sign(scoped(message(fresh))));
37
+ return {
38
+ ok: true,
39
+ headers: { "x-ogygia-capability": `${url.pathname}?${next}` }
40
+ };
41
+ }
42
+ };
43
+ }
44
+ export { plugin_capabilities };
@@ -0,0 +1,39 @@
1
+ /**
2
+ * `ogygia/plugin/client` — the BROWSER realm of a plugin (design: internal/notes/packages.md, plugin
3
+ * API v2). A plugin package exports `./client`; its default export is `defineClient({ … })`. The
4
+ * build finds it by the plugin's name and imports it statically into the runtime's boot entry, so it
5
+ * ships to every page the runtime boots on. Keep it small: it is in the boot's static graph — load
6
+ * anything heavy with a dynamic import of its own, on demand.
7
+ *
8
+ * export default defineClient({
9
+ * boot({ kitPage }) { … }, // once, as the runtime boots (before any region wakes)
10
+ * regionMount(el, { entry, urls }) { … }, // a region's component started in the browser
11
+ * regionUnmount(el, { entry }) { … } // …and left the page
12
+ * });
13
+ *
14
+ * With no plugin's client realm in the build, core's calls into these fold away entirely.
15
+ */
16
+ /** What `boot` is told about the page. */
17
+ export interface ClientBootContext {
18
+ /** A page Kit hydrates (csr = true): ogygia's runtime does not boot there and no region hook
19
+ * fires; the realm boots on its own (dev only). */
20
+ readonly kitPage: boolean;
21
+ }
22
+ /** A region whose component runs in the browser, as the region hooks see it. */
23
+ export interface ClientRegion {
24
+ /** The region's entry (its component's stable module URL). */
25
+ readonly entry: string;
26
+ }
27
+ /** A plugin's browser half. */
28
+ export interface ClientPlugin {
29
+ /** Once, as the runtime boots: after core's features, before the first region wakes. */
30
+ boot?(ctx: ClientBootContext): void;
31
+ /** A region's component started (hydrated, or mounted live). `urls`: the files it runs from. */
32
+ regionMount?(el: Element, region: ClientRegion & {
33
+ readonly urls: readonly string[];
34
+ }): void;
35
+ /** A region's component left the page. */
36
+ regionUnmount?(el: Element, region: ClientRegion): void;
37
+ }
38
+ /** Typed identity: a plugin's browser half. */
39
+ export declare function defineClient(plugin: ClientPlugin): ClientPlugin;
@@ -0,0 +1,6 @@
1
+ // src/plugin/client.ts
2
+ /** Typed identity: a plugin's browser half. */
3
+ function defineClient(plugin) {
4
+ return plugin;
5
+ }
6
+ export { defineClient };
@@ -0,0 +1,3 @@
1
+ /** Head tags for the components ONE render places (a layout chain + its page or error component):
2
+ * each component's whole-tree CSS, linked once per request. */
3
+ export declare function componentCssHead(components: readonly unknown[]): Promise<string>;