@utk09/ui-observability 0.12.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 (515) hide show
  1. package/CHANGELOG.md +420 -0
  2. package/README.md +72 -839
  3. package/dist/{batch-BjQUwjA6.js → batch-CXmPmTse.js} +4 -4
  4. package/dist/{batch-BjQUwjA6.js.map → batch-CXmPmTse.js.map} +1 -1
  5. package/dist/{batch-D5LlU4Q9.cjs → batch-mmPigCpi.cjs} +2 -2
  6. package/dist/{batch-D5LlU4Q9.cjs.map → batch-mmPigCpi.cjs.map} +1 -1
  7. package/dist/bus/bus.d.cts +331 -0
  8. package/dist/bus/bus.d.ts +60 -10
  9. package/dist/bus/links.d.cts +132 -0
  10. package/dist/bus/links.d.ts +18 -3
  11. package/dist/bus/validation.d.cts +16 -0
  12. package/dist/bus/validation.d.ts +10 -1
  13. package/dist/{bus-ecxUNTja.js → bus-C39wspFV.js} +308 -193
  14. package/dist/bus-C39wspFV.js.map +1 -0
  15. package/dist/bus-_EaOVPGq.cjs +2 -0
  16. package/dist/bus-_EaOVPGq.cjs.map +1 -0
  17. package/dist/capture/console.d.cts +37 -0
  18. package/dist/capture/console.d.ts +1 -1
  19. package/dist/capture/errors.d.cts +32 -0
  20. package/dist/capture/errors.d.ts +1 -1
  21. package/dist/capture/interactions.d.cts +48 -0
  22. package/dist/capture/interactions.d.ts +1 -1
  23. package/dist/capture/lifecycle.d.cts +20 -0
  24. package/dist/capture/lifecycle.d.ts +1 -1
  25. package/dist/capture/long-frames.d.cts +31 -0
  26. package/dist/capture/long-frames.d.ts +1 -1
  27. package/dist/capture/network.d.cts +57 -0
  28. package/dist/capture/network.d.ts +1 -1
  29. package/dist/capture/profiler-frames.d.cts +44 -0
  30. package/dist/capture/profiler-frames.d.ts +1 -1
  31. package/dist/capture/replay-buffer.d.cts +45 -0
  32. package/dist/capture/replay-buffer.d.ts +9 -10
  33. package/dist/capture/replay-upload.d.cts +79 -0
  34. package/dist/capture/replay-upload.d.ts +7 -2
  35. package/dist/capture/replay.d.cts +114 -0
  36. package/dist/capture/replay.d.ts +1 -1
  37. package/dist/capture/reports.d.cts +17 -0
  38. package/dist/capture/reports.d.ts +1 -1
  39. package/dist/capture/resource-timing.d.cts +14 -0
  40. package/dist/capture/resource-timing.d.ts +1 -1
  41. package/dist/capture/server-timing.d.cts +19 -0
  42. package/dist/capture/storm.d.cts +13 -0
  43. package/dist/capture/storm.d.ts +5 -5
  44. package/dist/capture/types.d.cts +128 -0
  45. package/dist/capture/types.d.ts +10 -9
  46. package/dist/capture/unclean-exit.d.cts +31 -0
  47. package/dist/capture/unclean-exit.d.ts +1 -1
  48. package/dist/capture/user-timing.d.cts +22 -0
  49. package/dist/capture/user-timing.d.ts +2 -2
  50. package/dist/capture/web-socket.d.cts +40 -0
  51. package/dist/capture/web-socket.d.ts +3 -3
  52. package/dist/capture/web-vitals.d.cts +40 -0
  53. package/dist/capture/web-vitals.d.ts +1 -1
  54. package/dist/{compression-lD9abCcO.cjs → compression-CvED_Jel.cjs} +2 -2
  55. package/dist/{compression-lD9abCcO.cjs.map → compression-CvED_Jel.cjs.map} +1 -1
  56. package/dist/{compression-AJJCMBOa.js → compression-tVtXwVjX.js} +2 -2
  57. package/dist/{compression-AJJCMBOa.js.map → compression-tVtXwVjX.js.map} +1 -1
  58. package/dist/config-DUs7uHHt.cjs +2 -0
  59. package/dist/config-DUs7uHHt.cjs.map +1 -0
  60. package/dist/config-SgQcCP1_.js +560 -0
  61. package/dist/config-SgQcCP1_.js.map +1 -0
  62. package/dist/console-BGgGnjSi.js +81 -0
  63. package/dist/console-BGgGnjSi.js.map +1 -0
  64. package/dist/console-CSZ5_Vx5.cjs +2 -0
  65. package/dist/console-CSZ5_Vx5.cjs.map +1 -0
  66. package/dist/constants-CUyd9cTZ.js +357 -0
  67. package/dist/constants-CUyd9cTZ.js.map +1 -0
  68. package/dist/constants-CqdJhTxH.cjs +2 -0
  69. package/dist/constants-CqdJhTxH.cjs.map +1 -0
  70. package/dist/constants.d.cts +751 -0
  71. package/dist/constants.d.ts +88 -20
  72. package/dist/core/breadcrumbs.d.cts +54 -0
  73. package/dist/core/breadcrumbs.d.ts +5 -0
  74. package/dist/core/config.d.cts +45 -0
  75. package/dist/core/config.d.ts +30 -2
  76. package/dist/core/context.d.cts +24 -0
  77. package/dist/core/context.d.ts +3 -8
  78. package/dist/core/debug-buffer.d.cts +34 -0
  79. package/dist/core/debug-buffer.d.ts +3 -3
  80. package/dist/core/debug-bundle.d.cts +12 -0
  81. package/dist/core/debug-bundle.d.ts +3 -3
  82. package/dist/core/deferred.d.cts +7 -0
  83. package/dist/core/deferred.d.ts +2 -2
  84. package/dist/core/diagnostics.d.cts +86 -0
  85. package/dist/core/diagnostics.d.ts +1 -1
  86. package/dist/core/drops.d.cts +39 -0
  87. package/dist/core/drops.d.ts +16 -6
  88. package/dist/core/hold-buffer.d.cts +36 -0
  89. package/dist/core/hold-buffer.d.ts +16 -7
  90. package/dist/core/journey.d.cts +148 -0
  91. package/dist/core/journey.d.ts +7 -7
  92. package/dist/core/logger.d.cts +141 -0
  93. package/dist/core/logger.d.ts +23 -30
  94. package/dist/core/measure.d.cts +30 -0
  95. package/dist/core/measure.d.ts +14 -3
  96. package/dist/core/meter.d.cts +78 -0
  97. package/dist/core/meter.d.ts +14 -8
  98. package/dist/core/pipeline.d.cts +227 -0
  99. package/dist/core/pipeline.d.ts +73 -10
  100. package/dist/core/profile-buckets.d.cts +31 -0
  101. package/dist/core/profiler.d.cts +218 -0
  102. package/dist/core/profiler.d.ts +2 -2
  103. package/dist/core/record.d.cts +190 -0
  104. package/dist/core/record.d.ts +44 -12
  105. package/dist/core/remote-rules.d.cts +17 -0
  106. package/dist/core/remote-rules.d.ts +3 -3
  107. package/dist/core/remote-sampling.d.cts +74 -0
  108. package/dist/core/remote-sampling.d.ts +3 -3
  109. package/dist/core/rotation.d.cts +75 -0
  110. package/dist/core/rotation.d.ts +75 -0
  111. package/dist/core/runtime.d.cts +765 -0
  112. package/dist/core/runtime.d.ts +245 -70
  113. package/dist/core/sampling.d.cts +86 -0
  114. package/dist/core/sampling.d.ts +5 -5
  115. package/dist/core/sender.d.cts +161 -0
  116. package/dist/core/sender.d.ts +59 -15
  117. package/dist/core/spans.d.cts +39 -0
  118. package/dist/core/spans.d.ts +1 -1
  119. package/dist/debug-bundle-BXIlwDKM.cjs +2 -0
  120. package/dist/debug-bundle-BXIlwDKM.cjs.map +1 -0
  121. package/dist/debug-bundle-CRpYV_ui.js +35 -0
  122. package/dist/debug-bundle-CRpYV_ui.js.map +1 -0
  123. package/dist/defineProperty-X1c4tIPD.cjs +1 -0
  124. package/dist/defineProperty-s2S8BXUc.js +35 -0
  125. package/dist/doctor.cjs +1 -1
  126. package/dist/doctor.cjs.map +1 -1
  127. package/dist/doctor.d.cts +36 -0
  128. package/dist/doctor.d.ts +5 -2
  129. package/dist/doctor.js +121 -89
  130. package/dist/doctor.js.map +1 -1
  131. package/dist/errors-BE_EZV7Q.js +86 -0
  132. package/dist/errors-BE_EZV7Q.js.map +1 -0
  133. package/dist/errors-CNPbesMs.cjs +3 -0
  134. package/dist/errors-CNPbesMs.cjs.map +1 -0
  135. package/dist/factory-CTi0Is3F.js +404 -0
  136. package/dist/factory-CTi0Is3F.js.map +1 -0
  137. package/dist/factory-hRrH32v5.cjs +2 -0
  138. package/dist/factory-hRrH32v5.cjs.map +1 -0
  139. package/dist/guards-BlYGRK4l.js +10 -0
  140. package/dist/guards-BlYGRK4l.js.map +1 -0
  141. package/dist/guards-EjG3ahFp.cjs +2 -0
  142. package/dist/guards-EjG3ahFp.cjs.map +1 -0
  143. package/dist/{identity-BrQp_5J5.js → identity-DdhKgrpk.js} +20 -24
  144. package/dist/identity-DdhKgrpk.js.map +1 -0
  145. package/dist/identity-DlWRIuwy.cjs +2 -0
  146. package/dist/identity-DlWRIuwy.cjs.map +1 -0
  147. package/dist/index.cjs +1 -1
  148. package/dist/index.cjs.map +1 -1
  149. package/dist/index.d.cts +300 -0
  150. package/dist/index.d.ts +89 -98
  151. package/dist/index.js +1173 -1506
  152. package/dist/index.js.map +1 -1
  153. package/dist/indexeddb-storage-CL9uqBCy.cjs +2 -0
  154. package/dist/indexeddb-storage-CL9uqBCy.cjs.map +1 -0
  155. package/dist/{indexeddb-storage-DLXQzAGh.js → indexeddb-storage-GHdl0t8A.js} +51 -47
  156. package/dist/indexeddb-storage-GHdl0t8A.js.map +1 -0
  157. package/dist/interactions-CUkzK8sR.cjs +2 -0
  158. package/dist/interactions-CUkzK8sR.cjs.map +1 -0
  159. package/dist/{interactions-B6z2I4tU.js → interactions-DiFvCosX.js} +41 -49
  160. package/dist/interactions-DiFvCosX.js.map +1 -0
  161. package/dist/journey-B4Adltjm.cjs +2 -0
  162. package/dist/journey-B4Adltjm.cjs.map +1 -0
  163. package/dist/{journey-35yCMNFo.js → journey-D2_sia57.js} +45 -48
  164. package/dist/journey-D2_sia57.js.map +1 -0
  165. package/dist/{library-console-Dl_Ly6DQ.js → library-console-Btrzt814.js} +2 -2
  166. package/dist/{library-console-Dl_Ly6DQ.js.map → library-console-Btrzt814.js.map} +1 -1
  167. package/dist/{library-console-BFWEuQsl.cjs → library-console-CPW6bvZH.cjs} +2 -2
  168. package/dist/{library-console-BFWEuQsl.cjs.map → library-console-CPW6bvZH.cjs.map} +1 -1
  169. package/dist/{library-request-nI6pvI6I.js → library-request-BJ9PLRaD.js} +2 -2
  170. package/dist/{library-request-nI6pvI6I.js.map → library-request-BJ9PLRaD.js.map} +1 -1
  171. package/dist/{library-request-Da-CHKzT.cjs → library-request-D7OvTxZV.cjs} +2 -2
  172. package/dist/{library-request-Da-CHKzT.cjs.map → library-request-D7OvTxZV.cjs.map} +1 -1
  173. package/dist/{lifecycle-CZ6RRXc6.js → lifecycle-22CUCrc9.js} +21 -29
  174. package/dist/lifecycle-22CUCrc9.js.map +1 -0
  175. package/dist/lifecycle-IaAm1mOC.cjs +2 -0
  176. package/dist/lifecycle-IaAm1mOC.cjs.map +1 -0
  177. package/dist/{log-record-DIA6McNr.js → log-record-BNiLfqtL.js} +8 -7
  178. package/dist/log-record-BNiLfqtL.js.map +1 -0
  179. package/dist/log-record-CkivuiEl.cjs +2 -0
  180. package/dist/log-record-CkivuiEl.cjs.map +1 -0
  181. package/dist/long-frames-BUUbXd-B.cjs +2 -0
  182. package/dist/long-frames-BUUbXd-B.cjs.map +1 -0
  183. package/dist/{long-frames-430_85Da.js → long-frames-DNFaRnC3.js} +18 -22
  184. package/dist/long-frames-DNFaRnC3.js.map +1 -0
  185. package/dist/models/batch.d.cts +57 -0
  186. package/dist/models/batch.d.ts +2 -2
  187. package/dist/models/bus.d.cts +158 -0
  188. package/dist/models/bus.d.ts +22 -2
  189. package/dist/models/config.d.cts +1540 -0
  190. package/dist/models/config.d.ts +360 -259
  191. package/dist/models/drop.d.cts +54 -0
  192. package/dist/models/drop.d.ts +16 -3
  193. package/dist/models/health.d.cts +148 -0
  194. package/dist/models/health.d.ts +108 -12
  195. package/dist/models/log-record.d.cts +61 -0
  196. package/dist/models/metric.d.cts +139 -0
  197. package/dist/models/metric.d.ts +13 -2
  198. package/dist/models/plugin.d.cts +47 -0
  199. package/dist/models/plugin.d.ts +3 -3
  200. package/dist/models/replay.d.cts +60 -0
  201. package/dist/models/serializer.d.cts +23 -0
  202. package/dist/models/serializer.d.ts +1 -1
  203. package/dist/models/storage.d.cts +95 -0
  204. package/dist/models/storage.d.ts +7 -5
  205. package/dist/network-CGMLQ-mA.cjs +2 -0
  206. package/dist/network-CGMLQ-mA.cjs.map +1 -0
  207. package/dist/{network-C7SkLf4v.js → network-on2zZT6H.js} +51 -51
  208. package/dist/network-on2zZT6H.js.map +1 -0
  209. package/dist/{otlp-2MCrC3kd.cjs → otlp-BENHf3g9.cjs} +2 -2
  210. package/dist/{otlp-2MCrC3kd.cjs.map → otlp-BENHf3g9.cjs.map} +1 -1
  211. package/dist/{otlp-COq033e3.js → otlp-DimfrRor.js} +12 -12
  212. package/dist/{otlp-COq033e3.js.map → otlp-DimfrRor.js.map} +1 -1
  213. package/dist/{platform-CVewe4wQ.js → platform-BaaFIPCU.js} +10 -10
  214. package/dist/{platform-CVewe4wQ.js.map → platform-BaaFIPCU.js.map} +1 -1
  215. package/dist/{platform-12uR7kBQ.cjs → platform-CfA3-7sJ.cjs} +2 -2
  216. package/dist/{platform-12uR7kBQ.cjs.map → platform-CfA3-7sJ.cjs.map} +1 -1
  217. package/dist/{profiler-BVWIOgnq.js → profiler-BAZoh7A4.js} +89 -107
  218. package/dist/profiler-BAZoh7A4.js.map +1 -0
  219. package/dist/profiler-D4tJpDRc.cjs +2 -0
  220. package/dist/profiler-D4tJpDRc.cjs.map +1 -0
  221. package/dist/profiler-frames-C4xr7KfH.cjs +2 -0
  222. package/dist/profiler-frames-C4xr7KfH.cjs.map +1 -0
  223. package/dist/{profiler-frames-CLXlT_xL.js → profiler-frames-cJMx9wNM.js} +29 -37
  224. package/dist/profiler-frames-cJMx9wNM.js.map +1 -0
  225. package/dist/remote-rules-Dz9MRAsB.js +95 -0
  226. package/dist/remote-rules-Dz9MRAsB.js.map +1 -0
  227. package/dist/remote-rules-_tY0zj5o.cjs +2 -0
  228. package/dist/remote-rules-_tY0zj5o.cjs.map +1 -0
  229. package/dist/replay-B3gFXIZd.cjs +2 -0
  230. package/dist/replay-B3gFXIZd.cjs.map +1 -0
  231. package/dist/replay-Ds-ANH34.js +310 -0
  232. package/dist/replay-Ds-ANH34.js.map +1 -0
  233. package/dist/reports-BDSe4dFH.cjs +2 -0
  234. package/dist/reports-BDSe4dFH.cjs.map +1 -0
  235. package/dist/{reports-BuXekPOS.js → reports-C-thq-bk.js} +25 -30
  236. package/dist/reports-C-thq-bk.js.map +1 -0
  237. package/dist/resource-timing-C576gFIQ.cjs +2 -0
  238. package/dist/resource-timing-C576gFIQ.cjs.map +1 -0
  239. package/dist/{resource-timing-CXGHwFRD.js → resource-timing-eUl2dNgC.js} +20 -23
  240. package/dist/resource-timing-eUl2dNgC.js.map +1 -0
  241. package/dist/response-body-YdNl-HkR.cjs +3 -0
  242. package/dist/response-body-YdNl-HkR.cjs.map +1 -0
  243. package/dist/response-body-eoSQpLiH.js +331 -0
  244. package/dist/response-body-eoSQpLiH.js.map +1 -0
  245. package/dist/rotation-Cwct4ckk.js +94 -0
  246. package/dist/rotation-Cwct4ckk.js.map +1 -0
  247. package/dist/rotation-D4qUAHAu.cjs +2 -0
  248. package/dist/rotation-D4qUAHAu.cjs.map +1 -0
  249. package/dist/sampling-BlrI8jor.js +63 -0
  250. package/dist/sampling-BlrI8jor.js.map +1 -0
  251. package/dist/sampling-mXt4dstx.cjs +2 -0
  252. package/dist/sampling-mXt4dstx.cjs.map +1 -0
  253. package/dist/{sanitize-CNmsD9r3.js → sanitize-Ba0KqU06.js} +2 -2
  254. package/dist/sanitize-Ba0KqU06.js.map +1 -0
  255. package/dist/{sanitize-ChLn97Ch.cjs → sanitize-DQyiI_KY.cjs} +2 -2
  256. package/dist/sanitize-DQyiI_KY.cjs.map +1 -0
  257. package/dist/sender-BdRuNVhF.cjs +2 -0
  258. package/dist/sender-BdRuNVhF.cjs.map +1 -0
  259. package/dist/sender-Dv8rAmpV.js +979 -0
  260. package/dist/sender-Dv8rAmpV.js.map +1 -0
  261. package/dist/storage/context-storage.d.cts +90 -0
  262. package/dist/storage/context-storage.d.ts +5 -5
  263. package/dist/storage/emergency-queue.d.cts +27 -0
  264. package/dist/storage/emergency-queue.d.ts +4 -4
  265. package/dist/storage/eviction.d.cts +40 -0
  266. package/dist/storage/eviction.d.ts +1 -1
  267. package/dist/storage/factory.d.cts +21 -0
  268. package/dist/storage/factory.d.ts +3 -3
  269. package/dist/storage/gap.d.cts +20 -0
  270. package/dist/storage/gap.d.ts +3 -3
  271. package/dist/storage/idb-driver.d.cts +93 -0
  272. package/dist/storage/idb-driver.d.ts +1 -1
  273. package/dist/storage/indexeddb-storage.d.cts +97 -0
  274. package/dist/storage/indexeddb-storage.d.ts +12 -4
  275. package/dist/storage/keys.d.cts +17 -0
  276. package/dist/storage/keys.d.ts +2 -2
  277. package/dist/storage/local-storage.d.cts +139 -0
  278. package/dist/storage/local-storage.d.ts +11 -4
  279. package/dist/storage/memory-storage.d.cts +73 -0
  280. package/dist/storage/memory-storage.d.ts +4 -3
  281. package/dist/storage/persistence.d.cts +8 -0
  282. package/dist/storage/persistence.d.ts +2 -2
  283. package/dist/storage/stored-context.d.cts +34 -0
  284. package/dist/storage/stored-context.d.ts +34 -0
  285. package/dist/stored-context-B2EzVuYm.js +51 -0
  286. package/dist/stored-context-B2EzVuYm.js.map +1 -0
  287. package/dist/stored-context-CXt7eHZL.cjs +2 -0
  288. package/dist/stored-context-CXt7eHZL.cjs.map +1 -0
  289. package/dist/storm-C-zYSdDX.cjs +2 -0
  290. package/dist/storm-C-zYSdDX.cjs.map +1 -0
  291. package/dist/storm-DjKetLKZ.js +9 -0
  292. package/dist/storm-DjKetLKZ.js.map +1 -0
  293. package/dist/transport/compression.d.cts +7 -0
  294. package/dist/transport/custom-transport.d.cts +22 -0
  295. package/dist/transport/custom-transport.d.ts +6 -5
  296. package/dist/transport/errors.d.cts +31 -0
  297. package/dist/transport/exit-flush.d.cts +135 -0
  298. package/dist/transport/exit-flush.d.ts +30 -13
  299. package/dist/transport/headers.d.cts +8 -0
  300. package/dist/transport/headers.d.ts +2 -2
  301. package/dist/transport/http-transport.d.cts +116 -0
  302. package/dist/transport/http-transport.d.ts +20 -8
  303. package/dist/transport/memory-transport.d.cts +30 -0
  304. package/dist/transport/memory-transport.d.ts +2 -2
  305. package/dist/transport/response-body.d.cts +49 -0
  306. package/dist/transport/response-body.d.ts +49 -0
  307. package/dist/transport/retry-engine.d.cts +129 -0
  308. package/dist/transport/retry-engine.d.ts +27 -9
  309. package/dist/transport/serializers/ecs.d.cts +3 -0
  310. package/dist/transport/serializers/ecs.d.ts +1 -1
  311. package/dist/transport/serializers/otlp-metrics.d.cts +3 -0
  312. package/dist/transport/serializers/otlp-metrics.d.ts +1 -1
  313. package/dist/transport/serializers/otlp-traces.d.cts +3 -0
  314. package/dist/transport/serializers/otlp-traces.d.ts +1 -1
  315. package/dist/transport/serializers/otlp.d.cts +47 -0
  316. package/dist/transport/serializers/otlp.d.ts +2 -2
  317. package/dist/transport/serializers/select.d.cts +38 -0
  318. package/dist/transport/serializers/select.d.ts +5 -5
  319. package/dist/transport/status-transport.d.cts +129 -0
  320. package/dist/transport/status-transport.d.ts +25 -8
  321. package/dist/transport/worker-client.d.cts +23 -0
  322. package/dist/transport/worker-client.d.ts +12 -3
  323. package/dist/transport/worker-entry.d.cts +5 -0
  324. package/dist/transport/worker-entry.d.ts +1 -1
  325. package/dist/transport/worker-protocol.d.cts +38 -0
  326. package/dist/transport/worker-protocol.d.ts +4 -2
  327. package/dist/transport/worker-server.d.cts +3 -0
  328. package/dist/transport/worker-server.d.ts +1 -1
  329. package/dist/transport/worker-transport.d.cts +10 -0
  330. package/dist/transport/worker-transport.d.ts +5 -4
  331. package/dist/types-BAerHgCq.js.map +1 -1
  332. package/dist/types-C7WNpnG1.cjs.map +1 -1
  333. package/dist/{unclean-exit-Cob_jyTv.js → unclean-exit-DQD1cT7c.js} +23 -30
  334. package/dist/unclean-exit-DQD1cT7c.js.map +1 -0
  335. package/dist/unclean-exit-py99ApzT.cjs +2 -0
  336. package/dist/unclean-exit-py99ApzT.cjs.map +1 -0
  337. package/dist/{user-timing-DgHubxCI.js → user-timing-BePqb1uN.js} +15 -17
  338. package/dist/user-timing-BePqb1uN.js.map +1 -0
  339. package/dist/user-timing-D6XTmpuM.cjs +2 -0
  340. package/dist/user-timing-D6XTmpuM.cjs.map +1 -0
  341. package/dist/utils/console.d.cts +36 -0
  342. package/dist/utils/console.d.ts +4 -4
  343. package/dist/utils/deadline.d.cts +14 -0
  344. package/dist/utils/error-like.d.cts +25 -0
  345. package/dist/utils/fixed-window.d.cts +25 -0
  346. package/dist/utils/global-scope.d.cts +20 -0
  347. package/dist/utils/guards.d.cts +14 -0
  348. package/dist/utils/guards.d.ts +8 -0
  349. package/dist/utils/identity.d.cts +109 -0
  350. package/dist/utils/identity.d.ts +3 -4
  351. package/dist/utils/library-console.d.cts +11 -0
  352. package/dist/utils/library-request.d.cts +24 -0
  353. package/dist/utils/lock.d.cts +24 -0
  354. package/dist/utils/lock.d.ts +1 -1
  355. package/dist/utils/openfin.d.cts +48 -0
  356. package/dist/utils/patch.d.cts +9 -0
  357. package/dist/utils/platform.d.cts +62 -0
  358. package/dist/utils/platform.d.ts +2 -2
  359. package/dist/utils/sanitize.d.cts +52 -0
  360. package/dist/utils/sanitize.d.ts +1 -1
  361. package/dist/utils/sequence.d.cts +10 -0
  362. package/dist/utils/tracing.d.cts +158 -0
  363. package/dist/utils/tracing.d.ts +11 -4
  364. package/dist/utils/unref.d.cts +9 -0
  365. package/dist/web-socket-CoIUBM3C.cjs +2 -0
  366. package/dist/{web-socket-DthJuSAg.js.map → web-socket-CoIUBM3C.cjs.map} +1 -1
  367. package/dist/{web-socket-DthJuSAg.js → web-socket-DSHgDiZ6.js} +23 -28
  368. package/dist/web-socket-DSHgDiZ6.js.map +1 -0
  369. package/dist/{web-vitals-CsGCWnUr.js → web-vitals-4pWACwaR.js} +15 -21
  370. package/dist/web-vitals-4pWACwaR.js.map +1 -0
  371. package/dist/web-vitals-__X7t4pj.cjs +2 -0
  372. package/dist/web-vitals-__X7t4pj.cjs.map +1 -0
  373. package/dist/worker-protocol-QbvqNazn.cjs +2 -0
  374. package/dist/worker-protocol-QbvqNazn.cjs.map +1 -0
  375. package/dist/{worker-protocol-B0_8rWy5.js → worker-protocol-x074Rpet.js} +14 -11
  376. package/dist/worker-protocol-x074Rpet.js.map +1 -0
  377. package/dist/worker-server-CFe4nvos.cjs +2 -0
  378. package/dist/worker-server-CFe4nvos.cjs.map +1 -0
  379. package/dist/worker-server-iUVSjH8L.js +94 -0
  380. package/dist/worker-server-iUVSjH8L.js.map +1 -0
  381. package/dist/worker-transport-CRAX-09c.cjs +2 -0
  382. package/dist/worker-transport-CRAX-09c.cjs.map +1 -0
  383. package/dist/worker-transport-Dy1KMA7t.js +190 -0
  384. package/dist/worker-transport-Dy1KMA7t.js.map +1 -0
  385. package/llms.txt +397 -0
  386. package/package.json +54 -46
  387. package/dist/bus-D_7pd7RN.cjs +0 -2
  388. package/dist/bus-D_7pd7RN.cjs.map +0 -1
  389. package/dist/bus-ecxUNTja.js.map +0 -1
  390. package/dist/console-CLz_PvFn.cjs +0 -2
  391. package/dist/console-CLz_PvFn.cjs.map +0 -1
  392. package/dist/console-cwgHKXvM.js +0 -82
  393. package/dist/console-cwgHKXvM.js.map +0 -1
  394. package/dist/constants-Bwl_YtQi.js +0 -349
  395. package/dist/constants-Bwl_YtQi.js.map +0 -1
  396. package/dist/constants-DakMxVB2.cjs +0 -2
  397. package/dist/constants-DakMxVB2.cjs.map +0 -1
  398. package/dist/context-storage-BjzeBSxH.cjs +0 -2
  399. package/dist/context-storage-BjzeBSxH.cjs.map +0 -1
  400. package/dist/context-storage-BzkoHzkQ.js +0 -51
  401. package/dist/context-storage-BzkoHzkQ.js.map +0 -1
  402. package/dist/debug-bundle-BOdYmCeV.js +0 -32
  403. package/dist/debug-bundle-BOdYmCeV.js.map +0 -1
  404. package/dist/debug-bundle-Ex4L_LSP.cjs +0 -2
  405. package/dist/debug-bundle-Ex4L_LSP.cjs.map +0 -1
  406. package/dist/emergency-queue-B9WZxanZ.js +0 -67
  407. package/dist/emergency-queue-B9WZxanZ.js.map +0 -1
  408. package/dist/emergency-queue-HBpL5r3V.cjs +0 -2
  409. package/dist/emergency-queue-HBpL5r3V.cjs.map +0 -1
  410. package/dist/errors-D6bwgJtO.js +0 -92
  411. package/dist/errors-D6bwgJtO.js.map +0 -1
  412. package/dist/errors-DCOCRdSi.cjs +0 -3
  413. package/dist/errors-DCOCRdSi.cjs.map +0 -1
  414. package/dist/factory-DLFDjdLv.cjs +0 -2
  415. package/dist/factory-DLFDjdLv.cjs.map +0 -1
  416. package/dist/factory-e9Qo3K0z.js +0 -276
  417. package/dist/factory-e9Qo3K0z.js.map +0 -1
  418. package/dist/guards-Cidk71ME.js +0 -7
  419. package/dist/guards-Cidk71ME.js.map +0 -1
  420. package/dist/guards-nJ70syPt.cjs +0 -2
  421. package/dist/guards-nJ70syPt.cjs.map +0 -1
  422. package/dist/identity-BlvlgjrU.cjs +0 -2
  423. package/dist/identity-BlvlgjrU.cjs.map +0 -1
  424. package/dist/identity-BrQp_5J5.js.map +0 -1
  425. package/dist/indexeddb-storage-CtLvZH1r.cjs +0 -2
  426. package/dist/indexeddb-storage-CtLvZH1r.cjs.map +0 -1
  427. package/dist/indexeddb-storage-DLXQzAGh.js.map +0 -1
  428. package/dist/interactions-B6z2I4tU.js.map +0 -1
  429. package/dist/interactions-P6pz08Jn.cjs +0 -2
  430. package/dist/interactions-P6pz08Jn.cjs.map +0 -1
  431. package/dist/journey-35yCMNFo.js.map +0 -1
  432. package/dist/journey-DAGh5h9k.cjs +0 -2
  433. package/dist/journey-DAGh5h9k.cjs.map +0 -1
  434. package/dist/keys-BHhw_0Wh.cjs +0 -2
  435. package/dist/keys-BHhw_0Wh.cjs.map +0 -1
  436. package/dist/keys-BU9j5YqW.js +0 -16
  437. package/dist/keys-BU9j5YqW.js.map +0 -1
  438. package/dist/lifecycle-BGGOcN4N.cjs +0 -2
  439. package/dist/lifecycle-BGGOcN4N.cjs.map +0 -1
  440. package/dist/lifecycle-CZ6RRXc6.js.map +0 -1
  441. package/dist/log-record-D7bA1RPb.cjs +0 -2
  442. package/dist/log-record-D7bA1RPb.cjs.map +0 -1
  443. package/dist/log-record-DIA6McNr.js.map +0 -1
  444. package/dist/long-frames-430_85Da.js.map +0 -1
  445. package/dist/long-frames-Dd8tsi2U.cjs +0 -2
  446. package/dist/long-frames-Dd8tsi2U.cjs.map +0 -1
  447. package/dist/models/stats.d.ts +0 -11
  448. package/dist/network-C7SkLf4v.js.map +0 -1
  449. package/dist/network-pEX3PAJv.cjs +0 -2
  450. package/dist/network-pEX3PAJv.cjs.map +0 -1
  451. package/dist/profiler-BVWIOgnq.js.map +0 -1
  452. package/dist/profiler-eVCknCzS.cjs +0 -2
  453. package/dist/profiler-eVCknCzS.cjs.map +0 -1
  454. package/dist/profiler-frames-CLXlT_xL.js.map +0 -1
  455. package/dist/profiler-frames-Dg2OebB2.cjs +0 -2
  456. package/dist/profiler-frames-Dg2OebB2.cjs.map +0 -1
  457. package/dist/remote-rules-BJGDJGwA.js +0 -98
  458. package/dist/remote-rules-BJGDJGwA.js.map +0 -1
  459. package/dist/remote-rules-CJD3ToVk.cjs +0 -2
  460. package/dist/remote-rules-CJD3ToVk.cjs.map +0 -1
  461. package/dist/replay-0zAJv9T3.js +0 -338
  462. package/dist/replay-0zAJv9T3.js.map +0 -1
  463. package/dist/replay-DomJpXqW.cjs +0 -2
  464. package/dist/replay-DomJpXqW.cjs.map +0 -1
  465. package/dist/reports-BsbqmP8h.cjs +0 -2
  466. package/dist/reports-BsbqmP8h.cjs.map +0 -1
  467. package/dist/reports-BuXekPOS.js.map +0 -1
  468. package/dist/resource-timing-CXGHwFRD.js.map +0 -1
  469. package/dist/resource-timing-DkycFGDa.cjs +0 -2
  470. package/dist/resource-timing-DkycFGDa.cjs.map +0 -1
  471. package/dist/sampling-Dd0wllyq.cjs +0 -2
  472. package/dist/sampling-Dd0wllyq.cjs.map +0 -1
  473. package/dist/sampling-UUDbi3K0.js +0 -60
  474. package/dist/sampling-UUDbi3K0.js.map +0 -1
  475. package/dist/sanitize-CNmsD9r3.js.map +0 -1
  476. package/dist/sanitize-ChLn97Ch.cjs.map +0 -1
  477. package/dist/select-CTk-K5mG.cjs +0 -3
  478. package/dist/select-CTk-K5mG.cjs.map +0 -1
  479. package/dist/select-DPv_j6wq.js +0 -270
  480. package/dist/select-DPv_j6wq.js.map +0 -1
  481. package/dist/sender-15zEsZpr.js +0 -857
  482. package/dist/sender-15zEsZpr.js.map +0 -1
  483. package/dist/sender-Bfpv9tad.cjs +0 -2
  484. package/dist/sender-Bfpv9tad.cjs.map +0 -1
  485. package/dist/storage-BA9RqRO-.cjs +0 -2
  486. package/dist/storage-BA9RqRO-.cjs.map +0 -1
  487. package/dist/storage-DZwed89z.js +0 -16
  488. package/dist/storage-DZwed89z.js.map +0 -1
  489. package/dist/storm-BTSNTIWI.js +0 -9
  490. package/dist/storm-BTSNTIWI.js.map +0 -1
  491. package/dist/storm-D0_qZOEg.cjs +0 -2
  492. package/dist/storm-D0_qZOEg.cjs.map +0 -1
  493. package/dist/unclean-exit-ClGzrc2A.cjs +0 -2
  494. package/dist/unclean-exit-ClGzrc2A.cjs.map +0 -1
  495. package/dist/unclean-exit-Cob_jyTv.js.map +0 -1
  496. package/dist/user-timing-CdYqx3PF.cjs +0 -2
  497. package/dist/user-timing-CdYqx3PF.cjs.map +0 -1
  498. package/dist/user-timing-DgHubxCI.js.map +0 -1
  499. package/dist/utils/timer.d.ts +0 -19
  500. package/dist/web-socket-BTuvYoJI.cjs +0 -2
  501. package/dist/web-socket-BTuvYoJI.cjs.map +0 -1
  502. package/dist/web-vitals-Ch5BpDmo.cjs +0 -2
  503. package/dist/web-vitals-Ch5BpDmo.cjs.map +0 -1
  504. package/dist/web-vitals-CsGCWnUr.js.map +0 -1
  505. package/dist/worker-protocol-B0_8rWy5.js.map +0 -1
  506. package/dist/worker-protocol-BjzFORfq.cjs +0 -2
  507. package/dist/worker-protocol-BjzFORfq.cjs.map +0 -1
  508. package/dist/worker-server-4en-Lt-3.cjs +0 -2
  509. package/dist/worker-server-4en-Lt-3.cjs.map +0 -1
  510. package/dist/worker-server-Cne9MX9I.js +0 -83
  511. package/dist/worker-server-Cne9MX9I.js.map +0 -1
  512. package/dist/worker-transport-B-GF4Aqn.cjs +0 -2
  513. package/dist/worker-transport-B-GF4Aqn.cjs.map +0 -1
  514. package/dist/worker-transport-C3SjJAEC.js +0 -200
  515. package/dist/worker-transport-C3SjJAEC.js.map +0 -1
@@ -0,0 +1,39 @@
1
+ import type { ResolvedConfig } from "../models/config.cjs";
2
+ import type { LossReason } from "../models/drop.cjs";
3
+ import type { LogRecord } from "../models/log-record.cjs";
4
+ import type { Diagnostics } from "./diagnostics.cjs";
5
+ /** Collects lost records and hands the onDrop hook one summary per reason. */
6
+ export declare class DropReporter {
7
+ private readonly config;
8
+ private readonly diagnostics;
9
+ /** Summaries waiting for the end of the task, one per reason. */
10
+ private readonly pending;
11
+ /** True while a microtask is waiting to send the summaries. */
12
+ private scheduled;
13
+ /** True while the hook runs. A loss the hook itself causes isn't reported again. */
14
+ private reporting;
15
+ /** Lost records since the start, per reason. getHealth() reports them. */
16
+ private readonly lost;
17
+ /**
18
+ * @param config Active configuration. `onDrop` is read from it on every call.
19
+ * @param diagnostics Diagnostics reporter.
20
+ */
21
+ constructor(config: ResolvedConfig, diagnostics: Diagnostics);
22
+ /**
23
+ * Counts lost records, and adds them to the summary for their reason. The summary needs an
24
+ * onDrop hook.
25
+ * @param reason Cause of the loss.
26
+ * @param records Lost records.
27
+ * @param batchIds Ids of the lost batches.
28
+ * @param count Number of lost records when the caller can't name them, for example after an
29
+ * OTLP partial rejection. Defaults to the length of `records`.
30
+ */
31
+ add(reason: LossReason, records: readonly LogRecord[], batchIds?: readonly string[], count?: number): void;
32
+ /**
33
+ * Returns the lost record counts since the start.
34
+ * @returns A copy of the count for each reason. A reason with no loss has no key.
35
+ */
36
+ counts(): Partial<Record<LossReason, number>>;
37
+ /** Hands every waiting summary to the hook. A hook that throws doesn't stop the others. */
38
+ private flush;
39
+ }
@@ -1,7 +1,7 @@
1
- import type { ResolvedConfig } from "../models/config";
2
- import type { LossReason } from "../models/drop";
3
- import type { LogRecord } from "../models/log-record";
4
- import type { Diagnostics } from "./diagnostics";
1
+ import type { ResolvedConfig } from "../models/config.js";
2
+ import type { LossReason } from "../models/drop.js";
3
+ import type { LogRecord } from "../models/log-record.js";
4
+ import type { Diagnostics } from "./diagnostics.js";
5
5
  /** Collects lost records and hands the onDrop hook one summary per reason. */
6
6
  export declare class DropReporter {
7
7
  private readonly config;
@@ -12,18 +12,28 @@ export declare class DropReporter {
12
12
  private scheduled;
13
13
  /** True while the hook runs. A loss the hook itself causes isn't reported again. */
14
14
  private reporting;
15
+ /** Lost records since the start, per reason. getHealth() reports them. */
16
+ private readonly lost;
15
17
  /**
16
18
  * @param config Active configuration. `onDrop` is read from it on every call.
17
19
  * @param diagnostics Diagnostics reporter.
18
20
  */
19
21
  constructor(config: ResolvedConfig, diagnostics: Diagnostics);
20
22
  /**
21
- * Adds lost records to the summary for their reason. Does nothing without an onDrop hook.
23
+ * Counts lost records, and adds them to the summary for their reason. The summary needs an
24
+ * onDrop hook.
22
25
  * @param reason Cause of the loss.
23
26
  * @param records Lost records.
24
27
  * @param batchIds Ids of the lost batches.
28
+ * @param count Number of lost records when the caller can't name them, for example after an
29
+ * OTLP partial rejection. Defaults to the length of `records`.
25
30
  */
26
- add(reason: LossReason, records: readonly LogRecord[], batchIds?: readonly string[]): void;
31
+ add(reason: LossReason, records: readonly LogRecord[], batchIds?: readonly string[], count?: number): void;
32
+ /**
33
+ * Returns the lost record counts since the start.
34
+ * @returns A copy of the count for each reason. A reason with no loss has no key.
35
+ */
36
+ counts(): Partial<Record<LossReason, number>>;
27
37
  /** Hands every waiting summary to the hook. A hook that throws doesn't stop the others. */
28
38
  private flush;
29
39
  }
@@ -0,0 +1,36 @@
1
+ import type { LogRecord } from "../models/log-record.cjs";
2
+ /** Holds records and returns them in arrival order. Each kind keeps its head when it is full. */
3
+ export declare class HoldBuffer {
4
+ private readonly onDrop;
5
+ /** Held actions. */
6
+ private actions;
7
+ /** Held records of every other kind. */
8
+ private others;
9
+ /** Arrival number of the next record. */
10
+ private arrivals;
11
+ /**
12
+ * @param onDrop Receives the record that a full buffer drops.
13
+ */
14
+ constructor(onDrop: (record: LogRecord) => void);
15
+ /** Held records in arrival order. */
16
+ get records(): readonly LogRecord[];
17
+ /** Number of held records. */
18
+ get length(): number;
19
+ /**
20
+ * Adds a record. A full buffer drops its oldest record of the same kind after the head.
21
+ * @param record Record to hold.
22
+ * @param maxRecords Cap on records that aren't actions. The caller reads it from the config
23
+ * on each push, because a record can arrive before the app's configure() sets the cap.
24
+ */
25
+ push(record: LogRecord, maxRecords: number): void;
26
+ /**
27
+ * Removes the held records.
28
+ * @returns The records in arrival order.
29
+ */
30
+ take(): LogRecord[];
31
+ /**
32
+ * Builds one list from the four. Each list is already sorted, so the sort only merges runs.
33
+ * @returns The held records in arrival order.
34
+ */
35
+ private inOrder;
36
+ }
@@ -1,11 +1,13 @@
1
- import type { LogRecord } from "../models/log-record";
2
- /** Holds records in arrival order. A full buffer drops its oldest record of the same kind. */
1
+ import type { LogRecord } from "../models/log-record.js";
2
+ /** Holds records and returns them in arrival order. Each kind keeps its head when it is full. */
3
3
  export declare class HoldBuffer {
4
4
  private readonly onDrop;
5
- /** Held records in arrival order. */
6
- private held;
7
- /** Number of held actions. Counting them spots a full buffer without a scan on every push. */
5
+ /** Held actions. */
8
6
  private actions;
7
+ /** Held records of every other kind. */
8
+ private others;
9
+ /** Arrival number of the next record. */
10
+ private arrivals;
9
11
  /**
10
12
  * @param onDrop Receives the record that a full buffer drops.
11
13
  */
@@ -15,13 +17,20 @@ export declare class HoldBuffer {
15
17
  /** Number of held records. */
16
18
  get length(): number;
17
19
  /**
18
- * Adds a record. A full buffer drops its oldest record of the same kind.
20
+ * Adds a record. A full buffer drops its oldest record of the same kind after the head.
19
21
  * @param record Record to hold.
22
+ * @param maxRecords Cap on records that aren't actions. The caller reads it from the config
23
+ * on each push, because a record can arrive before the app's configure() sets the cap.
20
24
  */
21
- push(record: LogRecord): void;
25
+ push(record: LogRecord, maxRecords: number): void;
22
26
  /**
23
27
  * Removes the held records.
24
28
  * @returns The records in arrival order.
25
29
  */
26
30
  take(): LogRecord[];
31
+ /**
32
+ * Builds one list from the four. Each list is already sorted, so the sort only merges runs.
33
+ * @returns The held records in arrival order.
34
+ */
35
+ private inOrder;
27
36
  }
@@ -0,0 +1,148 @@
1
+ import { type IdentityStores } from "../utils/identity.cjs";
2
+ import type { Diagnostics } from "./diagnostics.cjs";
3
+ /** Lifetime rules for a journey, which is one user task spanning several contexts. */
4
+ export interface JourneyOptions {
5
+ /** Maximum time a journey stays open, in milliseconds. After that the engine ends it. */
6
+ maxAgeMs: number;
7
+ /** True if the journey ends for all contexts when the owning context closes. */
8
+ endOnOwnerClose: boolean;
9
+ /** Query parameter checked at boot for a seeded journey token. */
10
+ urlParam: string;
11
+ }
12
+ /** The journey lifetime policy in effect. Tests build an engine with shorter values. */
13
+ export declare const JOURNEY_OPTIONS: JourneyOptions;
14
+ /** User journey workflow context shared across windows and applications. */
15
+ export interface Journey {
16
+ /** Unique journey correlation identifier. */
17
+ id: string;
18
+ /** Human-readable name of the journey's workflow. */
19
+ name: string;
20
+ /** Journey start timestamp in epoch milliseconds. */
21
+ startedAt: number;
22
+ /** Parent journey ID, set when the journey branches from an earlier one. */
23
+ parentId?: string;
24
+ /** Context identifier of the document that started the journey. */
25
+ ownerContextId: string;
26
+ }
27
+ /**
28
+ * Parses and validates an unknown value into a Journey object. The value comes from
29
+ * sessionStorage or from another realm's bus message.
30
+ * @param value Unverified parsed JSON value.
31
+ * @returns Validated Journey instance or null.
32
+ */
33
+ export declare function parseJourney(value: unknown): Journey | null;
34
+ /** Manages journey lifecycle, cross-window adoption, storage synchronization, and expiration. */
35
+ export declare class JourneyEngine {
36
+ private readonly options;
37
+ private readonly diagnostics;
38
+ private readonly contextId;
39
+ private readonly onLocalChange;
40
+ private readonly stores;
41
+ /** Active journey context, or null if none is in progress. */
42
+ private journey;
43
+ /** Active expiration timer handle. */
44
+ private expiryTimer;
45
+ /**
46
+ * @param options Journey configuration thresholds.
47
+ * @param diagnostics Diagnostics reporter.
48
+ * @param contextId Unique context identifier for this document.
49
+ * @param onLocalChange Callback invoked when journey state changes locally.
50
+ * @param stores Identity stores that hold the journey.
51
+ */
52
+ constructor(options: JourneyOptions, diagnostics: Diagnostics, contextId: string, onLocalChange: (journey: Journey | null) => void, stores?: IdentityStores);
53
+ /** Returns the active journey instance or null. */
54
+ current(): Journey | null;
55
+ /**
56
+ * Finds and adopts the initial journey. Keeps an active journey. Otherwise checks the URL
57
+ * query first, then sessionStorage, then OpenFin customData.
58
+ * @returns Promise that resolves when journey initialization completes.
59
+ */
60
+ bootstrap(): Promise<void>;
61
+ /**
62
+ * Starts a new journey, replacing the active one and telling connected peers.
63
+ * @param name Human-readable workflow name.
64
+ * @param opts Optional parent linkage and pre-assigned identifier.
65
+ * @returns Started Journey instance.
66
+ */
67
+ start(name: string, opts?: {
68
+ parent?: boolean;
69
+ id?: string;
70
+ }): Journey;
71
+ /**
72
+ * Picks the id for a new journey. A longer id, or one with multibyte characters, would make
73
+ * the journey token too long for adoptJourney().
74
+ * @param requested Id from the app, or undefined.
75
+ * @returns The requested id when it matches JOURNEY_ID_PATTERN, otherwise a new id.
76
+ */
77
+ private journeyId;
78
+ /** Ends the active journey and broadcasts the change. */
79
+ end(): void;
80
+ /**
81
+ * Applies a journey update from a bus peer without broadcasting it again. An echo would
82
+ * make two windows send the change back and forth forever. A journey with the same ID as
83
+ * the active one is ignored, so an echo can't restart the timer.
84
+ * @param journey Updated Journey instance or null.
85
+ */
86
+ applyRemote(journey: Journey | null): void;
87
+ /**
88
+ * Serializes the active journey into a compact token for URL or intent transfer.
89
+ * @returns Base64url token, or null when no journey is active or the token exceeds the size
90
+ * limit.
91
+ */
92
+ getToken(): string | null;
93
+ /**
94
+ * Validates and adopts a serialized journey token.
95
+ * @param token Base64url journey token.
96
+ * @param source Originating source description for diagnostics.
97
+ * @param broadcast True to send the adoption to the connected bus peers.
98
+ * @returns True if the token was valid, unexpired, and adopted.
99
+ */
100
+ adopt(token: string, source: string, broadcast?: boolean): boolean;
101
+ /**
102
+ * Ends the journey when endOnOwnerClose is on and the closed context owns the journey.
103
+ * @param ownerContextId Context identifier of the closed window.
104
+ */
105
+ ownerClosed(ownerContextId: string): void;
106
+ /** Clears pending expiration timers and releases resources on shutdown. */
107
+ destroy(): void;
108
+ /**
109
+ * Resumes a persisted journey from raw sessionStorage data.
110
+ * @param raw Serialized JSON string from storage.
111
+ * @returns True if the engine restored the journey.
112
+ */
113
+ private restore;
114
+ /**
115
+ * Decodes a base64url token into a validated Journey object. Anyone can edit the URL
116
+ * that holds a token, and every step throws on bad input. The guard reports the failure
117
+ * instead of letting it throw.
118
+ * @param token Encoded token string.
119
+ * @returns Decoded Journey instance or null on decode error.
120
+ */
121
+ private decodeToken;
122
+ /**
123
+ * Sets the active journey, updates sessionStorage, and schedules expiration.
124
+ * @param journey Target Journey instance or null.
125
+ */
126
+ private setJourney;
127
+ /** Removes journey data from the session store. */
128
+ private clearStored;
129
+ /** Cancels any active expiration timer. */
130
+ private clearTimer;
131
+ /**
132
+ * Extracts the journey token from the current window location search parameters.
133
+ * @returns Token string or null.
134
+ */
135
+ private readUrlToken;
136
+ /**
137
+ * Removes the journey token from the address bar once the engine has adopted it.
138
+ * Otherwise a copied or bookmarked link would start the same journey in another session.
139
+ */
140
+ private removeUrlToken;
141
+ /**
142
+ * Reads the journey token from customData in the OpenFin window options. The wait is
143
+ * capped by OPENFIN_OPTIONS_TIMEOUT_MS. At the deadline we report openfin.unavailable and
144
+ * return no token. A window with no token gives the same result.
145
+ * @returns Promise that resolves to the token string or null.
146
+ */
147
+ private readOpenFinToken;
148
+ }
@@ -1,5 +1,5 @@
1
- import { type IdentityStores } from "../utils/identity";
2
- import type { Diagnostics } from "./diagnostics";
1
+ import { type IdentityStores } from "../utils/identity.js";
2
+ import type { Diagnostics } from "./diagnostics.js";
3
3
  /** Lifetime rules for a journey, which is one user task spanning several contexts. */
4
4
  export interface JourneyOptions {
5
5
  /** Maximum time a journey stays open, in milliseconds. After that the engine ends it. */
@@ -53,8 +53,8 @@ export declare class JourneyEngine {
53
53
  /** Returns the active journey instance or null. */
54
54
  current(): Journey | null;
55
55
  /**
56
- * Finds and adopts the initial journey. Checks the URL query first, then sessionStorage,
57
- * then OpenFin customData.
56
+ * Finds and adopts the initial journey. Keeps an active journey. Otherwise checks the URL
57
+ * query first, then sessionStorage, then OpenFin customData.
58
58
  * @returns Promise that resolves when journey initialization completes.
59
59
  */
60
60
  bootstrap(): Promise<void>;
@@ -86,10 +86,10 @@ export declare class JourneyEngine {
86
86
  applyRemote(journey: Journey | null): void;
87
87
  /**
88
88
  * Serializes the active journey into a compact token for URL or intent transfer.
89
- * @returns Base64url token, or undefined when no journey is active or the token exceeds
90
- * the size limit.
89
+ * @returns Base64url token, or null when no journey is active or the token exceeds the size
90
+ * limit.
91
91
  */
92
- getToken(): string | undefined;
92
+ getToken(): string | null;
93
93
  /**
94
94
  * Validates and adopts a serialized journey token.
95
95
  * @param token Base64url journey token.
@@ -0,0 +1,141 @@
1
+ import { type LogLevel, type LogType, type MetricType } from "../models/log-record.cjs";
2
+ import type { RecordSnapshot } from "./record.cjs";
3
+ import type { ObservabilityRuntime } from "./runtime.cjs";
4
+ /** Configuration options for a scoped OneLogger instance. */
5
+ export interface OneLoggerOptions {
6
+ /** Contextual attributes merged into all records emitted by this logger. */
7
+ scopedContext?: Record<string, unknown>;
8
+ }
9
+ /** Namespaced logger instance for recording structured events, metrics, and errors. */
10
+ export declare class OneLogger {
11
+ protected readonly bind: () => ObservabilityRuntime;
12
+ readonly namespace: string;
13
+ private readonly options;
14
+ /** log.type the level methods use. "system" only for the library's own namespaces. */
15
+ private readonly levelType;
16
+ /**
17
+ * @param bind Returns the runtime for each write, so a logger created before configure()
18
+ * still writes to the configured runtime.
19
+ * @param namespace Application subsystem or module namespace.
20
+ * @param options Scoped context options.
21
+ */
22
+ constructor(bind: () => ObservabilityRuntime, namespace: string, options?: OneLoggerOptions);
23
+ /**
24
+ * Creates a child logger with a nested namespace and merged scoped context.
25
+ * @param namespace Sub-namespace appended with dot notation.
26
+ * @param options Additional scoped context attributes.
27
+ * @returns Nested child OneLogger instance.
28
+ */
29
+ child(namespace: string, options?: OneLoggerOptions): OneLogger;
30
+ /**
31
+ * Logs a trace-level debug record.
32
+ * @param message Log message.
33
+ * @param payload Optional contextual attributes.
34
+ */
35
+ trace: (message: string, payload?: Record<string, unknown>) => void;
36
+ /**
37
+ * Logs a debug-level record.
38
+ * @param message Log message.
39
+ * @param payload Optional contextual attributes.
40
+ */
41
+ debug: (message: string, payload?: Record<string, unknown>) => void;
42
+ /**
43
+ * Logs an informational record.
44
+ * @param message Log message.
45
+ * @param payload Optional contextual attributes.
46
+ */
47
+ info: (message: string, payload?: Record<string, unknown>) => void;
48
+ /**
49
+ * Logs a warning record.
50
+ * @param message Log message.
51
+ * @param payload Optional contextual attributes.
52
+ */
53
+ warn: (message: string, payload?: Record<string, unknown>) => void;
54
+ /**
55
+ * Logs an error record with the breadcrumb history. When payload is omitted, a plain
56
+ * object in the error slot is used as the payload.
57
+ * @param message Error description.
58
+ * @param error Caught error instance, reason, or payload.
59
+ * @param payload Optional contextual attributes.
60
+ */
61
+ error: (message: string, error?: unknown, payload?: Record<string, unknown>) => void;
62
+ /**
63
+ * Logs a fatal error record. When payload is omitted, a plain object in the error slot
64
+ * is used as the payload.
65
+ * @param message Error description.
66
+ * @param error Caught error instance, reason, or payload.
67
+ * @param payload Optional contextual attributes.
68
+ */
69
+ fatal: (message: string, error?: unknown, payload?: Record<string, unknown>) => void;
70
+ /**
71
+ * Logs a user action.
72
+ * @param name Action identifier.
73
+ * @param payload Optional action attributes.
74
+ */
75
+ logAction: (name: string, payload?: Record<string, unknown>) => void;
76
+ /**
77
+ * Logs an application lifecycle or domain event.
78
+ * @param name Event identifier.
79
+ * @param payload Optional event attributes.
80
+ */
81
+ logEvent: (name: string, payload?: Record<string, unknown>) => void;
82
+ /**
83
+ * Builds and emits a standard log record, and prints it to the console.
84
+ * @param level Severity level.
85
+ * @param type Record classification.
86
+ * @param body Primary message.
87
+ * @param payload Optional contextual attributes.
88
+ */
89
+ private write;
90
+ /** Runs a call right away, or queues it without reading its payload. */
91
+ protected submit(runtime: ObservabilityRuntime, level: LogLevel, type: LogType, work: (snapshot?: RecordSnapshot) => void): void;
92
+ /** Builds a standard record once the call's payload is ready to read. */
93
+ protected writeNow(runtime: ObservabilityRuntime, level: LogLevel, type: LogType, body: string, payload: Record<string, unknown> | undefined, copied: boolean, snapshot?: RecordSnapshot): void;
94
+ /**
95
+ * Builds and emits an error record with breadcrumbs, and prints it to the console.
96
+ * @param level Severity level ("ERROR" or "FATAL").
97
+ * @param message Error description.
98
+ * @param error Caught error instance, reason, or payload.
99
+ * @param payload Optional contextual attributes.
100
+ */
101
+ private writeError;
102
+ /** Builds an error record once the deferred queue releases its payload. */
103
+ private writeErrorNow;
104
+ /**
105
+ * Prints one log line. With a redact hook or processors, the line shows only what they
106
+ * returned. A host can record console arguments, so the console must not show what the hooks
107
+ * remove.
108
+ * @param runtime The runtime for this write.
109
+ * @param level Severity level.
110
+ * @param message Primary message.
111
+ * @param payload Caller payload.
112
+ * @param error The error from an error call.
113
+ * @param record Built record, or null if it was never built or redact dropped it.
114
+ * @param dropped Why the builder dropped the record, if it did.
115
+ */
116
+ private print;
117
+ /**
118
+ * Checks whether the console prints a level that we don't send.
119
+ * @param runtime The runtime for this write.
120
+ * @param level Severity level.
121
+ * @returns True if logging is on and the console accepts the level.
122
+ */
123
+ private mirrors;
124
+ }
125
+ /**
126
+ * Logger for the capture modules. It also writes one metric record per call, which the public
127
+ * Logger can't, because an app's metric goes through an instrument and its interval.
128
+ */
129
+ export declare class LibraryLogger extends OneLogger {
130
+ /**
131
+ * Logs one metric measurement as its own record.
132
+ * @param name Metric identifier.
133
+ * @param value Numerical measurement.
134
+ * @param unit Unit of measurement.
135
+ * @param type Metric type classification.
136
+ * @param attributes Optional metric attributes. With metricsEndpoint they're point attributes.
137
+ * @param recordOnly Optional attributes for the record only. They stay off the OTLP point,
138
+ * because a value that changes on each page load would start a new series each time.
139
+ */
140
+ logMetric: (name: string, value: number, unit?: string, type?: MetricType, attributes?: Record<string, unknown>, recordOnly?: Record<string, unknown>) => void;
141
+ }
@@ -1,5 +1,6 @@
1
- import { type MetricType } from "../models/log-record";
2
- import type { ObservabilityRuntime } from "./runtime";
1
+ import { type LogLevel, type LogType, type MetricType } from "../models/log-record.js";
2
+ import type { RecordSnapshot } from "./record.js";
3
+ import type { ObservabilityRuntime } from "./runtime.js";
3
4
  /** Configuration options for a scoped OneLogger instance. */
4
5
  export interface OneLoggerOptions {
5
6
  /** Contextual attributes merged into all records emitted by this logger. */
@@ -7,7 +8,7 @@ export interface OneLoggerOptions {
7
8
  }
8
9
  /** Namespaced logger instance for recording structured events, metrics, and errors. */
9
10
  export declare class OneLogger {
10
- private readonly bind;
11
+ protected readonly bind: () => ObservabilityRuntime;
11
12
  readonly namespace: string;
12
13
  private readonly options;
13
14
  /** log.type the level methods use. "system" only for the library's own namespaces. */
@@ -78,31 +79,6 @@ export declare class OneLogger {
78
79
  * @param payload Optional event attributes.
79
80
  */
80
81
  logEvent: (name: string, payload?: Record<string, unknown>) => void;
81
- /**
82
- * Logs a numerical metric measurement.
83
- * @param name Metric identifier.
84
- * @param value Numerical measurement.
85
- * @param unit Unit of measurement.
86
- * @param type Metric type classification.
87
- * @param attributes Optional metric attributes.
88
- */
89
- logMetric: (name: string, value: number, unit?: string, type?: MetricType, attributes?: Record<string, unknown>) => void;
90
- /**
91
- * Times a synchronous function execution and records a duration metric.
92
- * @param label Metric name prefix.
93
- * @param fn Synchronous function to time.
94
- * @param attributes Optional contextual attributes.
95
- * @returns Result returned by the timed function.
96
- */
97
- timeSync: <T>(label: string, fn: () => T, attributes?: Record<string, unknown>) => T;
98
- /**
99
- * Times an asynchronous function execution and records a duration metric.
100
- * @param label Metric name prefix.
101
- * @param fn Asynchronous function to time.
102
- * @param attributes Optional contextual attributes.
103
- * @returns Promise that resolves to the result of the timed function.
104
- */
105
- timeAsync: <T>(label: string, fn: () => Promise<T>, attributes?: Record<string, unknown>) => Promise<T>;
106
82
  /**
107
83
  * Builds and emits a standard log record, and prints it to the console.
108
84
  * @param level Severity level.
@@ -112,9 +88,9 @@ export declare class OneLogger {
112
88
  */
113
89
  private write;
114
90
  /** Runs a call right away, or queues it without reading its payload. */
115
- private submit;
91
+ protected submit(runtime: ObservabilityRuntime, level: LogLevel, type: LogType, work: (snapshot?: RecordSnapshot) => void): void;
116
92
  /** Builds a standard record once the call's payload is ready to read. */
117
- private writeNow;
93
+ protected writeNow(runtime: ObservabilityRuntime, level: LogLevel, type: LogType, body: string, payload: Record<string, unknown> | undefined, copied: boolean, snapshot?: RecordSnapshot): void;
118
94
  /**
119
95
  * Builds and emits an error record with breadcrumbs, and prints it to the console.
120
96
  * @param level Severity level ("ERROR" or "FATAL").
@@ -146,3 +122,20 @@ export declare class OneLogger {
146
122
  */
147
123
  private mirrors;
148
124
  }
125
+ /**
126
+ * Logger for the capture modules. It also writes one metric record per call, which the public
127
+ * Logger can't, because an app's metric goes through an instrument and its interval.
128
+ */
129
+ export declare class LibraryLogger extends OneLogger {
130
+ /**
131
+ * Logs one metric measurement as its own record.
132
+ * @param name Metric identifier.
133
+ * @param value Numerical measurement.
134
+ * @param unit Unit of measurement.
135
+ * @param type Metric type classification.
136
+ * @param attributes Optional metric attributes. With metricsEndpoint they're point attributes.
137
+ * @param recordOnly Optional attributes for the record only. They stay off the OTLP point,
138
+ * because a value that changes on each page load would start a new series each time.
139
+ */
140
+ logMetric: (name: string, value: number, unit?: string, type?: MetricType, attributes?: Record<string, unknown>, recordOnly?: Record<string, unknown>) => void;
141
+ }
@@ -0,0 +1,30 @@
1
+ import type { InstrumentDef, Measure, MetricAttributes } from "../models/metric.cjs";
2
+ import { type ClientSpan } from "../utils/tracing.cjs";
3
+ import type { Diagnostics } from "./diagnostics.cjs";
4
+ import type { SpanData } from "./spans.cjs";
5
+ /** Where the values of one measure go. */
6
+ export interface MeasureSinks {
7
+ /** Adds a value to a histogram. */
8
+ metric(def: InstrumentDef, value: number, attributes: MetricAttributes): void;
9
+ /** Records one span. */
10
+ span(span: SpanData): void;
11
+ }
12
+ /**
13
+ * Starts the clock for one operation.
14
+ * @param name Operation name. A JavaScript caller can pass any type.
15
+ * @param attributes Copy of the app's attribute set.
16
+ * @param span The operation's span, or undefined when spans are off or the trace was dropped.
17
+ * @param sinks Where the values go.
18
+ * @returns The operation's handle.
19
+ */
20
+ export declare function createMeasure(name: unknown, attributes: MetricAttributes, span: ClientSpan | undefined, sinks: MeasureSinks): Measure;
21
+ /**
22
+ * Calls a function and ends the measure when the call returns. If the result has a `then`
23
+ * function, the measure ends when it settles. A throw or a rejection ends it with the outcome
24
+ * "error" and goes to the caller.
25
+ * @param handle The measure of the call.
26
+ * @param fn The app's function.
27
+ * @param diagnostics Reports a result whose `then` can't be read.
28
+ * @returns Whatever fn returned, or the result of its then() call.
29
+ */
30
+ export declare function measureCall<T>(handle: Measure, fn: () => T, diagnostics: Diagnostics): T;
@@ -1,6 +1,7 @@
1
- import type { InstrumentDef, Measure, MetricAttributes } from "../models/metric";
2
- import { type ClientSpan } from "../utils/tracing";
3
- import type { SpanData } from "./spans";
1
+ import type { InstrumentDef, Measure, MetricAttributes } from "../models/metric.js";
2
+ import { type ClientSpan } from "../utils/tracing.js";
3
+ import type { Diagnostics } from "./diagnostics.js";
4
+ import type { SpanData } from "./spans.js";
4
5
  /** Where the values of one measure go. */
5
6
  export interface MeasureSinks {
6
7
  /** Adds a value to a histogram. */
@@ -17,3 +18,13 @@ export interface MeasureSinks {
17
18
  * @returns The operation's handle.
18
19
  */
19
20
  export declare function createMeasure(name: unknown, attributes: MetricAttributes, span: ClientSpan | undefined, sinks: MeasureSinks): Measure;
21
+ /**
22
+ * Calls a function and ends the measure when the call returns. If the result has a `then`
23
+ * function, the measure ends when it settles. A throw or a rejection ends it with the outcome
24
+ * "error" and goes to the caller.
25
+ * @param handle The measure of the call.
26
+ * @param fn The app's function.
27
+ * @param diagnostics Reports a result whose `then` can't be read.
28
+ * @returns Whatever fn returned, or the result of its then() call.
29
+ */
30
+ export declare function measureCall<T>(handle: Measure, fn: () => T, diagnostics: Diagnostics): T;