@sentry/cloudflare 10.69.0 → 11.0.0-alpha.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 (771) hide show
  1. package/README.md +3 -7
  2. package/build/cjs/{sdk.js → dev/baseSdk.js} +27 -17
  3. package/build/cjs/dev/baseSdk.js.map +1 -0
  4. package/build/cjs/dev/client.js.map +1 -0
  5. package/build/cjs/dev/debug-build.js.map +1 -0
  6. package/build/cjs/dev/defineCloudflareOptions.js.map +1 -0
  7. package/build/cjs/dev/durableobject.js +234 -0
  8. package/build/cjs/dev/durableobject.js.map +1 -0
  9. package/build/cjs/dev/flush.js.map +1 -0
  10. package/build/cjs/{index.js → dev/index.js} +15 -17
  11. package/build/cjs/{index.js.map → dev/index.js.map} +1 -1
  12. package/build/cjs/dev/instrument.js.map +1 -0
  13. package/build/cjs/{instrumentations → dev/instrumentations}/agents/index.js +2 -0
  14. package/build/cjs/dev/instrumentations/agents/index.js.map +1 -0
  15. package/build/cjs/{instrumentations → dev/instrumentations}/agents/instrumentAgentCallableRpc.js +2 -2
  16. package/build/cjs/dev/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -0
  17. package/build/cjs/dev/instrumentations/agents/instrumentAgentRequestConversation.js +19 -0
  18. package/build/cjs/dev/instrumentations/agents/instrumentAgentRequestConversation.js.map +1 -0
  19. package/build/cjs/{instrumentations → dev/instrumentations}/agents/instrumentChatAgentConversation.js +3 -3
  20. package/build/cjs/dev/instrumentations/agents/instrumentChatAgentConversation.js.map +1 -0
  21. package/build/cjs/dev/instrumentations/agents/types.js +77 -0
  22. package/build/cjs/dev/instrumentations/agents/types.js.map +1 -0
  23. package/build/cjs/dev/instrumentations/instrumentDurableObjectNamespace.js.map +1 -0
  24. package/build/cjs/dev/instrumentations/instrumentDurableObjectStorage.js.map +1 -0
  25. package/build/cjs/dev/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +1 -0
  26. package/build/cjs/dev/instrumentations/instrumentSqlStorage.js.map +1 -0
  27. package/build/cjs/{instrumentations → dev/instrumentations}/instrumentWorkerEntrypoint.js +3 -3
  28. package/build/cjs/dev/instrumentations/instrumentWorkerEntrypoint.js.map +1 -0
  29. package/build/cjs/{instrumentations → dev/instrumentations}/worker/instrumentD1.js +0 -4
  30. package/build/cjs/dev/instrumentations/worker/instrumentD1.js.map +1 -0
  31. package/build/cjs/{instrumentations → dev/instrumentations}/worker/instrumentEmail.js +3 -1
  32. package/build/cjs/dev/instrumentations/worker/instrumentEmail.js.map +1 -0
  33. package/build/cjs/{instrumentations → dev/instrumentations}/worker/instrumentEnv.js +3 -4
  34. package/build/cjs/dev/instrumentations/worker/instrumentEnv.js.map +1 -0
  35. package/build/cjs/{instrumentations → dev/instrumentations}/worker/instrumentFetch.js +9 -3
  36. package/build/cjs/dev/instrumentations/worker/instrumentFetch.js.map +1 -0
  37. package/build/cjs/dev/instrumentations/worker/instrumentFetcher.js.map +1 -0
  38. package/build/cjs/{instrumentations → dev/instrumentations}/worker/instrumentQueue.js +3 -2
  39. package/build/cjs/dev/instrumentations/worker/instrumentQueue.js.map +1 -0
  40. package/build/cjs/dev/instrumentations/worker/instrumentQueueProducer.js.map +1 -0
  41. package/build/cjs/dev/instrumentations/worker/instrumentR2.js.map +1 -0
  42. package/build/cjs/dev/instrumentations/worker/instrumentRateLimit.js.map +1 -0
  43. package/build/cjs/{instrumentations → dev/instrumentations}/worker/instrumentScheduled.js +3 -1
  44. package/build/cjs/dev/instrumentations/worker/instrumentScheduled.js.map +1 -0
  45. package/build/cjs/dev/instrumentations/worker/instrumentTail.js.map +1 -0
  46. package/build/cjs/{integrations → dev/integrations}/fetch.js +1 -1
  47. package/build/cjs/dev/integrations/fetch.js.map +1 -0
  48. package/build/cjs/{integrations → dev/integrations}/httpServer.js +5 -4
  49. package/build/cjs/dev/integrations/httpServer.js.map +1 -0
  50. package/build/cjs/dev/integrations/spotlight.js.map +1 -0
  51. package/build/cjs/{nodejs_compat → dev}/integrations/tracing/vercelai.js +6 -6
  52. package/build/cjs/dev/integrations/tracing/vercelai.js.map +1 -0
  53. package/build/cjs/dev/opentelemetry/tracer.js.map +1 -0
  54. package/build/cjs/{options.js → dev/options.js} +8 -0
  55. package/build/cjs/dev/options.js.map +1 -0
  56. package/build/cjs/{pages-plugin.js → dev/pages-plugin.js} +8 -3
  57. package/build/cjs/dev/pages-plugin.js.map +1 -0
  58. package/build/cjs/{request.js → dev/request.js} +23 -12
  59. package/build/cjs/dev/request.js.map +1 -0
  60. package/build/cjs/dev/scope-utils.js.map +1 -0
  61. package/build/cjs/dev/sdk.js +19 -0
  62. package/build/cjs/dev/sdk.js.map +1 -0
  63. package/build/cjs/dev/transport.js.map +1 -0
  64. package/build/cjs/{utils → dev/utils}/instrumentContext.js +8 -13
  65. package/build/cjs/dev/utils/instrumentContext.js.map +1 -0
  66. package/build/cjs/dev/utils/internalSqlQuery.js.map +1 -0
  67. package/build/cjs/dev/utils/internalStorageKey.js.map +1 -0
  68. package/build/cjs/dev/utils/invocationScope.js +12 -0
  69. package/build/cjs/dev/utils/invocationScope.js.map +1 -0
  70. package/build/cjs/dev/utils/isBinding.js.map +1 -0
  71. package/build/cjs/dev/utils/isCloudflareClass.js.map +1 -0
  72. package/build/cjs/{utils → dev/utils}/rpcMeta.js +4 -0
  73. package/build/cjs/dev/utils/rpcMeta.js.map +1 -0
  74. package/build/cjs/dev/utils/streaming.js.map +1 -0
  75. package/build/cjs/dev/utils/traceLinks.js.map +1 -0
  76. package/build/cjs/dev/vendor/stacktrace.js.map +1 -0
  77. package/build/cjs/dev/vite/agentClass.js.map +1 -0
  78. package/build/cjs/dev/vite/autoInstrument.js.map +1 -0
  79. package/build/cjs/{vite → dev/vite}/index.js +3 -1
  80. package/build/cjs/dev/vite/index.js.map +1 -0
  81. package/build/cjs/dev/vite/instrumentFile.js.map +1 -0
  82. package/build/cjs/dev/vite/moduleShape.js.map +1 -0
  83. package/build/cjs/dev/vite/transform.js.map +1 -0
  84. package/build/cjs/dev/vite/workerEntrypoint.js.map +1 -0
  85. package/build/cjs/dev/vite/wranglerConfig.js.map +1 -0
  86. package/build/cjs/{withSentry.js → dev/withSentry.js} +2 -19
  87. package/build/cjs/dev/withSentry.js.map +1 -0
  88. package/build/cjs/{workflows.js → dev/workflows.js} +9 -4
  89. package/build/cjs/dev/workflows.js.map +1 -0
  90. package/build/cjs/{wrapMethodWithSentry.js → dev/wrapMethodWithSentry.js} +2 -3
  91. package/build/cjs/dev/wrapMethodWithSentry.js.map +1 -0
  92. package/build/cjs/prod/baseSdk.js +73 -0
  93. package/build/cjs/prod/baseSdk.js.map +1 -0
  94. package/build/cjs/prod/client.js +122 -0
  95. package/build/cjs/prod/client.js.map +1 -0
  96. package/build/cjs/prod/debug-build.js +6 -0
  97. package/build/cjs/prod/debug-build.js.map +1 -0
  98. package/build/cjs/prod/defineCloudflareOptions.js +11 -0
  99. package/build/cjs/prod/defineCloudflareOptions.js.map +1 -0
  100. package/build/cjs/prod/durableobject.js +234 -0
  101. package/build/cjs/prod/durableobject.js.map +1 -0
  102. package/build/cjs/prod/flush.js +87 -0
  103. package/build/cjs/prod/flush.js.map +1 -0
  104. package/build/cjs/{nodejs_compat → prod}/index.js +33 -37
  105. package/build/cjs/{nodejs_compat → prod}/index.js.map +1 -1
  106. package/build/cjs/prod/instrument.js +52 -0
  107. package/build/cjs/prod/instrument.js.map +1 -0
  108. package/build/cjs/prod/instrumentations/agents/index.js +16 -0
  109. package/build/cjs/prod/instrumentations/agents/index.js.map +1 -0
  110. package/build/cjs/prod/instrumentations/agents/instrumentAgentCallableRpc.js +52 -0
  111. package/build/cjs/prod/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -0
  112. package/build/cjs/prod/instrumentations/agents/instrumentAgentRequestConversation.js +19 -0
  113. package/build/cjs/prod/instrumentations/agents/instrumentAgentRequestConversation.js.map +1 -0
  114. package/build/cjs/prod/instrumentations/agents/instrumentChatAgentConversation.js +31 -0
  115. package/build/cjs/prod/instrumentations/agents/instrumentChatAgentConversation.js.map +1 -0
  116. package/build/cjs/prod/instrumentations/agents/types.js +77 -0
  117. package/build/cjs/prod/instrumentations/agents/types.js.map +1 -0
  118. package/build/cjs/prod/instrumentations/instrumentDurableObjectNamespace.js +41 -0
  119. package/build/cjs/prod/instrumentations/instrumentDurableObjectNamespace.js.map +1 -0
  120. package/build/cjs/prod/instrumentations/instrumentDurableObjectStorage.js +72 -0
  121. package/build/cjs/prod/instrumentations/instrumentDurableObjectStorage.js.map +1 -0
  122. package/build/cjs/prod/instrumentations/instrumentDurableObjectSyncKvStorage.js +40 -0
  123. package/build/cjs/prod/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +1 -0
  124. package/build/cjs/prod/instrumentations/instrumentSqlStorage.js +42 -0
  125. package/build/cjs/prod/instrumentations/instrumentSqlStorage.js.map +1 -0
  126. package/build/cjs/prod/instrumentations/instrumentWorkerEntrypoint.js +139 -0
  127. package/build/cjs/prod/instrumentations/instrumentWorkerEntrypoint.js.map +1 -0
  128. package/build/cjs/prod/instrumentations/worker/instrumentD1.js +161 -0
  129. package/build/cjs/prod/instrumentations/worker/instrumentD1.js.map +1 -0
  130. package/build/cjs/prod/instrumentations/worker/instrumentEmail.js +63 -0
  131. package/build/cjs/prod/instrumentations/worker/instrumentEmail.js.map +1 -0
  132. package/build/cjs/prod/instrumentations/worker/instrumentEnv.js +90 -0
  133. package/build/cjs/prod/instrumentations/worker/instrumentEnv.js.map +1 -0
  134. package/build/cjs/prod/instrumentations/worker/instrumentFetch.js +54 -0
  135. package/build/cjs/prod/instrumentations/worker/instrumentFetch.js.map +1 -0
  136. package/build/cjs/prod/instrumentations/worker/instrumentFetcher.js +24 -0
  137. package/build/cjs/prod/instrumentations/worker/instrumentFetcher.js.map +1 -0
  138. package/build/cjs/prod/instrumentations/worker/instrumentQueue.js +82 -0
  139. package/build/cjs/prod/instrumentations/worker/instrumentQueue.js.map +1 -0
  140. package/build/cjs/prod/instrumentations/worker/instrumentQueueProducer.js +80 -0
  141. package/build/cjs/prod/instrumentations/worker/instrumentQueueProducer.js.map +1 -0
  142. package/build/cjs/prod/instrumentations/worker/instrumentR2.js +124 -0
  143. package/build/cjs/prod/instrumentations/worker/instrumentR2.js.map +1 -0
  144. package/build/cjs/prod/instrumentations/worker/instrumentRateLimit.js +29 -0
  145. package/build/cjs/prod/instrumentations/worker/instrumentRateLimit.js.map +1 -0
  146. package/build/cjs/prod/instrumentations/worker/instrumentScheduled.js +78 -0
  147. package/build/cjs/prod/instrumentations/worker/instrumentScheduled.js.map +1 -0
  148. package/build/cjs/prod/instrumentations/worker/instrumentTail.js +60 -0
  149. package/build/cjs/prod/instrumentations/worker/instrumentTail.js.map +1 -0
  150. package/build/cjs/prod/integrations/fetch.js +119 -0
  151. package/build/cjs/prod/integrations/fetch.js.map +1 -0
  152. package/build/cjs/prod/integrations/httpServer.js +36 -0
  153. package/build/cjs/prod/integrations/httpServer.js.map +1 -0
  154. package/build/cjs/prod/integrations/spotlight.js +64 -0
  155. package/build/cjs/prod/integrations/spotlight.js.map +1 -0
  156. package/build/cjs/{integrations → prod/integrations}/tracing/vercelai.js +5 -5
  157. package/build/cjs/prod/integrations/tracing/vercelai.js.map +1 -0
  158. package/build/cjs/prod/opentelemetry/tracer.js +49 -0
  159. package/build/cjs/prod/opentelemetry/tracer.js.map +1 -0
  160. package/build/cjs/prod/options.js +33 -0
  161. package/build/cjs/prod/options.js.map +1 -0
  162. package/build/cjs/prod/pages-plugin.js +24 -0
  163. package/build/cjs/prod/pages-plugin.js.map +1 -0
  164. package/build/cjs/prod/request.js +132 -0
  165. package/build/cjs/prod/request.js.map +1 -0
  166. package/build/cjs/prod/scope-utils.js +22 -0
  167. package/build/cjs/prod/scope-utils.js.map +1 -0
  168. package/build/cjs/prod/sdk.js +19 -0
  169. package/build/cjs/prod/sdk.js.map +1 -0
  170. package/build/cjs/prod/transport.js +75 -0
  171. package/build/cjs/prod/transport.js.map +1 -0
  172. package/build/cjs/prod/utils/instrumentContext.js +63 -0
  173. package/build/cjs/prod/utils/instrumentContext.js.map +1 -0
  174. package/build/cjs/prod/utils/internalSqlQuery.js +25 -0
  175. package/build/cjs/prod/utils/internalSqlQuery.js.map +1 -0
  176. package/build/cjs/prod/utils/internalStorageKey.js +44 -0
  177. package/build/cjs/prod/utils/internalStorageKey.js.map +1 -0
  178. package/build/cjs/prod/utils/invocationScope.js +12 -0
  179. package/build/cjs/prod/utils/invocationScope.js.map +1 -0
  180. package/build/cjs/prod/utils/isBinding.js +37 -0
  181. package/build/cjs/prod/utils/isBinding.js.map +1 -0
  182. package/build/cjs/prod/utils/isCloudflareClass.js +23 -0
  183. package/build/cjs/prod/utils/isCloudflareClass.js.map +1 -0
  184. package/build/cjs/prod/utils/rpcMeta.js +39 -0
  185. package/build/cjs/prod/utils/rpcMeta.js.map +1 -0
  186. package/build/cjs/prod/utils/streaming.js +16 -0
  187. package/build/cjs/prod/utils/streaming.js.map +1 -0
  188. package/build/cjs/prod/utils/traceLinks.js +54 -0
  189. package/build/cjs/prod/utils/traceLinks.js.map +1 -0
  190. package/build/cjs/prod/vendor/stacktrace.js +28 -0
  191. package/build/cjs/prod/vendor/stacktrace.js.map +1 -0
  192. package/build/cjs/prod/vite/agentClass.js +114 -0
  193. package/build/cjs/prod/vite/agentClass.js.map +1 -0
  194. package/build/cjs/prod/vite/autoInstrument.js +94 -0
  195. package/build/cjs/prod/vite/autoInstrument.js.map +1 -0
  196. package/build/cjs/prod/vite/index.js +16 -0
  197. package/build/cjs/prod/vite/index.js.map +1 -0
  198. package/build/cjs/prod/vite/instrumentFile.js +31 -0
  199. package/build/cjs/prod/vite/instrumentFile.js.map +1 -0
  200. package/build/cjs/prod/vite/moduleShape.js +231 -0
  201. package/build/cjs/prod/vite/moduleShape.js.map +1 -0
  202. package/build/cjs/prod/vite/transform.js +149 -0
  203. package/build/cjs/prod/vite/transform.js.map +1 -0
  204. package/build/cjs/prod/vite/workerEntrypoint.js +66 -0
  205. package/build/cjs/prod/vite/workerEntrypoint.js.map +1 -0
  206. package/build/cjs/prod/vite/wranglerConfig.js +54 -0
  207. package/build/cjs/prod/vite/wranglerConfig.js.map +1 -0
  208. package/build/cjs/prod/withSentry.js +29 -0
  209. package/build/cjs/prod/withSentry.js.map +1 -0
  210. package/build/cjs/prod/workflows.js +139 -0
  211. package/build/cjs/prod/workflows.js.map +1 -0
  212. package/build/cjs/prod/wrapMethodWithSentry.js +134 -0
  213. package/build/cjs/prod/wrapMethodWithSentry.js.map +1 -0
  214. package/build/esm/{sdk.js → dev/baseSdk.js} +26 -17
  215. package/build/esm/dev/baseSdk.js.map +1 -0
  216. package/build/esm/dev/client.js.map +1 -0
  217. package/build/esm/dev/debug-build.js.map +1 -0
  218. package/build/esm/dev/defineCloudflareOptions.js.map +1 -0
  219. package/build/esm/dev/durableobject.js +229 -0
  220. package/build/esm/dev/durableobject.js.map +1 -0
  221. package/build/esm/dev/flush.js.map +1 -0
  222. package/build/esm/dev/index.js +15 -0
  223. package/build/esm/{index.js.map → dev/index.js.map} +1 -1
  224. package/build/esm/dev/instrument.js.map +1 -0
  225. package/build/esm/{instrumentations → dev/instrumentations}/agents/index.js +2 -0
  226. package/build/esm/dev/instrumentations/agents/index.js.map +1 -0
  227. package/build/esm/{instrumentations → dev/instrumentations}/agents/instrumentAgentCallableRpc.js +2 -2
  228. package/build/esm/dev/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -0
  229. package/build/esm/dev/instrumentations/agents/instrumentAgentRequestConversation.js +17 -0
  230. package/build/esm/dev/instrumentations/agents/instrumentAgentRequestConversation.js.map +1 -0
  231. package/build/esm/{instrumentations → dev/instrumentations}/agents/instrumentChatAgentConversation.js +4 -4
  232. package/build/esm/dev/instrumentations/agents/instrumentChatAgentConversation.js.map +1 -0
  233. package/build/esm/dev/instrumentations/agents/types.js +69 -0
  234. package/build/esm/dev/instrumentations/agents/types.js.map +1 -0
  235. package/build/esm/dev/instrumentations/instrumentDurableObjectNamespace.js.map +1 -0
  236. package/build/esm/dev/instrumentations/instrumentDurableObjectStorage.js.map +1 -0
  237. package/build/esm/dev/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +1 -0
  238. package/build/esm/dev/instrumentations/instrumentSqlStorage.js.map +1 -0
  239. package/build/esm/{instrumentations → dev/instrumentations}/instrumentWorkerEntrypoint.js +2 -2
  240. package/build/esm/dev/instrumentations/instrumentWorkerEntrypoint.js.map +1 -0
  241. package/build/esm/{instrumentations → dev/instrumentations}/worker/instrumentD1.js +1 -4
  242. package/build/esm/dev/instrumentations/worker/instrumentD1.js.map +1 -0
  243. package/build/esm/{instrumentations → dev/instrumentations}/worker/instrumentEmail.js +3 -1
  244. package/build/esm/dev/instrumentations/worker/instrumentEmail.js.map +1 -0
  245. package/build/esm/{instrumentations → dev/instrumentations}/worker/instrumentEnv.js +3 -4
  246. package/build/esm/dev/instrumentations/worker/instrumentEnv.js.map +1 -0
  247. package/build/esm/{instrumentations → dev/instrumentations}/worker/instrumentFetch.js +10 -4
  248. package/build/esm/dev/instrumentations/worker/instrumentFetch.js.map +1 -0
  249. package/build/esm/dev/instrumentations/worker/instrumentFetcher.js.map +1 -0
  250. package/build/esm/{instrumentations → dev/instrumentations}/worker/instrumentQueue.js +4 -3
  251. package/build/esm/dev/instrumentations/worker/instrumentQueue.js.map +1 -0
  252. package/build/esm/dev/instrumentations/worker/instrumentQueueProducer.js.map +1 -0
  253. package/build/esm/dev/instrumentations/worker/instrumentR2.js.map +1 -0
  254. package/build/esm/dev/instrumentations/worker/instrumentRateLimit.js.map +1 -0
  255. package/build/esm/{instrumentations → dev/instrumentations}/worker/instrumentScheduled.js +3 -1
  256. package/build/esm/dev/instrumentations/worker/instrumentScheduled.js.map +1 -0
  257. package/build/esm/dev/instrumentations/worker/instrumentTail.js.map +1 -0
  258. package/build/esm/{integrations → dev/integrations}/fetch.js +1 -1
  259. package/build/esm/dev/integrations/fetch.js.map +1 -0
  260. package/build/esm/{integrations → dev/integrations}/httpServer.js +5 -4
  261. package/build/esm/dev/integrations/httpServer.js.map +1 -0
  262. package/build/esm/dev/integrations/spotlight.js.map +1 -0
  263. package/build/esm/{integrations → dev/integrations}/tracing/vercelai.js +5 -5
  264. package/build/esm/dev/integrations/tracing/vercelai.js.map +1 -0
  265. package/build/esm/dev/opentelemetry/tracer.js.map +1 -0
  266. package/build/esm/{options.js → dev/options.js} +8 -0
  267. package/build/esm/dev/options.js.map +1 -0
  268. package/build/esm/dev/package.json +1 -0
  269. package/build/esm/{pages-plugin.js → dev/pages-plugin.js} +8 -3
  270. package/build/esm/dev/pages-plugin.js.map +1 -0
  271. package/build/esm/{request.js → dev/request.js} +24 -14
  272. package/build/esm/dev/request.js.map +1 -0
  273. package/build/esm/dev/scope-utils.js.map +1 -0
  274. package/build/esm/dev/sdk.js +16 -0
  275. package/build/esm/dev/sdk.js.map +1 -0
  276. package/build/esm/dev/transport.js.map +1 -0
  277. package/build/esm/{utils → dev/utils}/instrumentContext.js +8 -13
  278. package/build/esm/dev/utils/instrumentContext.js.map +1 -0
  279. package/build/esm/dev/utils/internalSqlQuery.js.map +1 -0
  280. package/build/esm/dev/utils/internalStorageKey.js.map +1 -0
  281. package/build/esm/dev/utils/invocationScope.js +10 -0
  282. package/build/esm/dev/utils/invocationScope.js.map +1 -0
  283. package/build/esm/dev/utils/isBinding.js.map +1 -0
  284. package/build/esm/dev/utils/isCloudflareClass.js.map +1 -0
  285. package/build/esm/{utils → dev/utils}/rpcMeta.js +4 -1
  286. package/build/esm/dev/utils/rpcMeta.js.map +1 -0
  287. package/build/esm/dev/utils/streaming.js.map +1 -0
  288. package/build/esm/{utils → dev/utils}/traceLinks.js +1 -1
  289. package/build/esm/dev/utils/traceLinks.js.map +1 -0
  290. package/build/esm/dev/vendor/stacktrace.js.map +1 -0
  291. package/build/esm/dev/vite/agentClass.js.map +1 -0
  292. package/build/esm/dev/vite/autoInstrument.js.map +1 -0
  293. package/build/esm/{vite → dev/vite}/index.js +3 -1
  294. package/build/esm/dev/vite/index.js.map +1 -0
  295. package/build/esm/dev/vite/instrumentFile.js.map +1 -0
  296. package/build/esm/dev/vite/moduleShape.js.map +1 -0
  297. package/build/esm/dev/vite/transform.js.map +1 -0
  298. package/build/esm/dev/vite/workerEntrypoint.js.map +1 -0
  299. package/build/esm/dev/vite/wranglerConfig.js.map +1 -0
  300. package/build/esm/{withSentry.js → dev/withSentry.js} +1 -18
  301. package/build/esm/dev/withSentry.js.map +1 -0
  302. package/build/esm/{workflows.js → dev/workflows.js} +9 -4
  303. package/build/esm/dev/workflows.js.map +1 -0
  304. package/build/esm/{wrapMethodWithSentry.js → dev/wrapMethodWithSentry.js} +3 -4
  305. package/build/esm/dev/wrapMethodWithSentry.js.map +1 -0
  306. package/build/esm/prod/baseSdk.js +69 -0
  307. package/build/esm/prod/baseSdk.js.map +1 -0
  308. package/build/esm/prod/client.js +120 -0
  309. package/build/esm/prod/client.js.map +1 -0
  310. package/build/esm/prod/debug-build.js +4 -0
  311. package/build/esm/prod/debug-build.js.map +1 -0
  312. package/build/esm/prod/defineCloudflareOptions.js +9 -0
  313. package/build/esm/prod/defineCloudflareOptions.js.map +1 -0
  314. package/build/esm/prod/durableobject.js +229 -0
  315. package/build/esm/prod/durableobject.js.map +1 -0
  316. package/build/esm/prod/flush.js +83 -0
  317. package/build/esm/prod/flush.js.map +1 -0
  318. package/build/esm/prod/index.js +15 -0
  319. package/build/esm/{nodejs_compat → prod}/index.js.map +1 -1
  320. package/build/esm/prod/instrument.js +48 -0
  321. package/build/esm/prod/instrument.js.map +1 -0
  322. package/build/esm/prod/instrumentations/agents/index.js +14 -0
  323. package/build/esm/prod/instrumentations/agents/index.js.map +1 -0
  324. package/build/esm/prod/instrumentations/agents/instrumentAgentCallableRpc.js +50 -0
  325. package/build/esm/prod/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -0
  326. package/build/esm/prod/instrumentations/agents/instrumentAgentRequestConversation.js +17 -0
  327. package/build/esm/prod/instrumentations/agents/instrumentAgentRequestConversation.js.map +1 -0
  328. package/build/esm/prod/instrumentations/agents/instrumentChatAgentConversation.js +29 -0
  329. package/build/esm/prod/instrumentations/agents/instrumentChatAgentConversation.js.map +1 -0
  330. package/build/esm/prod/instrumentations/agents/types.js +69 -0
  331. package/build/esm/prod/instrumentations/agents/types.js.map +1 -0
  332. package/build/esm/prod/instrumentations/instrumentDurableObjectNamespace.js +38 -0
  333. package/build/esm/prod/instrumentations/instrumentDurableObjectNamespace.js.map +1 -0
  334. package/build/esm/prod/instrumentations/instrumentDurableObjectStorage.js +70 -0
  335. package/build/esm/prod/instrumentations/instrumentDurableObjectStorage.js.map +1 -0
  336. package/build/esm/prod/instrumentations/instrumentDurableObjectSyncKvStorage.js +38 -0
  337. package/build/esm/prod/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +1 -0
  338. package/build/esm/prod/instrumentations/instrumentSqlStorage.js +40 -0
  339. package/build/esm/prod/instrumentations/instrumentSqlStorage.js.map +1 -0
  340. package/build/esm/prod/instrumentations/instrumentWorkerEntrypoint.js +137 -0
  341. package/build/esm/prod/instrumentations/instrumentWorkerEntrypoint.js.map +1 -0
  342. package/build/esm/prod/instrumentations/worker/instrumentD1.js +159 -0
  343. package/build/esm/prod/instrumentations/worker/instrumentD1.js.map +1 -0
  344. package/build/esm/prod/instrumentations/worker/instrumentEmail.js +61 -0
  345. package/build/esm/prod/instrumentations/worker/instrumentEmail.js.map +1 -0
  346. package/build/esm/prod/instrumentations/worker/instrumentEnv.js +88 -0
  347. package/build/esm/prod/instrumentations/worker/instrumentEnv.js.map +1 -0
  348. package/build/esm/prod/instrumentations/worker/instrumentFetch.js +51 -0
  349. package/build/esm/prod/instrumentations/worker/instrumentFetch.js.map +1 -0
  350. package/build/esm/prod/instrumentations/worker/instrumentFetcher.js +22 -0
  351. package/build/esm/prod/instrumentations/worker/instrumentFetcher.js.map +1 -0
  352. package/build/esm/prod/instrumentations/worker/instrumentQueue.js +79 -0
  353. package/build/esm/prod/instrumentations/worker/instrumentQueue.js.map +1 -0
  354. package/build/esm/prod/instrumentations/worker/instrumentQueueProducer.js +78 -0
  355. package/build/esm/prod/instrumentations/worker/instrumentQueueProducer.js.map +1 -0
  356. package/build/esm/prod/instrumentations/worker/instrumentR2.js +122 -0
  357. package/build/esm/prod/instrumentations/worker/instrumentR2.js.map +1 -0
  358. package/build/esm/prod/instrumentations/worker/instrumentRateLimit.js +27 -0
  359. package/build/esm/prod/instrumentations/worker/instrumentRateLimit.js.map +1 -0
  360. package/build/esm/prod/instrumentations/worker/instrumentScheduled.js +75 -0
  361. package/build/esm/prod/instrumentations/worker/instrumentScheduled.js.map +1 -0
  362. package/build/esm/prod/instrumentations/worker/instrumentTail.js +57 -0
  363. package/build/esm/prod/instrumentations/worker/instrumentTail.js.map +1 -0
  364. package/build/esm/prod/integrations/fetch.js +117 -0
  365. package/build/esm/prod/integrations/fetch.js.map +1 -0
  366. package/build/esm/prod/integrations/httpServer.js +33 -0
  367. package/build/esm/prod/integrations/httpServer.js.map +1 -0
  368. package/build/esm/prod/integrations/spotlight.js +61 -0
  369. package/build/esm/prod/integrations/spotlight.js.map +1 -0
  370. package/build/esm/prod/integrations/tracing/vercelai.js +16 -0
  371. package/build/esm/prod/integrations/tracing/vercelai.js.map +1 -0
  372. package/build/esm/prod/opentelemetry/tracer.js +47 -0
  373. package/build/esm/prod/opentelemetry/tracer.js.map +1 -0
  374. package/build/esm/prod/options.js +31 -0
  375. package/build/esm/prod/options.js.map +1 -0
  376. package/build/esm/prod/package.json +1 -0
  377. package/build/esm/prod/pages-plugin.js +22 -0
  378. package/build/esm/prod/pages-plugin.js.map +1 -0
  379. package/build/esm/prod/request.js +129 -0
  380. package/build/esm/prod/request.js.map +1 -0
  381. package/build/esm/prod/scope-utils.js +18 -0
  382. package/build/esm/prod/scope-utils.js.map +1 -0
  383. package/build/esm/prod/sdk.js +16 -0
  384. package/build/esm/prod/sdk.js.map +1 -0
  385. package/build/esm/prod/transport.js +72 -0
  386. package/build/esm/prod/transport.js.map +1 -0
  387. package/build/esm/prod/utils/instrumentContext.js +61 -0
  388. package/build/esm/prod/utils/instrumentContext.js.map +1 -0
  389. package/build/esm/prod/utils/internalSqlQuery.js +23 -0
  390. package/build/esm/prod/utils/internalSqlQuery.js.map +1 -0
  391. package/build/esm/prod/utils/internalStorageKey.js +41 -0
  392. package/build/esm/prod/utils/internalStorageKey.js.map +1 -0
  393. package/build/esm/prod/utils/invocationScope.js +10 -0
  394. package/build/esm/prod/utils/invocationScope.js.map +1 -0
  395. package/build/esm/prod/utils/isBinding.js +29 -0
  396. package/build/esm/prod/utils/isBinding.js.map +1 -0
  397. package/build/esm/prod/utils/isCloudflareClass.js +21 -0
  398. package/build/esm/prod/utils/isCloudflareClass.js.map +1 -0
  399. package/build/esm/prod/utils/rpcMeta.js +35 -0
  400. package/build/esm/prod/utils/rpcMeta.js.map +1 -0
  401. package/build/esm/prod/utils/streaming.js +14 -0
  402. package/build/esm/prod/utils/streaming.js.map +1 -0
  403. package/build/esm/prod/utils/traceLinks.js +49 -0
  404. package/build/esm/prod/utils/traceLinks.js.map +1 -0
  405. package/build/esm/prod/vendor/stacktrace.js +25 -0
  406. package/build/esm/prod/vendor/stacktrace.js.map +1 -0
  407. package/build/esm/prod/vite/agentClass.js +111 -0
  408. package/build/esm/prod/vite/agentClass.js.map +1 -0
  409. package/build/esm/prod/vite/autoInstrument.js +92 -0
  410. package/build/esm/prod/vite/autoInstrument.js.map +1 -0
  411. package/build/esm/prod/vite/index.js +14 -0
  412. package/build/esm/prod/vite/index.js.map +1 -0
  413. package/build/esm/prod/vite/instrumentFile.js +27 -0
  414. package/build/esm/prod/vite/instrumentFile.js.map +1 -0
  415. package/build/esm/prod/vite/moduleShape.js +227 -0
  416. package/build/esm/prod/vite/moduleShape.js.map +1 -0
  417. package/build/esm/prod/vite/transform.js +147 -0
  418. package/build/esm/prod/vite/transform.js.map +1 -0
  419. package/build/esm/prod/vite/workerEntrypoint.js +64 -0
  420. package/build/esm/prod/vite/workerEntrypoint.js.map +1 -0
  421. package/build/esm/prod/vite/wranglerConfig.js +52 -0
  422. package/build/esm/prod/vite/wranglerConfig.js.map +1 -0
  423. package/build/esm/prod/withSentry.js +27 -0
  424. package/build/esm/prod/withSentry.js.map +1 -0
  425. package/build/esm/prod/workflows.js +136 -0
  426. package/build/esm/prod/workflows.js.map +1 -0
  427. package/build/esm/prod/wrapMethodWithSentry.js +132 -0
  428. package/build/esm/prod/wrapMethodWithSentry.js.map +1 -0
  429. package/build/types/baseSdk.d.ts +28 -0
  430. package/build/types/baseSdk.d.ts.map +1 -0
  431. package/build/types/client.d.ts +12 -39
  432. package/build/types/client.d.ts.map +1 -1
  433. package/build/types/defineCloudflareOptions.d.ts +2 -2
  434. package/build/types/defineCloudflareOptions.d.ts.map +1 -1
  435. package/build/types/durableobject.d.ts +22 -12
  436. package/build/types/durableobject.d.ts.map +1 -1
  437. package/build/types/flush.d.ts +1 -1
  438. package/build/types/flush.d.ts.map +1 -1
  439. package/build/types/index.d.ts +3 -5
  440. package/build/types/index.d.ts.map +1 -1
  441. package/build/types/instrumentations/agents/index.d.ts +4 -3
  442. package/build/types/instrumentations/agents/index.d.ts.map +1 -1
  443. package/build/types/instrumentations/agents/instrumentAgentCallableRpc.d.ts +4 -1
  444. package/build/types/instrumentations/agents/instrumentAgentCallableRpc.d.ts.map +1 -1
  445. package/build/types/instrumentations/agents/instrumentAgentRequestConversation.d.ts +16 -0
  446. package/build/types/instrumentations/agents/instrumentAgentRequestConversation.d.ts.map +1 -0
  447. package/build/types/instrumentations/agents/instrumentChatAgentConversation.d.ts +10 -9
  448. package/build/types/instrumentations/agents/instrumentChatAgentConversation.d.ts.map +1 -1
  449. package/build/types/instrumentations/agents/types.d.ts +63 -18
  450. package/build/types/instrumentations/agents/types.d.ts.map +1 -1
  451. package/build/types/instrumentations/instrumentDurableObjectStorage.d.ts.map +1 -1
  452. package/build/types/instrumentations/instrumentSqlStorage.d.ts.map +1 -1
  453. package/build/types/instrumentations/instrumentWorkerEntrypoint.d.ts +2 -1
  454. package/build/types/instrumentations/instrumentWorkerEntrypoint.d.ts.map +1 -1
  455. package/build/types/instrumentations/worker/instrumentD1.d.ts +0 -16
  456. package/build/types/instrumentations/worker/instrumentD1.d.ts.map +1 -1
  457. package/build/types/instrumentations/worker/instrumentEmail.d.ts +2 -2
  458. package/build/types/instrumentations/worker/instrumentEmail.d.ts.map +1 -1
  459. package/build/types/instrumentations/worker/instrumentEnv.d.ts.map +1 -1
  460. package/build/types/instrumentations/worker/instrumentFetch.d.ts +2 -2
  461. package/build/types/instrumentations/worker/instrumentFetch.d.ts.map +1 -1
  462. package/build/types/instrumentations/worker/instrumentQueue.d.ts +2 -2
  463. package/build/types/instrumentations/worker/instrumentQueue.d.ts.map +1 -1
  464. package/build/types/instrumentations/worker/instrumentScheduled.d.ts +2 -2
  465. package/build/types/instrumentations/worker/instrumentScheduled.d.ts.map +1 -1
  466. package/build/types/instrumentations/worker/instrumentTail.d.ts +2 -2
  467. package/build/types/instrumentations/worker/instrumentTail.d.ts.map +1 -1
  468. package/build/types/integrations/httpServer.d.ts.map +1 -1
  469. package/build/types/integrations/spotlight.d.ts +1 -1
  470. package/build/types/integrations/tracing/vercelai.d.ts +2 -9
  471. package/build/types/integrations/tracing/vercelai.d.ts.map +1 -1
  472. package/build/types/options.d.ts.map +1 -1
  473. package/build/types/pages-plugin.d.ts +1 -1
  474. package/build/types/pages-plugin.d.ts.map +1 -1
  475. package/build/types/request.d.ts +17 -2
  476. package/build/types/request.d.ts.map +1 -1
  477. package/build/types/sdk.d.ts +8 -3
  478. package/build/types/sdk.d.ts.map +1 -1
  479. package/build/types/transport.d.ts.map +1 -1
  480. package/build/types/types.d.ts +85 -0
  481. package/build/types/types.d.ts.map +1 -0
  482. package/build/types/utils/instrumentContext.d.ts.map +1 -1
  483. package/build/types/utils/invocationScope.d.ts +24 -0
  484. package/build/types/utils/invocationScope.d.ts.map +1 -0
  485. package/build/types/utils/isCloudflareClass.d.ts +1 -1
  486. package/build/types/utils/isCloudflareClass.d.ts.map +1 -1
  487. package/build/types/utils/rpcMeta.d.ts +8 -0
  488. package/build/types/utils/rpcMeta.d.ts.map +1 -1
  489. package/build/types/vite/autoInstrument.d.ts.map +1 -1
  490. package/build/types/vite/index.d.ts +20 -44
  491. package/build/types/vite/index.d.ts.map +1 -1
  492. package/build/types/withSentry.d.ts +2 -2
  493. package/build/types/withSentry.d.ts.map +1 -1
  494. package/build/types/workflows.d.ts +5 -4
  495. package/build/types/workflows.d.ts.map +1 -1
  496. package/build/types/wrapMethodWithSentry.d.ts +1 -1
  497. package/build/types/wrapMethodWithSentry.d.ts.map +1 -1
  498. package/package.json +28 -51
  499. package/build/cjs/async.js +0 -63
  500. package/build/cjs/async.js.map +0 -1
  501. package/build/cjs/client.js.map +0 -1
  502. package/build/cjs/debug-build.js.map +0 -1
  503. package/build/cjs/defineCloudflareOptions.js.map +0 -1
  504. package/build/cjs/durableobject.js +0 -155
  505. package/build/cjs/durableobject.js.map +0 -1
  506. package/build/cjs/flush.js.map +0 -1
  507. package/build/cjs/instrument.js.map +0 -1
  508. package/build/cjs/instrumentations/agents/index.js.map +0 -1
  509. package/build/cjs/instrumentations/agents/instrumentAgentCallableRpc.js.map +0 -1
  510. package/build/cjs/instrumentations/agents/instrumentChatAgentConversation.js.map +0 -1
  511. package/build/cjs/instrumentations/agents/types.js +0 -32
  512. package/build/cjs/instrumentations/agents/types.js.map +0 -1
  513. package/build/cjs/instrumentations/instrumentDurableObjectNamespace.js.map +0 -1
  514. package/build/cjs/instrumentations/instrumentDurableObjectStorage.js.map +0 -1
  515. package/build/cjs/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +0 -1
  516. package/build/cjs/instrumentations/instrumentSqlStorage.js.map +0 -1
  517. package/build/cjs/instrumentations/instrumentWorkerEntrypoint.js.map +0 -1
  518. package/build/cjs/instrumentations/worker/instrumentD1.js.map +0 -1
  519. package/build/cjs/instrumentations/worker/instrumentEmail.js.map +0 -1
  520. package/build/cjs/instrumentations/worker/instrumentEnv.js.map +0 -1
  521. package/build/cjs/instrumentations/worker/instrumentFetch.js.map +0 -1
  522. package/build/cjs/instrumentations/worker/instrumentFetcher.js.map +0 -1
  523. package/build/cjs/instrumentations/worker/instrumentQueue.js.map +0 -1
  524. package/build/cjs/instrumentations/worker/instrumentQueueProducer.js.map +0 -1
  525. package/build/cjs/instrumentations/worker/instrumentR2.js.map +0 -1
  526. package/build/cjs/instrumentations/worker/instrumentRateLimit.js.map +0 -1
  527. package/build/cjs/instrumentations/worker/instrumentScheduled.js.map +0 -1
  528. package/build/cjs/instrumentations/worker/instrumentTail.js.map +0 -1
  529. package/build/cjs/integrations/fetch.js.map +0 -1
  530. package/build/cjs/integrations/hono.js +0 -52
  531. package/build/cjs/integrations/hono.js.map +0 -1
  532. package/build/cjs/integrations/httpServer.js.map +0 -1
  533. package/build/cjs/integrations/spotlight.js.map +0 -1
  534. package/build/cjs/integrations/tracing/vercelai.js.map +0 -1
  535. package/build/cjs/nodejs_compat/integrations/tracing/vercelai.js.map +0 -1
  536. package/build/cjs/opentelemetry/tracer.js.map +0 -1
  537. package/build/cjs/options.js.map +0 -1
  538. package/build/cjs/pages-plugin.js.map +0 -1
  539. package/build/cjs/request.js.map +0 -1
  540. package/build/cjs/scope-utils.js.map +0 -1
  541. package/build/cjs/sdk.js.map +0 -1
  542. package/build/cjs/transport.js.map +0 -1
  543. package/build/cjs/utils/instrumentContext.js.map +0 -1
  544. package/build/cjs/utils/internalSqlQuery.js.map +0 -1
  545. package/build/cjs/utils/internalStorageKey.js.map +0 -1
  546. package/build/cjs/utils/isBinding.js.map +0 -1
  547. package/build/cjs/utils/isCloudflareClass.js.map +0 -1
  548. package/build/cjs/utils/rpcMeta.js.map +0 -1
  549. package/build/cjs/utils/rpcOptions.js +0 -26
  550. package/build/cjs/utils/rpcOptions.js.map +0 -1
  551. package/build/cjs/utils/streaming.js.map +0 -1
  552. package/build/cjs/utils/traceLinks.js.map +0 -1
  553. package/build/cjs/vendor/stacktrace.js.map +0 -1
  554. package/build/cjs/vite/agentClass.js.map +0 -1
  555. package/build/cjs/vite/autoInstrument.js.map +0 -1
  556. package/build/cjs/vite/index.js.map +0 -1
  557. package/build/cjs/vite/instrumentFile.js.map +0 -1
  558. package/build/cjs/vite/moduleShape.js.map +0 -1
  559. package/build/cjs/vite/transform.js.map +0 -1
  560. package/build/cjs/vite/workerEntrypoint.js.map +0 -1
  561. package/build/cjs/vite/wranglerConfig.js.map +0 -1
  562. package/build/cjs/withSentry.js.map +0 -1
  563. package/build/cjs/workflows.js.map +0 -1
  564. package/build/cjs/wrapMethodWithSentry.js.map +0 -1
  565. package/build/esm/async.js +0 -61
  566. package/build/esm/async.js.map +0 -1
  567. package/build/esm/client.js.map +0 -1
  568. package/build/esm/debug-build.js.map +0 -1
  569. package/build/esm/defineCloudflareOptions.js.map +0 -1
  570. package/build/esm/durableobject.js +0 -150
  571. package/build/esm/durableobject.js.map +0 -1
  572. package/build/esm/flush.js.map +0 -1
  573. package/build/esm/index.js +0 -17
  574. package/build/esm/instrument.js.map +0 -1
  575. package/build/esm/instrumentations/agents/index.js.map +0 -1
  576. package/build/esm/instrumentations/agents/instrumentAgentCallableRpc.js.map +0 -1
  577. package/build/esm/instrumentations/agents/instrumentChatAgentConversation.js.map +0 -1
  578. package/build/esm/instrumentations/agents/types.js +0 -26
  579. package/build/esm/instrumentations/agents/types.js.map +0 -1
  580. package/build/esm/instrumentations/instrumentDurableObjectNamespace.js.map +0 -1
  581. package/build/esm/instrumentations/instrumentDurableObjectStorage.js.map +0 -1
  582. package/build/esm/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +0 -1
  583. package/build/esm/instrumentations/instrumentSqlStorage.js.map +0 -1
  584. package/build/esm/instrumentations/instrumentWorkerEntrypoint.js.map +0 -1
  585. package/build/esm/instrumentations/worker/instrumentD1.js.map +0 -1
  586. package/build/esm/instrumentations/worker/instrumentEmail.js.map +0 -1
  587. package/build/esm/instrumentations/worker/instrumentEnv.js.map +0 -1
  588. package/build/esm/instrumentations/worker/instrumentFetch.js.map +0 -1
  589. package/build/esm/instrumentations/worker/instrumentFetcher.js.map +0 -1
  590. package/build/esm/instrumentations/worker/instrumentQueue.js.map +0 -1
  591. package/build/esm/instrumentations/worker/instrumentQueueProducer.js.map +0 -1
  592. package/build/esm/instrumentations/worker/instrumentR2.js.map +0 -1
  593. package/build/esm/instrumentations/worker/instrumentRateLimit.js.map +0 -1
  594. package/build/esm/instrumentations/worker/instrumentScheduled.js.map +0 -1
  595. package/build/esm/instrumentations/worker/instrumentTail.js.map +0 -1
  596. package/build/esm/integrations/fetch.js.map +0 -1
  597. package/build/esm/integrations/hono.js +0 -49
  598. package/build/esm/integrations/hono.js.map +0 -1
  599. package/build/esm/integrations/httpServer.js.map +0 -1
  600. package/build/esm/integrations/spotlight.js.map +0 -1
  601. package/build/esm/integrations/tracing/vercelai.js.map +0 -1
  602. package/build/esm/nodejs_compat/index.js +0 -18
  603. package/build/esm/nodejs_compat/integrations/tracing/vercelai.js +0 -16
  604. package/build/esm/nodejs_compat/integrations/tracing/vercelai.js.map +0 -1
  605. package/build/esm/opentelemetry/tracer.js.map +0 -1
  606. package/build/esm/options.js.map +0 -1
  607. package/build/esm/package.json +0 -1
  608. package/build/esm/pages-plugin.js.map +0 -1
  609. package/build/esm/request.js.map +0 -1
  610. package/build/esm/scope-utils.js.map +0 -1
  611. package/build/esm/sdk.js.map +0 -1
  612. package/build/esm/transport.js.map +0 -1
  613. package/build/esm/utils/instrumentContext.js.map +0 -1
  614. package/build/esm/utils/internalSqlQuery.js.map +0 -1
  615. package/build/esm/utils/internalStorageKey.js.map +0 -1
  616. package/build/esm/utils/isBinding.js.map +0 -1
  617. package/build/esm/utils/isCloudflareClass.js.map +0 -1
  618. package/build/esm/utils/rpcMeta.js.map +0 -1
  619. package/build/esm/utils/rpcOptions.js +0 -24
  620. package/build/esm/utils/rpcOptions.js.map +0 -1
  621. package/build/esm/utils/streaming.js.map +0 -1
  622. package/build/esm/utils/traceLinks.js.map +0 -1
  623. package/build/esm/vendor/stacktrace.js.map +0 -1
  624. package/build/esm/vite/agentClass.js.map +0 -1
  625. package/build/esm/vite/autoInstrument.js.map +0 -1
  626. package/build/esm/vite/index.js.map +0 -1
  627. package/build/esm/vite/instrumentFile.js.map +0 -1
  628. package/build/esm/vite/moduleShape.js.map +0 -1
  629. package/build/esm/vite/transform.js.map +0 -1
  630. package/build/esm/vite/workerEntrypoint.js.map +0 -1
  631. package/build/esm/vite/wranglerConfig.js.map +0 -1
  632. package/build/esm/withSentry.js.map +0 -1
  633. package/build/esm/workflows.js.map +0 -1
  634. package/build/esm/wrapMethodWithSentry.js.map +0 -1
  635. package/build/types/async.d.ts +0 -11
  636. package/build/types/async.d.ts.map +0 -1
  637. package/build/types/integrations/hono.d.ts +0 -42
  638. package/build/types/integrations/hono.d.ts.map +0 -1
  639. package/build/types/nodejs_compat/index.d.ts +0 -4
  640. package/build/types/nodejs_compat/index.d.ts.map +0 -1
  641. package/build/types/nodejs_compat/integrations/tracing/vercelai.d.ts +0 -37
  642. package/build/types/nodejs_compat/integrations/tracing/vercelai.d.ts.map +0 -1
  643. package/build/types/utils/rpcOptions.d.ts +0 -13
  644. package/build/types/utils/rpcOptions.d.ts.map +0 -1
  645. package/build/types-ts3.8/async.d.ts +0 -11
  646. package/build/types-ts3.8/client.d.ts +0 -203
  647. package/build/types-ts3.8/debug-build.d.ts +0 -7
  648. package/build/types-ts3.8/defineCloudflareOptions.d.ts +0 -38
  649. package/build/types-ts3.8/durableobject.d.ts +0 -118
  650. package/build/types-ts3.8/executionContext.d.ts +0 -13
  651. package/build/types-ts3.8/flush.d.ts +0 -47
  652. package/build/types-ts3.8/index.d.ts +0 -19
  653. package/build/types-ts3.8/instrument.d.ts +0 -20
  654. package/build/types-ts3.8/instrumentations/agents/index.d.ts +0 -24
  655. package/build/types-ts3.8/instrumentations/agents/instrumentAgentCallableRpc.d.ts +0 -11
  656. package/build/types-ts3.8/instrumentations/agents/instrumentChatAgentConversation.d.ts +0 -22
  657. package/build/types-ts3.8/instrumentations/agents/types.d.ts +0 -49
  658. package/build/types-ts3.8/instrumentations/instrumentDurableObjectNamespace.d.ts +0 -13
  659. package/build/types-ts3.8/instrumentations/instrumentDurableObjectStorage.d.ts +0 -19
  660. package/build/types-ts3.8/instrumentations/instrumentDurableObjectSyncKvStorage.d.ts +0 -3
  661. package/build/types-ts3.8/instrumentations/instrumentSqlStorage.d.ts +0 -9
  662. package/build/types-ts3.8/instrumentations/instrumentWorkerEntrypoint.d.ts +0 -42
  663. package/build/types-ts3.8/instrumentations/worker/instrumentD1.d.ts +0 -19
  664. package/build/types-ts3.8/instrumentations/worker/instrumentEmail.d.ts +0 -8
  665. package/build/types-ts3.8/instrumentations/worker/instrumentEnv.d.ts +0 -18
  666. package/build/types-ts3.8/instrumentations/worker/instrumentFetch.d.ts +0 -12
  667. package/build/types-ts3.8/instrumentations/worker/instrumentFetcher.d.ts +0 -10
  668. package/build/types-ts3.8/instrumentations/worker/instrumentQueue.d.ts +0 -12
  669. package/build/types-ts3.8/instrumentations/worker/instrumentQueueProducer.d.ts +0 -10
  670. package/build/types-ts3.8/instrumentations/worker/instrumentR2.d.ts +0 -9
  671. package/build/types-ts3.8/instrumentations/worker/instrumentRateLimit.d.ts +0 -6
  672. package/build/types-ts3.8/instrumentations/worker/instrumentScheduled.d.ts +0 -12
  673. package/build/types-ts3.8/instrumentations/worker/instrumentTail.d.ts +0 -12
  674. package/build/types-ts3.8/integrations/fetch.d.ts +0 -19
  675. package/build/types-ts3.8/integrations/hono.d.ts +0 -42
  676. package/build/types-ts3.8/integrations/httpServer.d.ts +0 -63
  677. package/build/types-ts3.8/integrations/spotlight.d.ts +0 -22
  678. package/build/types-ts3.8/integrations/tracing/vercelai.d.ts +0 -47
  679. package/build/types-ts3.8/nodejs_compat/index.d.ts +0 -4
  680. package/build/types-ts3.8/nodejs_compat/integrations/tracing/vercelai.d.ts +0 -37
  681. package/build/types-ts3.8/opentelemetry/tracer.d.ts +0 -6
  682. package/build/types-ts3.8/options.d.ts +0 -17
  683. package/build/types-ts3.8/pages-plugin.d.ts +0 -34
  684. package/build/types-ts3.8/request.d.ts +0 -25
  685. package/build/types-ts3.8/scope-utils.d.ts +0 -15
  686. package/build/types-ts3.8/sdk.d.ts +0 -10
  687. package/build/types-ts3.8/transport.d.ts +0 -34
  688. package/build/types-ts3.8/utils/instrumentContext.d.ts +0 -16
  689. package/build/types-ts3.8/utils/internalSqlQuery.d.ts +0 -20
  690. package/build/types-ts3.8/utils/internalStorageKey.d.ts +0 -22
  691. package/build/types-ts3.8/utils/isBinding.d.ts +0 -77
  692. package/build/types-ts3.8/utils/isCloudflareClass.d.ts +0 -30
  693. package/build/types-ts3.8/utils/rpcMeta.d.ts +0 -15
  694. package/build/types-ts3.8/utils/rpcOptions.d.ts +0 -13
  695. package/build/types-ts3.8/utils/streaming.d.ts +0 -17
  696. package/build/types-ts3.8/utils/traceLinks.d.ts +0 -28
  697. package/build/types-ts3.8/vendor/stacktrace.d.ts +0 -11
  698. package/build/types-ts3.8/vite/agentClass.d.ts +0 -41
  699. package/build/types-ts3.8/vite/autoInstrument.d.ts +0 -22
  700. package/build/types-ts3.8/vite/index.d.ts +0 -98
  701. package/build/types-ts3.8/vite/instrumentFile.d.ts +0 -22
  702. package/build/types-ts3.8/vite/moduleShape.d.ts +0 -52
  703. package/build/types-ts3.8/vite/transform.d.ts +0 -65
  704. package/build/types-ts3.8/vite/workerEntrypoint.d.ts +0 -12
  705. package/build/types-ts3.8/vite/wranglerConfig.d.ts +0 -43
  706. package/build/types-ts3.8/withSentry.d.ts +0 -16
  707. package/build/types-ts3.8/workflows.d.ts +0 -25
  708. package/build/types-ts3.8/wrapMethodWithSentry.d.ts +0 -43
  709. /package/build/cjs/{client.js → dev/client.js} +0 -0
  710. /package/build/cjs/{debug-build.js → dev/debug-build.js} +0 -0
  711. /package/build/cjs/{defineCloudflareOptions.js → dev/defineCloudflareOptions.js} +0 -0
  712. /package/build/cjs/{flush.js → dev/flush.js} +0 -0
  713. /package/build/cjs/{instrument.js → dev/instrument.js} +0 -0
  714. /package/build/cjs/{instrumentations → dev/instrumentations}/instrumentDurableObjectNamespace.js +0 -0
  715. /package/build/cjs/{instrumentations → dev/instrumentations}/instrumentDurableObjectStorage.js +0 -0
  716. /package/build/cjs/{instrumentations → dev/instrumentations}/instrumentDurableObjectSyncKvStorage.js +0 -0
  717. /package/build/cjs/{instrumentations → dev/instrumentations}/instrumentSqlStorage.js +0 -0
  718. /package/build/cjs/{instrumentations → dev/instrumentations}/worker/instrumentFetcher.js +0 -0
  719. /package/build/cjs/{instrumentations → dev/instrumentations}/worker/instrumentQueueProducer.js +0 -0
  720. /package/build/cjs/{instrumentations → dev/instrumentations}/worker/instrumentR2.js +0 -0
  721. /package/build/cjs/{instrumentations → dev/instrumentations}/worker/instrumentRateLimit.js +0 -0
  722. /package/build/cjs/{instrumentations → dev/instrumentations}/worker/instrumentTail.js +0 -0
  723. /package/build/cjs/{integrations → dev/integrations}/spotlight.js +0 -0
  724. /package/build/cjs/{opentelemetry → dev/opentelemetry}/tracer.js +0 -0
  725. /package/build/cjs/{scope-utils.js → dev/scope-utils.js} +0 -0
  726. /package/build/cjs/{transport.js → dev/transport.js} +0 -0
  727. /package/build/cjs/{utils → dev/utils}/internalSqlQuery.js +0 -0
  728. /package/build/cjs/{utils → dev/utils}/internalStorageKey.js +0 -0
  729. /package/build/cjs/{utils → dev/utils}/isBinding.js +0 -0
  730. /package/build/cjs/{utils → dev/utils}/isCloudflareClass.js +0 -0
  731. /package/build/cjs/{utils → dev/utils}/streaming.js +0 -0
  732. /package/build/cjs/{utils → dev/utils}/traceLinks.js +0 -0
  733. /package/build/cjs/{vendor → dev/vendor}/stacktrace.js +0 -0
  734. /package/build/cjs/{vite → dev/vite}/agentClass.js +0 -0
  735. /package/build/cjs/{vite → dev/vite}/autoInstrument.js +0 -0
  736. /package/build/cjs/{vite → dev/vite}/instrumentFile.js +0 -0
  737. /package/build/cjs/{vite → dev/vite}/moduleShape.js +0 -0
  738. /package/build/cjs/{vite → dev/vite}/transform.js +0 -0
  739. /package/build/cjs/{vite → dev/vite}/workerEntrypoint.js +0 -0
  740. /package/build/cjs/{vite → dev/vite}/wranglerConfig.js +0 -0
  741. /package/build/esm/{client.js → dev/client.js} +0 -0
  742. /package/build/esm/{debug-build.js → dev/debug-build.js} +0 -0
  743. /package/build/esm/{defineCloudflareOptions.js → dev/defineCloudflareOptions.js} +0 -0
  744. /package/build/esm/{flush.js → dev/flush.js} +0 -0
  745. /package/build/esm/{instrument.js → dev/instrument.js} +0 -0
  746. /package/build/esm/{instrumentations → dev/instrumentations}/instrumentDurableObjectNamespace.js +0 -0
  747. /package/build/esm/{instrumentations → dev/instrumentations}/instrumentDurableObjectStorage.js +0 -0
  748. /package/build/esm/{instrumentations → dev/instrumentations}/instrumentDurableObjectSyncKvStorage.js +0 -0
  749. /package/build/esm/{instrumentations → dev/instrumentations}/instrumentSqlStorage.js +0 -0
  750. /package/build/esm/{instrumentations → dev/instrumentations}/worker/instrumentFetcher.js +0 -0
  751. /package/build/esm/{instrumentations → dev/instrumentations}/worker/instrumentQueueProducer.js +0 -0
  752. /package/build/esm/{instrumentations → dev/instrumentations}/worker/instrumentR2.js +0 -0
  753. /package/build/esm/{instrumentations → dev/instrumentations}/worker/instrumentRateLimit.js +0 -0
  754. /package/build/esm/{instrumentations → dev/instrumentations}/worker/instrumentTail.js +0 -0
  755. /package/build/esm/{integrations → dev/integrations}/spotlight.js +0 -0
  756. /package/build/esm/{opentelemetry → dev/opentelemetry}/tracer.js +0 -0
  757. /package/build/esm/{scope-utils.js → dev/scope-utils.js} +0 -0
  758. /package/build/esm/{transport.js → dev/transport.js} +0 -0
  759. /package/build/esm/{utils → dev/utils}/internalSqlQuery.js +0 -0
  760. /package/build/esm/{utils → dev/utils}/internalStorageKey.js +0 -0
  761. /package/build/esm/{utils → dev/utils}/isBinding.js +0 -0
  762. /package/build/esm/{utils → dev/utils}/isCloudflareClass.js +0 -0
  763. /package/build/esm/{utils → dev/utils}/streaming.js +0 -0
  764. /package/build/esm/{vendor → dev/vendor}/stacktrace.js +0 -0
  765. /package/build/esm/{vite → dev/vite}/agentClass.js +0 -0
  766. /package/build/esm/{vite → dev/vite}/autoInstrument.js +0 -0
  767. /package/build/esm/{vite → dev/vite}/instrumentFile.js +0 -0
  768. /package/build/esm/{vite → dev/vite}/moduleShape.js +0 -0
  769. /package/build/esm/{vite → dev/vite}/transform.js +0 -0
  770. /package/build/esm/{vite → dev/vite}/workerEntrypoint.js +0 -0
  771. /package/build/esm/{vite → dev/vite}/wranglerConfig.js +0 -0
@@ -1,7 +1,12 @@
1
1
  import type { Integration } from '@sentry/core';
2
- import type { CloudflareOptions } from './client';
3
- import { CloudflareClient } from './client';
4
- /** Get the default integrations for the Cloudflare SDK. */
2
+ import type { CloudflareClient, CloudflareOptions } from './client';
3
+ /**
4
+ * Get the default integrations for the Cloudflare SDK.
5
+ *
6
+ * This is the full set and requires the `nodejs_compat` compatibility flag. Runtimes that cannot
7
+ * enable it (e.g. Shopify Oxygen) go through `wrapRequestHandler`, which only sets up
8
+ * `getBaseDefaultIntegrations`.
9
+ */
5
10
  export declare function getDefaultIntegrations(options: CloudflareOptions): Integration[];
6
11
  /**
7
12
  * Initializes the cloudflare SDK.
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAchD,OAAO,KAAK,EAA2B,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AA2B5C,2DAA2D;AAC3D,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,iBAAiB,GAAG,WAAW,EAAE,CA8BhF;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,iBAAiB,GAAG,gBAAgB,GAAG,SAAS,CAoC7E"}
1
+ {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAEpE;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,iBAAiB,GAAG,WAAW,EAAE,CAMhF;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,iBAAiB,GAAG,gBAAgB,GAAG,SAAS,CAE7E"}
@@ -1 +1 @@
1
- {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,4BAA4B,EAAoB,MAAM,cAAc,CAAC;AAGpH,MAAM,WAAW,0BAA2B,SAAQ,oBAAoB;IACtE,iFAAiF;IACjF,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB,iCAAiC;IACjC,YAAY,CAAC,EAAE,WAAW,CAAC;CAC5B;AAID;;;;;;;GAOG;AACH,qBAAa,qBAAqB;IAGzB,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,4BAA4B,CAAC,CAAC,CAAC;IAE3D,OAAO,CAAC,cAAc,CAAsD;IAE5E,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;gBAElB,WAAW,SAAgC;IAM9D;;OAEG;IACI,GAAG,CAAC,YAAY,EAAE,MAAM,WAAW,CAAC,4BAA4B,CAAC,GAAG,WAAW,CAAC,4BAA4B,CAAC;IASpH;;OAEG;IACI,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC;CA0BrD;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,0BAA0B,GAAG,SAAS,CAkCtF"}
1
+ {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,4BAA4B,EAAoB,MAAM,cAAc,CAAC;AAGpH,MAAM,WAAW,0BAA2B,SAAQ,oBAAoB;IACtE,iFAAiF;IACjF,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB,iCAAiC;IACjC,YAAY,CAAC,EAAE,WAAW,CAAC;CAC5B;AAID;;;;;;;GAOG;AACH,qBAAa,qBAAqB;IAGzB,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,4BAA4B,CAAC,CAAC,CAAC;IAE3D,OAAO,CAAC,cAAc,CAAsD;IAE5E,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IAErC,YAAmB,WAAW,SAAgC,EAI7D;IAED;;OAEG;IACI,GAAG,CAAC,YAAY,EAAE,MAAM,WAAW,CAAC,4BAA4B,CAAC,GAAG,WAAW,CAAC,4BAA4B,CAAC,CAOnH;IAED;;OAEG;IACI,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAyBnD;CACF;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,0BAA0B,GAAG,SAAS,CAkCtF"}
@@ -0,0 +1,85 @@
1
+ import type { env as cloudflareEnv } from 'cloudflare:workers';
2
+ type IsAny<T> = 0 extends 1 & T ? true : false;
3
+ /**
4
+ * A handler method of an `ExportedHandler` (`fetch`, `scheduled`, `queue`, ...).
5
+ */
6
+ type AnyHandlerMethod = (event: any, env: any, ctx: any) => any;
7
+ /**
8
+ * Structural version of `ExportedHandler` that accepts every env/message/metadata/props
9
+ * combination. Used as the handler constraint of `withSentry` instead of
10
+ * `ExportedHandler<any, any, any>`: on `@cloudflare/workers-types` v5, `ExportedHandler`
11
+ * has a 4th generic (`ExecutionContext<Props>`) which defaults to `unknown`, so a direct
12
+ * `ExportedHandler<any, any, any>` constraint rejects handlers typed with a concrete
13
+ * `Props`. Referencing the 4th generic is not an option either — it does not exist on v4,
14
+ * which the SDK also supports.
15
+ */
16
+ export interface AnyExportedHandler {
17
+ fetch?: AnyHandlerMethod;
18
+ scheduled?: AnyHandlerMethod;
19
+ queue?: AnyHandlerMethod;
20
+ email?: AnyHandlerMethod;
21
+ tail?: AnyHandlerMethod;
22
+ trace?: AnyHandlerMethod;
23
+ tailStream?: AnyHandlerMethod;
24
+ connect?: AnyHandlerMethod;
25
+ test?: AnyHandlerMethod;
26
+ }
27
+ type HandlerMethodName = keyof AnyExportedHandler;
28
+ /**
29
+ * Extracts the `Env` type from a handler method signature (its second parameter).
30
+ * `any` methods are skipped: framework app types like Hono's carry a string index
31
+ * signature, which would otherwise make every missing handler method read as `any`
32
+ * and poison the inferred env.
33
+ */
34
+ type EnvFromMethod<Method> = IsAny<Method> extends true ? never : Method extends (event: any, env: infer Env, ctx: any) => any ? Env : never;
35
+ /**
36
+ * Extracts the `Env` type from an `ExportedHandler`-shaped type.
37
+ *
38
+ * This infers the env from any of the handler methods (`fetch`, `scheduled`, `queue`, ...),
39
+ * so a handler literal with `satisfies ExportedHandler<Env>` or a pre-typed
40
+ * `ExportedHandler<Env>` both yield their `Env`. The structural read (instead of
41
+ * `T extends ExportedHandler<infer Env, ...>`) keeps inference working for
42
+ * `ExecutionContext<Props>`-typed handlers on workers-types v5.
43
+ */
44
+ type InferEnvFromHandler<T> = T extends AnyExportedHandler ? {
45
+ [K in HandlerMethodName]: K extends keyof T ? EnvFromMethod<T[K]> : never;
46
+ }[HandlerMethodName] : never;
47
+ /**
48
+ * Extracts the `Env` type from a class constructor type (`WorkerEntrypoint`, `DurableObject`
49
+ * or `WorkflowEntrypoint` subclasses). The env is inferred from the second constructor parameter,
50
+ * which carries the user's env type both for explicit constructors and for constructors inherited
51
+ * from a `WorkerEntrypoint<Env>` / `DurableObject<Env>` / `WorkflowEntrypoint<Env>` base class.
52
+ */
53
+ type InferEnvFromConstructor<T> = T extends new (ctx: any, env: infer Env) => any ? Env : never;
54
+ /**
55
+ * Infers the `Env` type from a handler passed to one of the instrumentation functions.
56
+ * Returns `never` when nothing can be inferred.
57
+ */
58
+ export type InferEnv<T> = [InferEnvFromHandler<T>] extends [never] ? InferEnvFromConstructor<T> : InferEnvFromHandler<T>;
59
+ /**
60
+ * Removes empty object types (`{}`) from a union. Framework handler types like Hono's
61
+ * `fetch(request, env?: E['Bindings'] | {}, ...)` union the env with `{}`, which would
62
+ * otherwise collapse the inferred env to "empty" — filtering keeps the meaningful member.
63
+ */
64
+ type FilterEmptyObjects<T> = T extends any ? ([keyof T] extends [never] ? never : T) : never;
65
+ /**
66
+ * Resolves the env type exposed on the options callback of the instrumentation functions.
67
+ *
68
+ * Resolution order:
69
+ * 1. The env inferred from the passed handler (e.g. via `satisfies ExportedHandler<Env>`,
70
+ * a pre-typed handler, or a `WorkerEntrypoint<Env>` subclass).
71
+ * 2. The explicitly provided `Env` generic (e.g. `withSentry<Env>(...)`), which defaults
72
+ * to the wrangler-generated `Cloudflare.Env` (via `typeof cloudflareEnv`).
73
+ * 3. `any` as the last resort, so untyped setups keep compiling instead of failing on
74
+ * an empty `Cloudflare.Env` interface.
75
+ */
76
+ export type ResolveEnv<Handler, ExplicitEnv> = IsAny<FilterEmptyObjects<InferEnv<Handler>>> extends true ? ExplicitEnv : unknown extends FilterEmptyObjects<InferEnv<Handler>> ? ExplicitEnv : [FilterEmptyObjects<InferEnv<Handler>>] extends [never] ? ExplicitEnv : FilterEmptyObjects<InferEnv<Handler>>;
77
+ /**
78
+ * The default env type when nothing can be inferred and no explicit generic is provided:
79
+ * the wrangler-generated `Cloudflare.Env` (via `cloudflare:workers`), falling back to `any`
80
+ * when the project never ran `wrangler types` (the interface is empty) so property access
81
+ * on `env` does not fail.
82
+ */
83
+ export type DefaultEnv = [keyof typeof cloudflareEnv] extends [never] ? any : typeof cloudflareEnv;
84
+ export {};
85
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @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appings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAA6B,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAGtH,KAAK,WAAW,GAAG,gBAAgB,GAAG,kBAAkB,CAAC;AAGzD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,WAAW,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAgDlE"}
1
+ {"version":3,"file":"instrumentContext.d.ts","sourceRoot":"","sources":["../../../src/utils/instrumentContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAA6B,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAGtH,KAAK,WAAW,GAAG,gBAAgB,GAAG,kBAAkB,CAAC;AAGzD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,WAAW,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CA6ClE"}
@@ -0,0 +1,24 @@
1
+ import { type Scope } from '@sentry/core';
2
+ /**
3
+ * Runs `callback` on the isolation scope for the current invocation.
4
+ *
5
+ * An instrumented handler is either the entry point of an invocation or reentrant — reached from
6
+ * another instrumented handler already serving the same invocation (a Durable Object method calling
7
+ * its own `fetch`, an RPC method reaching a sibling method). Only the entry point may fork:
8
+ *
9
+ * - Forking at the entry point is mandatory. `setUser`/`setTag` write to the isolation scope, and a
10
+ * Durable Object's isolation scope outlives the invocation that touched it, so without a fork one
11
+ * invocation's user and tags reappear on the next invocation's events in the same isolate.
12
+ * Forking clones, so request data set by an enclosing wrapper is still inherited.
13
+ * - Forking again when reentrant would be wrong. Everything below the entry point is one logical
14
+ * unit of work: a nested call must see what the caller set and be able to add to it, the way it
15
+ * would if the SDK were not wrapping it at all.
16
+ *
17
+ * The AsyncLocalStorage strategy hands the default isolation scope back whenever no invocation is in
18
+ * flight, and a forked one while inside `withIsolationScope`. Reference-comparing against the default
19
+ * is therefore enough to tell the two cases apart. The stack fallback does not fork, so it reports the
20
+ * default scope even inside an invocation; there the fork degrades to a no-op, which the stack strategy
21
+ * tolerates. This matches the approach used by `patchEventHandler` in Nuxt.
22
+ */
23
+ export declare function withInvocationIsolationScope<T>(callback: (scope: Scope) => T): T;
24
+ //# sourceMappingURL=invocationScope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invocationScope.d.ts","sourceRoot":"","sources":["../../../src/utils/invocationScope.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+C,KAAK,KAAK,EAAsB,MAAM,cAAc,CAAC;AAE3G;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,4BAA4B,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,CAAC,GAAG,CAAC,CAMhF"}
@@ -24,7 +24,7 @@ import type { WorkerEntrypointConstructor } from '../instrumentations/instrument
24
24
  * isCloudflareClass(MyDO, 'DurableObject') // true if MyDO extends DurableObject
25
25
  * ```
26
26
  */
27
- export declare function isCloudflareClass(value: unknown, className: 'WorkerEntrypoint'): value is WorkerEntrypointConstructor;
27
+ export declare function isCloudflareClass(value: unknown, className: 'WorkerEntrypoint'): value is WorkerEntrypointConstructor<any, any>;
28
28
  export declare function isCloudflareClass(value: unknown, className: 'DurableObject'): value is new (...args: unknown[]) => DurableObject;
29
29
  export declare function isCloudflareClass(value: unknown, className: 'WorkflowEntrypoint'): value is new (...args: unknown[]) => WorkflowEntrypoint;
30
30
  //# sourceMappingURL=isCloudflareClass.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isCloudflareClass.d.ts","sourceRoot":"","sources":["../../../src/utils/isCloudflareClass.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAGlG;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,kBAAkB,GAAG,KAAK,IAAI,2BAA2B,CAAC;AACvH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,eAAe,GACzB,KAAK,IAAI,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,aAAa,CAAC;AACtD,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,oBAAoB,GAC9B,KAAK,IAAI,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,kBAAkB,CAAC"}
1
+ {"version":3,"file":"isCloudflareClass.d.ts","sourceRoot":"","sources":["../../../src/utils/isCloudflareClass.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAGlG;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,kBAAkB,GAE5B,KAAK,IAAI,2BAA2B,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAClD,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,eAAe,GACzB,KAAK,IAAI,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,aAAa,CAAC;AACtD,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,oBAAoB,GAC9B,KAAK,IAAI,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,kBAAkB,CAAC"}
@@ -4,6 +4,14 @@ import { type SerializedTraceData } from '@sentry/core';
4
4
  * If no active trace exists, returns the original args unchanged.
5
5
  */
6
6
  export declare function appendRpcMeta(args: unknown[]): unknown[];
7
+ /**
8
+ * Whether the trailing argument carries Sentry RPC metadata.
9
+ *
10
+ * Separate from {@link extractRpcMeta} because the RPC method wrappers run this check on every
11
+ * call — including the instance's own internal method calls, which never carry metadata — and
12
+ * must not allocate on that path.
13
+ */
14
+ export declare function hasRpcMeta(args: unknown[]): boolean;
7
15
  /**
8
16
  * Extracts Sentry RPC metadata from the trailing argument of an args array.
9
17
  * Returns cleaned args (without meta) and the extracted trace data if found.
@@ -1 +1 @@
1
- {"version":3,"file":"rpcMeta.d.ts","sourceRoot":"","sources":["../../../src/utils/rpcMeta.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,KAAK,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAoBpF;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CAQxD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,OAAO,EAAE,EAChD,IAAI,EAAE,CAAC,GACN;IACD,IAAI,EAAE,CAAC,CAAC;IACR,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B,CAcA"}
1
+ {"version":3,"file":"rpcMeta.d.ts","sourceRoot":"","sources":["../../../src/utils/rpcMeta.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,KAAK,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAoBpF;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CAQxD;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAEnD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,OAAO,EAAE,EAChD,IAAI,EAAE,CAAC,GACN;IACD,IAAI,EAAE,CAAC,CAAC;IACR,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B,CAcA"}
@@ -1 +1 @@
1
- {"version":3,"file":"autoInstrument.d.ts","sourceRoot":"","sources":["../../../src/vite/autoInstrument.ts"],"names":[],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AAC,GAAG,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,CAAC;EAiFzD"}
@@ -13,25 +13,24 @@ export interface SentryCloudflareVitePluginOptions {
13
13
  * @default undefined (probes `wrangler.json`, `wrangler.jsonc`, `wrangler.toml` at the Vite root)
14
14
  */
15
15
  wranglerConfigPath?: string;
16
+ /**
17
+ * Build-time automatic instrumentation of supported dependencies (e.g.
18
+ * database clients like `mysql`) so the Sentry Cloudflare SDK can trace them
19
+ * without monkey-patching, which wouldn't work in workerd anyway.
20
+ *
21
+ * When enabled, the plugin injects `diagnostics_channel.tracingChannel` calls
22
+ * into the bundled packages and, next to each, a snippet that registers the
23
+ * matching Sentry channel-subscriber factory on the global marker, which the
24
+ * SDK picks up in `Sentry.withSentry()`. Both `vite build` and `vite dev` are
25
+ * instrumented. Set to `false` to opt out.
26
+ *
27
+ * @default true
28
+ */
29
+ buildTimeInstrumentation?: boolean;
16
30
  /**
17
31
  * Experimental options that may change or be removed without notice.
18
32
  */
19
33
  _experimental?: {
20
- /**
21
- * Enables build-time automatic instrumentation of supported dependencies
22
- * (e.g. database clients like `mysql`) so the Sentry Cloudflare SDK can
23
- * trace them without monkey-patching, which wouldn't work in workerd anyway.
24
- *
25
- * When enabled, the plugin injects `diagnostics_channel.tracingChannel`
26
- * calls into the bundled packages and, next to each, a snippet that
27
- * registers the matching Sentry channel-subscriber factory on the global
28
- * marker, which the SDK picks up in `Sentry.withSentry()`. Both `vite build`
29
- * and `vite dev` are instrumented.
30
- *
31
- * @default false
32
- * @experimental May change or be removed in any release.
33
- */
34
- useDiagnosticsChannelInjection?: boolean;
35
34
  /**
36
35
  * Automatically wraps your Worker at build time so you don't have to edit
37
36
  * your entry: the plugin reads your wrangler config, wraps the default
@@ -53,10 +52,9 @@ export interface SentryCloudflareVitePluginOptions {
53
52
  * instrumentation for Cloudflare Workers built with Vite. Configure the Sentry
54
53
  * SDK in your Worker as usual with `Sentry.withSentry()`.
55
54
  *
56
- * Currently, the only functionality is the experimental
57
- * `_experimental.useDiagnosticsChannelInjection` option, which traces supported
58
- * dependencies (such as database clients) without changing your application
59
- * code. Without it, the plugin is a no-op.
55
+ * By default, the plugin build-time instruments supported dependencies (such as
56
+ * database clients) so they are traced without changing your application code.
57
+ * Opt out with `buildTimeInstrumentation: false`.
60
58
  *
61
59
  * @example
62
60
  * ```ts
@@ -66,33 +64,11 @@ export interface SentryCloudflareVitePluginOptions {
66
64
  * import { defineConfig } from 'vite';
67
65
  *
68
66
  * export default defineConfig({
69
- * plugins: [
70
- * cloudflare(),
71
- * sentryCloudflareVitePlugin({
72
- * _experimental: {
73
- * useDiagnosticsChannelInjection: true,
74
- * },
75
- * }),
76
- * ],
67
+ * plugins: [cloudflare(), sentryCloudflareVitePlugin()],
77
68
  * });
78
69
  * ```
79
70
  */
80
- export declare function sentryCloudflareVitePlugin(options?: SentryCloudflareVitePluginOptions): ({
71
+ export declare function sentryCloudflareVitePlugin(options?: SentryCloudflareVitePluginOptions): Array<{
81
72
  name: string;
82
- configResolved(config: {
83
- root: string;
84
- logger?: {
85
- warn(msg: string): void;
86
- };
87
- }): void;
88
- transform(this: import("./agentClass").ModuleResolver & {
89
- warn?(msg: string): void;
90
- environment?: {
91
- name?: string;
92
- };
93
- }, code: string, id: string): Promise<{
94
- code: string;
95
- map: unknown;
96
- } | undefined>;
97
- } | import("vite").Plugin<any>)[];
73
+ }>;
98
74
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vite/index.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD;;;;;;;;;OASG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,aAAa,CAAC,EAAE;QACd;;;;;;;;;;;;;WAaG;QACH,8BAA8B,CAAC,EAAE,OAAO,CAAC;QACzC;;;;;;;;;;WAUG;QACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;KAC/B,CAAC;CACH;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,GAAE,iCAAsC;;;;cA5DlF,CAAC;;;;;YAiCgE,CAAC;mBAChD,CAAC;gBAAS,CAAA;;;;;;kCAmCnC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vite/index.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD;;;;;;;;;OASG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;;;;;;;;OAYG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC;;OAEG;IACH,aAAa,CAAC,EAAE;QACd;;;;;;;;;;WAUG;QACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;KAC/B,CAAC;CACH;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,GAAE,iCAAsC,GAAG,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CASnH"}
@@ -1,5 +1,5 @@
1
- import type { env as cloudflareEnv } from 'cloudflare:workers';
2
1
  import type { CloudflareOptions } from './client';
2
+ import type { AnyExportedHandler, DefaultEnv, ResolveEnv } from './types';
3
3
  import { type WorkerEntrypointConstructor } from './instrumentations/instrumentWorkerEntrypoint';
4
4
  /**
5
5
  * Wrapper for Cloudflare handlers.
@@ -12,5 +12,5 @@ import { type WorkerEntrypointConstructor } from './instrumentations/instrumentW
12
12
  * @param handler {ExportedHandler} The handler to wrap.
13
13
  * @returns The wrapped handler.
14
14
  */
15
- export declare function withSentry<Env = typeof cloudflareEnv, QueueHandlerMessage = unknown, CfHostMetadata = unknown, T extends ExportedHandler<Env, QueueHandlerMessage, CfHostMetadata> | WorkerEntrypointConstructor = ExportedHandler<Env, QueueHandlerMessage, CfHostMetadata>>(optionsCallback: (env: Env) => CloudflareOptions | undefined, handler: T): T;
15
+ export declare function withSentry<Env = DefaultEnv, QueueHandlerMessage = unknown, CfHostMetadata = unknown, T extends AnyExportedHandler | WorkerEntrypointConstructor<any, any> = ExportedHandler<Env, QueueHandlerMessage, CfHostMetadata> | WorkerEntrypointConstructor<Env>>(optionsCallback: (env: ResolveEnv<T, Env>) => CloudflareOptions | undefined, handler: T): T;
16
16
  //# sourceMappingURL=withSentry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"withSentry.d.ts","sourceRoot":"","sources":["../../src/withSentry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AASlD,OAAO,EAEL,KAAK,2BAA2B,EACjC,MAAM,+CAA+C,CAAC;AAEvD;;;;;;;;;;GAUG;AAGH,wBAAgB,UAAU,CACxB,GAAG,GAAG,OAAO,aAAa,EAC1B,mBAAmB,GAAG,OAAO,EAC7B,cAAc,GAAG,OAAO,EACxB,CAAC,SAAS,eAAe,CAAC,GAAG,EAAE,mBAAmB,EAAE,cAAc,CAAC,GAAG,2BAA2B,GAAG,eAAe,CACjH,GAAG,EACH,mBAAmB,EACnB,cAAc,CACf,EACD,eAAe,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,iBAAiB,GAAG,SAAS,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CA0B7E"}
1
+ {"version":3,"file":"withSentry.d.ts","sourceRoot":"","sources":["../../src/withSentry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAOlD,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAEL,KAAK,2BAA2B,EACjC,MAAM,+CAA+C,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CACxB,GAAG,GAAG,UAAU,EAChB,mBAAmB,GAAG,OAAO,EAC7B,cAAc,GAAG,OAAO,EAExB,CAAC,SAAS,kBAAkB,GAAG,2BAA2B,CAAC,GAAG,EAAE,GAAG,CAAC,GAChE,eAAe,CAAC,GAAG,EAAE,mBAAmB,EAAE,cAAc,CAAC,GACzD,2BAA2B,CAAC,GAAG,CAAC,EACpC,eAAe,EAAE,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,iBAAiB,GAAG,SAAS,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAyB5F"}
@@ -1,5 +1,6 @@
1
1
  import type { WorkflowEntrypoint } from 'cloudflare:workers';
2
2
  import type { CloudflareOptions } from './client';
3
+ import type { DefaultEnv, ResolveEnv } from './types';
3
4
  /**
4
5
  * Hashes a string to a UUID using SHA-1.
5
6
  */
@@ -21,8 +22,8 @@ export declare function deterministicTraceIdFromInstanceId(instanceId: string):
21
22
  * @param WorkflowClass - The workflow class to instrument
22
23
  * @returns Instrumented workflow class with the same interface
23
24
  */
24
- export declare function instrumentWorkflowWithSentry<E, // Environment type
25
- P, // Payload type
26
- T extends WorkflowEntrypoint<E, P>, // WorkflowEntrypoint type
27
- C extends new (ctx: ExecutionContext, env: E) => T>(optionsCallback: (env: E) => CloudflareOptions, WorkFlowClass: C): C;
25
+ export declare function instrumentWorkflowWithSentry<E = DefaultEnv, // Environment type
26
+ P = unknown, // Payload type
27
+ T extends WorkflowEntrypoint<any, any> = WorkflowEntrypoint<E, P>, // WorkflowEntrypoint type
28
+ C extends new (ctx: ExecutionContext, env: any) => WorkflowEntrypoint<any, any> = new (ctx: ExecutionContext, env: any) => T>(optionsCallback: (env: ResolveEnv<C, E>) => CloudflareOptions, WorkFlowClass: C): C;
28
29
  //# sourceMappingURL=workflows.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../src/workflows.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK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AAkB,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,KAChF,GAAG,EAAE,gBAAgB,EAErB,GAAG,EAAE,GAAG,KACL,CAAC,EACN,eAAe,EAAE,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,iBAAiB,EAAE,aAAa,EAAE,CAAC,GAAG,CAAC,CA6CpF"}
@@ -1,7 +1,7 @@
1
1
  import type { DurableObjectStorage } from '@cloudflare/workers-types';
2
2
  import type { CloudflareOptions } from './client';
3
3
  /** Extended DurableObjectState with originalStorage exposed by instrumentContext */
4
- interface InstrumentedDurableObjectState extends DurableObjectState {
4
+ export interface InstrumentedDurableObjectState extends DurableObjectState {
5
5
  originalStorage?: DurableObjectStorage;
6
6
  }
7
7
  type MethodWrapperOptions = {
@@ -1 +1 @@
1
- {"version":3,"file":"wrapMethodWithSentry.d.ts","sourceRoot":"","sources":["../../src/wrapMethodWithSentry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAgBtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAQlD,oFAAoF;AACpF,UAAU,8BAA+B,SAAQ,kBAAkB;IACjE,eAAe,CAAC,EAAE,oBAAoB,CAAC;CACxC;AAyBD,KAAK,oBAAoB,GAAG;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,gBAAgB,GAAG,8BAA8B,CAAC;IAC3D;;;;;;;;;OASG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAGF,MAAM,MAAM,eAAe,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AACtD,KAAK,cAAc,GAAG,eAAe,CAAC;AAEt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package.json CHANGED
@@ -1,68 +1,46 @@
1
1
  {
2
2
  "name": "@sentry/cloudflare",
3
- "version": "10.69.0",
3
+ "version": "11.0.0-alpha.0",
4
4
  "description": "Official Sentry SDK for Cloudflare Workers and Pages",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/cloudflare",
7
7
  "author": "Sentry",
8
8
  "license": "MIT",
9
9
  "engines": {
10
- "node": ">=18"
10
+ "node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0"
11
11
  },
12
12
  "files": [
13
13
  "/build"
14
14
  ],
15
- "main": "build/cjs/index.js",
16
- "module": "build/esm/index.js",
15
+ "main": "build/cjs/prod/index.js",
16
+ "module": "build/esm/prod/index.js",
17
17
  "types": "build/types/index.d.ts",
18
18
  "exports": {
19
19
  "./package.json": "./package.json",
20
20
  ".": {
21
- "import": {
22
- "types": "./build/types/index.d.ts",
23
- "default": "./build/esm/index.js"
21
+ "types": "./build/types/index.d.ts",
22
+ "development": {
23
+ "import": "./build/esm/dev/index.js",
24
+ "require": "./build/cjs/dev/index.js"
24
25
  },
25
- "require": {
26
- "types": "./build/types/index.d.ts",
27
- "default": "./build/cjs/index.js"
28
- }
29
- },
30
- "./request": {
31
- "import": {
32
- "types": "./build/types/request.d.ts",
33
- "default": "./build/esm/request.js"
26
+ "production": {
27
+ "import": "./build/esm/prod/index.js",
28
+ "require": "./build/cjs/prod/index.js"
34
29
  },
35
- "require": {
36
- "types": "./build/types/request.d.ts",
37
- "default": "./build/cjs/request.js"
30
+ "default": {
31
+ "import": "./build/esm/prod/index.js",
32
+ "require": "./build/cjs/prod/index.js"
38
33
  }
39
34
  },
40
- "./nodejs_compat": {
41
- "import": {
42
- "types": "./build/types/nodejs_compat/index.d.ts",
43
- "default": "./build/esm/nodejs_compat/index.js"
44
- },
45
- "require": {
46
- "types": "./build/types/nodejs_compat/index.d.ts",
47
- "default": "./build/cjs/nodejs_compat/index.js"
48
- }
35
+ "./request": {
36
+ "types": "./build/types/request.d.ts",
37
+ "import": "./build/esm/prod/request.js",
38
+ "require": "./build/cjs/prod/request.js"
49
39
  },
50
40
  "./vite": {
51
- "import": {
52
- "types": "./build/types/vite/index.d.ts",
53
- "default": "./build/esm/vite/index.js"
54
- },
55
- "require": {
56
- "types": "./build/types/vite/index.d.ts",
57
- "default": "./build/cjs/vite/index.js"
58
- }
59
- }
60
- },
61
- "typesVersions": {
62
- "<5.0": {
63
- "build/types/index.d.ts": [
64
- "build/types-ts3.8/index.d.ts"
65
- ]
41
+ "types": "./build/types/vite/index.d.ts",
42
+ "import": "./build/esm/prod/vite/index.js",
43
+ "require": "./build/cjs/prod/vite/index.js"
66
44
  }
67
45
  },
68
46
  "publishConfig": {
@@ -70,8 +48,9 @@
70
48
  },
71
49
  "dependencies": {
72
50
  "@opentelemetry/api": "^1.9.1",
73
- "@sentry/core": "10.69.0",
74
- "@sentry/server-utils": "10.69.0",
51
+ "@sentry/conventions": "^0.16.0",
52
+ "@sentry/core": "11.0.0-alpha.0",
53
+ "@sentry/server-utils": "11.0.0-alpha.0",
75
54
  "magic-string": "~0.30.21"
76
55
  },
77
56
  "peerDependencies": {
@@ -95,18 +74,16 @@
95
74
  "build": "run-p build:transpile build:types",
96
75
  "build:dev": "yarn build",
97
76
  "build:transpile": "rollup -c rollup.npm.config.mjs",
98
- "build:types": "run-s build:types:core build:types:downlevel",
99
- "build:types:core": "tsc -p tsconfig.types.json",
100
- "build:types:downlevel": "yarn downlevel-dts build/types build/types-ts3.8 --to ts3.8",
77
+ "build:types": "tsc -p tsconfig.types.json",
101
78
  "build:watch": "run-p build:transpile:watch",
102
79
  "build:dev:watch": "yarn build:watch",
103
80
  "build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch",
104
81
  "build:tarball": "npm pack",
105
82
  "circularDepCheck": "madge --circular src/index.ts",
106
83
  "clean": "rimraf build coverage sentry-cloudflare-*.tgz",
107
- "lint:fix": "OXLINT_TSGOLINT_DANGEROUSLY_SUPPRESS_PROGRAM_DIAGNOSTICS=true oxlint . --fix --type-aware",
108
- "lint": "OXLINT_TSGOLINT_DANGEROUSLY_SUPPRESS_PROGRAM_DIAGNOSTICS=true oxlint . --type-aware",
109
- "lint:es-compatibility": "es-check es2022 ./build/cjs/*.js && es-check es2022 ./build/esm/*.js --module",
84
+ "lint:fix": "oxlint . --fix --type-aware",
85
+ "lint": "oxlint . --type-aware",
86
+ "lint:es-compatibility": "es-check es2022 ./build/cjs/prod/*.js && es-check es2022 ./build/esm/prod/*.js --module",
110
87
  "test": "yarn test:unit",
111
88
  "test:unit": "vitest run",
112
89
  "test:watch": "vitest --watch",
@@ -1,63 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const node_async_hooks = require('node:async_hooks');
4
- const core = require('@sentry/core');
5
-
6
- function setAsyncLocalStorageAsyncContextStrategy() {
7
- const asyncStorage = new node_async_hooks.AsyncLocalStorage();
8
- function getScopes() {
9
- const scopes = asyncStorage.getStore();
10
- if (scopes) {
11
- return scopes;
12
- }
13
- return {
14
- scope: core.getDefaultCurrentScope(),
15
- isolationScope: core.getDefaultIsolationScope()
16
- };
17
- }
18
- function withScope(callback) {
19
- const scope = getScopes().scope.clone();
20
- const isolationScope = getScopes().isolationScope;
21
- return asyncStorage.run({ scope, isolationScope }, () => {
22
- return callback(scope);
23
- });
24
- }
25
- function withSetScope(scope, callback) {
26
- const isolationScope = getScopes().isolationScope.clone();
27
- return asyncStorage.run({ scope, isolationScope }, () => {
28
- return callback(scope);
29
- });
30
- }
31
- function withIsolationScope(callback) {
32
- const scope = getScopes().scope;
33
- const isolationScope = getScopes().isolationScope.clone();
34
- return asyncStorage.run({ scope, isolationScope }, () => {
35
- return callback(isolationScope);
36
- });
37
- }
38
- function withSetIsolationScope(isolationScope, callback) {
39
- const scope = getScopes().scope;
40
- return asyncStorage.run({ scope, isolationScope }, () => {
41
- return callback(isolationScope);
42
- });
43
- }
44
- function suppressTracing(callback) {
45
- return withScope((scope) => {
46
- scope.setSDKProcessingMetadata({ __SENTRY_SUPPRESS_TRACING__: true });
47
- return callback();
48
- });
49
- }
50
- core.setAsyncContextStrategy({
51
- suppressTracing,
52
- withScope,
53
- withSetScope,
54
- withIsolationScope,
55
- withSetIsolationScope,
56
- getCurrentScope: () => getScopes().scope,
57
- getIsolationScope: () => getScopes().isolationScope,
58
- getTracingChannelBinding: () => core._INTERNAL_createTracingChannelBinding(asyncStorage, getScopes)
59
- });
60
- }
61
-
62
- exports.setAsyncLocalStorageAsyncContextStrategy = setAsyncLocalStorageAsyncContextStrategy;
63
- //# sourceMappingURL=async.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"async.js","sources":["../../src/async.ts"],"sourcesContent":["// Need to use node: prefix for cloudflare workers compatibility\n// Note: Because we are using node:async_hooks, we need to set `node_compat` in the wrangler.toml\nimport { AsyncLocalStorage } from 'node:async_hooks';\nimport type { Scope } from '@sentry/core';\nimport {\n _INTERNAL_createTracingChannelBinding,\n getDefaultCurrentScope,\n getDefaultIsolationScope,\n setAsyncContextStrategy,\n} from '@sentry/core';\n\n/**\n * Sets the async context strategy to use AsyncLocalStorage.\n *\n * AsyncLocalStorage is only available in the cloudflare workers runtime if you set\n * compatibility_flags = [\"nodejs_compat\"]\n *\n * @internal Only exported to be used in higher-level Sentry packages\n * @hidden Only exported to be used in higher-level Sentry packages\n */\nexport function setAsyncLocalStorageAsyncContextStrategy(): void {\n const asyncStorage = new AsyncLocalStorage<{\n scope: Scope;\n isolationScope: Scope;\n }>();\n\n function getScopes(): { scope: Scope; isolationScope: Scope } {\n const scopes = asyncStorage.getStore();\n\n if (scopes) {\n return scopes;\n }\n\n // fallback behavior:\n // if, for whatever reason, we can't find scopes on the context here, we have to fix this somehow\n return {\n scope: getDefaultCurrentScope(),\n isolationScope: getDefaultIsolationScope(),\n };\n }\n\n function withScope<T>(callback: (scope: Scope) => T): T {\n const scope = getScopes().scope.clone();\n const isolationScope = getScopes().isolationScope;\n return asyncStorage.run({ scope, isolationScope }, () => {\n return callback(scope);\n });\n }\n\n function withSetScope<T>(scope: Scope, callback: (scope: Scope) => T): T {\n const isolationScope = getScopes().isolationScope.clone();\n return asyncStorage.run({ scope, isolationScope }, () => {\n return callback(scope);\n });\n }\n\n function withIsolationScope<T>(callback: (isolationScope: Scope) => T): T {\n const scope = getScopes().scope;\n const isolationScope = getScopes().isolationScope.clone();\n return asyncStorage.run({ scope, isolationScope }, () => {\n return callback(isolationScope);\n });\n }\n\n function withSetIsolationScope<T>(isolationScope: Scope, callback: (isolationScope: Scope) => T): T {\n const scope = getScopes().scope;\n return asyncStorage.run({ scope, isolationScope }, () => {\n return callback(isolationScope);\n });\n }\n\n // In contrast to the browser, we can rely on async context isolation here\n function suppressTracing<T>(callback: () => T): T {\n return withScope(scope => {\n scope.setSDKProcessingMetadata({ __SENTRY_SUPPRESS_TRACING__: true });\n return callback();\n });\n }\n\n setAsyncContextStrategy({\n suppressTracing,\n withScope,\n withSetScope,\n withIsolationScope,\n withSetIsolationScope,\n getCurrentScope: () => getScopes().scope,\n getIsolationScope: () => getScopes().isolationScope,\n getTracingChannelBinding: () => _INTERNAL_createTracingChannelBinding(asyncStorage, getScopes),\n });\n}\n"],"names":["AsyncLocalStorage","getDefaultCurrentScope","getDefaultIsolationScope","setAsyncContextStrategy","_INTERNAL_createTracingChannelBinding"],"mappings":";;;;;AAoBO,SAAS,wCAAA,GAAiD;AAC/D,EAAA,MAAM,YAAA,GAAe,IAAIA,kCAAA,EAGtB;AAEH,EAAA,SAAS,SAAA,GAAqD;AAC5D,IAAA,MAAM,MAAA,GAAS,aAAa,QAAA,EAAS;AAErC,IAAA,IAAI,MAAA,EAAQ;AACV,MAAA,OAAO,MAAA;AAAA,IACT;AAIA,IAAA,OAAO;AAAA,MACL,OAAOC,2BAAA,EAAuB;AAAA,MAC9B,gBAAgBC,6BAAA;AAAyB,KAC3C;AAAA,EACF;AAEA,EAAA,SA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yB,EAAE,2BAAA,EAA6B,IAAA,EAAM,CAAA;AACpE,MAAA,OAAO,QAAA,EAAS;AAAA,IAClB,CAAC,CAAA;AAAA,EACH;AAEA,EAAAC,4BAAA,CAAwB;AAAA,IACtB,eAAA;AAAA,IACA,SAAA;AAAA,IACA,YAAA;AAAA,IACA,kBAAA;AAAA,IACA,qBAAA;AAAA,IACA,eAAA,EAAiB,MAAM,SAAA,EAAU,CAAE,KAAA;AAAA,IACnC,iBAAA,EAAmB,MAAM,SAAA,EAAU,CAAE,cAAA;AAAA,IACrC,wBAAA,EAA0B,MAAMC,0CAAA,CAAsC,YAAA,EAAc,SAAS;AAAA,GAC9F,CAAA;AACH;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.js","sources":["../../src/client.ts"],"sourcesContent":["import type { ClientOptions, Options, ServerRuntimeClientOptions } from '@sentry/core';\nimport {\n _INTERNAL_clearAiProviderSkips,\n applySdkMetadata,\n debug,\n ServerRuntimeClient,\n spanIsSampled,\n} from '@sentry/core';\nimport { DEBUG_BUILD } from './debug-build';\nimport type { ExecutionContextCompat } from './executionContext';\nimport type { makeFlushLock } from './flush';\nimport type { CloudflareTransportOptions } from './transport';\n\n/**\n * The Sentry Cloudflare SDK Client.\n *\n * @see CloudflareClientOptions for documentation on configuration options.\n * @see ServerRuntimeClient for usage documentation.\n */\nexport class CloudflareClient extends ServerRuntimeClient {\n private readonly _flushLock: ReturnType<typeof makeFlushLock> | void;\n private _pendingSpans: Set<string> = new Set();\n private _spanCompletionPromise: Promise<void> | null = null;\n private _resolveSpanCompletion: (() => void) | null = null;\n\n private _unsubscribeSpanStart: (() => void) | null = null;\n private _unsubscribeSpanEnd: (() => void) | null = null;\n\n /**\n * Creates a new Cloudflare SDK instance.\n * @param options Configuration options for this SDK.\n */\n public constructor(options: CloudflareClientOptions) {\n applySdkMetadata(options, 'cloudflare');\n options._metadata = options._metadata || {};\n const { flushLock, ...serverOptions } = options;\n\n const clientOptions: ServerRuntimeClientOptions = {\n ...serverOptions,\n platform: 'javascript',\n // TODO: Grab version information\n runtime: { name: 'cloudflare' },\n // TODO: Add server name\n _flushInterval: 0,\n };\n\n super(clientOptions);\n this._flushLock = flushLock;\n\n // Track span lifecycle to know when to flush\n this._unsubscribeSpanStart = this.on('spanStart', span => {\n const spanId = span.spanContext().spanId;\n DEBUG_BUILD && debug.log('[CloudflareClient] Span started:', spanId);\n\n // Negatively sampled spans never emit spanEnd,\n // so tracking them would cause _pendingSpans to grow unboundedly.\n // We should fix the inconsistent behavior for NonRecordingSpans in the future but\n // for now, we just ignore them.\n if (!spanIsSampled(span)) {\n return;\n }\n\n this._pendingSpans.add(spanId);\n\n if (!this._spanCompletionPromise) {\n this._spanCompletionPromise = new Promise(resolve => {\n this._resolveSpanCompletion = resolve;\n });\n }\n });\n\n this._unsubscribeSpanEnd = this.on('spanEnd', span => {\n const spanId = span.spanContext().spanId;\n DEBUG_BUILD && debug.log('[CloudflareClient] Span ended:', spanId);\n this._pendingSpans.delete(spanId);\n\n // If no more pending spans, resolve the completion promise\n if (this._pendingSpans.size === 0 && this._resolveSpanCompletion) {\n DEBUG_BUILD && debug.log('[CloudflareClient] All spans completed, resolving promise');\n this._resolveSpanCompletion();\n this._resetSpanCompletionPromise();\n }\n });\n }\n\n /**\n * Flushes pending operations and ensures all data is processed.\n * If a timeout is provided, the operation will be completed within the specified time limit.\n *\n * It will wait for all pending spans to complete before flushing.\n *\n * @param {number} [timeout] - Optional timeout in milliseconds to force the completion of the flush operation.\n * @return {Promise<boolean>} A promise that resolves to a boolean indicating whether the flush operation was successful.\n */\n public async flush(timeout?: number): Promise<boolean> {\n if (this._flushLock) {\n await this._flushLock.finalize();\n }\n\n if (this._pendingSpans.size > 0 && this._spanCompletionPromise) {\n DEBUG_BUILD &&\n debug.log('[CloudflareClient] Waiting for', this._pendingSpans.size, 'pending spans to complete...');\n\n const timeoutMs = timeout ?? 5000;\n const spanCompletionRace = Promise.race([\n this._spanCompletionPromise,\n new Promise(resolve =>\n setTimeout(() => {\n DEBUG_BUILD &&\n debug.log('[CloudflareClient] Span completion timeout after', timeoutMs, 'ms, flushing anyway');\n resolve(undefined);\n }, timeoutMs),\n ),\n ]);\n\n await spanCompletionRace;\n }\n\n return super.flush(timeout);\n }\n\n /**\n * Disposes of the client and releases all resources.\n *\n * This method clears all Cloudflare-specific state in addition to the base client cleanup.\n * It unsubscribes from span lifecycle events and clears pending span tracking.\n *\n * Call this method after flushing to allow the client to be garbage collected.\n * After calling dispose(), the client should not be used anymore.\n */\n public override dispose(): void {\n DEBUG_BUILD && debug.log('[CloudflareClient] Disposing client...');\n\n super.dispose();\n\n if (this._unsubscribeSpanStart) {\n this._unsubscribeSpanStart();\n this._unsubscribeSpanStart = null;\n }\n if (this._unsubscribeSpanEnd) {\n this._unsubscribeSpanEnd();\n this._unsubscribeSpanEnd = null;\n }\n\n this._resetSpanCompletionPromise();\n (this as unknown as { _flushLock: ReturnType<typeof makeFlushLock> | void })._flushLock = undefined;\n }\n\n /** @inheritDoc */\n protected override _setupIntegrations(): void {\n // Clear AI provider skip registrations before setting up integrations.\n // The registry is module-global and Cloudflare calls `init()` per request, so without this a\n // single `ai` SDK call would suppress direct `env.AI.run` spans for the rest of the isolate's\n // life. Mirrors the same reset in the Node client.\n _INTERNAL_clearAiProviderSkips();\n super._setupIntegrations();\n }\n\n /**\n * Resets the span completion promise and resolve function.\n */\n private _resetSpanCompletionPromise(): void {\n this._pendingSpans.clear();\n this._spanCompletionPromise = null;\n this._resolveSpanCompletion = null;\n }\n}\n\ninterface BaseCloudflareOptions {\n /**\n * @ignore Used internally to disable the deDupeIntegration for workflows.\n * @hidden Used internally to disable the deDupeIntegration for workflows.\n * @default true\n */\n enableDedupe?: boolean;\n\n /**\n * The Cloudflare SDK is not OpenTelemetry native, however, we set up some OpenTelemetry compatibility\n * via a custom trace provider.\n * This ensures that any spans emitted via `@opentelemetry/api` will be captured by Sentry.\n * HOWEVER, big caveat: This does not handle custom context handling, it will always work off the current scope.\n * This should be good enough for many, but not all integrations.\n *\n * If you want to opt-out of setting up the OpenTelemetry compatibility tracer, set this to `true`.\n *\n * @default false\n */\n skipOpenTelemetrySetup?: boolean;\n\n /**\n * Enable trace propagation for RPC calls between Workers, Durable Objects, and Service Bindings.\n *\n * When enabled, trace context (sentry-trace + baggage) is propagated across:\n * - `stub.fetch()` calls to Durable Objects (via HTTP headers)\n * - Service binding `fetch()` calls (via HTTP headers)\n * - RPC method calls to Durable Objects and WorkerEntrypoints (via trailing argument)\n *\n * When enabled on the **receiver side** (DurableObject or WorkerEntrypoint), the SDK will also:\n * - Extract and continue traces from incoming RPC calls\n * - Create spans for each RPC method invocation\n * - Capture errors thrown by RPC methods\n *\n * **Important:** This option should be enabled on **both sides** for full trace propagation.\n *\n * @default false\n * @example\n * ```ts\n * // Worker side (caller)\n * export default Sentry.withSentry(\n * (env) => ({\n * dsn: env.SENTRY_DSN,\n * enableRpcTracePropagation: true,\n * }),\n * handler,\n * );\n *\n * // Durable Object side (receiver)\n * export const MyDO = Sentry.instrumentDurableObjectWithSentry(\n * (env) => ({\n * dsn: env.SENTRY_DSN,\n * enableRpcTracePropagation: true,\n * }),\n * MyDOBase,\n * );\n *\n * // WorkerEntrypoint side (receiver)\n * export const MyEntrypoint = Sentry.withSentry(\n * env => ({ dsn: env.SENTRY_DSN, enableRpcTracePropagation: true }),\n * MyEntrypointBase,\n * );\n * ```\n */\n enableRpcTracePropagation?: boolean;\n\n /**\n * Table names that should stay instrumented even though they match the reserved `cf_` prefix used\n * by Durable Object frameworks (`agents`, `partyserver`, ...) for their internal SQLite tables.\n *\n * By default, `exec` queries against `cf_`-prefixed tables are treated as framework noise and no\n * `db.query` span is created for them. If one of your own tables happens to use this prefix, add it\n * here to opt it back into instrumentation. Entries are matched against each table name in the\n * query summary — strings must match exactly, while regular expressions give you prefix/pattern\n * matching.\n *\n * @default []\n * @example\n * ```ts\n * export default Sentry.withSentry(\n * (env) => ({\n * dsn: env.SENTRY_DSN,\n * durableObjectSqlSpanAllowlist: ['cf_my_table', /^cf_reports_/],\n * }),\n * handler,\n * );\n * ```\n */\n durableObjectSqlSpanAllowlist?: Array<string | RegExp>;\n\n /**\n * KV keys that should stay instrumented even though they match a reserved prefix used by Durable\n * Object frameworks (`agents`, `partyserver`, ...) for their internal storage entries.\n *\n * By default, KV reads/writes (`get`, `put`, `delete`, `list`) of `cf_`- or `__ps_`-prefixed keys\n * are treated as framework noise and no `durable_object_storage_*` span is created for them,\n * mirroring how `cf_`-prefixed SQL tables are handled (see {@link durableObjectSqlSpanAllowlist}).\n * If one of your own keys happens to use such a prefix, add it here to opt it back into\n * instrumentation. Strings must match exactly, while regular expressions give you prefix/pattern\n * matching.\n *\n * @default []\n * @example\n * ```ts\n * export default Sentry.withSentry(\n * (env) => ({\n * dsn: env.SENTRY_DSN,\n * durableObjectStorageSpanAllowlist: ['cf_my_key', /^cf_reports_/],\n * }),\n * handler,\n * );\n * ```\n */\n durableObjectStorageSpanAllowlist?: Array<string | RegExp>;\n\n /**\n * @deprecated Use `enableRpcTracePropagation` instead. This option will be removed in a future major version.\n *\n * Enable instrumentation of prototype methods for DurableObjects.\n *\n * When `true`, the SDK will wrap all methods on the DurableObject prototype chain\n * to automatically create spans and capture errors for RPC method calls.\n *\n * When an array of strings is provided, only the specified method names will be instrumented.\n *\n * @default false\n */\n instrumentPrototypeMethods?: boolean | string[];\n\n /**\n * If you use Spotlight by Sentry during development, use\n * this option to forward captured Sentry events to Spotlight.\n *\n * Either set it to true, or provide a specific Spotlight Sidecar URL.\n *\n * More details: https://spotlightjs.com/\n *\n * IMPORTANT: Only set this option to `true` while developing, not in production!\n */\n spotlight?: boolean | string;\n}\n\n/**\n * Configuration options for the Sentry Cloudflare SDK\n *\n * @see @sentry/core Options for more information.\n */\nexport interface CloudflareOptions extends Options<CloudflareTransportOptions>, BaseCloudflareOptions {\n ctx?: ExecutionContextCompat;\n}\n\n/**\n * Configuration options for the Sentry Cloudflare SDK Client class\n *\n * @see CloudflareClient for more information.\n */\nexport interface CloudflareClientOptions extends ClientOptions<CloudflareTransportOptions>, BaseCloudflareOptions {\n flushLock?: ReturnType<typeof makeFlushLock>;\n}\n"],"names":["ServerRuntimeClient","applySdkMetadata","DEBUG_BUILD","debug","spanIsSampled","_INTERNAL_clearAiProviderSkips"],"mappings":";;;;;AAmBO,MAAM,yBAAyBA,wBAAA,CAAoB;AAAA;AAAA;AAAA;AAAA;AAAA,EAajD,YAAY,OAAA,EAAkC;AACnD,IAAAC,qBAAA,CAAiB,SAAS,YAAY,CAAA;AACtC,IAAA,OAAA,CAAQ,SAAA,GAAY,OAAA,CAAQ,SAAA,IAAa,EAAC;AAC1C,IAAA,MAAM,EAAE,SAAA,EAAW,GAAG,aAAA,EAAc,GAAI,OAAA;AAExC,IAAA,MAAM,aAAA,GAA4C;AAAA,MAChD,GAAG,aAAA;AAAA,MACH,QAAA,EAAU,YAAA;AAAA;AAAA,MAEV,OAAA,EAAS,EAAE,IAAA,EAAM,YAAA,EAAa;AAAA;AAAA,MAE9B,cAAA,EAAgB;AAAA,KAClB;AAEA,IAAA,KAAA,CAAM,aAAa,CAAA;AAzBrB,IAAA,IAAA,CAAQ,aAAA,uBAAiC,GAAA,EAAI;AAC7C,IAAA,IAAA,CAAQ,sBAAA,GAA+C,IAAA;AACvD,IAAA,IAAA,CAAQ,sBAAA,GAA8C,IAAA;AAEtD,IAAA,IAAA,CAAQ,qBAAA,GAA6C,IAAA;AACrD,IAAA,IAAA,CAAQ,mBAAA,GAA2C,IAAA;AAqBjD,IAAA,IAAA,CAAK,UAAA,GAAa,SAAA;AAGlB,IAAA,IAAA,CAAK,qBAAA,GAAwB,IAAA,CAAK,EAAA,CAAG,WAAA,EAAa,CAAA,IAAA,KAAQ;AACxD,MAAA,MAAM,MAAA,GAAS,IAAA,CAAK,WAAA,EAAY,CAAE,MAAA;AAClC,MAAAC,sBAAA,IAAeC,UAAA,CAAM,GAAA,CAAI,kCAAA,EAAoC,MAAM,CAAA;AAMnE,MA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A,IAAA,CAAK,cAAc,KAAA,EAAM;AACzB,IAAA,IAAA,CAAK,sBAAA,GAAyB,IAAA;AAC9B,IAAA,IAAA,CAAK,sBAAA,GAAyB,IAAA;AAAA,EAChC;AACF;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"debug-build.js","sources":["../../src/debug-build.ts"],"sourcesContent":["declare const __DEBUG_BUILD__: boolean;\n\n/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nexport const DEBUG_BUILD = __DEBUG_BUILD__;\n"],"names":[],"mappings":";;AAOO,MAAM,WAAA,IAAc,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA;;;;"}