@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,288 @@
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 { createClient } from "@osdk/client";
18
+ import { createObservableClient } from "@osdk/client/observable";
19
+
20
+ /**
21
+ * Configuration for creating a monitored OSDK client.
22
+ */
23
+
24
+ import { onCommitFiberRoot } from "../fiber/DevtoolsHook.js";
25
+ import { discoverOsdkComponentsFromRoot } from "../fiber/HookStateInspector.js";
26
+ import { createClickToInspect } from "../inspector/createClickToInspect.js";
27
+ import { MockManager } from "../mocking/MockManager.js";
28
+ import { PrototypeOverrideStore } from "../prototyping/PrototypeOverrideStore.js";
29
+ import { DEFAULT_MONITOR_CONFIG } from "../types/index.js";
30
+ import { componentContextCapture } from "../utils/ComponentContextCapture.js";
31
+ import { ComponentPrimitiveDiscovery } from "../utils/ComponentPrimitiveDiscovery.js";
32
+ import { ComponentQueryRegistry } from "../utils/ComponentQueryRegistry.js";
33
+ import { ComputeMonitor } from "../utils/ComputeMonitor.js";
34
+ import { EventTimeline } from "../utils/EventTimeline.js";
35
+ import { LinkTraversalTracker } from "../utils/LinkTraversalTracker.js";
36
+ import { createMonitorLogger } from "../utils/logger.js";
37
+ import { ObservableClientMonitor } from "../utils/ObservableClientMonitor.js";
38
+ import { PerformanceRecommendationEngine } from "../utils/PerformanceRecommendationEngine.js";
39
+ import { PropertyAccessTracker } from "../utils/PropertyAccessTracker.js";
40
+ import { ComputeStore } from "./ComputeStore.js";
41
+ import { ConsoleLogStore } from "./ConsoleLogStore.js";
42
+ import { MetricsStore } from "./MetricsStore.js";
43
+ import { WindowErrorStore } from "./WindowErrorStore.js";
44
+ const monitorStoreMap = new WeakMap();
45
+ export function getMonitorStore(client) {
46
+ return monitorStoreMap.get(client);
47
+ }
48
+ export class MonitorStore {
49
+ monitor = null;
50
+ originalGlobalFetch = null;
51
+ interceptedGlobalFetch = null;
52
+ unsubscribeFiberCommit = null;
53
+ constructor(config = {}) {
54
+ this.config = {
55
+ ...DEFAULT_MONITOR_CONFIG,
56
+ ...config
57
+ };
58
+ this.logger = config.logger ?? createMonitorLogger();
59
+ this.metricsStore = new MetricsStore(this.config.maxOperations, this.config.timeSeriesSize);
60
+ this.computeStore = new ComputeStore();
61
+ this.componentRegistry = new ComponentQueryRegistry();
62
+ this.linkTraversalTracker = new LinkTraversalTracker();
63
+ this.propertyAccessTracker = new PropertyAccessTracker();
64
+ this.eventTimeline = new EventTimeline(10000);
65
+ this.computeMonitor = new ComputeMonitor(this.computeStore, this.logger, undefined, this.eventTimeline);
66
+ this.primitiveDiscovery = new ComponentPrimitiveDiscovery(this.componentRegistry);
67
+ this.clickToInspect = createClickToInspect({
68
+ onSelect: component => {
69
+ const fiber = component.fiber.deref();
70
+ if (!fiber) {
71
+ return;
72
+ }
73
+ const primitives = this.primitiveDiscovery.discoverPrimitives(fiber);
74
+ window.dispatchEvent(new CustomEvent("primitives-discovered", {
75
+ detail: {
76
+ componentId: primitives.componentId,
77
+ primitives
78
+ }
79
+ }));
80
+ },
81
+ onDeactivate: () => {
82
+ window.dispatchEvent(new CustomEvent("inspector-deactivated"));
83
+ }
84
+ });
85
+ this.mockManager = new MockManager();
86
+ this.prototypeOverrideStore = new PrototypeOverrideStore();
87
+ this.consoleLogStore = new ConsoleLogStore(1000);
88
+ this.consoleLogStore.install();
89
+ this.windowErrorStore = new WindowErrorStore(1000);
90
+ this.windowErrorStore.install();
91
+ this.recommendationEngine = new PerformanceRecommendationEngine(this.metricsStore, this.componentRegistry, this.eventTimeline);
92
+ this.propertyAccessTracker.setEventTimeline(this.eventTimeline);
93
+ this.linkTraversalTracker.setEventTimeline(this.eventTimeline);
94
+ this.installGlobalFetchInterceptor();
95
+ if (typeof window !== "undefined") {
96
+ window.__OSDK_MONITOR__ = {
97
+ componentRegistry: this.componentRegistry,
98
+ componentContextCapture,
99
+ prototypeOverrideStore: this.prototypeOverrideStore
100
+ };
101
+ }
102
+ this.unsubscribeFiberCommit = onCommitFiberRoot((_rendererId, root) => {
103
+ const discovered = discoverOsdkComponentsFromRoot(root);
104
+ if (discovered.size > 0) {
105
+ this.componentRegistry.updateFromFiberDiscovery(discovered);
106
+ }
107
+ });
108
+ }
109
+ createMonitoredClient(config) {
110
+ const interceptedFetch = this.computeMonitor.createInterceptedFetch();
111
+ const client = createClient(config.baseUrl, config.ontologyRid, config.auth, {
112
+ logger: config.logger,
113
+ UNSTABLE_DO_NOT_USE_BRANCH: config.branch
114
+ }, interceptedFetch);
115
+ const observableClient = createObservableClient(client);
116
+ const fullyWrappedClient = this.wrapWithMonitoring(observableClient);
117
+ return {
118
+ client,
119
+ observableClient: fullyWrappedClient
120
+ };
121
+ }
122
+ wrapExistingClient(client) {
123
+ this.installGlobalFetchInterceptor();
124
+ const fullyWrappedClient = this.wrapWithMonitoring(client);
125
+ monitorStoreMap.set(fullyWrappedClient, this);
126
+ return fullyWrappedClient;
127
+ }
128
+ wrapWithMonitoring(client) {
129
+ if (!this.monitor) {
130
+ this.monitor = new ObservableClientMonitor({
131
+ metricsStore: this.metricsStore,
132
+ componentRegistry: this.componentRegistry,
133
+ linkTraversalTracker: this.linkTraversalTracker,
134
+ propertyAccessTracker: this.propertyAccessTracker,
135
+ eventTimeline: this.eventTimeline,
136
+ captureComponentContext: true,
137
+ captureQueryParams: true,
138
+ cleanupIntervalMs: this.config.cleanupIntervalMs,
139
+ cacheThresholdMs: this.config.cacheDetectionThresholdMs,
140
+ mockManager: this.mockManager
141
+ });
142
+ }
143
+ return this.monitor.wrapClient(client);
144
+ }
145
+ installGlobalFetchInterceptor() {
146
+ if (this.originalGlobalFetch != null) {
147
+ return;
148
+ }
149
+ this.originalGlobalFetch = globalThis.fetch;
150
+ const interceptedFetch = this.computeMonitor.createInterceptedFetch();
151
+ this.interceptedGlobalFetch = interceptedFetch;
152
+ globalThis.fetch = interceptedFetch;
153
+ }
154
+ uninstallGlobalFetchInterceptor() {
155
+ if (this.originalGlobalFetch == null) {
156
+ return;
157
+ }
158
+ if (globalThis.fetch === this.interceptedGlobalFetch) {
159
+ globalThis.fetch = this.originalGlobalFetch;
160
+ }
161
+ this.originalGlobalFetch = null;
162
+ this.interceptedGlobalFetch = null;
163
+ }
164
+ getMetricsStore() {
165
+ return this.metricsStore;
166
+ }
167
+ getComputeStore() {
168
+ return this.computeStore;
169
+ }
170
+ getComponentRegistry() {
171
+ return this.componentRegistry;
172
+ }
173
+ getLinkTraversalTracker() {
174
+ return this.linkTraversalTracker;
175
+ }
176
+ getPropertyAccessTracker() {
177
+ return this.propertyAccessTracker;
178
+ }
179
+ getMonitor() {
180
+ return this.monitor;
181
+ }
182
+ getEventTimeline() {
183
+ return this.eventTimeline;
184
+ }
185
+ getPrimitiveDiscovery() {
186
+ return this.primitiveDiscovery;
187
+ }
188
+ getClickToInspectSystem() {
189
+ return this.clickToInspect;
190
+ }
191
+ getMockManager() {
192
+ return this.mockManager;
193
+ }
194
+ getRecommendationEngine() {
195
+ return this.recommendationEngine;
196
+ }
197
+ getPrototypeOverrideStore() {
198
+ return this.prototypeOverrideStore;
199
+ }
200
+ getConsoleLogStore() {
201
+ return this.consoleLogStore;
202
+ }
203
+ getWindowErrorStore() {
204
+ return this.windowErrorStore;
205
+ }
206
+ dispose() {
207
+ this.unsubscribeFiberCommit?.();
208
+ this.unsubscribeFiberCommit = null;
209
+ this.uninstallGlobalFetchInterceptor();
210
+ if (typeof window !== "undefined") {
211
+ delete window.__OSDK_MONITOR__;
212
+ }
213
+ this.metricsStore.dispose();
214
+ this.computeStore.dispose();
215
+ this.componentRegistry.clear();
216
+ this.linkTraversalTracker.clear();
217
+ this.propertyAccessTracker.clear();
218
+ this.eventTimeline.clear();
219
+ this.clickToInspect.dispose();
220
+ this.consoleLogStore.dispose();
221
+ this.windowErrorStore.dispose();
222
+ this.mockManager.clear();
223
+ this.prototypeOverrideStore.clearAll();
224
+ this.monitor?.dispose();
225
+ this.monitor = null;
226
+ }
227
+ async loadCacheEntries() {
228
+ if (!this.monitor) {
229
+ return [];
230
+ }
231
+ try {
232
+ const snapshot = await this.monitor.getCacheSnapshot();
233
+ return snapshot.entries;
234
+ } catch {
235
+ return [];
236
+ }
237
+ }
238
+
239
+ /** @deprecated Use `loadCacheEntries()` — name was misleading because the method is async. */
240
+ getCacheEntries() {
241
+ return this.loadCacheEntries();
242
+ }
243
+ async getCacheSnapshot() {
244
+ if (!this.monitor) {
245
+ return {
246
+ entries: [],
247
+ stats: {
248
+ totalEntries: 0,
249
+ totalSize: 0,
250
+ totalHits: 0
251
+ }
252
+ };
253
+ }
254
+ try {
255
+ return await this.monitor.getCacheSnapshot();
256
+ } catch {
257
+ return {
258
+ entries: [],
259
+ stats: {
260
+ totalEntries: 0,
261
+ totalSize: 0,
262
+ totalHits: 0
263
+ }
264
+ };
265
+ }
266
+ }
267
+ async invalidateCacheEntry(entry) {
268
+ if (!this.monitor) {
269
+ return;
270
+ }
271
+ try {
272
+ if (entry.type === "object" && entry.data) {
273
+ await this.monitor.invalidateObjects(entry.data);
274
+ } else {
275
+ await this.monitor.invalidateObjectType(entry.objectType);
276
+ }
277
+ } catch {}
278
+ }
279
+ async clearCache() {
280
+ if (!this.monitor) {
281
+ return;
282
+ }
283
+ try {
284
+ await this.monitor.invalidateAll();
285
+ } catch {}
286
+ }
287
+ }
288
+ //# sourceMappingURL=MonitorStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MonitorStore.js","names":["createClient","createObservableClient","onCommitFiberRoot","discoverOsdkComponentsFromRoot","createClickToInspect","MockManager","PrototypeOverrideStore","DEFAULT_MONITOR_CONFIG","componentContextCapture","ComponentPrimitiveDiscovery","ComponentQueryRegistry","ComputeMonitor","EventTimeline","LinkTraversalTracker","createMonitorLogger","ObservableClientMonitor","PerformanceRecommendationEngine","PropertyAccessTracker","ComputeStore","ConsoleLogStore","MetricsStore","WindowErrorStore","monitorStoreMap","WeakMap","getMonitorStore","client","get","MonitorStore","monitor","originalGlobalFetch","interceptedGlobalFetch","unsubscribeFiberCommit","constructor","config","logger","metricsStore","maxOperations","timeSeriesSize","computeStore","componentRegistry","linkTraversalTracker","propertyAccessTracker","eventTimeline","computeMonitor","undefined","primitiveDiscovery","clickToInspect","onSelect","component","fiber","deref","primitives","discoverPrimitives","window","dispatchEvent","CustomEvent","detail","componentId","onDeactivate","mockManager","prototypeOverrideStore","consoleLogStore","install","windowErrorStore","recommendationEngine","setEventTimeline","installGlobalFetchInterceptor","__OSDK_MONITOR__","_rendererId","root","discovered","size","updateFromFiberDiscovery","createMonitoredClient","interceptedFetch","createInterceptedFetch","baseUrl","ontologyRid","auth","UNSTABLE_DO_NOT_USE_BRANCH","branch","observableClient","fullyWrappedClient","wrapWithMonitoring","wrapExistingClient","set","captureComponentContext","captureQueryParams","cleanupIntervalMs","cacheThresholdMs","cacheDetectionThresholdMs","wrapClient","globalThis","fetch","uninstallGlobalFetchInterceptor","getMetricsStore","getComputeStore","getComponentRegistry","getLinkTraversalTracker","getPropertyAccessTracker","getMonitor","getEventTimeline","getPrimitiveDiscovery","getClickToInspectSystem","getMockManager","getRecommendationEngine","getPrototypeOverrideStore","getConsoleLogStore","getWindowErrorStore","dispose","clear","clearAll","loadCacheEntries","snapshot","getCacheSnapshot","entries","getCacheEntries","stats","totalEntries","totalSize","totalHits","invalidateCacheEntry","entry","type","data","invalidateObjects","invalidateObjectType","objectType","clearCache","invalidateAll"],"sources":["MonitorStore.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 { Logger } from \"@osdk/api\";\nimport { type Client, createClient } from \"@osdk/client\";\nimport {\n type CacheEntry,\n type CacheSnapshot,\n createObservableClient,\n type ObservableClient,\n} from \"@osdk/client/observable\";\n\n/**\n * Configuration for creating a monitored OSDK client.\n */\ninterface ClientConfig {\n baseUrl: string;\n ontologyRid: string | Promise<string>;\n auth: () => Promise<string>;\n logger?: Logger;\n branch?: string;\n}\nimport { onCommitFiberRoot } from \"../fiber/DevtoolsHook.js\";\nimport { discoverOsdkComponentsFromRoot } from \"../fiber/HookStateInspector.js\";\nimport type { ClickToInspectSystem } from \"../inspector/ClickToInspectSystem.js\";\nimport { createClickToInspect } from \"../inspector/createClickToInspect.js\";\nimport { MockManager } from \"../mocking/MockManager.js\";\nimport { PrototypeOverrideStore } from \"../prototyping/PrototypeOverrideStore.js\";\nimport {\n DEFAULT_MONITOR_CONFIG,\n type MonitoringConfig,\n} from \"../types/index.js\";\nimport { componentContextCapture } from \"../utils/ComponentContextCapture.js\";\nimport { ComponentPrimitiveDiscovery } from \"../utils/ComponentPrimitiveDiscovery.js\";\nimport { ComponentQueryRegistry } from \"../utils/ComponentQueryRegistry.js\";\nimport { ComputeMonitor } from \"../utils/ComputeMonitor.js\";\nimport { EventTimeline } from \"../utils/EventTimeline.js\";\nimport { LinkTraversalTracker } from \"../utils/LinkTraversalTracker.js\";\nimport { createMonitorLogger } from \"../utils/logger.js\";\nimport { ObservableClientMonitor } from \"../utils/ObservableClientMonitor.js\";\nimport { PerformanceRecommendationEngine } from \"../utils/PerformanceRecommendationEngine.js\";\nimport { PropertyAccessTracker } from \"../utils/PropertyAccessTracker.js\";\nimport { ComputeStore } from \"./ComputeStore.js\";\nimport { ConsoleLogStore } from \"./ConsoleLogStore.js\";\nimport { MetricsStore } from \"./MetricsStore.js\";\nimport { WindowErrorStore } from \"./WindowErrorStore.js\";\n\nconst monitorStoreMap = new WeakMap<object, MonitorStore>();\n\nexport function getMonitorStore(client: object): MonitorStore | undefined {\n return monitorStoreMap.get(client);\n}\n\nexport class MonitorStore {\n private readonly config: MonitoringConfig;\n private readonly logger: Logger;\n private readonly metricsStore: MetricsStore;\n private readonly computeStore: ComputeStore;\n private readonly computeMonitor: ComputeMonitor;\n private readonly componentRegistry: ComponentQueryRegistry;\n private readonly linkTraversalTracker: LinkTraversalTracker;\n private readonly propertyAccessTracker: PropertyAccessTracker;\n private readonly eventTimeline: EventTimeline;\n private readonly primitiveDiscovery: ComponentPrimitiveDiscovery;\n private readonly clickToInspect: ClickToInspectSystem;\n private readonly mockManager: MockManager;\n private readonly recommendationEngine: PerformanceRecommendationEngine;\n private readonly prototypeOverrideStore: PrototypeOverrideStore;\n private readonly consoleLogStore: ConsoleLogStore;\n private readonly windowErrorStore: WindowErrorStore;\n private monitor: ObservableClientMonitor | null = null;\n private originalGlobalFetch: typeof globalThis.fetch | null = null;\n private interceptedGlobalFetch: typeof globalThis.fetch | null = null;\n private unsubscribeFiberCommit: (() => void) | null = null;\n\n constructor(config: Partial<MonitoringConfig> = {}) {\n this.config = { ...DEFAULT_MONITOR_CONFIG, ...config };\n this.logger = config.logger ?? createMonitorLogger();\n this.metricsStore = new MetricsStore(\n this.config.maxOperations,\n this.config.timeSeriesSize,\n );\n this.computeStore = new ComputeStore();\n this.componentRegistry = new ComponentQueryRegistry();\n this.linkTraversalTracker = new LinkTraversalTracker();\n this.propertyAccessTracker = new PropertyAccessTracker();\n this.eventTimeline = new EventTimeline(10000);\n this.computeMonitor = new ComputeMonitor(\n this.computeStore,\n this.logger,\n undefined,\n this.eventTimeline,\n );\n this.primitiveDiscovery = new ComponentPrimitiveDiscovery(\n this.componentRegistry,\n );\n this.clickToInspect = createClickToInspect({\n onSelect: (component) => {\n const fiber = component.fiber.deref();\n if (!fiber) {\n return;\n }\n const primitives = this.primitiveDiscovery.discoverPrimitives(fiber);\n window.dispatchEvent(\n new CustomEvent(\"primitives-discovered\", {\n detail: {\n componentId: primitives.componentId,\n primitives,\n },\n }),\n );\n },\n onDeactivate: () => {\n window.dispatchEvent(new CustomEvent(\"inspector-deactivated\"));\n },\n });\n this.mockManager = new MockManager();\n this.prototypeOverrideStore = new PrototypeOverrideStore();\n this.consoleLogStore = new ConsoleLogStore(1000);\n this.consoleLogStore.install();\n this.windowErrorStore = new WindowErrorStore(1000);\n this.windowErrorStore.install();\n this.recommendationEngine = new PerformanceRecommendationEngine(\n this.metricsStore,\n this.componentRegistry,\n this.eventTimeline,\n );\n\n this.propertyAccessTracker.setEventTimeline(this.eventTimeline);\n this.linkTraversalTracker.setEventTimeline(this.eventTimeline);\n this.installGlobalFetchInterceptor();\n\n if (typeof window !== \"undefined\") {\n window.__OSDK_MONITOR__ = {\n componentRegistry: this.componentRegistry,\n componentContextCapture,\n prototypeOverrideStore: this.prototypeOverrideStore,\n };\n }\n\n this.unsubscribeFiberCommit = onCommitFiberRoot((_rendererId, root) => {\n const discovered = discoverOsdkComponentsFromRoot(root);\n if (discovered.size > 0) {\n this.componentRegistry.updateFromFiberDiscovery(discovered);\n }\n });\n }\n\n createMonitoredClient(config: ClientConfig): {\n client: Client;\n observableClient: ObservableClient;\n } {\n const interceptedFetch = this.computeMonitor.createInterceptedFetch();\n\n const client = createClient(\n config.baseUrl,\n config.ontologyRid,\n config.auth,\n {\n logger: config.logger,\n UNSTABLE_DO_NOT_USE_BRANCH: config.branch,\n },\n interceptedFetch,\n );\n\n const observableClient: ObservableClient = createObservableClient(\n client,\n );\n\n const fullyWrappedClient = this.wrapWithMonitoring(observableClient);\n\n return {\n client,\n observableClient: fullyWrappedClient,\n };\n }\n\n wrapExistingClient(client: ObservableClient): ObservableClient {\n this.installGlobalFetchInterceptor();\n\n const fullyWrappedClient = this.wrapWithMonitoring(client);\n monitorStoreMap.set(fullyWrappedClient, this);\n\n return fullyWrappedClient;\n }\n\n private wrapWithMonitoring(client: ObservableClient): ObservableClient {\n if (!this.monitor) {\n this.monitor = new ObservableClientMonitor({\n metricsStore: this.metricsStore,\n componentRegistry: this.componentRegistry,\n linkTraversalTracker: this.linkTraversalTracker,\n propertyAccessTracker: this.propertyAccessTracker,\n eventTimeline: this.eventTimeline,\n captureComponentContext: true,\n captureQueryParams: true,\n cleanupIntervalMs: this.config.cleanupIntervalMs,\n cacheThresholdMs: this.config.cacheDetectionThresholdMs,\n mockManager: this.mockManager,\n });\n }\n return this.monitor.wrapClient(client);\n }\n\n installGlobalFetchInterceptor(): void {\n if (this.originalGlobalFetch != null) {\n return;\n }\n\n this.originalGlobalFetch = globalThis.fetch;\n const interceptedFetch = this.computeMonitor.createInterceptedFetch();\n this.interceptedGlobalFetch = interceptedFetch;\n globalThis.fetch = interceptedFetch;\n }\n\n private uninstallGlobalFetchInterceptor(): void {\n if (this.originalGlobalFetch == null) {\n return;\n }\n\n if (globalThis.fetch === this.interceptedGlobalFetch) {\n globalThis.fetch = this.originalGlobalFetch;\n }\n\n this.originalGlobalFetch = null;\n this.interceptedGlobalFetch = null;\n }\n\n getMetricsStore(): MetricsStore {\n return this.metricsStore;\n }\n\n getComputeStore(): ComputeStore {\n return this.computeStore;\n }\n\n getComponentRegistry(): ComponentQueryRegistry {\n return this.componentRegistry;\n }\n\n getLinkTraversalTracker(): LinkTraversalTracker {\n return this.linkTraversalTracker;\n }\n\n getPropertyAccessTracker(): PropertyAccessTracker {\n return this.propertyAccessTracker;\n }\n\n getMonitor(): ObservableClientMonitor | null {\n return this.monitor;\n }\n\n getEventTimeline(): EventTimeline {\n return this.eventTimeline;\n }\n\n getPrimitiveDiscovery(): ComponentPrimitiveDiscovery {\n return this.primitiveDiscovery;\n }\n\n getClickToInspectSystem(): ClickToInspectSystem {\n return this.clickToInspect;\n }\n\n getMockManager(): MockManager {\n return this.mockManager;\n }\n\n getRecommendationEngine(): PerformanceRecommendationEngine {\n return this.recommendationEngine;\n }\n\n getPrototypeOverrideStore(): PrototypeOverrideStore {\n return this.prototypeOverrideStore;\n }\n\n getConsoleLogStore(): ConsoleLogStore {\n return this.consoleLogStore;\n }\n\n getWindowErrorStore(): WindowErrorStore {\n return this.windowErrorStore;\n }\n\n dispose(): void {\n this.unsubscribeFiberCommit?.();\n this.unsubscribeFiberCommit = null;\n this.uninstallGlobalFetchInterceptor();\n if (typeof window !== \"undefined\") {\n delete (window as unknown as Record<string, unknown>).__OSDK_MONITOR__;\n }\n this.metricsStore.dispose();\n this.computeStore.dispose();\n this.componentRegistry.clear();\n this.linkTraversalTracker.clear();\n this.propertyAccessTracker.clear();\n this.eventTimeline.clear();\n this.clickToInspect.dispose();\n this.consoleLogStore.dispose();\n this.windowErrorStore.dispose();\n this.mockManager.clear();\n this.prototypeOverrideStore.clearAll();\n this.monitor?.dispose();\n this.monitor = null;\n }\n\n async loadCacheEntries(): Promise<CacheEntry[]> {\n if (!this.monitor) {\n return [];\n }\n\n try {\n const snapshot = await this.monitor.getCacheSnapshot();\n return snapshot.entries;\n } catch {\n return [];\n }\n }\n\n /** @deprecated Use `loadCacheEntries()` — name was misleading because the method is async. */\n getCacheEntries(): Promise<CacheEntry[]> {\n return this.loadCacheEntries();\n }\n\n async getCacheSnapshot(): Promise<CacheSnapshot> {\n if (!this.monitor) {\n return {\n entries: [],\n stats: { totalEntries: 0, totalSize: 0, totalHits: 0 },\n };\n }\n\n try {\n return await this.monitor.getCacheSnapshot();\n } catch {\n return {\n entries: [],\n stats: { totalEntries: 0, totalSize: 0, totalHits: 0 },\n };\n }\n }\n\n async invalidateCacheEntry(entry: {\n type: \"object\" | \"list\" | \"link\" | \"objectSet\";\n objectType: string;\n data?: unknown;\n }): Promise<void> {\n if (!this.monitor) {\n return;\n }\n\n try {\n if (entry.type === \"object\" && entry.data) {\n await this.monitor.invalidateObjects(entry.data);\n } else {\n await this.monitor.invalidateObjectType(entry.objectType);\n }\n } catch {\n }\n }\n\n async clearCache(): Promise<void> {\n if (!this.monitor) {\n return;\n }\n\n try {\n await this.monitor.invalidateAll();\n } catch {\n }\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAAsBA,YAAY,QAAQ,cAAc;AACxD,SAGEC,sBAAsB,QAEjB,yBAAyB;;AAEhC;AACA;AACA;;AAQA,SAASC,iBAAiB,QAAQ,0BAA0B;AAC5D,SAASC,8BAA8B,QAAQ,gCAAgC;AAE/E,SAASC,oBAAoB,QAAQ,sCAAsC;AAC3E,SAASC,WAAW,QAAQ,2BAA2B;AACvD,SAASC,sBAAsB,QAAQ,0CAA0C;AACjF,SACEC,sBAAsB,QAEjB,mBAAmB;AAC1B,SAASC,uBAAuB,QAAQ,qCAAqC;AAC7E,SAASC,2BAA2B,QAAQ,yCAAyC;AACrF,SAASC,sBAAsB,QAAQ,oCAAoC;AAC3E,SAASC,cAAc,QAAQ,4BAA4B;AAC3D,SAASC,aAAa,QAAQ,2BAA2B;AACzD,SAASC,oBAAoB,QAAQ,kCAAkC;AACvE,SAASC,mBAAmB,QAAQ,oBAAoB;AACxD,SAASC,uBAAuB,QAAQ,qCAAqC;AAC7E,SAASC,+BAA+B,QAAQ,6CAA6C;AAC7F,SAASC,qBAAqB,QAAQ,mCAAmC;AACzE,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,gBAAgB,QAAQ,uBAAuB;AAExD,MAAMC,eAAe,GAAG,IAAIC,OAAO,CAAuB,CAAC;AAE3D,OAAO,SAASC,eAAeA,CAACC,MAAc,EAA4B;EACxE,OAAOH,eAAe,CAACI,GAAG,CAACD,MAAM,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EAAE,EAAE;QACXE,KAAK,EAAE;UAAEC,YAAY,EAAE,CAAC;UAAEC,SAAS,EAAE,CAAC;UAAEC,SAAS,EAAE;QAAE;MACvD,CAAC;IACH;EACF;EAEA,MAAMC,oBAAoBA,CAACC,KAI1B,EAAiB;IAChB,IAAI,CAAC,IAAI,CAAC9F,OAAO,EAAE;MACjB;IACF;IAEA,IAAI;MACF,IAAI8F,KAAK,CAACC,IAAI,KAAK,QAAQ,IAAID,KAAK,CAACE,IAAI,EAAE;QACzC,MAAM,IAAI,CAAChG,OAAO,CAACiG,iBAAiB,CAACH,KAAK,CAACE,IAAI,CAAC;MAClD,CAAC,MAAM;QACL,MAAM,IAAI,CAAChG,OAAO,CAACkG,oBAAoB,CAACJ,KAAK,CAACK,UAAU,CAAC;MAC3D;IACF,CAAC,CAAC,MAAM,CACR;EACF;EAEA,MAAMC,UAAUA,CAAA,EAAkB;IAChC,IAAI,CAAC,IAAI,CAACpG,OAAO,EAAE;MACjB;IACF;IAEA,IAAI;MACF,MAAM,IAAI,CAACA,OAAO,CAACqG,aAAa,CAAC,CAAC;IACpC,CAAC,CAAC,MAAM,CACR;EACF;AACF","ignoreList":[]}
@@ -0,0 +1,38 @@
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
+ export class SubscribableStore {
18
+ subscribers = new Set();
19
+ subscribe(callback) {
20
+ this.subscribers.add(callback);
21
+ return () => {
22
+ this.subscribers.delete(callback);
23
+ };
24
+ }
25
+ notifySubscribers() {
26
+ for (const callback of this.subscribers) {
27
+ try {
28
+ callback();
29
+ } catch {
30
+ // don't let a bad subscriber break others
31
+ }
32
+ }
33
+ }
34
+ clearSubscribers() {
35
+ this.subscribers.clear();
36
+ }
37
+ }
38
+ //# sourceMappingURL=SubscribableStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SubscribableStore.js","names":["SubscribableStore","subscribers","Set","subscribe","callback","add","delete","notifySubscribers","clearSubscribers","clear"],"sources":["SubscribableStore.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\nexport abstract class SubscribableStore {\n private readonly subscribers = new Set<() => void>();\n\n subscribe(callback: () => void): () => void {\n this.subscribers.add(callback);\n return () => {\n this.subscribers.delete(callback);\n };\n }\n\n protected notifySubscribers(): void {\n for (const callback of this.subscribers) {\n try {\n callback();\n } catch {\n // don't let a bad subscriber break others\n }\n }\n }\n\n protected clearSubscribers(): void {\n this.subscribers.clear();\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAeA,iBAAiB,CAAC;EACrBC,WAAW,GAAG,IAAIC,GAAG,CAAa,CAAC;EAEpDC,SAASA,CAACC,QAAoB,EAAc;IAC1C,IAAI,CAACH,WAAW,CAACI,GAAG,CAACD,QAAQ,CAAC;IAC9B,OAAO,MAAM;MACX,IAAI,CAACH,WAAW,CAACK,MAAM,CAACF,QAAQ,CAAC;IACnC,CAAC;EACH;EAEUG,iBAAiBA,CAAA,EAAS;IAClC,KAAK,MAAMH,QAAQ,IAAI,IAAI,CAACH,WAAW,EAAE;MACvC,IAAI;QACFG,QAAQ,CAAC,CAAC;MACZ,CAAC,CAAC,MAAM;QACN;MAAA;IAEJ;EACF;EAEUI,gBAAgBA,CAAA,EAAS;IACjC,IAAI,CAACP,WAAW,CAACQ,KAAK,CAAC,CAAC;EAC1B;AACF","ignoreList":[]}
@@ -0,0 +1,195 @@
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
+ // Captures global JS errors (uncaught throws) and unhandled promise rejections
18
+ // from the host page. React's dev-mode render errors are captured separately
19
+ // via console.error in ConsoleLogStore, so we don't ship a dedicated error
20
+ // boundary alongside this.
21
+
22
+ import { CircularBuffer } from "../utils/CircularBuffer.js";
23
+ import { SubscribableStore } from "./SubscribableStore.js";
24
+ let entryCounter = 0;
25
+ function nextId() {
26
+ return `windowError-${++entryCounter}-${Date.now()}`;
27
+ }
28
+ function describeRejectionReason(reason) {
29
+ if (reason instanceof Error) {
30
+ return {
31
+ message: reason.message,
32
+ stack: reason.stack
33
+ };
34
+ }
35
+ if (typeof reason === "string") {
36
+ return {
37
+ message: reason
38
+ };
39
+ }
40
+ try {
41
+ return {
42
+ message: JSON.stringify(reason)
43
+ };
44
+ } catch {
45
+ return {
46
+ message: String(reason)
47
+ };
48
+ }
49
+ }
50
+ export class WindowErrorStore extends SubscribableStore {
51
+ cachedEntries = null;
52
+ installed = false;
53
+ suppressed = false;
54
+ notifyScheduled = false;
55
+ errorListener = null;
56
+ rejectionListener = null;
57
+ constructor(capacity = 1000) {
58
+ super();
59
+ this.entries = new CircularBuffer(capacity);
60
+ }
61
+ install() {
62
+ if (this.installed) {
63
+ return;
64
+ }
65
+ if (typeof window === "undefined") {
66
+ return;
67
+ }
68
+ this.errorListener = event => {
69
+ if (this.suppressed) {
70
+ return;
71
+ }
72
+ const message = event.message || (event.error instanceof Error ? event.error.message : "Error");
73
+ const stack = event.error instanceof Error ? event.error.stack : undefined;
74
+ const entry = {
75
+ id: nextId(),
76
+ kind: "error",
77
+ message,
78
+ ...(stack !== undefined ? {
79
+ stack
80
+ } : {}),
81
+ ...(event.filename ? {
82
+ filename: event.filename
83
+ } : {}),
84
+ ...(typeof event.lineno === "number" ? {
85
+ lineno: event.lineno
86
+ } : {}),
87
+ ...(typeof event.colno === "number" ? {
88
+ colno: event.colno
89
+ } : {}),
90
+ timestamp: Date.now()
91
+ };
92
+ this.entries.push(entry);
93
+ this.cachedEntries = null;
94
+ this.scheduleNotify();
95
+ };
96
+ this.rejectionListener = event => {
97
+ if (this.suppressed) {
98
+ return;
99
+ }
100
+ const {
101
+ message,
102
+ stack
103
+ } = describeRejectionReason(event.reason);
104
+ const entry = {
105
+ id: nextId(),
106
+ kind: "unhandledrejection",
107
+ message,
108
+ ...(stack !== undefined ? {
109
+ stack
110
+ } : {}),
111
+ timestamp: Date.now()
112
+ };
113
+ this.entries.push(entry);
114
+ this.cachedEntries = null;
115
+ this.scheduleNotify();
116
+ };
117
+ window.addEventListener("error", this.errorListener);
118
+ window.addEventListener("unhandledrejection", this.rejectionListener);
119
+ this.installed = true;
120
+ }
121
+ uninstall() {
122
+ if (!this.installed) {
123
+ return;
124
+ }
125
+ if (typeof window !== "undefined") {
126
+ if (this.errorListener) {
127
+ window.removeEventListener("error", this.errorListener);
128
+ }
129
+ if (this.rejectionListener) {
130
+ window.removeEventListener("unhandledrejection", this.rejectionListener);
131
+ }
132
+ }
133
+ this.errorListener = null;
134
+ this.rejectionListener = null;
135
+ this.installed = false;
136
+ }
137
+ suppress() {
138
+ this.suppressed = true;
139
+ }
140
+ unsuppress() {
141
+ this.suppressed = false;
142
+ }
143
+ recordError(error, source) {
144
+ if (this.suppressed) {
145
+ return;
146
+ }
147
+ const entry = {
148
+ id: nextId(),
149
+ kind: "error",
150
+ message: error.message,
151
+ ...(error.stack !== undefined ? {
152
+ stack: error.stack
153
+ } : {}),
154
+ ...(source !== undefined ? {
155
+ filename: source
156
+ } : {}),
157
+ timestamp: Date.now()
158
+ };
159
+ this.entries.push(entry);
160
+ this.cachedEntries = null;
161
+ this.scheduleNotify();
162
+ }
163
+ getEntries() {
164
+ if (this.cachedEntries != null) {
165
+ return this.cachedEntries;
166
+ }
167
+ this.cachedEntries = this.entries.toArray();
168
+ return this.cachedEntries;
169
+ }
170
+ getSize() {
171
+ return this.entries.getSize();
172
+ }
173
+ clear() {
174
+ this.entries.clear();
175
+ this.cachedEntries = null;
176
+ this.notifySubscribers();
177
+ }
178
+ dispose() {
179
+ this.uninstall();
180
+ this.entries.clear();
181
+ this.cachedEntries = null;
182
+ this.clearSubscribers();
183
+ }
184
+ scheduleNotify() {
185
+ if (this.notifyScheduled) {
186
+ return;
187
+ }
188
+ this.notifyScheduled = true;
189
+ queueMicrotask(() => {
190
+ this.notifyScheduled = false;
191
+ this.notifySubscribers();
192
+ });
193
+ }
194
+ }
195
+ //# sourceMappingURL=WindowErrorStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WindowErrorStore.js","names":["CircularBuffer","SubscribableStore","entryCounter","nextId","Date","now","describeRejectionReason","reason","Error","message","stack","JSON","stringify","String","WindowErrorStore","cachedEntries","installed","suppressed","notifyScheduled","errorListener","rejectionListener","constructor","capacity","entries","install","window","event","error","undefined","entry","id","kind","filename","lineno","colno","timestamp","push","scheduleNotify","addEventListener","uninstall","removeEventListener","suppress","unsuppress","recordError","source","getEntries","toArray","getSize","clear","notifySubscribers","dispose","clearSubscribers","queueMicrotask"],"sources":["WindowErrorStore.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\n// Captures global JS errors (uncaught throws) and unhandled promise rejections\n// from the host page. React's dev-mode render errors are captured separately\n// via console.error in ConsoleLogStore, so we don't ship a dedicated error\n// boundary alongside this.\n\nimport { CircularBuffer } from \"../utils/CircularBuffer.js\";\nimport { SubscribableStore } from \"./SubscribableStore.js\";\n\nexport type WindowErrorKind = \"error\" | \"unhandledrejection\";\n\nexport interface WindowErrorEntry {\n readonly id: string;\n readonly kind: WindowErrorKind;\n readonly message: string;\n readonly stack?: string;\n readonly filename?: string;\n readonly lineno?: number;\n readonly colno?: number;\n readonly timestamp: number;\n}\n\nlet entryCounter = 0;\n\nfunction nextId(): string {\n return `windowError-${++entryCounter}-${Date.now()}`;\n}\n\nfunction describeRejectionReason(\n reason: unknown,\n): { message: string; stack?: string } {\n if (reason instanceof Error) {\n return { message: reason.message, stack: reason.stack };\n }\n if (typeof reason === \"string\") {\n return { message: reason };\n }\n try {\n return { message: JSON.stringify(reason) };\n } catch {\n return { message: String(reason) };\n }\n}\n\nexport class WindowErrorStore extends SubscribableStore {\n private readonly entries: CircularBuffer<WindowErrorEntry>;\n private cachedEntries: readonly WindowErrorEntry[] | null = null;\n private installed = false;\n private suppressed = false;\n private notifyScheduled = false;\n\n private errorListener: ((event: ErrorEvent) => void) | null = null;\n private rejectionListener:\n | ((event: PromiseRejectionEvent) => void)\n | null = null;\n\n constructor(capacity: number = 1000) {\n super();\n this.entries = new CircularBuffer(capacity);\n }\n\n install(): void {\n if (this.installed) {\n return;\n }\n if (typeof window === \"undefined\") {\n return;\n }\n\n this.errorListener = (event: ErrorEvent) => {\n if (this.suppressed) {\n return;\n }\n const message = event.message\n || (event.error instanceof Error ? event.error.message : \"Error\");\n const stack = event.error instanceof Error\n ? event.error.stack\n : undefined;\n const entry: WindowErrorEntry = {\n id: nextId(),\n kind: \"error\",\n message,\n ...(stack !== undefined ? { stack } : {}),\n ...(event.filename ? { filename: event.filename } : {}),\n ...(typeof event.lineno === \"number\" ? { lineno: event.lineno } : {}),\n ...(typeof event.colno === \"number\" ? { colno: event.colno } : {}),\n timestamp: Date.now(),\n };\n this.entries.push(entry);\n this.cachedEntries = null;\n this.scheduleNotify();\n };\n\n this.rejectionListener = (event: PromiseRejectionEvent) => {\n if (this.suppressed) {\n return;\n }\n const { message, stack } = describeRejectionReason(event.reason);\n const entry: WindowErrorEntry = {\n id: nextId(),\n kind: \"unhandledrejection\",\n message,\n ...(stack !== undefined ? { stack } : {}),\n timestamp: Date.now(),\n };\n this.entries.push(entry);\n this.cachedEntries = null;\n this.scheduleNotify();\n };\n\n window.addEventListener(\"error\", this.errorListener);\n window.addEventListener(\"unhandledrejection\", this.rejectionListener);\n this.installed = true;\n }\n\n uninstall(): void {\n if (!this.installed) {\n return;\n }\n if (typeof window !== \"undefined\") {\n if (this.errorListener) {\n window.removeEventListener(\"error\", this.errorListener);\n }\n if (this.rejectionListener) {\n window.removeEventListener(\n \"unhandledrejection\",\n this.rejectionListener,\n );\n }\n }\n this.errorListener = null;\n this.rejectionListener = null;\n this.installed = false;\n }\n\n suppress(): void {\n this.suppressed = true;\n }\n\n unsuppress(): void {\n this.suppressed = false;\n }\n\n recordError(error: Error, source?: string): void {\n if (this.suppressed) {\n return;\n }\n const entry: WindowErrorEntry = {\n id: nextId(),\n kind: \"error\",\n message: error.message,\n ...(error.stack !== undefined ? { stack: error.stack } : {}),\n ...(source !== undefined ? { filename: source } : {}),\n timestamp: Date.now(),\n };\n this.entries.push(entry);\n this.cachedEntries = null;\n this.scheduleNotify();\n }\n\n getEntries(): readonly WindowErrorEntry[] {\n if (this.cachedEntries != null) {\n return this.cachedEntries;\n }\n this.cachedEntries = this.entries.toArray();\n return this.cachedEntries;\n }\n\n getSize(): number {\n return this.entries.getSize();\n }\n\n clear(): void {\n this.entries.clear();\n this.cachedEntries = null;\n this.notifySubscribers();\n }\n\n dispose(): void {\n this.uninstall();\n this.entries.clear();\n this.cachedEntries = null;\n this.clearSubscribers();\n }\n\n private scheduleNotify(): void {\n if (this.notifyScheduled) {\n return;\n }\n this.notifyScheduled = true;\n queueMicrotask(() => {\n this.notifyScheduled = false;\n this.notifySubscribers();\n });\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,SAASA,cAAc,QAAQ,4BAA4B;AAC3D,SAASC,iBAAiB,QAAQ,wBAAwB;AAe1D,IAAIC,YAAY,GAAG,CAAC;AAEpB,SAASC,MAAMA,CAAA,EAAW;EACxB,OAAO,eAAe,EAAED,YAAY,IAAIE,IAAI,CAACC,GAAG,CAAC,CAAC,EAAE;AACtD;AAEA,SAASC,uBAAuBA,CAC9BC,MAAe,EACsB;EACrC,IAAIA,MAAM,YAAYC,KAAK,EAAE;IAC3B,OAAO;MAAEC,OAAO,EAAEF,MAAM,CAACE,OAAO;MAAEC,KAAK,EAAEH,MAAM,CAACG;IAAM,CAAC;EACzD;EACA,IAAI,OAAOH,MAAM,KAAK,QAAQ,EAAE;IAC9B,OAAO;MAAEE,OAAO,EAAEF;IAAO,CAAC;EAC5B;EACA,IAAI;IACF,OAAO;MAAEE,OAAO,EAAEE,IAAI,CAACC,SAAS,CAACL,MAAM;IAAE,CAAC;EAC5C,CAAC,CAAC,MAAM;IACN,OAAO;MAAEE,OAAO,EAAEI,MAAM,CAACN,MAAM;IAAE,CAAC;EACpC;AACF;AAEA,OAAO,MAAMO,gB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