@sentry/core 10.53.0 → 10.54.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 (1519) hide show
  1. package/browser.d.ts +4 -0
  2. package/build/cjs/api.js +10 -34
  3. package/build/cjs/api.js.map +1 -1
  4. package/build/cjs/asyncContext/index.js +0 -14
  5. package/build/cjs/asyncContext/index.js.map +1 -1
  6. package/build/cjs/asyncContext/stackStrategy.js +16 -47
  7. package/build/cjs/asyncContext/stackStrategy.js.map +1 -1
  8. package/build/cjs/attributes.js +17 -95
  9. package/build/cjs/attributes.js.map +1 -1
  10. package/build/cjs/breadcrumbs.js +2 -22
  11. package/build/cjs/breadcrumbs.js.map +1 -1
  12. package/build/cjs/browser.js +12 -3
  13. package/build/cjs/browser.js.map +1 -1
  14. package/build/cjs/carrier.js +5 -42
  15. package/build/cjs/carrier.js.map +1 -1
  16. package/build/cjs/checkin.js +5 -19
  17. package/build/cjs/checkin.js.map +1 -1
  18. package/build/cjs/client.js +216 -585
  19. package/build/cjs/client.js.map +1 -1
  20. package/build/cjs/constants.js +2 -2
  21. package/build/cjs/currentScopes.js +5 -86
  22. package/build/cjs/currentScopes.js.map +1 -1
  23. package/build/cjs/debug-build.js +0 -5
  24. package/build/cjs/debug-build.js.map +1 -1
  25. package/build/cjs/defaultScopes.js +2 -5
  26. package/build/cjs/defaultScopes.js.map +1 -1
  27. package/build/cjs/envelope.js +32 -103
  28. package/build/cjs/envelope.js.map +1 -1
  29. package/build/cjs/eventProcessors.js +4 -23
  30. package/build/cjs/eventProcessors.js.map +1 -1
  31. package/build/cjs/exports.js +21 -197
  32. package/build/cjs/exports.js.map +1 -1
  33. package/build/cjs/feedback.js +7 -19
  34. package/build/cjs/feedback.js.map +1 -1
  35. package/build/cjs/fetch.js +66 -201
  36. package/build/cjs/fetch.js.map +1 -1
  37. package/build/cjs/index.js +17 -3
  38. package/build/cjs/index.js.map +1 -1
  39. package/build/cjs/instrument/console.js +9 -41
  40. package/build/cjs/instrument/console.js.map +1 -1
  41. package/build/cjs/instrument/fetch.js +47 -156
  42. package/build/cjs/instrument/fetch.js.map +1 -1
  43. package/build/cjs/instrument/globalError.js +4 -25
  44. package/build/cjs/instrument/globalError.js.map +1 -1
  45. package/build/cjs/instrument/globalUnhandledRejection.js +4 -21
  46. package/build/cjs/instrument/globalUnhandledRejection.js.map +1 -1
  47. package/build/cjs/instrument/handlers.js +9 -21
  48. package/build/cjs/instrument/handlers.js.map +1 -1
  49. package/build/cjs/integration.js +13 -77
  50. package/build/cjs/integration.js.map +1 -1
  51. package/build/cjs/integrations/captureconsole.js +16 -40
  52. package/build/cjs/integrations/captureconsole.js.map +1 -1
  53. package/build/cjs/integrations/consola.js +57 -163
  54. package/build/cjs/integrations/consola.js.map +1 -1
  55. package/build/cjs/integrations/console.js +11 -43
  56. package/build/cjs/integrations/console.js.map +1 -1
  57. package/build/cjs/integrations/conversationId.js +5 -22
  58. package/build/cjs/integrations/conversationId.js.map +1 -1
  59. package/build/cjs/integrations/dedupe.js +16 -74
  60. package/build/cjs/integrations/dedupe.js.map +1 -1
  61. package/build/cjs/integrations/eventFilters.js +63 -114
  62. package/build/cjs/integrations/eventFilters.js.map +1 -1
  63. package/build/cjs/integrations/express/index.js +30 -145
  64. package/build/cjs/integrations/express/index.js.map +1 -1
  65. package/build/cjs/integrations/express/patch-layer.js +20 -130
  66. package/build/cjs/integrations/express/patch-layer.js.map +1 -1
  67. package/build/cjs/integrations/express/request-layer-store.js +1 -3
  68. package/build/cjs/integrations/express/request-layer-store.js.map +1 -1
  69. package/build/cjs/integrations/express/set-sdk-processing-metadata.js +0 -2
  70. package/build/cjs/integrations/express/set-sdk-processing-metadata.js.map +1 -1
  71. package/build/cjs/integrations/express/types.js +6 -7
  72. package/build/cjs/integrations/express/types.js.map +1 -1
  73. package/build/cjs/integrations/express/utils.js +37 -145
  74. package/build/cjs/integrations/express/utils.js.map +1 -1
  75. package/build/cjs/integrations/extraerrordata.js +24 -69
  76. package/build/cjs/integrations/extraerrordata.js.map +1 -1
  77. package/build/cjs/integrations/featureFlags/featureFlagsIntegration.js +3 -29
  78. package/build/cjs/integrations/featureFlags/featureFlagsIntegration.js.map +1 -1
  79. package/build/cjs/integrations/featureFlags/growthbook.js +11 -40
  80. package/build/cjs/integrations/featureFlags/growthbook.js.map +1 -1
  81. package/build/cjs/integrations/functiontostring.js +6 -27
  82. package/build/cjs/integrations/functiontostring.js.map +1 -1
  83. package/build/cjs/integrations/http/add-outgoing-request-breadcrumb.js +10 -18
  84. package/build/cjs/integrations/http/add-outgoing-request-breadcrumb.js.map +1 -1
  85. package/build/cjs/integrations/http/client-patch.js +8 -70
  86. package/build/cjs/integrations/http/client-patch.js.map +1 -1
  87. package/build/cjs/integrations/http/client-subscriptions.js +22 -59
  88. package/build/cjs/integrations/http/client-subscriptions.js.map +1 -1
  89. package/build/cjs/integrations/http/constants.js +3 -3
  90. package/build/cjs/integrations/http/double-wrap-warning.js +10 -18
  91. package/build/cjs/integrations/http/double-wrap-warning.js.map +1 -1
  92. package/build/cjs/integrations/http/get-outgoing-span-data.js +30 -47
  93. package/build/cjs/integrations/http/get-outgoing-span-data.js.map +1 -1
  94. package/build/cjs/integrations/http/get-request-url.js +7 -24
  95. package/build/cjs/integrations/http/get-request-url.js.map +1 -1
  96. package/build/cjs/integrations/http/inject-trace-propagation-headers.js +14 -38
  97. package/build/cjs/integrations/http/inject-trace-propagation-headers.js.map +1 -1
  98. package/build/cjs/integrations/http/patch-request-to-capture-body.js +80 -0
  99. package/build/cjs/integrations/http/patch-request-to-capture-body.js.map +1 -0
  100. package/build/cjs/integrations/http/record-request-session.js +61 -0
  101. package/build/cjs/integrations/http/record-request-session.js.map +1 -0
  102. package/build/cjs/integrations/http/server-subscription.js +289 -0
  103. package/build/cjs/integrations/http/server-subscription.js.map +1 -0
  104. package/build/cjs/integrations/linkederrors.js +6 -11
  105. package/build/cjs/integrations/linkederrors.js.map +1 -1
  106. package/build/cjs/integrations/mcp-server/attributeExtraction.js +26 -69
  107. package/build/cjs/integrations/mcp-server/attributeExtraction.js.map +1 -1
  108. package/build/cjs/integrations/mcp-server/attributes.js +30 -138
  109. package/build/cjs/integrations/mcp-server/attributes.js.map +1 -1
  110. package/build/cjs/integrations/mcp-server/correlation.js +20 -91
  111. package/build/cjs/integrations/mcp-server/correlation.js.map +1 -1
  112. package/build/cjs/integrations/mcp-server/errorCapture.js +6 -25
  113. package/build/cjs/integrations/mcp-server/errorCapture.js.map +1 -1
  114. package/build/cjs/integrations/mcp-server/handlers.js +55 -169
  115. package/build/cjs/integrations/mcp-server/handlers.js.map +1 -1
  116. package/build/cjs/integrations/mcp-server/index.js +7 -60
  117. package/build/cjs/integrations/mcp-server/index.js.map +1 -1
  118. package/build/cjs/integrations/mcp-server/methodConfig.js +21 -59
  119. package/build/cjs/integrations/mcp-server/methodConfig.js.map +1 -1
  120. package/build/cjs/integrations/mcp-server/piiFiltering.js +5 -33
  121. package/build/cjs/integrations/mcp-server/piiFiltering.js.map +1 -1
  122. package/build/cjs/integrations/mcp-server/resultExtraction.js +20 -76
  123. package/build/cjs/integrations/mcp-server/resultExtraction.js.map +1 -1
  124. package/build/cjs/integrations/mcp-server/sessionExtraction.js +30 -121
  125. package/build/cjs/integrations/mcp-server/sessionExtraction.js.map +1 -1
  126. package/build/cjs/integrations/mcp-server/sessionManagement.js +2 -60
  127. package/build/cjs/integrations/mcp-server/sessionManagement.js.map +1 -1
  128. package/build/cjs/integrations/mcp-server/spans.js +20 -107
  129. package/build/cjs/integrations/mcp-server/spans.js.map +1 -1
  130. package/build/cjs/integrations/mcp-server/transport.js +26 -94
  131. package/build/cjs/integrations/mcp-server/transport.js.map +1 -1
  132. package/build/cjs/integrations/mcp-server/validation.js +6 -72
  133. package/build/cjs/integrations/mcp-server/validation.js.map +1 -1
  134. package/build/cjs/integrations/moduleMetadata.js +6 -20
  135. package/build/cjs/integrations/moduleMetadata.js.map +1 -1
  136. package/build/cjs/integrations/postgresjs.js +78 -287
  137. package/build/cjs/integrations/postgresjs.js.map +1 -1
  138. package/build/cjs/integrations/requestdata.js +30 -93
  139. package/build/cjs/integrations/requestdata.js.map +1 -1
  140. package/build/cjs/integrations/rewriteframes.js +14 -45
  141. package/build/cjs/integrations/rewriteframes.js.map +1 -1
  142. package/build/cjs/integrations/spanStreaming.js +9 -15
  143. package/build/cjs/integrations/spanStreaming.js.map +1 -1
  144. package/build/cjs/integrations/supabase.js +224 -333
  145. package/build/cjs/integrations/supabase.js.map +1 -1
  146. package/build/cjs/integrations/third-party-errors-filter.js +60 -85
  147. package/build/cjs/integrations/third-party-errors-filter.js.map +1 -1
  148. package/build/cjs/integrations/zoderrors.js +35 -111
  149. package/build/cjs/integrations/zoderrors.js.map +1 -1
  150. package/build/cjs/logs/console-integration.js +15 -50
  151. package/build/cjs/logs/console-integration.js.map +1 -1
  152. package/build/cjs/logs/constants.js +1 -6
  153. package/build/cjs/logs/constants.js.map +1 -1
  154. package/build/cjs/logs/envelope.js +10 -40
  155. package/build/cjs/logs/envelope.js.map +1 -1
  156. package/build/cjs/logs/internal.js +53 -125
  157. package/build/cjs/logs/internal.js.map +1 -1
  158. package/build/cjs/logs/public-api.js +13 -228
  159. package/build/cjs/logs/public-api.js.map +1 -1
  160. package/build/cjs/logs/utils.js +6 -47
  161. package/build/cjs/logs/utils.js.map +1 -1
  162. package/build/cjs/metadata.js +6 -51
  163. package/build/cjs/metadata.js.map +1 -1
  164. package/build/cjs/metrics/envelope.js +12 -45
  165. package/build/cjs/metrics/envelope.js.map +1 -1
  166. package/build/cjs/metrics/internal.js +31 -144
  167. package/build/cjs/metrics/internal.js.map +1 -1
  168. package/build/cjs/metrics/public-api.js +4 -109
  169. package/build/cjs/metrics/public-api.js.map +1 -1
  170. package/build/cjs/profiling.js +11 -41
  171. package/build/cjs/profiling.js.map +1 -1
  172. package/build/cjs/scope.js +73 -224
  173. package/build/cjs/scope.js.map +1 -1
  174. package/build/cjs/sdk.js +2 -21
  175. package/build/cjs/sdk.js.map +1 -1
  176. package/build/cjs/semanticAttributes.js +30 -116
  177. package/build/cjs/semanticAttributes.js.map +1 -1
  178. package/build/cjs/server-runtime-client.js +32 -87
  179. package/build/cjs/server-runtime-client.js.map +1 -1
  180. package/build/cjs/server.js +17 -3
  181. package/build/cjs/server.js.map +1 -1
  182. package/build/cjs/session.js +14 -67
  183. package/build/cjs/session.js.map +1 -1
  184. package/build/cjs/tracing/ai/gen-ai-attributes.js +45 -249
  185. package/build/cjs/tracing/ai/gen-ai-attributes.js.map +1 -1
  186. package/build/cjs/tracing/ai/mediaStripping.js +21 -116
  187. package/build/cjs/tracing/ai/mediaStripping.js.map +1 -1
  188. package/build/cjs/tracing/ai/messageTruncation.js +26 -212
  189. package/build/cjs/tracing/ai/messageTruncation.js.map +1 -1
  190. package/build/cjs/tracing/ai/utils.js +40 -180
  191. package/build/cjs/tracing/ai/utils.js.map +1 -1
  192. package/build/cjs/tracing/anthropic-ai/constants.js +9 -12
  193. package/build/cjs/tracing/anthropic-ai/constants.js.map +1 -1
  194. package/build/cjs/tracing/anthropic-ai/index.js +67 -172
  195. package/build/cjs/tracing/anthropic-ai/index.js.map +1 -1
  196. package/build/cjs/tracing/anthropic-ai/streaming.js +45 -149
  197. package/build/cjs/tracing/anthropic-ai/streaming.js.map +1 -1
  198. package/build/cjs/tracing/anthropic-ai/utils.js +17 -47
  199. package/build/cjs/tracing/anthropic-ai/utils.js.map +1 -1
  200. package/build/cjs/tracing/dynamicSamplingContext.js +18 -85
  201. package/build/cjs/tracing/dynamicSamplingContext.js.map +1 -1
  202. package/build/cjs/tracing/errors.js +2 -14
  203. package/build/cjs/tracing/errors.js.map +1 -1
  204. package/build/cjs/tracing/google-genai/constants.js +9 -16
  205. package/build/cjs/tracing/google-genai/constants.js.map +1 -1
  206. package/build/cjs/tracing/google-genai/index.js +79 -223
  207. package/build/cjs/tracing/google-genai/index.js.map +1 -1
  208. package/build/cjs/tracing/google-genai/streaming.js +11 -56
  209. package/build/cjs/tracing/google-genai/streaming.js.map +1 -1
  210. package/build/cjs/tracing/google-genai/utils.js +8 -13
  211. package/build/cjs/tracing/google-genai/utils.js.map +1 -1
  212. package/build/cjs/tracing/idleSpan.js +48 -174
  213. package/build/cjs/tracing/idleSpan.js.map +1 -1
  214. package/build/cjs/tracing/langchain/constants.js +8 -9
  215. package/build/cjs/tracing/langchain/constants.js.map +1 -1
  216. package/build/cjs/tracing/langchain/embeddings.js +31 -75
  217. package/build/cjs/tracing/langchain/embeddings.js.map +1 -1
  218. package/build/cjs/tracing/langchain/index.js +64 -161
  219. package/build/cjs/tracing/langchain/index.js.map +1 -1
  220. package/build/cjs/tracing/langchain/utils.js +101 -311
  221. package/build/cjs/tracing/langchain/utils.js.map +1 -1
  222. package/build/cjs/tracing/langgraph/constants.js +2 -2
  223. package/build/cjs/tracing/langgraph/index.js +57 -160
  224. package/build/cjs/tracing/langgraph/index.js.map +1 -1
  225. package/build/cjs/tracing/langgraph/utils.js +53 -170
  226. package/build/cjs/tracing/langgraph/utils.js.map +1 -1
  227. package/build/cjs/tracing/logSpans.js +10 -26
  228. package/build/cjs/tracing/logSpans.js.map +1 -1
  229. package/build/cjs/tracing/measurement.js +6 -18
  230. package/build/cjs/tracing/measurement.js.map +1 -1
  231. package/build/cjs/tracing/openai/constants.js +20 -24
  232. package/build/cjs/tracing/openai/constants.js.map +1 -1
  233. package/build/cjs/tracing/openai/index.js +52 -132
  234. package/build/cjs/tracing/openai/index.js.map +1 -1
  235. package/build/cjs/tracing/openai/streaming.js +24 -102
  236. package/build/cjs/tracing/openai/streaming.js.map +1 -1
  237. package/build/cjs/tracing/openai/utils.js +36 -107
  238. package/build/cjs/tracing/openai/utils.js.map +1 -1
  239. package/build/cjs/tracing/sampling.js +23 -63
  240. package/build/cjs/tracing/sampling.js.map +1 -1
  241. package/build/cjs/tracing/sentryNonRecordingSpan.js +15 -40
  242. package/build/cjs/tracing/sentryNonRecordingSpan.js.map +1 -1
  243. package/build/cjs/tracing/sentrySpan.js +66 -172
  244. package/build/cjs/tracing/sentrySpan.js.map +1 -1
  245. package/build/cjs/tracing/spans/beforeSendSpan.js +4 -32
  246. package/build/cjs/tracing/spans/beforeSendSpan.js.map +1 -1
  247. package/build/cjs/tracing/spans/captureSpan.js +63 -165
  248. package/build/cjs/tracing/spans/captureSpan.js.map +1 -1
  249. package/build/cjs/tracing/spans/envelope.js +12 -24
  250. package/build/cjs/tracing/spans/envelope.js.map +1 -1
  251. package/build/cjs/tracing/spans/estimateSize.js +0 -22
  252. package/build/cjs/tracing/spans/estimateSize.js.map +1 -1
  253. package/build/cjs/tracing/spans/extractGenAiSpans.js +11 -33
  254. package/build/cjs/tracing/spans/extractGenAiSpans.js.map +1 -1
  255. package/build/cjs/tracing/spans/hasSpanStreamingEnabled.js +1 -4
  256. package/build/cjs/tracing/spans/hasSpanStreamingEnabled.js.map +1 -1
  257. package/build/cjs/tracing/spans/scopeContextAttributes.js +58 -0
  258. package/build/cjs/tracing/spans/scopeContextAttributes.js.map +1 -0
  259. package/build/cjs/tracing/spans/spanBuffer.js +21 -71
  260. package/build/cjs/tracing/spans/spanBuffer.js.map +1 -1
  261. package/build/cjs/tracing/spans/spanJsonToStreamedSpan.js +4 -8
  262. package/build/cjs/tracing/spans/spanJsonToStreamedSpan.js.map +1 -1
  263. package/build/cjs/tracing/spanstatus.js +15 -32
  264. package/build/cjs/tracing/spanstatus.js.map +1 -1
  265. package/build/cjs/tracing/trace.js +95 -311
  266. package/build/cjs/tracing/trace.js.map +1 -1
  267. package/build/cjs/tracing/utils.js +4 -14
  268. package/build/cjs/tracing/utils.js.map +1 -1
  269. package/build/cjs/tracing/vercel-ai/constants.js +15 -26
  270. package/build/cjs/tracing/vercel-ai/constants.js.map +1 -1
  271. package/build/cjs/tracing/vercel-ai/index.js +84 -288
  272. package/build/cjs/tracing/vercel-ai/index.js.map +1 -1
  273. package/build/cjs/tracing/vercel-ai/utils.js +30 -128
  274. package/build/cjs/tracing/vercel-ai/utils.js.map +1 -1
  275. package/build/cjs/tracing/vercel-ai/vercel-ai-attributes.js +22 -229
  276. package/build/cjs/tracing/vercel-ai/vercel-ai-attributes.js.map +1 -1
  277. package/build/cjs/transports/base.js +32 -67
  278. package/build/cjs/transports/base.js.map +1 -1
  279. package/build/cjs/transports/multiplexed.js +38 -103
  280. package/build/cjs/transports/multiplexed.js.map +1 -1
  281. package/build/cjs/transports/offline.js +31 -72
  282. package/build/cjs/transports/offline.js.map +1 -1
  283. package/build/cjs/transports/userAgent.js +4 -13
  284. package/build/cjs/transports/userAgent.js.map +1 -1
  285. package/build/cjs/trpc.js +19 -39
  286. package/build/cjs/trpc.js.map +1 -1
  287. package/build/cjs/utils/aggregate-errors.js +18 -62
  288. package/build/cjs/utils/aggregate-errors.js.map +1 -1
  289. package/build/cjs/utils/ai/providerSkip.js +3 -50
  290. package/build/cjs/utils/ai/providerSkip.js.map +1 -1
  291. package/build/cjs/utils/anr.js +7 -36
  292. package/build/cjs/utils/anr.js.map +1 -1
  293. package/build/cjs/utils/baggage.js +37 -146
  294. package/build/cjs/utils/baggage.js.map +1 -1
  295. package/build/cjs/utils/breadcrumb-log-level.js +5 -9
  296. package/build/cjs/utils/breadcrumb-log-level.js.map +1 -1
  297. package/build/cjs/utils/browser.js +24 -86
  298. package/build/cjs/utils/browser.js.map +1 -1
  299. package/build/cjs/utils/chain-and-copy-promiselike.js +10 -27
  300. package/build/cjs/utils/chain-and-copy-promiselike.js.map +1 -1
  301. package/build/cjs/utils/clientreport.js +4 -13
  302. package/build/cjs/utils/clientreport.js.map +1 -1
  303. package/build/cjs/utils/cookie.js +6 -53
  304. package/build/cjs/utils/cookie.js.map +1 -1
  305. package/build/cjs/utils/data-collection/defaultPiiToCollectionOptions.js +28 -0
  306. package/build/cjs/utils/data-collection/defaultPiiToCollectionOptions.js.map +1 -0
  307. package/build/cjs/utils/data-collection/filterCookies.js +23 -0
  308. package/build/cjs/utils/data-collection/filterCookies.js.map +1 -0
  309. package/build/cjs/utils/data-collection/filterKeyValueData.js +43 -0
  310. package/build/cjs/utils/data-collection/filterKeyValueData.js.map +1 -0
  311. package/build/cjs/utils/data-collection/filterQueryParams.js +26 -0
  312. package/build/cjs/utils/data-collection/filterQueryParams.js.map +1 -0
  313. package/build/cjs/utils/data-collection/filtering-snippets.js +61 -0
  314. package/build/cjs/utils/data-collection/filtering-snippets.js.map +1 -0
  315. package/build/cjs/utils/data-collection/resolveDataCollectionOptions.js +37 -0
  316. package/build/cjs/utils/data-collection/resolveDataCollectionOptions.js.map +1 -0
  317. package/build/cjs/utils/debounce.js +5 -32
  318. package/build/cjs/utils/debounce.js.map +1 -1
  319. package/build/cjs/utils/debug-ids.js +4 -42
  320. package/build/cjs/utils/debug-ids.js.map +1 -1
  321. package/build/cjs/utils/debug-logger.js +23 -56
  322. package/build/cjs/utils/debug-logger.js.map +1 -1
  323. package/build/cjs/utils/dsn.js +18 -81
  324. package/build/cjs/utils/dsn.js.map +1 -1
  325. package/build/cjs/utils/env.js +3 -27
  326. package/build/cjs/utils/env.js.map +1 -1
  327. package/build/cjs/utils/envToBool.js +2 -15
  328. package/build/cjs/utils/envToBool.js.map +1 -1
  329. package/build/cjs/utils/envelope.js +39 -133
  330. package/build/cjs/utils/envelope.js.map +1 -1
  331. package/build/cjs/utils/error.js +3 -10
  332. package/build/cjs/utils/error.js.map +1 -1
  333. package/build/cjs/utils/eventUtils.js +0 -8
  334. package/build/cjs/utils/eventUtils.js.map +1 -1
  335. package/build/cjs/utils/eventbuilder.js +30 -114
  336. package/build/cjs/utils/eventbuilder.js.map +1 -1
  337. package/build/cjs/utils/exports.js +5 -24
  338. package/build/cjs/utils/exports.js.map +1 -1
  339. package/build/cjs/utils/featureFlags.js +10 -96
  340. package/build/cjs/utils/featureFlags.js.map +1 -1
  341. package/build/cjs/utils/flushIfServerless.js +14 -48
  342. package/build/cjs/utils/flushIfServerless.js.map +1 -1
  343. package/build/cjs/utils/get-default-export.js +1 -25
  344. package/build/cjs/utils/get-default-export.js.map +1 -1
  345. package/build/cjs/utils/handleCallbackErrors.js +10 -48
  346. package/build/cjs/utils/handleCallbackErrors.js.map +1 -1
  347. package/build/cjs/utils/hasSpansEnabled.js +4 -28
  348. package/build/cjs/utils/hasSpansEnabled.js.map +1 -1
  349. package/build/cjs/utils/ipAddress.js +7 -19
  350. package/build/cjs/utils/ipAddress.js.map +1 -1
  351. package/build/cjs/utils/is.js +18 -163
  352. package/build/cjs/utils/is.js.map +1 -1
  353. package/build/cjs/utils/isBrowser.js +3 -9
  354. package/build/cjs/utils/isBrowser.js.map +1 -1
  355. package/build/cjs/utils/isSentryRequestUrl.js +2 -19
  356. package/build/cjs/utils/isSentryRequestUrl.js.map +1 -1
  357. package/build/cjs/utils/lru.js +13 -24
  358. package/build/cjs/utils/lru.js.map +1 -1
  359. package/build/cjs/utils/merge.js +1 -17
  360. package/build/cjs/utils/merge.js.map +1 -1
  361. package/build/cjs/utils/meta.js +1 -24
  362. package/build/cjs/utils/meta.js.map +1 -1
  363. package/build/cjs/utils/misc.js +31 -134
  364. package/build/cjs/utils/misc.js.map +1 -1
  365. package/build/cjs/utils/node-stack-trace.js +22 -61
  366. package/build/cjs/utils/node-stack-trace.js.map +1 -1
  367. package/build/cjs/utils/node.js +3 -48
  368. package/build/cjs/utils/node.js.map +1 -1
  369. package/build/cjs/utils/normalizationHints.js +5 -18
  370. package/build/cjs/utils/normalizationHints.js.map +1 -1
  371. package/build/cjs/utils/normalize.js +39 -205
  372. package/build/cjs/utils/normalize.js.map +1 -1
  373. package/build/cjs/utils/object.js +33 -168
  374. package/build/cjs/utils/object.js.map +1 -1
  375. package/build/cjs/utils/parameterize.js +2 -21
  376. package/build/cjs/utils/parameterize.js.map +1 -1
  377. package/build/cjs/utils/parseSampleRate.js +4 -13
  378. package/build/cjs/utils/parseSampleRate.js.map +1 -1
  379. package/build/cjs/utils/path.js +28 -115
  380. package/build/cjs/utils/path.js.map +1 -1
  381. package/build/cjs/utils/prepareEvent.js +53 -191
  382. package/build/cjs/utils/prepareEvent.js.map +1 -1
  383. package/build/cjs/utils/promisebuffer.js +5 -47
  384. package/build/cjs/utils/promisebuffer.js.map +1 -1
  385. package/build/cjs/utils/propagationContext.js +0 -7
  386. package/build/cjs/utils/propagationContext.js.map +1 -1
  387. package/build/cjs/utils/randomSafeContext.js +3 -22
  388. package/build/cjs/utils/randomSafeContext.js.map +1 -1
  389. package/build/cjs/utils/ratelimit.js +13 -66
  390. package/build/cjs/utils/ratelimit.js.map +1 -1
  391. package/build/cjs/utils/request.js +62 -269
  392. package/build/cjs/utils/request.js.map +1 -1
  393. package/build/cjs/utils/scopeData.js +15 -79
  394. package/build/cjs/utils/scopeData.js.map +1 -1
  395. package/build/cjs/utils/sdkMetadata.js +5 -19
  396. package/build/cjs/utils/sdkMetadata.js.map +1 -1
  397. package/build/cjs/utils/severity.js +1 -9
  398. package/build/cjs/utils/severity.js.map +1 -1
  399. package/build/cjs/utils/should-ignore-span.js +6 -38
  400. package/build/cjs/utils/should-ignore-span.js.map +1 -1
  401. package/build/cjs/utils/spanOnScope.js +3 -14
  402. package/build/cjs/utils/spanOnScope.js.map +1 -1
  403. package/build/cjs/utils/spanUtils.js +42 -222
  404. package/build/cjs/utils/spanUtils.js.map +1 -1
  405. package/build/cjs/utils/stacktrace.js +19 -106
  406. package/build/cjs/utils/stacktrace.js.map +1 -1
  407. package/build/cjs/utils/string.js +7 -75
  408. package/build/cjs/utils/string.js.map +1 -1
  409. package/build/cjs/utils/supports.js +14 -99
  410. package/build/cjs/utils/supports.js.map +1 -1
  411. package/build/cjs/utils/syncpromise.js +19 -68
  412. package/build/cjs/utils/syncpromise.js.map +1 -1
  413. package/build/cjs/utils/time.js +7 -84
  414. package/build/cjs/utils/time.js.map +1 -1
  415. package/build/cjs/utils/timer.js +1 -10
  416. package/build/cjs/utils/timer.js.map +1 -1
  417. package/build/cjs/utils/timestampSequence.js +5 -21
  418. package/build/cjs/utils/timestampSequence.js.map +1 -1
  419. package/build/cjs/utils/trace-info.js +3 -10
  420. package/build/cjs/utils/trace-info.js.map +1 -1
  421. package/build/cjs/utils/traceData.js +4 -39
  422. package/build/cjs/utils/traceData.js.map +1 -1
  423. package/build/cjs/utils/tracePropagationTargets.js +4 -18
  424. package/build/cjs/utils/tracePropagationTargets.js.map +1 -1
  425. package/build/cjs/utils/tracing.js +32 -106
  426. package/build/cjs/utils/tracing.js.map +1 -1
  427. package/build/cjs/utils/transactionEvent.js +11 -19
  428. package/build/cjs/utils/transactionEvent.js.map +1 -1
  429. package/build/cjs/utils/tunnel.js +12 -33
  430. package/build/cjs/utils/tunnel.js.map +1 -1
  431. package/build/cjs/utils/url.js +42 -176
  432. package/build/cjs/utils/url.js.map +1 -1
  433. package/build/cjs/utils/vercelWaitUntil.js +4 -12
  434. package/build/cjs/utils/vercelWaitUntil.js.map +1 -1
  435. package/build/cjs/utils/version.js +1 -3
  436. package/build/cjs/utils/version.js.map +1 -1
  437. package/build/cjs/utils/weakRef.js +5 -36
  438. package/build/cjs/utils/weakRef.js.map +1 -1
  439. package/build/cjs/utils/worldwide.js +1 -4
  440. package/build/cjs/utils/worldwide.js.map +1 -1
  441. package/build/cjs/vendor/escapeStringForRegex.js +1 -32
  442. package/build/cjs/vendor/escapeStringForRegex.js.map +1 -1
  443. package/build/cjs/vendor/getIpAddress.js +19 -99
  444. package/build/cjs/vendor/getIpAddress.js.map +1 -1
  445. package/build/esm/api.js +10 -34
  446. package/build/esm/api.js.map +1 -1
  447. package/build/esm/asyncContext/index.js +0 -14
  448. package/build/esm/asyncContext/index.js.map +1 -1
  449. package/build/esm/asyncContext/stackStrategy.js +16 -47
  450. package/build/esm/asyncContext/stackStrategy.js.map +1 -1
  451. package/build/esm/attributes.js +17 -95
  452. package/build/esm/attributes.js.map +1 -1
  453. package/build/esm/breadcrumbs.js +2 -22
  454. package/build/esm/breadcrumbs.js.map +1 -1
  455. package/build/esm/browser.js +5 -1
  456. package/build/esm/browser.js.map +1 -1
  457. package/build/esm/carrier.js +5 -42
  458. package/build/esm/carrier.js.map +1 -1
  459. package/build/esm/checkin.js +5 -19
  460. package/build/esm/checkin.js.map +1 -1
  461. package/build/esm/client.js +216 -585
  462. package/build/esm/client.js.map +1 -1
  463. package/build/esm/constants.js +2 -2
  464. package/build/esm/currentScopes.js +5 -86
  465. package/build/esm/currentScopes.js.map +1 -1
  466. package/build/esm/debug-build.js +0 -5
  467. package/build/esm/debug-build.js.map +1 -1
  468. package/build/esm/defaultScopes.js +2 -5
  469. package/build/esm/defaultScopes.js.map +1 -1
  470. package/build/esm/envelope.js +32 -103
  471. package/build/esm/envelope.js.map +1 -1
  472. package/build/esm/eventProcessors.js +4 -23
  473. package/build/esm/eventProcessors.js.map +1 -1
  474. package/build/esm/exports.js +21 -197
  475. package/build/esm/exports.js.map +1 -1
  476. package/build/esm/feedback.js +7 -19
  477. package/build/esm/feedback.js.map +1 -1
  478. package/build/esm/fetch.js +66 -201
  479. package/build/esm/fetch.js.map +1 -1
  480. package/build/esm/index.js +7 -1
  481. package/build/esm/index.js.map +1 -1
  482. package/build/esm/instrument/console.js +9 -41
  483. package/build/esm/instrument/console.js.map +1 -1
  484. package/build/esm/instrument/fetch.js +47 -156
  485. package/build/esm/instrument/fetch.js.map +1 -1
  486. package/build/esm/instrument/globalError.js +4 -25
  487. package/build/esm/instrument/globalError.js.map +1 -1
  488. package/build/esm/instrument/globalUnhandledRejection.js +4 -21
  489. package/build/esm/instrument/globalUnhandledRejection.js.map +1 -1
  490. package/build/esm/instrument/handlers.js +9 -21
  491. package/build/esm/instrument/handlers.js.map +1 -1
  492. package/build/esm/integration.js +13 -77
  493. package/build/esm/integration.js.map +1 -1
  494. package/build/esm/integrations/captureconsole.js +16 -40
  495. package/build/esm/integrations/captureconsole.js.map +1 -1
  496. package/build/esm/integrations/consola.js +57 -163
  497. package/build/esm/integrations/consola.js.map +1 -1
  498. package/build/esm/integrations/console.js +11 -43
  499. package/build/esm/integrations/console.js.map +1 -1
  500. package/build/esm/integrations/conversationId.js +5 -22
  501. package/build/esm/integrations/conversationId.js.map +1 -1
  502. package/build/esm/integrations/dedupe.js +16 -74
  503. package/build/esm/integrations/dedupe.js.map +1 -1
  504. package/build/esm/integrations/eventFilters.js +63 -114
  505. package/build/esm/integrations/eventFilters.js.map +1 -1
  506. package/build/esm/integrations/express/index.js +30 -145
  507. package/build/esm/integrations/express/index.js.map +1 -1
  508. package/build/esm/integrations/express/patch-layer.js +20 -130
  509. package/build/esm/integrations/express/patch-layer.js.map +1 -1
  510. package/build/esm/integrations/express/request-layer-store.js +1 -3
  511. package/build/esm/integrations/express/request-layer-store.js.map +1 -1
  512. package/build/esm/integrations/express/set-sdk-processing-metadata.js +0 -2
  513. package/build/esm/integrations/express/set-sdk-processing-metadata.js.map +1 -1
  514. package/build/esm/integrations/express/types.js +6 -7
  515. package/build/esm/integrations/express/types.js.map +1 -1
  516. package/build/esm/integrations/express/utils.js +37 -145
  517. package/build/esm/integrations/express/utils.js.map +1 -1
  518. package/build/esm/integrations/extraerrordata.js +24 -69
  519. package/build/esm/integrations/extraerrordata.js.map +1 -1
  520. package/build/esm/integrations/featureFlags/featureFlagsIntegration.js +3 -29
  521. package/build/esm/integrations/featureFlags/featureFlagsIntegration.js.map +1 -1
  522. package/build/esm/integrations/featureFlags/growthbook.js +11 -40
  523. package/build/esm/integrations/featureFlags/growthbook.js.map +1 -1
  524. package/build/esm/integrations/functiontostring.js +6 -27
  525. package/build/esm/integrations/functiontostring.js.map +1 -1
  526. package/build/esm/integrations/http/add-outgoing-request-breadcrumb.js +10 -18
  527. package/build/esm/integrations/http/add-outgoing-request-breadcrumb.js.map +1 -1
  528. package/build/esm/integrations/http/client-patch.js +8 -70
  529. package/build/esm/integrations/http/client-patch.js.map +1 -1
  530. package/build/esm/integrations/http/client-subscriptions.js +22 -59
  531. package/build/esm/integrations/http/client-subscriptions.js.map +1 -1
  532. package/build/esm/integrations/http/constants.js +3 -3
  533. package/build/esm/integrations/http/double-wrap-warning.js +10 -18
  534. package/build/esm/integrations/http/double-wrap-warning.js.map +1 -1
  535. package/build/esm/integrations/http/get-outgoing-span-data.js +30 -47
  536. package/build/esm/integrations/http/get-outgoing-span-data.js.map +1 -1
  537. package/build/esm/integrations/http/get-request-url.js +7 -24
  538. package/build/esm/integrations/http/get-request-url.js.map +1 -1
  539. package/build/esm/integrations/http/inject-trace-propagation-headers.js +14 -38
  540. package/build/esm/integrations/http/inject-trace-propagation-headers.js.map +1 -1
  541. package/build/esm/integrations/http/patch-request-to-capture-body.js +78 -0
  542. package/build/esm/integrations/http/patch-request-to-capture-body.js.map +1 -0
  543. package/build/esm/integrations/http/record-request-session.js +59 -0
  544. package/build/esm/integrations/http/record-request-session.js.map +1 -0
  545. package/build/esm/integrations/http/server-subscription.js +285 -0
  546. package/build/esm/integrations/http/server-subscription.js.map +1 -0
  547. package/build/esm/integrations/linkederrors.js +6 -11
  548. package/build/esm/integrations/linkederrors.js.map +1 -1
  549. package/build/esm/integrations/mcp-server/attributeExtraction.js +26 -69
  550. package/build/esm/integrations/mcp-server/attributeExtraction.js.map +1 -1
  551. package/build/esm/integrations/mcp-server/attributes.js +30 -138
  552. package/build/esm/integrations/mcp-server/attributes.js.map +1 -1
  553. package/build/esm/integrations/mcp-server/correlation.js +20 -91
  554. package/build/esm/integrations/mcp-server/correlation.js.map +1 -1
  555. package/build/esm/integrations/mcp-server/errorCapture.js +6 -25
  556. package/build/esm/integrations/mcp-server/errorCapture.js.map +1 -1
  557. package/build/esm/integrations/mcp-server/handlers.js +55 -169
  558. package/build/esm/integrations/mcp-server/handlers.js.map +1 -1
  559. package/build/esm/integrations/mcp-server/index.js +7 -60
  560. package/build/esm/integrations/mcp-server/index.js.map +1 -1
  561. package/build/esm/integrations/mcp-server/methodConfig.js +21 -59
  562. package/build/esm/integrations/mcp-server/methodConfig.js.map +1 -1
  563. package/build/esm/integrations/mcp-server/piiFiltering.js +5 -33
  564. package/build/esm/integrations/mcp-server/piiFiltering.js.map +1 -1
  565. package/build/esm/integrations/mcp-server/resultExtraction.js +20 -76
  566. package/build/esm/integrations/mcp-server/resultExtraction.js.map +1 -1
  567. package/build/esm/integrations/mcp-server/sessionExtraction.js +30 -121
  568. package/build/esm/integrations/mcp-server/sessionExtraction.js.map +1 -1
  569. package/build/esm/integrations/mcp-server/sessionManagement.js +2 -60
  570. package/build/esm/integrations/mcp-server/sessionManagement.js.map +1 -1
  571. package/build/esm/integrations/mcp-server/spans.js +20 -107
  572. package/build/esm/integrations/mcp-server/spans.js.map +1 -1
  573. package/build/esm/integrations/mcp-server/transport.js +26 -94
  574. package/build/esm/integrations/mcp-server/transport.js.map +1 -1
  575. package/build/esm/integrations/mcp-server/validation.js +6 -72
  576. package/build/esm/integrations/mcp-server/validation.js.map +1 -1
  577. package/build/esm/integrations/moduleMetadata.js +6 -20
  578. package/build/esm/integrations/moduleMetadata.js.map +1 -1
  579. package/build/esm/integrations/postgresjs.js +78 -287
  580. package/build/esm/integrations/postgresjs.js.map +1 -1
  581. package/build/esm/integrations/requestdata.js +30 -93
  582. package/build/esm/integrations/requestdata.js.map +1 -1
  583. package/build/esm/integrations/rewriteframes.js +14 -45
  584. package/build/esm/integrations/rewriteframes.js.map +1 -1
  585. package/build/esm/integrations/spanStreaming.js +9 -15
  586. package/build/esm/integrations/spanStreaming.js.map +1 -1
  587. package/build/esm/integrations/supabase.js +224 -333
  588. package/build/esm/integrations/supabase.js.map +1 -1
  589. package/build/esm/integrations/third-party-errors-filter.js +60 -85
  590. package/build/esm/integrations/third-party-errors-filter.js.map +1 -1
  591. package/build/esm/integrations/zoderrors.js +35 -111
  592. package/build/esm/integrations/zoderrors.js.map +1 -1
  593. package/build/esm/logs/console-integration.js +15 -50
  594. package/build/esm/logs/console-integration.js.map +1 -1
  595. package/build/esm/logs/constants.js +1 -6
  596. package/build/esm/logs/constants.js.map +1 -1
  597. package/build/esm/logs/envelope.js +10 -40
  598. package/build/esm/logs/envelope.js.map +1 -1
  599. package/build/esm/logs/internal.js +53 -126
  600. package/build/esm/logs/internal.js.map +1 -1
  601. package/build/esm/logs/public-api.js +13 -228
  602. package/build/esm/logs/public-api.js.map +1 -1
  603. package/build/esm/logs/utils.js +6 -47
  604. package/build/esm/logs/utils.js.map +1 -1
  605. package/build/esm/metadata.js +6 -51
  606. package/build/esm/metadata.js.map +1 -1
  607. package/build/esm/metrics/envelope.js +12 -45
  608. package/build/esm/metrics/envelope.js.map +1 -1
  609. package/build/esm/metrics/internal.js +31 -144
  610. package/build/esm/metrics/internal.js.map +1 -1
  611. package/build/esm/metrics/public-api.js +4 -109
  612. package/build/esm/metrics/public-api.js.map +1 -1
  613. package/build/esm/package.json +1 -1
  614. package/build/esm/profiling.js +11 -41
  615. package/build/esm/profiling.js.map +1 -1
  616. package/build/esm/scope.js +73 -224
  617. package/build/esm/scope.js.map +1 -1
  618. package/build/esm/sdk.js +2 -21
  619. package/build/esm/sdk.js.map +1 -1
  620. package/build/esm/semanticAttributes.js +31 -118
  621. package/build/esm/semanticAttributes.js.map +1 -1
  622. package/build/esm/server-runtime-client.js +32 -87
  623. package/build/esm/server-runtime-client.js.map +1 -1
  624. package/build/esm/server.js +7 -1
  625. package/build/esm/server.js.map +1 -1
  626. package/build/esm/session.js +14 -67
  627. package/build/esm/session.js.map +1 -1
  628. package/build/esm/tracing/ai/gen-ai-attributes.js +45 -249
  629. package/build/esm/tracing/ai/gen-ai-attributes.js.map +1 -1
  630. package/build/esm/tracing/ai/mediaStripping.js +21 -116
  631. package/build/esm/tracing/ai/mediaStripping.js.map +1 -1
  632. package/build/esm/tracing/ai/messageTruncation.js +26 -212
  633. package/build/esm/tracing/ai/messageTruncation.js.map +1 -1
  634. package/build/esm/tracing/ai/utils.js +40 -180
  635. package/build/esm/tracing/ai/utils.js.map +1 -1
  636. package/build/esm/tracing/anthropic-ai/constants.js +9 -12
  637. package/build/esm/tracing/anthropic-ai/constants.js.map +1 -1
  638. package/build/esm/tracing/anthropic-ai/index.js +67 -172
  639. package/build/esm/tracing/anthropic-ai/index.js.map +1 -1
  640. package/build/esm/tracing/anthropic-ai/streaming.js +45 -149
  641. package/build/esm/tracing/anthropic-ai/streaming.js.map +1 -1
  642. package/build/esm/tracing/anthropic-ai/utils.js +17 -47
  643. package/build/esm/tracing/anthropic-ai/utils.js.map +1 -1
  644. package/build/esm/tracing/dynamicSamplingContext.js +18 -85
  645. package/build/esm/tracing/dynamicSamplingContext.js.map +1 -1
  646. package/build/esm/tracing/errors.js +2 -14
  647. package/build/esm/tracing/errors.js.map +1 -1
  648. package/build/esm/tracing/google-genai/constants.js +9 -16
  649. package/build/esm/tracing/google-genai/constants.js.map +1 -1
  650. package/build/esm/tracing/google-genai/index.js +79 -223
  651. package/build/esm/tracing/google-genai/index.js.map +1 -1
  652. package/build/esm/tracing/google-genai/streaming.js +11 -56
  653. package/build/esm/tracing/google-genai/streaming.js.map +1 -1
  654. package/build/esm/tracing/google-genai/utils.js +8 -13
  655. package/build/esm/tracing/google-genai/utils.js.map +1 -1
  656. package/build/esm/tracing/idleSpan.js +48 -174
  657. package/build/esm/tracing/idleSpan.js.map +1 -1
  658. package/build/esm/tracing/langchain/constants.js +8 -9
  659. package/build/esm/tracing/langchain/constants.js.map +1 -1
  660. package/build/esm/tracing/langchain/embeddings.js +31 -75
  661. package/build/esm/tracing/langchain/embeddings.js.map +1 -1
  662. package/build/esm/tracing/langchain/index.js +64 -161
  663. package/build/esm/tracing/langchain/index.js.map +1 -1
  664. package/build/esm/tracing/langchain/utils.js +101 -312
  665. package/build/esm/tracing/langchain/utils.js.map +1 -1
  666. package/build/esm/tracing/langgraph/constants.js +2 -2
  667. package/build/esm/tracing/langgraph/index.js +59 -162
  668. package/build/esm/tracing/langgraph/index.js.map +1 -1
  669. package/build/esm/tracing/langgraph/utils.js +54 -170
  670. package/build/esm/tracing/langgraph/utils.js.map +1 -1
  671. package/build/esm/tracing/logSpans.js +10 -26
  672. package/build/esm/tracing/logSpans.js.map +1 -1
  673. package/build/esm/tracing/measurement.js +6 -18
  674. package/build/esm/tracing/measurement.js.map +1 -1
  675. package/build/esm/tracing/openai/constants.js +20 -24
  676. package/build/esm/tracing/openai/constants.js.map +1 -1
  677. package/build/esm/tracing/openai/index.js +52 -132
  678. package/build/esm/tracing/openai/index.js.map +1 -1
  679. package/build/esm/tracing/openai/streaming.js +24 -102
  680. package/build/esm/tracing/openai/streaming.js.map +1 -1
  681. package/build/esm/tracing/openai/utils.js +36 -107
  682. package/build/esm/tracing/openai/utils.js.map +1 -1
  683. package/build/esm/tracing/sampling.js +23 -63
  684. package/build/esm/tracing/sampling.js.map +1 -1
  685. package/build/esm/tracing/sentryNonRecordingSpan.js +15 -40
  686. package/build/esm/tracing/sentryNonRecordingSpan.js.map +1 -1
  687. package/build/esm/tracing/sentrySpan.js +66 -172
  688. package/build/esm/tracing/sentrySpan.js.map +1 -1
  689. package/build/esm/tracing/spans/beforeSendSpan.js +4 -32
  690. package/build/esm/tracing/spans/beforeSendSpan.js.map +1 -1
  691. package/build/esm/tracing/spans/captureSpan.js +64 -166
  692. package/build/esm/tracing/spans/captureSpan.js.map +1 -1
  693. package/build/esm/tracing/spans/envelope.js +12 -24
  694. package/build/esm/tracing/spans/envelope.js.map +1 -1
  695. package/build/esm/tracing/spans/estimateSize.js +0 -22
  696. package/build/esm/tracing/spans/estimateSize.js.map +1 -1
  697. package/build/esm/tracing/spans/extractGenAiSpans.js +11 -33
  698. package/build/esm/tracing/spans/extractGenAiSpans.js.map +1 -1
  699. package/build/esm/tracing/spans/hasSpanStreamingEnabled.js +1 -4
  700. package/build/esm/tracing/spans/hasSpanStreamingEnabled.js.map +1 -1
  701. package/build/esm/tracing/spans/scopeContextAttributes.js +56 -0
  702. package/build/esm/tracing/spans/scopeContextAttributes.js.map +1 -0
  703. package/build/esm/tracing/spans/spanBuffer.js +21 -71
  704. package/build/esm/tracing/spans/spanBuffer.js.map +1 -1
  705. package/build/esm/tracing/spans/spanJsonToStreamedSpan.js +4 -8
  706. package/build/esm/tracing/spans/spanJsonToStreamedSpan.js.map +1 -1
  707. package/build/esm/tracing/spanstatus.js +15 -32
  708. package/build/esm/tracing/spanstatus.js.map +1 -1
  709. package/build/esm/tracing/trace.js +95 -311
  710. package/build/esm/tracing/trace.js.map +1 -1
  711. package/build/esm/tracing/utils.js +4 -14
  712. package/build/esm/tracing/utils.js.map +1 -1
  713. package/build/esm/tracing/vercel-ai/constants.js +15 -26
  714. package/build/esm/tracing/vercel-ai/constants.js.map +1 -1
  715. package/build/esm/tracing/vercel-ai/index.js +84 -288
  716. package/build/esm/tracing/vercel-ai/index.js.map +1 -1
  717. package/build/esm/tracing/vercel-ai/utils.js +30 -128
  718. package/build/esm/tracing/vercel-ai/utils.js.map +1 -1
  719. package/build/esm/tracing/vercel-ai/vercel-ai-attributes.js +22 -229
  720. package/build/esm/tracing/vercel-ai/vercel-ai-attributes.js.map +1 -1
  721. package/build/esm/transports/base.js +32 -67
  722. package/build/esm/transports/base.js.map +1 -1
  723. package/build/esm/transports/multiplexed.js +38 -103
  724. package/build/esm/transports/multiplexed.js.map +1 -1
  725. package/build/esm/transports/offline.js +31 -72
  726. package/build/esm/transports/offline.js.map +1 -1
  727. package/build/esm/transports/userAgent.js +4 -13
  728. package/build/esm/transports/userAgent.js.map +1 -1
  729. package/build/esm/trpc.js +19 -39
  730. package/build/esm/trpc.js.map +1 -1
  731. package/build/esm/utils/aggregate-errors.js +18 -62
  732. package/build/esm/utils/aggregate-errors.js.map +1 -1
  733. package/build/esm/utils/ai/providerSkip.js +3 -50
  734. package/build/esm/utils/ai/providerSkip.js.map +1 -1
  735. package/build/esm/utils/anr.js +7 -36
  736. package/build/esm/utils/anr.js.map +1 -1
  737. package/build/esm/utils/baggage.js +37 -146
  738. package/build/esm/utils/baggage.js.map +1 -1
  739. package/build/esm/utils/breadcrumb-log-level.js +5 -9
  740. package/build/esm/utils/breadcrumb-log-level.js.map +1 -1
  741. package/build/esm/utils/browser.js +24 -86
  742. package/build/esm/utils/browser.js.map +1 -1
  743. package/build/esm/utils/chain-and-copy-promiselike.js +10 -27
  744. package/build/esm/utils/chain-and-copy-promiselike.js.map +1 -1
  745. package/build/esm/utils/clientreport.js +4 -13
  746. package/build/esm/utils/clientreport.js.map +1 -1
  747. package/build/esm/utils/cookie.js +6 -53
  748. package/build/esm/utils/cookie.js.map +1 -1
  749. package/build/esm/utils/data-collection/defaultPiiToCollectionOptions.js +26 -0
  750. package/build/esm/utils/data-collection/defaultPiiToCollectionOptions.js.map +1 -0
  751. package/build/esm/utils/data-collection/filterCookies.js +21 -0
  752. package/build/esm/utils/data-collection/filterCookies.js.map +1 -0
  753. package/build/esm/utils/data-collection/filterKeyValueData.js +41 -0
  754. package/build/esm/utils/data-collection/filterKeyValueData.js.map +1 -0
  755. package/build/esm/utils/data-collection/filterQueryParams.js +24 -0
  756. package/build/esm/utils/data-collection/filterQueryParams.js.map +1 -0
  757. package/build/esm/utils/data-collection/filtering-snippets.js +56 -0
  758. package/build/esm/utils/data-collection/filtering-snippets.js.map +1 -0
  759. package/build/esm/utils/data-collection/resolveDataCollectionOptions.js +35 -0
  760. package/build/esm/utils/data-collection/resolveDataCollectionOptions.js.map +1 -0
  761. package/build/esm/utils/debounce.js +5 -32
  762. package/build/esm/utils/debounce.js.map +1 -1
  763. package/build/esm/utils/debug-ids.js +4 -42
  764. package/build/esm/utils/debug-ids.js.map +1 -1
  765. package/build/esm/utils/debug-logger.js +23 -56
  766. package/build/esm/utils/debug-logger.js.map +1 -1
  767. package/build/esm/utils/dsn.js +18 -81
  768. package/build/esm/utils/dsn.js.map +1 -1
  769. package/build/esm/utils/env.js +3 -27
  770. package/build/esm/utils/env.js.map +1 -1
  771. package/build/esm/utils/envToBool.js +2 -15
  772. package/build/esm/utils/envToBool.js.map +1 -1
  773. package/build/esm/utils/envelope.js +39 -133
  774. package/build/esm/utils/envelope.js.map +1 -1
  775. package/build/esm/utils/error.js +3 -10
  776. package/build/esm/utils/error.js.map +1 -1
  777. package/build/esm/utils/eventUtils.js +0 -8
  778. package/build/esm/utils/eventUtils.js.map +1 -1
  779. package/build/esm/utils/eventbuilder.js +30 -114
  780. package/build/esm/utils/eventbuilder.js.map +1 -1
  781. package/build/esm/utils/exports.js +5 -24
  782. package/build/esm/utils/exports.js.map +1 -1
  783. package/build/esm/utils/featureFlags.js +10 -96
  784. package/build/esm/utils/featureFlags.js.map +1 -1
  785. package/build/esm/utils/flushIfServerless.js +14 -48
  786. package/build/esm/utils/flushIfServerless.js.map +1 -1
  787. package/build/esm/utils/get-default-export.js +1 -25
  788. package/build/esm/utils/get-default-export.js.map +1 -1
  789. package/build/esm/utils/handleCallbackErrors.js +10 -48
  790. package/build/esm/utils/handleCallbackErrors.js.map +1 -1
  791. package/build/esm/utils/hasSpansEnabled.js +4 -28
  792. package/build/esm/utils/hasSpansEnabled.js.map +1 -1
  793. package/build/esm/utils/ipAddress.js +7 -19
  794. package/build/esm/utils/ipAddress.js.map +1 -1
  795. package/build/esm/utils/is.js +18 -163
  796. package/build/esm/utils/is.js.map +1 -1
  797. package/build/esm/utils/isBrowser.js +3 -9
  798. package/build/esm/utils/isBrowser.js.map +1 -1
  799. package/build/esm/utils/isSentryRequestUrl.js +2 -19
  800. package/build/esm/utils/isSentryRequestUrl.js.map +1 -1
  801. package/build/esm/utils/lru.js +13 -24
  802. package/build/esm/utils/lru.js.map +1 -1
  803. package/build/esm/utils/merge.js +1 -17
  804. package/build/esm/utils/merge.js.map +1 -1
  805. package/build/esm/utils/meta.js +1 -24
  806. package/build/esm/utils/meta.js.map +1 -1
  807. package/build/esm/utils/misc.js +31 -134
  808. package/build/esm/utils/misc.js.map +1 -1
  809. package/build/esm/utils/node-stack-trace.js +22 -61
  810. package/build/esm/utils/node-stack-trace.js.map +1 -1
  811. package/build/esm/utils/node.js +3 -48
  812. package/build/esm/utils/node.js.map +1 -1
  813. package/build/esm/utils/normalizationHints.js +5 -18
  814. package/build/esm/utils/normalizationHints.js.map +1 -1
  815. package/build/esm/utils/normalize.js +39 -205
  816. package/build/esm/utils/normalize.js.map +1 -1
  817. package/build/esm/utils/object.js +33 -168
  818. package/build/esm/utils/object.js.map +1 -1
  819. package/build/esm/utils/parameterize.js +2 -21
  820. package/build/esm/utils/parameterize.js.map +1 -1
  821. package/build/esm/utils/parseSampleRate.js +4 -13
  822. package/build/esm/utils/parseSampleRate.js.map +1 -1
  823. package/build/esm/utils/path.js +28 -115
  824. package/build/esm/utils/path.js.map +1 -1
  825. package/build/esm/utils/prepareEvent.js +53 -191
  826. package/build/esm/utils/prepareEvent.js.map +1 -1
  827. package/build/esm/utils/promisebuffer.js +5 -47
  828. package/build/esm/utils/promisebuffer.js.map +1 -1
  829. package/build/esm/utils/propagationContext.js +0 -7
  830. package/build/esm/utils/propagationContext.js.map +1 -1
  831. package/build/esm/utils/randomSafeContext.js +3 -22
  832. package/build/esm/utils/randomSafeContext.js.map +1 -1
  833. package/build/esm/utils/ratelimit.js +13 -66
  834. package/build/esm/utils/ratelimit.js.map +1 -1
  835. package/build/esm/utils/request.js +62 -269
  836. package/build/esm/utils/request.js.map +1 -1
  837. package/build/esm/utils/scopeData.js +15 -79
  838. package/build/esm/utils/scopeData.js.map +1 -1
  839. package/build/esm/utils/sdkMetadata.js +5 -19
  840. package/build/esm/utils/sdkMetadata.js.map +1 -1
  841. package/build/esm/utils/severity.js +1 -9
  842. package/build/esm/utils/severity.js.map +1 -1
  843. package/build/esm/utils/should-ignore-span.js +6 -38
  844. package/build/esm/utils/should-ignore-span.js.map +1 -1
  845. package/build/esm/utils/spanOnScope.js +3 -14
  846. package/build/esm/utils/spanOnScope.js.map +1 -1
  847. package/build/esm/utils/spanUtils.js +42 -222
  848. package/build/esm/utils/spanUtils.js.map +1 -1
  849. package/build/esm/utils/stacktrace.js +19 -106
  850. package/build/esm/utils/stacktrace.js.map +1 -1
  851. package/build/esm/utils/string.js +7 -75
  852. package/build/esm/utils/string.js.map +1 -1
  853. package/build/esm/utils/supports.js +14 -99
  854. package/build/esm/utils/supports.js.map +1 -1
  855. package/build/esm/utils/syncpromise.js +19 -68
  856. package/build/esm/utils/syncpromise.js.map +1 -1
  857. package/build/esm/utils/time.js +7 -84
  858. package/build/esm/utils/time.js.map +1 -1
  859. package/build/esm/utils/timer.js +1 -10
  860. package/build/esm/utils/timer.js.map +1 -1
  861. package/build/esm/utils/timestampSequence.js +5 -21
  862. package/build/esm/utils/timestampSequence.js.map +1 -1
  863. package/build/esm/utils/trace-info.js +3 -10
  864. package/build/esm/utils/trace-info.js.map +1 -1
  865. package/build/esm/utils/traceData.js +4 -39
  866. package/build/esm/utils/traceData.js.map +1 -1
  867. package/build/esm/utils/tracePropagationTargets.js +4 -18
  868. package/build/esm/utils/tracePropagationTargets.js.map +1 -1
  869. package/build/esm/utils/tracing.js +32 -106
  870. package/build/esm/utils/tracing.js.map +1 -1
  871. package/build/esm/utils/transactionEvent.js +11 -19
  872. package/build/esm/utils/transactionEvent.js.map +1 -1
  873. package/build/esm/utils/tunnel.js +12 -33
  874. package/build/esm/utils/tunnel.js.map +1 -1
  875. package/build/esm/utils/url.js +42 -176
  876. package/build/esm/utils/url.js.map +1 -1
  877. package/build/esm/utils/vercelWaitUntil.js +4 -12
  878. package/build/esm/utils/vercelWaitUntil.js.map +1 -1
  879. package/build/esm/utils/version.js +1 -3
  880. package/build/esm/utils/version.js.map +1 -1
  881. package/build/esm/utils/weakRef.js +5 -36
  882. package/build/esm/utils/weakRef.js.map +1 -1
  883. package/build/esm/utils/worldwide.js +1 -4
  884. package/build/esm/utils/worldwide.js.map +1 -1
  885. package/build/esm/vendor/escapeStringForRegex.js +1 -32
  886. package/build/esm/vendor/escapeStringForRegex.js.map +1 -1
  887. package/build/esm/vendor/getIpAddress.js +19 -99
  888. package/build/esm/vendor/getIpAddress.js.map +1 -1
  889. package/build/types/api.d.ts +2 -2
  890. package/build/types/api.d.ts.map +1 -1
  891. package/build/types/attributes.d.ts +5 -8
  892. package/build/types/attributes.d.ts.map +1 -1
  893. package/build/types/breadcrumbs.d.ts +1 -1
  894. package/build/types/breadcrumbs.d.ts.map +1 -1
  895. package/build/types/browser-exports.d.ts +3 -3
  896. package/build/types/browser-exports.d.ts.map +1 -1
  897. package/build/types/carrier.d.ts +2 -2
  898. package/build/types/carrier.d.ts.map +1 -1
  899. package/build/types/checkin.d.ts +4 -4
  900. package/build/types/checkin.d.ts.map +1 -1
  901. package/build/types/client.d.ts +32 -22
  902. package/build/types/client.d.ts.map +1 -1
  903. package/build/types/currentScopes.d.ts +1 -1
  904. package/build/types/currentScopes.d.ts.map +1 -1
  905. package/build/types/envelope.d.ts +7 -7
  906. package/build/types/envelope.d.ts.map +1 -1
  907. package/build/types/eventProcessors.d.ts +2 -2
  908. package/build/types/eventProcessors.d.ts.map +1 -1
  909. package/build/types/exports.d.ts +8 -8
  910. package/build/types/exports.d.ts.map +1 -1
  911. package/build/types/feedback.d.ts +2 -2
  912. package/build/types/feedback.d.ts.map +1 -1
  913. package/build/types/fetch.d.ts +3 -3
  914. package/build/types/fetch.d.ts.map +1 -1
  915. package/build/types/instrument/console.d.ts +1 -1
  916. package/build/types/instrument/console.d.ts.map +1 -1
  917. package/build/types/instrument/fetch.d.ts +1 -1
  918. package/build/types/instrument/fetch.d.ts.map +1 -1
  919. package/build/types/instrument/globalError.d.ts +1 -1
  920. package/build/types/instrument/globalError.d.ts.map +1 -1
  921. package/build/types/instrument/globalUnhandledRejection.d.ts +1 -1
  922. package/build/types/instrument/globalUnhandledRejection.d.ts.map +1 -1
  923. package/build/types/integration.d.ts +2 -2
  924. package/build/types/integration.d.ts.map +1 -1
  925. package/build/types/integrations/consola.d.ts +1 -1
  926. package/build/types/integrations/consola.d.ts.map +1 -1
  927. package/build/types/integrations/console.d.ts +1 -1
  928. package/build/types/integrations/console.d.ts.map +1 -1
  929. package/build/types/integrations/dedupe.d.ts +1 -1
  930. package/build/types/integrations/dedupe.d.ts.map +1 -1
  931. package/build/types/integrations/express/types.d.ts +2 -2
  932. package/build/types/integrations/express/types.d.ts.map +1 -1
  933. package/build/types/integrations/express/utils.d.ts +1 -1
  934. package/build/types/integrations/express/utils.d.ts.map +1 -1
  935. package/build/types/integrations/featureFlags/featureFlagsIntegration.d.ts +1 -1
  936. package/build/types/integrations/featureFlags/featureFlagsIntegration.d.ts.map +1 -1
  937. package/build/types/integrations/featureFlags/growthbook.d.ts +1 -1
  938. package/build/types/integrations/featureFlags/growthbook.d.ts.map +1 -1
  939. package/build/types/integrations/http/double-wrap-warning.d.ts +1 -1
  940. package/build/types/integrations/http/double-wrap-warning.d.ts.map +1 -1
  941. package/build/types/integrations/http/get-outgoing-span-data.d.ts +2 -2
  942. package/build/types/integrations/http/get-outgoing-span-data.d.ts.map +1 -1
  943. package/build/types/integrations/http/patch-request-to-capture-body.d.ts +12 -0
  944. package/build/types/integrations/http/patch-request-to-capture-body.d.ts.map +1 -0
  945. package/build/types/integrations/http/record-request-session.d.ts +18 -0
  946. package/build/types/integrations/http/record-request-session.d.ts.map +1 -0
  947. package/build/types/integrations/http/server-subscription.d.ts +26 -0
  948. package/build/types/integrations/http/server-subscription.d.ts.map +1 -0
  949. package/build/types/integrations/http/types.d.ts +12 -6
  950. package/build/types/integrations/http/types.d.ts.map +1 -1
  951. package/build/types/integrations/mcp-server/correlation.d.ts +1 -1
  952. package/build/types/integrations/mcp-server/correlation.d.ts.map +1 -1
  953. package/build/types/integrations/mcp-server/piiFiltering.d.ts +1 -1
  954. package/build/types/integrations/mcp-server/piiFiltering.d.ts.map +1 -1
  955. package/build/types/integrations/mcp-server/types.d.ts +1 -1
  956. package/build/types/integrations/mcp-server/types.d.ts.map +1 -1
  957. package/build/types/integrations/postgresjs.d.ts +1 -1
  958. package/build/types/integrations/postgresjs.d.ts.map +1 -1
  959. package/build/types/integrations/rewriteframes.d.ts +1 -1
  960. package/build/types/integrations/rewriteframes.d.ts.map +1 -1
  961. package/build/types/integrations/supabase.d.ts +14 -3
  962. package/build/types/integrations/supabase.d.ts.map +1 -1
  963. package/build/types/integrations/third-party-errors-filter.d.ts.map +1 -1
  964. package/build/types/integrations/zoderrors.d.ts +1 -1
  965. package/build/types/integrations/zoderrors.d.ts.map +1 -1
  966. package/build/types/logs/console-integration.d.ts +1 -1
  967. package/build/types/logs/console-integration.d.ts.map +1 -1
  968. package/build/types/logs/constants.d.ts +1 -1
  969. package/build/types/logs/constants.d.ts.map +1 -1
  970. package/build/types/logs/envelope.d.ts +4 -4
  971. package/build/types/logs/envelope.d.ts.map +1 -1
  972. package/build/types/logs/internal.d.ts +16 -1
  973. package/build/types/logs/internal.d.ts.map +1 -1
  974. package/build/types/logs/public-api.d.ts +2 -2
  975. package/build/types/logs/public-api.d.ts.map +1 -1
  976. package/build/types/metadata.d.ts +2 -2
  977. package/build/types/metadata.d.ts.map +1 -1
  978. package/build/types/metrics/envelope.d.ts +4 -4
  979. package/build/types/metrics/envelope.d.ts.map +1 -1
  980. package/build/types/metrics/internal.d.ts +1 -1
  981. package/build/types/metrics/internal.d.ts.map +1 -1
  982. package/build/types/metrics/public-api.d.ts +1 -1
  983. package/build/types/metrics/public-api.d.ts.map +1 -1
  984. package/build/types/profiling.d.ts +1 -1
  985. package/build/types/profiling.d.ts.map +1 -1
  986. package/build/types/report-dialog.d.ts +1 -1
  987. package/build/types/report-dialog.d.ts.map +1 -1
  988. package/build/types/scope.d.ts +14 -14
  989. package/build/types/scope.d.ts.map +1 -1
  990. package/build/types/sdk.d.ts +1 -1
  991. package/build/types/sdk.d.ts.map +1 -1
  992. package/build/types/semanticAttributes.d.ts +6 -4
  993. package/build/types/semanticAttributes.d.ts.map +1 -1
  994. package/build/types/server-exports.d.ts +3 -1
  995. package/build/types/server-exports.d.ts.map +1 -1
  996. package/build/types/server-runtime-client.d.ts +6 -6
  997. package/build/types/server-runtime-client.d.ts.map +1 -1
  998. package/build/types/session.d.ts +1 -1
  999. package/build/types/session.d.ts.map +1 -1
  1000. package/build/types/shared-exports.d.ts +58 -53
  1001. package/build/types/shared-exports.d.ts.map +1 -1
  1002. package/build/types/tracing/ai/utils.d.ts +1 -1
  1003. package/build/types/tracing/ai/utils.d.ts.map +1 -1
  1004. package/build/types/tracing/anthropic-ai/streaming.d.ts +1 -1
  1005. package/build/types/tracing/anthropic-ai/streaming.d.ts.map +1 -1
  1006. package/build/types/tracing/anthropic-ai/utils.d.ts +2 -2
  1007. package/build/types/tracing/anthropic-ai/utils.d.ts.map +1 -1
  1008. package/build/types/tracing/dynamicSamplingContext.d.ts +2 -2
  1009. package/build/types/tracing/dynamicSamplingContext.d.ts.map +1 -1
  1010. package/build/types/tracing/google-genai/streaming.d.ts +1 -1
  1011. package/build/types/tracing/google-genai/streaming.d.ts.map +1 -1
  1012. package/build/types/tracing/idleSpan.d.ts +2 -2
  1013. package/build/types/tracing/idleSpan.d.ts.map +1 -1
  1014. package/build/types/tracing/langchain/utils.d.ts +6 -1
  1015. package/build/types/tracing/langchain/utils.d.ts.map +1 -1
  1016. package/build/types/tracing/langgraph/index.d.ts.map +1 -1
  1017. package/build/types/tracing/langgraph/utils.d.ts +1 -3
  1018. package/build/types/tracing/langgraph/utils.d.ts.map +1 -1
  1019. package/build/types/tracing/logSpans.d.ts +1 -1
  1020. package/build/types/tracing/logSpans.d.ts.map +1 -1
  1021. package/build/types/tracing/measurement.d.ts +2 -2
  1022. package/build/types/tracing/measurement.d.ts.map +1 -1
  1023. package/build/types/tracing/openai/streaming.d.ts +1 -1
  1024. package/build/types/tracing/openai/streaming.d.ts.map +1 -1
  1025. package/build/types/tracing/openai/utils.d.ts +1 -1
  1026. package/build/types/tracing/openai/utils.d.ts.map +1 -1
  1027. package/build/types/tracing/sampling.d.ts +2 -2
  1028. package/build/types/tracing/sampling.d.ts.map +1 -1
  1029. package/build/types/tracing/sentryNonRecordingSpan.d.ts +3 -3
  1030. package/build/types/tracing/sentryNonRecordingSpan.d.ts.map +1 -1
  1031. package/build/types/tracing/sentrySpan.d.ts +4 -4
  1032. package/build/types/tracing/sentrySpan.d.ts.map +1 -1
  1033. package/build/types/tracing/spans/beforeSendSpan.d.ts +3 -3
  1034. package/build/types/tracing/spans/beforeSendSpan.d.ts.map +1 -1
  1035. package/build/types/tracing/spans/captureSpan.d.ts +1 -1
  1036. package/build/types/tracing/spans/captureSpan.d.ts.map +1 -1
  1037. package/build/types/tracing/spans/envelope.d.ts +2 -2
  1038. package/build/types/tracing/spans/envelope.d.ts.map +1 -1
  1039. package/build/types/tracing/spans/estimateSize.d.ts +1 -1
  1040. package/build/types/tracing/spans/estimateSize.d.ts.map +1 -1
  1041. package/build/types/tracing/spans/extractGenAiSpans.d.ts +2 -2
  1042. package/build/types/tracing/spans/extractGenAiSpans.d.ts.map +1 -1
  1043. package/build/types/tracing/spans/scopeContextAttributes.d.ts +9 -0
  1044. package/build/types/tracing/spans/scopeContextAttributes.d.ts.map +1 -0
  1045. package/build/types/tracing/spans/spanJsonToStreamedSpan.d.ts +1 -1
  1046. package/build/types/tracing/spans/spanJsonToStreamedSpan.d.ts.map +1 -1
  1047. package/build/types/tracing/spanstatus.d.ts +2 -2
  1048. package/build/types/tracing/spanstatus.d.ts.map +1 -1
  1049. package/build/types/tracing/trace.d.ts +2 -2
  1050. package/build/types/tracing/trace.d.ts.map +1 -1
  1051. package/build/types/tracing/utils.d.ts +1 -1
  1052. package/build/types/tracing/utils.d.ts.map +1 -1
  1053. package/build/types/tracing/vercel-ai/utils.d.ts +2 -2
  1054. package/build/types/tracing/vercel-ai/utils.d.ts.map +1 -1
  1055. package/build/types/transports/base.d.ts +1 -1
  1056. package/build/types/transports/base.d.ts.map +1 -1
  1057. package/build/types/transports/multiplexed.d.ts +3 -3
  1058. package/build/types/transports/multiplexed.d.ts.map +1 -1
  1059. package/build/types/transports/offline.d.ts +2 -2
  1060. package/build/types/transports/offline.d.ts.map +1 -1
  1061. package/build/types/transports/userAgent.d.ts +1 -1
  1062. package/build/types/transports/userAgent.d.ts.map +1 -1
  1063. package/build/types/trpc.d.ts.map +1 -1
  1064. package/build/types/types/attachment.d.ts.map +1 -0
  1065. package/build/types/types/breadcrumb.d.ts.map +1 -0
  1066. package/build/types/types/browseroptions.d.ts.map +1 -0
  1067. package/build/types/types/checkin.d.ts.map +1 -0
  1068. package/build/types/types/clientreport.d.ts.map +1 -0
  1069. package/build/types/types/context.d.ts.map +1 -0
  1070. package/build/types/types/csp.d.ts.map +1 -0
  1071. package/build/types/types/datacategory.d.ts.map +1 -0
  1072. package/build/types/types/datacollection.d.ts +75 -0
  1073. package/build/types/types/datacollection.d.ts.map +1 -0
  1074. package/build/types/types/debugMeta.d.ts.map +1 -0
  1075. package/build/types/types/dsn.d.ts.map +1 -0
  1076. package/build/types/types/envelope.d.ts.map +1 -0
  1077. package/build/types/types/error.d.ts.map +1 -0
  1078. package/build/types/types/event.d.ts.map +1 -0
  1079. package/build/types/types/eventprocessor.d.ts.map +1 -0
  1080. package/build/types/types/exception.d.ts.map +1 -0
  1081. package/build/types/types/extra.d.ts.map +1 -0
  1082. package/build/types/types/feedback/config.d.ts.map +1 -0
  1083. package/build/types/types/feedback/form.d.ts.map +1 -0
  1084. package/build/types/types/feedback/index.d.ts.map +1 -0
  1085. package/build/types/types/feedback/sendFeedback.d.ts.map +1 -0
  1086. package/build/types/types/feedback/theme.d.ts.map +1 -0
  1087. package/build/types/types/instrument.d.ts.map +1 -0
  1088. package/build/types/types/integration.d.ts.map +1 -0
  1089. package/build/types/types/link.d.ts.map +1 -0
  1090. package/build/types/types/log.d.ts.map +1 -0
  1091. package/build/types/types/measurement.d.ts.map +1 -0
  1092. package/build/types/types/mechanism.d.ts.map +1 -0
  1093. package/build/types/types/metric.d.ts.map +1 -0
  1094. package/build/types/types/misc.d.ts.map +1 -0
  1095. package/build/types/types/opentelemetry.d.ts.map +1 -0
  1096. package/build/types/{types-hoist → types}/options.d.ts +17 -0
  1097. package/build/types/types/options.d.ts.map +1 -0
  1098. package/build/types/types/package.d.ts.map +1 -0
  1099. package/build/types/types/parameterize.d.ts.map +1 -0
  1100. package/build/types/types/polymorphics.d.ts.map +1 -0
  1101. package/build/types/types/profiling.d.ts.map +1 -0
  1102. package/build/types/types/replay.d.ts.map +1 -0
  1103. package/build/types/types/request.d.ts.map +1 -0
  1104. package/build/types/types/runtime.d.ts.map +1 -0
  1105. package/build/types/{types-hoist → types}/samplingcontext.d.ts +1 -1
  1106. package/build/types/types/samplingcontext.d.ts.map +1 -0
  1107. package/build/types/types/sdkinfo.d.ts.map +1 -0
  1108. package/build/types/types/sdkmetadata.d.ts.map +1 -0
  1109. package/build/types/types/session.d.ts.map +1 -0
  1110. package/build/types/types/severity.d.ts.map +1 -0
  1111. package/build/types/types/span.d.ts.map +1 -0
  1112. package/build/types/types/spanStatus.d.ts.map +1 -0
  1113. package/build/types/types/stackframe.d.ts.map +1 -0
  1114. package/build/types/types/stacktrace.d.ts.map +1 -0
  1115. package/build/types/{types-hoist → types}/startSpanOptions.d.ts +13 -0
  1116. package/build/types/types/startSpanOptions.d.ts.map +1 -0
  1117. package/build/types/types/thread.d.ts.map +1 -0
  1118. package/build/types/types/timedEvent.d.ts.map +1 -0
  1119. package/build/types/types/tracing.d.ts.map +1 -0
  1120. package/build/types/types/transaction.d.ts.map +1 -0
  1121. package/build/types/types/transport.d.ts.map +1 -0
  1122. package/build/types/types/user.d.ts.map +1 -0
  1123. package/build/types/types/view-hierarchy.d.ts.map +1 -0
  1124. package/build/types/types/vue.d.ts.map +1 -0
  1125. package/build/types/types/webfetchapi.d.ts.map +1 -0
  1126. package/build/types/types/wrappedfunction.d.ts.map +1 -0
  1127. package/build/types/utils/aggregate-errors.d.ts +3 -3
  1128. package/build/types/utils/aggregate-errors.d.ts.map +1 -1
  1129. package/build/types/utils/anr.d.ts +1 -1
  1130. package/build/types/utils/anr.d.ts.map +1 -1
  1131. package/build/types/utils/baggage.d.ts +1 -1
  1132. package/build/types/utils/baggage.d.ts.map +1 -1
  1133. package/build/types/utils/breadcrumb-log-level.d.ts +1 -1
  1134. package/build/types/utils/breadcrumb-log-level.d.ts.map +1 -1
  1135. package/build/types/utils/clientreport.d.ts +2 -2
  1136. package/build/types/utils/clientreport.d.ts.map +1 -1
  1137. package/build/types/utils/data-collection/defaultPiiToCollectionOptions.d.ts +6 -0
  1138. package/build/types/utils/data-collection/defaultPiiToCollectionOptions.d.ts.map +1 -0
  1139. package/build/types/utils/data-collection/filterCookies.d.ts +9 -0
  1140. package/build/types/utils/data-collection/filterCookies.d.ts.map +1 -0
  1141. package/build/types/utils/data-collection/filterKeyValueData.d.ts +11 -0
  1142. package/build/types/utils/data-collection/filterKeyValueData.d.ts.map +1 -0
  1143. package/build/types/utils/data-collection/filterQueryParams.d.ts +9 -0
  1144. package/build/types/utils/data-collection/filterQueryParams.d.ts.map +1 -0
  1145. package/build/types/utils/data-collection/filtering-snippets.d.ts +14 -0
  1146. package/build/types/utils/data-collection/filtering-snippets.d.ts.map +1 -0
  1147. package/build/types/utils/data-collection/resolveDataCollectionOptions.d.ts +14 -0
  1148. package/build/types/utils/data-collection/resolveDataCollectionOptions.d.ts.map +1 -0
  1149. package/build/types/utils/debug-ids.d.ts +2 -2
  1150. package/build/types/utils/debug-ids.d.ts.map +1 -1
  1151. package/build/types/utils/debug-logger.d.ts +1 -1
  1152. package/build/types/utils/debug-logger.d.ts.map +1 -1
  1153. package/build/types/utils/dsn.d.ts +1 -1
  1154. package/build/types/utils/dsn.d.ts.map +1 -1
  1155. package/build/types/utils/env.d.ts.map +1 -1
  1156. package/build/types/utils/envelope.d.ts +8 -8
  1157. package/build/types/utils/envelope.d.ts.map +1 -1
  1158. package/build/types/utils/error.d.ts +1 -1
  1159. package/build/types/utils/error.d.ts.map +1 -1
  1160. package/build/types/utils/eventUtils.d.ts +1 -1
  1161. package/build/types/utils/eventUtils.d.ts.map +1 -1
  1162. package/build/types/utils/eventbuilder.d.ts +6 -6
  1163. package/build/types/utils/eventbuilder.d.ts.map +1 -1
  1164. package/build/types/utils/featureFlags.d.ts +1 -1
  1165. package/build/types/utils/featureFlags.d.ts.map +1 -1
  1166. package/build/types/utils/hasSpansEnabled.d.ts +1 -1
  1167. package/build/types/utils/hasSpansEnabled.d.ts.map +1 -1
  1168. package/build/types/utils/ipAddress.d.ts +2 -2
  1169. package/build/types/utils/ipAddress.d.ts.map +1 -1
  1170. package/build/types/utils/is.d.ts +4 -4
  1171. package/build/types/utils/is.d.ts.map +1 -1
  1172. package/build/types/utils/meta.d.ts +1 -1
  1173. package/build/types/utils/meta.d.ts.map +1 -1
  1174. package/build/types/utils/misc.d.ts +3 -3
  1175. package/build/types/utils/misc.d.ts.map +1 -1
  1176. package/build/types/utils/node-stack-trace.d.ts +1 -1
  1177. package/build/types/utils/node-stack-trace.d.ts.map +1 -1
  1178. package/build/types/utils/object.d.ts +1 -1
  1179. package/build/types/utils/object.d.ts.map +1 -1
  1180. package/build/types/utils/parameterize.d.ts +1 -1
  1181. package/build/types/utils/parameterize.d.ts.map +1 -1
  1182. package/build/types/utils/prepareEvent.d.ts +3 -3
  1183. package/build/types/utils/prepareEvent.d.ts.map +1 -1
  1184. package/build/types/utils/ratelimit.d.ts +2 -2
  1185. package/build/types/utils/ratelimit.d.ts.map +1 -1
  1186. package/build/types/utils/request.d.ts +3 -3
  1187. package/build/types/utils/request.d.ts.map +1 -1
  1188. package/build/types/utils/scopeData.d.ts +1 -1
  1189. package/build/types/utils/scopeData.d.ts.map +1 -1
  1190. package/build/types/utils/sdkMetadata.d.ts +1 -1
  1191. package/build/types/utils/sdkMetadata.d.ts.map +1 -1
  1192. package/build/types/utils/severity.d.ts +1 -1
  1193. package/build/types/utils/severity.d.ts.map +1 -1
  1194. package/build/types/utils/should-ignore-span.d.ts +2 -2
  1195. package/build/types/utils/should-ignore-span.d.ts.map +1 -1
  1196. package/build/types/utils/spanOnScope.d.ts +1 -1
  1197. package/build/types/utils/spanOnScope.d.ts.map +1 -1
  1198. package/build/types/utils/spanUtils.d.ts +4 -4
  1199. package/build/types/utils/spanUtils.d.ts.map +1 -1
  1200. package/build/types/utils/stacktrace.d.ts +4 -4
  1201. package/build/types/utils/stacktrace.d.ts.map +1 -1
  1202. package/build/types/utils/trace-info.d.ts +2 -2
  1203. package/build/types/utils/trace-info.d.ts.map +1 -1
  1204. package/build/types/utils/traceData.d.ts +2 -2
  1205. package/build/types/utils/traceData.d.ts.map +1 -1
  1206. package/build/types/utils/tracePropagationTargets.d.ts +1 -1
  1207. package/build/types/utils/tracePropagationTargets.d.ts.map +1 -1
  1208. package/build/types/utils/tracing.d.ts +2 -2
  1209. package/build/types/utils/tracing.d.ts.map +1 -1
  1210. package/build/types/utils/transactionEvent.d.ts +2 -2
  1211. package/build/types/utils/transactionEvent.d.ts.map +1 -1
  1212. package/build/types/utils/url.d.ts +1 -1
  1213. package/build/types/utils/url.d.ts.map +1 -1
  1214. package/build/types/utils/worldwide.d.ts +1 -0
  1215. package/build/types/utils/worldwide.d.ts.map +1 -1
  1216. package/build/types-ts3.8/api.d.ts +2 -2
  1217. package/build/types-ts3.8/attributes.d.ts +5 -8
  1218. package/build/types-ts3.8/breadcrumbs.d.ts +1 -1
  1219. package/build/types-ts3.8/browser-exports.d.ts +3 -3
  1220. package/build/types-ts3.8/carrier.d.ts +2 -2
  1221. package/build/types-ts3.8/checkin.d.ts +4 -4
  1222. package/build/types-ts3.8/client.d.ts +32 -22
  1223. package/build/types-ts3.8/currentScopes.d.ts +1 -1
  1224. package/build/types-ts3.8/envelope.d.ts +7 -7
  1225. package/build/types-ts3.8/eventProcessors.d.ts +2 -2
  1226. package/build/types-ts3.8/exports.d.ts +8 -8
  1227. package/build/types-ts3.8/feedback.d.ts +2 -2
  1228. package/build/types-ts3.8/fetch.d.ts +3 -3
  1229. package/build/types-ts3.8/instrument/console.d.ts +1 -1
  1230. package/build/types-ts3.8/instrument/fetch.d.ts +1 -1
  1231. package/build/types-ts3.8/instrument/globalError.d.ts +1 -1
  1232. package/build/types-ts3.8/instrument/globalUnhandledRejection.d.ts +1 -1
  1233. package/build/types-ts3.8/integration.d.ts +2 -2
  1234. package/build/types-ts3.8/integrations/consola.d.ts +1 -1
  1235. package/build/types-ts3.8/integrations/console.d.ts +1 -1
  1236. package/build/types-ts3.8/integrations/dedupe.d.ts +1 -1
  1237. package/build/types-ts3.8/integrations/express/types.d.ts +2 -2
  1238. package/build/types-ts3.8/integrations/express/utils.d.ts +1 -1
  1239. package/build/types-ts3.8/integrations/featureFlags/featureFlagsIntegration.d.ts +1 -1
  1240. package/build/types-ts3.8/integrations/featureFlags/growthbook.d.ts +1 -1
  1241. package/build/types-ts3.8/integrations/http/double-wrap-warning.d.ts +1 -1
  1242. package/build/types-ts3.8/integrations/http/get-outgoing-span-data.d.ts +2 -2
  1243. package/build/types-ts3.8/integrations/http/patch-request-to-capture-body.d.ts +12 -0
  1244. package/build/types-ts3.8/integrations/http/record-request-session.d.ts +18 -0
  1245. package/build/types-ts3.8/integrations/http/server-subscription.d.ts +26 -0
  1246. package/build/types-ts3.8/integrations/http/types.d.ts +12 -6
  1247. package/build/types-ts3.8/integrations/mcp-server/correlation.d.ts +1 -1
  1248. package/build/types-ts3.8/integrations/mcp-server/piiFiltering.d.ts +1 -1
  1249. package/build/types-ts3.8/integrations/mcp-server/types.d.ts +1 -1
  1250. package/build/types-ts3.8/integrations/postgresjs.d.ts +1 -1
  1251. package/build/types-ts3.8/integrations/rewriteframes.d.ts +1 -1
  1252. package/build/types-ts3.8/integrations/supabase.d.ts +14 -3
  1253. package/build/types-ts3.8/integrations/zoderrors.d.ts +1 -1
  1254. package/build/types-ts3.8/logs/console-integration.d.ts +1 -1
  1255. package/build/types-ts3.8/logs/constants.d.ts +1 -1
  1256. package/build/types-ts3.8/logs/envelope.d.ts +4 -4
  1257. package/build/types-ts3.8/logs/internal.d.ts +16 -1
  1258. package/build/types-ts3.8/logs/public-api.d.ts +2 -2
  1259. package/build/types-ts3.8/metadata.d.ts +2 -2
  1260. package/build/types-ts3.8/metrics/envelope.d.ts +4 -4
  1261. package/build/types-ts3.8/metrics/internal.d.ts +1 -1
  1262. package/build/types-ts3.8/metrics/public-api.d.ts +1 -1
  1263. package/build/types-ts3.8/profiling.d.ts +1 -1
  1264. package/build/types-ts3.8/report-dialog.d.ts +1 -1
  1265. package/build/types-ts3.8/scope.d.ts +14 -14
  1266. package/build/types-ts3.8/sdk.d.ts +1 -1
  1267. package/build/types-ts3.8/semanticAttributes.d.ts +6 -4
  1268. package/build/types-ts3.8/server-exports.d.ts +3 -1
  1269. package/build/types-ts3.8/server-runtime-client.d.ts +6 -6
  1270. package/build/types-ts3.8/session.d.ts +1 -1
  1271. package/build/types-ts3.8/shared-exports.d.ts +58 -53
  1272. package/build/types-ts3.8/tracing/ai/utils.d.ts +1 -1
  1273. package/build/types-ts3.8/tracing/anthropic-ai/streaming.d.ts +1 -1
  1274. package/build/types-ts3.8/tracing/anthropic-ai/utils.d.ts +2 -2
  1275. package/build/types-ts3.8/tracing/dynamicSamplingContext.d.ts +2 -2
  1276. package/build/types-ts3.8/tracing/google-genai/streaming.d.ts +1 -1
  1277. package/build/types-ts3.8/tracing/idleSpan.d.ts +2 -2
  1278. package/build/types-ts3.8/tracing/langchain/utils.d.ts +6 -1
  1279. package/build/types-ts3.8/tracing/langgraph/utils.d.ts +1 -3
  1280. package/build/types-ts3.8/tracing/logSpans.d.ts +1 -1
  1281. package/build/types-ts3.8/tracing/measurement.d.ts +2 -2
  1282. package/build/types-ts3.8/tracing/openai/streaming.d.ts +1 -1
  1283. package/build/types-ts3.8/tracing/openai/utils.d.ts +1 -1
  1284. package/build/types-ts3.8/tracing/sampling.d.ts +2 -2
  1285. package/build/types-ts3.8/tracing/sentryNonRecordingSpan.d.ts +3 -3
  1286. package/build/types-ts3.8/tracing/sentrySpan.d.ts +4 -4
  1287. package/build/types-ts3.8/tracing/spans/beforeSendSpan.d.ts +3 -3
  1288. package/build/types-ts3.8/tracing/spans/captureSpan.d.ts +1 -1
  1289. package/build/types-ts3.8/tracing/spans/envelope.d.ts +2 -2
  1290. package/build/types-ts3.8/tracing/spans/estimateSize.d.ts +1 -1
  1291. package/build/types-ts3.8/tracing/spans/extractGenAiSpans.d.ts +2 -2
  1292. package/build/types-ts3.8/tracing/spans/scopeContextAttributes.d.ts +9 -0
  1293. package/build/types-ts3.8/tracing/spans/spanJsonToStreamedSpan.d.ts +1 -1
  1294. package/build/types-ts3.8/tracing/spanstatus.d.ts +2 -2
  1295. package/build/types-ts3.8/tracing/trace.d.ts +2 -2
  1296. package/build/types-ts3.8/tracing/utils.d.ts +1 -1
  1297. package/build/types-ts3.8/tracing/vercel-ai/utils.d.ts +2 -2
  1298. package/build/types-ts3.8/transports/base.d.ts +1 -1
  1299. package/build/types-ts3.8/transports/multiplexed.d.ts +3 -3
  1300. package/build/types-ts3.8/transports/offline.d.ts +2 -2
  1301. package/build/types-ts3.8/transports/userAgent.d.ts +1 -1
  1302. package/build/types-ts3.8/types/datacollection.d.ts +75 -0
  1303. package/build/types-ts3.8/{types-hoist → types}/options.d.ts +17 -0
  1304. package/build/types-ts3.8/{types-hoist → types}/samplingcontext.d.ts +1 -1
  1305. package/build/types-ts3.8/{types-hoist → types}/startSpanOptions.d.ts +13 -0
  1306. package/build/types-ts3.8/utils/aggregate-errors.d.ts +3 -3
  1307. package/build/types-ts3.8/utils/anr.d.ts +1 -1
  1308. package/build/types-ts3.8/utils/baggage.d.ts +1 -1
  1309. package/build/types-ts3.8/utils/breadcrumb-log-level.d.ts +1 -1
  1310. package/build/types-ts3.8/utils/clientreport.d.ts +2 -2
  1311. package/build/types-ts3.8/utils/data-collection/defaultPiiToCollectionOptions.d.ts +6 -0
  1312. package/build/types-ts3.8/utils/data-collection/filterCookies.d.ts +9 -0
  1313. package/build/types-ts3.8/utils/data-collection/filterKeyValueData.d.ts +11 -0
  1314. package/build/types-ts3.8/utils/data-collection/filterQueryParams.d.ts +9 -0
  1315. package/build/types-ts3.8/utils/data-collection/filtering-snippets.d.ts +14 -0
  1316. package/build/types-ts3.8/utils/data-collection/resolveDataCollectionOptions.d.ts +14 -0
  1317. package/build/types-ts3.8/utils/debug-ids.d.ts +2 -2
  1318. package/build/types-ts3.8/utils/debug-logger.d.ts +1 -1
  1319. package/build/types-ts3.8/utils/dsn.d.ts +1 -1
  1320. package/build/types-ts3.8/utils/envelope.d.ts +8 -8
  1321. package/build/types-ts3.8/utils/error.d.ts +1 -1
  1322. package/build/types-ts3.8/utils/eventUtils.d.ts +1 -1
  1323. package/build/types-ts3.8/utils/eventbuilder.d.ts +6 -6
  1324. package/build/types-ts3.8/utils/featureFlags.d.ts +1 -1
  1325. package/build/types-ts3.8/utils/hasSpansEnabled.d.ts +1 -1
  1326. package/build/types-ts3.8/utils/ipAddress.d.ts +2 -2
  1327. package/build/types-ts3.8/utils/is.d.ts +4 -4
  1328. package/build/types-ts3.8/utils/meta.d.ts +1 -1
  1329. package/build/types-ts3.8/utils/misc.d.ts +3 -3
  1330. package/build/types-ts3.8/utils/node-stack-trace.d.ts +1 -1
  1331. package/build/types-ts3.8/utils/object.d.ts +1 -1
  1332. package/build/types-ts3.8/utils/parameterize.d.ts +1 -1
  1333. package/build/types-ts3.8/utils/prepareEvent.d.ts +3 -3
  1334. package/build/types-ts3.8/utils/ratelimit.d.ts +2 -2
  1335. package/build/types-ts3.8/utils/request.d.ts +3 -3
  1336. package/build/types-ts3.8/utils/scopeData.d.ts +1 -1
  1337. package/build/types-ts3.8/utils/sdkMetadata.d.ts +1 -1
  1338. package/build/types-ts3.8/utils/severity.d.ts +1 -1
  1339. package/build/types-ts3.8/utils/should-ignore-span.d.ts +2 -2
  1340. package/build/types-ts3.8/utils/spanOnScope.d.ts +1 -1
  1341. package/build/types-ts3.8/utils/spanUtils.d.ts +4 -4
  1342. package/build/types-ts3.8/utils/stacktrace.d.ts +4 -4
  1343. package/build/types-ts3.8/utils/trace-info.d.ts +2 -2
  1344. package/build/types-ts3.8/utils/traceData.d.ts +2 -2
  1345. package/build/types-ts3.8/utils/tracePropagationTargets.d.ts +1 -1
  1346. package/build/types-ts3.8/utils/tracing.d.ts +2 -2
  1347. package/build/types-ts3.8/utils/transactionEvent.d.ts +2 -2
  1348. package/build/types-ts3.8/utils/url.d.ts +1 -1
  1349. package/build/types-ts3.8/utils/worldwide.d.ts +1 -0
  1350. package/package.json +10 -2
  1351. package/server.d.ts +4 -0
  1352. package/build/types/types-hoist/attachment.d.ts.map +0 -1
  1353. package/build/types/types-hoist/breadcrumb.d.ts.map +0 -1
  1354. package/build/types/types-hoist/browseroptions.d.ts.map +0 -1
  1355. package/build/types/types-hoist/checkin.d.ts.map +0 -1
  1356. package/build/types/types-hoist/clientreport.d.ts.map +0 -1
  1357. package/build/types/types-hoist/context.d.ts.map +0 -1
  1358. package/build/types/types-hoist/csp.d.ts.map +0 -1
  1359. package/build/types/types-hoist/datacategory.d.ts.map +0 -1
  1360. package/build/types/types-hoist/debugMeta.d.ts.map +0 -1
  1361. package/build/types/types-hoist/dsn.d.ts.map +0 -1
  1362. package/build/types/types-hoist/envelope.d.ts.map +0 -1
  1363. package/build/types/types-hoist/error.d.ts.map +0 -1
  1364. package/build/types/types-hoist/event.d.ts.map +0 -1
  1365. package/build/types/types-hoist/eventprocessor.d.ts.map +0 -1
  1366. package/build/types/types-hoist/exception.d.ts.map +0 -1
  1367. package/build/types/types-hoist/extra.d.ts.map +0 -1
  1368. package/build/types/types-hoist/feedback/config.d.ts.map +0 -1
  1369. package/build/types/types-hoist/feedback/form.d.ts.map +0 -1
  1370. package/build/types/types-hoist/feedback/index.d.ts.map +0 -1
  1371. package/build/types/types-hoist/feedback/sendFeedback.d.ts.map +0 -1
  1372. package/build/types/types-hoist/feedback/theme.d.ts.map +0 -1
  1373. package/build/types/types-hoist/instrument.d.ts.map +0 -1
  1374. package/build/types/types-hoist/integration.d.ts.map +0 -1
  1375. package/build/types/types-hoist/link.d.ts.map +0 -1
  1376. package/build/types/types-hoist/log.d.ts.map +0 -1
  1377. package/build/types/types-hoist/measurement.d.ts.map +0 -1
  1378. package/build/types/types-hoist/mechanism.d.ts.map +0 -1
  1379. package/build/types/types-hoist/metric.d.ts.map +0 -1
  1380. package/build/types/types-hoist/misc.d.ts.map +0 -1
  1381. package/build/types/types-hoist/opentelemetry.d.ts.map +0 -1
  1382. package/build/types/types-hoist/options.d.ts.map +0 -1
  1383. package/build/types/types-hoist/package.d.ts.map +0 -1
  1384. package/build/types/types-hoist/parameterize.d.ts.map +0 -1
  1385. package/build/types/types-hoist/polymorphics.d.ts.map +0 -1
  1386. package/build/types/types-hoist/profiling.d.ts.map +0 -1
  1387. package/build/types/types-hoist/replay.d.ts.map +0 -1
  1388. package/build/types/types-hoist/request.d.ts.map +0 -1
  1389. package/build/types/types-hoist/runtime.d.ts.map +0 -1
  1390. package/build/types/types-hoist/samplingcontext.d.ts.map +0 -1
  1391. package/build/types/types-hoist/sdkinfo.d.ts.map +0 -1
  1392. package/build/types/types-hoist/sdkmetadata.d.ts.map +0 -1
  1393. package/build/types/types-hoist/session.d.ts.map +0 -1
  1394. package/build/types/types-hoist/severity.d.ts.map +0 -1
  1395. package/build/types/types-hoist/span.d.ts.map +0 -1
  1396. package/build/types/types-hoist/spanStatus.d.ts.map +0 -1
  1397. package/build/types/types-hoist/stackframe.d.ts.map +0 -1
  1398. package/build/types/types-hoist/stacktrace.d.ts.map +0 -1
  1399. package/build/types/types-hoist/startSpanOptions.d.ts.map +0 -1
  1400. package/build/types/types-hoist/thread.d.ts.map +0 -1
  1401. package/build/types/types-hoist/timedEvent.d.ts.map +0 -1
  1402. package/build/types/types-hoist/tracing.d.ts.map +0 -1
  1403. package/build/types/types-hoist/transaction.d.ts.map +0 -1
  1404. package/build/types/types-hoist/transport.d.ts.map +0 -1
  1405. package/build/types/types-hoist/user.d.ts.map +0 -1
  1406. package/build/types/types-hoist/view-hierarchy.d.ts.map +0 -1
  1407. package/build/types/types-hoist/vue.d.ts.map +0 -1
  1408. package/build/types/types-hoist/webfetchapi.d.ts.map +0 -1
  1409. package/build/types/types-hoist/wrappedfunction.d.ts.map +0 -1
  1410. /package/build/types/{types-hoist → types}/attachment.d.ts +0 -0
  1411. /package/build/types/{types-hoist → types}/breadcrumb.d.ts +0 -0
  1412. /package/build/types/{types-hoist → types}/browseroptions.d.ts +0 -0
  1413. /package/build/types/{types-hoist → types}/checkin.d.ts +0 -0
  1414. /package/build/types/{types-hoist → types}/clientreport.d.ts +0 -0
  1415. /package/build/types/{types-hoist → types}/context.d.ts +0 -0
  1416. /package/build/types/{types-hoist → types}/csp.d.ts +0 -0
  1417. /package/build/types/{types-hoist → types}/datacategory.d.ts +0 -0
  1418. /package/build/types/{types-hoist → types}/debugMeta.d.ts +0 -0
  1419. /package/build/types/{types-hoist → types}/dsn.d.ts +0 -0
  1420. /package/build/types/{types-hoist → types}/envelope.d.ts +0 -0
  1421. /package/build/types/{types-hoist → types}/error.d.ts +0 -0
  1422. /package/build/types/{types-hoist → types}/event.d.ts +0 -0
  1423. /package/build/types/{types-hoist → types}/eventprocessor.d.ts +0 -0
  1424. /package/build/types/{types-hoist → types}/exception.d.ts +0 -0
  1425. /package/build/types/{types-hoist → types}/extra.d.ts +0 -0
  1426. /package/build/types/{types-hoist → types}/feedback/config.d.ts +0 -0
  1427. /package/build/types/{types-hoist → types}/feedback/form.d.ts +0 -0
  1428. /package/build/types/{types-hoist → types}/feedback/index.d.ts +0 -0
  1429. /package/build/types/{types-hoist → types}/feedback/sendFeedback.d.ts +0 -0
  1430. /package/build/types/{types-hoist → types}/feedback/theme.d.ts +0 -0
  1431. /package/build/types/{types-hoist → types}/instrument.d.ts +0 -0
  1432. /package/build/types/{types-hoist → types}/integration.d.ts +0 -0
  1433. /package/build/types/{types-hoist → types}/link.d.ts +0 -0
  1434. /package/build/types/{types-hoist → types}/log.d.ts +0 -0
  1435. /package/build/types/{types-hoist → types}/measurement.d.ts +0 -0
  1436. /package/build/types/{types-hoist → types}/mechanism.d.ts +0 -0
  1437. /package/build/types/{types-hoist → types}/metric.d.ts +0 -0
  1438. /package/build/types/{types-hoist → types}/misc.d.ts +0 -0
  1439. /package/build/types/{types-hoist → types}/opentelemetry.d.ts +0 -0
  1440. /package/build/types/{types-hoist → types}/package.d.ts +0 -0
  1441. /package/build/types/{types-hoist → types}/parameterize.d.ts +0 -0
  1442. /package/build/types/{types-hoist → types}/polymorphics.d.ts +0 -0
  1443. /package/build/types/{types-hoist → types}/profiling.d.ts +0 -0
  1444. /package/build/types/{types-hoist → types}/replay.d.ts +0 -0
  1445. /package/build/types/{types-hoist → types}/request.d.ts +0 -0
  1446. /package/build/types/{types-hoist → types}/runtime.d.ts +0 -0
  1447. /package/build/types/{types-hoist → types}/sdkinfo.d.ts +0 -0
  1448. /package/build/types/{types-hoist → types}/sdkmetadata.d.ts +0 -0
  1449. /package/build/types/{types-hoist → types}/session.d.ts +0 -0
  1450. /package/build/types/{types-hoist → types}/severity.d.ts +0 -0
  1451. /package/build/types/{types-hoist → types}/span.d.ts +0 -0
  1452. /package/build/types/{types-hoist → types}/spanStatus.d.ts +0 -0
  1453. /package/build/types/{types-hoist → types}/stackframe.d.ts +0 -0
  1454. /package/build/types/{types-hoist → types}/stacktrace.d.ts +0 -0
  1455. /package/build/types/{types-hoist → types}/thread.d.ts +0 -0
  1456. /package/build/types/{types-hoist → types}/timedEvent.d.ts +0 -0
  1457. /package/build/types/{types-hoist → types}/tracing.d.ts +0 -0
  1458. /package/build/types/{types-hoist → types}/transaction.d.ts +0 -0
  1459. /package/build/types/{types-hoist → types}/transport.d.ts +0 -0
  1460. /package/build/types/{types-hoist → types}/user.d.ts +0 -0
  1461. /package/build/types/{types-hoist → types}/view-hierarchy.d.ts +0 -0
  1462. /package/build/types/{types-hoist → types}/vue.d.ts +0 -0
  1463. /package/build/types/{types-hoist → types}/webfetchapi.d.ts +0 -0
  1464. /package/build/types/{types-hoist → types}/wrappedfunction.d.ts +0 -0
  1465. /package/build/types-ts3.8/{types-hoist → types}/attachment.d.ts +0 -0
  1466. /package/build/types-ts3.8/{types-hoist → types}/breadcrumb.d.ts +0 -0
  1467. /package/build/types-ts3.8/{types-hoist → types}/browseroptions.d.ts +0 -0
  1468. /package/build/types-ts3.8/{types-hoist → types}/checkin.d.ts +0 -0
  1469. /package/build/types-ts3.8/{types-hoist → types}/clientreport.d.ts +0 -0
  1470. /package/build/types-ts3.8/{types-hoist → types}/context.d.ts +0 -0
  1471. /package/build/types-ts3.8/{types-hoist → types}/csp.d.ts +0 -0
  1472. /package/build/types-ts3.8/{types-hoist → types}/datacategory.d.ts +0 -0
  1473. /package/build/types-ts3.8/{types-hoist → types}/debugMeta.d.ts +0 -0
  1474. /package/build/types-ts3.8/{types-hoist → types}/dsn.d.ts +0 -0
  1475. /package/build/types-ts3.8/{types-hoist → types}/envelope.d.ts +0 -0
  1476. /package/build/types-ts3.8/{types-hoist → types}/error.d.ts +0 -0
  1477. /package/build/types-ts3.8/{types-hoist → types}/event.d.ts +0 -0
  1478. /package/build/types-ts3.8/{types-hoist → types}/eventprocessor.d.ts +0 -0
  1479. /package/build/types-ts3.8/{types-hoist → types}/exception.d.ts +0 -0
  1480. /package/build/types-ts3.8/{types-hoist → types}/extra.d.ts +0 -0
  1481. /package/build/types-ts3.8/{types-hoist → types}/feedback/config.d.ts +0 -0
  1482. /package/build/types-ts3.8/{types-hoist → types}/feedback/form.d.ts +0 -0
  1483. /package/build/types-ts3.8/{types-hoist → types}/feedback/index.d.ts +0 -0
  1484. /package/build/types-ts3.8/{types-hoist → types}/feedback/sendFeedback.d.ts +0 -0
  1485. /package/build/types-ts3.8/{types-hoist → types}/feedback/theme.d.ts +0 -0
  1486. /package/build/types-ts3.8/{types-hoist → types}/instrument.d.ts +0 -0
  1487. /package/build/types-ts3.8/{types-hoist → types}/integration.d.ts +0 -0
  1488. /package/build/types-ts3.8/{types-hoist → types}/link.d.ts +0 -0
  1489. /package/build/types-ts3.8/{types-hoist → types}/log.d.ts +0 -0
  1490. /package/build/types-ts3.8/{types-hoist → types}/measurement.d.ts +0 -0
  1491. /package/build/types-ts3.8/{types-hoist → types}/mechanism.d.ts +0 -0
  1492. /package/build/types-ts3.8/{types-hoist → types}/metric.d.ts +0 -0
  1493. /package/build/types-ts3.8/{types-hoist → types}/misc.d.ts +0 -0
  1494. /package/build/types-ts3.8/{types-hoist → types}/opentelemetry.d.ts +0 -0
  1495. /package/build/types-ts3.8/{types-hoist → types}/package.d.ts +0 -0
  1496. /package/build/types-ts3.8/{types-hoist → types}/parameterize.d.ts +0 -0
  1497. /package/build/types-ts3.8/{types-hoist → types}/polymorphics.d.ts +0 -0
  1498. /package/build/types-ts3.8/{types-hoist → types}/profiling.d.ts +0 -0
  1499. /package/build/types-ts3.8/{types-hoist → types}/replay.d.ts +0 -0
  1500. /package/build/types-ts3.8/{types-hoist → types}/request.d.ts +0 -0
  1501. /package/build/types-ts3.8/{types-hoist → types}/runtime.d.ts +0 -0
  1502. /package/build/types-ts3.8/{types-hoist → types}/sdkinfo.d.ts +0 -0
  1503. /package/build/types-ts3.8/{types-hoist → types}/sdkmetadata.d.ts +0 -0
  1504. /package/build/types-ts3.8/{types-hoist → types}/session.d.ts +0 -0
  1505. /package/build/types-ts3.8/{types-hoist → types}/severity.d.ts +0 -0
  1506. /package/build/types-ts3.8/{types-hoist → types}/span.d.ts +0 -0
  1507. /package/build/types-ts3.8/{types-hoist → types}/spanStatus.d.ts +0 -0
  1508. /package/build/types-ts3.8/{types-hoist → types}/stackframe.d.ts +0 -0
  1509. /package/build/types-ts3.8/{types-hoist → types}/stacktrace.d.ts +0 -0
  1510. /package/build/types-ts3.8/{types-hoist → types}/thread.d.ts +0 -0
  1511. /package/build/types-ts3.8/{types-hoist → types}/timedEvent.d.ts +0 -0
  1512. /package/build/types-ts3.8/{types-hoist → types}/tracing.d.ts +0 -0
  1513. /package/build/types-ts3.8/{types-hoist → types}/transaction.d.ts +0 -0
  1514. /package/build/types-ts3.8/{types-hoist → types}/transport.d.ts +0 -0
  1515. /package/build/types-ts3.8/{types-hoist → types}/user.d.ts +0 -0
  1516. /package/build/types-ts3.8/{types-hoist → types}/view-hierarchy.d.ts +0 -0
  1517. /package/build/types-ts3.8/{types-hoist → types}/vue.d.ts +0 -0
  1518. /package/build/types-ts3.8/{types-hoist → types}/webfetchapi.d.ts +0 -0
  1519. /package/build/types-ts3.8/{types-hoist → types}/wrappedfunction.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"idleSpan.js","sources":["../../../src/tracing/idleSpan.ts"],"sourcesContent":["import { getClient, getCurrentScope } from '../currentScopes';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON } from '../semanticAttributes';\nimport type { DynamicSamplingContext } from '../types-hoist/envelope';\nimport type { Span } from '../types-hoist/span';\nimport type { StartSpanOptions } from '../types-hoist/startSpanOptions';\nimport { debug } from '../utils/debug-logger';\nimport { hasSpansEnabled } from '../utils/hasSpansEnabled';\nimport { shouldIgnoreSpan } from '../utils/should-ignore-span';\nimport { _setSpanForScope } from '../utils/spanOnScope';\nimport {\n getActiveSpan,\n getSpanDescendants,\n removeChildSpanFromSpan,\n spanTimeInputToSeconds,\n spanToJSON,\n} from '../utils/spanUtils';\nimport { timestampInSeconds } from '../utils/time';\nimport { freezeDscOnSpan, getDynamicSamplingContextFromSpan } from './dynamicSamplingContext';\nimport { SentryNonRecordingSpan } from './sentryNonRecordingSpan';\nimport { SentrySpan } from './sentrySpan';\nimport { SPAN_STATUS_ERROR, SPAN_STATUS_OK } from './spanstatus';\nimport { startInactiveSpan } from './trace';\n\nexport const TRACING_DEFAULTS = {\n idleTimeout: 1_000,\n finalTimeout: 30_000,\n childSpanTimeout: 15_000,\n};\n\nconst FINISH_REASON_HEARTBEAT_FAILED = 'heartbeatFailed';\nconst FINISH_REASON_IDLE_TIMEOUT = 'idleTimeout';\nconst FINISH_REASON_FINAL_TIMEOUT = 'finalTimeout';\nconst FINISH_REASON_EXTERNAL_FINISH = 'externalFinish';\nconst FINISH_REASON_CANCELLED = 'cancelled';\n\n// unused\nconst FINISH_REASON_DOCUMENT_HIDDEN = 'documentHidden';\n\n// unused in this file, but used in BrowserTracing\nconst FINISH_REASON_INTERRUPTED = 'interactionInterrupted';\n\ntype IdleSpanFinishReason =\n | typeof FINISH_REASON_CANCELLED\n | typeof FINISH_REASON_DOCUMENT_HIDDEN\n | typeof FINISH_REASON_EXTERNAL_FINISH\n | typeof FINISH_REASON_FINAL_TIMEOUT\n | typeof FINISH_REASON_HEARTBEAT_FAILED\n | typeof FINISH_REASON_IDLE_TIMEOUT\n | typeof FINISH_REASON_INTERRUPTED;\n\ninterface IdleSpanOptions {\n /**\n * The time that has to pass without any span being created.\n * If this time is exceeded, the idle span will finish.\n */\n idleTimeout: number;\n /**\n * The max. time an idle span may run.\n * If this time is exceeded, the idle span will finish no matter what.\n */\n finalTimeout: number;\n /**\n * The max. time a child span may run.\n * If the time since the last span was started exceeds this time, the idle span will finish.\n */\n childSpanTimeout?: number;\n /**\n * When set to `true`, will disable the idle timeout and child timeout\n * until the `idleSpanEnableAutoFinish` hook is emitted for the idle span.\n * The final timeout mechanism will not be affected by this option,\n * meaning the idle span will definitely be finished when the final timeout is\n * reached, no matter what this option is configured to.\n *\n * Defaults to `false`.\n */\n disableAutoFinish?: boolean;\n\n /** Allows to configure a hook that is called when the idle span is ended, before it is processed. */\n beforeSpanEnd?: (span: Span) => void;\n\n /**\n * If set to `true`, the idle span will be trimmed to the latest span end timestamp of its children.\n *\n * @default `true`.\n */\n trimIdleSpanEndTimestamp?: boolean;\n}\n\n/**\n * An idle span is a span that automatically finishes. It does this by tracking child spans as activities.\n * An idle span is always the active span.\n */\nexport function startIdleSpan(startSpanOptions: StartSpanOptions, options: Partial<IdleSpanOptions> = {}): Span {\n // Activities store a list of active spans\n const activities = new Map<string, boolean>();\n\n // We should not use heartbeat if we finished a span\n let _finished = false;\n\n // Timer that tracks idleTimeout\n let _idleTimeoutID: ReturnType<typeof setTimeout> | undefined;\n\n // Timer that tracks maxSpanTime for child spans\n let _childSpanTimeoutID: ReturnType<typeof setTimeout> | undefined;\n\n // The reason why the span was finished\n let _finishReason: IdleSpanFinishReason = FINISH_REASON_EXTERNAL_FINISH;\n\n let _autoFinishAllowed: boolean = !options.disableAutoFinish;\n\n const _cleanupHooks: (() => void)[] = [];\n\n const {\n idleTimeout = TRACING_DEFAULTS.idleTimeout,\n finalTimeout = TRACING_DEFAULTS.finalTimeout,\n childSpanTimeout = TRACING_DEFAULTS.childSpanTimeout,\n beforeSpanEnd,\n trimIdleSpanEndTimestamp = true,\n } = options;\n\n const client = getClient();\n\n if (!client || !hasSpansEnabled()) {\n const span = new SentryNonRecordingSpan();\n\n const dsc = {\n sample_rate: '0',\n sampled: 'false',\n ...getDynamicSamplingContextFromSpan(span),\n } satisfies Partial<DynamicSamplingContext>;\n freezeDscOnSpan(span, dsc);\n\n return span;\n }\n\n const scope = getCurrentScope();\n const previousActiveSpan = getActiveSpan();\n const span = _startIdleSpan(startSpanOptions);\n\n // We patch span.end to ensure we can run some things before the span is ended\n // eslint-disable-next-line @typescript-eslint/unbound-method\n span.end = new Proxy(span.end, {\n apply(target, thisArg, args: Parameters<Span['end']>) {\n if (beforeSpanEnd) {\n beforeSpanEnd(span);\n }\n\n // If the span is non-recording, nothing more to do here...\n // This is the case if tracing is enabled but this specific span was not sampled\n if (thisArg instanceof SentryNonRecordingSpan) {\n return;\n }\n\n // Just ensuring that this keeps working, even if we ever have more arguments here\n const [definedEndTimestamp, ...rest] = args;\n const timestamp = definedEndTimestamp || timestampInSeconds();\n const spanEndTimestamp = spanTimeInputToSeconds(timestamp);\n\n // Ensure we end with the last span timestamp, if possible\n const spans = getSpanDescendants(span).filter(child => child !== span);\n\n const spanJson = spanToJSON(span);\n\n // If we have no spans, we just end, nothing else to do here\n // Likewise, if users explicitly ended the span, we simply end the span without timestamp adjustment\n if (!spans.length || !trimIdleSpanEndTimestamp) {\n onIdleSpanEnded(spanEndTimestamp);\n return Reflect.apply(target, thisArg, [spanEndTimestamp, ...rest]);\n }\n\n const ignoreSpans = client.getOptions().ignoreSpans;\n\n const latestSpanEndTimestamp = spans?.reduce((acc: number | undefined, current) => {\n const currentSpanJson = spanToJSON(current);\n if (!currentSpanJson.timestamp) {\n return acc;\n }\n // Ignored spans will get dropped later (in the client) but since we already adjust\n // the idle span end timestamp here, we can already take to-be-ignored spans out of\n // the calculation here.\n if (\n ignoreSpans &&\n shouldIgnoreSpan(\n { description: currentSpanJson.description, op: currentSpanJson.op, attributes: currentSpanJson.data },\n ignoreSpans,\n )\n ) {\n return acc;\n }\n return acc ? Math.max(acc, currentSpanJson.timestamp) : currentSpanJson.timestamp;\n }, undefined);\n\n // In reality this should always exist here, but type-wise it may be undefined...\n const spanStartTimestamp = spanJson.start_timestamp;\n\n // The final endTimestamp should:\n // * Never be before the span start timestamp\n // * Be the latestSpanEndTimestamp, if there is one, and it is smaller than the passed span end timestamp\n // * Otherwise be the passed end timestamp\n // Final timestamp can never be after finalTimeout\n const endTimestamp = Math.min(\n spanStartTimestamp ? spanStartTimestamp + finalTimeout / 1000 : Infinity,\n Math.max(spanStartTimestamp || -Infinity, Math.min(spanEndTimestamp, latestSpanEndTimestamp || Infinity)),\n );\n\n onIdleSpanEnded(endTimestamp);\n return Reflect.apply(target, thisArg, [endTimestamp, ...rest]);\n },\n });\n\n /**\n * Cancels the existing idle timeout, if there is one.\n */\n function _cancelIdleTimeout(): void {\n if (_idleTimeoutID) {\n clearTimeout(_idleTimeoutID);\n _idleTimeoutID = undefined;\n }\n }\n\n /**\n * Cancels the existing child span timeout, if there is one.\n */\n function _cancelChildSpanTimeout(): void {\n if (_childSpanTimeoutID) {\n clearTimeout(_childSpanTimeoutID);\n _childSpanTimeoutID = undefined;\n }\n }\n\n /**\n * Restarts idle timeout, if there is no running idle timeout it will start one.\n */\n function _restartIdleTimeout(endTimestamp?: number): void {\n _cancelIdleTimeout();\n _idleTimeoutID = setTimeout(() => {\n if (!_finished && activities.size === 0 && _autoFinishAllowed) {\n _finishReason = FINISH_REASON_IDLE_TIMEOUT;\n span.end(endTimestamp);\n }\n }, idleTimeout);\n }\n\n /**\n * Restarts child span timeout, if there is none running it will start one.\n */\n function _restartChildSpanTimeout(endTimestamp?: number): void {\n _cancelChildSpanTimeout();\n _idleTimeoutID = setTimeout(() => {\n if (!_finished && _autoFinishAllowed) {\n _finishReason = FINISH_REASON_HEARTBEAT_FAILED;\n span.end(endTimestamp);\n }\n }, childSpanTimeout);\n }\n\n /**\n * Start tracking a specific activity.\n * @param spanId The span id that represents the activity\n */\n function _pushActivity(spanId: string): void {\n _cancelIdleTimeout();\n activities.set(spanId, true);\n\n const endTimestamp = timestampInSeconds();\n // We need to add the timeout here to have the real endtimestamp of the idle span\n // Remember timestampInSeconds is in seconds, timeout is in ms\n _restartChildSpanTimeout(endTimestamp + childSpanTimeout / 1000);\n }\n\n /**\n * Remove an activity from usage\n * @param spanId The span id that represents the activity\n */\n function _popActivity(spanId: string): void {\n if (activities.has(spanId)) {\n activities.delete(spanId);\n }\n\n if (activities.size === 0) {\n const endTimestamp = timestampInSeconds();\n // We need to add the timeout here to have the real endtimestamp of the idle span\n // Remember timestampInSeconds is in seconds, timeout is in ms\n _restartIdleTimeout(endTimestamp + idleTimeout / 1000);\n _cancelChildSpanTimeout();\n }\n }\n\n function onIdleSpanEnded(endTimestamp: number): void {\n _finished = true;\n activities.clear();\n\n _cleanupHooks.forEach(cleanup => cleanup());\n\n _setSpanForScope(scope, previousActiveSpan);\n\n const spanJSON = spanToJSON(span);\n\n const { start_timestamp: startTimestamp } = spanJSON;\n // This should never happen, but to make TS happy...\n if (!startTimestamp) {\n return;\n }\n\n const attributes = spanJSON.data;\n if (!attributes[SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON]) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, _finishReason);\n }\n\n // Set span status to 'ok' if it hasn't been explicitly set to an error status\n const currentStatus = spanJSON.status;\n if (!currentStatus || currentStatus === 'unknown') {\n span.setStatus({ code: SPAN_STATUS_OK });\n }\n\n debug.log(`[Tracing] Idle span \"${spanJSON.op}\" finished`);\n\n const childSpans = getSpanDescendants(span).filter(child => child !== span);\n\n let discardedSpans = 0;\n childSpans.forEach(childSpan => {\n // We cancel all pending spans with status \"cancelled\" to indicate the idle span was finished early\n if (childSpan.isRecording()) {\n childSpan.setStatus({ code: SPAN_STATUS_ERROR, message: 'cancelled' });\n childSpan.end(endTimestamp);\n DEBUG_BUILD &&\n debug.log('[Tracing] Cancelling span since span ended early', JSON.stringify(childSpan, undefined, 2));\n }\n\n const childSpanJSON = spanToJSON(childSpan);\n const { timestamp: childEndTimestamp = 0, start_timestamp: childStartTimestamp = 0 } = childSpanJSON;\n\n const spanStartedBeforeIdleSpanEnd = childStartTimestamp <= endTimestamp;\n\n // Add a delta with idle timeout so that we prevent false positives\n const timeoutWithMarginOfError = (finalTimeout + idleTimeout) / 1000;\n const spanEndedBeforeFinalTimeout = childEndTimestamp - childStartTimestamp <= timeoutWithMarginOfError;\n\n if (DEBUG_BUILD) {\n const stringifiedSpan = JSON.stringify(childSpan, undefined, 2);\n if (!spanStartedBeforeIdleSpanEnd) {\n debug.log('[Tracing] Discarding span since it happened after idle span was finished', stringifiedSpan);\n } else if (!spanEndedBeforeFinalTimeout) {\n debug.log('[Tracing] Discarding span since it finished after idle span final timeout', stringifiedSpan);\n }\n }\n\n if (!spanEndedBeforeFinalTimeout || !spanStartedBeforeIdleSpanEnd) {\n removeChildSpanFromSpan(span, childSpan);\n discardedSpans++;\n }\n });\n\n if (discardedSpans > 0) {\n span.setAttribute('sentry.idle_span_discarded_spans', discardedSpans);\n }\n }\n\n _cleanupHooks.push(\n client.on('spanStart', startedSpan => {\n // If we already finished the idle span,\n // or if this is the idle span itself being started,\n // or if the started span has already been closed,\n // we don't care about it for activity\n if (\n _finished ||\n startedSpan === span ||\n !!spanToJSON(startedSpan).timestamp ||\n (startedSpan instanceof SentrySpan && startedSpan.isStandaloneSpan())\n ) {\n return;\n }\n\n const allSpans = getSpanDescendants(span);\n\n // If the span that was just started is a child of the idle span, we should track it\n if (allSpans.includes(startedSpan)) {\n _pushActivity(startedSpan.spanContext().spanId);\n }\n }),\n );\n\n _cleanupHooks.push(\n client.on('spanEnd', endedSpan => {\n if (_finished) {\n return;\n }\n\n _popActivity(endedSpan.spanContext().spanId);\n }),\n );\n\n _cleanupHooks.push(\n client.on('idleSpanEnableAutoFinish', spanToAllowAutoFinish => {\n if (spanToAllowAutoFinish === span) {\n _autoFinishAllowed = true;\n _restartIdleTimeout();\n\n if (activities.size) {\n _restartChildSpanTimeout();\n }\n }\n }),\n );\n\n // We only start the initial idle timeout if we are not delaying the auto finish\n if (!options.disableAutoFinish) {\n _restartIdleTimeout();\n }\n\n setTimeout(() => {\n if (!_finished) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: 'deadline_exceeded' });\n _finishReason = FINISH_REASON_FINAL_TIMEOUT;\n span.end();\n }\n }, finalTimeout);\n\n return span;\n}\n\nfunction _startIdleSpan(options: StartSpanOptions): Span {\n const span = startInactiveSpan(options);\n\n _setSpanForScope(getCurrentScope(), span);\n\n DEBUG_BUILD && debug.log('[Tracing] Started span is an idle span');\n\n return span;\n}\n"],"names":["getClient","hasSpansEnabled","SentryNonRecordingSpan","getDynamicSamplingContextFromSpan","freezeDscOnSpan","getCurrentScope","getActiveSpan","timestampInSeconds","spanTimeInputToSeconds","getSpanDescendants","spanToJSON","shouldIgnoreSpan","_setSpanForScope","SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON","SPAN_STATUS_OK","debug","SPAN_STATUS_ERROR","DEBUG_BUILD","removeChildSpanFromSpan","SentrySpan","startInactiveSpan"],"mappings":";;;;;;;;;;;;;;;;;AAwBO,MAAM,mBAAmB;AAChC,EAAE,WAAW,EAAE,IAAK;AACpB,EAAE,YAAY,EAAE,KAAM;AACtB,EAAE,gBAAgB,EAAE,KAAM;AAC1B;;AAEA,MAAM,8BAAA,GAAiC,iBAAiB;AACxD,MAAM,0BAAA,GAA6B,aAAa;AAChD,MAAM,2BAAA,GAA8B,cAAc;AAClD,MAAM,6BAAA,GAAgC,gBAAgB;;AAwDtD;AACA;AACA;AACA;AACO,SAAS,aAAa,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E,OAAO,EAAE,mBAAA,EAAqB,CAAC;AAC/E,MAAM,aAAA,GAAgB,2BAA2B;AACjD,MAAM,IAAI,CAAC,GAAG,EAAE;AAChB,IAAI;AACJ,EAAE,CAAC,EAAE,YAAY,CAAC;;AAElB,EAAE,OAAO,IAAI;AACb;;AAEA,SAAS,cAAc,CAAC,OAAO,EAA0B;AACzD,EAAE,MAAM,IAAA,GAAOI,uBAAiB,CAAC,OAAO,CAAC;;AAEzC,EAAER,4BAAgB,CAACP,6BAAe,EAAE,EAAE,IAAI,CAAC;;AAE3C,EAAEY,0BAAeF,iBAAK,CAAC,GAAG,CAAC,wCAAwC,CAAC;;AAEpE,EAAE,OAAO,IAAI;AACb;;;;;"}
1
+ {"version":3,"file":"idleSpan.js","sources":["../../../src/tracing/idleSpan.ts"],"sourcesContent":["import { getClient, getCurrentScope } from '../currentScopes';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON } from '../semanticAttributes';\nimport type { DynamicSamplingContext } from '../types/envelope';\nimport type { Span } from '../types/span';\nimport type { StartSpanOptions } from '../types/startSpanOptions';\nimport { debug } from '../utils/debug-logger';\nimport { hasSpansEnabled } from '../utils/hasSpansEnabled';\nimport { shouldIgnoreSpan } from '../utils/should-ignore-span';\nimport { _setSpanForScope } from '../utils/spanOnScope';\nimport {\n getActiveSpan,\n getSpanDescendants,\n removeChildSpanFromSpan,\n spanTimeInputToSeconds,\n spanToJSON,\n} from '../utils/spanUtils';\nimport { timestampInSeconds } from '../utils/time';\nimport { freezeDscOnSpan, getDynamicSamplingContextFromSpan } from './dynamicSamplingContext';\nimport { SentryNonRecordingSpan } from './sentryNonRecordingSpan';\nimport { SentrySpan } from './sentrySpan';\nimport { SPAN_STATUS_ERROR, SPAN_STATUS_OK } from './spanstatus';\nimport { startInactiveSpan } from './trace';\n\nexport const TRACING_DEFAULTS = {\n idleTimeout: 1_000,\n finalTimeout: 30_000,\n childSpanTimeout: 15_000,\n};\n\nconst FINISH_REASON_HEARTBEAT_FAILED = 'heartbeatFailed';\nconst FINISH_REASON_IDLE_TIMEOUT = 'idleTimeout';\nconst FINISH_REASON_FINAL_TIMEOUT = 'finalTimeout';\nconst FINISH_REASON_EXTERNAL_FINISH = 'externalFinish';\nconst FINISH_REASON_CANCELLED = 'cancelled';\n\n// unused\nconst FINISH_REASON_DOCUMENT_HIDDEN = 'documentHidden';\n\n// unused in this file, but used in BrowserTracing\nconst FINISH_REASON_INTERRUPTED = 'interactionInterrupted';\n\ntype IdleSpanFinishReason =\n | typeof FINISH_REASON_CANCELLED\n | typeof FINISH_REASON_DOCUMENT_HIDDEN\n | typeof FINISH_REASON_EXTERNAL_FINISH\n | typeof FINISH_REASON_FINAL_TIMEOUT\n | typeof FINISH_REASON_HEARTBEAT_FAILED\n | typeof FINISH_REASON_IDLE_TIMEOUT\n | typeof FINISH_REASON_INTERRUPTED;\n\ninterface IdleSpanOptions {\n /**\n * The time that has to pass without any span being created.\n * If this time is exceeded, the idle span will finish.\n */\n idleTimeout: number;\n /**\n * The max. time an idle span may run.\n * If this time is exceeded, the idle span will finish no matter what.\n */\n finalTimeout: number;\n /**\n * The max. time a child span may run.\n * If the time since the last span was started exceeds this time, the idle span will finish.\n */\n childSpanTimeout?: number;\n /**\n * When set to `true`, will disable the idle timeout and child timeout\n * until the `idleSpanEnableAutoFinish` hook is emitted for the idle span.\n * The final timeout mechanism will not be affected by this option,\n * meaning the idle span will definitely be finished when the final timeout is\n * reached, no matter what this option is configured to.\n *\n * Defaults to `false`.\n */\n disableAutoFinish?: boolean;\n\n /** Allows to configure a hook that is called when the idle span is ended, before it is processed. */\n beforeSpanEnd?: (span: Span) => void;\n\n /**\n * If set to `true`, the idle span will be trimmed to the latest span end timestamp of its children.\n *\n * @default `true`.\n */\n trimIdleSpanEndTimestamp?: boolean;\n}\n\n/**\n * An idle span is a span that automatically finishes. It does this by tracking child spans as activities.\n * An idle span is always the active span.\n */\nexport function startIdleSpan(startSpanOptions: StartSpanOptions, options: Partial<IdleSpanOptions> = {}): Span {\n // Activities store a list of active spans\n const activities = new Map<string, boolean>();\n\n // We should not use heartbeat if we finished a span\n let _finished = false;\n\n // Timer that tracks idleTimeout\n let _idleTimeoutID: ReturnType<typeof setTimeout> | undefined;\n\n // Timer that tracks maxSpanTime for child spans\n let _childSpanTimeoutID: ReturnType<typeof setTimeout> | undefined;\n\n // The reason why the span was finished\n let _finishReason: IdleSpanFinishReason = FINISH_REASON_EXTERNAL_FINISH;\n\n let _autoFinishAllowed: boolean = !options.disableAutoFinish;\n\n const _cleanupHooks: (() => void)[] = [];\n\n const {\n idleTimeout = TRACING_DEFAULTS.idleTimeout,\n finalTimeout = TRACING_DEFAULTS.finalTimeout,\n childSpanTimeout = TRACING_DEFAULTS.childSpanTimeout,\n beforeSpanEnd,\n trimIdleSpanEndTimestamp = true,\n } = options;\n\n const client = getClient();\n\n if (!client || !hasSpansEnabled()) {\n const span = new SentryNonRecordingSpan();\n\n const dsc = {\n sample_rate: '0',\n sampled: 'false',\n ...getDynamicSamplingContextFromSpan(span),\n } satisfies Partial<DynamicSamplingContext>;\n freezeDscOnSpan(span, dsc);\n\n return span;\n }\n\n const scope = getCurrentScope();\n const previousActiveSpan = getActiveSpan();\n const span = _startIdleSpan(startSpanOptions);\n\n // We patch span.end to ensure we can run some things before the span is ended\n // eslint-disable-next-line @typescript-eslint/unbound-method\n span.end = new Proxy(span.end, {\n apply(target, thisArg, args: Parameters<Span['end']>) {\n if (beforeSpanEnd) {\n beforeSpanEnd(span);\n }\n\n // If the span is non-recording, nothing more to do here...\n // This is the case if tracing is enabled but this specific span was not sampled\n if (thisArg instanceof SentryNonRecordingSpan) {\n return;\n }\n\n // Just ensuring that this keeps working, even if we ever have more arguments here\n const [definedEndTimestamp, ...rest] = args;\n const timestamp = definedEndTimestamp || timestampInSeconds();\n const spanEndTimestamp = spanTimeInputToSeconds(timestamp);\n\n // Ensure we end with the last span timestamp, if possible\n const spans = getSpanDescendants(span).filter(child => child !== span);\n\n const spanJson = spanToJSON(span);\n\n // If we have no spans, we just end, nothing else to do here\n // Likewise, if users explicitly ended the span, we simply end the span without timestamp adjustment\n if (!spans.length || !trimIdleSpanEndTimestamp) {\n onIdleSpanEnded(spanEndTimestamp);\n return Reflect.apply(target, thisArg, [spanEndTimestamp, ...rest]);\n }\n\n const ignoreSpans = client.getOptions().ignoreSpans;\n\n const latestSpanEndTimestamp = spans?.reduce((acc: number | undefined, current) => {\n const currentSpanJson = spanToJSON(current);\n if (!currentSpanJson.timestamp) {\n return acc;\n }\n // Ignored spans will get dropped later (in the client) but since we already adjust\n // the idle span end timestamp here, we can already take to-be-ignored spans out of\n // the calculation here.\n if (\n ignoreSpans &&\n shouldIgnoreSpan(\n { description: currentSpanJson.description, op: currentSpanJson.op, attributes: currentSpanJson.data },\n ignoreSpans,\n )\n ) {\n return acc;\n }\n return acc ? Math.max(acc, currentSpanJson.timestamp) : currentSpanJson.timestamp;\n }, undefined);\n\n // In reality this should always exist here, but type-wise it may be undefined...\n const spanStartTimestamp = spanJson.start_timestamp;\n\n // The final endTimestamp should:\n // * Never be before the span start timestamp\n // * Be the latestSpanEndTimestamp, if there is one, and it is smaller than the passed span end timestamp\n // * Otherwise be the passed end timestamp\n // Final timestamp can never be after finalTimeout\n const endTimestamp = Math.min(\n spanStartTimestamp ? spanStartTimestamp + finalTimeout / 1000 : Infinity,\n Math.max(spanStartTimestamp || -Infinity, Math.min(spanEndTimestamp, latestSpanEndTimestamp || Infinity)),\n );\n\n onIdleSpanEnded(endTimestamp);\n return Reflect.apply(target, thisArg, [endTimestamp, ...rest]);\n },\n });\n\n /**\n * Cancels the existing idle timeout, if there is one.\n */\n function _cancelIdleTimeout(): void {\n if (_idleTimeoutID) {\n clearTimeout(_idleTimeoutID);\n _idleTimeoutID = undefined;\n }\n }\n\n /**\n * Cancels the existing child span timeout, if there is one.\n */\n function _cancelChildSpanTimeout(): void {\n if (_childSpanTimeoutID) {\n clearTimeout(_childSpanTimeoutID);\n _childSpanTimeoutID = undefined;\n }\n }\n\n /**\n * Restarts idle timeout, if there is no running idle timeout it will start one.\n */\n function _restartIdleTimeout(endTimestamp?: number): void {\n _cancelIdleTimeout();\n _idleTimeoutID = setTimeout(() => {\n if (!_finished && activities.size === 0 && _autoFinishAllowed) {\n _finishReason = FINISH_REASON_IDLE_TIMEOUT;\n span.end(endTimestamp);\n }\n }, idleTimeout);\n }\n\n /**\n * Restarts child span timeout, if there is none running it will start one.\n */\n function _restartChildSpanTimeout(endTimestamp?: number): void {\n _cancelChildSpanTimeout();\n _idleTimeoutID = setTimeout(() => {\n if (!_finished && _autoFinishAllowed) {\n _finishReason = FINISH_REASON_HEARTBEAT_FAILED;\n span.end(endTimestamp);\n }\n }, childSpanTimeout);\n }\n\n /**\n * Start tracking a specific activity.\n * @param spanId The span id that represents the activity\n */\n function _pushActivity(spanId: string): void {\n _cancelIdleTimeout();\n activities.set(spanId, true);\n\n const endTimestamp = timestampInSeconds();\n // We need to add the timeout here to have the real endtimestamp of the idle span\n // Remember timestampInSeconds is in seconds, timeout is in ms\n _restartChildSpanTimeout(endTimestamp + childSpanTimeout / 1000);\n }\n\n /**\n * Remove an activity from usage\n * @param spanId The span id that represents the activity\n */\n function _popActivity(spanId: string): void {\n if (activities.has(spanId)) {\n activities.delete(spanId);\n }\n\n if (activities.size === 0) {\n const endTimestamp = timestampInSeconds();\n // We need to add the timeout here to have the real endtimestamp of the idle span\n // Remember timestampInSeconds is in seconds, timeout is in ms\n _restartIdleTimeout(endTimestamp + idleTimeout / 1000);\n _cancelChildSpanTimeout();\n }\n }\n\n function onIdleSpanEnded(endTimestamp: number): void {\n _finished = true;\n activities.clear();\n\n _cleanupHooks.forEach(cleanup => cleanup());\n\n _setSpanForScope(scope, previousActiveSpan);\n\n const spanJSON = spanToJSON(span);\n\n const { start_timestamp: startTimestamp } = spanJSON;\n // This should never happen, but to make TS happy...\n if (!startTimestamp) {\n return;\n }\n\n const attributes = spanJSON.data;\n if (!attributes[SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON]) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, _finishReason);\n }\n\n // Set span status to 'ok' if it hasn't been explicitly set to an error status\n const currentStatus = spanJSON.status;\n if (!currentStatus || currentStatus === 'unknown') {\n span.setStatus({ code: SPAN_STATUS_OK });\n }\n\n debug.log(`[Tracing] Idle span \"${spanJSON.op}\" finished`);\n\n const childSpans = getSpanDescendants(span).filter(child => child !== span);\n\n let discardedSpans = 0;\n childSpans.forEach(childSpan => {\n // We cancel all pending spans with status \"cancelled\" to indicate the idle span was finished early\n if (childSpan.isRecording()) {\n childSpan.setStatus({ code: SPAN_STATUS_ERROR, message: 'cancelled' });\n childSpan.end(endTimestamp);\n DEBUG_BUILD &&\n debug.log('[Tracing] Cancelling span since span ended early', JSON.stringify(childSpan, undefined, 2));\n }\n\n const childSpanJSON = spanToJSON(childSpan);\n const { timestamp: childEndTimestamp = 0, start_timestamp: childStartTimestamp = 0 } = childSpanJSON;\n\n const spanStartedBeforeIdleSpanEnd = childStartTimestamp <= endTimestamp;\n\n // Add a delta with idle timeout so that we prevent false positives\n const timeoutWithMarginOfError = (finalTimeout + idleTimeout) / 1000;\n const spanEndedBeforeFinalTimeout = childEndTimestamp - childStartTimestamp <= timeoutWithMarginOfError;\n\n if (DEBUG_BUILD) {\n const stringifiedSpan = JSON.stringify(childSpan, undefined, 2);\n if (!spanStartedBeforeIdleSpanEnd) {\n debug.log('[Tracing] Discarding span since it happened after idle span was finished', stringifiedSpan);\n } else if (!spanEndedBeforeFinalTimeout) {\n debug.log('[Tracing] Discarding span since it finished after idle span final timeout', stringifiedSpan);\n }\n }\n\n if (!spanEndedBeforeFinalTimeout || !spanStartedBeforeIdleSpanEnd) {\n removeChildSpanFromSpan(span, childSpan);\n discardedSpans++;\n }\n });\n\n if (discardedSpans > 0) {\n span.setAttribute('sentry.idle_span_discarded_spans', discardedSpans);\n }\n }\n\n _cleanupHooks.push(\n client.on('spanStart', startedSpan => {\n // If we already finished the idle span,\n // or if this is the idle span itself being started,\n // or if the started span has already been closed,\n // we don't care about it for activity\n if (\n _finished ||\n startedSpan === span ||\n !!spanToJSON(startedSpan).timestamp ||\n (startedSpan instanceof SentrySpan && startedSpan.isStandaloneSpan())\n ) {\n return;\n }\n\n const allSpans = getSpanDescendants(span);\n\n // If the span that was just started is a child of the idle span, we should track it\n if (allSpans.includes(startedSpan)) {\n _pushActivity(startedSpan.spanContext().spanId);\n }\n }),\n );\n\n _cleanupHooks.push(\n client.on('spanEnd', endedSpan => {\n if (_finished) {\n return;\n }\n\n _popActivity(endedSpan.spanContext().spanId);\n }),\n );\n\n _cleanupHooks.push(\n client.on('idleSpanEnableAutoFinish', spanToAllowAutoFinish => {\n if (spanToAllowAutoFinish === span) {\n _autoFinishAllowed = true;\n _restartIdleTimeout();\n\n if (activities.size) {\n _restartChildSpanTimeout();\n }\n }\n }),\n );\n\n // We only start the initial idle timeout if we are not delaying the auto finish\n if (!options.disableAutoFinish) {\n _restartIdleTimeout();\n }\n\n setTimeout(() => {\n if (!_finished) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: 'deadline_exceeded' });\n _finishReason = FINISH_REASON_FINAL_TIMEOUT;\n span.end();\n }\n }, finalTimeout);\n\n return span;\n}\n\nfunction _startIdleSpan(options: StartSpanOptions): Span {\n const span = startInactiveSpan(options);\n\n _setSpanForScope(getCurrentScope(), span);\n\n DEBUG_BUILD && debug.log('[Tracing] Started span is an idle span');\n\n return span;\n}\n"],"names":["getClient","hasSpansEnabled","span","SentryNonRecordingSpan","getDynamicSamplingContextFromSpan","freezeDscOnSpan","getCurrentScope","getActiveSpan","timestampInSeconds","spanTimeInputToSeconds","getSpanDescendants","spanToJSON","shouldIgnoreSpan","_setSpanForScope","SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON","SPAN_STATUS_OK","debug","SPAN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Property(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
- const LANGCHAIN_INTEGRATION_NAME = 'LangChain';
4
- const LANGCHAIN_ORIGIN = 'auto.ai.langchain';
5
-
3
+ const LANGCHAIN_INTEGRATION_NAME = "LangChain";
4
+ const LANGCHAIN_ORIGIN = "auto.ai.langchain";
6
5
  const ROLE_MAP = {
7
- human: 'user',
8
- ai: 'assistant',
9
- assistant: 'assistant',
10
- system: 'system',
11
- function: 'function',
12
- tool: 'tool',
6
+ human: "user",
7
+ ai: "assistant",
8
+ assistant: "assistant",
9
+ system: "system",
10
+ function: "function",
11
+ tool: "tool"
13
12
  };
14
13
 
15
14
  exports.LANGCHAIN_INTEGRATION_NAME = LANGCHAIN_INTEGRATION_NAME;
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../src/tracing/langchain/constants.ts"],"sourcesContent":["export const LANGCHAIN_INTEGRATION_NAME = 'LangChain';\nexport const LANGCHAIN_ORIGIN = 'auto.ai.langchain';\n\nexport const ROLE_MAP: Record<string, string> = {\n human: 'user',\n ai: 'assistant',\n assistant: 'assistant',\n system: 'system',\n function: 'function',\n tool: 'tool',\n};\n"],"names":[],"mappings":";;AAAO,MAAM,0BAAA,GAA6B;AACnC,MAAM,gBAAA,GAAmB;;AAEzB,MAAM,QAAQ,GAA2B;AAChD,EAAE,KAAK,EAAE,MAAM;AACf,EAAE,EAAE,EAAE,WAAW;AACjB,EAAE,SAAS,EAAE,WAAW;AACxB,EAAE,MAAM,EAAE,QAAQ;AAClB,EAAE,QAAQ,EAAE,UAAU;AACtB,EAAE,IAAI,EAAE,MAAM;AACd;;;;;;"}
1
+ {"version":3,"file":"constants.js","sources":["../../../../src/tracing/langchain/constants.ts"],"sourcesContent":["export const LANGCHAIN_INTEGRATION_NAME = 'LangChain';\nexport const LANGCHAIN_ORIGIN = 'auto.ai.langchain';\n\nexport const ROLE_MAP: Record<string, string> = {\n human: 'user',\n ai: 'assistant',\n assistant: 'assistant',\n system: 'system',\n function: 'function',\n tool: 'tool',\n};\n"],"names":[],"mappings":";;AAAO,MAAM,0BAAA,GAA6B;AACnC,MAAM,gBAAA,GAAmB;AAEzB,MAAM,QAAA,GAAmC;AAAA,EAC9C,KAAA,EAAO,MAAA;AAAA,EACP,EAAA,EAAI,WAAA;AAAA,EACJ,SAAA,EAAW,WAAA;AAAA,EACX,MAAA,EAAQ,QAAA;AAAA,EACR,QAAA,EAAU,UAAA;AAAA,EACV,IAAA,EAAM;AACR;;;;;;"}
@@ -7,123 +7,79 @@ const genAiAttributes = require('../ai/gen-ai-attributes.js');
7
7
  const utils = require('../ai/utils.js');
8
8
  const constants = require('./constants.js');
9
9
 
10
- /**
11
- * Infers the AI provider system name from the embedding class instance.
12
- */
13
10
  function inferSystemFromInstance(instance) {
14
- const name = (instance.constructor )?.name ?? '';
15
- if (name.includes('OpenAI')) return 'openai';
16
- if (name.includes('Google')) return 'google_genai';
17
- if (name.includes('Mistral')) return 'mistralai';
18
- if (name.includes('Vertex')) return 'google_vertexai';
19
- if (name.includes('Bedrock')) return 'aws_bedrock';
20
- if (name.includes('Ollama')) return 'ollama';
21
- if (name.includes('Cloudflare')) return 'cloudflare';
22
- if (name.includes('Cohere')) return 'cohere';
23
- return 'langchain';
11
+ const name = instance.constructor?.name ?? "";
12
+ if (name.includes("OpenAI")) return "openai";
13
+ if (name.includes("Google")) return "google_genai";
14
+ if (name.includes("Mistral")) return "mistralai";
15
+ if (name.includes("Vertex")) return "google_vertexai";
16
+ if (name.includes("Bedrock")) return "aws_bedrock";
17
+ if (name.includes("Ollama")) return "ollama";
18
+ if (name.includes("Cloudflare")) return "cloudflare";
19
+ if (name.includes("Cohere")) return "cohere";
20
+ return "langchain";
24
21
  }
25
-
26
- /**
27
- * Extracts span attributes from a LangChain embedding class instance.
28
- */
29
22
  function extractEmbeddingAttributes(instance) {
30
- const embeddingsInstance = (instance ?? {}) ;
31
-
23
+ const embeddingsInstance = instance ?? {};
32
24
  const attributes = {
33
25
  [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: constants.LANGCHAIN_ORIGIN,
34
26
  [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP]: genAiAttributes.GEN_AI_EMBEDDINGS_OPERATION_ATTRIBUTE,
35
- [genAiAttributes.GEN_AI_OPERATION_NAME_ATTRIBUTE]: 'embeddings',
36
- [genAiAttributes.GEN_AI_REQUEST_MODEL_ATTRIBUTE]: embeddingsInstance.model ?? 'unknown',
27
+ [genAiAttributes.GEN_AI_OPERATION_NAME_ATTRIBUTE]: "embeddings",
28
+ [genAiAttributes.GEN_AI_REQUEST_MODEL_ATTRIBUTE]: embeddingsInstance.model ?? "unknown"
37
29
  };
38
-
39
30
  attributes[genAiAttributes.GEN_AI_SYSTEM_ATTRIBUTE] = inferSystemFromInstance(embeddingsInstance);
40
- if ('dimensions' in embeddingsInstance) {
31
+ if ("dimensions" in embeddingsInstance) {
41
32
  attributes[genAiAttributes.GEN_AI_REQUEST_DIMENSIONS_ATTRIBUTE] = embeddingsInstance.dimensions;
42
33
  }
43
- if ('encodingFormat' in embeddingsInstance) {
34
+ if ("encodingFormat" in embeddingsInstance) {
44
35
  attributes[genAiAttributes.GEN_AI_REQUEST_ENCODING_FORMAT_ATTRIBUTE] = embeddingsInstance.encodingFormat;
45
36
  }
46
-
47
37
  return attributes;
48
38
  }
49
-
50
- /**
51
- * Wraps a LangChain embedding method (embedQuery or embedDocuments) to create Sentry spans.
52
- *
53
- * Used internally by the Node.js auto-instrumentation to patch embedding class prototypes.
54
- */
55
- function instrumentEmbeddingMethod(
56
- originalMethod,
57
- options = {},
58
- ) {
39
+ function instrumentEmbeddingMethod(originalMethod, options = {}) {
59
40
  const { recordInputs } = utils.resolveAIRecordingOptions(options);
60
-
61
41
  return new Proxy(originalMethod, {
62
42
  apply(target, thisArg, args) {
63
43
  const attributes = extractEmbeddingAttributes(thisArg);
64
- const modelName = attributes[genAiAttributes.GEN_AI_REQUEST_MODEL_ATTRIBUTE] || 'unknown';
65
-
44
+ const modelName = attributes[genAiAttributes.GEN_AI_REQUEST_MODEL_ATTRIBUTE] || "unknown";
66
45
  if (recordInputs) {
67
46
  const input = args[0];
68
47
  if (input != null) {
69
- attributes[genAiAttributes.GEN_AI_EMBEDDINGS_INPUT_ATTRIBUTE] = typeof input === 'string' ? input : JSON.stringify(input);
48
+ attributes[genAiAttributes.GEN_AI_EMBEDDINGS_INPUT_ATTRIBUTE] = typeof input === "string" ? input : JSON.stringify(input);
70
49
  }
71
50
  }
72
-
73
51
  return trace.startSpan(
74
52
  {
75
53
  name: `embeddings ${modelName}`,
76
54
  op: genAiAttributes.GEN_AI_EMBEDDINGS_OPERATION_ATTRIBUTE,
77
- attributes: attributes ,
55
+ attributes
78
56
  },
79
57
  () => {
80
- return Reflect.apply(target, thisArg, args).then(undefined, error => {
58
+ return Reflect.apply(target, thisArg, args).then(void 0, (error) => {
81
59
  exports$1.captureException(error, {
82
- mechanism: { handled: false, type: 'auto.ai.langchain' },
60
+ mechanism: { handled: false, type: "auto.ai.langchain" }
83
61
  });
84
62
  throw error;
85
63
  });
86
- },
64
+ }
87
65
  );
88
- },
89
- }) ;
66
+ }
67
+ });
90
68
  }
91
-
92
- /**
93
- * Wraps a LangChain embeddings instance to create Sentry spans for `embedQuery` and `embedDocuments` calls.
94
- *
95
- * Use this in non-Node runtimes (Cloudflare, browser, etc.) where auto-instrumentation is not available.
96
- *
97
- * @example
98
- * ```javascript
99
- * import * as Sentry from '@sentry/cloudflare';
100
- * import { OpenAIEmbeddings } from '@langchain/openai';
101
- *
102
- * const embeddings = Sentry.instrumentLangChainEmbeddings(
103
- * new OpenAIEmbeddings({ model: 'text-embedding-3-small' })
104
- * );
105
- *
106
- * await embeddings.embedQuery('Hello world');
107
- * await embeddings.embedDocuments(['doc1', 'doc2']);
108
- * ```
109
- */
110
69
  function instrumentLangChainEmbeddings(instance, options) {
111
- const embeddingsInstance = instance ;
112
-
113
- if (typeof embeddingsInstance.embedQuery === 'function') {
70
+ const embeddingsInstance = instance;
71
+ if (typeof embeddingsInstance.embedQuery === "function") {
114
72
  embeddingsInstance.embedQuery = instrumentEmbeddingMethod(
115
- embeddingsInstance.embedQuery ,
116
- options,
73
+ embeddingsInstance.embedQuery,
74
+ options
117
75
  );
118
76
  }
119
-
120
- if (typeof embeddingsInstance.embedDocuments === 'function') {
77
+ if (typeof embeddingsInstance.embedDocuments === "function") {
121
78
  embeddingsInstance.embedDocuments = instrumentEmbeddingMethod(
122
- embeddingsInstance.embedDocuments ,
123
- options,
79
+ embeddingsInstance.embedDocuments,
80
+ options
124
81
  );
125
82
  }
126
-
127
83
  return instance;
128
84
  }
129
85
 
@@ -1 +1 @@
1
- {"version":3,"file":"embeddings.js","sources":["../../../../src/tracing/langchain/embeddings.ts"],"sourcesContent":["import { captureException } from '../../exports';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '../../semanticAttributes';\nimport { startSpan } from '../../tracing/trace';\nimport type { SpanAttributeValue } from '../../types-hoist/span';\nimport {\n GEN_AI_EMBEDDINGS_OPERATION_ATTRIBUTE,\n GEN_AI_EMBEDDINGS_INPUT_ATTRIBUTE,\n GEN_AI_OPERATION_NAME_ATTRIBUTE,\n GEN_AI_REQUEST_DIMENSIONS_ATTRIBUTE,\n GEN_AI_REQUEST_ENCODING_FORMAT_ATTRIBUTE,\n GEN_AI_REQUEST_MODEL_ATTRIBUTE,\n GEN_AI_SYSTEM_ATTRIBUTE,\n} from '../ai/gen-ai-attributes';\nimport { resolveAIRecordingOptions } from '../ai/utils';\nimport { LANGCHAIN_ORIGIN } from './constants';\nimport type { LangChainOptions } from './types';\n\n/**\n * Infers the AI provider system name from the embedding class instance.\n */\nfunction inferSystemFromInstance(instance: Record<string, unknown>): string {\n const name = (instance.constructor as { name?: string })?.name ?? '';\n if (name.includes('OpenAI')) return 'openai';\n if (name.includes('Google')) return 'google_genai';\n if (name.includes('Mistral')) return 'mistralai';\n if (name.includes('Vertex')) return 'google_vertexai';\n if (name.includes('Bedrock')) return 'aws_bedrock';\n if (name.includes('Ollama')) return 'ollama';\n if (name.includes('Cloudflare')) return 'cloudflare';\n if (name.includes('Cohere')) return 'cohere';\n return 'langchain';\n}\n\n/**\n * Extracts span attributes from a LangChain embedding class instance.\n */\nfunction extractEmbeddingAttributes(instance: unknown): Record<string, unknown> {\n const embeddingsInstance = (instance ?? {}) as Record<string, unknown>;\n\n const attributes: Record<string, unknown> = {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: LANGCHAIN_ORIGIN,\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: GEN_AI_EMBEDDINGS_OPERATION_ATTRIBUTE,\n [GEN_AI_OPERATION_NAME_ATTRIBUTE]: 'embeddings',\n [GEN_AI_REQUEST_MODEL_ATTRIBUTE]: embeddingsInstance.model ?? 'unknown',\n };\n\n attributes[GEN_AI_SYSTEM_ATTRIBUTE] = inferSystemFromInstance(embeddingsInstance);\n if ('dimensions' in embeddingsInstance) {\n attributes[GEN_AI_REQUEST_DIMENSIONS_ATTRIBUTE] = embeddingsInstance.dimensions;\n }\n if ('encodingFormat' in embeddingsInstance) {\n attributes[GEN_AI_REQUEST_ENCODING_FORMAT_ATTRIBUTE] = embeddingsInstance.encodingFormat;\n }\n\n return attributes;\n}\n\n/**\n * Wraps a LangChain embedding method (embedQuery or embedDocuments) to create Sentry spans.\n *\n * Used internally by the Node.js auto-instrumentation to patch embedding class prototypes.\n */\nexport function instrumentEmbeddingMethod(\n originalMethod: (...args: unknown[]) => Promise<unknown>,\n options: LangChainOptions = {},\n): (...args: unknown[]) => Promise<unknown> {\n const { recordInputs } = resolveAIRecordingOptions(options);\n\n return new Proxy(originalMethod, {\n apply(target, thisArg, args: unknown[]): Promise<unknown> {\n const attributes = extractEmbeddingAttributes(thisArg);\n const modelName = attributes[GEN_AI_REQUEST_MODEL_ATTRIBUTE] || 'unknown';\n\n if (recordInputs) {\n const input = args[0];\n if (input != null) {\n attributes[GEN_AI_EMBEDDINGS_INPUT_ATTRIBUTE] = typeof input === 'string' ? input : JSON.stringify(input);\n }\n }\n\n return startSpan(\n {\n name: `embeddings ${modelName}`,\n op: GEN_AI_EMBEDDINGS_OPERATION_ATTRIBUTE,\n attributes: attributes as Record<string, SpanAttributeValue>,\n },\n () => {\n return Reflect.apply(target, thisArg, args).then(undefined, error => {\n captureException(error, {\n mechanism: { handled: false, type: 'auto.ai.langchain' },\n });\n throw error;\n });\n },\n );\n },\n }) as (...args: unknown[]) => Promise<unknown>;\n}\n\n/**\n * Wraps a LangChain embeddings instance to create Sentry spans for `embedQuery` and `embedDocuments` calls.\n *\n * Use this in non-Node runtimes (Cloudflare, browser, etc.) where auto-instrumentation is not available.\n *\n * @example\n * ```javascript\n * import * as Sentry from '@sentry/cloudflare';\n * import { OpenAIEmbeddings } from '@langchain/openai';\n *\n * const embeddings = Sentry.instrumentLangChainEmbeddings(\n * new OpenAIEmbeddings({ model: 'text-embedding-3-small' })\n * );\n *\n * await embeddings.embedQuery('Hello world');\n * await embeddings.embedDocuments(['doc1', 'doc2']);\n * ```\n */\nexport function instrumentLangChainEmbeddings<T extends object>(instance: T, options?: LangChainOptions): T {\n const embeddingsInstance = instance as Record<string, unknown>;\n\n if (typeof embeddingsInstance.embedQuery === 'function') {\n embeddingsInstance.embedQuery = instrumentEmbeddingMethod(\n embeddingsInstance.embedQuery as (...args: unknown[]) => Promise<unknown>,\n options,\n );\n }\n\n if (typeof embeddingsInstance.embedDocuments === 'function') {\n embeddingsInstance.embedDocuments = instrumentEmbeddingMethod(\n embeddingsInstance.embedDocuments as (...args: unknown[]) => Promise<unknown>,\n options,\n );\n }\n\n return instance;\n}\n"],"names":["SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","LANGCHAIN_ORIGIN","SEMANTIC_ATTRIBUTE_SENTRY_OP","GEN_AI_EMBEDDINGS_OPERATION_ATTRIBUTE","GEN_AI_OPERATION_NAME_ATTRIBUT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CAAA;AACA,UAAA,EAAA,EAAAR,qDAAA;AACA,UAAA,UAAA,EAAA,UAAA;AACA,SAAA;AACA,QAAA,MAAA;AACA,UAAA,OAAA,OAAA,CAAA,KAAA,CAAA,MAAA,EAAA,OAAA,EAAA,IAAA,CAAA,CAAA,IAAA,CAAA,SAAA,EAAA,KAAA,IAAA;AACA,YAAAS,0BAAA,CAAA,KAAA,EAAA;AACA,cAAA,SAAA,EAAA,EAAA,OAAA,EAAA,KAAA,EAAA,IAAA,EAAA,mBAAA,EAAA;AACA,aAAA,CAAA;AACA,YAAA,MAAA,KAAA;AACA,UAAA,CAAA,CAAA;AACA,QAAA,CAAA;AACA,OAAA;AACA,IAAA,CAAA;AACA,GAAA,CAAA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,6BAAA,CAAA,QAAA,EAAA,OAAA,EAAA;AACA,EAAA,MAAA,kBAAA,GAAA,QAAA;;AAEA,EAAA,IAAA,OAAA,kBAAA,CAAA,UAAA,KAAA,UAAA,EAAA;AACA,IAAA,kBAAA,CAAA,UAAA,GAAA,yBAAA;AACA,MAAA,kBAAA,CAAA,UAAA;AACA,MAAA,OAAA;AACA,KAAA;AACA,EAAA;;AAEA,EAAA,IAAA,OAAA,kBAAA,CAAA,cAAA,KAAA,UAAA,EAAA;AACA,IAAA,kBAAA,CAAA,cAAA,GAAA,yBAAA;AACA,MAAA,kBAAA,CAAA,cAAA;AACA,MAAA,OAAA;AACA,KAAA;AACA,EAAA;;AAEA,EAAA,OAAA,QAAA;AACA;;;;;"}
1
+ {"version":3,"file":"embeddings.js","sources":["../../../../src/tracing/langchain/embeddings.ts"],"sourcesContent":["import { captureException } from '../../exports';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '../../semanticAttributes';\nimport { startSpan } from '../../tracing/trace';\nimport type { SpanAttributeValue } from '../../types/span';\nimport {\n GEN_AI_EMBEDDINGS_OPERATION_ATTRIBUTE,\n GEN_AI_EMBEDDINGS_INPUT_ATTRIBUTE,\n GEN_AI_OPERATION_NAME_ATTRIBUTE,\n GEN_AI_REQUEST_DIMENSIONS_ATTRIBUTE,\n GEN_AI_REQUEST_ENCODING_FORMAT_ATTRIBUTE,\n GEN_AI_REQUEST_MODEL_ATTRIBUTE,\n GEN_AI_SYSTEM_ATTRIBUTE,\n} from '../ai/gen-ai-attributes';\nimport { resolveAIRecordingOptions } from '../ai/utils';\nimport { LANGCHAIN_ORIGIN } from './constants';\nimport type { LangChainOptions } from './types';\n\n/**\n * Infers the AI provider system name from the embedding class instance.\n */\nfunction inferSystemFromInstance(instance: Record<string, unknown>): string {\n const name = (instance.constructor as { name?: string })?.name ?? '';\n if (name.includes('OpenAI')) return 'openai';\n if (name.includes('Google')) return 'google_genai';\n if (name.includes('Mistral')) return 'mistralai';\n if (name.includes('Vertex')) return 'google_vertexai';\n if (name.includes('Bedrock')) return 'aws_bedrock';\n if (name.includes('Ollama')) return 'ollama';\n if (name.includes('Cloudflare')) return 'cloudflare';\n if (name.includes('Cohere')) return 'cohere';\n return 'langchain';\n}\n\n/**\n * Extracts span attributes from a LangChain embedding class instance.\n */\nfunction extractEmbeddingAttributes(instance: unknown): Record<string, unknown> {\n const embeddingsInstance = (instance ?? {}) as Record<string, unknown>;\n\n const attributes: Record<string, unknown> = {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: LANGCHAIN_ORIGIN,\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: GEN_AI_EMBEDDINGS_OPERATION_ATTRIBUTE,\n [GEN_AI_OPERATION_NAME_ATTRIBUTE]: 'embeddings',\n [GEN_AI_REQUEST_MODEL_ATTRIBUTE]: embeddingsInstance.model ?? 'unknown',\n };\n\n attributes[GEN_AI_SYSTEM_ATTRIBUTE] = inferSystemFromInstance(embeddingsInstance);\n if ('dimensions' in embeddingsInstance) {\n attributes[GEN_AI_REQUEST_DIMENSIONS_ATTRIBUTE] = embeddingsInstance.dimensions;\n }\n if ('encodingFormat' in embeddingsInstance) {\n attributes[GEN_AI_REQUEST_ENCODING_FORMAT_ATTRIBUTE] = embeddingsInstance.encodingFormat;\n }\n\n return attributes;\n}\n\n/**\n * Wraps a LangChain embedding method (embedQuery or embedDocuments) to create Sentry spans.\n *\n * Used internally by the Node.js auto-instrumentation to patch embedding class prototypes.\n */\nexport function instrumentEmbeddingMethod(\n originalMethod: (...args: unknown[]) => Promise<unknown>,\n options: LangChainOptions = {},\n): (...args: unknown[]) => Promise<unknown> {\n const { recordInputs } = resolveAIRecordingOptions(options);\n\n return new Proxy(originalMethod, {\n apply(target, thisArg, args: unknown[]): Promise<unknown> {\n const attributes = extractEmbeddingAttributes(thisArg);\n const modelName = attributes[GEN_AI_REQUEST_MODEL_ATTRIBUTE] || 'unknown';\n\n if (recordInputs) {\n const input = args[0];\n if (input != null) {\n attributes[GEN_AI_EMBEDDINGS_INPUT_ATTRIBUTE] = typeof input === 'string' ? input : JSON.stringify(input);\n }\n }\n\n return startSpan(\n {\n name: `embeddings ${modelName}`,\n op: GEN_AI_EMBEDDINGS_OPERATION_ATTRIBUTE,\n attributes: attributes as Record<string, SpanAttributeValue>,\n },\n () => {\n return Reflect.apply(target, thisArg, args).then(undefined, error => {\n captureException(error, {\n mechanism: { handled: false, type: 'auto.ai.langchain' },\n });\n throw error;\n });\n },\n );\n },\n }) as (...args: unknown[]) => Promise<unknown>;\n}\n\n/**\n * Wraps a LangChain embeddings instance to create Sentry spans for `embedQuery` and `embedDocuments` calls.\n *\n * Use this in non-Node runtimes (Cloudflare, browser, etc.) where auto-instrumentation is not available.\n *\n * @example\n * ```javascript\n * import * as Sentry from '@sentry/cloudflare';\n * import { OpenAIEmbeddings } from '@langchain/openai';\n *\n * const embeddings = Sentry.instrumentLangChainEmbeddings(\n * new OpenAIEmbeddings({ model: 'text-embedding-3-small' })\n * );\n *\n * await embeddings.embedQuery('Hello world');\n * await embeddings.embedDocuments(['doc1', 'doc2']);\n * ```\n */\nexport function instrumentLangChainEmbeddings<T extends object>(instance: T, options?: LangChainOptions): T {\n const embeddingsInstance = instance as Record<string, unknown>;\n\n if (typeof embeddingsInstance.embedQuery === 'function') {\n embeddingsInstance.embedQuery = instrumentEmbeddingMethod(\n embeddingsInstance.embedQuery as (...args: unknown[]) => Promise<unknown>,\n options,\n );\n }\n\n if (typeof embeddingsInstance.embedDocuments === 'function') {\n embeddingsInstance.embedDocuments = instrumentEmbeddingMethod(\n embeddingsInstance.embedDocuments as (...args: unknown[]) => Promise<unknown>,\n options,\n );\n }\n\n return instance;\n}\n"],"names":["SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","LANGCHAIN_ORIGIN","SEMANTIC_ATTRIBUTE_SENTRY_OP","GEN_AI_EMBEDDINGS_OPERATION_ATTRIBUTE","GEN_AI_OPERATION_NAME_ATTRIBUTE","GEN_AI_REQUEST_MODEL_ATTRIBUTE","GEN_AI_SYSTEM_ATTRIBUTE","GEN_AI_REQUEST_DIMENSIONS_ATTRIBUTE","GEN_AI_REQUEST_ENCODING_FORMAT_ATTRIBUTE","resolveAIRecordingOptions","GEN_AI_EMBEDDINGS_INPUT_ATTRIBUTE","startSpan","captureException"],"mappings":";;;;;;;;;AAoBA,SAAS,wBAAwB,QAAA,EAA2C;AAC1E,EAAA,MAAM,IAAA,GAAQ,QAAA,CAAS,WAAA,EAAmC,IAAA,IAAQ,EAAA;AAClE,EAAA,IAAI,IAAA,CAAK,QAAA,CAAS,QAAQ,CAAA,EAAG,OAAO,QAAA;AACpC,EAAA,IAAI,IAAA,CAAK,QAAA,CAAS,QAAQ,CAAA,EAAG,OAAO,cAAA;AACpC,EAAA,IAAI,IAAA,CAAK,QAAA,CAAS,SAAS,CAAA,EAAG,OAAO,WAAA;AACrC,EAAA,IAAI,IAAA,CAAK,QAAA,CAAS,QAAQ,CAAA,EAAG,OAAO,iBAAA;AACpC,EAAA,IAAI,I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