@sentry/cloudflare 11.0.0-alpha.1 → 11.0.0-alpha.2

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 (339) hide show
  1. package/build/cjs/dev/baseSdk.js +20 -8
  2. package/build/cjs/dev/baseSdk.js.map +1 -1
  3. package/build/cjs/dev/client.js +116 -24
  4. package/build/cjs/dev/client.js.map +1 -1
  5. package/build/cjs/dev/clientCache.js +15 -0
  6. package/build/cjs/dev/clientCache.js.map +1 -0
  7. package/build/cjs/dev/defineCloudflareOptions.js.map +1 -1
  8. package/build/cjs/dev/durableobject.js +24 -8
  9. package/build/cjs/dev/durableobject.js.map +1 -1
  10. package/build/cjs/dev/flush.js +6 -4
  11. package/build/cjs/dev/flush.js.map +1 -1
  12. package/build/cjs/dev/index.js +3 -3
  13. package/build/cjs/dev/instrumentations/instrumentDurableObjectNamespace.js +4 -4
  14. package/build/cjs/dev/instrumentations/instrumentDurableObjectNamespace.js.map +1 -1
  15. package/build/cjs/dev/instrumentations/instrumentWorkerEntrypoint.js +8 -16
  16. package/build/cjs/dev/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
  17. package/build/cjs/dev/instrumentations/worker/instrumentD1.js +5 -1
  18. package/build/cjs/dev/instrumentations/worker/instrumentD1.js.map +1 -1
  19. package/build/cjs/dev/instrumentations/worker/instrumentEmail.js +4 -2
  20. package/build/cjs/dev/instrumentations/worker/instrumentEmail.js.map +1 -1
  21. package/build/cjs/dev/instrumentations/worker/instrumentEnv.js +5 -5
  22. package/build/cjs/dev/instrumentations/worker/instrumentEnv.js.map +1 -1
  23. package/build/cjs/dev/instrumentations/worker/instrumentFetch.js +8 -8
  24. package/build/cjs/dev/instrumentations/worker/instrumentFetch.js.map +1 -1
  25. package/build/cjs/dev/instrumentations/worker/instrumentQueue.js +4 -2
  26. package/build/cjs/dev/instrumentations/worker/instrumentQueue.js.map +1 -1
  27. package/build/cjs/dev/instrumentations/worker/instrumentR2.js +21 -18
  28. package/build/cjs/dev/instrumentations/worker/instrumentR2.js.map +1 -1
  29. package/build/cjs/dev/instrumentations/worker/instrumentRateLimit.js +6 -1
  30. package/build/cjs/dev/instrumentations/worker/instrumentRateLimit.js.map +1 -1
  31. package/build/cjs/dev/instrumentations/worker/instrumentScheduled.js +4 -2
  32. package/build/cjs/dev/instrumentations/worker/instrumentScheduled.js.map +1 -1
  33. package/build/cjs/dev/instrumentations/worker/instrumentTail.js +2 -0
  34. package/build/cjs/dev/instrumentations/worker/instrumentTail.js.map +1 -1
  35. package/build/cjs/dev/integrations/fetch.js +1 -11
  36. package/build/cjs/dev/integrations/fetch.js.map +1 -1
  37. package/build/cjs/dev/opentelemetry/tracer.js +2 -40
  38. package/build/cjs/dev/opentelemetry/tracer.js.map +1 -1
  39. package/build/cjs/dev/pages-plugin.js +2 -2
  40. package/build/cjs/dev/pages-plugin.js.map +1 -1
  41. package/build/cjs/dev/request.js +2 -123
  42. package/build/cjs/dev/request.js.map +1 -1
  43. package/build/cjs/dev/sdk.js +12 -6
  44. package/build/cjs/dev/sdk.js.map +1 -1
  45. package/build/cjs/dev/transport.js +1 -1
  46. package/build/cjs/dev/transport.js.map +1 -1
  47. package/build/cjs/dev/utils/invocationContext.js +41 -0
  48. package/build/cjs/dev/utils/invocationContext.js.map +1 -0
  49. package/build/cjs/dev/utils/invocationScope.js +7 -2
  50. package/build/cjs/dev/utils/invocationScope.js.map +1 -1
  51. package/build/cjs/dev/utils/rpcPropagation.js +15 -0
  52. package/build/cjs/dev/utils/rpcPropagation.js.map +1 -0
  53. package/build/cjs/dev/vite/autoInstrument.js +2 -1
  54. package/build/cjs/dev/vite/autoInstrument.js.map +1 -1
  55. package/build/cjs/dev/vite/index.js.map +1 -1
  56. package/build/cjs/dev/vite/transform.js +30 -5
  57. package/build/cjs/dev/vite/transform.js.map +1 -1
  58. package/build/cjs/dev/vite/wranglerConfig.js +21 -1
  59. package/build/cjs/dev/vite/wranglerConfig.js.map +1 -1
  60. package/build/cjs/dev/withSentry.js.map +1 -1
  61. package/build/cjs/dev/workflows.js +45 -33
  62. package/build/cjs/dev/workflows.js.map +1 -1
  63. package/build/cjs/dev/wrapMethodWithSentry.js +51 -15
  64. package/build/cjs/dev/wrapMethodWithSentry.js.map +1 -1
  65. package/build/cjs/dev/wrapRequestHandlerWithInit.js +133 -0
  66. package/build/cjs/dev/wrapRequestHandlerWithInit.js.map +1 -0
  67. package/build/cjs/prod/baseSdk.js +20 -8
  68. package/build/cjs/prod/baseSdk.js.map +1 -1
  69. package/build/cjs/prod/client.js +116 -24
  70. package/build/cjs/prod/client.js.map +1 -1
  71. package/build/cjs/prod/clientCache.js +15 -0
  72. package/build/cjs/prod/clientCache.js.map +1 -0
  73. package/build/cjs/prod/defineCloudflareOptions.js.map +1 -1
  74. package/build/cjs/prod/durableobject.js +24 -8
  75. package/build/cjs/prod/durableobject.js.map +1 -1
  76. package/build/cjs/prod/flush.js +6 -4
  77. package/build/cjs/prod/flush.js.map +1 -1
  78. package/build/cjs/prod/index.js +3 -3
  79. package/build/cjs/prod/instrumentations/instrumentDurableObjectNamespace.js +4 -4
  80. package/build/cjs/prod/instrumentations/instrumentDurableObjectNamespace.js.map +1 -1
  81. package/build/cjs/prod/instrumentations/instrumentWorkerEntrypoint.js +8 -16
  82. package/build/cjs/prod/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
  83. package/build/cjs/prod/instrumentations/worker/instrumentD1.js +5 -1
  84. package/build/cjs/prod/instrumentations/worker/instrumentD1.js.map +1 -1
  85. package/build/cjs/prod/instrumentations/worker/instrumentEmail.js +4 -2
  86. package/build/cjs/prod/instrumentations/worker/instrumentEmail.js.map +1 -1
  87. package/build/cjs/prod/instrumentations/worker/instrumentEnv.js +5 -5
  88. package/build/cjs/prod/instrumentations/worker/instrumentEnv.js.map +1 -1
  89. package/build/cjs/prod/instrumentations/worker/instrumentFetch.js +8 -8
  90. package/build/cjs/prod/instrumentations/worker/instrumentFetch.js.map +1 -1
  91. package/build/cjs/prod/instrumentations/worker/instrumentQueue.js +4 -2
  92. package/build/cjs/prod/instrumentations/worker/instrumentQueue.js.map +1 -1
  93. package/build/cjs/prod/instrumentations/worker/instrumentR2.js +21 -18
  94. package/build/cjs/prod/instrumentations/worker/instrumentR2.js.map +1 -1
  95. package/build/cjs/prod/instrumentations/worker/instrumentRateLimit.js +6 -1
  96. package/build/cjs/prod/instrumentations/worker/instrumentRateLimit.js.map +1 -1
  97. package/build/cjs/prod/instrumentations/worker/instrumentScheduled.js +4 -2
  98. package/build/cjs/prod/instrumentations/worker/instrumentScheduled.js.map +1 -1
  99. package/build/cjs/prod/instrumentations/worker/instrumentTail.js +2 -0
  100. package/build/cjs/prod/instrumentations/worker/instrumentTail.js.map +1 -1
  101. package/build/cjs/prod/integrations/fetch.js +1 -11
  102. package/build/cjs/prod/integrations/fetch.js.map +1 -1
  103. package/build/cjs/prod/opentelemetry/tracer.js +2 -40
  104. package/build/cjs/prod/opentelemetry/tracer.js.map +1 -1
  105. package/build/cjs/prod/pages-plugin.js +2 -2
  106. package/build/cjs/prod/pages-plugin.js.map +1 -1
  107. package/build/cjs/prod/request.js +2 -123
  108. package/build/cjs/prod/request.js.map +1 -1
  109. package/build/cjs/prod/sdk.js +12 -6
  110. package/build/cjs/prod/sdk.js.map +1 -1
  111. package/build/cjs/prod/transport.js +1 -1
  112. package/build/cjs/prod/transport.js.map +1 -1
  113. package/build/cjs/prod/utils/invocationContext.js +41 -0
  114. package/build/cjs/prod/utils/invocationContext.js.map +1 -0
  115. package/build/cjs/prod/utils/invocationScope.js +7 -2
  116. package/build/cjs/prod/utils/invocationScope.js.map +1 -1
  117. package/build/cjs/prod/utils/rpcPropagation.js +15 -0
  118. package/build/cjs/prod/utils/rpcPropagation.js.map +1 -0
  119. package/build/cjs/prod/vite/autoInstrument.js +2 -1
  120. package/build/cjs/prod/vite/autoInstrument.js.map +1 -1
  121. package/build/cjs/prod/vite/index.js.map +1 -1
  122. package/build/cjs/prod/vite/transform.js +30 -5
  123. package/build/cjs/prod/vite/transform.js.map +1 -1
  124. package/build/cjs/prod/vite/wranglerConfig.js +21 -1
  125. package/build/cjs/prod/vite/wranglerConfig.js.map +1 -1
  126. package/build/cjs/prod/withSentry.js.map +1 -1
  127. package/build/cjs/prod/workflows.js +45 -33
  128. package/build/cjs/prod/workflows.js.map +1 -1
  129. package/build/cjs/prod/wrapMethodWithSentry.js +51 -15
  130. package/build/cjs/prod/wrapMethodWithSentry.js.map +1 -1
  131. package/build/cjs/prod/wrapRequestHandlerWithInit.js +133 -0
  132. package/build/cjs/prod/wrapRequestHandlerWithInit.js.map +1 -0
  133. package/build/esm/dev/baseSdk.js +21 -9
  134. package/build/esm/dev/baseSdk.js.map +1 -1
  135. package/build/esm/dev/client.js +117 -25
  136. package/build/esm/dev/client.js.map +1 -1
  137. package/build/esm/dev/clientCache.js +12 -0
  138. package/build/esm/dev/clientCache.js.map +1 -0
  139. package/build/esm/dev/defineCloudflareOptions.js.map +1 -1
  140. package/build/esm/dev/durableobject.js +23 -7
  141. package/build/esm/dev/durableobject.js.map +1 -1
  142. package/build/esm/dev/flush.js +6 -4
  143. package/build/esm/dev/flush.js.map +1 -1
  144. package/build/esm/dev/index.js +3 -4
  145. package/build/esm/dev/index.js.map +1 -1
  146. package/build/esm/dev/instrumentations/instrumentDurableObjectNamespace.js +4 -4
  147. package/build/esm/dev/instrumentations/instrumentDurableObjectNamespace.js.map +1 -1
  148. package/build/esm/dev/instrumentations/instrumentWorkerEntrypoint.js +8 -16
  149. package/build/esm/dev/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
  150. package/build/esm/dev/instrumentations/worker/instrumentD1.js +6 -2
  151. package/build/esm/dev/instrumentations/worker/instrumentD1.js.map +1 -1
  152. package/build/esm/dev/instrumentations/worker/instrumentEmail.js +7 -5
  153. package/build/esm/dev/instrumentations/worker/instrumentEmail.js.map +1 -1
  154. package/build/esm/dev/instrumentations/worker/instrumentEnv.js +5 -5
  155. package/build/esm/dev/instrumentations/worker/instrumentEnv.js.map +1 -1
  156. package/build/esm/dev/instrumentations/worker/instrumentFetch.js +1 -1
  157. package/build/esm/dev/instrumentations/worker/instrumentFetch.js.map +1 -1
  158. package/build/esm/dev/instrumentations/worker/instrumentQueue.js +7 -5
  159. package/build/esm/dev/instrumentations/worker/instrumentQueue.js.map +1 -1
  160. package/build/esm/dev/instrumentations/worker/instrumentR2.js +22 -19
  161. package/build/esm/dev/instrumentations/worker/instrumentR2.js.map +1 -1
  162. package/build/esm/dev/instrumentations/worker/instrumentRateLimit.js +6 -1
  163. package/build/esm/dev/instrumentations/worker/instrumentRateLimit.js.map +1 -1
  164. package/build/esm/dev/instrumentations/worker/instrumentScheduled.js +7 -5
  165. package/build/esm/dev/instrumentations/worker/instrumentScheduled.js.map +1 -1
  166. package/build/esm/dev/instrumentations/worker/instrumentTail.js +2 -0
  167. package/build/esm/dev/instrumentations/worker/instrumentTail.js.map +1 -1
  168. package/build/esm/dev/integrations/fetch.js +2 -12
  169. package/build/esm/dev/integrations/fetch.js.map +1 -1
  170. package/build/esm/dev/opentelemetry/tracer.js +2 -40
  171. package/build/esm/dev/opentelemetry/tracer.js.map +1 -1
  172. package/build/esm/dev/package.json +1 -1
  173. package/build/esm/dev/pages-plugin.js +1 -1
  174. package/build/esm/dev/pages-plugin.js.map +1 -1
  175. package/build/esm/dev/request.js +2 -122
  176. package/build/esm/dev/request.js.map +1 -1
  177. package/build/esm/dev/sdk.js +12 -7
  178. package/build/esm/dev/sdk.js.map +1 -1
  179. package/build/esm/dev/transport.js +1 -1
  180. package/build/esm/dev/transport.js.map +1 -1
  181. package/build/esm/dev/utils/invocationContext.js +37 -0
  182. package/build/esm/dev/utils/invocationContext.js.map +1 -0
  183. package/build/esm/dev/utils/invocationScope.js +7 -2
  184. package/build/esm/dev/utils/invocationScope.js.map +1 -1
  185. package/build/esm/dev/utils/rpcPropagation.js +13 -0
  186. package/build/esm/dev/utils/rpcPropagation.js.map +1 -0
  187. package/build/esm/dev/utils/traceLinks.js +1 -1
  188. package/build/esm/dev/vite/autoInstrument.js +2 -1
  189. package/build/esm/dev/vite/autoInstrument.js.map +1 -1
  190. package/build/esm/dev/vite/index.js.map +1 -1
  191. package/build/esm/dev/vite/transform.js +30 -5
  192. package/build/esm/dev/vite/transform.js.map +1 -1
  193. package/build/esm/dev/vite/wranglerConfig.js +21 -2
  194. package/build/esm/dev/vite/wranglerConfig.js.map +1 -1
  195. package/build/esm/dev/withSentry.js.map +1 -1
  196. package/build/esm/dev/workflows.js +48 -36
  197. package/build/esm/dev/workflows.js.map +1 -1
  198. package/build/esm/dev/wrapMethodWithSentry.js +53 -17
  199. package/build/esm/dev/wrapMethodWithSentry.js.map +1 -1
  200. package/build/esm/dev/wrapRequestHandlerWithInit.js +131 -0
  201. package/build/esm/dev/wrapRequestHandlerWithInit.js.map +1 -0
  202. package/build/esm/prod/baseSdk.js +21 -9
  203. package/build/esm/prod/baseSdk.js.map +1 -1
  204. package/build/esm/prod/client.js +117 -25
  205. package/build/esm/prod/client.js.map +1 -1
  206. package/build/esm/prod/clientCache.js +12 -0
  207. package/build/esm/prod/clientCache.js.map +1 -0
  208. package/build/esm/prod/defineCloudflareOptions.js.map +1 -1
  209. package/build/esm/prod/durableobject.js +23 -7
  210. package/build/esm/prod/durableobject.js.map +1 -1
  211. package/build/esm/prod/flush.js +6 -4
  212. package/build/esm/prod/flush.js.map +1 -1
  213. package/build/esm/prod/index.js +3 -4
  214. package/build/esm/prod/index.js.map +1 -1
  215. package/build/esm/prod/instrumentations/instrumentDurableObjectNamespace.js +4 -4
  216. package/build/esm/prod/instrumentations/instrumentDurableObjectNamespace.js.map +1 -1
  217. package/build/esm/prod/instrumentations/instrumentWorkerEntrypoint.js +8 -16
  218. package/build/esm/prod/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
  219. package/build/esm/prod/instrumentations/worker/instrumentD1.js +6 -2
  220. package/build/esm/prod/instrumentations/worker/instrumentD1.js.map +1 -1
  221. package/build/esm/prod/instrumentations/worker/instrumentEmail.js +7 -5
  222. package/build/esm/prod/instrumentations/worker/instrumentEmail.js.map +1 -1
  223. package/build/esm/prod/instrumentations/worker/instrumentEnv.js +5 -5
  224. package/build/esm/prod/instrumentations/worker/instrumentEnv.js.map +1 -1
  225. package/build/esm/prod/instrumentations/worker/instrumentFetch.js +1 -1
  226. package/build/esm/prod/instrumentations/worker/instrumentFetch.js.map +1 -1
  227. package/build/esm/prod/instrumentations/worker/instrumentQueue.js +7 -5
  228. package/build/esm/prod/instrumentations/worker/instrumentQueue.js.map +1 -1
  229. package/build/esm/prod/instrumentations/worker/instrumentR2.js +22 -19
  230. package/build/esm/prod/instrumentations/worker/instrumentR2.js.map +1 -1
  231. package/build/esm/prod/instrumentations/worker/instrumentRateLimit.js +6 -1
  232. package/build/esm/prod/instrumentations/worker/instrumentRateLimit.js.map +1 -1
  233. package/build/esm/prod/instrumentations/worker/instrumentScheduled.js +7 -5
  234. package/build/esm/prod/instrumentations/worker/instrumentScheduled.js.map +1 -1
  235. package/build/esm/prod/instrumentations/worker/instrumentTail.js +2 -0
  236. package/build/esm/prod/instrumentations/worker/instrumentTail.js.map +1 -1
  237. package/build/esm/prod/integrations/fetch.js +2 -12
  238. package/build/esm/prod/integrations/fetch.js.map +1 -1
  239. package/build/esm/prod/opentelemetry/tracer.js +2 -40
  240. package/build/esm/prod/opentelemetry/tracer.js.map +1 -1
  241. package/build/esm/prod/package.json +1 -1
  242. package/build/esm/prod/pages-plugin.js +1 -1
  243. package/build/esm/prod/pages-plugin.js.map +1 -1
  244. package/build/esm/prod/request.js +2 -122
  245. package/build/esm/prod/request.js.map +1 -1
  246. package/build/esm/prod/sdk.js +12 -7
  247. package/build/esm/prod/sdk.js.map +1 -1
  248. package/build/esm/prod/transport.js +1 -1
  249. package/build/esm/prod/transport.js.map +1 -1
  250. package/build/esm/prod/utils/invocationContext.js +37 -0
  251. package/build/esm/prod/utils/invocationContext.js.map +1 -0
  252. package/build/esm/prod/utils/invocationScope.js +7 -2
  253. package/build/esm/prod/utils/invocationScope.js.map +1 -1
  254. package/build/esm/prod/utils/rpcPropagation.js +13 -0
  255. package/build/esm/prod/utils/rpcPropagation.js.map +1 -0
  256. package/build/esm/prod/utils/traceLinks.js +1 -1
  257. package/build/esm/prod/vite/autoInstrument.js +2 -1
  258. package/build/esm/prod/vite/autoInstrument.js.map +1 -1
  259. package/build/esm/prod/vite/index.js.map +1 -1
  260. package/build/esm/prod/vite/transform.js +30 -5
  261. package/build/esm/prod/vite/transform.js.map +1 -1
  262. package/build/esm/prod/vite/wranglerConfig.js +21 -2
  263. package/build/esm/prod/vite/wranglerConfig.js.map +1 -1
  264. package/build/esm/prod/withSentry.js.map +1 -1
  265. package/build/esm/prod/workflows.js +48 -36
  266. package/build/esm/prod/workflows.js.map +1 -1
  267. package/build/esm/prod/wrapMethodWithSentry.js +53 -17
  268. package/build/esm/prod/wrapMethodWithSentry.js.map +1 -1
  269. package/build/esm/prod/wrapRequestHandlerWithInit.js +131 -0
  270. package/build/esm/prod/wrapRequestHandlerWithInit.js.map +1 -0
  271. package/build/types/baseSdk.d.ts +8 -0
  272. package/build/types/baseSdk.d.ts.map +1 -1
  273. package/build/types/client.d.ts +90 -17
  274. package/build/types/client.d.ts.map +1 -1
  275. package/build/types/clientCache.d.ts +8 -0
  276. package/build/types/clientCache.d.ts.map +1 -0
  277. package/build/types/defineCloudflareOptions.d.ts +3 -2
  278. package/build/types/defineCloudflareOptions.d.ts.map +1 -1
  279. package/build/types/durableobject.d.ts +5 -7
  280. package/build/types/durableobject.d.ts.map +1 -1
  281. package/build/types/flush.d.ts +2 -0
  282. package/build/types/flush.d.ts.map +1 -1
  283. package/build/types/index.d.ts +3 -4
  284. package/build/types/index.d.ts.map +1 -1
  285. package/build/types/instrumentations/instrumentDurableObjectNamespace.d.ts +2 -1
  286. package/build/types/instrumentations/instrumentDurableObjectNamespace.d.ts.map +1 -1
  287. package/build/types/instrumentations/instrumentWorkerEntrypoint.d.ts +2 -3
  288. package/build/types/instrumentations/instrumentWorkerEntrypoint.d.ts.map +1 -1
  289. package/build/types/instrumentations/worker/instrumentD1.d.ts.map +1 -1
  290. package/build/types/instrumentations/worker/instrumentEmail.d.ts.map +1 -1
  291. package/build/types/instrumentations/worker/instrumentEnv.d.ts.map +1 -1
  292. package/build/types/instrumentations/worker/instrumentQueue.d.ts.map +1 -1
  293. package/build/types/instrumentations/worker/instrumentR2.d.ts.map +1 -1
  294. package/build/types/instrumentations/worker/instrumentRateLimit.d.ts.map +1 -1
  295. package/build/types/instrumentations/worker/instrumentScheduled.d.ts.map +1 -1
  296. package/build/types/instrumentations/worker/instrumentTail.d.ts.map +1 -1
  297. package/build/types/integrations/fetch.d.ts.map +1 -1
  298. package/build/types/opentelemetry/tracer.d.ts.map +1 -1
  299. package/build/types/pages-plugin.d.ts +3 -1
  300. package/build/types/pages-plugin.d.ts.map +1 -1
  301. package/build/types/request.d.ts +5 -31
  302. package/build/types/request.d.ts.map +1 -1
  303. package/build/types/sdk.d.ts +13 -4
  304. package/build/types/sdk.d.ts.map +1 -1
  305. package/build/types/transport.d.ts.map +1 -1
  306. package/build/types/types.d.ts +28 -0
  307. package/build/types/types.d.ts.map +1 -1
  308. package/build/types/utils/invocationContext.d.ts +58 -0
  309. package/build/types/utils/invocationContext.d.ts.map +1 -0
  310. package/build/types/utils/invocationScope.d.ts +2 -1
  311. package/build/types/utils/invocationScope.d.ts.map +1 -1
  312. package/build/types/utils/rpcPropagation.d.ts +10 -0
  313. package/build/types/utils/rpcPropagation.d.ts.map +1 -0
  314. package/build/types/vite/autoInstrument.d.ts.map +1 -1
  315. package/build/types/vite/index.d.ts +4 -0
  316. package/build/types/vite/index.d.ts.map +1 -1
  317. package/build/types/vite/transform.d.ts +3 -0
  318. package/build/types/vite/transform.d.ts.map +1 -1
  319. package/build/types/vite/wranglerConfig.d.ts +13 -0
  320. package/build/types/vite/wranglerConfig.d.ts.map +1 -1
  321. package/build/types/withSentry.d.ts +2 -3
  322. package/build/types/withSentry.d.ts.map +1 -1
  323. package/build/types/workflows.d.ts +3 -3
  324. package/build/types/workflows.d.ts.map +1 -1
  325. package/build/types/wrapMethodWithSentry.d.ts +6 -1
  326. package/build/types/wrapMethodWithSentry.d.ts.map +1 -1
  327. package/build/types/wrapRequestHandlerWithInit.d.ts +31 -0
  328. package/build/types/wrapRequestHandlerWithInit.d.ts.map +1 -0
  329. package/package.json +6 -4
  330. package/build/cjs/dev/integrations/tracing/vercelai.js +0 -18
  331. package/build/cjs/dev/integrations/tracing/vercelai.js.map +0 -1
  332. package/build/cjs/prod/integrations/tracing/vercelai.js +0 -18
  333. package/build/cjs/prod/integrations/tracing/vercelai.js.map +0 -1
  334. package/build/esm/dev/integrations/tracing/vercelai.js +0 -16
  335. package/build/esm/dev/integrations/tracing/vercelai.js.map +0 -1
  336. package/build/esm/prod/integrations/tracing/vercelai.js +0 -16
  337. package/build/esm/prod/integrations/tracing/vercelai.js.map +0 -1
  338. package/build/types/integrations/tracing/vercelai.d.ts +0 -39
  339. package/build/types/integrations/tracing/vercelai.d.ts.map +0 -1
@@ -0,0 +1,58 @@
1
+ import type { ExecutionContext } from '@cloudflare/workers-types';
2
+ import type { Scope } from '@sentry/core';
3
+ import type { ExecutionContextCompat } from '../executionContext';
4
+ /**
5
+ * State owned by a single invocation (request, RPC call, cron, ...).
6
+ *
7
+ * A cached client (`cacheClient`) is shared by all invocations running in the same
8
+ * isolate, so anything invocation-owned must not live on the client: two overlapping
9
+ * requests would otherwise overwrite each other's state (e.g. the execution context
10
+ * used to register eager flushes) and the earlier invocation's envelopes would be
11
+ * suspended when the later invocation ends.
12
+ *
13
+ * The state rides on the invocation's forked isolation scope, which the async
14
+ * context strategy (AsyncLocalStorage) hands back for exactly the async context that
15
+ * owns the invocation — including detached continuations created inside it. A symbol
16
+ * key keeps it off `Scope.clone()` and out of serialized event data.
17
+ */
18
+ export interface InvocationState {
19
+ /**
20
+ * The execution context of the invocation that owns this scope. Eager envelope
21
+ * sends are registered with this context's `waitUntil`, so they are attributed to
22
+ * the invocation that captured the data even when invocations overlap.
23
+ */
24
+ readonly ctx: ExecutionContextCompat | undefined;
25
+ /**
26
+ * Set on the client's `flush` hook, the invocation's natural flush point.
27
+ * Captures before it are drained by that flush; captures after it (in
28
+ * `waitUntil` work or detached continuations) have no later flush to ride and
29
+ * are delivered eagerly.
30
+ */
31
+ flushPointReached?: boolean;
32
+ /**
33
+ * `ctx.waitUntil` resolved once for this invocation (see `getInvocationWaitUntil`).
34
+ * `null` once resolved to "no usable waitUntil".
35
+ */
36
+ waitUntil?: ExecutionContext['waitUntil'] | null;
37
+ }
38
+ /**
39
+ * Returns the invocation's original (un-instrumented) `waitUntil`, bound to its context,
40
+ * resolving it on first use and caching it on the state. Reading `ctx.waitUntil` on a
41
+ * native `ExecutionContext`/`DurableObjectState` goes through the runtime's property
42
+ * getter every time; one read per invocation is enough.
43
+ */
44
+ export declare function getInvocationWaitUntil(state: InvocationState): ExecutionContext['waitUntil'] | undefined;
45
+ /**
46
+ * Attaches invocation state to a forked isolation scope. Only meaningful on a scope
47
+ * that outlives nothing but this invocation — never attach to the default isolation
48
+ * scope, which is shared by every invocation in the isolate.
49
+ */
50
+ export declare function setInvocationState(scope: Scope, state: InvocationState): void;
51
+ /**
52
+ * Returns the state of the invocation that owns the current async context, or
53
+ * `undefined` outside any instrumented invocation (the default isolation scope is
54
+ * shared, so state read from it could not be attributed to one invocation — and it
55
+ * is never attached there in the first place).
56
+ */
57
+ export declare function getInvocationState(): InvocationState | undefined;
58
+ //# sourceMappingURL=invocationContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invocationContext.d.ts","sourceRoot":"","sources":["../../../src/utils/invocationContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAGlE;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,GAAG,EAAE,sBAAsB,GAAG,SAAS,CAAC;IACjD;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC;CAClD;AAID;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,eAAe,GAAG,gBAAgB,CAAC,WAAW,CAAC,GAAG,SAAS,CAaxG;AAMD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,eAAe,GAAG,IAAI,CAU7E;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,GAAG,SAAS,CAMhE"}
@@ -1,4 +1,5 @@
1
1
  import { type Scope } from '@sentry/core';
2
+ import type { ExecutionContextCompat } from '../executionContext';
2
3
  /**
3
4
  * Runs `callback` on the isolation scope for the current invocation.
4
5
  *
@@ -20,5 +21,5 @@ import { type Scope } from '@sentry/core';
20
21
  * default scope even inside an invocation; there the fork degrades to a no-op, which the stack strategy
21
22
  * tolerates. This matches the approach used by `patchEventHandler` in Nuxt.
22
23
  */
23
- export declare function withInvocationIsolationScope<T>(callback: (scope: Scope) => T): T;
24
+ export declare function withInvocationIsolationScope<T>(callback: (scope: Scope) => T, context?: ExecutionContextCompat): T;
24
25
  //# sourceMappingURL=invocationScope.d.ts.map
@@ -1 +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"}
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;AAC3G,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAGlE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,4BAA4B,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,CAAC,EAAE,OAAO,CAAC,EAAE,sBAAsB,GAAG,CAAC,CAWlH"}
@@ -0,0 +1,10 @@
1
+ import type { CloudflareOptions } from '../client';
2
+ /**
3
+ * Builds the per-binding predicate that decides whether a binding takes part in RPC trace
4
+ * propagation.
5
+ *
6
+ * Callers only. Receivers continue an incoming trace whenever one arrives, so they have nothing to
7
+ * match against.
8
+ */
9
+ export declare function createRpcPropagationResolver(options: CloudflareOptions | undefined): (bindingName: string) => boolean;
10
+ //# sourceMappingURL=rpcPropagation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rpcPropagation.d.ts","sourceRoot":"","sources":["../../../src/utils/rpcPropagation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAInD;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,iBAAiB,GAAG,SAAS,GAAG,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAUrH"}
@@ -1 +1 @@
1
- {"version":3,"file":"autoInstrument.d.ts","sourceRoot":"","sources":["../../../src/vite/autoInstrument.ts"],"names":[],"mappings":"AACA,OAAO,EAA8C,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAgB/F,wBAAgB,oCAAoC,CAAC,OAAO,GAAE;IAAE,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAAO;IAQ9F,IAAI;IAEJ,cAAc,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE;YAAE,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;SAAE,CAAA;KAAE,GAAG,IAAI;IAiC9E,SAAS,OACP,cAAc,GAAG;QAAE,IAAI,CAAC,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,WAAW,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,QAC9E,MAAM,MACR,MAAM,GACT,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,CAAC;EAiFzD"}
1
+ {"version":3,"file":"autoInstrument.d.ts","sourceRoot":"","sources":["../../../src/vite/autoInstrument.ts"],"names":[],"mappings":"AACA,OAAO,EAA8C,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAgB/F,wBAAgB,oCAAoC,CAAC,OAAO,GAAE;IAAE,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAAO;IAQ9F,IAAI;IAEJ,cAAc,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE;YAAE,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;SAAE,CAAA;KAAE,GAAG,IAAI;IAiC9E,SAAS,OACP,cAAc,GAAG;QAAE,IAAI,CAAC,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,WAAW,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,QAC9E,MAAM,MACR,MAAM,GACT,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,CAAC;EAkFzD"}
@@ -37,6 +37,10 @@ export interface SentryCloudflareVitePluginOptions {
37
37
  * left alone, so this is safe alongside manual instrumentation. Set to
38
38
  * `false` to opt out.
39
39
  *
40
+ * The plugin also adds the bindings that resolve to the wrapped classes (this worker's own
41
+ * Durable Objects and self service bindings) to `rpcTracePropagationBindings`. Bindings to
42
+ * other workers stay opt-in, their receivers may not run Sentry.
43
+ *
40
44
  * @default true
41
45
  */
42
46
  autoInstrumentation?: boolean;
@@ -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;;;;;;;;;;;;OAYG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC;;;;;;;;;;;OAWG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,GAAE,iCAAsC,GAAG,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CASnH"}
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,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,GAAE,iCAAsC,GAAG,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CASnH"}
@@ -1,4 +1,5 @@
1
1
  import MagicString from 'magic-string';
2
+ import { type SameWorkerBinding } from './wranglerConfig';
2
3
  export interface BaseNode {
3
4
  type: string;
4
5
  start: number;
@@ -34,6 +35,8 @@ export interface TransformContext {
34
35
  optionsFn: string;
35
36
  /** Import statement prepended when `optionsFn` references a separate module. */
36
37
  optionsImport?: string;
38
+ /** @see {@link import('./wranglerConfig').WranglerConfig.sameWorkerBindings} */
39
+ sameWorkerBindings?: readonly SameWorkerBinding[];
37
40
  }
38
41
  export interface TransformResult {
39
42
  code: string;
@@ -1 +1 @@
1
- {"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../src/vite/transform.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,cAAc,CAAC;AAOvC,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,QAAQ,EAAE,CAAC;CAClB;AAuDD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,gBAAgB,GAAG,eAAe,GAAG,OAAO,GAAG,UAAU,GAAG,kBAAkB,CAAC;AAc3F,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC7C;;;OAGG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,gFAAgF;IAChF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,UAAU,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC;IAC5C;;;;OAIG;IACH,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,WAAW,EAChB,GAAG,EAAE,gBAAgB,GACpB,eAAe,GAAG,SAAS,CA8C7B"}
1
+ {"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../src/vite/transform.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,cAAc,CAAC;AACvC,OAAO,EAAmC,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAS3F,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,QAAQ,EAAE,CAAC;CAClB;AAuDD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,gBAAgB,GAAG,eAAe,GAAG,OAAO,GAAG,UAAU,GAAG,kBAAkB,CAAC;AAc3F,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC7C;;;OAGG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,gFAAgF;IAChF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gFAAgF;IAChF,kBAAkB,CAAC,EAAE,SAAS,iBAAiB,EAAE,CAAC;CACnD;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,UAAU,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC;IAC5C;;;;OAIG;IACH,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,WAAW,EAChB,GAAG,EAAE,gBAAgB,GACpB,eAAe,GAAG,SAAS,CAsD7B"}
@@ -20,6 +20,19 @@ export interface WranglerConfig {
20
20
  * an export on a *different* worker, which this build can't wrap.
21
21
  */
22
22
  workerEntrypoints: string[];
23
+ /**
24
+ * Bindings whose RPC receiver lives in this worker, so this build instruments it. Not deduped by
25
+ * class, two bindings may point at the same class and both names have to be listed.
26
+ */
27
+ sameWorkerBindings: SameWorkerBinding[];
28
+ }
29
+ /** Stands in for a class name where a binding targets the module's default export. */
30
+ export declare const DEFAULT_EXPORT: unique symbol;
31
+ /** The name a binding or an export is known by, either an exported class name or the default export. */
32
+ export type ExportName = string | typeof DEFAULT_EXPORT;
33
+ export interface SameWorkerBinding {
34
+ bindingName: string;
35
+ className: ExportName;
23
36
  }
24
37
  /**
25
38
  * Locate and resolve the wrangler configuration via wrangler's own
@@ -1 +1 @@
1
- {"version":3,"file":"wranglerConfig.d.ts","sourceRoot":"","sources":["../../../src/vite/wranglerConfig.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC3D,SAAS,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtD;;;;;OAKG;IACH,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,YAAY,CAAC,EAAE,MAAM,GACpB;IAAE,MAAM,EAAE,cAAc,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CA2B3D"}
1
+ {"version":3,"file":"wranglerConfig.d.ts","sourceRoot":"","sources":["../../../src/vite/wranglerConfig.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC3D,SAAS,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtD;;;;;OAKG;IACH,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B;;;OAGG;IACH,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;CACzC;AAED,sFAAsF;AACtF,eAAO,MAAM,cAAc,eAA0B,CAAC;AAEtD,wGAAwG;AACxG,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,cAAc,CAAC;AAExD,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,UAAU,CAAC;CACvB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,YAAY,CAAC,EAAE,MAAM,GACpB;IAAE,MAAM,EAAE,cAAc,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CA4B3D"}
@@ -1,5 +1,4 @@
1
- import type { CloudflareOptions } from './client';
2
- import type { AnyExportedHandler, DefaultEnv, ResolveEnv } from './types';
1
+ import type { AnyExportedHandler, DefaultEnv, ResolveEnv, StrictCloudflareOptions } from './types';
3
2
  import { type WorkerEntrypointConstructor } from './instrumentations/instrumentWorkerEntrypoint';
4
3
  /**
5
4
  * Wrapper for Cloudflare handlers.
@@ -12,5 +11,5 @@ import { type WorkerEntrypointConstructor } from './instrumentations/instrumentW
12
11
  * @param handler {ExportedHandler} The handler to wrap.
13
12
  * @returns The wrapped handler.
14
13
  */
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;
14
+ export declare function withSentry<Env = DefaultEnv, QueueHandlerMessage = unknown, CfHostMetadata = unknown, T extends AnyExportedHandler | WorkerEntrypointConstructor<any, any> = ExportedHandler<Env, QueueHandlerMessage, CfHostMetadata> | WorkerEntrypointConstructor<Env>, O = unknown>(optionsCallback: (env: ResolveEnv<T, Env>) => StrictCloudflareOptions<O> | undefined, handler: T): T;
16
15
  //# sourceMappingURL=withSentry.d.ts.map
@@ -1 +1 @@
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
+ {"version":3,"file":"withSentry.d.ts","sourceRoot":"","sources":["../../src/withSentry.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AACnG,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,CAAC,GAAG,OAAO,EACX,eAAe,EAAE,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,uBAAuB,CAAC,CAAC,CAAC,GAAG,SAAS,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAyBrG"}
@@ -1,6 +1,5 @@
1
1
  import type { WorkflowEntrypoint } from 'cloudflare:workers';
2
- import type { CloudflareOptions } from './client';
3
- import type { DefaultEnv, ResolveEnv } from './types';
2
+ import type { DefaultEnv, ResolveEnv, StrictCloudflareOptions } from './types';
4
3
  /**
5
4
  * Hashes a string to a UUID using SHA-1.
6
5
  */
@@ -25,5 +24,6 @@ export declare function deterministicTraceIdFromInstanceId(instanceId: string):
25
24
  export declare function instrumentWorkflowWithSentry<E = DefaultEnv, // Environment type
26
25
  P = unknown, // Payload type
27
26
  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;
27
+ C extends new (ctx: ExecutionContext, env: any) => WorkflowEntrypoint<any, any> = new (ctx: ExecutionContext, env: any) => T, // Constructor type of the WorkflowEntrypoint class
28
+ O = unknown>(optionsCallback: (env: ResolveEnv<C, E>) => StrictCloudflareOptions<O>, WorkFlowClass: C): C;
29
29
  //# sourceMappingURL=workflows.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../src/workflows.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAEV,kBAAkB,EASnB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAMlD,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAItD;;GAEG;AACH,wBAAsB,kCAAkC,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAS5F;AAuID;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,4BAA4B,CAC1C,CAAC,GAAG,UAAU,EAAE,mBAAmB;AACnC,CAAC,GAAG,OAAO,EAAE,eAAe;AAE5B,CAAC,SAAS,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,0BAA0B;AAM7F,CAAC,SAAS,KAAK,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,GAAG,KAAK,kBAAkB,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
+ {"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../src/workflows.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAEV,kBAAkB,EASnB,MAAM,oBAAoB,CAAC;AAQ5B,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAK/E;;GAEG;AACH,wBAAsB,kCAAkC,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAS5F;AAuJD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,4BAA4B,CAC1C,CAAC,GAAG,UAAU,EAAE,mBAAmB;AACnC,CAAC,GAAG,OAAO,EAAE,eAAe;AAE5B,CAAC,SAAS,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,0BAA0B;AAM7F,CAAC,SAAS,KAAK,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,GAAG,KAAK,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,KAChF,GAAG,EAAE,gBAAgB,EAErB,GAAG,EAAE,GAAG,KACL,CAAC,EAAE,mDAAmD;AAC3D,CAAC,GAAG,OAAO,EACX,eAAe,EAAE,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,uBAAuB,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,GAAG,CAAC,CA6C7F"}
@@ -1,11 +1,16 @@
1
1
  import type { DurableObjectStorage } from '@cloudflare/workers-types';
2
+ import type { SerializedTraceData } from '@sentry/core';
2
3
  import type { CloudflareOptions } from './client';
3
4
  /** Extended DurableObjectState with originalStorage exposed by instrumentContext */
4
5
  export interface InstrumentedDurableObjectState extends DurableObjectState {
5
6
  originalStorage?: DurableObjectStorage;
6
7
  }
7
8
  type MethodWrapperOptions = {
8
- spanName?: string;
9
+ /**
10
+ * The span name, or a resolver called with the RPC metadata of the current call.
11
+ * Returning `undefined` skips the span and only captures errors.
12
+ */
13
+ spanName?: string | ((rpcMeta: SerializedTraceData | undefined) => string | undefined);
9
14
  spanOp?: string;
10
15
  options: CloudflareOptions;
11
16
  context: ExecutionContext | InstrumentedDurableObjectState;
@@ -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;AAatE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AASlD,oFAAoF;AACpF,MAAM,WAAW,8BAA+B,SAAQ,kBAAkB;IACxE,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;AAEtC;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,cAAc,EAC3D,cAAc,EAAE,oBAAoB,EACpC,OAAO,EAAE,CAAC,EACV,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,EAC3C,MAAM,CAAC,EAAE,IAAI,GACZ,CAAC,CAqJH"}
1
+ {"version":3,"file":"wrapMethodWithSentry.d.ts","sourceRoot":"","sources":["../../src/wrapMethodWithSentry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAYxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAUlD,oFAAoF;AACpF,MAAM,WAAW,8BAA+B,SAAQ,kBAAkB;IACxE,eAAe,CAAC,EAAE,oBAAoB,CAAC;CACxC;AAyBD,KAAK,oBAAoB,GAAG;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,OAAO,EAAE,mBAAmB,GAAG,SAAS,KAAK,MAAM,GAAG,SAAS,CAAC,CAAC;IACvF,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;AAEtC;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,cAAc,EAC3D,cAAc,EAAE,oBAAoB,EACpC,OAAO,EAAE,CAAC,EACV,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,EAC3C,MAAM,CAAC,EAAE,IAAI,GACZ,CAAC,CAsMH"}
@@ -0,0 +1,31 @@
1
+ import type { CfProperties, IncomingRequestCfProperties } from '@cloudflare/workers-types';
2
+ import type { CloudflareClient, CloudflareOptions } from './client';
3
+ import type { ExecutionContextCompat } from './executionContext';
4
+ export interface RequestHandlerWrapperOptions {
5
+ options: CloudflareOptions;
6
+ request: Request<unknown, IncomingRequestCfProperties<unknown> | CfProperties<unknown>>;
7
+ context: ExecutionContextCompat | undefined;
8
+ /**
9
+ * If true, errors will be captured, rethrown and sent to Sentry.
10
+ * Otherwise, errors are rethrown but not captured.
11
+ *
12
+ * You most likely don't want to set this to `false`, if you use `wrapRequestHandler` directly.
13
+ * This is primarily meant as an escape hatch for higher-level SDKs relying on additional error
14
+ * capturing mechanisms where this wrapper captures errors too early or too generally.
15
+ *
16
+ * @default true
17
+ */
18
+ captureErrors?: boolean;
19
+ }
20
+ type InitSdk = (options: CloudflareOptions) => CloudflareClient | undefined;
21
+ /**
22
+ * Same as {@link wrapRequestHandler}, but with the SDK initialization injected.
23
+ *
24
+ * Wrappers that are only reachable from the main entry point — where `nodejs_compat` is a
25
+ * requirement anyway — pass `init` from `sdk.ts` to get the full default integrations.
26
+ *
27
+ * @internal
28
+ */
29
+ export declare function wrapRequestHandlerWithInit(wrapperOptions: RequestHandlerWrapperOptions, handler: (...args: unknown[]) => Response | Promise<Response>, initSdk: InitSdk): Promise<Response>;
30
+ export {};
31
+ //# sourceMappingURL=wrapRequestHandlerWithInit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrapRequestHandlerWithInit.d.ts","sourceRoot":"","sources":["../../src/wrapRequestHandlerWithInit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAoB3F,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACpE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAYjE,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,2BAA2B,CAAC,OAAO,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;IACxF,OAAO,EAAE,sBAAsB,GAAG,SAAS,CAAC;IAC5C;;;;;;;;;OASG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,KAAK,OAAO,GAAG,CAAC,OAAO,EAAE,iBAAiB,KAAK,gBAAgB,GAAG,SAAS,CAAC;AAE5E;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,4BAA4B,EAC5C,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,EAC7D,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,QAAQ,CAAC,CAuKnB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/cloudflare",
3
- "version": "11.0.0-alpha.1",
3
+ "version": "11.0.0-alpha.2",
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",
@@ -48,9 +48,10 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "@opentelemetry/api": "^1.9.1",
51
- "@sentry/conventions": "^0.19.0",
52
- "@sentry/core": "11.0.0-alpha.1",
53
- "@sentry/server-utils": "11.0.0-alpha.1",
51
+ "@sentry/conventions": "^0.20.0",
52
+ "@sentry/core": "11.0.0-alpha.2",
53
+ "@sentry/opentelemetry": "11.0.0-alpha.2",
54
+ "@sentry/server-utils": "11.0.0-alpha.2",
54
55
  "magic-string": "~0.30.21"
55
56
  },
56
57
  "peerDependencies": {
@@ -83,6 +84,7 @@
83
84
  "clean": "rimraf build coverage sentry-cloudflare-*.tgz",
84
85
  "lint:fix": "oxlint . --fix --type-aware",
85
86
  "lint": "oxlint . --type-aware",
87
+ "lint:types": "oxlint src --type-aware --type-check",
86
88
  "lint:es-compatibility": "es-check es2022 ./build/cjs/prod/*.js && es-check es2022 ./build/esm/prod/*.js --module",
87
89
  "test": "yarn test:unit",
88
90
  "test:unit": "vitest run",
@@ -1,18 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const core = require('@sentry/core');
4
- const serverUtils = require('@sentry/server-utils');
5
-
6
- const _vercelAIIntegration = ((options = {}) => {
7
- const inner = serverUtils.vercelAiIntegration(options);
8
- return core.extendIntegration(inner, {
9
- options,
10
- setup(client) {
11
- serverUtils.addVercelAiProcessors(client);
12
- }
13
- });
14
- });
15
- const vercelAIIntegration = core.defineIntegration(_vercelAIIntegration);
16
-
17
- exports.vercelAIIntegration = vercelAIIntegration;
18
- //# sourceMappingURL=vercelai.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vercelai.js","sources":["../../../../../src/integrations/tracing/vercelai.ts"],"sourcesContent":["/**\n * This is a copy of the Vercel AI integration from the node SDK.\n *\n * The only difference is that it does not use `@opentelemetry/instrumentation`\n * because Cloudflare Workers do not support it.\n *\n * Therefore, we cannot automatically patch setting `experimental_telemetry: { isEnabled: true }`\n * and users have to manually set this to get spans.\n */\n\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration, extendIntegration } from '@sentry/core';\nimport { addVercelAiProcessors, vercelAiIntegration, type VercelAiOptions } from '@sentry/server-utils';\n\nconst _vercelAIIntegration = ((options: VercelAiOptions = {}) => {\n const inner = vercelAiIntegration(options);\n\n return extendIntegration(inner, {\n options,\n setup(client) {\n addVercelAiProcessors(client);\n },\n });\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library.\n * This integration is not enabled by default, you need to manually add it.\n *\n * For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry).\n *\n * You need to enable collecting spans for a specific call by setting\n * `experimental_telemetry.isEnabled` to `true` in the first argument of the function call.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true },\n * });\n * ```\n *\n * If you want to collect inputs and outputs for a specific call, you must specifically opt-in to each\n * function call by setting `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs`\n * to `true`.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true, recordInputs: true, recordOutputs: true },\n * });\n */\nexport const vercelAIIntegration = defineIntegration(_vercelAIIntegration);\n"],"names":["vercelAiIntegration","extendIntegration","addVercelAiProcessors","defineIntegration"],"mappings":";;;;;AAcA,MAAM,oBAAA,IAAwB,CAAC,OAAA,GAA2B,EAAC,KAAM;AAC/D,EAAA,MAAM,KAAA,GAAQA,gCAAoB,OAAO,CAAA;AAEzC,EAAA,OAAOC,uBAAkB,KAAA,EAAO;AAAA,IAC9B,OAAA;AAAA,IACA,MAAM,MAAA,EAAQ;AACZ,MAAAC,iCAAA,CAAsB,MAAM,CAAA;AAAA,IAC9B;AAAA,GACD,CAAA;AACH,CAAA,CAAA;AA4BO,MAAM,mBAAA,GAAsBC,uBAAkB,oBAAoB;;;;"}
@@ -1,18 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const core = require('@sentry/core');
4
- const serverUtils = require('@sentry/server-utils');
5
-
6
- const _vercelAIIntegration = ((options = {}) => {
7
- const inner = serverUtils.vercelAiIntegration(options);
8
- return core.extendIntegration(inner, {
9
- options,
10
- setup(client) {
11
- serverUtils.addVercelAiProcessors(client);
12
- }
13
- });
14
- });
15
- const vercelAIIntegration = core.defineIntegration(_vercelAIIntegration);
16
-
17
- exports.vercelAIIntegration = vercelAIIntegration;
18
- //# sourceMappingURL=vercelai.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vercelai.js","sources":["../../../../../src/integrations/tracing/vercelai.ts"],"sourcesContent":["/**\n * This is a copy of the Vercel AI integration from the node SDK.\n *\n * The only difference is that it does not use `@opentelemetry/instrumentation`\n * because Cloudflare Workers do not support it.\n *\n * Therefore, we cannot automatically patch setting `experimental_telemetry: { isEnabled: true }`\n * and users have to manually set this to get spans.\n */\n\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration, extendIntegration } from '@sentry/core';\nimport { addVercelAiProcessors, vercelAiIntegration, type VercelAiOptions } from '@sentry/server-utils';\n\nconst _vercelAIIntegration = ((options: VercelAiOptions = {}) => {\n const inner = vercelAiIntegration(options);\n\n return extendIntegration(inner, {\n options,\n setup(client) {\n addVercelAiProcessors(client);\n },\n });\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library.\n * This integration is not enabled by default, you need to manually add it.\n *\n * For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry).\n *\n * You need to enable collecting spans for a specific call by setting\n * `experimental_telemetry.isEnabled` to `true` in the first argument of the function call.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true },\n * });\n * ```\n *\n * If you want to collect inputs and outputs for a specific call, you must specifically opt-in to each\n * function call by setting `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs`\n * to `true`.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true, recordInputs: true, recordOutputs: true },\n * });\n */\nexport const vercelAIIntegration = defineIntegration(_vercelAIIntegration);\n"],"names":["vercelAiIntegration","extendIntegration","addVercelAiProcessors","defineIntegration"],"mappings":";;;;;AAcA,MAAM,oBAAA,IAAwB,CAAC,OAAA,GAA2B,EAAC,KAAM;AAC/D,EAAA,MAAM,KAAA,GAAQA,gCAAoB,OAAO,CAAA;AAEzC,EAAA,OAAOC,uBAAkB,KAAA,EAAO;AAAA,IAC9B,OAAA;AAAA,IACA,MAAM,MAAA,EAAQ;AACZ,MAAAC,iCAAA,CAAsB,MAAM,CAAA;AAAA,IAC9B;AAAA,GACD,CAAA;AACH,CAAA,CAAA;AA4BO,MAAM,mBAAA,GAAsBC,uBAAkB,oBAAoB;;;;"}
@@ -1,16 +0,0 @@
1
- import { defineIntegration, extendIntegration } from '@sentry/core';
2
- import { vercelAiIntegration, addVercelAiProcessors } from '@sentry/server-utils';
3
-
4
- const _vercelAIIntegration = ((options = {}) => {
5
- const inner = vercelAiIntegration(options);
6
- return extendIntegration(inner, {
7
- options,
8
- setup(client) {
9
- addVercelAiProcessors(client);
10
- }
11
- });
12
- });
13
- const vercelAIIntegration = defineIntegration(_vercelAIIntegration);
14
-
15
- export { vercelAIIntegration };
16
- //# sourceMappingURL=vercelai.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vercelai.js","sources":["../../../../../src/integrations/tracing/vercelai.ts"],"sourcesContent":["/**\n * This is a copy of the Vercel AI integration from the node SDK.\n *\n * The only difference is that it does not use `@opentelemetry/instrumentation`\n * because Cloudflare Workers do not support it.\n *\n * Therefore, we cannot automatically patch setting `experimental_telemetry: { isEnabled: true }`\n * and users have to manually set this to get spans.\n */\n\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration, extendIntegration } from '@sentry/core';\nimport { addVercelAiProcessors, vercelAiIntegration, type VercelAiOptions } from '@sentry/server-utils';\n\nconst _vercelAIIntegration = ((options: VercelAiOptions = {}) => {\n const inner = vercelAiIntegration(options);\n\n return extendIntegration(inner, {\n options,\n setup(client) {\n addVercelAiProcessors(client);\n },\n });\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library.\n * This integration is not enabled by default, you need to manually add it.\n *\n * For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry).\n *\n * You need to enable collecting spans for a specific call by setting\n * `experimental_telemetry.isEnabled` to `true` in the first argument of the function call.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true },\n * });\n * ```\n *\n * If you want to collect inputs and outputs for a specific call, you must specifically opt-in to each\n * function call by setting `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs`\n * to `true`.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true, recordInputs: true, recordOutputs: true },\n * });\n */\nexport const vercelAIIntegration = defineIntegration(_vercelAIIntegration);\n"],"names":[],"mappings":";;;AAcA,MAAM,oBAAA,IAAwB,CAAC,OAAA,GAA2B,EAAC,KAAM;AAC/D,EAAA,MAAM,KAAA,GAAQ,oBAAoB,OAAO,CAAA;AAEzC,EAAA,OAAO,kBAAkB,KAAA,EAAO;AAAA,IAC9B,OAAA;AAAA,IACA,MAAM,MAAA,EAAQ;AACZ,MAAA,qBAAA,CAAsB,MAAM,CAAA;AAAA,IAC9B;AAAA,GACD,CAAA;AACH,CAAA,CAAA;AA4BO,MAAM,mBAAA,GAAsB,kBAAkB,oBAAoB;;;;"}
@@ -1,16 +0,0 @@
1
- import { defineIntegration, extendIntegration } from '@sentry/core';
2
- import { vercelAiIntegration, addVercelAiProcessors } from '@sentry/server-utils';
3
-
4
- const _vercelAIIntegration = ((options = {}) => {
5
- const inner = vercelAiIntegration(options);
6
- return extendIntegration(inner, {
7
- options,
8
- setup(client) {
9
- addVercelAiProcessors(client);
10
- }
11
- });
12
- });
13
- const vercelAIIntegration = defineIntegration(_vercelAIIntegration);
14
-
15
- export { vercelAIIntegration };
16
- //# sourceMappingURL=vercelai.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vercelai.js","sources":["../../../../../src/integrations/tracing/vercelai.ts"],"sourcesContent":["/**\n * This is a copy of the Vercel AI integration from the node SDK.\n *\n * The only difference is that it does not use `@opentelemetry/instrumentation`\n * because Cloudflare Workers do not support it.\n *\n * Therefore, we cannot automatically patch setting `experimental_telemetry: { isEnabled: true }`\n * and users have to manually set this to get spans.\n */\n\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration, extendIntegration } from '@sentry/core';\nimport { addVercelAiProcessors, vercelAiIntegration, type VercelAiOptions } from '@sentry/server-utils';\n\nconst _vercelAIIntegration = ((options: VercelAiOptions = {}) => {\n const inner = vercelAiIntegration(options);\n\n return extendIntegration(inner, {\n options,\n setup(client) {\n addVercelAiProcessors(client);\n },\n });\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library.\n * This integration is not enabled by default, you need to manually add it.\n *\n * For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry).\n *\n * You need to enable collecting spans for a specific call by setting\n * `experimental_telemetry.isEnabled` to `true` in the first argument of the function call.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true },\n * });\n * ```\n *\n * If you want to collect inputs and outputs for a specific call, you must specifically opt-in to each\n * function call by setting `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs`\n * to `true`.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true, recordInputs: true, recordOutputs: true },\n * });\n */\nexport const vercelAIIntegration = defineIntegration(_vercelAIIntegration);\n"],"names":[],"mappings":";;;AAcA,MAAM,oBAAA,IAAwB,CAAC,OAAA,GAA2B,EAAC,KAAM;AAC/D,EAAA,MAAM,KAAA,GAAQ,oBAAoB,OAAO,CAAA;AAEzC,EAAA,OAAO,kBAAkB,KAAA,EAAO;AAAA,IAC9B,OAAA;AAAA,IACA,MAAM,MAAA,EAAQ;AACZ,MAAA,qBAAA,CAAsB,MAAM,CAAA;AAAA,IAC9B;AAAA,GACD,CAAA;AACH,CAAA,CAAA;AA4BO,MAAM,mBAAA,GAAsB,kBAAkB,oBAAoB;;;;"}
@@ -1,39 +0,0 @@
1
- /**
2
- * This is a copy of the Vercel AI integration from the node SDK.
3
- *
4
- * The only difference is that it does not use `@opentelemetry/instrumentation`
5
- * because Cloudflare Workers do not support it.
6
- *
7
- * Therefore, we cannot automatically patch setting `experimental_telemetry: { isEnabled: true }`
8
- * and users have to manually set this to get spans.
9
- */
10
- /**
11
- * Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library.
12
- * This integration is not enabled by default, you need to manually add it.
13
- *
14
- * For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry).
15
- *
16
- * You need to enable collecting spans for a specific call by setting
17
- * `experimental_telemetry.isEnabled` to `true` in the first argument of the function call.
18
- *
19
- * ```javascript
20
- * const result = await generateText({
21
- * model: openai('gpt-4-turbo'),
22
- * experimental_telemetry: { isEnabled: true },
23
- * });
24
- * ```
25
- *
26
- * If you want to collect inputs and outputs for a specific call, you must specifically opt-in to each
27
- * function call by setting `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs`
28
- * to `true`.
29
- *
30
- * ```javascript
31
- * const result = await generateText({
32
- * model: openai('gpt-4-turbo'),
33
- * experimental_telemetry: { isEnabled: true, recordInputs: true, recordOutputs: true },
34
- * });
35
- */
36
- export declare const vercelAIIntegration: (options?: import("@sentry/server-utils").GenAiOptions | undefined) => import("@sentry/core").Integration & {
37
- name: "VercelAI";
38
- };
39
- //# sourceMappingURL=vercelai.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vercelai.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/vercelai.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAiBH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,mBAAmB;;CAA0C,CAAC"}