@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.
- package/LICENSE +21 -0
- package/README.md +7 -1
- package/ambient.d.ts +194 -0
- package/dist/ClientBindingStub.svelte +6 -0
- package/dist/ClientBindingStub.svelte.d.ts +26 -0
- package/dist/KeepHost.svelte +19 -0
- package/dist/KeepHost.svelte.d.ts +10 -0
- package/dist/LakeBoundary.svelte +16 -0
- package/dist/LakeBoundary.svelte.d.ts +11 -0
- package/dist/LateIsland.svelte +22 -0
- package/dist/LateIsland.svelte.d.ts +15 -0
- package/dist/LateIslandAwait.svelte +17 -0
- package/dist/LateIslandAwait.svelte.d.ts +15 -0
- package/dist/LiveHost.svelte +19 -0
- package/dist/LiveHost.svelte.d.ts +10 -0
- package/dist/NestedProvider.svelte +13 -0
- package/dist/NestedProvider.svelte.d.ts +8 -0
- package/dist/OgygiaBoundary.svelte +5 -0
- package/dist/OgygiaBoundary.svelte.d.ts +17 -0
- package/dist/PromiseRegion.svelte +40 -0
- package/dist/PromiseRegion.svelte.d.ts +15 -0
- package/dist/PromiseRegionAwait.svelte +27 -0
- package/dist/PromiseRegionAwait.svelte.d.ts +15 -0
- package/dist/Provide.svelte +27 -0
- package/dist/Provide.svelte.d.ts +8 -0
- package/dist/RawHtml.svelte +9 -0
- package/dist/RawHtml.svelte.d.ts +6 -0
- package/dist/Region.svelte +1173 -0
- package/dist/Region.svelte.d.ts +68 -0
- package/dist/SlotBoundary.svelte +13 -0
- package/dist/SlotBoundary.svelte.d.ts +7 -0
- package/dist/app.d.ts +4 -0
- package/dist/app.js +3 -0
- package/dist/boundary.d.ts +35 -0
- package/dist/boundary.js +127 -0
- package/dist/build-cache.d.ts +13 -0
- package/dist/build-cache.js +77 -0
- package/dist/compiler/blank-styles.d.ts +1 -0
- package/dist/compiler/blank-styles.js +63 -0
- package/dist/compiler/bom.d.ts +2 -0
- package/dist/compiler/bom.js +15 -0
- package/dist/compiler/browser-full.d.ts +8 -0
- package/dist/compiler/browser-full.js +8 -0
- package/dist/compiler/browser.d.ts +11 -0
- package/dist/compiler/browser.js +11 -0
- package/dist/compiler/content/transportables.d.ts +26 -0
- package/dist/compiler/content/transportables.js +219 -0
- package/dist/compiler/ctx.d.ts +180 -0
- package/dist/compiler/ctx.js +183 -0
- package/dist/compiler/debarrel/barrel.d.ts +55 -0
- package/dist/compiler/debarrel/barrel.js +248 -0
- package/dist/compiler/debarrel/options.d.ts +67 -0
- package/dist/compiler/debarrel/options.js +31 -0
- package/dist/compiler/debarrel/parse.d.ts +65 -0
- package/dist/compiler/debarrel/parse.js +256 -0
- package/dist/compiler/debarrel/plugin.d.ts +31 -0
- package/dist/compiler/debarrel/plugin.js +190 -0
- package/dist/compiler/debarrel/rewrite.d.ts +27 -0
- package/dist/compiler/debarrel/rewrite.js +118 -0
- package/dist/compiler/debarrel/svelte.d.ts +13 -0
- package/dist/compiler/debarrel/svelte.js +56 -0
- package/dist/compiler/dev/css-scope.d.ts +16 -0
- package/dist/compiler/dev/css-scope.js +38 -0
- package/dist/compiler/dev/dev-hmr.d.ts +25 -0
- package/dist/compiler/dev/dev-hmr.js +29 -0
- package/dist/compiler/dev/hmr.d.ts +34 -0
- package/dist/compiler/dev/hmr.js +57 -0
- package/dist/compiler/dev/region-bytes.d.ts +34 -0
- package/dist/compiler/dev/region-bytes.js +126 -0
- package/dist/compiler/driver.d.ts +280 -0
- package/dist/compiler/driver.js +1352 -0
- package/dist/compiler/flags.d.ts +16 -0
- package/dist/compiler/flags.js +101 -0
- package/dist/compiler/fouc-css.d.ts +97 -0
- package/dist/compiler/fouc-css.js +335 -0
- package/dist/compiler/free-vars.d.ts +20 -0
- package/dist/compiler/free-vars.js +327 -0
- package/dist/compiler/host.d.ts +65 -0
- package/dist/compiler/host.js +51 -0
- package/dist/compiler/ids.d.ts +84 -0
- package/dist/compiler/ids.js +86 -0
- package/dist/compiler/index.d.ts +11 -0
- package/dist/compiler/index.js +11 -0
- package/dist/compiler/kit.d.ts +129 -0
- package/dist/compiler/kit.js +563 -0
- package/dist/compiler/link/build-output.d.ts +44 -0
- package/dist/compiler/link/build-output.js +147 -0
- package/dist/compiler/link/caps.d.ts +48 -0
- package/dist/compiler/link/caps.js +64 -0
- package/dist/compiler/link/context-detect.d.ts +23 -0
- package/dist/compiler/link/context-detect.js +137 -0
- package/dist/compiler/link/emit-gate.d.ts +11 -0
- package/dist/compiler/link/emit-gate.js +40 -0
- package/dist/compiler/link/entry-shim.d.ts +4 -0
- package/dist/compiler/link/entry-shim.js +29 -0
- package/dist/compiler/link/island-deps.d.ts +142 -0
- package/dist/compiler/link/island-deps.js +525 -0
- package/dist/compiler/link/manifest.d.ts +5 -0
- package/dist/compiler/link/manifest.js +9 -0
- package/dist/compiler/link/page-keys.d.ts +64 -0
- package/dist/compiler/link/page-keys.js +683 -0
- package/dist/compiler/link/registry-stub.d.ts +41 -0
- package/dist/compiler/link/registry-stub.js +212 -0
- package/dist/compiler/link/router-config.d.ts +11 -0
- package/dist/compiler/link/router-config.js +15 -0
- package/dist/compiler/link/router-css.d.ts +22 -0
- package/dist/compiler/link/router-css.js +142 -0
- package/dist/compiler/link/runtime-entry.d.ts +71 -0
- package/dist/compiler/link/runtime-entry.js +132 -0
- package/dist/compiler/link/server-manifest.d.ts +12 -0
- package/dist/compiler/link/server-manifest.js +45 -0
- package/dist/compiler/link/speculation.d.ts +17 -0
- package/dist/compiler/link/speculation.js +36 -0
- package/dist/compiler/link/transport.d.ts +31 -0
- package/dist/compiler/link/transport.js +67 -0
- package/dist/compiler/macros/bake.d.ts +20 -0
- package/dist/compiler/macros/bake.js +317 -0
- package/dist/compiler/macros/browser.d.ts +11 -0
- package/dist/compiler/macros/browser.js +69 -0
- package/dist/compiler/macros/dedent.d.ts +12 -0
- package/dist/compiler/macros/dedent.js +36 -0
- package/dist/compiler/macros/dollar.d.ts +15 -0
- package/dist/compiler/macros/dollar.js +387 -0
- package/dist/compiler/macros/pipeline.d.ts +31 -0
- package/dist/compiler/macros/pipeline.js +106 -0
- package/dist/compiler/macros/source.d.ts +6 -0
- package/dist/compiler/macros/source.js +127 -0
- package/dist/compiler/macros/store.d.ts +17 -0
- package/dist/compiler/macros/store.js +244 -0
- package/dist/compiler/macros/wire.d.ts +14 -0
- package/dist/compiler/macros/wire.js +160 -0
- package/dist/compiler/ownership-stamps.d.ts +6 -0
- package/dist/compiler/ownership-stamps.js +144 -0
- package/dist/compiler/parse/oxc.d.ts +34 -0
- package/dist/compiler/parse/oxc.js +59 -0
- package/dist/compiler/parse/scan.d.ts +43 -0
- package/dist/compiler/parse/scan.js +232 -0
- package/dist/compiler/program.d.ts +140 -0
- package/dist/compiler/program.js +242 -0
- package/dist/compiler/region/emit.d.ts +169 -0
- package/dist/compiler/region/emit.js +286 -0
- package/dist/compiler/region/identity.d.ts +28 -0
- package/dist/compiler/region/identity.js +75 -0
- package/dist/compiler/region/ir.d.ts +65 -0
- package/dist/compiler/region/ir.js +0 -0
- package/dist/compiler/region/transform.d.ts +178 -0
- package/dist/compiler/region/transform.js +1933 -0
- package/dist/compiler/script-request.d.ts +1 -0
- package/dist/compiler/script-request.js +43 -0
- package/dist/context-bridge.d.ts +65 -0
- package/dist/context-bridge.js +217 -0
- package/dist/context-registry.d.ts +40 -0
- package/dist/context-registry.js +15 -0
- package/dist/context.d.ts +72 -0
- package/dist/context.js +158 -0
- package/dist/current-region.d.ts +14 -0
- package/dist/current-region.js +36 -0
- package/dist/document.d.ts +41 -0
- package/dist/document.js +125 -0
- package/dist/entry-hydrate.d.ts +5 -0
- package/dist/entry-hydrate.js +42 -0
- package/dist/escape.d.ts +18 -0
- package/dist/escape.js +37 -0
- package/dist/events/bus.d.ts +33 -0
- package/dist/events/bus.js +153 -0
- package/dist/events/index.d.ts +4 -0
- package/dist/events/index.js +4 -0
- package/dist/events/schema.d.ts +389 -0
- package/dist/events/schema.js +23 -0
- package/dist/events/server-registry.d.ts +7 -0
- package/dist/events/server-registry.js +13 -0
- package/dist/events/sinks.d.ts +64 -0
- package/dist/events/sinks.js +85 -0
- package/dist/fn-transport.d.ts +33 -0
- package/dist/fn-transport.js +140 -0
- package/dist/frame.d.ts +20 -0
- package/dist/frame.js +19 -0
- package/dist/holes-record.d.ts +6 -0
- package/dist/holes-record.js +8 -0
- package/dist/hooks.d.ts +43 -0
- package/dist/hooks.js +1191 -0
- package/dist/hydration-info.d.ts +1 -0
- package/dist/hydration-info.js +31 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +17 -0
- package/dist/insights/attr-rules.d.ts +15 -0
- package/dist/insights/attr-rules.js +27 -0
- package/dist/insights/cpu.d.ts +82 -0
- package/dist/insights/cpu.js +177 -0
- package/dist/insights/fp-drift.d.ts +28 -0
- package/dist/insights/fp-drift.js +148 -0
- package/dist/insights/hole-segments.d.ts +26 -0
- package/dist/insights/hole-segments.js +50 -0
- package/dist/insights/html-diff.d.ts +25 -0
- package/dist/insights/html-diff.js +157 -0
- package/dist/insights/hydration-hazards.d.ts +36 -0
- package/dist/insights/hydration-hazards.js +136 -0
- package/dist/insights/hydration-status.d.ts +2 -0
- package/dist/insights/hydration-status.js +0 -0
- package/dist/insights/index.d.ts +14 -0
- package/dist/insights/index.js +12 -0
- package/dist/insights/page-assets.d.ts +211 -0
- package/dist/insights/page-assets.js +608 -0
- package/dist/insights/page-insights.d.ts +749 -0
- package/dist/insights/page-insights.js +2157 -0
- package/dist/insights/session-data.d.ts +108 -0
- package/dist/insights/session-data.js +0 -0
- package/dist/insights/session-insights.d.ts +121 -0
- package/dist/insights/session-insights.js +548 -0
- package/dist/insights/switch.d.ts +53 -0
- package/dist/insights/switch.js +91 -0
- package/dist/insights/testing-version.d.ts +19 -0
- package/dist/insights/testing-version.js +21 -0
- package/dist/insights/third-party.d.ts +75 -0
- package/dist/insights/third-party.js +160 -0
- package/dist/internal-instruments.d.ts +13 -0
- package/dist/internal-instruments.js +12 -0
- package/dist/internal-reconcile.d.ts +3 -0
- package/dist/internal-reconcile.js +3 -0
- package/dist/internal-register.d.ts +7 -0
- package/dist/internal-register.js +7 -0
- package/dist/internal-server.d.ts +7 -0
- package/dist/internal-server.js +7 -0
- package/dist/internal.d.ts +13 -0
- package/dist/internal.js +13 -0
- package/dist/island-graph.d.ts +36 -0
- package/dist/island-graph.js +89 -0
- package/dist/keep-fallback-marker.d.ts +7 -0
- package/dist/keep-fallback-marker.js +9 -0
- package/dist/keep-fallback.d.ts +13 -0
- package/dist/keep-fallback.js +39 -0
- package/dist/kit-paths.d.ts +2 -0
- package/dist/kit-paths.js +39 -0
- package/dist/late-region-registry.d.ts +40 -0
- package/dist/late-region-registry.js +36 -0
- package/dist/live-transport.d.ts +57 -0
- package/dist/live-transport.js +145 -0
- package/dist/markup.d.ts +4 -0
- package/dist/markup.js +4 -0
- package/dist/own-package.d.ts +15 -0
- package/dist/own-package.js +20 -0
- package/dist/page-defer.d.ts +33 -0
- package/dist/page-defer.js +35 -0
- package/dist/page-facts-script.d.ts +7 -0
- package/dist/page-facts-script.js +9 -0
- package/dist/page-seed-registry.d.ts +72 -0
- package/dist/page-seed-registry.js +31 -0
- package/dist/plugin/capability.d.ts +14 -0
- package/dist/plugin/capability.js +44 -0
- package/dist/plugin/client.d.ts +39 -0
- package/dist/plugin/client.js +6 -0
- package/dist/plugin/css.d.ts +3 -0
- package/dist/plugin/css.js +54 -0
- package/dist/plugin/facts.d.ts +42 -0
- package/dist/plugin/facts.js +37 -0
- package/dist/plugin/hooks.d.ts +33 -0
- package/dist/plugin/hooks.js +38 -0
- package/dist/plugin/index.d.ts +127 -0
- package/dist/plugin/index.js +26 -0
- package/dist/plugin/routes.d.ts +32 -0
- package/dist/plugin/routes.js +35 -0
- package/dist/plugin/server.d.ts +27 -0
- package/dist/plugin/server.js +92 -0
- package/dist/plugin/standard-schema.d.ts +27 -0
- package/dist/plugin/standard-schema.js +0 -0
- package/dist/plugin/testing.d.ts +13 -0
- package/dist/plugin/testing.js +54 -0
- package/dist/plugin/utils.d.ts +13 -0
- package/dist/plugin/utils.js +19 -0
- package/dist/portable-form.d.ts +22 -0
- package/dist/portable-form.js +52 -0
- package/dist/preference.d.ts +35 -0
- package/dist/preference.js +84 -0
- package/dist/preload.d.ts +1 -0
- package/dist/preload.js +21 -0
- package/dist/ref-watch.d.ts +31 -0
- package/dist/ref-watch.js +66 -0
- package/dist/ref.d.ts +124 -0
- package/dist/ref.js +272 -0
- package/dist/region-brand.d.ts +8 -0
- package/dist/region-brand.js +10 -0
- package/dist/region-core.d.ts +2 -0
- package/dist/region-core.js +1 -0
- package/dist/region-snippet.d.ts +73 -0
- package/dist/region-snippet.js +351 -0
- package/dist/region.d.ts +127 -0
- package/dist/region.js +162 -0
- package/dist/request-event.d.ts +1 -0
- package/dist/request-event.js +37 -0
- package/dist/router-css.d.ts +39 -0
- package/dist/router-css.js +66 -0
- package/dist/runtime/app-transport.d.ts +2 -0
- package/dist/runtime/app-transport.js +13 -0
- package/dist/runtime/beacon.d.ts +271 -0
- package/dist/runtime/beacon.js +2190 -0
- package/dist/runtime/boot-link.d.ts +1 -0
- package/dist/runtime/boot-link.js +44 -0
- package/dist/runtime/client-hooks.d.ts +5 -0
- package/dist/runtime/client-hooks.js +22 -0
- package/dist/runtime/client-plugins.d.ts +8 -0
- package/dist/runtime/client-plugins.js +34 -0
- package/dist/runtime/concurrency.d.ts +12 -0
- package/dist/runtime/concurrency.js +29 -0
- package/dist/runtime/connected.d.ts +12 -0
- package/dist/runtime/connected.js +16 -0
- package/dist/runtime/context.d.ts +1 -0
- package/dist/runtime/context.js +19 -0
- package/dist/runtime/core.d.ts +15 -0
- package/dist/runtime/core.js +1173 -0
- package/dist/runtime/drift-watch.d.ts +9 -0
- package/dist/runtime/drift-watch.js +60 -0
- package/dist/runtime/entry-locations.d.ts +33 -0
- package/dist/runtime/entry-locations.js +119 -0
- package/dist/runtime/foreign-props.d.ts +8 -0
- package/dist/runtime/foreign-props.js +14 -0
- package/dist/runtime/form-continuity.d.ts +10 -0
- package/dist/runtime/form-continuity.js +107 -0
- package/dist/runtime/frame-nav.d.ts +36 -0
- package/dist/runtime/frame-nav.js +225 -0
- package/dist/runtime/frame-store.d.ts +62 -0
- package/dist/runtime/frame-store.js +214 -0
- package/dist/runtime/frames.d.ts +1 -0
- package/dist/runtime/frames.js +25 -0
- package/dist/runtime/full.d.ts +4 -0
- package/dist/runtime/full.js +32 -0
- package/dist/runtime/hash.d.ts +41 -0
- package/dist/runtime/hash.js +79 -0
- package/dist/runtime/hole-facts.d.ts +8 -0
- package/dist/runtime/hole-facts.js +57 -0
- package/dist/runtime/host-classes.d.ts +24 -0
- package/dist/runtime/host-classes.js +43 -0
- package/dist/runtime/hydrate-core.d.ts +101 -0
- package/dist/runtime/hydrate-core.js +605 -0
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.js +1 -0
- package/dist/runtime/interaction-replay.d.ts +11 -0
- package/dist/runtime/interaction-replay.js +70 -0
- package/dist/runtime/interaction.d.ts +33 -0
- package/dist/runtime/interaction.js +217 -0
- package/dist/runtime/island-graph-preload.d.ts +13 -0
- package/dist/runtime/island-graph-preload.js +99 -0
- package/dist/runtime/kit-boot.d.ts +29 -0
- package/dist/runtime/kit-boot.js +60 -0
- package/dist/runtime/kit-page-thread.svelte.d.ts +1 -0
- package/dist/runtime/kit-page-thread.svelte.js +116 -0
- package/dist/runtime/lake-anchors.d.ts +13 -0
- package/dist/runtime/lake-anchors.js +19 -0
- package/dist/runtime/lakes.d.ts +15 -0
- package/dist/runtime/lakes.js +212 -0
- package/dist/runtime/live.d.ts +3 -0
- package/dist/runtime/live.js +17 -0
- package/dist/runtime/load-scheduler.d.ts +53 -0
- package/dist/runtime/load-scheduler.js +317 -0
- package/dist/runtime/morph.d.ts +42 -0
- package/dist/runtime/morph.js +671 -0
- package/dist/runtime/nav-handle.d.ts +25 -0
- package/dist/runtime/nav-handle.js +71 -0
- package/dist/runtime/nav-hooks.d.ts +2 -0
- package/dist/runtime/nav-hooks.js +23 -0
- package/dist/runtime/nearest-attr.d.ts +4 -0
- package/dist/runtime/nearest-attr.js +16 -0
- package/dist/runtime/observe.d.ts +27 -0
- package/dist/runtime/observe.js +63 -0
- package/dist/runtime/own-cost.d.ts +9 -0
- package/dist/runtime/own-cost.js +35 -0
- package/dist/runtime/ownership.d.ts +101 -0
- package/dist/runtime/ownership.js +115 -0
- package/dist/runtime/page-cache.d.ts +23 -0
- package/dist/runtime/page-cache.js +74 -0
- package/dist/runtime/page-defer.d.ts +14 -0
- package/dist/runtime/page-defer.js +103 -0
- package/dist/runtime/parse-html.d.ts +40 -0
- package/dist/runtime/parse-html.js +81 -0
- package/dist/runtime/reconcile.d.ts +41 -0
- package/dist/runtime/reconcile.js +194 -0
- package/dist/runtime/region-attrs.d.ts +95 -0
- package/dist/runtime/region-attrs.js +153 -0
- package/dist/runtime/region-endpoint-url.d.ts +76 -0
- package/dist/runtime/region-endpoint-url.js +169 -0
- package/dist/runtime/region-ids.d.ts +8 -0
- package/dist/runtime/region-ids.js +33 -0
- package/dist/runtime/remote-seeds.d.ts +2 -0
- package/dist/runtime/remote-seeds.js +21 -0
- package/dist/runtime/render-blocking.d.ts +2 -0
- package/dist/runtime/render-blocking.js +30 -0
- package/dist/runtime/restore.d.ts +34 -0
- package/dist/runtime/restore.js +390 -0
- package/dist/runtime/router-nav.d.ts +63 -0
- package/dist/runtime/router-nav.js +740 -0
- package/dist/runtime/router.d.ts +201 -0
- package/dist/runtime/router.js +593 -0
- package/dist/runtime/schedule.d.ts +49 -0
- package/dist/runtime/schedule.js +256 -0
- package/dist/runtime/seeds.d.ts +50 -0
- package/dist/runtime/seeds.js +208 -0
- package/dist/runtime/session.d.ts +52 -0
- package/dist/runtime/session.js +130 -0
- package/dist/runtime/sidecar.d.ts +3 -0
- package/dist/runtime/sidecar.js +56 -0
- package/dist/runtime/slots.d.ts +183 -0
- package/dist/runtime/slots.js +44 -0
- package/dist/runtime/spa-cacheable.d.ts +7 -0
- package/dist/runtime/spa-cacheable.js +18 -0
- package/dist/runtime/speculate-hint.d.ts +1 -0
- package/dist/runtime/speculate-hint.js +35 -0
- package/dist/runtime/svelte-warnings.d.ts +28 -0
- package/dist/runtime/svelte-warnings.js +71 -0
- package/dist/runtime/wire-classes.d.ts +3 -0
- package/dist/runtime/wire-classes.js +69 -0
- package/dist/runtime/wire-format.d.ts +7 -0
- package/dist/runtime/wire-format.js +22 -0
- package/dist/script.d.ts +134 -0
- package/dist/script.js +184 -0
- package/dist/seed-refs.d.ts +105 -0
- package/dist/seed-refs.js +487 -0
- package/dist/server/capability-lifetime.d.ts +28 -0
- package/dist/server/capability-lifetime.js +31 -0
- package/dist/server/dead-kit-resolves.d.ts +1 -0
- package/dist/server/dead-kit-resolves.js +39 -0
- package/dist/server/document-assembly.d.ts +30 -0
- package/dist/server/document-assembly.js +26 -0
- package/dist/server/document-tail.d.ts +113 -0
- package/dist/server/document-tail.js +208 -0
- package/dist/server/endpoint.d.ts +51 -0
- package/dist/server/endpoint.js +90 -0
- package/dist/server/entry-location.d.ts +8 -0
- package/dist/server/entry-location.js +29 -0
- package/dist/server/fingerprint.d.ts +1 -0
- package/dist/server/fingerprint.js +25 -0
- package/dist/server/head-presence.d.ts +45 -0
- package/dist/server/head-presence.js +156 -0
- package/dist/server/hmac.d.ts +38 -0
- package/dist/server/hmac.js +89 -0
- package/dist/server/hole-graph.d.ts +7 -0
- package/dist/server/hole-graph.js +71 -0
- package/dist/server/hole-urls.d.ts +3 -0
- package/dist/server/hole-urls.js +76 -0
- package/dist/server/html-scan.d.ts +19 -0
- package/dist/server/html-scan.js +60 -0
- package/dist/server/kit-context.d.ts +78 -0
- package/dist/server/kit-context.js +110 -0
- package/dist/server/late-wire.d.ts +22 -0
- package/dist/server/late-wire.js +28 -0
- package/dist/server/page-facts.d.ts +25 -0
- package/dist/server/page-facts.js +138 -0
- package/dist/server/page-seed.d.ts +33 -0
- package/dist/server/page-seed.js +60 -0
- package/dist/server/page-stream.d.ts +55 -0
- package/dist/server/page-stream.js +121 -0
- package/dist/server/payload.d.ts +6 -0
- package/dist/server/payload.js +22 -0
- package/dist/server/personal-response.d.ts +6 -0
- package/dist/server/personal-response.js +13 -0
- package/dist/server/props-wire.d.ts +56 -0
- package/dist/server/props-wire.js +178 -0
- package/dist/server/rate-limit.d.ts +22 -0
- package/dist/server/rate-limit.js +63 -0
- package/dist/server/region-css.d.ts +5 -0
- package/dist/server/region-css.js +30 -0
- package/dist/server/region-endpoint.d.ts +35 -0
- package/dist/server/region-endpoint.js +142 -0
- package/dist/server/region-props.d.ts +6 -0
- package/dist/server/region-props.js +44 -0
- package/dist/server/remote-seed-gate.d.ts +50 -0
- package/dist/server/remote-seed-gate.js +66 -0
- package/dist/server/render-cache.d.ts +26 -0
- package/dist/server/render-cache.js +51 -0
- package/dist/server/render-page.d.ts +51 -0
- package/dist/server/render-page.js +176 -0
- package/dist/server/render-region-html.d.ts +2 -0
- package/dist/server/render-region-html.js +19 -0
- package/dist/server/request-stats.d.ts +174 -0
- package/dist/server/request-stats.js +54 -0
- package/dist/server/reversible.d.ts +83 -0
- package/dist/server/reversible.js +994 -0
- package/dist/server/seed-shape.d.ts +22 -0
- package/dist/server/seed-shape.js +24 -0
- package/dist/server/shared-cache.d.ts +35 -0
- package/dist/server/shared-cache.js +104 -0
- package/dist/server/signing-key.d.ts +11 -0
- package/dist/server/signing-key.js +47 -0
- package/dist/server/sized-lru.d.ts +20 -0
- package/dist/server/sized-lru.js +68 -0
- package/dist/server/split-regions.d.ts +81 -0
- package/dist/server/split-regions.js +368 -0
- package/dist/server/stream-regions.d.ts +5 -0
- package/dist/server/stream-regions.js +36 -0
- package/dist/shared-state.d.ts +7 -0
- package/dist/shared-state.js +152 -0
- package/dist/shims/app-environment.d.ts +4 -0
- package/dist/shims/app-environment.js +6 -0
- package/dist/shims/app-navigation.d.ts +33 -0
- package/dist/shims/app-navigation.js +119 -0
- package/dist/shims/app-paths.d.ts +6 -0
- package/dist/shims/app-paths.js +18 -0
- package/dist/shims/app-state.svelte.d.ts +23 -0
- package/dist/shims/app-state.svelte.js +50 -0
- package/dist/shims/app-stores.d.ts +21 -0
- package/dist/shims/app-stores.js +54 -0
- package/dist/shims/kit-bridge.d.ts +29 -0
- package/dist/shims/kit-bridge.js +7 -0
- package/dist/shims/kit-remote/client-stub.d.ts +27 -0
- package/dist/shims/kit-remote/client-stub.js +43 -0
- package/dist/shims/kit-remote/paths-internal-stub.d.ts +3 -0
- package/dist/shims/kit-remote/paths-internal-stub.js +5 -0
- package/dist/shims/kit-remote/remote-cache.d.ts +49 -0
- package/dist/shims/kit-remote/remote-cache.js +73 -0
- package/dist/shims/kit-remote/state-stub.d.ts +8 -0
- package/dist/shims/kit-remote/state-stub.js +8 -0
- package/dist/shims/page-store.svelte.d.ts +39 -0
- package/dist/shims/page-store.svelte.js +77 -0
- package/dist/source.d.ts +29 -0
- package/dist/source.js +87 -0
- package/dist/store-transport.d.ts +86 -0
- package/dist/store-transport.js +229 -0
- package/dist/tool-fetches.d.ts +5 -0
- package/dist/tool-fetches.js +41 -0
- package/dist/transport.d.ts +48 -0
- package/dist/transport.js +181 -0
- package/dist/unscoped-css.d.ts +26 -0
- package/dist/unscoped-css.js +53 -0
- package/dist/vite/dev-maps.d.ts +33 -0
- package/dist/vite/dev-maps.js +140 -0
- package/dist/vite/index.d.ts +19 -0
- package/dist/vite/index.js +820 -0
- package/dist/vite/kit-dirs.d.ts +7 -0
- package/dist/vite/kit-dirs.js +67 -0
- package/dist/vite/late-island.d.ts +25 -0
- package/dist/vite/late-island.js +33 -0
- package/dist/vite/module-map.d.ts +8 -0
- package/dist/vite/module-map.js +144 -0
- package/dist/vite/options.d.ts +208 -0
- package/dist/vite/options.js +74 -0
- package/dist/vite/package-files.d.ts +3 -0
- package/dist/vite/package-files.js +84 -0
- package/dist/vite/paths.d.ts +45 -0
- package/dist/vite/paths.js +112 -0
- package/dist/vite/plugin-api.d.ts +166 -0
- package/dist/vite/plugin-api.js +212 -0
- package/dist/vite/profiler-maps.d.ts +23 -0
- package/dist/vite/profiler-maps.js +178 -0
- package/dist/vite/server-sourcemaps.d.ts +8 -0
- package/dist/vite/server-sourcemaps.js +80 -0
- package/dist/vite/sourcemaps.d.ts +18 -0
- package/dist/vite/sourcemaps.js +80 -0
- package/dist/vite/style-preprocess.d.ts +2 -0
- package/dist/vite/style-preprocess.js +96 -0
- package/package.json +180 -6
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { is_word } from "./html-scan.js";
|
|
2
|
+
// src/server/head-presence.ts
|
|
3
|
+
/**
|
|
4
|
+
* Presence checks for the head tags the `handle()` transform injects (the router meta, the runtime
|
|
5
|
+
* bootstrap, the dev-HMR script, MPA speculation rules). Each must detect a REAL element, never the
|
|
6
|
+
* tag's name as TEXT.
|
|
7
|
+
*
|
|
8
|
+
* Why this exists as its own module: a page that DOCUMENTS one of these tags in a code block renders
|
|
9
|
+
* it HTML-escaped — `` `<meta name="ogygia-router" content="plain">` `` becomes
|
|
10
|
+
* `<code><meta name="ogygia-router" content="plain"></code>`. A substring check like
|
|
11
|
+
* `html.includes('name="ogygia-router"')` false-matches that prose and suppresses the injection; for
|
|
12
|
+
* the router marker that silently drops the whole page to full-page navigation (no marker → the
|
|
13
|
+
* client router hands off to `location.href`, so no SPA and no view transition). The changelog page
|
|
14
|
+
* documents exactly these tags, which is how the bug surfaced.
|
|
15
|
+
*
|
|
16
|
+
* The fix each predicate shares: require a literal `<meta` / `<script` — the escaped copy carries
|
|
17
|
+
* `<`, never a bare `<`, so it can't match. `[^>]*` is bounded to the opening tag, so a `<script>`
|
|
18
|
+
* whose BODY mentions the attribute (inline JS) can't false-match either. Every pattern is a single
|
|
19
|
+
* unnested `[^>]*`, so `.test()` is linear — no backtracking on any input.
|
|
20
|
+
*
|
|
21
|
+
* The patterns are module constants (compiled once), never rebuilt per call: these predicates run on
|
|
22
|
+
* the page HTML during every SSR response transform. They STAY regexes: measured against hand-written
|
|
23
|
+
* scans (a tag walk, a rare-needle-first search), the engine's compiled matcher was 2–4× faster on
|
|
24
|
+
* real heads, allocation-free either way. `dedupe_head_links` is hand-written: it won.
|
|
25
|
+
*/
|
|
26
|
+
/** A real `<meta name="ogygia-router" …>` element — a page opting a route out of view transitions. */
|
|
27
|
+
const ROUTER_META_RE = /<meta\b[^>]*\bname=["']ogygia-router["']/i;
|
|
28
|
+
/** A real runtime bootstrap `<script … data-ogygia-runtime …>` (Region emits it on island pages). */
|
|
29
|
+
const RUNTIME_SCRIPT_RE = /<script\b[^>]*\bdata-ogygia-runtime\b/i;
|
|
30
|
+
/** A real dev-HMR `<script … data-ogygia-dev-hmr …>`. */
|
|
31
|
+
const DEV_HMR_SCRIPT_RE = /<script\b[^>]*\bdata-ogygia-dev-hmr\b/i;
|
|
32
|
+
/** A real `<script type="speculationrules" …>` (a page authoring its own MPA speculation rules). */
|
|
33
|
+
const SPECULATION_RULES_RE = /<script\b[^>]*\btype=["']speculationrules["']/i;
|
|
34
|
+
function page_declares_router_meta(html) {
|
|
35
|
+
return ROUTER_META_RE.test(html);
|
|
36
|
+
}
|
|
37
|
+
function page_declares_runtime_script(html) {
|
|
38
|
+
return RUNTIME_SCRIPT_RE.test(html);
|
|
39
|
+
}
|
|
40
|
+
function page_declares_dev_hmr_script(html) {
|
|
41
|
+
return DEV_HMR_SCRIPT_RE.test(html);
|
|
42
|
+
}
|
|
43
|
+
function page_declares_speculation_rules(html) {
|
|
44
|
+
return SPECULATION_RULES_RE.test(html);
|
|
45
|
+
}
|
|
46
|
+
/** The value of the first `\b<attr>=` + quote in `[from, to)`, up to the next quote of either kind
|
|
47
|
+
* (case-sensitive, as the `rel` / `href` probes always were), or `undefined`. */
|
|
48
|
+
function quoted_attr(s, from, to, attr) {
|
|
49
|
+
const n = attr.length;
|
|
50
|
+
for (let i = s.indexOf(attr, from); i !== -1 && i + n + 2 <= to; i = s.indexOf(attr, i + 1)) {
|
|
51
|
+
if (is_word(s.charCodeAt(i - 1)) || s.charCodeAt(i + n) !== 61) continue;
|
|
52
|
+
const q = s.charCodeAt(i + n + 1);
|
|
53
|
+
if (q !== 34 && q !== 39) continue;
|
|
54
|
+
const start = i + n + 2;
|
|
55
|
+
let end = start;
|
|
56
|
+
for (; end < to; end++) {
|
|
57
|
+
const c = s.charCodeAt(end);
|
|
58
|
+
if (c === 34 || c === 39) return s.slice(start, end);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Drop duplicate `<link>` tags in the HEAD — one pass over the head slice, two families:
|
|
64
|
+
*
|
|
65
|
+
* - `rel="stylesheet"`: same href → first occurrence wins. Kit links a route's client-graph CSS
|
|
66
|
+
* and Region.svelte links a rendered island's CSS from the render pass; a layout island compiled
|
|
67
|
+
* as a real wrapper (a csr=true-capable layout host) is in both, so its sheet was linked twice —
|
|
68
|
+
* two render-blocking fetches of one asset. `<style>` tags are untouched.
|
|
69
|
+
* - `rel="modulepreload"`: same href → first occurrence wins. Each island's SSR emits its own
|
|
70
|
+
* dep-hint block, so islands sharing dep chunks — or one island rendered N times — repeat
|
|
71
|
+
* identical hints (a real page carried ~44 duplicate tags). Every hint ogygia emits is
|
|
72
|
+
* `fetchpriority="low"` (Region.svelte), so there is no priority to arbitrate between copies.
|
|
73
|
+
*
|
|
74
|
+
* Every other `<link>` passes through byte-identical. The handle calls this on the HEAD SLICE of
|
|
75
|
+
* the document only (everything before `</head>`, tens of KB): the hints and the sheets live there,
|
|
76
|
+
* so the 2.6 MB body is never scanned for them.
|
|
77
|
+
*/
|
|
78
|
+
function dedupe_head_links(head) {
|
|
79
|
+
if (!head.includes("<link")) return head;
|
|
80
|
+
const sheets = /* @__PURE__ */ new Set();
|
|
81
|
+
const hints = /* @__PURE__ */ new Set();
|
|
82
|
+
let out = null;
|
|
83
|
+
let kept = 0;
|
|
84
|
+
for (let lt = head.indexOf("<link"), gt = 0; lt !== -1; lt = head.indexOf("<link", gt + 1)) {
|
|
85
|
+
if (is_word(head.charCodeAt(lt + 5))) {
|
|
86
|
+
gt = lt;
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
gt = head.indexOf(">", lt);
|
|
90
|
+
if (gt === -1) break;
|
|
91
|
+
const from = lt + 5;
|
|
92
|
+
const rel = quoted_attr(head, from, gt, "rel");
|
|
93
|
+
const seen = rel === "stylesheet" ? sheets : rel === "modulepreload" ? hints : null;
|
|
94
|
+
if (seen === null) continue;
|
|
95
|
+
const href = quoted_attr(head, from, gt, "href");
|
|
96
|
+
if (href === void 0) continue;
|
|
97
|
+
if (!seen.has(href)) {
|
|
98
|
+
seen.add(href);
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
(out ??= []).push(head.slice(kept, lt));
|
|
102
|
+
kept = gt + 1;
|
|
103
|
+
}
|
|
104
|
+
if (out === null) return head;
|
|
105
|
+
out.push(head.slice(kept));
|
|
106
|
+
return out.join("");
|
|
107
|
+
}
|
|
108
|
+
const RUNTIME_SCRIPT_ELEMENT_RE = /<script\b[^>]*\bdata-ogygia-runtime\b[^>]*><\/script>(?:<link\b[^>]*\bdata-ogygia-runtime-dep\b[^>]*>)*/i;
|
|
109
|
+
const HEAD_OPEN_RE = /<head\b[^>]*>/i;
|
|
110
|
+
const FIRST_JS_G = /<script\b|<link\b[^>]*\brel=["']?modulepreload\b/gi;
|
|
111
|
+
const HEAD_CLOSE_G = /<\/head\s*>/gi;
|
|
112
|
+
/** The first match of a global pattern at or after `from` (its index), or -1. */
|
|
113
|
+
function search_from(re, s, from) {
|
|
114
|
+
re.lastIndex = from;
|
|
115
|
+
const m = re.exec(s);
|
|
116
|
+
return m ? m.index : -1;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Put the runtime bootstrap BEFORE ALL OF THE PAGE'S JAVASCRIPT in `<head>` — immediately ahead of
|
|
120
|
+
* the first `<script>` or `<link rel="modulepreload">` the app's template and the page carry, and
|
|
121
|
+
* no earlier. `runtime` is the tag to place when the head has none yet (`null` = only reorder what
|
|
122
|
+
* is there; the tag an island page emits sits wherever Kit's head slot is, after the app's own
|
|
123
|
+
* scripts in `app.html`). With no JavaScript in the head it goes last in it. Returns `head` itself
|
|
124
|
+
* when there is nothing to move.
|
|
125
|
+
*
|
|
126
|
+
* Why BEFORE THE JS: module and deferred scripts run in document order once parsing ends, and the
|
|
127
|
+
* runtime's custom-element definition is what makes every `<ogygia-region>` connect and keep its
|
|
128
|
+
* server markup — the copy an island hydrates against when something edited it while it slept
|
|
129
|
+
* (runtime/core.ts `#ssr_html`). A design-system runtime loaded from the app template ran BEFORE the
|
|
130
|
+
* runtime on a customer page and stripped the whitespace nodes of every island in the header before
|
|
131
|
+
* the runtime ever saw them, so the "server copy" was the edited DOM and the login island still
|
|
132
|
+
* re-rendered client-side on its first tap. Ahead of every script, the runtime sees the document as
|
|
133
|
+
* the server sent it, whatever the app loads after it.
|
|
134
|
+
*
|
|
135
|
+
* Why NOT FIRST IN THE HEAD: that ordering guarantee is about execution, and only needs "before the
|
|
136
|
+
* other scripts". Heading the whole `<head>` also made the runtime the page's FIRST REQUEST, ahead of
|
|
137
|
+
* its stylesheets and its LCP image preload. Everything that is not JavaScript — the charset and
|
|
138
|
+
* other `<meta>`, the `<title>`, stylesheets, preconnects, image/font preloads — keeps its place in
|
|
139
|
+
* front of it.
|
|
140
|
+
*/
|
|
141
|
+
function runtime_first(head, runtime) {
|
|
142
|
+
const found = RUNTIME_SCRIPT_ELEMENT_RE.exec(head);
|
|
143
|
+
const tag = found ? found[0] : runtime;
|
|
144
|
+
if (tag === null) return head;
|
|
145
|
+
const rest = found ? head.slice(0, found.index) + head.slice(found.index + found[0].length) : head;
|
|
146
|
+
const open = HEAD_OPEN_RE.exec(rest);
|
|
147
|
+
const from = open ? open.index + open[0].length : 0;
|
|
148
|
+
let at = search_from(FIRST_JS_G, rest, from);
|
|
149
|
+
if (at === -1) {
|
|
150
|
+
const close = search_from(HEAD_CLOSE_G, rest, from);
|
|
151
|
+
at = close === -1 ? rest.length : close;
|
|
152
|
+
}
|
|
153
|
+
if (found && found.index === at) return head;
|
|
154
|
+
return rest.slice(0, at) + tag + rest.slice(at);
|
|
155
|
+
}
|
|
156
|
+
export { dedupe_head_links, page_declares_dev_hmr_script, page_declares_router_meta, page_declares_runtime_script, page_declares_speculation_rules, runtime_first };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** Minimum UTF-8 byte length for a user-supplied `OGYGIA_SECRET` in production builds. */
|
|
2
|
+
export declare const MIN_SECRET_BYTES = 16;
|
|
3
|
+
/** HKDF-SHA256 → 32-byte MAC key (hex for stable logging / tests; Buffer used internally). */
|
|
4
|
+
export declare function derive_mac_key(secret: string): Buffer;
|
|
5
|
+
/** HKDF-SHA256 → 16-byte id salt (hex). Empty input must not be used — caller gates on env. */
|
|
6
|
+
export declare function derive_id_salt(secret: string): string;
|
|
7
|
+
/** True when a configured secret meets the production entropy floor. */
|
|
8
|
+
export declare function secret_has_min_entropy(secret: string): boolean;
|
|
9
|
+
export declare class Hmac {
|
|
10
|
+
static sha256(key: Buffer, message: string): string;
|
|
11
|
+
static sign(secret: string, message: string): string;
|
|
12
|
+
static verify(secret: string, message: string, sig: string): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* MAC message for a signed region capability. Every field is length-prefixed (`<utf8 bytes>:<value>`),
|
|
15
|
+
* so a field's content can never forge a `|` boundary. Two versions:
|
|
16
|
+
*
|
|
17
|
+
* - `v1|id|exp|props|session|ttl` — the capability names only its region `id` (the wrapper that
|
|
18
|
+
* minted it: component ⊕ page-side schedule ⊕ the build's salt). Only a build that has that
|
|
19
|
+
* exact id can answer it. Minted before render identities (ogygia ≤ 0.8.6); still verified, so
|
|
20
|
+
* pages cached before an upgrade keep their holes.
|
|
21
|
+
* - `v2|id|exp|props|session|ttl|render` — the same five, plus the region's render identity (the
|
|
22
|
+
* URL's `r`: the component the endpoint renders, compiler/region/identity.ts `renderId`). Signing
|
|
23
|
+
* it lets a build that no longer has `id` (another schedule, preset or salt) answer the
|
|
24
|
+
* capability with its own entry for that component, and only for that component. Every current
|
|
25
|
+
* mint is `v2`.
|
|
26
|
+
*
|
|
27
|
+
* The version follows from the URL: a capability with `r` is checked as `v2`, one without as `v1`.
|
|
28
|
+
* A `v2` MAC never verifies as `v1` (the prefix and the field count differ), so stripping `r` or
|
|
29
|
+
* swapping it for another component breaks the signature. Empty `session`/`ttl` are still fields
|
|
30
|
+
* (prerender / unbound / no-store) — never optional concat. `ttl` is the response cache max-age in
|
|
31
|
+
* seconds (`''` = no-store); signing it keeps a harvested URL from being re-pointed at a longer
|
|
32
|
+
* browser cache.
|
|
33
|
+
*/
|
|
34
|
+
static region_message(id: string, exp: number | string, props: string, session?: string, ttl?: number | string, render?: string): string;
|
|
35
|
+
}
|
|
36
|
+
export declare const sign: typeof Hmac.sign;
|
|
37
|
+
export declare const verify: typeof Hmac.verify;
|
|
38
|
+
export declare const region_mac_message: typeof Hmac.region_message;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { is_lower_hex } from "./endpoint.js";
|
|
2
|
+
import { createHmac, hkdfSync, timingSafeEqual } from "node:crypto";
|
|
3
|
+
// src/server/hmac.ts
|
|
4
|
+
/**
|
|
5
|
+
* HMAC-SHA256 for region capability URLs — Node `createHmac` (sync).
|
|
6
|
+
*
|
|
7
|
+
* Used by `ogygiaHandle` and by SSR `virtual:ogygia/sign`. The client never imports this
|
|
8
|
+
* module: ServerIsland goes through `virtual:ogygia/sign`, which is a no-op on the client
|
|
9
|
+
* (secret is already empty there). Web Crypto is not used — browsers must not mint with a
|
|
10
|
+
* real secret.
|
|
11
|
+
*
|
|
12
|
+
* MAC format is versioned (`v1|…`) with UTF-8 length-prefixed fields so `\0` inside a
|
|
13
|
+
* field cannot shift boundaries. Signing keys are HKDF-derived (`ogygia-mac-v1`) from the
|
|
14
|
+
* raw secret so the id-salt domain stays separate.
|
|
15
|
+
*/
|
|
16
|
+
const MAC_INFO = Buffer.from("ogygia-mac-v1");
|
|
17
|
+
const ID_SALT_INFO = Buffer.from("ogygia-id-salt-v1");
|
|
18
|
+
const utf8 = new TextEncoder();
|
|
19
|
+
/** Minimum UTF-8 byte length for a user-supplied `OGYGIA_SECRET` in production builds. */
|
|
20
|
+
const MIN_SECRET_BYTES = 16;
|
|
21
|
+
const mac_keys = /* @__PURE__ */ new Map();
|
|
22
|
+
/** HKDF-SHA256 → 32-byte MAC key (hex for stable logging / tests; Buffer used internally). */
|
|
23
|
+
function derive_mac_key(secret) {
|
|
24
|
+
let key = mac_keys.get(secret);
|
|
25
|
+
if (key === void 0) {
|
|
26
|
+
key = Buffer.from(hkdfSync("sha256", Buffer.from(secret, "utf8"), Buffer.alloc(0), MAC_INFO, 32));
|
|
27
|
+
if (mac_keys.size >= 16) mac_keys.clear();
|
|
28
|
+
mac_keys.set(secret, key);
|
|
29
|
+
}
|
|
30
|
+
return key;
|
|
31
|
+
}
|
|
32
|
+
/** HKDF-SHA256 → 16-byte id salt (hex). Empty input must not be used — caller gates on env. */
|
|
33
|
+
function derive_id_salt(secret) {
|
|
34
|
+
return Buffer.from(hkdfSync("sha256", Buffer.from(secret, "utf8"), Buffer.alloc(0), ID_SALT_INFO, 16)).toString("hex");
|
|
35
|
+
}
|
|
36
|
+
/** True when a configured secret meets the production entropy floor. */
|
|
37
|
+
function secret_has_min_entropy(secret) {
|
|
38
|
+
return Buffer.byteLength(secret, "utf8") >= 16;
|
|
39
|
+
}
|
|
40
|
+
/** UTF-8 length-prefix so field contents cannot forge delimiters. */
|
|
41
|
+
function lp(s) {
|
|
42
|
+
return `${utf8.encode(s).byteLength}:${s}`;
|
|
43
|
+
}
|
|
44
|
+
var Hmac = class Hmac {
|
|
45
|
+
static sha256(key, message) {
|
|
46
|
+
return createHmac("sha256", key).update(message, "utf8").digest("hex");
|
|
47
|
+
}
|
|
48
|
+
static sign(secret, message) {
|
|
49
|
+
return Hmac.sha256(derive_mac_key(secret), message);
|
|
50
|
+
}
|
|
51
|
+
static verify(secret, message, sig) {
|
|
52
|
+
if (typeof sig !== "string" || !is_lower_hex(sig, 64)) return false;
|
|
53
|
+
const expected = Hmac.sha256(derive_mac_key(secret), message);
|
|
54
|
+
try {
|
|
55
|
+
return timingSafeEqual(Buffer.from(expected, "hex"), Buffer.from(sig, "hex"));
|
|
56
|
+
} catch {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* MAC message for a signed region capability. Every field is length-prefixed (`<utf8 bytes>:<value>`),
|
|
62
|
+
* so a field's content can never forge a `|` boundary. Two versions:
|
|
63
|
+
*
|
|
64
|
+
* - `v1|id|exp|props|session|ttl` — the capability names only its region `id` (the wrapper that
|
|
65
|
+
* minted it: component ⊕ page-side schedule ⊕ the build's salt). Only a build that has that
|
|
66
|
+
* exact id can answer it. Minted before render identities (ogygia ≤ 0.8.6); still verified, so
|
|
67
|
+
* pages cached before an upgrade keep their holes.
|
|
68
|
+
* - `v2|id|exp|props|session|ttl|render` — the same five, plus the region's render identity (the
|
|
69
|
+
* URL's `r`: the component the endpoint renders, compiler/region/identity.ts `renderId`). Signing
|
|
70
|
+
* it lets a build that no longer has `id` (another schedule, preset or salt) answer the
|
|
71
|
+
* capability with its own entry for that component, and only for that component. Every current
|
|
72
|
+
* mint is `v2`.
|
|
73
|
+
*
|
|
74
|
+
* The version follows from the URL: a capability with `r` is checked as `v2`, one without as `v1`.
|
|
75
|
+
* A `v2` MAC never verifies as `v1` (the prefix and the field count differ), so stripping `r` or
|
|
76
|
+
* swapping it for another component breaks the signature. Empty `session`/`ttl` are still fields
|
|
77
|
+
* (prerender / unbound / no-store) — never optional concat. `ttl` is the response cache max-age in
|
|
78
|
+
* seconds (`''` = no-store); signing it keeps a harvested URL from being re-pointed at a longer
|
|
79
|
+
* browser cache.
|
|
80
|
+
*/
|
|
81
|
+
static region_message(id, exp, props, session = "", ttl = "", render = "") {
|
|
82
|
+
const v1 = `${lp(String(id))}|${lp(String(exp))}|${lp(String(props))}|${lp(String(session))}|${lp(String(ttl))}`;
|
|
83
|
+
return render === "" ? `v1|${v1}` : `v2|${v1}|${lp(String(render))}`;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
const sign = Hmac.sign.bind(Hmac);
|
|
87
|
+
const verify = Hmac.verify.bind(Hmac);
|
|
88
|
+
const region_mac_message = Hmac.region_message.bind(Hmac);
|
|
89
|
+
export { Hmac, MIN_SECRET_BYTES, derive_id_salt, derive_mac_key, region_mac_message, secret_has_min_entropy, sign, verify };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** What the answer carries of the render's head: its islands' graph and their CSS ('' for none). */
|
|
2
|
+
export declare function hole_head(head: string, base: URL | undefined): string;
|
|
3
|
+
/** Every region-CSS tag in the head, as written (`<link … data-ogygia-region-css>` or
|
|
4
|
+
* `<style data-ogygia-region-css="…">…</style>`). */
|
|
5
|
+
export declare function head_region_css(head: string): string;
|
|
6
|
+
/** One graph script for the answer (or '' when the render's head carries none). */
|
|
7
|
+
export declare function hole_graph_script(head: string, base: URL): string;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ISLAND_GRAPH_ATTR, decode_island_graph, decode_island_locations } from "../island-graph.js";
|
|
2
|
+
import { island_graph_script } from "./document-tail.js";
|
|
3
|
+
// src/server/hole-graph.ts
|
|
4
|
+
/**
|
|
5
|
+
* WHAT A HOLE'S HEAD CARRIES INTO ITS ANSWER. A hole renders on its own, and the endpoint ships only
|
|
6
|
+
* the body — but the islands inside it write into the render's head what the page needs of them:
|
|
7
|
+
*
|
|
8
|
+
* - their GRAPH (the chunks their code needs — island-graph.ts). Without it the islands a hole brings
|
|
9
|
+
* loaded in a waterfall: each chunk discovered only after the last one parsed (+1.1 s at a 150 ms
|
|
10
|
+
* round trip, measured). Carried as one script; the runtime reads any graph script in the document
|
|
11
|
+
* (runtime/island-graph-preload.ts), so a nested island's wake preloads its whole graph at once.
|
|
12
|
+
* - their CSS (the `data-ogygia-region-css` tags Region.svelte writes for each island it renders: the
|
|
13
|
+
* island's own chunk CSS, exact — the bundler's, over what the island really imports). Without it
|
|
14
|
+
* an island in a hole had only the hole's own sheet, and whatever it rendered after the server
|
|
15
|
+
* render (a dropdown's contents, a branch behind a click) arrived unstyled. Carried as written; the
|
|
16
|
+
* runtime hoists these tags from an answer into `<head>` before the swap, deduped by href.
|
|
17
|
+
*
|
|
18
|
+
* URLs are made root-absolute (the graph here, the CSS tags by the answer's own absolutizing pass):
|
|
19
|
+
* the answer lands in a page at any depth, and a `./_app/…` resolved there would 404. indexOf only.
|
|
20
|
+
*/
|
|
21
|
+
function root_absolute(value, base) {
|
|
22
|
+
if (!value.startsWith("./") && !value.startsWith("../")) return value;
|
|
23
|
+
try {
|
|
24
|
+
const u = new URL(value, base);
|
|
25
|
+
return u.origin === base.origin ? u.pathname + u.search + u.hash : value;
|
|
26
|
+
} catch {
|
|
27
|
+
return value;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/** What the answer carries of the render's head: its islands' graph and their CSS ('' for none). */
|
|
31
|
+
function hole_head(head, base) {
|
|
32
|
+
return (base ? hole_graph_script(head, base) : "") + head_region_css(head);
|
|
33
|
+
}
|
|
34
|
+
const REGION_CSS_ATTR = "data-ogygia-region-css";
|
|
35
|
+
/** Every region-CSS tag in the head, as written (`<link … data-ogygia-region-css>` or
|
|
36
|
+
* `<style data-ogygia-region-css="…">…</style>`). */
|
|
37
|
+
function head_region_css(head) {
|
|
38
|
+
let out = "";
|
|
39
|
+
for (let at = head.indexOf(REGION_CSS_ATTR); at !== -1; at = head.indexOf(REGION_CSS_ATTR, at + 1)) {
|
|
40
|
+
const start = head.lastIndexOf("<", at);
|
|
41
|
+
if (start === -1) continue;
|
|
42
|
+
const is_style = head.startsWith("<style", start);
|
|
43
|
+
const end = is_style ? head.indexOf("</style>", at) : head.indexOf(">", at);
|
|
44
|
+
if (end === -1) break;
|
|
45
|
+
const stop = is_style ? end + 8 : end + 1;
|
|
46
|
+
out += head.slice(start, stop);
|
|
47
|
+
at = stop - 1;
|
|
48
|
+
}
|
|
49
|
+
return out;
|
|
50
|
+
}
|
|
51
|
+
/** One graph script for the answer (or '' when the render's head carries none). */
|
|
52
|
+
function hole_graph_script(head, base) {
|
|
53
|
+
let at = head.indexOf(ISLAND_GRAPH_ATTR);
|
|
54
|
+
if (at === -1) return "";
|
|
55
|
+
const graph = /* @__PURE__ */ new Map();
|
|
56
|
+
const locations = /* @__PURE__ */ new Map();
|
|
57
|
+
for (; at !== -1; at = head.indexOf(ISLAND_GRAPH_ATTR, at + ISLAND_GRAPH_ATTR.length)) {
|
|
58
|
+
const open = head.indexOf(">", at);
|
|
59
|
+
const close = open === -1 ? -1 : head.indexOf("<\/script", open);
|
|
60
|
+
if (close === -1) break;
|
|
61
|
+
const text = head.slice(open + 1, close);
|
|
62
|
+
for (const [entry, hrefs] of decode_island_graph(text)) {
|
|
63
|
+
const key = root_absolute(entry, base);
|
|
64
|
+
if (!graph.has(key)) graph.set(key, hrefs.map((h) => root_absolute(h, base)));
|
|
65
|
+
}
|
|
66
|
+
for (const [entry, src] of decode_island_locations(text)) locations.set(root_absolute(entry, base), root_absolute(src, base));
|
|
67
|
+
at = close;
|
|
68
|
+
}
|
|
69
|
+
return island_graph_script(graph, locations);
|
|
70
|
+
}
|
|
71
|
+
export { head_region_css, hole_graph_script, hole_head };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { escape_amp } from "../escape.js";
|
|
2
|
+
// src/server/hole-urls.ts
|
|
3
|
+
/**
|
|
4
|
+
* Absolute URLs inside a hole's HTML.
|
|
5
|
+
*
|
|
6
|
+
* A server island renders in its OWN request — `/__ogygia__?…` — and Kit's `asset()` (with the
|
|
7
|
+
* default `paths.relative`) emits every URL relative to THAT request: `./_app/immutable/x.js`,
|
|
8
|
+
* `./__ogygia__?…`. The HTML then lands in a page at any depth (`/docs/guides/`), and a
|
|
9
|
+
* region entry / nested-hole endpoint / region-css link inside it would resolve against the page:
|
|
10
|
+
* `/docs/guides/_app/…` → 404, a dead island in a live hole. The batch parcel and an
|
|
11
|
+
* ESI-stitched hole (the CDN splices the bytes straight into the page) have the same problem, so
|
|
12
|
+
* the fix is on the server, once, at the point the response is assembled: resolve every relative
|
|
13
|
+
* ogygia URL against the endpoint request URL and emit it root-absolute (Kit `base` included).
|
|
14
|
+
* Absolute (`/…`) and scheme'd (foreign federation entries) values are left alone.
|
|
15
|
+
*/
|
|
16
|
+
const REGION_CSS_ATTR = "data-ogygia-region-css";
|
|
17
|
+
function is_word(c) {
|
|
18
|
+
return c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122 || c === 95;
|
|
19
|
+
}
|
|
20
|
+
function resolve_attr(value, base) {
|
|
21
|
+
if (!value || !(value.startsWith("./") || value.startsWith("../"))) return value;
|
|
22
|
+
let resolved;
|
|
23
|
+
try {
|
|
24
|
+
resolved = new URL(value.indexOf("&") === -1 ? value : value.replaceAll("&", "&"), base);
|
|
25
|
+
} catch {
|
|
26
|
+
return value;
|
|
27
|
+
}
|
|
28
|
+
if (resolved.origin !== base.origin) return value;
|
|
29
|
+
return escape_amp(resolved.pathname + resolved.search + resolved.hash);
|
|
30
|
+
}
|
|
31
|
+
/** Rewrite `name="…"` in `tag` (a word boundary before `name`; every occurrence, or the first). */
|
|
32
|
+
function rewrite_attr(tag, name, base, all) {
|
|
33
|
+
const needle = name + "=\"";
|
|
34
|
+
let out = "";
|
|
35
|
+
let pos = 0;
|
|
36
|
+
for (let at = tag.indexOf(needle); at !== -1; at = tag.indexOf(needle, at + needle.length)) {
|
|
37
|
+
if (at > 0 && is_word(tag.charCodeAt(at - 1))) continue;
|
|
38
|
+
const start = at + needle.length;
|
|
39
|
+
const end = tag.indexOf("\"", start);
|
|
40
|
+
if (end === -1) break;
|
|
41
|
+
out += tag.slice(pos, start) + resolve_attr(tag.slice(start, end), base);
|
|
42
|
+
pos = end;
|
|
43
|
+
if (!all) break;
|
|
44
|
+
}
|
|
45
|
+
return pos === 0 ? tag : out + tag.slice(pos);
|
|
46
|
+
}
|
|
47
|
+
/** Does a tag named `name` open at `lt` (`<name` then a non-word character)? */
|
|
48
|
+
function opens(html, lt, name) {
|
|
49
|
+
return html.startsWith(name, lt + 1) && !is_word(html.charCodeAt(lt + 1 + name.length));
|
|
50
|
+
}
|
|
51
|
+
/** Rewrite the relative `entry` / `src` / `endpoint` / region-css `href` values in `html` to root-absolute
|
|
52
|
+
* paths resolved against `base` (the endpoint request URL). */
|
|
53
|
+
function absolutize_hole_html(html, base) {
|
|
54
|
+
if (!html.includes("<ogygia-region") && !html.includes(REGION_CSS_ATTR)) return html;
|
|
55
|
+
let out = "";
|
|
56
|
+
let pos = 0;
|
|
57
|
+
for (let lt = html.indexOf("<"); lt !== -1; lt = html.indexOf("<", lt + 1)) {
|
|
58
|
+
const region = opens(html, lt, "ogygia-region");
|
|
59
|
+
const link = !region && opens(html, lt, "link");
|
|
60
|
+
const style = !region && !link && opens(html, lt, "style");
|
|
61
|
+
if (!region && !link && !style) continue;
|
|
62
|
+
const gt = html.indexOf(">", lt);
|
|
63
|
+
if (gt === -1) break;
|
|
64
|
+
const tag = html.slice(lt, gt + 1);
|
|
65
|
+
let next = tag;
|
|
66
|
+
if (region) next = rewrite_attr(rewrite_attr(rewrite_attr(tag, "entry", base, true), "src", base, true), "endpoint", base, true);
|
|
67
|
+
else if (tag.indexOf(REGION_CSS_ATTR) !== -1) next = link ? rewrite_attr(tag, "href", base, false) : tag.indexOf(REGION_CSS_ATTR + "=\"") !== -1 ? rewrite_attr(tag, REGION_CSS_ATTR, base, false) : tag;
|
|
68
|
+
if (next !== tag) {
|
|
69
|
+
out += html.slice(pos, lt) + next;
|
|
70
|
+
pos = gt + 1;
|
|
71
|
+
}
|
|
72
|
+
lt = gt;
|
|
73
|
+
}
|
|
74
|
+
return pos === 0 ? html : out + html.slice(pos);
|
|
75
|
+
}
|
|
76
|
+
export { absolutize_hole_html };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Small hand-written scans shared by the server's per-request HTML work, each kept only where it
|
|
3
|
+
* MEASURED faster (or allocation-lighter) than the regex it replaced — the engine's compiled
|
|
4
|
+
* matcher wins plain presence tests, so those stayed regexes (head-presence.ts).
|
|
5
|
+
*/
|
|
6
|
+
/** `[A-Za-z0-9_]` — the regex `\w` (NaN, past the end, is not). */
|
|
7
|
+
export declare function is_word(c: number): boolean;
|
|
8
|
+
/** The regex `\s`: ASCII whitespace and the Unicode spaces (NaN, past the end, is not). */
|
|
9
|
+
export declare function is_space(c: number): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Every region-CSS tag in `head`, in order, joined: the `<link … data-ogygia-region-css>` form AND the
|
|
12
|
+
* inline `<style data-ogygia-region-css="href">…</style>` form a sheet under Kit's
|
|
13
|
+
* `inlineStyleThreshold` takes. What an isolated render (a held region's body) must carry forward
|
|
14
|
+
* from its head: keeping links only silently unstyled every small sheet.
|
|
15
|
+
*/
|
|
16
|
+
export declare function region_css_tags(head: string): string;
|
|
17
|
+
/** Every `<link …data-ogygia-region-css…>` tag in `head`, in order, joined — what
|
|
18
|
+
* `head.match(/<link\b[^>]*data-ogygia-region-css[^>]*>/g).join('')` returned. */
|
|
19
|
+
export declare function region_css_links(head: string): string;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// src/server/html-scan.ts
|
|
2
|
+
/**
|
|
3
|
+
* Small hand-written scans shared by the server's per-request HTML work, each kept only where it
|
|
4
|
+
* MEASURED faster (or allocation-lighter) than the regex it replaced — the engine's compiled
|
|
5
|
+
* matcher wins plain presence tests, so those stayed regexes (head-presence.ts).
|
|
6
|
+
*/
|
|
7
|
+
/** `[A-Za-z0-9_]` — the regex `\w` (NaN, past the end, is not). */
|
|
8
|
+
function is_word(c) {
|
|
9
|
+
return c >= 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57 || c === 95;
|
|
10
|
+
}
|
|
11
|
+
/** The regex `\s`: ASCII whitespace and the Unicode spaces (NaN, past the end, is not). */
|
|
12
|
+
function is_space(c) {
|
|
13
|
+
if (c <= 32) return c === 32 || c >= 9 && c <= 13;
|
|
14
|
+
if (c < 160) return false;
|
|
15
|
+
return c === 160 || c === 5760 || c >= 8192 && c <= 8202 || c === 8232 || c === 8233 || c === 8239 || c === 8287 || c === 12288 || c === 65279;
|
|
16
|
+
}
|
|
17
|
+
const REGION_CSS_ATTR = "data-ogygia-region-css";
|
|
18
|
+
/**
|
|
19
|
+
* Every region-CSS tag in `head`, in order, joined: the `<link … data-ogygia-region-css>` form AND the
|
|
20
|
+
* inline `<style data-ogygia-region-css="href">…</style>` form a sheet under Kit's
|
|
21
|
+
* `inlineStyleThreshold` takes. What an isolated render (a held region's body) must carry forward
|
|
22
|
+
* from its head: keeping links only silently unstyled every small sheet.
|
|
23
|
+
*/
|
|
24
|
+
function region_css_tags(head) {
|
|
25
|
+
let out = "";
|
|
26
|
+
for (let attr = head.indexOf(REGION_CSS_ATTR); attr !== -1; attr = head.indexOf(REGION_CSS_ATTR, attr + 1)) {
|
|
27
|
+
const open = head.lastIndexOf("<", attr);
|
|
28
|
+
if (open === -1) continue;
|
|
29
|
+
if (head.startsWith("<link", open) && !is_word(head.charCodeAt(open + 5))) {
|
|
30
|
+
const end = head.indexOf(">", attr);
|
|
31
|
+
if (end === -1) break;
|
|
32
|
+
out += head.slice(open, end + 1);
|
|
33
|
+
attr = end;
|
|
34
|
+
} else if (head.startsWith("<style", open) && !is_word(head.charCodeAt(open + 6))) {
|
|
35
|
+
const close = head.indexOf("</style>", attr);
|
|
36
|
+
if (close === -1) break;
|
|
37
|
+
out += head.slice(open, close + 8);
|
|
38
|
+
attr = close + 7;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return out;
|
|
42
|
+
}
|
|
43
|
+
/** Every `<link …data-ogygia-region-css…>` tag in `head`, in order, joined — what
|
|
44
|
+
* `head.match(/<link\b[^>]*data-ogygia-region-css[^>]*>/g).join('')` returned. */
|
|
45
|
+
function region_css_links(head) {
|
|
46
|
+
let out = "";
|
|
47
|
+
let attr = head.indexOf("data-ogygia-region-css");
|
|
48
|
+
if (attr === -1) return "";
|
|
49
|
+
for (let at = head.indexOf("<link"); at !== -1; at = head.indexOf("<link", at + 5)) {
|
|
50
|
+
if (is_word(head.charCodeAt(at + 5))) continue;
|
|
51
|
+
const end = head.indexOf(">", at);
|
|
52
|
+
if (end === -1) break;
|
|
53
|
+
if (attr < at) attr = head.indexOf("data-ogygia-region-css", at);
|
|
54
|
+
if (attr === -1) break;
|
|
55
|
+
if (attr < end) out += head.slice(at, end + 1);
|
|
56
|
+
at = end - 4;
|
|
57
|
+
}
|
|
58
|
+
return out;
|
|
59
|
+
}
|
|
60
|
+
export { is_space, is_word, region_css_links, region_css_tags };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kit's request context for ogygia's OWN server render roots.
|
|
3
|
+
*
|
|
4
|
+
* Kit's server `$app/state` answers `page.*` from `getContext('__request__').page` — a Svelte
|
|
5
|
+
* context Kit's page render sets on ITS root. Every `svelte/server` `render()` ogygia starts is a
|
|
6
|
+
* fresh root with no such context: the routeless document (`document()`), the inline island render
|
|
7
|
+
* (`region.ts`), the deferred-region endpoint, snippet bodies. A component reading `page.data`
|
|
8
|
+
* during SSR under any of them crashed with "reading 'page' of undefined". Every such root now
|
|
9
|
+
* passes `kit_render_context()`, which rebuilds Kit's shape from the per-request page snapshot
|
|
10
|
+
* (Region.svelte records it; the handle keeps it in the request bag) or, absent that, from the
|
|
11
|
+
* live request via the reader hooks.ts installs.
|
|
12
|
+
*
|
|
13
|
+
* Isomorphic and dependency-free by design: `region.ts` is in the client graph, so nothing here may
|
|
14
|
+
* import Kit's server internals. The reader rides ONE `globalThis` + `Symbol.for` slot — the
|
|
15
|
+
* PAGE-STATE-SINGLETON law (dist entries can double-evaluate a module).
|
|
16
|
+
*/
|
|
17
|
+
export declare const KIT_REQUEST_CONTEXT = "__request__";
|
|
18
|
+
/** Kit's `$app/stores` server side reads `getContext('__svelte__')` — `{ page, navigating, updated }`
|
|
19
|
+
* stores Kit's page render sets on ITS root (`render.js`). Same gap as `__request__`: a component
|
|
20
|
+
* using the (deprecated, still everywhere) `$page` store crashed under every ogygia render root. */
|
|
21
|
+
export declare const KIT_STORES_CONTEXT = "__svelte__";
|
|
22
|
+
/** Kit's `props.page` shape (what `$app/state`'s server getters read). */
|
|
23
|
+
export interface KitPage {
|
|
24
|
+
url: URL | undefined;
|
|
25
|
+
params: Record<string, string | undefined>;
|
|
26
|
+
route: {
|
|
27
|
+
id: string | null;
|
|
28
|
+
};
|
|
29
|
+
status: number;
|
|
30
|
+
data: unknown;
|
|
31
|
+
form: unknown;
|
|
32
|
+
error: unknown;
|
|
33
|
+
state: Record<string, unknown>;
|
|
34
|
+
}
|
|
35
|
+
type Reader = () => KitPage | null;
|
|
36
|
+
type EventReader = () => unknown | null;
|
|
37
|
+
/** THE PAGE OF A RENDER, as a render root uses it (server/render-page.ts behind it). */
|
|
38
|
+
interface RenderPagePort {
|
|
39
|
+
/** Before the root renders: its page ready for the reader. `reads_data` — `true`: this render
|
|
40
|
+
* reads `page.data`; `false`: it does not; `null`: unknown here (the request's kind decides). */
|
|
41
|
+
ready(reads_data: boolean | null): Promise<void> | void;
|
|
42
|
+
/** After it rendered: what its answer carries of the page it rendered for (`''`: nothing). */
|
|
43
|
+
tail(): string;
|
|
44
|
+
/** A hole minted in this render: the address part naming the page facts it renders from
|
|
45
|
+
* (`&pv=…`), `''` for a hole whose tree reads no `page.data`. */
|
|
46
|
+
version(hole_id: string): string;
|
|
47
|
+
}
|
|
48
|
+
/** hooks.ts installs the request-scoped reader (page snapshot + live event). */
|
|
49
|
+
export declare function set_kit_page_reader(fn: Reader | null): void;
|
|
50
|
+
/** hooks.ts installs the live `RequestEvent` reader — what `requestEvent()` (public, isomorphic)
|
|
51
|
+
* hands a server island: `locals`, `cookies`, `url`, `request` of the request rendering it. */
|
|
52
|
+
export declare function set_kit_event_reader(fn: EventReader | null): void;
|
|
53
|
+
/** hooks.ts installs the render-page port: in a request rendering for a page it is not (a hole, a
|
|
54
|
+
* remote call), that page is looked up once (server/page-facts.ts) so the reader answers from it,
|
|
55
|
+
* and an answer carries the facts its islands read. */
|
|
56
|
+
export declare function set_render_page_port(port: RenderPagePort | null): void;
|
|
57
|
+
/**
|
|
58
|
+
* Await before an async render root starts: the page this render belongs to, ready for the reader.
|
|
59
|
+
* Inside a page request, on the client, or for a render that reads no `page.data`: nothing to wait for
|
|
60
|
+
* (`undefined`, no microtask).
|
|
61
|
+
*/
|
|
62
|
+
export declare function kit_page_ready(reads_data?: boolean | null): Promise<void> | void;
|
|
63
|
+
/** Append to a render root's HTML: the page facts its islands read, when it rendered for a page. */
|
|
64
|
+
export declare function kit_page_facts_tail(): string;
|
|
65
|
+
/** Append to a minted hole endpoint: its page version (server/render-page.ts), or `''`. */
|
|
66
|
+
export declare function kit_page_version(hole_id: string): string;
|
|
67
|
+
/** The live event the installed reader answers (null off-request / on the client). */
|
|
68
|
+
export declare function kit_request_event(): unknown | null;
|
|
69
|
+
/** A page no component can crash on: what a render outside any request sees (tests, tools). */
|
|
70
|
+
export declare function empty_kit_page(): KitPage;
|
|
71
|
+
/** The `context` option for a `svelte/server` `render()` ogygia starts. An explicit `page` (the
|
|
72
|
+
* document root, built from the router's seed) wins; else the request reader; else empty. Both
|
|
73
|
+
* of Kit's contexts ride along: `__request__` for `$app/state`, `__svelte__` for `$app/stores`.
|
|
74
|
+
* The `__request__` entry also carries the live `event` (Kit's own render sets `{ page }` only)
|
|
75
|
+
* — the channel `requestEvent()` reads, so a server island can see its request without importing
|
|
76
|
+
* `$app/server` (which Kit's client guard rejects the moment a csr=true page shares the layout). */
|
|
77
|
+
export declare function kit_render_context(page?: KitPage, event?: unknown): Map<string, unknown>;
|
|
78
|
+
export {};
|