@sentry/server-utils 11.11.0 → 11.13.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 (1408) hide show
  1. package/LICENSE +31 -0
  2. package/build/THIRD-PARTY-LICENSES.txt +94 -94
  3. package/build/cjs/chunks/config.js +3388 -0
  4. package/build/cjs/chunks/config.js.map +1 -0
  5. package/build/cjs/{vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/core-Bd0h-mo3.js → chunks/core-BiWIBBjf.js} +40 -23
  6. package/build/cjs/chunks/core-BiWIBBjf.js.map +1 -0
  7. package/build/cjs/chunks/core.js +2 -0
  8. package/build/cjs/chunks/debug-build.js +15 -0
  9. package/build/cjs/chunks/debug-build.js.map +1 -0
  10. package/build/cjs/{vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm → chunks}/esbuild.js +20 -18
  11. package/build/cjs/chunks/esbuild.js.map +1 -0
  12. package/build/cjs/chunks/exports.js +7012 -0
  13. package/build/cjs/chunks/exports.js.map +1 -0
  14. package/build/cjs/{vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm → chunks}/instrumentation-serde-C-Xxv-jj.js +14 -6
  15. package/build/cjs/chunks/instrumentation-serde-C-Xxv-jj.js.map +1 -0
  16. package/build/cjs/chunks/module-details-from-path.js +15969 -0
  17. package/build/cjs/chunks/module-details-from-path.js.map +1 -0
  18. package/build/cjs/chunks/moduleInjectedTransform.js +10882 -0
  19. package/build/cjs/chunks/moduleInjectedTransform.js.map +1 -0
  20. package/build/cjs/chunks/options.js +66 -0
  21. package/build/cjs/chunks/options.js.map +1 -0
  22. package/build/cjs/chunks/pi-ai.js +80 -0
  23. package/build/cjs/chunks/pi-ai.js.map +1 -0
  24. package/build/cjs/chunks/registration-only.js +38 -0
  25. package/build/cjs/chunks/registration-only.js.map +1 -0
  26. package/build/cjs/chunks/resolve.js +75 -0
  27. package/build/cjs/chunks/resolve.js.map +1 -0
  28. package/build/cjs/chunks/rolldown-runtime.js +48 -0
  29. package/build/cjs/{vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/rollup-DCG8HLmh.js → chunks/rollup-CzqrjlS4.js} +17 -19
  30. package/build/cjs/chunks/rollup-CzqrjlS4.js.map +1 -0
  31. package/build/cjs/index.js +10409 -158
  32. package/build/cjs/index.js.map +1 -1
  33. package/build/cjs/index.no-diagnostic-channels.js +30 -49
  34. package/build/cjs/index.request-handler.js +240 -7
  35. package/build/cjs/index.request-handler.js.map +1 -1
  36. package/build/cjs/orchestrion/bundler/bun.js +102 -35
  37. package/build/cjs/orchestrion/bundler/bun.js.map +1 -1
  38. package/build/cjs/orchestrion/bundler/esbuild.js +59 -50
  39. package/build/cjs/orchestrion/bundler/esbuild.js.map +1 -1
  40. package/build/cjs/orchestrion/bundler/load-hook.js +24 -21
  41. package/build/cjs/orchestrion/bundler/load-hook.js.map +1 -1
  42. package/build/cjs/orchestrion/bundler/rollup.js +79 -70
  43. package/build/cjs/orchestrion/bundler/rollup.js.map +1 -1
  44. package/build/cjs/orchestrion/bundler/vite.js +212 -165
  45. package/build/cjs/orchestrion/bundler/vite.js.map +1 -1
  46. package/build/cjs/orchestrion/bundler/webpack-loader.js +134 -16
  47. package/build/cjs/orchestrion/bundler/webpack-loader.js.map +1 -1
  48. package/build/cjs/orchestrion/bundler/webpack.js +157 -77
  49. package/build/cjs/orchestrion/bundler/webpack.js.map +1 -1
  50. package/build/cjs/orchestrion/config/index.js +12 -129
  51. package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/defineProperty.js +17 -0
  52. package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/assertClassBrand.js +9 -0
  53. package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/checkPrivateRedeclaration.js +8 -0
  54. package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/classPrivateFieldGet2.js +9 -0
  55. package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/classPrivateFieldInitSpec.js +9 -0
  56. package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/classPrivateFieldSet2.js +9 -0
  57. package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/classPrivateMethodInitSpec.js +9 -0
  58. package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/defineProperty.js +11 -0
  59. package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/toPrimitive.js +13 -0
  60. package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/toPropertyKey.js +8 -0
  61. package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/typeof.js +10 -0
  62. package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/toPrimitive.js +19 -0
  63. package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/toPropertyKey.js +15 -0
  64. package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/typeof.js +15 -0
  65. package/build/esm/_virtual/_cjs/require_array_set.js +2 -0
  66. package/build/esm/_virtual/_cjs/require_astring.js +2 -0
  67. package/build/esm/_virtual/_cjs/require_base64.js +2 -0
  68. package/build/esm/_virtual/_cjs/require_base64_vlq.js +2 -0
  69. package/build/esm/_virtual/_cjs/require_binary_search.js +2 -0
  70. package/build/esm/_virtual/_cjs/require_esquery_min.js +2 -0
  71. package/build/esm/_virtual/_cjs/require_mapping_list.js +2 -0
  72. package/build/esm/_virtual/_cjs/require_meriyah.js +2 -0
  73. package/build/esm/_virtual/_cjs/require_quick_sort.js +2 -0
  74. package/build/esm/_virtual/_cjs/require_source_map.js +2 -0
  75. package/build/esm/_virtual/_cjs/require_source_map_consumer.js +2 -0
  76. package/build/esm/_virtual/_cjs/require_source_map_generator.js +2 -0
  77. package/build/esm/_virtual/_cjs/require_source_node.js +2 -0
  78. package/build/esm/_virtual/_cjs/require_util.js +2 -0
  79. package/build/esm/_virtual/_rolldown/runtime.js +35 -0
  80. package/build/esm/ai/anthropic-ai/constants.js +10 -6
  81. package/build/esm/ai/anthropic-ai/constants.js.map +1 -1
  82. package/build/esm/ai/anthropic-ai/index.js +183 -199
  83. package/build/esm/ai/anthropic-ai/index.js.map +1 -1
  84. package/build/esm/ai/anthropic-ai/streaming.js +176 -137
  85. package/build/esm/ai/anthropic-ai/streaming.js.map +1 -1
  86. package/build/esm/ai/anthropic-ai/tool-runner.js +103 -81
  87. package/build/esm/ai/anthropic-ai/tool-runner.js.map +1 -1
  88. package/build/esm/ai/anthropic-ai/utils.js +74 -47
  89. package/build/esm/ai/anthropic-ai/utils.js.map +1 -1
  90. package/build/esm/ai/core/apiPromise.js +35 -47
  91. package/build/esm/ai/core/apiPromise.js.map +1 -1
  92. package/build/esm/ai/core/gen-ai-attributes.js +29 -2
  93. package/build/esm/ai/core/gen-ai-attributes.js.map +1 -1
  94. package/build/esm/ai/core/streaming-tool-calls.js +37 -0
  95. package/build/esm/ai/core/streaming-tool-calls.js.map +1 -0
  96. package/build/esm/ai/core/utils.js +200 -144
  97. package/build/esm/ai/core/utils.js.map +1 -1
  98. package/build/esm/ai/flue/constants.js +31 -6
  99. package/build/esm/ai/flue/constants.js.map +1 -1
  100. package/build/esm/ai/flue/index.js +140 -136
  101. package/build/esm/ai/flue/index.js.map +1 -1
  102. package/build/esm/ai/flue/utils.js +93 -179
  103. package/build/esm/ai/flue/utils.js.map +1 -1
  104. package/build/esm/ai/google-genai/constants.js +15 -8
  105. package/build/esm/ai/google-genai/constants.js.map +1 -1
  106. package/build/esm/ai/google-genai/index.js +240 -249
  107. package/build/esm/ai/google-genai/index.js.map +1 -1
  108. package/build/esm/ai/google-genai/streaming.js +90 -64
  109. package/build/esm/ai/google-genai/streaming.js.map +1 -1
  110. package/build/esm/ai/google-genai/utils.js +115 -102
  111. package/build/esm/ai/google-genai/utils.js.map +1 -1
  112. package/build/esm/ai/index.js +12 -0
  113. package/build/esm/ai/langchain/constants.js +9 -8
  114. package/build/esm/ai/langchain/constants.js.map +1 -1
  115. package/build/esm/ai/langchain/embeddings.js +83 -67
  116. package/build/esm/ai/langchain/embeddings.js.map +1 -1
  117. package/build/esm/ai/langchain/index.js +249 -307
  118. package/build/esm/ai/langchain/index.js.map +1 -1
  119. package/build/esm/ai/langchain/typesafe-classifier.js +43 -43
  120. package/build/esm/ai/langchain/typesafe-classifier.js.map +1 -1
  121. package/build/esm/ai/langchain/utils.js +327 -292
  122. package/build/esm/ai/langchain/utils.js.map +1 -1
  123. package/build/esm/ai/langgraph/agent-span.js +83 -0
  124. package/build/esm/ai/langgraph/agent-span.js.map +1 -0
  125. package/build/esm/ai/langgraph/constants.js +3 -2
  126. package/build/esm/ai/langgraph/constants.js.map +1 -1
  127. package/build/esm/ai/langgraph/index.js +119 -159
  128. package/build/esm/ai/langgraph/index.js.map +1 -1
  129. package/build/esm/ai/langgraph/stream.js +89 -0
  130. package/build/esm/ai/langgraph/stream.js.map +1 -0
  131. package/build/esm/ai/langgraph/utils.js +171 -195
  132. package/build/esm/ai/langgraph/utils.js.map +1 -1
  133. package/build/esm/ai/mastra/classifier-evaluation.js +25 -18
  134. package/build/esm/ai/mastra/classifier-evaluation.js.map +1 -1
  135. package/build/esm/ai/mastra/constants.js +63 -18
  136. package/build/esm/ai/mastra/constants.js.map +1 -1
  137. package/build/esm/ai/mastra/index.js +164 -190
  138. package/build/esm/ai/mastra/index.js.map +1 -1
  139. package/build/esm/ai/mastra/span-registry.js +17 -8
  140. package/build/esm/ai/mastra/span-registry.js.map +1 -1
  141. package/build/esm/ai/mastra/utils.js +110 -137
  142. package/build/esm/ai/mastra/utils.js.map +1 -1
  143. package/build/esm/ai/mistral/constants.js +19 -9
  144. package/build/esm/ai/mistral/constants.js.map +1 -1
  145. package/build/esm/ai/mistral/index.js +111 -113
  146. package/build/esm/ai/mistral/index.js.map +1 -1
  147. package/build/esm/ai/mistral/streaming.js +183 -186
  148. package/build/esm/ai/mistral/streaming.js.map +1 -1
  149. package/build/esm/ai/mistral/utils.js +67 -73
  150. package/build/esm/ai/mistral/utils.js.map +1 -1
  151. package/build/esm/ai/openai/constants.js +20 -22
  152. package/build/esm/ai/openai/constants.js.map +1 -1
  153. package/build/esm/ai/openai/index.js +151 -159
  154. package/build/esm/ai/openai/index.js.map +1 -1
  155. package/build/esm/ai/openai/mapping.js +76 -53
  156. package/build/esm/ai/openai/mapping.js.map +1 -1
  157. package/build/esm/ai/openai/streaming.js +151 -152
  158. package/build/esm/ai/openai/streaming.js.map +1 -1
  159. package/build/esm/ai/openai/utils.js +94 -110
  160. package/build/esm/ai/openai/utils.js.map +1 -1
  161. package/build/esm/ai/pi-ai/chat.js +74 -0
  162. package/build/esm/ai/pi-ai/chat.js.map +1 -0
  163. package/build/esm/ai/pi-ai/constants.js +6 -0
  164. package/build/esm/ai/pi-ai/constants.js.map +1 -0
  165. package/build/esm/ai/pi-ai/messages.js +114 -107
  166. package/build/esm/ai/pi-ai/messages.js.map +1 -1
  167. package/build/esm/ai/pi-ai/providers.js +21 -18
  168. package/build/esm/ai/pi-ai/providers.js.map +1 -1
  169. package/build/esm/ai/pi-ai/recording.js +28 -0
  170. package/build/esm/ai/pi-ai/recording.js.map +1 -0
  171. package/build/esm/ai/pi-ai/usage.js +31 -27
  172. package/build/esm/ai/pi-ai/usage.js.map +1 -1
  173. package/build/esm/ai/pi-durable/constants.js +15 -5
  174. package/build/esm/ai/pi-durable/constants.js.map +1 -1
  175. package/build/esm/ai/pi-durable/index.js +164 -165
  176. package/build/esm/ai/pi-durable/index.js.map +1 -1
  177. package/build/esm/ai/pi-durable/runs.js +134 -136
  178. package/build/esm/ai/pi-durable/runs.js.map +1 -1
  179. package/build/esm/ai/pi-durable/tools.js +152 -160
  180. package/build/esm/ai/pi-durable/tools.js.map +1 -1
  181. package/build/esm/ai/pi-durable/utils.js +6 -4
  182. package/build/esm/ai/pi-durable/utils.js.map +1 -1
  183. package/build/esm/ai/typesafe/constants.js +3 -2
  184. package/build/esm/ai/typesafe/constants.js.map +1 -1
  185. package/build/esm/ai/typesafe/index.js +82 -94
  186. package/build/esm/ai/typesafe/index.js.map +1 -1
  187. package/build/esm/ai/vercel-ai/index.js +55 -60
  188. package/build/esm/ai/vercel-ai/index.js.map +1 -1
  189. package/build/esm/ai/workers-ai/constants.js +15 -2
  190. package/build/esm/ai/workers-ai/constants.js.map +1 -1
  191. package/build/esm/ai/workers-ai/index.js +82 -78
  192. package/build/esm/ai/workers-ai/index.js.map +1 -1
  193. package/build/esm/ai/workers-ai/streaming.js +136 -140
  194. package/build/esm/ai/workers-ai/streaming.js.map +1 -1
  195. package/build/esm/ai/workers-ai/utils.js +131 -143
  196. package/build/esm/ai/workers-ai/utils.js.map +1 -1
  197. package/build/esm/async-context.js +74 -63
  198. package/build/esm/async-context.js.map +1 -1
  199. package/build/esm/debug-build.js +9 -3
  200. package/build/esm/debug-build.js.map +1 -1
  201. package/build/esm/eve.js +61 -22
  202. package/build/esm/eve.js.map +1 -1
  203. package/build/esm/exports.js +21 -0
  204. package/build/esm/index.js +82 -73
  205. package/build/esm/index.js.map +1 -1
  206. package/build/esm/index.no-diagnostic-channels.js +21 -19
  207. package/build/esm/index.request-handler.js +1 -2
  208. package/build/esm/integrations/amqplib.js +338 -349
  209. package/build/esm/integrations/amqplib.js.map +1 -1
  210. package/build/esm/integrations/anthropic.js +154 -120
  211. package/build/esm/integrations/anthropic.js.map +1 -1
  212. package/build/esm/integrations/aws-sdk/constants.js +11 -2
  213. package/build/esm/integrations/aws-sdk/constants.js.map +1 -1
  214. package/build/esm/integrations/aws-sdk/index.js +118 -133
  215. package/build/esm/integrations/aws-sdk/index.js.map +1 -1
  216. package/build/esm/integrations/aws-sdk/services/MessageAttributes.js +30 -31
  217. package/build/esm/integrations/aws-sdk/services/MessageAttributes.js.map +1 -1
  218. package/build/esm/integrations/aws-sdk/services/ServicesExtensions.js +38 -44
  219. package/build/esm/integrations/aws-sdk/services/ServicesExtensions.js.map +1 -1
  220. package/build/esm/integrations/aws-sdk/services/bedrock-runtime-content.js +144 -0
  221. package/build/esm/integrations/aws-sdk/services/bedrock-runtime-content.js.map +1 -0
  222. package/build/esm/integrations/aws-sdk/services/bedrock-runtime.js +320 -405
  223. package/build/esm/integrations/aws-sdk/services/bedrock-runtime.js.map +1 -1
  224. package/build/esm/integrations/aws-sdk/services/dynamodb.js +67 -125
  225. package/build/esm/integrations/aws-sdk/services/dynamodb.js.map +1 -1
  226. package/build/esm/integrations/aws-sdk/services/index.js +1 -0
  227. package/build/esm/integrations/aws-sdk/services/kinesis.js +12 -16
  228. package/build/esm/integrations/aws-sdk/services/kinesis.js.map +1 -1
  229. package/build/esm/integrations/aws-sdk/services/lambda.js +51 -57
  230. package/build/esm/integrations/aws-sdk/services/lambda.js.map +1 -1
  231. package/build/esm/integrations/aws-sdk/services/s3.js +12 -16
  232. package/build/esm/integrations/aws-sdk/services/s3.js.map +1 -1
  233. package/build/esm/integrations/aws-sdk/services/secretsmanager.js +16 -22
  234. package/build/esm/integrations/aws-sdk/services/secretsmanager.js.map +1 -1
  235. package/build/esm/integrations/aws-sdk/services/sns.js +66 -70
  236. package/build/esm/integrations/aws-sdk/services/sns.js.map +1 -1
  237. package/build/esm/integrations/aws-sdk/services/sqs.js +104 -124
  238. package/build/esm/integrations/aws-sdk/services/sqs.js.map +1 -1
  239. package/build/esm/integrations/aws-sdk/services/stepfunctions.js +14 -20
  240. package/build/esm/integrations/aws-sdk/services/stepfunctions.js.map +1 -1
  241. package/build/esm/integrations/aws-sdk/utils.js +18 -19
  242. package/build/esm/integrations/aws-sdk/utils.js.map +1 -1
  243. package/build/esm/integrations/cron.js +33 -35
  244. package/build/esm/integrations/cron.js.map +1 -1
  245. package/build/esm/integrations/dataloader.js +101 -93
  246. package/build/esm/integrations/dataloader.js.map +1 -1
  247. package/build/esm/integrations/express/error-handled.js +13 -8
  248. package/build/esm/integrations/express/error-handled.js.map +1 -1
  249. package/build/esm/integrations/express/error-handler.js +49 -31
  250. package/build/esm/integrations/express/error-handler.js.map +1 -1
  251. package/build/esm/integrations/express/index.js +26 -17
  252. package/build/esm/integrations/express/index.js.map +1 -1
  253. package/build/esm/integrations/express/instrumentation.js +182 -196
  254. package/build/esm/integrations/express/instrumentation.js.map +1 -1
  255. package/build/esm/integrations/express/route.js +70 -45
  256. package/build/esm/integrations/express/route.js.map +1 -1
  257. package/build/esm/integrations/express/utils.js +11 -5
  258. package/build/esm/integrations/express/utils.js.map +1 -1
  259. package/build/esm/integrations/fastify/errors.js +33 -26
  260. package/build/esm/integrations/fastify/errors.js.map +1 -1
  261. package/build/esm/integrations/fastify/index.js +41 -21
  262. package/build/esm/integrations/fastify/index.js.map +1 -1
  263. package/build/esm/integrations/fastify/instrumentation.js +188 -208
  264. package/build/esm/integrations/fastify/instrumentation.js.map +1 -1
  265. package/build/esm/integrations/fastify/utils.js +21 -15
  266. package/build/esm/integrations/fastify/utils.js.map +1 -1
  267. package/build/esm/integrations/firebase/firestore.js +69 -70
  268. package/build/esm/integrations/firebase/firestore.js.map +1 -1
  269. package/build/esm/integrations/firebase/functions.js +66 -68
  270. package/build/esm/integrations/firebase/functions.js.map +1 -1
  271. package/build/esm/integrations/firebase/index.js +21 -13
  272. package/build/esm/integrations/firebase/index.js.map +1 -1
  273. package/build/esm/integrations/firebase/instrumentation.js +86 -47
  274. package/build/esm/integrations/firebase/instrumentation.js.map +1 -1
  275. package/build/esm/integrations/flue.js +46 -33
  276. package/build/esm/integrations/flue.js.map +1 -1
  277. package/build/esm/integrations/generic-pool.js +30 -27
  278. package/build/esm/integrations/generic-pool.js.map +1 -1
  279. package/build/esm/integrations/google-genai.js +90 -82
  280. package/build/esm/integrations/google-genai.js.map +1 -1
  281. package/build/esm/integrations/graphql/constants.js +6 -4
  282. package/build/esm/integrations/graphql/constants.js.map +1 -1
  283. package/build/esm/integrations/graphql/graphql-dc-subscriber.js +95 -99
  284. package/build/esm/integrations/graphql/graphql-dc-subscriber.js.map +1 -1
  285. package/build/esm/integrations/graphql/index.js +38 -47
  286. package/build/esm/integrations/graphql/index.js.map +1 -1
  287. package/build/esm/integrations/graphql/resolvers.js +117 -142
  288. package/build/esm/integrations/graphql/resolvers.js.map +1 -1
  289. package/build/esm/integrations/graphql/spans.js +110 -93
  290. package/build/esm/integrations/graphql/spans.js.map +1 -1
  291. package/build/esm/integrations/graphql/utils.js +84 -79
  292. package/build/esm/integrations/graphql/utils.js.map +1 -1
  293. package/build/esm/integrations/groq.js +22 -16
  294. package/build/esm/integrations/groq.js.map +1 -1
  295. package/build/esm/integrations/hapi/hapi-error-handler.js +47 -38
  296. package/build/esm/integrations/hapi/hapi-error-handler.js.map +1 -1
  297. package/build/esm/integrations/hapi/hapi-types.js +20 -13
  298. package/build/esm/integrations/hapi/hapi-types.js.map +1 -1
  299. package/build/esm/integrations/hapi/hapi-utils.js +165 -166
  300. package/build/esm/integrations/hapi/hapi-utils.js.map +1 -1
  301. package/build/esm/integrations/hapi/index.js +53 -64
  302. package/build/esm/integrations/hapi/index.js.map +1 -1
  303. package/build/esm/integrations/hono/applyPatches.js +43 -26
  304. package/build/esm/integrations/hono/applyPatches.js.map +1 -1
  305. package/build/esm/integrations/hono/connInfo.js +39 -30
  306. package/build/esm/integrations/hono/connInfo.js.map +1 -1
  307. package/build/esm/integrations/hono/constants.js +4 -2
  308. package/build/esm/integrations/hono/constants.js.map +1 -1
  309. package/build/esm/integrations/hono/createHonoMiddleware.js +59 -36
  310. package/build/esm/integrations/hono/createHonoMiddleware.js.map +1 -1
  311. package/build/esm/integrations/hono/defaultShouldHandleError.js +17 -9
  312. package/build/esm/integrations/hono/defaultShouldHandleError.js.map +1 -1
  313. package/build/esm/integrations/hono/hono-context.js +13 -9
  314. package/build/esm/integrations/hono/hono-context.js.map +1 -1
  315. package/build/esm/integrations/hono/honoIntegration.js +117 -81
  316. package/build/esm/integrations/hono/honoIntegration.js.map +1 -1
  317. package/build/esm/integrations/hono/index.js +3 -0
  318. package/build/esm/integrations/hono/isMiddleware.js +26 -13
  319. package/build/esm/integrations/hono/isMiddleware.js.map +1 -1
  320. package/build/esm/integrations/hono/matchResult.js +69 -11
  321. package/build/esm/integrations/hono/matchResult.js.map +1 -1
  322. package/build/esm/integrations/hono/middlewareHandlers.js +89 -73
  323. package/build/esm/integrations/hono/middlewareHandlers.js.map +1 -1
  324. package/build/esm/integrations/hono/patchAppRequest.js +77 -66
  325. package/build/esm/integrations/hono/patchAppRequest.js.map +1 -1
  326. package/build/esm/integrations/hono/patchAppUse.js +71 -56
  327. package/build/esm/integrations/hono/patchAppUse.js.map +1 -1
  328. package/build/esm/integrations/hono/patchRoute.js +73 -63
  329. package/build/esm/integrations/hono/patchRoute.js.map +1 -1
  330. package/build/esm/integrations/hono/resolveRouteName.js +21 -26
  331. package/build/esm/integrations/hono/resolveRouteName.js.map +1 -1
  332. package/build/esm/integrations/hono/sentryOriginalTraps.js +26 -0
  333. package/build/esm/integrations/hono/sentryOriginalTraps.js.map +1 -0
  334. package/build/esm/integrations/hono/wrapMiddlewareSpan.js +45 -46
  335. package/build/esm/integrations/hono/wrapMiddlewareSpan.js.map +1 -1
  336. package/build/esm/integrations/index.js +92 -85
  337. package/build/esm/integrations/index.js.map +1 -1
  338. package/build/esm/integrations/kafkajs/consumer.js +58 -60
  339. package/build/esm/integrations/kafkajs/consumer.js.map +1 -1
  340. package/build/esm/integrations/kafkajs/index.js +53 -57
  341. package/build/esm/integrations/kafkajs/index.js.map +1 -1
  342. package/build/esm/integrations/kafkajs/semconv.js +4 -2
  343. package/build/esm/integrations/kafkajs/semconv.js.map +1 -1
  344. package/build/esm/integrations/kafkajs/spans.js +107 -101
  345. package/build/esm/integrations/kafkajs/spans.js.map +1 -1
  346. package/build/esm/integrations/knex.js +133 -157
  347. package/build/esm/integrations/knex.js.map +1 -1
  348. package/build/esm/integrations/koa/index.js +122 -133
  349. package/build/esm/integrations/koa/index.js.map +1 -1
  350. package/build/esm/integrations/koa/koa-error-handler.js +43 -25
  351. package/build/esm/integrations/koa/koa-error-handler.js.map +1 -1
  352. package/build/esm/integrations/langchain.js +66 -75
  353. package/build/esm/integrations/langchain.js.map +1 -1
  354. package/build/esm/integrations/langgraph.js +55 -75
  355. package/build/esm/integrations/langgraph.js.map +1 -1
  356. package/build/esm/integrations/lru-memoizer.js +22 -20
  357. package/build/esm/integrations/lru-memoizer.js.map +1 -1
  358. package/build/esm/integrations/mastra-classifier.js +47 -50
  359. package/build/esm/integrations/mastra-classifier.js.map +1 -1
  360. package/build/esm/integrations/mastra.js +208 -209
  361. package/build/esm/integrations/mastra.js.map +1 -1
  362. package/build/esm/integrations/mcp-server.js +28 -28
  363. package/build/esm/integrations/mcp-server.js.map +1 -1
  364. package/build/esm/integrations/mistral.js +73 -56
  365. package/build/esm/integrations/mistral.js.map +1 -1
  366. package/build/esm/integrations/mongodb/index.js +101 -76
  367. package/build/esm/integrations/mongodb/index.js.map +1 -1
  368. package/build/esm/integrations/mongodb/mongodb-span.js +110 -106
  369. package/build/esm/integrations/mongodb/mongodb-span.js.map +1 -1
  370. package/build/esm/integrations/mongoose/index.js +82 -89
  371. package/build/esm/integrations/mongoose/index.js.map +1 -1
  372. package/build/esm/integrations/mongoose/mongoose-dc-subscriber.js +85 -72
  373. package/build/esm/integrations/mongoose/mongoose-dc-subscriber.js.map +1 -1
  374. package/build/esm/integrations/mongoose/mongoose-legacy-span.js +39 -36
  375. package/build/esm/integrations/mongoose/mongoose-legacy-span.js.map +1 -1
  376. package/build/esm/integrations/mysql.js +74 -83
  377. package/build/esm/integrations/mysql.js.map +1 -1
  378. package/build/esm/integrations/mysql2/index.js +86 -61
  379. package/build/esm/integrations/mysql2/index.js.map +1 -1
  380. package/build/esm/integrations/mysql2/mysql2-dc-subscriber.js +51 -38
  381. package/build/esm/integrations/mysql2/mysql2-dc-subscriber.js.map +1 -1
  382. package/build/esm/integrations/neon.js +84 -86
  383. package/build/esm/integrations/neon.js.map +1 -1
  384. package/build/esm/integrations/nitro/captureStorageEvents.js +97 -111
  385. package/build/esm/integrations/nitro/captureStorageEvents.js.map +1 -1
  386. package/build/esm/integrations/nitro/captureTracingEvents.js +139 -181
  387. package/build/esm/integrations/nitro/captureTracingEvents.js.map +1 -1
  388. package/build/esm/integrations/nitro/index.js +26 -20
  389. package/build/esm/integrations/nitro/index.js.map +1 -1
  390. package/build/esm/integrations/nitro/setServerTimingHeaders.js +31 -33
  391. package/build/esm/integrations/nitro/setServerTimingHeaders.js.map +1 -1
  392. package/build/esm/integrations/node-cron.js +53 -48
  393. package/build/esm/integrations/node-cron.js.map +1 -1
  394. package/build/esm/integrations/node-schedule.js +45 -51
  395. package/build/esm/integrations/node-schedule.js.map +1 -1
  396. package/build/esm/integrations/openai-compatible.js +84 -79
  397. package/build/esm/integrations/openai-compatible.js.map +1 -1
  398. package/build/esm/integrations/openai.js +85 -75
  399. package/build/esm/integrations/openai.js.map +1 -1
  400. package/build/esm/integrations/pg.js +147 -130
  401. package/build/esm/integrations/pg.js.map +1 -1
  402. package/build/esm/integrations/pi-ai.js +69 -0
  403. package/build/esm/integrations/pi-ai.js.map +1 -0
  404. package/build/esm/integrations/pi-durable.js +46 -42
  405. package/build/esm/integrations/pi-durable.js.map +1 -1
  406. package/build/esm/integrations/postgresjs/index.js +124 -126
  407. package/build/esm/integrations/postgresjs/index.js.map +1 -1
  408. package/build/esm/integrations/postgresjs/postgresjs-dc-subscriber.js +72 -64
  409. package/build/esm/integrations/postgresjs/postgresjs-dc-subscriber.js.map +1 -1
  410. package/build/esm/integrations/postgresjs-wrapper.js +232 -187
  411. package/build/esm/integrations/postgresjs-wrapper.js.map +1 -1
  412. package/build/esm/integrations/prisma/global.js +6 -5
  413. package/build/esm/integrations/prisma/global.js.map +1 -1
  414. package/build/esm/integrations/prisma/index.js +44 -26
  415. package/build/esm/integrations/prisma/index.js.map +1 -1
  416. package/build/esm/integrations/prisma/orchestrion.js +96 -115
  417. package/build/esm/integrations/prisma/orchestrion.js.map +1 -1
  418. package/build/esm/integrations/prisma/tracing-helper.js +192 -208
  419. package/build/esm/integrations/prisma/tracing-helper.js.map +1 -1
  420. package/build/esm/integrations/redis/index.js +173 -190
  421. package/build/esm/integrations/redis/index.js.map +1 -1
  422. package/build/esm/integrations/redis/ioredis-channel-subscriber.js +78 -72
  423. package/build/esm/integrations/redis/ioredis-channel-subscriber.js.map +1 -1
  424. package/build/esm/integrations/redis/redis-cache.js +110 -111
  425. package/build/esm/integrations/redis/redis-cache.js.map +1 -1
  426. package/build/esm/integrations/redis/redis-dc-subscriber.js +79 -84
  427. package/build/esm/integrations/redis/redis-dc-subscriber.js.map +1 -1
  428. package/build/esm/integrations/redis/redis-span-name.js +31 -21
  429. package/build/esm/integrations/redis/redis-span-name.js.map +1 -1
  430. package/build/esm/integrations/redis/redis-statement-serializer.js +38 -27
  431. package/build/esm/integrations/redis/redis-statement-serializer.js.map +1 -1
  432. package/build/esm/integrations/serveTunnel.js +36 -0
  433. package/build/esm/integrations/serveTunnel.js.map +1 -0
  434. package/build/esm/integrations/tedious.js +132 -132
  435. package/build/esm/integrations/tedious.js.map +1 -1
  436. package/build/esm/integrations/together-ai.js +22 -16
  437. package/build/esm/integrations/together-ai.js.map +1 -1
  438. package/build/esm/integrations/typesafe.js +32 -37
  439. package/build/esm/integrations/typesafe.js.map +1 -1
  440. package/build/esm/integrations/vercel-ai/gen-ai-recording-mode.js +20 -4
  441. package/build/esm/integrations/vercel-ai/gen-ai-recording-mode.js.map +1 -1
  442. package/build/esm/integrations/vercel-ai/index.js +29 -26
  443. package/build/esm/integrations/vercel-ai/index.js.map +1 -1
  444. package/build/esm/integrations/vercel-ai/util.js +86 -92
  445. package/build/esm/integrations/vercel-ai/util.js.map +1 -1
  446. package/build/esm/integrations/vercel-ai/vercel-ai-dc-subscriber.js +510 -509
  447. package/build/esm/integrations/vercel-ai/vercel-ai-dc-subscriber.js.map +1 -1
  448. package/build/esm/integrations/vercel-ai/vercel-ai-orchestrion-subscriber.js +386 -361
  449. package/build/esm/integrations/vercel-ai/vercel-ai-orchestrion-subscriber.js.map +1 -1
  450. package/build/esm/integrations/vercel-ai/vercel-ai-tool-telemetry.js +61 -34
  451. package/build/esm/integrations/vercel-ai/vercel-ai-tool-telemetry.js.map +1 -1
  452. package/build/esm/opentelemetry.js +70 -35
  453. package/build/esm/opentelemetry.js.map +1 -1
  454. package/build/esm/orchestrion/bundler/bun.js +42 -32
  455. package/build/esm/orchestrion/bundler/bun.js.map +1 -1
  456. package/build/esm/orchestrion/bundler/esbuild.js +57 -47
  457. package/build/esm/orchestrion/bundler/esbuild.js.map +1 -1
  458. package/build/esm/orchestrion/bundler/externalRequire.js +65 -62
  459. package/build/esm/orchestrion/bundler/externalRequire.js.map +1 -1
  460. package/build/esm/orchestrion/bundler/load-hook.js +23 -19
  461. package/build/esm/orchestrion/bundler/load-hook.js.map +1 -1
  462. package/build/esm/orchestrion/bundler/moduleInjectedTransform.js +118 -44
  463. package/build/esm/orchestrion/bundler/moduleInjectedTransform.js.map +1 -1
  464. package/build/esm/orchestrion/bundler/options.js +42 -13
  465. package/build/esm/orchestrion/bundler/options.js.map +1 -1
  466. package/build/esm/orchestrion/bundler/resolve.js +43 -13
  467. package/build/esm/orchestrion/bundler/resolve.js.map +1 -1
  468. package/build/esm/orchestrion/bundler/rollup.js +78 -67
  469. package/build/esm/orchestrion/bundler/rollup.js.map +1 -1
  470. package/build/esm/orchestrion/bundler/vite.js +122 -160
  471. package/build/esm/orchestrion/bundler/vite.js.map +1 -1
  472. package/build/esm/orchestrion/bundler/webpack-loader.js +18 -14
  473. package/build/esm/orchestrion/bundler/webpack-loader.js.map +1 -1
  474. package/build/esm/orchestrion/bundler/webpack.js +57 -71
  475. package/build/esm/orchestrion/bundler/webpack.js.map +1 -1
  476. package/build/esm/orchestrion/channels.js +105 -87
  477. package/build/esm/orchestrion/channels.js.map +1 -1
  478. package/build/esm/orchestrion/config/amqplib.js +152 -83
  479. package/build/esm/orchestrion/config/amqplib.js.map +1 -1
  480. package/build/esm/orchestrion/config/anthropic-ai.js +96 -43
  481. package/build/esm/orchestrion/config/anthropic-ai.js.map +1 -1
  482. package/build/esm/orchestrion/config/aws-sdk.js +46 -22
  483. package/build/esm/orchestrion/config/aws-sdk.js.map +1 -1
  484. package/build/esm/orchestrion/config/channel-integration-definitions.js +193 -51
  485. package/build/esm/orchestrion/config/channel-integration-definitions.js.map +1 -1
  486. package/build/esm/orchestrion/config/cron.js +27 -18
  487. package/build/esm/orchestrion/config/cron.js.map +1 -1
  488. package/build/esm/orchestrion/config/dataloader.js +62 -45
  489. package/build/esm/orchestrion/config/dataloader.js.map +1 -1
  490. package/build/esm/orchestrion/config/express.js +80 -71
  491. package/build/esm/orchestrion/config/express.js.map +1 -1
  492. package/build/esm/orchestrion/config/firebase.js +133 -70
  493. package/build/esm/orchestrion/config/firebase.js.map +1 -1
  494. package/build/esm/orchestrion/config/flue.js +15 -7
  495. package/build/esm/orchestrion/config/flue.js.map +1 -1
  496. package/build/esm/orchestrion/config/generic-pool.js +29 -19
  497. package/build/esm/orchestrion/config/generic-pool.js.map +1 -1
  498. package/build/esm/orchestrion/config/google-genai.js +50 -33
  499. package/build/esm/orchestrion/config/google-genai.js.map +1 -1
  500. package/build/esm/orchestrion/config/graphql.js +43 -22
  501. package/build/esm/orchestrion/config/graphql.js.map +1 -1
  502. package/build/esm/orchestrion/config/groq.js +9 -9
  503. package/build/esm/orchestrion/config/groq.js.map +1 -1
  504. package/build/esm/orchestrion/config/hapi.js +56 -38
  505. package/build/esm/orchestrion/config/hapi.js.map +1 -1
  506. package/build/esm/orchestrion/config/hono.js +23 -26
  507. package/build/esm/orchestrion/config/hono.js.map +1 -1
  508. package/build/esm/orchestrion/config/index.js +177 -111
  509. package/build/esm/orchestrion/config/index.js.map +1 -1
  510. package/build/esm/orchestrion/config/ioredis.js +65 -31
  511. package/build/esm/orchestrion/config/ioredis.js.map +1 -1
  512. package/build/esm/orchestrion/config/kafkajs.js +29 -26
  513. package/build/esm/orchestrion/config/kafkajs.js.map +1 -1
  514. package/build/esm/orchestrion/config/knex.js +57 -29
  515. package/build/esm/orchestrion/config/knex.js.map +1 -1
  516. package/build/esm/orchestrion/config/koa.js +31 -24
  517. package/build/esm/orchestrion/config/koa.js.map +1 -1
  518. package/build/esm/orchestrion/config/langchain.js +78 -49
  519. package/build/esm/orchestrion/config/langchain.js.map +1 -1
  520. package/build/esm/orchestrion/config/langgraph.js +25 -20
  521. package/build/esm/orchestrion/config/langgraph.js.map +1 -1
  522. package/build/esm/orchestrion/config/lru-memoizer.js +17 -15
  523. package/build/esm/orchestrion/config/lru-memoizer.js.map +1 -1
  524. package/build/esm/orchestrion/config/mastra.js +44 -44
  525. package/build/esm/orchestrion/config/mastra.js.map +1 -1
  526. package/build/esm/orchestrion/config/mcp-server.js +24 -32
  527. package/build/esm/orchestrion/config/mcp-server.js.map +1 -1
  528. package/build/esm/orchestrion/config/mistral.js +87 -47
  529. package/build/esm/orchestrion/config/mistral.js.map +1 -1
  530. package/build/esm/orchestrion/config/module-names.js +9 -3
  531. package/build/esm/orchestrion/config/module-names.js.map +1 -1
  532. package/build/esm/orchestrion/config/mongodb.js +101 -61
  533. package/build/esm/orchestrion/config/mongodb.js.map +1 -1
  534. package/build/esm/orchestrion/config/mongoose.js +131 -100
  535. package/build/esm/orchestrion/config/mongoose.js.map +1 -1
  536. package/build/esm/orchestrion/config/mysql.js +17 -14
  537. package/build/esm/orchestrion/config/mysql.js.map +1 -1
  538. package/build/esm/orchestrion/config/mysql2.js +64 -28
  539. package/build/esm/orchestrion/config/mysql2.js.map +1 -1
  540. package/build/esm/orchestrion/config/neon.js +33 -36
  541. package/build/esm/orchestrion/config/neon.js.map +1 -1
  542. package/build/esm/orchestrion/config/nestjs.js +151 -120
  543. package/build/esm/orchestrion/config/nestjs.js.map +1 -1
  544. package/build/esm/orchestrion/config/nitro.js +25 -7
  545. package/build/esm/orchestrion/config/nitro.js.map +1 -1
  546. package/build/esm/orchestrion/config/node-cron.js +74 -43
  547. package/build/esm/orchestrion/config/node-cron.js.map +1 -1
  548. package/build/esm/orchestrion/config/node-schedule.js +26 -21
  549. package/build/esm/orchestrion/config/node-schedule.js.map +1 -1
  550. package/build/esm/orchestrion/config/openai-compatible.js +42 -15
  551. package/build/esm/orchestrion/config/openai-compatible.js.map +1 -1
  552. package/build/esm/orchestrion/config/openai.js +72 -39
  553. package/build/esm/orchestrion/config/openai.js.map +1 -1
  554. package/build/esm/orchestrion/config/pg.js +70 -45
  555. package/build/esm/orchestrion/config/pg.js.map +1 -1
  556. package/build/esm/orchestrion/config/pi-ai.js +49 -0
  557. package/build/esm/orchestrion/config/pi-ai.js.map +1 -0
  558. package/build/esm/orchestrion/config/pi-durable.js +36 -26
  559. package/build/esm/orchestrion/config/pi-durable.js.map +1 -1
  560. package/build/esm/orchestrion/config/postgres.js +63 -48
  561. package/build/esm/orchestrion/config/postgres.js.map +1 -1
  562. package/build/esm/orchestrion/config/prisma.js +46 -36
  563. package/build/esm/orchestrion/config/prisma.js.map +1 -1
  564. package/build/esm/orchestrion/config/redis.js +133 -72
  565. package/build/esm/orchestrion/config/redis.js.map +1 -1
  566. package/build/esm/orchestrion/config/registration-only.js +23 -8
  567. package/build/esm/orchestrion/config/registration-only.js.map +1 -1
  568. package/build/esm/orchestrion/config/remix-v3.js +68 -47
  569. package/build/esm/orchestrion/config/remix-v3.js.map +1 -1
  570. package/build/esm/orchestrion/config/remix.js +77 -45
  571. package/build/esm/orchestrion/config/remix.js.map +1 -1
  572. package/build/esm/orchestrion/config/tedious.js +31 -16
  573. package/build/esm/orchestrion/config/tedious.js.map +1 -1
  574. package/build/esm/orchestrion/config/together-ai.js +17 -15
  575. package/build/esm/orchestrion/config/together-ai.js.map +1 -1
  576. package/build/esm/orchestrion/config/typesafe.js +16 -10
  577. package/build/esm/orchestrion/config/typesafe.js.map +1 -1
  578. package/build/esm/orchestrion/config/vercel-ai.js +54 -44
  579. package/build/esm/orchestrion/config/vercel-ai.js.map +1 -1
  580. package/build/esm/orchestrion/detect.js +50 -21
  581. package/build/esm/orchestrion/detect.js.map +1 -1
  582. package/build/esm/orchestrion/instrumentation.js +90 -70
  583. package/build/esm/orchestrion/instrumentation.js.map +1 -1
  584. package/build/esm/package.json +1 -1
  585. package/build/esm/tracing-channel.js +143 -135
  586. package/build/esm/tracing-channel.js.map +1 -1
  587. package/build/esm/utils/cronMonitoring.js +152 -125
  588. package/build/esm/utils/cronMonitoring.js.map +1 -1
  589. package/build/esm/utils/diagnosticsChannel.js +27 -21
  590. package/build/esm/utils/diagnosticsChannel.js.map +1 -1
  591. package/build/esm/utils/moduleInjected.js +35 -13
  592. package/build/esm/utils/moduleInjected.js.map +1 -1
  593. package/build/esm/utils/monitorStream.js +52 -58
  594. package/build/esm/utils/monitorStream.js.map +1 -1
  595. package/build/esm/utils/runtime.js +17 -0
  596. package/build/esm/utils/runtime.js.map +1 -0
  597. package/build/esm/utils/setHttpServerSpanRouteAttribute.js +22 -21
  598. package/build/esm/utils/setHttpServerSpanRouteAttribute.js.map +1 -1
  599. package/build/esm/utils/sql.js +260 -225
  600. package/build/esm/utils/sql.js.map +1 -1
  601. package/build/esm/utils/tunnelServer.js +31 -0
  602. package/build/esm/utils/tunnelServer.js.map +1 -0
  603. package/build/esm/utils/withCleanScopes.js +17 -12
  604. package/build/esm/utils/withCleanScopes.js.map +1 -1
  605. package/build/esm/utils/wrapServerRequestHandler.js +180 -196
  606. package/build/esm/utils/wrapServerRequestHandler.js.map +1 -1
  607. package/build/esm/vendored/@apm-js-collab/code-transformer/index.js +9 -5
  608. package/build/esm/vendored/@apm-js-collab/code-transformer/index.js.map +1 -1
  609. package/build/esm/vendored/@apm-js-collab/code-transformer/lib/index.js +21 -9
  610. package/build/esm/vendored/@apm-js-collab/code-transformer/lib/index.js.map +1 -1
  611. package/build/esm/vendored/@apm-js-collab/code-transformer/lib/matcher.js +80 -83
  612. package/build/esm/vendored/@apm-js-collab/code-transformer/lib/matcher.js.map +1 -1
  613. package/build/esm/vendored/@apm-js-collab/code-transformer/lib/transformer.js +289 -313
  614. package/build/esm/vendored/@apm-js-collab/code-transformer/lib/transformer.js.map +1 -1
  615. package/build/esm/vendored/@apm-js-collab/code-transformer/lib/transforms.js +488 -284
  616. package/build/esm/vendored/@apm-js-collab/code-transformer/lib/transforms.js.map +1 -1
  617. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/bun.js +5 -6
  618. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/bun.js.map +1 -1
  619. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/{core-Bd0h-mo3.js → core-BiWIBBjf.js} +15 -14
  620. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/core-BiWIBBjf.js.map +1 -0
  621. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/core.js +3 -0
  622. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/esbuild.js +6 -7
  623. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/esbuild.js.map +1 -1
  624. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/instrumentation-serde-C-Xxv-jj.js +3 -3
  625. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/instrumentation-serde-C-Xxv-jj.js.map +1 -1
  626. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/{rollup-DCG8HLmh.js → rollup-CzqrjlS4.js} +8 -13
  627. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/rollup-CzqrjlS4.js.map +1 -0
  628. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/rollup.js +1 -0
  629. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/vite.js +4 -5
  630. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/vite.js.map +1 -1
  631. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/webpack-loader-factory.js +13 -12
  632. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/webpack-loader-factory.js.map +1 -1
  633. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/webpack.js +7 -8
  634. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/webpack.js.map +1 -1
  635. package/build/esm/vendored/astring/dist/astring.js +910 -1065
  636. package/build/esm/vendored/astring/dist/astring.js.map +1 -1
  637. package/build/esm/vendored/esquery/dist/esquery.min.js +1312 -0
  638. package/build/esm/vendored/esquery/dist/esquery.min.js.map +1 -0
  639. package/build/esm/vendored/meriyah/dist/meriyah.js +10539 -9189
  640. package/build/esm/vendored/meriyah/dist/meriyah.js.map +1 -1
  641. package/build/esm/vendored/meriyah/dist/meriyah2.js +10122 -8806
  642. package/build/esm/vendored/meriyah/dist/meriyah2.js.map +1 -1
  643. package/build/esm/vendored/module-details-from-path/index.js +31 -40
  644. package/build/esm/vendored/module-details-from-path/index.js.map +1 -1
  645. package/build/esm/vendored/semifies/index.js +106 -108
  646. package/build/esm/vendored/semifies/index.js.map +1 -1
  647. package/build/esm/vendored/source-map/lib/array-set.js +100 -70
  648. package/build/esm/vendored/source-map/lib/array-set.js.map +1 -1
  649. package/build/esm/vendored/source-map/lib/base64-vlq.js +71 -54
  650. package/build/esm/vendored/source-map/lib/base64-vlq.js.map +1 -1
  651. package/build/esm/vendored/source-map/lib/base64.js +38 -39
  652. package/build/esm/vendored/source-map/lib/base64.js.map +1 -1
  653. package/build/esm/vendored/source-map/lib/binary-search.js +61 -50
  654. package/build/esm/vendored/source-map/lib/binary-search.js.map +1 -1
  655. package/build/esm/vendored/source-map/lib/mapping-list.js +75 -39
  656. package/build/esm/vendored/source-map/lib/mapping-list.js.map +1 -1
  657. package/build/esm/vendored/source-map/lib/quick-sort.js +73 -33
  658. package/build/esm/vendored/source-map/lib/quick-sort.js.map +1 -1
  659. package/build/esm/vendored/source-map/lib/source-map-consumer.js +763 -609
  660. package/build/esm/vendored/source-map/lib/source-map-consumer.js.map +1 -1
  661. package/build/esm/vendored/source-map/lib/source-map-generator.js +281 -282
  662. package/build/esm/vendored/source-map/lib/source-map-generator.js.map +1 -1
  663. package/build/esm/vendored/source-map/lib/source-node.js +294 -267
  664. package/build/esm/vendored/source-map/lib/source-node.js.map +1 -1
  665. package/build/esm/vendored/source-map/lib/util.js +241 -252
  666. package/build/esm/vendored/source-map/lib/util.js.map +1 -1
  667. package/build/esm/vendored/source-map/source-map.js +17 -13
  668. package/build/esm/vendored/source-map/source-map.js.map +1 -1
  669. package/build/types/ai/anthropic-ai/index.d.ts +1 -1
  670. package/build/types/ai/anthropic-ai/index.d.ts.map +1 -1
  671. package/build/types/ai/anthropic-ai/streaming.d.ts +2 -1
  672. package/build/types/ai/anthropic-ai/streaming.d.ts.map +1 -1
  673. package/build/types/ai/anthropic-ai/tool-runner.d.ts +1 -1
  674. package/build/types/ai/anthropic-ai/tool-runner.d.ts.map +1 -1
  675. package/build/types/ai/anthropic-ai/utils.d.ts +7 -2
  676. package/build/types/ai/anthropic-ai/utils.d.ts.map +1 -1
  677. package/build/types/ai/core/streaming-tool-calls.d.ts +19 -0
  678. package/build/types/ai/core/streaming-tool-calls.d.ts.map +1 -0
  679. package/build/types/ai/core/utils.d.ts +18 -1
  680. package/build/types/ai/core/utils.d.ts.map +1 -1
  681. package/build/types/ai/flue/constants.d.ts +5 -7
  682. package/build/types/ai/flue/constants.d.ts.map +1 -1
  683. package/build/types/ai/flue/index.d.ts +7 -4
  684. package/build/types/ai/flue/index.d.ts.map +1 -1
  685. package/build/types/ai/flue/types.d.ts +1 -38
  686. package/build/types/ai/flue/types.d.ts.map +1 -1
  687. package/build/types/ai/flue/utils.d.ts +1 -13
  688. package/build/types/ai/flue/utils.d.ts.map +1 -1
  689. package/build/types/ai/google-genai/index.d.ts +4 -0
  690. package/build/types/ai/google-genai/index.d.ts.map +1 -1
  691. package/build/types/ai/google-genai/streaming.d.ts +1 -1
  692. package/build/types/ai/google-genai/streaming.d.ts.map +1 -1
  693. package/build/types/ai/langchain/utils.d.ts +6 -0
  694. package/build/types/ai/langchain/utils.d.ts.map +1 -1
  695. package/build/types/ai/langgraph/agent-span.d.ts +15 -0
  696. package/build/types/ai/langgraph/agent-span.d.ts.map +1 -0
  697. package/build/types/ai/langgraph/index.d.ts +7 -1
  698. package/build/types/ai/langgraph/index.d.ts.map +1 -1
  699. package/build/types/ai/langgraph/stream.d.ts +10 -0
  700. package/build/types/ai/langgraph/stream.d.ts.map +1 -0
  701. package/build/types/ai/langgraph/types.d.ts +1 -0
  702. package/build/types/ai/langgraph/types.d.ts.map +1 -1
  703. package/build/types/ai/mastra/utils.d.ts +1 -1
  704. package/build/types/ai/openai/index.d.ts.map +1 -1
  705. package/build/types/ai/openai/streaming.d.ts.map +1 -1
  706. package/build/types/ai/pi-ai/chat.d.ts +20 -0
  707. package/build/types/ai/pi-ai/chat.d.ts.map +1 -0
  708. package/build/types/ai/pi-ai/constants.d.ts +3 -0
  709. package/build/types/ai/pi-ai/constants.d.ts.map +1 -0
  710. package/build/types/ai/pi-ai/providers.d.ts +9 -6
  711. package/build/types/ai/pi-ai/providers.d.ts.map +1 -1
  712. package/build/types/ai/pi-ai/recording.d.ts +15 -0
  713. package/build/types/ai/pi-ai/recording.d.ts.map +1 -0
  714. package/build/types/ai/pi-ai/types.d.ts +31 -0
  715. package/build/types/ai/pi-ai/types.d.ts.map +1 -0
  716. package/build/types/ai/pi-durable/index.d.ts +5 -5
  717. package/build/types/ai/pi-durable/index.d.ts.map +1 -1
  718. package/build/types/ai/pi-durable/types.d.ts +3 -43
  719. package/build/types/ai/pi-durable/types.d.ts.map +1 -1
  720. package/build/types/ai/workers-ai/index.d.ts.map +1 -1
  721. package/build/types/ai/workers-ai/streaming.d.ts.map +1 -1
  722. package/build/types/ai/workers-ai/types.d.ts +13 -0
  723. package/build/types/ai/workers-ai/types.d.ts.map +1 -1
  724. package/build/types/ai/workers-ai/utils.d.ts.map +1 -1
  725. package/build/types/eve.d.ts +13 -0
  726. package/build/types/eve.d.ts.map +1 -1
  727. package/build/types/exports.d.ts +1 -0
  728. package/build/types/exports.d.ts.map +1 -1
  729. package/build/types/index.d.ts +4 -1
  730. package/build/types/index.d.ts.map +1 -1
  731. package/build/types/integrations/anthropic.d.ts.map +1 -1
  732. package/build/types/integrations/aws-sdk/index.d.ts +3 -1
  733. package/build/types/integrations/aws-sdk/index.d.ts.map +1 -1
  734. package/build/types/integrations/aws-sdk/services/ServicesExtensions.d.ts +2 -0
  735. package/build/types/integrations/aws-sdk/services/ServicesExtensions.d.ts.map +1 -1
  736. package/build/types/integrations/aws-sdk/services/bedrock-runtime-content.d.ts +30 -0
  737. package/build/types/integrations/aws-sdk/services/bedrock-runtime-content.d.ts.map +1 -0
  738. package/build/types/integrations/aws-sdk/services/bedrock-runtime.d.ts +5 -0
  739. package/build/types/integrations/aws-sdk/services/bedrock-runtime.d.ts.map +1 -1
  740. package/build/types/integrations/aws-sdk/types.d.ts +2 -0
  741. package/build/types/integrations/aws-sdk/types.d.ts.map +1 -1
  742. package/build/types/integrations/flue.d.ts.map +1 -1
  743. package/build/types/integrations/google-genai.d.ts.map +1 -1
  744. package/build/types/integrations/hono/constants.d.ts +1 -0
  745. package/build/types/integrations/hono/constants.d.ts.map +1 -1
  746. package/build/types/integrations/hono/createHonoMiddleware.d.ts +0 -1
  747. package/build/types/integrations/hono/createHonoMiddleware.d.ts.map +1 -1
  748. package/build/types/integrations/hono/honoIntegration.d.ts.map +1 -1
  749. package/build/types/integrations/hono/matchResult.d.ts +21 -4
  750. package/build/types/integrations/hono/matchResult.d.ts.map +1 -1
  751. package/build/types/integrations/hono/middlewareHandlers.d.ts +1 -2
  752. package/build/types/integrations/hono/middlewareHandlers.d.ts.map +1 -1
  753. package/build/types/integrations/hono/patchAppRequest.d.ts.map +1 -1
  754. package/build/types/integrations/hono/patchRoute.d.ts.map +1 -1
  755. package/build/types/integrations/hono/resolveRouteName.d.ts +4 -7
  756. package/build/types/integrations/hono/resolveRouteName.d.ts.map +1 -1
  757. package/build/types/integrations/hono/sentryOriginalTraps.d.ts +9 -0
  758. package/build/types/integrations/hono/sentryOriginalTraps.d.ts.map +1 -0
  759. package/build/types/integrations/hono/wrapMiddlewareSpan.d.ts.map +1 -1
  760. package/build/types/integrations/index.d.ts.map +1 -1
  761. package/build/types/integrations/langgraph.d.ts.map +1 -1
  762. package/build/types/integrations/mistral.d.ts.map +1 -1
  763. package/build/types/integrations/nitro/captureStorageEvents.d.ts.map +1 -1
  764. package/build/types/integrations/nitro/captureTracingEvents.d.ts.map +1 -1
  765. package/build/types/integrations/nitro/setServerTimingHeaders.d.ts.map +1 -1
  766. package/build/types/integrations/openai-compatible.d.ts.map +1 -1
  767. package/build/types/integrations/openai.d.ts.map +1 -1
  768. package/build/types/integrations/pi-ai.d.ts +19 -0
  769. package/build/types/integrations/pi-ai.d.ts.map +1 -0
  770. package/build/types/integrations/pi-durable.d.ts +3 -4
  771. package/build/types/integrations/pi-durable.d.ts.map +1 -1
  772. package/build/types/integrations/serveTunnel.d.ts +14 -0
  773. package/build/types/integrations/serveTunnel.d.ts.map +1 -0
  774. package/build/types/integrations/vercel-ai/gen-ai-recording-mode.d.ts +5 -1
  775. package/build/types/integrations/vercel-ai/gen-ai-recording-mode.d.ts.map +1 -1
  776. package/build/types/integrations/vercel-ai/vercel-ai-dc-subscriber.d.ts +6 -4
  777. package/build/types/integrations/vercel-ai/vercel-ai-dc-subscriber.d.ts.map +1 -1
  778. package/build/types/integrations/vercel-ai/vercel-ai-orchestrion-subscriber.d.ts.map +1 -1
  779. package/build/types/integrations/vercel-ai/vercel-ai-tool-telemetry.d.ts +3 -3
  780. package/build/types/integrations/vercel-ai/vercel-ai-tool-telemetry.d.ts.map +1 -1
  781. package/build/types/orchestrion/bundler/moduleInjectedTransform.d.ts +5 -1
  782. package/build/types/orchestrion/bundler/moduleInjectedTransform.d.ts.map +1 -1
  783. package/build/types/orchestrion/bundler/options.d.ts +6 -0
  784. package/build/types/orchestrion/bundler/options.d.ts.map +1 -1
  785. package/build/types/orchestrion/channels.d.ts +4 -0
  786. package/build/types/orchestrion/channels.d.ts.map +1 -1
  787. package/build/types/orchestrion/config/anthropic-ai.d.ts +1 -0
  788. package/build/types/orchestrion/config/anthropic-ai.d.ts.map +1 -1
  789. package/build/types/orchestrion/config/channel-integration-definitions.d.ts +3 -0
  790. package/build/types/orchestrion/config/channel-integration-definitions.d.ts.map +1 -1
  791. package/build/types/orchestrion/config/flue.d.ts +1 -1
  792. package/build/types/orchestrion/config/index.d.ts.map +1 -1
  793. package/build/types/orchestrion/config/pi-ai.d.ts +8 -0
  794. package/build/types/orchestrion/config/pi-ai.d.ts.map +1 -0
  795. package/build/types/orchestrion/config/vercel-ai.d.ts +1 -0
  796. package/build/types/orchestrion/config/vercel-ai.d.ts.map +1 -1
  797. package/build/types/orchestrion/detect.d.ts.map +1 -1
  798. package/build/types/orchestrion/instrumentation.d.ts.map +1 -1
  799. package/build/types/utils/diagnosticsChannel.d.ts.map +1 -1
  800. package/build/types/utils/runtime.d.ts +7 -0
  801. package/build/types/utils/runtime.d.ts.map +1 -0
  802. package/build/types/utils/tunnelServer.d.ts +10 -0
  803. package/build/types/utils/tunnelServer.d.ts.map +1 -0
  804. package/build/types/utils/wrapServerRequestHandler.d.ts +5 -0
  805. package/build/types/utils/wrapServerRequestHandler.d.ts.map +1 -1
  806. package/package.json +27 -27
  807. package/build/cjs/_virtual/_commonjsHelpers.js +0 -8
  808. package/build/cjs/_virtual/_commonjsHelpers.js.map +0 -1
  809. package/build/cjs/_virtual/array-set.js +0 -6
  810. package/build/cjs/_virtual/array-set.js.map +0 -1
  811. package/build/cjs/_virtual/astring.js +0 -6
  812. package/build/cjs/_virtual/astring.js.map +0 -1
  813. package/build/cjs/_virtual/base64-vlq.js +0 -6
  814. package/build/cjs/_virtual/base64-vlq.js.map +0 -1
  815. package/build/cjs/_virtual/base64.js +0 -6
  816. package/build/cjs/_virtual/base64.js.map +0 -1
  817. package/build/cjs/_virtual/binary-search.js +0 -6
  818. package/build/cjs/_virtual/binary-search.js.map +0 -1
  819. package/build/cjs/_virtual/mapping-list.js +0 -6
  820. package/build/cjs/_virtual/mapping-list.js.map +0 -1
  821. package/build/cjs/_virtual/meriyah.js +0 -6
  822. package/build/cjs/_virtual/meriyah.js.map +0 -1
  823. package/build/cjs/_virtual/quick-sort.js +0 -6
  824. package/build/cjs/_virtual/quick-sort.js.map +0 -1
  825. package/build/cjs/_virtual/source-map-consumer.js +0 -6
  826. package/build/cjs/_virtual/source-map-consumer.js.map +0 -1
  827. package/build/cjs/_virtual/source-map-generator.js +0 -6
  828. package/build/cjs/_virtual/source-map-generator.js.map +0 -1
  829. package/build/cjs/_virtual/source-map.js +0 -6
  830. package/build/cjs/_virtual/source-map.js.map +0 -1
  831. package/build/cjs/_virtual/source-node.js +0 -6
  832. package/build/cjs/_virtual/source-node.js.map +0 -1
  833. package/build/cjs/_virtual/util.js +0 -6
  834. package/build/cjs/_virtual/util.js.map +0 -1
  835. package/build/cjs/ai/anthropic-ai/constants.js +0 -15
  836. package/build/cjs/ai/anthropic-ai/constants.js.map +0 -1
  837. package/build/cjs/ai/anthropic-ai/index.js +0 -225
  838. package/build/cjs/ai/anthropic-ai/index.js.map +0 -1
  839. package/build/cjs/ai/anthropic-ai/streaming.js +0 -158
  840. package/build/cjs/ai/anthropic-ai/streaming.js.map +0 -1
  841. package/build/cjs/ai/anthropic-ai/tool-runner.js +0 -100
  842. package/build/cjs/ai/anthropic-ai/tool-runner.js.map +0 -1
  843. package/build/cjs/ai/anthropic-ai/utils.js +0 -62
  844. package/build/cjs/ai/anthropic-ai/utils.js.map +0 -1
  845. package/build/cjs/ai/core/apiPromise.js +0 -54
  846. package/build/cjs/ai/core/apiPromise.js.map +0 -1
  847. package/build/cjs/ai/core/gen-ai-attributes.js +0 -14
  848. package/build/cjs/ai/core/gen-ai-attributes.js.map +0 -1
  849. package/build/cjs/ai/core/utils.js +0 -182
  850. package/build/cjs/ai/core/utils.js.map +0 -1
  851. package/build/cjs/ai/flue/constants.js +0 -20
  852. package/build/cjs/ai/flue/constants.js.map +0 -1
  853. package/build/cjs/ai/flue/index.js +0 -143
  854. package/build/cjs/ai/flue/index.js.map +0 -1
  855. package/build/cjs/ai/flue/utils.js +0 -200
  856. package/build/cjs/ai/flue/utils.js.map +0 -1
  857. package/build/cjs/ai/google-genai/constants.js +0 -17
  858. package/build/cjs/ai/google-genai/constants.js.map +0 -1
  859. package/build/cjs/ai/google-genai/index.js +0 -275
  860. package/build/cjs/ai/google-genai/index.js.map +0 -1
  861. package/build/cjs/ai/google-genai/streaming.js +0 -76
  862. package/build/cjs/ai/google-genai/streaming.js.map +0 -1
  863. package/build/cjs/ai/google-genai/utils.js +0 -131
  864. package/build/cjs/ai/google-genai/utils.js.map +0 -1
  865. package/build/cjs/ai/langchain/constants.js +0 -19
  866. package/build/cjs/ai/langchain/constants.js.map +0 -1
  867. package/build/cjs/ai/langchain/embeddings.js +0 -82
  868. package/build/cjs/ai/langchain/embeddings.js.map +0 -1
  869. package/build/cjs/ai/langchain/index.js +0 -312
  870. package/build/cjs/ai/langchain/index.js.map +0 -1
  871. package/build/cjs/ai/langchain/typesafe-classifier.js +0 -62
  872. package/build/cjs/ai/langchain/typesafe-classifier.js.map +0 -1
  873. package/build/cjs/ai/langchain/utils.js +0 -354
  874. package/build/cjs/ai/langchain/utils.js.map +0 -1
  875. package/build/cjs/ai/langgraph/constants.js +0 -8
  876. package/build/cjs/ai/langgraph/constants.js.map +0 -1
  877. package/build/cjs/ai/langgraph/index.js +0 -174
  878. package/build/cjs/ai/langgraph/index.js.map +0 -1
  879. package/build/cjs/ai/langgraph/utils.js +0 -221
  880. package/build/cjs/ai/langgraph/utils.js.map +0 -1
  881. package/build/cjs/ai/mastra/classifier-evaluation.js +0 -30
  882. package/build/cjs/ai/mastra/classifier-evaluation.js.map +0 -1
  883. package/build/cjs/ai/mastra/constants.js +0 -41
  884. package/build/cjs/ai/mastra/constants.js.map +0 -1
  885. package/build/cjs/ai/mastra/index.js +0 -195
  886. package/build/cjs/ai/mastra/index.js.map +0 -1
  887. package/build/cjs/ai/mastra/span-registry.js +0 -20
  888. package/build/cjs/ai/mastra/span-registry.js.map +0 -1
  889. package/build/cjs/ai/mastra/utils.js +0 -177
  890. package/build/cjs/ai/mastra/utils.js.map +0 -1
  891. package/build/cjs/ai/mistral/constants.js +0 -20
  892. package/build/cjs/ai/mistral/constants.js.map +0 -1
  893. package/build/cjs/ai/mistral/index.js +0 -130
  894. package/build/cjs/ai/mistral/index.js.map +0 -1
  895. package/build/cjs/ai/mistral/streaming.js +0 -208
  896. package/build/cjs/ai/mistral/streaming.js.map +0 -1
  897. package/build/cjs/ai/mistral/utils.js +0 -87
  898. package/build/cjs/ai/mistral/utils.js.map +0 -1
  899. package/build/cjs/ai/openai/constants.js +0 -35
  900. package/build/cjs/ai/openai/constants.js.map +0 -1
  901. package/build/cjs/ai/openai/index.js +0 -176
  902. package/build/cjs/ai/openai/index.js.map +0 -1
  903. package/build/cjs/ai/openai/mapping.js +0 -67
  904. package/build/cjs/ai/openai/mapping.js.map +0 -1
  905. package/build/cjs/ai/openai/streaming.js +0 -163
  906. package/build/cjs/ai/openai/streaming.js.map +0 -1
  907. package/build/cjs/ai/openai/utils.js +0 -128
  908. package/build/cjs/ai/openai/utils.js.map +0 -1
  909. package/build/cjs/ai/pi-ai/messages.js +0 -135
  910. package/build/cjs/ai/pi-ai/messages.js.map +0 -1
  911. package/build/cjs/ai/pi-ai/providers.js +0 -22
  912. package/build/cjs/ai/pi-ai/providers.js.map +0 -1
  913. package/build/cjs/ai/pi-ai/usage.js +0 -34
  914. package/build/cjs/ai/pi-ai/usage.js.map +0 -1
  915. package/build/cjs/ai/pi-durable/constants.js +0 -22
  916. package/build/cjs/ai/pi-durable/constants.js.map +0 -1
  917. package/build/cjs/ai/pi-durable/index.js +0 -176
  918. package/build/cjs/ai/pi-durable/index.js.map +0 -1
  919. package/build/cjs/ai/pi-durable/models.js +0 -140
  920. package/build/cjs/ai/pi-durable/models.js.map +0 -1
  921. package/build/cjs/ai/pi-durable/runs.js +0 -159
  922. package/build/cjs/ai/pi-durable/runs.js.map +0 -1
  923. package/build/cjs/ai/pi-durable/tools.js +0 -178
  924. package/build/cjs/ai/pi-durable/tools.js.map +0 -1
  925. package/build/cjs/ai/pi-durable/utils.js +0 -9
  926. package/build/cjs/ai/pi-durable/utils.js.map +0 -1
  927. package/build/cjs/ai/typesafe/constants.js +0 -10
  928. package/build/cjs/ai/typesafe/constants.js.map +0 -1
  929. package/build/cjs/ai/typesafe/index.js +0 -112
  930. package/build/cjs/ai/typesafe/index.js.map +0 -1
  931. package/build/cjs/ai/vercel-ai/index.js +0 -70
  932. package/build/cjs/ai/vercel-ai/index.js.map +0 -1
  933. package/build/cjs/ai/workers-ai/constants.js +0 -10
  934. package/build/cjs/ai/workers-ai/constants.js.map +0 -1
  935. package/build/cjs/ai/workers-ai/index.js +0 -85
  936. package/build/cjs/ai/workers-ai/index.js.map +0 -1
  937. package/build/cjs/ai/workers-ai/streaming.js +0 -149
  938. package/build/cjs/ai/workers-ai/streaming.js.map +0 -1
  939. package/build/cjs/ai/workers-ai/utils.js +0 -166
  940. package/build/cjs/ai/workers-ai/utils.js.map +0 -1
  941. package/build/cjs/async-context.js +0 -68
  942. package/build/cjs/async-context.js.map +0 -1
  943. package/build/cjs/debug-build.js +0 -6
  944. package/build/cjs/debug-build.js.map +0 -1
  945. package/build/cjs/eve.js +0 -30
  946. package/build/cjs/eve.js.map +0 -1
  947. package/build/cjs/index.no-diagnostic-channels.js.map +0 -1
  948. package/build/cjs/integrations/amqplib.js +0 -417
  949. package/build/cjs/integrations/amqplib.js.map +0 -1
  950. package/build/cjs/integrations/anthropic.js +0 -145
  951. package/build/cjs/integrations/anthropic.js.map +0 -1
  952. package/build/cjs/integrations/aws-sdk/constants.js +0 -16
  953. package/build/cjs/integrations/aws-sdk/constants.js.map +0 -1
  954. package/build/cjs/integrations/aws-sdk/index.js +0 -145
  955. package/build/cjs/integrations/aws-sdk/index.js.map +0 -1
  956. package/build/cjs/integrations/aws-sdk/services/MessageAttributes.js +0 -46
  957. package/build/cjs/integrations/aws-sdk/services/MessageAttributes.js.map +0 -1
  958. package/build/cjs/integrations/aws-sdk/services/ServicesExtensions.js +0 -47
  959. package/build/cjs/integrations/aws-sdk/services/ServicesExtensions.js.map +0 -1
  960. package/build/cjs/integrations/aws-sdk/services/bedrock-runtime.js +0 -424
  961. package/build/cjs/integrations/aws-sdk/services/bedrock-runtime.js.map +0 -1
  962. package/build/cjs/integrations/aws-sdk/services/dynamodb.js +0 -130
  963. package/build/cjs/integrations/aws-sdk/services/dynamodb.js.map +0 -1
  964. package/build/cjs/integrations/aws-sdk/services/kinesis.js +0 -19
  965. package/build/cjs/integrations/aws-sdk/services/kinesis.js.map +0 -1
  966. package/build/cjs/integrations/aws-sdk/services/lambda.js +0 -63
  967. package/build/cjs/integrations/aws-sdk/services/lambda.js.map +0 -1
  968. package/build/cjs/integrations/aws-sdk/services/s3.js +0 -19
  969. package/build/cjs/integrations/aws-sdk/services/s3.js.map +0 -1
  970. package/build/cjs/integrations/aws-sdk/services/secretsmanager.js +0 -25
  971. package/build/cjs/integrations/aws-sdk/services/secretsmanager.js.map +0 -1
  972. package/build/cjs/integrations/aws-sdk/services/sns.js +0 -79
  973. package/build/cjs/integrations/aws-sdk/services/sns.js.map +0 -1
  974. package/build/cjs/integrations/aws-sdk/services/sqs.js +0 -135
  975. package/build/cjs/integrations/aws-sdk/services/sqs.js.map +0 -1
  976. package/build/cjs/integrations/aws-sdk/services/stepfunctions.js +0 -23
  977. package/build/cjs/integrations/aws-sdk/services/stepfunctions.js.map +0 -1
  978. package/build/cjs/integrations/aws-sdk/utils.js +0 -30
  979. package/build/cjs/integrations/aws-sdk/utils.js.map +0 -1
  980. package/build/cjs/integrations/cron.js +0 -49
  981. package/build/cjs/integrations/cron.js.map +0 -1
  982. package/build/cjs/integrations/dataloader.js +0 -118
  983. package/build/cjs/integrations/dataloader.js.map +0 -1
  984. package/build/cjs/integrations/express/error-handled.js +0 -17
  985. package/build/cjs/integrations/express/error-handled.js.map +0 -1
  986. package/build/cjs/integrations/express/error-handler.js +0 -43
  987. package/build/cjs/integrations/express/error-handler.js.map +0 -1
  988. package/build/cjs/integrations/express/index.js +0 -24
  989. package/build/cjs/integrations/express/index.js.map +0 -1
  990. package/build/cjs/integrations/express/instrumentation.js +0 -222
  991. package/build/cjs/integrations/express/instrumentation.js.map +0 -1
  992. package/build/cjs/integrations/express/route.js +0 -76
  993. package/build/cjs/integrations/express/route.js.map +0 -1
  994. package/build/cjs/integrations/express/utils.js +0 -12
  995. package/build/cjs/integrations/express/utils.js.map +0 -1
  996. package/build/cjs/integrations/fastify/errors.js +0 -36
  997. package/build/cjs/integrations/fastify/errors.js.map +0 -1
  998. package/build/cjs/integrations/fastify/index.js +0 -28
  999. package/build/cjs/integrations/fastify/index.js.map +0 -1
  1000. package/build/cjs/integrations/fastify/instrumentation.js +0 -252
  1001. package/build/cjs/integrations/fastify/instrumentation.js.map +0 -1
  1002. package/build/cjs/integrations/fastify/utils.js +0 -26
  1003. package/build/cjs/integrations/fastify/utils.js.map +0 -1
  1004. package/build/cjs/integrations/firebase/firestore.js +0 -93
  1005. package/build/cjs/integrations/firebase/firestore.js.map +0 -1
  1006. package/build/cjs/integrations/firebase/functions.js +0 -79
  1007. package/build/cjs/integrations/firebase/functions.js.map +0 -1
  1008. package/build/cjs/integrations/firebase/index.js +0 -20
  1009. package/build/cjs/integrations/firebase/index.js.map +0 -1
  1010. package/build/cjs/integrations/firebase/instrumentation.js +0 -56
  1011. package/build/cjs/integrations/firebase/instrumentation.js.map +0 -1
  1012. package/build/cjs/integrations/flue.js +0 -40
  1013. package/build/cjs/integrations/flue.js.map +0 -1
  1014. package/build/cjs/integrations/generic-pool.js +0 -36
  1015. package/build/cjs/integrations/generic-pool.js.map +0 -1
  1016. package/build/cjs/integrations/google-genai.js +0 -99
  1017. package/build/cjs/integrations/google-genai.js.map +0 -1
  1018. package/build/cjs/integrations/graphql/constants.js +0 -36
  1019. package/build/cjs/integrations/graphql/constants.js.map +0 -1
  1020. package/build/cjs/integrations/graphql/graphql-dc-subscriber.js +0 -122
  1021. package/build/cjs/integrations/graphql/graphql-dc-subscriber.js.map +0 -1
  1022. package/build/cjs/integrations/graphql/index.js +0 -60
  1023. package/build/cjs/integrations/graphql/index.js.map +0 -1
  1024. package/build/cjs/integrations/graphql/resolvers.js +0 -175
  1025. package/build/cjs/integrations/graphql/resolvers.js.map +0 -1
  1026. package/build/cjs/integrations/graphql/spans.js +0 -114
  1027. package/build/cjs/integrations/graphql/spans.js.map +0 -1
  1028. package/build/cjs/integrations/graphql/utils.js +0 -98
  1029. package/build/cjs/integrations/graphql/utils.js.map +0 -1
  1030. package/build/cjs/integrations/groq.js +0 -21
  1031. package/build/cjs/integrations/groq.js.map +0 -1
  1032. package/build/cjs/integrations/hapi/hapi-error-handler.js +0 -46
  1033. package/build/cjs/integrations/hapi/hapi-error-handler.js.map +0 -1
  1034. package/build/cjs/integrations/hapi/hapi-types.js +0 -23
  1035. package/build/cjs/integrations/hapi/hapi-types.js.map +0 -1
  1036. package/build/cjs/integrations/hapi/hapi-utils.js +0 -202
  1037. package/build/cjs/integrations/hapi/hapi-utils.js.map +0 -1
  1038. package/build/cjs/integrations/hapi/index.js +0 -73
  1039. package/build/cjs/integrations/hapi/index.js.map +0 -1
  1040. package/build/cjs/integrations/hono/applyPatches.js +0 -38
  1041. package/build/cjs/integrations/hono/applyPatches.js.map +0 -1
  1042. package/build/cjs/integrations/hono/connInfo.js +0 -37
  1043. package/build/cjs/integrations/hono/connInfo.js.map +0 -1
  1044. package/build/cjs/integrations/hono/constants.js +0 -6
  1045. package/build/cjs/integrations/hono/constants.js.map +0 -1
  1046. package/build/cjs/integrations/hono/createHonoMiddleware.js +0 -44
  1047. package/build/cjs/integrations/hono/createHonoMiddleware.js.map +0 -1
  1048. package/build/cjs/integrations/hono/defaultShouldHandleError.js +0 -14
  1049. package/build/cjs/integrations/hono/defaultShouldHandleError.js.map +0 -1
  1050. package/build/cjs/integrations/hono/hono-context.js +0 -14
  1051. package/build/cjs/integrations/hono/hono-context.js.map +0 -1
  1052. package/build/cjs/integrations/hono/honoIntegration.js +0 -98
  1053. package/build/cjs/integrations/hono/honoIntegration.js.map +0 -1
  1054. package/build/cjs/integrations/hono/isMiddleware.js +0 -22
  1055. package/build/cjs/integrations/hono/isMiddleware.js.map +0 -1
  1056. package/build/cjs/integrations/hono/matchResult.js +0 -18
  1057. package/build/cjs/integrations/hono/matchResult.js.map +0 -1
  1058. package/build/cjs/integrations/hono/middlewareHandlers.js +0 -91
  1059. package/build/cjs/integrations/hono/middlewareHandlers.js.map +0 -1
  1060. package/build/cjs/integrations/hono/patchAppRequest.js +0 -82
  1061. package/build/cjs/integrations/hono/patchAppRequest.js.map +0 -1
  1062. package/build/cjs/integrations/hono/patchAppUse.js +0 -70
  1063. package/build/cjs/integrations/hono/patchAppUse.js.map +0 -1
  1064. package/build/cjs/integrations/hono/patchRoute.js +0 -73
  1065. package/build/cjs/integrations/hono/patchRoute.js.map +0 -1
  1066. package/build/cjs/integrations/hono/resolveRouteName.js +0 -31
  1067. package/build/cjs/integrations/hono/resolveRouteName.js.map +0 -1
  1068. package/build/cjs/integrations/hono/wrapMiddlewareSpan.js +0 -52
  1069. package/build/cjs/integrations/hono/wrapMiddlewareSpan.js.map +0 -1
  1070. package/build/cjs/integrations/index.js +0 -93
  1071. package/build/cjs/integrations/index.js.map +0 -1
  1072. package/build/cjs/integrations/kafkajs/consumer.js +0 -71
  1073. package/build/cjs/integrations/kafkajs/consumer.js.map +0 -1
  1074. package/build/cjs/integrations/kafkajs/index.js +0 -70
  1075. package/build/cjs/integrations/kafkajs/index.js.map +0 -1
  1076. package/build/cjs/integrations/kafkajs/semconv.js +0 -14
  1077. package/build/cjs/integrations/kafkajs/semconv.js.map +0 -1
  1078. package/build/cjs/integrations/kafkajs/spans.js +0 -127
  1079. package/build/cjs/integrations/kafkajs/spans.js.map +0 -1
  1080. package/build/cjs/integrations/knex.js +0 -187
  1081. package/build/cjs/integrations/knex.js.map +0 -1
  1082. package/build/cjs/integrations/koa/index.js +0 -155
  1083. package/build/cjs/integrations/koa/index.js.map +0 -1
  1084. package/build/cjs/integrations/koa/koa-error-handler.js +0 -33
  1085. package/build/cjs/integrations/koa/koa-error-handler.js.map +0 -1
  1086. package/build/cjs/integrations/langchain.js +0 -92
  1087. package/build/cjs/integrations/langchain.js.map +0 -1
  1088. package/build/cjs/integrations/langgraph.js +0 -87
  1089. package/build/cjs/integrations/langgraph.js.map +0 -1
  1090. package/build/cjs/integrations/lru-memoizer.js +0 -29
  1091. package/build/cjs/integrations/lru-memoizer.js.map +0 -1
  1092. package/build/cjs/integrations/mastra-classifier.js +0 -57
  1093. package/build/cjs/integrations/mastra-classifier.js.map +0 -1
  1094. package/build/cjs/integrations/mastra.js +0 -247
  1095. package/build/cjs/integrations/mastra.js.map +0 -1
  1096. package/build/cjs/integrations/mcp-server.js +0 -37
  1097. package/build/cjs/integrations/mcp-server.js.map +0 -1
  1098. package/build/cjs/integrations/mistral.js +0 -69
  1099. package/build/cjs/integrations/mistral.js.map +0 -1
  1100. package/build/cjs/integrations/mongodb/index.js +0 -94
  1101. package/build/cjs/integrations/mongodb/index.js.map +0 -1
  1102. package/build/cjs/integrations/mongodb/mongodb-span.js +0 -135
  1103. package/build/cjs/integrations/mongodb/mongodb-span.js.map +0 -1
  1104. package/build/cjs/integrations/mongoose/index.js +0 -109
  1105. package/build/cjs/integrations/mongoose/index.js.map +0 -1
  1106. package/build/cjs/integrations/mongoose/mongoose-dc-subscriber.js +0 -101
  1107. package/build/cjs/integrations/mongoose/mongoose-dc-subscriber.js.map +0 -1
  1108. package/build/cjs/integrations/mongoose/mongoose-legacy-span.js +0 -41
  1109. package/build/cjs/integrations/mongoose/mongoose-legacy-span.js.map +0 -1
  1110. package/build/cjs/integrations/mysql.js +0 -101
  1111. package/build/cjs/integrations/mysql.js.map +0 -1
  1112. package/build/cjs/integrations/mysql2/index.js +0 -80
  1113. package/build/cjs/integrations/mysql2/index.js.map +0 -1
  1114. package/build/cjs/integrations/mysql2/mysql2-dc-subscriber.js +0 -57
  1115. package/build/cjs/integrations/mysql2/mysql2-dc-subscriber.js.map +0 -1
  1116. package/build/cjs/integrations/neon.js +0 -107
  1117. package/build/cjs/integrations/neon.js.map +0 -1
  1118. package/build/cjs/integrations/nitro/captureStorageEvents.js +0 -132
  1119. package/build/cjs/integrations/nitro/captureStorageEvents.js.map +0 -1
  1120. package/build/cjs/integrations/nitro/captureTracingEvents.js +0 -202
  1121. package/build/cjs/integrations/nitro/captureTracingEvents.js.map +0 -1
  1122. package/build/cjs/integrations/nitro/index.js +0 -27
  1123. package/build/cjs/integrations/nitro/index.js.map +0 -1
  1124. package/build/cjs/integrations/nitro/setServerTimingHeaders.js +0 -40
  1125. package/build/cjs/integrations/nitro/setServerTimingHeaders.js.map +0 -1
  1126. package/build/cjs/integrations/node-cron.js +0 -68
  1127. package/build/cjs/integrations/node-cron.js.map +0 -1
  1128. package/build/cjs/integrations/node-schedule.js +0 -76
  1129. package/build/cjs/integrations/node-schedule.js.map +0 -1
  1130. package/build/cjs/integrations/openai-compatible.js +0 -90
  1131. package/build/cjs/integrations/openai-compatible.js.map +0 -1
  1132. package/build/cjs/integrations/openai.js +0 -93
  1133. package/build/cjs/integrations/openai.js.map +0 -1
  1134. package/build/cjs/integrations/pg.js +0 -171
  1135. package/build/cjs/integrations/pg.js.map +0 -1
  1136. package/build/cjs/integrations/pi-durable.js +0 -50
  1137. package/build/cjs/integrations/pi-durable.js.map +0 -1
  1138. package/build/cjs/integrations/postgresjs/index.js +0 -147
  1139. package/build/cjs/integrations/postgresjs/index.js.map +0 -1
  1140. package/build/cjs/integrations/postgresjs/postgresjs-dc-subscriber.js +0 -81
  1141. package/build/cjs/integrations/postgresjs/postgresjs-dc-subscriber.js.map +0 -1
  1142. package/build/cjs/integrations/postgresjs-wrapper.js +0 -219
  1143. package/build/cjs/integrations/postgresjs-wrapper.js.map +0 -1
  1144. package/build/cjs/integrations/prisma/global.js +0 -14
  1145. package/build/cjs/integrations/prisma/global.js.map +0 -1
  1146. package/build/cjs/integrations/prisma/index.js +0 -36
  1147. package/build/cjs/integrations/prisma/index.js.map +0 -1
  1148. package/build/cjs/integrations/prisma/orchestrion.js +0 -137
  1149. package/build/cjs/integrations/prisma/orchestrion.js.map +0 -1
  1150. package/build/cjs/integrations/prisma/tracing-helper.js +0 -241
  1151. package/build/cjs/integrations/prisma/tracing-helper.js.map +0 -1
  1152. package/build/cjs/integrations/redis/index.js +0 -223
  1153. package/build/cjs/integrations/redis/index.js.map +0 -1
  1154. package/build/cjs/integrations/redis/ioredis-channel-subscriber.js +0 -87
  1155. package/build/cjs/integrations/redis/ioredis-channel-subscriber.js.map +0 -1
  1156. package/build/cjs/integrations/redis/redis-cache.js +0 -144
  1157. package/build/cjs/integrations/redis/redis-cache.js.map +0 -1
  1158. package/build/cjs/integrations/redis/redis-dc-subscriber.js +0 -107
  1159. package/build/cjs/integrations/redis/redis-dc-subscriber.js.map +0 -1
  1160. package/build/cjs/integrations/redis/redis-span-name.js +0 -32
  1161. package/build/cjs/integrations/redis/redis-span-name.js.map +0 -1
  1162. package/build/cjs/integrations/redis/redis-statement-serializer.js +0 -34
  1163. package/build/cjs/integrations/redis/redis-statement-serializer.js.map +0 -1
  1164. package/build/cjs/integrations/tedious.js +0 -160
  1165. package/build/cjs/integrations/tedious.js.map +0 -1
  1166. package/build/cjs/integrations/together-ai.js +0 -19
  1167. package/build/cjs/integrations/together-ai.js.map +0 -1
  1168. package/build/cjs/integrations/typesafe.js +0 -45
  1169. package/build/cjs/integrations/typesafe.js.map +0 -1
  1170. package/build/cjs/integrations/vercel-ai/gen-ai-recording-mode.js +0 -13
  1171. package/build/cjs/integrations/vercel-ai/gen-ai-recording-mode.js.map +0 -1
  1172. package/build/cjs/integrations/vercel-ai/index.js +0 -34
  1173. package/build/cjs/integrations/vercel-ai/index.js.map +0 -1
  1174. package/build/cjs/integrations/vercel-ai/util.js +0 -108
  1175. package/build/cjs/integrations/vercel-ai/util.js.map +0 -1
  1176. package/build/cjs/integrations/vercel-ai/vercel-ai-dc-subscriber.js +0 -581
  1177. package/build/cjs/integrations/vercel-ai/vercel-ai-dc-subscriber.js.map +0 -1
  1178. package/build/cjs/integrations/vercel-ai/vercel-ai-orchestrion-subscriber.js +0 -409
  1179. package/build/cjs/integrations/vercel-ai/vercel-ai-orchestrion-subscriber.js.map +0 -1
  1180. package/build/cjs/integrations/vercel-ai/vercel-ai-tool-telemetry.js +0 -40
  1181. package/build/cjs/integrations/vercel-ai/vercel-ai-tool-telemetry.js.map +0 -1
  1182. package/build/cjs/opentelemetry.js +0 -45
  1183. package/build/cjs/opentelemetry.js.map +0 -1
  1184. package/build/cjs/orchestrion/bundler/externalRequire.js +0 -82
  1185. package/build/cjs/orchestrion/bundler/externalRequire.js.map +0 -1
  1186. package/build/cjs/orchestrion/bundler/moduleInjectedTransform.js +0 -55
  1187. package/build/cjs/orchestrion/bundler/moduleInjectedTransform.js.map +0 -1
  1188. package/build/cjs/orchestrion/bundler/options.js +0 -25
  1189. package/build/cjs/orchestrion/bundler/options.js.map +0 -1
  1190. package/build/cjs/orchestrion/bundler/resolve.js +0 -27
  1191. package/build/cjs/orchestrion/bundler/resolve.js.map +0 -1
  1192. package/build/cjs/orchestrion/channels.js +0 -92
  1193. package/build/cjs/orchestrion/channels.js.map +0 -1
  1194. package/build/cjs/orchestrion/config/amqplib.js +0 -93
  1195. package/build/cjs/orchestrion/config/amqplib.js.map +0 -1
  1196. package/build/cjs/orchestrion/config/anthropic-ai.js +0 -53
  1197. package/build/cjs/orchestrion/config/anthropic-ai.js.map +0 -1
  1198. package/build/cjs/orchestrion/config/aws-sdk.js +0 -32
  1199. package/build/cjs/orchestrion/config/aws-sdk.js.map +0 -1
  1200. package/build/cjs/orchestrion/config/channel-integration-definitions.js +0 -59
  1201. package/build/cjs/orchestrion/config/channel-integration-definitions.js.map +0 -1
  1202. package/build/cjs/orchestrion/config/cron.js +0 -26
  1203. package/build/cjs/orchestrion/config/cron.js.map +0 -1
  1204. package/build/cjs/orchestrion/config/dataloader.js +0 -53
  1205. package/build/cjs/orchestrion/config/dataloader.js.map +0 -1
  1206. package/build/cjs/orchestrion/config/express.js +0 -81
  1207. package/build/cjs/orchestrion/config/express.js.map +0 -1
  1208. package/build/cjs/orchestrion/config/firebase.js +0 -85
  1209. package/build/cjs/orchestrion/config/firebase.js.map +0 -1
  1210. package/build/cjs/orchestrion/config/flue.js +0 -10
  1211. package/build/cjs/orchestrion/config/flue.js.map +0 -1
  1212. package/build/cjs/orchestrion/config/generic-pool.js +0 -25
  1213. package/build/cjs/orchestrion/config/generic-pool.js.map +0 -1
  1214. package/build/cjs/orchestrion/config/google-genai.js +0 -43
  1215. package/build/cjs/orchestrion/config/google-genai.js.map +0 -1
  1216. package/build/cjs/orchestrion/config/graphql.js +0 -32
  1217. package/build/cjs/orchestrion/config/graphql.js.map +0 -1
  1218. package/build/cjs/orchestrion/config/groq.js +0 -19
  1219. package/build/cjs/orchestrion/config/groq.js.map +0 -1
  1220. package/build/cjs/orchestrion/config/hapi.js +0 -48
  1221. package/build/cjs/orchestrion/config/hapi.js.map +0 -1
  1222. package/build/cjs/orchestrion/config/hono.js +0 -34
  1223. package/build/cjs/orchestrion/config/hono.js.map +0 -1
  1224. package/build/cjs/orchestrion/config/index.js.map +0 -1
  1225. package/build/cjs/orchestrion/config/ioredis.js +0 -41
  1226. package/build/cjs/orchestrion/config/ioredis.js.map +0 -1
  1227. package/build/cjs/orchestrion/config/kafkajs.js +0 -34
  1228. package/build/cjs/orchestrion/config/kafkajs.js.map +0 -1
  1229. package/build/cjs/orchestrion/config/knex.js +0 -43
  1230. package/build/cjs/orchestrion/config/knex.js.map +0 -1
  1231. package/build/cjs/orchestrion/config/koa.js +0 -32
  1232. package/build/cjs/orchestrion/config/koa.js.map +0 -1
  1233. package/build/cjs/orchestrion/config/langchain.js +0 -66
  1234. package/build/cjs/orchestrion/config/langchain.js.map +0 -1
  1235. package/build/cjs/orchestrion/config/langgraph.js +0 -32
  1236. package/build/cjs/orchestrion/config/langgraph.js.map +0 -1
  1237. package/build/cjs/orchestrion/config/lru-memoizer.js +0 -21
  1238. package/build/cjs/orchestrion/config/lru-memoizer.js.map +0 -1
  1239. package/build/cjs/orchestrion/config/mastra.js +0 -54
  1240. package/build/cjs/orchestrion/config/mastra.js.map +0 -1
  1241. package/build/cjs/orchestrion/config/mcp-server.js +0 -41
  1242. package/build/cjs/orchestrion/config/mcp-server.js.map +0 -1
  1243. package/build/cjs/orchestrion/config/mistral.js +0 -57
  1244. package/build/cjs/orchestrion/config/mistral.js.map +0 -1
  1245. package/build/cjs/orchestrion/config/module-names.js +0 -8
  1246. package/build/cjs/orchestrion/config/module-names.js.map +0 -1
  1247. package/build/cjs/orchestrion/config/mongodb.js +0 -71
  1248. package/build/cjs/orchestrion/config/mongodb.js.map +0 -1
  1249. package/build/cjs/orchestrion/config/mongoose.js +0 -113
  1250. package/build/cjs/orchestrion/config/mongoose.js.map +0 -1
  1251. package/build/cjs/orchestrion/config/mysql.js +0 -20
  1252. package/build/cjs/orchestrion/config/mysql.js.map +0 -1
  1253. package/build/cjs/orchestrion/config/mysql2.js +0 -38
  1254. package/build/cjs/orchestrion/config/mysql2.js.map +0 -1
  1255. package/build/cjs/orchestrion/config/neon.js +0 -46
  1256. package/build/cjs/orchestrion/config/neon.js.map +0 -1
  1257. package/build/cjs/orchestrion/config/nestjs.js +0 -130
  1258. package/build/cjs/orchestrion/config/nestjs.js.map +0 -1
  1259. package/build/cjs/orchestrion/config/nitro.js +0 -10
  1260. package/build/cjs/orchestrion/config/nitro.js.map +0 -1
  1261. package/build/cjs/orchestrion/config/node-cron.js +0 -53
  1262. package/build/cjs/orchestrion/config/node-cron.js.map +0 -1
  1263. package/build/cjs/orchestrion/config/node-schedule.js +0 -29
  1264. package/build/cjs/orchestrion/config/node-schedule.js.map +0 -1
  1265. package/build/cjs/orchestrion/config/openai-compatible.js +0 -19
  1266. package/build/cjs/orchestrion/config/openai-compatible.js.map +0 -1
  1267. package/build/cjs/orchestrion/config/openai.js +0 -49
  1268. package/build/cjs/orchestrion/config/openai.js.map +0 -1
  1269. package/build/cjs/orchestrion/config/pg.js +0 -55
  1270. package/build/cjs/orchestrion/config/pg.js.map +0 -1
  1271. package/build/cjs/orchestrion/config/pi-durable.js +0 -34
  1272. package/build/cjs/orchestrion/config/pi-durable.js.map +0 -1
  1273. package/build/cjs/orchestrion/config/postgres.js +0 -58
  1274. package/build/cjs/orchestrion/config/postgres.js.map +0 -1
  1275. package/build/cjs/orchestrion/config/prisma.js +0 -53
  1276. package/build/cjs/orchestrion/config/prisma.js.map +0 -1
  1277. package/build/cjs/orchestrion/config/redis.js +0 -82
  1278. package/build/cjs/orchestrion/config/redis.js.map +0 -1
  1279. package/build/cjs/orchestrion/config/registration-only.js +0 -15
  1280. package/build/cjs/orchestrion/config/registration-only.js.map +0 -1
  1281. package/build/cjs/orchestrion/config/remix-v3.js +0 -55
  1282. package/build/cjs/orchestrion/config/remix-v3.js.map +0 -1
  1283. package/build/cjs/orchestrion/config/remix.js +0 -54
  1284. package/build/cjs/orchestrion/config/remix.js.map +0 -1
  1285. package/build/cjs/orchestrion/config/tedious.js +0 -28
  1286. package/build/cjs/orchestrion/config/tedious.js.map +0 -1
  1287. package/build/cjs/orchestrion/config/together-ai.js +0 -23
  1288. package/build/cjs/orchestrion/config/together-ai.js.map +0 -1
  1289. package/build/cjs/orchestrion/config/typesafe.js +0 -18
  1290. package/build/cjs/orchestrion/config/typesafe.js.map +0 -1
  1291. package/build/cjs/orchestrion/config/vercel-ai.js +0 -56
  1292. package/build/cjs/orchestrion/config/vercel-ai.js.map +0 -1
  1293. package/build/cjs/orchestrion/detect.js +0 -29
  1294. package/build/cjs/orchestrion/detect.js.map +0 -1
  1295. package/build/cjs/orchestrion/instrumentation.js +0 -80
  1296. package/build/cjs/orchestrion/instrumentation.js.map +0 -1
  1297. package/build/cjs/tracing-channel.js +0 -152
  1298. package/build/cjs/tracing-channel.js.map +0 -1
  1299. package/build/cjs/utils/cronMonitoring.js +0 -160
  1300. package/build/cjs/utils/cronMonitoring.js.map +0 -1
  1301. package/build/cjs/utils/diagnosticsChannel.js +0 -47
  1302. package/build/cjs/utils/diagnosticsChannel.js.map +0 -1
  1303. package/build/cjs/utils/moduleInjected.js +0 -18
  1304. package/build/cjs/utils/moduleInjected.js.map +0 -1
  1305. package/build/cjs/utils/monitorStream.js +0 -63
  1306. package/build/cjs/utils/monitorStream.js.map +0 -1
  1307. package/build/cjs/utils/setHttpServerSpanRouteAttribute.js +0 -26
  1308. package/build/cjs/utils/setHttpServerSpanRouteAttribute.js.map +0 -1
  1309. package/build/cjs/utils/sql.js +0 -285
  1310. package/build/cjs/utils/sql.js.map +0 -1
  1311. package/build/cjs/utils/withCleanScopes.js +0 -17
  1312. package/build/cjs/utils/withCleanScopes.js.map +0 -1
  1313. package/build/cjs/utils/wrapServerRequestHandler.js +0 -209
  1314. package/build/cjs/utils/wrapServerRequestHandler.js.map +0 -1
  1315. package/build/cjs/vendored/@apm-js-collab/code-transformer/index.js +0 -8
  1316. package/build/cjs/vendored/@apm-js-collab/code-transformer/index.js.map +0 -1
  1317. package/build/cjs/vendored/@apm-js-collab/code-transformer/lib/index.js +0 -12
  1318. package/build/cjs/vendored/@apm-js-collab/code-transformer/lib/index.js.map +0 -1
  1319. package/build/cjs/vendored/@apm-js-collab/code-transformer/lib/matcher.js +0 -86
  1320. package/build/cjs/vendored/@apm-js-collab/code-transformer/lib/matcher.js.map +0 -1
  1321. package/build/cjs/vendored/@apm-js-collab/code-transformer/lib/transformer.js +0 -316
  1322. package/build/cjs/vendored/@apm-js-collab/code-transformer/lib/transformer.js.map +0 -1
  1323. package/build/cjs/vendored/@apm-js-collab/code-transformer/lib/transforms.js +0 -470
  1324. package/build/cjs/vendored/@apm-js-collab/code-transformer/lib/transforms.js.map +0 -1
  1325. package/build/cjs/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/bun.js +0 -65
  1326. package/build/cjs/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/bun.js.map +0 -1
  1327. package/build/cjs/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/core-Bd0h-mo3.js.map +0 -1
  1328. package/build/cjs/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/esbuild.js.map +0 -1
  1329. package/build/cjs/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/instrumentation-serde-C-Xxv-jj.js.map +0 -1
  1330. package/build/cjs/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/rollup-DCG8HLmh.js.map +0 -1
  1331. package/build/cjs/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/vite.js +0 -14
  1332. package/build/cjs/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/vite.js.map +0 -1
  1333. package/build/cjs/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/webpack-loader-factory.js +0 -117
  1334. package/build/cjs/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/webpack-loader-factory.js.map +0 -1
  1335. package/build/cjs/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/webpack.js +0 -103
  1336. package/build/cjs/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/webpack.js.map +0 -1
  1337. package/build/cjs/vendored/astring/dist/astring.js +0 -1068
  1338. package/build/cjs/vendored/astring/dist/astring.js.map +0 -1
  1339. package/build/cjs/vendored/esquery/dist/esquery.esm.min.js +0 -847
  1340. package/build/cjs/vendored/esquery/dist/esquery.esm.min.js.map +0 -1
  1341. package/build/cjs/vendored/meriyah/dist/meriyah.js +0 -9192
  1342. package/build/cjs/vendored/meriyah/dist/meriyah.js.map +0 -1
  1343. package/build/cjs/vendored/meriyah/dist/meriyah2.js +0 -9209
  1344. package/build/cjs/vendored/meriyah/dist/meriyah2.js.map +0 -1
  1345. package/build/cjs/vendored/module-details-from-path/index.js +0 -43
  1346. package/build/cjs/vendored/module-details-from-path/index.js.map +0 -1
  1347. package/build/cjs/vendored/semifies/index.js +0 -111
  1348. package/build/cjs/vendored/semifies/index.js.map +0 -1
  1349. package/build/cjs/vendored/source-map/lib/array-set.js +0 -73
  1350. package/build/cjs/vendored/source-map/lib/array-set.js.map +0 -1
  1351. package/build/cjs/vendored/source-map/lib/base64-vlq.js +0 -57
  1352. package/build/cjs/vendored/source-map/lib/base64-vlq.js.map +0 -1
  1353. package/build/cjs/vendored/source-map/lib/base64.js +0 -42
  1354. package/build/cjs/vendored/source-map/lib/base64.js.map +0 -1
  1355. package/build/cjs/vendored/source-map/lib/binary-search.js +0 -55
  1356. package/build/cjs/vendored/source-map/lib/binary-search.js.map +0 -1
  1357. package/build/cjs/vendored/source-map/lib/mapping-list.js +0 -42
  1358. package/build/cjs/vendored/source-map/lib/mapping-list.js.map +0 -1
  1359. package/build/cjs/vendored/source-map/lib/quick-sort.js +0 -36
  1360. package/build/cjs/vendored/source-map/lib/quick-sort.js.map +0 -1
  1361. package/build/cjs/vendored/source-map/lib/source-map-consumer.js +0 -612
  1362. package/build/cjs/vendored/source-map/lib/source-map-consumer.js.map +0 -1
  1363. package/build/cjs/vendored/source-map/lib/source-map-generator.js +0 -285
  1364. package/build/cjs/vendored/source-map/lib/source-map-generator.js.map +0 -1
  1365. package/build/cjs/vendored/source-map/lib/source-node.js +0 -270
  1366. package/build/cjs/vendored/source-map/lib/source-node.js.map +0 -1
  1367. package/build/cjs/vendored/source-map/lib/util.js +0 -300
  1368. package/build/cjs/vendored/source-map/lib/util.js.map +0 -1
  1369. package/build/cjs/vendored/source-map/source-map.js +0 -16
  1370. package/build/cjs/vendored/source-map/source-map.js.map +0 -1
  1371. package/build/esm/_virtual/_commonjsHelpers.js +0 -6
  1372. package/build/esm/_virtual/_commonjsHelpers.js.map +0 -1
  1373. package/build/esm/_virtual/array-set.js +0 -4
  1374. package/build/esm/_virtual/array-set.js.map +0 -1
  1375. package/build/esm/_virtual/astring.js +0 -4
  1376. package/build/esm/_virtual/astring.js.map +0 -1
  1377. package/build/esm/_virtual/base64-vlq.js +0 -4
  1378. package/build/esm/_virtual/base64-vlq.js.map +0 -1
  1379. package/build/esm/_virtual/base64.js +0 -4
  1380. package/build/esm/_virtual/base64.js.map +0 -1
  1381. package/build/esm/_virtual/binary-search.js +0 -4
  1382. package/build/esm/_virtual/binary-search.js.map +0 -1
  1383. package/build/esm/_virtual/mapping-list.js +0 -4
  1384. package/build/esm/_virtual/mapping-list.js.map +0 -1
  1385. package/build/esm/_virtual/meriyah.js +0 -4
  1386. package/build/esm/_virtual/meriyah.js.map +0 -1
  1387. package/build/esm/_virtual/quick-sort.js +0 -4
  1388. package/build/esm/_virtual/quick-sort.js.map +0 -1
  1389. package/build/esm/_virtual/source-map-consumer.js +0 -4
  1390. package/build/esm/_virtual/source-map-consumer.js.map +0 -1
  1391. package/build/esm/_virtual/source-map-generator.js +0 -4
  1392. package/build/esm/_virtual/source-map-generator.js.map +0 -1
  1393. package/build/esm/_virtual/source-map.js +0 -4
  1394. package/build/esm/_virtual/source-map.js.map +0 -1
  1395. package/build/esm/_virtual/source-node.js +0 -4
  1396. package/build/esm/_virtual/source-node.js.map +0 -1
  1397. package/build/esm/_virtual/util.js +0 -4
  1398. package/build/esm/_virtual/util.js.map +0 -1
  1399. package/build/esm/ai/pi-durable/models.js +0 -138
  1400. package/build/esm/ai/pi-durable/models.js.map +0 -1
  1401. package/build/esm/index.no-diagnostic-channels.js.map +0 -1
  1402. package/build/esm/index.request-handler.js.map +0 -1
  1403. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/core-Bd0h-mo3.js.map +0 -1
  1404. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/rollup-DCG8HLmh.js.map +0 -1
  1405. package/build/esm/vendored/esquery/dist/esquery.esm.min.js +0 -845
  1406. package/build/esm/vendored/esquery/dist/esquery.esm.min.js.map +0 -1
  1407. package/build/types/ai/pi-durable/models.d.ts +0 -10
  1408. package/build/types/ai/pi-durable/models.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"setServerTimingHeaders.js","sources":["../../../../src/integrations/nitro/setServerTimingHeaders.ts"],"sourcesContent":["import { getTraceData, GLOBAL_OBJ } from '@sentry/core';\nimport * as diagnosticsChannel from '../../utils/diagnosticsChannel';\nimport type { H3TracingRequestEvent, NitroH3Event } from './nitroTypes';\n\nconst globalWithServerTiming = GLOBAL_OBJ as typeof GLOBAL_OBJ & {\n __SENTRY_NITRO_SERVER_TIMING_INSTRUMENTED__: boolean;\n};\n\n/**\n * Subscribes to the h3 request tracing channel to set Server-Timing trace headers on every response.\n *\n * This is deliberately independent of span sampling: `getTraceData()` returns valid trace\n * propagation data even in tracing-without-performance mode, and the browser SDK reads these headers\n * (via the Performance API) to connect a pageload to the backend trace regardless of whether the\n * server records spans.\n */\nexport function captureServerTimingHeaders(): void {\n if (globalWithServerTiming.__SENTRY_NITRO_SERVER_TIMING_INSTRUMENTED__) {\n return;\n }\n\n // Bail if this is not available (e.g. Node without tracing channel support)\n if (!diagnosticsChannel.tracingChannel) {\n return;\n }\n\n diagnosticsChannel.tracingChannel<H3TracingRequestEvent>('h3.request').start.subscribe(message => {\n setServerTimingHeaders((message as H3TracingRequestEvent).event);\n });\n\n globalWithServerTiming.__SENTRY_NITRO_SERVER_TIMING_INSTRUMENTED__ = true;\n}\n\n/**\n * Sets Server-Timing response headers for trace propagation to the client.\n * The browser SDK reads these via the Performance API to connect pageload traces.\n */\nfunction setServerTimingHeaders(event: NitroH3Event): void {\n if (event.context?._sentryServerTimingSet) {\n return;\n }\n\n const headers = event.res?.headers;\n if (!headers) {\n return;\n }\n\n const traceData = getTraceData();\n if (traceData['sentry-trace']) {\n headers.append('Server-Timing', `sentry-trace;desc=\"${traceData['sentry-trace']}\"`);\n }\n if (traceData.baggage) {\n headers.append('Server-Timing', `baggage;desc=\"${traceData.baggage}\"`);\n }\n\n if (event.context) {\n event.context._sentryServerTimingSet = true;\n }\n}\n"],"names":["diagnosticsChannel.tracingChannel"],"mappings":";;;AAIA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAyB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAYxB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,0BAAA,CAAA,CAAA,CAAmC;AACjD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAuB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA6C;AACtE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CACF;AAGA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAACA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAmB,CAAA,CAAgB;AACtC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CA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,CAAA,CACzC;AACF;;"}
1
+ {"version":3,"file":"setServerTimingHeaders.js","names":["diagnosticsChannel.tracingChannel"],"sources":["../../../../src/integrations/nitro/setServerTimingHeaders.ts"],"sourcesContent":["import { getTraceData, GLOBAL_OBJ } from '@sentry/core';\nimport * as diagnosticsChannel from '../../utils/diagnosticsChannel';\nimport type { H3TracingRequestEvent, NitroH3Event } from './nitroTypes';\n\ntype GlobalWithServerTiming = typeof GLOBAL_OBJ & {\n __SENTRY_NITRO_SERVER_TIMING_INSTRUMENTED__?: boolean;\n};\n\n/**\n * Subscribes to the h3 request tracing channel to set Server-Timing trace headers on every response.\n *\n * This is deliberately independent of span sampling: `getTraceData()` returns valid trace\n * propagation data even in tracing-without-performance mode, and the browser SDK reads these headers\n * (via the Performance API) to connect a pageload to the backend trace regardless of whether the\n * server records spans.\n */\nexport function captureServerTimingHeaders(): void {\n const globalWithServerTiming = GLOBAL_OBJ as GlobalWithServerTiming;\n if (globalWithServerTiming.__SENTRY_NITRO_SERVER_TIMING_INSTRUMENTED__) {\n return;\n }\n\n // Bail if this is not available (e.g. Node without tracing channel support)\n if (!diagnosticsChannel.tracingChannel) {\n return;\n }\n\n diagnosticsChannel.tracingChannel<H3TracingRequestEvent>('h3.request').start.subscribe(message => {\n setServerTimingHeaders((message as H3TracingRequestEvent).event);\n });\n\n globalWithServerTiming.__SENTRY_NITRO_SERVER_TIMING_INSTRUMENTED__ = true;\n}\n\n/**\n * Sets Server-Timing response headers for trace propagation to the client.\n * The browser SDK reads these via the Performance API to connect pageload traces.\n */\nfunction setServerTimingHeaders(event: NitroH3Event): void {\n if (event.context?._sentryServerTimingSet) {\n return;\n }\n\n const headers = event.res?.headers;\n if (!headers) {\n return;\n }\n\n const traceData = getTraceData();\n if (traceData['sentry-trace']) {\n headers.append('Server-Timing', `sentry-trace;desc=\"${traceData['sentry-trace']}\"`);\n }\n if (traceData.baggage) {\n headers.append('Server-Timing', `baggage;desc=\"${traceData.baggage}\"`);\n }\n\n if (event.context) {\n event.context._sentryServerTimingSet = true;\n }\n}\n"],"mappings":";;;;;;;;;;;AAgBA,SAAgB,6BAAmC;CACjD,MAAM,yBAAyB;CAC/B,IAAI,uBAAuB,6CACzB;CAIF,IAAI,CAACA,gBACH;CAGFA,eAAyD,YAAY,CAAC,CAAC,MAAM,WAAU,YAAW;EAChG,uBAAwB,QAAkC,KAAK;CACjE,CAAC;CAED,uBAAuB,8CAA8C;AACvE;;;;;AAMA,SAAS,uBAAuB,OAA2B;CACzD,IAAI,MAAM,SAAS,wBACjB;CAGF,MAAM,UAAU,MAAM,KAAK;CAC3B,IAAI,CAAC,SACH;CAGF,MAAM,YAAY,aAAa;CAC/B,IAAI,UAAU,iBACZ,QAAQ,OAAO,iBAAiB,sBAAsB,UAAU,gBAAgB,EAAE;CAEpF,IAAI,UAAU,SACZ,QAAQ,OAAO,iBAAiB,iBAAiB,UAAU,QAAQ,EAAE;CAGvE,IAAI,MAAM,SACR,MAAM,QAAQ,yBAAyB;AAE3C"}
@@ -1,63 +1,68 @@
1
- import { defineIntegration } from '@sentry/core';
2
- import { CHANNELS } from '../orchestrion/channels.js';
3
- import { nodeCronModuleNames } from '../orchestrion/config/node-cron.js';
4
- import { invokeOrchestrionInstrumentation } from '../orchestrion/instrumentation.js';
5
- import { subscribeToJobCreation, shouldMonitorJob, wrapScheduledJob, cronExpressionToMonitorConfig } from '../utils/cronMonitoring.js';
6
-
1
+ import { CHANNELS } from "../orchestrion/channels.js";
2
+ import { nodeCronModuleNames } from "../orchestrion/config/node-cron.js";
3
+ import { invokeOrchestrionInstrumentation } from "../orchestrion/instrumentation.js";
4
+ import { cronExpressionToMonitorConfig, shouldMonitorJob, subscribeToJobCreation, wrapScheduledJob } from "../utils/cronMonitoring.js";
5
+ import { defineIntegration } from "@sentry/core";
6
+ // src/integrations/node-cron.ts
7
7
  const INTEGRATION_NAME = "NodeCron";
8
8
  const _nodeCronIntegration = ((options = {}) => {
9
- return {
10
- name: INTEGRATION_NAME,
11
- setup(client) {
12
- invokeOrchestrionInstrumentation(client, nodeCronModuleNames, subscribe, [options], {
13
- // The binding only parents spans, and this integration creates none.
14
- requiresTracingChannelBinding: false
15
- });
16
- }
17
- };
9
+ return {
10
+ name: INTEGRATION_NAME,
11
+ setup(client) {
12
+ invokeOrchestrionInstrumentation(client, nodeCronModuleNames, subscribe, [options], { requiresTracingChannelBinding: false });
13
+ }
14
+ };
18
15
  });
16
+ /**
17
+ * Sends Crons check-ins for every named `node-cron` task, with its schedule as the monitor config.
18
+ * The monitor slug is the task's `name` option. Tasks without a name, or with a schedule Sentry can't express, are not
19
+ * monitored.
20
+ */
19
21
  const nodeCronIntegration = defineIntegration(_nodeCronIntegration);
20
22
  function subscribe(options) {
21
- subscribeToJobCreation(CHANNELS.NODE_CRON_CREATE_TASK, INTEGRATION_NAME, (args) => wrapTask(args, options));
22
- subscribeToJobCreation(
23
- CHANNELS.NODE_CRON_V4_CREATE_TASK,
24
- INTEGRATION_NAME,
25
- (args) => wrapTask(args, options, isReadAlikeByNodeCron4)
26
- );
27
- subscribeToJobCreation(
28
- CHANNELS.NODE_CRON_V3_CREATE_TASK,
29
- INTEGRATION_NAME,
30
- (args) => wrapTask(args, options, isReadAlikeByNodeCron3)
31
- );
23
+ subscribeToJobCreation(CHANNELS.NODE_CRON_CREATE_TASK, INTEGRATION_NAME, (args) => wrapTask(args, options));
24
+ subscribeToJobCreation(CHANNELS.NODE_CRON_V4_CREATE_TASK, INTEGRATION_NAME, (args) => wrapTask(args, options, isReadAlikeByNodeCron4));
25
+ subscribeToJobCreation(CHANNELS.NODE_CRON_V3_CREATE_TASK, INTEGRATION_NAME, (args) => wrapTask(args, options, isReadAlikeByNodeCron3));
32
26
  }
33
27
  function wrapTask(args, options, isReadAlike) {
34
- const [expression, func, taskOptions] = args;
35
- const { name, timezone } = taskOptions || {};
36
- if (!shouldMonitorJob(name, func, options.excludeJobs)) {
37
- return;
38
- }
39
- const monitorConfig = getMonitorConfig(String(expression), timezone, isReadAlike);
40
- args[1] = wrapScheduledJob(func, name, monitorConfig, "auto.function.node-cron");
28
+ const [expression, func, taskOptions] = args;
29
+ const { name, timezone } = taskOptions || {};
30
+ if (!shouldMonitorJob(name, func, options.excludeJobs)) return;
31
+ const monitorConfig = getMonitorConfig(String(expression), timezone, isReadAlike);
32
+ args[1] = wrapScheduledJob(func, name, monitorConfig, "auto.function.node-cron");
41
33
  }
34
+ /** The monitor config for a task, or `undefined` if `isReadAlike` says this node-cron version reads it differently. */
42
35
  function getMonitorConfig(expression, timezone, isReadAlike) {
43
- return isReadAlike && !isReadAlike(expression) ? void 0 : cronExpressionToMonitorConfig(expression, timezone, "and");
36
+ return isReadAlike && !isReadAlike(expression) ? void 0 : cronExpressionToMonitorConfig(expression, timezone, "and");
44
37
  }
45
- const NODE_CRON_3_FIELD_MINIMUMS = [0, 0, 1, 1, 0];
38
+ const NODE_CRON_3_FIELD_MINIMUMS = [
39
+ 0,
40
+ 0,
41
+ 1,
42
+ 1,
43
+ 0
44
+ ];
45
+ /**
46
+ * node-cron before 4.6 reads `7` as `0` and swaps reversed ranges, so it runs `sat-sun`, `6-0` and `6-7` every day.
47
+ * Returns `false` for weekday ranges that could hit that.
48
+ */
46
49
  function isReadAlikeByNodeCron4(expression) {
47
- const weekday = expression.trim().split(/\s+/).pop() || "";
48
- return !(weekday.includes("-") && (weekday.includes("7") || /-(?:0|sun)/i.test(weekday)));
50
+ const weekday = expression.trim().split(/\s+/).pop() || "";
51
+ return !(weekday.includes("-") && (weekday.includes("7") || /-(?:0|sun)/i.test(weekday)));
49
52
  }
53
+ /**
54
+ * node-cron 3 keeps the values of a stepped field that are multiples of the step (`*\/2` days are 2, 4, ...)
55
+ * and reads weekday ranges like node-cron 4 before 4.6. Returns `false` where that differs from standard cron.
56
+ */
50
57
  function isReadAlikeByNodeCron3(expression) {
51
- const fields = expression.trim().split(/\s+/);
52
- const minimums = fields.length === 6 ? [0, ...NODE_CRON_3_FIELD_MINIMUMS] : NODE_CRON_3_FIELD_MINIMUMS;
53
- return isReadAlikeByNodeCron4(expression) && fields.every((field, index) => {
54
- if (!field.includes("/")) {
55
- return true;
56
- }
57
- const match = /^(?:\*|(\d+)-\d+)\/(\d+)$/.exec(field);
58
- return !!match && Number(match[1] ?? minimums[index]) % Number(match[2]) === 0;
59
- });
58
+ const fields = expression.trim().split(/\s+/);
59
+ const minimums = fields.length === 6 ? [0, ...NODE_CRON_3_FIELD_MINIMUMS] : NODE_CRON_3_FIELD_MINIMUMS;
60
+ return isReadAlikeByNodeCron4(expression) && fields.every((field, index) => {
61
+ if (!field.includes("/")) return true;
62
+ const match = /^(?:\*|(\d+)-\d+)\/(\d+)$/.exec(field);
63
+ return !!match && Number(match[1] ?? minimums[index]) % Number(match[2]) === 0;
64
+ });
60
65
  }
61
-
62
66
  export { getMonitorConfig, isReadAlikeByNodeCron3, isReadAlikeByNodeCron4, nodeCronIntegration };
63
- //# sourceMappingURL=node-cron.js.map
67
+
68
+ //# sourceMappingURL=node-cron.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"node-cron.js","sources":["../../../src/integrations/node-cron.ts"],"sourcesContent":["import type { IntegrationFn, MonitorConfig } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { CHANNELS } from '../orchestrion/channels';\nimport { nodeCronModuleNames } from '../orchestrion/config/node-cron';\nimport { invokeOrchestrionInstrumentation } from '../orchestrion/instrumentation';\nimport type { AnyFn } from '../utils/cronMonitoring';\nimport {\n cronExpressionToMonitorConfig,\n shouldMonitorJob,\n subscribeToJobCreation,\n wrapScheduledJob,\n} from '../utils/cronMonitoring';\n\nconst INTEGRATION_NAME = 'NodeCron' as const;\n\nexport interface NodeCronIntegrationOptions {\n /** Task names not to monitor. Strings must match the name exactly. */\n excludeJobs?: Array<string | RegExp>;\n}\n\nconst _nodeCronIntegration = ((options: NodeCronIntegrationOptions = {}) => {\n return {\n name: INTEGRATION_NAME,\n setup(client) {\n invokeOrchestrionInstrumentation(client, nodeCronModuleNames, subscribe, [options], {\n // The binding only parents spans, and this integration creates none.\n requiresTracingChannelBinding: false,\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Sends Crons check-ins for every named `node-cron` task, with its schedule as the monitor config.\n * The monitor slug is the task's `name` option. Tasks without a name, or with a schedule Sentry can't express, are not\n * monitored.\n */\nexport const nodeCronIntegration = defineIntegration(_nodeCronIntegration);\n\nfunction subscribe(options: NodeCronIntegrationOptions): void {\n subscribeToJobCreation(CHANNELS.NODE_CRON_CREATE_TASK, INTEGRATION_NAME, args => wrapTask(args, options));\n subscribeToJobCreation(CHANNELS.NODE_CRON_V4_CREATE_TASK, INTEGRATION_NAME, args =>\n wrapTask(args, options, isReadAlikeByNodeCron4),\n );\n subscribeToJobCreation(CHANNELS.NODE_CRON_V3_CREATE_TASK, INTEGRATION_NAME, args =>\n wrapTask(args, options, isReadAlikeByNodeCron3),\n );\n}\n\n// `createTask(expression, func, options)`\nfunction wrapTask(\n args: unknown[],\n options: NodeCronIntegrationOptions,\n isReadAlike?: (expression: string) => boolean,\n): void {\n const [expression, func, taskOptions] = args;\n const { name, timezone } = (taskOptions || {}) as { name?: unknown; timezone?: unknown };\n if (!shouldMonitorJob(name, func, options.excludeJobs)) {\n return;\n }\n const monitorConfig = getMonitorConfig(String(expression), timezone, isReadAlike);\n args[1] = wrapScheduledJob(func as AnyFn, name, monitorConfig, 'auto.function.node-cron');\n}\n\n/** The monitor config for a task, or `undefined` if `isReadAlike` says this node-cron version reads it differently. */\nexport function getMonitorConfig(\n expression: string,\n timezone: unknown,\n isReadAlike?: (expression: string) => boolean,\n): MonitorConfig | undefined {\n return isReadAlike && !isReadAlike(expression)\n ? undefined\n : cronExpressionToMonitorConfig(expression, timezone, 'and');\n}\n\nconst NODE_CRON_3_FIELD_MINIMUMS = [0, 0, 1, 1, 0];\n\n/**\n * node-cron before 4.6 reads `7` as `0` and swaps reversed ranges, so it runs `sat-sun`, `6-0` and `6-7` every day.\n * Returns `false` for weekday ranges that could hit that.\n */\nexport function isReadAlikeByNodeCron4(expression: string): boolean {\n const weekday = expression.trim().split(/\\s+/).pop() || '';\n return !(weekday.includes('-') && (weekday.includes('7') || /-(?:0|sun)/i.test(weekday)));\n}\n\n/**\n * node-cron 3 keeps the values of a stepped field that are multiples of the step (`*\\/2` days are 2, 4, ...)\n * and reads weekday ranges like node-cron 4 before 4.6. Returns `false` where that differs from standard cron.\n */\nexport function isReadAlikeByNodeCron3(expression: string): boolean {\n const fields = expression.trim().split(/\\s+/);\n const minimums = fields.length === 6 ? [0, ...NODE_CRON_3_FIELD_MINIMUMS] : NODE_CRON_3_FIELD_MINIMUMS;\n return (\n isReadAlikeByNodeCron4(expression) &&\n fields.every((field, index) => {\n if (!field.includes('/')) {\n return true;\n }\n const match = /^(?:\\*|(\\d+)-\\d+)\\/(\\d+)$/.exec(field);\n return !!match && Number(match[1] ?? minimums[index]) % Number(match[2]) === 0;\n })\n );\n}\n"],"names":[],"mappings":";;;;;;AAaA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAmB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAOzB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,oBAAA,CAAA,CAAA,CAAA,CAAwB,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAsC,EAAC,CAAA,CAAA,CAAA,CAAA,CAAM;AAC1E,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO;AAAA,CAAA,CAAA,CAAA,CACL,CAAA,CAAA,CAAA,CAAA,EAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACN,CAAA,CA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AA,CAAA,CAAA,CAAA,CAA4B,CAAA,CAAA,CAAA,CAAA,CAAK,KAAK,CAAA;AACpD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,CAAA,CAAA,EAAM,CAAC,CAAA,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,CAAA,CAAA,CAAA,CAAA,CAAK,CAAC,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA;AAAA,CAAA,CAC/E,CAAC,CAAA;AAEL;;"}
1
+ {"version":3,"file":"node-cron.js","names":[],"sources":["../../../src/integrations/node-cron.ts"],"sourcesContent":["import type { IntegrationFn, MonitorConfig } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { CHANNELS } from '../orchestrion/channels';\nimport { nodeCronModuleNames } from '../orchestrion/config/node-cron';\nimport { invokeOrchestrionInstrumentation } from '../orchestrion/instrumentation';\nimport type { AnyFn } from '../utils/cronMonitoring';\nimport {\n cronExpressionToMonitorConfig,\n shouldMonitorJob,\n subscribeToJobCreation,\n wrapScheduledJob,\n} from '../utils/cronMonitoring';\n\nconst INTEGRATION_NAME = 'NodeCron' as const;\n\nexport interface NodeCronIntegrationOptions {\n /** Task names not to monitor. Strings must match the name exactly. */\n excludeJobs?: Array<string | RegExp>;\n}\n\nconst _nodeCronIntegration = ((options: NodeCronIntegrationOptions = {}) => {\n return {\n name: INTEGRATION_NAME,\n setup(client) {\n invokeOrchestrionInstrumentation(client, nodeCronModuleNames, subscribe, [options], {\n // The binding only parents spans, and this integration creates none.\n requiresTracingChannelBinding: false,\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Sends Crons check-ins for every named `node-cron` task, with its schedule as the monitor config.\n * The monitor slug is the task's `name` option. Tasks without a name, or with a schedule Sentry can't express, are not\n * monitored.\n */\nexport const nodeCronIntegration = defineIntegration(_nodeCronIntegration);\n\nfunction subscribe(options: NodeCronIntegrationOptions): void {\n subscribeToJobCreation(CHANNELS.NODE_CRON_CREATE_TASK, INTEGRATION_NAME, args => wrapTask(args, options));\n subscribeToJobCreation(CHANNELS.NODE_CRON_V4_CREATE_TASK, INTEGRATION_NAME, args =>\n wrapTask(args, options, isReadAlikeByNodeCron4),\n );\n subscribeToJobCreation(CHANNELS.NODE_CRON_V3_CREATE_TASK, INTEGRATION_NAME, args =>\n wrapTask(args, options, isReadAlikeByNodeCron3),\n );\n}\n\n// `createTask(expression, func, options)`\nfunction wrapTask(\n args: unknown[],\n options: NodeCronIntegrationOptions,\n isReadAlike?: (expression: string) => boolean,\n): void {\n const [expression, func, taskOptions] = args;\n const { name, timezone } = (taskOptions || {}) as { name?: unknown; timezone?: unknown };\n if (!shouldMonitorJob(name, func, options.excludeJobs)) {\n return;\n }\n const monitorConfig = getMonitorConfig(String(expression), timezone, isReadAlike);\n args[1] = wrapScheduledJob(func as AnyFn, name, monitorConfig, 'auto.function.node-cron');\n}\n\n/** The monitor config for a task, or `undefined` if `isReadAlike` says this node-cron version reads it differently. */\nexport function getMonitorConfig(\n expression: string,\n timezone: unknown,\n isReadAlike?: (expression: string) => boolean,\n): MonitorConfig | undefined {\n return isReadAlike && !isReadAlike(expression)\n ? undefined\n : cronExpressionToMonitorConfig(expression, timezone, 'and');\n}\n\nconst NODE_CRON_3_FIELD_MINIMUMS = [0, 0, 1, 1, 0];\n\n/**\n * node-cron before 4.6 reads `7` as `0` and swaps reversed ranges, so it runs `sat-sun`, `6-0` and `6-7` every day.\n * Returns `false` for weekday ranges that could hit that.\n */\nexport function isReadAlikeByNodeCron4(expression: string): boolean {\n const weekday = expression.trim().split(/\\s+/).pop() || '';\n return !(weekday.includes('-') && (weekday.includes('7') || /-(?:0|sun)/i.test(weekday)));\n}\n\n/**\n * node-cron 3 keeps the values of a stepped field that are multiples of the step (`*\\/2` days are 2, 4, ...)\n * and reads weekday ranges like node-cron 4 before 4.6. Returns `false` where that differs from standard cron.\n */\nexport function isReadAlikeByNodeCron3(expression: string): boolean {\n const fields = expression.trim().split(/\\s+/);\n const minimums = fields.length === 6 ? [0, ...NODE_CRON_3_FIELD_MINIMUMS] : NODE_CRON_3_FIELD_MINIMUMS;\n return (\n isReadAlikeByNodeCron4(expression) &&\n fields.every((field, index) => {\n if (!field.includes('/')) {\n return true;\n }\n const match = /^(?:\\*|(\\d+)-\\d+)\\/(\\d+)$/.exec(field);\n return !!match && Number(match[1] ?? minimums[index]) % Number(match[2]) === 0;\n })\n );\n}\n"],"mappings":";;;;;;AAaA,MAAM,mBAAmB;AAOzB,MAAM,yBAAyB,UAAsC,CAAC,MAAM;CAC1E,OAAO;EACL,MAAM;EACN,MAAM,QAAQ;GACZ,iCAAiC,QAAQ,qBAAqB,WAAW,CAAC,OAAO,GAAG,EAElF,+BAA+B,MACjC,CAAC;EACH;CACF;AACF;;;;;;AAOA,MAAa,sBAAsB,kBAAkB,oBAAoB;AAEzE,SAAS,UAAU,SAA2C;CAC5D,uBAAuB,SAAS,uBAAuB,mBAAkB,SAAQ,SAAS,MAAM,OAAO,CAAC;CACxG,uBAAuB,SAAS,0BAA0B,mBAAkB,SAC1E,SAAS,MAAM,SAAS,sBAAsB,CAChD;CACA,uBAAuB,SAAS,0BAA0B,mBAAkB,SAC1E,SAAS,MAAM,SAAS,sBAAsB,CAChD;AACF;AAGA,SAAS,SACP,MACA,SACA,aACM;CACN,MAAM,CAAC,YAAY,MAAM,eAAe;CACxC,MAAM,EAAE,MAAM,aAAc,eAAe,CAAC;CAC5C,IAAI,CAAC,iBAAiB,MAAM,MAAM,QAAQ,WAAW,GACnD;CAEF,MAAM,gBAAgB,iBAAiB,OAAO,UAAU,GAAG,UAAU,WAAW;CAChF,KAAK,KAAK,iBAAiB,MAAe,MAAM,eAAe,yBAAyB;AAC1F;;AAGA,SAAgB,iBACd,YACA,UACA,aAC2B;CAC3B,OAAO,eAAe,CAAC,YAAY,UAAU,IACzC,KAAA,IACA,8BAA8B,YAAY,UAAU,KAAK;AAC/D;AAEA,MAAM,6BAA6B;CAAC;CAAG;CAAG;CAAG;CAAG;AAAC;;;;;AAMjD,SAAgB,uBAAuB,YAA6B;CAClE,MAAM,UAAU,WAAW,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,IAAI,KAAK;CACxD,OAAO,EAAE,QAAQ,SAAS,GAAG,MAAM,QAAQ,SAAS,GAAG,KAAK,cAAc,KAAK,OAAO;AACxF;;;;;AAMA,SAAgB,uBAAuB,YAA6B;CAClE,MAAM,SAAS,WAAW,KAAK,CAAC,CAAC,MAAM,KAAK;CAC5C,MAAM,WAAW,OAAO,WAAW,IAAI,CAAC,GAAG,GAAG,0BAA0B,IAAI;CAC5E,OACE,uBAAuB,UAAU,KACjC,OAAO,OAAO,OAAO,UAAU;EAC7B,IAAI,CAAC,MAAM,SAAS,GAAG,GACrB,OAAO;EAET,MAAM,QAAQ,4BAA4B,KAAK,KAAK;EACpD,OAAO,CAAC,CAAC,SAAS,OAAO,MAAM,MAAM,SAAS,MAAM,IAAI,OAAO,MAAM,EAAE,MAAM;CAC/E,CAAC;AAEL"}
@@ -1,70 +1,64 @@
1
- import { defineIntegration } from '@sentry/core';
2
- import { CHANNELS } from '../orchestrion/channels.js';
3
- import { nodeScheduleModuleNames } from '../orchestrion/config/node-schedule.js';
4
- import { invokeOrchestrionInstrumentation } from '../orchestrion/instrumentation.js';
5
- import { subscribeToScheduleChange, shouldMonitorJob, wrapScheduledJob, updateMonitorConfig, cronExpressionToMonitorConfig } from '../utils/cronMonitoring.js';
6
-
1
+ import { CHANNELS } from "../orchestrion/channels.js";
2
+ import { nodeScheduleModuleNames } from "../orchestrion/config/node-schedule.js";
3
+ import { invokeOrchestrionInstrumentation } from "../orchestrion/instrumentation.js";
4
+ import { cronExpressionToMonitorConfig, shouldMonitorJob, subscribeToScheduleChange, updateMonitorConfig, wrapScheduledJob } from "../utils/cronMonitoring.js";
5
+ import { defineIntegration } from "@sentry/core";
6
+ // src/integrations/node-schedule.ts
7
7
  const INTEGRATION_NAME = "NodeSchedule";
8
8
  const _nodeScheduleIntegration = ((options = {}) => {
9
- return {
10
- name: INTEGRATION_NAME,
11
- setup(client) {
12
- invokeOrchestrionInstrumentation(client, nodeScheduleModuleNames, subscribe, [options], {
13
- requiresTracingChannelBinding: false
14
- });
15
- }
16
- };
9
+ return {
10
+ name: INTEGRATION_NAME,
11
+ setup(client) {
12
+ invokeOrchestrionInstrumentation(client, nodeScheduleModuleNames, subscribe, [options], { requiresTracingChannelBinding: false });
13
+ }
14
+ };
17
15
  });
16
+ /**
17
+ * Sends Crons check-ins for every named `node-schedule` job, whether it's created with `scheduleJob` or `new Job()`.
18
+ * The monitor slug is the job name. Jobs without a name, one-off jobs, and jobs with a schedule Crons can't express
19
+ * are not monitored.
20
+ */
18
21
  const nodeScheduleIntegration = defineIntegration(_nodeScheduleIntegration);
19
22
  function subscribe(options) {
20
- subscribeToScheduleChange(
21
- CHANNELS.NODE_SCHEDULE_SCHEDULE,
22
- INTEGRATION_NAME,
23
- onSchedule,
24
- (change) => beforeSchedule(change, options)
25
- );
23
+ subscribeToScheduleChange(CHANNELS.NODE_SCHEDULE_SCHEDULE, INTEGRATION_NAME, onSchedule, (change) => beforeSchedule(change, options));
26
24
  }
27
25
  const ANONYMOUS_NAME = /^<Anonymous Job \d+[ >]/;
28
26
  const addsToPendingRuns = /* @__PURE__ */ new WeakSet();
27
+ /** Wraps a named job's method before `job.schedule(spec)` with a recurring spec, unless it's already wrapped. */
29
28
  function beforeSchedule(change, options) {
30
- const job = change.self;
31
- if (!job) {
32
- return;
33
- }
34
- if (typeof job.nextInvocation === "function" && job.nextInvocation() != null) {
35
- addsToPendingRuns.add(change);
36
- }
37
- const name = typeof job.name === "string" && !ANONYMOUS_NAME.test(job.name) ? job.name : void 0;
38
- if (isOneOffSpec(change.arguments[0]) || !shouldMonitorJob(name, job.job, options.excludeJobs)) {
39
- return;
40
- }
41
- job.job = wrapScheduledJob(job.job, name, void 0, "auto.function.node-schedule");
29
+ const job = change.self;
30
+ if (!job) return;
31
+ if (typeof job.nextInvocation === "function" && job.nextInvocation() != null) addsToPendingRuns.add(change);
32
+ const name = typeof job.name === "string" && !ANONYMOUS_NAME.test(job.name) ? job.name : void 0;
33
+ if (isOneOffSpec(change.arguments[0]) || !shouldMonitorJob(name, job.job, options.excludeJobs)) return;
34
+ job.job = wrapScheduledJob(job.job, name, void 0, "auto.function.node-schedule");
42
35
  }
36
+ /**
37
+ * Sets the spec's config after `job.schedule(spec)`. Without one, from a spec Crons can't express or a job that also
38
+ * keeps runs from an earlier spec, the job doesn't check in.
39
+ */
43
40
  function onSchedule(change) {
44
- if (change.result === true) {
45
- const job = change.self;
46
- updateMonitorConfig(job?.job, addsToPendingRuns.has(change) ? void 0 : getMonitorConfig(change.arguments[0]));
47
- }
41
+ if (change.result === true) {
42
+ const job = change.self;
43
+ updateMonitorConfig(job?.job, addsToPendingRuns.has(change) ? void 0 : getMonitorConfig(change.arguments[0]));
44
+ }
48
45
  }
46
+ /** Whether node-schedule runs a job with this spec once: a `Date`, a timestamp, or a date string. */
49
47
  function isOneOffSpec(spec) {
50
- const { rule } = spec || {};
51
- const when = typeof spec === "object" && rule ? rule : spec;
52
- if (typeof when === "string") {
53
- return !isCronShaped(when) && !Number.isNaN(Date.parse(when));
54
- }
55
- return when instanceof Date || typeof when === "number";
48
+ const { rule } = spec || {};
49
+ const when = typeof spec === "object" && rule ? rule : spec;
50
+ if (typeof when === "string") return !isCronShaped(when) && !Number.isNaN(Date.parse(when));
51
+ return when instanceof Date || typeof when === "number";
56
52
  }
57
53
  function isCronShaped(value) {
58
- const fields = value.trim().split(/\s+/);
59
- return /^@[a-z]+$/i.test(value.trim()) || (fields.length === 5 || fields.length === 6) && fields.every((field) => /^[\d*,/?#a-z-]+$/i.test(field));
54
+ const fields = value.trim().split(/\s+/);
55
+ return /^@[a-z]+$/i.test(value.trim()) || (fields.length === 5 || fields.length === 6) && fields.every((field) => /^[\d*,/?#a-z-]+$/i.test(field));
60
56
  }
61
57
  function getMonitorConfig(spec) {
62
- if (typeof spec === "string") {
63
- return cronExpressionToMonitorConfig(spec, void 0, "or");
64
- }
65
- const { rule, tz, start, end } = spec || {};
66
- return typeof rule === "string" && !start && !end ? cronExpressionToMonitorConfig(rule, tz, "or") : void 0;
58
+ if (typeof spec === "string") return cronExpressionToMonitorConfig(spec, void 0, "or");
59
+ const { rule, tz, start, end } = spec || {};
60
+ return typeof rule === "string" && !start && !end ? cronExpressionToMonitorConfig(rule, tz, "or") : void 0;
67
61
  }
68
-
69
62
  export { beforeSchedule, getMonitorConfig, isOneOffSpec, nodeScheduleIntegration, onSchedule };
70
- //# sourceMappingURL=node-schedule.js.map
63
+
64
+ //# sourceMappingURL=node-schedule.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"node-schedule.js","sources":["../../../src/integrations/node-schedule.ts"],"sourcesContent":["import type { IntegrationFn, MonitorConfig } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { CHANNELS } from '../orchestrion/channels';\nimport { nodeScheduleModuleNames } from '../orchestrion/config/node-schedule';\nimport { invokeOrchestrionInstrumentation } from '../orchestrion/instrumentation';\nimport type { AnyFn, ScheduleChange } from '../utils/cronMonitoring';\nimport {\n cronExpressionToMonitorConfig,\n shouldMonitorJob,\n subscribeToScheduleChange,\n updateMonitorConfig,\n wrapScheduledJob,\n} from '../utils/cronMonitoring';\n\nconst INTEGRATION_NAME = 'NodeSchedule' as const;\n\nexport interface NodeScheduleIntegrationOptions {\n /** Job names not to monitor. Strings must match the name exactly. */\n excludeJobs?: Array<string | RegExp>;\n}\n\nconst _nodeScheduleIntegration = ((options: NodeScheduleIntegrationOptions = {}) => {\n return {\n name: INTEGRATION_NAME,\n setup(client) {\n invokeOrchestrionInstrumentation(client, nodeScheduleModuleNames, subscribe, [options], {\n requiresTracingChannelBinding: false,\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Sends Crons check-ins for every named `node-schedule` job, whether it's created with `scheduleJob` or `new Job()`.\n * The monitor slug is the job name. Jobs without a name, one-off jobs, and jobs with a schedule Crons can't express\n * are not monitored.\n */\nexport const nodeScheduleIntegration = defineIntegration(_nodeScheduleIntegration);\n\nfunction subscribe(options: NodeScheduleIntegrationOptions): void {\n subscribeToScheduleChange(CHANNELS.NODE_SCHEDULE_SCHEDULE, INTEGRATION_NAME, onSchedule, change =>\n beforeSchedule(change, options),\n );\n}\n\ninterface Job {\n name?: unknown;\n job?: unknown;\n nextInvocation?: () => unknown;\n}\n\n// The name node-schedule gives jobs created without one.\nconst ANONYMOUS_NAME = /^<Anonymous Job \\d+[ >]/;\n\n// `job.schedule(spec)` calls that add to runs the job already has pending, rather than replace them.\nconst addsToPendingRuns = new WeakSet<ScheduleChange>();\n\n/** Wraps a named job's method before `job.schedule(spec)` with a recurring spec, unless it's already wrapped. */\nexport function beforeSchedule(change: ScheduleChange, options: NodeScheduleIntegrationOptions): void {\n const job = change.self as Job | undefined;\n if (!job) {\n return;\n }\n if (typeof job.nextInvocation === 'function' && job.nextInvocation() != null) {\n addsToPendingRuns.add(change);\n }\n const name = typeof job.name === 'string' && !ANONYMOUS_NAME.test(job.name) ? job.name : undefined;\n if (isOneOffSpec(change.arguments[0]) || !shouldMonitorJob(name, job.job, options.excludeJobs)) {\n return;\n }\n job.job = wrapScheduledJob(job.job as AnyFn, name, undefined, 'auto.function.node-schedule');\n}\n\n/**\n * Sets the spec's config after `job.schedule(spec)`. Without one, from a spec Crons can't express or a job that also\n * keeps runs from an earlier spec, the job doesn't check in.\n */\nexport function onSchedule(change: ScheduleChange): void {\n // `schedule` returns false when it scheduled nothing, and `reschedule` then keeps the old schedule.\n if (change.result === true) {\n const job = change.self as Job | undefined;\n updateMonitorConfig(job?.job, addsToPendingRuns.has(change) ? undefined : getMonitorConfig(change.arguments[0]));\n }\n}\n\n/** Whether node-schedule runs a job with this spec once: a `Date`, a timestamp, or a date string. */\nexport function isOneOffSpec(spec: unknown): boolean {\n const { rule } = (spec || {}) as { rule?: unknown };\n const when = typeof spec === 'object' && rule ? rule : spec;\n if (typeof when === 'string') {\n // `Date.parse` also accepts some crons, like `0 9 * * *`.\n return !isCronShaped(when) && !Number.isNaN(Date.parse(when));\n }\n return when instanceof Date || typeof when === 'number';\n}\n\nfunction isCronShaped(value: string): boolean {\n const fields = value.trim().split(/\\s+/);\n return (\n /^@[a-z]+$/i.test(value.trim()) ||\n ((fields.length === 5 || fields.length === 6) && fields.every(field => /^[\\d*,/?#a-z-]+$/i.test(field)))\n );\n}\n\n// Only cron strings convert; recurrence rules and rules limited by `start` or `end` don't.\nexport function getMonitorConfig(spec: unknown): MonitorConfig | undefined {\n if (typeof spec === 'string') {\n return cronExpressionToMonitorConfig(spec, undefined, 'or');\n }\n const { rule, tz, start, end } = (spec || {}) as { rule?: unknown; tz?: unknown; start?: unknown; end?: unknown };\n return typeof rule === 'string' && !start && !end ? cronExpressionToMonitorConfig(rule, tz, 'or') : undefined;\n}\n"],"names":[],"mappings":";;;;;;AAcA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAmB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAOzB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,wBAAA,CAAA,CAAA,CAAA,CAA4B,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA0C,EAAC,CAAA,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,CAAK,CAAA,CAAA,CAAA,KAAQ,CAAA,CAAC;AAC3C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,OAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,QAAA,CAAA,CAAA,CAAA,CAAY,CAAC,KAAA,CAAA,CAAA,CAAA,CAAS,CAAC,GAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA8B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACtG;;"}
1
+ {"version":3,"file":"node-schedule.js","names":[],"sources":["../../../src/integrations/node-schedule.ts"],"sourcesContent":["import type { IntegrationFn, MonitorConfig } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { CHANNELS } from '../orchestrion/channels';\nimport { nodeScheduleModuleNames } from '../orchestrion/config/node-schedule';\nimport { invokeOrchestrionInstrumentation } from '../orchestrion/instrumentation';\nimport type { AnyFn, ScheduleChange } from '../utils/cronMonitoring';\nimport {\n cronExpressionToMonitorConfig,\n shouldMonitorJob,\n subscribeToScheduleChange,\n updateMonitorConfig,\n wrapScheduledJob,\n} from '../utils/cronMonitoring';\n\nconst INTEGRATION_NAME = 'NodeSchedule' as const;\n\nexport interface NodeScheduleIntegrationOptions {\n /** Job names not to monitor. Strings must match the name exactly. */\n excludeJobs?: Array<string | RegExp>;\n}\n\nconst _nodeScheduleIntegration = ((options: NodeScheduleIntegrationOptions = {}) => {\n return {\n name: INTEGRATION_NAME,\n setup(client) {\n invokeOrchestrionInstrumentation(client, nodeScheduleModuleNames, subscribe, [options], {\n requiresTracingChannelBinding: false,\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Sends Crons check-ins for every named `node-schedule` job, whether it's created with `scheduleJob` or `new Job()`.\n * The monitor slug is the job name. Jobs without a name, one-off jobs, and jobs with a schedule Crons can't express\n * are not monitored.\n */\nexport const nodeScheduleIntegration = defineIntegration(_nodeScheduleIntegration);\n\nfunction subscribe(options: NodeScheduleIntegrationOptions): void {\n subscribeToScheduleChange(CHANNELS.NODE_SCHEDULE_SCHEDULE, INTEGRATION_NAME, onSchedule, change =>\n beforeSchedule(change, options),\n );\n}\n\ninterface Job {\n name?: unknown;\n job?: unknown;\n nextInvocation?: () => unknown;\n}\n\n// The name node-schedule gives jobs created without one.\nconst ANONYMOUS_NAME = /^<Anonymous Job \\d+[ >]/;\n\n// `job.schedule(spec)` calls that add to runs the job already has pending, rather than replace them.\nconst addsToPendingRuns = new WeakSet<ScheduleChange>();\n\n/** Wraps a named job's method before `job.schedule(spec)` with a recurring spec, unless it's already wrapped. */\nexport function beforeSchedule(change: ScheduleChange, options: NodeScheduleIntegrationOptions): void {\n const job = change.self as Job | undefined;\n if (!job) {\n return;\n }\n if (typeof job.nextInvocation === 'function' && job.nextInvocation() != null) {\n addsToPendingRuns.add(change);\n }\n const name = typeof job.name === 'string' && !ANONYMOUS_NAME.test(job.name) ? job.name : undefined;\n if (isOneOffSpec(change.arguments[0]) || !shouldMonitorJob(name, job.job, options.excludeJobs)) {\n return;\n }\n job.job = wrapScheduledJob(job.job as AnyFn, name, undefined, 'auto.function.node-schedule');\n}\n\n/**\n * Sets the spec's config after `job.schedule(spec)`. Without one, from a spec Crons can't express or a job that also\n * keeps runs from an earlier spec, the job doesn't check in.\n */\nexport function onSchedule(change: ScheduleChange): void {\n // `schedule` returns false when it scheduled nothing, and `reschedule` then keeps the old schedule.\n if (change.result === true) {\n const job = change.self as Job | undefined;\n updateMonitorConfig(job?.job, addsToPendingRuns.has(change) ? undefined : getMonitorConfig(change.arguments[0]));\n }\n}\n\n/** Whether node-schedule runs a job with this spec once: a `Date`, a timestamp, or a date string. */\nexport function isOneOffSpec(spec: unknown): boolean {\n const { rule } = (spec || {}) as { rule?: unknown };\n const when = typeof spec === 'object' && rule ? rule : spec;\n if (typeof when === 'string') {\n // `Date.parse` also accepts some crons, like `0 9 * * *`.\n return !isCronShaped(when) && !Number.isNaN(Date.parse(when));\n }\n return when instanceof Date || typeof when === 'number';\n}\n\nfunction isCronShaped(value: string): boolean {\n const fields = value.trim().split(/\\s+/);\n return (\n /^@[a-z]+$/i.test(value.trim()) ||\n ((fields.length === 5 || fields.length === 6) && fields.every(field => /^[\\d*,/?#a-z-]+$/i.test(field)))\n );\n}\n\n// Only cron strings convert; recurrence rules and rules limited by `start` or `end` don't.\nexport function getMonitorConfig(spec: unknown): MonitorConfig | undefined {\n if (typeof spec === 'string') {\n return cronExpressionToMonitorConfig(spec, undefined, 'or');\n }\n const { rule, tz, start, end } = (spec || {}) as { rule?: unknown; tz?: unknown; start?: unknown; end?: unknown };\n return typeof rule === 'string' && !start && !end ? cronExpressionToMonitorConfig(rule, tz, 'or') : undefined;\n}\n"],"mappings":";;;;;;AAcA,MAAM,mBAAmB;AAOzB,MAAM,6BAA6B,UAA0C,CAAC,MAAM;CAClF,OAAO;EACL,MAAM;EACN,MAAM,QAAQ;GACZ,iCAAiC,QAAQ,yBAAyB,WAAW,CAAC,OAAO,GAAG,EACtF,+BAA+B,MACjC,CAAC;EACH;CACF;AACF;;;;;;AAOA,MAAa,0BAA0B,kBAAkB,wBAAwB;AAEjF,SAAS,UAAU,SAA+C;CAChE,0BAA0B,SAAS,wBAAwB,kBAAkB,aAAY,WACvF,eAAe,QAAQ,OAAO,CAChC;AACF;AASA,MAAM,iBAAiB;AAGvB,MAAM,oCAAoB,IAAI,QAAwB;;AAGtD,SAAgB,eAAe,QAAwB,SAA+C;CACpG,MAAM,MAAM,OAAO;CACnB,IAAI,CAAC,KACH;CAEF,IAAI,OAAO,IAA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IAAI,IAAI,KAAA;AACtG"}
@@ -1,88 +1,93 @@
1
- import { tracingChannel } from '../utils/diagnosticsChannel.js';
2
- import { _INTERNAL_shouldSkipAiProviderWrapping, getClient, startInactiveSpan, hasSpanStreamingEnabled } from '@sentry/core';
3
- import { GEN_AI_PROVIDER_NAME, SENTRY_ORIGIN } from '@sentry/conventions/attributes';
4
- import { resolveAIRecordingOptions, getGenAiSpanOp } from '../ai/core/utils.js';
5
- import { wrapApiPromiseResponse } from '../ai/core/apiPromise.js';
6
- import { extractRequestAttributes, addRequestAttributes } from '../ai/openai/index.js';
7
- import { instrumentStream } from '../ai/openai/streaming.js';
8
- import { addResponseAttributes } from '../ai/openai/utils.js';
9
- import { invokeOrchestrionInstrumentation } from '../orchestrion/instrumentation.js';
10
- import { bindTracingChannelToSpan } from '../tracing-channel.js';
11
-
1
+ import { tracingChannel } from "../utils/diagnosticsChannel.js";
2
+ import { getGenAiSpanOp, getRequestSignal, markCancelledIfAborted, resolveAIRecordingOptions } from "../ai/core/utils.js";
3
+ import { wrapApiPromiseResponse } from "../ai/core/apiPromise.js";
4
+ import { addRequestAttributes, extractRequestAttributes } from "../ai/openai/index.js";
5
+ import { instrumentStream } from "../ai/openai/streaming.js";
6
+ import { addResponseAttributes } from "../ai/openai/utils.js";
7
+ import { invokeOrchestrionInstrumentation } from "../orchestrion/instrumentation.js";
8
+ import { bindTracingChannelToSpan } from "../tracing-channel.js";
9
+ import { GEN_AI_PROVIDER_NAME, SENTRY_ORIGIN } from "@sentry/conventions/attributes";
10
+ import { _INTERNAL_shouldSkipAiProviderWrapping, getClient, hasSpanStreamingEnabled, startInactiveSpan } from "@sentry/core";
11
+ // src/integrations/openai-compatible.ts
12
+ /**
13
+ * Builds a diagnostics-channel integration for an OpenAI-compatible provider SDK. It subscribes to the
14
+ * `orchestrion:<module>:{chat,embeddings}` channels injected into the SDK's `create` methods, so it
15
+ * requires the Sentry runtime hook or bundler plugin. Everything below the channel — request/response
16
+ * attributes and streaming — is shared with the openai integration; only the provider name and origin
17
+ * differ.
18
+ */
12
19
  function createOpenAiCompatibleIntegration(provider) {
13
- const instrumentedChannels = [
14
- { channel: provider.channels.chat, operation: "chat" },
15
- { channel: provider.channels.embeddings, operation: "embeddings" }
16
- ];
17
- function instrument(options) {
18
- for (const { channel, operation } of instrumentedChannels) {
19
- bindTracingChannelToSpan(
20
- tracingChannel(channel),
21
- (data) => createGenAiSpan(data, operation, provider, options),
22
- {
23
- beforeSpanEnd: (span, data) => {
24
- addResponseAttributes(span, data.result, resolveAIRecordingOptions(options).recordOutputs);
25
- },
26
- deferSpanEnd: ({ span, data, end }) => wrapApiPromiseResponse(
27
- data.result,
28
- (response) => {
29
- data.result = response;
30
- if (!wrapStreamResult(span, data, options)) {
31
- end();
32
- }
33
- },
34
- end
35
- ) || wrapStreamResult(span, data, options)
36
- }
37
- );
38
- }
39
- }
40
- return ((options = {}) => {
41
- return {
42
- name: provider.integrationName,
43
- setup(client) {
44
- invokeOrchestrionInstrumentation(client, provider.moduleNames, instrument, [options]);
45
- }
46
- };
47
- });
20
+ const instrumentedChannels = [{
21
+ channel: provider.channels.chat,
22
+ operation: "chat"
23
+ }, {
24
+ channel: provider.channels.embeddings,
25
+ operation: "embeddings"
26
+ }];
27
+ function instrument(options) {
28
+ for (const { channel, operation } of instrumentedChannels) bindTracingChannelToSpan(tracingChannel(channel), (data) => createGenAiSpan(data, operation, provider, options), {
29
+ beforeSpanEnd: (span, data) => {
30
+ if ("error" in data) markCancelledIfAborted(span, getRequestSignal(data.arguments?.[1]));
31
+ addResponseAttributes(span, data.result, resolveAIRecordingOptions(options).recordOutputs);
32
+ },
33
+ deferSpanEnd: ({ span, data, end }) => wrapApiPromiseResponse(data.result, (response) => {
34
+ data.result = response;
35
+ if (!wrapStreamResult(span, data, options)) end();
36
+ }, end) || wrapStreamResult(span, data, options)
37
+ });
38
+ }
39
+ return ((options = {}) => {
40
+ return {
41
+ name: provider.integrationName,
42
+ setup(client) {
43
+ invokeOrchestrionInstrumentation(client, provider.moduleNames, instrument, [options]);
44
+ }
45
+ };
46
+ });
48
47
  }
48
+ /**
49
+ * Build the span for an instrumented `create` call.
50
+ * Returning `undefined` opts the payload out so no span is opened.
51
+ */
49
52
  function createGenAiSpan(data, operation, provider, options) {
50
- if (_INTERNAL_shouldSkipAiProviderWrapping(provider.integrationName)) {
51
- return void 0;
52
- }
53
- const args = data.arguments ?? [];
54
- const params = args[0];
55
- const { recordInputs } = resolveAIRecordingOptions(options);
56
- const attributes = extractRequestAttributes(args, operation, recordInputs);
57
- attributes[GEN_AI_PROVIDER_NAME] = provider.providerName;
58
- attributes[SENTRY_ORIGIN] = provider.origin;
59
- const model = params?.model || "unknown";
60
- const client = getClient();
61
- const span = startInactiveSpan({
62
- // With span streaming, omit the `'unknown'` model sentinel so the name stays low-cardinality.
63
- name: model !== "unknown" || !(client && hasSpanStreamingEnabled(client)) ? `${operation} ${model}` : operation,
64
- op: getGenAiSpanOp(operation),
65
- attributes
66
- });
67
- if (recordInputs && params) {
68
- addRequestAttributes(span, params, operation);
69
- }
70
- return span;
53
+ if (_INTERNAL_shouldSkipAiProviderWrapping(provider.integrationName)) return;
54
+ const args = data.arguments ?? [];
55
+ const params = args[0];
56
+ const { recordInputs } = resolveAIRecordingOptions(options);
57
+ const attributes = extractRequestAttributes(args, operation, recordInputs);
58
+ attributes[GEN_AI_PROVIDER_NAME] = provider.providerName;
59
+ attributes[SENTRY_ORIGIN] = provider.origin;
60
+ const model = params?.model || "unknown";
61
+ const client = getClient();
62
+ const span = startInactiveSpan({
63
+ name: model !== "unknown" || !(client && hasSpanStreamingEnabled(client)) ? `${operation} ${model}` : operation,
64
+ op: getGenAiSpanOp(operation),
65
+ attributes
66
+ });
67
+ if (recordInputs && params) addRequestAttributes(span, params, operation);
68
+ return span;
71
69
  }
72
70
  function isAsyncIterable(value) {
73
- return !!value && typeof value[Symbol.asyncIterator] === "function";
71
+ return !!value && typeof value[Symbol.asyncIterator] === "function";
74
72
  }
73
+ /**
74
+ * For a streaming `create({ stream: true })` the result is a `Stream` the caller consumes later. We can't
75
+ * swap what `create` returns, but the `Stream` in `data.result` is the same instance the caller holds and
76
+ * we observe it before the caller iterates — so we patch its async iterator in place to run through
77
+ * `instrumentStream`, which accumulates the streamed attributes and ends the span when iteration finishes.
78
+ * Only a streaming call resolves to an async-iterable, so that check alone distinguishes it. Returns `true`
79
+ * to hand span-ending ownership to `instrumentStream`; `false` for non-streaming/errored results, which end
80
+ * via the normal `beforeSpanEnd` path.
81
+ */
75
82
  function wrapStreamResult(span, data, options) {
76
- const result = data.result;
77
- if (!isAsyncIterable(result)) {
78
- return false;
79
- }
80
- const { recordOutputs } = resolveAIRecordingOptions(options);
81
- const iterate = result[Symbol.asyncIterator].bind(result);
82
- const instrumented = instrumentStream({ [Symbol.asyncIterator]: iterate }, span, recordOutputs ?? false);
83
- result[Symbol.asyncIterator] = () => instrumented;
84
- return true;
83
+ const result = data.result;
84
+ if (!isAsyncIterable(result)) return false;
85
+ const { recordOutputs } = resolveAIRecordingOptions(options);
86
+ const iterate = result[Symbol.asyncIterator].bind(result);
87
+ const instrumented = instrumentStream({ [Symbol.asyncIterator]: iterate }, span, recordOutputs ?? false);
88
+ result[Symbol.asyncIterator] = () => instrumented;
89
+ return true;
85
90
  }
86
-
87
91
  export { createOpenAiCompatibleIntegration };
88
- //# sourceMappingURL=openai-compatible.js.map
92
+
93
+ //# sourceMappingURL=openai-compatible.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"openai-compatible.js","sources":["../../../src/integrations/openai-compatible.ts"],"sourcesContent":["import * as diagnosticsChannel from '../utils/diagnosticsChannel';\nimport type { Integration, IntegrationFn, Span, SpanAttributeValue } from '@sentry/core';\nimport {\n _INTERNAL_shouldSkipAiProviderWrapping,\n getClient,\n hasSpanStreamingEnabled,\n startInactiveSpan,\n} from '@sentry/core';\nimport { GEN_AI_PROVIDER_NAME, SENTRY_ORIGIN } from '@sentry/conventions/attributes';\nimport { getGenAiSpanOp, resolveAIRecordingOptions } from '../ai/core/utils';\nimport { wrapApiPromiseResponse } from '../ai/core/apiPromise';\nimport { addRequestAttributes, extractRequestAttributes } from '../ai/openai';\nimport { instrumentStream } from '../ai/openai/streaming';\nimport type { OpenAiOptions } from '../ai/openai/types';\nimport { addResponseAttributes } from '../ai/openai/utils';\nimport type { OrchestrionChannelContext } from '../orchestrion/types';\nimport { invokeOrchestrionInstrumentation } from '../orchestrion/instrumentation';\nimport { bindTracingChannelToSpan } from '../tracing-channel';\n\n/**\n * Describes an OpenAI-compatible provider whose SDK mirrors the openai wire format (Groq, Together, ...),\n * so the span building, streaming and response parsing can all be reused from `ai/openai`.\n */\nexport interface OpenAiCompatibleProvider {\n /** Integration name; also the key used to skip double-wrapping when another provider drives the SDK. */\n integrationName: string;\n /** Value reported on `gen_ai.provider.name`. */\n providerName: string;\n /** Span origin, `auto.ai.<provider>`. */\n origin: string;\n /** The instrumented `module.name`s (from the orchestrion config's `getModuleNames`). */\n moduleNames: string[];\n /** The fully-qualified orchestrion channels this provider publishes to. */\n channels: { chat: string; embeddings: string };\n}\n\n/**\n * Builds a diagnostics-channel integration for an OpenAI-compatible provider SDK. It subscribes to the\n * `orchestrion:<module>:{chat,embeddings}` channels injected into the SDK's `create` methods, so it\n * requires the Sentry runtime hook or bundler plugin. Everything below the channel — request/response\n * attributes and streaming — is shared with the openai integration; only the provider name and origin\n * differ.\n */\nexport function createOpenAiCompatibleIntegration<T extends OpenAiCompatibleProvider>(\n provider: T,\n): (options?: OpenAiOptions) => Integration & { name: T['integrationName'] } {\n const instrumentedChannels = [\n { channel: provider.channels.chat, operation: 'chat' },\n { channel: provider.channels.embeddings, operation: 'embeddings' },\n ] as const;\n\n function instrument(options: OpenAiOptions): void {\n for (const { channel, operation } of instrumentedChannels) {\n bindTracingChannelToSpan(\n diagnosticsChannel.tracingChannel<OrchestrionChannelContext>(channel),\n data => createGenAiSpan(data, operation, provider, options),\n {\n beforeSpanEnd: (span, data) => {\n addResponseAttributes(span, data.result, resolveAIRecordingOptions(options).recordOutputs);\n },\n deferSpanEnd: ({ span, data, end }) =>\n wrapApiPromiseResponse(\n data.result,\n response => {\n data.result = response;\n if (!wrapStreamResult(span, data, options)) {\n end();\n }\n },\n end,\n ) || wrapStreamResult(span, data, options),\n },\n );\n }\n }\n\n return ((options: OpenAiOptions = {}) => {\n return {\n name: provider.integrationName,\n setup(client) {\n invokeOrchestrionInstrumentation(client, provider.moduleNames, instrument, [options]);\n },\n };\n }) satisfies IntegrationFn;\n}\n\n/**\n * Build the span for an instrumented `create` call.\n * Returning `undefined` opts the payload out so no span is opened.\n */\nfunction createGenAiSpan(\n data: OrchestrionChannelContext,\n operation: string,\n provider: OpenAiCompatibleProvider,\n options: OpenAiOptions,\n): Span | undefined {\n // When another provider (e.g. LangChain) is driving the SDK, it records the spans itself and marks this\n // provider as skipped; skip here to avoid double spans.\n if (_INTERNAL_shouldSkipAiProviderWrapping(provider.integrationName)) {\n return undefined;\n }\n\n const args = data.arguments ?? [];\n const params = args[0] as Record<string, unknown> | undefined;\n\n const { recordInputs } = resolveAIRecordingOptions(options);\n\n // `extractRequestAttributes` defaults the provider to openai; override it for the concrete provider.\n const attributes = extractRequestAttributes(args, operation, recordInputs);\n attributes[GEN_AI_PROVIDER_NAME] = provider.providerName;\n attributes[SENTRY_ORIGIN] = provider.origin;\n const model = (params?.model as string) || 'unknown';\n const client = getClient();\n\n const span = startInactiveSpan({\n // With span streaming, omit the `'unknown'` model sentinel so the name stays low-cardinality.\n name: model !== 'unknown' || !(client && hasSpanStreamingEnabled(client)) ? `${operation} ${model}` : operation,\n op: getGenAiSpanOp(operation),\n attributes: attributes as Record<string, SpanAttributeValue>,\n });\n\n if (recordInputs && params) {\n addRequestAttributes(span, params, operation);\n }\n\n return span;\n}\n\ntype AsyncIterableStream = { [Symbol.asyncIterator]: () => AsyncIterator<unknown> };\n\nfunction isAsyncIterable(value: unknown): value is AsyncIterableStream {\n return !!value && typeof (value as AsyncIterableStream)[Symbol.asyncIterator] === 'function';\n}\n\n/**\n * For a streaming `create({ stream: true })` the result is a `Stream` the caller consumes later. We can't\n * swap what `create` returns, but the `Stream` in `data.result` is the same instance the caller holds and\n * we observe it before the caller iterates — so we patch its async iterator in place to run through\n * `instrumentStream`, which accumulates the streamed attributes and ends the span when iteration finishes.\n * Only a streaming call resolves to an async-iterable, so that check alone distinguishes it. Returns `true`\n * to hand span-ending ownership to `instrumentStream`; `false` for non-streaming/errored results, which end\n * via the normal `beforeSpanEnd` path.\n */\nfunction wrapStreamResult(span: Span, data: OrchestrionChannelContext, options: OpenAiOptions): boolean {\n const result = data.result;\n if (!isAsyncIterable(result)) {\n return false;\n }\n\n const { recordOutputs } = resolveAIRecordingOptions(options);\n const iterate = result[Symbol.asyncIterator].bind(result);\n const instrumented = instrumentStream({ [Symbol.asyncIterator]: iterate }, span, recordOutputs ?? false);\n result[Symbol.asyncIterator] = () => instrumented;\n\n return true;\n}\n"],"names":["diagnosticsChannel.tracingChannel"],"mappings":";;;;;;;;;;;AA2CO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EACd,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAC2E;AAC3E,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,oBAAA,CAAA,CAAA,CAAuB;AAAA,CAAA,CAAA,CAAA,CAC3B,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAAA,CAAA,IAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,CAAA,CAAE,CAAA,CAAA,CAAA,EAAK,MAAM,CAAA;AACxD,CAAA,CAAA,MAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,gBAAA,CAAiB,CAAA,CAAE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,aAAa,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAQ,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,EAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,KAAK,CAAA;AACvG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,aAAa,CAAA,CAAA,CAAA,CAAI,MAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAErC,CAAA,CAAA,OAAO,CAAA,CAAA,CAAA,CAAA;AACT;;"}
1
+ {"version":3,"file":"openai-compatible.js","names":["diagnosticsChannel.tracingChannel"],"sources":["../../../src/integrations/openai-compatible.ts"],"sourcesContent":["import * as diagnosticsChannel from '../utils/diagnosticsChannel';\nimport type { Integration, IntegrationFn, Span, SpanAttributeValue } from '@sentry/core';\nimport {\n _INTERNAL_shouldSkipAiProviderWrapping,\n getClient,\n hasSpanStreamingEnabled,\n startInactiveSpan,\n} from '@sentry/core';\nimport { GEN_AI_PROVIDER_NAME, SENTRY_ORIGIN } from '@sentry/conventions/attributes';\nimport { getGenAiSpanOp, getRequestSignal, markCancelledIfAborted, resolveAIRecordingOptions } from '../ai/core/utils';\nimport { wrapApiPromiseResponse } from '../ai/core/apiPromise';\nimport { addRequestAttributes, extractRequestAttributes } from '../ai/openai';\nimport { instrumentStream } from '../ai/openai/streaming';\nimport type { OpenAiOptions } from '../ai/openai/types';\nimport { addResponseAttributes } from '../ai/openai/utils';\nimport type { OrchestrionChannelContext } from '../orchestrion/types';\nimport { invokeOrchestrionInstrumentation } from '../orchestrion/instrumentation';\nimport { bindTracingChannelToSpan } from '../tracing-channel';\n\n/**\n * Describes an OpenAI-compatible provider whose SDK mirrors the openai wire format (Groq, Together, ...),\n * so the span building, streaming and response parsing can all be reused from `ai/openai`.\n */\nexport interface OpenAiCompatibleProvider {\n /** Integration name; also the key used to skip double-wrapping when another provider drives the SDK. */\n integrationName: string;\n /** Value reported on `gen_ai.provider.name`. */\n providerName: string;\n /** Span origin, `auto.ai.<provider>`. */\n origin: string;\n /** The instrumented `module.name`s (from the orchestrion config's `getModuleNames`). */\n moduleNames: string[];\n /** The fully-qualified orchestrion channels this provider publishes to. */\n channels: { chat: string; embeddings: string };\n}\n\n/**\n * Builds a diagnostics-channel integration for an OpenAI-compatible provider SDK. It subscribes to the\n * `orchestrion:<module>:{chat,embeddings}` channels injected into the SDK's `create` methods, so it\n * requires the Sentry runtime hook or bundler plugin. Everything below the channel — request/response\n * attributes and streaming — is shared with the openai integration; only the provider name and origin\n * differ.\n */\nexport function createOpenAiCompatibleIntegration<T extends OpenAiCompatibleProvider>(\n provider: T,\n): (options?: OpenAiOptions) => Integration & { name: T['integrationName'] } {\n const instrumentedChannels = [\n { channel: provider.channels.chat, operation: 'chat' },\n { channel: provider.channels.embeddings, operation: 'embeddings' },\n ] as const;\n\n function instrument(options: OpenAiOptions): void {\n for (const { channel, operation } of instrumentedChannels) {\n bindTracingChannelToSpan(\n diagnosticsChannel.tracingChannel<OrchestrionChannelContext>(channel),\n data => createGenAiSpan(data, operation, provider, options),\n {\n beforeSpanEnd: (span, data) => {\n if ('error' in data) {\n markCancelledIfAborted(span, getRequestSignal(data.arguments?.[1]));\n }\n addResponseAttributes(span, data.result, resolveAIRecordingOptions(options).recordOutputs);\n },\n deferSpanEnd: ({ span, data, end }) =>\n wrapApiPromiseResponse(\n data.result,\n response => {\n data.result = response;\n if (!wrapStreamResult(span, data, options)) {\n end();\n }\n },\n end,\n ) || wrapStreamResult(span, data, options),\n },\n );\n }\n }\n\n return ((options: OpenAiOptions = {}) => {\n return {\n name: provider.integrationName,\n setup(client) {\n invokeOrchestrionInstrumentation(client, provider.moduleNames, instrument, [options]);\n },\n };\n }) satisfies IntegrationFn;\n}\n\n/**\n * Build the span for an instrumented `create` call.\n * Returning `undefined` opts the payload out so no span is opened.\n */\nfunction createGenAiSpan(\n data: OrchestrionChannelContext,\n operation: string,\n provider: OpenAiCompatibleProvider,\n options: OpenAiOptions,\n): Span | undefined {\n // When another provider (e.g. LangChain) is driving the SDK, it records the spans itself and marks this\n // provider as skipped; skip here to avoid double spans.\n if (_INTERNAL_shouldSkipAiProviderWrapping(provider.integrationName)) {\n return undefined;\n }\n\n const args = data.arguments ?? [];\n const params = args[0] as Record<string, unknown> | undefined;\n\n const { recordInputs } = resolveAIRecordingOptions(options);\n\n // `extractRequestAttributes` defaults the provider to openai; override it for the concrete provider.\n const attributes = extractRequestAttributes(args, operation, recordInputs);\n attributes[GEN_AI_PROVIDER_NAME] = provider.providerName;\n attributes[SENTRY_ORIGIN] = provider.origin;\n const model = (params?.model as string) || 'unknown';\n const client = getClient();\n\n const span = startInactiveSpan({\n // With span streaming, omit the `'unknown'` model sentinel so the name stays low-cardinality.\n name: model !== 'unknown' || !(client && hasSpanStreamingEnabled(client)) ? `${operation} ${model}` : operation,\n op: getGenAiSpanOp(operation),\n attributes: attributes as Record<string, SpanAttributeValue>,\n });\n\n if (recordInputs && params) {\n addRequestAttributes(span, params, operation);\n }\n\n return span;\n}\n\ntype AsyncIterableStream = { [Symbol.asyncIterator]: () => AsyncIterator<unknown> };\n\nfunction isAsyncIterable(value: unknown): value is AsyncIterableStream {\n return !!value && typeof (value as AsyncIterableStream)[Symbol.asyncIterator] === 'function';\n}\n\n/**\n * For a streaming `create({ stream: true })` the result is a `Stream` the caller consumes later. We can't\n * swap what `create` returns, but the `Stream` in `data.result` is the same instance the caller holds and\n * we observe it before the caller iterates — so we patch its async iterator in place to run through\n * `instrumentStream`, which accumulates the streamed attributes and ends the span when iteration finishes.\n * Only a streaming call resolves to an async-iterable, so that check alone distinguishes it. Returns `true`\n * to hand span-ending ownership to `instrumentStream`; `false` for non-streaming/errored results, which end\n * via the normal `beforeSpanEnd` path.\n */\nfunction wrapStreamResult(span: Span, data: OrchestrionChannelContext, options: OpenAiOptions): boolean {\n const result = data.result;\n if (!isAsyncIterable(result)) {\n return false;\n }\n\n const { recordOutputs } = resolveAIRecordingOptions(options);\n const iterate = result[Symbol.asyncIterator].bind(result);\n const instrumented = instrumentStream({ [Symbol.asyncIterator]: iterate }, span, recordOutputs ?? false);\n result[Symbol.asyncIterator] = () => instrumented;\n\n return true;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA2CA,SAAgB,kCACd,UAC2E;CAC3E,MAAM,uBAAuB,CAC3B;EAAE,SAAS,SAAS,SAAS;EAAM,WAAW;CAAO,GACrD;EAAE,SAAS,SAAS,SAAS;EAAY,WAAW;CAAa,CACnE;CAEA,SAAS,WAAW,SAA8B;EAChD,KAAK,MAAM,EAAE,SAAS,eAAe,sBACnC,yBACEA,eAA6D,OAAO,IACpE,SAAQ,gBAAgB,MAAM,WAAW,UAAU,OAAO,GAC1D;GACE,gBAAgB,MAAM,SAAS;IAC7B,IAAI,WAAW,MACb,uBAAuB,MAAM,iBAAiB,KAAK,YAAY,EAAE,CAAC;IAEpE,sBAAsB,MAAM,KAAK,QAAQ,0BAA0B,OAAO,CAAC,CAAC,aAAa;GAC3F;GACA,eAAe,EAAE,MAAM,MAAM,UAC3B,uB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