@depup/sentry__server-utils 10.67.0-depup.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 (848) hide show
  1. package/README.md +32 -0
  2. package/build/cjs/debug-build.js +6 -0
  3. package/build/cjs/debug-build.js.map +1 -0
  4. package/build/cjs/graphql/graphql-dc-subscriber.js +123 -0
  5. package/build/cjs/graphql/graphql-dc-subscriber.js.map +1 -0
  6. package/build/cjs/graphql/index.js +23 -0
  7. package/build/cjs/graphql/index.js.map +1 -0
  8. package/build/cjs/graphql/utils.js +92 -0
  9. package/build/cjs/graphql/utils.js.map +1 -0
  10. package/build/cjs/index.js +34 -0
  11. package/build/cjs/index.js.map +1 -0
  12. package/build/cjs/integrations/tracing-channel/amqplib.js +420 -0
  13. package/build/cjs/integrations/tracing-channel/amqplib.js.map +1 -0
  14. package/build/cjs/integrations/tracing-channel/anthropic.js +101 -0
  15. package/build/cjs/integrations/tracing-channel/anthropic.js.map +1 -0
  16. package/build/cjs/integrations/tracing-channel/aws-sdk/constants.js +16 -0
  17. package/build/cjs/integrations/tracing-channel/aws-sdk/constants.js.map +1 -0
  18. package/build/cjs/integrations/tracing-channel/aws-sdk/index.js +154 -0
  19. package/build/cjs/integrations/tracing-channel/aws-sdk/index.js.map +1 -0
  20. package/build/cjs/integrations/tracing-channel/aws-sdk/services/MessageAttributes.js +46 -0
  21. package/build/cjs/integrations/tracing-channel/aws-sdk/services/MessageAttributes.js.map +1 -0
  22. package/build/cjs/integrations/tracing-channel/aws-sdk/services/ServicesExtensions.js +47 -0
  23. package/build/cjs/integrations/tracing-channel/aws-sdk/services/ServicesExtensions.js.map +1 -0
  24. package/build/cjs/integrations/tracing-channel/aws-sdk/services/bedrock-runtime.js +419 -0
  25. package/build/cjs/integrations/tracing-channel/aws-sdk/services/bedrock-runtime.js.map +1 -0
  26. package/build/cjs/integrations/tracing-channel/aws-sdk/services/dynamodb.js +131 -0
  27. package/build/cjs/integrations/tracing-channel/aws-sdk/services/dynamodb.js.map +1 -0
  28. package/build/cjs/integrations/tracing-channel/aws-sdk/services/kinesis.js +21 -0
  29. package/build/cjs/integrations/tracing-channel/aws-sdk/services/kinesis.js.map +1 -0
  30. package/build/cjs/integrations/tracing-channel/aws-sdk/services/lambda.js +64 -0
  31. package/build/cjs/integrations/tracing-channel/aws-sdk/services/lambda.js.map +1 -0
  32. package/build/cjs/integrations/tracing-channel/aws-sdk/services/s3.js +21 -0
  33. package/build/cjs/integrations/tracing-channel/aws-sdk/services/s3.js.map +1 -0
  34. package/build/cjs/integrations/tracing-channel/aws-sdk/services/secretsmanager.js +27 -0
  35. package/build/cjs/integrations/tracing-channel/aws-sdk/services/secretsmanager.js.map +1 -0
  36. package/build/cjs/integrations/tracing-channel/aws-sdk/services/sns.js +63 -0
  37. package/build/cjs/integrations/tracing-channel/aws-sdk/services/sns.js.map +1 -0
  38. package/build/cjs/integrations/tracing-channel/aws-sdk/services/sqs.js +116 -0
  39. package/build/cjs/integrations/tracing-channel/aws-sdk/services/sqs.js.map +1 -0
  40. package/build/cjs/integrations/tracing-channel/aws-sdk/services/stepfunctions.js +25 -0
  41. package/build/cjs/integrations/tracing-channel/aws-sdk/services/stepfunctions.js.map +1 -0
  42. package/build/cjs/integrations/tracing-channel/aws-sdk/utils.js +30 -0
  43. package/build/cjs/integrations/tracing-channel/aws-sdk/utils.js.map +1 -0
  44. package/build/cjs/integrations/tracing-channel/dataloader.js +95 -0
  45. package/build/cjs/integrations/tracing-channel/dataloader.js.map +1 -0
  46. package/build/cjs/integrations/tracing-channel/express/index.js +24 -0
  47. package/build/cjs/integrations/tracing-channel/express/index.js.map +1 -0
  48. package/build/cjs/integrations/tracing-channel/express/instrumentation.js +168 -0
  49. package/build/cjs/integrations/tracing-channel/express/instrumentation.js.map +1 -0
  50. package/build/cjs/integrations/tracing-channel/express/route.js +76 -0
  51. package/build/cjs/integrations/tracing-channel/express/route.js.map +1 -0
  52. package/build/cjs/integrations/tracing-channel/fastify/errors.js +42 -0
  53. package/build/cjs/integrations/tracing-channel/fastify/errors.js.map +1 -0
  54. package/build/cjs/integrations/tracing-channel/fastify/index.js +34 -0
  55. package/build/cjs/integrations/tracing-channel/fastify/index.js.map +1 -0
  56. package/build/cjs/integrations/tracing-channel/fastify/instrumentation.js +279 -0
  57. package/build/cjs/integrations/tracing-channel/fastify/instrumentation.js.map +1 -0
  58. package/build/cjs/integrations/tracing-channel/fastify/utils.js +11 -0
  59. package/build/cjs/integrations/tracing-channel/fastify/utils.js.map +1 -0
  60. package/build/cjs/integrations/tracing-channel/generic-pool.js +34 -0
  61. package/build/cjs/integrations/tracing-channel/generic-pool.js.map +1 -0
  62. package/build/cjs/integrations/tracing-channel/google-genai.js +96 -0
  63. package/build/cjs/integrations/tracing-channel/google-genai.js.map +1 -0
  64. package/build/cjs/integrations/tracing-channel/graphql/constants.js +26 -0
  65. package/build/cjs/integrations/tracing-channel/graphql/constants.js.map +1 -0
  66. package/build/cjs/integrations/tracing-channel/graphql/index.js +66 -0
  67. package/build/cjs/integrations/tracing-channel/graphql/index.js.map +1 -0
  68. package/build/cjs/integrations/tracing-channel/graphql/resolvers.js +168 -0
  69. package/build/cjs/integrations/tracing-channel/graphql/resolvers.js.map +1 -0
  70. package/build/cjs/integrations/tracing-channel/graphql/spans.js +102 -0
  71. package/build/cjs/integrations/tracing-channel/graphql/spans.js.map +1 -0
  72. package/build/cjs/integrations/tracing-channel/hapi-types.js +30 -0
  73. package/build/cjs/integrations/tracing-channel/hapi-types.js.map +1 -0
  74. package/build/cjs/integrations/tracing-channel/hapi-utils.js +177 -0
  75. package/build/cjs/integrations/tracing-channel/hapi-utils.js.map +1 -0
  76. package/build/cjs/integrations/tracing-channel/hapi.js +52 -0
  77. package/build/cjs/integrations/tracing-channel/hapi.js.map +1 -0
  78. package/build/cjs/integrations/tracing-channel/ioredis.js +99 -0
  79. package/build/cjs/integrations/tracing-channel/ioredis.js.map +1 -0
  80. package/build/cjs/integrations/tracing-channel/kafkajs/consumer.js +71 -0
  81. package/build/cjs/integrations/tracing-channel/kafkajs/consumer.js.map +1 -0
  82. package/build/cjs/integrations/tracing-channel/kafkajs/index.js +70 -0
  83. package/build/cjs/integrations/tracing-channel/kafkajs/index.js.map +1 -0
  84. package/build/cjs/integrations/tracing-channel/kafkajs/semconv.js +22 -0
  85. package/build/cjs/integrations/tracing-channel/kafkajs/semconv.js.map +1 -0
  86. package/build/cjs/integrations/tracing-channel/kafkajs/spans.js +119 -0
  87. package/build/cjs/integrations/tracing-channel/kafkajs/spans.js.map +1 -0
  88. package/build/cjs/integrations/tracing-channel/knex.js +188 -0
  89. package/build/cjs/integrations/tracing-channel/knex.js.map +1 -0
  90. package/build/cjs/integrations/tracing-channel/koa.js +146 -0
  91. package/build/cjs/integrations/tracing-channel/koa.js.map +1 -0
  92. package/build/cjs/integrations/tracing-channel/langchain.js +63 -0
  93. package/build/cjs/integrations/tracing-channel/langchain.js.map +1 -0
  94. package/build/cjs/integrations/tracing-channel/langgraph.js +100 -0
  95. package/build/cjs/integrations/tracing-channel/langgraph.js.map +1 -0
  96. package/build/cjs/integrations/tracing-channel/lru-memoizer.js +31 -0
  97. package/build/cjs/integrations/tracing-channel/lru-memoizer.js.map +1 -0
  98. package/build/cjs/integrations/tracing-channel/mongodb.js +104 -0
  99. package/build/cjs/integrations/tracing-channel/mongodb.js.map +1 -0
  100. package/build/cjs/integrations/tracing-channel/mongoose.js +110 -0
  101. package/build/cjs/integrations/tracing-channel/mongoose.js.map +1 -0
  102. package/build/cjs/integrations/tracing-channel/mysql.js +107 -0
  103. package/build/cjs/integrations/tracing-channel/mysql.js.map +1 -0
  104. package/build/cjs/integrations/tracing-channel/mysql2.js +83 -0
  105. package/build/cjs/integrations/tracing-channel/mysql2.js.map +1 -0
  106. package/build/cjs/integrations/tracing-channel/openai.js +81 -0
  107. package/build/cjs/integrations/tracing-channel/openai.js.map +1 -0
  108. package/build/cjs/integrations/tracing-channel/postgres-js.js +191 -0
  109. package/build/cjs/integrations/tracing-channel/postgres-js.js.map +1 -0
  110. package/build/cjs/integrations/tracing-channel/postgres.js +170 -0
  111. package/build/cjs/integrations/tracing-channel/postgres.js.map +1 -0
  112. package/build/cjs/integrations/tracing-channel/redis.js +218 -0
  113. package/build/cjs/integrations/tracing-channel/redis.js.map +1 -0
  114. package/build/cjs/integrations/tracing-channel/tedious.js +145 -0
  115. package/build/cjs/integrations/tracing-channel/tedious.js.map +1 -0
  116. package/build/cjs/integrations/tracing-channel/vercel-ai.js +25 -0
  117. package/build/cjs/integrations/tracing-channel/vercel-ai.js.map +1 -0
  118. package/build/cjs/mongodb/mongodb-span.js +133 -0
  119. package/build/cjs/mongodb/mongodb-span.js.map +1 -0
  120. package/build/cjs/mongoose/index.js +23 -0
  121. package/build/cjs/mongoose/index.js.map +1 -0
  122. package/build/cjs/mongoose/mongoose-dc-subscriber.js +97 -0
  123. package/build/cjs/mongoose/mongoose-dc-subscriber.js.map +1 -0
  124. package/build/cjs/mongoose/mongoose-legacy-span.js +40 -0
  125. package/build/cjs/mongoose/mongoose-legacy-span.js.map +1 -0
  126. package/build/cjs/mysql2/index.js +23 -0
  127. package/build/cjs/mysql2/index.js.map +1 -0
  128. package/build/cjs/mysql2/mysql2-dc-subscriber.js +68 -0
  129. package/build/cjs/mysql2/mysql2-dc-subscriber.js.map +1 -0
  130. package/build/cjs/orchestrion/bundler/esbuild.js +15 -0
  131. package/build/cjs/orchestrion/bundler/esbuild.js.map +1 -0
  132. package/build/cjs/orchestrion/bundler/options.js +24 -0
  133. package/build/cjs/orchestrion/bundler/options.js.map +1 -0
  134. package/build/cjs/orchestrion/bundler/rollup.js +15 -0
  135. package/build/cjs/orchestrion/bundler/rollup.js.map +1 -0
  136. package/build/cjs/orchestrion/bundler/vite.js +21 -0
  137. package/build/cjs/orchestrion/bundler/vite.js.map +1 -0
  138. package/build/cjs/orchestrion/bundler/webpack.js +36 -0
  139. package/build/cjs/orchestrion/bundler/webpack.js.map +1 -0
  140. package/build/cjs/orchestrion/channels.js +70 -0
  141. package/build/cjs/orchestrion/channels.js.map +1 -0
  142. package/build/cjs/orchestrion/config/amqplib.js +81 -0
  143. package/build/cjs/orchestrion/config/amqplib.js.map +1 -0
  144. package/build/cjs/orchestrion/config/anthropic-ai.js +43 -0
  145. package/build/cjs/orchestrion/config/anthropic-ai.js.map +1 -0
  146. package/build/cjs/orchestrion/config/aws-sdk.js +28 -0
  147. package/build/cjs/orchestrion/config/aws-sdk.js.map +1 -0
  148. package/build/cjs/orchestrion/config/dataloader.js +53 -0
  149. package/build/cjs/orchestrion/config/dataloader.js.map +1 -0
  150. package/build/cjs/orchestrion/config/express.js +77 -0
  151. package/build/cjs/orchestrion/config/express.js.map +1 -0
  152. package/build/cjs/orchestrion/config/firebase.js +8 -0
  153. package/build/cjs/orchestrion/config/firebase.js.map +1 -0
  154. package/build/cjs/orchestrion/config/generic-pool.js +21 -0
  155. package/build/cjs/orchestrion/config/generic-pool.js.map +1 -0
  156. package/build/cjs/orchestrion/config/google-genai.js +38 -0
  157. package/build/cjs/orchestrion/config/google-genai.js.map +1 -0
  158. package/build/cjs/orchestrion/config/graphql.js +28 -0
  159. package/build/cjs/orchestrion/config/graphql.js.map +1 -0
  160. package/build/cjs/orchestrion/config/hapi.js +26 -0
  161. package/build/cjs/orchestrion/config/hapi.js.map +1 -0
  162. package/build/cjs/orchestrion/config/index.js +89 -0
  163. package/build/cjs/orchestrion/config/index.js.map +1 -0
  164. package/build/cjs/orchestrion/config/ioredis.js +35 -0
  165. package/build/cjs/orchestrion/config/ioredis.js.map +1 -0
  166. package/build/cjs/orchestrion/config/kafkajs.js +30 -0
  167. package/build/cjs/orchestrion/config/kafkajs.js.map +1 -0
  168. package/build/cjs/orchestrion/config/knex.js +43 -0
  169. package/build/cjs/orchestrion/config/knex.js.map +1 -0
  170. package/build/cjs/orchestrion/config/koa.js +16 -0
  171. package/build/cjs/orchestrion/config/koa.js.map +1 -0
  172. package/build/cjs/orchestrion/config/langchain.js +52 -0
  173. package/build/cjs/orchestrion/config/langchain.js.map +1 -0
  174. package/build/cjs/orchestrion/config/langgraph.js +28 -0
  175. package/build/cjs/orchestrion/config/langgraph.js.map +1 -0
  176. package/build/cjs/orchestrion/config/lru-memoizer.js +17 -0
  177. package/build/cjs/orchestrion/config/lru-memoizer.js.map +1 -0
  178. package/build/cjs/orchestrion/config/mongodb.js +67 -0
  179. package/build/cjs/orchestrion/config/mongodb.js.map +1 -0
  180. package/build/cjs/orchestrion/config/mongoose.js +107 -0
  181. package/build/cjs/orchestrion/config/mongoose.js.map +1 -0
  182. package/build/cjs/orchestrion/config/mysql.js +16 -0
  183. package/build/cjs/orchestrion/config/mysql.js.map +1 -0
  184. package/build/cjs/orchestrion/config/mysql2.js +32 -0
  185. package/build/cjs/orchestrion/config/mysql2.js.map +1 -0
  186. package/build/cjs/orchestrion/config/nestjs.js +122 -0
  187. package/build/cjs/orchestrion/config/nestjs.js.map +1 -0
  188. package/build/cjs/orchestrion/config/openai.js +40 -0
  189. package/build/cjs/orchestrion/config/openai.js.map +1 -0
  190. package/build/cjs/orchestrion/config/pg.js +51 -0
  191. package/build/cjs/orchestrion/config/pg.js.map +1 -0
  192. package/build/cjs/orchestrion/config/postgres.js +50 -0
  193. package/build/cjs/orchestrion/config/postgres.js.map +1 -0
  194. package/build/cjs/orchestrion/config/prisma.js +8 -0
  195. package/build/cjs/orchestrion/config/prisma.js.map +1 -0
  196. package/build/cjs/orchestrion/config/react-router.js +8 -0
  197. package/build/cjs/orchestrion/config/react-router.js.map +1 -0
  198. package/build/cjs/orchestrion/config/redis.js +76 -0
  199. package/build/cjs/orchestrion/config/redis.js.map +1 -0
  200. package/build/cjs/orchestrion/config/remix.js +54 -0
  201. package/build/cjs/orchestrion/config/remix.js.map +1 -0
  202. package/build/cjs/orchestrion/config/tedious.js +24 -0
  203. package/build/cjs/orchestrion/config/tedious.js.map +1 -0
  204. package/build/cjs/orchestrion/config/vercel-ai.js +48 -0
  205. package/build/cjs/orchestrion/config/vercel-ai.js.map +1 -0
  206. package/build/cjs/orchestrion/detect.js +26 -0
  207. package/build/cjs/orchestrion/detect.js.map +1 -0
  208. package/build/cjs/orchestrion/index.js +89 -0
  209. package/build/cjs/orchestrion/index.js.map +1 -0
  210. package/build/cjs/orchestrion/runtime/register.js +77 -0
  211. package/build/cjs/orchestrion/runtime/register.js.map +1 -0
  212. package/build/cjs/prisma/global.js +14 -0
  213. package/build/cjs/prisma/global.js.map +1 -0
  214. package/build/cjs/prisma/index.js +27 -0
  215. package/build/cjs/prisma/index.js.map +1 -0
  216. package/build/cjs/prisma/tracing-helper.js +211 -0
  217. package/build/cjs/prisma/tracing-helper.js.map +1 -0
  218. package/build/cjs/redis/index.js +23 -0
  219. package/build/cjs/redis/index.js.map +1 -0
  220. package/build/cjs/redis/redis-dc-subscriber.js +101 -0
  221. package/build/cjs/redis/redis-dc-subscriber.js.map +1 -0
  222. package/build/cjs/redis/redis-statement-serializer.js +34 -0
  223. package/build/cjs/redis/redis-statement-serializer.js.map +1 -0
  224. package/build/cjs/tracing-channel.js +134 -0
  225. package/build/cjs/tracing-channel.js.map +1 -0
  226. package/build/cjs/vercel-ai/index.js +23 -0
  227. package/build/cjs/vercel-ai/index.js.map +1 -0
  228. package/build/cjs/vercel-ai/util.js +112 -0
  229. package/build/cjs/vercel-ai/util.js.map +1 -0
  230. package/build/cjs/vercel-ai/vercel-ai-dc-subscriber.js +433 -0
  231. package/build/cjs/vercel-ai/vercel-ai-dc-subscriber.js.map +1 -0
  232. package/build/cjs/vercel-ai/vercel-ai-orchestrion-subscriber.js +399 -0
  233. package/build/cjs/vercel-ai/vercel-ai-orchestrion-subscriber.js.map +1 -0
  234. package/build/esm/debug-build.js +4 -0
  235. package/build/esm/debug-build.js.map +1 -0
  236. package/build/esm/graphql/graphql-dc-subscriber.js +116 -0
  237. package/build/esm/graphql/graphql-dc-subscriber.js.map +1 -0
  238. package/build/esm/graphql/index.js +21 -0
  239. package/build/esm/graphql/index.js.map +1 -0
  240. package/build/esm/graphql/utils.js +87 -0
  241. package/build/esm/graphql/utils.js.map +1 -0
  242. package/build/esm/index.js +12 -0
  243. package/build/esm/index.js.map +1 -0
  244. package/build/esm/integrations/tracing-channel/amqplib.js +418 -0
  245. package/build/esm/integrations/tracing-channel/amqplib.js.map +1 -0
  246. package/build/esm/integrations/tracing-channel/anthropic.js +99 -0
  247. package/build/esm/integrations/tracing-channel/anthropic.js.map +1 -0
  248. package/build/esm/integrations/tracing-channel/aws-sdk/constants.js +9 -0
  249. package/build/esm/integrations/tracing-channel/aws-sdk/constants.js.map +1 -0
  250. package/build/esm/integrations/tracing-channel/aws-sdk/index.js +152 -0
  251. package/build/esm/integrations/tracing-channel/aws-sdk/index.js.map +1 -0
  252. package/build/esm/integrations/tracing-channel/aws-sdk/services/MessageAttributes.js +41 -0
  253. package/build/esm/integrations/tracing-channel/aws-sdk/services/MessageAttributes.js.map +1 -0
  254. package/build/esm/integrations/tracing-channel/aws-sdk/services/ServicesExtensions.js +45 -0
  255. package/build/esm/integrations/tracing-channel/aws-sdk/services/ServicesExtensions.js.map +1 -0
  256. package/build/esm/integrations/tracing-channel/aws-sdk/services/bedrock-runtime.js +417 -0
  257. package/build/esm/integrations/tracing-channel/aws-sdk/services/bedrock-runtime.js.map +1 -0
  258. package/build/esm/integrations/tracing-channel/aws-sdk/services/dynamodb.js +129 -0
  259. package/build/esm/integrations/tracing-channel/aws-sdk/services/dynamodb.js.map +1 -0
  260. package/build/esm/integrations/tracing-channel/aws-sdk/services/kinesis.js +19 -0
  261. package/build/esm/integrations/tracing-channel/aws-sdk/services/kinesis.js.map +1 -0
  262. package/build/esm/integrations/tracing-channel/aws-sdk/services/lambda.js +62 -0
  263. package/build/esm/integrations/tracing-channel/aws-sdk/services/lambda.js.map +1 -0
  264. package/build/esm/integrations/tracing-channel/aws-sdk/services/s3.js +19 -0
  265. package/build/esm/integrations/tracing-channel/aws-sdk/services/s3.js.map +1 -0
  266. package/build/esm/integrations/tracing-channel/aws-sdk/services/secretsmanager.js +25 -0
  267. package/build/esm/integrations/tracing-channel/aws-sdk/services/secretsmanager.js.map +1 -0
  268. package/build/esm/integrations/tracing-channel/aws-sdk/services/sns.js +61 -0
  269. package/build/esm/integrations/tracing-channel/aws-sdk/services/sns.js.map +1 -0
  270. package/build/esm/integrations/tracing-channel/aws-sdk/services/sqs.js +114 -0
  271. package/build/esm/integrations/tracing-channel/aws-sdk/services/sqs.js.map +1 -0
  272. package/build/esm/integrations/tracing-channel/aws-sdk/services/stepfunctions.js +23 -0
  273. package/build/esm/integrations/tracing-channel/aws-sdk/services/stepfunctions.js.map +1 -0
  274. package/build/esm/integrations/tracing-channel/aws-sdk/utils.js +26 -0
  275. package/build/esm/integrations/tracing-channel/aws-sdk/utils.js.map +1 -0
  276. package/build/esm/integrations/tracing-channel/dataloader.js +93 -0
  277. package/build/esm/integrations/tracing-channel/dataloader.js.map +1 -0
  278. package/build/esm/integrations/tracing-channel/express/index.js +22 -0
  279. package/build/esm/integrations/tracing-channel/express/index.js.map +1 -0
  280. package/build/esm/integrations/tracing-channel/express/instrumentation.js +166 -0
  281. package/build/esm/integrations/tracing-channel/express/instrumentation.js.map +1 -0
  282. package/build/esm/integrations/tracing-channel/express/route.js +68 -0
  283. package/build/esm/integrations/tracing-channel/express/route.js.map +1 -0
  284. package/build/esm/integrations/tracing-channel/fastify/errors.js +39 -0
  285. package/build/esm/integrations/tracing-channel/fastify/errors.js.map +1 -0
  286. package/build/esm/integrations/tracing-channel/fastify/index.js +30 -0
  287. package/build/esm/integrations/tracing-channel/fastify/index.js.map +1 -0
  288. package/build/esm/integrations/tracing-channel/fastify/instrumentation.js +277 -0
  289. package/build/esm/integrations/tracing-channel/fastify/instrumentation.js.map +1 -0
  290. package/build/esm/integrations/tracing-channel/fastify/utils.js +8 -0
  291. package/build/esm/integrations/tracing-channel/fastify/utils.js.map +1 -0
  292. package/build/esm/integrations/tracing-channel/generic-pool.js +32 -0
  293. package/build/esm/integrations/tracing-channel/generic-pool.js.map +1 -0
  294. package/build/esm/integrations/tracing-channel/google-genai.js +94 -0
  295. package/build/esm/integrations/tracing-channel/google-genai.js.map +1 -0
  296. package/build/esm/integrations/tracing-channel/graphql/constants.js +14 -0
  297. package/build/esm/integrations/tracing-channel/graphql/constants.js.map +1 -0
  298. package/build/esm/integrations/tracing-channel/graphql/index.js +63 -0
  299. package/build/esm/integrations/tracing-channel/graphql/index.js.map +1 -0
  300. package/build/esm/integrations/tracing-channel/graphql/resolvers.js +164 -0
  301. package/build/esm/integrations/tracing-channel/graphql/resolvers.js.map +1 -0
  302. package/build/esm/integrations/tracing-channel/graphql/spans.js +96 -0
  303. package/build/esm/integrations/tracing-channel/graphql/spans.js.map +1 -0
  304. package/build/esm/integrations/tracing-channel/hapi-types.js +25 -0
  305. package/build/esm/integrations/tracing-channel/hapi-types.js.map +1 -0
  306. package/build/esm/integrations/tracing-channel/hapi-utils.js +172 -0
  307. package/build/esm/integrations/tracing-channel/hapi-utils.js.map +1 -0
  308. package/build/esm/integrations/tracing-channel/hapi.js +50 -0
  309. package/build/esm/integrations/tracing-channel/hapi.js.map +1 -0
  310. package/build/esm/integrations/tracing-channel/ioredis.js +96 -0
  311. package/build/esm/integrations/tracing-channel/ioredis.js.map +1 -0
  312. package/build/esm/integrations/tracing-channel/kafkajs/consumer.js +67 -0
  313. package/build/esm/integrations/tracing-channel/kafkajs/consumer.js.map +1 -0
  314. package/build/esm/integrations/tracing-channel/kafkajs/index.js +68 -0
  315. package/build/esm/integrations/tracing-channel/kafkajs/index.js.map +1 -0
  316. package/build/esm/integrations/tracing-channel/kafkajs/semconv.js +12 -0
  317. package/build/esm/integrations/tracing-channel/kafkajs/semconv.js.map +1 -0
  318. package/build/esm/integrations/tracing-channel/kafkajs/spans.js +112 -0
  319. package/build/esm/integrations/tracing-channel/kafkajs/spans.js.map +1 -0
  320. package/build/esm/integrations/tracing-channel/knex.js +186 -0
  321. package/build/esm/integrations/tracing-channel/knex.js.map +1 -0
  322. package/build/esm/integrations/tracing-channel/koa.js +144 -0
  323. package/build/esm/integrations/tracing-channel/koa.js.map +1 -0
  324. package/build/esm/integrations/tracing-channel/langchain.js +61 -0
  325. package/build/esm/integrations/tracing-channel/langchain.js.map +1 -0
  326. package/build/esm/integrations/tracing-channel/langgraph.js +98 -0
  327. package/build/esm/integrations/tracing-channel/langgraph.js.map +1 -0
  328. package/build/esm/integrations/tracing-channel/lru-memoizer.js +29 -0
  329. package/build/esm/integrations/tracing-channel/lru-memoizer.js.map +1 -0
  330. package/build/esm/integrations/tracing-channel/mongodb.js +102 -0
  331. package/build/esm/integrations/tracing-channel/mongodb.js.map +1 -0
  332. package/build/esm/integrations/tracing-channel/mongoose.js +108 -0
  333. package/build/esm/integrations/tracing-channel/mongoose.js.map +1 -0
  334. package/build/esm/integrations/tracing-channel/mysql.js +105 -0
  335. package/build/esm/integrations/tracing-channel/mysql.js.map +1 -0
  336. package/build/esm/integrations/tracing-channel/mysql2.js +81 -0
  337. package/build/esm/integrations/tracing-channel/mysql2.js.map +1 -0
  338. package/build/esm/integrations/tracing-channel/openai.js +79 -0
  339. package/build/esm/integrations/tracing-channel/openai.js.map +1 -0
  340. package/build/esm/integrations/tracing-channel/postgres-js.js +189 -0
  341. package/build/esm/integrations/tracing-channel/postgres-js.js.map +1 -0
  342. package/build/esm/integrations/tracing-channel/postgres.js +168 -0
  343. package/build/esm/integrations/tracing-channel/postgres.js.map +1 -0
  344. package/build/esm/integrations/tracing-channel/redis.js +216 -0
  345. package/build/esm/integrations/tracing-channel/redis.js.map +1 -0
  346. package/build/esm/integrations/tracing-channel/tedious.js +143 -0
  347. package/build/esm/integrations/tracing-channel/tedious.js.map +1 -0
  348. package/build/esm/integrations/tracing-channel/vercel-ai.js +23 -0
  349. package/build/esm/integrations/tracing-channel/vercel-ai.js.map +1 -0
  350. package/build/esm/mongodb/mongodb-span.js +126 -0
  351. package/build/esm/mongodb/mongodb-span.js.map +1 -0
  352. package/build/esm/mongoose/index.js +21 -0
  353. package/build/esm/mongoose/index.js.map +1 -0
  354. package/build/esm/mongoose/mongoose-dc-subscriber.js +89 -0
  355. package/build/esm/mongoose/mongoose-dc-subscriber.js.map +1 -0
  356. package/build/esm/mongoose/mongoose-legacy-span.js +38 -0
  357. package/build/esm/mongoose/mongoose-legacy-span.js.map +1 -0
  358. package/build/esm/mysql2/index.js +21 -0
  359. package/build/esm/mysql2/index.js.map +1 -0
  360. package/build/esm/mysql2/mysql2-dc-subscriber.js +62 -0
  361. package/build/esm/mysql2/mysql2-dc-subscriber.js.map +1 -0
  362. package/build/esm/orchestrion/bundler/esbuild.js +9 -0
  363. package/build/esm/orchestrion/bundler/esbuild.js.map +1 -0
  364. package/build/esm/orchestrion/bundler/options.js +22 -0
  365. package/build/esm/orchestrion/bundler/options.js.map +1 -0
  366. package/build/esm/orchestrion/bundler/rollup.js +9 -0
  367. package/build/esm/orchestrion/bundler/rollup.js.map +1 -0
  368. package/build/esm/orchestrion/bundler/vite.js +15 -0
  369. package/build/esm/orchestrion/bundler/vite.js.map +1 -0
  370. package/build/esm/orchestrion/bundler/webpack.js +27 -0
  371. package/build/esm/orchestrion/bundler/webpack.js.map +1 -0
  372. package/build/esm/orchestrion/channels.js +68 -0
  373. package/build/esm/orchestrion/channels.js.map +1 -0
  374. package/build/esm/orchestrion/config/amqplib.js +78 -0
  375. package/build/esm/orchestrion/config/amqplib.js.map +1 -0
  376. package/build/esm/orchestrion/config/anthropic-ai.js +40 -0
  377. package/build/esm/orchestrion/config/anthropic-ai.js.map +1 -0
  378. package/build/esm/orchestrion/config/aws-sdk.js +25 -0
  379. package/build/esm/orchestrion/config/aws-sdk.js.map +1 -0
  380. package/build/esm/orchestrion/config/dataloader.js +50 -0
  381. package/build/esm/orchestrion/config/dataloader.js.map +1 -0
  382. package/build/esm/orchestrion/config/express.js +74 -0
  383. package/build/esm/orchestrion/config/express.js.map +1 -0
  384. package/build/esm/orchestrion/config/firebase.js +5 -0
  385. package/build/esm/orchestrion/config/firebase.js.map +1 -0
  386. package/build/esm/orchestrion/config/generic-pool.js +18 -0
  387. package/build/esm/orchestrion/config/generic-pool.js.map +1 -0
  388. package/build/esm/orchestrion/config/google-genai.js +35 -0
  389. package/build/esm/orchestrion/config/google-genai.js.map +1 -0
  390. package/build/esm/orchestrion/config/graphql.js +25 -0
  391. package/build/esm/orchestrion/config/graphql.js.map +1 -0
  392. package/build/esm/orchestrion/config/hapi.js +23 -0
  393. package/build/esm/orchestrion/config/hapi.js.map +1 -0
  394. package/build/esm/orchestrion/config/index.js +84 -0
  395. package/build/esm/orchestrion/config/index.js.map +1 -0
  396. package/build/esm/orchestrion/config/ioredis.js +32 -0
  397. package/build/esm/orchestrion/config/ioredis.js.map +1 -0
  398. package/build/esm/orchestrion/config/kafkajs.js +27 -0
  399. package/build/esm/orchestrion/config/kafkajs.js.map +1 -0
  400. package/build/esm/orchestrion/config/knex.js +40 -0
  401. package/build/esm/orchestrion/config/knex.js.map +1 -0
  402. package/build/esm/orchestrion/config/koa.js +13 -0
  403. package/build/esm/orchestrion/config/koa.js.map +1 -0
  404. package/build/esm/orchestrion/config/langchain.js +48 -0
  405. package/build/esm/orchestrion/config/langchain.js.map +1 -0
  406. package/build/esm/orchestrion/config/langgraph.js +25 -0
  407. package/build/esm/orchestrion/config/langgraph.js.map +1 -0
  408. package/build/esm/orchestrion/config/lru-memoizer.js +14 -0
  409. package/build/esm/orchestrion/config/lru-memoizer.js.map +1 -0
  410. package/build/esm/orchestrion/config/mongodb.js +64 -0
  411. package/build/esm/orchestrion/config/mongodb.js.map +1 -0
  412. package/build/esm/orchestrion/config/mongoose.js +103 -0
  413. package/build/esm/orchestrion/config/mongoose.js.map +1 -0
  414. package/build/esm/orchestrion/config/mysql.js +13 -0
  415. package/build/esm/orchestrion/config/mysql.js.map +1 -0
  416. package/build/esm/orchestrion/config/mysql2.js +29 -0
  417. package/build/esm/orchestrion/config/mysql2.js.map +1 -0
  418. package/build/esm/orchestrion/config/nestjs.js +119 -0
  419. package/build/esm/orchestrion/config/nestjs.js.map +1 -0
  420. package/build/esm/orchestrion/config/openai.js +37 -0
  421. package/build/esm/orchestrion/config/openai.js.map +1 -0
  422. package/build/esm/orchestrion/config/pg.js +48 -0
  423. package/build/esm/orchestrion/config/pg.js.map +1 -0
  424. package/build/esm/orchestrion/config/postgres.js +47 -0
  425. package/build/esm/orchestrion/config/postgres.js.map +1 -0
  426. package/build/esm/orchestrion/config/prisma.js +5 -0
  427. package/build/esm/orchestrion/config/prisma.js.map +1 -0
  428. package/build/esm/orchestrion/config/react-router.js +5 -0
  429. package/build/esm/orchestrion/config/react-router.js.map +1 -0
  430. package/build/esm/orchestrion/config/redis.js +73 -0
  431. package/build/esm/orchestrion/config/redis.js.map +1 -0
  432. package/build/esm/orchestrion/config/remix.js +51 -0
  433. package/build/esm/orchestrion/config/remix.js.map +1 -0
  434. package/build/esm/orchestrion/config/tedious.js +21 -0
  435. package/build/esm/orchestrion/config/tedious.js.map +1 -0
  436. package/build/esm/orchestrion/config/vercel-ai.js +45 -0
  437. package/build/esm/orchestrion/config/vercel-ai.js.map +1 -0
  438. package/build/esm/orchestrion/detect.js +23 -0
  439. package/build/esm/orchestrion/detect.js.map +1 -0
  440. package/build/esm/orchestrion/index.js +58 -0
  441. package/build/esm/orchestrion/index.js.map +1 -0
  442. package/build/esm/orchestrion/runtime/register.js +76 -0
  443. package/build/esm/orchestrion/runtime/register.js.map +1 -0
  444. package/build/esm/package.json +1 -0
  445. package/build/esm/prisma/global.js +12 -0
  446. package/build/esm/prisma/global.js.map +1 -0
  447. package/build/esm/prisma/index.js +24 -0
  448. package/build/esm/prisma/index.js.map +1 -0
  449. package/build/esm/prisma/tracing-helper.js +209 -0
  450. package/build/esm/prisma/tracing-helper.js.map +1 -0
  451. package/build/esm/redis/index.js +21 -0
  452. package/build/esm/redis/index.js.map +1 -0
  453. package/build/esm/redis/redis-dc-subscriber.js +94 -0
  454. package/build/esm/redis/redis-dc-subscriber.js.map +1 -0
  455. package/build/esm/redis/redis-statement-serializer.js +32 -0
  456. package/build/esm/redis/redis-statement-serializer.js.map +1 -0
  457. package/build/esm/tracing-channel.js +132 -0
  458. package/build/esm/tracing-channel.js.map +1 -0
  459. package/build/esm/vercel-ai/index.js +21 -0
  460. package/build/esm/vercel-ai/index.js.map +1 -0
  461. package/build/esm/vercel-ai/util.js +106 -0
  462. package/build/esm/vercel-ai/util.js.map +1 -0
  463. package/build/esm/vercel-ai/vercel-ai-dc-subscriber.js +425 -0
  464. package/build/esm/vercel-ai/vercel-ai-dc-subscriber.js.map +1 -0
  465. package/build/esm/vercel-ai/vercel-ai-orchestrion-subscriber.js +397 -0
  466. package/build/esm/vercel-ai/vercel-ai-orchestrion-subscriber.js.map +1 -0
  467. package/build/orchestrion/import-hook.mjs +19 -0
  468. package/build/types/debug-build.d.ts +7 -0
  469. package/build/types/debug-build.d.ts.map +1 -0
  470. package/build/types/graphql/graphql-dc-subscriber.d.ts +94 -0
  471. package/build/types/graphql/graphql-dc-subscriber.d.ts.map +1 -0
  472. package/build/types/graphql/index.d.ts +12 -0
  473. package/build/types/graphql/index.d.ts.map +1 -0
  474. package/build/types/graphql/utils.d.ts +36 -0
  475. package/build/types/graphql/utils.d.ts.map +1 -0
  476. package/build/types/index.d.ts +22 -0
  477. package/build/types/index.d.ts.map +1 -0
  478. package/build/types/integrations/tracing-channel/amqplib.d.ts +11 -0
  479. package/build/types/integrations/tracing-channel/amqplib.d.ts.map +1 -0
  480. package/build/types/integrations/tracing-channel/anthropic.d.ts +10 -0
  481. package/build/types/integrations/tracing-channel/anthropic.d.ts.map +1 -0
  482. package/build/types/integrations/tracing-channel/aws-sdk/aws-sdk.types.d.ts +43 -0
  483. package/build/types/integrations/tracing-channel/aws-sdk/aws-sdk.types.d.ts.map +1 -0
  484. package/build/types/integrations/tracing-channel/aws-sdk/constants.d.ts +15 -0
  485. package/build/types/integrations/tracing-channel/aws-sdk/constants.d.ts.map +1 -0
  486. package/build/types/integrations/tracing-channel/aws-sdk/index.d.ts +15 -0
  487. package/build/types/integrations/tracing-channel/aws-sdk/index.d.ts.map +1 -0
  488. package/build/types/integrations/tracing-channel/aws-sdk/services/MessageAttributes.d.ts +23 -0
  489. package/build/types/integrations/tracing-channel/aws-sdk/services/MessageAttributes.d.ts.map +1 -0
  490. package/build/types/integrations/tracing-channel/aws-sdk/services/ServiceExtension.d.ts +9 -0
  491. package/build/types/integrations/tracing-channel/aws-sdk/services/ServiceExtension.d.ts.map +1 -0
  492. package/build/types/integrations/tracing-channel/aws-sdk/services/ServicesExtensions.d.ts +10 -0
  493. package/build/types/integrations/tracing-channel/aws-sdk/services/ServicesExtensions.d.ts.map +1 -0
  494. package/build/types/integrations/tracing-channel/aws-sdk/services/bedrock-runtime.d.ts +14 -0
  495. package/build/types/integrations/tracing-channel/aws-sdk/services/bedrock-runtime.d.ts.map +1 -0
  496. package/build/types/integrations/tracing-channel/aws-sdk/services/dynamodb.d.ts +8 -0
  497. package/build/types/integrations/tracing-channel/aws-sdk/services/dynamodb.d.ts.map +1 -0
  498. package/build/types/integrations/tracing-channel/aws-sdk/services/index.d.ts +2 -0
  499. package/build/types/integrations/tracing-channel/aws-sdk/services/index.d.ts.map +1 -0
  500. package/build/types/integrations/tracing-channel/aws-sdk/services/kinesis.d.ts +6 -0
  501. package/build/types/integrations/tracing-channel/aws-sdk/services/kinesis.d.ts.map +1 -0
  502. package/build/types/integrations/tracing-channel/aws-sdk/services/lambda.d.ts +9 -0
  503. package/build/types/integrations/tracing-channel/aws-sdk/services/lambda.d.ts.map +1 -0
  504. package/build/types/integrations/tracing-channel/aws-sdk/services/s3.d.ts +6 -0
  505. package/build/types/integrations/tracing-channel/aws-sdk/services/s3.d.ts.map +1 -0
  506. package/build/types/integrations/tracing-channel/aws-sdk/services/secretsmanager.d.ts +8 -0
  507. package/build/types/integrations/tracing-channel/aws-sdk/services/secretsmanager.d.ts.map +1 -0
  508. package/build/types/integrations/tracing-channel/aws-sdk/services/sns.d.ts +9 -0
  509. package/build/types/integrations/tracing-channel/aws-sdk/services/sns.d.ts.map +1 -0
  510. package/build/types/integrations/tracing-channel/aws-sdk/services/sqs.d.ts +9 -0
  511. package/build/types/integrations/tracing-channel/aws-sdk/services/sqs.d.ts.map +1 -0
  512. package/build/types/integrations/tracing-channel/aws-sdk/services/stepfunctions.d.ts +6 -0
  513. package/build/types/integrations/tracing-channel/aws-sdk/services/stepfunctions.d.ts.map +1 -0
  514. package/build/types/integrations/tracing-channel/aws-sdk/types.d.ts +26 -0
  515. package/build/types/integrations/tracing-channel/aws-sdk/types.d.ts.map +1 -0
  516. package/build/types/integrations/tracing-channel/aws-sdk/utils.d.ts +5 -0
  517. package/build/types/integrations/tracing-channel/aws-sdk/utils.d.ts.map +1 -0
  518. package/build/types/integrations/tracing-channel/dataloader.d.ts +11 -0
  519. package/build/types/integrations/tracing-channel/dataloader.d.ts.map +1 -0
  520. package/build/types/integrations/tracing-channel/express/index.d.ts +18 -0
  521. package/build/types/integrations/tracing-channel/express/index.d.ts.map +1 -0
  522. package/build/types/integrations/tracing-channel/express/instrumentation.d.ts +4 -0
  523. package/build/types/integrations/tracing-channel/express/instrumentation.d.ts.map +1 -0
  524. package/build/types/integrations/tracing-channel/express/route.d.ts +28 -0
  525. package/build/types/integrations/tracing-channel/express/route.d.ts.map +1 -0
  526. package/build/types/integrations/tracing-channel/express/types.d.ts +64 -0
  527. package/build/types/integrations/tracing-channel/express/types.d.ts.map +1 -0
  528. package/build/types/integrations/tracing-channel/fastify/errors.d.ts +12 -0
  529. package/build/types/integrations/tracing-channel/fastify/errors.d.ts.map +1 -0
  530. package/build/types/integrations/tracing-channel/fastify/index.d.ts +66 -0
  531. package/build/types/integrations/tracing-channel/fastify/index.d.ts.map +1 -0
  532. package/build/types/integrations/tracing-channel/fastify/instrumentation.d.ts +10 -0
  533. package/build/types/integrations/tracing-channel/fastify/instrumentation.d.ts.map +1 -0
  534. package/build/types/integrations/tracing-channel/fastify/types.d.ts +32 -0
  535. package/build/types/integrations/tracing-channel/fastify/types.d.ts.map +1 -0
  536. package/build/types/integrations/tracing-channel/fastify/utils.d.ts +9 -0
  537. package/build/types/integrations/tracing-channel/fastify/utils.d.ts.map +1 -0
  538. package/build/types/integrations/tracing-channel/generic-pool.d.ts +10 -0
  539. package/build/types/integrations/tracing-channel/generic-pool.d.ts.map +1 -0
  540. package/build/types/integrations/tracing-channel/google-genai.d.ts +12 -0
  541. package/build/types/integrations/tracing-channel/google-genai.d.ts.map +1 -0
  542. package/build/types/integrations/tracing-channel/graphql/constants.d.ts +12 -0
  543. package/build/types/integrations/tracing-channel/graphql/constants.d.ts.map +1 -0
  544. package/build/types/integrations/tracing-channel/graphql/graphql-types.d.ts +135 -0
  545. package/build/types/integrations/tracing-channel/graphql/graphql-types.d.ts.map +1 -0
  546. package/build/types/integrations/tracing-channel/graphql/index.d.ts +28 -0
  547. package/build/types/integrations/tracing-channel/graphql/index.d.ts.map +1 -0
  548. package/build/types/integrations/tracing-channel/graphql/resolvers.d.ts +13 -0
  549. package/build/types/integrations/tracing-channel/graphql/resolvers.d.ts.map +1 -0
  550. package/build/types/integrations/tracing-channel/graphql/spans.d.ts +17 -0
  551. package/build/types/integrations/tracing-channel/graphql/spans.d.ts.map +1 -0
  552. package/build/types/integrations/tracing-channel/graphql/types.d.ts +25 -0
  553. package/build/types/integrations/tracing-channel/graphql/types.d.ts.map +1 -0
  554. package/build/types/integrations/tracing-channel/hapi-types.d.ts +53 -0
  555. package/build/types/integrations/tracing-channel/hapi-types.d.ts.map +1 -0
  556. package/build/types/integrations/tracing-channel/hapi-utils.d.ts +25 -0
  557. package/build/types/integrations/tracing-channel/hapi-utils.d.ts.map +1 -0
  558. package/build/types/integrations/tracing-channel/hapi.d.ts +9 -0
  559. package/build/types/integrations/tracing-channel/hapi.d.ts.map +1 -0
  560. package/build/types/integrations/tracing-channel/ioredis.d.ts +37 -0
  561. package/build/types/integrations/tracing-channel/ioredis.d.ts.map +1 -0
  562. package/build/types/integrations/tracing-channel/kafkajs/consumer.d.ts +8 -0
  563. package/build/types/integrations/tracing-channel/kafkajs/consumer.d.ts.map +1 -0
  564. package/build/types/integrations/tracing-channel/kafkajs/index.d.ts +17 -0
  565. package/build/types/integrations/tracing-channel/kafkajs/index.d.ts.map +1 -0
  566. package/build/types/integrations/tracing-channel/kafkajs/semconv.d.ts +10 -0
  567. package/build/types/integrations/tracing-channel/kafkajs/semconv.d.ts.map +1 -0
  568. package/build/types/integrations/tracing-channel/kafkajs/spans.d.ts +38 -0
  569. package/build/types/integrations/tracing-channel/kafkajs/spans.d.ts.map +1 -0
  570. package/build/types/integrations/tracing-channel/kafkajs/types.d.ts +40 -0
  571. package/build/types/integrations/tracing-channel/kafkajs/types.d.ts.map +1 -0
  572. package/build/types/integrations/tracing-channel/knex.d.ts +11 -0
  573. package/build/types/integrations/tracing-channel/knex.d.ts.map +1 -0
  574. package/build/types/integrations/tracing-channel/koa.d.ts +14 -0
  575. package/build/types/integrations/tracing-channel/koa.d.ts.map +1 -0
  576. package/build/types/integrations/tracing-channel/langchain.d.ts +10 -0
  577. package/build/types/integrations/tracing-channel/langchain.d.ts.map +1 -0
  578. package/build/types/integrations/tracing-channel/langgraph.d.ts +10 -0
  579. package/build/types/integrations/tracing-channel/langgraph.d.ts.map +1 -0
  580. package/build/types/integrations/tracing-channel/lru-memoizer.d.ts +10 -0
  581. package/build/types/integrations/tracing-channel/lru-memoizer.d.ts.map +1 -0
  582. package/build/types/integrations/tracing-channel/mongodb.d.ts +12 -0
  583. package/build/types/integrations/tracing-channel/mongodb.d.ts.map +1 -0
  584. package/build/types/integrations/tracing-channel/mongoose.d.ts +15 -0
  585. package/build/types/integrations/tracing-channel/mongoose.d.ts.map +1 -0
  586. package/build/types/integrations/tracing-channel/mysql.d.ts +12 -0
  587. package/build/types/integrations/tracing-channel/mysql.d.ts.map +1 -0
  588. package/build/types/integrations/tracing-channel/mysql2.d.ts +15 -0
  589. package/build/types/integrations/tracing-channel/mysql2.d.ts.map +1 -0
  590. package/build/types/integrations/tracing-channel/openai.d.ts +10 -0
  591. package/build/types/integrations/tracing-channel/openai.d.ts.map +1 -0
  592. package/build/types/integrations/tracing-channel/postgres-js.d.ts +26 -0
  593. package/build/types/integrations/tracing-channel/postgres-js.d.ts.map +1 -0
  594. package/build/types/integrations/tracing-channel/postgres.d.ts +15 -0
  595. package/build/types/integrations/tracing-channel/postgres.d.ts.map +1 -0
  596. package/build/types/integrations/tracing-channel/redis.d.ts +16 -0
  597. package/build/types/integrations/tracing-channel/redis.d.ts.map +1 -0
  598. package/build/types/integrations/tracing-channel/tedious.d.ts +11 -0
  599. package/build/types/integrations/tracing-channel/tedious.d.ts.map +1 -0
  600. package/build/types/integrations/tracing-channel/vercel-ai.d.ts +13 -0
  601. package/build/types/integrations/tracing-channel/vercel-ai.d.ts.map +1 -0
  602. package/build/types/mongodb/mongodb-span.d.ts +66 -0
  603. package/build/types/mongodb/mongodb-span.d.ts.map +1 -0
  604. package/build/types/mongoose/index.d.ts +13 -0
  605. package/build/types/mongoose/index.d.ts.map +1 -0
  606. package/build/types/mongoose/mongoose-dc-subscriber.d.ts +63 -0
  607. package/build/types/mongoose/mongoose-dc-subscriber.d.ts.map +1 -0
  608. package/build/types/mongoose/mongoose-legacy-span.d.ts +29 -0
  609. package/build/types/mongoose/mongoose-legacy-span.d.ts.map +1 -0
  610. package/build/types/mysql2/index.d.ts +11 -0
  611. package/build/types/mysql2/index.d.ts.map +1 -0
  612. package/build/types/mysql2/mysql2-dc-subscriber.d.ts +59 -0
  613. package/build/types/mysql2/mysql2-dc-subscriber.d.ts.map +1 -0
  614. package/build/types/orchestrion/bundler/esbuild.d.ts +21 -0
  615. package/build/types/orchestrion/bundler/esbuild.d.ts.map +1 -0
  616. package/build/types/orchestrion/bundler/options.d.ts +29 -0
  617. package/build/types/orchestrion/bundler/options.d.ts.map +1 -0
  618. package/build/types/orchestrion/bundler/rollup.d.ts +17 -0
  619. package/build/types/orchestrion/bundler/rollup.d.ts.map +1 -0
  620. package/build/types/orchestrion/bundler/vite.d.ts +18 -0
  621. package/build/types/orchestrion/bundler/vite.d.ts.map +1 -0
  622. package/build/types/orchestrion/bundler/webpack.d.ts +19 -0
  623. package/build/types/orchestrion/bundler/webpack.d.ts.map +1 -0
  624. package/build/types/orchestrion/channels.d.ts +130 -0
  625. package/build/types/orchestrion/channels.d.ts.map +1 -0
  626. package/build/types/orchestrion/config/amqplib.d.ts +66 -0
  627. package/build/types/orchestrion/config/amqplib.d.ts.map +1 -0
  628. package/build/types/orchestrion/config/anthropic-ai.d.ts +31 -0
  629. package/build/types/orchestrion/config/anthropic-ai.d.ts.map +1 -0
  630. package/build/types/orchestrion/config/aws-sdk.d.ts +19 -0
  631. package/build/types/orchestrion/config/aws-sdk.d.ts.map +1 -0
  632. package/build/types/orchestrion/config/dataloader.d.ts +46 -0
  633. package/build/types/orchestrion/config/dataloader.d.ts.map +1 -0
  634. package/build/types/orchestrion/config/express.d.ts +30 -0
  635. package/build/types/orchestrion/config/express.d.ts.map +1 -0
  636. package/build/types/orchestrion/config/firebase.d.ts +4 -0
  637. package/build/types/orchestrion/config/firebase.d.ts.map +1 -0
  638. package/build/types/orchestrion/config/generic-pool.d.ts +31 -0
  639. package/build/types/orchestrion/config/generic-pool.d.ts.map +1 -0
  640. package/build/types/orchestrion/config/google-genai.d.ts +30 -0
  641. package/build/types/orchestrion/config/google-genai.d.ts.map +1 -0
  642. package/build/types/orchestrion/config/graphql.d.ts +29 -0
  643. package/build/types/orchestrion/config/graphql.d.ts.map +1 -0
  644. package/build/types/orchestrion/config/hapi.d.ts +17 -0
  645. package/build/types/orchestrion/config/hapi.d.ts.map +1 -0
  646. package/build/types/orchestrion/config/index.d.ts +37 -0
  647. package/build/types/orchestrion/config/index.d.ts.map +1 -0
  648. package/build/types/orchestrion/config/ioredis.d.ts +7 -0
  649. package/build/types/orchestrion/config/ioredis.d.ts.map +1 -0
  650. package/build/types/orchestrion/config/kafkajs.d.ts +17 -0
  651. package/build/types/orchestrion/config/kafkajs.d.ts.map +1 -0
  652. package/build/types/orchestrion/config/knex.d.ts +9 -0
  653. package/build/types/orchestrion/config/knex.d.ts.map +1 -0
  654. package/build/types/orchestrion/config/koa.d.ts +17 -0
  655. package/build/types/orchestrion/config/koa.d.ts.map +1 -0
  656. package/build/types/orchestrion/config/langchain.d.ts +18 -0
  657. package/build/types/orchestrion/config/langchain.d.ts.map +1 -0
  658. package/build/types/orchestrion/config/langgraph.d.ts +21 -0
  659. package/build/types/orchestrion/config/langgraph.d.ts.map +1 -0
  660. package/build/types/orchestrion/config/lru-memoizer.d.ts +16 -0
  661. package/build/types/orchestrion/config/lru-memoizer.d.ts.map +1 -0
  662. package/build/types/orchestrion/config/mongodb.d.ts +59 -0
  663. package/build/types/orchestrion/config/mongodb.d.ts.map +1 -0
  664. package/build/types/orchestrion/config/mongoose.d.ts +40 -0
  665. package/build/types/orchestrion/config/mongoose.d.ts.map +1 -0
  666. package/build/types/orchestrion/config/mysql.d.ts +16 -0
  667. package/build/types/orchestrion/config/mysql.d.ts.map +1 -0
  668. package/build/types/orchestrion/config/mysql2.d.ts +18 -0
  669. package/build/types/orchestrion/config/mysql2.d.ts.map +1 -0
  670. package/build/types/orchestrion/config/nestjs.d.ts +24 -0
  671. package/build/types/orchestrion/config/nestjs.d.ts.map +1 -0
  672. package/build/types/orchestrion/config/openai.d.ts +18 -0
  673. package/build/types/orchestrion/config/openai.d.ts.map +1 -0
  674. package/build/types/orchestrion/config/pg.d.ts +33 -0
  675. package/build/types/orchestrion/config/pg.d.ts.map +1 -0
  676. package/build/types/orchestrion/config/postgres.d.ts +9 -0
  677. package/build/types/orchestrion/config/postgres.d.ts.map +1 -0
  678. package/build/types/orchestrion/config/prisma.d.ts +4 -0
  679. package/build/types/orchestrion/config/prisma.d.ts.map +1 -0
  680. package/build/types/orchestrion/config/react-router.d.ts +4 -0
  681. package/build/types/orchestrion/config/react-router.d.ts.map +1 -0
  682. package/build/types/orchestrion/config/redis.d.ts +37 -0
  683. package/build/types/orchestrion/config/redis.d.ts.map +1 -0
  684. package/build/types/orchestrion/config/remix.d.ts +9 -0
  685. package/build/types/orchestrion/config/remix.d.ts.map +1 -0
  686. package/build/types/orchestrion/config/tedious.d.ts +12 -0
  687. package/build/types/orchestrion/config/tedious.d.ts.map +1 -0
  688. package/build/types/orchestrion/config/vercel-ai.d.ts +12 -0
  689. package/build/types/orchestrion/config/vercel-ai.d.ts.map +1 -0
  690. package/build/types/orchestrion/detect.d.ts +26 -0
  691. package/build/types/orchestrion/detect.d.ts.map +1 -0
  692. package/build/types/orchestrion/index.d.ts +136 -0
  693. package/build/types/orchestrion/index.d.ts.map +1 -0
  694. package/build/types/orchestrion/runtime/register.d.ts +25 -0
  695. package/build/types/orchestrion/runtime/register.d.ts.map +1 -0
  696. package/build/types/prisma/global.d.ts +5 -0
  697. package/build/types/prisma/global.d.ts.map +1 -0
  698. package/build/types/prisma/index.d.ts +45 -0
  699. package/build/types/prisma/index.d.ts.map +1 -0
  700. package/build/types/prisma/tracing-helper.d.ts +46 -0
  701. package/build/types/prisma/tracing-helper.d.ts.map +1 -0
  702. package/build/types/prisma/types.d.ts +37 -0
  703. package/build/types/prisma/types.d.ts.map +1 -0
  704. package/build/types/redis/index.d.ts +18 -0
  705. package/build/types/redis/index.d.ts.map +1 -0
  706. package/build/types/redis/redis-dc-subscriber.d.ts +89 -0
  707. package/build/types/redis/redis-dc-subscriber.d.ts.map +1 -0
  708. package/build/types/redis/redis-statement-serializer.d.ts +6 -0
  709. package/build/types/redis/redis-statement-serializer.d.ts.map +1 -0
  710. package/build/types/tracing-channel.d.ts +73 -0
  711. package/build/types/tracing-channel.d.ts.map +1 -0
  712. package/build/types/vercel-ai/index.d.ts +27 -0
  713. package/build/types/vercel-ai/index.d.ts.map +1 -0
  714. package/build/types/vercel-ai/util.d.ts +30 -0
  715. package/build/types/vercel-ai/util.d.ts.map +1 -0
  716. package/build/types/vercel-ai/vercel-ai-dc-subscriber.d.ts +72 -0
  717. package/build/types/vercel-ai/vercel-ai-dc-subscriber.d.ts.map +1 -0
  718. package/build/types/vercel-ai/vercel-ai-orchestrion-subscriber.d.ts +12 -0
  719. package/build/types/vercel-ai/vercel-ai-orchestrion-subscriber.d.ts.map +1 -0
  720. package/build/types-ts3.8/debug-build.d.ts +7 -0
  721. package/build/types-ts3.8/graphql/graphql-dc-subscriber.d.ts +94 -0
  722. package/build/types-ts3.8/graphql/index.d.ts +12 -0
  723. package/build/types-ts3.8/graphql/utils.d.ts +36 -0
  724. package/build/types-ts3.8/index.d.ts +23 -0
  725. package/build/types-ts3.8/integrations/tracing-channel/amqplib.d.ts +11 -0
  726. package/build/types-ts3.8/integrations/tracing-channel/anthropic.d.ts +10 -0
  727. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/aws-sdk.types.d.ts +43 -0
  728. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/constants.d.ts +15 -0
  729. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/index.d.ts +15 -0
  730. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/MessageAttributes.d.ts +23 -0
  731. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/ServiceExtension.d.ts +9 -0
  732. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/ServicesExtensions.d.ts +10 -0
  733. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/bedrock-runtime.d.ts +14 -0
  734. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/dynamodb.d.ts +8 -0
  735. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/index.d.ts +2 -0
  736. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/kinesis.d.ts +6 -0
  737. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/lambda.d.ts +9 -0
  738. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/s3.d.ts +6 -0
  739. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/secretsmanager.d.ts +8 -0
  740. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/sns.d.ts +9 -0
  741. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/sqs.d.ts +9 -0
  742. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/stepfunctions.d.ts +6 -0
  743. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/types.d.ts +26 -0
  744. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/utils.d.ts +5 -0
  745. package/build/types-ts3.8/integrations/tracing-channel/dataloader.d.ts +11 -0
  746. package/build/types-ts3.8/integrations/tracing-channel/express/index.d.ts +18 -0
  747. package/build/types-ts3.8/integrations/tracing-channel/express/instrumentation.d.ts +4 -0
  748. package/build/types-ts3.8/integrations/tracing-channel/express/route.d.ts +28 -0
  749. package/build/types-ts3.8/integrations/tracing-channel/express/types.d.ts +64 -0
  750. package/build/types-ts3.8/integrations/tracing-channel/fastify/errors.d.ts +12 -0
  751. package/build/types-ts3.8/integrations/tracing-channel/fastify/index.d.ts +66 -0
  752. package/build/types-ts3.8/integrations/tracing-channel/fastify/instrumentation.d.ts +10 -0
  753. package/build/types-ts3.8/integrations/tracing-channel/fastify/types.d.ts +32 -0
  754. package/build/types-ts3.8/integrations/tracing-channel/fastify/utils.d.ts +9 -0
  755. package/build/types-ts3.8/integrations/tracing-channel/generic-pool.d.ts +10 -0
  756. package/build/types-ts3.8/integrations/tracing-channel/google-genai.d.ts +12 -0
  757. package/build/types-ts3.8/integrations/tracing-channel/graphql/constants.d.ts +12 -0
  758. package/build/types-ts3.8/integrations/tracing-channel/graphql/graphql-types.d.ts +135 -0
  759. package/build/types-ts3.8/integrations/tracing-channel/graphql/index.d.ts +30 -0
  760. package/build/types-ts3.8/integrations/tracing-channel/graphql/resolvers.d.ts +13 -0
  761. package/build/types-ts3.8/integrations/tracing-channel/graphql/spans.d.ts +17 -0
  762. package/build/types-ts3.8/integrations/tracing-channel/graphql/types.d.ts +25 -0
  763. package/build/types-ts3.8/integrations/tracing-channel/hapi-types.d.ts +65 -0
  764. package/build/types-ts3.8/integrations/tracing-channel/hapi-utils.d.ts +25 -0
  765. package/build/types-ts3.8/integrations/tracing-channel/hapi.d.ts +9 -0
  766. package/build/types-ts3.8/integrations/tracing-channel/ioredis.d.ts +37 -0
  767. package/build/types-ts3.8/integrations/tracing-channel/kafkajs/consumer.d.ts +8 -0
  768. package/build/types-ts3.8/integrations/tracing-channel/kafkajs/index.d.ts +17 -0
  769. package/build/types-ts3.8/integrations/tracing-channel/kafkajs/semconv.d.ts +10 -0
  770. package/build/types-ts3.8/integrations/tracing-channel/kafkajs/spans.d.ts +38 -0
  771. package/build/types-ts3.8/integrations/tracing-channel/kafkajs/types.d.ts +40 -0
  772. package/build/types-ts3.8/integrations/tracing-channel/knex.d.ts +11 -0
  773. package/build/types-ts3.8/integrations/tracing-channel/koa.d.ts +14 -0
  774. package/build/types-ts3.8/integrations/tracing-channel/langchain.d.ts +10 -0
  775. package/build/types-ts3.8/integrations/tracing-channel/langgraph.d.ts +10 -0
  776. package/build/types-ts3.8/integrations/tracing-channel/lru-memoizer.d.ts +10 -0
  777. package/build/types-ts3.8/integrations/tracing-channel/mongodb.d.ts +12 -0
  778. package/build/types-ts3.8/integrations/tracing-channel/mongoose.d.ts +15 -0
  779. package/build/types-ts3.8/integrations/tracing-channel/mysql.d.ts +12 -0
  780. package/build/types-ts3.8/integrations/tracing-channel/mysql2.d.ts +15 -0
  781. package/build/types-ts3.8/integrations/tracing-channel/openai.d.ts +10 -0
  782. package/build/types-ts3.8/integrations/tracing-channel/postgres-js.d.ts +26 -0
  783. package/build/types-ts3.8/integrations/tracing-channel/postgres.d.ts +15 -0
  784. package/build/types-ts3.8/integrations/tracing-channel/redis.d.ts +16 -0
  785. package/build/types-ts3.8/integrations/tracing-channel/tedious.d.ts +11 -0
  786. package/build/types-ts3.8/integrations/tracing-channel/vercel-ai.d.ts +13 -0
  787. package/build/types-ts3.8/mongodb/mongodb-span.d.ts +66 -0
  788. package/build/types-ts3.8/mongoose/index.d.ts +13 -0
  789. package/build/types-ts3.8/mongoose/mongoose-dc-subscriber.d.ts +63 -0
  790. package/build/types-ts3.8/mongoose/mongoose-legacy-span.d.ts +29 -0
  791. package/build/types-ts3.8/mysql2/index.d.ts +11 -0
  792. package/build/types-ts3.8/mysql2/mysql2-dc-subscriber.d.ts +59 -0
  793. package/build/types-ts3.8/node-diagnostics-channel.d.ts +19 -0
  794. package/build/types-ts3.8/orchestrion/bundler/esbuild.d.ts +21 -0
  795. package/build/types-ts3.8/orchestrion/bundler/options.d.ts +29 -0
  796. package/build/types-ts3.8/orchestrion/bundler/rollup.d.ts +17 -0
  797. package/build/types-ts3.8/orchestrion/bundler/vite.d.ts +18 -0
  798. package/build/types-ts3.8/orchestrion/bundler/webpack.d.ts +19 -0
  799. package/build/types-ts3.8/orchestrion/channels.d.ts +130 -0
  800. package/build/types-ts3.8/orchestrion/config/amqplib.d.ts +66 -0
  801. package/build/types-ts3.8/orchestrion/config/anthropic-ai.d.ts +31 -0
  802. package/build/types-ts3.8/orchestrion/config/aws-sdk.d.ts +19 -0
  803. package/build/types-ts3.8/orchestrion/config/dataloader.d.ts +46 -0
  804. package/build/types-ts3.8/orchestrion/config/express.d.ts +30 -0
  805. package/build/types-ts3.8/orchestrion/config/firebase.d.ts +4 -0
  806. package/build/types-ts3.8/orchestrion/config/generic-pool.d.ts +31 -0
  807. package/build/types-ts3.8/orchestrion/config/google-genai.d.ts +30 -0
  808. package/build/types-ts3.8/orchestrion/config/graphql.d.ts +29 -0
  809. package/build/types-ts3.8/orchestrion/config/hapi.d.ts +17 -0
  810. package/build/types-ts3.8/orchestrion/config/index.d.ts +37 -0
  811. package/build/types-ts3.8/orchestrion/config/ioredis.d.ts +7 -0
  812. package/build/types-ts3.8/orchestrion/config/kafkajs.d.ts +17 -0
  813. package/build/types-ts3.8/orchestrion/config/knex.d.ts +9 -0
  814. package/build/types-ts3.8/orchestrion/config/koa.d.ts +17 -0
  815. package/build/types-ts3.8/orchestrion/config/langchain.d.ts +18 -0
  816. package/build/types-ts3.8/orchestrion/config/langgraph.d.ts +21 -0
  817. package/build/types-ts3.8/orchestrion/config/lru-memoizer.d.ts +16 -0
  818. package/build/types-ts3.8/orchestrion/config/mongodb.d.ts +59 -0
  819. package/build/types-ts3.8/orchestrion/config/mongoose.d.ts +40 -0
  820. package/build/types-ts3.8/orchestrion/config/mysql.d.ts +16 -0
  821. package/build/types-ts3.8/orchestrion/config/mysql2.d.ts +18 -0
  822. package/build/types-ts3.8/orchestrion/config/nestjs.d.ts +24 -0
  823. package/build/types-ts3.8/orchestrion/config/openai.d.ts +18 -0
  824. package/build/types-ts3.8/orchestrion/config/pg.d.ts +33 -0
  825. package/build/types-ts3.8/orchestrion/config/postgres.d.ts +9 -0
  826. package/build/types-ts3.8/orchestrion/config/prisma.d.ts +4 -0
  827. package/build/types-ts3.8/orchestrion/config/react-router.d.ts +4 -0
  828. package/build/types-ts3.8/orchestrion/config/redis.d.ts +37 -0
  829. package/build/types-ts3.8/orchestrion/config/remix.d.ts +9 -0
  830. package/build/types-ts3.8/orchestrion/config/tedious.d.ts +12 -0
  831. package/build/types-ts3.8/orchestrion/config/vercel-ai.d.ts +12 -0
  832. package/build/types-ts3.8/orchestrion/detect.d.ts +26 -0
  833. package/build/types-ts3.8/orchestrion/index.d.ts +138 -0
  834. package/build/types-ts3.8/orchestrion/runtime/register.d.ts +25 -0
  835. package/build/types-ts3.8/prisma/global.d.ts +5 -0
  836. package/build/types-ts3.8/prisma/index.d.ts +45 -0
  837. package/build/types-ts3.8/prisma/tracing-helper.d.ts +52 -0
  838. package/build/types-ts3.8/prisma/types.d.ts +40 -0
  839. package/build/types-ts3.8/redis/index.d.ts +18 -0
  840. package/build/types-ts3.8/redis/redis-dc-subscriber.d.ts +89 -0
  841. package/build/types-ts3.8/redis/redis-statement-serializer.d.ts +6 -0
  842. package/build/types-ts3.8/tracing-channel.d.ts +73 -0
  843. package/build/types-ts3.8/vercel-ai/index.d.ts +27 -0
  844. package/build/types-ts3.8/vercel-ai/util.d.ts +30 -0
  845. package/build/types-ts3.8/vercel-ai/vercel-ai-dc-subscriber.d.ts +72 -0
  846. package/build/types-ts3.8/vercel-ai/vercel-ai-orchestrion-subscriber.d.ts +12 -0
  847. package/changes.json +14 -0
  848. package/package.json +189 -0
@@ -0,0 +1,397 @@
1
+ import { debug, isObjectLike, addNonEnumerableProperty, getActiveSpan, withActiveSpan, SPAN_STATUS_ERROR } from '@sentry/core';
2
+ import { DEBUG_BUILD } from '../debug-build.js';
3
+ import { CHANNELS } from '../orchestrion/channels.js';
4
+ import { bindTracingChannelToSpan } from '../tracing-channel.js';
5
+ import { enrichSpanOnEnd, clearOperationId, createSpanFromMessage, streamedResultToChannelResult, clearOperationCallId, captureToolError } from './vercel-ai-dc-subscriber.js';
6
+ import { asString, isReadableStream, tapModelCallStream } from './util.js';
7
+
8
+ const PATCHED = /* @__PURE__ */ Symbol("SentryVercelAiModelPatched");
9
+ const TOOL_PATCHED = /* @__PURE__ */ Symbol("SentryVercelAiToolPatched");
10
+ let callIdCounter = 0;
11
+ function nextCallId() {
12
+ return `v6-${++callIdCounter}`;
13
+ }
14
+ const messages = /* @__PURE__ */ new WeakMap();
15
+ const operationSpans = /* @__PURE__ */ new WeakSet();
16
+ const toolCallSpans = /* @__PURE__ */ new WeakSet();
17
+ const callIdBySpan = /* @__PURE__ */ new WeakMap();
18
+ const recordingBySpan = /* @__PURE__ */ new WeakMap();
19
+ const operationErrorInfoBySpan = /* @__PURE__ */ new WeakMap();
20
+ const suppressedTelemetry = /* @__PURE__ */ new WeakSet();
21
+ let subscribed = false;
22
+ function subscribeVercelAiOrchestrionChannels(tracingChannel, options = {}) {
23
+ if (subscribed) {
24
+ return;
25
+ }
26
+ subscribed = true;
27
+ try {
28
+ bindOperation(tracingChannel, CHANNELS.VERCEL_AI_GENERATE_TEXT, buildTextMessage("generateText"), options);
29
+ bindOperation(tracingChannel, CHANNELS.VERCEL_AI_STREAM_TEXT, buildTextMessage("streamText"), options);
30
+ bindOperation(tracingChannel, CHANNELS.VERCEL_AI_GENERATE_OBJECT, buildTextMessage("generateObject"), options);
31
+ bindOperation(
32
+ tracingChannel,
33
+ CHANNELS.VERCEL_AI_EMBED,
34
+ (callOptions, telemetry) => ({
35
+ type: "embed",
36
+ event: {
37
+ callId: nextCallId(),
38
+ ...modelFields(callOptions.model),
39
+ maxRetries: callOptions.maxRetries,
40
+ value: callOptions.value,
41
+ ...recording(telemetry)
42
+ }
43
+ }),
44
+ options
45
+ );
46
+ bindOperation(
47
+ tracingChannel,
48
+ CHANNELS.VERCEL_AI_EMBED_MANY,
49
+ // `embedMany` takes a `values` array (vs `embed`'s single `value`); the shared core reads it as the
50
+ // embeddings input, matching the OTel path's batch `ai.embedMany` span.
51
+ (callOptions, telemetry) => ({
52
+ type: "embedMany",
53
+ event: {
54
+ callId: nextCallId(),
55
+ ...modelFields(callOptions.model),
56
+ maxRetries: callOptions.maxRetries,
57
+ values: callOptions.values,
58
+ ...recording(telemetry)
59
+ }
60
+ }),
61
+ options
62
+ );
63
+ bindOperation(
64
+ tracingChannel,
65
+ CHANNELS.VERCEL_AI_EXECUTE_TOOL_CALL,
66
+ (callOptions, telemetry) => ({
67
+ type: "executeTool",
68
+ // v6 carries the tool definitions on the executeToolCall args (a record keyed by name);
69
+ // the shared core reads the matching tool's `description` for the span.
70
+ event: {
71
+ callId: nextCallId(),
72
+ toolCall: callOptions.toolCall,
73
+ tools: callOptions.tools,
74
+ ...recording(telemetry)
75
+ }
76
+ }),
77
+ options
78
+ );
79
+ subscribeResolveLanguageModel(tracingChannel, CHANNELS.VERCEL_AI_RESOLVE_LANGUAGE_MODEL, options);
80
+ } catch {
81
+ DEBUG_BUILD && debug.log("Vercel AI orchestrion channel subscription failed.");
82
+ }
83
+ }
84
+ function bindOperation(tracingChannel, channelName, build, options) {
85
+ const channel = tracingChannel(channelName);
86
+ const buildOperationSpan = (data) => {
87
+ const callOptions = isObjectLike(data.arguments[0]) ? data.arguments[0] : {};
88
+ const telemetry = isObjectLike(callOptions.experimental_telemetry) ? callOptions.experimental_telemetry : {};
89
+ if (telemetry.isEnabled === false && !suppressedTelemetry.has(telemetry)) {
90
+ return void 0;
91
+ }
92
+ const message = build(callOptions, telemetry);
93
+ suppressNativeTelemetry(callOptions, telemetry);
94
+ const callSiteSpan = getActiveSpan();
95
+ const span = createSpanFromMessage(message, options);
96
+ if (span) {
97
+ messages.set(data, message);
98
+ operationSpans.add(span);
99
+ const isV4 = isObjectLike(callOptions.model) && callOptions.model.specificationVersion === "v1";
100
+ operationErrorInfoBySpan.set(span, { callSiteSpan, toolErrorsBubbleToCaller: isV4 });
101
+ if (message.type === "executeTool") {
102
+ toolCallSpans.add(span);
103
+ }
104
+ const callId = asString(message.event.callId);
105
+ if (callId) {
106
+ callIdBySpan.set(span, callId);
107
+ }
108
+ recordingBySpan.set(span, recording(telemetry));
109
+ if (isObjectLike(callOptions.tools)) {
110
+ patchOperationTools(callOptions.tools, options);
111
+ }
112
+ if (isV4) {
113
+ patchModelMethods(callOptions.model, options);
114
+ }
115
+ }
116
+ return span;
117
+ };
118
+ bindTracingChannelToSpan(
119
+ channel,
120
+ (data) => buildOperationSpan(data),
121
+ {
122
+ beforeSpanEnd: (span, data) => {
123
+ const message = messages.get(data);
124
+ if (!message) {
125
+ return;
126
+ }
127
+ if ("error" in data) {
128
+ const callSiteSpan = operationErrorInfoBySpan.get(span)?.callSiteSpan;
129
+ if (callSiteSpan && isObjectLike(data.error)) {
130
+ addNonEnumerableProperty(data.error, "_sentry_active_span", callSiteSpan);
131
+ }
132
+ } else {
133
+ message.result = message.type === "executeTool" ? { output: data.result } : data.result;
134
+ enrichSpanOnEnd(span, message, options);
135
+ }
136
+ if (message.type !== "streamText") {
137
+ clearOperationId(message);
138
+ }
139
+ messages.delete(data);
140
+ },
141
+ // `streamText` returns synchronously, so its operation span would otherwise end before the stream
142
+ // drains — losing the aggregate usage/output. Defer the end and await the result's completion
143
+ // promises (`totalUsage`/`text`/…, which resolve on drain), mirroring how v7's channel defers the
144
+ // operation span on the SDK's total-usage promise.
145
+ deferSpanEnd: ({ data, end }) => deferStreamTextOperationEnd(data, end)
146
+ }
147
+ );
148
+ }
149
+ function deferStreamTextOperationEnd(data, end) {
150
+ if (messages.get(data)?.type !== "streamText" || "error" in data || !isStreamingResult(data.result)) {
151
+ return false;
152
+ }
153
+ const streamResult = data.result;
154
+ void (async () => {
155
+ try {
156
+ const [usage, text, toolCalls, finishReason, response] = await Promise.all([
157
+ streamResult.totalUsage ?? streamResult.usage,
158
+ streamResult.text,
159
+ streamResult.toolCalls,
160
+ streamResult.finishReason,
161
+ streamResult.response
162
+ ]);
163
+ data.result = { usage, text, toolCalls, finishReason, response };
164
+ end();
165
+ } catch (error) {
166
+ end(error);
167
+ }
168
+ })();
169
+ return true;
170
+ }
171
+ function isStreamingResult(result) {
172
+ return isObjectLike(result) && (isThenable(result.totalUsage) || isThenable(result.usage));
173
+ }
174
+ function isThenable(value) {
175
+ return isObjectLike(value) && typeof value.then === "function";
176
+ }
177
+ function suppressNativeTelemetry(callOptions, telemetry) {
178
+ if (telemetry.isEnabled !== true) {
179
+ return;
180
+ }
181
+ const suppressed = { ...telemetry, isEnabled: false };
182
+ suppressedTelemetry.add(suppressed);
183
+ callOptions.experimental_telemetry = suppressed;
184
+ }
185
+ function subscribeResolveLanguageModel(tracingChannel, channelName, options) {
186
+ tracingChannel(channelName).subscribe({
187
+ end(rawCtx) {
188
+ const ctx = rawCtx;
189
+ if (!isObjectLike(ctx.result)) {
190
+ return;
191
+ }
192
+ patchModelMethods(ctx.result, options);
193
+ },
194
+ start() {
195
+ },
196
+ asyncStart() {
197
+ },
198
+ asyncEnd() {
199
+ },
200
+ error() {
201
+ }
202
+ });
203
+ }
204
+ function resolveModelCallParent() {
205
+ const active = getActiveSpan();
206
+ return active && operationSpans.has(active) ? active : void 0;
207
+ }
208
+ function patchModelMethods(model, options) {
209
+ if (model[PATCHED]) {
210
+ return;
211
+ }
212
+ model[PATCHED] = true;
213
+ patchModelMethod(model, "doGenerate", options);
214
+ patchModelMethod(model, "doStream", options);
215
+ }
216
+ function patchModelMethod(model, method, options) {
217
+ const original = model[method];
218
+ if (typeof original !== "function") {
219
+ return;
220
+ }
221
+ model[method] = function(...args) {
222
+ const parent = resolveModelCallParent();
223
+ if (!parent) {
224
+ return Promise.resolve(original.apply(this, args));
225
+ }
226
+ const callArgs = isObjectLike(args[0]) ? args[0] : {};
227
+ const callId = callIdBySpan.get(parent);
228
+ const message = {
229
+ type: "languageModelCall",
230
+ event: {
231
+ callId,
232
+ provider: model.provider,
233
+ modelId: model.modelId,
234
+ // v4 nests the tool list under `mode.tools` (the `LanguageModelV1` call shape); v5+ passes a
235
+ // top-level `tools` array. Reading both keeps `available_tools` populated on the model-call span.
236
+ tools: callArgs.tools ?? (isObjectLike(callArgs.mode) ? callArgs.mode.tools : void 0),
237
+ messages: callArgs.prompt,
238
+ // Inherit the enclosing operation's per-call recording flags so inputs/tools/outputs are recorded on
239
+ // the model-call span whenever they are on the parent `invoke_agent` span.
240
+ ...recordingBySpan.get(parent)
241
+ }
242
+ };
243
+ const span = withActiveSpan(parent, () => createSpanFromMessage(message, options));
244
+ if (!span) {
245
+ return Promise.resolve(original.apply(this, args));
246
+ }
247
+ const clearStreamCallId = () => {
248
+ if (method === "doStream" && callId) {
249
+ clearOperationCallId(callId);
250
+ }
251
+ };
252
+ const failSpan = (error) => {
253
+ span.setStatus({ code: SPAN_STATUS_ERROR, message: error instanceof Error ? error.message : "unknown_error" });
254
+ span.end();
255
+ clearStreamCallId();
256
+ throw error;
257
+ };
258
+ try {
259
+ const result = Promise.resolve(original.apply(this, args));
260
+ return result.then((value) => {
261
+ if (method === "doStream" && isObjectLike(value) && isReadableStream(value.stream)) {
262
+ value.stream = tapModelCallStream(
263
+ value.stream,
264
+ (final) => {
265
+ message.result = { ...value, ...streamedResultToChannelResult(final) };
266
+ enrichSpanOnEnd(span, message, options);
267
+ span.end();
268
+ clearStreamCallId();
269
+ },
270
+ (error) => {
271
+ span.setStatus({
272
+ code: SPAN_STATUS_ERROR,
273
+ message: error instanceof Error ? error.message : "unknown_error"
274
+ });
275
+ span.end();
276
+ clearStreamCallId();
277
+ }
278
+ );
279
+ return value;
280
+ }
281
+ message.result = value;
282
+ enrichSpanOnEnd(span, message, options);
283
+ span.end();
284
+ clearStreamCallId();
285
+ return value;
286
+ }, failSpan);
287
+ } catch (error) {
288
+ return failSpan(error);
289
+ }
290
+ };
291
+ }
292
+ function patchOperationTools(tools, options) {
293
+ try {
294
+ for (const [toolName, tool] of Object.entries(tools)) {
295
+ if (isObjectLike(tool)) {
296
+ patchToolExecute(toolName, tool, tools, options);
297
+ }
298
+ }
299
+ } catch {
300
+ DEBUG_BUILD && debug.log("Vercel AI orchestrion tool patching failed.");
301
+ }
302
+ }
303
+ function patchToolExecute(toolName, tool, tools, options) {
304
+ const original = tool.execute;
305
+ if (typeof original !== "function" || tool[TOOL_PATCHED]) {
306
+ return;
307
+ }
308
+ tool[TOOL_PATCHED] = true;
309
+ tool.execute = function(input, ...rest) {
310
+ const parent = resolveModelCallParent();
311
+ if (!parent || toolCallSpans.has(parent)) {
312
+ return original.apply(this, [input, ...rest]);
313
+ }
314
+ const callOptions = isObjectLike(rest[0]) ? rest[0] : {};
315
+ const message = {
316
+ type: "executeTool",
317
+ event: {
318
+ callId: callIdBySpan.get(parent),
319
+ toolCall: { toolName, toolCallId: asString(callOptions.toolCallId), input },
320
+ // The `tools` record (keyed by name) lets the shared core backfill the tool's `description`.
321
+ tools,
322
+ // Inherit the enclosing operation's per-call recording flags so tool inputs/outputs are recorded
323
+ // whenever they are on the parent `invoke_agent` span.
324
+ ...recordingBySpan.get(parent)
325
+ }
326
+ };
327
+ const span = withActiveSpan(parent, () => createSpanFromMessage(message, options));
328
+ if (!span) {
329
+ return original.apply(this, [input, ...rest]);
330
+ }
331
+ const failSpan = (error) => {
332
+ if (operationErrorInfoBySpan.get(parent)?.toolErrorsBubbleToCaller) {
333
+ span.setStatus({ code: SPAN_STATUS_ERROR, message: error instanceof Error ? error.message : "tool_error" });
334
+ } else {
335
+ captureToolError(span, message, error);
336
+ }
337
+ span.end();
338
+ throw error;
339
+ };
340
+ try {
341
+ const result = Promise.resolve(original.apply(this, [input, ...rest]));
342
+ return result.then((value) => {
343
+ message.result = { output: value };
344
+ enrichSpanOnEnd(span, message, options);
345
+ span.end();
346
+ return value;
347
+ }, failSpan);
348
+ } catch (error) {
349
+ return failSpan(error);
350
+ }
351
+ };
352
+ }
353
+ function buildTextMessage(type) {
354
+ return (options, telemetry) => ({
355
+ type,
356
+ event: {
357
+ callId: nextCallId(),
358
+ operationId: `ai.${type}`,
359
+ functionId: asString(telemetry.functionId),
360
+ ...modelFields(options.model),
361
+ maxRetries: options.maxRetries,
362
+ // The `ai` SDK takes the system prompt as a top-level `system` option (all of v4/v5/v6); the
363
+ // shared core lifts `event.instructions` into the system-instructions attribute, matching v7's
364
+ // native channel (which carries it as a distinct field rather than inside the messages array).
365
+ instructions: asString(options.system),
366
+ // Normalize to the message-array shape the shared core (and v7's channel) expects: a bare string
367
+ // `prompt` becomes a single user message, matching the SDK's own normalization.
368
+ messages: normalizePromptMessages(options),
369
+ ...recording(telemetry)
370
+ }
371
+ });
372
+ }
373
+ function normalizePromptMessages(options) {
374
+ if (Array.isArray(options.messages)) {
375
+ return options.messages;
376
+ }
377
+ if (typeof options.prompt === "string") {
378
+ return [{ role: "user", content: options.prompt }];
379
+ }
380
+ return options.messages ?? options.prompt;
381
+ }
382
+ function recording(telemetry) {
383
+ const enabledDefault = telemetry.isEnabled === true ? true : void 0;
384
+ return {
385
+ recordInputs: telemetry.recordInputs ?? enabledDefault,
386
+ recordOutputs: telemetry.recordOutputs ?? enabledDefault
387
+ };
388
+ }
389
+ function modelFields(model) {
390
+ return { provider: modelField(model, "provider"), modelId: modelField(model, "modelId") };
391
+ }
392
+ function modelField(model, field) {
393
+ return isObjectLike(model) ? asString(model[field]) : void 0;
394
+ }
395
+
396
+ export { subscribeVercelAiOrchestrionChannels };
397
+ //# sourceMappingURL=vercel-ai-orchestrion-subscriber.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vercel-ai-orchestrion-subscriber.js","sources":["../../../src/vercel-ai/vercel-ai-orchestrion-subscriber.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport type { Span } from '@sentry/core';\nimport {\n addNonEnumerableProperty,\n debug,\n getActiveSpan,\n isObjectLike,\n SPAN_STATUS_ERROR,\n withActiveSpan,\n} from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { CHANNELS } from '../orchestrion/channels';\nimport { bindTracingChannelToSpan, type TracingChannelPayloadWithSpan } from '../tracing-channel';\nimport {\n captureToolError,\n clearOperationCallId,\n clearOperationId,\n createSpanFromMessage,\n enrichSpanOnEnd,\n streamedResultToChannelResult,\n type VercelAiChannelMessage,\n type VercelAiChannelOptions,\n type VercelAiTracingChannelFactory,\n} from './vercel-ai-dc-subscriber';\nimport { asString, isReadableStream, tapModelCallStream } from './util';\n\n/**\n * v4, v5 & v6 channel adapter for the Vercel AI (`ai`) SDK.\n *\n * `ai` >= 7 publishes a normalized `ai:telemetry` tracing channel natively\n * (consumed by `subscribeVercelAiTracingChannel`). v4/v5/v6 have no such channel, so\n * orchestrion injects `orchestrion:ai:*` channels around the top-level\n * functions (see `orchestrion/config/index.ts`). The injected channels carry only the\n * wrapped call's `{ arguments, result, error }` — NOT v7's normalized `event`\n * object — so this adapter reconstructs an equivalent {@link VercelAiChannelMessage}\n * from each version's argument/result shapes and delegates to the SAME span-building core\n * (`createSpanFromMessage` / `enrichSpanOnEnd`) the v7 subscriber uses, so the\n * emitted spans are identical between v4, v5, v6 and v7. The shared core reads both v4-style\n * (`promptTokens`/`completionTokens`) and v5+-style (`inputTokens`/`outputTokens`) token names.\n *\n * The model call (`languageModelCall` / `generate_content` span) has no\n * injectable definition in `ai`. On v5/v6 we wrap `resolveLanguageModel` (the\n * single chokepoint every model call flows through) and monkey-patch\n * `doGenerate`/`doStream` on the returned model. v4 has no `resolveLanguageModel`\n * — the passed `LanguageModelV1` (`specificationVersion: 'v1'`) is called directly —\n * so we patch its `doGenerate`/`doStream` at the operation start instead (see\n * `buildOperationSpan`), gated on `'v1'` so it never touches v5/v6 models.\n *\n * Tool-call spans differ by version: v6 exposes a per-call `executeToolCall`\n * function orchestrion wraps into its own channel. v4/v5 have no such export (only a\n * batch `executeTools`), so instead we monkey-patch each tool's `execute` from\n * the operation's `tools`. On v6 that patch is inert: `executeToolCall` runs\n * `execute` inside its own tool-call span (the active async context), so the\n * patch sees that span as its parent and skips — only v4/v5 (where the parent is\n * the enclosing `invoke_agent` span) emit the patched span, so v6 never\n * double-counts tool spans.\n */\n\n/** Shape orchestrion's transform attaches to the tracing-channel context. */\ninterface OrchestrionContext {\n arguments: unknown[];\n result?: unknown;\n error?: unknown;\n}\n\n/** Builds the normalized message for a channel from the wrapped call's first-arg options. */\ntype MessageBuilder = (options: Record<string, unknown>, telemetry: Record<string, unknown>) => VercelAiChannelMessage;\n\n/** A resolved `ai` language model — has `doGenerate`/`doStream` and identity fields. */\ninterface ResolvedModel {\n modelId?: string;\n provider?: string;\n doGenerate?: (...args: unknown[]) => Promise<unknown>;\n doStream?: (...args: unknown[]) => Promise<unknown>;\n}\n\nconst PATCHED = Symbol('SentryVercelAiModelPatched');\nconst TOOL_PATCHED = Symbol('SentryVercelAiToolPatched');\n\n/** A resolved model with our patch bookkeeping (idempotency flag). */\ntype PatchableModel = ResolvedModel & { [PATCHED]?: boolean };\n\n/** A tool definition off an operation's `tools`, with our patch bookkeeping. */\ntype PatchableTool = { execute?: (...args: unknown[]) => unknown; [TOOL_PATCHED]?: boolean };\n\n// Per-operation correlation id. No Date/random (unavailable / non-deterministic) — a counter is enough.\nlet callIdCounter = 0;\nfunction nextCallId(): string {\n return `v6-${++callIdCounter}`;\n}\n\n// The message built on `start` for each operation, keyed by the (stable-identity) channel context, so\n// the `beforeSpanEnd` handler can enrich the span from the settled result and clear the `callId` maps.\nconst messages = new WeakMap<object, VercelAiChannelMessage>();\n// The spans we opened for top-level operations, and each one's `callId`. A model call resolves its\n// parent against this set (so it never mis-attributes to the enclosing `main`/user span) and reads the\n// parent's `callId` so its span can be named after the operation (e.g. `ai.streamText.doStream`).\nconst operationSpans = new WeakSet<Span>();\n// Tool-call spans — only v6's `executeToolCall` channel opens these. The v5 tool-`execute` patch\n// consults this to avoid double-counting: `executeToolCall` runs `execute` inside its span (which is\n// therefore the active parent), so a resolved parent in this set means v6 already spanned the call.\nconst toolCallSpans = new WeakSet<Span>();\nconst callIdBySpan = new WeakMap<Span, string>();\n// The operation's per-call recording flags (`experimental_telemetry.recordInputs/recordOutputs`), keyed by\n// its span. A model call carries no telemetry of its own, so it inherits the enclosing operation's flags —\n// otherwise a per-call `recordInputs: true` would record inputs on the `invoke_agent` span but not on the\n// child `generate_content` span (whose event would fall back to the global default). v7's channel forwards\n// these flags on every event, so this keeps v6 identical.\nconst recordingBySpan = new WeakMap<Span, ReturnType<typeof recording>>();\ninterface OperationErrorInfo {\n // The span active when the operation was invoked (its call site, e.g. the enclosing request/`main` span).\n // When an operation's error bubbles out unhandled it reaches the global handler outside any span, so — as\n // the OTel path does — we stamp this span onto the error (in `beforeSpanEnd`) so the unhandled-rejection\n // handler can restore it and correlate the captured error to the operation's trace.\n callSiteSpan: Span | undefined;\n // Whether a thrown tool error bubbles out of the `ai` call (v4). On v4 a tool-`execute` rejection is\n // wrapped in `AI_ToolExecutionError` and re-thrown, so it reaches the user's own error handling (or our\n // global handlers) — capturing it at the tool span too would double-report it, matching how the OTel path\n // leaves v4 tool errors to bubble. On v5 `executeTools` swallows the rejection into `tool-error` content,\n // so it never surfaces and we must capture it ourselves (see `failSpan`).\n toolErrorsBubbleToCaller: boolean;\n}\n// Per-operation error-handling info, keyed by the operation span (see `OperationErrorInfo`).\nconst operationErrorInfoBySpan = new WeakMap<Span, OperationErrorInfo>();\n\n// The `experimental_telemetry` objects we swapped in to suppress `ai`'s native OTel spans (see\n// `suppressNativeTelemetry`). Our skip logic treats `isEnabled === false` as \"user disabled telemetry,\n// emit no span\"; without this set, a call whose options object we already neutralized — or a user-shared\n// telemetry object we replaced on a prior call — would be misread as user-disabled and lose its span.\nconst suppressedTelemetry = new WeakSet<object>();\n\nlet subscribed = false;\n\n/**\n * Subscribe the v6 orchestrion channel adapter. Safe to always call: inert on\n * `ai` >= 7 (those channels are never published) and when orchestrion injection\n * isn't active. Idempotent.\n *\n * `tracingChannel` is the platform-provided factory (the same one passed to\n * `subscribeVercelAiTracingChannel`); `options` pins the recording settings at\n * subscribe time so we never look the integration up per event.\n */\nexport function subscribeVercelAiOrchestrionChannels(\n tracingChannel: VercelAiTracingChannelFactory,\n options: VercelAiChannelOptions = {},\n): void {\n if (subscribed) {\n return;\n }\n subscribed = true;\n\n try {\n bindOperation(tracingChannel, CHANNELS.VERCEL_AI_GENERATE_TEXT, buildTextMessage('generateText'), options);\n bindOperation(tracingChannel, CHANNELS.VERCEL_AI_STREAM_TEXT, buildTextMessage('streamText'), options);\n bindOperation(tracingChannel, CHANNELS.VERCEL_AI_GENERATE_OBJECT, buildTextMessage('generateObject'), options);\n bindOperation(\n tracingChannel,\n CHANNELS.VERCEL_AI_EMBED,\n (callOptions, telemetry) => ({\n type: 'embed',\n event: {\n callId: nextCallId(),\n ...modelFields(callOptions.model),\n maxRetries: callOptions.maxRetries,\n value: callOptions.value,\n ...recording(telemetry),\n },\n }),\n options,\n );\n bindOperation(\n tracingChannel,\n CHANNELS.VERCEL_AI_EMBED_MANY,\n // `embedMany` takes a `values` array (vs `embed`'s single `value`); the shared core reads it as the\n // embeddings input, matching the OTel path's batch `ai.embedMany` span.\n (callOptions, telemetry) => ({\n type: 'embedMany',\n event: {\n callId: nextCallId(),\n ...modelFields(callOptions.model),\n maxRetries: callOptions.maxRetries,\n values: callOptions.values,\n ...recording(telemetry),\n },\n }),\n options,\n );\n bindOperation(\n tracingChannel,\n CHANNELS.VERCEL_AI_EXECUTE_TOOL_CALL,\n (callOptions, telemetry) => ({\n type: 'executeTool',\n // v6 carries the tool definitions on the executeToolCall args (a record keyed by name);\n // the shared core reads the matching tool's `description` for the span.\n event: {\n callId: nextCallId(),\n toolCall: callOptions.toolCall,\n tools: callOptions.tools,\n ...recording(telemetry),\n },\n }),\n options,\n );\n subscribeResolveLanguageModel(tracingChannel, CHANNELS.VERCEL_AI_RESOLVE_LANGUAGE_MODEL, options);\n } catch {\n DEBUG_BUILD && debug.log('Vercel AI orchestrion channel subscription failed.');\n }\n}\n\n/**\n * Bind one operation channel: `getSpan` opens a span from the message reconstructed out of the wrapped\n * call's first argument; `beforeSpanEnd` enriches it from the settled result (tokens, output messages,\n * finish reasons, …) before the helper ends the span.\n *\n * An operation whose `experimental_telemetry.isEnabled` is explicitly `false` is skipped entirely (no\n * span): the orchestrion channel fires regardless of that flag, whereas v7's native `ai:telemetry`\n * channel is simply not published in that case — so we reproduce v7's \"no telemetry → no span\".\n */\nfunction bindOperation(\n tracingChannel: VercelAiTracingChannelFactory,\n channelName: string,\n build: MessageBuilder,\n options: VercelAiChannelOptions,\n): void {\n const channel = tracingChannel<OrchestrionContext>(channelName);\n\n // Build the operation span from the wrapped call's first argument and track it (so a model call can\n // resolve it as its parent). `bindTracingChannelToSpan` calls this once at channel `start` and makes\n // the returned span the active async context for the operation's duration — that active span is what\n // `resolveModelCallParent` reads. It also sets `data._sentrySpan`, so we don't here.\n const buildOperationSpan = (data: TracingChannelPayloadWithSpan<OrchestrionContext>): Span | undefined => {\n const callOptions = isObjectLike(data.arguments[0]) ? data.arguments[0] : {};\n const telemetry = isObjectLike(callOptions.experimental_telemetry) ? callOptions.experimental_telemetry : {};\n // `isEnabled === false` means the user opted out — emit no span. But `isEnabled` is also `false` on\n // the telemetry object we swap in to suppress native spans, so don't mistake our own object for a\n // user opt-out (which would drop the span on a call whose options we already neutralized).\n if (telemetry.isEnabled === false && !suppressedTelemetry.has(telemetry)) {\n return undefined;\n }\n const message = build(callOptions, telemetry);\n // Stop `ai` from emitting its own native OTel spans for this call — we build the equivalent spans\n // from the channels, so the SDK's would be duplicates. Reads above have already captured everything\n // we need off `telemetry`.\n suppressNativeTelemetry(callOptions, telemetry);\n // The span active here is the operation's call site — `bindTracingChannelToSpan` only makes the\n // operation span active *after* this returns — so this is the span we later restore for a bubbled error.\n const callSiteSpan = getActiveSpan();\n const span = createSpanFromMessage(message, options);\n if (span) {\n messages.set(data, message);\n operationSpans.add(span);\n // `'v1'` models are v4 (v5/v6 are `'v2'`), where a thrown tool error bubbles out of the call rather\n // than being swallowed into `tool-error` content — so its tool spans must not self-capture the error.\n const isV4 = isObjectLike(callOptions.model) && callOptions.model.specificationVersion === 'v1';\n operationErrorInfoBySpan.set(span, { callSiteSpan, toolErrorsBubbleToCaller: isV4 });\n // v6's `executeToolCall` span: tracked so the v5 tool-`execute` patch can recognize (and skip)\n // tool calls it runs, since that patch sees this span as its active parent (see `patchToolExecute`).\n if (message.type === 'executeTool') {\n toolCallSpans.add(span);\n }\n const callId = asString(message.event.callId);\n if (callId) {\n callIdBySpan.set(span, callId);\n }\n recordingBySpan.set(span, recording(telemetry));\n // v5 has no `executeToolCall` channel, so patch each tool's `execute` to emit the tool-call span.\n // Inert on v6 (guarded inside `patchToolExecute` when the parent is `executeToolCall`'s own span).\n if (isObjectLike(callOptions.tools)) {\n patchOperationTools(callOptions.tools, options);\n }\n // v4 has no `resolveLanguageModel` chokepoint — the passed `LanguageModelV1` is called directly — so\n // patch its `doGenerate`/`doStream` here, at the operation start, instead. v5/v6 models are patched via\n // `resolveLanguageModel`, so restricting to v4 keeps this strictly additive and avoids double-patching.\n // Embedding models are also `'v1'` but expose no `doGenerate`/`doStream`, so the patch is a no-op for\n // `embed`/`embedMany`.\n if (isV4) {\n patchModelMethods(callOptions.model as PatchableModel, options);\n }\n }\n return span;\n };\n\n bindTracingChannelToSpan(\n channel,\n (data: TracingChannelPayloadWithSpan<OrchestrionContext>) => buildOperationSpan(data),\n {\n beforeSpanEnd: (span, data) => {\n const message = messages.get(data);\n if (!message) {\n return;\n }\n // The helper's `error` handler already set the span status; only enrich from a successful result.\n if ('error' in data) {\n // The error bubbles out of the `ai` call. If nothing handles it before our global handler, that\n // handler runs outside any span — so stamp the operation's call-site span onto the error, letting\n // the unhandled-rejection handler restore it and correlate the report to this trace. This mirrors\n // the OTel path; it's a no-op when the error is handled earlier (e.g. a framework error handler).\n const callSiteSpan = operationErrorInfoBySpan.get(span)?.callSiteSpan;\n if (callSiteSpan && isObjectLike(data.error)) {\n addNonEnumerableProperty(data.error, '_sentry_active_span', callSiteSpan);\n }\n } else {\n // v6's `executeToolCall` returns the tool result/error object directly, whereas the shared core\n // (matching v7) expects it nested under `output`; wrap it so tool-error detection works.\n message.result = message.type === 'executeTool' ? { output: data.result } : data.result;\n enrichSpanOnEnd(span, message, options);\n }\n // A `streamText` model call runs after this (synchronously-returning) operation's span has\n // already ended, so its `callId` entry must outlive the operation — it's cleared once the model\n // call settles (see `patchModelMethod`). Every other operation can clear here.\n if (message.type !== 'streamText') {\n clearOperationId(message);\n }\n messages.delete(data);\n },\n // `streamText` returns synchronously, so its operation span would otherwise end before the stream\n // drains — losing the aggregate usage/output. Defer the end and await the result's completion\n // promises (`totalUsage`/`text`/…, which resolve on drain), mirroring how v7's channel defers the\n // operation span on the SDK's total-usage promise.\n deferSpanEnd: ({ data, end }) => deferStreamTextOperationEnd(data, end),\n },\n );\n}\n\n/**\n * Keep a streamed `streamText` operation span open until the stream drains, then enrich it from the\n * `StreamTextResult`'s completion promises (usage/output/finish reason) and end it. Returns `false` for\n * anything that isn't a streamed `streamText` result, so the helper ends the span as usual.\n */\nfunction deferStreamTextOperationEnd(\n data: TracingChannelPayloadWithSpan<OrchestrionContext>,\n end: (error?: unknown) => void,\n): boolean {\n if (messages.get(data)?.type !== 'streamText' || 'error' in data || !isStreamingResult(data.result)) {\n return false;\n }\n\n const streamResult = data.result;\n void (async () => {\n try {\n const [usage, text, toolCalls, finishReason, response] = await Promise.all([\n streamResult.totalUsage ?? streamResult.usage,\n streamResult.text,\n streamResult.toolCalls,\n streamResult.finishReason,\n streamResult.response,\n ]);\n // Feed the resolved values back through the shared enrichment: `beforeSpanEnd` reads `data.result`.\n data.result = { usage, text, toolCalls, finishReason, response };\n end();\n } catch (error) {\n end(error);\n }\n })();\n\n return true;\n}\n\n/** A `StreamTextResult` exposes its aggregates as promises (`totalUsage`/`usage`); a settled result does not. */\nfunction isStreamingResult(result: unknown): result is Record<string, PromiseLike<unknown> | undefined> {\n return isObjectLike(result) && (isThenable(result.totalUsage) || isThenable(result.usage));\n}\n\nfunction isThenable(value: unknown): boolean {\n return isObjectLike(value) && typeof value.then === 'function';\n}\n\n/**\n * Neutralize `ai`'s native OpenTelemetry instrumentation for this call by pointing\n * `experimental_telemetry` at a copy with `isEnabled: false`. `ai`'s `getTracer` then returns its\n * internal no-op tracer, so it never creates (nor sets active) the duplicate `ai.*` spans we'd\n * otherwise have to drop.\n *\n * Only a call that explicitly enabled telemetry emits native spans — otherwise `ai` already uses its\n * no-op tracer, so there's nothing to suppress and we leave the user's options untouched. When\n * `isEnabled === true`, `telemetry` is `callOptions.experimental_telemetry` and `callOptions` is the\n * real first argument the SDK will read, so the reassignment takes effect for the wrapped call. We\n * replace rather than mutate in place, so a telemetry object the user shares across calls keeps its own\n * `isEnabled: true`; the replacement is tracked in `suppressedTelemetry` so our skip logic doesn't\n * later read it back as a user opt-out.\n */\nfunction suppressNativeTelemetry(callOptions: Record<string, unknown>, telemetry: Record<string, unknown>): void {\n if (telemetry.isEnabled !== true) {\n return;\n }\n const suppressed = { ...telemetry, isEnabled: false };\n suppressedTelemetry.add(suppressed);\n callOptions.experimental_telemetry = suppressed;\n}\n\n/**\n * `resolveLanguageModel` returns the model every call flows through. We don't span it — on `end` we\n * monkey-patch `doGenerate`/`doStream` on the returned model so each invocation produces a\n * `languageModelCall` span parented to the enclosing invoke_agent span.\n */\nfunction subscribeResolveLanguageModel(\n tracingChannel: VercelAiTracingChannelFactory,\n channelName: string,\n options: VercelAiChannelOptions,\n): void {\n tracingChannel<OrchestrionContext>(channelName).subscribe({\n end(rawCtx) {\n const ctx = rawCtx as OrchestrionContext;\n if (!isObjectLike(ctx.result)) {\n return;\n }\n // Patch the model's `doGenerate`/`doStream` once. The model call recovers its parent from the\n // active async context at call time (the operation span `bindTracingChannelToSpan` bound), which\n // propagates into the model call for `streamText` too, so there is nothing to capture on the model here.\n patchModelMethods(ctx.result as PatchableModel, options);\n },\n start() {\n /* no-op */\n },\n asyncStart() {\n /* no-op */\n },\n asyncEnd() {\n /* no-op */\n },\n error() {\n /* no-op */\n },\n });\n}\n\n/**\n * Pick the invoke_agent span a model call should hang under: the operation span that\n * `bindTracingChannelToSpan` planted as the active async context for the enclosing operation.\n *\n * Because we suppress `ai`'s native telemetry (so it never installs its own span as active), the active\n * span inside `doGenerate`/`doStream` is our operation span. The `operationSpans` gate makes this return\n * `undefined` when the active span isn't one of ours — e.g. telemetry was disabled for the call so we\n * opened no operation span and the active span is the user's enclosing span — so the model call is\n * skipped rather than mis-parented.\n *\n * This covers `generateText`/`embed` (whose model call is awaited inside the operation body) and\n * `streamText` alike — `ai` initiates the stream synchronously within the operation's bound context, so\n * the later `doStream` continuation restores the same active span even though the operation's span has\n * already ended. The per-operation binding also disambiguates concurrent calls that share one model\n * instance (a single mutable slot on the shared model could not — it would hold whichever operation\n * resolved the model last).\n */\nfunction resolveModelCallParent(): Span | undefined {\n const active = getActiveSpan();\n return active && operationSpans.has(active) ? active : undefined;\n}\n\n/**\n * Idempotently patch a resolved model's `doGenerate`/`doStream` so each invocation emits a\n * `languageModelCall` span. Shared by the v5/v6 `resolveLanguageModel` path and the v4 path (which\n * patches the passed model at the operation start, as v4 has no `resolveLanguageModel`).\n */\nfunction patchModelMethods(model: PatchableModel, options: VercelAiChannelOptions): void {\n if (model[PATCHED]) {\n return;\n }\n model[PATCHED] = true;\n patchModelMethod(model, 'doGenerate', options);\n patchModelMethod(model, 'doStream', options);\n}\n\nfunction patchModelMethod(\n model: PatchableModel,\n method: 'doGenerate' | 'doStream',\n options: VercelAiChannelOptions,\n): void {\n const original = model[method];\n if (typeof original !== 'function') {\n return;\n }\n model[method] = function (this: unknown, ...args: unknown[]): Promise<unknown> {\n const parent = resolveModelCallParent();\n // No enclosing operation span (e.g. telemetry disabled for the call) → don't open a model-call span.\n if (!parent) {\n return Promise.resolve(original.apply(this, args));\n }\n\n const callArgs = isObjectLike(args[0]) ? args[0] : {};\n // Carry the operation's `callId` so the shared core can name the span after it\n // (`ai.generateText.doGenerate` / `ai.streamText.doStream`).\n const callId = callIdBySpan.get(parent);\n const message: VercelAiChannelMessage = {\n type: 'languageModelCall',\n event: {\n callId,\n provider: model.provider,\n modelId: model.modelId,\n // v4 nests the tool list under `mode.tools` (the `LanguageModelV1` call shape); v5+ passes a\n // top-level `tools` array. Reading both keeps `available_tools` populated on the model-call span.\n tools: callArgs.tools ?? (isObjectLike(callArgs.mode) ? callArgs.mode.tools : undefined),\n messages: callArgs.prompt,\n // Inherit the enclosing operation's per-call recording flags so inputs/tools/outputs are recorded on\n // the model-call span whenever they are on the parent `invoke_agent` span.\n ...recordingBySpan.get(parent),\n },\n };\n const span = withActiveSpan(parent, () => createSpanFromMessage(message, options));\n // `languageModelCall` always opens a span; the guard just keeps the wrapper safe if that changes.\n if (!span) {\n return Promise.resolve(original.apply(this, args));\n }\n\n // `streamText` ends its operation span synchronously, so its `callId` entry was deliberately left in\n // place for this later model call; drop it now that we've used it.\n const clearStreamCallId = (): void => {\n if (method === 'doStream' && callId) {\n clearOperationCallId(callId);\n }\n };\n\n // Both the synchronous throw and the async rejection of the model call must end the span with an\n // error status (an `async` `doGenerate`/`doStream` that throws rejects rather than throwing here).\n const failSpan = (error: unknown): never => {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: error instanceof Error ? error.message : 'unknown_error' });\n span.end();\n clearStreamCallId();\n throw error;\n };\n\n try {\n const result = Promise.resolve(original.apply(this, args));\n return result.then(value => {\n // A streamed model call resolves to `{ stream, ... }` before the stream is consumed, so its\n // usage/finish/output only arrive as the stream drains. Tap it (same helper as the v7 path) and\n // defer ending this model-call span until then. The parent `invoke_agent` span is enriched\n // separately by `deferStreamTextOperationEnd`, which awaits the operation's own result promises.\n if (method === 'doStream' && isObjectLike(value) && isReadableStream(value.stream)) {\n value.stream = tapModelCallStream(\n value.stream,\n final => {\n message.result = { ...value, ...streamedResultToChannelResult(final) };\n enrichSpanOnEnd(span, message, options);\n span.end();\n clearStreamCallId();\n },\n error => {\n span.setStatus({\n code: SPAN_STATUS_ERROR,\n message: error instanceof Error ? error.message : 'unknown_error',\n });\n span.end();\n clearStreamCallId();\n },\n );\n\n return value;\n }\n // `doGenerate` (and any non-stream result) settles with the full result; end here, start/end\n // bracket the call to match the channel timing.\n message.result = value;\n enrichSpanOnEnd(span, message, options);\n span.end();\n clearStreamCallId();\n\n return value;\n }, failSpan);\n } catch (error) {\n return failSpan(error);\n }\n };\n}\n\n/**\n * Patch every executable tool on an operation's `tools` (a record keyed by tool name) so each\n * invocation emits a `gen_ai.execute_tool` span. v5 routes tool execution through the batch\n * `executeTools`, which binds `tool.execute` at call time — so replacing the `execute` property here\n * (before the call runs) is picked up. Tools without an `execute` (client-side tools) are skipped,\n * matching `executeTools`.\n */\nfunction patchOperationTools(tools: Record<string, unknown>, options: VercelAiChannelOptions): void {\n // This runs inside the channel `start` transform (no upstream try/catch), so a throw here would break\n // the user's `ai` call. Instrumentation must never do that — degrade to no tool span instead.\n try {\n for (const [toolName, tool] of Object.entries(tools)) {\n if (isObjectLike(tool)) {\n patchToolExecute(toolName, tool as PatchableTool, tools, options);\n }\n }\n } catch {\n DEBUG_BUILD && debug.log('Vercel AI orchestrion tool patching failed.');\n }\n}\n\nfunction patchToolExecute(\n toolName: string,\n tool: PatchableTool,\n tools: Record<string, unknown>,\n options: VercelAiChannelOptions,\n): void {\n const original = tool.execute;\n if (typeof original !== 'function' || tool[TOOL_PATCHED]) {\n return;\n }\n tool[TOOL_PATCHED] = true;\n tool.execute = function (this: unknown, input: unknown, ...rest: unknown[]): unknown {\n // Skip if there's no enclosing operation span (telemetry disabled for the call), or if that parent\n // is itself a tool-call span — the latter means v6's `executeToolCall` already opened a span for\n // this call and is running `execute` inside it, so spanning again here would double-count. On v5\n // the parent is the enclosing `invoke_agent` operation span, so we proceed.\n const parent = resolveModelCallParent();\n if (!parent || toolCallSpans.has(parent)) {\n return original.apply(this, [input, ...rest]);\n }\n\n // v5 passes `{ toolCallId, messages, abortSignal, ... }` as the second argument to `execute`.\n const callOptions = isObjectLike(rest[0]) ? rest[0] : {};\n const message: VercelAiChannelMessage = {\n type: 'executeTool',\n event: {\n callId: callIdBySpan.get(parent),\n toolCall: { toolName, toolCallId: asString(callOptions.toolCallId), input },\n // The `tools` record (keyed by name) lets the shared core backfill the tool's `description`.\n tools,\n // Inherit the enclosing operation's per-call recording flags so tool inputs/outputs are recorded\n // whenever they are on the parent `invoke_agent` span.\n ...recordingBySpan.get(parent),\n },\n };\n const span = withActiveSpan(parent, () => createSpanFromMessage(message, options));\n // `executeTool` always opens a span; the guard just keeps the wrapper safe if that changes.\n if (!span) {\n return original.apply(this, [input, ...rest]);\n }\n\n // v5's `executeTools` catches a thrown tool error and turns it into `tool-error` content rather than\n // rejecting, so the user never sees a rejection — we must capture it here. On v4 the rejection bubbles\n // out of the call and reaches the user's error handling (or our global handlers), so we only mark the\n // span and leave the capture to them, avoiding a duplicate report. Rethrow either way so `executeTools`\n // still produces its `tool-error` result (v5) and the rejection propagates (v4).\n const failSpan = (error: unknown): never => {\n if (operationErrorInfoBySpan.get(parent)?.toolErrorsBubbleToCaller) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: error instanceof Error ? error.message : 'tool_error' });\n } else {\n captureToolError(span, message, error);\n }\n span.end();\n throw error;\n };\n\n try {\n const result = Promise.resolve(original.apply(this, [input, ...rest]));\n return result.then(value => {\n // The shared core (matching v6/v7) expects the tool result nested under `output`.\n message.result = { output: value };\n enrichSpanOnEnd(span, message, options);\n span.end();\n return value;\n }, failSpan);\n } catch (error) {\n return failSpan(error);\n }\n };\n}\n\nfunction buildTextMessage(type: 'generateText' | 'streamText' | 'generateObject'): MessageBuilder {\n return (options, telemetry) => ({\n type,\n event: {\n callId: nextCallId(),\n operationId: `ai.${type}`,\n functionId: asString(telemetry.functionId),\n ...modelFields(options.model),\n maxRetries: options.maxRetries,\n // The `ai` SDK takes the system prompt as a top-level `system` option (all of v4/v5/v6); the\n // shared core lifts `event.instructions` into the system-instructions attribute, matching v7's\n // native channel (which carries it as a distinct field rather than inside the messages array).\n instructions: asString(options.system),\n // Normalize to the message-array shape the shared core (and v7's channel) expects: a bare string\n // `prompt` becomes a single user message, matching the SDK's own normalization.\n messages: normalizePromptMessages(options),\n ...recording(telemetry),\n },\n });\n}\n\nfunction normalizePromptMessages(options: Record<string, unknown>): unknown {\n if (Array.isArray(options.messages)) {\n return options.messages;\n }\n if (typeof options.prompt === 'string') {\n return [{ role: 'user', content: options.prompt }];\n }\n return options.messages ?? options.prompt;\n}\n\nfunction recording(telemetry: Record<string, unknown>): { recordInputs: unknown; recordOutputs: unknown } {\n // Match the OTel integration's per-call default: an explicit `recordInputs`/`recordOutputs` wins, but a\n // call that merely enables telemetry (`isEnabled: true`, no explicit flags) defaults both to `true`.\n // Unlike v7's native `ai:telemetry` channel, the orchestrion channels expose `isEnabled`, so — as noted\n // in `resolveRecording` — we CAN reproduce that default here (the native-channel subscriber cannot).\n const enabledDefault = telemetry.isEnabled === true ? true : undefined;\n return {\n recordInputs: telemetry.recordInputs ?? enabledDefault,\n recordOutputs: telemetry.recordOutputs ?? enabledDefault,\n };\n}\n\nfunction modelFields(model: unknown): { provider?: string; modelId?: string } {\n return { provider: modelField(model, 'provider'), modelId: modelField(model, 'modelId') };\n}\n\nfunction modelField(model: unknown, field: 'modelId' | 'provider'): string | undefined {\n return isObjectLike(model) ? asString(model[field]) : undefined;\n}\n"],"names":[],"mappings":";;;;;;;AA4EA,M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A,SAAS,wBAAwB,OAAA,EAA2C;AAC1E,EAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,OAAA,CAAQ,QAAQ,CAAA,EAAG;AACnC,IAAA,OAAO,OAAA,CAAQ,QAAA;AAAA,EACjB;AACA,EAAA,IAAI,OAAO,OAAA,CAAQ,MAAA,KAAW,QAAA,EAAU;AACtC,IAAA,OAAO,CAAC,EAAE,IAAA,EAAM,QAAQ,OAAA,EAAS,OAAA,CAAQ,QAAQ,CAAA;AAAA,EACnD;AACA,EAAA,OAAO,OAAA,CAAQ,YAAY,OAAA,CAAQ,MAAA;AACrC;AAEA,SAAS,UAAU,SAAA,EAAuF;AAKxG,EAAA,MAAM,cAAA,GAAiB,SAAA,CAAU,SAAA,KAAc,IAAA,GAAO,IAAA,GAAO,MAAA;AAC7D,EAAA,OAAO;AAAA,IACL,YAAA,EAAc,UAAU,YAAA,IAAgB,cAAA;AAAA,IACxC,aAAA,EAAe,UAAU,aAAA,IAAiB;AAAA,GAC5C;AACF;AAEA,SAAS,YAAY,KAAA,EAAyD;AAC5E,EAAA,OAAO,EAAE,QAAA,EAAU,UAAA,CAAW,KAAA,EAAO,UAAU,GAAG,OAAA,EAAS,UAAA,CAAW,KAAA,EAAO,SAAS,CAAA,EAAE;AAC1F;AAEA,SAAS,UAAA,CAAW,OAAgB,KAAA,EAAmD;AACrF,EAAA,OAAO,aAAa,KAAK,CAAA,GAAI,SAAS,KAAA,CAAM,KAAK,CAAC,CAAA,GAAI,MAAA;AACxD;;;;"}
@@ -0,0 +1,19 @@
1
+ import { registerDiagnosticsChannelInjection } from '@sentry/server-utils/orchestrion/register';
2
+
3
+ // EXPERIMENTAL — diagnostics-channel injection runtime hook. The side-effecting
4
+ // `--import` entry (e.g. `node --import @sentry/node/import app.js`) that injects
5
+ // the channels unconditionally before the app loads.
6
+ //
7
+ // All of the registration logic lives in `register.ts` — it has to be a
8
+ // CJS-compatible, dual-built module so `Sentry.init()` can `require()` it
9
+ // synchronously, and keeping a single source of truth means the `--import` path
10
+ // and the `init()` path can never drift apart. This file is just the
11
+ // side-effecting wrapper that invokes it.
12
+ //
13
+ // This file is shipped as-is to `build/orchestrion/import-hook.mjs`. Keep it a
14
+ // single self-contained `.mjs` file with no relative-path imports — `--import`
15
+ // resolves it (and the bare specifier below) via Node's module resolution
16
+ // against the installed package.
17
+
18
+
19
+ registerDiagnosticsChannelInjection();
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 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.
3
+ *
4
+ * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.
5
+ */
6
+ export declare const DEBUG_BUILD: boolean;
7
+ //# sourceMappingURL=debug-build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug-build.d.ts","sourceRoot":"","sources":["../../src/debug-build.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,WAAW,SAAkB,CAAC"}
@@ -0,0 +1,94 @@
1
+ import type { TracingChannel } from 'node:diagnostics_channel';
2
+ import type { GraphqlDocumentNode } from './utils';
3
+ export declare const GRAPHQL_DC_CHANNEL_PARSE = "graphql:parse";
4
+ export declare const GRAPHQL_DC_CHANNEL_VALIDATE = "graphql:validate";
5
+ export declare const GRAPHQL_DC_CHANNEL_EXECUTE = "graphql:execute";
6
+ export declare const GRAPHQL_DC_CHANNEL_SUBSCRIBE = "graphql:subscribe";
7
+ export declare const GRAPHQL_DC_CHANNEL_RESOLVE = "graphql:resolve";
8
+ /** Context published on the sync-only `graphql:parse` channel. */
9
+ export interface GraphqlParseData {
10
+ source: string | {
11
+ body?: string;
12
+ };
13
+ result?: GraphqlDocumentNode;
14
+ error?: unknown;
15
+ }
16
+ /** Context published on the sync-only `graphql:validate` channel. */
17
+ export interface GraphqlValidateData {
18
+ document: GraphqlDocumentNode;
19
+ /** Validation errors returned by validation; an empty array means the document is valid. */
20
+ result?: ReadonlyArray<unknown>;
21
+ error?: unknown;
22
+ }
23
+ /**
24
+ * Context published on the `graphql:execute` and `graphql:subscribe` channels.
25
+ *
26
+ * `result` carries an `ExecutionResult` (or, for subscriptions, an async generator); GraphQL errors
27
+ * collected during execution surface on `result.errors` rather than as the channel's `error`
28
+ * lifecycle event, which only fires on an abrupt throw.
29
+ */
30
+ export interface GraphqlOperationData {
31
+ document: GraphqlDocumentNode;
32
+ operationName?: string;
33
+ operationType?: string;
34
+ result?: unknown;
35
+ error?: unknown;
36
+ }
37
+ /**
38
+ * Context published on the per-field `graphql:resolve` channel.
39
+ *
40
+ * A resolver throw or rejection publishes the `error` lifecycle event here; the same failure also
41
+ * surfaces in the enclosing execution result.
42
+ */
43
+ export interface GraphqlResolveData {
44
+ fieldName: string;
45
+ parentType: string;
46
+ fieldType: string;
47
+ fieldPath: string;
48
+ /** Whether the field is handled by graphql's default property resolver (vs. a user resolver). */
49
+ isDefaultResolver: boolean;
50
+ alias?: string;
51
+ args?: unknown;
52
+ result?: unknown;
53
+ error?: unknown;
54
+ }
55
+ /** Options controlling which graphql channels the subscriber emits spans for. */
56
+ export interface GraphqlDiagnosticChannelsOptions {
57
+ /**
58
+ * Do not create spans for resolvers. Resolver spans are per-field and can be very high volume.
59
+ * Defaults to `true`.
60
+ */
61
+ ignoreResolveSpans?: boolean;
62
+ /**
63
+ * When resolver spans are enabled, do not create them for graphql's default property resolver
64
+ * (fields without a user-defined resolver), which are rarely interesting. Defaults to `true`.
65
+ */
66
+ ignoreTrivialResolveSpans?: boolean;
67
+ /**
68
+ * Rename the enclosing root span to include the operation name(s), e.g.
69
+ * `GET /graphql` -> `GET /graphql (query GetUser)`. Defaults to `true`.
70
+ */
71
+ useOperationNameForRootSpan?: boolean;
72
+ }
73
+ /**
74
+ * Platform-provided factory that creates a native tracing channel for the given name. The
75
+ * subscriber binds the span and its lifecycle onto the channel via `bindTracingChannelToSpan`,
76
+ * which propagates the active span through the runtime's async context.
77
+ *
78
+ * Node passes `node:diagnostics_channel`'s `tracingChannel` directly.
79
+ */
80
+ export type GraphqlTracingChannelFactory = <T extends object>(name: string) => TracingChannel<T, T>;
81
+ /**
82
+ * Subscribe Sentry span handlers to graphql's diagnostics-channel events
83
+ * (`graphql:parse`, `:validate`, `:execute`, `:subscribe`), published by graphql >= 17.0.0.
84
+ *
85
+ * On older graphql versions the channels are never published to, so the subscribers are inert —
86
+ * there is no double-instrumentation against the vendored OTel patcher, which is gated to `< 17`.
87
+ *
88
+ * The per-field `graphql:resolve` channel is only subscribed when `ignoreResolveSpans` is `false`:
89
+ * resolver spans are per-field and can be extremely high-volume, so they are off by default (matching
90
+ * the legacy OTel path). When enabled, `ignoreTrivialResolveSpans` (default `true`) additionally skips
91
+ * graphql's default property resolver.
92
+ */
93
+ export declare function subscribeGraphqlDiagnosticChannels(tracingChannel: GraphqlTracingChannelFactory, options?: GraphqlDiagnosticChannelsOptions): void;
94
+ //# sourceMappingURL=graphql-dc-subscriber.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphql-dc-subscriber.d.ts","sourceRoot":"","sources":["../../../src/graphql/graphql-dc-subscriber.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAU/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAMnD,eAAO,MAAM,wBAAwB,kBAAkB,CAAC;AACxD,eAAO,MAAM,2BAA2B,qBAAqB,CAAC;AAC9D,eAAO,MAAM,0BAA0B,oBAAoB,CAAC;AAC5D,eAAO,MAAM,4BAA4B,sBAAsB,CAAC;AAChE,eAAO,MAAM,0BAA0B,oBAAoB,CAAC;AAiB5D,kEAAkE;AAClE,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC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7C,IAAI,CAaN"}
@@ -0,0 +1,12 @@
1
+ import { type GraphqlDiagnosticChannelsOptions } from './graphql-dc-subscriber';
2
+ /**
3
+ * Auto-instrument the [graphql](https://www.npmjs.com/package/graphql) library via its native
4
+ * `node:diagnostics_channel` tracing channels (graphql >= 17).
5
+ *
6
+ * On older graphql versions the channels are never published to, so this integration is inert and
7
+ * the vendored OTel instrumentation (gated to `< 17`) handles instrumentation instead.
8
+ */
9
+ export declare const graphqlIntegration: (options?: GraphqlDiagnosticChannelsOptions | undefined) => import("@sentry/core").Integration & {
10
+ name: "Graphql";
11
+ };
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/graphql/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,gCAAgC,EAAsC,MAAM,yBAAyB,CAAC;AAoBpH;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB;;CAAyC,CAAC"}