heaplens-cli 0.0.0-stage → 0.1.1

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 (350) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +43 -2
  3. package/THIRD_PARTY_NOTICES.json +2199 -0
  4. package/bin/heaplens.cjs +72 -0
  5. package/distribution.json +1754 -0
  6. package/licenses/d3-LICENSE.txt +12 -0
  7. package/licenses/rust/aho-corasick-1.1.4/COPYING +3 -0
  8. package/licenses/rust/aho-corasick-1.1.4/LICENSE-MIT +21 -0
  9. package/licenses/rust/anstream-0.6.21/LICENSE-APACHE +202 -0
  10. package/licenses/rust/anstream-0.6.21/LICENSE-MIT +19 -0
  11. package/licenses/rust/anstyle-1.0.13/LICENSE-APACHE +202 -0
  12. package/licenses/rust/anstyle-1.0.13/LICENSE-MIT +19 -0
  13. package/licenses/rust/anstyle-parse-0.2.7/LICENSE-APACHE +202 -0
  14. package/licenses/rust/anstyle-parse-0.2.7/LICENSE-MIT +19 -0
  15. package/licenses/rust/anstyle-query-1.1.5/LICENSE-APACHE +202 -0
  16. package/licenses/rust/anstyle-query-1.1.5/LICENSE-MIT +19 -0
  17. package/licenses/rust/anyhow-1.0.100/LICENSE-APACHE +176 -0
  18. package/licenses/rust/anyhow-1.0.100/LICENSE-MIT +23 -0
  19. package/licenses/rust/arrayvec-0.5.2/LICENSE-APACHE +201 -0
  20. package/licenses/rust/arrayvec-0.5.2/LICENSE-MIT +25 -0
  21. package/licenses/rust/arrayvec-0.7.8/LICENSE-APACHE +201 -0
  22. package/licenses/rust/arrayvec-0.7.8/LICENSE-MIT +25 -0
  23. package/licenses/rust/atomic-waker-1.1.2/LICENSE-APACHE +201 -0
  24. package/licenses/rust/atomic-waker-1.1.2/LICENSE-MIT +23 -0
  25. package/licenses/rust/atomic-waker-1.1.2/LICENSE-THIRD-PARTY +45 -0
  26. package/licenses/rust/autocfg-1.5.1/LICENSE-APACHE +201 -0
  27. package/licenses/rust/autocfg-1.5.1/LICENSE-MIT +25 -0
  28. package/licenses/rust/base64-0.22.1/LICENSE-APACHE +201 -0
  29. package/licenses/rust/base64-0.22.1/LICENSE-MIT +21 -0
  30. package/licenses/rust/base64-0.23.1/LICENSE-APACHE +201 -0
  31. package/licenses/rust/base64-0.23.1/LICENSE-MIT +21 -0
  32. package/licenses/rust/bitflags-1.3.2/LICENSE-APACHE +201 -0
  33. package/licenses/rust/bitflags-1.3.2/LICENSE-MIT +25 -0
  34. package/licenses/rust/bitflags-2.10.0/LICENSE-APACHE +201 -0
  35. package/licenses/rust/bitflags-2.10.0/LICENSE-MIT +25 -0
  36. package/licenses/rust/blake3-1.8.7/LICENSE_A2 +202 -0
  37. package/licenses/rust/blake3-1.8.7/LICENSE_A2LLVM +219 -0
  38. package/licenses/rust/blake3-1.8.7/LICENSE_CC0 +121 -0
  39. package/licenses/rust/bytes-1.11.0/LICENSE +25 -0
  40. package/licenses/rust/cc-1.6.0/LICENSE-APACHE +201 -0
  41. package/licenses/rust/cc-1.6.0/LICENSE-MIT +25 -0
  42. package/licenses/rust/cfg-if-1.0.4/LICENSE-APACHE +201 -0
  43. package/licenses/rust/cfg-if-1.0.4/LICENSE-MIT +25 -0
  44. package/licenses/rust/cfg_aliases-0.2.2/LICENSE +9 -0
  45. package/licenses/rust/cfg_aliases-0.2.2/NOTICES.md +26 -0
  46. package/licenses/rust/chacha20-0.10.2/LICENSE-APACHE +201 -0
  47. package/licenses/rust/chacha20-0.10.2/LICENSE-MIT +25 -0
  48. package/licenses/rust/chrono-0.4.45/LICENSE.txt +240 -0
  49. package/licenses/rust/clap-4.5.60/LICENSE-APACHE +202 -0
  50. package/licenses/rust/clap-4.5.60/LICENSE-MIT +19 -0
  51. package/licenses/rust/clap_builder-4.5.60/LICENSE-APACHE +202 -0
  52. package/licenses/rust/clap_builder-4.5.60/LICENSE-MIT +19 -0
  53. package/licenses/rust/clap_derive-4.5.55/LICENSE-APACHE +202 -0
  54. package/licenses/rust/clap_derive-4.5.55/LICENSE-MIT +19 -0
  55. package/licenses/rust/clap_lex-1.0.0/LICENSE-APACHE +202 -0
  56. package/licenses/rust/clap_lex-1.0.0/LICENSE-MIT +19 -0
  57. package/licenses/rust/colorchoice-1.0.4/LICENSE-APACHE +202 -0
  58. package/licenses/rust/colorchoice-1.0.4/LICENSE-MIT +19 -0
  59. package/licenses/rust/constant_time_eq-0.4.2/LICENSE-APACHE +176 -0
  60. package/licenses/rust/constant_time_eq-0.4.2/LICENSE-CC0 +121 -0
  61. package/licenses/rust/constant_time_eq-0.4.2/LICENSE-MIT0 +14 -0
  62. package/licenses/rust/core-foundation-sys-0.8.7/LICENSE-APACHE +201 -0
  63. package/licenses/rust/core-foundation-sys-0.8.7/LICENSE-MIT +25 -0
  64. package/licenses/rust/crossbeam-deque-0.8.6/LICENSE-APACHE +201 -0
  65. package/licenses/rust/crossbeam-deque-0.8.6/LICENSE-MIT +27 -0
  66. package/licenses/rust/crossbeam-epoch-0.9.18/LICENSE-APACHE +201 -0
  67. package/licenses/rust/crossbeam-epoch-0.9.18/LICENSE-MIT +27 -0
  68. package/licenses/rust/crossbeam-utils-0.8.21/LICENSE-APACHE +201 -0
  69. package/licenses/rust/crossbeam-utils-0.8.21/LICENSE-MIT +27 -0
  70. package/licenses/rust/displaydoc-0.2.7/LICENSE-APACHE +201 -0
  71. package/licenses/rust/displaydoc-0.2.7/LICENSE-MIT +23 -0
  72. package/licenses/rust/either-1.15.0/LICENSE-APACHE +201 -0
  73. package/licenses/rust/either-1.15.0/LICENSE-MIT +25 -0
  74. package/licenses/rust/env_filter-0.1.4/LICENSE-APACHE +202 -0
  75. package/licenses/rust/env_filter-0.1.4/LICENSE-MIT +19 -0
  76. package/licenses/rust/env_logger-0.11.8/LICENSE-APACHE +202 -0
  77. package/licenses/rust/env_logger-0.11.8/LICENSE-MIT +19 -0
  78. package/licenses/rust/equivalent-1.0.2/LICENSE-APACHE +201 -0
  79. package/licenses/rust/equivalent-1.0.2/LICENSE-MIT +25 -0
  80. package/licenses/rust/errno-0.3.14/LICENSE-APACHE +201 -0
  81. package/licenses/rust/errno-0.3.14/LICENSE-MIT +25 -0
  82. package/licenses/rust/fastrand-2.3.0/LICENSE-APACHE +201 -0
  83. package/licenses/rust/fastrand-2.3.0/LICENSE-MIT +23 -0
  84. package/licenses/rust/find-msvc-tools-0.1.14/LICENSE-APACHE +201 -0
  85. package/licenses/rust/find-msvc-tools-0.1.14/LICENSE-MIT +25 -0
  86. package/licenses/rust/fixedbitset-0.4.2/LICENSE-APACHE +201 -0
  87. package/licenses/rust/fixedbitset-0.4.2/LICENSE-MIT +25 -0
  88. package/licenses/rust/form_urlencoded-1.2.2/LICENSE-APACHE +201 -0
  89. package/licenses/rust/form_urlencoded-1.2.2/LICENSE-MIT +25 -0
  90. package/licenses/rust/futures-channel-0.3.34/LICENSE-APACHE +202 -0
  91. package/licenses/rust/futures-channel-0.3.34/LICENSE-MIT +26 -0
  92. package/licenses/rust/futures-core-0.3.34/LICENSE-APACHE +202 -0
  93. package/licenses/rust/futures-core-0.3.34/LICENSE-MIT +26 -0
  94. package/licenses/rust/futures-io-0.3.34/LICENSE-APACHE +202 -0
  95. package/licenses/rust/futures-io-0.3.34/LICENSE-MIT +26 -0
  96. package/licenses/rust/futures-sink-0.3.34/LICENSE-APACHE +202 -0
  97. package/licenses/rust/futures-sink-0.3.34/LICENSE-MIT +26 -0
  98. package/licenses/rust/futures-task-0.3.34/LICENSE-APACHE +202 -0
  99. package/licenses/rust/futures-task-0.3.34/LICENSE-MIT +26 -0
  100. package/licenses/rust/futures-util-0.3.34/LICENSE-APACHE +202 -0
  101. package/licenses/rust/futures-util-0.3.34/LICENSE-MIT +26 -0
  102. package/licenses/rust/getrandom-0.2.17/LICENSE-APACHE +201 -0
  103. package/licenses/rust/getrandom-0.2.17/LICENSE-MIT +26 -0
  104. package/licenses/rust/getrandom-0.3.4/LICENSE-APACHE +201 -0
  105. package/licenses/rust/getrandom-0.3.4/LICENSE-MIT +26 -0
  106. package/licenses/rust/getrandom-0.4.3/LICENSE-APACHE +201 -0
  107. package/licenses/rust/getrandom-0.4.3/LICENSE-MIT +26 -0
  108. package/licenses/rust/getset-0.0.9/LICENSE +21 -0
  109. package/licenses/rust/hashbrown-0.16.1/LICENSE-APACHE +201 -0
  110. package/licenses/rust/hashbrown-0.16.1/LICENSE-MIT +25 -0
  111. package/licenses/rust/heck-0.3.3/LICENSE-APACHE +201 -0
  112. package/licenses/rust/heck-0.3.3/LICENSE-MIT +25 -0
  113. package/licenses/rust/heck-0.5.0/LICENSE-APACHE +201 -0
  114. package/licenses/rust/heck-0.5.0/LICENSE-MIT +25 -0
  115. package/licenses/rust/http-1.5.0/LICENSE-APACHE +201 -0
  116. package/licenses/rust/http-1.5.0/LICENSE-MIT +25 -0
  117. package/licenses/rust/http-body-1.1.0/LICENSE +25 -0
  118. package/licenses/rust/http-body-util-0.1.5/LICENSE +25 -0
  119. package/licenses/rust/httparse-1.10.1/LICENSE-APACHE +201 -0
  120. package/licenses/rust/httparse-1.10.1/LICENSE-MIT +20 -0
  121. package/licenses/rust/hyper-1.12.0/LICENSE +19 -0
  122. package/licenses/rust/hyper-rustls-0.27.10/LICENSE-APACHE +201 -0
  123. package/licenses/rust/hyper-rustls-0.27.10/LICENSE-ISC +15 -0
  124. package/licenses/rust/hyper-rustls-0.27.10/LICENSE-MIT +25 -0
  125. package/licenses/rust/hyper-util-0.1.21/LICENSE +19 -0
  126. package/licenses/rust/iana-time-zone-0.1.65/LICENSE-APACHE +201 -0
  127. package/licenses/rust/iana-time-zone-0.1.65/LICENSE-MIT +25 -0
  128. package/licenses/rust/icu_collections-2.3.0/LICENSE +46 -0
  129. package/licenses/rust/icu_locale_core-2.3.0/LICENSE +46 -0
  130. package/licenses/rust/icu_normalizer-2.3.0/LICENSE +46 -0
  131. package/licenses/rust/icu_normalizer_data-2.3.0/LICENSE +46 -0
  132. package/licenses/rust/icu_properties-2.3.0/LICENSE +46 -0
  133. package/licenses/rust/icu_properties_data-2.3.0/LICENSE +46 -0
  134. package/licenses/rust/icu_provider-2.3.1/LICENSE +46 -0
  135. package/licenses/rust/idna-1.1.0/LICENSE-APACHE +201 -0
  136. package/licenses/rust/idna-1.1.0/LICENSE-MIT +25 -0
  137. package/licenses/rust/idna_adapter-1.2.2/LICENSE-APACHE +201 -0
  138. package/licenses/rust/idna_adapter-1.2.2/LICENSE-MIT +25 -0
  139. package/licenses/rust/indexmap-2.13.0/LICENSE-APACHE +201 -0
  140. package/licenses/rust/indexmap-2.13.0/LICENSE-MIT +25 -0
  141. package/licenses/rust/ipnet-2.12.2/LICENSE-APACHE +201 -0
  142. package/licenses/rust/ipnet-2.12.2/LICENSE-MIT +7 -0
  143. package/licenses/rust/is_terminal_polyfill-1.70.2/LICENSE-APACHE +202 -0
  144. package/licenses/rust/is_terminal_polyfill-1.70.2/LICENSE-MIT +19 -0
  145. package/licenses/rust/itoa-1.0.17/LICENSE-APACHE +176 -0
  146. package/licenses/rust/itoa-1.0.17/LICENSE-MIT +23 -0
  147. package/licenses/rust/jiff-0.2.18/COPYING +3 -0
  148. package/licenses/rust/jiff-0.2.18/LICENSE-MIT +21 -0
  149. package/licenses/rust/jvm-hprof-0.1.0/LICENSE.txt +36 -0
  150. package/licenses/rust/lexical-core-0.7.6/LICENSE-APACHE +201 -0
  151. package/licenses/rust/lexical-core-0.7.6/LICENSE-MIT +23 -0
  152. package/licenses/rust/libc-0.2.180/LICENSE-APACHE +176 -0
  153. package/licenses/rust/libc-0.2.180/LICENSE-MIT +25 -0
  154. package/licenses/rust/litemap-0.8.3/LICENSE +46 -0
  155. package/licenses/rust/lock_api-0.4.14/LICENSE-APACHE +201 -0
  156. package/licenses/rust/lock_api-0.4.14/LICENSE-MIT +25 -0
  157. package/licenses/rust/log-0.4.29/LICENSE-APACHE +201 -0
  158. package/licenses/rust/log-0.4.29/LICENSE-MIT +25 -0
  159. package/licenses/rust/lru-slab-0.1.3/LICENSE-APACHE +202 -0
  160. package/licenses/rust/lru-slab-0.1.3/LICENSE-MIT +7 -0
  161. package/licenses/rust/lru-slab-0.1.3/LICENSE-ZLIB +19 -0
  162. package/licenses/rust/memchr-2.7.6/COPYING +3 -0
  163. package/licenses/rust/memchr-2.7.6/LICENSE-MIT +21 -0
  164. package/licenses/rust/memmap2-0.9.9/LICENSE-APACHE +201 -0
  165. package/licenses/rust/memmap2-0.9.9/LICENSE-MIT +26 -0
  166. package/licenses/rust/mio-1.1.1/LICENSE +19 -0
  167. package/licenses/rust/nom-5.1.3/LICENSE +20 -0
  168. package/licenses/rust/num-traits-0.2.19/LICENSE-APACHE +201 -0
  169. package/licenses/rust/num-traits-0.2.19/LICENSE-MIT +25 -0
  170. package/licenses/rust/once_cell-1.21.3/LICENSE-APACHE +201 -0
  171. package/licenses/rust/once_cell-1.21.3/LICENSE-MIT +23 -0
  172. package/licenses/rust/parking_lot-0.12.5/LICENSE-APACHE +201 -0
  173. package/licenses/rust/parking_lot-0.12.5/LICENSE-MIT +25 -0
  174. package/licenses/rust/parking_lot_core-0.9.12/LICENSE-APACHE +201 -0
  175. package/licenses/rust/parking_lot_core-0.9.12/LICENSE-MIT +25 -0
  176. package/licenses/rust/percent-encoding-2.3.2/LICENSE-APACHE +201 -0
  177. package/licenses/rust/percent-encoding-2.3.2/LICENSE-MIT +25 -0
  178. package/licenses/rust/petgraph-0.6.5/LICENSE-APACHE +201 -0
  179. package/licenses/rust/petgraph-0.6.5/LICENSE-MIT +25 -0
  180. package/licenses/rust/pin-project-lite-0.2.16/LICENSE-APACHE +177 -0
  181. package/licenses/rust/pin-project-lite-0.2.16/LICENSE-MIT +23 -0
  182. package/licenses/rust/potential_utf-0.1.6/LICENSE +46 -0
  183. package/licenses/rust/proc-macro2-1.0.105/LICENSE-APACHE +176 -0
  184. package/licenses/rust/proc-macro2-1.0.105/LICENSE-MIT +23 -0
  185. package/licenses/rust/quinn-0.11.12/LICENSE-APACHE +201 -0
  186. package/licenses/rust/quinn-0.11.12/LICENSE-MIT +7 -0
  187. package/licenses/rust/quinn-proto-0.11.19/LICENSE-APACHE +201 -0
  188. package/licenses/rust/quinn-proto-0.11.19/LICENSE-MIT +7 -0
  189. package/licenses/rust/quinn-udp-0.5.16/LICENSE-APACHE +201 -0
  190. package/licenses/rust/quinn-udp-0.5.16/LICENSE-MIT +7 -0
  191. package/licenses/rust/quote-1.0.47/LICENSE-APACHE +176 -0
  192. package/licenses/rust/quote-1.0.47/LICENSE-MIT +23 -0
  193. package/licenses/rust/rand-0.10.3/COPYRIGHT +12 -0
  194. package/licenses/rust/rand-0.10.3/LICENSE-APACHE +176 -0
  195. package/licenses/rust/rand-0.10.3/LICENSE-MIT +26 -0
  196. package/licenses/rust/rand_core-0.10.1/COPYRIGHT +9 -0
  197. package/licenses/rust/rand_core-0.10.1/LICENSE-APACHE +187 -0
  198. package/licenses/rust/rand_core-0.10.1/LICENSE-MIT +25 -0
  199. package/licenses/rust/rand_pcg-0.10.2/COPYRIGHT +12 -0
  200. package/licenses/rust/rand_pcg-0.10.2/LICENSE-APACHE +187 -0
  201. package/licenses/rust/rand_pcg-0.10.2/LICENSE-MIT +26 -0
  202. package/licenses/rust/rayon-1.11.0/LICENSE-APACHE +201 -0
  203. package/licenses/rust/rayon-1.11.0/LICENSE-MIT +25 -0
  204. package/licenses/rust/rayon-core-1.13.0/LICENSE-APACHE +201 -0
  205. package/licenses/rust/rayon-core-1.13.0/LICENSE-MIT +25 -0
  206. package/licenses/rust/regex-1.12.2/LICENSE-APACHE +201 -0
  207. package/licenses/rust/regex-1.12.2/LICENSE-MIT +25 -0
  208. package/licenses/rust/regex-automata-0.4.13/LICENSE-APACHE +201 -0
  209. package/licenses/rust/regex-automata-0.4.13/LICENSE-MIT +25 -0
  210. package/licenses/rust/regex-syntax-0.8.8/LICENSE-APACHE +201 -0
  211. package/licenses/rust/regex-syntax-0.8.8/LICENSE-MIT +25 -0
  212. package/licenses/rust/reqwest-0.12.28/LICENSE-APACHE +201 -0
  213. package/licenses/rust/reqwest-0.12.28/LICENSE-MIT +20 -0
  214. package/licenses/rust/ring-0.17.14/LICENSE +9 -0
  215. package/licenses/rust/ring-0.17.14/LICENSE-BoringSSL +272 -0
  216. package/licenses/rust/ring-0.17.14/LICENSE-other-bits +13 -0
  217. package/licenses/rust/rustc-hash-2.1.3/LICENSE-APACHE +176 -0
  218. package/licenses/rust/rustc-hash-2.1.3/LICENSE-MIT +23 -0
  219. package/licenses/rust/rustix-1.1.3/COPYRIGHT +29 -0
  220. package/licenses/rust/rustix-1.1.3/LICENSE-APACHE +201 -0
  221. package/licenses/rust/rustix-1.1.3/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
  222. package/licenses/rust/rustix-1.1.3/LICENSE-MIT +23 -0
  223. package/licenses/rust/rustls-0.23.45/LICENSE-APACHE +201 -0
  224. package/licenses/rust/rustls-0.23.45/LICENSE-ISC +15 -0
  225. package/licenses/rust/rustls-0.23.45/LICENSE-MIT +25 -0
  226. package/licenses/rust/rustls-pki-types-1.15.1/LICENSE-APACHE +201 -0
  227. package/licenses/rust/rustls-pki-types-1.15.1/LICENSE-MIT +25 -0
  228. package/licenses/rust/rustls-webpki-0.103.15/LICENSE +19 -0
  229. package/licenses/rust/ryu-1.0.22/LICENSE-APACHE +176 -0
  230. package/licenses/rust/ryu-1.0.22/LICENSE-BOOST +23 -0
  231. package/licenses/rust/scopeguard-1.2.0/LICENSE-APACHE +201 -0
  232. package/licenses/rust/scopeguard-1.2.0/LICENSE-MIT +25 -0
  233. package/licenses/rust/serde-1.0.228/LICENSE-APACHE +176 -0
  234. package/licenses/rust/serde-1.0.228/LICENSE-MIT +23 -0
  235. package/licenses/rust/serde_core-1.0.228/LICENSE-APACHE +176 -0
  236. package/licenses/rust/serde_core-1.0.228/LICENSE-MIT +23 -0
  237. package/licenses/rust/serde_derive-1.0.228/LICENSE-APACHE +176 -0
  238. package/licenses/rust/serde_derive-1.0.228/LICENSE-MIT +23 -0
  239. package/licenses/rust/serde_json-1.0.149/LICENSE-APACHE +176 -0
  240. package/licenses/rust/serde_json-1.0.149/LICENSE-MIT +23 -0
  241. package/licenses/rust/serde_urlencoded-0.7.1/LICENSE-APACHE +176 -0
  242. package/licenses/rust/serde_urlencoded-0.7.1/LICENSE-MIT +25 -0
  243. package/licenses/rust/shlex-2.0.1/LICENSE-APACHE +13 -0
  244. package/licenses/rust/shlex-2.0.1/LICENSE-MIT +21 -0
  245. package/licenses/rust/signal-hook-registry-1.4.8/LICENSE-APACHE +201 -0
  246. package/licenses/rust/signal-hook-registry-1.4.8/LICENSE-MIT +25 -0
  247. package/licenses/rust/slab-0.4.12/LICENSE +25 -0
  248. package/licenses/rust/smallvec-1.15.1/LICENSE-APACHE +201 -0
  249. package/licenses/rust/smallvec-1.15.1/LICENSE-MIT +25 -0
  250. package/licenses/rust/socket2-0.6.1/LICENSE-APACHE +201 -0
  251. package/licenses/rust/socket2-0.6.1/LICENSE-MIT +25 -0
  252. package/licenses/rust/stable_deref_trait-1.2.1/LICENSE-APACHE +201 -0
  253. package/licenses/rust/stable_deref_trait-1.2.1/LICENSE-MIT +25 -0
  254. package/licenses/rust/static_assertions-1.1.0/LICENSE-APACHE +202 -0
  255. package/licenses/rust/static_assertions-1.1.0/LICENSE-MIT +21 -0
  256. package/licenses/rust/strsim-0.11.1/LICENSE +23 -0
  257. package/licenses/rust/strum-0.20.0/LICENSE +21 -0
  258. package/licenses/rust/strum_macros-0.20.1/LICENSE +21 -0
  259. package/licenses/rust/subtle-2.6.1/LICENSE +29 -0
  260. package/licenses/rust/syn-1.0.109/LICENSE-APACHE +201 -0
  261. package/licenses/rust/syn-1.0.109/LICENSE-MIT +23 -0
  262. package/licenses/rust/syn-2.0.114/LICENSE-APACHE +176 -0
  263. package/licenses/rust/syn-2.0.114/LICENSE-MIT +23 -0
  264. package/licenses/rust/syn-3.0.6/LICENSE-APACHE +176 -0
  265. package/licenses/rust/syn-3.0.6/LICENSE-MIT +23 -0
  266. package/licenses/rust/sync_wrapper-1.0.2/LICENSE +177 -0
  267. package/licenses/rust/synstructure-0.14.0/LICENSE +7 -0
  268. package/licenses/rust/tempfile-3.24.0/LICENSE-APACHE +201 -0
  269. package/licenses/rust/tempfile-3.24.0/LICENSE-MIT +25 -0
  270. package/licenses/rust/thiserror-1.0.69/LICENSE-APACHE +176 -0
  271. package/licenses/rust/thiserror-1.0.69/LICENSE-MIT +23 -0
  272. package/licenses/rust/thiserror-2.0.21/LICENSE-APACHE +176 -0
  273. package/licenses/rust/thiserror-2.0.21/LICENSE-MIT +23 -0
  274. package/licenses/rust/thiserror-impl-1.0.69/LICENSE-APACHE +176 -0
  275. package/licenses/rust/thiserror-impl-1.0.69/LICENSE-MIT +23 -0
  276. package/licenses/rust/thiserror-impl-2.0.21/LICENSE-APACHE +176 -0
  277. package/licenses/rust/thiserror-impl-2.0.21/LICENSE-MIT +23 -0
  278. package/licenses/rust/tinystr-0.8.4/LICENSE +46 -0
  279. package/licenses/rust/tinyvec-1.13.3/LICENSE-APACHE.md +202 -0
  280. package/licenses/rust/tinyvec-1.13.3/LICENSE-MIT.md +5 -0
  281. package/licenses/rust/tinyvec-1.13.3/LICENSE-ZLIB.md +11 -0
  282. package/licenses/rust/tokio-1.49.0/LICENSE +21 -0
  283. package/licenses/rust/tokio-macros-2.6.0/LICENSE +22 -0
  284. package/licenses/rust/tokio-rustls-0.26.6/LICENSE-APACHE +201 -0
  285. package/licenses/rust/tokio-rustls-0.26.6/LICENSE-MIT +25 -0
  286. package/licenses/rust/tower-0.5.3/LICENSE +25 -0
  287. package/licenses/rust/tower-http-0.6.11/LICENSE +25 -0
  288. package/licenses/rust/tower-layer-0.3.3/LICENSE +25 -0
  289. package/licenses/rust/tower-service-0.3.3/LICENSE +25 -0
  290. package/licenses/rust/tracing-0.1.44/LICENSE +25 -0
  291. package/licenses/rust/tracing-core-0.1.36/LICENSE +25 -0
  292. package/licenses/rust/try-lock-0.2.5/LICENSE +21 -0
  293. package/licenses/rust/unicode-ident-1.0.22/LICENSE-APACHE +176 -0
  294. package/licenses/rust/unicode-ident-1.0.22/LICENSE-MIT +23 -0
  295. package/licenses/rust/unicode-ident-1.0.22/LICENSE-UNICODE +39 -0
  296. package/licenses/rust/unicode-segmentation-1.12.0/COPYRIGHT +7 -0
  297. package/licenses/rust/unicode-segmentation-1.12.0/LICENSE-APACHE +201 -0
  298. package/licenses/rust/unicode-segmentation-1.12.0/LICENSE-MIT +25 -0
  299. package/licenses/rust/untrusted-0.9.0/LICENSE.txt +13 -0
  300. package/licenses/rust/url-2.5.8/LICENSE-APACHE +201 -0
  301. package/licenses/rust/url-2.5.8/LICENSE-MIT +25 -0
  302. package/licenses/rust/utf8_iter-1.0.4/COPYRIGHT +42 -0
  303. package/licenses/rust/utf8_iter-1.0.4/LICENSE-APACHE +202 -0
  304. package/licenses/rust/utf8_iter-1.0.4/LICENSE-MIT +25 -0
  305. package/licenses/rust/utf8parse-0.2.2/LICENSE-APACHE +176 -0
  306. package/licenses/rust/utf8parse-0.2.2/LICENSE-MIT +25 -0
  307. package/licenses/rust/version_check-0.9.5/LICENSE-APACHE +201 -0
  308. package/licenses/rust/version_check-0.9.5/LICENSE-MIT +19 -0
  309. package/licenses/rust/want-0.3.2/LICENSE +20 -0
  310. package/licenses/rust/webpki-roots-1.0.9/LICENSE +61 -0
  311. package/licenses/rust/writeable-0.6.4/LICENSE +46 -0
  312. package/licenses/rust/yoke-0.8.3/LICENSE +46 -0
  313. package/licenses/rust/yoke-derive-0.8.4/LICENSE +46 -0
  314. package/licenses/rust/zerofrom-0.1.8/LICENSE +46 -0
  315. package/licenses/rust/zerofrom-derive-0.1.8/LICENSE +46 -0
  316. package/licenses/rust/zeroize-1.9.1/LICENSE-APACHE +202 -0
  317. package/licenses/rust/zeroize-1.9.1/LICENSE-MIT +25 -0
  318. package/licenses/rust/zerotrie-0.2.5/LICENSE +46 -0
  319. package/licenses/rust/zerovec-0.11.8/LICENSE +46 -0
  320. package/licenses/rust/zerovec-derive-0.11.6/LICENSE +46 -0
  321. package/licenses/rust/zmij-1.0.14/LICENSE-MIT +23 -0
  322. package/package.json +33 -4
  323. package/runtime/bin/heaplens +0 -0
  324. package/runtime/bin/hprof-server +0 -0
  325. package/runtime/browser-ui/ai-actions.cjs +126 -0
  326. package/runtime/browser-ui/ai.cjs +121 -0
  327. package/runtime/browser-ui/build/fix-system-prompt.txt +17 -0
  328. package/runtime/browser-ui/build/index.html +7605 -0
  329. package/runtime/browser-ui/build/prompts.cjs +188 -0
  330. package/runtime/browser-ui/build/providers.json +65 -0
  331. package/runtime/browser-ui/build/system-prompt.txt +41 -0
  332. package/runtime/browser-ui/consent-actions.cjs +25 -0
  333. package/runtime/browser-ui/export-actions.cjs +47 -0
  334. package/runtime/browser-ui/guards.cjs +8 -0
  335. package/runtime/browser-ui/monitor-actions.cjs +37 -0
  336. package/runtime/browser-ui/monitor.cjs +73 -0
  337. package/runtime/browser-ui/object-actions.cjs +60 -0
  338. package/runtime/browser-ui/progressive-actions.cjs +6 -0
  339. package/runtime/browser-ui/rpc.cjs +115 -0
  340. package/runtime/browser-ui/server.cjs +209 -0
  341. package/runtime/browser-ui/session.cjs +184 -0
  342. package/runtime/browser-ui/snapshot-actions.cjs +38 -0
  343. package/runtime/browser-ui/source-actions.cjs +38 -0
  344. package/runtime/browser-ui/sources.cjs +72 -0
  345. package/runtime/browser-ui/telemetry-actions.cjs +39 -0
  346. package/runtime/browser-ui/waste-actions.cjs +20 -0
  347. package/runtime/package.json +1 -0
  348. package/runtime/telemetry/contract.cjs +31 -0
  349. package/runtime/telemetry/contract.json +60 -0
  350. package/runtime/telemetry/node.cjs +62 -0
@@ -0,0 +1,72 @@
1
+ 'use strict';
2
+ const fs = require('node:fs/promises');
3
+ const sync = require('node:fs');
4
+ const path = require('node:path');
5
+ const MAX = 256 * 1024;
6
+ function classParts(value) {
7
+ if (typeof value !== 'string' || value.length > 1024)
8
+ throw Error('Invalid class name');
9
+ const parts = value.replace(/^class /, '').replace(/(?:\[\])+$/, '').split('.');
10
+ if (!parts.every(x => /^[\p{L}\p{Nl}\p{Sc}\p{Pc}][\p{L}\p{Nl}\p{Sc}\p{Pc}\p{Nd}\p{Mn}\p{Mc}]*$/u.test(x)))
11
+ throw Error('Invalid class name');
12
+ const simple = parts.at(-1), inner = simple.indexOf('$', 1);
13
+ parts[parts.length - 1] = (inner < 0 ? simple : simple.slice(0, inner)) + '.java';
14
+ return parts;
15
+ }
16
+ function contained(root, file) { return file === root || file.startsWith(root + path.sep); }
17
+ class Sources {
18
+ constructor(roots) { this.roots = roots; this.files = null; }
19
+ async index() {
20
+ if (this.files)
21
+ return this.files;
22
+ const result = [];
23
+ let visited = 0;
24
+ for (const input of this.roots) {
25
+ const root = input;
26
+ if (await fs.realpath(root) !== root || !(await fs.stat(root)).isDirectory())
27
+ throw Error('Approved source root moved or is not a directory');
28
+ async function walk(dir) {
29
+ for await (const entry of await fs.opendir(dir)) {
30
+ if (++visited > 50000)
31
+ throw Error('Source scope is too large. Choose a narrower source directory.');
32
+ if (entry.isSymbolicLink() || ['.git', 'node_modules', '.idea', 'target', 'build'].includes(entry.name))
33
+ continue;
34
+ const file = path.join(dir, entry.name);
35
+ if (entry.isDirectory())
36
+ await walk(file);
37
+ else if (entry.isFile() && entry.name.endsWith('.java'))
38
+ result.push({ root, rootIndex: thisRootIndex, file, label: path.relative(root, file) });
39
+ }
40
+ }
41
+ const thisRootIndex = this.roots.indexOf(input) + 1;
42
+ await walk(root);
43
+ }
44
+ this.files = result;
45
+ return result;
46
+ }
47
+ async find(name) { const suffix = classParts(name).join(path.sep); const matches = (await this.index()).filter(x => x.label === suffix || x.label.endsWith(path.sep + suffix)); if (matches.length > 20)
48
+ throw Error('Too many matching files. Choose narrower source roots.'); return matches; }
49
+ async read(target) {
50
+ const resolved = await fs.realpath(target.file);
51
+ if (!contained(target.root, resolved))
52
+ throw Error('Source moved outside approved root');
53
+ const h = await fs.open(resolved, sync.constants.O_RDONLY | (sync.constants.O_NOFOLLOW || 0));
54
+ try {
55
+ const st = await h.stat();
56
+ if (!st.isFile() || st.size > MAX)
57
+ throw Error('Source is unavailable or exceeds 256 KiB');
58
+ // Verify the handle still describes the confined file, not a swapped link.
59
+ const again = await fs.realpath(target.file), current = await fs.stat(again);
60
+ if (!contained(target.root, again) || current.ino !== st.ino || current.dev !== st.dev)
61
+ throw Error('Source changed during lookup');
62
+ const text = await h.readFile('utf8');
63
+ if (Buffer.byteLength(text) > MAX)
64
+ throw Error('Source exceeds 256 KiB');
65
+ return text;
66
+ }
67
+ finally {
68
+ await h.close();
69
+ }
70
+ }
71
+ }
72
+ module.exports = { Sources, classParts, contained };
@@ -0,0 +1,39 @@
1
+ 'use strict';
2
+ // Focused optional observer: no engine objects, IDs or event bodies cross its sink.
3
+ function observe(session, command, data) {
4
+ const telemetry=session.host.telemetry;
5
+ if (!telemetry || session.state==='closed') return;
6
+ const state=session.diagnosticState ||= {generation:-1,phase:'unknown',completed:-1};
7
+ if(command==='analysisProgress') {
8
+ if(state.generation!==session.generation) {
9
+ state.generation=session.generation;state.started=Date.now();
10
+ telemetry.track('analysis/started',{}, {fileSizeMB:session.file.size/1048576});
11
+ }
12
+ const phase=['loading','graph_building','graph_built','dominators'].includes(data.stage)?data.stage:'unknown';
13
+ if(phase!==state.phase){state.phase=phase;telemetry.track('analysis/phase',{phase});}
14
+ } else if(command==='analysisComplete' && state.completed!==session.generation) {
15
+ state.completed=session.generation;
16
+ const summary=data.summary||{};
17
+ telemetry.track('analysis/completed',{}, {durationMs:Math.min(86400000,Date.now()-state.started),objectCount:summary.total_instances||0,
18
+ classCount:summary.total_classes||0,heapSizeMB:(summary.total_heap_size||0)/1048576});
19
+ } else if(command==='serverCrashed') {
20
+ telemetry.track('error/serverCrashed',{phase:state.phase,errorType:'unknown'});
21
+ } else if(command==='analysisCancelled') telemetry.track('analysis/cancelled');
22
+ else if(command==='queryError') telemetry.track('query/failed',{phase:'query',errorType:'unknown'});
23
+ else if(command==='queryResult') telemetry.track('feature/queryExecuted');
24
+ }
25
+ function install(session) {
26
+ const actions={aiSend:'feature/chatMessage',openProjectSource:'feature/goToSource',fixWithAi:'feature/fixWithAi',explainObject:'feature/explainObject',
27
+ explainLeakSuspect:'feature/explainLeakSuspect',inspectObject:'feature/inspectObject',gcRootPath:'feature/gcRootPath',compareHeaps:'feature/compareHeaps',
28
+ exportHistogramCsv:'feature/export',copyReportText:'feature/export',exportCompareCsv:'feature/export',exportCompareMarkdown:'feature/export'};
29
+ for(const [command,event]of Object.entries(actions)) {
30
+ const action=session.commands.get(command);
31
+ if(action)session.commands.set(command,m=>{session.host.telemetry?.track(event);return action(m);});
32
+ }
33
+ session.commands.set('tabViewed',m=>session.host.telemetry?.track('feature/tabViewed',{tab:m.tab}));
34
+ const retry=session.commands.get('retryAnalysis');
35
+ session.commands.set('retryAnalysis',m=>{if(['failed','cancelled'].includes(session.state))session.host.telemetry?.track('analysis/retry');return retry(m);});
36
+ session.commands.set('telemetryOff',()=>{session.host.telemetry?.setLevel('off');session.emit('localActionStatus',{message:'Telemetry is off. Pending delivery was cleared.'});});
37
+ session.commands.set('reviewDiagnostics',()=>session.emit('diagnosticReport',{text:JSON.stringify(session.host.telemetry?.report()||{},null,2)}));
38
+ }
39
+ module.exports={observe,install};
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+ const { requestId } = require('./guards.cjs');
3
+ module.exports.install = session => {
4
+ session.commands.set('calculateWaste', async m => {
5
+ const id = requestId(m), original = session.raw;
6
+ try {
7
+ const waste = await session.engine('get_waste_analysis', {});
8
+ if (session.raw !== original) return;
9
+ session.raw.waste_analysis = waste;
10
+ if (session.snapshot) {
11
+ const totals = Object.fromEntries(['total_wasted_bytes', 'waste_percentage', 'duplicate_string_wasted_bytes', 'empty_collection_wasted_bytes', 'over_allocated_wasted_bytes', 'boxed_primitive_wasted_bytes'].map(k => [k, waste[k]]));
12
+ session.snapshot = { ...session.snapshot, waste_analysis: totals };
13
+ session.host.changed();
14
+ }
15
+ session.emit('wasteResult', { requestId: id, wasteAnalysis: waste });
16
+ } catch {
17
+ session.emit('wasteError', { requestId: id, error: 'Waste analysis unavailable. Retry after retained analysis completes.' });
18
+ }
19
+ });
20
+ };
@@ -0,0 +1 @@
1
+ {"version":"0.1.1"}
@@ -0,0 +1,31 @@
1
+ 'use strict';
2
+ const schema = require('./contract.json');
3
+ const own = (object, key) => Object.prototype.hasOwnProperty.call(object, key);
4
+ function record(name, context, properties = {}, measurements = {}) {
5
+ if (!properties || typeof properties!=='object' || Array.isArray(properties) || !measurements || typeof measurements!=='object' || Array.isArray(measurements)) return null;
6
+ if (!own(schema.events, name) || !schema.hosts.includes(context.host) ||
7
+ !schema.platforms.includes(context.os) || !schema.architectures.includes(context.arch)) return null;
8
+ const event = schema.events[name], props = {} , metrics = {};
9
+ for (const [key, value] of Object.entries(properties)) {
10
+ if (!event.properties.includes(key) || !schema.enums[key].includes(value)) return null;
11
+ props[key] = value;
12
+ }
13
+ for (const [key, value] of Object.entries(measurements)) {
14
+ if (!event.measurements.includes(key)) return null;
15
+ const bound = schema.metrics[key];
16
+ if (typeof value !== 'number' || !Number.isFinite(value) || value < 0 || value > bound.max) return null;
17
+ metrics[key] = Math.floor(value / bound.quantum) * bound.quantum;
18
+ }
19
+ const version = /^(?:unknown|[0-9]{1,4}\.[0-9]{1,4}\.[0-9]{1,4}(?:-[a-z0-9.-]{1,24})?)$/.test(context.version) ? context.version : 'unknown';
20
+ return { name, category: event.category, properties: {
21
+ schemaVersion: String(schema.schemaVersion), host: context.host, version, os: context.os, arch: context.arch, ...props
22
+ }, measurements: metrics };
23
+ }
24
+ function envelope(event, time = new Date().toISOString()) {
25
+ return { ver: 1, name: 'Microsoft.ApplicationInsights.Event', time, iKey: schema.instrumentationKey,
26
+ tags: {}, data: { baseType: 'EventData', baseData: { ver: 2, name: 'heaplens/' + event.name,
27
+ properties: event.properties, measurements: event.measurements } } };
28
+ }
29
+ const platform = value => schema.platforms.includes(value) ? value : 'unknown';
30
+ const architecture = value => ({ aarch64:'arm64', arm64:'arm64', x86_64:'x64', amd64:'x64', x64:'x64' }[value] || 'unknown');
31
+ module.exports = { schema, record, envelope, platform, architecture };
@@ -0,0 +1,60 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "endpoint": "https://eastus2-3.in.applicationinsights.azure.com/v2/track",
4
+ "instrumentationKey": "963d68d0-40ec-4dcb-ad11-48c8abacd67c",
5
+ "hosts": ["vscode", "intellij", "cli", "browser"],
6
+ "platforms": ["darwin", "win32", "linux", "unknown"],
7
+ "architectures": ["arm64", "x64", "unknown"],
8
+ "enums": {
9
+ "errorType": ["timeout", "memory_error", "parse", "not_found", "permission", "server_spawn", "cancelled", "killed", "pipe_broken", "protocol", "unknown"],
10
+ "phase": ["input", "loading", "graph_building", "graph_built", "dominators", "query", "output", "server_start", "unknown"],
11
+ "signal": ["none", "SIGKILL", "SIGTERM", "SIGSEGV", "SIGABRT", "SIGBUS", "other"],
12
+ "exitCode": ["0", "1", "2", "3", "4", "5", "6", "137", "139", "unknown"],
13
+ "keyword": ["select", "group_by", "where", "order_by", "instances", "retained", "count", "other"],
14
+ "tab": ["overview", "histogram", "domtree", "leaks", "waste", "source", "query", "compare", "timeline", "monitor", "chat", "unknown"],
15
+ "provider": ["anthropic", "openai", "gemini", "deepseek", "mistral", "groq", "xai", "together", "openrouter", "ollama"],
16
+ "format": ["json", "report", "csv", "compare-markdown", "compare-csv", "text"],
17
+ "tier": ["workspace", "source-jar", "decompiled", "dependency", "none"],
18
+ "status": ["diff-opened", "already-fixed", "source-not-found", "cancelled", "error"],
19
+ "command": ["default", "analyze", "leaks", "explain", "query", "compare"],
20
+ "ruleId": ["heap-growth", "new-leak-suspects", "class-explosion", "resolved-leaks"],
21
+ "severity": ["warning", "info"]
22
+ },
23
+ "metrics": {
24
+ "fileSizeMB": {"max": 1048576, "quantum": 64},
25
+ "heapSizeMB": {"max": 1048576, "quantum": 64},
26
+ "durationMs": {"max": 86400000, "quantum": 100},
27
+ "elapsedMinutes": {"max": 1440, "quantum": 1},
28
+ "objectCount": {"max": 1000000000000, "quantum": 1000},
29
+ "classCount": {"max": 10000000, "quantum": 100},
30
+ "leakSuspectCount": {"max": 10000000, "quantum": 10},
31
+ "consecutiveFailures": {"max": 100, "quantum": 1}
32
+ },
33
+ "events": {
34
+ "analysis/started": {"category": "usage", "properties": [], "measurements": ["fileSizeMB"]},
35
+ "analysis/phase": {"category": "usage", "properties": ["phase"], "measurements": []},
36
+ "analysis/completed": {"category": "usage", "properties": [], "measurements": ["durationMs", "objectCount", "classCount", "leakSuspectCount", "heapSizeMB"]},
37
+ "analysis/cancelled": {"category": "usage", "properties": [], "measurements": []},
38
+ "analysis/longRunning": {"category": "usage", "properties": [], "measurements": ["elapsedMinutes"]},
39
+ "analysis/failed": {"category": "error", "properties": ["errorType", "phase"], "measurements": ["durationMs"]},
40
+ "analysis/retry": {"category": "usage", "properties": [], "measurements": []},
41
+ "analysis/recovered": {"category": "usage", "properties": [], "measurements": []},
42
+ "error/serverCrashed": {"category": "error", "properties": ["exitCode", "signal", "phase", "errorType"], "measurements": []},
43
+ "error/heartbeatFailed": {"category": "error", "properties": [], "measurements": ["consecutiveFailures"]},
44
+ "query/failed": {"category": "error", "properties": ["errorType", "phase"], "measurements": []},
45
+ "feature/queryExecuted": {"category": "usage", "properties": ["keyword"], "measurements": []},
46
+ "feature/tabViewed": {"category": "usage", "properties": ["tab"], "measurements": []},
47
+ "feature/chatMessage": {"category": "usage", "properties": ["provider"], "measurements": []},
48
+ "feature/copilotChat": {"category": "usage", "properties": ["command"], "measurements": []},
49
+ "feature/goToSource": {"category": "usage", "properties": ["tier"], "measurements": []},
50
+ "feature/fixWithAi": {"category": "usage", "properties": ["status"], "measurements": []},
51
+ "feature/compareHeaps": {"category": "usage", "properties": [], "measurements": []},
52
+ "feature/export": {"category": "usage", "properties": ["format"], "measurements": []},
53
+ "feature/gcRootPath": {"category": "usage", "properties": [], "measurements": []},
54
+ "feature/inspectObject": {"category": "usage", "properties": [], "measurements": []},
55
+ "feature/explainObject": {"category": "usage", "properties": [], "measurements": []},
56
+ "feature/explainLeakSuspect": {"category": "usage", "properties": [], "measurements": []},
57
+ "alert/fired": {"category": "usage", "properties": ["ruleId", "severity"], "measurements": []},
58
+ "alert/viewComparison": {"category": "usage", "properties": ["ruleId"], "measurements": []}
59
+ }
60
+ }
@@ -0,0 +1,62 @@
1
+ 'use strict';
2
+ const https = require('node:https');
3
+ const { schema, record, envelope } = require('./contract.cjs');
4
+
5
+ // No SDK, automatic exceptions, identity tags, redirects, disk queue or retries.
6
+ function azureSend(body, done) {
7
+ let finished = false, deadline, request;
8
+ const finish = ok => { if (!finished) { finished = true; clearTimeout(deadline); done(ok); } };
9
+ try {
10
+ request = https.request(schema.endpoint, { method: 'POST', headers: {
11
+ 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(body)
12
+ } }, response => { response.on('error',()=>finish(false));response.on('end',()=>finish(response.statusCode === 200));response.resume(); });
13
+ request.on('error', () => finish(false));
14
+ deadline = setTimeout(() => { request.destroy(); finish(false); }, 1000);
15
+ deadline.unref();
16
+ request.end(body);
17
+ } catch { finish(false); }
18
+ return () => { request?.destroy(); finish(false); };
19
+ }
20
+
21
+ class Telemetry {
22
+ constructor({ context, level = 'off', disabled = false, send = azureSend }) {
23
+ this.context = context; this.disabled = disabled; this.send = send;
24
+ this.level = 'off'; this.queue = []; this.recent = []; this.job = null;
25
+ this.submitted = 0; this.accepted = 0; this.dropped = 0; this.generation = 0;
26
+ this.setLevel(level);
27
+ }
28
+ setLevel(level) {
29
+ const next = !this.disabled && ['off','error','all'].includes(level) ? level : 'off';
30
+ if (next === this.level) return;
31
+ this.level = next; this.generation++; this.queue.length = 0;
32
+ const retired = this.job; this.job = null; retired?.abort?.();
33
+ }
34
+ track(name, properties, measurements) {
35
+ try {
36
+ const event = record(name, this.context, properties, measurements);
37
+ if (!event) return false;
38
+ this.recent.push(event); if (this.recent.length > 20) this.recent.shift();
39
+ if (this.level === 'off' || (this.level === 'error' && event.category !== 'error')) return true;
40
+ if (this.queue.length >= 16 || this.submitted + this.queue.length >= 256) { this.dropped++; return true; }
41
+ this.queue.push(event); queueMicrotask(() => this.pump()); return true;
42
+ } catch { return false; }
43
+ }
44
+ pump() {
45
+ if (this.job || !this.queue.length || this.level === 'off') return;
46
+ const event = this.queue.shift(), job = { generation: this.generation, abort: null };
47
+ this.job = job; this.submitted++;
48
+ const finish = accepted => {
49
+ if (this.job !== job || job.generation !== this.generation) return;
50
+ if (accepted) this.accepted++;
51
+ this.job = null; queueMicrotask(() => this.pump());
52
+ };
53
+ try { job.abort = this.send(JSON.stringify(envelope(event)), finish); }
54
+ catch { finish(false); }
55
+ }
56
+ report() { return { schemaVersion: 1, level: this.level, submitted: this.submitted, accepted: this.accepted,
57
+ queued: this.queue.length, dropped: this.dropped,
58
+ note: 'Local allowlisted records. HTTP acceptance is not proof of Azure portal visibility. No stable user/session IDs; network services may process IP addresses.',
59
+ events: JSON.parse(JSON.stringify(this.recent)) }; }
60
+ dispose() { this.setLevel('off'); this.recent.length = 0; }
61
+ }
62
+ module.exports = { Telemetry, azureSend };