@sentry/cloudflare 11.12.0 → 11.14.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 (618) hide show
  1. package/build/cjs/dev/_virtual/_rolldown/runtime.js +22 -0
  2. package/build/cjs/dev/baseSdk.js +98 -103
  3. package/build/cjs/dev/baseSdk.js.map +1 -1
  4. package/build/cjs/dev/client.js +218 -237
  5. package/build/cjs/dev/client.js.map +1 -1
  6. package/build/cjs/dev/clientCache.js +8 -8
  7. package/build/cjs/dev/clientCache.js.map +1 -1
  8. package/build/cjs/dev/debug-build.js +9 -5
  9. package/build/cjs/dev/debug-build.js.map +1 -1
  10. package/build/cjs/dev/defineCloudflareOptions.js +5 -8
  11. package/build/cjs/dev/defineCloudflareOptions.js.map +1 -1
  12. package/build/cjs/dev/durableobject.js +287 -176
  13. package/build/cjs/dev/durableobject.js.map +1 -1
  14. package/build/cjs/dev/flush.js +104 -77
  15. package/build/cjs/dev/flush.js.map +1 -1
  16. package/build/cjs/dev/index.js +181 -182
  17. package/build/cjs/dev/instrument.js +53 -39
  18. package/build/cjs/dev/instrument.js.map +1 -1
  19. package/build/cjs/dev/instrumentations/agents/index.js +34 -13
  20. package/build/cjs/dev/instrumentations/agents/index.js.map +1 -1
  21. package/build/cjs/dev/instrumentations/agents/instrumentAgentCallableRpc.js +46 -49
  22. package/build/cjs/dev/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -1
  23. package/build/cjs/dev/instrumentations/agents/instrumentAgentRequestConversation.js +23 -16
  24. package/build/cjs/dev/instrumentations/agents/instrumentAgentRequestConversation.js.map +1 -1
  25. package/build/cjs/dev/instrumentations/agents/instrumentChatAgentConversation.js +36 -28
  26. package/build/cjs/dev/instrumentations/agents/instrumentChatAgentConversation.js.map +1 -1
  27. package/build/cjs/dev/instrumentations/agents/types.js +103 -58
  28. package/build/cjs/dev/instrumentations/agents/types.js.map +1 -1
  29. package/build/cjs/dev/instrumentations/instrumentDurableObjectHandlers.js +87 -118
  30. package/build/cjs/dev/instrumentations/instrumentDurableObjectHandlers.js.map +1 -1
  31. package/build/cjs/dev/instrumentations/instrumentDurableObjectNamespace.js +46 -44
  32. package/build/cjs/dev/instrumentations/instrumentDurableObjectNamespace.js.map +1 -1
  33. package/build/cjs/dev/instrumentations/instrumentDurableObjectStorage.js +70 -71
  34. package/build/cjs/dev/instrumentations/instrumentDurableObjectStorage.js.map +1 -1
  35. package/build/cjs/dev/instrumentations/instrumentDurableObjectSyncKvStorage.js +31 -39
  36. package/build/cjs/dev/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +1 -1
  37. package/build/cjs/dev/instrumentations/instrumentSqlStorage.js +50 -52
  38. package/build/cjs/dev/instrumentations/instrumentSqlStorage.js.map +1 -1
  39. package/build/cjs/dev/instrumentations/instrumentWorkerEntrypoint.js +136 -123
  40. package/build/cjs/dev/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
  41. package/build/cjs/dev/instrumentations/worker/instrumentD1.js +131 -146
  42. package/build/cjs/dev/instrumentations/worker/instrumentD1.js.map +1 -1
  43. package/build/cjs/dev/instrumentations/worker/instrumentEmail.js +63 -61
  44. package/build/cjs/dev/instrumentations/worker/instrumentEmail.js.map +1 -1
  45. package/build/cjs/dev/instrumentations/worker/instrumentEnv.js +83 -88
  46. package/build/cjs/dev/instrumentations/worker/instrumentEnv.js.map +1 -1
  47. package/build/cjs/dev/instrumentations/worker/instrumentFetch.js +41 -48
  48. package/build/cjs/dev/instrumentations/worker/instrumentFetch.js.map +1 -1
  49. package/build/cjs/dev/instrumentations/worker/instrumentFetcher.js +25 -21
  50. package/build/cjs/dev/instrumentations/worker/instrumentFetcher.js.map +1 -1
  51. package/build/cjs/dev/instrumentations/worker/instrumentKV.js +54 -67
  52. package/build/cjs/dev/instrumentations/worker/instrumentKV.js.map +1 -1
  53. package/build/cjs/dev/instrumentations/worker/instrumentQueue.js +98 -105
  54. package/build/cjs/dev/instrumentations/worker/instrumentQueue.js.map +1 -1
  55. package/build/cjs/dev/instrumentations/worker/instrumentQueueProducer.js +88 -94
  56. package/build/cjs/dev/instrumentations/worker/instrumentQueueProducer.js.map +1 -1
  57. package/build/cjs/dev/instrumentations/worker/instrumentR2.js +128 -115
  58. package/build/cjs/dev/instrumentations/worker/instrumentR2.js.map +1 -1
  59. package/build/cjs/dev/instrumentations/worker/instrumentScheduled.js +90 -94
  60. package/build/cjs/dev/instrumentations/worker/instrumentScheduled.js.map +1 -1
  61. package/build/cjs/dev/instrumentations/worker/instrumentTail.js +100 -55
  62. package/build/cjs/dev/instrumentations/worker/instrumentTail.js.map +1 -1
  63. package/build/cjs/dev/integrations/cronTriggers.js +130 -85
  64. package/build/cjs/dev/integrations/cronTriggers.js.map +1 -1
  65. package/build/cjs/dev/integrations/fetch.js +9 -9
  66. package/build/cjs/dev/integrations/fetch.js.map +1 -1
  67. package/build/cjs/dev/integrations/httpServer.js +41 -22
  68. package/build/cjs/dev/integrations/httpServer.js.map +1 -1
  69. package/build/cjs/dev/integrations/spotlight.js +52 -55
  70. package/build/cjs/dev/integrations/spotlight.js.map +1 -1
  71. package/build/cjs/dev/opentelemetry/tracer.js +10 -8
  72. package/build/cjs/dev/opentelemetry/tracer.js.map +1 -1
  73. package/build/cjs/dev/options.js +56 -39
  74. package/build/cjs/dev/options.js.map +1 -1
  75. package/build/cjs/dev/orchestrion-deferred-channels.js +45 -29
  76. package/build/cjs/dev/orchestrion-deferred-channels.js.map +1 -1
  77. package/build/cjs/dev/orchestrion-diagnostics-channel.js +97 -72
  78. package/build/cjs/dev/orchestrion-diagnostics-channel.js.map +1 -1
  79. package/build/cjs/dev/pages-plugin.js +20 -21
  80. package/build/cjs/dev/pages-plugin.js.map +1 -1
  81. package/build/cjs/dev/request.js +16 -10
  82. package/build/cjs/dev/request.js.map +1 -1
  83. package/build/cjs/dev/scope-utils.js +12 -12
  84. package/build/cjs/dev/scope-utils.js.map +1 -1
  85. package/build/cjs/dev/sdk.js +24 -15
  86. package/build/cjs/dev/sdk.js.map +1 -1
  87. package/build/cjs/dev/transport.js +93 -86
  88. package/build/cjs/dev/transport.js.map +1 -1
  89. package/build/cjs/dev/utils/asyncContextStrategy.js +10 -10
  90. package/build/cjs/dev/utils/asyncContextStrategy.js.map +1 -1
  91. package/build/cjs/dev/utils/bindingPropagation.js +17 -11
  92. package/build/cjs/dev/utils/bindingPropagation.js.map +1 -1
  93. package/build/cjs/dev/utils/cloudflareTrace.js +34 -0
  94. package/build/cjs/dev/utils/cloudflareTrace.js.map +1 -0
  95. package/build/cjs/dev/utils/instrumentContext.js +74 -58
  96. package/build/cjs/dev/utils/instrumentContext.js.map +1 -1
  97. package/build/cjs/dev/utils/internalSqlQuery.js +38 -21
  98. package/build/cjs/dev/utils/internalSqlQuery.js.map +1 -1
  99. package/build/cjs/dev/utils/internalStorageKey.js +41 -38
  100. package/build/cjs/dev/utils/internalStorageKey.js.map +1 -1
  101. package/build/cjs/dev/utils/invocationContext.js +42 -32
  102. package/build/cjs/dev/utils/invocationContext.js.map +1 -1
  103. package/build/cjs/dev/utils/invocationScope.js +45 -21
  104. package/build/cjs/dev/utils/invocationScope.js.map +1 -1
  105. package/build/cjs/dev/utils/isBinding.js +47 -15
  106. package/build/cjs/dev/utils/isBinding.js.map +1 -1
  107. package/build/cjs/dev/utils/isCloudflareClass.js +11 -20
  108. package/build/cjs/dev/utils/isCloudflareClass.js.map +1 -1
  109. package/build/cjs/dev/utils/queueTraceMeta.js +24 -35
  110. package/build/cjs/dev/utils/queueTraceMeta.js.map +1 -1
  111. package/build/cjs/dev/utils/rpcMeta.js +37 -27
  112. package/build/cjs/dev/utils/rpcMeta.js.map +1 -1
  113. package/build/cjs/dev/utils/traceLinks.js +52 -42
  114. package/build/cjs/dev/utils/traceLinks.js.map +1 -1
  115. package/build/cjs/dev/vendor/stacktrace.js +32 -24
  116. package/build/cjs/dev/vendor/stacktrace.js.map +1 -1
  117. package/build/cjs/dev/vite/agentClass.js +105 -98
  118. package/build/cjs/dev/vite/agentClass.js.map +1 -1
  119. package/build/cjs/dev/vite/autoInstrument.js +125 -122
  120. package/build/cjs/dev/vite/autoInstrument.js.map +1 -1
  121. package/build/cjs/dev/vite/index.js +44 -21
  122. package/build/cjs/dev/vite/index.js.map +1 -1
  123. package/build/cjs/dev/vite/instrumentFile.js +37 -20
  124. package/build/cjs/dev/vite/instrumentFile.js.map +1 -1
  125. package/build/cjs/dev/vite/mastraObservability.js +19 -12
  126. package/build/cjs/dev/vite/mastraObservability.js.map +1 -1
  127. package/build/cjs/dev/vite/moduleShape.js +220 -201
  128. package/build/cjs/dev/vite/moduleShape.js.map +1 -1
  129. package/build/cjs/dev/vite/providedModulePlugin.js +62 -45
  130. package/build/cjs/dev/vite/providedModulePlugin.js.map +1 -1
  131. package/build/cjs/dev/vite/transform.js +332 -284
  132. package/build/cjs/dev/vite/transform.js.map +1 -1
  133. package/build/cjs/dev/vite/workerEntrypoint.js +66 -57
  134. package/build/cjs/dev/vite/workerEntrypoint.js.map +1 -1
  135. package/build/cjs/dev/vite/wranglerConfig.js +94 -67
  136. package/build/cjs/dev/vite/wranglerConfig.js.map +1 -1
  137. package/build/cjs/dev/withSentry.js +32 -26
  138. package/build/cjs/dev/withSentry.js.map +1 -1
  139. package/build/cjs/dev/workflows.js +164 -151
  140. package/build/cjs/dev/workflows.js.map +1 -1
  141. package/build/cjs/dev/wrapMethodWithSentry.js +148 -169
  142. package/build/cjs/dev/wrapMethodWithSentry.js.map +1 -1
  143. package/build/cjs/dev/wrapRequestHandlerWithInit.js +76 -78
  144. package/build/cjs/dev/wrapRequestHandlerWithInit.js.map +1 -1
  145. package/build/cjs/prod/_virtual/_rolldown/runtime.js +22 -0
  146. package/build/cjs/prod/baseSdk.js +94 -93
  147. package/build/cjs/prod/baseSdk.js.map +1 -1
  148. package/build/cjs/prod/client.js +218 -237
  149. package/build/cjs/prod/client.js.map +1 -1
  150. package/build/cjs/prod/clientCache.js +8 -8
  151. package/build/cjs/prod/clientCache.js.map +1 -1
  152. package/build/cjs/prod/debug-build.js +9 -5
  153. package/build/cjs/prod/debug-build.js.map +1 -1
  154. package/build/cjs/prod/defineCloudflareOptions.js +5 -8
  155. package/build/cjs/prod/defineCloudflareOptions.js.map +1 -1
  156. package/build/cjs/prod/durableobject.js +287 -176
  157. package/build/cjs/prod/durableobject.js.map +1 -1
  158. package/build/cjs/prod/flush.js +104 -77
  159. package/build/cjs/prod/flush.js.map +1 -1
  160. package/build/cjs/prod/index.js +181 -182
  161. package/build/cjs/prod/instrument.js +53 -39
  162. package/build/cjs/prod/instrument.js.map +1 -1
  163. package/build/cjs/prod/instrumentations/agents/index.js +34 -13
  164. package/build/cjs/prod/instrumentations/agents/index.js.map +1 -1
  165. package/build/cjs/prod/instrumentations/agents/instrumentAgentCallableRpc.js +46 -49
  166. package/build/cjs/prod/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -1
  167. package/build/cjs/prod/instrumentations/agents/instrumentAgentRequestConversation.js +23 -16
  168. package/build/cjs/prod/instrumentations/agents/instrumentAgentRequestConversation.js.map +1 -1
  169. package/build/cjs/prod/instrumentations/agents/instrumentChatAgentConversation.js +36 -28
  170. package/build/cjs/prod/instrumentations/agents/instrumentChatAgentConversation.js.map +1 -1
  171. package/build/cjs/prod/instrumentations/agents/types.js +103 -58
  172. package/build/cjs/prod/instrumentations/agents/types.js.map +1 -1
  173. package/build/cjs/prod/instrumentations/instrumentDurableObjectHandlers.js +87 -118
  174. package/build/cjs/prod/instrumentations/instrumentDurableObjectHandlers.js.map +1 -1
  175. package/build/cjs/prod/instrumentations/instrumentDurableObjectNamespace.js +46 -44
  176. package/build/cjs/prod/instrumentations/instrumentDurableObjectNamespace.js.map +1 -1
  177. package/build/cjs/prod/instrumentations/instrumentDurableObjectStorage.js +70 -71
  178. package/build/cjs/prod/instrumentations/instrumentDurableObjectStorage.js.map +1 -1
  179. package/build/cjs/prod/instrumentations/instrumentDurableObjectSyncKvStorage.js +31 -39
  180. package/build/cjs/prod/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +1 -1
  181. package/build/cjs/prod/instrumentations/instrumentSqlStorage.js +50 -52
  182. package/build/cjs/prod/instrumentations/instrumentSqlStorage.js.map +1 -1
  183. package/build/cjs/prod/instrumentations/instrumentWorkerEntrypoint.js +136 -123
  184. package/build/cjs/prod/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
  185. package/build/cjs/prod/instrumentations/worker/instrumentD1.js +131 -146
  186. package/build/cjs/prod/instrumentations/worker/instrumentD1.js.map +1 -1
  187. package/build/cjs/prod/instrumentations/worker/instrumentEmail.js +63 -61
  188. package/build/cjs/prod/instrumentations/worker/instrumentEmail.js.map +1 -1
  189. package/build/cjs/prod/instrumentations/worker/instrumentEnv.js +83 -88
  190. package/build/cjs/prod/instrumentations/worker/instrumentEnv.js.map +1 -1
  191. package/build/cjs/prod/instrumentations/worker/instrumentFetch.js +41 -48
  192. package/build/cjs/prod/instrumentations/worker/instrumentFetch.js.map +1 -1
  193. package/build/cjs/prod/instrumentations/worker/instrumentFetcher.js +25 -21
  194. package/build/cjs/prod/instrumentations/worker/instrumentFetcher.js.map +1 -1
  195. package/build/cjs/prod/instrumentations/worker/instrumentKV.js +54 -67
  196. package/build/cjs/prod/instrumentations/worker/instrumentKV.js.map +1 -1
  197. package/build/cjs/prod/instrumentations/worker/instrumentQueue.js +98 -105
  198. package/build/cjs/prod/instrumentations/worker/instrumentQueue.js.map +1 -1
  199. package/build/cjs/prod/instrumentations/worker/instrumentQueueProducer.js +88 -94
  200. package/build/cjs/prod/instrumentations/worker/instrumentQueueProducer.js.map +1 -1
  201. package/build/cjs/prod/instrumentations/worker/instrumentR2.js +128 -115
  202. package/build/cjs/prod/instrumentations/worker/instrumentR2.js.map +1 -1
  203. package/build/cjs/prod/instrumentations/worker/instrumentScheduled.js +90 -94
  204. package/build/cjs/prod/instrumentations/worker/instrumentScheduled.js.map +1 -1
  205. package/build/cjs/prod/instrumentations/worker/instrumentTail.js +100 -55
  206. package/build/cjs/prod/instrumentations/worker/instrumentTail.js.map +1 -1
  207. package/build/cjs/prod/integrations/cronTriggers.js +130 -85
  208. package/build/cjs/prod/integrations/cronTriggers.js.map +1 -1
  209. package/build/cjs/prod/integrations/fetch.js +9 -9
  210. package/build/cjs/prod/integrations/fetch.js.map +1 -1
  211. package/build/cjs/prod/integrations/httpServer.js +41 -22
  212. package/build/cjs/prod/integrations/httpServer.js.map +1 -1
  213. package/build/cjs/prod/integrations/spotlight.js +52 -55
  214. package/build/cjs/prod/integrations/spotlight.js.map +1 -1
  215. package/build/cjs/prod/opentelemetry/tracer.js +10 -8
  216. package/build/cjs/prod/opentelemetry/tracer.js.map +1 -1
  217. package/build/cjs/prod/options.js +38 -24
  218. package/build/cjs/prod/options.js.map +1 -1
  219. package/build/cjs/prod/orchestrion-deferred-channels.js +45 -29
  220. package/build/cjs/prod/orchestrion-deferred-channels.js.map +1 -1
  221. package/build/cjs/prod/orchestrion-diagnostics-channel.js +97 -72
  222. package/build/cjs/prod/orchestrion-diagnostics-channel.js.map +1 -1
  223. package/build/cjs/prod/pages-plugin.js +20 -21
  224. package/build/cjs/prod/pages-plugin.js.map +1 -1
  225. package/build/cjs/prod/request.js +16 -10
  226. package/build/cjs/prod/request.js.map +1 -1
  227. package/build/cjs/prod/scope-utils.js +12 -12
  228. package/build/cjs/prod/scope-utils.js.map +1 -1
  229. package/build/cjs/prod/sdk.js +24 -15
  230. package/build/cjs/prod/sdk.js.map +1 -1
  231. package/build/cjs/prod/transport.js +93 -86
  232. package/build/cjs/prod/transport.js.map +1 -1
  233. package/build/cjs/prod/utils/asyncContextStrategy.js +10 -10
  234. package/build/cjs/prod/utils/asyncContextStrategy.js.map +1 -1
  235. package/build/cjs/prod/utils/bindingPropagation.js +17 -11
  236. package/build/cjs/prod/utils/bindingPropagation.js.map +1 -1
  237. package/build/cjs/prod/utils/cloudflareTrace.js +34 -0
  238. package/build/cjs/prod/utils/cloudflareTrace.js.map +1 -0
  239. package/build/cjs/prod/utils/instrumentContext.js +74 -58
  240. package/build/cjs/prod/utils/instrumentContext.js.map +1 -1
  241. package/build/cjs/prod/utils/internalSqlQuery.js +38 -21
  242. package/build/cjs/prod/utils/internalSqlQuery.js.map +1 -1
  243. package/build/cjs/prod/utils/internalStorageKey.js +41 -38
  244. package/build/cjs/prod/utils/internalStorageKey.js.map +1 -1
  245. package/build/cjs/prod/utils/invocationContext.js +42 -32
  246. package/build/cjs/prod/utils/invocationContext.js.map +1 -1
  247. package/build/cjs/prod/utils/invocationScope.js +45 -21
  248. package/build/cjs/prod/utils/invocationScope.js.map +1 -1
  249. package/build/cjs/prod/utils/isBinding.js +47 -15
  250. package/build/cjs/prod/utils/isBinding.js.map +1 -1
  251. package/build/cjs/prod/utils/isCloudflareClass.js +11 -20
  252. package/build/cjs/prod/utils/isCloudflareClass.js.map +1 -1
  253. package/build/cjs/prod/utils/queueTraceMeta.js +24 -35
  254. package/build/cjs/prod/utils/queueTraceMeta.js.map +1 -1
  255. package/build/cjs/prod/utils/rpcMeta.js +37 -27
  256. package/build/cjs/prod/utils/rpcMeta.js.map +1 -1
  257. package/build/cjs/prod/utils/traceLinks.js +52 -42
  258. package/build/cjs/prod/utils/traceLinks.js.map +1 -1
  259. package/build/cjs/prod/vendor/stacktrace.js +32 -24
  260. package/build/cjs/prod/vendor/stacktrace.js.map +1 -1
  261. package/build/cjs/prod/vite/agentClass.js +105 -98
  262. package/build/cjs/prod/vite/agentClass.js.map +1 -1
  263. package/build/cjs/prod/vite/autoInstrument.js +125 -122
  264. package/build/cjs/prod/vite/autoInstrument.js.map +1 -1
  265. package/build/cjs/prod/vite/index.js +44 -21
  266. package/build/cjs/prod/vite/index.js.map +1 -1
  267. package/build/cjs/prod/vite/instrumentFile.js +37 -20
  268. package/build/cjs/prod/vite/instrumentFile.js.map +1 -1
  269. package/build/cjs/prod/vite/mastraObservability.js +19 -12
  270. package/build/cjs/prod/vite/mastraObservability.js.map +1 -1
  271. package/build/cjs/prod/vite/moduleShape.js +220 -201
  272. package/build/cjs/prod/vite/moduleShape.js.map +1 -1
  273. package/build/cjs/prod/vite/providedModulePlugin.js +62 -45
  274. package/build/cjs/prod/vite/providedModulePlugin.js.map +1 -1
  275. package/build/cjs/prod/vite/transform.js +332 -284
  276. package/build/cjs/prod/vite/transform.js.map +1 -1
  277. package/build/cjs/prod/vite/workerEntrypoint.js +66 -57
  278. package/build/cjs/prod/vite/workerEntrypoint.js.map +1 -1
  279. package/build/cjs/prod/vite/wranglerConfig.js +94 -67
  280. package/build/cjs/prod/vite/wranglerConfig.js.map +1 -1
  281. package/build/cjs/prod/withSentry.js +32 -26
  282. package/build/cjs/prod/withSentry.js.map +1 -1
  283. package/build/cjs/prod/workflows.js +164 -151
  284. package/build/cjs/prod/workflows.js.map +1 -1
  285. package/build/cjs/prod/wrapMethodWithSentry.js +148 -169
  286. package/build/cjs/prod/wrapMethodWithSentry.js.map +1 -1
  287. package/build/cjs/prod/wrapRequestHandlerWithInit.js +76 -78
  288. package/build/cjs/prod/wrapRequestHandlerWithInit.js.map +1 -1
  289. package/build/esm/dev/baseSdk.js +98 -101
  290. package/build/esm/dev/baseSdk.js.map +1 -1
  291. package/build/esm/dev/client.js +218 -235
  292. package/build/esm/dev/client.js.map +1 -1
  293. package/build/esm/dev/clientCache.js +8 -6
  294. package/build/esm/dev/clientCache.js.map +1 -1
  295. package/build/esm/dev/debug-build.js +9 -3
  296. package/build/esm/dev/debug-build.js.map +1 -1
  297. package/build/esm/dev/defineCloudflareOptions.js +5 -6
  298. package/build/esm/dev/defineCloudflareOptions.js.map +1 -1
  299. package/build/esm/dev/durableobject.js +287 -174
  300. package/build/esm/dev/durableobject.js.map +1 -1
  301. package/build/esm/dev/flush.js +104 -75
  302. package/build/esm/dev/flush.js.map +1 -1
  303. package/build/esm/dev/index.js +19 -18
  304. package/build/esm/dev/instrument.js +53 -37
  305. package/build/esm/dev/instrument.js.map +1 -1
  306. package/build/esm/dev/instrumentations/agents/index.js +34 -11
  307. package/build/esm/dev/instrumentations/agents/index.js.map +1 -1
  308. package/build/esm/dev/instrumentations/agents/instrumentAgentCallableRpc.js +46 -47
  309. package/build/esm/dev/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -1
  310. package/build/esm/dev/instrumentations/agents/instrumentAgentRequestConversation.js +23 -14
  311. package/build/esm/dev/instrumentations/agents/instrumentAgentRequestConversation.js.map +1 -1
  312. package/build/esm/dev/instrumentations/agents/instrumentChatAgentConversation.js +36 -26
  313. package/build/esm/dev/instrumentations/agents/instrumentChatAgentConversation.js.map +1 -1
  314. package/build/esm/dev/instrumentations/agents/types.js +103 -56
  315. package/build/esm/dev/instrumentations/agents/types.js.map +1 -1
  316. package/build/esm/dev/instrumentations/instrumentDurableObjectHandlers.js +87 -116
  317. package/build/esm/dev/instrumentations/instrumentDurableObjectHandlers.js.map +1 -1
  318. package/build/esm/dev/instrumentations/instrumentDurableObjectNamespace.js +46 -42
  319. package/build/esm/dev/instrumentations/instrumentDurableObjectNamespace.js.map +1 -1
  320. package/build/esm/dev/instrumentations/instrumentDurableObjectStorage.js +70 -69
  321. package/build/esm/dev/instrumentations/instrumentDurableObjectStorage.js.map +1 -1
  322. package/build/esm/dev/instrumentations/instrumentDurableObjectSyncKvStorage.js +31 -37
  323. package/build/esm/dev/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +1 -1
  324. package/build/esm/dev/instrumentations/instrumentSqlStorage.js +50 -50
  325. package/build/esm/dev/instrumentations/instrumentSqlStorage.js.map +1 -1
  326. package/build/esm/dev/instrumentations/instrumentWorkerEntrypoint.js +136 -121
  327. package/build/esm/dev/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
  328. package/build/esm/dev/instrumentations/worker/instrumentD1.js +131 -144
  329. package/build/esm/dev/instrumentations/worker/instrumentD1.js.map +1 -1
  330. package/build/esm/dev/instrumentations/worker/instrumentEmail.js +63 -59
  331. package/build/esm/dev/instrumentations/worker/instrumentEmail.js.map +1 -1
  332. package/build/esm/dev/instrumentations/worker/instrumentEnv.js +83 -86
  333. package/build/esm/dev/instrumentations/worker/instrumentEnv.js.map +1 -1
  334. package/build/esm/dev/instrumentations/worker/instrumentFetch.js +41 -46
  335. package/build/esm/dev/instrumentations/worker/instrumentFetch.js.map +1 -1
  336. package/build/esm/dev/instrumentations/worker/instrumentFetcher.js +25 -19
  337. package/build/esm/dev/instrumentations/worker/instrumentFetcher.js.map +1 -1
  338. package/build/esm/dev/instrumentations/worker/instrumentKV.js +54 -65
  339. package/build/esm/dev/instrumentations/worker/instrumentKV.js.map +1 -1
  340. package/build/esm/dev/instrumentations/worker/instrumentQueue.js +98 -103
  341. package/build/esm/dev/instrumentations/worker/instrumentQueue.js.map +1 -1
  342. package/build/esm/dev/instrumentations/worker/instrumentQueueProducer.js +88 -92
  343. package/build/esm/dev/instrumentations/worker/instrumentQueueProducer.js.map +1 -1
  344. package/build/esm/dev/instrumentations/worker/instrumentR2.js +128 -113
  345. package/build/esm/dev/instrumentations/worker/instrumentR2.js.map +1 -1
  346. package/build/esm/dev/instrumentations/worker/instrumentScheduled.js +90 -92
  347. package/build/esm/dev/instrumentations/worker/instrumentScheduled.js.map +1 -1
  348. package/build/esm/dev/instrumentations/worker/instrumentTail.js +100 -53
  349. package/build/esm/dev/instrumentations/worker/instrumentTail.js.map +1 -1
  350. package/build/esm/dev/integrations/cronTriggers.js +129 -82
  351. package/build/esm/dev/integrations/cronTriggers.js.map +1 -1
  352. package/build/esm/dev/integrations/fetch.js +9 -6
  353. package/build/esm/dev/integrations/fetch.js.map +1 -1
  354. package/build/esm/dev/integrations/httpServer.js +40 -19
  355. package/build/esm/dev/integrations/httpServer.js.map +1 -1
  356. package/build/esm/dev/integrations/spotlight.js +51 -52
  357. package/build/esm/dev/integrations/spotlight.js.map +1 -1
  358. package/build/esm/dev/opentelemetry/tracer.js +10 -6
  359. package/build/esm/dev/opentelemetry/tracer.js.map +1 -1
  360. package/build/esm/dev/options.js +56 -37
  361. package/build/esm/dev/options.js.map +1 -1
  362. package/build/esm/dev/orchestrion-deferred-channels.js +45 -27
  363. package/build/esm/dev/orchestrion-deferred-channels.js.map +1 -1
  364. package/build/esm/dev/orchestrion-diagnostics-channel.js +87 -66
  365. package/build/esm/dev/orchestrion-diagnostics-channel.js.map +1 -1
  366. package/build/esm/dev/package.json +1 -1
  367. package/build/esm/dev/pages-plugin.js +20 -19
  368. package/build/esm/dev/pages-plugin.js.map +1 -1
  369. package/build/esm/dev/request.js +14 -7
  370. package/build/esm/dev/request.js.map +1 -1
  371. package/build/esm/dev/scope-utils.js +12 -10
  372. package/build/esm/dev/scope-utils.js.map +1 -1
  373. package/build/esm/dev/sdk.js +23 -13
  374. package/build/esm/dev/sdk.js.map +1 -1
  375. package/build/esm/dev/transport.js +93 -84
  376. package/build/esm/dev/transport.js.map +1 -1
  377. package/build/esm/dev/utils/asyncContextStrategy.js +10 -8
  378. package/build/esm/dev/utils/asyncContextStrategy.js.map +1 -1
  379. package/build/esm/dev/utils/bindingPropagation.js +17 -9
  380. package/build/esm/dev/utils/bindingPropagation.js.map +1 -1
  381. package/build/esm/dev/utils/cloudflareTrace.js +34 -0
  382. package/build/esm/dev/utils/cloudflareTrace.js.map +1 -0
  383. package/build/esm/dev/utils/instrumentContext.js +74 -56
  384. package/build/esm/dev/utils/instrumentContext.js.map +1 -1
  385. package/build/esm/dev/utils/internalSqlQuery.js +38 -19
  386. package/build/esm/dev/utils/internalSqlQuery.js.map +1 -1
  387. package/build/esm/dev/utils/internalStorageKey.js +41 -36
  388. package/build/esm/dev/utils/internalStorageKey.js.map +1 -1
  389. package/build/esm/dev/utils/invocationContext.js +42 -30
  390. package/build/esm/dev/utils/invocationContext.js.map +1 -1
  391. package/build/esm/dev/utils/invocationScope.js +45 -19
  392. package/build/esm/dev/utils/invocationScope.js.map +1 -1
  393. package/build/esm/dev/utils/isBinding.js +47 -13
  394. package/build/esm/dev/utils/isBinding.js.map +1 -1
  395. package/build/esm/dev/utils/isCloudflareClass.js +11 -18
  396. package/build/esm/dev/utils/isCloudflareClass.js.map +1 -1
  397. package/build/esm/dev/utils/queueTraceMeta.js +24 -33
  398. package/build/esm/dev/utils/queueTraceMeta.js.map +1 -1
  399. package/build/esm/dev/utils/rpcMeta.js +37 -25
  400. package/build/esm/dev/utils/rpcMeta.js.map +1 -1
  401. package/build/esm/dev/utils/traceLinks.js +52 -40
  402. package/build/esm/dev/utils/traceLinks.js.map +1 -1
  403. package/build/esm/dev/vendor/stacktrace.js +31 -21
  404. package/build/esm/dev/vendor/stacktrace.js.map +1 -1
  405. package/build/esm/dev/vite/agentClass.js +105 -96
  406. package/build/esm/dev/vite/agentClass.js.map +1 -1
  407. package/build/esm/dev/vite/autoInstrument.js +125 -120
  408. package/build/esm/dev/vite/autoInstrument.js.map +1 -1
  409. package/build/esm/dev/vite/index.js +43 -19
  410. package/build/esm/dev/vite/index.js.map +1 -1
  411. package/build/esm/dev/vite/instrumentFile.js +37 -18
  412. package/build/esm/dev/vite/instrumentFile.js.map +1 -1
  413. package/build/esm/dev/vite/mastraObservability.js +19 -10
  414. package/build/esm/dev/vite/mastraObservability.js.map +1 -1
  415. package/build/esm/dev/vite/moduleShape.js +220 -199
  416. package/build/esm/dev/vite/moduleShape.js.map +1 -1
  417. package/build/esm/dev/vite/providedModulePlugin.js +60 -43
  418. package/build/esm/dev/vite/providedModulePlugin.js.map +1 -1
  419. package/build/esm/dev/vite/transform.js +330 -282
  420. package/build/esm/dev/vite/transform.js.map +1 -1
  421. package/build/esm/dev/vite/workerEntrypoint.js +66 -55
  422. package/build/esm/dev/vite/workerEntrypoint.js.map +1 -1
  423. package/build/esm/dev/vite/wranglerConfig.js +94 -65
  424. package/build/esm/dev/vite/wranglerConfig.js.map +1 -1
  425. package/build/esm/dev/withSentry.js +32 -24
  426. package/build/esm/dev/withSentry.js.map +1 -1
  427. package/build/esm/dev/workflows.js +164 -149
  428. package/build/esm/dev/workflows.js.map +1 -1
  429. package/build/esm/dev/wrapMethodWithSentry.js +148 -167
  430. package/build/esm/dev/wrapMethodWithSentry.js.map +1 -1
  431. package/build/esm/dev/wrapRequestHandlerWithInit.js +76 -76
  432. package/build/esm/dev/wrapRequestHandlerWithInit.js.map +1 -1
  433. package/build/esm/prod/baseSdk.js +94 -91
  434. package/build/esm/prod/baseSdk.js.map +1 -1
  435. package/build/esm/prod/client.js +218 -235
  436. package/build/esm/prod/client.js.map +1 -1
  437. package/build/esm/prod/clientCache.js +8 -6
  438. package/build/esm/prod/clientCache.js.map +1 -1
  439. package/build/esm/prod/debug-build.js +9 -3
  440. package/build/esm/prod/debug-build.js.map +1 -1
  441. package/build/esm/prod/defineCloudflareOptions.js +5 -6
  442. package/build/esm/prod/defineCloudflareOptions.js.map +1 -1
  443. package/build/esm/prod/durableobject.js +287 -174
  444. package/build/esm/prod/durableobject.js.map +1 -1
  445. package/build/esm/prod/flush.js +104 -75
  446. package/build/esm/prod/flush.js.map +1 -1
  447. package/build/esm/prod/index.js +19 -18
  448. package/build/esm/prod/instrument.js +53 -37
  449. package/build/esm/prod/instrument.js.map +1 -1
  450. package/build/esm/prod/instrumentations/agents/index.js +34 -11
  451. package/build/esm/prod/instrumentations/agents/index.js.map +1 -1
  452. package/build/esm/prod/instrumentations/agents/instrumentAgentCallableRpc.js +46 -47
  453. package/build/esm/prod/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -1
  454. package/build/esm/prod/instrumentations/agents/instrumentAgentRequestConversation.js +23 -14
  455. package/build/esm/prod/instrumentations/agents/instrumentAgentRequestConversation.js.map +1 -1
  456. package/build/esm/prod/instrumentations/agents/instrumentChatAgentConversation.js +36 -26
  457. package/build/esm/prod/instrumentations/agents/instrumentChatAgentConversation.js.map +1 -1
  458. package/build/esm/prod/instrumentations/agents/types.js +103 -56
  459. package/build/esm/prod/instrumentations/agents/types.js.map +1 -1
  460. package/build/esm/prod/instrumentations/instrumentDurableObjectHandlers.js +87 -116
  461. package/build/esm/prod/instrumentations/instrumentDurableObjectHandlers.js.map +1 -1
  462. package/build/esm/prod/instrumentations/instrumentDurableObjectNamespace.js +46 -42
  463. package/build/esm/prod/instrumentations/instrumentDurableObjectNamespace.js.map +1 -1
  464. package/build/esm/prod/instrumentations/instrumentDurableObjectStorage.js +70 -69
  465. package/build/esm/prod/instrumentations/instrumentDurableObjectStorage.js.map +1 -1
  466. package/build/esm/prod/instrumentations/instrumentDurableObjectSyncKvStorage.js +31 -37
  467. package/build/esm/prod/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +1 -1
  468. package/build/esm/prod/instrumentations/instrumentSqlStorage.js +50 -50
  469. package/build/esm/prod/instrumentations/instrumentSqlStorage.js.map +1 -1
  470. package/build/esm/prod/instrumentations/instrumentWorkerEntrypoint.js +136 -121
  471. package/build/esm/prod/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
  472. package/build/esm/prod/instrumentations/worker/instrumentD1.js +131 -144
  473. package/build/esm/prod/instrumentations/worker/instrumentD1.js.map +1 -1
  474. package/build/esm/prod/instrumentations/worker/instrumentEmail.js +63 -59
  475. package/build/esm/prod/instrumentations/worker/instrumentEmail.js.map +1 -1
  476. package/build/esm/prod/instrumentations/worker/instrumentEnv.js +83 -86
  477. package/build/esm/prod/instrumentations/worker/instrumentEnv.js.map +1 -1
  478. package/build/esm/prod/instrumentations/worker/instrumentFetch.js +41 -46
  479. package/build/esm/prod/instrumentations/worker/instrumentFetch.js.map +1 -1
  480. package/build/esm/prod/instrumentations/worker/instrumentFetcher.js +25 -19
  481. package/build/esm/prod/instrumentations/worker/instrumentFetcher.js.map +1 -1
  482. package/build/esm/prod/instrumentations/worker/instrumentKV.js +54 -65
  483. package/build/esm/prod/instrumentations/worker/instrumentKV.js.map +1 -1
  484. package/build/esm/prod/instrumentations/worker/instrumentQueue.js +98 -103
  485. package/build/esm/prod/instrumentations/worker/instrumentQueue.js.map +1 -1
  486. package/build/esm/prod/instrumentations/worker/instrumentQueueProducer.js +88 -92
  487. package/build/esm/prod/instrumentations/worker/instrumentQueueProducer.js.map +1 -1
  488. package/build/esm/prod/instrumentations/worker/instrumentR2.js +128 -113
  489. package/build/esm/prod/instrumentations/worker/instrumentR2.js.map +1 -1
  490. package/build/esm/prod/instrumentations/worker/instrumentScheduled.js +90 -92
  491. package/build/esm/prod/instrumentations/worker/instrumentScheduled.js.map +1 -1
  492. package/build/esm/prod/instrumentations/worker/instrumentTail.js +100 -53
  493. package/build/esm/prod/instrumentations/worker/instrumentTail.js.map +1 -1
  494. package/build/esm/prod/integrations/cronTriggers.js +129 -82
  495. package/build/esm/prod/integrations/cronTriggers.js.map +1 -1
  496. package/build/esm/prod/integrations/fetch.js +9 -6
  497. package/build/esm/prod/integrations/fetch.js.map +1 -1
  498. package/build/esm/prod/integrations/httpServer.js +40 -19
  499. package/build/esm/prod/integrations/httpServer.js.map +1 -1
  500. package/build/esm/prod/integrations/spotlight.js +51 -52
  501. package/build/esm/prod/integrations/spotlight.js.map +1 -1
  502. package/build/esm/prod/opentelemetry/tracer.js +10 -6
  503. package/build/esm/prod/opentelemetry/tracer.js.map +1 -1
  504. package/build/esm/prod/options.js +38 -22
  505. package/build/esm/prod/options.js.map +1 -1
  506. package/build/esm/prod/orchestrion-deferred-channels.js +45 -27
  507. package/build/esm/prod/orchestrion-deferred-channels.js.map +1 -1
  508. package/build/esm/prod/orchestrion-diagnostics-channel.js +87 -66
  509. package/build/esm/prod/orchestrion-diagnostics-channel.js.map +1 -1
  510. package/build/esm/prod/package.json +1 -1
  511. package/build/esm/prod/pages-plugin.js +20 -19
  512. package/build/esm/prod/pages-plugin.js.map +1 -1
  513. package/build/esm/prod/request.js +14 -7
  514. package/build/esm/prod/request.js.map +1 -1
  515. package/build/esm/prod/scope-utils.js +12 -10
  516. package/build/esm/prod/scope-utils.js.map +1 -1
  517. package/build/esm/prod/sdk.js +23 -13
  518. package/build/esm/prod/sdk.js.map +1 -1
  519. package/build/esm/prod/transport.js +93 -84
  520. package/build/esm/prod/transport.js.map +1 -1
  521. package/build/esm/prod/utils/asyncContextStrategy.js +10 -8
  522. package/build/esm/prod/utils/asyncContextStrategy.js.map +1 -1
  523. package/build/esm/prod/utils/bindingPropagation.js +17 -9
  524. package/build/esm/prod/utils/bindingPropagation.js.map +1 -1
  525. package/build/esm/prod/utils/cloudflareTrace.js +34 -0
  526. package/build/esm/prod/utils/cloudflareTrace.js.map +1 -0
  527. package/build/esm/prod/utils/instrumentContext.js +74 -56
  528. package/build/esm/prod/utils/instrumentContext.js.map +1 -1
  529. package/build/esm/prod/utils/internalSqlQuery.js +38 -19
  530. package/build/esm/prod/utils/internalSqlQuery.js.map +1 -1
  531. package/build/esm/prod/utils/internalStorageKey.js +41 -36
  532. package/build/esm/prod/utils/internalStorageKey.js.map +1 -1
  533. package/build/esm/prod/utils/invocationContext.js +42 -30
  534. package/build/esm/prod/utils/invocationContext.js.map +1 -1
  535. package/build/esm/prod/utils/invocationScope.js +45 -19
  536. package/build/esm/prod/utils/invocationScope.js.map +1 -1
  537. package/build/esm/prod/utils/isBinding.js +47 -13
  538. package/build/esm/prod/utils/isBinding.js.map +1 -1
  539. package/build/esm/prod/utils/isCloudflareClass.js +11 -18
  540. package/build/esm/prod/utils/isCloudflareClass.js.map +1 -1
  541. package/build/esm/prod/utils/queueTraceMeta.js +24 -33
  542. package/build/esm/prod/utils/queueTraceMeta.js.map +1 -1
  543. package/build/esm/prod/utils/rpcMeta.js +37 -25
  544. package/build/esm/prod/utils/rpcMeta.js.map +1 -1
  545. package/build/esm/prod/utils/traceLinks.js +52 -40
  546. package/build/esm/prod/utils/traceLinks.js.map +1 -1
  547. package/build/esm/prod/vendor/stacktrace.js +31 -21
  548. package/build/esm/prod/vendor/stacktrace.js.map +1 -1
  549. package/build/esm/prod/vite/agentClass.js +105 -96
  550. package/build/esm/prod/vite/agentClass.js.map +1 -1
  551. package/build/esm/prod/vite/autoInstrument.js +125 -120
  552. package/build/esm/prod/vite/autoInstrument.js.map +1 -1
  553. package/build/esm/prod/vite/index.js +43 -19
  554. package/build/esm/prod/vite/index.js.map +1 -1
  555. package/build/esm/prod/vite/instrumentFile.js +37 -18
  556. package/build/esm/prod/vite/instrumentFile.js.map +1 -1
  557. package/build/esm/prod/vite/mastraObservability.js +19 -10
  558. package/build/esm/prod/vite/mastraObservability.js.map +1 -1
  559. package/build/esm/prod/vite/moduleShape.js +220 -199
  560. package/build/esm/prod/vite/moduleShape.js.map +1 -1
  561. package/build/esm/prod/vite/providedModulePlugin.js +60 -43
  562. package/build/esm/prod/vite/providedModulePlugin.js.map +1 -1
  563. package/build/esm/prod/vite/transform.js +330 -282
  564. package/build/esm/prod/vite/transform.js.map +1 -1
  565. package/build/esm/prod/vite/workerEntrypoint.js +66 -55
  566. package/build/esm/prod/vite/workerEntrypoint.js.map +1 -1
  567. package/build/esm/prod/vite/wranglerConfig.js +94 -65
  568. package/build/esm/prod/vite/wranglerConfig.js.map +1 -1
  569. package/build/esm/prod/withSentry.js +32 -24
  570. package/build/esm/prod/withSentry.js.map +1 -1
  571. package/build/esm/prod/workflows.js +164 -149
  572. package/build/esm/prod/workflows.js.map +1 -1
  573. package/build/esm/prod/wrapMethodWithSentry.js +148 -167
  574. package/build/esm/prod/wrapMethodWithSentry.js.map +1 -1
  575. package/build/esm/prod/wrapRequestHandlerWithInit.js +76 -76
  576. package/build/esm/prod/wrapRequestHandlerWithInit.js.map +1 -1
  577. package/build/types/baseSdk.d.ts.map +1 -1
  578. package/build/types/client.d.ts +9 -1
  579. package/build/types/client.d.ts.map +1 -1
  580. package/build/types/durableobject.d.ts.map +1 -1
  581. package/build/types/index.d.ts +3 -2
  582. package/build/types/index.d.ts.map +1 -1
  583. package/build/types/instrumentations/worker/instrumentEmail.d.ts.map +1 -1
  584. package/build/types/instrumentations/worker/instrumentFetcher.d.ts.map +1 -1
  585. package/build/types/instrumentations/worker/instrumentQueue.d.ts.map +1 -1
  586. package/build/types/instrumentations/worker/instrumentScheduled.d.ts.map +1 -1
  587. package/build/types/instrumentations/worker/instrumentTail.d.ts +4 -2
  588. package/build/types/instrumentations/worker/instrumentTail.d.ts.map +1 -1
  589. package/build/types/options.d.ts.map +1 -1
  590. package/build/types/utils/cloudflareTrace.d.ts +13 -0
  591. package/build/types/utils/cloudflareTrace.d.ts.map +1 -0
  592. package/build/types/vite/autoInstrument.d.ts.map +1 -1
  593. package/build/types/vite/index.d.ts +3 -0
  594. package/build/types/vite/index.d.ts.map +1 -1
  595. package/build/types/vite/providedModulePlugin.d.ts +15 -11
  596. package/build/types/vite/providedModulePlugin.d.ts.map +1 -1
  597. package/build/types/vite/transform.d.ts +12 -2
  598. package/build/types/vite/transform.d.ts.map +1 -1
  599. package/build/types/vite/wranglerConfig.d.ts +8 -0
  600. package/build/types/vite/wranglerConfig.d.ts.map +1 -1
  601. package/build/types/workflows.d.ts.map +1 -1
  602. package/build/types/wrapMethodWithSentry.d.ts.map +1 -1
  603. package/build/types/wrapRequestHandlerWithInit.d.ts.map +1 -1
  604. package/package.json +10 -14
  605. package/build/cjs/dev/index.js.map +0 -1
  606. package/build/cjs/dev/vite/flueRuntime.js +0 -15
  607. package/build/cjs/dev/vite/flueRuntime.js.map +0 -1
  608. package/build/cjs/prod/index.js.map +0 -1
  609. package/build/cjs/prod/vite/flueRuntime.js +0 -15
  610. package/build/cjs/prod/vite/flueRuntime.js.map +0 -1
  611. package/build/esm/dev/index.js.map +0 -1
  612. package/build/esm/dev/vite/flueRuntime.js +0 -13
  613. package/build/esm/dev/vite/flueRuntime.js.map +0 -1
  614. package/build/esm/prod/index.js.map +0 -1
  615. package/build/esm/prod/vite/flueRuntime.js +0 -13
  616. package/build/esm/prod/vite/flueRuntime.js.map +0 -1
  617. package/build/types/vite/flueRuntime.d.ts +0 -12
  618. package/build/types/vite/flueRuntime.d.ts.map +0 -1
@@ -0,0 +1,22 @@
1
+ // \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+ exports.__toESM = __toESM;
@@ -1,111 +1,106 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const core = require('@sentry/core');
4
- const client = require('./client.js');
5
- const flush = require('./flush.js');
6
- const clientCache = require('./clientCache.js');
7
- const debugBuild = require('./debug-build.js');
8
- const fetch = require('./integrations/fetch.js');
9
- const httpServer = require('./integrations/httpServer.js');
10
- const spotlight = require('./integrations/spotlight.js');
11
- const transport = require('./transport.js');
12
- const stacktrace = require('./vendor/stacktrace.js');
13
-
1
+ const require_client = require("./client.js");
2
+ const require_flush = require("./flush.js");
3
+ const require_clientCache = require("./clientCache.js");
4
+ const require_debug_build = require("./debug-build.js");
5
+ const require_fetch = require("./integrations/fetch.js");
6
+ const require_httpServer = require("./integrations/httpServer.js");
7
+ const require_spotlight = require("./integrations/spotlight.js");
8
+ const require_transport = require("./transport.js");
9
+ const require_stacktrace = require("./vendor/stacktrace.js");
10
+ let _sentry_core = require("@sentry/core");
11
+ // src/baseSdk.ts
12
+ /**
13
+ * Instantiate the channel-subscriber factories the `@sentry/cloudflare/vite`
14
+ * plugin registered on the global marker. The plugin splices a small snippet
15
+ * into each instrumented module that `.set`s its factory here (keyed by module
16
+ * name), so the marker holds one factory per package actually bundled.
17
+ *
18
+ * The marker is read directly instead of importing the factories, so a worker
19
+ * built without the plugin — where the channels never fire — ships none of this
20
+ * code.
21
+ */
14
22
  function getRegisteredChannelIntegrations() {
15
- const registered = core.GLOBAL_OBJ.__SENTRY_ORCHESTRION__?.integrations;
16
- return registered ? [...registered.values()].map((factory) => factory()) : [];
23
+ const registered = _sentry_core.GLOBAL_OBJ.__SENTRY_ORCHESTRION__?.integrations;
24
+ return registered ? [...registered.values()].map((factory) => factory()) : [];
17
25
  }
26
+ /**
27
+ * Get the default integrations for the Cloudflare SDK.
28
+ * These also work on Workers-compatible runtimes without the `nodejs_compat` compatibility flag.
29
+ */
18
30
  function getDefaultIntegrations(options) {
19
- return [
20
- // The Dedupe integration should not be used in workflows because we want to
21
- // capture all step failures, even if they are the same error.
22
- ...options.enableDedupe === false ? [] : [core.dedupeIntegration()],
23
- core.eventFiltersIntegration(),
24
- core.functionToStringIntegration(),
25
- core.conversationIdIntegration(),
26
- core.linkedErrorsIntegration(),
27
- fetch.fetchIntegration(),
28
- httpServer.httpServerIntegration(),
29
- core.requestDataIntegration(),
30
- core.consoleIntegration(),
31
- // The orchestrion diagnostics-channel subscribers (mysql, pg, …). The
32
- // `@sentry/cloudflare/vite` plugin injects the channels at build time and,
33
- // next to each, a snippet that registers the matching subscriber factory on
34
- // the global marker. Read from there instead of importing them so bundles
35
- // built without the plugin — where the channels would never fire — don't
36
- // ship the code.
37
- ...getRegisteredChannelIntegrations()
38
- ];
31
+ return [
32
+ ...options.enableDedupe === false ? [] : [(0, _sentry_core.dedupeIntegration)()],
33
+ (0, _sentry_core.eventFiltersIntegration)(),
34
+ (0, _sentry_core.functionToStringIntegration)(),
35
+ (0, _sentry_core.conversationIdIntegration)(),
36
+ (0, _sentry_core.linkedErrorsIntegration)(),
37
+ require_fetch.fetchIntegration(),
38
+ require_httpServer.httpServerIntegration(),
39
+ (0, _sentry_core.requestDataIntegration)(),
40
+ (0, _sentry_core.consoleIntegration)(),
41
+ ...getRegisteredChannelIntegrations()
42
+ ];
39
43
  }
44
+ /**
45
+ * Initializes the Cloudflare SDK without setting up an OpenTelemetry tracer provider.
46
+ *
47
+ * Kept separate from `sdk.ts` so `@sentry/cloudflare/request` can load without Node.js-only
48
+ * dependencies on runtimes such as Shopify Oxygen.
49
+ *
50
+ * The client is cached and reused across invocations within the same isolate,
51
+ * unless `cacheClient: false` is passed. This avoids the
52
+ * per-invocation cost of constructing a new client, and it is what makes
53
+ * Durable Object telemetry reliable: a per-invocation client is disposed at
54
+ * the end of the handler, and in a Durable Object there is no `waitUntil`
55
+ * boundary that reliably extends execution, so spans/events that end after
56
+ * disposal would otherwise be lost.
57
+ */
40
58
  function initBaseSdk(options) {
41
- const cached = clientCache.getCachedClient();
42
- const cacheEnabled = options.cacheClient !== false;
43
- if (cacheEnabled && cached && !core._INTERNAL_isClientClosed(cached)) {
44
- if (debugBuild.DEBUG_BUILD && cached.getOptions().dsn !== options.dsn) {
45
- core.debug.warn(
46
- "[Sentry] init() was called with a different DSN than the cached client of this isolate; the cached client keeps its DSN. Pass `cacheClient: false` for per-invocation options."
47
- );
48
- }
49
- core.getCurrentScope().update(options.initialScope);
50
- core.setCurrentClient(cached);
51
- return cached;
52
- }
53
- const usesSdkDefaults = options.defaultIntegrations === void 0 || !!options._extendsDefaultIntegrations;
54
- if (options.defaultIntegrations === void 0) {
55
- options.defaultIntegrations = getDefaultIntegrations(options);
56
- }
57
- const invocationContext = options.ctx;
58
- const flushLock = !cacheEnabled && invocationContext ? flush.makeFlushLock(invocationContext) : void 0;
59
- delete options.ctx;
60
- const clientOptions = {
61
- ...options,
62
- cacheClient: cacheEnabled,
63
- stackParser: core.stackParserFromStackParserOptions(options.stackParser || stacktrace.defaultStackParser),
64
- integrations: core.getIntegrationsToSetup(options),
65
- transport: options.transport || transport.makeCloudflareTransport,
66
- flushLock
67
- };
68
- /*! rollup-include-development-only */
69
- if (options.spotlight && !clientOptions.integrations.some(({ name }) => name === spotlight.INTEGRATION_NAME)) {
70
- clientOptions.integrations.push(
71
- spotlight.spotlightIntegration({
72
- sidecarUrl: typeof options.spotlight === "string" ? options.spotlight : void 0
73
- })
74
- );
75
- }
76
- /*! rollup-include-development-only-end */
77
- if (!cacheEnabled) {
78
- core.getCurrentScope().setClient(void 0);
79
- }
80
- const client$1 = core.initAndBind(client.CloudflareClient, clientOptions);
81
- if (cacheEnabled && client$1) {
82
- clientCache.cacheClient(client$1);
83
- }
84
- const userIntegrations = options.integrations;
85
- client$1.on("orchestrion.module-injected", (moduleName) => {
86
- const factory = core.GLOBAL_OBJ.__SENTRY_ORCHESTRION__?.integrations?.get(moduleName);
87
- if (!usesSdkDefaults || !factory) {
88
- return;
89
- }
90
- const integration = factory();
91
- if (typeof userIntegrations !== "function") {
92
- client$1.addIntegration(integration);
93
- return;
94
- }
95
- const kept = core.safeCallback(
96
- debugBuild.DEBUG_BUILD ? "Error in the `integrations` function, skipping a late-loaded integration:" : "",
97
- () => core.getIntegrationsToSetup({ defaultIntegrations: [integration], integrations: userIntegrations }).find(
98
- ({ name }) => name === integration.name
99
- ),
100
- () => void 0
101
- );
102
- if (kept) {
103
- client$1.addIntegration(kept);
104
- }
105
- });
106
- return client$1;
59
+ const cached = require_clientCache.getCachedClient();
60
+ const cacheEnabled = options.cacheClient !== false;
61
+ if (cacheEnabled && cached && !(0, _sentry_core._INTERNAL_isClientClosed)(cached)) {
62
+ if (require_debug_build.DEBUG_BUILD && cached.getOptions().dsn !== options.dsn) _sentry_core.debug.warn("[Sentry] init() was called with a different DSN than the cached client of this isolate; the cached client keeps its DSN. Pass `cacheClient: false` for per-invocation options.");
63
+ (0, _sentry_core.getCurrentScope)().update(options.initialScope);
64
+ (0, _sentry_core.setCurrentClient)(cached);
65
+ return cached;
66
+ }
67
+ const usesSdkDefaults = options.defaultIntegrations === void 0 || !!options._extendsDefaultIntegrations;
68
+ if (options.defaultIntegrations === void 0) options.defaultIntegrations = getDefaultIntegrations(options);
69
+ const invocationContext = options.ctx;
70
+ const flushLock = !cacheEnabled && invocationContext ? require_flush.makeFlushLock(invocationContext) : void 0;
71
+ delete options.ctx;
72
+ const clientOptions = {
73
+ ...options,
74
+ cacheClient: cacheEnabled,
75
+ stackParser: (0, _sentry_core.stackParserFromStackParserOptions)(options.stackParser || require_stacktrace.defaultStackParser),
76
+ integrations: (0, _sentry_core.getIntegrationsToSetup)(options),
77
+ transport: options.transport || require_transport.makeCloudflareTransport,
78
+ flushLock
79
+ };
80
+ /*! rollup-include-development-only */
81
+ if (options.spotlight && !clientOptions.integrations.some(({ name }) => name === "Spotlight")) clientOptions.integrations.push(require_spotlight.spotlightIntegration({ sidecarUrl: typeof options.spotlight === "string" ? options.spotlight : void 0 }));
82
+ /*! rollup-include-development-only-end */
83
+ if (!cacheEnabled) (0, _sentry_core.getCurrentScope)().setClient(void 0);
84
+ const client = (0, _sentry_core.initAndBind)(require_client.CloudflareClient, clientOptions);
85
+ if (cacheEnabled && client) require_clientCache.cacheClient(client);
86
+ const userIntegrations = options.integrations;
87
+ client.on("orchestrion.module-injected", (moduleName) => {
88
+ const factory = _sentry_core.GLOBAL_OBJ.__SENTRY_ORCHESTRION__?.integrations?.get(moduleName);
89
+ if (!usesSdkDefaults || !factory) return;
90
+ const integration = factory();
91
+ if (typeof userIntegrations !== "function") {
92
+ client.addIntegration(integration);
93
+ return;
94
+ }
95
+ const kept = (0, _sentry_core.safeCallback)(require_debug_build.DEBUG_BUILD ? "Error in the `integrations` function, skipping a late-loaded integration:" : "", () => (0, _sentry_core.getIntegrationsToSetup)({
96
+ defaultIntegrations: [integration],
97
+ integrations: userIntegrations
98
+ }).find(({ name }) => name === integration.name), () => void 0);
99
+ if (kept) client.addIntegration(kept);
100
+ });
101
+ return client;
107
102
  }
108
-
109
103
  exports.getDefaultIntegrations = getDefaultIntegrations;
110
104
  exports.initBaseSdk = initBaseSdk;
111
- //# sourceMappingURL=baseSdk.js.map
105
+
106
+ //# sourceMappingURL=baseSdk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"baseSdk.js","sources":["../../../src/baseSdk.ts"],"sourcesContent":["import type { Integration } from '@sentry/core';\nimport { _INTERNAL_isClientClosed, debug, getCurrentScope, safeCallback, setCurrentClient } from '@sentry/core';\nimport {\n consoleIntegration,\n conversationIdIntegration,\n dedupeIntegration,\n eventFiltersIntegration,\n functionToStringIntegration,\n getIntegrationsToSetup,\n GLOBAL_OBJ,\n initAndBind,\n linkedErrorsIntegration,\n requestDataIntegration,\n stackParserFromStackParserOptions,\n} from '@sentry/core';\nimport type { CloudflareClientOptions, CloudflareOptions } from './client';\nimport { CloudflareClient } from './client';\nimport { makeFlushLock } from './flush';\nimport { cacheClient, getCachedClient } from './clientCache';\nimport { DEBUG_BUILD } from './debug-build';\nimport { fetchIntegration } from './integrations/fetch';\nimport { httpServerIntegration } from './integrations/httpServer';\nimport { INTEGRATION_NAME as SPOTLIGHT_INTEGRATION_NAME, spotlightIntegration } from './integrations/spotlight';\nimport { makeCloudflareTransport } from './transport';\nimport { defaultStackParser } from './vendor/stacktrace';\n\n/**\n * Instantiate the channel-subscriber factories the `@sentry/cloudflare/vite`\n * plugin registered on the global marker. The plugin splices a small snippet\n * into each instrumented module that `.set`s its factory here (keyed by module\n * name), so the marker holds one factory per package actually bundled.\n *\n * The marker is read directly instead of importing the factories, so a worker\n * built without the plugin — where the channels never fire — ships none of this\n * code.\n */\nfunction getRegisteredChannelIntegrations(): Integration[] {\n const registered = GLOBAL_OBJ.__SENTRY_ORCHESTRION__?.integrations;\n\n return registered ? [...registered.values()].map(factory => factory()) : [];\n}\n\n/**\n * Get the default integrations for the Cloudflare SDK.\n * These also work on Workers-compatible runtimes without the `nodejs_compat` compatibility flag.\n */\nexport function getDefaultIntegrations(options: CloudflareOptions): Integration[] {\n return [\n // The Dedupe integration should not be used in workflows because we want to\n // capture all step failures, even if they are the same error.\n ...(options.enableDedupe === false ? [] : [dedupeIntegration()]),\n eventFiltersIntegration(),\n functionToStringIntegration(),\n conversationIdIntegration(),\n linkedErrorsIntegration(),\n fetchIntegration(),\n httpServerIntegration(),\n requestDataIntegration(),\n consoleIntegration(),\n // The orchestrion diagnostics-channel subscribers (mysql, pg, …). The\n // `@sentry/cloudflare/vite` plugin injects the channels at build time and,\n // next to each, a snippet that registers the matching subscriber factory on\n // the global marker. Read from there instead of importing them so bundles\n // built without the plugin — where the channels would never fire — don't\n // ship the code.\n ...getRegisteredChannelIntegrations(),\n ];\n}\n\n/**\n * Initializes the Cloudflare SDK without setting up an OpenTelemetry tracer provider.\n *\n * Kept separate from `sdk.ts` so `@sentry/cloudflare/request` can load without Node.js-only\n * dependencies on runtimes such as Shopify Oxygen.\n *\n * The client is cached and reused across invocations within the same isolate,\n * unless `cacheClient: false` is passed. This avoids the\n * per-invocation cost of constructing a new client, and it is what makes\n * Durable Object telemetry reliable: a per-invocation client is disposed at\n * the end of the handler, and in a Durable Object there is no `waitUntil`\n * boundary that reliably extends execution, so spans/events that end after\n * disposal would otherwise be lost.\n */\nexport function initBaseSdk(options: CloudflareOptions): CloudflareClient | undefined {\n const cached = getCachedClient();\n const cacheEnabled = options.cacheClient !== false;\n\n // A closed client drops all data. `close()` marks the client before it\n // flushes, so this also skips a client that is still closing.\n if (cacheEnabled && cached && !_INTERNAL_isClientClosed(cached)) {\n if (DEBUG_BUILD && cached.getOptions().dsn !== options.dsn) {\n debug.warn(\n '[Sentry] init() was called with a different DSN than the cached client of this isolate; the cached client keeps its DSN. Pass `cacheClient: false` for per-invocation options.',\n );\n }\n getCurrentScope().update(options.initialScope);\n setCurrentClient(cached);\n return cached;\n }\n\n // `false` or a custom list turns off the SDK defaults, late-loaded ones\n // included, unless an SDK built the list from the defaults.\n const usesSdkDefaults = options.defaultIntegrations === undefined || !!options._extendsDefaultIntegrations;\n if (options.defaultIntegrations === undefined) {\n options.defaultIntegrations = getDefaultIntegrations(options);\n }\n\n // A cached client outlives any single invocation, so binding it to one\n // invocation's flush lock would make later flushes wait on that invocation's\n // waitUntil work forever. Eager delivery replaces the flush lock's purpose.\n const invocationContext = options.ctx;\n const flushLock = !cacheEnabled && invocationContext ? makeFlushLock(invocationContext) : undefined;\n delete options.ctx;\n\n const clientOptions: CloudflareClientOptions = {\n ...options,\n cacheClient: cacheEnabled,\n stackParser: stackParserFromStackParserOptions(options.stackParser || defaultStackParser),\n integrations: getIntegrationsToSetup(options),\n transport: options.transport || makeCloudflareTransport,\n flushLock,\n };\n\n /*! rollup-include-development-only */\n if (options.spotlight && !clientOptions.integrations.some(({ name }) => name === SPOTLIGHT_INTEGRATION_NAME)) {\n clientOptions.integrations.push(\n spotlightIntegration({\n sidecarUrl: typeof options.spotlight === 'string' ? options.spotlight : undefined,\n }),\n );\n }\n /*! rollup-include-development-only-end */\n\n if (!cacheEnabled) {\n // `cacheClient: false` asks for a new client on each call, so replacing\n // the bound client is expected here and must not warn.\n getCurrentScope().setClient(undefined);\n }\n\n const client = initAndBind(CloudflareClient, clientOptions) as CloudflareClient;\n\n if (cacheEnabled && client) {\n cacheClient(client);\n }\n\n // An instrumented module that first evaluates AFTER this init (e.g. a driver\n // lazily required on first use) stores its subscriber factory on the global\n // marker too late for the default-integrations snapshot above. Its injected\n // snippet emits this event right after storing the factory, so install the\n // integration on the live client here, with the same rules as the defaults.\n // `addIntegration` dedupes by integration name, so an integration the user\n // configured stays in place.\n const userIntegrations = options.integrations;\n client.on('orchestrion.module-injected', moduleName => {\n const factory = GLOBAL_OBJ.__SENTRY_ORCHESTRION__?.integrations?.get(moduleName);\n if (!usesSdkDefaults || !factory) {\n return;\n }\n\n const integration = factory();\n if (typeof userIntegrations !== 'function') {\n client.addIntegration(integration);\n return;\n }\n\n // Pass the late default through the user's `integrations` function, so a\n // filter that removed it at init removes it here too. This calls the\n // function again, once for each late module. If the function throws, skip\n // the integration, so the module load that emitted the event still works.\n const kept = safeCallback(\n DEBUG_BUILD ? 'Error in the `integrations` function, skipping a late-loaded integration:' : '',\n () =>\n getIntegrationsToSetup({ defaultIntegrations: [integration], integrations: userIntegrations }).find(\n ({ name }) => name === integration.name,\n ),\n () => undefined,\n );\n if (kept) {\n client.addIntegration(kept);\n }\n });\n\n return client;\n}\n"],"names":["GLOBAL_OBJ","dedupeIntegration","eventFiltersIntegration","functionToStringIntegration","conversationIdIntegration","linkedErrorsIntegration","fetchIntegration","httpServerIntegration","requestDataIntegration","consoleIntegration","getCachedClient","_INTERNAL_isClientClosed","DEBUG_BUILD","debug","getCurrentScope","setCurrentClient","makeFlushLock","stackParserFromStackParserOptions","defaultStackParser","getIntegrationsToSetup","makeCloudflareTransport","SPOTLIGHT_INTEGRATION_NAME","spotlightIntegration","client","initAndBind","CloudflareClient","cacheClient","safeCallback"],"mappings":"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"}
1
+ {"version":3,"file":"baseSdk.js","names":["GLOBAL_OBJ","dedupeIntegration","eventFiltersIntegration","functionToStringIntegration","conversationIdIntegration","linkedErrorsIntegration","fetchIntegration","httpServerIntegration","requestDataIntegration","consoleIntegration","getCachedClient","_INTERNAL_isClientClosed","DEBUG_BUILD","debug","getCurrentScope","setCurrentClient","makeFlushLock","stackParserFromStackParserOptions","defaultStackParser","getIntegrationsToSetup","makeCloudflareTransport","spotlightIntegration","initAndBind","CloudflareClient","cacheClient","safeCallback"],"sources":["../../../src/baseSdk.ts"],"sourcesContent":["import type { Integration } from '@sentry/core';\nimport { _INTERNAL_isClientClosed, debug, getCurrentScope, safeCallback, setCurrentClient } from '@sentry/core';\nimport {\n consoleIntegration,\n conversationIdIntegration,\n dedupeIntegration,\n eventFiltersIntegration,\n functionToStringIntegration,\n getIntegrationsToSetup,\n GLOBAL_OBJ,\n initAndBind,\n linkedErrorsIntegration,\n requestDataIntegration,\n stackParserFromStackParserOptions,\n} from '@sentry/core';\nimport type { CloudflareClientOptions, CloudflareOptions } from './client';\nimport { CloudflareClient } from './client';\nimport { makeFlushLock } from './flush';\nimport { cacheClient, getCachedClient } from './clientCache';\nimport { DEBUG_BUILD } from './debug-build';\nimport { fetchIntegration } from './integrations/fetch';\nimport { httpServerIntegration } from './integrations/httpServer';\nimport { INTEGRATION_NAME as SPOTLIGHT_INTEGRATION_NAME, spotlightIntegration } from './integrations/spotlight';\nimport { makeCloudflareTransport } from './transport';\nimport { defaultStackParser } from './vendor/stacktrace';\n\n/**\n * Instantiate the channel-subscriber factories the `@sentry/cloudflare/vite`\n * plugin registered on the global marker. The plugin splices a small snippet\n * into each instrumented module that `.set`s its factory here (keyed by module\n * name), so the marker holds one factory per package actually bundled.\n *\n * The marker is read directly instead of importing the factories, so a worker\n * built without the plugin — where the channels never fire — ships none of this\n * code.\n */\nfunction getRegisteredChannelIntegrations(): Integration[] {\n const registered = GLOBAL_OBJ.__SENTRY_ORCHESTRION__?.integrations;\n\n return registered ? [...registered.values()].map(factory => factory()) : [];\n}\n\n/**\n * Get the default integrations for the Cloudflare SDK.\n * These also work on Workers-compatible runtimes without the `nodejs_compat` compatibility flag.\n */\nexport function getDefaultIntegrations(options: CloudflareOptions): Integration[] {\n return [\n // The Dedupe integration should not be used in workflows because we want to\n // capture all step failures, even if they are the same error.\n ...(options.enableDedupe === false ? [] : [dedupeIntegration()]),\n eventFiltersIntegration(),\n functionToStringIntegration(),\n conversationIdIntegration(),\n linkedErrorsIntegration(),\n fetchIntegration(),\n httpServerIntegration(),\n requestDataIntegration(),\n consoleIntegration(),\n // The orchestrion diagnostics-channel subscribers (mysql, pg, …). The\n // `@sentry/cloudflare/vite` plugin injects the channels at build time and,\n // next to each, a snippet that registers the matching subscriber factory on\n // the global marker. Read from there instead of importing them so bundles\n // built without the plugin — where the channels would never fire — don't\n // ship the code.\n ...getRegisteredChannelIntegrations(),\n ];\n}\n\n/**\n * Initializes the Cloudflare SDK without setting up an OpenTelemetry tracer provider.\n *\n * Kept separate from `sdk.ts` so `@sentry/cloudflare/request` can load without Node.js-only\n * dependencies on runtimes such as Shopify Oxygen.\n *\n * The client is cached and reused across invocations within the same isolate,\n * unless `cacheClient: false` is passed. This avoids the\n * per-invocation cost of constructing a new client, and it is what makes\n * Durable Object telemetry reliable: a per-invocation client is disposed at\n * the end of the handler, and in a Durable Object there is no `waitUntil`\n * boundary that reliably extends execution, so spans/events that end after\n * disposal would otherwise be lost.\n */\nexport function initBaseSdk(options: CloudflareOptions): CloudflareClient | undefined {\n const cached = getCachedClient();\n // oxlint-disable-next-line typescript/no-deprecated\n const cacheEnabled = options.cacheClient !== false;\n\n // A closed client drops all data. `close()` marks the client before it\n // flushes, so this also skips a client that is still closing.\n if (cacheEnabled && cached && !_INTERNAL_isClientClosed(cached)) {\n if (DEBUG_BUILD && cached.getOptions().dsn !== options.dsn) {\n debug.warn(\n '[Sentry] init() was called with a different DSN than the cached client of this isolate; the cached client keeps its DSN. Pass `cacheClient: false` for per-invocation options.',\n );\n }\n getCurrentScope().update(options.initialScope);\n setCurrentClient(cached);\n return cached;\n }\n\n // `false` or a custom list turns off the SDK defaults, late-loaded ones\n // included, unless an SDK built the list from the defaults.\n const usesSdkDefaults = options.defaultIntegrations === undefined || !!options._extendsDefaultIntegrations;\n if (options.defaultIntegrations === undefined) {\n options.defaultIntegrations = getDefaultIntegrations(options);\n }\n\n // A cached client outlives any single invocation, so binding it to one\n // invocation's flush lock would make later flushes wait on that invocation's\n // waitUntil work forever. Eager delivery replaces the flush lock's purpose.\n const invocationContext = options.ctx;\n const flushLock = !cacheEnabled && invocationContext ? makeFlushLock(invocationContext) : undefined;\n delete options.ctx;\n\n const clientOptions: CloudflareClientOptions = {\n ...options,\n // oxlint-disable-next-line typescript/no-deprecated\n cacheClient: cacheEnabled,\n stackParser: stackParserFromStackParserOptions(options.stackParser || defaultStackParser),\n integrations: getIntegrationsToSetup(options),\n transport: options.transport || makeCloudflareTransport,\n flushLock,\n };\n\n /*! rollup-include-development-only */\n if (options.spotlight && !clientOptions.integrations.some(({ name }) => name === SPOTLIGHT_INTEGRATION_NAME)) {\n clientOptions.integrations.push(\n spotlightIntegration({\n sidecarUrl: typeof options.spotlight === 'string' ? options.spotlight : undefined,\n }),\n );\n }\n /*! rollup-include-development-only-end */\n\n if (!cacheEnabled) {\n // `cacheClient: false` asks for a new client on each call, so replacing\n // the bound client is expected here and must not warn.\n getCurrentScope().setClient(undefined);\n }\n\n const client = initAndBind(CloudflareClient, clientOptions) as CloudflareClient;\n\n if (cacheEnabled && client) {\n cacheClient(client);\n }\n\n // An instrumented module that first evaluates AFTER this init (e.g. a driver\n // lazily required on first use) stores its subscriber factory on the global\n // marker too late for the default-integrations snapshot above. Its injected\n // snippet emits this event right after storing the factory, so install the\n // integration on the live client here, with the same rules as the defaults.\n // `addIntegration` dedupes by integration name, so an integration the user\n // configured stays in place.\n const userIntegrations = options.integrations;\n client.on('orchestrion.module-injected', moduleName => {\n const factory = GLOBAL_OBJ.__SENTRY_ORCHESTRION__?.integrations?.get(moduleName);\n if (!usesSdkDefaults || !factory) {\n return;\n }\n\n const integration = factory();\n if (typeof userIntegrations !== 'function') {\n client.addIntegration(integration);\n return;\n }\n\n // Pass the late default through the user's `integrations` function, so a\n // filter that removed it at init removes it here too. This calls the\n // function again, once for each late module. If the function throws, skip\n // the integration, so the module load that emitted the event still works.\n const kept = safeCallback(\n DEBUG_BUILD ? 'Error in the `integrations` function, skipping a late-loaded integration:' : '',\n () =>\n getIntegrationsToSetup({ defaultIntegrations: [integration], integrations: userIntegrations }).find(\n ({ name }) => name === integration.name,\n ),\n () => undefined,\n );\n if (kept) {\n client.addIntegration(kept);\n }\n });\n\n return client;\n}\n"],"mappings":"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"}