@utk09/ui-observability 0.10.0 → 0.12.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 (406) hide show
  1. package/CHANGELOG.md +77 -1
  2. package/README.md +323 -113
  3. package/bin/uiobs.mjs +1 -1
  4. package/dist/{batch-BMdT9mKm.js → batch-BjQUwjA6.js} +5 -6
  5. package/dist/batch-BjQUwjA6.js.map +1 -0
  6. package/dist/{batch-BHXypM1j.cjs → batch-D5LlU4Q9.cjs} +2 -2
  7. package/dist/batch-D5LlU4Q9.cjs.map +1 -0
  8. package/dist/bus/bus.d.ts +48 -47
  9. package/dist/bus/links.d.ts +4 -4
  10. package/dist/bus/validation.d.ts +1 -1
  11. package/dist/bus-D_7pd7RN.cjs +2 -0
  12. package/dist/bus-D_7pd7RN.cjs.map +1 -0
  13. package/dist/{bus-DKfBaica.js → bus-ecxUNTja.js} +105 -109
  14. package/dist/bus-ecxUNTja.js.map +1 -0
  15. package/dist/capture/console.d.ts +10 -10
  16. package/dist/capture/errors.d.ts +6 -6
  17. package/dist/capture/interactions.d.ts +14 -14
  18. package/dist/capture/lifecycle.d.ts +3 -3
  19. package/dist/capture/long-frames.d.ts +6 -6
  20. package/dist/capture/network.d.ts +17 -17
  21. package/dist/capture/profiler-frames.d.ts +44 -0
  22. package/dist/capture/replay-buffer.d.ts +46 -0
  23. package/dist/capture/replay-upload.d.ts +74 -0
  24. package/dist/capture/replay.d.ts +114 -0
  25. package/dist/capture/reports.d.ts +2 -2
  26. package/dist/capture/resource-timing.d.ts +1 -1
  27. package/dist/capture/server-timing.d.ts +3 -3
  28. package/dist/capture/storm.d.ts +3 -3
  29. package/dist/capture/types.d.ts +45 -33
  30. package/dist/capture/unclean-exit.d.ts +8 -8
  31. package/dist/capture/user-timing.d.ts +3 -3
  32. package/dist/capture/web-socket.d.ts +11 -11
  33. package/dist/capture/web-vitals.d.ts +20 -7
  34. package/dist/compression-AJJCMBOa.js +11 -0
  35. package/dist/compression-AJJCMBOa.js.map +1 -0
  36. package/dist/compression-lD9abCcO.cjs +2 -0
  37. package/dist/compression-lD9abCcO.cjs.map +1 -0
  38. package/dist/console-CLz_PvFn.cjs +2 -0
  39. package/dist/console-CLz_PvFn.cjs.map +1 -0
  40. package/dist/{console-BX_0UCV7.js → console-cwgHKXvM.js} +14 -15
  41. package/dist/console-cwgHKXvM.js.map +1 -0
  42. package/dist/constants-Bwl_YtQi.js +349 -0
  43. package/dist/constants-Bwl_YtQi.js.map +1 -0
  44. package/dist/constants-DakMxVB2.cjs +2 -0
  45. package/dist/constants-DakMxVB2.cjs.map +1 -0
  46. package/dist/constants.d.ts +150 -103
  47. package/dist/context-storage-BjzeBSxH.cjs.map +1 -1
  48. package/dist/{context-storage-DxZf4Gfh.js → context-storage-BzkoHzkQ.js} +2 -3
  49. package/dist/context-storage-BzkoHzkQ.js.map +1 -0
  50. package/dist/core/breadcrumbs.d.ts +16 -15
  51. package/dist/core/config.d.ts +3 -3
  52. package/dist/core/context.d.ts +7 -7
  53. package/dist/core/debug-buffer.d.ts +10 -10
  54. package/dist/core/debug-bundle.d.ts +3 -3
  55. package/dist/core/deferred.d.ts +2 -2
  56. package/dist/core/diagnostics.d.ts +24 -21
  57. package/dist/core/drops.d.ts +7 -7
  58. package/dist/core/hold-buffer.d.ts +1 -1
  59. package/dist/core/journey.d.ts +22 -23
  60. package/dist/core/logger.d.ts +22 -21
  61. package/dist/core/measure.d.ts +7 -7
  62. package/dist/core/meter.d.ts +25 -21
  63. package/dist/core/pipeline.d.ts +42 -41
  64. package/dist/core/profile-buckets.d.ts +31 -0
  65. package/dist/core/profiler.d.ts +218 -0
  66. package/dist/core/record.d.ts +23 -23
  67. package/dist/core/remote-rules.d.ts +4 -4
  68. package/dist/core/remote-sampling.d.ts +21 -20
  69. package/dist/core/runtime.d.ts +206 -137
  70. package/dist/core/sampling.d.ts +18 -18
  71. package/dist/core/sender.d.ts +22 -20
  72. package/dist/core/spans.d.ts +5 -5
  73. package/dist/{deadline-5_PecIl5.js → deadline-C4ccAuk5.js} +4 -9
  74. package/dist/deadline-C4ccAuk5.js.map +1 -0
  75. package/dist/deadline-CUGbto-y.cjs +2 -0
  76. package/dist/deadline-CUGbto-y.cjs.map +1 -0
  77. package/dist/{debug-bundle-CZZ6SQQh.js → debug-bundle-BOdYmCeV.js} +12 -6
  78. package/dist/debug-bundle-BOdYmCeV.js.map +1 -0
  79. package/dist/debug-bundle-Ex4L_LSP.cjs +2 -0
  80. package/dist/debug-bundle-Ex4L_LSP.cjs.map +1 -0
  81. package/dist/doctor.cjs +1 -1
  82. package/dist/doctor.cjs.map +1 -1
  83. package/dist/doctor.d.ts +16 -6
  84. package/dist/doctor.js +148 -54
  85. package/dist/doctor.js.map +1 -1
  86. package/dist/{emergency-queue-Cs8-i2xw.js → emergency-queue-B9WZxanZ.js} +15 -17
  87. package/dist/emergency-queue-B9WZxanZ.js.map +1 -0
  88. package/dist/{emergency-queue-CQ-9acZf.cjs → emergency-queue-HBpL5r3V.cjs} +2 -2
  89. package/dist/emergency-queue-HBpL5r3V.cjs.map +1 -0
  90. package/dist/{error-like-Ywo5uRHo.js → error-like-B11pB4aL.js} +2 -3
  91. package/dist/error-like-B11pB4aL.js.map +1 -0
  92. package/dist/error-like-gGRx2s36.cjs.map +1 -1
  93. package/dist/{errors-oyxrpHjY.js → errors-D6bwgJtO.js} +5 -6
  94. package/dist/errors-D6bwgJtO.js.map +1 -0
  95. package/dist/{errors-CigX45pL.cjs → errors-DCOCRdSi.cjs} +2 -2
  96. package/dist/errors-DCOCRdSi.cjs.map +1 -0
  97. package/dist/{factory-BkjNzPYL.cjs → factory-DLFDjdLv.cjs} +2 -2
  98. package/dist/factory-DLFDjdLv.cjs.map +1 -0
  99. package/dist/{factory-Bgsky_e0.js → factory-e9Qo3K0z.js} +18 -22
  100. package/dist/factory-e9Qo3K0z.js.map +1 -0
  101. package/dist/fixed-window-CvESpFYV.cjs.map +1 -1
  102. package/dist/{fixed-window-CtaFHanJ.js → fixed-window-Dq3MLUUv.js} +2 -3
  103. package/dist/fixed-window-Dq3MLUUv.js.map +1 -0
  104. package/dist/global-scope-BN-Io_yv.cjs.map +1 -1
  105. package/dist/{global-scope-dp2jADRl.js → global-scope-D9I8s-oN.js} +2 -3
  106. package/dist/global-scope-D9I8s-oN.js.map +1 -0
  107. package/dist/{guards-CpvOpJL6.js → guards-Cidk71ME.js} +2 -3
  108. package/dist/guards-Cidk71ME.js.map +1 -0
  109. package/dist/guards-nJ70syPt.cjs.map +1 -1
  110. package/dist/{identity-BMlKGHUM.cjs → identity-BlvlgjrU.cjs} +2 -2
  111. package/dist/identity-BlvlgjrU.cjs.map +1 -0
  112. package/dist/{identity-DOaHdfhT.js → identity-BrQp_5J5.js} +20 -21
  113. package/dist/identity-BrQp_5J5.js.map +1 -0
  114. package/dist/index.cjs +1 -1
  115. package/dist/index.cjs.map +1 -1
  116. package/dist/index.d.ts +112 -79
  117. package/dist/index.js +797 -659
  118. package/dist/index.js.map +1 -1
  119. package/dist/{indexeddb-storage-CaXGJqDD.cjs → indexeddb-storage-CtLvZH1r.cjs} +2 -2
  120. package/dist/indexeddb-storage-CtLvZH1r.cjs.map +1 -0
  121. package/dist/{indexeddb-storage-D-lUW_5P.js → indexeddb-storage-DLXQzAGh.js} +5 -6
  122. package/dist/indexeddb-storage-DLXQzAGh.js.map +1 -0
  123. package/dist/{interactions-CqDNrtIR.js → interactions-B6z2I4tU.js} +10 -11
  124. package/dist/interactions-B6z2I4tU.js.map +1 -0
  125. package/dist/{interactions-8DgxtmgO.cjs → interactions-P6pz08Jn.cjs} +2 -2
  126. package/dist/interactions-P6pz08Jn.cjs.map +1 -0
  127. package/dist/{journey-DgIjhrIc.js → journey-35yCMNFo.js} +21 -21
  128. package/dist/journey-35yCMNFo.js.map +1 -0
  129. package/dist/journey-DAGh5h9k.cjs +2 -0
  130. package/dist/journey-DAGh5h9k.cjs.map +1 -0
  131. package/dist/keys-BHhw_0Wh.cjs.map +1 -1
  132. package/dist/{keys-D5r_GH9q.js → keys-BU9j5YqW.js} +2 -3
  133. package/dist/keys-BU9j5YqW.js.map +1 -0
  134. package/dist/{library-console-g_VU-wzP.cjs → library-console-BFWEuQsl.cjs} +2 -2
  135. package/dist/library-console-BFWEuQsl.cjs.map +1 -0
  136. package/dist/library-console-Dl_Ly6DQ.js +13 -0
  137. package/dist/library-console-Dl_Ly6DQ.js.map +1 -0
  138. package/dist/{library-request-FQaiWjCP.cjs → library-request-Da-CHKzT.cjs} +2 -2
  139. package/dist/library-request-Da-CHKzT.cjs.map +1 -0
  140. package/dist/{library-request-CyC-9IOk.js → library-request-nI6pvI6I.js} +4 -5
  141. package/dist/library-request-nI6pvI6I.js.map +1 -0
  142. package/dist/{lifecycle-C2z_d8OX.cjs → lifecycle-BGGOcN4N.cjs} +2 -2
  143. package/dist/lifecycle-BGGOcN4N.cjs.map +1 -0
  144. package/dist/{lifecycle-BLC4VU7c.js → lifecycle-CZ6RRXc6.js} +3 -4
  145. package/dist/lifecycle-CZ6RRXc6.js.map +1 -0
  146. package/dist/{log-record-DKvo-B-d.cjs → log-record-D7bA1RPb.cjs} +2 -2
  147. package/dist/log-record-D7bA1RPb.cjs.map +1 -0
  148. package/dist/{log-record-CndanC-p.js → log-record-DIA6McNr.js} +3 -4
  149. package/dist/log-record-DIA6McNr.js.map +1 -0
  150. package/dist/{long-frames-BQef9rXR.js → long-frames-430_85Da.js} +9 -8
  151. package/dist/long-frames-430_85Da.js.map +1 -0
  152. package/dist/long-frames-Dd8tsi2U.cjs +2 -0
  153. package/dist/long-frames-Dd8tsi2U.cjs.map +1 -0
  154. package/dist/models/batch.d.ts +14 -15
  155. package/dist/models/bus.d.ts +24 -24
  156. package/dist/models/config.d.ts +402 -216
  157. package/dist/models/drop.d.ts +13 -11
  158. package/dist/models/health.d.ts +13 -13
  159. package/dist/models/log-record.d.ts +13 -14
  160. package/dist/models/metric.d.ts +82 -17
  161. package/dist/models/plugin.d.ts +13 -13
  162. package/dist/models/replay.d.ts +60 -0
  163. package/dist/models/serializer.d.ts +2 -3
  164. package/dist/models/stats.d.ts +2 -2
  165. package/dist/models/storage.d.ts +12 -11
  166. package/dist/{network-CvkvYzRU.js → network-C7SkLf4v.js} +30 -32
  167. package/dist/network-C7SkLf4v.js.map +1 -0
  168. package/dist/{network-CqnQOqon.cjs → network-pEX3PAJv.cjs} +2 -2
  169. package/dist/network-pEX3PAJv.cjs.map +1 -0
  170. package/dist/openfin-Bxelt0yg.js +7 -0
  171. package/dist/openfin-Bxelt0yg.js.map +1 -0
  172. package/dist/openfin-DtH2f7zX.cjs.map +1 -1
  173. package/dist/otlp-2MCrC3kd.cjs +2 -0
  174. package/dist/otlp-2MCrC3kd.cjs.map +1 -0
  175. package/dist/{otlp-CYIL7MOE.js → otlp-COq033e3.js} +26 -35
  176. package/dist/otlp-COq033e3.js.map +1 -0
  177. package/dist/patch-BX8KrPCT.cjs.map +1 -1
  178. package/dist/{patch-CCWfuEY7.js → patch-UdPz1ea8.js} +2 -3
  179. package/dist/patch-UdPz1ea8.js.map +1 -0
  180. package/dist/{platform-KMWkoI-v.cjs → platform-12uR7kBQ.cjs} +2 -2
  181. package/dist/platform-12uR7kBQ.cjs.map +1 -0
  182. package/dist/{platform-wcAkkv9F.js → platform-CVewe4wQ.js} +9 -10
  183. package/dist/platform-CVewe4wQ.js.map +1 -0
  184. package/dist/profiler-BVWIOgnq.js +310 -0
  185. package/dist/profiler-BVWIOgnq.js.map +1 -0
  186. package/dist/profiler-eVCknCzS.cjs +2 -0
  187. package/dist/profiler-eVCknCzS.cjs.map +1 -0
  188. package/dist/profiler-frames-CLXlT_xL.js +86 -0
  189. package/dist/profiler-frames-CLXlT_xL.js.map +1 -0
  190. package/dist/profiler-frames-Dg2OebB2.cjs +2 -0
  191. package/dist/profiler-frames-Dg2OebB2.cjs.map +1 -0
  192. package/dist/{remote-rules-CH_7PphT.js → remote-rules-BJGDJGwA.js} +29 -30
  193. package/dist/remote-rules-BJGDJGwA.js.map +1 -0
  194. package/dist/{remote-rules-BL8km4xk.cjs → remote-rules-CJD3ToVk.cjs} +2 -2
  195. package/dist/remote-rules-CJD3ToVk.cjs.map +1 -0
  196. package/dist/replay-0zAJv9T3.js +338 -0
  197. package/dist/replay-0zAJv9T3.js.map +1 -0
  198. package/dist/replay-DomJpXqW.cjs +2 -0
  199. package/dist/replay-DomJpXqW.cjs.map +1 -0
  200. package/dist/{reports-Bh_-KpZ2.cjs → reports-BsbqmP8h.cjs} +2 -2
  201. package/dist/reports-BsbqmP8h.cjs.map +1 -0
  202. package/dist/{reports-BOKyY3_A.js → reports-BuXekPOS.js} +4 -5
  203. package/dist/reports-BuXekPOS.js.map +1 -0
  204. package/dist/{resource-timing-BROnEJ0E.js → resource-timing-CXGHwFRD.js} +6 -7
  205. package/dist/resource-timing-CXGHwFRD.js.map +1 -0
  206. package/dist/{resource-timing-CbgwNpog.cjs → resource-timing-DkycFGDa.cjs} +2 -2
  207. package/dist/resource-timing-DkycFGDa.cjs.map +1 -0
  208. package/dist/{sampling-ECGVYiDD.cjs → sampling-Dd0wllyq.cjs} +2 -2
  209. package/dist/sampling-Dd0wllyq.cjs.map +1 -0
  210. package/dist/{sampling-BLO_pcV4.js → sampling-UUDbi3K0.js} +11 -12
  211. package/dist/sampling-UUDbi3K0.js.map +1 -0
  212. package/dist/{sanitize-DS0G4_ea.js → sanitize-CNmsD9r3.js} +4 -5
  213. package/dist/sanitize-CNmsD9r3.js.map +1 -0
  214. package/dist/{sanitize-Bsn8HQWC.cjs → sanitize-ChLn97Ch.cjs} +2 -2
  215. package/dist/sanitize-ChLn97Ch.cjs.map +1 -0
  216. package/dist/{select-DWO0-w8_.cjs → select-CTk-K5mG.cjs} +3 -3
  217. package/dist/select-CTk-K5mG.cjs.map +1 -0
  218. package/dist/{select-wqt9Wxio.js → select-DPv_j6wq.js} +64 -67
  219. package/dist/select-DPv_j6wq.js.map +1 -0
  220. package/dist/{sender-BkAVt-Rq.js → sender-15zEsZpr.js} +98 -101
  221. package/dist/sender-15zEsZpr.js.map +1 -0
  222. package/dist/sender-Bfpv9tad.cjs +2 -0
  223. package/dist/sender-Bfpv9tad.cjs.map +1 -0
  224. package/dist/storage/context-storage.d.ts +34 -33
  225. package/dist/storage/emergency-queue.d.ts +9 -9
  226. package/dist/storage/eviction.d.ts +12 -12
  227. package/dist/storage/factory.d.ts +8 -7
  228. package/dist/storage/gap.d.ts +6 -6
  229. package/dist/storage/idb-driver.d.ts +31 -32
  230. package/dist/storage/indexeddb-storage.d.ts +26 -27
  231. package/dist/storage/keys.d.ts +7 -7
  232. package/dist/storage/local-storage.d.ts +38 -38
  233. package/dist/storage/memory-storage.d.ts +21 -22
  234. package/dist/storage/persistence.d.ts +1 -1
  235. package/dist/storage-BA9RqRO-.cjs.map +1 -1
  236. package/dist/{storage-w7Tslvlq.js → storage-DZwed89z.js} +2 -3
  237. package/dist/storage-DZwed89z.js.map +1 -0
  238. package/dist/{storm-DD4cUkoL.js → storm-BTSNTIWI.js} +4 -5
  239. package/dist/storm-BTSNTIWI.js.map +1 -0
  240. package/dist/{storm-DCEsqViG.cjs → storm-D0_qZOEg.cjs} +2 -2
  241. package/dist/storm-D0_qZOEg.cjs.map +1 -0
  242. package/dist/transport/compression.d.ts +2 -2
  243. package/dist/transport/errors.d.ts +7 -7
  244. package/dist/transport/exit-flush.d.ts +39 -39
  245. package/dist/transport/headers.d.ts +2 -2
  246. package/dist/transport/http-transport.d.ts +28 -27
  247. package/dist/transport/memory-transport.d.ts +6 -6
  248. package/dist/transport/retry-engine.d.ts +35 -34
  249. package/dist/transport/serializers/ecs.d.ts +1 -1
  250. package/dist/transport/serializers/otlp-metrics.d.ts +1 -1
  251. package/dist/transport/serializers/otlp-traces.d.ts +1 -1
  252. package/dist/transport/serializers/otlp.d.ts +16 -16
  253. package/dist/transport/serializers/select.d.ts +7 -7
  254. package/dist/transport/status-transport.d.ts +20 -20
  255. package/dist/transport/worker-protocol.d.ts +3 -3
  256. package/dist/{types-BR9t_w28.js → types-BAerHgCq.js} +2 -3
  257. package/dist/types-BAerHgCq.js.map +1 -0
  258. package/dist/types-C7WNpnG1.cjs.map +1 -1
  259. package/dist/{unclean-exit-CwdpbUDg.cjs → unclean-exit-ClGzrc2A.cjs} +2 -2
  260. package/dist/unclean-exit-ClGzrc2A.cjs.map +1 -0
  261. package/dist/{unclean-exit-BYZ5yaSI.js → unclean-exit-Cob_jyTv.js} +3 -4
  262. package/dist/unclean-exit-Cob_jyTv.js.map +1 -0
  263. package/dist/unref-CU9Nyz_9.cjs +2 -0
  264. package/dist/unref-CU9Nyz_9.cjs.map +1 -0
  265. package/dist/unref-DgHPQeWv.js +7 -0
  266. package/dist/unref-DgHPQeWv.js.map +1 -0
  267. package/dist/user-timing-CdYqx3PF.cjs +2 -0
  268. package/dist/user-timing-CdYqx3PF.cjs.map +1 -0
  269. package/dist/{user-timing-Di2ra5DB.js → user-timing-DgHubxCI.js} +7 -6
  270. package/dist/user-timing-DgHubxCI.js.map +1 -0
  271. package/dist/utils/console.d.ts +2 -2
  272. package/dist/utils/deadline.d.ts +4 -4
  273. package/dist/utils/error-like.d.ts +7 -7
  274. package/dist/utils/fixed-window.d.ts +9 -8
  275. package/dist/utils/global-scope.d.ts +8 -8
  276. package/dist/utils/guards.d.ts +2 -2
  277. package/dist/utils/identity.d.ts +17 -17
  278. package/dist/utils/library-console.d.ts +4 -4
  279. package/dist/utils/library-request.d.ts +10 -10
  280. package/dist/utils/lock.d.ts +10 -9
  281. package/dist/utils/openfin.d.ts +5 -5
  282. package/dist/utils/patch.d.ts +6 -6
  283. package/dist/utils/platform.d.ts +13 -11
  284. package/dist/utils/sanitize.d.ts +4 -4
  285. package/dist/utils/timer.d.ts +1 -1
  286. package/dist/utils/tracing.d.ts +38 -38
  287. package/dist/utils/unref.d.ts +3 -3
  288. package/dist/{web-socket-DwBNhgre.cjs → web-socket-BTuvYoJI.cjs} +2 -2
  289. package/dist/web-socket-BTuvYoJI.cjs.map +1 -0
  290. package/dist/{web-socket-B-5qqPy7.js → web-socket-DthJuSAg.js} +14 -15
  291. package/dist/web-socket-DthJuSAg.js.map +1 -0
  292. package/dist/web-vitals-Ch5BpDmo.cjs +2 -0
  293. package/dist/web-vitals-Ch5BpDmo.cjs.map +1 -0
  294. package/dist/web-vitals-CsGCWnUr.js +77 -0
  295. package/dist/web-vitals-CsGCWnUr.js.map +1 -0
  296. package/dist/{worker-protocol-0HMf4-kY.js → worker-protocol-B0_8rWy5.js} +6 -7
  297. package/dist/worker-protocol-B0_8rWy5.js.map +1 -0
  298. package/dist/{worker-protocol-DXekoADQ.cjs → worker-protocol-BjzFORfq.cjs} +2 -2
  299. package/dist/worker-protocol-BjzFORfq.cjs.map +1 -0
  300. package/dist/worker-server-4en-Lt-3.cjs +2 -0
  301. package/dist/worker-server-4en-Lt-3.cjs.map +1 -0
  302. package/dist/{worker-server-CKcmX5m5.js → worker-server-Cne9MX9I.js} +25 -26
  303. package/dist/{worker-server-CKcmX5m5.js.map → worker-server-Cne9MX9I.js.map} +1 -1
  304. package/dist/worker-transport-B-GF4Aqn.cjs +2 -0
  305. package/dist/worker-transport-B-GF4Aqn.cjs.map +1 -0
  306. package/dist/{worker-transport-2220ghFZ.js → worker-transport-C3SjJAEC.js} +64 -65
  307. package/dist/worker-transport-C3SjJAEC.js.map +1 -0
  308. package/package.json +33 -41
  309. package/dist/batch-BHXypM1j.cjs.map +0 -1
  310. package/dist/batch-BMdT9mKm.js.map +0 -1
  311. package/dist/bus-DKfBaica.js.map +0 -1
  312. package/dist/bus-Dea9rVhy.cjs +0 -2
  313. package/dist/bus-Dea9rVhy.cjs.map +0 -1
  314. package/dist/console-BX_0UCV7.js.map +0 -1
  315. package/dist/console-DZEcs7FL.cjs +0 -2
  316. package/dist/console-DZEcs7FL.cjs.map +0 -1
  317. package/dist/constants-CL0ZdI2f.cjs +0 -2
  318. package/dist/constants-CL0ZdI2f.cjs.map +0 -1
  319. package/dist/constants-CU60FG4w.js +0 -305
  320. package/dist/constants-CU60FG4w.js.map +0 -1
  321. package/dist/context-storage-DxZf4Gfh.js.map +0 -1
  322. package/dist/deadline-5_PecIl5.js.map +0 -1
  323. package/dist/deadline-XSnm95pg.cjs +0 -2
  324. package/dist/deadline-XSnm95pg.cjs.map +0 -1
  325. package/dist/debug-bundle-CZZ6SQQh.js.map +0 -1
  326. package/dist/debug-bundle-yRkrU1ny.cjs +0 -2
  327. package/dist/debug-bundle-yRkrU1ny.cjs.map +0 -1
  328. package/dist/emergency-queue-CQ-9acZf.cjs.map +0 -1
  329. package/dist/emergency-queue-Cs8-i2xw.js.map +0 -1
  330. package/dist/error-like-Ywo5uRHo.js.map +0 -1
  331. package/dist/errors-CigX45pL.cjs.map +0 -1
  332. package/dist/errors-oyxrpHjY.js.map +0 -1
  333. package/dist/factory-Bgsky_e0.js.map +0 -1
  334. package/dist/factory-BkjNzPYL.cjs.map +0 -1
  335. package/dist/fixed-window-CtaFHanJ.js.map +0 -1
  336. package/dist/global-scope-dp2jADRl.js.map +0 -1
  337. package/dist/guards-CpvOpJL6.js.map +0 -1
  338. package/dist/identity-BMlKGHUM.cjs.map +0 -1
  339. package/dist/identity-DOaHdfhT.js.map +0 -1
  340. package/dist/indexeddb-storage-CaXGJqDD.cjs.map +0 -1
  341. package/dist/indexeddb-storage-D-lUW_5P.js.map +0 -1
  342. package/dist/interactions-8DgxtmgO.cjs.map +0 -1
  343. package/dist/interactions-CqDNrtIR.js.map +0 -1
  344. package/dist/journey-5tcxEbnG.cjs +0 -2
  345. package/dist/journey-5tcxEbnG.cjs.map +0 -1
  346. package/dist/journey-DgIjhrIc.js.map +0 -1
  347. package/dist/keys-D5r_GH9q.js.map +0 -1
  348. package/dist/library-console-CabK2j2-.js +0 -14
  349. package/dist/library-console-CabK2j2-.js.map +0 -1
  350. package/dist/library-console-g_VU-wzP.cjs.map +0 -1
  351. package/dist/library-request-CyC-9IOk.js.map +0 -1
  352. package/dist/library-request-FQaiWjCP.cjs.map +0 -1
  353. package/dist/lifecycle-BLC4VU7c.js.map +0 -1
  354. package/dist/lifecycle-C2z_d8OX.cjs.map +0 -1
  355. package/dist/log-record-CndanC-p.js.map +0 -1
  356. package/dist/log-record-DKvo-B-d.cjs.map +0 -1
  357. package/dist/long-frames-BQef9rXR.js.map +0 -1
  358. package/dist/long-frames-CV5ZG2cx.cjs +0 -2
  359. package/dist/long-frames-CV5ZG2cx.cjs.map +0 -1
  360. package/dist/network-CqnQOqon.cjs.map +0 -1
  361. package/dist/network-CvkvYzRU.js.map +0 -1
  362. package/dist/openfin-BwEN0uj4.js +0 -8
  363. package/dist/openfin-BwEN0uj4.js.map +0 -1
  364. package/dist/otlp-CYIL7MOE.js.map +0 -1
  365. package/dist/otlp-RVbkNQRh.cjs +0 -2
  366. package/dist/otlp-RVbkNQRh.cjs.map +0 -1
  367. package/dist/patch-CCWfuEY7.js.map +0 -1
  368. package/dist/platform-KMWkoI-v.cjs.map +0 -1
  369. package/dist/platform-wcAkkv9F.js.map +0 -1
  370. package/dist/remote-rules-BL8km4xk.cjs.map +0 -1
  371. package/dist/remote-rules-CH_7PphT.js.map +0 -1
  372. package/dist/reports-BOKyY3_A.js.map +0 -1
  373. package/dist/reports-Bh_-KpZ2.cjs.map +0 -1
  374. package/dist/resource-timing-BROnEJ0E.js.map +0 -1
  375. package/dist/resource-timing-CbgwNpog.cjs.map +0 -1
  376. package/dist/sampling-BLO_pcV4.js.map +0 -1
  377. package/dist/sampling-ECGVYiDD.cjs.map +0 -1
  378. package/dist/sanitize-Bsn8HQWC.cjs.map +0 -1
  379. package/dist/sanitize-DS0G4_ea.js.map +0 -1
  380. package/dist/select-DWO0-w8_.cjs.map +0 -1
  381. package/dist/select-wqt9Wxio.js.map +0 -1
  382. package/dist/sender-BkAVt-Rq.js.map +0 -1
  383. package/dist/sender-D82PxlCY.cjs +0 -2
  384. package/dist/sender-D82PxlCY.cjs.map +0 -1
  385. package/dist/storage-w7Tslvlq.js.map +0 -1
  386. package/dist/storm-DCEsqViG.cjs.map +0 -1
  387. package/dist/storm-DD4cUkoL.js.map +0 -1
  388. package/dist/types-BR9t_w28.js.map +0 -1
  389. package/dist/unclean-exit-BYZ5yaSI.js.map +0 -1
  390. package/dist/unclean-exit-CwdpbUDg.cjs.map +0 -1
  391. package/dist/user-timing-C1kB3JEg.cjs +0 -2
  392. package/dist/user-timing-C1kB3JEg.cjs.map +0 -1
  393. package/dist/user-timing-Di2ra5DB.js.map +0 -1
  394. package/dist/web-socket-B-5qqPy7.js.map +0 -1
  395. package/dist/web-socket-DwBNhgre.cjs.map +0 -1
  396. package/dist/web-vitals-Bflr5jSA.js +0 -53
  397. package/dist/web-vitals-Bflr5jSA.js.map +0 -1
  398. package/dist/web-vitals-DFuoTQbZ.cjs +0 -2
  399. package/dist/web-vitals-DFuoTQbZ.cjs.map +0 -1
  400. package/dist/worker-protocol-0HMf4-kY.js.map +0 -1
  401. package/dist/worker-protocol-DXekoADQ.cjs.map +0 -1
  402. package/dist/worker-server-BQK5z2yl.cjs +0 -2
  403. package/dist/worker-server-BQK5z2yl.cjs.map +0 -1
  404. package/dist/worker-transport-2220ghFZ.js.map +0 -1
  405. package/dist/worker-transport-Dj2yCQN5.cjs +0 -2
  406. package/dist/worker-transport-Dj2yCQN5.cjs.map +0 -1
@@ -4,17 +4,17 @@ import type { StorageLimits } from "./models/storage";
4
4
  /** Prefix on console messages this library writes. */
5
5
  export declare const LIBRARY_LOG_PREFIX = "[ui-observability]";
6
6
  /**
7
- * Throttle window for each diagnostic code, in milliseconds. It limits how often an error
8
- * loop calls the handler.
7
+ * Throttle window per diagnostic code, in milliseconds. Limits how often an error
8
+ * loop can call the handler.
9
9
  */
10
10
  export declare const DIAGNOSTIC_THROTTLE_MS = 1000;
11
11
  /** `localStorage` key for the session id and its last-seen time. */
12
12
  export declare const SESSION_ID_KEY = "ui-observability.session";
13
13
  /** `sessionStorage` key for the tab id. */
14
14
  export declare const TAB_ID_KEY = "ui-observability.tab";
15
- /** sessionStorage key of the marker of a page that is alive. A clean close removes it. */
15
+ /** sessionStorage key for a live page's marker. A clean close removes it. */
16
16
  export declare const ALIVE_KEY = "ui-observability.alive";
17
- /** Interval of the updates of the alive marker, in milliseconds. */
17
+ /** How often the alive marker is updated, in milliseconds. */
18
18
  export declare const ALIVE_UPDATE_MS = 30000;
19
19
  /** Session idle timeout, in milliseconds. */
20
20
  export declare const SESSION_IDLE_MS: number;
@@ -72,15 +72,15 @@ export declare const SEVERITY_NUMBER: Record<LogLevel, number>;
72
72
  export declare const LEVEL_ORDER: Record<LogLevel, number>;
73
73
  /** Record kind attribute key. */
74
74
  export declare const ATTR_LOG_TYPE = "log.type";
75
- /** Record sequence number in its context. It starts at 1. */
75
+ /** A record's sequence number within its context. Starts at 1. */
76
76
  export declare const ATTR_LOG_SEQ = "log.seq";
77
77
  /** Logger namespace attribute key. */
78
78
  export declare const ATTR_APP_NAMESPACE = "app.namespace";
79
- /** Document URL when the library built the record. */
79
+ /** The document URL at the time the record was built. */
80
80
  export declare const ATTR_PAGE_URL = "page.url";
81
81
  /**
82
- * HTTP request URL attribute key. Network capture sets it. Do not reuse `ATTR_PAGE_URL`.
83
- * The page URL overwrites the request target under that key.
82
+ * HTTP request URL attribute key, set by network capture. Don't reuse `ATTR_PAGE_URL` for it,
83
+ * because the page URL overwrites the request target under that key.
84
84
  * @see {@link ATTR_PAGE_URL}
85
85
  */
86
86
  export declare const ATTR_URL_FULL = "url.full";
@@ -92,12 +92,12 @@ export declare const ATTR_JOURNEY_NAME = "journey.name";
92
92
  export declare const ATTR_JOURNEY_PARENT_ID = "journey.parent_id";
93
93
  /** Marks a record whose attributes failed to sanitize. */
94
94
  export declare const ATTR_SANITIZE_FAILED = "uiobs.sanitize_failed";
95
- /** Own fields of an Error reason, or the whole reason when it is not an Error. */
95
+ /** An Error reason's own fields, or the whole reason when it isn't an Error. */
96
96
  export declare const ATTR_ERROR_DATA = "error.data";
97
- /** Breadcrumb history of an error record. */
97
+ /** An error record's breadcrumb history. */
98
98
  export declare const ATTR_BREADCRUMBS = "breadcrumbs";
99
99
  /**
100
- * Marks a record when the library drops its attributes because they exceed the byte budget.
100
+ * Marks a record whose attributes were dropped for exceeding the byte budget.
101
101
  * @see {@link ATTR_ATTRIBUTES_BYTES}
102
102
  */
103
103
  export declare const ATTR_ATTRIBUTES_DROPPED = "uiobs.attributes_dropped";
@@ -106,11 +106,11 @@ export declare const ATTR_ATTRIBUTES_DROPPED = "uiobs.attributes_dropped";
106
106
  * @see {@link ATTR_ATTRIBUTES_DROPPED}
107
107
  */
108
108
  export declare const ATTR_ATTRIBUTES_BYTES = "uiobs.attributes_bytes";
109
- /** Server time minus client time, in milliseconds, from the Date header of an accepted answer. */
109
+ /** Server time minus client time, in milliseconds, from an accepted answer's Date header. */
110
110
  export declare const ATTR_CLOCK_OFFSET_MS = "uiobs.clock_offset_ms";
111
- /** Marks a record that the debug buffer kept until an error. */
111
+ /** Marks a record the debug buffer held until an error. */
112
112
  export declare const ATTR_DEBUG_BUFFER = "uiobs.debug_buffer";
113
- /** Half the resolution of the HTTP Date header. It centers the error of the clock offset. */
113
+ /** Half the HTTP Date header's resolution. Centers the clock offset's error. */
114
114
  export declare const DATE_HEADER_HALF_STEP_MS = 500;
115
115
  /** Application name resource key. */
116
116
  export declare const RESOURCE_SERVICE_NAME = "service.name";
@@ -153,7 +153,7 @@ export declare const RESOURCE_OPENFIN_NAME = "openfin.name";
153
153
  */
154
154
  export declare const TELEMETRY_SDK_NAME = "@utk09/ui-observability";
155
155
  /**
156
- * Value of `telemetry.sdk.version`. The build writes the version of package.json here.
156
+ * Value of `telemetry.sdk.version`. The build writes the package.json version here.
157
157
  * @see {@link RESOURCE_TELEMETRY_SDK_VERSION}
158
158
  */
159
159
  export declare const TELEMETRY_SDK_VERSION: string;
@@ -168,11 +168,11 @@ export declare const SERIALIZER_NAME_OTLP = "otlp";
168
168
  export declare const SERIALIZER_NAME_ECS = "ecs";
169
169
  /**
170
170
  * ECS `log.level` names that differ from the lowercase severity text. ECS spells
171
- * the warning level in full. All other levels match in lowercase.
171
+ * the warning level out in full, and every other level matches in lowercase.
172
172
  * @see {@link SERIALIZER_NAME_ECS}
173
173
  */
174
174
  export declare const ECS_LEVEL_NAMES: Partial<Record<LogLevel, string>>;
175
- /** ECS version of the documents. The Elastic ECS logging libraries write this version. */
175
+ /** The ECS version of the documents, the same one the Elastic ECS logging libraries write. */
176
176
  export declare const ECS_VERSION = "8.10.0";
177
177
  /** Content type for an OTLP/JSON body. */
178
178
  export declare const CONTENT_TYPE_JSON = "application/json";
@@ -230,7 +230,7 @@ export declare const HTTP_SERVICE_UNAVAILABLE = 503;
230
230
  export declare const MILLIS_PER_SECOND = 1000;
231
231
  /** Max exit payload size, in bytes (`sendBeacon`/`fetch(keepalive)` shared budget). */
232
232
  export declare const BEACON_LIMIT_BYTES = 60000;
233
- /** Content type for an exit payload. It is CORS-safelisted and does not cause a preflight. */
233
+ /** Content type for an exit payload. CORS-safelisted, so it doesn't trigger a preflight. */
234
234
  export declare const CONTENT_TYPE_TEXT_PLAIN = "text/plain;charset=UTF-8";
235
235
  /**
236
236
  * Batch id query param name, for the exit path.
@@ -243,23 +243,24 @@ export declare const QUERY_PARAM_EXIT_REASON = "uiobs_exit";
243
243
  export declare const BATCH_STORAGE_KEY_PREFIX = "ui-observability.batch.";
244
244
  /** Zero-padded digit width for the creation time in a batch key. */
245
245
  export declare const BATCH_KEY_TIME_WIDTH = 14;
246
- /** localStorage key prefix for a batch that exit flush stores. */
246
+ /** localStorage key prefix for a batch stored by the exit flush. */
247
247
  export declare const EMERGENCY_STORAGE_KEY_PREFIX = "ui-observability.emergency.";
248
248
  /** Maximum number of exit batches in the emergency queue. */
249
249
  export declare const EMERGENCY_MAX_ENTRIES = 20;
250
- /** Key that the library writes to test if localStorage accepts writes. */
250
+ /** Key we write to check whether localStorage accepts writes. */
251
251
  export declare const STORAGE_PROBE_KEY = "ui-observability.probe";
252
252
  /** Fraction of the store to evict on a quota error (1 in N). */
253
253
  export declare const QUOTA_EVICTION_DIVISOR = 4;
254
254
  /** DOMException name for a full store. */
255
255
  export declare const QUOTA_EXCEEDED_ERROR = "QuotaExceededError";
256
256
  /**
257
- * Native IndexedDB version. Version 11 replaced Dexie. Version 12 adds the context index.
258
- * Dexie opened this database at ten times its declared version. A version below 11 makes
259
- * open() fail with VersionError for an existing installation. Then no code can read its batches.
257
+ * Native IndexedDB version. Version 11 replaced Dexie, and version 12 adds the context index.
258
+ * Dexie opened this database at ten times its declared version, so a version below 11 makes
259
+ * open() fail with VersionError on an existing installation, and then nothing can read its
260
+ * batches.
260
261
  */
261
262
  export declare const INDEXEDDB_SCHEMA_VERSION = 12;
262
- /** IndexedDB object store that holds batches. Dexie set this name before the library removed it. */
263
+ /** IndexedDB object store that holds the batches. The name dates from Dexie, since removed. */
263
264
  export declare const INDEXEDDB_STORE_NAME = "batches";
264
265
  /** Index on the batch store that orders reads by creation time. */
265
266
  export declare const INDEXEDDB_CREATED_AT_INDEX = "createdAt";
@@ -291,30 +292,30 @@ export declare const JOURNEY_STORAGE_KEY = "ui-observability.journey";
291
292
  */
292
293
  export declare const JOURNEY_TOKEN_NAME_MAX_CHARS = 64;
293
294
  /**
294
- * Max length of a journey id from startJourney(), in characters. The token of a journey with this
295
- * id and a full name stays below the token limit.
295
+ * Max length of a journey id from startJourney(), in characters. A journey with an id this long
296
+ * and a full-length name still gets a token below the token limit.
296
297
  * @see {@link JOURNEY_TOKEN_MAX_CHARS}
297
298
  */
298
299
  export declare const JOURNEY_ID_MAX_CHARS = 64;
299
300
  /**
300
- * Accepted journey id from startJourney(): letters, digits, "_", ".", ":" and "-". Each character
301
- * is one byte in UTF-8. A multibyte id makes the token larger than its limit.
301
+ * Accepted journey id from startJourney(): letters, digits, "_", ".", ":" and "-". Every
302
+ * character is one byte in UTF-8. A multibyte id would push the token over its limit.
302
303
  */
303
304
  export declare const JOURNEY_ID_PATTERN: RegExp;
304
305
  /**
305
- * Time that the start of a journey token can be ahead of this clock, in milliseconds. Two machines
306
- * can disagree on the time. A token further ahead never expires.
306
+ * How far ahead of this clock a journey token's start time can be, in milliseconds. Two machines
307
+ * can disagree on the time, but a token further ahead than this would never expire.
307
308
  */
308
309
  export declare const JOURNEY_CLOCK_SKEW_MS: number;
309
310
  /**
310
- * Max whole-token length, in characters. It rejects an oversized token. It does not
311
- * validate the token content.
311
+ * Max whole-token length, in characters. This only rejects an oversized token. It doesn't
312
+ * validate the token's content.
312
313
  * @see {@link JOURNEY_TOKEN_NAME_MAX_CHARS}
313
314
  */
314
315
  export declare const JOURNEY_TOKEN_MAX_CHARS = 256;
315
316
  /**
316
- * Time to wait for `fin.me.getOptions()`, in milliseconds. After this time, the
317
- * runtime continues without a seeded journey.
317
+ * How long to wait for `fin.me.getOptions()`, in milliseconds. After that, the
318
+ * runtime carries on without a seeded journey.
318
319
  * @see {@link OPENFIN_JOURNEY_CUSTOM_DATA_KEY}
319
320
  */
320
321
  export declare const OPENFIN_OPTIONS_TIMEOUT_MS = 2000;
@@ -358,8 +359,8 @@ export declare const FNV_PRIME = 16777619;
358
359
  /** Largest 32-bit unsigned value. */
359
360
  export declare const UINT32_MAX = 4294967295;
360
361
  /**
361
- * Types that minLevel does not drop. An action is an audit fact. A metric and a span are measurements.
362
- * The remote rate cap for records below minLevel does not apply to them.
362
+ * Types that minLevel never drops. An action is an audit fact, and a metric or a span is a
363
+ * measurement. The remote rate cap for records below minLevel doesn't apply to them either.
363
364
  */
364
365
  export declare const LEVEL_BYPASS_TYPES: readonly LogType[];
365
366
  /** Record kind routed to the metric stream. */
@@ -371,9 +372,9 @@ export declare const LOG_TYPE_SPAN: LogType;
371
372
  /** Protocol identifier for bus envelopes. The bus drops an envelope with a different version. */
372
373
  export declare const BUS_PROTOCOL = "ui-observability/2";
373
374
  /**
374
- * Type tag of each bus message. Every frame must use the same values. The prefix makes a message
375
- * easy to identify in a postMessage log. The envelope tag BUS_PROTOCOL still separates the bus
376
- * from other traffic.
375
+ * Type tag for every bus message. Every frame must use the same values. The prefix makes a
376
+ * message easy to spot in a postMessage log, but it is still the BUS_PROTOCOL envelope tag that
377
+ * separates the bus from other traffic.
377
378
  */
378
379
  export declare const BUS_TYPE: {
379
380
  readonly hello: "ui-observability.message.hello";
@@ -388,77 +389,77 @@ export declare const BUS_TYPE: {
388
389
  };
389
390
  /** Global window property key used to locate a same-origin runtime instance. */
390
391
  export declare const RUNTIME_GLOBAL_KEY = "ui-observability.runtime";
391
- /** Global key of the runtime that shutdown() stopped. Calls go to it until the next configure(). */
392
+ /** Global key for the runtime shutdown() stopped. Calls go to it until the next configure(). */
392
393
  export declare const RUNTIME_STOPPED_KEY = "ui-observability.stopped";
393
- /** Global symbol key of the library request scope count. All library copies on a page share it. */
394
+ /** Global symbol key for the library request scope count, shared by every copy on the page. */
394
395
  export declare const LIBRARY_REQUEST_KEY = "ui-observability.request-scope";
395
- /** Global symbol key of the library console scope count. All library copies on a page share it. */
396
+ /** Global symbol key for the library console scope count, shared by every copy on the page. */
396
397
  export declare const LIBRARY_CONSOLE_KEY = "ui-observability.console-scope";
397
- /** Global symbol key of the count of custom transport calls that wait for an answer. */
398
+ /** Global symbol key for the number of custom transport calls still waiting for an answer. */
398
399
  export declare const TRANSPORT_CALL_KEY = "ui-observability.transport-calls";
399
400
  /** Maximum error records captured per throttling window before suppression. */
400
401
  export declare const ERROR_STORM_MAX_PER_WINDOW = 20;
401
402
  /** Error rate-limiting window duration in milliseconds. */
402
403
  export declare const ERROR_STORM_WINDOW_MS = 10000;
403
404
  /**
404
- * Max ERROR and FATAL records that the pipeline admits in each storm window.
405
- * It is a safety limit for a render loop. It does not shape normal traffic.
406
- * ERROR and FATAL records skip sampling. A direct logger.error call has no other limit.
405
+ * Max ERROR and FATAL records the pipeline admits per storm window. This is a safety limit for
406
+ * a render loop, not a way to shape normal traffic. ERROR and FATAL records skip sampling, so a
407
+ * direct logger.error call has no other limit.
407
408
  */
408
409
  export declare const ERROR_CEILING_MAX_PER_WINDOW = 500;
409
- /** Default minimum duration of a long frame that the library records, in milliseconds. */
410
+ /** Default minimum duration for a long frame to be recorded, in milliseconds. */
410
411
  export declare const LONG_FRAME_THRESHOLD_MS = 100;
411
- /** Maximum long frames recorded in each storm window. A frozen tab cannot flood the pipeline. */
412
+ /** Maximum long frames recorded per storm window, so a frozen tab can't flood the pipeline. */
412
413
  export declare const LONG_FRAME_MAX_PER_WINDOW = 20;
413
- /** Maximum WebSocket events recorded in each storm window. A reconnect loop cannot flood the pipeline. */
414
+ /** Max WebSocket events recorded per storm window, so a reconnect loop can't flood the pipeline. */
414
415
  export declare const WEBSOCKET_MAX_PER_WINDOW = 20;
415
416
  /** Maximum character length of a console breadcrumb message. */
416
417
  export declare const CONSOLE_BREADCRUMB_MAX_CHARS = 200;
417
418
  /** Maximum distinct error signatures tracked for deduplication before LRU eviction. */
418
419
  export declare const MAX_TRACKED_ERROR_SIGNATURES = 200;
419
- /** Maximum character length retained from clicked element text in breadcrumbs. */
420
+ /** Maximum characters of a clicked element's text kept in a breadcrumb. */
420
421
  export declare const CLICK_TEXT_MAX_CHARS = 50;
421
- /** Attribute that names a click action when the app sets no other attribute. */
422
+ /** Attribute that names a click action, unless the app configures a different one. */
422
423
  export declare const ACTION_ATTRIBUTE_DEFAULT = "data-observability-action";
423
- /** Clicks on one element that make a rage click, by default. */
424
+ /** How many clicks on one element make a rage click, by default. */
424
425
  export declare const RAGE_CLICK_COUNT = 3;
425
- /** Time in which the clicks of a rage click occur, in milliseconds, by default. */
426
+ /** The time window a rage click's clicks must fall within, in milliseconds, by default. */
426
427
  export declare const RAGE_CLICK_WINDOW_MS = 1000;
427
- /** Wait for a visible response to a click before it counts as a dead click, in milliseconds. */
428
+ /** How long to wait for a visible response before a click counts as dead, in milliseconds. */
428
429
  export declare const DEAD_CLICK_MS = 1000;
429
- /** Controls whose click must give a visible response. Only these get a dead click check. */
430
+ /** Controls that should respond visibly to a click. Only these get a dead click check. */
430
431
  export declare const DEAD_CLICK_CONTROLS = "a, button, summary, input[type=\"button\"], input[type=\"submit\"], input[type=\"reset\"], [role=\"button\"], [role=\"link\"], [role=\"menuitem\"], [role=\"tab\"]";
431
- /** Maximum character length retained from an aria-label attribute in generated selectors. */
432
+ /** Maximum characters of an aria-label kept in a generated selector. */
432
433
  export declare const ARIA_LABEL_MAX_CHARS = 40;
433
- /** Maximum class names included per element in generated CSS selectors. */
434
+ /** Maximum class names per element in a generated CSS selector. */
434
435
  export declare const SELECTOR_MAX_CLASSES = 2;
435
- /** Default CSS of the console prefix. The colors are readable on light and dark devtools. */
436
+ /** Default CSS for the console prefix. The colors are readable in light and dark devtools. */
436
437
  export declare const CONSOLE_DEFAULT_STYLES: Readonly<Required<ConsoleStyles>>;
437
- /** Scaling factor for rounding duration measurements to three decimal places. */
438
+ /** Scaling factor for rounding a duration to three decimal places. */
438
439
  export declare const DURATION_PRECISION = 1000;
439
- /** Minimum duration in milliseconds between storage gap warning reports. */
440
+ /** Minimum time between storage gap warning reports, in milliseconds. */
440
441
  export declare const GAP_REPORT_THROTTLE_MS = 60000;
441
- /** Default namespace for telemetry records emitted by auto-capture modules. */
442
+ /** Default namespace for records the auto-capture modules emit. */
442
443
  export declare const CAPTURE_NAMESPACE = "uiobs.capture";
443
- /** Default namespace for telemetry records emitted by storage subsystems. */
444
+ /** Default namespace for records the storage subsystems emit. */
444
445
  export declare const STORAGE_NAMESPACE = "uiobs.storage";
445
- /** Namespace of the records that `diagnostics.records` gives. */
446
+ /** Namespace for the records `diagnostics.records` produces. */
446
447
  export declare const DIAGNOSTICS_NAMESPACE = "uiobs.diagnostics";
447
- /** Measurement unit that the library uses when the call gives no unit. */
448
+ /** The measurement unit used when a call doesn't give one. */
448
449
  export declare const DEFAULT_METRIC_UNIT = "count";
449
- /** Namespace of the points that the counter and histogram instruments give. */
450
+ /** Namespace for the points the counter and histogram instruments produce. */
450
451
  export declare const METRIC_NAMESPACE = "uiobs.metrics";
451
- /** Maximum attribute sets of one instrument in one interval. More sets go to one overflow set. */
452
+ /** Maximum attribute sets per instrument per interval. Any more go into one overflow set. */
452
453
  export declare const METRIC_MAX_SERIES = 100;
453
- /** Maximum bucket boundaries of one histogram. More boundaries make a large point. */
454
+ /** Maximum bucket boundaries per histogram. More than that makes for a large point. */
454
455
  export declare const METRIC_MAX_BOUNDARIES = 50;
455
- /** Attribute of the overflow set. OpenTelemetry uses the same key. */
456
+ /** Attribute on the overflow set. OpenTelemetry uses the same key. */
456
457
  export declare const ATTR_METRIC_OVERFLOW = "otel.metric.overflow";
457
- /** Default histogram boundaries. They are the OpenTelemetry default boundaries. */
458
+ /** Default histogram boundaries, the same as OpenTelemetry's defaults. */
458
459
  export declare const METRIC_DEFAULT_BOUNDARIES: readonly number[];
459
460
  /**
460
- * Attribute keys of an aggregated metric point. The OTLP metrics serializer reads them.
461
- * Sampling keeps each record with a start time. A sample of a sum gives a false sum.
461
+ * Attribute keys on an aggregated metric point, read by the OTLP metrics serializer.
462
+ * Sampling keeps every record that has a start time, because sampling a sum gives a false sum.
462
463
  */
463
464
  export declare const METRIC_KEYS: {
464
465
  readonly start: "metric.start_time_unix_nano";
@@ -470,9 +471,58 @@ export declare const METRIC_KEYS: {
470
471
  readonly bounds: "metric.bounds";
471
472
  readonly buckets: "metric.bucket_counts";
472
473
  };
474
+ /** Precision of the profiler histogram: 2^4 = 16 sub-buckets per power of two. */
475
+ export declare const PROFILE_SUB_BITS = 4;
476
+ /** Buckets per probe: 16 for 0 to 15 us, then 16 for each exponent from 4 to 25. */
477
+ export declare const PROFILE_BUCKETS = 368;
478
+ /** Largest tracked duration in microseconds (2^26 - 1). Larger values go in the last bucket. */
479
+ export declare const PROFILE_MAX_US = 67108863;
480
+ /** Cap on the buckets in one profiler summary record, to keep the payload small. */
481
+ export declare const PROFILE_POINT_BUCKETS = 100;
482
+ /** Default interval between profiler summary records, in ms. */
483
+ export declare const PROFILER_FLUSH_INTERVAL_MS = 10000;
484
+ /** Default probe limit. The runtime fixes the limit at startup. */
485
+ export declare const PROFILER_MAX_PROBES = 64;
486
+ /** Metric name for profiler summary records. */
487
+ export declare const PROFILE_METRIC_NAME = "ui.profile.duration";
488
+ /** Attribute keys on profiler summary records. */
489
+ export declare const PROFILE_KEYS: {
490
+ readonly probe: "profile.probe";
491
+ readonly sampleEvery: "profile.sample_every";
492
+ readonly p50: "profile.p50";
493
+ readonly p90: "profile.p90";
494
+ readonly p99: "profile.p99";
495
+ readonly overhead: "profile.overhead_ns";
496
+ readonly selfP99: "profile.self_p99";
497
+ readonly framePhase: "profile.frame_phase";
498
+ };
499
+ /** How deep spans can nest and still get a self time. Going deeper drops the frames below. */
500
+ export declare const PROFILER_STACK_DEPTH = 32;
501
+ /** How many recent spans the profiler keeps for linking to long animation frames. */
502
+ export declare const PROFILER_RING_SPANS = 256;
503
+ /** Shortest span, in ms, that gets linked to a long animation frame. */
504
+ export declare const PROFILER_LINK_MIN_MS = 1;
505
+ /** Metric name for long animation frame phases, reported per probe in the frame. */
506
+ export declare const PROFILE_FRAME_METRIC_NAME = "ui.profile.frame.duration";
507
+ /** Probe name for frame pacing. Each value is the time between two frames. */
508
+ export declare const PROFILE_FRAME_PROBE = "frame.interval";
509
+ /** Reported when the library can't read an instrument's options. */
510
+ export declare const INSTRUMENT_OPTIONS_FAULT = "The library could not read the options of an instrument. The library uses the defaults.";
511
+ /** Ambient attribute that ties every record to the session replay recording. */
512
+ export declare const REPLAY_ID_KEY = "replay.id";
513
+ /** Put this attribute on an element to leave its text unmasked in session replay. */
514
+ export declare const REPLAY_UNMASK_ATTRIBUTE = "data-observability-unmask";
515
+ /** Hard cap on registered probe names, and so the upper bound for profiler.maxProbes. */
516
+ export declare const PROFILER_PROBE_LIMIT = 1024;
517
+ /** Global symbol key for the profiler core. Copies of the same library version share the core. */
518
+ export declare const PROFILER_GLOBAL_KEY = "ui-observability.profiler";
519
+ /** Minimum window for the profiler's overhead measurement, in ms. */
520
+ export declare const PROFILER_CALIBRATION_MS = 2;
521
+ /** Cap on begin()/end() pairs in the profiler's overhead measurement. */
522
+ export declare const PROFILER_CALIBRATION_PAIRS = 100000;
473
523
  /** Namespace of the span records. */
474
524
  export declare const TRACE_NAMESPACE = "uiobs.traces";
475
- /** Attribute keys of the span fields of a span record. The traces serializer reads them. */
525
+ /** Attribute keys for the span fields on a span record, read by the traces serializer. */
476
526
  export declare const SPAN_KEYS: {
477
527
  readonly kind: "span.kind";
478
528
  readonly parentId: "span.parent_id";
@@ -482,9 +532,9 @@ export declare const SPAN_KEYS: {
482
532
  readonly linkTraceId: "span.link.trace_id";
483
533
  readonly linkSpanId: "span.link.span_id";
484
534
  };
485
- /** Protocol of the private transport worker channel. */
535
+ /** Protocol for the private transport worker channel. */
486
536
  export declare const TRANSPORT_WORKER_PROTOCOL = "ui-observability.transport/1";
487
- /** Type tags of the private transport worker messages. */
537
+ /** Type tags for the private transport worker messages. */
488
538
  export declare const TRANSPORT_WORKER_TYPE: {
489
539
  readonly connect: "connect";
490
540
  readonly ready: "ready";
@@ -492,7 +542,7 @@ export declare const TRANSPORT_WORKER_TYPE: {
492
542
  readonly result: "result";
493
543
  readonly cancel: "cancel";
494
544
  };
495
- /** Refusal of the worker entry. A constant keeps the protocol code out of the main chunk. */
545
+ /** The worker entry's refusal message. A constant keeps the protocol code out of the main chunk. */
496
546
  export declare const TRANSPORT_WORKER_REFUSAL: {
497
547
  readonly p: "ui-observability.transport/1";
498
548
  readonly v: string;
@@ -501,18 +551,18 @@ export declare const TRANSPORT_WORKER_REFUSAL: {
501
551
  };
502
552
  /** Maximum requests in one transport worker. */
503
553
  export declare const TRANSPORT_WORKER_MAX_JOBS = 64;
504
- /** Maximum wait for idle time before the deferred logger builds its records. */
554
+ /** Longest the deferred logger waits for idle time before it builds its records. */
505
555
  export declare const DEFER_IDLE_TIMEOUT_MS = 1000;
506
- /** Maximum pending payload references of one runtime. A full queue builds its records first. */
556
+ /** Maximum pending payload references per runtime. A full queue builds its records first. */
507
557
  export declare const DEFER_QUEUE_LIMIT = 1000;
508
- /** Default minimum duration of a slow resource event, in milliseconds. */
558
+ /** Default minimum duration for a slow resource event, in milliseconds. */
509
559
  export declare const RESOURCE_SLOW_MS = 1000;
510
560
  /** Response header with server duration entries. */
511
561
  export declare const SERVER_TIMING_HEADER = "Server-Timing";
512
562
  /** Maximum Server-Timing header length and entry count. */
513
563
  export declare const SERVER_TIMING_MAX_CHARS = 4096;
514
564
  export declare const SERVER_TIMING_MAX_ENTRIES = 32;
515
- /** Capture switches that a remote rule can change. Privacy controls stay local. */
565
+ /** Capture switches a remote rule can change. Privacy controls stay local. */
516
566
  export declare const REMOTE_CAPTURE_FLAGS: readonly ["errors", "rejections", "resourceErrors", "fetch", "xhr", "httpMetrics", "navigation", "webVitals", "longFrames", "interactions", "console", "webSocket", "uncleanExit", "userTiming", "serverTiming", "reports", "resourceTiming", "lifecycle"];
517
567
  /** Default `service.name` when a consumer sets none. */
518
568
  export declare const UNKNOWN_SERVICE_NAME = "unknown-service";
@@ -525,15 +575,15 @@ export declare const SAMPLING_RATE_MAX = 1;
525
575
  * @see {@link SAMPLING_RATE_MAX}
526
576
  */
527
577
  export declare const SAMPLING_RATE_FALLBACK = 1;
528
- /** Version of the remote sampling rules that the library accepts. */
578
+ /** The remote sampling rules version this library accepts. */
529
579
  export declare const REMOTE_SAMPLING_VERSION = 1;
530
580
  /** Maximum length of the sampling header, in characters. */
531
581
  export declare const REMOTE_SAMPLING_MAX_CHARS = 4096;
532
- /** Maximum time that remote sampling rules stay in force, in milliseconds. */
582
+ /** Longest that remote sampling rules stay in effect, in milliseconds. */
533
583
  export declare const REMOTE_SAMPLING_MAX_TTL_MS: number;
534
584
  /** Maximum namespace rates in one set of remote sampling rules. */
535
585
  export declare const REMOTE_SAMPLING_MAX_RATES = 100;
536
- /** Time between two requests of a forwarder for the remote sampling rules, in milliseconds. */
586
+ /** How often a forwarder asks for the remote sampling rules, in milliseconds. */
537
587
  export declare const REMOTE_SAMPLING_POLL_MS = 30000;
538
588
  /**
539
589
  * Config keys with no default, excluded from `DEFAULT_CONFIG`.
@@ -544,7 +594,7 @@ export declare const UNDEFAULTED_CONFIG_KEYS: readonly ["contextProvider", "reda
544
594
  * Nested config section keys.
545
595
  * @see {@link ResolvedConfig}
546
596
  */
547
- export declare const CONFIG_SECTIONS: readonly ["capturePolicy", "metadata", "persistence", "diagnostics", "correlation", "metrics", "buffering", "delivery", "loggerCache", "securityContext", "sampling", "bus", "journey", "batching", "retention", "limits", "capture", "debugBuffer"];
597
+ export declare const CONFIG_SECTIONS: readonly ["capturePolicy", "metadata", "persistence", "diagnostics", "correlation", "metrics", "buffering", "delivery", "loggerCache", "securityContext", "sampling", "bus", "journey", "batching", "retention", "limits", "capture", "debugBuffer", "profiler", "replay"];
548
598
  /**
549
599
  * Section keys with no default, excluded from their section of `DEFAULT_CONFIG`.
550
600
  * @see {@link UNDEFAULTED_CONFIG_KEYS}
@@ -558,15 +608,15 @@ export declare const LOG_FLUSH_INTERVAL_MS = 2000;
558
608
  export declare const LOG_BATCH_SIZE = 100;
559
609
  /**
560
610
  * Max time a partial metric batch waits before the pipeline sends it, in milliseconds.
561
- * Metric batches wait longer than log batches. Metrics have a higher volume, and no
562
- * caller waits for them.
611
+ * Metric batches wait longer than log batches because metrics have a higher volume and
612
+ * no caller is waiting for them.
563
613
  */
564
614
  export declare const METRIC_FLUSH_INTERVAL_MS = 10000;
565
615
  /** Max records per metric batch. At this count, the pipeline sends the batch early. */
566
616
  export declare const METRIC_BATCH_SIZE = 500;
567
617
  /** Max concurrent ingest requests, across both streams. */
568
618
  export declare const MAX_CONCURRENT_REQUESTS = 2;
569
- /** Max time for one ingest request, in milliseconds. Then the transport aborts and retries it. */
619
+ /** Max time for one ingest request, in milliseconds. The transport then aborts and retries it. */
570
620
  export declare const REQUEST_TIMEOUT_MS = 15000;
571
621
  /** Min payload size to compress, in bytes. */
572
622
  export declare const COMPRESSION_THRESHOLD_BYTES = 1024;
@@ -575,17 +625,17 @@ export declare const STORAGE_DB_NAME = "UiObservability";
575
625
  /** Capacity and retention thresholds every storage adapter enforces. */
576
626
  export declare const STORAGE_LIMITS: StorageLimits;
577
627
  /**
578
- * Max time for one storage call, in milliseconds. Then the library treats the call as failed.
579
- * A call that does not settle keeps a dispatch slot or the drain flag.
628
+ * Max time for one storage call, in milliseconds. After that the call counts as failed, because
629
+ * a call that never settles would hold on to a dispatch slot or the drain flag.
580
630
  */
581
631
  export declare const STORAGE_DEADLINE_MS = 10000;
582
- /** First backoff step, in milliseconds. Each attempt doubles it. */
632
+ /** First backoff step, in milliseconds. Doubles with every attempt. */
583
633
  export declare const RETRY_BASE_DELAY_MS = 2000;
584
634
  /** Backoff ceiling, in milliseconds. */
585
635
  export declare const RETRY_MAX_DELAY_MS = 60000;
586
636
  /** How often to check for stored work when nothing has failed recently, in milliseconds. */
587
637
  export declare const RETRY_IDLE_DELAY_MS = 30000;
588
- /** Max time a journey stays open, in milliseconds. Then the library treats it as abandoned. */
638
+ /** Max time a journey stays open, in milliseconds. After that it counts as abandoned. */
589
639
  export declare const JOURNEY_MAX_AGE_MS: number;
590
640
  /** True if the journey ends for all contexts when the owning context closes. */
591
641
  export declare const JOURNEY_END_ON_OWNER_CLOSE = false;
@@ -597,25 +647,22 @@ export declare const BUS_CHANNEL_NAME = "ui_observability_control";
597
647
  export declare const BUS_HANDSHAKE_TIMEOUT_MS = 1500;
598
648
  /** Handshake attempts allowed before a cross-origin forwarder promotes itself to sender. */
599
649
  export declare const BUS_MAX_HANDSHAKE_ATTEMPTS = 3;
600
- /** Max records that are not actions in one hold buffer. A full buffer drops the oldest. */
650
+ /** Max non-action records in one hold buffer. A full buffer drops the oldest. */
601
651
  export declare const BUS_MAX_BOOT_BUFFER_RECORDS = 500;
602
- /** Max action records in one hold buffer. Actions have their own cap. A log storm cannot push one out. */
652
+ /** Max action records in one hold buffer. Their own cap means a log storm can't push one out. */
603
653
  export declare const BUS_MAX_BOOT_BUFFER_ACTIONS = 2000;
604
- /** Max different values in each list of an onDrop summary. */
654
+ /** Max distinct values in each list of an onDrop summary. */
605
655
  export declare const DROP_SUMMARY_MAX_ITEMS = 20;
606
656
  /**
607
- * Max characters of an untrusted message type in a diagnostic detail. The sender sets the text.
608
- * The longest BUS_TYPE value has 41 characters. Each valid type then fits.
657
+ * Max characters of an untrusted message type in a diagnostic detail, since the sender controls
658
+ * that text. The longest BUS_TYPE value is 41 characters, so every valid type fits.
609
659
  */
610
660
  export declare const BUS_TYPE_DETAIL_MAX_CHARS = 48;
611
661
  /** Breadcrumbs kept as context for the next error. */
612
662
  export declare const MAX_BREADCRUMBS = 50;
613
- /**
614
- * Time window in which the library counts identical errors but does not send them again,
615
- * in milliseconds.
616
- */
663
+ /** How long identical errors are counted without being sent again, in milliseconds. */
617
664
  export declare const ERROR_DEDUPE_MS = 5000;
618
- /** Size caps for every record. The library applies them after sanitize and after redact. */
665
+ /** Size caps for every record, applied after sanitize and after redact. */
619
666
  export declare const RECORD_LIMITS: {
620
667
  maxBodyChars: number;
621
668
  maxAttributeChars: number;
@@ -627,9 +674,9 @@ export declare const RECORD_LIMITS: {
627
674
  maxRecordBytes: number;
628
675
  };
629
676
  /**
630
- * Default runtime config before the consumer calls `configure()`. It excludes `serializer`.
631
- * `resolveConfig` supplies that default to prevent a circular import.
632
- * It comes after the constants that it reads. A const cannot be read before its line.
677
+ * The default runtime config, before the consumer calls `configure()`. `serializer` is left
678
+ * out, because `resolveConfig` supplies that default to avoid a circular import.
679
+ * This sits below the constants it reads, since a const can't be read before its own line.
633
680
  * @see {@link ResolvedConfig}
634
681
  * @see {@link UNDEFAULTED_CONFIG_KEYS}
635
682
  */
@@ -1 +1 @@
1
- {"version":3,"file":"context-storage-BjzeBSxH.cjs","names":["ContextStorage","store","policy","namespace","batch","limit","id","attempts","discard"],"sources":["../src/storage/context-storage.ts"],"sourcesContent":["// src/storage/context-storage.ts\n//\n// Gives access to stored batches of one delivery context and one application namespace.\n\nimport type { SecurityContextOptions } from \"../models/config\";\nimport type { LogBatch } from \"../models/batch\";\nimport type { StorageAdapter } from \"../models/storage\";\n\n/** Gives access to one part of the shared store. Records of other contexts stay stored. */\nexport class ContextStorage implements StorageAdapter {\n /** Adapter name of the underlying store. */\n readonly name: string;\n /** False after this context store stops accepting writes. */\n private active = true;\n /** True if a late save must remove its batch after it completes. */\n private discard = false;\n\n /**\n * Builds access to one application namespace and delivery context.\n * @param store Underlying batch store.\n * @param policy Active context id and isolation rule.\n * @param namespace Application storage namespace.\n */\n constructor(\n private readonly store: StorageAdapter,\n private readonly policy: SecurityContextOptions,\n readonly namespace = \"\",\n ) {\n this.name = store.name;\n }\n\n /**\n * Checks if a batch belongs to the permitted namespace and context.\n * @param batch Batch to check.\n * @returns True if this adapter can accept the batch.\n */\n accepts(batch: LogBatch): boolean {\n return (\n (batch.persistenceNamespace ?? \"\") === this.namespace &&\n (!this.policy.isolation || !this.policy.id || batch.routingContextId === this.policy.id)\n );\n }\n\n /**\n * Stores a batch of this context. A late save removes its batch after a discard.\n * @param batch Batch to store.\n * @returns Promise that resolves when the save and any removal complete.\n */\n async save(batch: LogBatch): Promise<void> {\n if (!this.active || !this.accepts(batch)) return;\n await this.store.save(batch);\n // A slow save can complete after the context change cleared these records.\n if (this.discard) await this.store.remove(batch.id);\n }\n\n /**\n * Reads stored batches of this context, oldest first.\n * @param limit Maximum batches to return.\n * @returns Batches in creation order. The method does not remove them.\n */\n async take(limit: number): Promise<LogBatch[]> {\n // Read only this part of the store. A full read on each retry pass parses all contexts.\n if (!this.isolated()) {\n return (await this.store.take(limit)).filter((batch) => this.accepts(batch));\n }\n\n if (this.store.takeContext) {\n return this.store.takeContext(this.policy.id, limit);\n }\n\n const all = await this.store.take(0xffffffff);\n return all.filter((batch) => this.accepts(batch)).slice(0, limit);\n }\n\n /**\n * Checks if reads are limited to the active context.\n * @returns True if isolation is on and the context has an id.\n */\n private isolated(): boolean {\n return this.policy.isolation && this.policy.id !== \"\";\n }\n\n /**\n * Removes one stored batch.\n * @param id Batch id.\n * @returns Promise that resolves when removal completes.\n */\n remove(id: string): Promise<void> {\n return this.store.remove(id);\n }\n\n /**\n * Changes the attempt count of a stored batch.\n * @param id Batch id.\n * @param attempts Total attempt count to store.\n * @returns Promise that resolves when the change completes.\n */\n bumpAttempts(id: string, attempts: number): Promise<void> {\n return this.store.bumpAttempts(id, attempts);\n }\n\n /**\n * Applies the retention and capacity limits of the underlying store.\n * @returns Summary of the batches and records removed.\n */\n prune(): ReturnType<StorageAdapter[\"prune\"]> {\n return this.store.prune();\n }\n\n /**\n * Counts stored batches of this context.\n * @returns Number of batches in this context.\n */\n async count(): Promise<number> {\n if (!this.isolated()) {\n return this.store.count();\n }\n\n if (this.store.countContext) {\n return this.store.countContext(this.policy.id);\n }\n\n return (await this.take(Number.MAX_SAFE_INTEGER)).length;\n }\n\n /**\n * Removes stored batches of this context.\n * @returns Promise that resolves when removal completes.\n */\n async clear(): Promise<void> {\n for (const batch of await this.take(Number.MAX_SAFE_INTEGER)) await this.store.remove(batch.id);\n }\n\n /**\n * Stops new writes and clears this context if required. Other contexts can keep the memory store.\n * @param discard True to remove this context before closing the store.\n * @returns Promise that resolves when removal and closure complete.\n */\n async retire(discard: boolean): Promise<void> {\n this.active = false;\n this.discard = discard;\n if (discard) await this.clear();\n // Keep the memory store for later context changes. It can hold records of other contexts.\n if (this.name !== \"memory\") await this.close();\n }\n\n /**\n * Removes all batches in the application namespace.\n * @returns Promise that resolves when removal completes.\n */\n clearNamespace(): Promise<void> {\n return this.store.clear();\n }\n\n /**\n * Closes the underlying store.\n * @returns Promise that resolves when closure completes.\n */\n close(): Promise<void> {\n return this.store.close();\n }\n}\n"],"mappings":"AASA,IAAaA,EAAb,KAAsD,CAejC,MACA,OACR,UAfX,KAEA,OAAiB,GAEjB,QAAkB,GAQlB,YACE,EACA,EACA,EAAqB,GACrB,CAHiB,KAAA,MAAAC,EACA,KAAA,OAAAC,EACR,KAAA,UAAAC,EAET,KAAK,KAAOF,EAAM,IACpB,CAOA,QAAQ,EAA0B,CAChC,OACGG,EAAM,sBAAwB,MAAQ,KAAK,YAC3C,CAAC,KAAK,OAAO,WAAa,CAAC,KAAK,OAAO,IAAMA,EAAM,mBAAqB,KAAK,OAAO,GAEzF,CAOA,MAAM,KAAK,EAAgC,CACpC,KAAK,QAAW,KAAK,QAAQA,CAAK,IACvC,MAAM,KAAK,MAAM,KAAKA,CAAK,EAEvB,KAAK,SAAS,MAAM,KAAK,MAAM,OAAOA,EAAM,EAAE,EACpD,CAOA,MAAM,KAAK,EAAoC,CAW7C,OATK,KAAK,SAAS,EAIf,KAAK,MAAM,YACN,KAAK,MAAM,YAAY,KAAK,OAAO,GAAIC,CAAK,GAI9C,MADW,KAAK,MAAM,KAAK,UAAU,EAAA,CACjC,OAAQ,GAAU,KAAK,QAAQD,CAAK,CAAC,CAAC,CAAC,MAAM,EAAGC,CAAK,GARtD,MAAM,KAAK,MAAM,KAAKA,CAAK,EAAA,CAAG,OAAQ,GAAU,KAAK,QAAQD,CAAK,CAAC,CAS/E,CAMA,UAA4B,CAC1B,OAAO,KAAK,OAAO,WAAa,KAAK,OAAO,KAAO,EACrD,CAOA,OAAO,EAA2B,CAChC,OAAO,KAAK,MAAM,OAAOE,CAAE,CAC7B,CAQA,aAAa,EAAY,EAAiC,CACxD,OAAO,KAAK,MAAM,aAAaA,EAAIC,CAAQ,CAC7C,CAMA,OAA6C,CAC3C,OAAO,KAAK,MAAM,MAAM,CAC1B,CAMA,MAAM,OAAyB,CAS7B,OARK,KAAK,SAAS,EAIf,KAAK,MAAM,aACN,KAAK,MAAM,aAAa,KAAK,OAAO,EAAE,GAGvC,MAAM,KAAK,YAA4B,EAAA,CAAG,OAPzC,KAAK,MAAM,MAAM,CAQ5B,CAMA,MAAM,OAAuB,CAC3B,IAAK,IAAMH,KAAS,MAAM,KAAK,YAA4B,EAAG,MAAM,KAAK,MAAM,OAAOA,EAAM,EAAE,CAChG,CAOA,MAAM,OAAO,EAAiC,CAC5C,KAAK,OAAS,GACd,KAAK,QAAUI,EACXA,GAAS,MAAM,KAAK,MAAM,EAE1B,KAAK,OAAS,UAAU,MAAM,KAAK,MAAM,CAC/C,CAMA,gBAAgC,CAC9B,OAAO,KAAK,MAAM,MAAM,CAC1B,CAMA,OAAuB,CACrB,OAAO,KAAK,MAAM,MAAM,CAC1B,CACF"}
1
+ {"version":3,"file":"context-storage-BjzeBSxH.cjs","names":["ContextStorage","store","policy","namespace","batch","limit","id","attempts","discard"],"sources":["../src/storage/context-storage.ts"],"sourcesContent":["// src/storage/context-storage.ts\n//\n// Scopes the shared batch store to one delivery context and one application namespace.\n\nimport type { SecurityContextOptions } from \"../models/config\";\nimport type { LogBatch } from \"../models/batch\";\nimport type { StorageAdapter } from \"../models/storage\";\n\n/** A view of one slice of the shared store. Other contexts' records are left alone. */\nexport class ContextStorage implements StorageAdapter {\n /** Name of the underlying adapter. */\n readonly name: string;\n /** False once this context store stops accepting writes. */\n private active = true;\n /** True if a late save has to remove its batch once it finishes. */\n private discard = false;\n\n /**\n * Scopes a store to one application namespace and delivery context.\n * @param store The underlying batch store.\n * @param policy The active context id and the isolation rule.\n * @param namespace The application's storage namespace.\n */\n constructor(\n private readonly store: StorageAdapter,\n private readonly policy: SecurityContextOptions,\n readonly namespace = \"\",\n ) {\n this.name = store.name;\n }\n\n /**\n * Checks whether a batch belongs to this namespace and context.\n * @param batch The batch to check.\n * @returns True if this adapter can accept the batch.\n */\n accepts(batch: LogBatch): boolean {\n return (\n (batch.persistenceNamespace ?? \"\") === this.namespace &&\n (!this.policy.isolation || !this.policy.id || batch.routingContextId === this.policy.id)\n );\n }\n\n /**\n * Stores a batch for this context. After a discard, a late save removes its own batch again.\n * @param batch The batch to store.\n * @returns A promise that resolves once the save, and any removal, is done.\n */\n async save(batch: LogBatch): Promise<void> {\n if (!this.active || !this.accepts(batch)) return;\n await this.store.save(batch);\n // A slow save can finish after the context change already cleared these records.\n if (this.discard) await this.store.remove(batch.id);\n }\n\n /**\n * Reads this context's stored batches, oldest first.\n * @param limit Maximum number of batches to return.\n * @returns The batches in creation order. They are not removed.\n */\n async take(limit: number): Promise<LogBatch[]> {\n // Read only this context's slice. A full read on every retry pass would parse all contexts.\n if (!this.isolated()) {\n return (await this.store.take(limit)).filter((batch) => this.accepts(batch));\n }\n\n if (this.store.takeContext) {\n return this.store.takeContext(this.policy.id, limit);\n }\n\n const all = await this.store.take(0xffffffff);\n return all.filter((batch) => this.accepts(batch)).slice(0, limit);\n }\n\n /**\n * Checks whether reads are limited to the active context.\n * @returns True if isolation is on and the context has an id.\n */\n private isolated(): boolean {\n return this.policy.isolation && this.policy.id !== \"\";\n }\n\n /**\n * Removes one stored batch.\n * @param id Batch id.\n * @returns A promise that resolves once the batch is removed.\n */\n remove(id: string): Promise<void> {\n return this.store.remove(id);\n }\n\n /**\n * Updates a stored batch's attempt count.\n * @param id Batch id.\n * @param attempts The total attempt count to store.\n * @returns A promise that resolves once the change is saved.\n */\n bumpAttempts(id: string, attempts: number): Promise<void> {\n return this.store.bumpAttempts(id, attempts);\n }\n\n /**\n * Applies the underlying store's retention and capacity limits.\n * @returns A summary of the batches and records it removed.\n */\n prune(): ReturnType<StorageAdapter[\"prune\"]> {\n return this.store.prune();\n }\n\n /**\n * Counts this context's stored batches.\n * @returns The number of batches in this context.\n */\n async count(): Promise<number> {\n if (!this.isolated()) {\n return this.store.count();\n }\n\n if (this.store.countContext) {\n return this.store.countContext(this.policy.id);\n }\n\n return (await this.take(Number.MAX_SAFE_INTEGER)).length;\n }\n\n /**\n * Removes this context's stored batches.\n * @returns A promise that resolves once they are removed.\n */\n async clear(): Promise<void> {\n for (const batch of await this.take(Number.MAX_SAFE_INTEGER)) await this.store.remove(batch.id);\n }\n\n /**\n * Stops new writes and, if asked, clears this context. The memory store is left open for\n * other contexts.\n * @param discard True to remove this context's batches before closing the store.\n * @returns A promise that resolves once the removal and the close are done.\n */\n async retire(discard: boolean): Promise<void> {\n this.active = false;\n this.discard = discard;\n if (discard) await this.clear();\n // Keep the memory store around for later context changes. It may hold other contexts' records.\n if (this.name !== \"memory\") await this.close();\n }\n\n /**\n * Removes every batch in the application namespace.\n * @returns A promise that resolves once they are removed.\n */\n clearNamespace(): Promise<void> {\n return this.store.clear();\n }\n\n /**\n * Closes the underlying store.\n * @returns A promise that resolves once it is closed.\n */\n close(): Promise<void> {\n return this.store.close();\n }\n}\n"],"mappings":"AASA,IAAaA,EAAb,KAAsD,CAejC,MACA,OACR,UAfX,KAEA,OAAiB,GAEjB,QAAkB,GAQlB,YACE,EACA,EACA,EAAqB,GACrB,CAHiB,KAAA,MAAAC,EACA,KAAA,OAAAC,EACR,KAAA,UAAAC,EAET,KAAK,KAAOF,EAAM,IACpB,CAOA,QAAQ,EAA0B,CAChC,OACGG,EAAM,sBAAwB,MAAQ,KAAK,YAC3C,CAAC,KAAK,OAAO,WAAa,CAAC,KAAK,OAAO,IAAMA,EAAM,mBAAqB,KAAK,OAAO,GAEzF,CAOA,MAAM,KAAK,EAAgC,CACpC,KAAK,QAAW,KAAK,QAAQA,CAAK,IACvC,MAAM,KAAK,MAAM,KAAKA,CAAK,EAEvB,KAAK,SAAS,MAAM,KAAK,MAAM,OAAOA,EAAM,EAAE,EACpD,CAOA,MAAM,KAAK,EAAoC,CAW7C,OATK,KAAK,SAAS,EAIf,KAAK,MAAM,YACN,KAAK,MAAM,YAAY,KAAK,OAAO,GAAIC,CAAK,GAI9C,MADW,KAAK,MAAM,KAAK,UAAU,EAAA,CACjC,OAAQ,GAAU,KAAK,QAAQD,CAAK,CAAC,CAAC,CAAC,MAAM,EAAGC,CAAK,GARtD,MAAM,KAAK,MAAM,KAAKA,CAAK,EAAA,CAAG,OAAQ,GAAU,KAAK,QAAQD,CAAK,CAAC,CAS/E,CAMA,UAA4B,CAC1B,OAAO,KAAK,OAAO,WAAa,KAAK,OAAO,KAAO,EACrD,CAOA,OAAO,EAA2B,CAChC,OAAO,KAAK,MAAM,OAAOE,CAAE,CAC7B,CAQA,aAAa,EAAY,EAAiC,CACxD,OAAO,KAAK,MAAM,aAAaA,EAAIC,CAAQ,CAC7C,CAMA,OAA6C,CAC3C,OAAO,KAAK,MAAM,MAAM,CAC1B,CAMA,MAAM,OAAyB,CAS7B,OARK,KAAK,SAAS,EAIf,KAAK,MAAM,aACN,KAAK,MAAM,aAAa,KAAK,OAAO,EAAE,GAGvC,MAAM,KAAK,YAA4B,EAAA,CAAG,OAPzC,KAAK,MAAM,MAAM,CAQ5B,CAMA,MAAM,OAAuB,CAC3B,IAAK,IAAMH,KAAS,MAAM,KAAK,YAA4B,EAAG,MAAM,KAAK,MAAM,OAAOA,EAAM,EAAE,CAChG,CAQA,MAAM,OAAO,EAAiC,CAC5C,KAAK,OAAS,GACd,KAAK,QAAUI,EACXA,GAAS,MAAM,KAAK,MAAM,EAE1B,KAAK,OAAS,UAAU,MAAM,KAAK,MAAM,CAC/C,CAMA,gBAAgC,CAC9B,OAAO,KAAK,MAAM,MAAM,CAC1B,CAMA,OAAuB,CACrB,OAAO,KAAK,MAAM,MAAM,CAC1B,CACF,E"}
@@ -1,4 +1,4 @@
1
- //#region src/storage/context-storage.ts
1
+ // src/storage/context-storage.ts
2
2
  var e = class {
3
3
  store;
4
4
  policy;
@@ -46,7 +46,6 @@ var e = class {
46
46
  return this.store.close();
47
47
  }
48
48
  };
49
- //#endregion
50
49
  export { e as ContextStorage };
51
50
 
52
- //# sourceMappingURL=context-storage-DxZf4Gfh.js.map
51
+ //# sourceMappingURL=context-storage-BzkoHzkQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-storage-BzkoHzkQ.js","names":["ContextStorage","store","policy","namespace","batch","limit","id","attempts","discard"],"sources":["../src/storage/context-storage.ts"],"sourcesContent":["// src/storage/context-storage.ts\n//\n// Scopes the shared batch store to one delivery context and one application namespace.\n\nimport type { SecurityContextOptions } from \"../models/config\";\nimport type { LogBatch } from \"../models/batch\";\nimport type { StorageAdapter } from \"../models/storage\";\n\n/** A view of one slice of the shared store. Other contexts' records are left alone. */\nexport class ContextStorage implements StorageAdapter {\n /** Name of the underlying adapter. */\n readonly name: string;\n /** False once this context store stops accepting writes. */\n private active = true;\n /** True if a late save has to remove its batch once it finishes. */\n private discard = false;\n\n /**\n * Scopes a store to one application namespace and delivery context.\n * @param store The underlying batch store.\n * @param policy The active context id and the isolation rule.\n * @param namespace The application's storage namespace.\n */\n constructor(\n private readonly store: StorageAdapter,\n private readonly policy: SecurityContextOptions,\n readonly namespace = \"\",\n ) {\n this.name = store.name;\n }\n\n /**\n * Checks whether a batch belongs to this namespace and context.\n * @param batch The batch to check.\n * @returns True if this adapter can accept the batch.\n */\n accepts(batch: LogBatch): boolean {\n return (\n (batch.persistenceNamespace ?? \"\") === this.namespace &&\n (!this.policy.isolation || !this.policy.id || batch.routingContextId === this.policy.id)\n );\n }\n\n /**\n * Stores a batch for this context. After a discard, a late save removes its own batch again.\n * @param batch The batch to store.\n * @returns A promise that resolves once the save, and any removal, is done.\n */\n async save(batch: LogBatch): Promise<void> {\n if (!this.active || !this.accepts(batch)) return;\n await this.store.save(batch);\n // A slow save can finish after the context change already cleared these records.\n if (this.discard) await this.store.remove(batch.id);\n }\n\n /**\n * Reads this context's stored batches, oldest first.\n * @param limit Maximum number of batches to return.\n * @returns The batches in creation order. They are not removed.\n */\n async take(limit: number): Promise<LogBatch[]> {\n // Read only this context's slice. A full read on every retry pass would parse all contexts.\n if (!this.isolated()) {\n return (await this.store.take(limit)).filter((batch) => this.accepts(batch));\n }\n\n if (this.store.takeContext) {\n return this.store.takeContext(this.policy.id, limit);\n }\n\n const all = await this.store.take(0xffffffff);\n return all.filter((batch) => this.accepts(batch)).slice(0, limit);\n }\n\n /**\n * Checks whether reads are limited to the active context.\n * @returns True if isolation is on and the context has an id.\n */\n private isolated(): boolean {\n return this.policy.isolation && this.policy.id !== \"\";\n }\n\n /**\n * Removes one stored batch.\n * @param id Batch id.\n * @returns A promise that resolves once the batch is removed.\n */\n remove(id: string): Promise<void> {\n return this.store.remove(id);\n }\n\n /**\n * Updates a stored batch's attempt count.\n * @param id Batch id.\n * @param attempts The total attempt count to store.\n * @returns A promise that resolves once the change is saved.\n */\n bumpAttempts(id: string, attempts: number): Promise<void> {\n return this.store.bumpAttempts(id, attempts);\n }\n\n /**\n * Applies the underlying store's retention and capacity limits.\n * @returns A summary of the batches and records it removed.\n */\n prune(): ReturnType<StorageAdapter[\"prune\"]> {\n return this.store.prune();\n }\n\n /**\n * Counts this context's stored batches.\n * @returns The number of batches in this context.\n */\n async count(): Promise<number> {\n if (!this.isolated()) {\n return this.store.count();\n }\n\n if (this.store.countContext) {\n return this.store.countContext(this.policy.id);\n }\n\n return (await this.take(Number.MAX_SAFE_INTEGER)).length;\n }\n\n /**\n * Removes this context's stored batches.\n * @returns A promise that resolves once they are removed.\n */\n async clear(): Promise<void> {\n for (const batch of await this.take(Number.MAX_SAFE_INTEGER)) await this.store.remove(batch.id);\n }\n\n /**\n * Stops new writes and, if asked, clears this context. The memory store is left open for\n * other contexts.\n * @param discard True to remove this context's batches before closing the store.\n * @returns A promise that resolves once the removal and the close are done.\n */\n async retire(discard: boolean): Promise<void> {\n this.active = false;\n this.discard = discard;\n if (discard) await this.clear();\n // Keep the memory store around for later context changes. It may hold other contexts' records.\n if (this.name !== \"memory\") await this.close();\n }\n\n /**\n * Removes every batch in the application namespace.\n * @returns A promise that resolves once they are removed.\n */\n clearNamespace(): Promise<void> {\n return this.store.clear();\n }\n\n /**\n * Closes the underlying store.\n * @returns A promise that resolves once it is closed.\n */\n close(): Promise<void> {\n return this.store.close();\n }\n}\n"],"mappings":";AASA,IAAaA,IAAb,MAAsD;CAejC;CACA;CACR;CAfX;CAEA,SAAiB;CAEjB,UAAkB;CAQlB,YACE,GACA,GACA,IAAqB,IACrB;EACA,AAJiB,KAAA,QAAAC,GACA,KAAA,SAAAC,GACR,KAAA,YAAAC,GAET,KAAK,OAAOF,EAAM;CACpB;CAOA,QAAQ,GAA0B;EAChC,QACGG,EAAM,wBAAwB,QAAQ,KAAK,cAC3C,CAAC,KAAK,OAAO,aAAa,CAAC,KAAK,OAAO,MAAMA,EAAM,qBAAqB,KAAK,OAAO;CAEzF;CAOA,MAAM,KAAK,GAAgC;EACzC,AAAK,KAAK,UAAW,KAAK,QAAQA,CAAK,MACvC,MAAM,KAAK,MAAM,KAAKA,CAAK,GAEvB,KAAK,WAAS,MAAM,KAAK,MAAM,OAAOA,EAAM,EAAE;CACpD;CAOA,MAAM,KAAK,GAAoC;EAW7C,OATK,KAAK,SAAS,IAIf,KAAK,MAAM,cACN,KAAK,MAAM,YAAY,KAAK,OAAO,IAAIC,CAAK,KAI9C,MADW,KAAK,MAAM,KAAK,UAAU,EAAA,CACjC,QAAQ,MAAU,KAAK,QAAQD,CAAK,CAAC,CAAC,CAAC,MAAM,GAAGC,CAAK,KARtD,MAAM,KAAK,MAAM,KAAKA,CAAK,EAAA,CAAG,QAAQ,MAAU,KAAK,QAAQD,CAAK,CAAC;CAS/E;CAMA,WAA4B;EAC1B,OAAO,KAAK,OAAO,aAAa,KAAK,OAAO,OAAO;CACrD;CAOA,OAAO,GAA2B;EAChC,OAAO,KAAK,MAAM,OAAOE,CAAE;CAC7B;CAQA,aAAa,GAAY,GAAiC;EACxD,OAAO,KAAK,MAAM,aAAaA,GAAIC,CAAQ;CAC7C;CAMA,QAA6C;EAC3C,OAAO,KAAK,MAAM,MAAM;CAC1B;CAMA,MAAM,QAAyB;EAS7B,OARK,KAAK,SAAS,IAIf,KAAK,MAAM,eACN,KAAK,MAAM,aAAa,KAAK,OAAO,EAAE,KAGvC,MAAM,KAAK,gBAA4B,EAAA,CAAG,SAPzC,KAAK,MAAM,MAAM;CAQ5B;CAMA,MAAM,QAAuB;EAC3B,KAAK,IAAMH,KAAS,MAAM,KAAK,gBAA4B,GAAG,MAAM,KAAK,MAAM,OAAOA,EAAM,EAAE;CAChG;CAQA,MAAM,OAAO,GAAiC;EAK5C,AAJA,KAAK,SAAS,IACd,KAAK,UAAUI,GACXA,KAAS,MAAM,KAAK,MAAM,GAE1B,KAAK,SAAS,YAAU,MAAM,KAAK,MAAM;CAC/C;CAMA,iBAAgC;EAC9B,OAAO,KAAK,MAAM,MAAM;CAC1B;CAMA,QAAuB;EACrB,OAAO,KAAK,MAAM,MAAM;CAC1B;AACF"}