@ogygia/devtools 0.0.0 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (310) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +24 -1
  3. package/dist/client.d.ts +3 -0
  4. package/dist/client.js +24 -0
  5. package/dist/devtools/BoundaryOverlay.svelte +396 -0
  6. package/dist/devtools/BoundaryOverlay.svelte.d.ts +19 -0
  7. package/dist/devtools/Devtools.svelte +663 -0
  8. package/dist/devtools/Devtools.svelte.d.ts +15 -0
  9. package/dist/devtools/HubTab.svelte +206 -0
  10. package/dist/devtools/HubTab.svelte.d.ts +11 -0
  11. package/dist/devtools/HydrationTab.svelte +237 -0
  12. package/dist/devtools/HydrationTab.svelte.d.ts +13 -0
  13. package/dist/devtools/IslandDetail.svelte +615 -0
  14. package/dist/devtools/IslandDetail.svelte.d.ts +15 -0
  15. package/dist/devtools/LedgerTab.svelte +287 -0
  16. package/dist/devtools/LedgerTab.svelte.d.ts +11 -0
  17. package/dist/devtools/LensTab.svelte +290 -0
  18. package/dist/devtools/LensTab.svelte.d.ts +19 -0
  19. package/dist/devtools/NavTab.svelte +229 -0
  20. package/dist/devtools/NavTab.svelte.d.ts +11 -0
  21. package/dist/devtools/PageTab.svelte +1122 -0
  22. package/dist/devtools/PageTab.svelte.d.ts +15 -0
  23. package/dist/devtools/ProfilerTab.svelte +755 -0
  24. package/dist/devtools/ProfilerTab.svelte.d.ts +15 -0
  25. package/dist/devtools/PropsTree.svelte +155 -0
  26. package/dist/devtools/PropsTree.svelte.d.ts +15 -0
  27. package/dist/devtools/SessionTab.svelte +796 -0
  28. package/dist/devtools/SessionTab.svelte.d.ts +11 -0
  29. package/dist/devtools/TimelineTab.svelte +267 -0
  30. package/dist/devtools/TimelineTab.svelte.d.ts +11 -0
  31. package/dist/devtools/WireTab.svelte +149 -0
  32. package/dist/devtools/WireTab.svelte.d.ts +11 -0
  33. package/dist/devtools/bytes.d.ts +70 -0
  34. package/dist/devtools/bytes.js +82 -0
  35. package/dist/devtools/cache-headers.d.ts +20 -0
  36. package/dist/devtools/cache-headers.js +81 -0
  37. package/dist/devtools/highlight.d.ts +7 -0
  38. package/dist/devtools/highlight.js +83 -0
  39. package/dist/devtools/hydration.d.ts +48 -0
  40. package/dist/devtools/hydration.js +93 -0
  41. package/dist/devtools/index.d.ts +3 -0
  42. package/dist/devtools/index.js +3 -0
  43. package/dist/devtools/ledger-dom.d.ts +7 -0
  44. package/dist/devtools/ledger-dom.js +151 -0
  45. package/dist/devtools/leftovers.d.ts +77 -0
  46. package/dist/devtools/leftovers.js +319 -0
  47. package/dist/devtools/names.d.ts +1 -0
  48. package/dist/devtools/names.js +34 -0
  49. package/dist/devtools/page.d.ts +96 -0
  50. package/dist/devtools/page.js +957 -0
  51. package/dist/devtools/profile-anchors.d.ts +22 -0
  52. package/dist/devtools/profile-anchors.js +135 -0
  53. package/dist/devtools/profile-store.d.ts +175 -0
  54. package/dist/devtools/profile-store.js +239 -0
  55. package/dist/devtools/regions.d.ts +77 -0
  56. package/dist/devtools/regions.js +132 -0
  57. package/dist/devtools/session.d.ts +31 -0
  58. package/dist/devtools/session.js +455 -0
  59. package/dist/devtools/since-load.d.ts +50 -0
  60. package/dist/devtools/since-load.js +89 -0
  61. package/dist/devtools/source-lines.d.ts +24 -0
  62. package/dist/devtools/source-lines.js +106 -0
  63. package/dist/devtools/styles.d.ts +52 -0
  64. package/dist/devtools/styles.js +248 -0
  65. package/dist/devtools/testing-engine.d.ts +83 -0
  66. package/dist/devtools/testing-engine.js +220 -0
  67. package/dist/devtools/ui-app.d.ts +5 -0
  68. package/dist/devtools/ui-app.js +69 -0
  69. package/dist/devtools/ui.d.ts +50 -0
  70. package/dist/devtools/ui.js +175 -0
  71. package/dist/profiler/alloc.d.ts +75 -0
  72. package/dist/profiler/alloc.js +76 -0
  73. package/dist/profiler/analyze.d.ts +437 -0
  74. package/dist/profiler/analyze.js +1941 -0
  75. package/dist/profiler/app-path.d.ts +7 -0
  76. package/dist/profiler/app-path.js +26 -0
  77. package/dist/profiler/async-io.d.ts +58 -0
  78. package/dist/profiler/async-io.js +187 -0
  79. package/dist/profiler/beacon-standalone.d.ts +4 -0
  80. package/dist/profiler/beacon-standalone.js +409 -0
  81. package/dist/profiler/browser-findings.d.ts +25 -0
  82. package/dist/profiler/browser-findings.js +260 -0
  83. package/dist/profiler/byte-strip.d.ts +58 -0
  84. package/dist/profiler/byte-strip.js +228 -0
  85. package/dist/profiler/client-files.d.ts +16 -0
  86. package/dist/profiler/client-files.js +60 -0
  87. package/dist/profiler/client-windows.d.ts +49 -0
  88. package/dist/profiler/client-windows.js +95 -0
  89. package/dist/profiler/client.d.ts +40 -0
  90. package/dist/profiler/client.js +82 -0
  91. package/dist/profiler/compare.d.ts +308 -0
  92. package/dist/profiler/compare.js +733 -0
  93. package/dist/profiler/compress.d.ts +10 -0
  94. package/dist/profiler/compress.js +36 -0
  95. package/dist/profiler/contention.d.ts +60 -0
  96. package/dist/profiler/contention.js +86 -0
  97. package/dist/profiler/crypto.d.ts +19 -0
  98. package/dist/profiler/crypto.js +101 -0
  99. package/dist/profiler/doc-diff.d.ts +47 -0
  100. package/dist/profiler/doc-diff.js +214 -0
  101. package/dist/profiler/dom-diff.d.ts +43 -0
  102. package/dist/profiler/dom-diff.js +121 -0
  103. package/dist/profiler/drill.d.ts +89 -0
  104. package/dist/profiler/drill.js +553 -0
  105. package/dist/profiler/embedded-maps.d.ts +37 -0
  106. package/dist/profiler/embedded-maps.js +135 -0
  107. package/dist/profiler/env.d.ts +6 -0
  108. package/dist/profiler/env.js +10 -0
  109. package/dist/profiler/forecast.d.ts +76 -0
  110. package/dist/profiler/forecast.js +225 -0
  111. package/dist/profiler/frames.d.ts +11 -0
  112. package/dist/profiler/frames.js +42 -0
  113. package/dist/profiler/gc.d.ts +144 -0
  114. package/dist/profiler/gc.js +271 -0
  115. package/dist/profiler/hole-slots.d.ts +31 -0
  116. package/dist/profiler/hole-slots.js +90 -0
  117. package/dist/profiler/index.d.ts +288 -0
  118. package/dist/profiler/index.js +4921 -0
  119. package/dist/profiler/insights.d.ts +96 -0
  120. package/dist/profiler/insights.js +239 -0
  121. package/dist/profiler/ledger.d.ts +121 -0
  122. package/dist/profiler/ledger.js +440 -0
  123. package/dist/profiler/lineage.d.ts +81 -0
  124. package/dist/profiler/lineage.js +359 -0
  125. package/dist/profiler/module-map.d.ts +12 -0
  126. package/dist/profiler/module-map.js +94 -0
  127. package/dist/profiler/net.d.ts +169 -0
  128. package/dist/profiler/net.js +586 -0
  129. package/dist/profiler/on-demand.d.ts +11 -0
  130. package/dist/profiler/on-demand.js +15 -0
  131. package/dist/profiler/own-requests.d.ts +9 -0
  132. package/dist/profiler/own-requests.js +17 -0
  133. package/dist/profiler/patterns.d.ts +476 -0
  134. package/dist/profiler/patterns.js +2203 -0
  135. package/dist/profiler/profiler-router.d.ts +245 -0
  136. package/dist/profiler/profiler-router.js +113 -0
  137. package/dist/profiler/refresh-stub.d.ts +2 -0
  138. package/dist/profiler/refresh-stub.js +37 -0
  139. package/dist/profiler/report.d.ts +1404 -0
  140. package/dist/profiler/report.js +2638 -0
  141. package/dist/profiler/river.d.ts +65 -0
  142. package/dist/profiler/river.js +298 -0
  143. package/dist/profiler/route-files.d.ts +22 -0
  144. package/dist/profiler/route-files.js +55 -0
  145. package/dist/profiler/route-imports.d.ts +14 -0
  146. package/dist/profiler/route-imports.js +83 -0
  147. package/dist/profiler/saving.d.ts +22 -0
  148. package/dist/profiler/saving.js +42 -0
  149. package/dist/profiler/score.d.ts +109 -0
  150. package/dist/profiler/score.js +261 -0
  151. package/dist/profiler/session-cookie.d.ts +28 -0
  152. package/dist/profiler/session-cookie.js +45 -0
  153. package/dist/profiler/sink.d.ts +81 -0
  154. package/dist/profiler/sink.js +124 -0
  155. package/dist/profiler/site-fixes.d.ts +25 -0
  156. package/dist/profiler/site-fixes.js +62 -0
  157. package/dist/profiler/source-scan.d.ts +210 -0
  158. package/dist/profiler/source-scan.js +1724 -0
  159. package/dist/profiler/span.d.ts +90 -0
  160. package/dist/profiler/span.js +109 -0
  161. package/dist/profiler/stacks.d.ts +43 -0
  162. package/dist/profiler/stacks.js +107 -0
  163. package/dist/profiler/standalone.d.ts +27 -0
  164. package/dist/profiler/standalone.js +98 -0
  165. package/dist/profiler/steps.d.ts +39 -0
  166. package/dist/profiler/steps.js +74 -0
  167. package/dist/profiler/storage/index.d.ts +87 -0
  168. package/dist/profiler/storage/index.js +76 -0
  169. package/dist/profiler/storage/postgres.d.ts +12 -0
  170. package/dist/profiler/storage/postgres.js +94 -0
  171. package/dist/profiler/storage/redis.d.ts +19 -0
  172. package/dist/profiler/storage/redis.js +148 -0
  173. package/dist/profiler/storage/sqlite.d.ts +2 -0
  174. package/dist/profiler/storage/sqlite.js +85 -0
  175. package/dist/profiler/storage/visits.d.ts +4 -0
  176. package/dist/profiler/storage/visits.js +6 -0
  177. package/dist/profiler/stream-tail.d.ts +26 -0
  178. package/dist/profiler/stream-tail.js +74 -0
  179. package/dist/profiler/timeline.d.ts +279 -0
  180. package/dist/profiler/timeline.js +690 -0
  181. package/dist/profiler/ui/AllocStrip.svelte +146 -0
  182. package/dist/profiler/ui/AllocStrip.svelte.d.ts +17 -0
  183. package/dist/profiler/ui/Awaits.svelte +363 -0
  184. package/dist/profiler/ui/Awaits.svelte.d.ts +16 -0
  185. package/dist/profiler/ui/ByteStrip.svelte +182 -0
  186. package/dist/profiler/ui/ByteStrip.svelte.d.ts +18 -0
  187. package/dist/profiler/ui/Compare.svelte +24 -0
  188. package/dist/profiler/ui/Compare.svelte.d.ts +16 -0
  189. package/dist/profiler/ui/CompareBody.svelte +429 -0
  190. package/dist/profiler/ui/CompareBody.svelte.d.ts +8 -0
  191. package/dist/profiler/ui/ComponentsTable.svelte +265 -0
  192. package/dist/profiler/ui/ComponentsTable.svelte.d.ts +20 -0
  193. package/dist/profiler/ui/Dashboard.svelte +492 -0
  194. package/dist/profiler/ui/Dashboard.svelte.d.ts +31 -0
  195. package/dist/profiler/ui/DataRiver.svelte +206 -0
  196. package/dist/profiler/ui/DataRiver.svelte.d.ts +13 -0
  197. package/dist/profiler/ui/DomTravel.svelte +207 -0
  198. package/dist/profiler/ui/DomTravel.svelte.d.ts +9 -0
  199. package/dist/profiler/ui/DownloadHtml.svelte +52 -0
  200. package/dist/profiler/ui/DownloadHtml.svelte.d.ts +10 -0
  201. package/dist/profiler/ui/Drill.svelte +276 -0
  202. package/dist/profiler/ui/Drill.svelte.d.ts +12 -0
  203. package/dist/profiler/ui/ExportButton.svelte +59 -0
  204. package/dist/profiler/ui/ExportButton.svelte.d.ts +8 -0
  205. package/dist/profiler/ui/Flame.svelte +222 -0
  206. package/dist/profiler/ui/Flame.svelte.d.ts +12 -0
  207. package/dist/profiler/ui/FrameDetails.svelte +308 -0
  208. package/dist/profiler/ui/FrameDetails.svelte.d.ts +16 -0
  209. package/dist/profiler/ui/FunctionsTable.svelte +156 -0
  210. package/dist/profiler/ui/FunctionsTable.svelte.d.ts +17 -0
  211. package/dist/profiler/ui/IslandHeatmap.svelte +151 -0
  212. package/dist/profiler/ui/IslandHeatmap.svelte.d.ts +16 -0
  213. package/dist/profiler/ui/IslandsTable.svelte +448 -0
  214. package/dist/profiler/ui/IslandsTable.svelte.d.ts +16 -0
  215. package/dist/profiler/ui/KeepLocal.svelte +46 -0
  216. package/dist/profiler/ui/KeepLocal.svelte.d.ts +8 -0
  217. package/dist/profiler/ui/Ledger.svelte +196 -0
  218. package/dist/profiler/ui/Ledger.svelte.d.ts +18 -0
  219. package/dist/profiler/ui/LocalCompare.svelte +48 -0
  220. package/dist/profiler/ui/LocalCompare.svelte.d.ts +8 -0
  221. package/dist/profiler/ui/LocalReports.svelte +68 -0
  222. package/dist/profiler/ui/LocalReports.svelte.d.ts +7 -0
  223. package/dist/profiler/ui/Login.svelte +13 -0
  224. package/dist/profiler/ui/Login.svelte.d.ts +12 -0
  225. package/dist/profiler/ui/LoginForm.svelte +42 -0
  226. package/dist/profiler/ui/LoginForm.svelte.d.ts +7 -0
  227. package/dist/profiler/ui/Message.svelte +10 -0
  228. package/dist/profiler/ui/Message.svelte.d.ts +12 -0
  229. package/dist/profiler/ui/OnThisPage.svelte +137 -0
  230. package/dist/profiler/ui/OnThisPage.svelte.d.ts +3 -0
  231. package/dist/profiler/ui/OneClock.svelte +297 -0
  232. package/dist/profiler/ui/OneClock.svelte.d.ts +27 -0
  233. package/dist/profiler/ui/Panel.svelte +10 -0
  234. package/dist/profiler/ui/Panel.svelte.d.ts +16 -0
  235. package/dist/profiler/ui/Paths.svelte +269 -0
  236. package/dist/profiler/ui/Paths.svelte.d.ts +15 -0
  237. package/dist/profiler/ui/Patterns.svelte +364 -0
  238. package/dist/profiler/ui/Patterns.svelte.d.ts +15 -0
  239. package/dist/profiler/ui/PermalinkGate.svelte +143 -0
  240. package/dist/profiler/ui/PermalinkGate.svelte.d.ts +10 -0
  241. package/dist/profiler/ui/RenderSteps.svelte +218 -0
  242. package/dist/profiler/ui/RenderSteps.svelte.d.ts +13 -0
  243. package/dist/profiler/ui/Report.svelte +28 -0
  244. package/dist/profiler/ui/Report.svelte.d.ts +20 -0
  245. package/dist/profiler/ui/ReportBody.svelte +2592 -0
  246. package/dist/profiler/ui/ReportBody.svelte.d.ts +21 -0
  247. package/dist/profiler/ui/Run.svelte +17 -0
  248. package/dist/profiler/ui/Run.svelte.d.ts +14 -0
  249. package/dist/profiler/ui/RunView.svelte +146 -0
  250. package/dist/profiler/ui/RunView.svelte.d.ts +10 -0
  251. package/dist/profiler/ui/ScoreCard.svelte +197 -0
  252. package/dist/profiler/ui/ScoreCard.svelte.d.ts +7 -0
  253. package/dist/profiler/ui/Scrub.svelte +293 -0
  254. package/dist/profiler/ui/Scrub.svelte.d.ts +18 -0
  255. package/dist/profiler/ui/SeedExplainer.svelte +193 -0
  256. package/dist/profiler/ui/SeedExplainer.svelte.d.ts +16 -0
  257. package/dist/profiler/ui/ShareLink.svelte +148 -0
  258. package/dist/profiler/ui/ShareLink.svelte.d.ts +8 -0
  259. package/dist/profiler/ui/Shell.svelte +50 -0
  260. package/dist/profiler/ui/Shell.svelte.d.ts +27 -0
  261. package/dist/profiler/ui/Sidebar.svelte +312 -0
  262. package/dist/profiler/ui/Sidebar.svelte.d.ts +7 -0
  263. package/dist/profiler/ui/Site.svelte +20 -0
  264. package/dist/profiler/ui/Site.svelte.d.ts +23 -0
  265. package/dist/profiler/ui/SiteView.svelte +385 -0
  266. package/dist/profiler/ui/SiteView.svelte.d.ts +27 -0
  267. package/dist/profiler/ui/ThemeSwitch.svelte +78 -0
  268. package/dist/profiler/ui/ThemeSwitch.svelte.d.ts +3 -0
  269. package/dist/profiler/ui/Timeline.svelte +672 -0
  270. package/dist/profiler/ui/Timeline.svelte.d.ts +22 -0
  271. package/dist/profiler/ui/Treemap.svelte +278 -0
  272. package/dist/profiler/ui/Treemap.svelte.d.ts +20 -0
  273. package/dist/profiler/ui/Upload.svelte +19 -0
  274. package/dist/profiler/ui/Upload.svelte.d.ts +10 -0
  275. package/dist/profiler/ui/UploadForm.svelte +59 -0
  276. package/dist/profiler/ui/UploadForm.svelte.d.ts +6 -0
  277. package/dist/profiler/ui/WaitingTable.svelte +55 -0
  278. package/dist/profiler/ui/WaitingTable.svelte.d.ts +14 -0
  279. package/dist/profiler/ui/Waterfall.svelte +371 -0
  280. package/dist/profiler/ui/Waterfall.svelte.d.ts +7 -0
  281. package/dist/profiler/ui/WhatIf.svelte +87 -0
  282. package/dist/profiler/ui/WhatIf.svelte.d.ts +18 -0
  283. package/dist/profiler/ui/fake-progress.svelte.d.ts +15 -0
  284. package/dist/profiler/ui/fake-progress.svelte.js +38 -0
  285. package/dist/profiler/ui/format.d.ts +20 -0
  286. package/dist/profiler/ui/format.js +71 -0
  287. package/dist/profiler/ui/permalink.d.ts +9 -0
  288. package/dist/profiler/ui/permalink.js +108 -0
  289. package/dist/profiler/ui/press.d.ts +5 -0
  290. package/dist/profiler/ui/press.js +19 -0
  291. package/dist/profiler/ui/profiler.css +650 -0
  292. package/dist/profiler/ui/report-data.d.ts +189 -0
  293. package/dist/profiler/ui/report-data.js +393 -0
  294. package/dist/profiler/ui/report-request.d.ts +6 -0
  295. package/dist/profiler/ui/report-request.js +50 -0
  296. package/dist/profiler/ui/row-anchor.svelte.d.ts +12 -0
  297. package/dist/profiler/ui/row-anchor.svelte.js +44 -0
  298. package/dist/profiler/ui/sort.svelte.d.ts +14 -0
  299. package/dist/profiler/ui/sort.svelte.js +37 -0
  300. package/dist/profiler/ui/store.d.ts +45 -0
  301. package/dist/profiler/ui/store.js +92 -0
  302. package/dist/profiler/visit.d.ts +389 -0
  303. package/dist/profiler/visit.js +1002 -0
  304. package/dist/report.d.ts +5 -0
  305. package/dist/report.js +4 -0
  306. package/dist/server.d.ts +11 -0
  307. package/dist/server.js +38 -0
  308. package/dist/vite.d.ts +12 -0
  309. package/dist/vite.js +78 -0
  310. package/package.json +99 -6
@@ -0,0 +1,50 @@
1
+ <script>import Sidebar from "./Sidebar.svelte" with { wake: "load" };
2
+ // The shared profiler vocabulary (reset, typography, tables, buttons, form controls…). Global by
3
+ // nature — every page composes with it — so it lives in a sibling stylesheet, not scoped here. It's
4
+ // collected onto every page's server-router CSS aggregate because Shell is a child of every page.
5
+ //
6
+ // `?inline`, deliberately: the router-css walk reads the FILE (this import is only its discovery
7
+ // marker — the query is stripped before resolution), so the sheet must never be a live css MODULE.
8
+ // The profiler loads on the first request of any dev session (its handle times every render), which
9
+ // welds this subtree into the SSR module graph — and SvelteKit's dev "inline all styles" collector
10
+ // walks that graph and would inject this GLOBAL sheet (body{ max-width… }) into the app's own
11
+ // pages (seen in the wild: every page squeezed to 1150px, profiler-dark). Kit's collector skips
12
+ // `?inline` css urls by rule, so this is leak-proof no matter how the crawl reaches us.
13
+ import "./profiler.css?inline";
14
+ let { base = "", current = null, toc = false, bare = false, children } = $props();
15
+ </script>
16
+
17
+ <svelte:head>
18
+ <!-- Tell the ogygia devtools to stay out of profiler pages (incl. the Profiler tab's embedded iframe). -->
19
+ <meta name="ogygia-devtools" content="off" />
20
+ </svelte:head>
21
+
22
+ {#if bare}
23
+ <!-- pre-auth / message pages: no rail, no polling islands, just the content centred -->
24
+ <main class="app-main app-bare">
25
+ {@render children()}
26
+ </main>
27
+ {:else}
28
+ <div class="app">
29
+ <Sidebar {base} {current} />
30
+ <main class="app-main" class:has-toc={toc}>
31
+ {@render children()}
32
+ <div class="footer">
33
+ ogygia/profiler — samples the whole Node process during SSR. <b>Self</b> = time (or memory)
34
+ inside the function itself. <b>Total</b> = self plus everything it called. <b>Per call</b> = total
35
+ ÷ how many times it ran (a ×N tag means it ran N times; no tag means once).
36
+ </div>
37
+ </main>
38
+ </div>
39
+ {/if}
40
+
41
+ <style>
42
+ /* The shell's own chrome (scoped). The shared vocabulary lives in ./profiler.css. */
43
+ .footer {
44
+ margin-top: 40px;
45
+ padding-top: 12px;
46
+ border-top: 1px solid var(--line);
47
+ color: var(--text-faint);
48
+ font-size: 12px;
49
+ }
50
+ </style>
@@ -0,0 +1,27 @@
1
+ /**
2
+ * The profiler UI shell: owns the shared stylesheet (the sibling profiler.css, imported below) and
3
+ * renders the footer. Every profiler view wraps its body in this. Component-specific styles live
4
+ * scoped in their own components (Treemap / Flame / Waterfall / ReportBody / ShareLink /
5
+ * PermalinkGate); the shared vocabulary is the imported sheet.
6
+ *
7
+ * Reaching a routeless, server-only-rendered page: the profiler renders through `@ogygia/router` +
8
+ * `document()`, so its component CSS is emitted + linked by the SERVER-ROUTER CSS mechanism
9
+ * (link/router-css.ts) — Shell is a transitive child of every page component, so this sheet ships on
10
+ * every profiler page.
11
+ *
12
+ * NOTE — no literal style/script tag or a preprocessor-dialect block may appear anywhere in this
13
+ * file, comments included: this ships raw and svelte2tsx (type-gen) treats such a token as a real
14
+ * open tag and reports "script left open". See test/profiler-ui-consumer-safe.
15
+ */
16
+ import type { Snippet } from 'svelte';
17
+ import './profiler.css?inline';
18
+ type $$ComponentProps = {
19
+ base?: string;
20
+ current?: string | null;
21
+ toc?: boolean;
22
+ bare?: boolean;
23
+ children: Snippet;
24
+ };
25
+ declare const Shell: import("svelte").Component<$$ComponentProps, {}, "">;
26
+ type Shell = ReturnType<typeof Shell>;
27
+ export default Shell;
@@ -0,0 +1,312 @@
1
+ <script>/**
2
+ * The global rail — on every profiler page (Shell renders it). Brand, the top-level nav, the
3
+ * recordings this browser has kept, live status, and the theme switch. A `wake:'load'` island so
4
+ * it can read the local store (IndexedDB) for kept reports and poll status.
5
+ *
6
+ * HOSTED DB SEAM: `server` is the list a company-hosted store would return (the reports the
7
+ * backend holds, across instances and teammates). Today it is empty and the rail shows what THIS
8
+ * browser kept ("the browser is the database"); when the backend lands, the router fills `server`
9
+ * and the two lists merge — nothing else here changes. `live` is the same seam for a status feed.
10
+ */
11
+ import { list_reports } from "./store.js";
12
+ import ThemeSwitch from "./ThemeSwitch.svelte";
13
+ let { base, current = null } = $props();
14
+ // reports the durable store holds (SQLite/Redis/Postgres), shared across instances and teammates —
15
+ // fetched from `/reports.json`; empty when no store is configured (then the rail is local-only)
16
+ let server = $state([]);
17
+ $effect(() => {
18
+ fetch(`${base}/reports.json`, { headers: { accept: "application/json" } }).then((r) => r.ok ? r.json() : []).then((rows) => server = Array.isArray(rows) ? rows : []).catch(() => server = []);
19
+ });
20
+ // LIVE STATUS — polled from the instance (`/status.json`): is a recording running, how many
21
+ // requests are in flight, memory, how many reports it holds. The rail's pulse.
22
+ let live = $state(null);
23
+ $effect(() => {
24
+ let alive = true;
25
+ const poll = async () => {
26
+ try {
27
+ const r = await fetch(`${base}/status.json`, { headers: { accept: "application/json" } });
28
+ if (r.ok && alive) live = await r.json();
29
+ } catch {}
30
+ };
31
+ poll();
32
+ const t = setInterval(poll, 4e3);
33
+ return () => {
34
+ alive = false;
35
+ clearInterval(t);
36
+ };
37
+ });
38
+ let local = $state([]);
39
+ $effect(() => {
40
+ list_reports().then((rows) => rows.sort((a, b) => b.at - a.at).slice(0, 12).map((r) => ({
41
+ id: r.id,
42
+ label: r.page ?? r.label ?? r.id,
43
+ page: r.page ?? undefined,
44
+ created: r.at,
45
+ where: "local"
46
+ }))).then((rows) => local = rows).catch(() => local = []);
47
+ });
48
+ // server-held reports first, then browser-only ones; a report in both shows ONCE (server wins)
49
+ const rows = $derived.by(() => {
50
+ const seen = new Set();
51
+ const out = [];
52
+ for (const s of server) {
53
+ if (seen.has(s.id)) continue;
54
+ seen.add(s.id);
55
+ out.push({
56
+ ...s,
57
+ where: "server"
58
+ });
59
+ }
60
+ for (const l of local) {
61
+ if (seen.has(l.id)) continue;
62
+ seen.add(l.id);
63
+ out.push(l);
64
+ }
65
+ return out.slice(0, 16);
66
+ });
67
+ const ago = (t) => {
68
+ const s = Math.max(0, (Date.now() - t) / 1e3);
69
+ if (s < 60) return "just now";
70
+ if (s < 3600) return `${Math.round(s / 60)}m ago`;
71
+ if (s < 86400) return `${Math.round(s / 3600)}h ago`;
72
+ return `${Math.round(s / 86400)}d ago`;
73
+ };
74
+ const nav = $derived([
75
+ {
76
+ href: base,
77
+ label: "Dashboard",
78
+ icon: "▦"
79
+ },
80
+ {
81
+ href: `${base}/site`,
82
+ label: "Whole site",
83
+ icon: "◈"
84
+ },
85
+ {
86
+ href: `${base}/view`,
87
+ label: "Import .ogp",
88
+ icon: "↥"
89
+ }
90
+ ]);
91
+ const is_here = (href) => typeof window !== "undefined" && window.location.pathname === new URL(href, window.location.origin).pathname;
92
+ </script>
93
+
94
+ <aside class="rail">
95
+ <a class="brand" href={base}>
96
+ <span class="mark">◑</span>
97
+ <span class="wordmark">ogygia<b>profiler</b></span>
98
+ </a>
99
+
100
+ <nav>
101
+ {#each nav as n (n.href)}
102
+ <a href={n.href} class="navi" class:on={is_here(n.href)}
103
+ ><span class="ni">{n.icon}</span>{n.label}</a
104
+ >
105
+ {/each}
106
+ </nav>
107
+
108
+ <div
109
+ class="status"
110
+ title={live ? `${live.inflight} in flight · ${live.rss_mb} MB · ${live.reports} in memory` : ''}
111
+ >
112
+ <span class="dot" class:run={live?.recording}></span>
113
+ {#if live?.recording}
114
+ recording…
115
+ {:else if live}
116
+ ready · {live.inflight} in flight
117
+ {:else}
118
+ ready
119
+ {/if}
120
+ </div>
121
+
122
+ <div class="recent">
123
+ <div class="rh">Recent recordings</div>
124
+ {#if rows.length}
125
+ <ul>
126
+ {#each rows as r (r.where + r.id)}
127
+ <li>
128
+ <a href="{base}/report/{r.id}" class:cur={r.id === current}>
129
+ <span class="rl">{r.label}</span>
130
+ <span class="rm"
131
+ >{ago(r.created)}{#if r.where === 'server'}
132
+ · shared{/if}</span
133
+ >
134
+ </a>
135
+ </li>
136
+ {/each}
137
+ </ul>
138
+ {:else}
139
+ <p class="empty">
140
+ None kept in this browser yet. On a report, hit <b>Keep</b> to pin it here.
141
+ </p>
142
+ {/if}
143
+ </div>
144
+
145
+ <div class="foot">
146
+ <ThemeSwitch />
147
+ </div>
148
+ </aside>
149
+
150
+ <style>
151
+ .rail {
152
+ position: fixed;
153
+ left: 0;
154
+ top: 0;
155
+ width: 236px;
156
+ height: 100vh;
157
+ display: flex;
158
+ flex-direction: column;
159
+ gap: 14px;
160
+ padding: 18px 14px;
161
+ border-right: 1px solid var(--line);
162
+ background: var(--bg-panel);
163
+ overflow-y: auto;
164
+ z-index: 10;
165
+ }
166
+ @media (max-width: 860px) {
167
+ .rail {
168
+ position: static;
169
+ width: auto;
170
+ height: auto;
171
+ }
172
+ }
173
+ .brand {
174
+ display: flex;
175
+ align-items: center;
176
+ gap: 9px;
177
+ text-decoration: none;
178
+ color: var(--text);
179
+ padding: 2px 4px;
180
+ }
181
+ .brand:hover {
182
+ text-decoration: none;
183
+ }
184
+ .mark {
185
+ font-size: 20px;
186
+ color: var(--accent);
187
+ }
188
+ .wordmark {
189
+ font-family: var(--font-display);
190
+ font-size: 17px;
191
+ letter-spacing: -0.01em;
192
+ }
193
+ .wordmark b {
194
+ font-weight: 600;
195
+ color: var(--accent);
196
+ margin-left: 3px;
197
+ }
198
+ nav {
199
+ display: flex;
200
+ flex-direction: column;
201
+ gap: 2px;
202
+ }
203
+ .navi {
204
+ display: flex;
205
+ align-items: center;
206
+ gap: 10px;
207
+ padding: 7px 10px;
208
+ border-radius: var(--r-sm);
209
+ color: var(--text-dim);
210
+ font-size: 13px;
211
+ text-decoration: none;
212
+ }
213
+ .navi:hover {
214
+ background: var(--bg-hover);
215
+ color: var(--text);
216
+ text-decoration: none;
217
+ }
218
+ .navi.on {
219
+ background: var(--accent-deep);
220
+ color: var(--accent-strong);
221
+ }
222
+ .ni {
223
+ width: 16px;
224
+ text-align: center;
225
+ opacity: 0.85;
226
+ }
227
+ .status {
228
+ display: flex;
229
+ align-items: center;
230
+ gap: 8px;
231
+ font-size: 12px;
232
+ color: var(--text-faint);
233
+ padding: 0 10px;
234
+ }
235
+ .dot {
236
+ width: 7px;
237
+ height: 7px;
238
+ border-radius: 50%;
239
+ background: var(--text-faint);
240
+ }
241
+ .dot.run {
242
+ background: var(--accent);
243
+ box-shadow: 0 0 8px var(--accent);
244
+ animation: pulse 1.6s ease-in-out infinite;
245
+ }
246
+ @keyframes pulse {
247
+ 50% {
248
+ opacity: 0.4;
249
+ }
250
+ }
251
+ .recent {
252
+ flex: 1;
253
+ min-height: 0;
254
+ display: flex;
255
+ flex-direction: column;
256
+ }
257
+ .rh {
258
+ font-size: 10.5px;
259
+ text-transform: uppercase;
260
+ letter-spacing: 0.06em;
261
+ color: var(--text-faint);
262
+ padding: 0 10px 6px;
263
+ }
264
+ .recent ul {
265
+ list-style: none;
266
+ margin: 0;
267
+ padding: 0;
268
+ overflow-y: auto;
269
+ }
270
+ .recent a {
271
+ display: block;
272
+ padding: 6px 10px;
273
+ border-radius: var(--r-sm);
274
+ text-decoration: none;
275
+ color: var(--text-dim);
276
+ }
277
+ .recent a:hover {
278
+ background: var(--bg-hover);
279
+ text-decoration: none;
280
+ }
281
+ .recent a.cur {
282
+ background: var(--accent-deep);
283
+ }
284
+ /* (the faint grey is 4.2:1 on the dark accent fill) */
285
+ .recent a.cur .rm {
286
+ color: var(--text-dim);
287
+ }
288
+ .rl {
289
+ display: block;
290
+ font-size: 12.5px;
291
+ color: var(--text);
292
+ white-space: nowrap;
293
+ overflow: hidden;
294
+ text-overflow: ellipsis;
295
+ font-family: var(--font-mono);
296
+ }
297
+ .rm {
298
+ display: block;
299
+ font-size: 10.5px;
300
+ color: var(--text-faint);
301
+ }
302
+ .empty {
303
+ font-size: 12px;
304
+ color: var(--text-faint);
305
+ padding: 0 10px;
306
+ line-height: 1.5;
307
+ }
308
+ .foot {
309
+ border-top: 1px solid var(--line);
310
+ padding-top: 12px;
311
+ }
312
+ </style>
@@ -0,0 +1,7 @@
1
+ type $$ComponentProps = {
2
+ base: string;
3
+ current?: string | null;
4
+ };
5
+ declare const Sidebar: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type Sidebar = ReturnType<typeof Sidebar>;
7
+ export default Sidebar;
@@ -0,0 +1,20 @@
1
+ <script>/** `<base>/site`: the whole-site pictures. Shell + the SiteView island (the request cloud with a
2
+ * brushable selection, and the layer cake per route), fed by this instance's rows or a sink URL
3
+ * the browser reads. */
4
+ import Shell from "./Shell.svelte";
5
+ import SiteView from "./SiteView.svelte" with { wake: "load" };
6
+ let { data } = $props();
7
+ const { base, rows, from, sink, ephemeral } = $derived(data);
8
+ </script>
9
+
10
+ <svelte:head><title>the whole site — profiler</title></svelte:head>
11
+
12
+ <Shell {base}>
13
+ <h1>The whole site <small>every request, and where the time goes per route</small></h1>
14
+ <p class="hint">
15
+ <a href={base}>← dashboard</a> · {rows.length} rows from this instance{ephemeral
16
+ ? ' (ephemeral: seconds of memory — use a sink)'
17
+ : ''}
18
+ </p>
19
+ <SiteView {base} {rows} {from} {sink} {ephemeral} />
20
+ </Shell>
@@ -0,0 +1,23 @@
1
+ declare const Site: import("svelte").Component<{
2
+ data: {
3
+ base: string;
4
+ rows: import("../sink.js").SinkRow[];
5
+ sink: {
6
+ url: string;
7
+ last: {
8
+ at: number;
9
+ ok: boolean;
10
+ rows: number;
11
+ error?: string;
12
+ } | null;
13
+ buffered: number;
14
+ } | null;
15
+ from: string | null;
16
+ ephemeral: boolean;
17
+ };
18
+ form: null;
19
+ params: {};
20
+ search: {};
21
+ }, {}, "">;
22
+ type Site = ReturnType<typeof Site>;
23
+ export default Site;