@utk09/ui-observability 0.11.0 → 1.0.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 (557) hide show
  1. package/CHANGELOG.md +481 -0
  2. package/README.md +73 -669
  3. package/bin/uiobs.mjs +1 -1
  4. package/dist/{batch-CL9uWYY3.js → batch-CXmPmTse.js} +3 -3
  5. package/dist/batch-CXmPmTse.js.map +1 -0
  6. package/dist/{batch-C8OcWR2L.cjs → batch-mmPigCpi.cjs} +2 -2
  7. package/dist/batch-mmPigCpi.cjs.map +1 -0
  8. package/dist/bus/bus.d.cts +331 -0
  9. package/dist/bus/bus.d.ts +108 -57
  10. package/dist/bus/links.d.cts +132 -0
  11. package/dist/bus/links.d.ts +22 -7
  12. package/dist/bus/validation.d.cts +16 -0
  13. package/dist/bus/validation.d.ts +11 -2
  14. package/dist/bus-C39wspFV.js +775 -0
  15. package/dist/bus-C39wspFV.js.map +1 -0
  16. package/dist/bus-_EaOVPGq.cjs +2 -0
  17. package/dist/bus-_EaOVPGq.cjs.map +1 -0
  18. package/dist/capture/console.d.cts +37 -0
  19. package/dist/capture/console.d.ts +11 -11
  20. package/dist/capture/errors.d.cts +32 -0
  21. package/dist/capture/errors.d.ts +7 -7
  22. package/dist/capture/interactions.d.cts +48 -0
  23. package/dist/capture/interactions.d.ts +15 -15
  24. package/dist/capture/lifecycle.d.cts +20 -0
  25. package/dist/capture/lifecycle.d.ts +4 -4
  26. package/dist/capture/long-frames.d.cts +31 -0
  27. package/dist/capture/long-frames.d.ts +7 -7
  28. package/dist/capture/network.d.cts +57 -0
  29. package/dist/capture/network.d.ts +18 -18
  30. package/dist/capture/profiler-frames.d.cts +44 -0
  31. package/dist/capture/profiler-frames.d.ts +44 -0
  32. package/dist/capture/replay-buffer.d.cts +45 -0
  33. package/dist/capture/replay-buffer.d.ts +45 -0
  34. package/dist/capture/replay-upload.d.cts +79 -0
  35. package/dist/capture/replay-upload.d.ts +79 -0
  36. package/dist/capture/replay.d.cts +114 -0
  37. package/dist/capture/replay.d.ts +114 -0
  38. package/dist/capture/reports.d.cts +17 -0
  39. package/dist/capture/reports.d.ts +3 -3
  40. package/dist/capture/resource-timing.d.cts +14 -0
  41. package/dist/capture/resource-timing.d.ts +2 -2
  42. package/dist/capture/server-timing.d.cts +19 -0
  43. package/dist/capture/server-timing.d.ts +3 -3
  44. package/dist/capture/storm.d.cts +13 -0
  45. package/dist/capture/storm.d.ts +7 -7
  46. package/dist/capture/types.d.cts +128 -0
  47. package/dist/capture/types.d.ts +54 -41
  48. package/dist/capture/unclean-exit.d.cts +31 -0
  49. package/dist/capture/unclean-exit.d.ts +9 -9
  50. package/dist/capture/user-timing.d.cts +22 -0
  51. package/dist/capture/user-timing.d.ts +4 -4
  52. package/dist/capture/web-socket.d.cts +40 -0
  53. package/dist/capture/web-socket.d.ts +14 -14
  54. package/dist/capture/web-vitals.d.cts +40 -0
  55. package/dist/capture/web-vitals.d.ts +21 -8
  56. package/dist/compression-CvED_Jel.cjs +2 -0
  57. package/dist/compression-CvED_Jel.cjs.map +1 -0
  58. package/dist/compression-tVtXwVjX.js +11 -0
  59. package/dist/compression-tVtXwVjX.js.map +1 -0
  60. package/dist/config-DUs7uHHt.cjs +2 -0
  61. package/dist/config-DUs7uHHt.cjs.map +1 -0
  62. package/dist/config-SgQcCP1_.js +560 -0
  63. package/dist/config-SgQcCP1_.js.map +1 -0
  64. package/dist/console-BGgGnjSi.js +81 -0
  65. package/dist/console-BGgGnjSi.js.map +1 -0
  66. package/dist/console-CSZ5_Vx5.cjs +2 -0
  67. package/dist/console-CSZ5_Vx5.cjs.map +1 -0
  68. package/dist/constants-CUyd9cTZ.js +357 -0
  69. package/dist/constants-CUyd9cTZ.js.map +1 -0
  70. package/dist/constants-CqdJhTxH.cjs +2 -0
  71. package/dist/constants-CqdJhTxH.cjs.map +1 -0
  72. package/dist/constants.d.cts +751 -0
  73. package/dist/constants.d.ts +231 -116
  74. package/dist/core/breadcrumbs.d.cts +54 -0
  75. package/dist/core/breadcrumbs.d.ts +21 -15
  76. package/dist/core/config.d.cts +45 -0
  77. package/dist/core/config.d.ts +33 -5
  78. package/dist/core/context.d.cts +24 -0
  79. package/dist/core/context.d.ts +8 -13
  80. package/dist/core/debug-buffer.d.cts +34 -0
  81. package/dist/core/debug-buffer.d.ts +13 -13
  82. package/dist/core/debug-bundle.d.cts +12 -0
  83. package/dist/core/debug-bundle.d.ts +6 -6
  84. package/dist/core/deferred.d.cts +7 -0
  85. package/dist/core/deferred.d.ts +4 -4
  86. package/dist/core/diagnostics.d.cts +86 -0
  87. package/dist/core/diagnostics.d.ts +25 -22
  88. package/dist/core/drops.d.cts +39 -0
  89. package/dist/core/drops.d.ts +22 -12
  90. package/dist/core/hold-buffer.d.cts +36 -0
  91. package/dist/core/hold-buffer.d.ts +16 -7
  92. package/dist/core/journey.d.cts +148 -0
  93. package/dist/core/journey.d.ts +28 -29
  94. package/dist/core/logger.d.cts +141 -0
  95. package/dist/core/logger.d.ts +45 -51
  96. package/dist/core/measure.d.cts +30 -0
  97. package/dist/core/measure.d.ts +21 -10
  98. package/dist/core/meter.d.cts +78 -0
  99. package/dist/core/meter.d.ts +38 -28
  100. package/dist/core/pipeline.d.cts +227 -0
  101. package/dist/core/pipeline.d.ts +114 -50
  102. package/dist/core/profile-buckets.d.cts +31 -0
  103. package/dist/core/profile-buckets.d.ts +31 -0
  104. package/dist/core/profiler.d.cts +218 -0
  105. package/dist/core/profiler.d.ts +218 -0
  106. package/dist/core/record.d.cts +190 -0
  107. package/dist/core/record.d.ts +67 -35
  108. package/dist/core/remote-rules.d.cts +17 -0
  109. package/dist/core/remote-rules.d.ts +7 -7
  110. package/dist/core/remote-sampling.d.cts +74 -0
  111. package/dist/core/remote-sampling.d.ts +24 -23
  112. package/dist/core/rotation.d.cts +75 -0
  113. package/dist/core/rotation.d.ts +75 -0
  114. package/dist/core/runtime.d.cts +765 -0
  115. package/dist/core/runtime.d.ts +430 -186
  116. package/dist/core/sampling.d.cts +86 -0
  117. package/dist/core/sampling.d.ts +22 -22
  118. package/dist/core/sender.d.cts +161 -0
  119. package/dist/core/sender.d.ts +80 -34
  120. package/dist/core/spans.d.cts +39 -0
  121. package/dist/core/spans.d.ts +6 -6
  122. package/dist/{deadline-BOjOxNHj.js → deadline-C4ccAuk5.js} +3 -6
  123. package/dist/deadline-C4ccAuk5.js.map +1 -0
  124. package/dist/deadline-CUGbto-y.cjs +2 -0
  125. package/dist/deadline-CUGbto-y.cjs.map +1 -0
  126. package/dist/debug-bundle-BXIlwDKM.cjs +2 -0
  127. package/dist/debug-bundle-BXIlwDKM.cjs.map +1 -0
  128. package/dist/debug-bundle-CRpYV_ui.js +35 -0
  129. package/dist/debug-bundle-CRpYV_ui.js.map +1 -0
  130. package/dist/defineProperty-X1c4tIPD.cjs +1 -0
  131. package/dist/defineProperty-s2S8BXUc.js +35 -0
  132. package/dist/doctor.cjs +1 -1
  133. package/dist/doctor.cjs.map +1 -1
  134. package/dist/doctor.d.cts +36 -0
  135. package/dist/doctor.d.ts +19 -6
  136. package/dist/doctor.js +180 -53
  137. package/dist/doctor.js.map +1 -1
  138. package/dist/error-like-B11pB4aL.js.map +1 -1
  139. package/dist/error-like-gGRx2s36.cjs.map +1 -1
  140. package/dist/errors-BE_EZV7Q.js +86 -0
  141. package/dist/errors-BE_EZV7Q.js.map +1 -0
  142. package/dist/errors-CNPbesMs.cjs +3 -0
  143. package/dist/errors-CNPbesMs.cjs.map +1 -0
  144. package/dist/factory-CTi0Is3F.js +404 -0
  145. package/dist/factory-CTi0Is3F.js.map +1 -0
  146. package/dist/factory-hRrH32v5.cjs +2 -0
  147. package/dist/factory-hRrH32v5.cjs.map +1 -0
  148. package/dist/fixed-window-CvESpFYV.cjs.map +1 -1
  149. package/dist/fixed-window-Dq3MLUUv.js.map +1 -1
  150. package/dist/global-scope-BN-Io_yv.cjs.map +1 -1
  151. package/dist/global-scope-D9I8s-oN.js.map +1 -1
  152. package/dist/guards-BlYGRK4l.js +10 -0
  153. package/dist/guards-BlYGRK4l.js.map +1 -0
  154. package/dist/guards-EjG3ahFp.cjs +2 -0
  155. package/dist/guards-EjG3ahFp.cjs.map +1 -0
  156. package/dist/{identity-DT5VmvXy.js → identity-DdhKgrpk.js} +11 -15
  157. package/dist/identity-DdhKgrpk.js.map +1 -0
  158. package/dist/identity-DlWRIuwy.cjs +2 -0
  159. package/dist/identity-DlWRIuwy.cjs.map +1 -0
  160. package/dist/index.cjs +1 -1
  161. package/dist/index.cjs.map +1 -1
  162. package/dist/index.d.cts +300 -0
  163. package/dist/index.d.ts +165 -141
  164. package/dist/index.js +1283 -1468
  165. package/dist/index.js.map +1 -1
  166. package/dist/indexeddb-storage-CL9uqBCy.cjs +2 -0
  167. package/dist/indexeddb-storage-CL9uqBCy.cjs.map +1 -0
  168. package/dist/{indexeddb-storage-BJVtiQKm.js → indexeddb-storage-GHdl0t8A.js} +51 -47
  169. package/dist/indexeddb-storage-GHdl0t8A.js.map +1 -0
  170. package/dist/interactions-CUkzK8sR.cjs +2 -0
  171. package/dist/interactions-CUkzK8sR.cjs.map +1 -0
  172. package/dist/{interactions-DTgKy_6K.js → interactions-DiFvCosX.js} +41 -49
  173. package/dist/interactions-DiFvCosX.js.map +1 -0
  174. package/dist/journey-B4Adltjm.cjs +2 -0
  175. package/dist/journey-B4Adltjm.cjs.map +1 -0
  176. package/dist/{journey-CuJrHzEg.js → journey-D2_sia57.js} +51 -53
  177. package/dist/journey-D2_sia57.js.map +1 -0
  178. package/dist/{library-console-C1m6g1BR.js → library-console-Btrzt814.js} +2 -2
  179. package/dist/library-console-Btrzt814.js.map +1 -0
  180. package/dist/{library-console-D2GY9Or6.cjs → library-console-CPW6bvZH.cjs} +2 -2
  181. package/dist/library-console-CPW6bvZH.cjs.map +1 -0
  182. package/dist/{library-request-BQBT9N9Q.js → library-request-BJ9PLRaD.js} +2 -2
  183. package/dist/library-request-BJ9PLRaD.js.map +1 -0
  184. package/dist/{library-request-1BX_UlaX.cjs → library-request-D7OvTxZV.cjs} +2 -2
  185. package/dist/library-request-D7OvTxZV.cjs.map +1 -0
  186. package/dist/{lifecycle-BaKx_-32.js → lifecycle-22CUCrc9.js} +21 -29
  187. package/dist/lifecycle-22CUCrc9.js.map +1 -0
  188. package/dist/lifecycle-IaAm1mOC.cjs +2 -0
  189. package/dist/lifecycle-IaAm1mOC.cjs.map +1 -0
  190. package/dist/{log-record-CAoGBBf3.js → log-record-BNiLfqtL.js} +8 -7
  191. package/dist/log-record-BNiLfqtL.js.map +1 -0
  192. package/dist/log-record-CkivuiEl.cjs +2 -0
  193. package/dist/log-record-CkivuiEl.cjs.map +1 -0
  194. package/dist/long-frames-BUUbXd-B.cjs +2 -0
  195. package/dist/long-frames-BUUbXd-B.cjs.map +1 -0
  196. package/dist/long-frames-DNFaRnC3.js +62 -0
  197. package/dist/long-frames-DNFaRnC3.js.map +1 -0
  198. package/dist/models/batch.d.cts +57 -0
  199. package/dist/models/batch.d.ts +16 -17
  200. package/dist/models/bus.d.cts +158 -0
  201. package/dist/models/bus.d.ts +46 -26
  202. package/dist/models/config.d.cts +1540 -0
  203. package/dist/models/config.d.ts +692 -405
  204. package/dist/models/drop.d.cts +54 -0
  205. package/dist/models/drop.d.ts +29 -14
  206. package/dist/models/health.d.cts +148 -0
  207. package/dist/models/health.d.ts +119 -23
  208. package/dist/models/log-record.d.cts +61 -0
  209. package/dist/models/log-record.d.ts +13 -14
  210. package/dist/models/metric.d.cts +139 -0
  211. package/dist/models/metric.d.ts +94 -18
  212. package/dist/models/plugin.d.cts +47 -0
  213. package/dist/models/plugin.d.ts +16 -16
  214. package/dist/models/replay.d.cts +60 -0
  215. package/dist/models/replay.d.ts +60 -0
  216. package/dist/models/serializer.d.cts +23 -0
  217. package/dist/models/serializer.d.ts +3 -4
  218. package/dist/models/storage.d.cts +95 -0
  219. package/dist/models/storage.d.ts +17 -14
  220. package/dist/network-CGMLQ-mA.cjs +2 -0
  221. package/dist/network-CGMLQ-mA.cjs.map +1 -0
  222. package/dist/{network-DBNwApoF.js → network-on2zZT6H.js} +57 -57
  223. package/dist/network-on2zZT6H.js.map +1 -0
  224. package/dist/openfin-Bxelt0yg.js.map +1 -1
  225. package/dist/openfin-DtH2f7zX.cjs.map +1 -1
  226. package/dist/otlp-BENHf3g9.cjs +2 -0
  227. package/dist/otlp-BENHf3g9.cjs.map +1 -0
  228. package/dist/{otlp-BTJdIa6F.js → otlp-DimfrRor.js} +22 -29
  229. package/dist/otlp-DimfrRor.js.map +1 -0
  230. package/dist/patch-BX8KrPCT.cjs.map +1 -1
  231. package/dist/patch-UdPz1ea8.js.map +1 -1
  232. package/dist/{platform-DkcuXwe-.js → platform-BaaFIPCU.js} +8 -8
  233. package/dist/platform-BaaFIPCU.js.map +1 -0
  234. package/dist/{platform-C2Ez5kDc.cjs → platform-CfA3-7sJ.cjs} +2 -2
  235. package/dist/platform-CfA3-7sJ.cjs.map +1 -0
  236. package/dist/profiler-BAZoh7A4.js +292 -0
  237. package/dist/profiler-BAZoh7A4.js.map +1 -0
  238. package/dist/profiler-D4tJpDRc.cjs +2 -0
  239. package/dist/profiler-D4tJpDRc.cjs.map +1 -0
  240. package/dist/profiler-frames-C4xr7KfH.cjs +2 -0
  241. package/dist/profiler-frames-C4xr7KfH.cjs.map +1 -0
  242. package/dist/profiler-frames-cJMx9wNM.js +78 -0
  243. package/dist/profiler-frames-cJMx9wNM.js.map +1 -0
  244. package/dist/remote-rules-Dz9MRAsB.js +95 -0
  245. package/dist/remote-rules-Dz9MRAsB.js.map +1 -0
  246. package/dist/remote-rules-_tY0zj5o.cjs +2 -0
  247. package/dist/remote-rules-_tY0zj5o.cjs.map +1 -0
  248. package/dist/replay-B3gFXIZd.cjs +2 -0
  249. package/dist/replay-B3gFXIZd.cjs.map +1 -0
  250. package/dist/replay-Ds-ANH34.js +310 -0
  251. package/dist/replay-Ds-ANH34.js.map +1 -0
  252. package/dist/reports-BDSe4dFH.cjs +2 -0
  253. package/dist/reports-BDSe4dFH.cjs.map +1 -0
  254. package/dist/{reports-TA-zInnq.js → reports-C-thq-bk.js} +25 -30
  255. package/dist/reports-C-thq-bk.js.map +1 -0
  256. package/dist/resource-timing-C576gFIQ.cjs +2 -0
  257. package/dist/resource-timing-C576gFIQ.cjs.map +1 -0
  258. package/dist/{resource-timing-BLv3EA2A.js → resource-timing-eUl2dNgC.js} +20 -23
  259. package/dist/resource-timing-eUl2dNgC.js.map +1 -0
  260. package/dist/response-body-YdNl-HkR.cjs +3 -0
  261. package/dist/response-body-YdNl-HkR.cjs.map +1 -0
  262. package/dist/response-body-eoSQpLiH.js +331 -0
  263. package/dist/response-body-eoSQpLiH.js.map +1 -0
  264. package/dist/rotation-Cwct4ckk.js +94 -0
  265. package/dist/rotation-Cwct4ckk.js.map +1 -0
  266. package/dist/rotation-D4qUAHAu.cjs +2 -0
  267. package/dist/rotation-D4qUAHAu.cjs.map +1 -0
  268. package/dist/sampling-BlrI8jor.js +63 -0
  269. package/dist/sampling-BlrI8jor.js.map +1 -0
  270. package/dist/sampling-mXt4dstx.cjs +2 -0
  271. package/dist/sampling-mXt4dstx.cjs.map +1 -0
  272. package/dist/{sanitize-6ymPlVvP.js → sanitize-Ba0KqU06.js} +2 -2
  273. package/dist/sanitize-Ba0KqU06.js.map +1 -0
  274. package/dist/{sanitize-BAWzkZt0.cjs → sanitize-DQyiI_KY.cjs} +2 -2
  275. package/dist/sanitize-DQyiI_KY.cjs.map +1 -0
  276. package/dist/sender-BdRuNVhF.cjs +2 -0
  277. package/dist/sender-BdRuNVhF.cjs.map +1 -0
  278. package/dist/sender-Dv8rAmpV.js +979 -0
  279. package/dist/sender-Dv8rAmpV.js.map +1 -0
  280. package/dist/storage/context-storage.d.cts +90 -0
  281. package/dist/storage/context-storage.d.ts +38 -37
  282. package/dist/storage/emergency-queue.d.cts +27 -0
  283. package/dist/storage/emergency-queue.d.ts +13 -13
  284. package/dist/storage/eviction.d.cts +40 -0
  285. package/dist/storage/eviction.d.ts +13 -13
  286. package/dist/storage/factory.d.cts +21 -0
  287. package/dist/storage/factory.d.ts +11 -10
  288. package/dist/storage/gap.d.cts +20 -0
  289. package/dist/storage/gap.d.ts +9 -9
  290. package/dist/storage/idb-driver.d.cts +93 -0
  291. package/dist/storage/idb-driver.d.ts +32 -33
  292. package/dist/storage/indexeddb-storage.d.cts +97 -0
  293. package/dist/storage/indexeddb-storage.d.ts +38 -31
  294. package/dist/storage/keys.d.cts +17 -0
  295. package/dist/storage/keys.d.ts +9 -9
  296. package/dist/storage/local-storage.d.cts +139 -0
  297. package/dist/storage/local-storage.d.ts +49 -42
  298. package/dist/storage/memory-storage.d.cts +73 -0
  299. package/dist/storage/memory-storage.d.ts +25 -25
  300. package/dist/storage/persistence.d.cts +8 -0
  301. package/dist/storage/persistence.d.ts +3 -3
  302. package/dist/storage/stored-context.d.cts +34 -0
  303. package/dist/storage/stored-context.d.ts +34 -0
  304. package/dist/stored-context-B2EzVuYm.js +51 -0
  305. package/dist/stored-context-B2EzVuYm.js.map +1 -0
  306. package/dist/stored-context-CXt7eHZL.cjs +2 -0
  307. package/dist/stored-context-CXt7eHZL.cjs.map +1 -0
  308. package/dist/storm-C-zYSdDX.cjs +2 -0
  309. package/dist/storm-C-zYSdDX.cjs.map +1 -0
  310. package/dist/storm-DjKetLKZ.js +9 -0
  311. package/dist/storm-DjKetLKZ.js.map +1 -0
  312. package/dist/transport/compression.d.cts +7 -0
  313. package/dist/transport/compression.d.ts +2 -2
  314. package/dist/transport/custom-transport.d.cts +22 -0
  315. package/dist/transport/custom-transport.d.ts +6 -5
  316. package/dist/transport/errors.d.cts +31 -0
  317. package/dist/transport/errors.d.ts +7 -7
  318. package/dist/transport/exit-flush.d.cts +135 -0
  319. package/dist/transport/exit-flush.d.ts +62 -45
  320. package/dist/transport/headers.d.cts +8 -0
  321. package/dist/transport/headers.d.ts +4 -4
  322. package/dist/transport/http-transport.d.cts +116 -0
  323. package/dist/transport/http-transport.d.ts +48 -35
  324. package/dist/transport/memory-transport.d.cts +30 -0
  325. package/dist/transport/memory-transport.d.ts +8 -8
  326. package/dist/transport/response-body.d.cts +49 -0
  327. package/dist/transport/response-body.d.ts +49 -0
  328. package/dist/transport/retry-engine.d.cts +129 -0
  329. package/dist/transport/retry-engine.d.ts +62 -43
  330. package/dist/transport/serializers/ecs.d.cts +3 -0
  331. package/dist/transport/serializers/ecs.d.ts +2 -2
  332. package/dist/transport/serializers/otlp-metrics.d.cts +3 -0
  333. package/dist/transport/serializers/otlp-metrics.d.ts +2 -2
  334. package/dist/transport/serializers/otlp-traces.d.cts +3 -0
  335. package/dist/transport/serializers/otlp-traces.d.ts +2 -2
  336. package/dist/transport/serializers/otlp.d.cts +47 -0
  337. package/dist/transport/serializers/otlp.d.ts +18 -18
  338. package/dist/transport/serializers/select.d.cts +38 -0
  339. package/dist/transport/serializers/select.d.ts +11 -11
  340. package/dist/transport/status-transport.d.cts +129 -0
  341. package/dist/transport/status-transport.d.ts +45 -28
  342. package/dist/transport/worker-client.d.cts +23 -0
  343. package/dist/transport/worker-client.d.ts +12 -3
  344. package/dist/transport/worker-entry.d.cts +5 -0
  345. package/dist/transport/worker-entry.d.ts +1 -1
  346. package/dist/transport/worker-protocol.d.cts +38 -0
  347. package/dist/transport/worker-protocol.d.ts +7 -5
  348. package/dist/transport/worker-server.d.cts +3 -0
  349. package/dist/transport/worker-server.d.ts +1 -1
  350. package/dist/transport/worker-transport.d.cts +10 -0
  351. package/dist/transport/worker-transport.d.ts +5 -4
  352. package/dist/types-BAerHgCq.js.map +1 -1
  353. package/dist/types-C7WNpnG1.cjs.map +1 -1
  354. package/dist/{unclean-exit-CwcUhFOn.js → unclean-exit-DQD1cT7c.js} +23 -30
  355. package/dist/unclean-exit-DQD1cT7c.js.map +1 -0
  356. package/dist/unclean-exit-py99ApzT.cjs +2 -0
  357. package/dist/unclean-exit-py99ApzT.cjs.map +1 -0
  358. package/dist/unref-CU9Nyz_9.cjs +2 -0
  359. package/dist/unref-CU9Nyz_9.cjs.map +1 -0
  360. package/dist/unref-DgHPQeWv.js +7 -0
  361. package/dist/unref-DgHPQeWv.js.map +1 -0
  362. package/dist/{user-timing-_jZIhDKI.js → user-timing-BePqb1uN.js} +18 -18
  363. package/dist/user-timing-BePqb1uN.js.map +1 -0
  364. package/dist/user-timing-D6XTmpuM.cjs +2 -0
  365. package/dist/user-timing-D6XTmpuM.cjs.map +1 -0
  366. package/dist/utils/console.d.cts +36 -0
  367. package/dist/utils/console.d.ts +6 -6
  368. package/dist/utils/deadline.d.cts +14 -0
  369. package/dist/utils/deadline.d.ts +4 -4
  370. package/dist/utils/error-like.d.cts +25 -0
  371. package/dist/utils/error-like.d.ts +7 -7
  372. package/dist/utils/fixed-window.d.cts +25 -0
  373. package/dist/utils/fixed-window.d.ts +9 -8
  374. package/dist/utils/global-scope.d.cts +20 -0
  375. package/dist/utils/global-scope.d.ts +8 -8
  376. package/dist/utils/guards.d.cts +14 -0
  377. package/dist/utils/guards.d.ts +10 -2
  378. package/dist/utils/identity.d.cts +109 -0
  379. package/dist/utils/identity.d.ts +20 -21
  380. package/dist/utils/library-console.d.cts +11 -0
  381. package/dist/utils/library-console.d.ts +4 -4
  382. package/dist/utils/library-request.d.cts +24 -0
  383. package/dist/utils/library-request.d.ts +10 -10
  384. package/dist/utils/lock.d.cts +24 -0
  385. package/dist/utils/lock.d.ts +11 -10
  386. package/dist/utils/openfin.d.cts +48 -0
  387. package/dist/utils/openfin.d.ts +5 -5
  388. package/dist/utils/patch.d.cts +9 -0
  389. package/dist/utils/patch.d.ts +6 -6
  390. package/dist/utils/platform.d.cts +62 -0
  391. package/dist/utils/platform.d.ts +15 -13
  392. package/dist/utils/sanitize.d.cts +52 -0
  393. package/dist/utils/sanitize.d.ts +5 -5
  394. package/dist/utils/sequence.d.cts +10 -0
  395. package/dist/utils/tracing.d.cts +158 -0
  396. package/dist/utils/tracing.d.ts +49 -42
  397. package/dist/utils/unref.d.cts +9 -0
  398. package/dist/utils/unref.d.ts +3 -3
  399. package/dist/web-socket-CoIUBM3C.cjs +2 -0
  400. package/dist/web-socket-CoIUBM3C.cjs.map +1 -0
  401. package/dist/{web-socket-CV7yIMnm.js → web-socket-DSHgDiZ6.js} +23 -28
  402. package/dist/web-socket-DSHgDiZ6.js.map +1 -0
  403. package/dist/web-vitals-4pWACwaR.js +71 -0
  404. package/dist/web-vitals-4pWACwaR.js.map +1 -0
  405. package/dist/web-vitals-__X7t4pj.cjs +2 -0
  406. package/dist/web-vitals-__X7t4pj.cjs.map +1 -0
  407. package/dist/worker-protocol-QbvqNazn.cjs +2 -0
  408. package/dist/worker-protocol-QbvqNazn.cjs.map +1 -0
  409. package/dist/{worker-protocol-CrsdSDLn.js → worker-protocol-x074Rpet.js} +14 -11
  410. package/dist/worker-protocol-x074Rpet.js.map +1 -0
  411. package/dist/worker-server-CFe4nvos.cjs +2 -0
  412. package/dist/worker-server-CFe4nvos.cjs.map +1 -0
  413. package/dist/worker-server-iUVSjH8L.js +94 -0
  414. package/dist/worker-server-iUVSjH8L.js.map +1 -0
  415. package/dist/worker-transport-CRAX-09c.cjs +2 -0
  416. package/dist/worker-transport-CRAX-09c.cjs.map +1 -0
  417. package/dist/worker-transport-Dy1KMA7t.js +190 -0
  418. package/dist/worker-transport-Dy1KMA7t.js.map +1 -0
  419. package/llms.txt +397 -0
  420. package/package.json +55 -41
  421. package/dist/batch-C8OcWR2L.cjs.map +0 -1
  422. package/dist/batch-CL9uWYY3.js.map +0 -1
  423. package/dist/bus-BZ0GldpT.js +0 -660
  424. package/dist/bus-BZ0GldpT.js.map +0 -1
  425. package/dist/bus-VWlmM5xs.cjs +0 -2
  426. package/dist/bus-VWlmM5xs.cjs.map +0 -1
  427. package/dist/console-BPZCuSLc.cjs +0 -2
  428. package/dist/console-BPZCuSLc.cjs.map +0 -1
  429. package/dist/console-BeCF7n59.js +0 -82
  430. package/dist/console-BeCF7n59.js.map +0 -1
  431. package/dist/constants-DqKJH_MP.cjs +0 -2
  432. package/dist/constants-DqKJH_MP.cjs.map +0 -1
  433. package/dist/constants-zyrqveN4.js +0 -304
  434. package/dist/constants-zyrqveN4.js.map +0 -1
  435. package/dist/context-storage-BjzeBSxH.cjs +0 -2
  436. package/dist/context-storage-BjzeBSxH.cjs.map +0 -1
  437. package/dist/context-storage-BzkoHzkQ.js +0 -51
  438. package/dist/context-storage-BzkoHzkQ.js.map +0 -1
  439. package/dist/deadline-BOjOxNHj.js.map +0 -1
  440. package/dist/deadline-XSnm95pg.cjs +0 -2
  441. package/dist/deadline-XSnm95pg.cjs.map +0 -1
  442. package/dist/debug-bundle-BzJNpbF0.cjs +0 -2
  443. package/dist/debug-bundle-BzJNpbF0.cjs.map +0 -1
  444. package/dist/debug-bundle-C7UkHZ-q.js +0 -25
  445. package/dist/debug-bundle-C7UkHZ-q.js.map +0 -1
  446. package/dist/emergency-queue-CNTRui5t.cjs +0 -2
  447. package/dist/emergency-queue-CNTRui5t.cjs.map +0 -1
  448. package/dist/emergency-queue-Zy6lNafo.js +0 -67
  449. package/dist/emergency-queue-Zy6lNafo.js.map +0 -1
  450. package/dist/errors-Dh7kef0i.js +0 -92
  451. package/dist/errors-Dh7kef0i.js.map +0 -1
  452. package/dist/errors-tfEr48bS.cjs +0 -3
  453. package/dist/errors-tfEr48bS.cjs.map +0 -1
  454. package/dist/factory-BonqI3NL.js +0 -276
  455. package/dist/factory-BonqI3NL.js.map +0 -1
  456. package/dist/factory-CJXVYp0R.cjs +0 -2
  457. package/dist/factory-CJXVYp0R.cjs.map +0 -1
  458. package/dist/guards-Cidk71ME.js +0 -7
  459. package/dist/guards-Cidk71ME.js.map +0 -1
  460. package/dist/guards-nJ70syPt.cjs +0 -2
  461. package/dist/guards-nJ70syPt.cjs.map +0 -1
  462. package/dist/identity-Cxgj6pZX.cjs +0 -2
  463. package/dist/identity-Cxgj6pZX.cjs.map +0 -1
  464. package/dist/identity-DT5VmvXy.js.map +0 -1
  465. package/dist/indexeddb-storage-BJVtiQKm.js.map +0 -1
  466. package/dist/indexeddb-storage-CIoW21Xd.cjs +0 -2
  467. package/dist/indexeddb-storage-CIoW21Xd.cjs.map +0 -1
  468. package/dist/interactions-DTgKy_6K.js.map +0 -1
  469. package/dist/interactions-fEN6FbVo.cjs +0 -2
  470. package/dist/interactions-fEN6FbVo.cjs.map +0 -1
  471. package/dist/journey-CuJrHzEg.js.map +0 -1
  472. package/dist/journey-pffMVMfa.cjs +0 -2
  473. package/dist/journey-pffMVMfa.cjs.map +0 -1
  474. package/dist/keys-BHhw_0Wh.cjs +0 -2
  475. package/dist/keys-BHhw_0Wh.cjs.map +0 -1
  476. package/dist/keys-BU9j5YqW.js +0 -16
  477. package/dist/keys-BU9j5YqW.js.map +0 -1
  478. package/dist/library-console-C1m6g1BR.js.map +0 -1
  479. package/dist/library-console-D2GY9Or6.cjs.map +0 -1
  480. package/dist/library-request-1BX_UlaX.cjs.map +0 -1
  481. package/dist/library-request-BQBT9N9Q.js.map +0 -1
  482. package/dist/lifecycle-2EtUaRpo.cjs +0 -2
  483. package/dist/lifecycle-2EtUaRpo.cjs.map +0 -1
  484. package/dist/lifecycle-BaKx_-32.js.map +0 -1
  485. package/dist/log-record-CAoGBBf3.js.map +0 -1
  486. package/dist/log-record-i9zOTkpQ.cjs +0 -2
  487. package/dist/log-record-i9zOTkpQ.cjs.map +0 -1
  488. package/dist/long-frames-BVg4i5SC.cjs +0 -2
  489. package/dist/long-frames-BVg4i5SC.cjs.map +0 -1
  490. package/dist/long-frames-Czk7IupC.js +0 -64
  491. package/dist/long-frames-Czk7IupC.js.map +0 -1
  492. package/dist/models/stats.d.ts +0 -11
  493. package/dist/network-DBNwApoF.js.map +0 -1
  494. package/dist/network-xbbuvG_6.cjs +0 -2
  495. package/dist/network-xbbuvG_6.cjs.map +0 -1
  496. package/dist/otlp-BDvFrLnc.cjs +0 -2
  497. package/dist/otlp-BDvFrLnc.cjs.map +0 -1
  498. package/dist/otlp-BTJdIa6F.js.map +0 -1
  499. package/dist/platform-C2Ez5kDc.cjs.map +0 -1
  500. package/dist/platform-DkcuXwe-.js.map +0 -1
  501. package/dist/remote-rules-Cfb4K-Nl.js +0 -98
  502. package/dist/remote-rules-Cfb4K-Nl.js.map +0 -1
  503. package/dist/remote-rules-vzvk7aKf.cjs +0 -2
  504. package/dist/remote-rules-vzvk7aKf.cjs.map +0 -1
  505. package/dist/reports-Dk2YhKIh.cjs +0 -2
  506. package/dist/reports-Dk2YhKIh.cjs.map +0 -1
  507. package/dist/reports-TA-zInnq.js.map +0 -1
  508. package/dist/resource-timing-BLv3EA2A.js.map +0 -1
  509. package/dist/resource-timing-Cysw1S1f.cjs +0 -2
  510. package/dist/resource-timing-Cysw1S1f.cjs.map +0 -1
  511. package/dist/sampling-C4VV-1MS.js +0 -60
  512. package/dist/sampling-C4VV-1MS.js.map +0 -1
  513. package/dist/sampling-Ckh2yW9k.cjs +0 -2
  514. package/dist/sampling-Ckh2yW9k.cjs.map +0 -1
  515. package/dist/sanitize-6ymPlVvP.js.map +0 -1
  516. package/dist/sanitize-BAWzkZt0.cjs.map +0 -1
  517. package/dist/select-ZF4by-lF.cjs +0 -3
  518. package/dist/select-ZF4by-lF.cjs.map +0 -1
  519. package/dist/select-xtQaenIi.js +0 -270
  520. package/dist/select-xtQaenIi.js.map +0 -1
  521. package/dist/sender-CiMHC9YG.js +0 -856
  522. package/dist/sender-CiMHC9YG.js.map +0 -1
  523. package/dist/sender-D5wBoXA8.cjs +0 -2
  524. package/dist/sender-D5wBoXA8.cjs.map +0 -1
  525. package/dist/storage-BA9RqRO-.cjs +0 -2
  526. package/dist/storage-BA9RqRO-.cjs.map +0 -1
  527. package/dist/storage-DZwed89z.js +0 -16
  528. package/dist/storage-DZwed89z.js.map +0 -1
  529. package/dist/storm-CYi9Swpx.cjs +0 -2
  530. package/dist/storm-CYi9Swpx.cjs.map +0 -1
  531. package/dist/storm-VR024_QN.js +0 -9
  532. package/dist/storm-VR024_QN.js.map +0 -1
  533. package/dist/unclean-exit-CwcUhFOn.js.map +0 -1
  534. package/dist/unclean-exit-DFUN57wY.cjs +0 -2
  535. package/dist/unclean-exit-DFUN57wY.cjs.map +0 -1
  536. package/dist/user-timing-C9kfRq3J.cjs +0 -2
  537. package/dist/user-timing-C9kfRq3J.cjs.map +0 -1
  538. package/dist/user-timing-_jZIhDKI.js.map +0 -1
  539. package/dist/utils/timer.d.ts +0 -19
  540. package/dist/web-socket-BWUoqBh8.cjs +0 -2
  541. package/dist/web-socket-BWUoqBh8.cjs.map +0 -1
  542. package/dist/web-socket-CV7yIMnm.js.map +0 -1
  543. package/dist/web-vitals-Bq4WFHQo.js +0 -52
  544. package/dist/web-vitals-Bq4WFHQo.js.map +0 -1
  545. package/dist/web-vitals-DFuoTQbZ.cjs +0 -2
  546. package/dist/web-vitals-DFuoTQbZ.cjs.map +0 -1
  547. package/dist/worker-protocol-Bai7GAIA.cjs +0 -2
  548. package/dist/worker-protocol-Bai7GAIA.cjs.map +0 -1
  549. package/dist/worker-protocol-CrsdSDLn.js.map +0 -1
  550. package/dist/worker-server-BrIYkfoa.cjs +0 -2
  551. package/dist/worker-server-BrIYkfoa.cjs.map +0 -1
  552. package/dist/worker-server-Dp5HYm4b.js +0 -83
  553. package/dist/worker-server-Dp5HYm4b.js.map +0 -1
  554. package/dist/worker-transport-Bwej4N2e.cjs +0 -2
  555. package/dist/worker-transport-Bwej4N2e.cjs.map +0 -1
  556. package/dist/worker-transport-D6jtgpqN.js +0 -199
  557. package/dist/worker-transport-D6jtgpqN.js.map +0 -1
@@ -1,68 +1,80 @@
1
- import type { Receive, WorkerLike } from "../bus/links";
2
- import type { BusMessage } from "../models/bus";
3
- import type { FrameOptions, SourceOptions } from "../models/bus";
4
- import type { ObservabilityConfig, ResolvedConfig, SecurityContextUpdate, SecurityContextRotationOptions } from "../models/config";
5
- import type { InstrumentDef, Measure, MetricAttributes } from "../models/metric";
6
- import { type LogRecord } from "../models/log-record";
7
- import type { DeliveryStats } from "../models/stats";
8
- import type { DebugBundle, ObservabilityHealth } from "../models/health";
9
- import { ConsoleSink } from "../utils/console";
10
- import { type Identity } from "../utils/identity";
11
- import { type PlatformMetadata } from "../utils/platform";
12
- import { Sequence } from "../utils/sequence";
13
- import { TraceEngine } from "../utils/tracing";
14
- import { BreadcrumbBuffer } from "./breadcrumbs";
15
- import { ContextStore } from "./context";
16
- import { Diagnostics } from "./diagnostics";
17
- import { JourneyEngine } from "./journey";
18
- import { RecordBuilder } from "./record";
1
+ import type { Receive, WorkerLike } from "../bus/links.js";
2
+ import type { BusMessage } from "../models/bus.js";
3
+ import type { FrameOptions, SourceOptions } from "../models/bus.js";
4
+ import type { ObservabilityConfig, ResolvedConfig, SecurityContextUpdate, SecurityContextRotationOptions, ShutdownOptions } from "../models/config.js";
5
+ import type { InstrumentDef, Measure, MetricAttributes } from "../models/metric.js";
6
+ import { type LogRecord } from "../models/log-record.js";
7
+ import type { DebugBundle, FlushResult, ObservabilityHealth } from "../models/health.js";
8
+ import { ConsoleSink } from "../utils/console.js";
9
+ import { type Identity } from "../utils/identity.js";
10
+ import { type PlatformMetadata } from "../utils/platform.js";
11
+ import { Sequence } from "../utils/sequence.js";
12
+ import { TraceEngine } from "../utils/tracing.js";
13
+ import { BreadcrumbBuffer } from "./breadcrumbs.js";
14
+ import { ContextStore } from "./context.js";
15
+ import { Diagnostics } from "./diagnostics.js";
16
+ import { JourneyEngine } from "./journey.js";
17
+ import { RecordBuilder } from "./record.js";
19
18
  /** Manages subsystem lifecycles, bus coordination and record delivery. */
20
19
  export declare class ObservabilityRuntime {
21
- /** True while the runtime changes the security context. */
20
+ /** True while the security context is changing. */
22
21
  private rotating;
23
- /** True while the runtime collects the last records of the old context. */
22
+ /** Number of the latest rotateSecurityContext() call, so a queued call keeps `rotating` up. */
23
+ private rotationSeq;
24
+ /**
25
+ * True while this runtime has the profiler core attached. Tracking it keeps configure() from
26
+ * restarting the sampling every time, and keeps a runtime with the profiler off from ever
27
+ * creating the core and its global symbol.
28
+ */
29
+ private profilerOn;
30
+ /** True while the old context's last records are being collected. */
24
31
  private closingContext;
25
32
  /** Version of another SDK copy that owns the page runtime, or null. */
26
33
  private mismatchVersion;
27
- /** True if the configured context id differs from the owner context id. */
34
+ /** True if the configured context id differs from the owner's context id. */
28
35
  private contextMismatch;
29
- /** Current context change. Shutdown waits for this promise. */
36
+ /** The context change in progress. Shutdown waits for this promise. */
30
37
  private rotation?;
31
38
  /** Memory store kept for later context changes. */
32
39
  private memoryStorage?;
33
- /** State of the request for persistent storage. getHealth() reports it. */
40
+ /** State of the persistent storage request. getHealth() reports it. */
34
41
  private storagePersistence;
35
- /** True while a diagnostic record goes out. A diagnostic during that time gives no record. */
42
+ /** True while a diagnostic record goes out. Diagnostics raised meanwhile produce no record. */
36
43
  private recordingDiagnostic;
37
- /** Logger of the records that diagnostics.records gives. */
44
+ /** Logger for the records that diagnostics.records produces. */
38
45
  private readonly diagnosticLogger;
39
- /** Records that minLevel or sampling dropped. An error of this context sends them first. */
46
+ /** Records that minLevel or sampling dropped. An error in this context sends them first. */
40
47
  private readonly debugBuffer;
41
48
  /** True if the app supplied a context id at startup. */
42
49
  private explicitSecurityContext;
43
- /** True after this forwarder takes a context id from its owner. */
50
+ /** True once this forwarder has taken a context id from its owner. */
44
51
  private ownerAdopted;
45
52
  /**
46
- * Checks if a security context change is in progress.
53
+ * Checks whether a security context change is in progress.
47
54
  * @returns True until the current change completes.
48
55
  */
49
56
  isRotating(): boolean;
50
57
  /**
51
- * Locks or unlocks configuration at the request of the app. Other code of this origin can
52
- * call this method. The lock does not control access.
58
+ * Locks or unlocks configuration when the app asks. Any other code on this origin can call
59
+ * this too, so the lock is not access control.
53
60
  * @param locked True to refuse changes through configure().
54
61
  */
55
62
  setConfigurationLocked(locked: boolean): void;
56
63
  /**
57
- * Runtime of this copy of the library when another version owns the page runtime.
64
+ * This copy's runtime when another version of the library owns the page runtime.
58
65
  * It stays off the global key.
59
66
  */
60
67
  private static local;
61
68
  /**
62
- * Library version of this runtime. Another copy reads it from the global key.
63
- * Two versions with one runtime call methods that the other version does not have.
69
+ * This runtime's library version. Another copy reads it from the global key, because two
70
+ * versions sharing one runtime would call methods the other version doesn't have.
64
71
  */
65
72
  readonly sdkVersion: string;
73
+ /**
74
+ * This runtime's bus protocol tag. A same-origin child frame reads it from the global key
75
+ * before it opens a direct link, because a direct call has no envelope to carry the tag.
76
+ */
77
+ readonly protocol: string;
66
78
  /** Diagnostics reporter for internal faults. */
67
79
  readonly diagnostics: Diagnostics;
68
80
  /** Active configuration instance. A reconfigure changes it in place. */
@@ -71,12 +83,14 @@ export declare class ObservabilityRuntime {
71
83
  readonly platform: PlatformMetadata;
72
84
  /** Identity context containing session, tab, and context identifiers. */
73
85
  readonly identity: Identity;
74
- /** Stores for identity and journey keys. The runtime sets them at startup. */
86
+ /** Where the ids and the journey live. Memory until the start, so nothing touches storage. */
87
+ private backing;
88
+ /** Stores for identity and journey keys. They read the backing on every call. */
75
89
  private readonly stores;
76
- /** Identity strategy that the runtime used to make the stores. */
77
- private readonly identityBuiltAs;
78
- /** Throttled writer of the session's last-seen timestamp. */
79
- private readonly sessionTouch;
90
+ /** The identity strategy that the start uses. The app's startup call fixes it. */
91
+ private identityBuiltAs;
92
+ /** Throttled writer of the session's last-seen timestamp. The start builds it again. */
93
+ private sessionTouch;
80
94
  /** Store for ambient application context attributes. */
81
95
  readonly context: ContextStore;
82
96
  /** Ring buffer holding contextual user breadcrumbs. */
@@ -89,14 +103,25 @@ export declare class ObservabilityRuntime {
89
103
  readonly journey: JourneyEngine;
90
104
  /** Record builder assembling structured log records. */
91
105
  readonly builder: RecordBuilder;
92
- /** Slot of the remote sampling rules. The sender or the bus fills it. */
106
+ /** Slot for the remote sampling rules. The sender or the bus fills it. */
93
107
  private readonly remote;
94
- /** Count of delivery identity changes. The first id of a context is not a change. */
108
+ /** Number of delivery identity changes. A context's first id doesn't count as a change. */
95
109
  private identityEpoch;
96
- /** Timer that restores the local capture switches after the remote TTL. */
110
+ /** Session replay's hook. It gets every ERROR and FATAL record. */
111
+ private errorHook;
112
+ /**
113
+ * True after startReplay(), false after stopReplay(), undefined until either is called. The
114
+ * app's last choice survives a reinstall of the capture modules.
115
+ */
116
+ private replayConsent;
117
+ /** The installed session replay capture. */
118
+ private replay;
119
+ /** Timer that restores the local capture switches once the remote TTL ends. */
97
120
  private remoteCaptureTimer;
98
121
  /** Settings of the current capture load or install. */
99
122
  private installedCaptureKey;
123
+ /** The replay settings the running replay capture was built with. */
124
+ private replayBuiltKey;
100
125
  /** Console sink for local developer output. */
101
126
  readonly console: ConsoleSink;
102
127
  /** Collects lost records into onDrop summaries. */
@@ -104,60 +129,100 @@ export declare class ObservabilityRuntime {
104
129
  /** Sums the values of the counter and histogram instruments. */
105
130
  private readonly meter;
106
131
  /**
107
- * Cross-realm communication bus. It is null until its chunk loads.
108
- * In bus.mode "off", it loads only when a child frame or a worker needs it.
132
+ * Cross-realm communication bus. Null until its chunk loads. In bus.mode "off", it loads
133
+ * only when a child frame or a worker needs it.
109
134
  */
110
135
  private bus;
111
- /** Load and construction of the bus. It is undefined until the first need. */
136
+ /** Promise for the bus load and construction. Undefined until first needed. */
112
137
  private busBuilt?;
113
- /** Load and start of the bus. It is undefined until the first need. */
138
+ /** Promise for the bus load and start. Undefined until first needed. */
114
139
  private busLoad?;
115
- /** Storage strategy of the adapter. The runtime sets it when the build starts. */
116
- private storageBuiltAs?;
117
- /** Delivery stack. The runtime sets it in the sender role with an endpoint, after the chunk loads. */
140
+ /**
141
+ * Delivery stack. Set in the sender role with an endpoint or a custom transport, once the
142
+ * chunk has loaded.
143
+ */
118
144
  private sender?;
119
- /** Load of the delivery stack. It is undefined when nothing loads. A record then has no destination. */
145
+ /** The delivery stack load. Undefined when nothing loads, so records have no destination. */
120
146
  private senderLoad?;
121
- /** Records that arrive while the delivery stack loads. */
147
+ /** Records that arrive while the delivery stack loads, or while a pause holds them. */
122
148
  private readonly pendingRecords;
149
+ /** Records that dropPaused() reported, so a second pagehide doesn't count them again. */
150
+ private readonly pausedLoss;
151
+ /** Stored batches that a carry during a pause left for the next sender to adopt. */
152
+ private carried;
153
+ /** True once resetSession() ran. start() then keeps that session over the stored one. */
154
+ private sessionPicked;
155
+ /**
156
+ * True after a rotation fails. The app asked to leave the context, so the runtime sends no
157
+ * record with its endpoint or headers until a rotation succeeds.
158
+ */
159
+ private deliveryClosed;
160
+ /**
161
+ * The stopped sender of the context that a failed rotation closed. The next rotation that
162
+ * succeeds retires it with its own rule, so the old records don't stay or move by accident.
163
+ */
164
+ private parkedSender;
165
+ /** The sender that a rotation retires. Its records wait for the rotation's rule. */
166
+ private retiring;
167
+ /**
168
+ * True after the first configure() call failed. The runtime stays unconfigured and refuses
169
+ * each record, because it can't know what the app needs to redact.
170
+ */
171
+ private startFailed;
172
+ /**
173
+ * True once the runtime has started: the first configure() call that works, with enabled true.
174
+ * Before that, nothing is patched, stored or sent.
175
+ */
176
+ private running;
177
+ /** Opens the start gate below. Its promise sets it, and start() calls it. */
178
+ private openGate;
179
+ /** Resolves at the start. A frame or worker that registers before it joins the bus then. */
180
+ private readonly startGate;
123
181
  /** Active auto-capture instrumentation modules. */
124
182
  private readonly captures;
125
- /** Count of capture installs. An install that a later install replaced stops after its load. */
183
+ /** Number of capture installs. An install replaced by a later one stops after its load. */
126
184
  private captureGeneration;
127
- /** Capture work that a rebuild of the capture modules must not repeat. */
185
+ /** Capture work that rebuilding the capture modules must not repeat. */
128
186
  private readonly captureOnce;
129
- /** Queue buffering records created before bus role resolution. */
187
+ /** Holds records created before the bus role is resolved. */
130
188
  private readonly bootBuffer;
131
- /** Batch buffer staging records for microtask forwarding. */
189
+ /** Records staged for forwarding on the next microtask. */
132
190
  private forwardBuffer;
133
191
  /** True if a microtask drain of the forward buffer is pending. */
134
192
  private forwardScheduled;
135
- /** True if startup has decided the bus role. A sender load waits for it. */
193
+ /** True once startup has decided the bus role. A sender load waits for it. */
136
194
  private roleResolved;
137
- /** Resolves when startup releases the boot records. flush() waits for it. init() sets it. */
195
+ /** Resolves when startup releases the boot records. Set by init(), awaited by flush(). */
138
196
  private started;
139
197
  /** True if asynchronous initialization is complete. */
140
198
  private ready;
141
199
  /** True if shutdown stopped the runtime. */
142
200
  private destroyed;
143
- /** Timestamp of the last reported storage gap warning in epoch milliseconds. */
201
+ /** The first shutdown. A later shutdown() waits for it before it removes the stored data. */
202
+ private stopping?;
203
+ /** When the server last accepted a batch, in epoch milliseconds. A rotation keeps it. */
204
+ private lastSendAt;
205
+ /** When the last storage gap warning was reported, in epoch milliseconds. */
144
206
  private lastGapAt;
145
- /** Record limits of the builder and the console. The first configure() of the app sets them. */
207
+ /** Record limits for the builder and the console. The app's first configure() sets them. */
146
208
  private readonly limits;
147
- /** Lifetime rules of the journey engine. The first configure() of the app sets the age. */
209
+ /** Lifetime rules for the journey engine. The app's first configure() sets the age. */
148
210
  private readonly journeyOptions;
149
- /** False in a runtime that an early log call started. The first configure() then sets limits. */
211
+ /**
212
+ * False until the app's startup call, the first configure() call that works. That call sets
213
+ * every startup-fixed setting, also after an early log call.
214
+ */
150
215
  private tunablesLocked;
151
216
  /**
152
- * True for a console-only runtime. It sends nothing, joins no bus and installs no capture.
153
- * Another version of the library on the page, or a server, makes it console-only.
217
+ * True for a console-only runtime, which sends nothing, joins no bus and installs no capture.
218
+ * That happens next to another version of the library on the page, or on a server.
154
219
  */
155
220
  private readonly degraded;
156
- /** True after the report of a destination on a server. The runtime reports it one time. */
221
+ /** True once a destination on a server has been reported. It is reported only once. */
157
222
  private serverReported;
158
223
  /**
159
- * Ends the root span of a forwarder when its document unloads. The exit flush ends it only in
160
- * the sender. Without this, the client spans of a frame or a view have no parent.
224
+ * Ends a forwarder's root span when its document unloads. The exit flush only ends it in the
225
+ * sender, so without this the client spans of a frame or a view have no parent.
161
226
  */
162
227
  private readonly onPageHide;
163
228
  /**
@@ -166,100 +231,139 @@ export declare class ObservabilityRuntime {
166
231
  */
167
232
  private constructor();
168
233
  /**
169
- * Gives the handler of the diagnostics. With diagnostics.records, it also sends each event
170
- * as a record.
171
- * @returns The handler, or undefined without onDiagnostic and without diagnostic records.
234
+ * Returns the diagnostics handler. With diagnostics.records, it also sends every event as
235
+ * a record.
236
+ * @returns The handler, or undefined with no onDiagnostic and no diagnostic records.
172
237
  */
173
238
  private diagnosticHandler;
174
239
  /**
175
240
  * Sends a diagnostic event as a record when diagnostics.records selects its code.
176
- * A diagnostic during that send gives no record. That stops a loop.
241
+ * A diagnostic raised during that send produces no record, which stops a loop.
177
242
  * @param event Diagnostic event.
178
243
  */
179
244
  private recordDiagnostic;
180
245
  /**
181
- * Adds a breadcrumb from app code. It copies the data now. A later change of the object of the
182
- * app then does not change the trail.
183
- * @param message Description of the event. A JavaScript caller can pass a value that is not a
184
- * string. The library converts it.
246
+ * Adds a breadcrumb from app code. The data is copied now, so a later change to the app's
247
+ * object doesn't change the trail.
248
+ * @param message Description of the event. A JavaScript caller can pass a non-string, which
249
+ * is converted.
185
250
  * @param data Optional metadata.
186
251
  */
187
252
  addBreadcrumb(message: unknown, data?: Record<string, unknown>): void;
188
253
  /**
189
- * Adds a value to a counter or a histogram. The meter sends one point at each interval.
190
- * @param def Definition of the instrument.
254
+ * Adds a value to a counter or a histogram. The meter sends one point per interval.
255
+ * @param def The instrument's definition.
191
256
  * @param value Value to add.
192
- * @param attributes Attribute set of the value.
257
+ * @param attributes The value's attribute set.
193
258
  */
194
259
  recordMetric(def: InstrumentDef, value: number, attributes?: MetricAttributes): void;
195
260
  /**
196
- * Starts a timed operation. A shutdown or a new delivery identity before its end drops its values.
261
+ * Starts a timed operation. Its values are dropped if the runtime has shut down or a rotation
262
+ * is running when it ends. With `securityContext.isolation`, a new delivery identity before
263
+ * the end drops them too.
197
264
  * @param name Operation name.
198
- * @param attributes Attribute set of each histogram point.
199
- * @returns The handle of the operation.
265
+ * @param attributes Attribute set for every histogram point.
266
+ * @returns The operation's handle.
200
267
  */
201
268
  startMeasure(name: string, attributes?: MetricAttributes): Measure;
202
269
  /**
203
- * Builds and emits the record of one span. The console does not print it. minLevel does not
204
- * drop it. The trace engine sampled the trace before the span existed.
270
+ * Builds and emits the record for one span. The console doesn't print it and minLevel
271
+ * doesn't drop it. The trace engine already sampled the trace before the span existed.
205
272
  * @param span The span data.
206
273
  */
207
274
  private recordSpan;
208
275
  /**
209
- * Builds and emits the record of one aggregated point. The console does not print it.
276
+ * Builds and emits the record for one aggregated point. The console doesn't print it.
210
277
  * @param name Metric name.
211
- * @param attributes Attributes of the call. The record limits apply to them.
212
- * @param fields Metric fields of the point. The record limits do not cut them.
278
+ * @param attributes The call's attributes. The record limits apply to them.
279
+ * @param fields The point's metric fields. The record limits don't truncate them.
213
280
  */
214
281
  private emitPoint;
282
+ /**
283
+ * Turns the profiler on or off to match profiler.enabled. Before switching off it sends the
284
+ * points that are waiting, because the switch would otherwise drop them.
285
+ */
286
+ private syncProfiler;
287
+ /**
288
+ * Gives or withdraws consent for session replay, and starts or stops the recorder if the
289
+ * capture is installed.
290
+ * @param consent True starts the recorder, false stops it.
291
+ */
292
+ setReplay(consent: boolean): void;
293
+ /**
294
+ * Sends the open interval of the meter and the profiler. The profiler doesn't calibrate here,
295
+ * which keeps flush and the exit path short and synchronous.
296
+ */
297
+ private collectPoints;
298
+ /**
299
+ * Starts a new identity epoch. With isolation on, the profiler also drops its data and open
300
+ * spans, so a span from the old identity can't add to the new one. The old identity's remote
301
+ * rules and capture switches don't apply to the new one.
302
+ */
303
+ private advanceIdentity;
215
304
  /**
216
305
  * Checks the source policy before a direct child link opens.
217
306
  * @param source Child window.
218
- * @param origin Origin of the child window.
219
- * @returns True if the bus permits this source.
307
+ * @param origin The child window's origin.
308
+ * @returns True if the bus allows this source.
220
309
  */
221
310
  readonly busCanAccept: (source: Window, origin: string) => boolean;
222
311
  /**
223
312
  * Receives direct messages from same-origin child frames.
224
313
  * @param message Inbound bus message.
225
314
  * @param reply Direct response callback.
226
- * @param source Window of the child frame.
315
+ * @param source The child frame's window.
227
316
  */
228
317
  readonly busAccept: (message: BusMessage, reply: Receive, source?: Window) => void;
229
318
  /**
230
- * Returns the runtime on the global key of this realm. Another copy of the library can own it.
319
+ * Returns the runtime on this realm's global key. Another copy of the library can own it.
231
320
  * @returns Pinned runtime instance or null.
232
321
  */
233
322
  private static pinned;
234
323
  /**
235
- * Returns the local runtime of this copy. Without one, it returns the pinned runtime.
236
- * A pinned runtime of another version gives null. A log call then starts the local runtime.
324
+ * Returns this copy's local runtime, or the pinned runtime if there is none. A pinned
325
+ * runtime from another version returns null, and a log call then starts the local runtime.
237
326
  * @returns Active runtime instance or null.
238
327
  */
239
328
  static current(): ObservabilityRuntime | null;
240
329
  /**
241
330
  * Returns the runtime that shutdown() stopped, until the next configure().
242
- * A stopped runtime of another version gives null.
331
+ * A stopped runtime from another version returns null.
243
332
  * @returns Stopped runtime instance or null.
244
333
  */
245
334
  static stopped(): ObservabilityRuntime | null;
246
335
  /**
247
- * Tests if shutdown() stopped this runtime.
248
- * @returns True after destroy() starts.
336
+ * Checks whether shutdown() stopped this runtime.
337
+ * @returns True once destroy() starts.
249
338
  */
250
339
  isDestroyed(): boolean;
251
340
  /**
252
341
  * Initializes a new runtime instance or updates the existing singleton.
253
342
  * @param input Consumer configuration options.
254
- * @param implicit True for the default runtime that an early log call starts.
343
+ * @param implicit True for the unconfigured runtime that an early log call makes.
255
344
  * @returns Active runtime instance.
256
345
  */
257
346
  static configure(input: Partial<ObservabilityConfig>, implicit?: boolean): ObservabilityRuntime;
258
347
  /**
259
- * Starts a console-only runtime next to the runtime of another version. It sends nothing,
260
- * joins no bus and installs no capture. The other version keeps the page runtime.
348
+ * Fails closed after the app's first configure() call couldn't be read. The library can't
349
+ * tell what the app must redact, so it refuses each record, the held ones too, until a call
350
+ * sets redact itself. The runtime stays unconfigured, so it writes no id to storage.
351
+ * @param error What reading the options threw.
352
+ */
353
+ private refuse;
354
+ /**
355
+ * Starts a runtime, or updates the one that runs. A getter in the input can throw here.
261
356
  * @param input Consumer configuration options.
262
- * @param found sdkVersion of the pinned runtime. A runtime before 0.9.0 has none.
357
+ * @param implicit True for the unconfigured runtime that an early log call makes.
358
+ * @returns Active runtime instance.
359
+ */
360
+ private static startOrUpdate;
361
+ /**
362
+ * Starts a console-only runtime next to another version's runtime. It sends nothing, joins
363
+ * no bus and installs no capture. The other version keeps the page runtime.
364
+ * @param input Consumer configuration options.
365
+ * @param found The pinned runtime's sdkVersion. A runtime older than 0.9.0 has none.
366
+ * @param implicit True for the unconfigured runtime that an early log call makes.
263
367
  * @returns The local runtime.
264
368
  */
265
369
  private static startDegraded;
@@ -269,73 +373,86 @@ export declare class ObservabilityRuntime {
269
373
  */
270
374
  private reconfigure;
271
375
  /**
272
- * Tests if the runtime runs on a server, for example Node during server-side rendering.
376
+ * Checks whether the runtime is on a server, for example Node during server-side rendering.
273
377
  * @returns True on Node.
274
378
  */
275
379
  private onServer;
276
380
  /**
277
- * Removes the delivery settings from the input of a console-only runtime. On a server, it
278
- * reports a destination one time.
381
+ * Removes the routing settings from a console-only runtime's input. On a server, it
382
+ * reports a destination once.
279
383
  * @param input Consumer configuration options.
280
- * @returns The options that the runtime accepts.
384
+ * @returns The options the runtime accepts.
281
385
  */
282
386
  private allowed;
283
387
  /**
284
- * Removes delivery and identity changes while isolation is on. The other settings still apply.
388
+ * Removes routing and identity changes while isolation is on. The other settings still apply.
285
389
  * @param input Consumer configuration options.
286
- * @returns The options without the refused delivery or identity changes.
390
+ * @returns The options without the refused routing or identity changes.
287
391
  */
288
392
  private keepRouting;
289
393
  /**
290
- * Restores the startup tunables in the next config. A part of the runtime reads each tunable
291
- * one time. A later change has no effect. The runtime then refuses it.
292
- * @param next Resolved config of a later configure() call.
394
+ * Restores the startup tunables in the next config. Each tunable is read once by some part
395
+ * of the runtime, so a later change would have no effect and is refused.
396
+ * @param next The resolved config from a later configure() call.
293
397
  */
294
398
  private keepStartupTunables;
295
399
  /**
296
- * Refuses a change of config sections. It restores the values in force in the next config.
297
- * @param next Resolved config of a later configure() call.
298
- * @param sections Sections that cannot change.
400
+ * Refuses a change to config sections by restoring the current values in the next config.
401
+ * @param next The resolved config from a later configure() call.
402
+ * @param sections Sections that can't change.
299
403
  */
300
404
  private keepSections;
301
- /**
302
- * Restores the storage strategy of the built adapter. The runtime reads all other keys
303
- * live. It builds the adapter only one time. A new adapter strands the batches in the
304
- * old adapter. That loss is worse than a refused change.
305
- */
306
- private keepBuiltStorage;
307
405
  /**
308
406
  * Refuses a change that leaves the built delivery stack with no destination.
309
- * Without a destination, the retry engine removes each stored batch as delivered.
407
+ * Without one, the retry engine removes every stored batch as if it were delivered.
310
408
  * @param input Partial configuration to merge.
311
409
  * @returns Input without the refused changes.
312
410
  */
313
411
  private keepDestination;
314
412
  /**
315
- * Restores the identity strategy from startup. The ids exist from startup.
316
- * A later change cannot move them to another store.
413
+ * Restores the identity strategy from startup. The ids have existed since startup, and a
414
+ * later change can't move them to another store.
317
415
  */
318
416
  private keepBuiltIdentity;
417
+ /**
418
+ * Fixes the startup settings at the first configure() call that works, then starts the
419
+ * runtime once enabled is true. A failed first call leaves the runtime unconfigured.
420
+ */
421
+ private launch;
422
+ /**
423
+ * Starts the runtime: reads the configured ids, gives the held records the app's hooks and
424
+ * resource, then installs the captures and starts the bus and the sender. Runs once.
425
+ */
426
+ private start;
427
+ /**
428
+ * Takes the records that log calls held before the app's startup call, and runs the app's
429
+ * hooks on them now.
430
+ * @returns The records the hooks kept, with the configured resource.
431
+ */
432
+ private rehookHeld;
319
433
  /** Initializes asynchronous subsystems and flushes the boot buffer. */
320
434
  private init;
321
- /** Resolves the bus role, loads the delivery stack and releases the boot records. It never rejects. */
435
+ /**
436
+ * Resolves the bus role, loads the delivery stack and releases the boot records.
437
+ * Never rejects.
438
+ */
322
439
  private boot;
323
440
  /**
324
- * Starts the load of the bus one time.
325
- * @returns Promise that resolves to the started bus, or null if it did not load.
441
+ * Starts the bus load once.
442
+ * @returns Promise that resolves to the started bus, or null if it didn't load.
326
443
  */
327
444
  private ensureBus;
328
445
  /**
329
- * Loads and constructs the bus one time. It does not call start().
330
- * @returns Promise that resolves to the constructed bus, or null if it did not load.
446
+ * Loads and constructs the bus once. Does not call start().
447
+ * @returns Promise that resolves to the constructed bus, or null if it didn't load.
331
448
  */
332
449
  private constructBus;
333
450
  /**
334
- * Starts the constructed bus. It never rejects.
335
- * @returns Promise that resolves to the started bus, or null if it did not load or start.
451
+ * Starts the constructed bus. Never rejects.
452
+ * @returns Promise that resolves to the started bus, or null if it didn't load or start.
336
453
  */
337
454
  private startBus;
338
- /** Imports and constructs the bus. It never rejects. */
455
+ /** Imports and constructs the bus. Never rejects. */
339
456
  private buildBus;
340
457
  /**
341
458
  * Reads the bus role. Without a bus, this context is the sender.
@@ -343,43 +460,71 @@ export declare class ObservabilityRuntime {
343
460
  */
344
461
  private role;
345
462
  /**
346
- * Loads the delivery stack if this context is the sender and has an endpoint.
463
+ * Loads the delivery stack if this context is the sender and has a destination, that is an
464
+ * endpoint or a custom transport.
347
465
  * @returns Promise that resolves when the load completes, or immediately when nothing loads.
348
466
  */
349
467
  private syncSender;
350
468
  /**
351
- * Tests if the config names a destination for the records.
352
- * @returns True with an endpoint or a custom transport.
469
+ * Checks whether the config names a destination for the records.
470
+ * @returns True if it has an endpoint or a custom transport.
353
471
  */
354
472
  private hasDestination;
355
473
  /**
356
- * Starts the load of the delivery stack one time.
474
+ * Starts the delivery stack load once.
357
475
  * @returns Promise that resolves when the load completes or fails.
358
476
  */
359
477
  private loadSender;
360
- /** Imports and builds the delivery stack. It then moves the held records into it. It never rejects. */
478
+ /**
479
+ * Imports and builds the delivery stack, then moves the held records into it.
480
+ * Never rejects.
481
+ */
361
482
  private buildSender;
483
+ /**
484
+ * Stores an earlier context's batches under this context.
485
+ * @param sender The sender that adopts them.
486
+ * @param stored The earlier context's stored batches.
487
+ */
488
+ private adoptStored;
362
489
  /** Refreshes temporary switches and restores local settings when their TTL ends. */
363
490
  private refreshCaptures;
491
+ /**
492
+ * Serializes the current capture settings and profiler observers into one string. When the
493
+ * string changes, the captures are reinstalled.
494
+ * @param settings Current capture settings.
495
+ * @returns The string.
496
+ */
497
+ private captureState;
498
+ /**
499
+ * Serializes what the replay recorder reads when it starts. The replay capture has its own
500
+ * key because a restart drops the buffer, so an unrelated capture change must not cause one.
501
+ * The other replay values are read on use and apply without a restart.
502
+ * @param settings Current capture settings.
503
+ * @returns The string. Empty while replay is off, so a replay change then installs nothing.
504
+ */
505
+ private replayState;
364
506
  /** Returns local capture settings with the permitted remote switches. */
365
507
  private effectiveCapture;
366
- /** Loads, builds and installs the enabled capture modules. It never rejects. */
508
+ /** Loads, builds and installs the enabled capture modules. Never rejects. */
367
509
  private installCaptures;
368
- /** Uninstalls the active capture modules. */
510
+ /**
511
+ * Uninstalls the active capture modules.
512
+ * @param kept A replay capture that stays installed, if there is one.
513
+ */
369
514
  private uninstallCaptures;
370
515
  /**
371
- * Imports the WebSocket capture plugin. A failed import reports and skips it.
516
+ * Imports the WebSocket capture plugin. A failed import is reported and skipped.
372
517
  * @returns Promise that resolves to the class, or undefined if the import failed.
373
518
  */
374
519
  private loadWebSocket;
375
520
  /**
376
- * Wraps a plugin as a capture module. The plugin gets public tools only.
377
- * @param plugin Plugin of the app, or a built-in plugin.
521
+ * Wraps a plugin as a capture module. The plugin only gets public tools.
522
+ * @param plugin The app's plugin, or a built-in one.
378
523
  * @returns The capture module.
379
524
  */
380
525
  private pluginCapture;
381
526
  /**
382
- * Imports one capture module. A failed import reports and skips that module only.
527
+ * Imports one capture module. A failed import is reported and skips only that module.
383
528
  * @param name Capture module name.
384
529
  * @returns Promise that resolves to the class, or undefined if the import failed.
385
530
  */
@@ -396,16 +541,45 @@ export declare class ObservabilityRuntime {
396
541
  * @returns Function that removes this registration.
397
542
  */
398
543
  registerFrame(frame: HTMLIFrameElement | Window, options: FrameOptions): () => void;
399
- /** Flushes pending telemetry, unregisters listeners, and unpins the runtime instance. */
400
- destroy(): Promise<void>;
544
+ /**
545
+ * Stops every subsystem and unpins the runtime. By default it flushes the records first. A
546
+ * discard sends nothing, and a clearStorage scope also removes the stored batches and ids. A
547
+ * later call stops nothing more, but its clearStorage scope still applies.
548
+ * @param options What to do with the records that wait, and which storage to remove.
549
+ */
550
+ destroy(options?: ShutdownOptions): Promise<void>;
551
+ /**
552
+ * Stops every subsystem once, then unpins the runtime.
553
+ * @param discard True to send nothing and report the records in memory as discarded.
554
+ */
555
+ private stop;
556
+ /**
557
+ * Reads the shutdown() options. A value it can't use reports config.invalid and discards,
558
+ * because an app that asks to discard or to remove storage doesn't want a send.
559
+ * @param options The app's options.
560
+ * @returns True to discard, and the storage scope to remove.
561
+ */
562
+ private shutdownRule;
563
+ /** Flushes the sender's records and runs the exit flush. Reports what can't go out. */
564
+ private flushHeld;
565
+ /**
566
+ * Drops the records in memory without a send and reports each one as "discarded". A record
567
+ * in a request that is in flight isn't reported, because the request can still arrive.
568
+ */
569
+ private discardHeld;
570
+ /**
571
+ * Removes the stored batches, the emergency queue entries and the stored ids. Before the
572
+ * first configure() call that works, no store is known, so it removes nothing.
573
+ * @param scope Whose stored batches to remove.
574
+ */
575
+ private clearStorage;
401
576
  /**
402
577
  * Routes a completed log record to the pipeline or forward buffer.
403
578
  * @param record Log record to emit, or null when the build dropped it.
404
579
  */
405
580
  emit(record: LogRecord | null): void;
406
581
  /**
407
- * Sends a record to the forward buffer or to the local pipeline. The bus role selects
408
- * the path.
582
+ * Sends a record to the forward buffer or to the local pipeline, depending on the bus role.
409
583
  * @param record Log record to route.
410
584
  */
411
585
  private route;
@@ -416,7 +590,18 @@ export declare class ObservabilityRuntime {
416
590
  */
417
591
  private deliver;
418
592
  /**
419
- * Counts a record that a full hold buffer drops. It gives the record to the onDrop report.
593
+ * Reports the sender's records in memory as lost during a pause. A pause has no exit flush,
594
+ * so a pagehide or a shutdown leaves nothing to send them.
595
+ */
596
+ private dropPaused;
597
+ /**
598
+ * Leaves out the records that a pause already reported, so onDrop counts each loss once.
599
+ * @param records Lost records.
600
+ * @returns The records with no report yet.
601
+ */
602
+ private unreported;
603
+ /**
604
+ * Counts a record dropped by a full hold buffer and passes it to the onDrop report.
420
605
  * @param record Dropped record.
421
606
  */
422
607
  private dropHeld;
@@ -425,97 +610,156 @@ export declare class ObservabilityRuntime {
425
610
  * @param record Log record to forward.
426
611
  */
427
612
  private forward;
428
- /** Gives the records of the forward buffer to the bus. */
613
+ /**
614
+ * Hands the forward buffer's records to the bus.
615
+ * @returns How many records went upstream.
616
+ */
429
617
  private sendForwarded;
430
618
  /**
431
- * Validates, samples and queues records from child frames or workers.
432
- * A forwarded record arrives built. This is the first point in this context where
433
- * sampling can run. RecordBuilder samples a local record.
619
+ * Validates, samples and queues records from child frames or workers. A forwarded record
620
+ * arrives already built, so this is the first point in this context where sampling can run.
621
+ * Local records are sampled by RecordBuilder.
434
622
  * @param records Inbound payload from bus.
435
623
  */
436
624
  private ingestForwarded;
437
- /** Flushes the startup records. It adds the active journey to records without a journey. */
625
+ /** Flushes the startup records, adding the active journey to records that have none. */
438
626
  private releaseBootBuffer;
439
627
  /**
440
- * Gives lost records to the onDrop report.
441
- * @param reason Cause of the loss.
628
+ * Passes lost records to the onDrop report.
629
+ * @param reason Why they were lost.
442
630
  * @param records Lost records.
443
631
  * @param batchIds Ids of the lost batches.
444
632
  */
445
633
  private readonly reportLoss;
446
634
  /**
447
- * Gives the evicted batches to the onDrop report. It also emits a warning record. A throttle
448
- * limits the warning records.
635
+ * Passes the evicted batches to the onDrop report and emits a warning record. The warning
636
+ * records are throttled.
449
637
  * @param result Storage prune summary metrics.
450
638
  * @param dropped The evicted batches.
451
639
  */
452
640
  private readonly reportGap;
453
- /** Makes and stores a new tab ID after a tab ID collision. */
641
+ /** Creates and stores a new tab ID after a tab ID collision. */
454
642
  private regenerateTabId;
455
643
  /**
456
- * Starts a new session in this context. It sends the open metric points, starts a new trace,
457
- * ends the active journey and clears the breadcrumbs. Other tabs read the new id at their next
458
- * startup.
644
+ * Starts a new session in this context. Sends the open metric points, starts a new trace,
645
+ * ends the active journey and clears the breadcrumbs. Other tabs pick up the new id at
646
+ * their next startup.
459
647
  */
460
648
  newSession(): void;
461
649
  /**
462
- * Closes the work of the old session and starts the given session.
650
+ * Closes the old session's work and starts the given session.
463
651
  * @param sessionId Id of the session to start.
464
652
  */
465
653
  private resetSession;
466
654
  /**
467
- * Changes the delivery context in one operation. A second change must wait for this change.
468
- * @param update New identity, delivery settings and context attributes.
469
- * @param options Rule for records of the old context and the flush deadline.
655
+ * Changes the delivery context in one operation. Rotations run in call order, so a logout
656
+ * that starts during a login still runs, after the login.
657
+ * @param update New identity, routing settings and context attributes.
658
+ * @param options What to do with the old context's records, and the flush deadline.
470
659
  * @returns Promise that resolves when the change completes. Invalid settings reject it.
471
660
  */
472
661
  rotateSecurityContext(update: SecurityContextUpdate, options?: SecurityContextRotationOptions): Promise<void>;
473
662
  /**
474
- * Checks new settings, stops old delivery and starts the new context.
475
- * @param update New identity, delivery settings and attributes.
476
- * @param pending Rule for the old records.
477
- * @param timeoutMs Maximum wait for an old-context flush, in milliseconds.
478
- * @returns Promise that resolves when the context change completes.
663
+ * Runs one rotation once the earlier ones are done. The rotation code loads on the first call.
664
+ * @param update New identity, routing settings and context attributes.
665
+ * @param options What to do with the old context's records, and the flush deadline.
666
+ * @param seq Number of this call.
667
+ * @returns Promise that resolves when the change completes.
479
668
  */
480
- private rotateContext;
669
+ private runRotation;
481
670
  /**
482
- * Moves the records of the old context into the new context.
483
- * @param live Records that were in memory. They go through the live buffer.
484
- * @param stored Batches that were stored. The new sender stores them again.
485
- * @returns Promise that resolves when the stored batches are stored again.
671
+ * Returns the changes the rotation code can make to this runtime's private state.
672
+ * @returns The rotation host.
486
673
  */
487
- private carry;
674
+ private rotationHost;
488
675
  /**
489
- * Collects the state of this runtime for a support ticket. The app decides where to send it.
676
+ * Stops delivery after a rotation fails. The app asked to leave this context, so its endpoint
677
+ * and headers send no record until a rotation succeeds. The old records stay stored under
678
+ * the old id, and the next rotation that succeeds applies its rule to them.
679
+ */
680
+ private closeDelivery;
681
+ /**
682
+ * Stops a sender of a closed context and keeps it, so the next rotation that succeeds can
683
+ * apply its rule to the records of that context.
684
+ * @param sender The sender to stop.
685
+ */
686
+ private parkSender;
687
+ /**
688
+ * Collects this runtime's state for a support ticket. The app decides where to send it.
490
689
  * @param health Health snapshot from the facade, with the logger cache counts.
491
690
  * @returns Promise that resolves to the JSON-safe bundle.
492
691
  */
493
692
  debugBundle(health: ObservabilityHealth): Promise<DebugBundle>;
494
693
  /**
495
- * Reads the state of this runtime. It does not wait for startup or the sender to load.
694
+ * Reads this runtime's state. Doesn't wait for startup or for the sender to load.
496
695
  * @returns State, delivery counts and policies. The facade adds the logger cache counts.
497
696
  */
498
697
  health(): Promise<Omit<ObservabilityHealth, "loggerCache">>;
499
698
  /**
500
- * Reads the delivery state of this context.
501
- * @returns Promise that resolves to the counts and the time of the last accepted send.
699
+ * Returns what opening the store needs when no sender runs.
700
+ * @returns The config, the reporter and the kept memory store.
701
+ */
702
+ private storeAccess;
703
+ /**
704
+ * Counts the stored batches. After a failed rotation, the parked sender's store still holds
705
+ * the closed context's batches, and they count until a rotation retires them.
706
+ * @returns Promise that resolves to the number of stored batches.
707
+ */
708
+ private storedBatches;
709
+ /**
710
+ * Sends the records in memory and waits until each one has a final state or the time limit
711
+ * passes. A forwarder hands its records to its sender, then asks the sender to flush.
712
+ * @param options How long to wait. A value it can't use reports config.invalid.
713
+ * @returns Promise that resolves to what became of the records in memory at the call. It
714
+ * never rejects.
715
+ */
716
+ flush(options?: unknown): Promise<FlushResult>;
717
+ /**
718
+ * Runs a flush with a time limit that is already in range.
719
+ * @param timeoutMs How long to wait, in milliseconds.
720
+ * @param collect True to send the open interval of the meter and the profiler first. A flush
721
+ * that a child asks for doesn't, otherwise each request would make this context build points.
722
+ * @returns Promise that resolves to the flush result.
723
+ */
724
+ private flushFor;
725
+ /**
726
+ * Waits for startup and the delivery stack, then flushes the sender or asks the upstream one.
727
+ * @param ends Epoch time in milliseconds of the deadline.
728
+ * @param expired Resolves at the deadline.
729
+ * @returns The flush result.
730
+ */
731
+ private flushBefore;
732
+ /**
733
+ * Returns the result for a runtime that sends nothing now: before the start, after a failed
734
+ * first configure(), during a pause and after shutdown().
735
+ * @returns The "inactive" result with the records that wait in memory, or null.
736
+ */
737
+ private idle;
738
+ /**
739
+ * Counts the records in the hold buffers and the forward buffer.
740
+ * @returns The record count.
502
741
  */
503
- stats(): Promise<DeliveryStats>;
742
+ private heldRecords;
504
743
  /**
505
- * Removes stored records of one context or all contexts in the application namespace.
506
- * @param scope Part of storage to clear.
507
- * @returns Promise that resolves when removal completes.
744
+ * Counts the records in memory: the hold buffers, the forward buffer, and the buffers, the
745
+ * queue and the requests of the sender and of a sender that a rotation retires.
746
+ * @returns The record count.
508
747
  */
509
- clearPersisted(scope: "context" | "namespace"): Promise<void>;
748
+ private waiting;
510
749
  /**
511
- * Counts the batches held in storage after a failed or deferred delivery.
512
- * @returns Promise that resolves to the number of stored batches. A forwarder stores
513
- * nothing and reports 0.
750
+ * Copies a call's options. A value that isn't an object reports config.invalid with the text,
751
+ * and so does a getter that throws.
752
+ * @param options The app's options. undefined and null read as no options.
753
+ * @param text The text of the report.
754
+ * @returns The copy, or undefined after a report.
514
755
  */
515
- queueDepth(): Promise<number>;
756
+ private readOptions;
516
757
  /**
517
- * Flushes all pending records in the pipeline or forward buffer.
518
- * @returns Promise that resolves when the library sends or hands off the queued records.
758
+ * Reads flush()'s time limit. A value it can't use reports config.invalid, and the default
759
+ * applies. null options and a null timeoutMs give the default, as in shutdown() and
760
+ * rotateSecurityContext().
761
+ * @param options The app's options.
762
+ * @returns The time limit in milliseconds.
519
763
  */
520
- flush(): Promise<void>;
764
+ private flushTimeout;
521
765
  }