@utk09/ui-observability 0.11.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (557) hide show
  1. package/CHANGELOG.md +481 -0
  2. package/README.md +73 -669
  3. package/bin/uiobs.mjs +1 -1
  4. package/dist/{batch-CL9uWYY3.js → batch-CXmPmTse.js} +3 -3
  5. package/dist/batch-CXmPmTse.js.map +1 -0
  6. package/dist/{batch-C8OcWR2L.cjs → batch-mmPigCpi.cjs} +2 -2
  7. package/dist/batch-mmPigCpi.cjs.map +1 -0
  8. package/dist/bus/bus.d.cts +331 -0
  9. package/dist/bus/bus.d.ts +108 -57
  10. package/dist/bus/links.d.cts +132 -0
  11. package/dist/bus/links.d.ts +22 -7
  12. package/dist/bus/validation.d.cts +16 -0
  13. package/dist/bus/validation.d.ts +11 -2
  14. package/dist/bus-C39wspFV.js +775 -0
  15. package/dist/bus-C39wspFV.js.map +1 -0
  16. package/dist/bus-_EaOVPGq.cjs +2 -0
  17. package/dist/bus-_EaOVPGq.cjs.map +1 -0
  18. package/dist/capture/console.d.cts +37 -0
  19. package/dist/capture/console.d.ts +11 -11
  20. package/dist/capture/errors.d.cts +32 -0
  21. package/dist/capture/errors.d.ts +7 -7
  22. package/dist/capture/interactions.d.cts +48 -0
  23. package/dist/capture/interactions.d.ts +15 -15
  24. package/dist/capture/lifecycle.d.cts +20 -0
  25. package/dist/capture/lifecycle.d.ts +4 -4
  26. package/dist/capture/long-frames.d.cts +31 -0
  27. package/dist/capture/long-frames.d.ts +7 -7
  28. package/dist/capture/network.d.cts +57 -0
  29. package/dist/capture/network.d.ts +18 -18
  30. package/dist/capture/profiler-frames.d.cts +44 -0
  31. package/dist/capture/profiler-frames.d.ts +44 -0
  32. package/dist/capture/replay-buffer.d.cts +45 -0
  33. package/dist/capture/replay-buffer.d.ts +45 -0
  34. package/dist/capture/replay-upload.d.cts +79 -0
  35. package/dist/capture/replay-upload.d.ts +79 -0
  36. package/dist/capture/replay.d.cts +114 -0
  37. package/dist/capture/replay.d.ts +114 -0
  38. package/dist/capture/reports.d.cts +17 -0
  39. package/dist/capture/reports.d.ts +3 -3
  40. package/dist/capture/resource-timing.d.cts +14 -0
  41. package/dist/capture/resource-timing.d.ts +2 -2
  42. package/dist/capture/server-timing.d.cts +19 -0
  43. package/dist/capture/server-timing.d.ts +3 -3
  44. package/dist/capture/storm.d.cts +13 -0
  45. package/dist/capture/storm.d.ts +7 -7
  46. package/dist/capture/types.d.cts +128 -0
  47. package/dist/capture/types.d.ts +54 -41
  48. package/dist/capture/unclean-exit.d.cts +31 -0
  49. package/dist/capture/unclean-exit.d.ts +9 -9
  50. package/dist/capture/user-timing.d.cts +22 -0
  51. package/dist/capture/user-timing.d.ts +4 -4
  52. package/dist/capture/web-socket.d.cts +40 -0
  53. package/dist/capture/web-socket.d.ts +14 -14
  54. package/dist/capture/web-vitals.d.cts +40 -0
  55. package/dist/capture/web-vitals.d.ts +21 -8
  56. package/dist/compression-CvED_Jel.cjs +2 -0
  57. package/dist/compression-CvED_Jel.cjs.map +1 -0
  58. package/dist/compression-tVtXwVjX.js +11 -0
  59. package/dist/compression-tVtXwVjX.js.map +1 -0
  60. package/dist/config-DUs7uHHt.cjs +2 -0
  61. package/dist/config-DUs7uHHt.cjs.map +1 -0
  62. package/dist/config-SgQcCP1_.js +560 -0
  63. package/dist/config-SgQcCP1_.js.map +1 -0
  64. package/dist/console-BGgGnjSi.js +81 -0
  65. package/dist/console-BGgGnjSi.js.map +1 -0
  66. package/dist/console-CSZ5_Vx5.cjs +2 -0
  67. package/dist/console-CSZ5_Vx5.cjs.map +1 -0
  68. package/dist/constants-CUyd9cTZ.js +357 -0
  69. package/dist/constants-CUyd9cTZ.js.map +1 -0
  70. package/dist/constants-CqdJhTxH.cjs +2 -0
  71. package/dist/constants-CqdJhTxH.cjs.map +1 -0
  72. package/dist/constants.d.cts +751 -0
  73. package/dist/constants.d.ts +231 -116
  74. package/dist/core/breadcrumbs.d.cts +54 -0
  75. package/dist/core/breadcrumbs.d.ts +21 -15
  76. package/dist/core/config.d.cts +45 -0
  77. package/dist/core/config.d.ts +33 -5
  78. package/dist/core/context.d.cts +24 -0
  79. package/dist/core/context.d.ts +8 -13
  80. package/dist/core/debug-buffer.d.cts +34 -0
  81. package/dist/core/debug-buffer.d.ts +13 -13
  82. package/dist/core/debug-bundle.d.cts +12 -0
  83. package/dist/core/debug-bundle.d.ts +6 -6
  84. package/dist/core/deferred.d.cts +7 -0
  85. package/dist/core/deferred.d.ts +4 -4
  86. package/dist/core/diagnostics.d.cts +86 -0
  87. package/dist/core/diagnostics.d.ts +25 -22
  88. package/dist/core/drops.d.cts +39 -0
  89. package/dist/core/drops.d.ts +22 -12
  90. package/dist/core/hold-buffer.d.cts +36 -0
  91. package/dist/core/hold-buffer.d.ts +16 -7
  92. package/dist/core/journey.d.cts +148 -0
  93. package/dist/core/journey.d.ts +28 -29
  94. package/dist/core/logger.d.cts +141 -0
  95. package/dist/core/logger.d.ts +45 -51
  96. package/dist/core/measure.d.cts +30 -0
  97. package/dist/core/measure.d.ts +21 -10
  98. package/dist/core/meter.d.cts +78 -0
  99. package/dist/core/meter.d.ts +38 -28
  100. package/dist/core/pipeline.d.cts +227 -0
  101. package/dist/core/pipeline.d.ts +114 -50
  102. package/dist/core/profile-buckets.d.cts +31 -0
  103. package/dist/core/profile-buckets.d.ts +31 -0
  104. package/dist/core/profiler.d.cts +218 -0
  105. package/dist/core/profiler.d.ts +218 -0
  106. package/dist/core/record.d.cts +190 -0
  107. package/dist/core/record.d.ts +67 -35
  108. package/dist/core/remote-rules.d.cts +17 -0
  109. package/dist/core/remote-rules.d.ts +7 -7
  110. package/dist/core/remote-sampling.d.cts +74 -0
  111. package/dist/core/remote-sampling.d.ts +24 -23
  112. package/dist/core/rotation.d.cts +75 -0
  113. package/dist/core/rotation.d.ts +75 -0
  114. package/dist/core/runtime.d.cts +765 -0
  115. package/dist/core/runtime.d.ts +430 -186
  116. package/dist/core/sampling.d.cts +86 -0
  117. package/dist/core/sampling.d.ts +22 -22
  118. package/dist/core/sender.d.cts +161 -0
  119. package/dist/core/sender.d.ts +80 -34
  120. package/dist/core/spans.d.cts +39 -0
  121. package/dist/core/spans.d.ts +6 -6
  122. package/dist/{deadline-BOjOxNHj.js → deadline-C4ccAuk5.js} +3 -6
  123. package/dist/deadline-C4ccAuk5.js.map +1 -0
  124. package/dist/deadline-CUGbto-y.cjs +2 -0
  125. package/dist/deadline-CUGbto-y.cjs.map +1 -0
  126. package/dist/debug-bundle-BXIlwDKM.cjs +2 -0
  127. package/dist/debug-bundle-BXIlwDKM.cjs.map +1 -0
  128. package/dist/debug-bundle-CRpYV_ui.js +35 -0
  129. package/dist/debug-bundle-CRpYV_ui.js.map +1 -0
  130. package/dist/defineProperty-X1c4tIPD.cjs +1 -0
  131. package/dist/defineProperty-s2S8BXUc.js +35 -0
  132. package/dist/doctor.cjs +1 -1
  133. package/dist/doctor.cjs.map +1 -1
  134. package/dist/doctor.d.cts +36 -0
  135. package/dist/doctor.d.ts +19 -6
  136. package/dist/doctor.js +180 -53
  137. package/dist/doctor.js.map +1 -1
  138. package/dist/error-like-B11pB4aL.js.map +1 -1
  139. package/dist/error-like-gGRx2s36.cjs.map +1 -1
  140. package/dist/errors-BE_EZV7Q.js +86 -0
  141. package/dist/errors-BE_EZV7Q.js.map +1 -0
  142. package/dist/errors-CNPbesMs.cjs +3 -0
  143. package/dist/errors-CNPbesMs.cjs.map +1 -0
  144. package/dist/factory-CTi0Is3F.js +404 -0
  145. package/dist/factory-CTi0Is3F.js.map +1 -0
  146. package/dist/factory-hRrH32v5.cjs +2 -0
  147. package/dist/factory-hRrH32v5.cjs.map +1 -0
  148. package/dist/fixed-window-CvESpFYV.cjs.map +1 -1
  149. package/dist/fixed-window-Dq3MLUUv.js.map +1 -1
  150. package/dist/global-scope-BN-Io_yv.cjs.map +1 -1
  151. package/dist/global-scope-D9I8s-oN.js.map +1 -1
  152. package/dist/guards-BlYGRK4l.js +10 -0
  153. package/dist/guards-BlYGRK4l.js.map +1 -0
  154. package/dist/guards-EjG3ahFp.cjs +2 -0
  155. package/dist/guards-EjG3ahFp.cjs.map +1 -0
  156. package/dist/{identity-DT5VmvXy.js → identity-DdhKgrpk.js} +11 -15
  157. package/dist/identity-DdhKgrpk.js.map +1 -0
  158. package/dist/identity-DlWRIuwy.cjs +2 -0
  159. package/dist/identity-DlWRIuwy.cjs.map +1 -0
  160. package/dist/index.cjs +1 -1
  161. package/dist/index.cjs.map +1 -1
  162. package/dist/index.d.cts +300 -0
  163. package/dist/index.d.ts +165 -141
  164. package/dist/index.js +1283 -1468
  165. package/dist/index.js.map +1 -1
  166. package/dist/indexeddb-storage-CL9uqBCy.cjs +2 -0
  167. package/dist/indexeddb-storage-CL9uqBCy.cjs.map +1 -0
  168. package/dist/{indexeddb-storage-BJVtiQKm.js → indexeddb-storage-GHdl0t8A.js} +51 -47
  169. package/dist/indexeddb-storage-GHdl0t8A.js.map +1 -0
  170. package/dist/interactions-CUkzK8sR.cjs +2 -0
  171. package/dist/interactions-CUkzK8sR.cjs.map +1 -0
  172. package/dist/{interactions-DTgKy_6K.js → interactions-DiFvCosX.js} +41 -49
  173. package/dist/interactions-DiFvCosX.js.map +1 -0
  174. package/dist/journey-B4Adltjm.cjs +2 -0
  175. package/dist/journey-B4Adltjm.cjs.map +1 -0
  176. package/dist/{journey-CuJrHzEg.js → journey-D2_sia57.js} +51 -53
  177. package/dist/journey-D2_sia57.js.map +1 -0
  178. package/dist/{library-console-C1m6g1BR.js → library-console-Btrzt814.js} +2 -2
  179. package/dist/library-console-Btrzt814.js.map +1 -0
  180. package/dist/{library-console-D2GY9Or6.cjs → library-console-CPW6bvZH.cjs} +2 -2
  181. package/dist/library-console-CPW6bvZH.cjs.map +1 -0
  182. package/dist/{library-request-BQBT9N9Q.js → library-request-BJ9PLRaD.js} +2 -2
  183. package/dist/library-request-BJ9PLRaD.js.map +1 -0
  184. package/dist/{library-request-1BX_UlaX.cjs → library-request-D7OvTxZV.cjs} +2 -2
  185. package/dist/library-request-D7OvTxZV.cjs.map +1 -0
  186. package/dist/{lifecycle-BaKx_-32.js → lifecycle-22CUCrc9.js} +21 -29
  187. package/dist/lifecycle-22CUCrc9.js.map +1 -0
  188. package/dist/lifecycle-IaAm1mOC.cjs +2 -0
  189. package/dist/lifecycle-IaAm1mOC.cjs.map +1 -0
  190. package/dist/{log-record-CAoGBBf3.js → log-record-BNiLfqtL.js} +8 -7
  191. package/dist/log-record-BNiLfqtL.js.map +1 -0
  192. package/dist/log-record-CkivuiEl.cjs +2 -0
  193. package/dist/log-record-CkivuiEl.cjs.map +1 -0
  194. package/dist/long-frames-BUUbXd-B.cjs +2 -0
  195. package/dist/long-frames-BUUbXd-B.cjs.map +1 -0
  196. package/dist/long-frames-DNFaRnC3.js +62 -0
  197. package/dist/long-frames-DNFaRnC3.js.map +1 -0
  198. package/dist/models/batch.d.cts +57 -0
  199. package/dist/models/batch.d.ts +16 -17
  200. package/dist/models/bus.d.cts +158 -0
  201. package/dist/models/bus.d.ts +46 -26
  202. package/dist/models/config.d.cts +1540 -0
  203. package/dist/models/config.d.ts +692 -405
  204. package/dist/models/drop.d.cts +54 -0
  205. package/dist/models/drop.d.ts +29 -14
  206. package/dist/models/health.d.cts +148 -0
  207. package/dist/models/health.d.ts +119 -23
  208. package/dist/models/log-record.d.cts +61 -0
  209. package/dist/models/log-record.d.ts +13 -14
  210. package/dist/models/metric.d.cts +139 -0
  211. package/dist/models/metric.d.ts +94 -18
  212. package/dist/models/plugin.d.cts +47 -0
  213. package/dist/models/plugin.d.ts +16 -16
  214. package/dist/models/replay.d.cts +60 -0
  215. package/dist/models/replay.d.ts +60 -0
  216. package/dist/models/serializer.d.cts +23 -0
  217. package/dist/models/serializer.d.ts +3 -4
  218. package/dist/models/storage.d.cts +95 -0
  219. package/dist/models/storage.d.ts +17 -14
  220. package/dist/network-CGMLQ-mA.cjs +2 -0
  221. package/dist/network-CGMLQ-mA.cjs.map +1 -0
  222. package/dist/{network-DBNwApoF.js → network-on2zZT6H.js} +57 -57
  223. package/dist/network-on2zZT6H.js.map +1 -0
  224. package/dist/openfin-Bxelt0yg.js.map +1 -1
  225. package/dist/openfin-DtH2f7zX.cjs.map +1 -1
  226. package/dist/otlp-BENHf3g9.cjs +2 -0
  227. package/dist/otlp-BENHf3g9.cjs.map +1 -0
  228. package/dist/{otlp-BTJdIa6F.js → otlp-DimfrRor.js} +22 -29
  229. package/dist/otlp-DimfrRor.js.map +1 -0
  230. package/dist/patch-BX8KrPCT.cjs.map +1 -1
  231. package/dist/patch-UdPz1ea8.js.map +1 -1
  232. package/dist/{platform-DkcuXwe-.js → platform-BaaFIPCU.js} +8 -8
  233. package/dist/platform-BaaFIPCU.js.map +1 -0
  234. package/dist/{platform-C2Ez5kDc.cjs → platform-CfA3-7sJ.cjs} +2 -2
  235. package/dist/platform-CfA3-7sJ.cjs.map +1 -0
  236. package/dist/profiler-BAZoh7A4.js +292 -0
  237. package/dist/profiler-BAZoh7A4.js.map +1 -0
  238. package/dist/profiler-D4tJpDRc.cjs +2 -0
  239. package/dist/profiler-D4tJpDRc.cjs.map +1 -0
  240. package/dist/profiler-frames-C4xr7KfH.cjs +2 -0
  241. package/dist/profiler-frames-C4xr7KfH.cjs.map +1 -0
  242. package/dist/profiler-frames-cJMx9wNM.js +78 -0
  243. package/dist/profiler-frames-cJMx9wNM.js.map +1 -0
  244. package/dist/remote-rules-Dz9MRAsB.js +95 -0
  245. package/dist/remote-rules-Dz9MRAsB.js.map +1 -0
  246. package/dist/remote-rules-_tY0zj5o.cjs +2 -0
  247. package/dist/remote-rules-_tY0zj5o.cjs.map +1 -0
  248. package/dist/replay-B3gFXIZd.cjs +2 -0
  249. package/dist/replay-B3gFXIZd.cjs.map +1 -0
  250. package/dist/replay-Ds-ANH34.js +310 -0
  251. package/dist/replay-Ds-ANH34.js.map +1 -0
  252. package/dist/reports-BDSe4dFH.cjs +2 -0
  253. package/dist/reports-BDSe4dFH.cjs.map +1 -0
  254. package/dist/{reports-TA-zInnq.js → reports-C-thq-bk.js} +25 -30
  255. package/dist/reports-C-thq-bk.js.map +1 -0
  256. package/dist/resource-timing-C576gFIQ.cjs +2 -0
  257. package/dist/resource-timing-C576gFIQ.cjs.map +1 -0
  258. package/dist/{resource-timing-BLv3EA2A.js → resource-timing-eUl2dNgC.js} +20 -23
  259. package/dist/resource-timing-eUl2dNgC.js.map +1 -0
  260. package/dist/response-body-YdNl-HkR.cjs +3 -0
  261. package/dist/response-body-YdNl-HkR.cjs.map +1 -0
  262. package/dist/response-body-eoSQpLiH.js +331 -0
  263. package/dist/response-body-eoSQpLiH.js.map +1 -0
  264. package/dist/rotation-Cwct4ckk.js +94 -0
  265. package/dist/rotation-Cwct4ckk.js.map +1 -0
  266. package/dist/rotation-D4qUAHAu.cjs +2 -0
  267. package/dist/rotation-D4qUAHAu.cjs.map +1 -0
  268. package/dist/sampling-BlrI8jor.js +63 -0
  269. package/dist/sampling-BlrI8jor.js.map +1 -0
  270. package/dist/sampling-mXt4dstx.cjs +2 -0
  271. package/dist/sampling-mXt4dstx.cjs.map +1 -0
  272. package/dist/{sanitize-6ymPlVvP.js → sanitize-Ba0KqU06.js} +2 -2
  273. package/dist/sanitize-Ba0KqU06.js.map +1 -0
  274. package/dist/{sanitize-BAWzkZt0.cjs → sanitize-DQyiI_KY.cjs} +2 -2
  275. package/dist/sanitize-DQyiI_KY.cjs.map +1 -0
  276. package/dist/sender-BdRuNVhF.cjs +2 -0
  277. package/dist/sender-BdRuNVhF.cjs.map +1 -0
  278. package/dist/sender-Dv8rAmpV.js +979 -0
  279. package/dist/sender-Dv8rAmpV.js.map +1 -0
  280. package/dist/storage/context-storage.d.cts +90 -0
  281. package/dist/storage/context-storage.d.ts +38 -37
  282. package/dist/storage/emergency-queue.d.cts +27 -0
  283. package/dist/storage/emergency-queue.d.ts +13 -13
  284. package/dist/storage/eviction.d.cts +40 -0
  285. package/dist/storage/eviction.d.ts +13 -13
  286. package/dist/storage/factory.d.cts +21 -0
  287. package/dist/storage/factory.d.ts +11 -10
  288. package/dist/storage/gap.d.cts +20 -0
  289. package/dist/storage/gap.d.ts +9 -9
  290. package/dist/storage/idb-driver.d.cts +93 -0
  291. package/dist/storage/idb-driver.d.ts +32 -33
  292. package/dist/storage/indexeddb-storage.d.cts +97 -0
  293. package/dist/storage/indexeddb-storage.d.ts +38 -31
  294. package/dist/storage/keys.d.cts +17 -0
  295. package/dist/storage/keys.d.ts +9 -9
  296. package/dist/storage/local-storage.d.cts +139 -0
  297. package/dist/storage/local-storage.d.ts +49 -42
  298. package/dist/storage/memory-storage.d.cts +73 -0
  299. package/dist/storage/memory-storage.d.ts +25 -25
  300. package/dist/storage/persistence.d.cts +8 -0
  301. package/dist/storage/persistence.d.ts +3 -3
  302. package/dist/storage/stored-context.d.cts +34 -0
  303. package/dist/storage/stored-context.d.ts +34 -0
  304. package/dist/stored-context-B2EzVuYm.js +51 -0
  305. package/dist/stored-context-B2EzVuYm.js.map +1 -0
  306. package/dist/stored-context-CXt7eHZL.cjs +2 -0
  307. package/dist/stored-context-CXt7eHZL.cjs.map +1 -0
  308. package/dist/storm-C-zYSdDX.cjs +2 -0
  309. package/dist/storm-C-zYSdDX.cjs.map +1 -0
  310. package/dist/storm-DjKetLKZ.js +9 -0
  311. package/dist/storm-DjKetLKZ.js.map +1 -0
  312. package/dist/transport/compression.d.cts +7 -0
  313. package/dist/transport/compression.d.ts +2 -2
  314. package/dist/transport/custom-transport.d.cts +22 -0
  315. package/dist/transport/custom-transport.d.ts +6 -5
  316. package/dist/transport/errors.d.cts +31 -0
  317. package/dist/transport/errors.d.ts +7 -7
  318. package/dist/transport/exit-flush.d.cts +135 -0
  319. package/dist/transport/exit-flush.d.ts +62 -45
  320. package/dist/transport/headers.d.cts +8 -0
  321. package/dist/transport/headers.d.ts +4 -4
  322. package/dist/transport/http-transport.d.cts +116 -0
  323. package/dist/transport/http-transport.d.ts +48 -35
  324. package/dist/transport/memory-transport.d.cts +30 -0
  325. package/dist/transport/memory-transport.d.ts +8 -8
  326. package/dist/transport/response-body.d.cts +49 -0
  327. package/dist/transport/response-body.d.ts +49 -0
  328. package/dist/transport/retry-engine.d.cts +129 -0
  329. package/dist/transport/retry-engine.d.ts +62 -43
  330. package/dist/transport/serializers/ecs.d.cts +3 -0
  331. package/dist/transport/serializers/ecs.d.ts +2 -2
  332. package/dist/transport/serializers/otlp-metrics.d.cts +3 -0
  333. package/dist/transport/serializers/otlp-metrics.d.ts +2 -2
  334. package/dist/transport/serializers/otlp-traces.d.cts +3 -0
  335. package/dist/transport/serializers/otlp-traces.d.ts +2 -2
  336. package/dist/transport/serializers/otlp.d.cts +47 -0
  337. package/dist/transport/serializers/otlp.d.ts +18 -18
  338. package/dist/transport/serializers/select.d.cts +38 -0
  339. package/dist/transport/serializers/select.d.ts +11 -11
  340. package/dist/transport/status-transport.d.cts +129 -0
  341. package/dist/transport/status-transport.d.ts +45 -28
  342. package/dist/transport/worker-client.d.cts +23 -0
  343. package/dist/transport/worker-client.d.ts +12 -3
  344. package/dist/transport/worker-entry.d.cts +5 -0
  345. package/dist/transport/worker-entry.d.ts +1 -1
  346. package/dist/transport/worker-protocol.d.cts +38 -0
  347. package/dist/transport/worker-protocol.d.ts +7 -5
  348. package/dist/transport/worker-server.d.cts +3 -0
  349. package/dist/transport/worker-server.d.ts +1 -1
  350. package/dist/transport/worker-transport.d.cts +10 -0
  351. package/dist/transport/worker-transport.d.ts +5 -4
  352. package/dist/types-BAerHgCq.js.map +1 -1
  353. package/dist/types-C7WNpnG1.cjs.map +1 -1
  354. package/dist/{unclean-exit-CwcUhFOn.js → unclean-exit-DQD1cT7c.js} +23 -30
  355. package/dist/unclean-exit-DQD1cT7c.js.map +1 -0
  356. package/dist/unclean-exit-py99ApzT.cjs +2 -0
  357. package/dist/unclean-exit-py99ApzT.cjs.map +1 -0
  358. package/dist/unref-CU9Nyz_9.cjs +2 -0
  359. package/dist/unref-CU9Nyz_9.cjs.map +1 -0
  360. package/dist/unref-DgHPQeWv.js +7 -0
  361. package/dist/unref-DgHPQeWv.js.map +1 -0
  362. package/dist/{user-timing-_jZIhDKI.js → user-timing-BePqb1uN.js} +18 -18
  363. package/dist/user-timing-BePqb1uN.js.map +1 -0
  364. package/dist/user-timing-D6XTmpuM.cjs +2 -0
  365. package/dist/user-timing-D6XTmpuM.cjs.map +1 -0
  366. package/dist/utils/console.d.cts +36 -0
  367. package/dist/utils/console.d.ts +6 -6
  368. package/dist/utils/deadline.d.cts +14 -0
  369. package/dist/utils/deadline.d.ts +4 -4
  370. package/dist/utils/error-like.d.cts +25 -0
  371. package/dist/utils/error-like.d.ts +7 -7
  372. package/dist/utils/fixed-window.d.cts +25 -0
  373. package/dist/utils/fixed-window.d.ts +9 -8
  374. package/dist/utils/global-scope.d.cts +20 -0
  375. package/dist/utils/global-scope.d.ts +8 -8
  376. package/dist/utils/guards.d.cts +14 -0
  377. package/dist/utils/guards.d.ts +10 -2
  378. package/dist/utils/identity.d.cts +109 -0
  379. package/dist/utils/identity.d.ts +20 -21
  380. package/dist/utils/library-console.d.cts +11 -0
  381. package/dist/utils/library-console.d.ts +4 -4
  382. package/dist/utils/library-request.d.cts +24 -0
  383. package/dist/utils/library-request.d.ts +10 -10
  384. package/dist/utils/lock.d.cts +24 -0
  385. package/dist/utils/lock.d.ts +11 -10
  386. package/dist/utils/openfin.d.cts +48 -0
  387. package/dist/utils/openfin.d.ts +5 -5
  388. package/dist/utils/patch.d.cts +9 -0
  389. package/dist/utils/patch.d.ts +6 -6
  390. package/dist/utils/platform.d.cts +62 -0
  391. package/dist/utils/platform.d.ts +15 -13
  392. package/dist/utils/sanitize.d.cts +52 -0
  393. package/dist/utils/sanitize.d.ts +5 -5
  394. package/dist/utils/sequence.d.cts +10 -0
  395. package/dist/utils/tracing.d.cts +158 -0
  396. package/dist/utils/tracing.d.ts +49 -42
  397. package/dist/utils/unref.d.cts +9 -0
  398. package/dist/utils/unref.d.ts +3 -3
  399. package/dist/web-socket-CoIUBM3C.cjs +2 -0
  400. package/dist/web-socket-CoIUBM3C.cjs.map +1 -0
  401. package/dist/{web-socket-CV7yIMnm.js → web-socket-DSHgDiZ6.js} +23 -28
  402. package/dist/web-socket-DSHgDiZ6.js.map +1 -0
  403. package/dist/web-vitals-4pWACwaR.js +71 -0
  404. package/dist/web-vitals-4pWACwaR.js.map +1 -0
  405. package/dist/web-vitals-__X7t4pj.cjs +2 -0
  406. package/dist/web-vitals-__X7t4pj.cjs.map +1 -0
  407. package/dist/worker-protocol-QbvqNazn.cjs +2 -0
  408. package/dist/worker-protocol-QbvqNazn.cjs.map +1 -0
  409. package/dist/{worker-protocol-CrsdSDLn.js → worker-protocol-x074Rpet.js} +14 -11
  410. package/dist/worker-protocol-x074Rpet.js.map +1 -0
  411. package/dist/worker-server-CFe4nvos.cjs +2 -0
  412. package/dist/worker-server-CFe4nvos.cjs.map +1 -0
  413. package/dist/worker-server-iUVSjH8L.js +94 -0
  414. package/dist/worker-server-iUVSjH8L.js.map +1 -0
  415. package/dist/worker-transport-CRAX-09c.cjs +2 -0
  416. package/dist/worker-transport-CRAX-09c.cjs.map +1 -0
  417. package/dist/worker-transport-Dy1KMA7t.js +190 -0
  418. package/dist/worker-transport-Dy1KMA7t.js.map +1 -0
  419. package/llms.txt +397 -0
  420. package/package.json +55 -41
  421. package/dist/batch-C8OcWR2L.cjs.map +0 -1
  422. package/dist/batch-CL9uWYY3.js.map +0 -1
  423. package/dist/bus-BZ0GldpT.js +0 -660
  424. package/dist/bus-BZ0GldpT.js.map +0 -1
  425. package/dist/bus-VWlmM5xs.cjs +0 -2
  426. package/dist/bus-VWlmM5xs.cjs.map +0 -1
  427. package/dist/console-BPZCuSLc.cjs +0 -2
  428. package/dist/console-BPZCuSLc.cjs.map +0 -1
  429. package/dist/console-BeCF7n59.js +0 -82
  430. package/dist/console-BeCF7n59.js.map +0 -1
  431. package/dist/constants-DqKJH_MP.cjs +0 -2
  432. package/dist/constants-DqKJH_MP.cjs.map +0 -1
  433. package/dist/constants-zyrqveN4.js +0 -304
  434. package/dist/constants-zyrqveN4.js.map +0 -1
  435. package/dist/context-storage-BjzeBSxH.cjs +0 -2
  436. package/dist/context-storage-BjzeBSxH.cjs.map +0 -1
  437. package/dist/context-storage-BzkoHzkQ.js +0 -51
  438. package/dist/context-storage-BzkoHzkQ.js.map +0 -1
  439. package/dist/deadline-BOjOxNHj.js.map +0 -1
  440. package/dist/deadline-XSnm95pg.cjs +0 -2
  441. package/dist/deadline-XSnm95pg.cjs.map +0 -1
  442. package/dist/debug-bundle-BzJNpbF0.cjs +0 -2
  443. package/dist/debug-bundle-BzJNpbF0.cjs.map +0 -1
  444. package/dist/debug-bundle-C7UkHZ-q.js +0 -25
  445. package/dist/debug-bundle-C7UkHZ-q.js.map +0 -1
  446. package/dist/emergency-queue-CNTRui5t.cjs +0 -2
  447. package/dist/emergency-queue-CNTRui5t.cjs.map +0 -1
  448. package/dist/emergency-queue-Zy6lNafo.js +0 -67
  449. package/dist/emergency-queue-Zy6lNafo.js.map +0 -1
  450. package/dist/errors-Dh7kef0i.js +0 -92
  451. package/dist/errors-Dh7kef0i.js.map +0 -1
  452. package/dist/errors-tfEr48bS.cjs +0 -3
  453. package/dist/errors-tfEr48bS.cjs.map +0 -1
  454. package/dist/factory-BonqI3NL.js +0 -276
  455. package/dist/factory-BonqI3NL.js.map +0 -1
  456. package/dist/factory-CJXVYp0R.cjs +0 -2
  457. package/dist/factory-CJXVYp0R.cjs.map +0 -1
  458. package/dist/guards-Cidk71ME.js +0 -7
  459. package/dist/guards-Cidk71ME.js.map +0 -1
  460. package/dist/guards-nJ70syPt.cjs +0 -2
  461. package/dist/guards-nJ70syPt.cjs.map +0 -1
  462. package/dist/identity-Cxgj6pZX.cjs +0 -2
  463. package/dist/identity-Cxgj6pZX.cjs.map +0 -1
  464. package/dist/identity-DT5VmvXy.js.map +0 -1
  465. package/dist/indexeddb-storage-BJVtiQKm.js.map +0 -1
  466. package/dist/indexeddb-storage-CIoW21Xd.cjs +0 -2
  467. package/dist/indexeddb-storage-CIoW21Xd.cjs.map +0 -1
  468. package/dist/interactions-DTgKy_6K.js.map +0 -1
  469. package/dist/interactions-fEN6FbVo.cjs +0 -2
  470. package/dist/interactions-fEN6FbVo.cjs.map +0 -1
  471. package/dist/journey-CuJrHzEg.js.map +0 -1
  472. package/dist/journey-pffMVMfa.cjs +0 -2
  473. package/dist/journey-pffMVMfa.cjs.map +0 -1
  474. package/dist/keys-BHhw_0Wh.cjs +0 -2
  475. package/dist/keys-BHhw_0Wh.cjs.map +0 -1
  476. package/dist/keys-BU9j5YqW.js +0 -16
  477. package/dist/keys-BU9j5YqW.js.map +0 -1
  478. package/dist/library-console-C1m6g1BR.js.map +0 -1
  479. package/dist/library-console-D2GY9Or6.cjs.map +0 -1
  480. package/dist/library-request-1BX_UlaX.cjs.map +0 -1
  481. package/dist/library-request-BQBT9N9Q.js.map +0 -1
  482. package/dist/lifecycle-2EtUaRpo.cjs +0 -2
  483. package/dist/lifecycle-2EtUaRpo.cjs.map +0 -1
  484. package/dist/lifecycle-BaKx_-32.js.map +0 -1
  485. package/dist/log-record-CAoGBBf3.js.map +0 -1
  486. package/dist/log-record-i9zOTkpQ.cjs +0 -2
  487. package/dist/log-record-i9zOTkpQ.cjs.map +0 -1
  488. package/dist/long-frames-BVg4i5SC.cjs +0 -2
  489. package/dist/long-frames-BVg4i5SC.cjs.map +0 -1
  490. package/dist/long-frames-Czk7IupC.js +0 -64
  491. package/dist/long-frames-Czk7IupC.js.map +0 -1
  492. package/dist/models/stats.d.ts +0 -11
  493. package/dist/network-DBNwApoF.js.map +0 -1
  494. package/dist/network-xbbuvG_6.cjs +0 -2
  495. package/dist/network-xbbuvG_6.cjs.map +0 -1
  496. package/dist/otlp-BDvFrLnc.cjs +0 -2
  497. package/dist/otlp-BDvFrLnc.cjs.map +0 -1
  498. package/dist/otlp-BTJdIa6F.js.map +0 -1
  499. package/dist/platform-C2Ez5kDc.cjs.map +0 -1
  500. package/dist/platform-DkcuXwe-.js.map +0 -1
  501. package/dist/remote-rules-Cfb4K-Nl.js +0 -98
  502. package/dist/remote-rules-Cfb4K-Nl.js.map +0 -1
  503. package/dist/remote-rules-vzvk7aKf.cjs +0 -2
  504. package/dist/remote-rules-vzvk7aKf.cjs.map +0 -1
  505. package/dist/reports-Dk2YhKIh.cjs +0 -2
  506. package/dist/reports-Dk2YhKIh.cjs.map +0 -1
  507. package/dist/reports-TA-zInnq.js.map +0 -1
  508. package/dist/resource-timing-BLv3EA2A.js.map +0 -1
  509. package/dist/resource-timing-Cysw1S1f.cjs +0 -2
  510. package/dist/resource-timing-Cysw1S1f.cjs.map +0 -1
  511. package/dist/sampling-C4VV-1MS.js +0 -60
  512. package/dist/sampling-C4VV-1MS.js.map +0 -1
  513. package/dist/sampling-Ckh2yW9k.cjs +0 -2
  514. package/dist/sampling-Ckh2yW9k.cjs.map +0 -1
  515. package/dist/sanitize-6ymPlVvP.js.map +0 -1
  516. package/dist/sanitize-BAWzkZt0.cjs.map +0 -1
  517. package/dist/select-ZF4by-lF.cjs +0 -3
  518. package/dist/select-ZF4by-lF.cjs.map +0 -1
  519. package/dist/select-xtQaenIi.js +0 -270
  520. package/dist/select-xtQaenIi.js.map +0 -1
  521. package/dist/sender-CiMHC9YG.js +0 -856
  522. package/dist/sender-CiMHC9YG.js.map +0 -1
  523. package/dist/sender-D5wBoXA8.cjs +0 -2
  524. package/dist/sender-D5wBoXA8.cjs.map +0 -1
  525. package/dist/storage-BA9RqRO-.cjs +0 -2
  526. package/dist/storage-BA9RqRO-.cjs.map +0 -1
  527. package/dist/storage-DZwed89z.js +0 -16
  528. package/dist/storage-DZwed89z.js.map +0 -1
  529. package/dist/storm-CYi9Swpx.cjs +0 -2
  530. package/dist/storm-CYi9Swpx.cjs.map +0 -1
  531. package/dist/storm-VR024_QN.js +0 -9
  532. package/dist/storm-VR024_QN.js.map +0 -1
  533. package/dist/unclean-exit-CwcUhFOn.js.map +0 -1
  534. package/dist/unclean-exit-DFUN57wY.cjs +0 -2
  535. package/dist/unclean-exit-DFUN57wY.cjs.map +0 -1
  536. package/dist/user-timing-C9kfRq3J.cjs +0 -2
  537. package/dist/user-timing-C9kfRq3J.cjs.map +0 -1
  538. package/dist/user-timing-_jZIhDKI.js.map +0 -1
  539. package/dist/utils/timer.d.ts +0 -19
  540. package/dist/web-socket-BWUoqBh8.cjs +0 -2
  541. package/dist/web-socket-BWUoqBh8.cjs.map +0 -1
  542. package/dist/web-socket-CV7yIMnm.js.map +0 -1
  543. package/dist/web-vitals-Bq4WFHQo.js +0 -52
  544. package/dist/web-vitals-Bq4WFHQo.js.map +0 -1
  545. package/dist/web-vitals-DFuoTQbZ.cjs +0 -2
  546. package/dist/web-vitals-DFuoTQbZ.cjs.map +0 -1
  547. package/dist/worker-protocol-Bai7GAIA.cjs +0 -2
  548. package/dist/worker-protocol-Bai7GAIA.cjs.map +0 -1
  549. package/dist/worker-protocol-CrsdSDLn.js.map +0 -1
  550. package/dist/worker-server-BrIYkfoa.cjs +0 -2
  551. package/dist/worker-server-BrIYkfoa.cjs.map +0 -1
  552. package/dist/worker-server-Dp5HYm4b.js +0 -83
  553. package/dist/worker-server-Dp5HYm4b.js.map +0 -1
  554. package/dist/worker-transport-Bwej4N2e.cjs +0 -2
  555. package/dist/worker-transport-Bwej4N2e.cjs.map +0 -1
  556. package/dist/worker-transport-D6jtgpqN.js +0 -199
  557. package/dist/worker-transport-D6jtgpqN.js.map +0 -1
package/dist/bus/bus.d.ts CHANGED
@@ -1,15 +1,16 @@
1
- import type { Diagnostics } from "../core/diagnostics";
2
- import { type Journey } from "../core/journey";
3
- import type { RemoteSlot } from "../core/remote-sampling";
4
- import type { BusMessage, BusRole } from "../models/bus";
5
- import type { SourceOptions, FrameOptions } from "../models/bus";
6
- import type { ResolvedConfig } from "../models/config";
7
- import type { LogRecord } from "../models/log-record";
8
- import type { PlatformMetadata } from "../utils/platform";
9
- import { type Receive, type WorkerLike } from "./links";
1
+ import type { Diagnostics } from "../core/diagnostics.js";
2
+ import { type Journey } from "../core/journey.js";
3
+ import type { RemoteSlot } from "../core/remote-sampling.js";
4
+ import type { BusMessage, BusRole } from "../models/bus.js";
5
+ import type { SourceOptions, FrameOptions } from "../models/bus.js";
6
+ import type { ResolvedConfig } from "../models/config.js";
7
+ import type { FlushResult } from "../models/health.js";
8
+ import type { LogRecord } from "../models/log-record.js";
9
+ import type { PlatformMetadata } from "../utils/platform.js";
10
+ import { type Receive, type WorkerLike } from "./links.js";
10
11
  /** Handshake timing for a forwarder waiting on an owner. */
11
12
  export interface HandshakeOptions {
12
- /** Maximum time that a forwarder waits for an owner to answer, in milliseconds. */
13
+ /** How long a forwarder waits for an owner to answer, in milliseconds. */
13
14
  timeoutMs: number;
14
15
  /** Attempts allowed before a cross-origin forwarder promotes itself to sender. */
15
16
  maxAttempts: number;
@@ -18,17 +19,29 @@ export interface HandshakeOptions {
18
19
  export declare const HANDSHAKE_OPTIONS: HandshakeOptions;
19
20
  /** Callbacks for handling records and journey events from connected realms. */
20
21
  export interface BusHandlers {
21
- /** Adopts the delivery context of the owner. False refuses a different identity. */
22
+ /** Adopts the owner's delivery context. Returning false refuses a different identity. */
22
23
  onSecurityContext?: (id: string) => boolean;
23
24
  /** Processes records forwarded from child contexts. */
24
25
  onRecords: (records: LogRecord[]) => void;
26
+ /**
27
+ * Returns true while the runtime is paused. A paused forwarder hands a child's records to
28
+ * onRecords, which drops them, instead of relaying them upstream.
29
+ */
30
+ paused?: () => boolean;
25
31
  /** Applies journey updates received from the control bus. */
26
32
  onJourney: (journey: Journey | null) => void;
27
33
  /** Returns the active journey to a child context that requests it. */
28
34
  onJourneyRequest: () => Journey | null;
29
35
  /** Runs when two windows use the same tab identifier. */
30
36
  onTabConflict: () => void;
31
- /** Slot of the runtime for the remote sampling rules. The bus reads it and fills it. */
37
+ /**
38
+ * Runs this context's own flush for a child that asked, with the child's time limit. Without
39
+ * it, the bus answers no flush request.
40
+ * @param timeoutMs How long the flush waits, in milliseconds, already in range.
41
+ * @returns The flush result.
42
+ */
43
+ onFlush?: (timeoutMs: number) => Promise<FlushResult>;
44
+ /** The runtime's slot for the remote sampling rules. The bus both reads and fills it. */
32
45
  remote: RemoteSlot;
33
46
  }
34
47
  /** Coordinates cross-realm communication, role resolution, and message dispatch. */
@@ -46,11 +59,11 @@ export declare class Bus {
46
59
  private readonly rates;
47
60
  /** Message counts for each named source or link in the current rate window. */
48
61
  private readonly channelRates;
49
- /** Reply of each same-origin child on the direct link. A weak reply frees a navigated frame. */
62
+ /** Each same-origin direct child's reply. Held weakly so a navigated frame can be freed. */
50
63
  private readonly directReplies;
51
64
  /**
52
- * Checks if this source can receive a control message. A window can read a message
53
- * even when its address names another window.
65
+ * Checks whether this source may receive a control message. A window can read a message
66
+ * even when it is addressed to another window.
54
67
  * @param message Control message to send.
55
68
  * @param peer Window or worker that receives the message.
56
69
  * @returns True if the source has the required permission.
@@ -81,19 +94,19 @@ export declare class Bus {
81
94
  */
82
95
  private passContext;
83
96
  /**
84
- * Sends a security context message to each same-origin child on the direct link.
85
- * It drops a child that is closed, freed or no longer permitted.
97
+ * Sends a security context message to every same-origin child on the direct link, dropping
98
+ * any child that is closed, freed or no longer permitted.
86
99
  * @param message Security context message.
87
100
  */
88
101
  private postToDirectChildren;
89
102
  /**
90
- * Keeps the reply of a direct child for the next context id. It drops each closed child.
91
- * A removed frame then does not keep its document in memory.
92
- * @param peer Window of the child.
93
- * @param reply Reply callback of the child.
103
+ * Keeps a direct child's reply callback for the next context id. Closed children are dropped
104
+ * along the way, so a removed frame doesn't keep its document in memory.
105
+ * @param peer The child's window.
106
+ * @param reply The child's reply callback.
94
107
  */
95
108
  private keepDirectReply;
96
- /** Current bus role. The default is "sender". */
109
+ /** Current bus role. Defaults to "sender". */
97
110
  private role;
98
111
  /** Upstream forwarding link, or null when acting as sender. */
99
112
  private upstream;
@@ -105,14 +118,22 @@ export declare class Bus {
105
118
  private isOpenFinProvider;
106
119
  /** Timer that asks the upstream owner for the remote sampling rules. */
107
120
  private rulesPoll;
108
- /** True after destroy(). A handshake that ends later must not start a timer. */
121
+ /** True after destroy(), so a handshake that finishes later doesn't start a timer. */
109
122
  private destroyed;
110
- /** Context id of the owner that answered the handshake. Null with no handshake. */
123
+ /** Context id of the owner that answered the handshake. Null if there was no handshake. */
111
124
  private ownerId;
112
- /** Transport identity of the owner from the handshake. */
125
+ /** The owner's transport identity, taken from the handshake. */
113
126
  private ownerPeer?;
114
127
  /** Active handshake state awaiting welcome response. */
115
128
  private awaitingWelcome;
129
+ /** This forwarder's flush requests that wait for an answer, by request id. */
130
+ private readonly flushAnswers;
131
+ /** Children's flush requests that wait for the flush after the one that runs. */
132
+ private flushQueue;
133
+ /** True while a flush that a child asked for runs, or waits for its gap. */
134
+ private flushing;
135
+ /** Epoch time in milliseconds when the last flush for a child started. */
136
+ private flushedAt;
116
137
  /**
117
138
  * @param config Active configuration instance.
118
139
  * @param diagnostics Diagnostics reporter.
@@ -132,8 +153,18 @@ export declare class Bus {
132
153
  /**
133
154
  * Forwards records to the upstream owner if configured.
134
155
  * @param records Batch of log records to send.
156
+ * @returns How many records went upstream. A record above the size limit doesn't go.
157
+ */
158
+ sendRecords(records: LogRecord[]): number;
159
+ /**
160
+ * Asks the upstream sender to flush, then waits for its answer. The records that went before
161
+ * the request on the same link are in the sender's snapshot, because a link keeps its order.
162
+ * @param timeoutMs The time this context has left, in milliseconds. The sender uses it as its
163
+ * own limit.
164
+ * @param expired Resolves when this context stops waiting.
165
+ * @returns The sender's result, or null when no valid answer came in time.
135
166
  */
136
- sendRecords(records: LogRecord[]): void;
167
+ requestFlush(timeoutMs: number, expired: Promise<void>): Promise<FlushResult | null>;
137
168
  /**
138
169
  * Synchronously processes direct messages from same-origin child contexts.
139
170
  * @param message Received bus message.
@@ -146,7 +177,7 @@ export declare class Bus {
146
177
  */
147
178
  attachWorker(worker: WorkerLike, options?: SourceOptions): () => void;
148
179
  /**
149
- * Sends journey state changes over each link of the journey scope.
180
+ * Sends journey state changes over every link in the journey scope.
150
181
  * @param journey Active journey or null if ended.
151
182
  */
152
183
  broadcastJourney(journey: Journey | null): void;
@@ -156,7 +187,7 @@ export declare class Bus {
156
187
  private allLinks;
157
188
  /** Sends a message only over links of the given kind. */
158
189
  private postOver;
159
- /** Sends a journey message over each link of the journey scope. */
190
+ /** Sends a journey message over every link in the journey scope. */
160
191
  private postJourney;
161
192
  /** Routes incoming messages to registered handlers or upstream targets. */
162
193
  private readonly receive;
@@ -169,42 +200,62 @@ export declare class Bus {
169
200
  */
170
201
  private acceptsMessage;
171
202
  /**
172
- * Runs the source, budget, shape and permission checks. Each check returns false, not an error.
173
- * A flood of rejected messages then makes no stack traces.
203
+ * Runs the source, budget, shape and permission checks. A failed check returns false instead
204
+ * of throwing, so a flood of rejected messages builds no stack traces. Only the JSON encoding
205
+ * can throw, and acceptsMessage catches that.
174
206
  * @param message Message from the source.
175
207
  * @param source Link and identity of the source.
176
208
  * @param child True if the source is a child of this context.
177
- * @returns True if the message passes each check.
209
+ * @returns True if the message passes every check.
178
210
  */
179
211
  private passesChecks;
180
212
  /**
181
- * Gives an accepted message to its handler or the upstream link.
213
+ * Hands an accepted message to its handler or to the upstream link.
182
214
  * @param message Message that passed the source and shape checks.
183
215
  * @param source Link and identity of the source.
184
216
  */
185
217
  private routeMessage;
186
218
  /**
187
- * Answers the source of a message. A link that can address one source sends to it only.
219
+ * Queues a child's flush request. The first request runs its flush alone, and the requests
220
+ * that arrive meanwhile share one flush after it, so a flood has one flush running at most.
221
+ * @param message The request.
222
+ * @param source Link and identity of the child, which gets the answer.
223
+ */
224
+ private queueFlush;
225
+ /**
226
+ * Runs one flush for the waiting requests, and one more while new requests wait. Two flushes
227
+ * start at least BUS_FLUSH_GAP_MS apart, and a request in the gap joins the next one.
228
+ */
229
+ private runFlushes;
230
+ /**
231
+ * Hands a flush answer to the request that waits for it. Only the upstream owner can answer,
232
+ * because a sibling on a shared link can read the request's id.
233
+ * @param message The answer.
234
+ * @param source Link and identity of the sender of the answer.
235
+ */
236
+ private settleFlush;
237
+ /**
238
+ * Answers whoever sent a message. A link that can address a single source sends to it only.
188
239
  * @param source Link and identity of the source.
189
240
  * @param message Answer to send.
190
241
  */
191
242
  private answer;
192
243
  /**
193
- * Tells if records from a link can go upstream. Records that go back on
194
- * their arrival link return to their sender. A direct link is an exception.
195
- * Each direct link is one call into one parent. Thus two direct links in a
196
- * chain are different links.
244
+ * Checks whether records from a link can go upstream. Records sent back out on the link
245
+ * they arrived on would return to their sender. A direct link is the exception, because
246
+ * each one is a single call into one parent, so two direct links in a chain are
247
+ * different links.
197
248
  * @param link Kind of the link the records arrived on.
198
249
  * @returns True if the relay is safe.
199
250
  */
200
251
  private canRelay;
201
- /** Returns true if this context can be the owner of the given link type. */
252
+ /** Checks whether this context can own the given link type. */
202
253
  private canOwn;
203
- /** Finds if this context is the OpenFin platform provider. */
254
+ /** Works out whether this context is the OpenFin platform provider. */
204
255
  private resolveOpenFinProvider;
205
256
  /** Resolves the handshake orphan policy for the current platform context. */
206
257
  private orphanPolicy;
207
- /** Tests if a cross-origin boundary blocks access to the parent window. */
258
+ /** Checks whether a cross-origin boundary blocks access to the parent window. */
208
259
  private isCrossOriginFrame;
209
260
  /** Identifies the candidate upstream link based on platform hierarchy. */
210
261
  private candidateUpstream;
@@ -215,66 +266,66 @@ export declare class Bus {
215
266
  /** Returns the singleton OpenFin InterApplicationBus link. */
216
267
  private ensureOpenFinLink;
217
268
  /**
218
- * Executes a hello/welcome handshake over candidate link.
269
+ * Runs a hello/welcome handshake over the candidate link.
219
270
  * @param candidate Upstream link candidate.
220
- * @returns True if welcome response arrived before timeout.
271
+ * @returns True if the welcome arrived before the timeout.
221
272
  */
222
273
  private handshake;
223
274
  /** Broadcasts tab claim and queries existing journey state. */
224
275
  private announce;
225
276
  /**
226
- * Resolves the journey scope. "auto" gives "origin" in OpenFin and "tab" in a browser.
227
- * @returns The scope in force.
277
+ * Resolves the journey scope. "auto" becomes "origin" in OpenFin and "tab" in a browser.
278
+ * @returns The scope in effect.
228
279
  */
229
280
  private journeyScope;
230
281
  /**
231
- * Tests if a link carries journey messages in the scope in force.
232
- * Only "origin" uses the broadcast link. That link reaches each tab of the origin.
282
+ * Checks whether a link carries journey messages in the current scope.
283
+ * Only "origin" uses the broadcast link, which reaches every tab on the origin.
233
284
  * @param link Link kind.
234
285
  * @returns True if the link carries journey messages.
235
286
  */
236
287
  private journeyLink;
237
288
  /**
238
- * Tests if this context adopts a journey message.
289
+ * Checks whether this context adopts a journey message.
239
290
  * @param message Journey message.
240
291
  * @param source Link and origin of the message.
241
- * @returns True for a message on a journey link, to this context, from an accepted sender.
242
- * In "tab" scope, only the owner of a forwarder is an accepted sender.
292
+ * @returns True for a message on a journey link, addressed to this context, from an accepted
293
+ * sender. In "tab" scope, the only accepted sender is a forwarder's owner.
243
294
  */
244
295
  private acceptsJourney;
245
296
  /**
246
- * Tests if a message comes from the upstream owner of this forwarder.
297
+ * Checks whether a message comes from this forwarder's upstream owner.
247
298
  * @param from Context id of the sender.
248
299
  * @param link Link kind of the message.
249
300
  * @returns True for the upstream link and, after a handshake, the owner that answered it.
250
301
  */
251
302
  private fromOwner;
252
303
  /**
253
- * Parses a journey payload from another realm and gives it to the runtime.
304
+ * Parses a journey payload from another realm and hands it to the runtime.
254
305
  * @param payload Journey, or null when the journey ended.
255
306
  */
256
307
  private applyJourney;
257
308
  /**
258
- * Builds the answer to a sampling question. Null rules end the copy of the forwarder.
309
+ * Builds the answer to a sampling question. Null rules clear the forwarder's copy.
259
310
  * @param to Context id of the forwarder that asked.
260
311
  * @returns The answer.
261
312
  */
262
313
  private rulesAnswer;
263
314
  /**
264
- * Tests if this context accepts sampling rules from a source.
315
+ * Checks whether this context accepts sampling rules from a source.
265
316
  * @param to Context id that the answer names.
266
317
  * @param source Link and origin of the answer.
267
318
  * @returns True only for an answer from the upstream owner to this context.
268
319
  */
269
320
  private acceptsRules;
270
321
  /**
271
- * Applies the rules of an answer. It ignores rules that are not valid.
272
- * @param raw Rules of the answer, or null when the upstream has none.
322
+ * Applies the rules from an answer, ignoring any that are invalid.
323
+ * @param raw The answer's rules, or null when the upstream has none.
273
324
  */
274
325
  private applyRules;
275
326
  /**
276
- * Asks the upstream owner for the remote sampling rules now, then at each poll interval.
277
- * A direct link cannot push the rules to a child. A poll works on each link kind.
327
+ * Asks the upstream owner for the remote sampling rules now, then on every poll interval.
328
+ * A direct link can't push the rules to a child, but a poll works on every link kind.
278
329
  */
279
330
  private pollRules;
280
331
  }
@@ -0,0 +1,132 @@
1
+ import type { Diagnostics } from "../core/diagnostics.cjs";
2
+ import { type BusMessage, type LinkKind, type MessageSource } from "../models/bus.cjs";
3
+ /** Bidirectional communication channel for bus message transport. */
4
+ export interface Link {
5
+ /** Channel transport kind. */
6
+ readonly kind: LinkKind;
7
+ /**
8
+ * Sends a message over the channel without throwing.
9
+ * @param message Bus message to transmit.
10
+ */
11
+ post(message: BusMessage): void;
12
+ /** Releases listeners, subscriptions, or channels held open by the link. */
13
+ close(): void;
14
+ }
15
+ /**
16
+ * Callback invoked when a bus message arrives on a link.
17
+ * @param message Received bus message.
18
+ * @param source Origin and link metadata.
19
+ */
20
+ export type Receive = (message: BusMessage, source: MessageSource) => void;
21
+ /** Interface that a same-origin parent runtime exposes on a global symbol. */
22
+ export interface DirectHost {
23
+ /**
24
+ * The parent's bus protocol tag. A direct call has no envelope to carry it, so the child
25
+ * compares it before it opens the link. A parent on 0.12 or older has no tag.
26
+ */
27
+ readonly protocol?: string;
28
+ /**
29
+ * Accepts a message directly from a child frame and replies synchronously.
30
+ * @param message Child bus message.
31
+ * @param reply Callback for synchronous response.
32
+ */
33
+ busAccept(message: BusMessage, reply: Receive, source?: Window): void;
34
+ /**
35
+ * Checks if the parent permits a direct link from the child window.
36
+ * @param source Child window.
37
+ * @param origin Origin of the child window.
38
+ * @returns True if the parent permits this source.
39
+ */
40
+ busCanAccept?: (source: Window, origin: string) => boolean;
41
+ }
42
+ /** Message port or dedicated/shared worker interface. */
43
+ export interface WorkerLike {
44
+ /**
45
+ * Sends a message to the worker or port.
46
+ * @param message Payload to send.
47
+ */
48
+ postMessage(message: unknown): void;
49
+ /**
50
+ * Subscribes to incoming message events.
51
+ * @param type Event name ("message").
52
+ * @param listener Event handler callback.
53
+ */
54
+ addEventListener(type: "message", listener: (event: MessageEvent) => void): void;
55
+ /**
56
+ * Unsubscribes from message events.
57
+ * @param type Event name ("message").
58
+ * @param listener Event handler to remove.
59
+ */
60
+ removeEventListener(type: "message", listener: (event: MessageEvent) => void): void;
61
+ /** Starts message delivery on MessagePort instances. */
62
+ start?: () => void;
63
+ }
64
+ /**
65
+ * Returns the origin this frame runs on. A srcdoc or about:blank frame runs on the origin of
66
+ * the document that made it, but its location.origin reads "null", because that comes from
67
+ * the URL.
68
+ * @returns location.origin, or the origin global when location.origin is "null". A frame
69
+ * sandboxed from a URL keeps its URL origin here, and the parent refuses its "null" messages.
70
+ */
71
+ export declare function frameOrigin(): string;
72
+ /**
73
+ * Establishes direct synchronous communication with a same-origin parent runtime.
74
+ * @param receive Callback for parent replies.
75
+ * @param diagnostics Diagnostics reporter.
76
+ * @returns Direct link, or null if the parent is inaccessible, lacks a runtime, uses another
77
+ * bus protocol or refuses this frame. When it is null, the bus tries the message link to the
78
+ * parent.
79
+ */
80
+ export declare function createDirectLink(receive: Receive, diagnostics: Diagnostics): Link | null;
81
+ /**
82
+ * Creates a postMessage link to a parent window on a trusted origin. Records hold user data,
83
+ * so a page on another origin that frames this app must not get them.
84
+ * @param receive Callback for incoming parent messages.
85
+ * @param trustedOrigins Parent origins that may receive the records, in addition to this origin.
86
+ * @param diagnostics Diagnostics reporter.
87
+ * @returns Link to the parent window, or null at the top level or with an untrusted parent.
88
+ * When it is null, this context sends its own records.
89
+ */
90
+ export declare function createParentLink(receive: Receive, trustedOrigins: string[], diagnostics: Diagnostics): Link | null;
91
+ /**
92
+ * Creates a link listening to child frames with origin allowlist filtering.
93
+ * @param receive Callback for messages from authorized child frames.
94
+ * @param trustedOrigins Additional origins allowed to communicate.
95
+ * @param diagnostics Diagnostics reporter.
96
+ * @returns Children link, or null in non-window environments.
97
+ */
98
+ export declare function createChildrenLink(receive: Receive, trustedOrigins: string[], diagnostics: Diagnostics, authorize?: (source: MessageEventSource | null, origin: string) => boolean, mayPost?: (message: BusMessage, source: MessageEventSource) => boolean): Link | null;
99
+ /**
100
+ * Creates a same-origin BroadcastChannel link for cross-tab control messages.
101
+ * @param channelName BroadcastChannel identifier.
102
+ * @param receive Callback for incoming cross-tab messages.
103
+ * @param diagnostics Diagnostics reporter.
104
+ * @returns Broadcast link, or null if unsupported.
105
+ */
106
+ export declare function createBroadcastLink(channelName: string, receive: Receive, diagnostics: Diagnostics): Link | null;
107
+ /**
108
+ * Creates an OpenFin InterApplicationBus link scoped to one application.
109
+ * @param topic InterApplicationBus topic prefix.
110
+ * @param appUuid OpenFin application uuid owning this context.
111
+ * @param receive Callback for received topic messages.
112
+ * @param diagnostics Diagnostics reporter.
113
+ * @returns OpenFin link, or null if InterApplicationBus or the identity is unavailable.
114
+ */
115
+ export declare function createOpenFinLink(topic: string, appUuid: string | undefined, receive: Receive, diagnostics: Diagnostics): Link | null;
116
+ /**
117
+ * Creates the worker-side link pointing at the document that created this
118
+ * worker. Emits `kind: "owner"`.
119
+ * @param receive Callback for incoming messages from the owning document.
120
+ * @param diagnostics Diagnostics reporter.
121
+ * @returns Owner link, or null outside a DedicatedWorkerGlobalScope.
122
+ */
123
+ export declare function createOwnerLink(receive: Receive, diagnostics: Diagnostics): Link | null;
124
+ /**
125
+ * Creates the document-side link pointing at one attached worker or port.
126
+ * Emits `kind: "worker"`.
127
+ * @param worker Target worker instance or MessagePort.
128
+ * @param receive Callback for messages from the worker.
129
+ * @param diagnostics Diagnostics reporter.
130
+ * @returns Document-to-worker link.
131
+ */
132
+ export declare function createWorkerLink(worker: WorkerLike, receive: Receive, diagnostics: Diagnostics): Link;
@@ -1,5 +1,5 @@
1
- import type { Diagnostics } from "../core/diagnostics";
2
- import { type BusMessage, type LinkKind, type MessageSource } from "../models/bus";
1
+ import type { Diagnostics } from "../core/diagnostics.js";
2
+ import { type BusMessage, type LinkKind, type MessageSource } from "../models/bus.js";
3
3
  /** Bidirectional communication channel for bus message transport. */
4
4
  export interface Link {
5
5
  /** Channel transport kind. */
@@ -20,6 +20,11 @@ export interface Link {
20
20
  export type Receive = (message: BusMessage, source: MessageSource) => void;
21
21
  /** Interface that a same-origin parent runtime exposes on a global symbol. */
22
22
  export interface DirectHost {
23
+ /**
24
+ * The parent's bus protocol tag. A direct call has no envelope to carry it, so the child
25
+ * compares it before it opens the link. A parent on 0.12 or older has no tag.
26
+ */
27
+ readonly protocol?: string;
23
28
  /**
24
29
  * Accepts a message directly from a child frame and replies synchronously.
25
30
  * @param message Child bus message.
@@ -56,21 +61,31 @@ export interface WorkerLike {
56
61
  /** Starts message delivery on MessagePort instances. */
57
62
  start?: () => void;
58
63
  }
64
+ /**
65
+ * Returns the origin this frame runs on. A srcdoc or about:blank frame runs on the origin of
66
+ * the document that made it, but its location.origin reads "null", because that comes from
67
+ * the URL.
68
+ * @returns location.origin, or the origin global when location.origin is "null". A frame
69
+ * sandboxed from a URL keeps its URL origin here, and the parent refuses its "null" messages.
70
+ */
71
+ export declare function frameOrigin(): string;
59
72
  /**
60
73
  * Establishes direct synchronous communication with a same-origin parent runtime.
61
74
  * @param receive Callback for parent replies.
62
75
  * @param diagnostics Diagnostics reporter.
63
- * @returns Direct link, or null if parent is inaccessible or lacks a runtime.
76
+ * @returns Direct link, or null if the parent is inaccessible, lacks a runtime, uses another
77
+ * bus protocol or refuses this frame. When it is null, the bus tries the message link to the
78
+ * parent.
64
79
  */
65
80
  export declare function createDirectLink(receive: Receive, diagnostics: Diagnostics): Link | null;
66
81
  /**
67
- * Creates a postMessage link to a parent window on a trusted origin. Records hold user data.
68
- * A page on another origin that frames this app must not get them.
82
+ * Creates a postMessage link to a parent window on a trusted origin. Records hold user data,
83
+ * so a page on another origin that frames this app must not get them.
69
84
  * @param receive Callback for incoming parent messages.
70
- * @param trustedOrigins Origins of a parent that can get the records, in addition to this origin.
85
+ * @param trustedOrigins Parent origins that may receive the records, in addition to this origin.
71
86
  * @param diagnostics Diagnostics reporter.
72
87
  * @returns Link to the parent window, or null at the top level or with an untrusted parent.
73
- * With null, this context sends its own records.
88
+ * When it is null, this context sends its own records.
74
89
  */
75
90
  export declare function createParentLink(receive: Receive, trustedOrigins: string[], diagnostics: Diagnostics): Link | null;
76
91
  /**
@@ -0,0 +1,16 @@
1
+ import type { BusMessage } from "../models/bus.cjs";
2
+ import type { FlushResult } from "../models/health.cjs";
3
+ /**
4
+ * Checks the fields that each bus message type requires. unwrap() only checks the envelope.
5
+ * @param value Message to check.
6
+ * @returns True if the message has the required fields and values.
7
+ */
8
+ export declare function validMessage(value: unknown): value is BusMessage;
9
+ /**
10
+ * Copies a flush result from another context and checks the copy. Each field is read once, so
11
+ * a getter can't pass the check with one value and hand over another.
12
+ * @param value The answer's result.
13
+ * @returns The copy, or null when the status is unknown or a count isn't a safe integer of 0
14
+ * or more.
15
+ */
16
+ export declare function readFlushResult(value: unknown): FlushResult | null;
@@ -1,7 +1,16 @@
1
- import type { BusMessage } from "../models/bus";
1
+ import type { BusMessage } from "../models/bus.js";
2
+ import type { FlushResult } from "../models/health.js";
2
3
  /**
3
- * Checks the fields required by each bus message type. unwrap() checks the envelope only.
4
+ * Checks the fields that each bus message type requires. unwrap() only checks the envelope.
4
5
  * @param value Message to check.
5
6
  * @returns True if the message has the required fields and values.
6
7
  */
7
8
  export declare function validMessage(value: unknown): value is BusMessage;
9
+ /**
10
+ * Copies a flush result from another context and checks the copy. Each field is read once, so
11
+ * a getter can't pass the check with one value and hand over another.
12
+ * @param value The answer's result.
13
+ * @returns The copy, or null when the status is unknown or a count isn't a safe integer of 0
14
+ * or more.
15
+ */
16
+ export declare function readFlushResult(value: unknown): FlushResult | null;