@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,389 @@
1
+ /**
2
+ * Devtools event schema v1 — the UI-agnostic wire vocabulary the whole Observatory rides on
3
+ * (internal/notes/devtools.md, Rung 0). Every event is JSON-serializable and keyed on the
4
+ * identities the framework already mints — region fingerprints (`data-og-fp`), island entry ids,
5
+ * hub Ref ids — so a region's compile, server render, wire payload, client wake, and nav-reconcile
6
+ * decision CORRELATE by id with zero new identity machinery. That is what turns a log into a story.
7
+ *
8
+ * Laws (from the note):
9
+ * - **Versioned from day one.** `DEVTOOLS_SCHEMA_VERSION` is stamped on every event; the trace
10
+ * format is a public artifact eventually, so a consumer can refuse a version it doesn't know.
11
+ * - **Sizes always, payload bodies lazy.** Events carry byte COUNTS (cheap — a length already in
12
+ * hand), never the bytes themselves. A sink that wants the body subscribes to the DOM/network.
13
+ * - **Don't invent events the code can't cheaply produce.** Every name below maps to a real seam
14
+ * (see the per-domain comments); nothing here needs an extra serialization pass to emit.
15
+ *
16
+ * Naming: internal, so snake_case is the house style — but these strings travel on the wire and name
17
+ * user-facing instruments, so event NAMES use the `domain.thing.verb` dotted form (stable ids), while
18
+ * the TS field names stay terse. Domains mirror the note's Schema-v1 table.
19
+ */
20
+ /** Bump only on a breaking shape change; a trace stamps this so a reader can gate on it. */
21
+ export declare const DEVTOOLS_SCHEMA_VERSION = 1;
22
+ /** The six event domains (note's Schema-v1 table). */
23
+ export type DevtoolsDomain = "compile" | "server" | "wire" | "runtime" | "hub" | "nav";
24
+ /** Fields the bus stamps on EVERY event — the caller never sets these. */
25
+ export interface DevtoolsEnvelope {
26
+ /** Schema version ({@link DEVTOOLS_SCHEMA_VERSION}) — copied onto every event for trace gating. */
27
+ v: number;
28
+ /** Monotonic per-session sequence number (ordering that survives equal timestamps). */
29
+ seq: number;
30
+ /** Timestamp: `performance.now()` (ms, sub-ms precision) when available, else `Date.now()`. */
31
+ t: number;
32
+ /** Which realm emitted it — a trace merges client + server streams, so it must be labelled. */
33
+ realm: "client" | "server";
34
+ }
35
+ /** What a call site passes to `emit` — the envelope is added by the bus. */
36
+ export type DevtoolsEventInput = CompileEventInput | ServerEventInput | WireEventInput | RuntimeEventInput | HubEventInput | NavEventInput;
37
+ /** A fully-stamped event as it sits in the ring buffer / trace / on a sink. */
38
+ export type DevtoolsEvent = DevtoolsEventInput & DevtoolsEnvelope;
39
+ export type CompileEventInput = {
40
+ domain: "compile";
41
+ name: "compile.island.discovered";
42
+ /** Region identity (the transform's stable id / iid). */
43
+ iid: string;
44
+ /** Client entry chunk specifier (`entry="…"`). */
45
+ entry?: string;
46
+ /** The two-dial strategy key (`render`+`wake`), e.g. `island:load`, `defer:visible`, `lake`. */
47
+ strategy: string;
48
+ /** csr decision at discovery: does this host ship the ogygia runtime at all. */
49
+ csr: boolean;
50
+ } | {
51
+ domain: "compile";
52
+ name: "compile.chunk.emitted";
53
+ /** Deduped wrapper/entry chunk filename. */
54
+ entry: string;
55
+ /** Emitted source size (bytes) — a length already in hand at emit. */
56
+ bytes: number;
57
+ };
58
+ export type ServerEventInput = {
59
+ domain: "server";
60
+ name: "server.region.rendered";
61
+ /** `data-og-fp` — the exact key the client wake / reconcile correlate on. */
62
+ fp: string;
63
+ /** island | server | lake | held-inline | held-defer | held-live. */
64
+ mode: string;
65
+ entry?: string;
66
+ /** Rendered HTML size (bytes). */
67
+ htmlBytes?: number;
68
+ /** devalue props sidecar size (bytes). */
69
+ propsBytes?: number;
70
+ /** Wall-clock ms for the component's server render, when measured. */
71
+ ms?: number;
72
+ } | {
73
+ domain: "server";
74
+ name: "server.capability.minted";
75
+ /** Signed hole id. */
76
+ id: string;
77
+ /** Capability TTL (seconds). */
78
+ ttl?: number;
79
+ } | {
80
+ domain: "server";
81
+ name: "server.delta.skip";
82
+ /** A region the client already has live (`x-ogygia-known`) — server SKIPPED re-rendering it. */
83
+ fp: string;
84
+ } | {
85
+ domain: "server";
86
+ name: "server.seed.injected";
87
+ /** page | remote — which document side-channel seed the handle wrote. */
88
+ kind: "page" | "remote";
89
+ bytes: number;
90
+ } | {
91
+ domain: "server";
92
+ name: "server.postrender";
93
+ /** hit | join | stored | skip | invalidate | invalidate-where | self-evict. */
94
+ op: string;
95
+ /** Store key (URL pathname), or the prefix for the bulk op. */
96
+ url?: string;
97
+ /** Named refusal for `skip` — the same string the dev note prints. */
98
+ reason?: string;
99
+ /** Stored html size (bytes) for `stored`. */
100
+ bytes?: number;
101
+ };
102
+ export type WireEventInput = {
103
+ domain: "wire";
104
+ name: "wire.props";
105
+ entry?: string;
106
+ /** devalue payload size (bytes). */
107
+ bytes: number;
108
+ } | {
109
+ domain: "wire";
110
+ name: "wire.context";
111
+ bytes: number;
112
+ } | {
113
+ domain: "wire";
114
+ name: "wire.frame.batch";
115
+ /** Regions in the single-flight parcel. */
116
+ count: number;
117
+ bytes?: number;
118
+ } | {
119
+ domain: "wire";
120
+ name: "wire.known.sent";
121
+ /** Fingerprints the client claimed via `x-ogygia-known`. */
122
+ count: number;
123
+ bytes: number;
124
+ };
125
+ export type RuntimeEventInput = {
126
+ domain: "runtime";
127
+ name: "runtime.boot";
128
+ /** Feature installers that ran (router, lakes, live, interaction, …). */
129
+ features: string[];
130
+ } | {
131
+ domain: "runtime";
132
+ name: "region.connected";
133
+ entry?: string;
134
+ fp?: string;
135
+ /** wake attribute (load | idle | visible | interaction | media | none). */
136
+ wake?: string;
137
+ /** True for a `render="defer"` hole (HTML fetched, not inline). */
138
+ deferred: boolean;
139
+ /** True when this region rides an awake ancestor (nested — self-run skipped). */
140
+ nested: boolean;
141
+ } | {
142
+ domain: "runtime";
143
+ name: "wake.scheduled";
144
+ entry?: string;
145
+ fp?: string;
146
+ /** The schedule armed (load | idle | visible | interaction | media). */
147
+ when: string;
148
+ } | {
149
+ domain: "runtime";
150
+ name: "wake.fired";
151
+ entry?: string;
152
+ fp?: string;
153
+ when: string;
154
+ } | {
155
+ domain: "runtime";
156
+ /** A deferred hole's `prefetch` schedule fired: its HTML is being warmed into the frame
157
+ * store ahead of its `when` (no swap yet — the wake joins this frame later). */
158
+ name: "region.prefetch";
159
+ entry?: string;
160
+ fp?: string;
161
+ } | {
162
+ domain: "runtime";
163
+ name: "region.hydrate.start";
164
+ entry?: string;
165
+ fp?: string;
166
+ } | {
167
+ domain: "runtime";
168
+ name: "region.hydrate.done";
169
+ entry?: string;
170
+ fp?: string;
171
+ /** Wall-clock ms from hydrate start to mounted: its `$effect`s and onMount included (they
172
+ * run in a microtask after Svelte's `hydrate()`; the event is sent after them). */
173
+ ms: number;
174
+ } | {
175
+ domain: "runtime";
176
+ name: "region.hydrate.failed";
177
+ entry?: string;
178
+ fp?: string;
179
+ message: string;
180
+ } | {
181
+ domain: "runtime";
182
+ /** Svelte's silent mismatch RECOVERY discarded this region's entire server DOM and
183
+ * re-rendered it client-side — something mutated the region between SSR and wake
184
+ * (post-SSR transform, A/B tool, DSD injector). See internal/notes/foreign-dom.md. */
185
+ name: "region.hydrate.recovered";
186
+ entry?: string;
187
+ fp?: string;
188
+ /** The specific first divergence between the server markup and the mutated live DOM (e.g.
189
+ * "an injected <style>", "scoped web-component hydration marks", "whitespace stripped") —
190
+ * the WHY, when the runtime could name it. Absent when the recovery had no sequence drift
191
+ * the walk sees. */
192
+ reason?: string;
193
+ } | {
194
+ domain: "runtime";
195
+ /** The island's live DOM had drifted from its server markup while it slept (another
196
+ * script edited it); the runtime put the server markup back and hydrated THAT instead of
197
+ * letting Svelte re-render the island client-side. */
198
+ name: "region.hydrate.healed";
199
+ entry?: string;
200
+ fp?: string;
201
+ /** The first divergence the runtime repaired — same "why" as the recovered event. */
202
+ reason?: string;
203
+ } | {
204
+ domain: "runtime";
205
+ /** A download ogygia started on its own left the load scheduler's queue
206
+ * (runtime/load-scheduler.ts): its class, what it fetches, and how long it waited for its
207
+ * slot (the page's critical resources, the background window). */
208
+ name: "load.started";
209
+ class: "user" | "visible" | "ahead" | "speculative";
210
+ kind: "code" | "content";
211
+ label?: string;
212
+ waited_ms: number;
213
+ } | {
214
+ domain: "runtime";
215
+ /** The load scheduler stopped waiting for the page's critical resources (the images and
216
+ * preloads marked `fetchpriority="high"`): they `arrived`, the visitor's first `input`, the
217
+ * `cap` ran out, or `none` were pending. */
218
+ name: "load.critical";
219
+ outcome: "arrived" | "input" | "cap" | "none";
220
+ resources: number;
221
+ waited_ms: number;
222
+ } | {
223
+ domain: "runtime";
224
+ /** Two owners wanted the same nodes (runtime/ownership.ts): a web component changed its own
225
+ * children in a position Svelte's hydration reads, and the repair removed what it added so
226
+ * the island could hydrate. `reason` names the element and the way out ({@html} / static
227
+ * markup / a lake / data-ogygia-keep). */
228
+ name: "region.hydrate.conflict";
229
+ entry?: string;
230
+ fp?: string;
231
+ reason?: string;
232
+ } | {
233
+ domain: "runtime";
234
+ /** Svelte's own dev warning that the server and the browser disagreed while hydrating
235
+ * (`hydration_html_changed`, `hydration_attribute_changed`, `hydration_mismatch`…) */
236
+ name: "svelte.hydration.warning";
237
+ /** Svelte's code, e.g. `hydration_html_changed` */
238
+ code: string;
239
+ message: string;
240
+ /** the component file the warning names, when it names one */
241
+ file?: string;
242
+ /** the island that was hydrating when it was raised */
243
+ fp?: string;
244
+ } | {
245
+ domain: "runtime";
246
+ name: "region.server.applied";
247
+ entry?: string;
248
+ endpoint?: string;
249
+ /** Fetched hole HTML size (bytes). */
250
+ bytes: number;
251
+ /** True for an SWR/live re-apply (not the first paint). */
252
+ revalidate: boolean;
253
+ /** The first answer: ms from the fetch's start to the swap (how long the fallback showed). */
254
+ wait_ms?: number;
255
+ } | {
256
+ /** Holes went out as ONE batch request (runtime/frame-nav.ts): the page's holes that
257
+ * started together, or a navigation's. One request, a part per hole as each renders. */
258
+ domain: "runtime";
259
+ name: "region.batch.sent";
260
+ /** this batch, on this page (its parts and its end carry it) */
261
+ batch: number;
262
+ /** `page`: holes that started together; `nav`: an in-app navigation's */
263
+ kind: "page" | "nav";
264
+ /** the holes' endpoints */
265
+ endpoints: string[];
266
+ } | {
267
+ /** One hole's answer landed out of its batch (when it rendered: out of order). */
268
+ domain: "runtime";
269
+ name: "region.batch.part";
270
+ batch: number;
271
+ endpoint: string;
272
+ } | {
273
+ /** A batch request ended. The holes it did not carry fetch on their own right after. */
274
+ domain: "runtime";
275
+ name: "region.batch.done";
276
+ batch: number;
277
+ sent: number;
278
+ /** holes whose answer it carried */
279
+ delivered: number;
280
+ /** the response's status (0: the request itself failed) */
281
+ status: number;
282
+ /** what answered, when it was not the batch: redirected to another URL, or a whole document */
283
+ refused?: "redirected" | "document";
284
+ final_url?: string;
285
+ } | {
286
+ /** A hole's answer did not arrive. Without this the page keeps the fallback and nothing
287
+ * anywhere says why (in a build the runtime is silent). */
288
+ domain: "runtime";
289
+ name: "region.server.failed";
290
+ entry?: string;
291
+ endpoint?: string;
292
+ /** refused: redirected / a whole document answered / the capability refused (403); error:
293
+ * the request failed */
294
+ reason: "redirected" | "document" | "forbidden" | "error";
295
+ /** what answered instead (a refused answer) */
296
+ final_url?: string;
297
+ /** the error's first line (a failed request), or the server's reason (a refused capability) */
298
+ message?: string;
299
+ /** this attempt (1-based) */
300
+ attempt: number;
301
+ /** no retry follows: the fallback stays */
302
+ final: boolean;
303
+ } | {
304
+ /** An island's LOCATION (its content-hashed file) failed to load, and it woke — or tried
305
+ * to — through its IDENTITY fetched fresh: the page's HTML came from a build whose files
306
+ * are gone (a cache outlived it). Its code is now the current build's. */
307
+ domain: "runtime";
308
+ name: "entry.fallback";
309
+ /** the identity (the stable URL) */
310
+ entry: string;
311
+ /** the location that failed */
312
+ src: string;
313
+ /** the fresh identity loaded (false: it failed too, the island stays asleep) */
314
+ recovered: boolean;
315
+ } | {
316
+ domain: "runtime";
317
+ name: "interaction.replay";
318
+ entry?: string;
319
+ fp?: string;
320
+ /** Queued clicks replayed after the wake. */
321
+ clicks: number;
322
+ /** Form fields whose typed value was restored. */
323
+ fields: number;
324
+ };
325
+ export type HubEventInput = {
326
+ domain: "hub";
327
+ name: "hub.mint";
328
+ /** Kind discriminator (wire | store | snippet | region | fn | …). */
329
+ kind: string;
330
+ /** Minted Ref id. */
331
+ id: string;
332
+ tag?: string;
333
+ } | {
334
+ domain: "hub";
335
+ name: "hub.resolve";
336
+ kind: string;
337
+ id: string;
338
+ scope: string;
339
+ /** Registration tag `<module>#<ExportName>` (wire classes) — the hub inspector's name. */
340
+ tag?: string;
341
+ /** True when an existing instance was reunited (memo hit), false on a fresh decode. */
342
+ hit: boolean;
343
+ } | {
344
+ domain: "hub";
345
+ name: "hub.dispose";
346
+ /** page | session | ids — which scope (or a selective id sweep) was torn down. */
347
+ scope: string;
348
+ /** Instances disposed. */
349
+ count: number;
350
+ };
351
+ export type NavEventInput = {
352
+ domain: "nav";
353
+ name: "nav.start";
354
+ from: string;
355
+ to: string;
356
+ /** link | goto | popstate | enter. */
357
+ type: string;
358
+ } | {
359
+ domain: "nav";
360
+ name: "nav.finish";
361
+ to: string;
362
+ /** Wall-clock ms from nav start to swap committed. */
363
+ ms: number;
364
+ /** True on the reconcile (in-place diff) path, false on the full-swap fallback. */
365
+ reconciled: boolean;
366
+ /** True when the swap ran inside a View Transition. */
367
+ vt: boolean;
368
+ } | {
369
+ domain: "nav";
370
+ name: "nav.reconcile";
371
+ /** The reconcile key: `k\0<keepName>` (keep marker) / `p\0<sig>` (persist) / `r\0<fp>` (props fp). */
372
+ key: string;
373
+ /** keep | patch | mount | remove — the per-region delta decision. */
374
+ decision: "keep" | "patch" | "mount" | "remove";
375
+ /** The region's `entry` module URL — lets the nav lab label the decision by component NAME. */
376
+ entry?: string;
377
+ /** The region's wake strategy, for the nav lab row. */
378
+ wake?: string;
379
+ } | {
380
+ domain: "nav";
381
+ name: "nav.batch";
382
+ /** Deferred holes single-flighted into one request. */
383
+ count: number;
384
+ } | {
385
+ domain: "nav";
386
+ name: "nav.fallback";
387
+ /** Why the reconcile path was skipped (shadow-dom / reconcile-off). */
388
+ reason: string;
389
+ };
@@ -0,0 +1,23 @@
1
+ // src/events/schema.ts
2
+ /**
3
+ * Devtools event schema v1 — the UI-agnostic wire vocabulary the whole Observatory rides on
4
+ * (internal/notes/devtools.md, Rung 0). Every event is JSON-serializable and keyed on the
5
+ * identities the framework already mints — region fingerprints (`data-og-fp`), island entry ids,
6
+ * hub Ref ids — so a region's compile, server render, wire payload, client wake, and nav-reconcile
7
+ * decision CORRELATE by id with zero new identity machinery. That is what turns a log into a story.
8
+ *
9
+ * Laws (from the note):
10
+ * - **Versioned from day one.** `DEVTOOLS_SCHEMA_VERSION` is stamped on every event; the trace
11
+ * format is a public artifact eventually, so a consumer can refuse a version it doesn't know.
12
+ * - **Sizes always, payload bodies lazy.** Events carry byte COUNTS (cheap — a length already in
13
+ * hand), never the bytes themselves. A sink that wants the body subscribes to the DOM/network.
14
+ * - **Don't invent events the code can't cheaply produce.** Every name below maps to a real seam
15
+ * (see the per-domain comments); nothing here needs an extra serialization pass to emit.
16
+ *
17
+ * Naming: internal, so snake_case is the house style — but these strings travel on the wire and name
18
+ * user-facing instruments, so event NAMES use the `domain.thing.verb` dotted form (stable ids), while
19
+ * the TS field names stay terse. Domains mirror the note's Schema-v1 table.
20
+ */
21
+ /** Bump only on a breaking shape change; a trace stamps this so a reader can gate on it. */
22
+ const DEVTOOLS_SCHEMA_VERSION = 1;
23
+ export { DEVTOOLS_SCHEMA_VERSION };
@@ -0,0 +1,7 @@
1
+ import { DevtoolsEventInput } from "./schema.js";
2
+ /** A recorder receives the un-stamped event input; hooks.ts stamps + buffers it per request. */
3
+ export type ServerDevtoolsRecorder = (input: DevtoolsEventInput) => void;
4
+ /** Server (`hooks.ts`) installs a request-scoped, ALS-backed recorder. Passing `null` clears it. */
5
+ export declare function set_server_devtools_recorder(fn: ServerDevtoolsRecorder | null): void;
6
+ /** SSR render seams call this; the client (recorder unset) is a no-op, and the whole call DCEs off. */
7
+ export declare function record_server_event(input: DevtoolsEventInput): void;
@@ -0,0 +1,13 @@
1
+ // src/events/server-registry.ts
2
+ const DEVTOOLS = typeof __OGYGIA_DEVTOOLS__ !== "undefined" ? __OGYGIA_DEVTOOLS__ : false;
3
+ let recorder = null;
4
+ /** Server (`hooks.ts`) installs a request-scoped, ALS-backed recorder. Passing `null` clears it. */
5
+ function set_server_devtools_recorder(fn) {
6
+ recorder = fn;
7
+ }
8
+ /** SSR render seams call this; the client (recorder unset) is a no-op, and the whole call DCEs off. */
9
+ function record_server_event(input) {
10
+ if (!DEVTOOLS) return;
11
+ recorder?.(input);
12
+ }
13
+ export { record_server_event, set_server_devtools_recorder };
@@ -0,0 +1,64 @@
1
+ import { DevtoolsEvent } from "./schema.js";
2
+ /** The global the {@link install_window_sink window sink} publishes. Distinct from the compile-time
3
+ * `__OGYGIA_DEVTOOLS__` define (a bare identifier the bundler replaces) — this is a real runtime
4
+ * object on `window`, read by Playwright `page.evaluate` across the script boundary. */
5
+ declare const WINDOW_HOOK = "__ogygia_devtools";
6
+ /** Shape of `window.__ogygia_devtools` (the e2e / instrument entry point). */
7
+ export interface DevtoolsWindowHook {
8
+ /** Schema version, so a reader can gate. */
9
+ version: number;
10
+ /** Every buffered event, oldest → newest (a fresh copy each call). */
11
+ events(): DevtoolsEvent[];
12
+ /** Subscribe to events from now on; returns an unsubscribe fn. */
13
+ on(cb: (event: DevtoolsEvent) => void): () => void;
14
+ /** Drop the buffer (between e2e scenarios). */
15
+ clear(): void;
16
+ /** Serialize the buffer to a portable trace. */
17
+ trace(): DevtoolsTrace;
18
+ }
19
+ declare global {
20
+ interface Window {
21
+ [WINDOW_HOOK]?: DevtoolsWindowHook;
22
+ }
23
+ }
24
+ /**
25
+ * Publish `window.__ogygia_devtools` so an out-of-page reader (Playwright, a devtools panel, a REPL
26
+ * host) can pull buffered events, subscribe to new ones, and drain a trace — WITHOUT importing any
27
+ * framework module. Idempotent. No-op off the browser. Returns the hook (or undefined on the server).
28
+ *
29
+ * This is what lets our e2e assert on the ISLAND LIFECYCLE directly ("interaction island fired its
30
+ * wake, replayed exactly one click") instead of polling the DOM behind a `waitForTimeout` — the
31
+ * bus pays for itself in our own tests first (the note's proof-of-value).
32
+ */
33
+ export declare function install_window_sink(): DevtoolsWindowHook | undefined;
34
+ /**
35
+ * Forward every event to a `postMessage` target (the REPL's tab ↔ worker ↔ iframe channel). Pass a
36
+ * `Worker` / `MessagePort` / `Window`; each event is posted as `{ __ogygia_devtools: event }`.
37
+ * Returns the unregister fn.
38
+ */
39
+ export declare function install_postmessage_sink(target: {
40
+ postMessage: (message: unknown) => void;
41
+ }): () => void;
42
+ /** Log every event to the console (debugging). `filter` limits by domain/name substring. */
43
+ export declare function install_console_sink(filter?: (event: DevtoolsEvent) => boolean): () => void;
44
+ /** A portable trace — a versioned bag of events, attachable to a bug report and replayable in the
45
+ * REPL later (the note's "CPU-profile energy, but for the islands lifecycle"). */
46
+ export interface DevtoolsTrace {
47
+ /** Marker so a consumer knows what it's holding. */
48
+ kind: "ogygia-devtools-trace";
49
+ /** {@link DEVTOOLS_SCHEMA_VERSION}. */
50
+ version: number;
51
+ /** Events in emission order. */
52
+ events: DevtoolsEvent[];
53
+ }
54
+ /** Serialize the current buffer into a {@link DevtoolsTrace}. */
55
+ export declare function to_trace(): DevtoolsTrace;
56
+ /**
57
+ * Read the server realm's `<script type="application/ogygia-devtools">` side-channel (injected by the
58
+ * handle on a devtools build) and INGEST its events into the unified stream, so a region's server
59
+ * render sits in the same `window.__ogygia_devtools` timeline as its client wake — correlated by
60
+ * fingerprint. Idempotent per document via a marker attribute; no-op off the browser or when the
61
+ * script is absent. Returns how many server events were ingested.
62
+ */
63
+ export declare function ingest_server_events(): number;
64
+ export {};
@@ -0,0 +1,85 @@
1
+ import { add_sink, clear, ingest, snapshot } from "./bus.js";
2
+ import "./schema.js";
3
+ // src/events/sinks.ts
4
+ /**
5
+ * Built-in sinks + the trace format (internal/notes/devtools.md, Rung 0). Each sink is a plain
6
+ * listener over {@link ./bus.js the bus}; none touches framework internals. Load only what you use —
7
+ * the REPL wants `postMessage`, our e2e wants the `window` hook, a bug report wants a trace.
8
+ */
9
+ /** The global the {@link install_window_sink window sink} publishes. Distinct from the compile-time
10
+ * `__OGYGIA_DEVTOOLS__` define (a bare identifier the bundler replaces) — this is a real runtime
11
+ * object on `window`, read by Playwright `page.evaluate` across the script boundary. */
12
+ const WINDOW_HOOK = "__ogygia_devtools";
13
+ /**
14
+ * Publish `window.__ogygia_devtools` so an out-of-page reader (Playwright, a devtools panel, a REPL
15
+ * host) can pull buffered events, subscribe to new ones, and drain a trace — WITHOUT importing any
16
+ * framework module. Idempotent. No-op off the browser. Returns the hook (or undefined on the server).
17
+ *
18
+ * This is what lets our e2e assert on the ISLAND LIFECYCLE directly ("interaction island fired its
19
+ * wake, replayed exactly one click") instead of polling the DOM behind a `waitForTimeout` — the
20
+ * bus pays for itself in our own tests first (the note's proof-of-value).
21
+ */
22
+ function install_window_sink() {
23
+ if (typeof window === "undefined") return void 0;
24
+ const existing = window[WINDOW_HOOK];
25
+ if (existing) return existing;
26
+ const hook = {
27
+ version: 1,
28
+ events: () => snapshot(),
29
+ on: (cb) => add_sink(cb),
30
+ clear: () => clear(),
31
+ trace: () => to_trace()
32
+ };
33
+ window[WINDOW_HOOK] = hook;
34
+ return hook;
35
+ }
36
+ /**
37
+ * Forward every event to a `postMessage` target (the REPL's tab ↔ worker ↔ iframe channel). Pass a
38
+ * `Worker` / `MessagePort` / `Window`; each event is posted as `{ __ogygia_devtools: event }`.
39
+ * Returns the unregister fn.
40
+ */
41
+ function install_postmessage_sink(target) {
42
+ const sink = (event) => target.postMessage({ [WINDOW_HOOK]: event });
43
+ return add_sink(sink);
44
+ }
45
+ /** Log every event to the console (debugging). `filter` limits by domain/name substring. */
46
+ function install_console_sink(filter) {
47
+ const sink = (event) => {
48
+ if (filter && !filter(event)) return;
49
+ console.debug(`[ogygia:dt] ${event.domain}.${event.name}`, event);
50
+ };
51
+ return add_sink(sink);
52
+ }
53
+ /** Serialize the current buffer into a {@link DevtoolsTrace}. */
54
+ function to_trace() {
55
+ return {
56
+ kind: "ogygia-devtools-trace",
57
+ version: 1,
58
+ events: snapshot()
59
+ };
60
+ }
61
+ /**
62
+ * Read the server realm's `<script type="application/ogygia-devtools">` side-channel (injected by the
63
+ * handle on a devtools build) and INGEST its events into the unified stream, so a region's server
64
+ * render sits in the same `window.__ogygia_devtools` timeline as its client wake — correlated by
65
+ * fingerprint. Idempotent per document via a marker attribute; no-op off the browser or when the
66
+ * script is absent. Returns how many server events were ingested.
67
+ */
68
+ function ingest_server_events() {
69
+ if (typeof document === "undefined") return 0;
70
+ let total = 0;
71
+ for (const el of document.querySelectorAll("script[type=\"application/ogygia-devtools\"]:not([data-og-dt-ingested])")) {
72
+ el.setAttribute("data-og-dt-ingested", "");
73
+ const text = el.textContent;
74
+ if (!text) continue;
75
+ try {
76
+ const events = JSON.parse(text);
77
+ if (Array.isArray(events) && events.length) {
78
+ ingest(events);
79
+ total += events.length;
80
+ }
81
+ } catch {}
82
+ }
83
+ return total;
84
+ }
85
+ export { ingest_server_events, install_console_sink, install_postmessage_sink, install_window_sink, to_trace };
@@ -0,0 +1,33 @@
1
+ /** Register a hoisted-function factory under its build tag (module path + export name).
2
+ * Called by the generated module; runs wherever that chunk loads (server AND island bundles). */
3
+ export declare function __register_fn(tag: string, factory: unknown): void;
4
+ /** Is this a transportable (og.$-branded) function? The drop-in setContext bridges these —
5
+ * the "functions never cross" law applies to BARE functions only. */
6
+ export declare function is_branded_fn(value: unknown): boolean;
7
+ /**
8
+ * The call-site rewrite target: build the LIVE function for this side (the factory's module is
9
+ * imported right there, so it is always registered) and brand it with its travel handle. The
10
+ * host renders with a real function; if it crosses a boundary, the brand is what travels.
11
+ */
12
+ export declare function fn_handle(tag: string, bound: unknown[]): (...args: unknown[]) => unknown;
13
+ /** The hub kind: a branded hoisted function. Bare functions are NEVER claimed (the snippet kind
14
+ * owns SSR-freezable snippets; an unmarked function at a boundary must keep failing loudly). */
15
+ export declare function register_fn_kind(): void;
16
+ /** Devalue reducer (legacy-shaped wrapper, mirrors the other kinds). */
17
+ export declare function reduce_fn(value: unknown): {
18
+ t: string;
19
+ i: string;
20
+ d: unknown;
21
+ } | undefined;
22
+ /** Devalue reviver. Functions never memoize; `remember` rides through for capture resolution. */
23
+ export declare function revive_fn(payload: {
24
+ t: string;
25
+ i: string;
26
+ d: unknown;
27
+ }, remember: boolean): unknown;
28
+ /**
29
+ * The `import.meta.og.$` rewrite target: register the hoisted factory (pull-registration —
30
+ * the call site IS the moment the code exists) and return the LIVE bound function, branded
31
+ * with its travel handle. One expression, no import-time side effects.
32
+ */
33
+ export declare function __og_$(tag: string, bound: unknown[], factory: (...b: unknown[]) => unknown): (...args: unknown[]) => unknown;