@redscope-ai/redscope 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 (619) hide show
  1. package/README.md +224 -0
  2. package/dist/chunk-090920rk.js +288 -0
  3. package/dist/chunk-0afb2r78.js +141 -0
  4. package/dist/chunk-0d4ekx1g.js +73 -0
  5. package/dist/chunk-0g6nwbhq.js +15 -0
  6. package/dist/chunk-0qj905nt.js +18 -0
  7. package/dist/chunk-0s5btnn1.js +186 -0
  8. package/dist/chunk-0s8fars0.js +91 -0
  9. package/dist/chunk-10ev3dvh.js +312 -0
  10. package/dist/chunk-10k5jfc5.js +1295 -0
  11. package/dist/chunk-12tspwqa.js +240 -0
  12. package/dist/chunk-13qesvnw.js +17 -0
  13. package/dist/chunk-143eh1e0.js +121 -0
  14. package/dist/chunk-14p6wvsq.js +39 -0
  15. package/dist/chunk-19f3zb1m.js +342 -0
  16. package/dist/chunk-1a5cep8h.js +145 -0
  17. package/dist/chunk-1abw9kkn.js +34 -0
  18. package/dist/chunk-1aer7c78.js +118 -0
  19. package/dist/chunk-1dazz4g6.js +154 -0
  20. package/dist/chunk-1fcf4ty1.js +142 -0
  21. package/dist/chunk-1gnxhyf8.js +62 -0
  22. package/dist/chunk-1he3944e.js +8124 -0
  23. package/dist/chunk-1jpayz7y.js +952 -0
  24. package/dist/chunk-1qd6f6vk.js +269 -0
  25. package/dist/chunk-1v0kpe62.js +2547 -0
  26. package/dist/chunk-1w20m7gw.js +445 -0
  27. package/dist/chunk-1y7kp51j.js +72 -0
  28. package/dist/chunk-1ycb5sxt.js +247 -0
  29. package/dist/chunk-1zbwhcbt.js +1124 -0
  30. package/dist/chunk-20psem54.js +116 -0
  31. package/dist/chunk-23h69r5b.js +30 -0
  32. package/dist/chunk-23x86ptv.js +473 -0
  33. package/dist/chunk-24fyv3jz.js +378 -0
  34. package/dist/chunk-24kv69g3.js +97 -0
  35. package/dist/chunk-2azx8zsc.js +125 -0
  36. package/dist/chunk-2d1gwzz9.js +524 -0
  37. package/dist/chunk-2g0ytd9d.js +29058 -0
  38. package/dist/chunk-2hfp9kat.js +21 -0
  39. package/dist/chunk-2j875eq6.js +37 -0
  40. package/dist/chunk-2kcgxnvp.js +39 -0
  41. package/dist/chunk-2kz09j2s.js +23 -0
  42. package/dist/chunk-2mwnwp0n.js +17 -0
  43. package/dist/chunk-2p1cqhcn.js +921 -0
  44. package/dist/chunk-2p369q9z.js +61 -0
  45. package/dist/chunk-2rf6asgf.js +151 -0
  46. package/dist/chunk-2vr7mqx1.js +384 -0
  47. package/dist/chunk-2xcg933e.js +205 -0
  48. package/dist/chunk-2ypwckbz.js +40310 -0
  49. package/dist/chunk-30wnahyg.js +626 -0
  50. package/dist/chunk-326zehp8.js +204 -0
  51. package/dist/chunk-32s6jzgw.js +183 -0
  52. package/dist/chunk-35yzt1a7.js +202 -0
  53. package/dist/chunk-38frkej6.js +62 -0
  54. package/dist/chunk-3abaq08g.js +34 -0
  55. package/dist/chunk-3h59ttr5.js +32 -0
  56. package/dist/chunk-3nk9q8dr.js +154 -0
  57. package/dist/chunk-3prrxevm.js +224 -0
  58. package/dist/chunk-3tv8p9xw.js +127 -0
  59. package/dist/chunk-3txyekes.js +19 -0
  60. package/dist/chunk-3vfxjn7g.js +19 -0
  61. package/dist/chunk-3w9sye8h.js +81 -0
  62. package/dist/chunk-3y69j7y8.js +24 -0
  63. package/dist/chunk-3zwjpkjh.js +1603 -0
  64. package/dist/chunk-40t1d75v.js +3442 -0
  65. package/dist/chunk-470kmby4.js +318 -0
  66. package/dist/chunk-47jc141z.js +335 -0
  67. package/dist/chunk-48rz50ct.js +868 -0
  68. package/dist/chunk-49wv03ts.js +232 -0
  69. package/dist/chunk-4a189mn2.js +103 -0
  70. package/dist/chunk-4c4fmh7a.js +15 -0
  71. package/dist/chunk-4ct8dsj5.js +49 -0
  72. package/dist/chunk-4kqt1pm1.js +100 -0
  73. package/dist/chunk-4ng0xy0e.js +802 -0
  74. package/dist/chunk-4spgkgr3.js +43 -0
  75. package/dist/chunk-4tjdwtyy.js +19 -0
  76. package/dist/chunk-4tr60273.js +370 -0
  77. package/dist/chunk-4vnaeng5.js +29 -0
  78. package/dist/chunk-4wbqpeaw.js +871 -0
  79. package/dist/chunk-4wgkv3fv.js +1140 -0
  80. package/dist/chunk-4yjskjb6.js +40 -0
  81. package/dist/chunk-50m3a23z.js +35 -0
  82. package/dist/chunk-511f79az.js +182 -0
  83. package/dist/chunk-51sgztvv.js +161 -0
  84. package/dist/chunk-563fcpv1.js +290 -0
  85. package/dist/chunk-564cnq6v.js +735 -0
  86. package/dist/chunk-569r8cxc.js +31 -0
  87. package/dist/chunk-570x55d4.js +12 -0
  88. package/dist/chunk-571556cm.js +80 -0
  89. package/dist/chunk-59t4c56e.js +63 -0
  90. package/dist/chunk-5axjhkma.js +36 -0
  91. package/dist/chunk-5b188q5e.js +157 -0
  92. package/dist/chunk-5dmn1865.js +439 -0
  93. package/dist/chunk-5ks4829r.js +267 -0
  94. package/dist/chunk-5mmhfbxb.js +1078 -0
  95. package/dist/chunk-5rdt14hy.js +742 -0
  96. package/dist/chunk-5ssryexj.js +121 -0
  97. package/dist/chunk-5v95pnq4.js +15 -0
  98. package/dist/chunk-5xvjt2t9.js +68 -0
  99. package/dist/chunk-5zyq6t1q.js +118 -0
  100. package/dist/chunk-60fkafk2.js +15 -0
  101. package/dist/chunk-62fjkf5q.js +46 -0
  102. package/dist/chunk-64gazrrb.js +8067 -0
  103. package/dist/chunk-65tq2yjx.js +126 -0
  104. package/dist/chunk-65zbgg1n.js +14 -0
  105. package/dist/chunk-66v8mty3.js +264 -0
  106. package/dist/chunk-6acx5heq.js +292 -0
  107. package/dist/chunk-6hr7742d.js +61 -0
  108. package/dist/chunk-6hygvrhn.js +143 -0
  109. package/dist/chunk-6kjh280m.js +128 -0
  110. package/dist/chunk-6s0q1s5r.js +66 -0
  111. package/dist/chunk-6x35ffpx.js +690 -0
  112. package/dist/chunk-71jfy1hh.js +570 -0
  113. package/dist/chunk-71sdcaq6.js +15 -0
  114. package/dist/chunk-754qdxs5.js +92 -0
  115. package/dist/chunk-79v5bkj4.js +1176 -0
  116. package/dist/chunk-7br0w7j5.js +151 -0
  117. package/dist/chunk-7cjgrzz1.js +298 -0
  118. package/dist/chunk-7d41ks0y.js +133 -0
  119. package/dist/chunk-7f40pmtr.js +71 -0
  120. package/dist/chunk-7g15x8hm.js +131 -0
  121. package/dist/chunk-7gtnzdet.js +120 -0
  122. package/dist/chunk-7h0z4aqx.js +702 -0
  123. package/dist/chunk-7h7e5a7d.js +25 -0
  124. package/dist/chunk-7m2cznwr.js +40 -0
  125. package/dist/chunk-7nvday0n.js +252 -0
  126. package/dist/chunk-7qey87th.js +145 -0
  127. package/dist/chunk-7qx3xhv3.js +9076 -0
  128. package/dist/chunk-7tfdhkpy.js +61 -0
  129. package/dist/chunk-80m511j6.js +121 -0
  130. package/dist/chunk-80ysxfe9.js +784 -0
  131. package/dist/chunk-8375zk8t.js +17200 -0
  132. package/dist/chunk-85bpkyy9.js +412 -0
  133. package/dist/chunk-85tcn547.js +876 -0
  134. package/dist/chunk-85vqgbc8.js +13 -0
  135. package/dist/chunk-86626jb4.js +49 -0
  136. package/dist/chunk-87ms17f6.js +444 -0
  137. package/dist/chunk-87mz239c.js +118 -0
  138. package/dist/chunk-89vdzt4e.js +254 -0
  139. package/dist/chunk-89z3e99z.js +159 -0
  140. package/dist/chunk-8cwrz1dd.js +1806 -0
  141. package/dist/chunk-8gv2pjby.js +21 -0
  142. package/dist/chunk-8hdevr3s.js +140 -0
  143. package/dist/chunk-8hdsk6qc.js +710 -0
  144. package/dist/chunk-8kct9arg.js +724 -0
  145. package/dist/chunk-8kf8h7xf.js +23 -0
  146. package/dist/chunk-8qed8ymj.js +605 -0
  147. package/dist/chunk-8sdgr592.js +101 -0
  148. package/dist/chunk-8we9w8pw.js +111 -0
  149. package/dist/chunk-8xnm5637.js +72 -0
  150. package/dist/chunk-8y3q0eqy.js +67 -0
  151. package/dist/chunk-8yvsnrkr.js +3449 -0
  152. package/dist/chunk-8zz4z1q3.js +42 -0
  153. package/dist/chunk-90eyff3k.js +119 -0
  154. package/dist/chunk-92bjkrf2.js +121 -0
  155. package/dist/chunk-92zrc7c6.js +327 -0
  156. package/dist/chunk-935nrvdb.js +13 -0
  157. package/dist/chunk-94pfyv6a.js +48 -0
  158. package/dist/chunk-9568p8se.js +115 -0
  159. package/dist/chunk-96km1ywr.js +37 -0
  160. package/dist/chunk-980bg4w4.js +163 -0
  161. package/dist/chunk-9a9g5hbj.js +205 -0
  162. package/dist/chunk-9cm4725d.js +4395 -0
  163. package/dist/chunk-9ds3vzq8.js +847 -0
  164. package/dist/chunk-9ffc9n60.js +618 -0
  165. package/dist/chunk-9fstrwv2.js +184 -0
  166. package/dist/chunk-9gt0g0qe.js +153 -0
  167. package/dist/chunk-9h9k5vz3.js +2761 -0
  168. package/dist/chunk-9he8bmhy.js +17 -0
  169. package/dist/chunk-9hn8e6h1.js +12 -0
  170. package/dist/chunk-9j0n3g8e.js +179 -0
  171. package/dist/chunk-9j6pa3ft.js +251 -0
  172. package/dist/chunk-9jpg9dn7.js +122 -0
  173. package/dist/chunk-9mycnwj5.js +46 -0
  174. package/dist/chunk-9npy2c17.js +517 -0
  175. package/dist/chunk-9p6sec8n.js +34 -0
  176. package/dist/chunk-9pnym83h.js +4584 -0
  177. package/dist/chunk-9skwrnd2.js +25 -0
  178. package/dist/chunk-9tsfaqr8.js +459 -0
  179. package/dist/chunk-9tsw3cqv.js +5924 -0
  180. package/dist/chunk-9w6ckyk4.js +49 -0
  181. package/dist/chunk-a15bwzv6.js +147 -0
  182. package/dist/chunk-a9t6cp69.js +28 -0
  183. package/dist/chunk-ad2yk19p.js +102 -0
  184. package/dist/chunk-ad4cw4nw.js +336 -0
  185. package/dist/chunk-ad69fbsk.js +347 -0
  186. package/dist/chunk-ae76ded0.js +30 -0
  187. package/dist/chunk-aeysytks.js +216 -0
  188. package/dist/chunk-ag81m9bq.js +61 -0
  189. package/dist/chunk-ahx7gp6r.js +4448 -0
  190. package/dist/chunk-aj4tk4tk.js +23 -0
  191. package/dist/chunk-an82t9jc.js +104 -0
  192. package/dist/chunk-apg95qd7.js +1393 -0
  193. package/dist/chunk-aq5n2adz.js +27 -0
  194. package/dist/chunk-aw4s3a99.js +208 -0
  195. package/dist/chunk-awgdfggg.js +14 -0
  196. package/dist/chunk-ayymxgn1.js +164 -0
  197. package/dist/chunk-azbab59e.js +637 -0
  198. package/dist/chunk-azdxq2a3.js +293 -0
  199. package/dist/chunk-b0tjx3k1.js +523 -0
  200. package/dist/chunk-b5pp4g2g.js +371 -0
  201. package/dist/chunk-b5zm8dt6.js +26 -0
  202. package/dist/chunk-bcnye5a0.js +109 -0
  203. package/dist/chunk-beqz3k49.js +190 -0
  204. package/dist/chunk-bf906wpw.js +147 -0
  205. package/dist/chunk-bgan4cpf.js +13 -0
  206. package/dist/chunk-bhzp13h7.js +1178 -0
  207. package/dist/chunk-bk403kpw.js +142 -0
  208. package/dist/chunk-bmq4c135.js +489 -0
  209. package/dist/chunk-bprbeda7.js +35 -0
  210. package/dist/chunk-bst7czdd.js +888 -0
  211. package/dist/chunk-bths4xgn.js +111 -0
  212. package/dist/chunk-btjn3qby.js +13 -0
  213. package/dist/chunk-bwb1vxnt.js +120 -0
  214. package/dist/chunk-bxa6tw4m.js +643 -0
  215. package/dist/chunk-bxfjr8qb.js +27 -0
  216. package/dist/chunk-bxpzhrej.js +73 -0
  217. package/dist/chunk-bzyzrq0k.js +51 -0
  218. package/dist/chunk-c0k7b0jw.js +4265 -0
  219. package/dist/chunk-c17f0h2s.js +16 -0
  220. package/dist/chunk-c1yc761e.js +6748 -0
  221. package/dist/chunk-c5g9shkw.js +298 -0
  222. package/dist/chunk-c696122m.js +69 -0
  223. package/dist/chunk-c92b3yxx.js +109 -0
  224. package/dist/chunk-c9aqz56y.js +143 -0
  225. package/dist/chunk-cba7c5w3.js +345 -0
  226. package/dist/chunk-cbcxbbe6.js +6543 -0
  227. package/dist/chunk-cdfjb87h.js +11 -0
  228. package/dist/chunk-ce8zjt1y.js +136 -0
  229. package/dist/chunk-cep7e37k.js +22740 -0
  230. package/dist/chunk-chs5qm8d.js +258 -0
  231. package/dist/chunk-ckydq33g.js +144 -0
  232. package/dist/chunk-cnge6wpj.js +514 -0
  233. package/dist/chunk-cpnsvqf1.js +13 -0
  234. package/dist/chunk-cqqebkv4.js +32 -0
  235. package/dist/chunk-cvqpp7dk.js +627 -0
  236. package/dist/chunk-cwc33j40.js +65 -0
  237. package/dist/chunk-cypvrq2a.js +155 -0
  238. package/dist/chunk-d1ha0swn.js +475 -0
  239. package/dist/chunk-d2an0138.js +35 -0
  240. package/dist/chunk-d2tt72ck.js +343 -0
  241. package/dist/chunk-d6wvcqrw.js +9507 -0
  242. package/dist/chunk-d7ys2kka.js +991 -0
  243. package/dist/chunk-dbts5q5p.js +122 -0
  244. package/dist/chunk-dct29ggs.js +295 -0
  245. package/dist/chunk-de0qnnf7.js +1059 -0
  246. package/dist/chunk-dep72ce4.js +513 -0
  247. package/dist/chunk-dgpvgy8x.js +47 -0
  248. package/dist/chunk-dhhd7dtc.js +20 -0
  249. package/dist/chunk-dhzpmxv6.js +594 -0
  250. package/dist/chunk-djes4da7.js +413 -0
  251. package/dist/chunk-dnhv3vx7.js +166 -0
  252. package/dist/chunk-dqtvafan.js +2365 -0
  253. package/dist/chunk-dr4a3tcp.js +60 -0
  254. package/dist/chunk-dz2xk9kb.js +100 -0
  255. package/dist/chunk-dz7nc6rf.js +15 -0
  256. package/dist/chunk-e3abfxpy.js +1486 -0
  257. package/dist/chunk-e3cq9z89.js +85 -0
  258. package/dist/chunk-e3j7m7k2.js +642 -0
  259. package/dist/chunk-e4dsy4g1.js +9951 -0
  260. package/dist/chunk-e5592pnn.js +197 -0
  261. package/dist/chunk-e55hdegh.js +129 -0
  262. package/dist/chunk-e5r5r04e.js +1030 -0
  263. package/dist/chunk-e60zztbt.js +442 -0
  264. package/dist/chunk-e7qq6vn0.js +372 -0
  265. package/dist/chunk-e9aat7xw.js +80 -0
  266. package/dist/chunk-e9d5v3zs.js +143 -0
  267. package/dist/chunk-eax32zk4.js +87 -0
  268. package/dist/chunk-ebfwmbx1.js +117 -0
  269. package/dist/chunk-ec71pb8t.js +971 -0
  270. package/dist/chunk-eemjb825.js +17252 -0
  271. package/dist/chunk-ees8xdhd.js +256 -0
  272. package/dist/chunk-eewg66y1.js +112 -0
  273. package/dist/chunk-eg22v12d.js +266 -0
  274. package/dist/chunk-enzzk67f.js +313 -0
  275. package/dist/chunk-eskhp70f.js +117 -0
  276. package/dist/chunk-ewx6z4g8.js +55 -0
  277. package/dist/chunk-eyvx461k.js +76 -0
  278. package/dist/chunk-eztq2b5f.js +94 -0
  279. package/dist/chunk-f0ffwzdd.js +321 -0
  280. package/dist/chunk-f80n68mf.js +119 -0
  281. package/dist/chunk-fae2hjxp.js +99 -0
  282. package/dist/chunk-fbtfp370.js +60 -0
  283. package/dist/chunk-fc6ndtgf.js +94 -0
  284. package/dist/chunk-fdwabr8p.js +13870 -0
  285. package/dist/chunk-fejeqe61.js +785 -0
  286. package/dist/chunk-fh0d6mvk.js +168 -0
  287. package/dist/chunk-fh19zcaf.js +304 -0
  288. package/dist/chunk-fh8bd39r.js +186 -0
  289. package/dist/chunk-fj2ebbpn.js +33 -0
  290. package/dist/chunk-fjn632v7.js +194 -0
  291. package/dist/chunk-fncpkzs5.js +1389 -0
  292. package/dist/chunk-fpd1gpt8.js +332 -0
  293. package/dist/chunk-fq9snrnh.js +295 -0
  294. package/dist/chunk-fqcfzg3j.js +207 -0
  295. package/dist/chunk-ftt3vqj2.js +1919 -0
  296. package/dist/chunk-g06pm4n9.js +395 -0
  297. package/dist/chunk-g4m5pf4g.js +8 -0
  298. package/dist/chunk-g72h52y6.js +36 -0
  299. package/dist/chunk-g79ej71s.js +1627 -0
  300. package/dist/chunk-g7fwk59d.js +19 -0
  301. package/dist/chunk-g9jnkrtm.js +663 -0
  302. package/dist/chunk-g9vg5d7t.js +38 -0
  303. package/dist/chunk-ga1jkyqy.js +1636 -0
  304. package/dist/chunk-gaaap2nk.js +676 -0
  305. package/dist/chunk-gc6erq5q.js +483 -0
  306. package/dist/chunk-gjrcmf0a.js +752 -0
  307. package/dist/chunk-gmdy2w3z.js +238999 -0
  308. package/dist/chunk-gsz4yrrk.js +81 -0
  309. package/dist/chunk-gy47rjy8.js +3830 -0
  310. package/dist/chunk-h12a4f4x.js +11 -0
  311. package/dist/chunk-h1yratmg.js +725 -0
  312. package/dist/chunk-h9y0jnsy.js +155 -0
  313. package/dist/chunk-hbhs3mwy.js +133 -0
  314. package/dist/chunk-hbs8cmb4.js +8 -0
  315. package/dist/chunk-hdk0t1ht.js +940 -0
  316. package/dist/chunk-hef8dx4s.js +178 -0
  317. package/dist/chunk-hgsca8mt.js +381 -0
  318. package/dist/chunk-hhsxm2yr.js +67 -0
  319. package/dist/chunk-hj5tzzpd.js +39 -0
  320. package/dist/chunk-hjxqmtg5.js +94 -0
  321. package/dist/chunk-hn4w9pkj.js +68 -0
  322. package/dist/chunk-hnprkjgp.js +25 -0
  323. package/dist/chunk-hq3n5ex7.js +183 -0
  324. package/dist/chunk-hqjspfma.js +158 -0
  325. package/dist/chunk-hqxp6b72.js +1198 -0
  326. package/dist/chunk-hs6nrmq6.js +94 -0
  327. package/dist/chunk-hwba5xdc.js +267 -0
  328. package/dist/chunk-hy566ev3.js +430 -0
  329. package/dist/chunk-hzmzwte2.js +153 -0
  330. package/dist/chunk-hzxzvzw8.js +274 -0
  331. package/dist/chunk-j139fzgs.js +114 -0
  332. package/dist/chunk-j1mep9ck.js +62 -0
  333. package/dist/chunk-j3xveeg4.js +273 -0
  334. package/dist/chunk-j5y1s11j.js +100 -0
  335. package/dist/chunk-j9475b46.js +26 -0
  336. package/dist/chunk-j9rgqs8m.js +1192 -0
  337. package/dist/chunk-jccjaddz.js +74 -0
  338. package/dist/chunk-jdkwfy9e.js +35 -0
  339. package/dist/chunk-jdqp0r4h.js +6157 -0
  340. package/dist/chunk-jdzk4zwn.js +587 -0
  341. package/dist/chunk-jfafmkte.js +49 -0
  342. package/dist/chunk-jg3r989b.js +16 -0
  343. package/dist/chunk-jhtccjc9.js +54 -0
  344. package/dist/chunk-jj2ff1pr.js +688 -0
  345. package/dist/chunk-jmv7k0jn.js +37 -0
  346. package/dist/chunk-jmxzmwpw.js +65 -0
  347. package/dist/chunk-jnjxdqyr.js +353 -0
  348. package/dist/chunk-jsbbez9j.js +138 -0
  349. package/dist/chunk-jvpt2dc0.js +424 -0
  350. package/dist/chunk-jwd7cka0.js +34 -0
  351. package/dist/chunk-jy5er3st.js +15 -0
  352. package/dist/chunk-jyby79z5.js +121 -0
  353. package/dist/chunk-jzyr6j5n.js +332 -0
  354. package/dist/chunk-k49xc781.js +63 -0
  355. package/dist/chunk-k7dt2g4a.js +41 -0
  356. package/dist/chunk-k7hexw3v.js +969 -0
  357. package/dist/chunk-k7wwkraa.js +117 -0
  358. package/dist/chunk-kb3758f7.js +51 -0
  359. package/dist/chunk-kc67kt75.js +3119 -0
  360. package/dist/chunk-kdhmfxmh.js +3149 -0
  361. package/dist/chunk-kejdd6zc.js +51 -0
  362. package/dist/chunk-kekrjeem.js +402 -0
  363. package/dist/chunk-kez5r0zz.js +280 -0
  364. package/dist/chunk-kfsvcs5t.js +75 -0
  365. package/dist/chunk-khtvffc4.js +285 -0
  366. package/dist/chunk-kkz4w1tv.js +64 -0
  367. package/dist/chunk-kmywng0j.js +272 -0
  368. package/dist/chunk-kq6vcpdr.js +224 -0
  369. package/dist/chunk-kqzdszcc.js +37 -0
  370. package/dist/chunk-ktxpp02w.js +435 -0
  371. package/dist/chunk-kwcvhbtz.js +26 -0
  372. package/dist/chunk-kx0cm9qr.js +128 -0
  373. package/dist/chunk-kxcmqz10.js +120 -0
  374. package/dist/chunk-kxwava1g.js +14 -0
  375. package/dist/chunk-kywtr3jg.js +825 -0
  376. package/dist/chunk-kzwg923p.js +8 -0
  377. package/dist/chunk-m1eq3sgv.js +255 -0
  378. package/dist/chunk-m21h5zb4.js +119 -0
  379. package/dist/chunk-m2c3bjv1.js +111 -0
  380. package/dist/chunk-m41e19ms.js +42 -0
  381. package/dist/chunk-m7ka36ex.js +97 -0
  382. package/dist/chunk-m81w8tbm.js +259 -0
  383. package/dist/chunk-m95ggkax.js +281 -0
  384. package/dist/chunk-manx26xa.js +145 -0
  385. package/dist/chunk-mdxh3pk2.js +298 -0
  386. package/dist/chunk-mhbfkcja.js +311 -0
  387. package/dist/chunk-mjnr5erm.js +173 -0
  388. package/dist/chunk-mngvnmwp.js +135 -0
  389. package/dist/chunk-mvfqanv5.js +63 -0
  390. package/dist/chunk-mw1nesq1.js +140 -0
  391. package/dist/chunk-mx168925.js +661 -0
  392. package/dist/chunk-mxwvj18g.js +795 -0
  393. package/dist/chunk-my7r5mba.js +257 -0
  394. package/dist/chunk-myaa1kkf.js +17 -0
  395. package/dist/chunk-myypc3tn.js +46 -0
  396. package/dist/chunk-mzcnmnpq.js +3379 -0
  397. package/dist/chunk-mznav6d1.js +194 -0
  398. package/dist/chunk-n0qxskpr.js +24 -0
  399. package/dist/chunk-n6a6hgtp.js +394 -0
  400. package/dist/chunk-n6d5fgx0.js +254 -0
  401. package/dist/chunk-n6ym3n03.js +120 -0
  402. package/dist/chunk-n9g24mwe.js +104 -0
  403. package/dist/chunk-naamqdf9.js +185 -0
  404. package/dist/chunk-nb2jk7zj.js +15 -0
  405. package/dist/chunk-nbkbq9en.js +67 -0
  406. package/dist/chunk-ndttd6es.js +38 -0
  407. package/dist/chunk-nfygaaxg.js +133 -0
  408. package/dist/chunk-ngdzpszd.js +454 -0
  409. package/dist/chunk-nmfwksa4.js +1297 -0
  410. package/dist/chunk-nt837qt9.js +21 -0
  411. package/dist/chunk-nwc3v0vp.js +691 -0
  412. package/dist/chunk-nz8ha95p.js +3610 -0
  413. package/dist/chunk-nzxfj0gq.js +2007 -0
  414. package/dist/chunk-p0r8887g.js +6932 -0
  415. package/dist/chunk-p1seyqdm.js +120 -0
  416. package/dist/chunk-p425zbgw.js +726 -0
  417. package/dist/chunk-p7hamd2c.js +146 -0
  418. package/dist/chunk-pdvg91cg.js +32 -0
  419. package/dist/chunk-pecy49yr.js +14649 -0
  420. package/dist/chunk-pfxrg89f.js +547 -0
  421. package/dist/chunk-pfyw3155.js +2750 -0
  422. package/dist/chunk-pr8m11pm.js +1192 -0
  423. package/dist/chunk-ptxteaeh.js +1591 -0
  424. package/dist/chunk-pv164mac.js +394 -0
  425. package/dist/chunk-pxxhtxf5.js +10154 -0
  426. package/dist/chunk-q0e485mg.js +61 -0
  427. package/dist/chunk-q1vrhh0q.js +458 -0
  428. package/dist/chunk-q2h79ncs.js +370 -0
  429. package/dist/chunk-q3b4n194.js +56 -0
  430. package/dist/chunk-q44zc68f.js +4301 -0
  431. package/dist/chunk-q8gknbdx.js +352 -0
  432. package/dist/chunk-q8xk3kdj.js +11 -0
  433. package/dist/chunk-qak46xtp.js +119 -0
  434. package/dist/chunk-qfq7absv.js +95 -0
  435. package/dist/chunk-qfsn720k.js +151 -0
  436. package/dist/chunk-qg4811f6.js +228 -0
  437. package/dist/chunk-qgzn3qps.js +90 -0
  438. package/dist/chunk-qhaggqkt.js +113 -0
  439. package/dist/chunk-qjjp27z8.js +195 -0
  440. package/dist/chunk-qxp0nye6.js +34 -0
  441. package/dist/chunk-qy3nagaq.js +4957 -0
  442. package/dist/chunk-qz2meav1.js +1452 -0
  443. package/dist/chunk-r50hne7m.js +63 -0
  444. package/dist/chunk-r6m0vgnv.js +80 -0
  445. package/dist/chunk-r7yw38vf.js +22864 -0
  446. package/dist/chunk-r8xc618w.js +42 -0
  447. package/dist/chunk-r961r5kj.js +87 -0
  448. package/dist/chunk-r9b5xrh0.js +66 -0
  449. package/dist/chunk-rcn2pd6q.js +477 -0
  450. package/dist/chunk-rdeh8p3y.js +148 -0
  451. package/dist/chunk-rg9x1742.js +542 -0
  452. package/dist/chunk-rgyzsbs3.js +39 -0
  453. package/dist/chunk-rk2fsxtz.js +16 -0
  454. package/dist/chunk-rkchkwv9.js +40 -0
  455. package/dist/chunk-rp8whpb3.js +478 -0
  456. package/dist/chunk-rpkxdtgr.js +68 -0
  457. package/dist/chunk-rpmntgyh.js +394 -0
  458. package/dist/chunk-rpshz4dy.js +614 -0
  459. package/dist/chunk-rqd60ay5.js +133 -0
  460. package/dist/chunk-rrsjf2ea.js +229 -0
  461. package/dist/chunk-rtjk8c8e.js +173 -0
  462. package/dist/chunk-rw0y2wdf.js +1017 -0
  463. package/dist/chunk-rx5w7ess.js +663 -0
  464. package/dist/chunk-rx8t9d35.js +1947 -0
  465. package/dist/chunk-rxcazxgf.js +195 -0
  466. package/dist/chunk-rxg6q3bp.js +1413 -0
  467. package/dist/chunk-rxrb7xnd.js +71 -0
  468. package/dist/chunk-rxrzxff3.js +118 -0
  469. package/dist/chunk-ryqjc943.js +71 -0
  470. package/dist/chunk-rzk9k2rf.js +81 -0
  471. package/dist/chunk-s2qv0nht.js +119 -0
  472. package/dist/chunk-s3hafnk3.js +2285 -0
  473. package/dist/chunk-s4a496tt.js +226 -0
  474. package/dist/chunk-s4d1h3ka.js +35 -0
  475. package/dist/chunk-sm3k3ze4.js +16525 -0
  476. package/dist/chunk-sn0bja82.js +385 -0
  477. package/dist/chunk-sngjggw1.js +4227 -0
  478. package/dist/chunk-sq047n34.js +364 -0
  479. package/dist/chunk-sttwe2tw.js +8584 -0
  480. package/dist/chunk-sw8qx1r0.js +86 -0
  481. package/dist/chunk-swstah6a.js +240 -0
  482. package/dist/chunk-syrkr0mf.js +63 -0
  483. package/dist/chunk-sz206bd9.js +26 -0
  484. package/dist/chunk-t09669cj.js +333 -0
  485. package/dist/chunk-t5f8e30k.js +602 -0
  486. package/dist/chunk-t5m78mc8.js +432 -0
  487. package/dist/chunk-t5x1dqwn.js +143 -0
  488. package/dist/chunk-t877ea0w.js +168 -0
  489. package/dist/chunk-t91hb71c.js +17 -0
  490. package/dist/chunk-tb636bcf.js +942 -0
  491. package/dist/chunk-tb8sykbr.js +426 -0
  492. package/dist/chunk-tbdkekz3.js +125 -0
  493. package/dist/chunk-td2gsz7s.js +225 -0
  494. package/dist/chunk-tenvxbyh.js +20 -0
  495. package/dist/chunk-texg4qqt.js +317 -0
  496. package/dist/chunk-teymzz80.js +266 -0
  497. package/dist/chunk-tj26qpf7.js +153 -0
  498. package/dist/chunk-tk85ec4p.js +395 -0
  499. package/dist/chunk-tq205h01.js +164 -0
  500. package/dist/chunk-tqzddjzg.js +61 -0
  501. package/dist/chunk-trqrj23e.js +134 -0
  502. package/dist/chunk-tw1hfsxv.js +2477 -0
  503. package/dist/chunk-txxdfq83.js +122 -0
  504. package/dist/chunk-v0yhe582.js +31 -0
  505. package/dist/chunk-v14184xm.js +15 -0
  506. package/dist/chunk-v1h9z4hw.js +138 -0
  507. package/dist/chunk-v3ey5j7f.js +329 -0
  508. package/dist/chunk-v3nh1sfn.js +208 -0
  509. package/dist/chunk-v3x8tcc0.js +45 -0
  510. package/dist/chunk-v4nqnvqq.js +3984 -0
  511. package/dist/chunk-v4ypszbb.js +15 -0
  512. package/dist/chunk-v7wbqcx9.js +63 -0
  513. package/dist/chunk-v8r5fev3.js +341 -0
  514. package/dist/chunk-v9zg5kzx.js +2810 -0
  515. package/dist/chunk-va1wh5ss.js +24 -0
  516. package/dist/chunk-vbfswhht.js +42 -0
  517. package/dist/chunk-ve7x2tfq.js +124 -0
  518. package/dist/chunk-vfz8k89y.js +485 -0
  519. package/dist/chunk-vgm5k14x.js +35678 -0
  520. package/dist/chunk-vh9pej3c.js +247 -0
  521. package/dist/chunk-vjxqyt6f.js +3820 -0
  522. package/dist/chunk-vpb1xstn.js +178 -0
  523. package/dist/chunk-vqt79tj8.js +110 -0
  524. package/dist/chunk-vr0n9pv9.js +152 -0
  525. package/dist/chunk-vrejmja5.js +90 -0
  526. package/dist/chunk-vrxasmdw.js +449 -0
  527. package/dist/chunk-vrxb946v.js +125 -0
  528. package/dist/chunk-vv4kj0q8.js +98 -0
  529. package/dist/chunk-vvpfng7w.js +8 -0
  530. package/dist/chunk-vw6ybyew.js +2007 -0
  531. package/dist/chunk-vwenx8ke.js +17 -0
  532. package/dist/chunk-vwfa0s5a.js +155 -0
  533. package/dist/chunk-vx71j8xe.js +63 -0
  534. package/dist/chunk-vxbjzggp.js +43 -0
  535. package/dist/chunk-vxjxtz8w.js +440 -0
  536. package/dist/chunk-vy0c1bwp.js +9 -0
  537. package/dist/chunk-w3zczyse.js +14 -0
  538. package/dist/chunk-w4p5t920.js +655 -0
  539. package/dist/chunk-w68wc625.js +287 -0
  540. package/dist/chunk-w9ddp3yf.js +96 -0
  541. package/dist/chunk-wcggm5ja.js +125 -0
  542. package/dist/chunk-wgnyph3q.js +1306 -0
  543. package/dist/chunk-wjm5pc1e.js +134 -0
  544. package/dist/chunk-wnve0drm.js +131 -0
  545. package/dist/chunk-wp27ev2k.js +135 -0
  546. package/dist/chunk-wyvy8a4x.js +131 -0
  547. package/dist/chunk-x671y4dk.js +129 -0
  548. package/dist/chunk-xbj5keyy.js +22 -0
  549. package/dist/chunk-xf4fzms8.js +39 -0
  550. package/dist/chunk-xf59k3zg.js +65 -0
  551. package/dist/chunk-xgzc4w49.js +204 -0
  552. package/dist/chunk-xhj7g13b.js +2149 -0
  553. package/dist/chunk-xjp0cd00.js +56 -0
  554. package/dist/chunk-xkhnmhqs.js +74 -0
  555. package/dist/chunk-xkrkqx61.js +55 -0
  556. package/dist/chunk-xmpgmeb8.js +114 -0
  557. package/dist/chunk-xrw80zgd.js +4249 -0
  558. package/dist/chunk-xrzc96g0.js +202 -0
  559. package/dist/chunk-xt76sm44.js +318 -0
  560. package/dist/chunk-xwet3awb.js +20 -0
  561. package/dist/chunk-xyg1sk2w.js +78 -0
  562. package/dist/chunk-y0jpkqb0.js +180 -0
  563. package/dist/chunk-y1q7rt9n.js +102 -0
  564. package/dist/chunk-y67ntyek.js +258 -0
  565. package/dist/chunk-ybk37qp9.js +37 -0
  566. package/dist/chunk-yc1stfve.js +5386 -0
  567. package/dist/chunk-ychjpjef.js +62 -0
  568. package/dist/chunk-yez8fa9g.js +276 -0
  569. package/dist/chunk-ygm7xszr.js +90 -0
  570. package/dist/chunk-ym11azkj.js +37 -0
  571. package/dist/chunk-ympz2h15.js +578 -0
  572. package/dist/chunk-yqx3az3n.js +129 -0
  573. package/dist/chunk-yt3nfhcc.js +152 -0
  574. package/dist/chunk-yy8q0n8s.js +120 -0
  575. package/dist/chunk-yzb92zxv.js +8 -0
  576. package/dist/chunk-yzet6xyr.js +119 -0
  577. package/dist/chunk-yzm97qp1.js +226 -0
  578. package/dist/chunk-z0jgeax8.js +35 -0
  579. package/dist/chunk-z1r3z6w6.js +29 -0
  580. package/dist/chunk-z2dp53wn.js +17 -0
  581. package/dist/chunk-z79355gz.js +308 -0
  582. package/dist/chunk-z7e94hxz.js +251 -0
  583. package/dist/chunk-z8cqdcec.js +173 -0
  584. package/dist/chunk-z99tbg45.js +148 -0
  585. package/dist/chunk-z9nsjcht.js +37 -0
  586. package/dist/chunk-za3k6h2h.js +470 -0
  587. package/dist/chunk-zacynq5p.js +265 -0
  588. package/dist/chunk-zb0x40az.js +1785 -0
  589. package/dist/chunk-zbxtzycc.js +274 -0
  590. package/dist/chunk-zga50181.js +342 -0
  591. package/dist/chunk-zhb2pns1.js +44 -0
  592. package/dist/chunk-zkch6trx.js +231 -0
  593. package/dist/chunk-znf3z4qt.js +954 -0
  594. package/dist/chunk-zp8zwdgq.js +72 -0
  595. package/dist/chunk-ztjd8pyf.js +120 -0
  596. package/dist/chunk-ztmb7geg.js +173 -0
  597. package/dist/chunk-zvr4snzv.js +887 -0
  598. package/dist/chunk-zw62m6n3.js +34858 -0
  599. package/dist/chunk-zwwdebd0.js +65 -0
  600. package/dist/chunk-zxc6x9w8.js +340 -0
  601. package/dist/chunk-zy2e7sz0.js +8 -0
  602. package/dist/chunk-zzf074w3.js +196 -0
  603. package/dist/chunk-zzz0nwb5.js +310 -0
  604. package/dist/cli-bun.js +2 -0
  605. package/dist/cli-node.js +2 -0
  606. package/dist/cli.js +218 -0
  607. package/dist/vendor/audio-capture/arm64-darwin/audio-capture.node +0 -0
  608. package/dist/vendor/audio-capture/arm64-linux/audio-capture.node +0 -0
  609. package/dist/vendor/audio-capture/arm64-win32/audio-capture.node +0 -0
  610. package/dist/vendor/audio-capture/x64-darwin/audio-capture.node +0 -0
  611. package/dist/vendor/audio-capture/x64-linux/audio-capture.node +0 -0
  612. package/dist/vendor/audio-capture/x64-win32/audio-capture.node +0 -0
  613. package/dist/vendor/ripgrep/x64-win32/rg.exe +0 -0
  614. package/package.json +243 -0
  615. package/scripts/chrome-mcp-bridge-resolver.mjs +43 -0
  616. package/scripts/chrome-mcp-env.mjs +19 -0
  617. package/scripts/postinstall.cjs +339 -0
  618. package/scripts/run-parallel.mjs +10 -0
  619. package/scripts/setup-chrome-mcp.mjs +69 -0
@@ -0,0 +1,1389 @@
1
+ // @bun
2
+ import {
3
+ envDynamic,
4
+ getFeatureValue_CACHED_MAY_BE_STALE,
5
+ getOauthAccountInfo,
6
+ getOrCreateUserID,
7
+ init_auth,
8
+ init_config1 as init_config,
9
+ init_envDynamic,
10
+ init_growthbook,
11
+ init_metadata,
12
+ sanitizeToolNameForAnalytics
13
+ } from "./chunk-eemjb825.js";
14
+ import {
15
+ getAgentId,
16
+ getAgentName,
17
+ getParentSessionId,
18
+ init_teammate
19
+ } from "./chunk-k7hexw3v.js";
20
+ import {
21
+ require_src
22
+ } from "./chunk-e3abfxpy.js";
23
+ import {
24
+ djb2Hash,
25
+ init_cleanupRegistry,
26
+ init_debug,
27
+ init_envUtils,
28
+ init_errors,
29
+ init_hash,
30
+ init_redscopeCompat,
31
+ init_slowOperations,
32
+ isEnvTruthy,
33
+ jsonParse,
34
+ jsonStringify,
35
+ logForDebugging
36
+ } from "./chunk-s3hafnk3.js";
37
+ import {
38
+ getEventLogger,
39
+ getIsNonInteractiveSession,
40
+ getPromptId,
41
+ getSessionId,
42
+ init_state
43
+ } from "./chunk-9h9k5vz3.js";
44
+ import {
45
+ __esm,
46
+ __toESM
47
+ } from "./chunk-hhsxm2yr.js";
48
+
49
+ // src/utils/taggedId.ts
50
+ function base58Encode(n) {
51
+ const base = BigInt(BASE_58_CHARS.length);
52
+ const result = new Array(ENCODED_LENGTH).fill(BASE_58_CHARS[0]);
53
+ let i = ENCODED_LENGTH - 1;
54
+ let value = n;
55
+ while (value > 0n) {
56
+ const rem = Number(value % base);
57
+ result[i] = BASE_58_CHARS[rem];
58
+ value = value / base;
59
+ i--;
60
+ }
61
+ return result.join("");
62
+ }
63
+ function uuidToBigInt(uuid) {
64
+ const hex = uuid.replace(/-/g, "");
65
+ if (hex.length !== 32) {
66
+ throw new Error(`Invalid UUID hex length: ${hex.length}`);
67
+ }
68
+ return BigInt("0x" + hex);
69
+ }
70
+ function toTaggedId(tag, uuid) {
71
+ const n = uuidToBigInt(uuid);
72
+ return `${tag}_${VERSION}${base58Encode(n)}`;
73
+ }
74
+ var BASE_58_CHARS = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz", VERSION = "01", ENCODED_LENGTH = 22;
75
+ var init_taggedId = () => {};
76
+
77
+ // src/utils/telemetryAttributes.ts
78
+ function shouldIncludeAttribute(envVar) {
79
+ const defaultValue = METRICS_CARDINALITY_DEFAULTS[envVar];
80
+ const envValue = process.env[envVar];
81
+ if (envValue === undefined) {
82
+ return defaultValue;
83
+ }
84
+ return isEnvTruthy(envValue);
85
+ }
86
+ function getTelemetryAttributes() {
87
+ const userId = getOrCreateUserID();
88
+ const sessionId = getSessionId();
89
+ const attributes = {
90
+ "user.id": userId
91
+ };
92
+ if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_SESSION_ID")) {
93
+ attributes["session.id"] = sessionId;
94
+ }
95
+ if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
96
+ attributes["app.version"] = "1.0.0";
97
+ }
98
+ const oauthAccount = getOauthAccountInfo();
99
+ if (oauthAccount) {
100
+ const orgId = oauthAccount.organizationUuid;
101
+ const email = oauthAccount.emailAddress;
102
+ const accountUuid = oauthAccount.accountUuid;
103
+ if (orgId)
104
+ attributes["organization.id"] = orgId;
105
+ if (email)
106
+ attributes["user.email"] = email;
107
+ if (accountUuid && shouldIncludeAttribute("OTEL_METRICS_INCLUDE_ACCOUNT_UUID")) {
108
+ attributes["user.account_uuid"] = accountUuid;
109
+ attributes["user.account_id"] = process.env.CLAUDE_CODE_ACCOUNT_TAGGED_ID || toTaggedId("user", accountUuid);
110
+ }
111
+ }
112
+ if (envDynamic.terminal) {
113
+ attributes["terminal.type"] = envDynamic.terminal;
114
+ }
115
+ return attributes;
116
+ }
117
+ var METRICS_CARDINALITY_DEFAULTS;
118
+ var init_telemetryAttributes = __esm(() => {
119
+ init_state();
120
+ init_auth();
121
+ init_config();
122
+ init_envDynamic();
123
+ init_envUtils();
124
+ init_taggedId();
125
+ METRICS_CARDINALITY_DEFAULTS = {
126
+ OTEL_METRICS_INCLUDE_SESSION_ID: true,
127
+ OTEL_METRICS_INCLUDE_VERSION: false,
128
+ OTEL_METRICS_INCLUDE_ACCOUNT_UUID: true
129
+ };
130
+ });
131
+
132
+ // src/utils/telemetry/events.ts
133
+ function isUserPromptLoggingEnabled() {
134
+ return isEnvTruthy(process.env.OTEL_LOG_USER_PROMPTS);
135
+ }
136
+ function redactIfDisabled(content) {
137
+ return isUserPromptLoggingEnabled() ? content : "<REDACTED>";
138
+ }
139
+ async function logOTelEvent(eventName, metadata = {}) {
140
+ const eventLogger = getEventLogger();
141
+ if (!eventLogger) {
142
+ if (!hasWarnedNoEventLogger) {
143
+ hasWarnedNoEventLogger = true;
144
+ logForDebugging(`[3P telemetry] Event dropped (no event logger initialized): ${eventName}`, { level: "warn" });
145
+ }
146
+ return;
147
+ }
148
+ if (false) {}
149
+ const attributes = {
150
+ ...getTelemetryAttributes(),
151
+ "event.name": eventName,
152
+ "event.timestamp": new Date().toISOString(),
153
+ "event.sequence": eventSequence++
154
+ };
155
+ const promptId = getPromptId();
156
+ if (promptId) {
157
+ attributes["prompt.id"] = promptId;
158
+ }
159
+ const workspaceDir = process.env.CLAUDE_CODE_WORKSPACE_HOST_PATHS;
160
+ if (workspaceDir) {
161
+ attributes["workspace.host_paths"] = workspaceDir.split("|");
162
+ }
163
+ for (const [key, value] of Object.entries(metadata)) {
164
+ if (value !== undefined) {
165
+ attributes[key] = value;
166
+ }
167
+ }
168
+ eventLogger.emit({
169
+ body: `claude_code.${eventName}`,
170
+ attributes
171
+ });
172
+ }
173
+ var eventSequence = 0, hasWarnedNoEventLogger = false;
174
+ var init_events = __esm(() => {
175
+ init_state();
176
+ init_debug();
177
+ init_envUtils();
178
+ init_telemetryAttributes();
179
+ });
180
+
181
+ // src/utils/telemetry/betaSessionTracing.ts
182
+ import { createHash } from "crypto";
183
+ function clearBetaTracingState() {
184
+ seenHashes.clear();
185
+ lastReportedMessageHash.clear();
186
+ }
187
+ function isBetaTracingEnabled() {
188
+ const baseEnabled = isEnvTruthy(process.env.ENABLE_BETA_TRACING_DETAILED) && Boolean(process.env.BETA_TRACING_ENDPOINT);
189
+ if (!baseEnabled) {
190
+ return false;
191
+ }
192
+ if (process.env.USER_TYPE !== "ant") {
193
+ return getIsNonInteractiveSession() || getFeatureValue_CACHED_MAY_BE_STALE("tengu_trace_lantern", false);
194
+ }
195
+ return true;
196
+ }
197
+ function truncateContent(content, maxSize = MAX_CONTENT_SIZE) {
198
+ if (content.length <= maxSize) {
199
+ return { content, truncated: false };
200
+ }
201
+ return {
202
+ content: content.slice(0, maxSize) + `
203
+
204
+ [TRUNCATED - Content exceeds 60KB limit]`,
205
+ truncated: true
206
+ };
207
+ }
208
+ function shortHash(content) {
209
+ return createHash("sha256").update(content).digest("hex").slice(0, 12);
210
+ }
211
+ function hashSystemPrompt(systemPrompt) {
212
+ return `sp_${shortHash(systemPrompt)}`;
213
+ }
214
+ function hashMessage(message) {
215
+ const content = jsonStringify(message.message.content);
216
+ return `msg_${shortHash(content)}`;
217
+ }
218
+ function extractSystemReminderContent(text) {
219
+ const match = text.trim().match(SYSTEM_REMINDER_REGEX);
220
+ return match && match[1] ? match[1].trim() : null;
221
+ }
222
+ function formatMessagesForContext(messages) {
223
+ const contextParts = [];
224
+ const systemReminders = [];
225
+ for (const message of messages) {
226
+ const content = message.message.content;
227
+ if (typeof content === "string") {
228
+ const reminderContent = extractSystemReminderContent(content);
229
+ if (reminderContent) {
230
+ systemReminders.push(reminderContent);
231
+ } else {
232
+ contextParts.push(`[USER]
233
+ ${content}`);
234
+ }
235
+ } else if (Array.isArray(content)) {
236
+ for (const block of content) {
237
+ if (block.type === "text") {
238
+ const reminderContent = extractSystemReminderContent(block.text);
239
+ if (reminderContent) {
240
+ systemReminders.push(reminderContent);
241
+ } else {
242
+ contextParts.push(`[USER]
243
+ ${block.text}`);
244
+ }
245
+ } else if (block.type === "tool_result") {
246
+ const resultContent = typeof block.content === "string" ? block.content : jsonStringify(block.content);
247
+ const reminderContent = extractSystemReminderContent(resultContent);
248
+ if (reminderContent) {
249
+ systemReminders.push(reminderContent);
250
+ } else {
251
+ contextParts.push(`[TOOL RESULT: ${block.tool_use_id}]
252
+ ${resultContent}`);
253
+ }
254
+ }
255
+ }
256
+ }
257
+ }
258
+ return { contextParts, systemReminders };
259
+ }
260
+ function addBetaInteractionAttributes(span, userPrompt) {
261
+ if (!isBetaTracingEnabled()) {
262
+ return;
263
+ }
264
+ const { content: truncatedPrompt, truncated } = truncateContent(`[USER PROMPT]
265
+ ${userPrompt}`);
266
+ span.setAttributes({
267
+ new_context: truncatedPrompt,
268
+ ...truncated && {
269
+ new_context_truncated: true,
270
+ new_context_original_length: userPrompt.length
271
+ }
272
+ });
273
+ }
274
+ function addBetaLLMRequestAttributes(span, newContext, messagesForAPI) {
275
+ if (!isBetaTracingEnabled()) {
276
+ return;
277
+ }
278
+ if (newContext?.systemPrompt) {
279
+ const promptHash = hashSystemPrompt(newContext.systemPrompt);
280
+ const preview = newContext.systemPrompt.slice(0, 500);
281
+ span.setAttribute("system_prompt_hash", promptHash);
282
+ span.setAttribute("system_prompt_preview", preview);
283
+ span.setAttribute("system_prompt_length", newContext.systemPrompt.length);
284
+ if (!seenHashes.has(promptHash)) {
285
+ seenHashes.add(promptHash);
286
+ const { content: truncatedPrompt, truncated } = truncateContent(newContext.systemPrompt);
287
+ logOTelEvent("system_prompt", {
288
+ system_prompt_hash: promptHash,
289
+ system_prompt: truncatedPrompt,
290
+ system_prompt_length: String(newContext.systemPrompt.length),
291
+ ...truncated && { system_prompt_truncated: "true" }
292
+ });
293
+ }
294
+ }
295
+ if (newContext?.tools) {
296
+ try {
297
+ const toolsArray = jsonParse(newContext.tools);
298
+ const toolsWithHashes = toolsArray.map((tool) => {
299
+ const toolJson = jsonStringify(tool);
300
+ const toolHash = shortHash(toolJson);
301
+ return {
302
+ name: typeof tool.name === "string" ? tool.name : "unknown",
303
+ hash: toolHash,
304
+ json: toolJson
305
+ };
306
+ });
307
+ span.setAttribute("tools", jsonStringify(toolsWithHashes.map(({ name, hash }) => ({ name, hash }))));
308
+ span.setAttribute("tools_count", toolsWithHashes.length);
309
+ for (const { name, hash, json } of toolsWithHashes) {
310
+ if (!seenHashes.has(`tool_${hash}`)) {
311
+ seenHashes.add(`tool_${hash}`);
312
+ const { content: truncatedTool, truncated } = truncateContent(json);
313
+ logOTelEvent("tool", {
314
+ tool_name: sanitizeToolNameForAnalytics(name),
315
+ tool_hash: hash,
316
+ tool: truncatedTool,
317
+ ...truncated && { tool_truncated: "true" }
318
+ });
319
+ }
320
+ }
321
+ } catch {
322
+ span.setAttribute("tools_parse_error", true);
323
+ }
324
+ }
325
+ if (messagesForAPI && messagesForAPI.length > 0 && newContext?.querySource) {
326
+ const querySource = newContext.querySource;
327
+ const lastHash = lastReportedMessageHash.get(querySource);
328
+ let startIndex = 0;
329
+ if (lastHash) {
330
+ for (let i = 0;i < messagesForAPI.length; i++) {
331
+ const msg = messagesForAPI[i];
332
+ if (msg && hashMessage(msg) === lastHash) {
333
+ startIndex = i + 1;
334
+ break;
335
+ }
336
+ }
337
+ }
338
+ const newMessages = messagesForAPI.slice(startIndex).filter((m) => m.type === "user");
339
+ if (newMessages.length > 0) {
340
+ const { contextParts, systemReminders } = formatMessagesForContext(newMessages);
341
+ if (contextParts.length > 0) {
342
+ const fullContext = contextParts.join(`
343
+
344
+ ---
345
+
346
+ `);
347
+ const { content: truncatedContext, truncated } = truncateContent(fullContext);
348
+ span.setAttributes({
349
+ new_context: truncatedContext,
350
+ new_context_message_count: newMessages.length,
351
+ ...truncated && {
352
+ new_context_truncated: true,
353
+ new_context_original_length: fullContext.length
354
+ }
355
+ });
356
+ }
357
+ if (systemReminders.length > 0) {
358
+ const fullReminders = systemReminders.join(`
359
+
360
+ ---
361
+
362
+ `);
363
+ const { content: truncatedReminders, truncated: remindersTruncated } = truncateContent(fullReminders);
364
+ span.setAttributes({
365
+ system_reminders: truncatedReminders,
366
+ system_reminders_count: systemReminders.length,
367
+ ...remindersTruncated && {
368
+ system_reminders_truncated: true,
369
+ system_reminders_original_length: fullReminders.length
370
+ }
371
+ });
372
+ }
373
+ const lastMessage = messagesForAPI[messagesForAPI.length - 1];
374
+ if (lastMessage) {
375
+ lastReportedMessageHash.set(querySource, hashMessage(lastMessage));
376
+ }
377
+ }
378
+ }
379
+ }
380
+ function addBetaLLMResponseAttributes(endAttributes, metadata) {
381
+ if (!isBetaTracingEnabled() || !metadata) {
382
+ return;
383
+ }
384
+ if (metadata.modelOutput !== undefined) {
385
+ const { content: modelOutput, truncated: outputTruncated } = truncateContent(metadata.modelOutput);
386
+ endAttributes["response.model_output"] = modelOutput;
387
+ if (outputTruncated) {
388
+ endAttributes["response.model_output_truncated"] = true;
389
+ endAttributes["response.model_output_original_length"] = metadata.modelOutput.length;
390
+ }
391
+ }
392
+ if (process.env.USER_TYPE === "ant" && metadata.thinkingOutput !== undefined) {
393
+ const { content: thinkingOutput, truncated: thinkingTruncated } = truncateContent(metadata.thinkingOutput);
394
+ endAttributes["response.thinking_output"] = thinkingOutput;
395
+ if (thinkingTruncated) {
396
+ endAttributes["response.thinking_output_truncated"] = true;
397
+ endAttributes["response.thinking_output_original_length"] = metadata.thinkingOutput.length;
398
+ }
399
+ }
400
+ }
401
+ function addBetaToolInputAttributes(span, toolName, toolInput) {
402
+ if (!isBetaTracingEnabled()) {
403
+ return;
404
+ }
405
+ const { content: truncatedInput, truncated } = truncateContent(`[TOOL INPUT: ${toolName}]
406
+ ${toolInput}`);
407
+ span.setAttributes({
408
+ tool_input: truncatedInput,
409
+ ...truncated && {
410
+ tool_input_truncated: true,
411
+ tool_input_original_length: toolInput.length
412
+ }
413
+ });
414
+ }
415
+ function addBetaToolResultAttributes(endAttributes, toolName, toolResult) {
416
+ if (!isBetaTracingEnabled()) {
417
+ return;
418
+ }
419
+ const { content: truncatedResult, truncated } = truncateContent(`[TOOL RESULT: ${toolName}]
420
+ ${toolResult}`);
421
+ endAttributes["new_context"] = truncatedResult;
422
+ if (truncated) {
423
+ endAttributes["new_context_truncated"] = true;
424
+ endAttributes["new_context_original_length"] = toolResult.length;
425
+ }
426
+ }
427
+ var seenHashes, lastReportedMessageHash, MAX_CONTENT_SIZE, SYSTEM_REMINDER_REGEX;
428
+ var init_betaSessionTracing = __esm(() => {
429
+ init_state();
430
+ init_growthbook();
431
+ init_metadata();
432
+ init_envUtils();
433
+ init_slowOperations();
434
+ init_events();
435
+ seenHashes = new Set;
436
+ lastReportedMessageHash = new Map;
437
+ MAX_CONTENT_SIZE = 60 * 1024;
438
+ SYSTEM_REMINDER_REGEX = /^<system-reminder>\n?([\s\S]*?)\n?<\/system-reminder>$/;
439
+ });
440
+
441
+ // src/utils/telemetry/perfettoTracing.ts
442
+ function stringToNumericHash(str) {
443
+ return Math.abs(djb2Hash(str)) || 1;
444
+ }
445
+ function getProcessIdForAgent(agentId) {
446
+ const existing = agentIdToProcessId.get(agentId);
447
+ if (existing !== undefined)
448
+ return existing;
449
+ processIdCounter++;
450
+ agentIdToProcessId.set(agentId, processIdCounter);
451
+ return processIdCounter;
452
+ }
453
+ function getCurrentAgentInfo() {
454
+ const agentId = getAgentId() ?? getSessionId();
455
+ const agentName = getAgentName() ?? "main";
456
+ const parentSessionId = getParentSessionId();
457
+ const existing = agentRegistry.get(agentId);
458
+ if (existing)
459
+ return existing;
460
+ const info = {
461
+ agentId,
462
+ agentName,
463
+ parentAgentId: parentSessionId,
464
+ processId: agentId === getSessionId() ? 1 : getProcessIdForAgent(agentId),
465
+ threadId: stringToNumericHash(agentName)
466
+ };
467
+ agentRegistry.set(agentId, info);
468
+ totalAgentCount++;
469
+ return info;
470
+ }
471
+ function getTimestamp() {
472
+ return (Date.now() - startTimeMs) * 1000;
473
+ }
474
+ function generateSpanId() {
475
+ return `span_${++spanIdCounter}`;
476
+ }
477
+ function initializePerfettoTracing() {
478
+ const envValue = process.env.CLAUDE_CODE_PERFETTO_TRACE;
479
+ logForDebugging(`[Perfetto] initializePerfettoTracing called, env value: ${envValue}`);
480
+ if (false) {}
481
+ }
482
+ function emitProcessMetadata(agentInfo) {
483
+ if (!isEnabled)
484
+ return;
485
+ metadataEvents.push({
486
+ name: "process_name",
487
+ cat: "__metadata",
488
+ ph: "M",
489
+ ts: 0,
490
+ pid: agentInfo.processId,
491
+ tid: 0,
492
+ args: { name: agentInfo.agentName }
493
+ });
494
+ metadataEvents.push({
495
+ name: "thread_name",
496
+ cat: "__metadata",
497
+ ph: "M",
498
+ ts: 0,
499
+ pid: agentInfo.processId,
500
+ tid: agentInfo.threadId,
501
+ args: { name: agentInfo.agentName }
502
+ });
503
+ if (agentInfo.parentAgentId) {
504
+ metadataEvents.push({
505
+ name: "parent_agent",
506
+ cat: "__metadata",
507
+ ph: "M",
508
+ ts: 0,
509
+ pid: agentInfo.processId,
510
+ tid: 0,
511
+ args: {
512
+ parent_agent_id: agentInfo.parentAgentId
513
+ }
514
+ });
515
+ }
516
+ }
517
+ function isPerfettoTracingEnabled() {
518
+ return isEnabled;
519
+ }
520
+ function registerAgent(agentId, agentName, parentAgentId) {
521
+ if (!isEnabled)
522
+ return;
523
+ const info = {
524
+ agentId,
525
+ agentName,
526
+ parentAgentId,
527
+ processId: getProcessIdForAgent(agentId),
528
+ threadId: stringToNumericHash(agentName)
529
+ };
530
+ agentRegistry.set(agentId, info);
531
+ totalAgentCount++;
532
+ emitProcessMetadata(info);
533
+ }
534
+ function unregisterAgent(agentId) {
535
+ if (!isEnabled)
536
+ return;
537
+ agentRegistry.delete(agentId);
538
+ agentIdToProcessId.delete(agentId);
539
+ }
540
+ function startLLMRequestPerfettoSpan(args) {
541
+ if (!isEnabled)
542
+ return "";
543
+ const spanId = generateSpanId();
544
+ const agentInfo = getCurrentAgentInfo();
545
+ pendingSpans.set(spanId, {
546
+ name: "API Call",
547
+ category: "api",
548
+ startTime: getTimestamp(),
549
+ agentInfo,
550
+ args: {
551
+ model: args.model,
552
+ prompt_tokens: args.promptTokens,
553
+ message_id: args.messageId,
554
+ is_speculative: args.isSpeculative ?? false,
555
+ query_source: args.querySource
556
+ }
557
+ });
558
+ events.push({
559
+ name: "API Call",
560
+ cat: "api",
561
+ ph: "B",
562
+ ts: pendingSpans.get(spanId).startTime,
563
+ pid: agentInfo.processId,
564
+ tid: agentInfo.threadId,
565
+ args: pendingSpans.get(spanId).args
566
+ });
567
+ return spanId;
568
+ }
569
+ function endLLMRequestPerfettoSpan(spanId, metadata) {
570
+ if (!isEnabled || !spanId)
571
+ return;
572
+ const pending = pendingSpans.get(spanId);
573
+ if (!pending)
574
+ return;
575
+ const endTime = getTimestamp();
576
+ const duration = endTime - pending.startTime;
577
+ const promptTokens = metadata.promptTokens ?? pending.args.prompt_tokens;
578
+ const ttftMs = metadata.ttftMs;
579
+ const ttltMs = metadata.ttltMs;
580
+ const outputTokens = metadata.outputTokens;
581
+ const cacheReadTokens = metadata.cacheReadTokens;
582
+ const itps = ttftMs !== undefined && promptTokens !== undefined && ttftMs > 0 ? Math.round(promptTokens / (ttftMs / 1000) * 100) / 100 : undefined;
583
+ const samplingMs = ttltMs !== undefined && ttftMs !== undefined ? ttltMs - ttftMs : undefined;
584
+ const otps = samplingMs !== undefined && outputTokens !== undefined && samplingMs > 0 ? Math.round(outputTokens / (samplingMs / 1000) * 100) / 100 : undefined;
585
+ const cacheHitRate = cacheReadTokens !== undefined && promptTokens !== undefined && promptTokens > 0 ? Math.round(cacheReadTokens / promptTokens * 1e4) / 100 : undefined;
586
+ const requestSetupMs = metadata.requestSetupMs;
587
+ const attemptStartTimes = metadata.attemptStartTimes;
588
+ const args = {
589
+ ...pending.args,
590
+ ttft_ms: ttftMs,
591
+ ttlt_ms: ttltMs,
592
+ prompt_tokens: promptTokens,
593
+ output_tokens: outputTokens,
594
+ cache_read_tokens: cacheReadTokens,
595
+ cache_creation_tokens: metadata.cacheCreationTokens,
596
+ message_id: metadata.messageId ?? pending.args.message_id,
597
+ success: metadata.success ?? true,
598
+ error: metadata.error,
599
+ duration_ms: duration / 1000,
600
+ request_setup_ms: requestSetupMs,
601
+ itps,
602
+ otps,
603
+ cache_hit_rate_pct: cacheHitRate
604
+ };
605
+ const setupUs = requestSetupMs !== undefined && requestSetupMs > 0 ? requestSetupMs * 1000 : 0;
606
+ if (setupUs > 0) {
607
+ const setupEndTs = pending.startTime + setupUs;
608
+ events.push({
609
+ name: "Request Setup",
610
+ cat: "api,setup",
611
+ ph: "B",
612
+ ts: pending.startTime,
613
+ pid: pending.agentInfo.processId,
614
+ tid: pending.agentInfo.threadId,
615
+ args: {
616
+ request_setup_ms: requestSetupMs,
617
+ attempt_count: attemptStartTimes?.length ?? 1
618
+ }
619
+ });
620
+ if (attemptStartTimes && attemptStartTimes.length > 1) {
621
+ const baseWallMs = attemptStartTimes[0];
622
+ for (let i = 0;i < attemptStartTimes.length - 1; i++) {
623
+ const attemptStartUs = pending.startTime + (attemptStartTimes[i] - baseWallMs) * 1000;
624
+ const attemptEndUs = pending.startTime + (attemptStartTimes[i + 1] - baseWallMs) * 1000;
625
+ events.push({
626
+ name: `Attempt ${i + 1} (retry)`,
627
+ cat: "api,retry",
628
+ ph: "B",
629
+ ts: attemptStartUs,
630
+ pid: pending.agentInfo.processId,
631
+ tid: pending.agentInfo.threadId,
632
+ args: { attempt: i + 1 }
633
+ });
634
+ events.push({
635
+ name: `Attempt ${i + 1} (retry)`,
636
+ cat: "api,retry",
637
+ ph: "E",
638
+ ts: attemptEndUs,
639
+ pid: pending.agentInfo.processId,
640
+ tid: pending.agentInfo.threadId
641
+ });
642
+ }
643
+ }
644
+ events.push({
645
+ name: "Request Setup",
646
+ cat: "api,setup",
647
+ ph: "E",
648
+ ts: setupEndTs,
649
+ pid: pending.agentInfo.processId,
650
+ tid: pending.agentInfo.threadId
651
+ });
652
+ }
653
+ if (ttftMs !== undefined) {
654
+ const firstTokenStartTs = pending.startTime + setupUs;
655
+ const firstTokenEndTs = firstTokenStartTs + ttftMs * 1000;
656
+ events.push({
657
+ name: "First Token",
658
+ cat: "api,ttft",
659
+ ph: "B",
660
+ ts: firstTokenStartTs,
661
+ pid: pending.agentInfo.processId,
662
+ tid: pending.agentInfo.threadId,
663
+ args: {
664
+ ttft_ms: ttftMs,
665
+ prompt_tokens: promptTokens,
666
+ itps,
667
+ cache_hit_rate_pct: cacheHitRate
668
+ }
669
+ });
670
+ events.push({
671
+ name: "First Token",
672
+ cat: "api,ttft",
673
+ ph: "E",
674
+ ts: firstTokenEndTs,
675
+ pid: pending.agentInfo.processId,
676
+ tid: pending.agentInfo.threadId
677
+ });
678
+ const actualSamplingMs = ttltMs !== undefined ? ttltMs - ttftMs - setupUs / 1000 : undefined;
679
+ if (actualSamplingMs !== undefined && actualSamplingMs > 0) {
680
+ events.push({
681
+ name: "Sampling",
682
+ cat: "api,sampling",
683
+ ph: "B",
684
+ ts: firstTokenEndTs,
685
+ pid: pending.agentInfo.processId,
686
+ tid: pending.agentInfo.threadId,
687
+ args: {
688
+ sampling_ms: actualSamplingMs,
689
+ output_tokens: outputTokens,
690
+ otps
691
+ }
692
+ });
693
+ events.push({
694
+ name: "Sampling",
695
+ cat: "api,sampling",
696
+ ph: "E",
697
+ ts: firstTokenEndTs + actualSamplingMs * 1000,
698
+ pid: pending.agentInfo.processId,
699
+ tid: pending.agentInfo.threadId
700
+ });
701
+ }
702
+ }
703
+ events.push({
704
+ name: pending.name,
705
+ cat: pending.category,
706
+ ph: "E",
707
+ ts: endTime,
708
+ pid: pending.agentInfo.processId,
709
+ tid: pending.agentInfo.threadId,
710
+ args
711
+ });
712
+ pendingSpans.delete(spanId);
713
+ }
714
+ function startToolPerfettoSpan(toolName, args) {
715
+ if (!isEnabled)
716
+ return "";
717
+ const spanId = generateSpanId();
718
+ const agentInfo = getCurrentAgentInfo();
719
+ pendingSpans.set(spanId, {
720
+ name: `Tool: ${toolName}`,
721
+ category: "tool",
722
+ startTime: getTimestamp(),
723
+ agentInfo,
724
+ args: {
725
+ tool_name: toolName,
726
+ ...args
727
+ }
728
+ });
729
+ events.push({
730
+ name: `Tool: ${toolName}`,
731
+ cat: "tool",
732
+ ph: "B",
733
+ ts: pendingSpans.get(spanId).startTime,
734
+ pid: agentInfo.processId,
735
+ tid: agentInfo.threadId,
736
+ args: pendingSpans.get(spanId).args
737
+ });
738
+ return spanId;
739
+ }
740
+ function endToolPerfettoSpan(spanId, metadata) {
741
+ if (!isEnabled || !spanId)
742
+ return;
743
+ const pending = pendingSpans.get(spanId);
744
+ if (!pending)
745
+ return;
746
+ const endTime = getTimestamp();
747
+ const duration = endTime - pending.startTime;
748
+ const args = {
749
+ ...pending.args,
750
+ success: metadata?.success ?? true,
751
+ error: metadata?.error,
752
+ result_tokens: metadata?.resultTokens,
753
+ duration_ms: duration / 1000
754
+ };
755
+ events.push({
756
+ name: pending.name,
757
+ cat: pending.category,
758
+ ph: "E",
759
+ ts: endTime,
760
+ pid: pending.agentInfo.processId,
761
+ tid: pending.agentInfo.threadId,
762
+ args
763
+ });
764
+ pendingSpans.delete(spanId);
765
+ }
766
+ function startUserInputPerfettoSpan(context) {
767
+ if (!isEnabled)
768
+ return "";
769
+ const spanId = generateSpanId();
770
+ const agentInfo = getCurrentAgentInfo();
771
+ pendingSpans.set(spanId, {
772
+ name: "Waiting for User Input",
773
+ category: "user_input",
774
+ startTime: getTimestamp(),
775
+ agentInfo,
776
+ args: {
777
+ context
778
+ }
779
+ });
780
+ events.push({
781
+ name: "Waiting for User Input",
782
+ cat: "user_input",
783
+ ph: "B",
784
+ ts: pendingSpans.get(spanId).startTime,
785
+ pid: agentInfo.processId,
786
+ tid: agentInfo.threadId,
787
+ args: pendingSpans.get(spanId).args
788
+ });
789
+ return spanId;
790
+ }
791
+ function endUserInputPerfettoSpan(spanId, metadata) {
792
+ if (!isEnabled || !spanId)
793
+ return;
794
+ const pending = pendingSpans.get(spanId);
795
+ if (!pending)
796
+ return;
797
+ const endTime = getTimestamp();
798
+ const duration = endTime - pending.startTime;
799
+ const args = {
800
+ ...pending.args,
801
+ decision: metadata?.decision,
802
+ source: metadata?.source,
803
+ duration_ms: duration / 1000
804
+ };
805
+ events.push({
806
+ name: pending.name,
807
+ cat: pending.category,
808
+ ph: "E",
809
+ ts: endTime,
810
+ pid: pending.agentInfo.processId,
811
+ tid: pending.agentInfo.threadId,
812
+ args
813
+ });
814
+ pendingSpans.delete(spanId);
815
+ }
816
+ function startInteractionPerfettoSpan(userPrompt) {
817
+ if (!isEnabled)
818
+ return "";
819
+ const spanId = generateSpanId();
820
+ const agentInfo = getCurrentAgentInfo();
821
+ pendingSpans.set(spanId, {
822
+ name: "Interaction",
823
+ category: "interaction",
824
+ startTime: getTimestamp(),
825
+ agentInfo,
826
+ args: {
827
+ user_prompt_length: userPrompt?.length
828
+ }
829
+ });
830
+ events.push({
831
+ name: "Interaction",
832
+ cat: "interaction",
833
+ ph: "B",
834
+ ts: pendingSpans.get(spanId).startTime,
835
+ pid: agentInfo.processId,
836
+ tid: agentInfo.threadId,
837
+ args: pendingSpans.get(spanId).args
838
+ });
839
+ return spanId;
840
+ }
841
+ function endInteractionPerfettoSpan(spanId) {
842
+ if (!isEnabled || !spanId)
843
+ return;
844
+ const pending = pendingSpans.get(spanId);
845
+ if (!pending)
846
+ return;
847
+ const endTime = getTimestamp();
848
+ const duration = endTime - pending.startTime;
849
+ events.push({
850
+ name: pending.name,
851
+ cat: pending.category,
852
+ ph: "E",
853
+ ts: endTime,
854
+ pid: pending.agentInfo.processId,
855
+ tid: pending.agentInfo.threadId,
856
+ args: {
857
+ ...pending.args,
858
+ duration_ms: duration / 1000
859
+ }
860
+ });
861
+ pendingSpans.delete(spanId);
862
+ }
863
+ var isEnabled = false, metadataEvents, events, pendingSpans, agentRegistry, totalAgentCount = 0, startTimeMs = 0, spanIdCounter = 0, processIdCounter = 1, agentIdToProcessId, STALE_SPAN_TTL_MS, STALE_SPAN_CLEANUP_INTERVAL_MS;
864
+ var init_perfettoTracing = __esm(() => {
865
+ init_state();
866
+ init_cleanupRegistry();
867
+ init_debug();
868
+ init_envUtils();
869
+ init_errors();
870
+ init_hash();
871
+ init_redscopeCompat();
872
+ init_slowOperations();
873
+ init_teammate();
874
+ metadataEvents = [];
875
+ events = [];
876
+ pendingSpans = new Map;
877
+ agentRegistry = new Map;
878
+ agentIdToProcessId = new Map;
879
+ STALE_SPAN_TTL_MS = 30 * 60 * 1000;
880
+ STALE_SPAN_CLEANUP_INTERVAL_MS = 60 * 1000;
881
+ });
882
+
883
+ // src/utils/telemetry/sessionTracing.ts
884
+ import { AsyncLocalStorage } from "async_hooks";
885
+ function getSpanId(span) {
886
+ return span.spanContext().spanId || "";
887
+ }
888
+ function ensureCleanupInterval() {
889
+ if (_cleanupIntervalStarted)
890
+ return;
891
+ _cleanupIntervalStarted = true;
892
+ const interval = setInterval(() => {
893
+ const cutoff = Date.now() - SPAN_TTL_MS;
894
+ for (const [spanId, weakRef] of activeSpans) {
895
+ const ctx = weakRef.deref();
896
+ if (ctx === undefined) {
897
+ activeSpans.delete(spanId);
898
+ strongSpans.delete(spanId);
899
+ } else if (ctx.startTime < cutoff) {
900
+ if (!ctx.ended)
901
+ ctx.span.end();
902
+ activeSpans.delete(spanId);
903
+ strongSpans.delete(spanId);
904
+ }
905
+ }
906
+ }, 60000);
907
+ if (typeof interval.unref === "function") {
908
+ interval.unref();
909
+ }
910
+ }
911
+ function isEnhancedTelemetryEnabled() {
912
+ if (false) {}
913
+ return false;
914
+ }
915
+ function isAnyTracingEnabled() {
916
+ return isEnhancedTelemetryEnabled() || isBetaTracingEnabled();
917
+ }
918
+ function getTracer() {
919
+ return import_api.trace.getTracer("com.anthropic.claude_code.tracing", "1.0.0");
920
+ }
921
+ function createSpanAttributes(spanType, customAttributes = {}) {
922
+ const baseAttributes = getTelemetryAttributes();
923
+ const attributes = {
924
+ ...baseAttributes,
925
+ "span.type": spanType,
926
+ ...customAttributes
927
+ };
928
+ return attributes;
929
+ }
930
+ function startInteractionSpan(userPrompt) {
931
+ ensureCleanupInterval();
932
+ const perfettoSpanId = isPerfettoTracingEnabled() ? startInteractionPerfettoSpan(userPrompt) : undefined;
933
+ if (!isAnyTracingEnabled()) {
934
+ if (perfettoSpanId) {
935
+ const dummySpan = import_api.trace.getActiveSpan() || getTracer().startSpan("dummy");
936
+ const spanId2 = getSpanId(dummySpan);
937
+ const spanContextObj2 = {
938
+ span: dummySpan,
939
+ startTime: Date.now(),
940
+ attributes: {},
941
+ perfettoSpanId
942
+ };
943
+ activeSpans.set(spanId2, new WeakRef(spanContextObj2));
944
+ interactionContext.enterWith(spanContextObj2);
945
+ return dummySpan;
946
+ }
947
+ return import_api.trace.getActiveSpan() || getTracer().startSpan("dummy");
948
+ }
949
+ const tracer = getTracer();
950
+ const isUserPromptLoggingEnabled2 = isEnvTruthy(process.env.OTEL_LOG_USER_PROMPTS);
951
+ const promptToLog = isUserPromptLoggingEnabled2 ? userPrompt : "<REDACTED>";
952
+ interactionSequence++;
953
+ const attributes = createSpanAttributes("interaction", {
954
+ user_prompt: promptToLog,
955
+ user_prompt_length: userPrompt.length,
956
+ "interaction.sequence": interactionSequence
957
+ });
958
+ const span = tracer.startSpan("claude_code.interaction", {
959
+ attributes
960
+ });
961
+ addBetaInteractionAttributes(span, userPrompt);
962
+ const spanId = getSpanId(span);
963
+ const spanContextObj = {
964
+ span,
965
+ startTime: Date.now(),
966
+ attributes,
967
+ perfettoSpanId
968
+ };
969
+ activeSpans.set(spanId, new WeakRef(spanContextObj));
970
+ interactionContext.enterWith(spanContextObj);
971
+ return span;
972
+ }
973
+ function endInteractionSpan() {
974
+ const spanContext = interactionContext.getStore();
975
+ if (!spanContext) {
976
+ return;
977
+ }
978
+ if (spanContext.ended) {
979
+ return;
980
+ }
981
+ if (spanContext.perfettoSpanId) {
982
+ endInteractionPerfettoSpan(spanContext.perfettoSpanId);
983
+ }
984
+ if (!isAnyTracingEnabled()) {
985
+ spanContext.ended = true;
986
+ activeSpans.delete(getSpanId(spanContext.span));
987
+ interactionContext.enterWith(undefined);
988
+ return;
989
+ }
990
+ const duration = Date.now() - spanContext.startTime;
991
+ spanContext.span.setAttributes({
992
+ "interaction.duration_ms": duration
993
+ });
994
+ spanContext.span.end();
995
+ spanContext.ended = true;
996
+ activeSpans.delete(getSpanId(spanContext.span));
997
+ interactionContext.enterWith(undefined);
998
+ }
999
+ function startLLMRequestSpan(model, newContext, messagesForAPI, fastMode) {
1000
+ const perfettoSpanId = isPerfettoTracingEnabled() ? startLLMRequestPerfettoSpan({
1001
+ model,
1002
+ querySource: newContext?.querySource,
1003
+ messageId: undefined
1004
+ }) : undefined;
1005
+ if (!isAnyTracingEnabled()) {
1006
+ if (perfettoSpanId) {
1007
+ const dummySpan = import_api.trace.getActiveSpan() || getTracer().startSpan("dummy");
1008
+ const spanId2 = getSpanId(dummySpan);
1009
+ const spanContextObj2 = {
1010
+ span: dummySpan,
1011
+ startTime: Date.now(),
1012
+ attributes: { model },
1013
+ perfettoSpanId
1014
+ };
1015
+ activeSpans.set(spanId2, new WeakRef(spanContextObj2));
1016
+ strongSpans.set(spanId2, spanContextObj2);
1017
+ return dummySpan;
1018
+ }
1019
+ return import_api.trace.getActiveSpan() || getTracer().startSpan("dummy");
1020
+ }
1021
+ const tracer = getTracer();
1022
+ const parentSpanCtx = interactionContext.getStore();
1023
+ const attributes = createSpanAttributes("llm_request", {
1024
+ model,
1025
+ "llm_request.context": parentSpanCtx ? "interaction" : "standalone",
1026
+ speed: fastMode ? "fast" : "normal"
1027
+ });
1028
+ const ctx = parentSpanCtx ? import_api.trace.setSpan(import_api.context.active(), parentSpanCtx.span) : import_api.context.active();
1029
+ const span = tracer.startSpan("claude_code.llm_request", { attributes }, ctx);
1030
+ if (newContext?.querySource) {
1031
+ span.setAttribute("query_source", newContext.querySource);
1032
+ }
1033
+ addBetaLLMRequestAttributes(span, newContext, messagesForAPI);
1034
+ const spanId = getSpanId(span);
1035
+ const spanContextObj = {
1036
+ span,
1037
+ startTime: Date.now(),
1038
+ attributes,
1039
+ perfettoSpanId
1040
+ };
1041
+ activeSpans.set(spanId, new WeakRef(spanContextObj));
1042
+ strongSpans.set(spanId, spanContextObj);
1043
+ return span;
1044
+ }
1045
+ function endLLMRequestSpan(span, metadata) {
1046
+ let llmSpanContext;
1047
+ if (span) {
1048
+ const spanId2 = getSpanId(span);
1049
+ llmSpanContext = activeSpans.get(spanId2)?.deref();
1050
+ } else {
1051
+ llmSpanContext = Array.from(activeSpans.values()).findLast((r) => {
1052
+ const ctx = r.deref();
1053
+ return ctx?.attributes["span.type"] === "llm_request" || ctx?.attributes["model"];
1054
+ })?.deref();
1055
+ }
1056
+ if (!llmSpanContext) {
1057
+ return;
1058
+ }
1059
+ const duration = Date.now() - llmSpanContext.startTime;
1060
+ if (llmSpanContext.perfettoSpanId) {
1061
+ endLLMRequestPerfettoSpan(llmSpanContext.perfettoSpanId, {
1062
+ ttftMs: metadata?.ttftMs,
1063
+ ttltMs: duration,
1064
+ promptTokens: metadata?.inputTokens,
1065
+ outputTokens: metadata?.outputTokens,
1066
+ cacheReadTokens: metadata?.cacheReadTokens,
1067
+ cacheCreationTokens: metadata?.cacheCreationTokens,
1068
+ success: metadata?.success,
1069
+ error: metadata?.error,
1070
+ requestSetupMs: metadata?.requestSetupMs,
1071
+ attemptStartTimes: metadata?.attemptStartTimes
1072
+ });
1073
+ }
1074
+ if (!isAnyTracingEnabled()) {
1075
+ const spanId2 = getSpanId(llmSpanContext.span);
1076
+ activeSpans.delete(spanId2);
1077
+ strongSpans.delete(spanId2);
1078
+ return;
1079
+ }
1080
+ const endAttributes = {
1081
+ duration_ms: duration
1082
+ };
1083
+ if (metadata) {
1084
+ if (metadata.inputTokens !== undefined)
1085
+ endAttributes["input_tokens"] = metadata.inputTokens;
1086
+ if (metadata.outputTokens !== undefined)
1087
+ endAttributes["output_tokens"] = metadata.outputTokens;
1088
+ if (metadata.cacheReadTokens !== undefined)
1089
+ endAttributes["cache_read_tokens"] = metadata.cacheReadTokens;
1090
+ if (metadata.cacheCreationTokens !== undefined)
1091
+ endAttributes["cache_creation_tokens"] = metadata.cacheCreationTokens;
1092
+ if (metadata.success !== undefined)
1093
+ endAttributes["success"] = metadata.success;
1094
+ if (metadata.statusCode !== undefined)
1095
+ endAttributes["status_code"] = metadata.statusCode;
1096
+ if (metadata.error !== undefined)
1097
+ endAttributes["error"] = metadata.error;
1098
+ if (metadata.attempt !== undefined)
1099
+ endAttributes["attempt"] = metadata.attempt;
1100
+ if (metadata.hasToolCall !== undefined)
1101
+ endAttributes["response.has_tool_call"] = metadata.hasToolCall;
1102
+ if (metadata.ttftMs !== undefined)
1103
+ endAttributes["ttft_ms"] = metadata.ttftMs;
1104
+ addBetaLLMResponseAttributes(endAttributes, metadata);
1105
+ }
1106
+ llmSpanContext.span.setAttributes(endAttributes);
1107
+ llmSpanContext.span.end();
1108
+ const spanId = getSpanId(llmSpanContext.span);
1109
+ activeSpans.delete(spanId);
1110
+ strongSpans.delete(spanId);
1111
+ }
1112
+ function startToolSpan(toolName, toolAttributes, toolInput) {
1113
+ const perfettoSpanId = isPerfettoTracingEnabled() ? startToolPerfettoSpan(toolName, toolAttributes) : undefined;
1114
+ if (!isAnyTracingEnabled()) {
1115
+ if (perfettoSpanId) {
1116
+ const dummySpan = import_api.trace.getActiveSpan() || getTracer().startSpan("dummy");
1117
+ const spanId2 = getSpanId(dummySpan);
1118
+ const spanContextObj2 = {
1119
+ span: dummySpan,
1120
+ startTime: Date.now(),
1121
+ attributes: { "span.type": "tool", tool_name: toolName },
1122
+ perfettoSpanId
1123
+ };
1124
+ activeSpans.set(spanId2, new WeakRef(spanContextObj2));
1125
+ toolContext.enterWith(spanContextObj2);
1126
+ return dummySpan;
1127
+ }
1128
+ return import_api.trace.getActiveSpan() || getTracer().startSpan("dummy");
1129
+ }
1130
+ const tracer = getTracer();
1131
+ const parentSpanCtx = interactionContext.getStore();
1132
+ const attributes = createSpanAttributes("tool", {
1133
+ tool_name: toolName,
1134
+ ...toolAttributes
1135
+ });
1136
+ const ctx = parentSpanCtx ? import_api.trace.setSpan(import_api.context.active(), parentSpanCtx.span) : import_api.context.active();
1137
+ const span = tracer.startSpan("claude_code.tool", { attributes }, ctx);
1138
+ if (toolInput) {
1139
+ addBetaToolInputAttributes(span, toolName, toolInput);
1140
+ }
1141
+ const spanId = getSpanId(span);
1142
+ const spanContextObj = {
1143
+ span,
1144
+ startTime: Date.now(),
1145
+ attributes,
1146
+ perfettoSpanId
1147
+ };
1148
+ activeSpans.set(spanId, new WeakRef(spanContextObj));
1149
+ toolContext.enterWith(spanContextObj);
1150
+ return span;
1151
+ }
1152
+ function startToolBlockedOnUserSpan() {
1153
+ const perfettoSpanId = isPerfettoTracingEnabled() ? startUserInputPerfettoSpan("tool_permission") : undefined;
1154
+ if (!isAnyTracingEnabled()) {
1155
+ if (perfettoSpanId) {
1156
+ const dummySpan = import_api.trace.getActiveSpan() || getTracer().startSpan("dummy");
1157
+ const spanId2 = getSpanId(dummySpan);
1158
+ const spanContextObj2 = {
1159
+ span: dummySpan,
1160
+ startTime: Date.now(),
1161
+ attributes: { "span.type": "tool.blocked_on_user" },
1162
+ perfettoSpanId
1163
+ };
1164
+ activeSpans.set(spanId2, new WeakRef(spanContextObj2));
1165
+ strongSpans.set(spanId2, spanContextObj2);
1166
+ return dummySpan;
1167
+ }
1168
+ return import_api.trace.getActiveSpan() || getTracer().startSpan("dummy");
1169
+ }
1170
+ const tracer = getTracer();
1171
+ const parentSpanCtx = toolContext.getStore();
1172
+ const attributes = createSpanAttributes("tool.blocked_on_user");
1173
+ const ctx = parentSpanCtx ? import_api.trace.setSpan(import_api.context.active(), parentSpanCtx.span) : import_api.context.active();
1174
+ const span = tracer.startSpan("claude_code.tool.blocked_on_user", { attributes }, ctx);
1175
+ const spanId = getSpanId(span);
1176
+ const spanContextObj = {
1177
+ span,
1178
+ startTime: Date.now(),
1179
+ attributes,
1180
+ perfettoSpanId
1181
+ };
1182
+ activeSpans.set(spanId, new WeakRef(spanContextObj));
1183
+ strongSpans.set(spanId, spanContextObj);
1184
+ return span;
1185
+ }
1186
+ function endToolBlockedOnUserSpan(decision, source) {
1187
+ const blockedSpanContext = Array.from(activeSpans.values()).findLast((r) => r.deref()?.attributes["span.type"] === "tool.blocked_on_user")?.deref();
1188
+ if (!blockedSpanContext) {
1189
+ return;
1190
+ }
1191
+ if (blockedSpanContext.perfettoSpanId) {
1192
+ endUserInputPerfettoSpan(blockedSpanContext.perfettoSpanId, {
1193
+ decision,
1194
+ source
1195
+ });
1196
+ }
1197
+ if (!isAnyTracingEnabled()) {
1198
+ const spanId2 = getSpanId(blockedSpanContext.span);
1199
+ activeSpans.delete(spanId2);
1200
+ strongSpans.delete(spanId2);
1201
+ return;
1202
+ }
1203
+ const duration = Date.now() - blockedSpanContext.startTime;
1204
+ const attributes = {
1205
+ duration_ms: duration
1206
+ };
1207
+ if (decision) {
1208
+ attributes["decision"] = decision;
1209
+ }
1210
+ if (source) {
1211
+ attributes["source"] = source;
1212
+ }
1213
+ blockedSpanContext.span.setAttributes(attributes);
1214
+ blockedSpanContext.span.end();
1215
+ const spanId = getSpanId(blockedSpanContext.span);
1216
+ activeSpans.delete(spanId);
1217
+ strongSpans.delete(spanId);
1218
+ }
1219
+ function startToolExecutionSpan() {
1220
+ if (!isAnyTracingEnabled()) {
1221
+ return import_api.trace.getActiveSpan() || getTracer().startSpan("dummy");
1222
+ }
1223
+ const tracer = getTracer();
1224
+ const parentSpanCtx = toolContext.getStore();
1225
+ const attributes = createSpanAttributes("tool.execution");
1226
+ const ctx = parentSpanCtx ? import_api.trace.setSpan(import_api.context.active(), parentSpanCtx.span) : import_api.context.active();
1227
+ const span = tracer.startSpan("claude_code.tool.execution", { attributes }, ctx);
1228
+ const spanId = getSpanId(span);
1229
+ const spanContextObj = {
1230
+ span,
1231
+ startTime: Date.now(),
1232
+ attributes
1233
+ };
1234
+ activeSpans.set(spanId, new WeakRef(spanContextObj));
1235
+ strongSpans.set(spanId, spanContextObj);
1236
+ return span;
1237
+ }
1238
+ function endToolExecutionSpan(metadata) {
1239
+ if (!isAnyTracingEnabled()) {
1240
+ return;
1241
+ }
1242
+ const executionSpanContext = Array.from(activeSpans.values()).findLast((r) => r.deref()?.attributes["span.type"] === "tool.execution")?.deref();
1243
+ if (!executionSpanContext) {
1244
+ return;
1245
+ }
1246
+ const duration = Date.now() - executionSpanContext.startTime;
1247
+ const attributes = {
1248
+ duration_ms: duration
1249
+ };
1250
+ if (metadata) {
1251
+ if (metadata.success !== undefined)
1252
+ attributes["success"] = metadata.success;
1253
+ if (metadata.error !== undefined)
1254
+ attributes["error"] = metadata.error;
1255
+ }
1256
+ executionSpanContext.span.setAttributes(attributes);
1257
+ executionSpanContext.span.end();
1258
+ const spanId = getSpanId(executionSpanContext.span);
1259
+ activeSpans.delete(spanId);
1260
+ strongSpans.delete(spanId);
1261
+ }
1262
+ function endToolSpan(toolResult, resultTokens) {
1263
+ const toolSpanContext = toolContext.getStore();
1264
+ if (!toolSpanContext) {
1265
+ return;
1266
+ }
1267
+ if (toolSpanContext.perfettoSpanId) {
1268
+ endToolPerfettoSpan(toolSpanContext.perfettoSpanId, {
1269
+ success: true,
1270
+ resultTokens
1271
+ });
1272
+ }
1273
+ if (!isAnyTracingEnabled()) {
1274
+ const spanId2 = getSpanId(toolSpanContext.span);
1275
+ activeSpans.delete(spanId2);
1276
+ toolContext.enterWith(undefined);
1277
+ return;
1278
+ }
1279
+ const duration = Date.now() - toolSpanContext.startTime;
1280
+ const endAttributes = {
1281
+ duration_ms: duration
1282
+ };
1283
+ if (toolResult) {
1284
+ const toolName = toolSpanContext.attributes["tool_name"] || "unknown";
1285
+ addBetaToolResultAttributes(endAttributes, toolName, toolResult);
1286
+ }
1287
+ if (resultTokens !== undefined) {
1288
+ endAttributes["result_tokens"] = resultTokens;
1289
+ }
1290
+ toolSpanContext.span.setAttributes(endAttributes);
1291
+ toolSpanContext.span.end();
1292
+ const spanId = getSpanId(toolSpanContext.span);
1293
+ activeSpans.delete(spanId);
1294
+ toolContext.enterWith(undefined);
1295
+ }
1296
+ function isToolContentLoggingEnabled() {
1297
+ return isEnvTruthy(process.env.OTEL_LOG_TOOL_CONTENT);
1298
+ }
1299
+ function addToolContentEvent(eventName, attributes) {
1300
+ if (!isAnyTracingEnabled() || !isToolContentLoggingEnabled()) {
1301
+ return;
1302
+ }
1303
+ const currentSpanCtx = toolContext.getStore();
1304
+ if (!currentSpanCtx) {
1305
+ return;
1306
+ }
1307
+ const processedAttributes = {};
1308
+ for (const [key, value] of Object.entries(attributes)) {
1309
+ if (typeof value === "string") {
1310
+ const { content, truncated } = truncateContent(value);
1311
+ processedAttributes[key] = content;
1312
+ if (truncated) {
1313
+ processedAttributes[`${key}_truncated`] = true;
1314
+ processedAttributes[`${key}_original_length`] = value.length;
1315
+ }
1316
+ } else {
1317
+ processedAttributes[key] = value;
1318
+ }
1319
+ }
1320
+ currentSpanCtx.span.addEvent(eventName, processedAttributes);
1321
+ }
1322
+ function startHookSpan(hookEvent, hookName, numHooks, hookDefinitions) {
1323
+ if (!isBetaTracingEnabled()) {
1324
+ return import_api.trace.getActiveSpan() || getTracer().startSpan("dummy");
1325
+ }
1326
+ const tracer = getTracer();
1327
+ const parentSpanCtx = toolContext.getStore() ?? interactionContext.getStore();
1328
+ const attributes = createSpanAttributes("hook", {
1329
+ hook_event: hookEvent,
1330
+ hook_name: hookName,
1331
+ num_hooks: numHooks,
1332
+ hook_definitions: hookDefinitions
1333
+ });
1334
+ const ctx = parentSpanCtx ? import_api.trace.setSpan(import_api.context.active(), parentSpanCtx.span) : import_api.context.active();
1335
+ const span = tracer.startSpan("claude_code.hook", { attributes }, ctx);
1336
+ const spanId = getSpanId(span);
1337
+ const spanContextObj = {
1338
+ span,
1339
+ startTime: Date.now(),
1340
+ attributes
1341
+ };
1342
+ activeSpans.set(spanId, new WeakRef(spanContextObj));
1343
+ strongSpans.set(spanId, spanContextObj);
1344
+ return span;
1345
+ }
1346
+ function endHookSpan(span, metadata) {
1347
+ if (!isBetaTracingEnabled()) {
1348
+ return;
1349
+ }
1350
+ const spanId = getSpanId(span);
1351
+ const spanContext = activeSpans.get(spanId)?.deref();
1352
+ if (!spanContext) {
1353
+ return;
1354
+ }
1355
+ const duration = Date.now() - spanContext.startTime;
1356
+ const endAttributes = {
1357
+ duration_ms: duration
1358
+ };
1359
+ if (metadata) {
1360
+ if (metadata.numSuccess !== undefined)
1361
+ endAttributes["num_success"] = metadata.numSuccess;
1362
+ if (metadata.numBlocking !== undefined)
1363
+ endAttributes["num_blocking"] = metadata.numBlocking;
1364
+ if (metadata.numNonBlockingError !== undefined)
1365
+ endAttributes["num_non_blocking_error"] = metadata.numNonBlockingError;
1366
+ if (metadata.numCancelled !== undefined)
1367
+ endAttributes["num_cancelled"] = metadata.numCancelled;
1368
+ }
1369
+ spanContext.span.setAttributes(endAttributes);
1370
+ spanContext.span.end();
1371
+ activeSpans.delete(spanId);
1372
+ strongSpans.delete(spanId);
1373
+ }
1374
+ var import_api, interactionContext, toolContext, activeSpans, strongSpans, interactionSequence = 0, _cleanupIntervalStarted = false, SPAN_TTL_MS;
1375
+ var init_sessionTracing = __esm(() => {
1376
+ init_growthbook();
1377
+ init_envUtils();
1378
+ init_telemetryAttributes();
1379
+ init_betaSessionTracing();
1380
+ init_perfettoTracing();
1381
+ import_api = __toESM(require_src(), 1);
1382
+ interactionContext = new AsyncLocalStorage;
1383
+ toolContext = new AsyncLocalStorage;
1384
+ activeSpans = new Map;
1385
+ strongSpans = new Map;
1386
+ SPAN_TTL_MS = 30 * 60 * 1000;
1387
+ });
1388
+
1389
+ export { getTelemetryAttributes, init_telemetryAttributes, redactIfDisabled, logOTelEvent, init_events, clearBetaTracingState, isBetaTracingEnabled, init_betaSessionTracing, initializePerfettoTracing, isPerfettoTracingEnabled, registerAgent, unregisterAgent, init_perfettoTracing, isEnhancedTelemetryEnabled, startInteractionSpan, endInteractionSpan, startLLMRequestSpan, endLLMRequestSpan, startToolSpan, startToolBlockedOnUserSpan, endToolBlockedOnUserSpan, startToolExecutionSpan, endToolExecutionSpan, endToolSpan, addToolContentEvent, startHookSpan, endHookSpan, init_sessionTracing };