@osdk/react-devtools 0.5.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 (443) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/build/esm/DevToolsContext.js +19 -0
  3. package/build/esm/DevToolsContext.js.map +1 -0
  4. package/build/esm/components/ActionMetrics.js +89 -0
  5. package/build/esm/components/ActionMetrics.js.map +1 -0
  6. package/build/esm/components/BubbleChart.js +175 -0
  7. package/build/esm/components/BubbleChart.js.map +1 -0
  8. package/build/esm/components/BubbleChart.module.scss.js +6 -0
  9. package/build/esm/components/CacheInspectorTab.js +291 -0
  10. package/build/esm/components/CacheInspectorTab.js.map +1 -0
  11. package/build/esm/components/CacheInspectorTab.module.scss.js +39 -0
  12. package/build/esm/components/CacheMetrics.js +55 -0
  13. package/build/esm/components/CacheMetrics.js.map +1 -0
  14. package/build/esm/components/ComponentCard.js +124 -0
  15. package/build/esm/components/ComponentCard.js.map +1 -0
  16. package/build/esm/components/ComponentCard.module.scss.js +31 -0
  17. package/build/esm/components/ComputeTab.js +175 -0
  18. package/build/esm/components/ComputeTab.js.map +1 -0
  19. package/build/esm/components/CopyableCodeBlock.js +49 -0
  20. package/build/esm/components/CopyableCodeBlock.js.map +1 -0
  21. package/build/esm/components/CopyableCodeBlock.module.scss.js +10 -0
  22. package/build/esm/components/DebuggingTab.js +342 -0
  23. package/build/esm/components/DebuggingTab.js.map +1 -0
  24. package/build/esm/components/DebuggingTab.module.scss.js +18 -0
  25. package/build/esm/components/HookRow.js +180 -0
  26. package/build/esm/components/HookRow.js.map +1 -0
  27. package/build/esm/components/HookRow.module.scss.js +16 -0
  28. package/build/esm/components/ImprovementsTab.js +138 -0
  29. package/build/esm/components/ImprovementsTab.js.map +1 -0
  30. package/build/esm/components/ImprovementsTab.module.scss.js +30 -0
  31. package/build/esm/components/InspectorSelectionHeader.js +65 -0
  32. package/build/esm/components/InspectorSelectionHeader.js.map +1 -0
  33. package/build/esm/components/InterceptTab.js +862 -0
  34. package/build/esm/components/InterceptTab.js.map +1 -0
  35. package/build/esm/components/InterceptTab.module.scss.js +49 -0
  36. package/build/esm/components/IssueCard.js +115 -0
  37. package/build/esm/components/IssueCard.js.map +1 -0
  38. package/build/esm/components/IssueCard.module.scss.js +24 -0
  39. package/build/esm/components/LogEntryCard.js +94 -0
  40. package/build/esm/components/LogEntryCard.js.map +1 -0
  41. package/build/esm/components/LogEntryCard.module.scss.js +19 -0
  42. package/build/esm/components/MockEditor.js +316 -0
  43. package/build/esm/components/MockEditor.js.map +1 -0
  44. package/build/esm/components/MonitorErrorBoundary.js +64 -0
  45. package/build/esm/components/MonitorErrorBoundary.js.map +1 -0
  46. package/build/esm/components/MonitorErrorBoundary.module.scss.js +9 -0
  47. package/build/esm/components/MonitoringPanel.js +434 -0
  48. package/build/esm/components/MonitoringPanel.js.map +1 -0
  49. package/build/esm/components/MonitoringPanel.module.scss.js +81 -0
  50. package/build/esm/components/ObjectLoadingMetrics.js +60 -0
  51. package/build/esm/components/ObjectLoadingMetrics.js.map +1 -0
  52. package/build/esm/components/OsdkAppErrorBoundary.js +68 -0
  53. package/build/esm/components/OsdkAppErrorBoundary.js.map +1 -0
  54. package/build/esm/components/OsdkDevTools.js +40 -0
  55. package/build/esm/components/OsdkDevTools.js.map +1 -0
  56. package/build/esm/components/OverrideEditor.js +197 -0
  57. package/build/esm/components/OverrideEditor.js.map +1 -0
  58. package/build/esm/components/PerformanceTab.js +297 -0
  59. package/build/esm/components/PerformanceTab.js.map +1 -0
  60. package/build/esm/components/PrimitiveSelectionPanel.js +220 -0
  61. package/build/esm/components/PrimitiveSelectionPanel.js.map +1 -0
  62. package/build/esm/components/PrimitiveSelectionPanel.module.scss.js +26 -0
  63. package/build/esm/components/issueTypes.js +2 -0
  64. package/build/esm/components/issueTypes.js.map +1 -0
  65. package/build/esm/components/resolveComponentName.js +57 -0
  66. package/build/esm/components/resolveComponentName.js.map +1 -0
  67. package/build/esm/components/testHelpers.js +312 -0
  68. package/build/esm/components/testHelpers.js.map +1 -0
  69. package/build/esm/css.d.ts +20 -0
  70. package/build/esm/fiber/DegradationNotice.js +193 -0
  71. package/build/esm/fiber/DegradationNotice.js.map +1 -0
  72. package/build/esm/fiber/DevtoolsHook.js +252 -0
  73. package/build/esm/fiber/DevtoolsHook.js.map +1 -0
  74. package/build/esm/fiber/FiberAccess.js +65 -0
  75. package/build/esm/fiber/FiberAccess.js.map +1 -0
  76. package/build/esm/fiber/FiberInspection.js +140 -0
  77. package/build/esm/fiber/FiberInspection.js.map +1 -0
  78. package/build/esm/fiber/FiberTags.js +52 -0
  79. package/build/esm/fiber/FiberTags.js.map +1 -0
  80. package/build/esm/fiber/HookStateInspector.js +254 -0
  81. package/build/esm/fiber/HookStateInspector.js.map +1 -0
  82. package/build/esm/fiber/SafeFiberOperation.js +35 -0
  83. package/build/esm/fiber/SafeFiberOperation.js.map +1 -0
  84. package/build/esm/fiber/capabilities.js +180 -0
  85. package/build/esm/fiber/capabilities.js.map +1 -0
  86. package/build/esm/fiber/traverseFiber.js +129 -0
  87. package/build/esm/fiber/traverseFiber.js.map +1 -0
  88. package/build/esm/fiber/types.js +2 -0
  89. package/build/esm/fiber/types.js.map +1 -0
  90. package/build/esm/fiber/validation.js +155 -0
  91. package/build/esm/fiber/validation.js.map +1 -0
  92. package/build/esm/hooks/createPollingStore.js +81 -0
  93. package/build/esm/hooks/createPollingStore.js.map +1 -0
  94. package/build/esm/hooks/useActiveComponents.js +27 -0
  95. package/build/esm/hooks/useActiveComponents.js.map +1 -0
  96. package/build/esm/hooks/useComponentRegistry.js +25 -0
  97. package/build/esm/hooks/useComponentRegistry.js.map +1 -0
  98. package/build/esm/hooks/useComputeSelectors.js +43 -0
  99. package/build/esm/hooks/useComputeSelectors.js.map +1 -0
  100. package/build/esm/hooks/useConsoleLogs.js +46 -0
  101. package/build/esm/hooks/useConsoleLogs.js.map +1 -0
  102. package/build/esm/hooks/useInspectorSelection.js +93 -0
  103. package/build/esm/hooks/useInspectorSelection.js.map +1 -0
  104. package/build/esm/hooks/useMetrics.js +23 -0
  105. package/build/esm/hooks/useMetrics.js.map +1 -0
  106. package/build/esm/hooks/usePersistedState.js +89 -0
  107. package/build/esm/hooks/usePersistedState.js.map +1 -0
  108. package/build/esm/hooks/useRecommendations.js +123 -0
  109. package/build/esm/hooks/useRecommendations.js.map +1 -0
  110. package/build/esm/hooks/useSharedTick.js +49 -0
  111. package/build/esm/hooks/useSharedTick.js.map +1 -0
  112. package/build/esm/hooks/useTimeElapsed.js +51 -0
  113. package/build/esm/hooks/useTimeElapsed.js.map +1 -0
  114. package/build/esm/hooks/useTrackerSubscription.js +97 -0
  115. package/build/esm/hooks/useTrackerSubscription.js.map +1 -0
  116. package/build/esm/hooks/useUnusedFieldAnalysis.js +99 -0
  117. package/build/esm/hooks/useUnusedFieldAnalysis.js.map +1 -0
  118. package/build/esm/index.js +31 -0
  119. package/build/esm/index.js.map +1 -0
  120. package/build/esm/inspector/ClickToInspectSystem.js +228 -0
  121. package/build/esm/inspector/ClickToInspectSystem.js.map +1 -0
  122. package/build/esm/inspector/components/ComponentLabel.js +175 -0
  123. package/build/esm/inspector/components/ComponentLabel.js.map +1 -0
  124. package/build/esm/inspector/components/ComponentLabel.module.scss.js +12 -0
  125. package/build/esm/inspector/components/InspectorBanner.js +79 -0
  126. package/build/esm/inspector/components/InspectorBanner.js.map +1 -0
  127. package/build/esm/inspector/components/InspectorOverlay.js +149 -0
  128. package/build/esm/inspector/components/InspectorOverlay.js.map +1 -0
  129. package/build/esm/inspector/components/SelectionHighlight.js +74 -0
  130. package/build/esm/inspector/components/SelectionHighlight.js.map +1 -0
  131. package/build/esm/inspector/createClickToInspect.js +21 -0
  132. package/build/esm/inspector/createClickToInspect.js.map +1 -0
  133. package/build/esm/inspector/hooks/useAnimatedBounds.js +167 -0
  134. package/build/esm/inspector/hooks/useAnimatedBounds.js.map +1 -0
  135. package/build/esm/inspector/index.js +40 -0
  136. package/build/esm/inspector/index.js.map +1 -0
  137. package/build/esm/inspector/inspectorController.js +328 -0
  138. package/build/esm/inspector/inspectorController.js.map +1 -0
  139. package/build/esm/inspector/types.js +2 -0
  140. package/build/esm/inspector/types.js.map +1 -0
  141. package/build/esm/inspector/utils/elementBounds.js +72 -0
  142. package/build/esm/inspector/utils/elementBounds.js.map +1 -0
  143. package/build/esm/inspector/utils/interpolation.js +26 -0
  144. package/build/esm/inspector/utils/interpolation.js.map +1 -0
  145. package/build/esm/inspector/utils/labelPositioning.js +62 -0
  146. package/build/esm/inspector/utils/labelPositioning.js.map +1 -0
  147. package/build/esm/mocking/MockCacheKeyGenerator.js +109 -0
  148. package/build/esm/mocking/MockCacheKeyGenerator.js.map +1 -0
  149. package/build/esm/mocking/MockManager.js +281 -0
  150. package/build/esm/mocking/MockManager.js.map +1 -0
  151. package/build/esm/prototyping/PrototypeOverrideStore.js +66 -0
  152. package/build/esm/prototyping/PrototypeOverrideStore.js.map +1 -0
  153. package/build/esm/prototyping/index.js +18 -0
  154. package/build/esm/prototyping/index.js.map +1 -0
  155. package/build/esm/public/vite.js +19 -0
  156. package/build/esm/public/vite.js.map +1 -0
  157. package/build/esm/register.js +41 -0
  158. package/build/esm/register.js.map +1 -0
  159. package/build/esm/scss.d.ts +20 -0
  160. package/build/esm/store/ComputeStore.js +269 -0
  161. package/build/esm/store/ComputeStore.js.map +1 -0
  162. package/build/esm/store/ConsoleLogStore.js +289 -0
  163. package/build/esm/store/ConsoleLogStore.js.map +1 -0
  164. package/build/esm/store/MetricsStore.js +428 -0
  165. package/build/esm/store/MetricsStore.js.map +1 -0
  166. package/build/esm/store/MonitorStore.js +288 -0
  167. package/build/esm/store/MonitorStore.js.map +1 -0
  168. package/build/esm/store/SubscribableStore.js +38 -0
  169. package/build/esm/store/SubscribableStore.js.map +1 -0
  170. package/build/esm/store/WindowErrorStore.js +195 -0
  171. package/build/esm/store/WindowErrorStore.js.map +1 -0
  172. package/build/esm/styles.css +19441 -0
  173. package/build/esm/styles.js +31 -0
  174. package/build/esm/styles.js.map +1 -0
  175. package/build/esm/types/compute.js +2 -0
  176. package/build/esm/types/compute.js.map +1 -0
  177. package/build/esm/types/emissions.js +2 -0
  178. package/build/esm/types/emissions.js.map +1 -0
  179. package/build/esm/types/index.js +23 -0
  180. package/build/esm/types/index.js.map +1 -0
  181. package/build/esm/utils/ActionLifecycleTracker.js +178 -0
  182. package/build/esm/utils/ActionLifecycleTracker.js.map +1 -0
  183. package/build/esm/utils/CacheEfficiencyAnalyzer.js +198 -0
  184. package/build/esm/utils/CacheEfficiencyAnalyzer.js.map +1 -0
  185. package/build/esm/utils/CircularBuffer.js +96 -0
  186. package/build/esm/utils/CircularBuffer.js.map +1 -0
  187. package/build/esm/utils/ComponentContextCapture.js +215 -0
  188. package/build/esm/utils/ComponentContextCapture.js.map +1 -0
  189. package/build/esm/utils/ComponentPrimitiveDiscovery.js +173 -0
  190. package/build/esm/utils/ComponentPrimitiveDiscovery.js.map +1 -0
  191. package/build/esm/utils/ComponentQueryRegistry.js +340 -0
  192. package/build/esm/utils/ComponentQueryRegistry.js.map +1 -0
  193. package/build/esm/utils/ComputeMonitor.js +199 -0
  194. package/build/esm/utils/ComputeMonitor.js.map +1 -0
  195. package/build/esm/utils/EventTimeline.js +130 -0
  196. package/build/esm/utils/EventTimeline.js.map +1 -0
  197. package/build/esm/utils/LinkTraversalTracker.js +116 -0
  198. package/build/esm/utils/LinkTraversalTracker.js.map +1 -0
  199. package/build/esm/utils/MockDataGenerator.js +473 -0
  200. package/build/esm/utils/MockDataGenerator.js.map +1 -0
  201. package/build/esm/utils/ObservableClientMonitor.js +768 -0
  202. package/build/esm/utils/ObservableClientMonitor.js.map +1 -0
  203. package/build/esm/utils/PerformanceRecommendationEngine.js +185 -0
  204. package/build/esm/utils/PerformanceRecommendationEngine.js.map +1 -0
  205. package/build/esm/utils/PropertyAccessTracker.js +238 -0
  206. package/build/esm/utils/PropertyAccessTracker.js.map +1 -0
  207. package/build/esm/utils/RecommendationMatcher.js +53 -0
  208. package/build/esm/utils/RecommendationMatcher.js.map +1 -0
  209. package/build/esm/utils/SubscriptionTracker.js +132 -0
  210. package/build/esm/utils/SubscriptionTracker.js.map +1 -0
  211. package/build/esm/utils/UnusedFieldAnalyzer.js +186 -0
  212. package/build/esm/utils/UnusedFieldAnalyzer.js.map +1 -0
  213. package/build/esm/utils/WaterfallDetector.js +200 -0
  214. package/build/esm/utils/WaterfallDetector.js.map +1 -0
  215. package/build/esm/utils/computePayload.js +37 -0
  216. package/build/esm/utils/computePayload.js.map +1 -0
  217. package/build/esm/utils/computeRequest.js +29 -0
  218. package/build/esm/utils/computeRequest.js.map +1 -0
  219. package/build/esm/utils/format.js +69 -0
  220. package/build/esm/utils/format.js.map +1 -0
  221. package/build/esm/utils/logger.js +31 -0
  222. package/build/esm/utils/logger.js.map +1 -0
  223. package/build/esm/vite/constants.js +18 -0
  224. package/build/esm/vite/constants.js.map +1 -0
  225. package/build/esm/vite/hookInstaller.js +99 -0
  226. package/build/esm/vite/hookInstaller.js.map +1 -0
  227. package/build/esm/vite/index.js +77 -0
  228. package/build/esm/vite/index.js.map +1 -0
  229. package/build/types/DevToolsContext.d.ts +3 -0
  230. package/build/types/DevToolsContext.d.ts.map +1 -0
  231. package/build/types/components/ActionMetrics.d.ts +6 -0
  232. package/build/types/components/ActionMetrics.d.ts.map +1 -0
  233. package/build/types/components/BubbleChart.d.ts +10 -0
  234. package/build/types/components/BubbleChart.d.ts.map +1 -0
  235. package/build/types/components/CacheInspectorTab.d.ts +6 -0
  236. package/build/types/components/CacheInspectorTab.d.ts.map +1 -0
  237. package/build/types/components/CacheMetrics.d.ts +6 -0
  238. package/build/types/components/CacheMetrics.d.ts.map +1 -0
  239. package/build/types/components/ComponentCard.d.ts +13 -0
  240. package/build/types/components/ComponentCard.d.ts.map +1 -0
  241. package/build/types/components/ComputeTab.d.ts +6 -0
  242. package/build/types/components/ComputeTab.d.ts.map +1 -0
  243. package/build/types/components/CopyableCodeBlock.d.ts +7 -0
  244. package/build/types/components/CopyableCodeBlock.d.ts.map +1 -0
  245. package/build/types/components/DebuggingTab.d.ts +6 -0
  246. package/build/types/components/DebuggingTab.d.ts.map +1 -0
  247. package/build/types/components/HookRow.d.ts +9 -0
  248. package/build/types/components/HookRow.d.ts.map +1 -0
  249. package/build/types/components/ImprovementsTab.d.ts +7 -0
  250. package/build/types/components/ImprovementsTab.d.ts.map +1 -0
  251. package/build/types/components/InspectorSelectionHeader.d.ts +12 -0
  252. package/build/types/components/InspectorSelectionHeader.d.ts.map +1 -0
  253. package/build/types/components/InterceptTab.d.ts +126 -0
  254. package/build/types/components/InterceptTab.d.ts.map +1 -0
  255. package/build/types/components/IssueCard.d.ts +8 -0
  256. package/build/types/components/IssueCard.d.ts.map +1 -0
  257. package/build/types/components/LogEntryCard.d.ts +7 -0
  258. package/build/types/components/LogEntryCard.d.ts.map +1 -0
  259. package/build/types/components/MockEditor.d.ts +58 -0
  260. package/build/types/components/MockEditor.d.ts.map +1 -0
  261. package/build/types/components/MonitorErrorBoundary.d.ts +16 -0
  262. package/build/types/components/MonitorErrorBoundary.d.ts.map +1 -0
  263. package/build/types/components/MonitoringPanel.d.ts +8 -0
  264. package/build/types/components/MonitoringPanel.d.ts.map +1 -0
  265. package/build/types/components/ObjectLoadingMetrics.d.ts +7 -0
  266. package/build/types/components/ObjectLoadingMetrics.d.ts.map +1 -0
  267. package/build/types/components/OsdkAppErrorBoundary.d.ts +18 -0
  268. package/build/types/components/OsdkAppErrorBoundary.d.ts.map +1 -0
  269. package/build/types/components/OsdkDevTools.d.ts +2 -0
  270. package/build/types/components/OsdkDevTools.d.ts.map +1 -0
  271. package/build/types/components/OverrideEditor.d.ts +26 -0
  272. package/build/types/components/OverrideEditor.d.ts.map +1 -0
  273. package/build/types/components/PerformanceTab.d.ts +8 -0
  274. package/build/types/components/PerformanceTab.d.ts.map +1 -0
  275. package/build/types/components/PrimitiveSelectionPanel.d.ts +28 -0
  276. package/build/types/components/PrimitiveSelectionPanel.d.ts.map +1 -0
  277. package/build/types/components/issueTypes.d.ts +16 -0
  278. package/build/types/components/issueTypes.d.ts.map +1 -0
  279. package/build/types/components/resolveComponentName.d.ts +3 -0
  280. package/build/types/components/resolveComponentName.d.ts.map +1 -0
  281. package/build/types/components/testHelpers.d.ts +2 -0
  282. package/build/types/components/testHelpers.d.ts.map +1 -0
  283. package/build/types/css.d.d.ts +4 -0
  284. package/build/types/css.d.d.ts.map +1 -0
  285. package/build/types/fiber/DegradationNotice.d.ts +8 -0
  286. package/build/types/fiber/DegradationNotice.d.ts.map +1 -0
  287. package/build/types/fiber/DevtoolsHook.d.ts +7 -0
  288. package/build/types/fiber/DevtoolsHook.d.ts.map +1 -0
  289. package/build/types/fiber/FiberAccess.d.ts +2 -0
  290. package/build/types/fiber/FiberAccess.d.ts.map +1 -0
  291. package/build/types/fiber/FiberInspection.d.ts +6 -0
  292. package/build/types/fiber/FiberInspection.d.ts.map +1 -0
  293. package/build/types/fiber/FiberTags.d.ts +33 -0
  294. package/build/types/fiber/FiberTags.d.ts.map +1 -0
  295. package/build/types/fiber/HookStateInspector.d.ts +45 -0
  296. package/build/types/fiber/HookStateInspector.d.ts.map +1 -0
  297. package/build/types/fiber/SafeFiberOperation.d.ts +7 -0
  298. package/build/types/fiber/SafeFiberOperation.d.ts.map +1 -0
  299. package/build/types/fiber/capabilities.d.ts +38 -0
  300. package/build/types/fiber/capabilities.d.ts.map +1 -0
  301. package/build/types/fiber/traverseFiber.d.ts +5 -0
  302. package/build/types/fiber/traverseFiber.d.ts.map +1 -0
  303. package/build/types/fiber/types.d.ts +87 -0
  304. package/build/types/fiber/types.d.ts.map +1 -0
  305. package/build/types/fiber/validation.d.ts +10 -0
  306. package/build/types/fiber/validation.d.ts.map +1 -0
  307. package/build/types/hooks/createPollingStore.d.ts +5 -0
  308. package/build/types/hooks/createPollingStore.d.ts.map +1 -0
  309. package/build/types/hooks/useActiveComponents.d.ts +3 -0
  310. package/build/types/hooks/useActiveComponents.d.ts.map +1 -0
  311. package/build/types/hooks/useComponentRegistry.d.ts +3 -0
  312. package/build/types/hooks/useComponentRegistry.d.ts.map +1 -0
  313. package/build/types/hooks/useComputeSelectors.d.ts +7 -0
  314. package/build/types/hooks/useComputeSelectors.d.ts.map +1 -0
  315. package/build/types/hooks/useConsoleLogs.d.ts +7 -0
  316. package/build/types/hooks/useConsoleLogs.d.ts.map +1 -0
  317. package/build/types/hooks/useInspectorSelection.d.ts +9 -0
  318. package/build/types/hooks/useInspectorSelection.d.ts.map +1 -0
  319. package/build/types/hooks/useMetrics.d.ts +3 -0
  320. package/build/types/hooks/useMetrics.d.ts.map +1 -0
  321. package/build/types/hooks/usePersistedState.d.ts +1 -0
  322. package/build/types/hooks/usePersistedState.d.ts.map +1 -0
  323. package/build/types/hooks/useRecommendations.d.ts +10 -0
  324. package/build/types/hooks/useRecommendations.d.ts.map +1 -0
  325. package/build/types/hooks/useSharedTick.d.ts +1 -0
  326. package/build/types/hooks/useSharedTick.d.ts.map +1 -0
  327. package/build/types/hooks/useTimeElapsed.d.ts +1 -0
  328. package/build/types/hooks/useTimeElapsed.d.ts.map +1 -0
  329. package/build/types/hooks/useTrackerSubscription.d.ts +16 -0
  330. package/build/types/hooks/useTrackerSubscription.d.ts.map +1 -0
  331. package/build/types/hooks/useUnusedFieldAnalysis.d.ts +8 -0
  332. package/build/types/hooks/useUnusedFieldAnalysis.d.ts.map +1 -0
  333. package/build/types/index.d.ts +21 -0
  334. package/build/types/index.d.ts.map +1 -0
  335. package/build/types/inspector/ClickToInspectSystem.d.ts +40 -0
  336. package/build/types/inspector/ClickToInspectSystem.d.ts.map +1 -0
  337. package/build/types/inspector/components/ComponentLabel.d.ts +3 -0
  338. package/build/types/inspector/components/ComponentLabel.d.ts.map +1 -0
  339. package/build/types/inspector/components/InspectorBanner.d.ts +5 -0
  340. package/build/types/inspector/components/InspectorBanner.d.ts.map +1 -0
  341. package/build/types/inspector/components/InspectorOverlay.d.ts +3 -0
  342. package/build/types/inspector/components/InspectorOverlay.d.ts.map +1 -0
  343. package/build/types/inspector/components/SelectionHighlight.d.ts +3 -0
  344. package/build/types/inspector/components/SelectionHighlight.d.ts.map +1 -0
  345. package/build/types/inspector/createClickToInspect.d.ts +3 -0
  346. package/build/types/inspector/createClickToInspect.d.ts.map +1 -0
  347. package/build/types/inspector/hooks/useAnimatedBounds.d.ts +2 -0
  348. package/build/types/inspector/hooks/useAnimatedBounds.d.ts.map +1 -0
  349. package/build/types/inspector/index.d.ts +13 -0
  350. package/build/types/inspector/index.d.ts.map +1 -0
  351. package/build/types/inspector/inspectorController.d.ts +2 -0
  352. package/build/types/inspector/inspectorController.d.ts.map +1 -0
  353. package/build/types/inspector/types.d.ts +94 -0
  354. package/build/types/inspector/types.d.ts.map +1 -0
  355. package/build/types/inspector/utils/elementBounds.d.ts +3 -0
  356. package/build/types/inspector/utils/elementBounds.d.ts.map +1 -0
  357. package/build/types/inspector/utils/interpolation.d.ts +7 -0
  358. package/build/types/inspector/utils/interpolation.d.ts.map +1 -0
  359. package/build/types/inspector/utils/labelPositioning.d.ts +3 -0
  360. package/build/types/inspector/utils/labelPositioning.d.ts.map +1 -0
  361. package/build/types/mocking/MockCacheKeyGenerator.d.ts +41 -0
  362. package/build/types/mocking/MockCacheKeyGenerator.d.ts.map +1 -0
  363. package/build/types/mocking/MockManager.d.ts +103 -0
  364. package/build/types/mocking/MockManager.d.ts.map +1 -0
  365. package/build/types/prototyping/PrototypeOverrideStore.d.ts +33 -0
  366. package/build/types/prototyping/PrototypeOverrideStore.d.ts.map +1 -0
  367. package/build/types/prototyping/index.d.ts +1 -0
  368. package/build/types/prototyping/index.d.ts.map +1 -0
  369. package/build/types/public/vite.d.ts +2 -0
  370. package/build/types/public/vite.d.ts.map +1 -0
  371. package/build/types/register.d.ts +1 -0
  372. package/build/types/register.d.ts.map +1 -0
  373. package/build/types/scss.d.d.ts +6 -0
  374. package/build/types/scss.d.d.ts.map +1 -0
  375. package/build/types/store/ComputeStore.d.ts +47 -0
  376. package/build/types/store/ComputeStore.d.ts.map +1 -0
  377. package/build/types/store/ConsoleLogStore.d.ts +29 -0
  378. package/build/types/store/ConsoleLogStore.d.ts.map +1 -0
  379. package/build/types/store/MetricsStore.d.ts +42 -0
  380. package/build/types/store/MetricsStore.d.ts.map +1 -0
  381. package/build/types/store/MonitorStore.d.ts +86 -0
  382. package/build/types/store/MonitorStore.d.ts.map +1 -0
  383. package/build/types/store/SubscribableStore.d.ts +6 -0
  384. package/build/types/store/SubscribableStore.d.ts.map +1 -0
  385. package/build/types/store/WindowErrorStore.d.ts +32 -0
  386. package/build/types/store/WindowErrorStore.d.ts.map +1 -0
  387. package/build/types/styles.d.ts +1 -0
  388. package/build/types/styles.d.ts.map +1 -0
  389. package/build/types/types/compute.d.ts +73 -0
  390. package/build/types/types/compute.d.ts.map +1 -0
  391. package/build/types/types/emissions.d.ts +24 -0
  392. package/build/types/types/emissions.d.ts.map +1 -0
  393. package/build/types/types/index.d.ts +143 -0
  394. package/build/types/types/index.d.ts.map +1 -0
  395. package/build/types/utils/ActionLifecycleTracker.d.ts +39 -0
  396. package/build/types/utils/ActionLifecycleTracker.d.ts.map +1 -0
  397. package/build/types/utils/CacheEfficiencyAnalyzer.d.ts +45 -0
  398. package/build/types/utils/CacheEfficiencyAnalyzer.d.ts.map +1 -0
  399. package/build/types/utils/CircularBuffer.d.ts +18 -0
  400. package/build/types/utils/CircularBuffer.d.ts.map +1 -0
  401. package/build/types/utils/ComponentContextCapture.d.ts +29 -0
  402. package/build/types/utils/ComponentContextCapture.d.ts.map +1 -0
  403. package/build/types/utils/ComponentPrimitiveDiscovery.d.ts +62 -0
  404. package/build/types/utils/ComponentPrimitiveDiscovery.d.ts.map +1 -0
  405. package/build/types/utils/ComponentQueryRegistry.d.ts +91 -0
  406. package/build/types/utils/ComponentQueryRegistry.d.ts.map +1 -0
  407. package/build/types/utils/ComputeMonitor.d.ts +14 -0
  408. package/build/types/utils/ComputeMonitor.d.ts.map +1 -0
  409. package/build/types/utils/EventTimeline.d.ts +102 -0
  410. package/build/types/utils/EventTimeline.d.ts.map +1 -0
  411. package/build/types/utils/LinkTraversalTracker.d.ts +43 -0
  412. package/build/types/utils/LinkTraversalTracker.d.ts.map +1 -0
  413. package/build/types/utils/MockDataGenerator.d.ts +23 -0
  414. package/build/types/utils/MockDataGenerator.d.ts.map +1 -0
  415. package/build/types/utils/ObservableClientMonitor.d.ts +62 -0
  416. package/build/types/utils/ObservableClientMonitor.d.ts.map +1 -0
  417. package/build/types/utils/PerformanceRecommendationEngine.d.ts +67 -0
  418. package/build/types/utils/PerformanceRecommendationEngine.d.ts.map +1 -0
  419. package/build/types/utils/PropertyAccessTracker.d.ts +50 -0
  420. package/build/types/utils/PropertyAccessTracker.d.ts.map +1 -0
  421. package/build/types/utils/RecommendationMatcher.d.ts +5 -0
  422. package/build/types/utils/RecommendationMatcher.d.ts.map +1 -0
  423. package/build/types/utils/SubscriptionTracker.d.ts +17 -0
  424. package/build/types/utils/SubscriptionTracker.d.ts.map +1 -0
  425. package/build/types/utils/UnusedFieldAnalyzer.d.ts +46 -0
  426. package/build/types/utils/UnusedFieldAnalyzer.d.ts.map +1 -0
  427. package/build/types/utils/WaterfallDetector.d.ts +28 -0
  428. package/build/types/utils/WaterfallDetector.d.ts.map +1 -0
  429. package/build/types/utils/computePayload.d.ts +3 -0
  430. package/build/types/utils/computePayload.d.ts.map +1 -0
  431. package/build/types/utils/computeRequest.d.ts +20 -0
  432. package/build/types/utils/computeRequest.d.ts.map +1 -0
  433. package/build/types/utils/format.d.ts +5 -0
  434. package/build/types/utils/format.d.ts.map +1 -0
  435. package/build/types/utils/logger.d.ts +2 -0
  436. package/build/types/utils/logger.d.ts.map +1 -0
  437. package/build/types/vite/constants.d.ts +1 -0
  438. package/build/types/vite/constants.d.ts.map +1 -0
  439. package/build/types/vite/hookInstaller.d.ts +1 -0
  440. package/build/types/vite/hookInstaller.d.ts.map +1 -0
  441. package/build/types/vite/index.d.ts +20 -0
  442. package/build/types/vite/index.d.ts.map +1 -0
  443. package/package.json +114 -0
@@ -0,0 +1,428 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { CircularBuffer } from "../utils/CircularBuffer.js";
18
+ import { SubscribableStore } from "./SubscribableStore.js";
19
+ export class MetricsStore extends SubscribableStore {
20
+ pendingUpdates = [];
21
+ isProcessing = false;
22
+ lastSnapshot = null;
23
+ intervalId = null;
24
+ subscriberCount = 0;
25
+ actionErrors = [];
26
+ cachedAvgNetworkTime = 100;
27
+ cachedAvgBytesPerObject = 1024;
28
+ networkTimeDirty = true;
29
+ bytesPerObjectDirty = true;
30
+ constructor(maxOperations = 1000, timeSeriesSize = 60) {
31
+ super();
32
+ this.maxOperations = maxOperations;
33
+ this.timeSeriesSize = timeSeriesSize;
34
+ this.operations = new CircularBuffer(maxOperations);
35
+ this.aggregates = {
36
+ cacheHits: 0,
37
+ cacheMisses: 0,
38
+ deduplications: 0,
39
+ optimisticUpdates: 0,
40
+ totalResponseTime: 0,
41
+ cachedResponseTime: 0,
42
+ networkResponseTime: 0,
43
+ requestsSaved: 0,
44
+ bytesServedFromCache: 0,
45
+ totalObjectsFromCache: 0,
46
+ totalObjectsFromNetwork: 0,
47
+ revalidations: 0,
48
+ actionCount: 0,
49
+ configuredOptimisticActionCount: 0,
50
+ optimisticActionCount: 0,
51
+ rollbackActionCount: 0,
52
+ totalOptimisticRenderTime: 0,
53
+ totalServerRoundTripTime: 0,
54
+ totalPerceivedSpeedup: 0,
55
+ totalOptimisticObjectsAffected: 0,
56
+ validationCount: 0,
57
+ totalValidationTime: 0
58
+ };
59
+ this.timeSeries = {
60
+ timestamps: [],
61
+ cacheHits: [],
62
+ cacheMisses: [],
63
+ revalidations: [],
64
+ deduplications: []
65
+ };
66
+ }
67
+ recordCacheHit(signature, responseTime, metadata, objectCount = 1) {
68
+ const operation = {
69
+ id: crypto.randomUUID(),
70
+ type: "cache-hit",
71
+ signature,
72
+ timestamp: Date.now(),
73
+ responseTime,
74
+ saved: this.estimateNetworkTime(signature) - responseTime,
75
+ metadata,
76
+ objectCount
77
+ };
78
+ this.queueOperation(operation);
79
+ }
80
+ recordCacheMiss(signature, responseTime, metadata, objectCount = 1) {
81
+ const operation = {
82
+ id: crypto.randomUUID(),
83
+ type: "cache-miss",
84
+ signature,
85
+ timestamp: Date.now(),
86
+ responseTime,
87
+ metadata,
88
+ objectCount
89
+ };
90
+ this.queueOperation(operation);
91
+ }
92
+ recordRevalidation(signature, responseTime, metadata, objectCount = 1) {
93
+ const operation = {
94
+ id: crypto.randomUUID(),
95
+ type: "revalidation",
96
+ signature,
97
+ timestamp: Date.now(),
98
+ responseTime,
99
+ metadata,
100
+ objectCount
101
+ };
102
+ this.queueOperation(operation);
103
+ }
104
+ recordDeduplication(signature, metadata) {
105
+ const operation = {
106
+ id: crypto.randomUUID(),
107
+ type: "deduplication",
108
+ signature,
109
+ timestamp: Date.now(),
110
+ saved: this.estimateNetworkTime(signature),
111
+ metadata
112
+ };
113
+ this.queueOperation(operation);
114
+ }
115
+ recordOptimisticUpdate(signature, metadata) {
116
+ const operation = {
117
+ id: crypto.randomUUID(),
118
+ type: "optimistic-update",
119
+ signature,
120
+ timestamp: Date.now(),
121
+ saved: this.estimateNetworkTime(signature),
122
+ metadata
123
+ };
124
+ this.queueOperation(operation);
125
+ }
126
+ recordActionLifecycle(operation) {
127
+ this.queueOperation(operation);
128
+ }
129
+ recordActionValidation(signature, duration, metadata) {
130
+ const operation = {
131
+ id: crypto.randomUUID(),
132
+ type: "action-validation",
133
+ signature,
134
+ timestamp: Date.now(),
135
+ responseTime: duration,
136
+ metadata,
137
+ actionName: metadata?.actionName
138
+ };
139
+ this.queueOperation(operation);
140
+ }
141
+ getSnapshot() {
142
+ if (this.lastSnapshot) {
143
+ return this.lastSnapshot;
144
+ }
145
+ const snapshot = {
146
+ recent: this.operations.toArray(),
147
+ aggregates: {
148
+ ...this.aggregates
149
+ },
150
+ rates: this.calculateRates(),
151
+ timeSeries: {
152
+ timestamps: [...this.timeSeries.timestamps],
153
+ cacheHits: [...this.timeSeries.cacheHits],
154
+ cacheMisses: [...this.timeSeries.cacheMisses],
155
+ revalidations: [...this.timeSeries.revalidations],
156
+ deduplications: [...this.timeSeries.deduplications]
157
+ }
158
+ };
159
+ this.lastSnapshot = snapshot;
160
+ return snapshot;
161
+ }
162
+ reset() {
163
+ this.operations.clear();
164
+ Object.assign(this.aggregates, {
165
+ cacheHits: 0,
166
+ cacheMisses: 0,
167
+ deduplications: 0,
168
+ optimisticUpdates: 0,
169
+ totalResponseTime: 0,
170
+ cachedResponseTime: 0,
171
+ networkResponseTime: 0,
172
+ requestsSaved: 0,
173
+ bytesServedFromCache: 0,
174
+ totalObjectsFromCache: 0,
175
+ totalObjectsFromNetwork: 0,
176
+ revalidations: 0,
177
+ actionCount: 0,
178
+ configuredOptimisticActionCount: 0,
179
+ optimisticActionCount: 0,
180
+ rollbackActionCount: 0,
181
+ totalOptimisticRenderTime: 0,
182
+ totalServerRoundTripTime: 0,
183
+ totalPerceivedSpeedup: 0,
184
+ totalOptimisticObjectsAffected: 0,
185
+ validationCount: 0,
186
+ totalValidationTime: 0
187
+ });
188
+ this.timeSeries.timestamps.length = 0;
189
+ this.timeSeries.cacheHits.length = 0;
190
+ this.timeSeries.cacheMisses.length = 0;
191
+ this.timeSeries.revalidations.length = 0;
192
+ this.timeSeries.deduplications.length = 0;
193
+ this.actionErrors = [];
194
+ this.lastSnapshot = null;
195
+ this.notifySubscribers();
196
+ }
197
+ subscribe(callback) {
198
+ const unsub = super.subscribe(callback);
199
+ this.subscriberCount++;
200
+ if (this.subscriberCount === 1 && this.intervalId == null) {
201
+ this.intervalId = setInterval(() => this.updateTimeSeries(), 1000);
202
+ }
203
+ return () => {
204
+ unsub();
205
+ this.subscriberCount--;
206
+ if (this.subscriberCount === 0 && this.intervalId != null) {
207
+ clearInterval(this.intervalId);
208
+ this.intervalId = null;
209
+ }
210
+ };
211
+ }
212
+ dispose() {
213
+ if (this.intervalId) {
214
+ clearInterval(this.intervalId);
215
+ this.intervalId = null;
216
+ }
217
+ this.reset();
218
+ this.clearSubscribers();
219
+ this.subscriberCount = 0;
220
+ this.pendingUpdates = [];
221
+ this.isProcessing = false;
222
+ }
223
+ queueOperation(operation) {
224
+ this.pendingUpdates.push(operation);
225
+ if (!this.isProcessing) {
226
+ this.isProcessing = true;
227
+ this.scheduleProcessBatch();
228
+ }
229
+ }
230
+ scheduleProcessBatch() {
231
+ if (typeof requestIdleCallback !== "undefined") {
232
+ requestIdleCallback(() => this.processBatch());
233
+ } else {
234
+ setTimeout(() => this.processBatch(), 0);
235
+ }
236
+ }
237
+ processBatch() {
238
+ const batch = this.pendingUpdates.splice(0, 100);
239
+ for (const operation of batch) {
240
+ this.operations.push(operation);
241
+ this.updateAggregates(operation);
242
+ }
243
+ this.lastSnapshot = null;
244
+ this.isProcessing = false;
245
+ if (this.pendingUpdates.length > 0) {
246
+ this.scheduleProcessBatch();
247
+ }
248
+ this.notifySubscribers();
249
+ }
250
+ updateAggregates(operation) {
251
+ const objectCount = operation.objectCount ?? 0;
252
+ switch (operation.type) {
253
+ case "cache-hit":
254
+ this.aggregates.cacheHits++;
255
+ this.aggregates.totalObjectsFromCache += objectCount;
256
+ if (operation.responseTime != null) {
257
+ this.aggregates.cachedResponseTime += operation.responseTime;
258
+ this.aggregates.totalResponseTime += operation.responseTime;
259
+ }
260
+ if (operation.saved) {
261
+ this.aggregates.requestsSaved++;
262
+ this.aggregates.bytesServedFromCache += this.estimateBytes(operation.signature);
263
+ }
264
+ break;
265
+ case "cache-miss":
266
+ this.aggregates.cacheMisses++;
267
+ this.aggregates.totalObjectsFromNetwork += objectCount;
268
+ this.networkTimeDirty = true;
269
+ this.bytesPerObjectDirty = true;
270
+ if (operation.responseTime != null) {
271
+ this.aggregates.networkResponseTime += operation.responseTime;
272
+ this.aggregates.totalResponseTime += operation.responseTime;
273
+ }
274
+ break;
275
+ case "revalidation":
276
+ this.aggregates.revalidations++;
277
+ this.aggregates.totalObjectsFromCache += objectCount;
278
+ this.networkTimeDirty = true;
279
+ if (operation.responseTime != null) {
280
+ this.aggregates.networkResponseTime += operation.responseTime;
281
+ this.aggregates.totalResponseTime += operation.responseTime;
282
+ }
283
+ break;
284
+ case "deduplication":
285
+ this.aggregates.deduplications++;
286
+ this.aggregates.requestsSaved++;
287
+ break;
288
+ case "optimistic-update":
289
+ this.aggregates.optimisticUpdates++;
290
+ break;
291
+ case "action":
292
+ this.aggregates.actionCount++;
293
+ if (operation.optimisticConfigured) {
294
+ this.aggregates.configuredOptimisticActionCount++;
295
+ }
296
+ if (operation.optimisticObserved) {
297
+ this.aggregates.optimisticActionCount++;
298
+ }
299
+ if (operation.rollback) {
300
+ this.aggregates.rollbackActionCount++;
301
+ }
302
+ if (operation.optimisticRenderTime != null) {
303
+ this.aggregates.totalOptimisticRenderTime += operation.optimisticRenderTime;
304
+ }
305
+ if (operation.serverRoundTripTime != null) {
306
+ this.aggregates.totalServerRoundTripTime += operation.serverRoundTripTime;
307
+ }
308
+ if (operation.perceivedSpeedup != null) {
309
+ this.aggregates.totalPerceivedSpeedup += operation.perceivedSpeedup;
310
+ }
311
+ if (operation.optimisticObjectsAffected != null) {
312
+ this.aggregates.totalOptimisticObjectsAffected += operation.optimisticObjectsAffected;
313
+ }
314
+ break;
315
+ case "action-validation":
316
+ this.aggregates.validationCount++;
317
+ if (operation.responseTime != null) {
318
+ this.aggregates.totalValidationTime += operation.responseTime;
319
+ }
320
+ break;
321
+ }
322
+ }
323
+ calculateRates() {
324
+ const total = this.aggregates.cacheHits + this.aggregates.cacheMisses + this.aggregates.revalidations;
325
+ const totalRequests = total + this.aggregates.deduplications;
326
+ const actionCount = this.aggregates.actionCount;
327
+ const optimisticActionCount = this.aggregates.optimisticActionCount;
328
+ const averageValidationTime = this.aggregates.validationCount > 0 ? this.aggregates.totalValidationTime / this.aggregates.validationCount : 0;
329
+ const averageServerRoundTripTime = actionCount > 0 ? this.aggregates.totalServerRoundTripTime / actionCount : 0;
330
+ return {
331
+ cacheHitRate: total > 0 ? (this.aggregates.cacheHits + this.aggregates.revalidations) / total : 0,
332
+ deduplicationRate: totalRequests > 0 ? this.aggregates.deduplications / totalRequests : 0,
333
+ optimisticUpdateRate: totalRequests > 0 ? this.aggregates.optimisticUpdates / totalRequests : 0,
334
+ averageResponseTime: total > 0 ? this.aggregates.totalResponseTime / total : 0,
335
+ averageCachedResponseTime: this.aggregates.cacheHits > 0 ? this.aggregates.cachedResponseTime / this.aggregates.cacheHits : 0,
336
+ optimisticActionCoverage: actionCount > 0 ? optimisticActionCount / actionCount : 0,
337
+ configuredOptimisticActionRate: actionCount > 0 ? this.aggregates.configuredOptimisticActionCount / actionCount : 0,
338
+ rollbackRate: actionCount > 0 ? this.aggregates.rollbackActionCount / actionCount : 0,
339
+ averageOptimisticRenderTime: optimisticActionCount > 0 ? this.aggregates.totalOptimisticRenderTime / optimisticActionCount : 0,
340
+ averageServerRoundTripTime,
341
+ averagePerceivedSpeedup: optimisticActionCount > 0 ? this.aggregates.totalPerceivedSpeedup / optimisticActionCount : 0,
342
+ averageValidationTime,
343
+ validationTimeSaved: Math.max(0, averageServerRoundTripTime - averageValidationTime)
344
+ };
345
+ }
346
+ updateTimeSeries() {
347
+ const now = Date.now();
348
+ const currentSecond = Math.floor(now / 1000) * 1000;
349
+ const lastTimestamp = this.timeSeries.timestamps[this.timeSeries.timestamps.length - 1];
350
+ if (lastTimestamp === currentSecond) {
351
+ return;
352
+ }
353
+ if (this.timeSeries.timestamps.length >= this.timeSeriesSize) {
354
+ this.timeSeries.timestamps.shift();
355
+ this.timeSeries.cacheHits.shift();
356
+ this.timeSeries.cacheMisses.shift();
357
+ this.timeSeries.revalidations.shift();
358
+ this.timeSeries.deduplications.shift();
359
+ }
360
+ const recentOps = this.operations.getLast(100);
361
+ let cacheHits = 0;
362
+ let cacheMisses = 0;
363
+ let revalidations = 0;
364
+ let deduplications = 0;
365
+ for (const op of recentOps) {
366
+ if (op.timestamp >= currentSecond - 1000 && op.timestamp < currentSecond) {
367
+ switch (op.type) {
368
+ case "cache-hit":
369
+ cacheHits++;
370
+ break;
371
+ case "cache-miss":
372
+ cacheMisses++;
373
+ break;
374
+ case "revalidation":
375
+ revalidations++;
376
+ break;
377
+ case "deduplication":
378
+ deduplications++;
379
+ break;
380
+ }
381
+ }
382
+ }
383
+ this.timeSeries.timestamps.push(currentSecond);
384
+ this.timeSeries.cacheHits.push(cacheHits);
385
+ this.timeSeries.cacheMisses.push(cacheMisses);
386
+ this.timeSeries.revalidations.push(revalidations);
387
+ this.timeSeries.deduplications.push(deduplications);
388
+ this.lastSnapshot = null;
389
+ this.notifySubscribers();
390
+ }
391
+ estimateNetworkTime() {
392
+ if (this.networkTimeDirty) {
393
+ const recentMisses = this.operations.getLast(100).filter(op => op.type === "cache-miss" && op.responseTime != null);
394
+ if (recentMisses.length > 0) {
395
+ const totalTime = recentMisses.reduce((sum, op) => sum + (op.responseTime ?? 0), 0);
396
+ this.cachedAvgNetworkTime = totalTime / recentMisses.length;
397
+ }
398
+ this.networkTimeDirty = false;
399
+ }
400
+ return this.cachedAvgNetworkTime;
401
+ }
402
+ estimateBytes() {
403
+ if (this.bytesPerObjectDirty) {
404
+ const recentMisses = this.operations.getLast(100).filter(op => op.type === "cache-miss" && op.objectCount != null && op.objectCount > 0);
405
+ if (recentMisses.length > 0) {
406
+ const avgObjectCount = recentMisses.reduce((sum, op) => sum + (op.objectCount ?? 0), 0) / recentMisses.length;
407
+ this.cachedAvgBytesPerObject = avgObjectCount * 1024;
408
+ }
409
+ this.bytesPerObjectDirty = false;
410
+ }
411
+ return this.cachedAvgBytesPerObject;
412
+ }
413
+ recordActionError(error) {
414
+ this.actionErrors.push(error);
415
+ if (this.actionErrors.length > 100) {
416
+ this.actionErrors.shift();
417
+ }
418
+ this.notifySubscribers();
419
+ }
420
+ getActionErrors() {
421
+ return [...this.actionErrors].reverse();
422
+ }
423
+ getCacheHitRate() {
424
+ const total = this.aggregates.cacheHits + this.aggregates.cacheMisses + this.aggregates.revalidations;
425
+ return total > 0 ? (this.aggregates.cacheHits + this.aggregates.revalidations) / total : 0;
426
+ }
427
+ }
428
+ //# sourceMappingURL=MetricsStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MetricsStore.js","names":["CircularBuffer","SubscribableStore","MetricsStore","pendingUpdates","isProcessing","lastSnapshot","intervalId","subscriberCount","actionErrors","cachedAvgNetworkTime","cachedAvgBytesPerObject","networkTimeDirty","bytesPerObjectDirty","constructor","maxOperations","timeSeriesSize","operations","aggregates","cacheHits","cacheMisses","deduplications","optimisticUpdates","totalResponseTime","cachedResponseTime","networkResponseTime","requestsSaved","bytesServedFromCache","totalObjectsFromCache","totalObjectsFromNetwork","revalidations","actionCount","configuredOptimisticActionCount","optimisticActionCount","rollbackActionCount","totalOptimisticRenderTime","totalServerRoundTripTime","totalPerceivedSpeedup","totalOptimisticObjectsAffected","validationCount","totalValidationTime","timeSeries","timestamps","recordCacheHit","signature","responseTime","metadata","objectCount","operation","id","crypto","randomUUID","type","timestamp","Date","now","saved","estimateNetworkTime","queueOperation","recordCacheMiss","recordRevalidation","recordDeduplication","recordOptimisticUpdate","recordActionLifecycle","recordActionValidation","duration","actionName","getSnapshot","snapshot","recent","toArray","rates","calculateRates","reset","clear","Object","assign","length","notifySubscribers","subscribe","callback","unsub","setInterval","updateTimeSeries","clearInterval","dispose","clearSubscribers","push","scheduleProcessBatch","requestIdleCallback","processBatch","setTimeout","batch","splice","updateAggregates","estimateBytes","optimisticConfigured","optimisticObserved","rollback","optimisticRenderTime","serverRoundTripTime","perceivedSpeedup","optimisticObjectsAffected","total","totalRequests","averageValidationTime","averageServerRoundTripTime","cacheHitRate","deduplicationRate","optimisticUpdateRate","averageResponseTime","averageCachedResponseTime","optimisticActionCoverage","configuredOptimisticActionRate","rollbackRate","averageOptimisticRenderTime","averagePerceivedSpeedup","validationTimeSaved","Math","max","currentSecond","floor","lastTimestamp","shift","recentOps","getLast","op","recentMisses","filter","totalTime","reduce","sum","avgObjectCount","recordActionError","error","getActionErrors","reverse","getCacheHitRate"],"sources":["MetricsStore.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ActionError,\n MetricRates,\n MetricsSnapshot,\n Operation,\n OperationMetadata,\n} from \"../types/index.js\";\nimport { CircularBuffer } from \"../utils/CircularBuffer.js\";\nimport { SubscribableStore } from \"./SubscribableStore.js\";\n\nexport class MetricsStore extends SubscribableStore {\n private readonly maxOperations: number;\n private readonly timeSeriesSize: number;\n private readonly operations: CircularBuffer<Operation>;\n private readonly aggregates: {\n cacheHits: number;\n cacheMisses: number;\n deduplications: number;\n optimisticUpdates: number;\n totalResponseTime: number;\n cachedResponseTime: number;\n networkResponseTime: number;\n requestsSaved: number;\n bytesServedFromCache: number;\n totalObjectsFromCache: number;\n totalObjectsFromNetwork: number;\n revalidations: number;\n actionCount: number;\n configuredOptimisticActionCount: number;\n optimisticActionCount: number;\n rollbackActionCount: number;\n totalOptimisticRenderTime: number;\n totalServerRoundTripTime: number;\n totalPerceivedSpeedup: number;\n totalOptimisticObjectsAffected: number;\n validationCount: number;\n totalValidationTime: number;\n };\n private readonly timeSeries: {\n timestamps: number[];\n cacheHits: number[];\n cacheMisses: number[];\n revalidations: number[];\n deduplications: number[];\n };\n\n private pendingUpdates: Operation[] = [];\n private isProcessing = false;\n private lastSnapshot: MetricsSnapshot | null = null;\n private intervalId: ReturnType<typeof setInterval> | null = null;\n private subscriberCount = 0;\n private actionErrors: ActionError[] = [];\n private cachedAvgNetworkTime: number = 100;\n private cachedAvgBytesPerObject: number = 1024;\n private networkTimeDirty = true;\n private bytesPerObjectDirty = true;\n\n constructor(maxOperations: number = 1000, timeSeriesSize: number = 60) {\n super();\n this.maxOperations = maxOperations;\n this.timeSeriesSize = timeSeriesSize;\n this.operations = new CircularBuffer(maxOperations);\n this.aggregates = {\n cacheHits: 0,\n cacheMisses: 0,\n deduplications: 0,\n optimisticUpdates: 0,\n totalResponseTime: 0,\n cachedResponseTime: 0,\n networkResponseTime: 0,\n requestsSaved: 0,\n bytesServedFromCache: 0,\n totalObjectsFromCache: 0,\n totalObjectsFromNetwork: 0,\n revalidations: 0,\n actionCount: 0,\n configuredOptimisticActionCount: 0,\n optimisticActionCount: 0,\n rollbackActionCount: 0,\n totalOptimisticRenderTime: 0,\n totalServerRoundTripTime: 0,\n totalPerceivedSpeedup: 0,\n totalOptimisticObjectsAffected: 0,\n validationCount: 0,\n totalValidationTime: 0,\n };\n this.timeSeries = {\n timestamps: [],\n cacheHits: [],\n cacheMisses: [],\n revalidations: [],\n deduplications: [],\n };\n }\n\n recordCacheHit(\n signature: string,\n responseTime: number,\n metadata?: OperationMetadata,\n objectCount: number = 1,\n ): void {\n const operation: Operation = {\n id: crypto.randomUUID(),\n type: \"cache-hit\",\n signature,\n timestamp: Date.now(),\n responseTime,\n saved: this.estimateNetworkTime(signature) - responseTime,\n metadata,\n objectCount,\n };\n\n this.queueOperation(operation);\n }\n\n recordCacheMiss(\n signature: string,\n responseTime: number,\n metadata?: OperationMetadata,\n objectCount: number = 1,\n ): void {\n const operation: Operation = {\n id: crypto.randomUUID(),\n type: \"cache-miss\",\n signature,\n timestamp: Date.now(),\n responseTime,\n metadata,\n objectCount,\n };\n\n this.queueOperation(operation);\n }\n\n recordRevalidation(\n signature: string,\n responseTime: number,\n metadata?: OperationMetadata,\n objectCount: number = 1,\n ): void {\n const operation: Operation = {\n id: crypto.randomUUID(),\n type: \"revalidation\",\n signature,\n timestamp: Date.now(),\n responseTime,\n metadata,\n objectCount,\n };\n\n this.queueOperation(operation);\n }\n\n recordDeduplication(\n signature: string,\n metadata?: OperationMetadata,\n ): void {\n const operation: Operation = {\n id: crypto.randomUUID(),\n type: \"deduplication\",\n signature,\n timestamp: Date.now(),\n saved: this.estimateNetworkTime(signature),\n metadata,\n };\n\n this.queueOperation(operation);\n }\n\n recordOptimisticUpdate(\n signature: string,\n metadata?: OperationMetadata,\n ): void {\n const operation: Operation = {\n id: crypto.randomUUID(),\n type: \"optimistic-update\",\n signature,\n timestamp: Date.now(),\n saved: this.estimateNetworkTime(signature),\n metadata,\n };\n\n this.queueOperation(operation);\n }\n\n recordActionLifecycle(operation: Operation): void {\n this.queueOperation(operation);\n }\n\n recordActionValidation(\n signature: string,\n duration: number,\n metadata?: OperationMetadata,\n ): void {\n const operation: Operation = {\n id: crypto.randomUUID(),\n type: \"action-validation\",\n signature,\n timestamp: Date.now(),\n responseTime: duration,\n metadata,\n actionName: metadata?.actionName,\n };\n\n this.queueOperation(operation);\n }\n\n getSnapshot(): MetricsSnapshot {\n if (this.lastSnapshot) {\n return this.lastSnapshot;\n }\n\n const snapshot: MetricsSnapshot = {\n recent: this.operations.toArray(),\n aggregates: { ...this.aggregates },\n rates: this.calculateRates(),\n timeSeries: {\n timestamps: [...this.timeSeries.timestamps],\n cacheHits: [...this.timeSeries.cacheHits],\n cacheMisses: [...this.timeSeries.cacheMisses],\n revalidations: [...this.timeSeries.revalidations],\n deduplications: [...this.timeSeries.deduplications],\n },\n };\n\n this.lastSnapshot = snapshot;\n return snapshot;\n }\n\n reset(): void {\n this.operations.clear();\n Object.assign(this.aggregates, {\n cacheHits: 0,\n cacheMisses: 0,\n deduplications: 0,\n optimisticUpdates: 0,\n totalResponseTime: 0,\n cachedResponseTime: 0,\n networkResponseTime: 0,\n requestsSaved: 0,\n bytesServedFromCache: 0,\n totalObjectsFromCache: 0,\n totalObjectsFromNetwork: 0,\n revalidations: 0,\n actionCount: 0,\n configuredOptimisticActionCount: 0,\n optimisticActionCount: 0,\n rollbackActionCount: 0,\n totalOptimisticRenderTime: 0,\n totalServerRoundTripTime: 0,\n totalPerceivedSpeedup: 0,\n totalOptimisticObjectsAffected: 0,\n validationCount: 0,\n totalValidationTime: 0,\n });\n this.timeSeries.timestamps.length = 0;\n this.timeSeries.cacheHits.length = 0;\n this.timeSeries.cacheMisses.length = 0;\n this.timeSeries.revalidations.length = 0;\n this.timeSeries.deduplications.length = 0;\n this.actionErrors = [];\n this.lastSnapshot = null;\n this.notifySubscribers();\n }\n\n override subscribe(callback: () => void): () => void {\n const unsub = super.subscribe(callback);\n this.subscriberCount++;\n if (this.subscriberCount === 1 && this.intervalId == null) {\n this.intervalId = setInterval(() => this.updateTimeSeries(), 1000);\n }\n return () => {\n unsub();\n this.subscriberCount--;\n if (this.subscriberCount === 0 && this.intervalId != null) {\n clearInterval(this.intervalId);\n this.intervalId = null;\n }\n };\n }\n\n dispose(): void {\n if (this.intervalId) {\n clearInterval(this.intervalId);\n this.intervalId = null;\n }\n\n this.reset();\n this.clearSubscribers();\n this.subscriberCount = 0;\n this.pendingUpdates = [];\n this.isProcessing = false;\n }\n\n private queueOperation(operation: Operation): void {\n this.pendingUpdates.push(operation);\n\n if (!this.isProcessing) {\n this.isProcessing = true;\n this.scheduleProcessBatch();\n }\n }\n\n private scheduleProcessBatch(): void {\n if (typeof requestIdleCallback !== \"undefined\") {\n requestIdleCallback(() => this.processBatch());\n } else {\n setTimeout(() => this.processBatch(), 0);\n }\n }\n\n private processBatch(): void {\n const batch = this.pendingUpdates.splice(0, 100);\n\n for (const operation of batch) {\n this.operations.push(operation);\n this.updateAggregates(operation);\n }\n\n this.lastSnapshot = null;\n this.isProcessing = false;\n\n if (this.pendingUpdates.length > 0) {\n this.scheduleProcessBatch();\n }\n\n this.notifySubscribers();\n }\n\n private updateAggregates(operation: Operation): void {\n const objectCount = operation.objectCount ?? 0;\n\n switch (operation.type) {\n case \"cache-hit\":\n this.aggregates.cacheHits++;\n this.aggregates.totalObjectsFromCache += objectCount;\n if (operation.responseTime != null) {\n this.aggregates.cachedResponseTime += operation.responseTime;\n this.aggregates.totalResponseTime += operation.responseTime;\n }\n if (operation.saved) {\n this.aggregates.requestsSaved++;\n this.aggregates.bytesServedFromCache += this.estimateBytes(\n operation.signature,\n );\n }\n break;\n\n case \"cache-miss\":\n this.aggregates.cacheMisses++;\n this.aggregates.totalObjectsFromNetwork += objectCount;\n this.networkTimeDirty = true;\n this.bytesPerObjectDirty = true;\n if (operation.responseTime != null) {\n this.aggregates.networkResponseTime += operation.responseTime;\n this.aggregates.totalResponseTime += operation.responseTime;\n }\n break;\n\n case \"revalidation\":\n this.aggregates.revalidations++;\n this.aggregates.totalObjectsFromCache += objectCount;\n this.networkTimeDirty = true;\n if (operation.responseTime != null) {\n this.aggregates.networkResponseTime += operation.responseTime;\n this.aggregates.totalResponseTime += operation.responseTime;\n }\n break;\n\n case \"deduplication\":\n this.aggregates.deduplications++;\n this.aggregates.requestsSaved++;\n break;\n\n case \"optimistic-update\":\n this.aggregates.optimisticUpdates++;\n break;\n\n case \"action\":\n this.aggregates.actionCount++;\n if (operation.optimisticConfigured) {\n this.aggregates.configuredOptimisticActionCount++;\n }\n if (operation.optimisticObserved) {\n this.aggregates.optimisticActionCount++;\n }\n if (operation.rollback) {\n this.aggregates.rollbackActionCount++;\n }\n if (operation.optimisticRenderTime != null) {\n this.aggregates.totalOptimisticRenderTime +=\n operation.optimisticRenderTime;\n }\n if (operation.serverRoundTripTime != null) {\n this.aggregates.totalServerRoundTripTime +=\n operation.serverRoundTripTime;\n }\n if (operation.perceivedSpeedup != null) {\n this.aggregates.totalPerceivedSpeedup += operation.perceivedSpeedup;\n }\n if (operation.optimisticObjectsAffected != null) {\n this.aggregates.totalOptimisticObjectsAffected +=\n operation.optimisticObjectsAffected;\n }\n break;\n\n case \"action-validation\":\n this.aggregates.validationCount++;\n if (operation.responseTime != null) {\n this.aggregates.totalValidationTime += operation.responseTime;\n }\n break;\n }\n }\n\n private calculateRates(): MetricRates {\n const total = this.aggregates.cacheHits + this.aggregates.cacheMisses\n + this.aggregates.revalidations;\n const totalRequests = total + this.aggregates.deduplications;\n const actionCount = this.aggregates.actionCount;\n const optimisticActionCount = this.aggregates.optimisticActionCount;\n const averageValidationTime = this.aggregates.validationCount > 0\n ? this.aggregates.totalValidationTime / this.aggregates.validationCount\n : 0;\n const averageServerRoundTripTime = actionCount > 0\n ? this.aggregates.totalServerRoundTripTime / actionCount\n : 0;\n\n return {\n cacheHitRate: total > 0\n ? (this.aggregates.cacheHits + this.aggregates.revalidations) / total\n : 0,\n deduplicationRate: totalRequests > 0\n ? this.aggregates.deduplications / totalRequests\n : 0,\n optimisticUpdateRate: totalRequests > 0\n ? this.aggregates.optimisticUpdates / totalRequests\n : 0,\n averageResponseTime: total > 0\n ? this.aggregates.totalResponseTime / total\n : 0,\n averageCachedResponseTime: this.aggregates.cacheHits > 0\n ? this.aggregates.cachedResponseTime / this.aggregates.cacheHits\n : 0,\n optimisticActionCoverage: actionCount > 0\n ? optimisticActionCount / actionCount\n : 0,\n configuredOptimisticActionRate: actionCount > 0\n ? this.aggregates.configuredOptimisticActionCount / actionCount\n : 0,\n rollbackRate: actionCount > 0\n ? this.aggregates.rollbackActionCount / actionCount\n : 0,\n averageOptimisticRenderTime: optimisticActionCount > 0\n ? this.aggregates.totalOptimisticRenderTime / optimisticActionCount\n : 0,\n averageServerRoundTripTime,\n averagePerceivedSpeedup: optimisticActionCount > 0\n ? this.aggregates.totalPerceivedSpeedup / optimisticActionCount\n : 0,\n averageValidationTime,\n validationTimeSaved: Math.max(\n 0,\n averageServerRoundTripTime - averageValidationTime,\n ),\n };\n }\n\n private updateTimeSeries(): void {\n const now = Date.now();\n const currentSecond = Math.floor(now / 1000) * 1000;\n\n const lastTimestamp =\n this.timeSeries.timestamps[this.timeSeries.timestamps.length - 1];\n if (lastTimestamp === currentSecond) {\n return;\n }\n\n if (this.timeSeries.timestamps.length >= this.timeSeriesSize) {\n this.timeSeries.timestamps.shift();\n this.timeSeries.cacheHits.shift();\n this.timeSeries.cacheMisses.shift();\n this.timeSeries.revalidations.shift();\n this.timeSeries.deduplications.shift();\n }\n\n const recentOps = this.operations.getLast(100);\n let cacheHits = 0;\n let cacheMisses = 0;\n let revalidations = 0;\n let deduplications = 0;\n\n for (const op of recentOps) {\n if (\n op.timestamp >= currentSecond - 1000 && op.timestamp < currentSecond\n ) {\n switch (op.type) {\n case \"cache-hit\":\n cacheHits++;\n break;\n case \"cache-miss\":\n cacheMisses++;\n break;\n case \"revalidation\":\n revalidations++;\n break;\n case \"deduplication\":\n deduplications++;\n break;\n }\n }\n }\n\n this.timeSeries.timestamps.push(currentSecond);\n this.timeSeries.cacheHits.push(cacheHits);\n this.timeSeries.cacheMisses.push(cacheMisses);\n this.timeSeries.revalidations.push(revalidations);\n this.timeSeries.deduplications.push(deduplications);\n\n this.lastSnapshot = null;\n this.notifySubscribers();\n }\n\n private estimateNetworkTime(_signature: string): number {\n if (this.networkTimeDirty) {\n const recentMisses = this.operations.getLast(100)\n .filter(op => op.type === \"cache-miss\" && op.responseTime != null);\n\n if (recentMisses.length > 0) {\n const totalTime = recentMisses.reduce(\n (sum, op) => sum + (op.responseTime ?? 0),\n 0,\n );\n this.cachedAvgNetworkTime = totalTime / recentMisses.length;\n }\n this.networkTimeDirty = false;\n }\n return this.cachedAvgNetworkTime;\n }\n\n private estimateBytes(_signature: string): number {\n if (this.bytesPerObjectDirty) {\n const recentMisses = this.operations.getLast(100)\n .filter(\n op =>\n op.type === \"cache-miss\"\n && op.objectCount != null\n && op.objectCount > 0,\n );\n\n if (recentMisses.length > 0) {\n const avgObjectCount = recentMisses.reduce(\n (sum, op) => sum + (op.objectCount ?? 0),\n 0,\n ) / recentMisses.length;\n this.cachedAvgBytesPerObject = avgObjectCount * 1024;\n }\n this.bytesPerObjectDirty = false;\n }\n return this.cachedAvgBytesPerObject;\n }\n\n recordActionError(error: ActionError): void {\n this.actionErrors.push(error);\n\n if (this.actionErrors.length > 100) {\n this.actionErrors.shift();\n }\n\n this.notifySubscribers();\n }\n\n getActionErrors(): ActionError[] {\n return [...this.actionErrors].reverse();\n }\n\n getCacheHitRate(): number {\n const total = this.aggregates.cacheHits + this.aggregates.cacheMisses\n + this.aggregates.revalidations;\n return total > 0\n ? (this.aggregates.cacheHits + this.aggregates.revalidations) / total\n : 0;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA,SAASA,cAAc,QAAQ,4BAA4B;AAC3D,SAASC,iBAAiB,QAAQ,wBAAwB;AAE1D,OAAO,MAAMC,YAAY,SAASD,iBAAiB,CAAC;EAoC1CE,cAAc,GAAgB,EAAE;EAChCC,YAAY,GAAG,KAAK;EACpBC,YAAY,GAA2B,IAAI;EAC3CC,UAAU,GAA0C,IAAI;EACxDC,eAAe,GAAG,CAAC;EACnBC,YAAY,GAAkB,EAAE;EAChCC,oBAAoB,GAAW,GAAG;EAClCC,uBAAuB,GAAW,IAAI;EACtCC,gBAAgB,GAAG,IAAI;EACvBC,mBAAmB,GAAG,IAAI;EAElCC,WAAWA,CAACC,aAAqB,GAAG,IAAI,EAAEC,cAAsB,GAAG,EAAE,EAAE;IACrE,KAAK,CAAC,CAAC;IACP,IAAI,CAACD,aAAa,GAAGA,aAAa;IAClC,IAAI,CAACC,cAAc,GAAGA,cAAc;IACpC,IAAI,CAACC,UAAU,GAAG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