@sentry/server-utils 11.12.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 (1375) hide show
  1. package/build/THIRD-PARTY-LICENSES.txt +94 -94
  2. package/build/cjs/chunks/config.js +3388 -0
  3. package/build/cjs/chunks/config.js.map +1 -0
  4. package/build/cjs/{vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/core-Bd0h-mo3.js → chunks/core-BiWIBBjf.js} +40 -23
  5. package/build/cjs/chunks/core-BiWIBBjf.js.map +1 -0
  6. package/build/cjs/chunks/core.js +2 -0
  7. package/build/cjs/chunks/debug-build.js +15 -0
  8. package/build/cjs/chunks/debug-build.js.map +1 -0
  9. package/build/cjs/{vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm → chunks}/esbuild.js +20 -18
  10. package/build/cjs/chunks/esbuild.js.map +1 -0
  11. package/build/cjs/chunks/exports.js +7012 -0
  12. package/build/cjs/chunks/exports.js.map +1 -0
  13. package/build/cjs/{vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm → chunks}/instrumentation-serde-C-Xxv-jj.js +14 -6
  14. package/build/cjs/chunks/instrumentation-serde-C-Xxv-jj.js.map +1 -0
  15. package/build/cjs/chunks/module-details-from-path.js +15969 -0
  16. package/build/cjs/chunks/module-details-from-path.js.map +1 -0
  17. package/build/cjs/chunks/moduleInjectedTransform.js +10882 -0
  18. package/build/cjs/chunks/moduleInjectedTransform.js.map +1 -0
  19. package/build/cjs/chunks/options.js +66 -0
  20. package/build/cjs/chunks/options.js.map +1 -0
  21. package/build/cjs/chunks/pi-ai.js +80 -0
  22. package/build/cjs/chunks/pi-ai.js.map +1 -0
  23. package/build/cjs/chunks/registration-only.js +38 -0
  24. package/build/cjs/chunks/registration-only.js.map +1 -0
  25. package/build/cjs/chunks/resolve.js +75 -0
  26. package/build/cjs/chunks/resolve.js.map +1 -0
  27. package/build/cjs/chunks/rolldown-runtime.js +48 -0
  28. package/build/cjs/{vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/rollup-DCG8HLmh.js → chunks/rollup-CzqrjlS4.js} +17 -19
  29. package/build/cjs/chunks/rollup-CzqrjlS4.js.map +1 -0
  30. package/build/cjs/index.js +10409 -167
  31. package/build/cjs/index.js.map +1 -1
  32. package/build/cjs/index.no-diagnostic-channels.js +30 -53
  33. package/build/cjs/index.request-handler.js +240 -7
  34. package/build/cjs/index.request-handler.js.map +1 -1
  35. package/build/cjs/orchestrion/bundler/bun.js +102 -35
  36. package/build/cjs/orchestrion/bundler/bun.js.map +1 -1
  37. package/build/cjs/orchestrion/bundler/esbuild.js +59 -50
  38. package/build/cjs/orchestrion/bundler/esbuild.js.map +1 -1
  39. package/build/cjs/orchestrion/bundler/load-hook.js +24 -21
  40. package/build/cjs/orchestrion/bundler/load-hook.js.map +1 -1
  41. package/build/cjs/orchestrion/bundler/rollup.js +79 -70
  42. package/build/cjs/orchestrion/bundler/rollup.js.map +1 -1
  43. package/build/cjs/orchestrion/bundler/vite.js +212 -165
  44. package/build/cjs/orchestrion/bundler/vite.js.map +1 -1
  45. package/build/cjs/orchestrion/bundler/webpack-loader.js +134 -16
  46. package/build/cjs/orchestrion/bundler/webpack-loader.js.map +1 -1
  47. package/build/cjs/orchestrion/bundler/webpack.js +157 -77
  48. package/build/cjs/orchestrion/bundler/webpack.js.map +1 -1
  49. package/build/cjs/orchestrion/config/index.js +12 -129
  50. package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/defineProperty.js +17 -0
  51. package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/assertClassBrand.js +9 -0
  52. package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/checkPrivateRedeclaration.js +8 -0
  53. package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/classPrivateFieldGet2.js +9 -0
  54. package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/classPrivateFieldInitSpec.js +9 -0
  55. package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/classPrivateFieldSet2.js +9 -0
  56. package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/classPrivateMethodInitSpec.js +9 -0
  57. package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/defineProperty.js +11 -0
  58. package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/toPrimitive.js +13 -0
  59. package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/toPropertyKey.js +8 -0
  60. package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/esm/typeof.js +10 -0
  61. package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/toPrimitive.js +19 -0
  62. package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/toPropertyKey.js +15 -0
  63. package/build/esm/_virtual/_@oxc-project_runtime@0.158.0/helpers/typeof.js +15 -0
  64. package/build/esm/_virtual/_cjs/require_array_set.js +2 -0
  65. package/build/esm/_virtual/_cjs/require_astring.js +2 -0
  66. package/build/esm/_virtual/_cjs/require_base64.js +2 -0
  67. package/build/esm/_virtual/_cjs/require_base64_vlq.js +2 -0
  68. package/build/esm/_virtual/_cjs/require_binary_search.js +2 -0
  69. package/build/esm/_virtual/_cjs/require_esquery_min.js +2 -0
  70. package/build/esm/_virtual/_cjs/require_mapping_list.js +2 -0
  71. package/build/esm/_virtual/_cjs/require_meriyah.js +2 -0
  72. package/build/esm/_virtual/_cjs/require_quick_sort.js +2 -0
  73. package/build/esm/_virtual/_cjs/require_source_map.js +2 -0
  74. package/build/esm/_virtual/_cjs/require_source_map_consumer.js +2 -0
  75. package/build/esm/_virtual/_cjs/require_source_map_generator.js +2 -0
  76. package/build/esm/_virtual/_cjs/require_source_node.js +2 -0
  77. package/build/esm/_virtual/_cjs/require_util.js +2 -0
  78. package/build/esm/_virtual/_rolldown/runtime.js +35 -0
  79. package/build/esm/ai/anthropic-ai/constants.js +10 -6
  80. package/build/esm/ai/anthropic-ai/constants.js.map +1 -1
  81. package/build/esm/ai/anthropic-ai/index.js +183 -199
  82. package/build/esm/ai/anthropic-ai/index.js.map +1 -1
  83. package/build/esm/ai/anthropic-ai/streaming.js +176 -140
  84. package/build/esm/ai/anthropic-ai/streaming.js.map +1 -1
  85. package/build/esm/ai/anthropic-ai/tool-runner.js +99 -125
  86. package/build/esm/ai/anthropic-ai/tool-runner.js.map +1 -1
  87. package/build/esm/ai/anthropic-ai/utils.js +72 -52
  88. package/build/esm/ai/anthropic-ai/utils.js.map +1 -1
  89. package/build/esm/ai/core/apiPromise.js +35 -47
  90. package/build/esm/ai/core/apiPromise.js.map +1 -1
  91. package/build/esm/ai/core/gen-ai-attributes.js +29 -2
  92. package/build/esm/ai/core/gen-ai-attributes.js.map +1 -1
  93. package/build/esm/ai/core/streaming-tool-calls.js +37 -0
  94. package/build/esm/ai/core/streaming-tool-calls.js.map +1 -0
  95. package/build/esm/ai/core/utils.js +200 -144
  96. package/build/esm/ai/core/utils.js.map +1 -1
  97. package/build/esm/ai/flue/constants.js +31 -6
  98. package/build/esm/ai/flue/constants.js.map +1 -1
  99. package/build/esm/ai/flue/index.js +140 -134
  100. package/build/esm/ai/flue/index.js.map +1 -1
  101. package/build/esm/ai/flue/utils.js +93 -179
  102. package/build/esm/ai/flue/utils.js.map +1 -1
  103. package/build/esm/ai/google-genai/constants.js +15 -8
  104. package/build/esm/ai/google-genai/constants.js.map +1 -1
  105. package/build/esm/ai/google-genai/index.js +240 -254
  106. package/build/esm/ai/google-genai/index.js.map +1 -1
  107. package/build/esm/ai/google-genai/streaming.js +89 -66
  108. package/build/esm/ai/google-genai/streaming.js.map +1 -1
  109. package/build/esm/ai/google-genai/utils.js +115 -102
  110. package/build/esm/ai/google-genai/utils.js.map +1 -1
  111. package/build/esm/ai/index.js +12 -0
  112. package/build/esm/ai/langchain/constants.js +9 -8
  113. package/build/esm/ai/langchain/constants.js.map +1 -1
  114. package/build/esm/ai/langchain/embeddings.js +83 -67
  115. package/build/esm/ai/langchain/embeddings.js.map +1 -1
  116. package/build/esm/ai/langchain/index.js +249 -307
  117. package/build/esm/ai/langchain/index.js.map +1 -1
  118. package/build/esm/ai/langchain/typesafe-classifier.js +43 -43
  119. package/build/esm/ai/langchain/typesafe-classifier.js.map +1 -1
  120. package/build/esm/ai/langchain/utils.js +323 -288
  121. package/build/esm/ai/langchain/utils.js.map +1 -1
  122. package/build/esm/ai/langgraph/agent-span.js +73 -79
  123. package/build/esm/ai/langgraph/agent-span.js.map +1 -1
  124. package/build/esm/ai/langgraph/constants.js +3 -2
  125. package/build/esm/ai/langgraph/constants.js.map +1 -1
  126. package/build/esm/ai/langgraph/index.js +111 -109
  127. package/build/esm/ai/langgraph/index.js.map +1 -1
  128. package/build/esm/ai/langgraph/stream.js +84 -110
  129. package/build/esm/ai/langgraph/stream.js.map +1 -1
  130. package/build/esm/ai/langgraph/utils.js +171 -195
  131. package/build/esm/ai/langgraph/utils.js.map +1 -1
  132. package/build/esm/ai/mastra/classifier-evaluation.js +25 -18
  133. package/build/esm/ai/mastra/classifier-evaluation.js.map +1 -1
  134. package/build/esm/ai/mastra/constants.js +63 -18
  135. package/build/esm/ai/mastra/constants.js.map +1 -1
  136. package/build/esm/ai/mastra/index.js +164 -190
  137. package/build/esm/ai/mastra/index.js.map +1 -1
  138. package/build/esm/ai/mastra/span-registry.js +17 -8
  139. package/build/esm/ai/mastra/span-registry.js.map +1 -1
  140. package/build/esm/ai/mastra/utils.js +110 -137
  141. package/build/esm/ai/mastra/utils.js.map +1 -1
  142. package/build/esm/ai/mistral/constants.js +19 -9
  143. package/build/esm/ai/mistral/constants.js.map +1 -1
  144. package/build/esm/ai/mistral/index.js +111 -113
  145. package/build/esm/ai/mistral/index.js.map +1 -1
  146. package/build/esm/ai/mistral/streaming.js +183 -186
  147. package/build/esm/ai/mistral/streaming.js.map +1 -1
  148. package/build/esm/ai/mistral/utils.js +67 -73
  149. package/build/esm/ai/mistral/utils.js.map +1 -1
  150. package/build/esm/ai/openai/constants.js +20 -22
  151. package/build/esm/ai/openai/constants.js.map +1 -1
  152. package/build/esm/ai/openai/index.js +151 -159
  153. package/build/esm/ai/openai/index.js.map +1 -1
  154. package/build/esm/ai/openai/mapping.js +76 -53
  155. package/build/esm/ai/openai/mapping.js.map +1 -1
  156. package/build/esm/ai/openai/streaming.js +151 -155
  157. package/build/esm/ai/openai/streaming.js.map +1 -1
  158. package/build/esm/ai/openai/utils.js +94 -110
  159. package/build/esm/ai/openai/utils.js.map +1 -1
  160. package/build/esm/ai/pi-ai/chat.js +74 -0
  161. package/build/esm/ai/pi-ai/chat.js.map +1 -0
  162. package/build/esm/ai/pi-ai/constants.js +6 -0
  163. package/build/esm/ai/pi-ai/constants.js.map +1 -0
  164. package/build/esm/ai/pi-ai/messages.js +114 -107
  165. package/build/esm/ai/pi-ai/messages.js.map +1 -1
  166. package/build/esm/ai/pi-ai/providers.js +21 -18
  167. package/build/esm/ai/pi-ai/providers.js.map +1 -1
  168. package/build/esm/ai/pi-ai/recording.js +28 -0
  169. package/build/esm/ai/pi-ai/recording.js.map +1 -0
  170. package/build/esm/ai/pi-ai/usage.js +31 -27
  171. package/build/esm/ai/pi-ai/usage.js.map +1 -1
  172. package/build/esm/ai/pi-durable/constants.js +15 -5
  173. package/build/esm/ai/pi-durable/constants.js.map +1 -1
  174. package/build/esm/ai/pi-durable/index.js +164 -165
  175. package/build/esm/ai/pi-durable/index.js.map +1 -1
  176. package/build/esm/ai/pi-durable/runs.js +134 -136
  177. package/build/esm/ai/pi-durable/runs.js.map +1 -1
  178. package/build/esm/ai/pi-durable/tools.js +152 -160
  179. package/build/esm/ai/pi-durable/tools.js.map +1 -1
  180. package/build/esm/ai/pi-durable/utils.js +6 -4
  181. package/build/esm/ai/pi-durable/utils.js.map +1 -1
  182. package/build/esm/ai/typesafe/constants.js +3 -2
  183. package/build/esm/ai/typesafe/constants.js.map +1 -1
  184. package/build/esm/ai/typesafe/index.js +82 -94
  185. package/build/esm/ai/typesafe/index.js.map +1 -1
  186. package/build/esm/ai/vercel-ai/index.js +55 -60
  187. package/build/esm/ai/vercel-ai/index.js.map +1 -1
  188. package/build/esm/ai/workers-ai/constants.js +15 -2
  189. package/build/esm/ai/workers-ai/constants.js.map +1 -1
  190. package/build/esm/ai/workers-ai/index.js +82 -78
  191. package/build/esm/ai/workers-ai/index.js.map +1 -1
  192. package/build/esm/ai/workers-ai/streaming.js +136 -140
  193. package/build/esm/ai/workers-ai/streaming.js.map +1 -1
  194. package/build/esm/ai/workers-ai/utils.js +131 -143
  195. package/build/esm/ai/workers-ai/utils.js.map +1 -1
  196. package/build/esm/async-context.js +74 -63
  197. package/build/esm/async-context.js.map +1 -1
  198. package/build/esm/debug-build.js +9 -3
  199. package/build/esm/debug-build.js.map +1 -1
  200. package/build/esm/eve.js +61 -22
  201. package/build/esm/eve.js.map +1 -1
  202. package/build/esm/exports.js +21 -0
  203. package/build/esm/index.js +82 -76
  204. package/build/esm/index.js.map +1 -1
  205. package/build/esm/index.no-diagnostic-channels.js +21 -20
  206. package/build/esm/index.request-handler.js +1 -2
  207. package/build/esm/integrations/amqplib.js +338 -349
  208. package/build/esm/integrations/amqplib.js.map +1 -1
  209. package/build/esm/integrations/anthropic.js +154 -120
  210. package/build/esm/integrations/anthropic.js.map +1 -1
  211. package/build/esm/integrations/aws-sdk/constants.js +11 -2
  212. package/build/esm/integrations/aws-sdk/constants.js.map +1 -1
  213. package/build/esm/integrations/aws-sdk/index.js +118 -134
  214. package/build/esm/integrations/aws-sdk/index.js.map +1 -1
  215. package/build/esm/integrations/aws-sdk/services/MessageAttributes.js +30 -31
  216. package/build/esm/integrations/aws-sdk/services/MessageAttributes.js.map +1 -1
  217. package/build/esm/integrations/aws-sdk/services/ServicesExtensions.js +38 -44
  218. package/build/esm/integrations/aws-sdk/services/ServicesExtensions.js.map +1 -1
  219. package/build/esm/integrations/aws-sdk/services/bedrock-runtime-content.js +144 -0
  220. package/build/esm/integrations/aws-sdk/services/bedrock-runtime-content.js.map +1 -0
  221. package/build/esm/integrations/aws-sdk/services/bedrock-runtime.js +316 -454
  222. package/build/esm/integrations/aws-sdk/services/bedrock-runtime.js.map +1 -1
  223. package/build/esm/integrations/aws-sdk/services/dynamodb.js +67 -125
  224. package/build/esm/integrations/aws-sdk/services/dynamodb.js.map +1 -1
  225. package/build/esm/integrations/aws-sdk/services/index.js +1 -0
  226. package/build/esm/integrations/aws-sdk/services/kinesis.js +12 -16
  227. package/build/esm/integrations/aws-sdk/services/kinesis.js.map +1 -1
  228. package/build/esm/integrations/aws-sdk/services/lambda.js +51 -57
  229. package/build/esm/integrations/aws-sdk/services/lambda.js.map +1 -1
  230. package/build/esm/integrations/aws-sdk/services/s3.js +12 -16
  231. package/build/esm/integrations/aws-sdk/services/s3.js.map +1 -1
  232. package/build/esm/integrations/aws-sdk/services/secretsmanager.js +16 -22
  233. package/build/esm/integrations/aws-sdk/services/secretsmanager.js.map +1 -1
  234. package/build/esm/integrations/aws-sdk/services/sns.js +66 -70
  235. package/build/esm/integrations/aws-sdk/services/sns.js.map +1 -1
  236. package/build/esm/integrations/aws-sdk/services/sqs.js +104 -124
  237. package/build/esm/integrations/aws-sdk/services/sqs.js.map +1 -1
  238. package/build/esm/integrations/aws-sdk/services/stepfunctions.js +14 -20
  239. package/build/esm/integrations/aws-sdk/services/stepfunctions.js.map +1 -1
  240. package/build/esm/integrations/aws-sdk/utils.js +18 -19
  241. package/build/esm/integrations/aws-sdk/utils.js.map +1 -1
  242. package/build/esm/integrations/cron.js +33 -35
  243. package/build/esm/integrations/cron.js.map +1 -1
  244. package/build/esm/integrations/dataloader.js +101 -93
  245. package/build/esm/integrations/dataloader.js.map +1 -1
  246. package/build/esm/integrations/express/error-handled.js +13 -8
  247. package/build/esm/integrations/express/error-handled.js.map +1 -1
  248. package/build/esm/integrations/express/error-handler.js +49 -31
  249. package/build/esm/integrations/express/error-handler.js.map +1 -1
  250. package/build/esm/integrations/express/index.js +26 -17
  251. package/build/esm/integrations/express/index.js.map +1 -1
  252. package/build/esm/integrations/express/instrumentation.js +182 -196
  253. package/build/esm/integrations/express/instrumentation.js.map +1 -1
  254. package/build/esm/integrations/express/route.js +70 -45
  255. package/build/esm/integrations/express/route.js.map +1 -1
  256. package/build/esm/integrations/express/utils.js +11 -5
  257. package/build/esm/integrations/express/utils.js.map +1 -1
  258. package/build/esm/integrations/fastify/errors.js +33 -26
  259. package/build/esm/integrations/fastify/errors.js.map +1 -1
  260. package/build/esm/integrations/fastify/index.js +41 -21
  261. package/build/esm/integrations/fastify/index.js.map +1 -1
  262. package/build/esm/integrations/fastify/instrumentation.js +188 -208
  263. package/build/esm/integrations/fastify/instrumentation.js.map +1 -1
  264. package/build/esm/integrations/fastify/utils.js +21 -15
  265. package/build/esm/integrations/fastify/utils.js.map +1 -1
  266. package/build/esm/integrations/firebase/firestore.js +69 -70
  267. package/build/esm/integrations/firebase/firestore.js.map +1 -1
  268. package/build/esm/integrations/firebase/functions.js +66 -68
  269. package/build/esm/integrations/firebase/functions.js.map +1 -1
  270. package/build/esm/integrations/firebase/index.js +21 -13
  271. package/build/esm/integrations/firebase/index.js.map +1 -1
  272. package/build/esm/integrations/firebase/instrumentation.js +86 -47
  273. package/build/esm/integrations/firebase/instrumentation.js.map +1 -1
  274. package/build/esm/integrations/flue.js +46 -33
  275. package/build/esm/integrations/flue.js.map +1 -1
  276. package/build/esm/integrations/generic-pool.js +30 -27
  277. package/build/esm/integrations/generic-pool.js.map +1 -1
  278. package/build/esm/integrations/google-genai.js +89 -87
  279. package/build/esm/integrations/google-genai.js.map +1 -1
  280. package/build/esm/integrations/graphql/constants.js +6 -4
  281. package/build/esm/integrations/graphql/constants.js.map +1 -1
  282. package/build/esm/integrations/graphql/graphql-dc-subscriber.js +95 -99
  283. package/build/esm/integrations/graphql/graphql-dc-subscriber.js.map +1 -1
  284. package/build/esm/integrations/graphql/index.js +38 -47
  285. package/build/esm/integrations/graphql/index.js.map +1 -1
  286. package/build/esm/integrations/graphql/resolvers.js +117 -142
  287. package/build/esm/integrations/graphql/resolvers.js.map +1 -1
  288. package/build/esm/integrations/graphql/spans.js +110 -93
  289. package/build/esm/integrations/graphql/spans.js.map +1 -1
  290. package/build/esm/integrations/graphql/utils.js +84 -79
  291. package/build/esm/integrations/graphql/utils.js.map +1 -1
  292. package/build/esm/integrations/groq.js +22 -16
  293. package/build/esm/integrations/groq.js.map +1 -1
  294. package/build/esm/integrations/hapi/hapi-error-handler.js +47 -38
  295. package/build/esm/integrations/hapi/hapi-error-handler.js.map +1 -1
  296. package/build/esm/integrations/hapi/hapi-types.js +20 -13
  297. package/build/esm/integrations/hapi/hapi-types.js.map +1 -1
  298. package/build/esm/integrations/hapi/hapi-utils.js +165 -166
  299. package/build/esm/integrations/hapi/hapi-utils.js.map +1 -1
  300. package/build/esm/integrations/hapi/index.js +53 -64
  301. package/build/esm/integrations/hapi/index.js.map +1 -1
  302. package/build/esm/integrations/hono/applyPatches.js +43 -26
  303. package/build/esm/integrations/hono/applyPatches.js.map +1 -1
  304. package/build/esm/integrations/hono/connInfo.js +39 -30
  305. package/build/esm/integrations/hono/connInfo.js.map +1 -1
  306. package/build/esm/integrations/hono/constants.js +3 -2
  307. package/build/esm/integrations/hono/constants.js.map +1 -1
  308. package/build/esm/integrations/hono/createHonoMiddleware.js +59 -36
  309. package/build/esm/integrations/hono/createHonoMiddleware.js.map +1 -1
  310. package/build/esm/integrations/hono/defaultShouldHandleError.js +17 -9
  311. package/build/esm/integrations/hono/defaultShouldHandleError.js.map +1 -1
  312. package/build/esm/integrations/hono/hono-context.js +13 -9
  313. package/build/esm/integrations/hono/hono-context.js.map +1 -1
  314. package/build/esm/integrations/hono/honoIntegration.js +114 -78
  315. package/build/esm/integrations/hono/honoIntegration.js.map +1 -1
  316. package/build/esm/integrations/hono/index.js +3 -0
  317. package/build/esm/integrations/hono/isMiddleware.js +26 -13
  318. package/build/esm/integrations/hono/isMiddleware.js.map +1 -1
  319. package/build/esm/integrations/hono/matchResult.js +59 -64
  320. package/build/esm/integrations/hono/matchResult.js.map +1 -1
  321. package/build/esm/integrations/hono/middlewareHandlers.js +88 -82
  322. package/build/esm/integrations/hono/middlewareHandlers.js.map +1 -1
  323. package/build/esm/integrations/hono/patchAppRequest.js +77 -62
  324. package/build/esm/integrations/hono/patchAppRequest.js.map +1 -1
  325. package/build/esm/integrations/hono/patchAppUse.js +71 -56
  326. package/build/esm/integrations/hono/patchAppUse.js.map +1 -1
  327. package/build/esm/integrations/hono/patchRoute.js +73 -59
  328. package/build/esm/integrations/hono/patchRoute.js.map +1 -1
  329. package/build/esm/integrations/hono/resolveRouteName.js +19 -22
  330. package/build/esm/integrations/hono/resolveRouteName.js.map +1 -1
  331. package/build/esm/integrations/hono/sentryOriginalTraps.js +23 -16
  332. package/build/esm/integrations/hono/sentryOriginalTraps.js.map +1 -1
  333. package/build/esm/integrations/hono/wrapMiddlewareSpan.js +45 -42
  334. package/build/esm/integrations/hono/wrapMiddlewareSpan.js.map +1 -1
  335. package/build/esm/integrations/index.js +92 -85
  336. package/build/esm/integrations/index.js.map +1 -1
  337. package/build/esm/integrations/kafkajs/consumer.js +58 -60
  338. package/build/esm/integrations/kafkajs/consumer.js.map +1 -1
  339. package/build/esm/integrations/kafkajs/index.js +53 -57
  340. package/build/esm/integrations/kafkajs/index.js.map +1 -1
  341. package/build/esm/integrations/kafkajs/semconv.js +4 -2
  342. package/build/esm/integrations/kafkajs/semconv.js.map +1 -1
  343. package/build/esm/integrations/kafkajs/spans.js +107 -101
  344. package/build/esm/integrations/kafkajs/spans.js.map +1 -1
  345. package/build/esm/integrations/knex.js +133 -157
  346. package/build/esm/integrations/knex.js.map +1 -1
  347. package/build/esm/integrations/koa/index.js +122 -133
  348. package/build/esm/integrations/koa/index.js.map +1 -1
  349. package/build/esm/integrations/koa/koa-error-handler.js +43 -25
  350. package/build/esm/integrations/koa/koa-error-handler.js.map +1 -1
  351. package/build/esm/integrations/langchain.js +66 -75
  352. package/build/esm/integrations/langchain.js.map +1 -1
  353. package/build/esm/integrations/langgraph.js +55 -61
  354. package/build/esm/integrations/langgraph.js.map +1 -1
  355. package/build/esm/integrations/lru-memoizer.js +22 -20
  356. package/build/esm/integrations/lru-memoizer.js.map +1 -1
  357. package/build/esm/integrations/mastra-classifier.js +47 -50
  358. package/build/esm/integrations/mastra-classifier.js.map +1 -1
  359. package/build/esm/integrations/mastra.js +208 -209
  360. package/build/esm/integrations/mastra.js.map +1 -1
  361. package/build/esm/integrations/mcp-server.js +28 -28
  362. package/build/esm/integrations/mcp-server.js.map +1 -1
  363. package/build/esm/integrations/mistral.js +73 -56
  364. package/build/esm/integrations/mistral.js.map +1 -1
  365. package/build/esm/integrations/mongodb/index.js +101 -76
  366. package/build/esm/integrations/mongodb/index.js.map +1 -1
  367. package/build/esm/integrations/mongodb/mongodb-span.js +110 -106
  368. package/build/esm/integrations/mongodb/mongodb-span.js.map +1 -1
  369. package/build/esm/integrations/mongoose/index.js +82 -89
  370. package/build/esm/integrations/mongoose/index.js.map +1 -1
  371. package/build/esm/integrations/mongoose/mongoose-dc-subscriber.js +85 -72
  372. package/build/esm/integrations/mongoose/mongoose-dc-subscriber.js.map +1 -1
  373. package/build/esm/integrations/mongoose/mongoose-legacy-span.js +39 -36
  374. package/build/esm/integrations/mongoose/mongoose-legacy-span.js.map +1 -1
  375. package/build/esm/integrations/mysql.js +74 -83
  376. package/build/esm/integrations/mysql.js.map +1 -1
  377. package/build/esm/integrations/mysql2/index.js +86 -61
  378. package/build/esm/integrations/mysql2/index.js.map +1 -1
  379. package/build/esm/integrations/mysql2/mysql2-dc-subscriber.js +51 -38
  380. package/build/esm/integrations/mysql2/mysql2-dc-subscriber.js.map +1 -1
  381. package/build/esm/integrations/neon.js +84 -86
  382. package/build/esm/integrations/neon.js.map +1 -1
  383. package/build/esm/integrations/nitro/captureStorageEvents.js +97 -111
  384. package/build/esm/integrations/nitro/captureStorageEvents.js.map +1 -1
  385. package/build/esm/integrations/nitro/captureTracingEvents.js +139 -181
  386. package/build/esm/integrations/nitro/captureTracingEvents.js.map +1 -1
  387. package/build/esm/integrations/nitro/index.js +26 -20
  388. package/build/esm/integrations/nitro/index.js.map +1 -1
  389. package/build/esm/integrations/nitro/setServerTimingHeaders.js +31 -33
  390. package/build/esm/integrations/nitro/setServerTimingHeaders.js.map +1 -1
  391. package/build/esm/integrations/node-cron.js +53 -48
  392. package/build/esm/integrations/node-cron.js.map +1 -1
  393. package/build/esm/integrations/node-schedule.js +45 -51
  394. package/build/esm/integrations/node-schedule.js.map +1 -1
  395. package/build/esm/integrations/openai-compatible.js +84 -79
  396. package/build/esm/integrations/openai-compatible.js.map +1 -1
  397. package/build/esm/integrations/openai.js +85 -75
  398. package/build/esm/integrations/openai.js.map +1 -1
  399. package/build/esm/integrations/pg.js +147 -130
  400. package/build/esm/integrations/pg.js.map +1 -1
  401. package/build/esm/integrations/pi-ai.js +69 -0
  402. package/build/esm/integrations/pi-ai.js.map +1 -0
  403. package/build/esm/integrations/pi-durable.js +46 -42
  404. package/build/esm/integrations/pi-durable.js.map +1 -1
  405. package/build/esm/integrations/postgresjs/index.js +124 -126
  406. package/build/esm/integrations/postgresjs/index.js.map +1 -1
  407. package/build/esm/integrations/postgresjs/postgresjs-dc-subscriber.js +72 -64
  408. package/build/esm/integrations/postgresjs/postgresjs-dc-subscriber.js.map +1 -1
  409. package/build/esm/integrations/postgresjs-wrapper.js +232 -187
  410. package/build/esm/integrations/postgresjs-wrapper.js.map +1 -1
  411. package/build/esm/integrations/prisma/global.js +6 -5
  412. package/build/esm/integrations/prisma/global.js.map +1 -1
  413. package/build/esm/integrations/prisma/index.js +44 -26
  414. package/build/esm/integrations/prisma/index.js.map +1 -1
  415. package/build/esm/integrations/prisma/orchestrion.js +96 -115
  416. package/build/esm/integrations/prisma/orchestrion.js.map +1 -1
  417. package/build/esm/integrations/prisma/tracing-helper.js +192 -208
  418. package/build/esm/integrations/prisma/tracing-helper.js.map +1 -1
  419. package/build/esm/integrations/redis/index.js +173 -190
  420. package/build/esm/integrations/redis/index.js.map +1 -1
  421. package/build/esm/integrations/redis/ioredis-channel-subscriber.js +78 -72
  422. package/build/esm/integrations/redis/ioredis-channel-subscriber.js.map +1 -1
  423. package/build/esm/integrations/redis/redis-cache.js +110 -111
  424. package/build/esm/integrations/redis/redis-cache.js.map +1 -1
  425. package/build/esm/integrations/redis/redis-dc-subscriber.js +79 -84
  426. package/build/esm/integrations/redis/redis-dc-subscriber.js.map +1 -1
  427. package/build/esm/integrations/redis/redis-span-name.js +31 -21
  428. package/build/esm/integrations/redis/redis-span-name.js.map +1 -1
  429. package/build/esm/integrations/redis/redis-statement-serializer.js +38 -27
  430. package/build/esm/integrations/redis/redis-statement-serializer.js.map +1 -1
  431. package/build/esm/integrations/serveTunnel.js +30 -24
  432. package/build/esm/integrations/serveTunnel.js.map +1 -1
  433. package/build/esm/integrations/tedious.js +132 -132
  434. package/build/esm/integrations/tedious.js.map +1 -1
  435. package/build/esm/integrations/together-ai.js +22 -16
  436. package/build/esm/integrations/together-ai.js.map +1 -1
  437. package/build/esm/integrations/typesafe.js +32 -37
  438. package/build/esm/integrations/typesafe.js.map +1 -1
  439. package/build/esm/integrations/vercel-ai/gen-ai-recording-mode.js +20 -4
  440. package/build/esm/integrations/vercel-ai/gen-ai-recording-mode.js.map +1 -1
  441. package/build/esm/integrations/vercel-ai/index.js +29 -26
  442. package/build/esm/integrations/vercel-ai/index.js.map +1 -1
  443. package/build/esm/integrations/vercel-ai/util.js +86 -92
  444. package/build/esm/integrations/vercel-ai/util.js.map +1 -1
  445. package/build/esm/integrations/vercel-ai/vercel-ai-dc-subscriber.js +507 -514
  446. package/build/esm/integrations/vercel-ai/vercel-ai-dc-subscriber.js.map +1 -1
  447. package/build/esm/integrations/vercel-ai/vercel-ai-orchestrion-subscriber.js +386 -361
  448. package/build/esm/integrations/vercel-ai/vercel-ai-orchestrion-subscriber.js.map +1 -1
  449. package/build/esm/integrations/vercel-ai/vercel-ai-tool-telemetry.js +61 -34
  450. package/build/esm/integrations/vercel-ai/vercel-ai-tool-telemetry.js.map +1 -1
  451. package/build/esm/opentelemetry.js +70 -35
  452. package/build/esm/opentelemetry.js.map +1 -1
  453. package/build/esm/orchestrion/bundler/bun.js +42 -32
  454. package/build/esm/orchestrion/bundler/bun.js.map +1 -1
  455. package/build/esm/orchestrion/bundler/esbuild.js +57 -47
  456. package/build/esm/orchestrion/bundler/esbuild.js.map +1 -1
  457. package/build/esm/orchestrion/bundler/externalRequire.js +65 -62
  458. package/build/esm/orchestrion/bundler/externalRequire.js.map +1 -1
  459. package/build/esm/orchestrion/bundler/load-hook.js +23 -19
  460. package/build/esm/orchestrion/bundler/load-hook.js.map +1 -1
  461. package/build/esm/orchestrion/bundler/moduleInjectedTransform.js +118 -44
  462. package/build/esm/orchestrion/bundler/moduleInjectedTransform.js.map +1 -1
  463. package/build/esm/orchestrion/bundler/options.js +42 -13
  464. package/build/esm/orchestrion/bundler/options.js.map +1 -1
  465. package/build/esm/orchestrion/bundler/resolve.js +43 -13
  466. package/build/esm/orchestrion/bundler/resolve.js.map +1 -1
  467. package/build/esm/orchestrion/bundler/rollup.js +78 -67
  468. package/build/esm/orchestrion/bundler/rollup.js.map +1 -1
  469. package/build/esm/orchestrion/bundler/vite.js +122 -160
  470. package/build/esm/orchestrion/bundler/vite.js.map +1 -1
  471. package/build/esm/orchestrion/bundler/webpack-loader.js +18 -14
  472. package/build/esm/orchestrion/bundler/webpack-loader.js.map +1 -1
  473. package/build/esm/orchestrion/bundler/webpack.js +57 -71
  474. package/build/esm/orchestrion/bundler/webpack.js.map +1 -1
  475. package/build/esm/orchestrion/channels.js +105 -87
  476. package/build/esm/orchestrion/channels.js.map +1 -1
  477. package/build/esm/orchestrion/config/amqplib.js +152 -83
  478. package/build/esm/orchestrion/config/amqplib.js.map +1 -1
  479. package/build/esm/orchestrion/config/anthropic-ai.js +96 -43
  480. package/build/esm/orchestrion/config/anthropic-ai.js.map +1 -1
  481. package/build/esm/orchestrion/config/aws-sdk.js +46 -22
  482. package/build/esm/orchestrion/config/aws-sdk.js.map +1 -1
  483. package/build/esm/orchestrion/config/channel-integration-definitions.js +193 -51
  484. package/build/esm/orchestrion/config/channel-integration-definitions.js.map +1 -1
  485. package/build/esm/orchestrion/config/cron.js +27 -18
  486. package/build/esm/orchestrion/config/cron.js.map +1 -1
  487. package/build/esm/orchestrion/config/dataloader.js +62 -45
  488. package/build/esm/orchestrion/config/dataloader.js.map +1 -1
  489. package/build/esm/orchestrion/config/express.js +80 -71
  490. package/build/esm/orchestrion/config/express.js.map +1 -1
  491. package/build/esm/orchestrion/config/firebase.js +133 -70
  492. package/build/esm/orchestrion/config/firebase.js.map +1 -1
  493. package/build/esm/orchestrion/config/flue.js +15 -7
  494. package/build/esm/orchestrion/config/flue.js.map +1 -1
  495. package/build/esm/orchestrion/config/generic-pool.js +29 -19
  496. package/build/esm/orchestrion/config/generic-pool.js.map +1 -1
  497. package/build/esm/orchestrion/config/google-genai.js +50 -33
  498. package/build/esm/orchestrion/config/google-genai.js.map +1 -1
  499. package/build/esm/orchestrion/config/graphql.js +43 -22
  500. package/build/esm/orchestrion/config/graphql.js.map +1 -1
  501. package/build/esm/orchestrion/config/groq.js +9 -9
  502. package/build/esm/orchestrion/config/groq.js.map +1 -1
  503. package/build/esm/orchestrion/config/hapi.js +56 -38
  504. package/build/esm/orchestrion/config/hapi.js.map +1 -1
  505. package/build/esm/orchestrion/config/hono.js +23 -26
  506. package/build/esm/orchestrion/config/hono.js.map +1 -1
  507. package/build/esm/orchestrion/config/index.js +177 -111
  508. package/build/esm/orchestrion/config/index.js.map +1 -1
  509. package/build/esm/orchestrion/config/ioredis.js +65 -31
  510. package/build/esm/orchestrion/config/ioredis.js.map +1 -1
  511. package/build/esm/orchestrion/config/kafkajs.js +29 -26
  512. package/build/esm/orchestrion/config/kafkajs.js.map +1 -1
  513. package/build/esm/orchestrion/config/knex.js +57 -29
  514. package/build/esm/orchestrion/config/knex.js.map +1 -1
  515. package/build/esm/orchestrion/config/koa.js +31 -24
  516. package/build/esm/orchestrion/config/koa.js.map +1 -1
  517. package/build/esm/orchestrion/config/langchain.js +78 -49
  518. package/build/esm/orchestrion/config/langchain.js.map +1 -1
  519. package/build/esm/orchestrion/config/langgraph.js +25 -20
  520. package/build/esm/orchestrion/config/langgraph.js.map +1 -1
  521. package/build/esm/orchestrion/config/lru-memoizer.js +17 -15
  522. package/build/esm/orchestrion/config/lru-memoizer.js.map +1 -1
  523. package/build/esm/orchestrion/config/mastra.js +44 -44
  524. package/build/esm/orchestrion/config/mastra.js.map +1 -1
  525. package/build/esm/orchestrion/config/mcp-server.js +24 -32
  526. package/build/esm/orchestrion/config/mcp-server.js.map +1 -1
  527. package/build/esm/orchestrion/config/mistral.js +87 -47
  528. package/build/esm/orchestrion/config/mistral.js.map +1 -1
  529. package/build/esm/orchestrion/config/module-names.js +9 -3
  530. package/build/esm/orchestrion/config/module-names.js.map +1 -1
  531. package/build/esm/orchestrion/config/mongodb.js +101 -61
  532. package/build/esm/orchestrion/config/mongodb.js.map +1 -1
  533. package/build/esm/orchestrion/config/mongoose.js +131 -100
  534. package/build/esm/orchestrion/config/mongoose.js.map +1 -1
  535. package/build/esm/orchestrion/config/mysql.js +17 -14
  536. package/build/esm/orchestrion/config/mysql.js.map +1 -1
  537. package/build/esm/orchestrion/config/mysql2.js +64 -28
  538. package/build/esm/orchestrion/config/mysql2.js.map +1 -1
  539. package/build/esm/orchestrion/config/neon.js +33 -36
  540. package/build/esm/orchestrion/config/neon.js.map +1 -1
  541. package/build/esm/orchestrion/config/nestjs.js +151 -120
  542. package/build/esm/orchestrion/config/nestjs.js.map +1 -1
  543. package/build/esm/orchestrion/config/nitro.js +25 -7
  544. package/build/esm/orchestrion/config/nitro.js.map +1 -1
  545. package/build/esm/orchestrion/config/node-cron.js +74 -43
  546. package/build/esm/orchestrion/config/node-cron.js.map +1 -1
  547. package/build/esm/orchestrion/config/node-schedule.js +26 -21
  548. package/build/esm/orchestrion/config/node-schedule.js.map +1 -1
  549. package/build/esm/orchestrion/config/openai-compatible.js +42 -15
  550. package/build/esm/orchestrion/config/openai-compatible.js.map +1 -1
  551. package/build/esm/orchestrion/config/openai.js +72 -39
  552. package/build/esm/orchestrion/config/openai.js.map +1 -1
  553. package/build/esm/orchestrion/config/pg.js +70 -45
  554. package/build/esm/orchestrion/config/pg.js.map +1 -1
  555. package/build/esm/orchestrion/config/pi-ai.js +49 -0
  556. package/build/esm/orchestrion/config/pi-ai.js.map +1 -0
  557. package/build/esm/orchestrion/config/pi-durable.js +36 -26
  558. package/build/esm/orchestrion/config/pi-durable.js.map +1 -1
  559. package/build/esm/orchestrion/config/postgres.js +63 -48
  560. package/build/esm/orchestrion/config/postgres.js.map +1 -1
  561. package/build/esm/orchestrion/config/prisma.js +46 -36
  562. package/build/esm/orchestrion/config/prisma.js.map +1 -1
  563. package/build/esm/orchestrion/config/redis.js +133 -72
  564. package/build/esm/orchestrion/config/redis.js.map +1 -1
  565. package/build/esm/orchestrion/config/registration-only.js +23 -8
  566. package/build/esm/orchestrion/config/registration-only.js.map +1 -1
  567. package/build/esm/orchestrion/config/remix-v3.js +68 -47
  568. package/build/esm/orchestrion/config/remix-v3.js.map +1 -1
  569. package/build/esm/orchestrion/config/remix.js +77 -45
  570. package/build/esm/orchestrion/config/remix.js.map +1 -1
  571. package/build/esm/orchestrion/config/tedious.js +31 -16
  572. package/build/esm/orchestrion/config/tedious.js.map +1 -1
  573. package/build/esm/orchestrion/config/together-ai.js +17 -15
  574. package/build/esm/orchestrion/config/together-ai.js.map +1 -1
  575. package/build/esm/orchestrion/config/typesafe.js +16 -10
  576. package/build/esm/orchestrion/config/typesafe.js.map +1 -1
  577. package/build/esm/orchestrion/config/vercel-ai.js +54 -44
  578. package/build/esm/orchestrion/config/vercel-ai.js.map +1 -1
  579. package/build/esm/orchestrion/detect.js +50 -34
  580. package/build/esm/orchestrion/detect.js.map +1 -1
  581. package/build/esm/orchestrion/instrumentation.js +90 -70
  582. package/build/esm/orchestrion/instrumentation.js.map +1 -1
  583. package/build/esm/package.json +1 -1
  584. package/build/esm/tracing-channel.js +143 -135
  585. package/build/esm/tracing-channel.js.map +1 -1
  586. package/build/esm/utils/cronMonitoring.js +152 -125
  587. package/build/esm/utils/cronMonitoring.js.map +1 -1
  588. package/build/esm/utils/diagnosticsChannel.js +26 -21
  589. package/build/esm/utils/diagnosticsChannel.js.map +1 -1
  590. package/build/esm/utils/moduleInjected.js +35 -13
  591. package/build/esm/utils/moduleInjected.js.map +1 -1
  592. package/build/esm/utils/monitorStream.js +52 -58
  593. package/build/esm/utils/monitorStream.js.map +1 -1
  594. package/build/esm/utils/runtime.js +10 -8
  595. package/build/esm/utils/runtime.js.map +1 -1
  596. package/build/esm/utils/setHttpServerSpanRouteAttribute.js +22 -21
  597. package/build/esm/utils/setHttpServerSpanRouteAttribute.js.map +1 -1
  598. package/build/esm/utils/sql.js +260 -225
  599. package/build/esm/utils/sql.js.map +1 -1
  600. package/build/esm/utils/tunnelServer.js +27 -23
  601. package/build/esm/utils/tunnelServer.js.map +1 -1
  602. package/build/esm/utils/withCleanScopes.js +17 -12
  603. package/build/esm/utils/withCleanScopes.js.map +1 -1
  604. package/build/esm/utils/wrapServerRequestHandler.js +180 -208
  605. package/build/esm/utils/wrapServerRequestHandler.js.map +1 -1
  606. package/build/esm/vendored/@apm-js-collab/code-transformer/index.js +9 -5
  607. package/build/esm/vendored/@apm-js-collab/code-transformer/index.js.map +1 -1
  608. package/build/esm/vendored/@apm-js-collab/code-transformer/lib/index.js +21 -9
  609. package/build/esm/vendored/@apm-js-collab/code-transformer/lib/index.js.map +1 -1
  610. package/build/esm/vendored/@apm-js-collab/code-transformer/lib/matcher.js +80 -83
  611. package/build/esm/vendored/@apm-js-collab/code-transformer/lib/matcher.js.map +1 -1
  612. package/build/esm/vendored/@apm-js-collab/code-transformer/lib/transformer.js +289 -313
  613. package/build/esm/vendored/@apm-js-collab/code-transformer/lib/transformer.js.map +1 -1
  614. package/build/esm/vendored/@apm-js-collab/code-transformer/lib/transforms.js +488 -284
  615. package/build/esm/vendored/@apm-js-collab/code-transformer/lib/transforms.js.map +1 -1
  616. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/bun.js +5 -6
  617. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/bun.js.map +1 -1
  618. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/{core-Bd0h-mo3.js → core-BiWIBBjf.js} +15 -14
  619. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/core-BiWIBBjf.js.map +1 -0
  620. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/core.js +3 -0
  621. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/esbuild.js +6 -7
  622. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/esbuild.js.map +1 -1
  623. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/instrumentation-serde-C-Xxv-jj.js +3 -3
  624. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/instrumentation-serde-C-Xxv-jj.js.map +1 -1
  625. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/{rollup-DCG8HLmh.js → rollup-CzqrjlS4.js} +8 -13
  626. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/rollup-CzqrjlS4.js.map +1 -0
  627. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/rollup.js +1 -0
  628. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/vite.js +4 -5
  629. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/vite.js.map +1 -1
  630. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/webpack-loader-factory.js +13 -12
  631. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/webpack-loader-factory.js.map +1 -1
  632. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/webpack.js +7 -8
  633. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/webpack.js.map +1 -1
  634. package/build/esm/vendored/astring/dist/astring.js +910 -1065
  635. package/build/esm/vendored/astring/dist/astring.js.map +1 -1
  636. package/build/esm/vendored/esquery/dist/esquery.min.js +1312 -0
  637. package/build/esm/vendored/esquery/dist/esquery.min.js.map +1 -0
  638. package/build/esm/vendored/meriyah/dist/meriyah.js +10539 -9189
  639. package/build/esm/vendored/meriyah/dist/meriyah.js.map +1 -1
  640. package/build/esm/vendored/meriyah/dist/meriyah2.js +10122 -8806
  641. package/build/esm/vendored/meriyah/dist/meriyah2.js.map +1 -1
  642. package/build/esm/vendored/module-details-from-path/index.js +31 -40
  643. package/build/esm/vendored/module-details-from-path/index.js.map +1 -1
  644. package/build/esm/vendored/semifies/index.js +106 -108
  645. package/build/esm/vendored/semifies/index.js.map +1 -1
  646. package/build/esm/vendored/source-map/lib/array-set.js +100 -70
  647. package/build/esm/vendored/source-map/lib/array-set.js.map +1 -1
  648. package/build/esm/vendored/source-map/lib/base64-vlq.js +71 -54
  649. package/build/esm/vendored/source-map/lib/base64-vlq.js.map +1 -1
  650. package/build/esm/vendored/source-map/lib/base64.js +38 -39
  651. package/build/esm/vendored/source-map/lib/base64.js.map +1 -1
  652. package/build/esm/vendored/source-map/lib/binary-search.js +61 -50
  653. package/build/esm/vendored/source-map/lib/binary-search.js.map +1 -1
  654. package/build/esm/vendored/source-map/lib/mapping-list.js +75 -39
  655. package/build/esm/vendored/source-map/lib/mapping-list.js.map +1 -1
  656. package/build/esm/vendored/source-map/lib/quick-sort.js +73 -33
  657. package/build/esm/vendored/source-map/lib/quick-sort.js.map +1 -1
  658. package/build/esm/vendored/source-map/lib/source-map-consumer.js +763 -609
  659. package/build/esm/vendored/source-map/lib/source-map-consumer.js.map +1 -1
  660. package/build/esm/vendored/source-map/lib/source-map-generator.js +281 -282
  661. package/build/esm/vendored/source-map/lib/source-map-generator.js.map +1 -1
  662. package/build/esm/vendored/source-map/lib/source-node.js +294 -267
  663. package/build/esm/vendored/source-map/lib/source-node.js.map +1 -1
  664. package/build/esm/vendored/source-map/lib/util.js +241 -252
  665. package/build/esm/vendored/source-map/lib/util.js.map +1 -1
  666. package/build/esm/vendored/source-map/source-map.js +17 -13
  667. package/build/esm/vendored/source-map/source-map.js.map +1 -1
  668. package/build/types/ai/anthropic-ai/index.d.ts +1 -1
  669. package/build/types/ai/anthropic-ai/index.d.ts.map +1 -1
  670. package/build/types/ai/anthropic-ai/streaming.d.ts +2 -1
  671. package/build/types/ai/anthropic-ai/streaming.d.ts.map +1 -1
  672. package/build/types/ai/anthropic-ai/utils.d.ts +7 -2
  673. package/build/types/ai/anthropic-ai/utils.d.ts.map +1 -1
  674. package/build/types/ai/core/streaming-tool-calls.d.ts +19 -0
  675. package/build/types/ai/core/streaming-tool-calls.d.ts.map +1 -0
  676. package/build/types/ai/core/utils.d.ts +18 -1
  677. package/build/types/ai/core/utils.d.ts.map +1 -1
  678. package/build/types/ai/flue/constants.d.ts +5 -7
  679. package/build/types/ai/flue/constants.d.ts.map +1 -1
  680. package/build/types/ai/flue/index.d.ts +7 -4
  681. package/build/types/ai/flue/index.d.ts.map +1 -1
  682. package/build/types/ai/flue/types.d.ts +1 -38
  683. package/build/types/ai/flue/types.d.ts.map +1 -1
  684. package/build/types/ai/flue/utils.d.ts +1 -13
  685. package/build/types/ai/flue/utils.d.ts.map +1 -1
  686. package/build/types/ai/google-genai/index.d.ts +4 -0
  687. package/build/types/ai/google-genai/index.d.ts.map +1 -1
  688. package/build/types/ai/google-genai/streaming.d.ts.map +1 -1
  689. package/build/types/ai/openai/index.d.ts.map +1 -1
  690. package/build/types/ai/openai/streaming.d.ts.map +1 -1
  691. package/build/types/ai/pi-ai/chat.d.ts +20 -0
  692. package/build/types/ai/pi-ai/chat.d.ts.map +1 -0
  693. package/build/types/ai/pi-ai/constants.d.ts +3 -0
  694. package/build/types/ai/pi-ai/constants.d.ts.map +1 -0
  695. package/build/types/ai/pi-ai/providers.d.ts +9 -6
  696. package/build/types/ai/pi-ai/providers.d.ts.map +1 -1
  697. package/build/types/ai/pi-ai/recording.d.ts +15 -0
  698. package/build/types/ai/pi-ai/recording.d.ts.map +1 -0
  699. package/build/types/ai/pi-ai/types.d.ts +31 -0
  700. package/build/types/ai/pi-ai/types.d.ts.map +1 -0
  701. package/build/types/ai/pi-durable/index.d.ts +5 -5
  702. package/build/types/ai/pi-durable/index.d.ts.map +1 -1
  703. package/build/types/ai/pi-durable/types.d.ts +3 -43
  704. package/build/types/ai/pi-durable/types.d.ts.map +1 -1
  705. package/build/types/ai/workers-ai/index.d.ts.map +1 -1
  706. package/build/types/ai/workers-ai/streaming.d.ts.map +1 -1
  707. package/build/types/ai/workers-ai/types.d.ts +13 -0
  708. package/build/types/ai/workers-ai/types.d.ts.map +1 -1
  709. package/build/types/ai/workers-ai/utils.d.ts.map +1 -1
  710. package/build/types/eve.d.ts +13 -0
  711. package/build/types/eve.d.ts.map +1 -1
  712. package/build/types/index.d.ts +2 -1
  713. package/build/types/index.d.ts.map +1 -1
  714. package/build/types/integrations/anthropic.d.ts.map +1 -1
  715. package/build/types/integrations/aws-sdk/index.d.ts +3 -1
  716. package/build/types/integrations/aws-sdk/index.d.ts.map +1 -1
  717. package/build/types/integrations/aws-sdk/services/ServicesExtensions.d.ts +2 -0
  718. package/build/types/integrations/aws-sdk/services/ServicesExtensions.d.ts.map +1 -1
  719. package/build/types/integrations/aws-sdk/services/bedrock-runtime-content.d.ts +30 -0
  720. package/build/types/integrations/aws-sdk/services/bedrock-runtime-content.d.ts.map +1 -0
  721. package/build/types/integrations/aws-sdk/services/bedrock-runtime.d.ts +5 -0
  722. package/build/types/integrations/aws-sdk/services/bedrock-runtime.d.ts.map +1 -1
  723. package/build/types/integrations/flue.d.ts.map +1 -1
  724. package/build/types/integrations/google-genai.d.ts.map +1 -1
  725. package/build/types/integrations/index.d.ts.map +1 -1
  726. package/build/types/integrations/mistral.d.ts.map +1 -1
  727. package/build/types/integrations/nitro/captureStorageEvents.d.ts.map +1 -1
  728. package/build/types/integrations/nitro/captureTracingEvents.d.ts.map +1 -1
  729. package/build/types/integrations/nitro/setServerTimingHeaders.d.ts.map +1 -1
  730. package/build/types/integrations/openai-compatible.d.ts.map +1 -1
  731. package/build/types/integrations/openai.d.ts.map +1 -1
  732. package/build/types/integrations/pi-ai.d.ts +19 -0
  733. package/build/types/integrations/pi-ai.d.ts.map +1 -0
  734. package/build/types/integrations/pi-durable.d.ts +3 -4
  735. package/build/types/integrations/pi-durable.d.ts.map +1 -1
  736. package/build/types/integrations/vercel-ai/gen-ai-recording-mode.d.ts +5 -1
  737. package/build/types/integrations/vercel-ai/gen-ai-recording-mode.d.ts.map +1 -1
  738. package/build/types/integrations/vercel-ai/vercel-ai-dc-subscriber.d.ts +6 -4
  739. package/build/types/integrations/vercel-ai/vercel-ai-dc-subscriber.d.ts.map +1 -1
  740. package/build/types/integrations/vercel-ai/vercel-ai-orchestrion-subscriber.d.ts.map +1 -1
  741. package/build/types/integrations/vercel-ai/vercel-ai-tool-telemetry.d.ts +3 -3
  742. package/build/types/integrations/vercel-ai/vercel-ai-tool-telemetry.d.ts.map +1 -1
  743. package/build/types/orchestrion/bundler/moduleInjectedTransform.d.ts +5 -1
  744. package/build/types/orchestrion/bundler/moduleInjectedTransform.d.ts.map +1 -1
  745. package/build/types/orchestrion/bundler/options.d.ts +6 -0
  746. package/build/types/orchestrion/bundler/options.d.ts.map +1 -1
  747. package/build/types/orchestrion/channels.d.ts +4 -0
  748. package/build/types/orchestrion/channels.d.ts.map +1 -1
  749. package/build/types/orchestrion/config/anthropic-ai.d.ts +1 -0
  750. package/build/types/orchestrion/config/anthropic-ai.d.ts.map +1 -1
  751. package/build/types/orchestrion/config/channel-integration-definitions.d.ts +3 -0
  752. package/build/types/orchestrion/config/channel-integration-definitions.d.ts.map +1 -1
  753. package/build/types/orchestrion/config/flue.d.ts +1 -1
  754. package/build/types/orchestrion/config/index.d.ts.map +1 -1
  755. package/build/types/orchestrion/config/pi-ai.d.ts +8 -0
  756. package/build/types/orchestrion/config/pi-ai.d.ts.map +1 -0
  757. package/build/types/orchestrion/config/vercel-ai.d.ts +1 -0
  758. package/build/types/orchestrion/config/vercel-ai.d.ts.map +1 -1
  759. package/build/types/utils/wrapServerRequestHandler.d.ts +5 -0
  760. package/build/types/utils/wrapServerRequestHandler.d.ts.map +1 -1
  761. package/package.json +9 -12
  762. package/build/cjs/_virtual/_commonjsHelpers.js +0 -8
  763. package/build/cjs/_virtual/_commonjsHelpers.js.map +0 -1
  764. package/build/cjs/_virtual/array-set.js +0 -6
  765. package/build/cjs/_virtual/array-set.js.map +0 -1
  766. package/build/cjs/_virtual/astring.js +0 -6
  767. package/build/cjs/_virtual/astring.js.map +0 -1
  768. package/build/cjs/_virtual/base64-vlq.js +0 -6
  769. package/build/cjs/_virtual/base64-vlq.js.map +0 -1
  770. package/build/cjs/_virtual/base64.js +0 -6
  771. package/build/cjs/_virtual/base64.js.map +0 -1
  772. package/build/cjs/_virtual/binary-search.js +0 -6
  773. package/build/cjs/_virtual/binary-search.js.map +0 -1
  774. package/build/cjs/_virtual/mapping-list.js +0 -6
  775. package/build/cjs/_virtual/mapping-list.js.map +0 -1
  776. package/build/cjs/_virtual/meriyah.js +0 -6
  777. package/build/cjs/_virtual/meriyah.js.map +0 -1
  778. package/build/cjs/_virtual/quick-sort.js +0 -6
  779. package/build/cjs/_virtual/quick-sort.js.map +0 -1
  780. package/build/cjs/_virtual/source-map-consumer.js +0 -6
  781. package/build/cjs/_virtual/source-map-consumer.js.map +0 -1
  782. package/build/cjs/_virtual/source-map-generator.js +0 -6
  783. package/build/cjs/_virtual/source-map-generator.js.map +0 -1
  784. package/build/cjs/_virtual/source-map.js +0 -6
  785. package/build/cjs/_virtual/source-map.js.map +0 -1
  786. package/build/cjs/_virtual/source-node.js +0 -6
  787. package/build/cjs/_virtual/source-node.js.map +0 -1
  788. package/build/cjs/_virtual/util.js +0 -6
  789. package/build/cjs/_virtual/util.js.map +0 -1
  790. package/build/cjs/ai/anthropic-ai/constants.js +0 -15
  791. package/build/cjs/ai/anthropic-ai/constants.js.map +0 -1
  792. package/build/cjs/ai/anthropic-ai/index.js +0 -225
  793. package/build/cjs/ai/anthropic-ai/index.js.map +0 -1
  794. package/build/cjs/ai/anthropic-ai/streaming.js +0 -161
  795. package/build/cjs/ai/anthropic-ai/streaming.js.map +0 -1
  796. package/build/cjs/ai/anthropic-ai/tool-runner.js +0 -148
  797. package/build/cjs/ai/anthropic-ai/tool-runner.js.map +0 -1
  798. package/build/cjs/ai/anthropic-ai/utils.js +0 -69
  799. package/build/cjs/ai/anthropic-ai/utils.js.map +0 -1
  800. package/build/cjs/ai/core/apiPromise.js +0 -54
  801. package/build/cjs/ai/core/apiPromise.js.map +0 -1
  802. package/build/cjs/ai/core/gen-ai-attributes.js +0 -14
  803. package/build/cjs/ai/core/gen-ai-attributes.js.map +0 -1
  804. package/build/cjs/ai/core/utils.js +0 -182
  805. package/build/cjs/ai/core/utils.js.map +0 -1
  806. package/build/cjs/ai/flue/constants.js +0 -20
  807. package/build/cjs/ai/flue/constants.js.map +0 -1
  808. package/build/cjs/ai/flue/index.js +0 -141
  809. package/build/cjs/ai/flue/index.js.map +0 -1
  810. package/build/cjs/ai/flue/utils.js +0 -200
  811. package/build/cjs/ai/flue/utils.js.map +0 -1
  812. package/build/cjs/ai/google-genai/constants.js +0 -17
  813. package/build/cjs/ai/google-genai/constants.js.map +0 -1
  814. package/build/cjs/ai/google-genai/index.js +0 -280
  815. package/build/cjs/ai/google-genai/index.js.map +0 -1
  816. package/build/cjs/ai/google-genai/streaming.js +0 -79
  817. package/build/cjs/ai/google-genai/streaming.js.map +0 -1
  818. package/build/cjs/ai/google-genai/utils.js +0 -131
  819. package/build/cjs/ai/google-genai/utils.js.map +0 -1
  820. package/build/cjs/ai/langchain/constants.js +0 -19
  821. package/build/cjs/ai/langchain/constants.js.map +0 -1
  822. package/build/cjs/ai/langchain/embeddings.js +0 -82
  823. package/build/cjs/ai/langchain/embeddings.js.map +0 -1
  824. package/build/cjs/ai/langchain/index.js +0 -312
  825. package/build/cjs/ai/langchain/index.js.map +0 -1
  826. package/build/cjs/ai/langchain/typesafe-classifier.js +0 -62
  827. package/build/cjs/ai/langchain/typesafe-classifier.js.map +0 -1
  828. package/build/cjs/ai/langchain/utils.js +0 -355
  829. package/build/cjs/ai/langchain/utils.js.map +0 -1
  830. package/build/cjs/ai/langgraph/agent-span.js +0 -94
  831. package/build/cjs/ai/langgraph/agent-span.js.map +0 -1
  832. package/build/cjs/ai/langgraph/constants.js +0 -8
  833. package/build/cjs/ai/langgraph/constants.js.map +0 -1
  834. package/build/cjs/ai/langgraph/index.js +0 -134
  835. package/build/cjs/ai/langgraph/index.js.map +0 -1
  836. package/build/cjs/ai/langgraph/stream.js +0 -117
  837. package/build/cjs/ai/langgraph/stream.js.map +0 -1
  838. package/build/cjs/ai/langgraph/utils.js +0 -221
  839. package/build/cjs/ai/langgraph/utils.js.map +0 -1
  840. package/build/cjs/ai/mastra/classifier-evaluation.js +0 -30
  841. package/build/cjs/ai/mastra/classifier-evaluation.js.map +0 -1
  842. package/build/cjs/ai/mastra/constants.js +0 -41
  843. package/build/cjs/ai/mastra/constants.js.map +0 -1
  844. package/build/cjs/ai/mastra/index.js +0 -195
  845. package/build/cjs/ai/mastra/index.js.map +0 -1
  846. package/build/cjs/ai/mastra/span-registry.js +0 -20
  847. package/build/cjs/ai/mastra/span-registry.js.map +0 -1
  848. package/build/cjs/ai/mastra/utils.js +0 -177
  849. package/build/cjs/ai/mastra/utils.js.map +0 -1
  850. package/build/cjs/ai/mistral/constants.js +0 -20
  851. package/build/cjs/ai/mistral/constants.js.map +0 -1
  852. package/build/cjs/ai/mistral/index.js +0 -130
  853. package/build/cjs/ai/mistral/index.js.map +0 -1
  854. package/build/cjs/ai/mistral/streaming.js +0 -208
  855. package/build/cjs/ai/mistral/streaming.js.map +0 -1
  856. package/build/cjs/ai/mistral/utils.js +0 -87
  857. package/build/cjs/ai/mistral/utils.js.map +0 -1
  858. package/build/cjs/ai/openai/constants.js +0 -35
  859. package/build/cjs/ai/openai/constants.js.map +0 -1
  860. package/build/cjs/ai/openai/index.js +0 -176
  861. package/build/cjs/ai/openai/index.js.map +0 -1
  862. package/build/cjs/ai/openai/mapping.js +0 -67
  863. package/build/cjs/ai/openai/mapping.js.map +0 -1
  864. package/build/cjs/ai/openai/streaming.js +0 -166
  865. package/build/cjs/ai/openai/streaming.js.map +0 -1
  866. package/build/cjs/ai/openai/utils.js +0 -128
  867. package/build/cjs/ai/openai/utils.js.map +0 -1
  868. package/build/cjs/ai/pi-ai/messages.js +0 -135
  869. package/build/cjs/ai/pi-ai/messages.js.map +0 -1
  870. package/build/cjs/ai/pi-ai/providers.js +0 -22
  871. package/build/cjs/ai/pi-ai/providers.js.map +0 -1
  872. package/build/cjs/ai/pi-ai/usage.js +0 -34
  873. package/build/cjs/ai/pi-ai/usage.js.map +0 -1
  874. package/build/cjs/ai/pi-durable/constants.js +0 -22
  875. package/build/cjs/ai/pi-durable/constants.js.map +0 -1
  876. package/build/cjs/ai/pi-durable/index.js +0 -176
  877. package/build/cjs/ai/pi-durable/index.js.map +0 -1
  878. package/build/cjs/ai/pi-durable/models.js +0 -140
  879. package/build/cjs/ai/pi-durable/models.js.map +0 -1
  880. package/build/cjs/ai/pi-durable/runs.js +0 -159
  881. package/build/cjs/ai/pi-durable/runs.js.map +0 -1
  882. package/build/cjs/ai/pi-durable/tools.js +0 -178
  883. package/build/cjs/ai/pi-durable/tools.js.map +0 -1
  884. package/build/cjs/ai/pi-durable/utils.js +0 -9
  885. package/build/cjs/ai/pi-durable/utils.js.map +0 -1
  886. package/build/cjs/ai/typesafe/constants.js +0 -10
  887. package/build/cjs/ai/typesafe/constants.js.map +0 -1
  888. package/build/cjs/ai/typesafe/index.js +0 -112
  889. package/build/cjs/ai/typesafe/index.js.map +0 -1
  890. package/build/cjs/ai/vercel-ai/index.js +0 -70
  891. package/build/cjs/ai/vercel-ai/index.js.map +0 -1
  892. package/build/cjs/ai/workers-ai/constants.js +0 -10
  893. package/build/cjs/ai/workers-ai/constants.js.map +0 -1
  894. package/build/cjs/ai/workers-ai/index.js +0 -85
  895. package/build/cjs/ai/workers-ai/index.js.map +0 -1
  896. package/build/cjs/ai/workers-ai/streaming.js +0 -149
  897. package/build/cjs/ai/workers-ai/streaming.js.map +0 -1
  898. package/build/cjs/ai/workers-ai/utils.js +0 -166
  899. package/build/cjs/ai/workers-ai/utils.js.map +0 -1
  900. package/build/cjs/async-context.js +0 -68
  901. package/build/cjs/async-context.js.map +0 -1
  902. package/build/cjs/debug-build.js +0 -6
  903. package/build/cjs/debug-build.js.map +0 -1
  904. package/build/cjs/eve.js +0 -30
  905. package/build/cjs/eve.js.map +0 -1
  906. package/build/cjs/index.no-diagnostic-channels.js.map +0 -1
  907. package/build/cjs/integrations/amqplib.js +0 -417
  908. package/build/cjs/integrations/amqplib.js.map +0 -1
  909. package/build/cjs/integrations/anthropic.js +0 -145
  910. package/build/cjs/integrations/anthropic.js.map +0 -1
  911. package/build/cjs/integrations/aws-sdk/constants.js +0 -16
  912. package/build/cjs/integrations/aws-sdk/constants.js.map +0 -1
  913. package/build/cjs/integrations/aws-sdk/index.js +0 -146
  914. package/build/cjs/integrations/aws-sdk/index.js.map +0 -1
  915. package/build/cjs/integrations/aws-sdk/services/MessageAttributes.js +0 -46
  916. package/build/cjs/integrations/aws-sdk/services/MessageAttributes.js.map +0 -1
  917. package/build/cjs/integrations/aws-sdk/services/ServicesExtensions.js +0 -47
  918. package/build/cjs/integrations/aws-sdk/services/ServicesExtensions.js.map +0 -1
  919. package/build/cjs/integrations/aws-sdk/services/bedrock-runtime.js +0 -477
  920. package/build/cjs/integrations/aws-sdk/services/bedrock-runtime.js.map +0 -1
  921. package/build/cjs/integrations/aws-sdk/services/dynamodb.js +0 -130
  922. package/build/cjs/integrations/aws-sdk/services/dynamodb.js.map +0 -1
  923. package/build/cjs/integrations/aws-sdk/services/kinesis.js +0 -19
  924. package/build/cjs/integrations/aws-sdk/services/kinesis.js.map +0 -1
  925. package/build/cjs/integrations/aws-sdk/services/lambda.js +0 -63
  926. package/build/cjs/integrations/aws-sdk/services/lambda.js.map +0 -1
  927. package/build/cjs/integrations/aws-sdk/services/s3.js +0 -19
  928. package/build/cjs/integrations/aws-sdk/services/s3.js.map +0 -1
  929. package/build/cjs/integrations/aws-sdk/services/secretsmanager.js +0 -25
  930. package/build/cjs/integrations/aws-sdk/services/secretsmanager.js.map +0 -1
  931. package/build/cjs/integrations/aws-sdk/services/sns.js +0 -79
  932. package/build/cjs/integrations/aws-sdk/services/sns.js.map +0 -1
  933. package/build/cjs/integrations/aws-sdk/services/sqs.js +0 -135
  934. package/build/cjs/integrations/aws-sdk/services/sqs.js.map +0 -1
  935. package/build/cjs/integrations/aws-sdk/services/stepfunctions.js +0 -23
  936. package/build/cjs/integrations/aws-sdk/services/stepfunctions.js.map +0 -1
  937. package/build/cjs/integrations/aws-sdk/utils.js +0 -30
  938. package/build/cjs/integrations/aws-sdk/utils.js.map +0 -1
  939. package/build/cjs/integrations/cron.js +0 -49
  940. package/build/cjs/integrations/cron.js.map +0 -1
  941. package/build/cjs/integrations/dataloader.js +0 -118
  942. package/build/cjs/integrations/dataloader.js.map +0 -1
  943. package/build/cjs/integrations/express/error-handled.js +0 -17
  944. package/build/cjs/integrations/express/error-handled.js.map +0 -1
  945. package/build/cjs/integrations/express/error-handler.js +0 -43
  946. package/build/cjs/integrations/express/error-handler.js.map +0 -1
  947. package/build/cjs/integrations/express/index.js +0 -24
  948. package/build/cjs/integrations/express/index.js.map +0 -1
  949. package/build/cjs/integrations/express/instrumentation.js +0 -222
  950. package/build/cjs/integrations/express/instrumentation.js.map +0 -1
  951. package/build/cjs/integrations/express/route.js +0 -76
  952. package/build/cjs/integrations/express/route.js.map +0 -1
  953. package/build/cjs/integrations/express/utils.js +0 -12
  954. package/build/cjs/integrations/express/utils.js.map +0 -1
  955. package/build/cjs/integrations/fastify/errors.js +0 -36
  956. package/build/cjs/integrations/fastify/errors.js.map +0 -1
  957. package/build/cjs/integrations/fastify/index.js +0 -28
  958. package/build/cjs/integrations/fastify/index.js.map +0 -1
  959. package/build/cjs/integrations/fastify/instrumentation.js +0 -252
  960. package/build/cjs/integrations/fastify/instrumentation.js.map +0 -1
  961. package/build/cjs/integrations/fastify/utils.js +0 -26
  962. package/build/cjs/integrations/fastify/utils.js.map +0 -1
  963. package/build/cjs/integrations/firebase/firestore.js +0 -93
  964. package/build/cjs/integrations/firebase/firestore.js.map +0 -1
  965. package/build/cjs/integrations/firebase/functions.js +0 -79
  966. package/build/cjs/integrations/firebase/functions.js.map +0 -1
  967. package/build/cjs/integrations/firebase/index.js +0 -20
  968. package/build/cjs/integrations/firebase/index.js.map +0 -1
  969. package/build/cjs/integrations/firebase/instrumentation.js +0 -56
  970. package/build/cjs/integrations/firebase/instrumentation.js.map +0 -1
  971. package/build/cjs/integrations/flue.js +0 -40
  972. package/build/cjs/integrations/flue.js.map +0 -1
  973. package/build/cjs/integrations/generic-pool.js +0 -36
  974. package/build/cjs/integrations/generic-pool.js.map +0 -1
  975. package/build/cjs/integrations/google-genai.js +0 -105
  976. package/build/cjs/integrations/google-genai.js.map +0 -1
  977. package/build/cjs/integrations/graphql/constants.js +0 -36
  978. package/build/cjs/integrations/graphql/constants.js.map +0 -1
  979. package/build/cjs/integrations/graphql/graphql-dc-subscriber.js +0 -122
  980. package/build/cjs/integrations/graphql/graphql-dc-subscriber.js.map +0 -1
  981. package/build/cjs/integrations/graphql/index.js +0 -60
  982. package/build/cjs/integrations/graphql/index.js.map +0 -1
  983. package/build/cjs/integrations/graphql/resolvers.js +0 -175
  984. package/build/cjs/integrations/graphql/resolvers.js.map +0 -1
  985. package/build/cjs/integrations/graphql/spans.js +0 -114
  986. package/build/cjs/integrations/graphql/spans.js.map +0 -1
  987. package/build/cjs/integrations/graphql/utils.js +0 -98
  988. package/build/cjs/integrations/graphql/utils.js.map +0 -1
  989. package/build/cjs/integrations/groq.js +0 -21
  990. package/build/cjs/integrations/groq.js.map +0 -1
  991. package/build/cjs/integrations/hapi/hapi-error-handler.js +0 -46
  992. package/build/cjs/integrations/hapi/hapi-error-handler.js.map +0 -1
  993. package/build/cjs/integrations/hapi/hapi-types.js +0 -23
  994. package/build/cjs/integrations/hapi/hapi-types.js.map +0 -1
  995. package/build/cjs/integrations/hapi/hapi-utils.js +0 -202
  996. package/build/cjs/integrations/hapi/hapi-utils.js.map +0 -1
  997. package/build/cjs/integrations/hapi/index.js +0 -73
  998. package/build/cjs/integrations/hapi/index.js.map +0 -1
  999. package/build/cjs/integrations/hono/applyPatches.js +0 -38
  1000. package/build/cjs/integrations/hono/applyPatches.js.map +0 -1
  1001. package/build/cjs/integrations/hono/connInfo.js +0 -37
  1002. package/build/cjs/integrations/hono/connInfo.js.map +0 -1
  1003. package/build/cjs/integrations/hono/constants.js +0 -8
  1004. package/build/cjs/integrations/hono/constants.js.map +0 -1
  1005. package/build/cjs/integrations/hono/createHonoMiddleware.js +0 -43
  1006. package/build/cjs/integrations/hono/createHonoMiddleware.js.map +0 -1
  1007. package/build/cjs/integrations/hono/defaultShouldHandleError.js +0 -14
  1008. package/build/cjs/integrations/hono/defaultShouldHandleError.js.map +0 -1
  1009. package/build/cjs/integrations/hono/hono-context.js +0 -14
  1010. package/build/cjs/integrations/hono/hono-context.js.map +0 -1
  1011. package/build/cjs/integrations/hono/honoIntegration.js +0 -98
  1012. package/build/cjs/integrations/hono/honoIntegration.js.map +0 -1
  1013. package/build/cjs/integrations/hono/isMiddleware.js +0 -22
  1014. package/build/cjs/integrations/hono/isMiddleware.js.map +0 -1
  1015. package/build/cjs/integrations/hono/matchResult.js +0 -85
  1016. package/build/cjs/integrations/hono/matchResult.js.map +0 -1
  1017. package/build/cjs/integrations/hono/middlewareHandlers.js +0 -101
  1018. package/build/cjs/integrations/hono/middlewareHandlers.js.map +0 -1
  1019. package/build/cjs/integrations/hono/patchAppRequest.js +0 -78
  1020. package/build/cjs/integrations/hono/patchAppRequest.js.map +0 -1
  1021. package/build/cjs/integrations/hono/patchAppUse.js +0 -70
  1022. package/build/cjs/integrations/hono/patchAppUse.js.map +0 -1
  1023. package/build/cjs/integrations/hono/patchRoute.js +0 -69
  1024. package/build/cjs/integrations/hono/patchRoute.js.map +0 -1
  1025. package/build/cjs/integrations/hono/resolveRouteName.js +0 -29
  1026. package/build/cjs/integrations/hono/resolveRouteName.js.map +0 -1
  1027. package/build/cjs/integrations/hono/sentryOriginalTraps.js +0 -21
  1028. package/build/cjs/integrations/hono/sentryOriginalTraps.js.map +0 -1
  1029. package/build/cjs/integrations/hono/wrapMiddlewareSpan.js +0 -48
  1030. package/build/cjs/integrations/hono/wrapMiddlewareSpan.js.map +0 -1
  1031. package/build/cjs/integrations/index.js +0 -93
  1032. package/build/cjs/integrations/index.js.map +0 -1
  1033. package/build/cjs/integrations/kafkajs/consumer.js +0 -71
  1034. package/build/cjs/integrations/kafkajs/consumer.js.map +0 -1
  1035. package/build/cjs/integrations/kafkajs/index.js +0 -70
  1036. package/build/cjs/integrations/kafkajs/index.js.map +0 -1
  1037. package/build/cjs/integrations/kafkajs/semconv.js +0 -14
  1038. package/build/cjs/integrations/kafkajs/semconv.js.map +0 -1
  1039. package/build/cjs/integrations/kafkajs/spans.js +0 -127
  1040. package/build/cjs/integrations/kafkajs/spans.js.map +0 -1
  1041. package/build/cjs/integrations/knex.js +0 -187
  1042. package/build/cjs/integrations/knex.js.map +0 -1
  1043. package/build/cjs/integrations/koa/index.js +0 -155
  1044. package/build/cjs/integrations/koa/index.js.map +0 -1
  1045. package/build/cjs/integrations/koa/koa-error-handler.js +0 -33
  1046. package/build/cjs/integrations/koa/koa-error-handler.js.map +0 -1
  1047. package/build/cjs/integrations/langchain.js +0 -92
  1048. package/build/cjs/integrations/langchain.js.map +0 -1
  1049. package/build/cjs/integrations/langgraph.js +0 -73
  1050. package/build/cjs/integrations/langgraph.js.map +0 -1
  1051. package/build/cjs/integrations/lru-memoizer.js +0 -29
  1052. package/build/cjs/integrations/lru-memoizer.js.map +0 -1
  1053. package/build/cjs/integrations/mastra-classifier.js +0 -57
  1054. package/build/cjs/integrations/mastra-classifier.js.map +0 -1
  1055. package/build/cjs/integrations/mastra.js +0 -247
  1056. package/build/cjs/integrations/mastra.js.map +0 -1
  1057. package/build/cjs/integrations/mcp-server.js +0 -37
  1058. package/build/cjs/integrations/mcp-server.js.map +0 -1
  1059. package/build/cjs/integrations/mistral.js +0 -69
  1060. package/build/cjs/integrations/mistral.js.map +0 -1
  1061. package/build/cjs/integrations/mongodb/index.js +0 -94
  1062. package/build/cjs/integrations/mongodb/index.js.map +0 -1
  1063. package/build/cjs/integrations/mongodb/mongodb-span.js +0 -135
  1064. package/build/cjs/integrations/mongodb/mongodb-span.js.map +0 -1
  1065. package/build/cjs/integrations/mongoose/index.js +0 -109
  1066. package/build/cjs/integrations/mongoose/index.js.map +0 -1
  1067. package/build/cjs/integrations/mongoose/mongoose-dc-subscriber.js +0 -101
  1068. package/build/cjs/integrations/mongoose/mongoose-dc-subscriber.js.map +0 -1
  1069. package/build/cjs/integrations/mongoose/mongoose-legacy-span.js +0 -41
  1070. package/build/cjs/integrations/mongoose/mongoose-legacy-span.js.map +0 -1
  1071. package/build/cjs/integrations/mysql.js +0 -101
  1072. package/build/cjs/integrations/mysql.js.map +0 -1
  1073. package/build/cjs/integrations/mysql2/index.js +0 -80
  1074. package/build/cjs/integrations/mysql2/index.js.map +0 -1
  1075. package/build/cjs/integrations/mysql2/mysql2-dc-subscriber.js +0 -57
  1076. package/build/cjs/integrations/mysql2/mysql2-dc-subscriber.js.map +0 -1
  1077. package/build/cjs/integrations/neon.js +0 -107
  1078. package/build/cjs/integrations/neon.js.map +0 -1
  1079. package/build/cjs/integrations/nitro/captureStorageEvents.js +0 -132
  1080. package/build/cjs/integrations/nitro/captureStorageEvents.js.map +0 -1
  1081. package/build/cjs/integrations/nitro/captureTracingEvents.js +0 -202
  1082. package/build/cjs/integrations/nitro/captureTracingEvents.js.map +0 -1
  1083. package/build/cjs/integrations/nitro/index.js +0 -27
  1084. package/build/cjs/integrations/nitro/index.js.map +0 -1
  1085. package/build/cjs/integrations/nitro/setServerTimingHeaders.js +0 -40
  1086. package/build/cjs/integrations/nitro/setServerTimingHeaders.js.map +0 -1
  1087. package/build/cjs/integrations/node-cron.js +0 -68
  1088. package/build/cjs/integrations/node-cron.js.map +0 -1
  1089. package/build/cjs/integrations/node-schedule.js +0 -76
  1090. package/build/cjs/integrations/node-schedule.js.map +0 -1
  1091. package/build/cjs/integrations/openai-compatible.js +0 -90
  1092. package/build/cjs/integrations/openai-compatible.js.map +0 -1
  1093. package/build/cjs/integrations/openai.js +0 -93
  1094. package/build/cjs/integrations/openai.js.map +0 -1
  1095. package/build/cjs/integrations/pg.js +0 -171
  1096. package/build/cjs/integrations/pg.js.map +0 -1
  1097. package/build/cjs/integrations/pi-durable.js +0 -50
  1098. package/build/cjs/integrations/pi-durable.js.map +0 -1
  1099. package/build/cjs/integrations/postgresjs/index.js +0 -147
  1100. package/build/cjs/integrations/postgresjs/index.js.map +0 -1
  1101. package/build/cjs/integrations/postgresjs/postgresjs-dc-subscriber.js +0 -81
  1102. package/build/cjs/integrations/postgresjs/postgresjs-dc-subscriber.js.map +0 -1
  1103. package/build/cjs/integrations/postgresjs-wrapper.js +0 -219
  1104. package/build/cjs/integrations/postgresjs-wrapper.js.map +0 -1
  1105. package/build/cjs/integrations/prisma/global.js +0 -14
  1106. package/build/cjs/integrations/prisma/global.js.map +0 -1
  1107. package/build/cjs/integrations/prisma/index.js +0 -36
  1108. package/build/cjs/integrations/prisma/index.js.map +0 -1
  1109. package/build/cjs/integrations/prisma/orchestrion.js +0 -137
  1110. package/build/cjs/integrations/prisma/orchestrion.js.map +0 -1
  1111. package/build/cjs/integrations/prisma/tracing-helper.js +0 -241
  1112. package/build/cjs/integrations/prisma/tracing-helper.js.map +0 -1
  1113. package/build/cjs/integrations/redis/index.js +0 -223
  1114. package/build/cjs/integrations/redis/index.js.map +0 -1
  1115. package/build/cjs/integrations/redis/ioredis-channel-subscriber.js +0 -87
  1116. package/build/cjs/integrations/redis/ioredis-channel-subscriber.js.map +0 -1
  1117. package/build/cjs/integrations/redis/redis-cache.js +0 -144
  1118. package/build/cjs/integrations/redis/redis-cache.js.map +0 -1
  1119. package/build/cjs/integrations/redis/redis-dc-subscriber.js +0 -107
  1120. package/build/cjs/integrations/redis/redis-dc-subscriber.js.map +0 -1
  1121. package/build/cjs/integrations/redis/redis-span-name.js +0 -32
  1122. package/build/cjs/integrations/redis/redis-span-name.js.map +0 -1
  1123. package/build/cjs/integrations/redis/redis-statement-serializer.js +0 -34
  1124. package/build/cjs/integrations/redis/redis-statement-serializer.js.map +0 -1
  1125. package/build/cjs/integrations/serveTunnel.js +0 -33
  1126. package/build/cjs/integrations/serveTunnel.js.map +0 -1
  1127. package/build/cjs/integrations/tedious.js +0 -160
  1128. package/build/cjs/integrations/tedious.js.map +0 -1
  1129. package/build/cjs/integrations/together-ai.js +0 -19
  1130. package/build/cjs/integrations/together-ai.js.map +0 -1
  1131. package/build/cjs/integrations/typesafe.js +0 -45
  1132. package/build/cjs/integrations/typesafe.js.map +0 -1
  1133. package/build/cjs/integrations/vercel-ai/gen-ai-recording-mode.js +0 -13
  1134. package/build/cjs/integrations/vercel-ai/gen-ai-recording-mode.js.map +0 -1
  1135. package/build/cjs/integrations/vercel-ai/index.js +0 -34
  1136. package/build/cjs/integrations/vercel-ai/index.js.map +0 -1
  1137. package/build/cjs/integrations/vercel-ai/util.js +0 -108
  1138. package/build/cjs/integrations/vercel-ai/util.js.map +0 -1
  1139. package/build/cjs/integrations/vercel-ai/vercel-ai-dc-subscriber.js +0 -589
  1140. package/build/cjs/integrations/vercel-ai/vercel-ai-dc-subscriber.js.map +0 -1
  1141. package/build/cjs/integrations/vercel-ai/vercel-ai-orchestrion-subscriber.js +0 -409
  1142. package/build/cjs/integrations/vercel-ai/vercel-ai-orchestrion-subscriber.js.map +0 -1
  1143. package/build/cjs/integrations/vercel-ai/vercel-ai-tool-telemetry.js +0 -40
  1144. package/build/cjs/integrations/vercel-ai/vercel-ai-tool-telemetry.js.map +0 -1
  1145. package/build/cjs/opentelemetry.js +0 -45
  1146. package/build/cjs/opentelemetry.js.map +0 -1
  1147. package/build/cjs/orchestrion/bundler/externalRequire.js +0 -82
  1148. package/build/cjs/orchestrion/bundler/externalRequire.js.map +0 -1
  1149. package/build/cjs/orchestrion/bundler/moduleInjectedTransform.js +0 -55
  1150. package/build/cjs/orchestrion/bundler/moduleInjectedTransform.js.map +0 -1
  1151. package/build/cjs/orchestrion/bundler/options.js +0 -25
  1152. package/build/cjs/orchestrion/bundler/options.js.map +0 -1
  1153. package/build/cjs/orchestrion/bundler/resolve.js +0 -27
  1154. package/build/cjs/orchestrion/bundler/resolve.js.map +0 -1
  1155. package/build/cjs/orchestrion/channels.js +0 -92
  1156. package/build/cjs/orchestrion/channels.js.map +0 -1
  1157. package/build/cjs/orchestrion/config/amqplib.js +0 -93
  1158. package/build/cjs/orchestrion/config/amqplib.js.map +0 -1
  1159. package/build/cjs/orchestrion/config/anthropic-ai.js +0 -53
  1160. package/build/cjs/orchestrion/config/anthropic-ai.js.map +0 -1
  1161. package/build/cjs/orchestrion/config/aws-sdk.js +0 -32
  1162. package/build/cjs/orchestrion/config/aws-sdk.js.map +0 -1
  1163. package/build/cjs/orchestrion/config/channel-integration-definitions.js +0 -59
  1164. package/build/cjs/orchestrion/config/channel-integration-definitions.js.map +0 -1
  1165. package/build/cjs/orchestrion/config/cron.js +0 -26
  1166. package/build/cjs/orchestrion/config/cron.js.map +0 -1
  1167. package/build/cjs/orchestrion/config/dataloader.js +0 -53
  1168. package/build/cjs/orchestrion/config/dataloader.js.map +0 -1
  1169. package/build/cjs/orchestrion/config/express.js +0 -81
  1170. package/build/cjs/orchestrion/config/express.js.map +0 -1
  1171. package/build/cjs/orchestrion/config/firebase.js +0 -85
  1172. package/build/cjs/orchestrion/config/firebase.js.map +0 -1
  1173. package/build/cjs/orchestrion/config/flue.js +0 -10
  1174. package/build/cjs/orchestrion/config/flue.js.map +0 -1
  1175. package/build/cjs/orchestrion/config/generic-pool.js +0 -25
  1176. package/build/cjs/orchestrion/config/generic-pool.js.map +0 -1
  1177. package/build/cjs/orchestrion/config/google-genai.js +0 -43
  1178. package/build/cjs/orchestrion/config/google-genai.js.map +0 -1
  1179. package/build/cjs/orchestrion/config/graphql.js +0 -32
  1180. package/build/cjs/orchestrion/config/graphql.js.map +0 -1
  1181. package/build/cjs/orchestrion/config/groq.js +0 -19
  1182. package/build/cjs/orchestrion/config/groq.js.map +0 -1
  1183. package/build/cjs/orchestrion/config/hapi.js +0 -48
  1184. package/build/cjs/orchestrion/config/hapi.js.map +0 -1
  1185. package/build/cjs/orchestrion/config/hono.js +0 -34
  1186. package/build/cjs/orchestrion/config/hono.js.map +0 -1
  1187. package/build/cjs/orchestrion/config/index.js.map +0 -1
  1188. package/build/cjs/orchestrion/config/ioredis.js +0 -41
  1189. package/build/cjs/orchestrion/config/ioredis.js.map +0 -1
  1190. package/build/cjs/orchestrion/config/kafkajs.js +0 -34
  1191. package/build/cjs/orchestrion/config/kafkajs.js.map +0 -1
  1192. package/build/cjs/orchestrion/config/knex.js +0 -43
  1193. package/build/cjs/orchestrion/config/knex.js.map +0 -1
  1194. package/build/cjs/orchestrion/config/koa.js +0 -32
  1195. package/build/cjs/orchestrion/config/koa.js.map +0 -1
  1196. package/build/cjs/orchestrion/config/langchain.js +0 -66
  1197. package/build/cjs/orchestrion/config/langchain.js.map +0 -1
  1198. package/build/cjs/orchestrion/config/langgraph.js +0 -32
  1199. package/build/cjs/orchestrion/config/langgraph.js.map +0 -1
  1200. package/build/cjs/orchestrion/config/lru-memoizer.js +0 -21
  1201. package/build/cjs/orchestrion/config/lru-memoizer.js.map +0 -1
  1202. package/build/cjs/orchestrion/config/mastra.js +0 -54
  1203. package/build/cjs/orchestrion/config/mastra.js.map +0 -1
  1204. package/build/cjs/orchestrion/config/mcp-server.js +0 -41
  1205. package/build/cjs/orchestrion/config/mcp-server.js.map +0 -1
  1206. package/build/cjs/orchestrion/config/mistral.js +0 -57
  1207. package/build/cjs/orchestrion/config/mistral.js.map +0 -1
  1208. package/build/cjs/orchestrion/config/module-names.js +0 -8
  1209. package/build/cjs/orchestrion/config/module-names.js.map +0 -1
  1210. package/build/cjs/orchestrion/config/mongodb.js +0 -71
  1211. package/build/cjs/orchestrion/config/mongodb.js.map +0 -1
  1212. package/build/cjs/orchestrion/config/mongoose.js +0 -113
  1213. package/build/cjs/orchestrion/config/mongoose.js.map +0 -1
  1214. package/build/cjs/orchestrion/config/mysql.js +0 -20
  1215. package/build/cjs/orchestrion/config/mysql.js.map +0 -1
  1216. package/build/cjs/orchestrion/config/mysql2.js +0 -38
  1217. package/build/cjs/orchestrion/config/mysql2.js.map +0 -1
  1218. package/build/cjs/orchestrion/config/neon.js +0 -46
  1219. package/build/cjs/orchestrion/config/neon.js.map +0 -1
  1220. package/build/cjs/orchestrion/config/nestjs.js +0 -130
  1221. package/build/cjs/orchestrion/config/nestjs.js.map +0 -1
  1222. package/build/cjs/orchestrion/config/nitro.js +0 -10
  1223. package/build/cjs/orchestrion/config/nitro.js.map +0 -1
  1224. package/build/cjs/orchestrion/config/node-cron.js +0 -53
  1225. package/build/cjs/orchestrion/config/node-cron.js.map +0 -1
  1226. package/build/cjs/orchestrion/config/node-schedule.js +0 -29
  1227. package/build/cjs/orchestrion/config/node-schedule.js.map +0 -1
  1228. package/build/cjs/orchestrion/config/openai-compatible.js +0 -19
  1229. package/build/cjs/orchestrion/config/openai-compatible.js.map +0 -1
  1230. package/build/cjs/orchestrion/config/openai.js +0 -49
  1231. package/build/cjs/orchestrion/config/openai.js.map +0 -1
  1232. package/build/cjs/orchestrion/config/pg.js +0 -55
  1233. package/build/cjs/orchestrion/config/pg.js.map +0 -1
  1234. package/build/cjs/orchestrion/config/pi-durable.js +0 -34
  1235. package/build/cjs/orchestrion/config/pi-durable.js.map +0 -1
  1236. package/build/cjs/orchestrion/config/postgres.js +0 -58
  1237. package/build/cjs/orchestrion/config/postgres.js.map +0 -1
  1238. package/build/cjs/orchestrion/config/prisma.js +0 -53
  1239. package/build/cjs/orchestrion/config/prisma.js.map +0 -1
  1240. package/build/cjs/orchestrion/config/redis.js +0 -82
  1241. package/build/cjs/orchestrion/config/redis.js.map +0 -1
  1242. package/build/cjs/orchestrion/config/registration-only.js +0 -15
  1243. package/build/cjs/orchestrion/config/registration-only.js.map +0 -1
  1244. package/build/cjs/orchestrion/config/remix-v3.js +0 -55
  1245. package/build/cjs/orchestrion/config/remix-v3.js.map +0 -1
  1246. package/build/cjs/orchestrion/config/remix.js +0 -54
  1247. package/build/cjs/orchestrion/config/remix.js.map +0 -1
  1248. package/build/cjs/orchestrion/config/tedious.js +0 -28
  1249. package/build/cjs/orchestrion/config/tedious.js.map +0 -1
  1250. package/build/cjs/orchestrion/config/together-ai.js +0 -23
  1251. package/build/cjs/orchestrion/config/together-ai.js.map +0 -1
  1252. package/build/cjs/orchestrion/config/typesafe.js +0 -18
  1253. package/build/cjs/orchestrion/config/typesafe.js.map +0 -1
  1254. package/build/cjs/orchestrion/config/vercel-ai.js +0 -56
  1255. package/build/cjs/orchestrion/config/vercel-ai.js.map +0 -1
  1256. package/build/cjs/orchestrion/detect.js +0 -42
  1257. package/build/cjs/orchestrion/detect.js.map +0 -1
  1258. package/build/cjs/orchestrion/instrumentation.js +0 -80
  1259. package/build/cjs/orchestrion/instrumentation.js.map +0 -1
  1260. package/build/cjs/tracing-channel.js +0 -152
  1261. package/build/cjs/tracing-channel.js.map +0 -1
  1262. package/build/cjs/utils/cronMonitoring.js +0 -160
  1263. package/build/cjs/utils/cronMonitoring.js.map +0 -1
  1264. package/build/cjs/utils/diagnosticsChannel.js +0 -48
  1265. package/build/cjs/utils/diagnosticsChannel.js.map +0 -1
  1266. package/build/cjs/utils/moduleInjected.js +0 -18
  1267. package/build/cjs/utils/moduleInjected.js.map +0 -1
  1268. package/build/cjs/utils/monitorStream.js +0 -63
  1269. package/build/cjs/utils/monitorStream.js.map +0 -1
  1270. package/build/cjs/utils/runtime.js +0 -19
  1271. package/build/cjs/utils/runtime.js.map +0 -1
  1272. package/build/cjs/utils/setHttpServerSpanRouteAttribute.js +0 -26
  1273. package/build/cjs/utils/setHttpServerSpanRouteAttribute.js.map +0 -1
  1274. package/build/cjs/utils/sql.js +0 -285
  1275. package/build/cjs/utils/sql.js.map +0 -1
  1276. package/build/cjs/utils/tunnelServer.js +0 -29
  1277. package/build/cjs/utils/tunnelServer.js.map +0 -1
  1278. package/build/cjs/utils/withCleanScopes.js +0 -17
  1279. package/build/cjs/utils/withCleanScopes.js.map +0 -1
  1280. package/build/cjs/utils/wrapServerRequestHandler.js +0 -221
  1281. package/build/cjs/utils/wrapServerRequestHandler.js.map +0 -1
  1282. package/build/cjs/vendored/@apm-js-collab/code-transformer/index.js +0 -8
  1283. package/build/cjs/vendored/@apm-js-collab/code-transformer/index.js.map +0 -1
  1284. package/build/cjs/vendored/@apm-js-collab/code-transformer/lib/index.js +0 -12
  1285. package/build/cjs/vendored/@apm-js-collab/code-transformer/lib/index.js.map +0 -1
  1286. package/build/cjs/vendored/@apm-js-collab/code-transformer/lib/matcher.js +0 -86
  1287. package/build/cjs/vendored/@apm-js-collab/code-transformer/lib/matcher.js.map +0 -1
  1288. package/build/cjs/vendored/@apm-js-collab/code-transformer/lib/transformer.js +0 -316
  1289. package/build/cjs/vendored/@apm-js-collab/code-transformer/lib/transformer.js.map +0 -1
  1290. package/build/cjs/vendored/@apm-js-collab/code-transformer/lib/transforms.js +0 -470
  1291. package/build/cjs/vendored/@apm-js-collab/code-transformer/lib/transforms.js.map +0 -1
  1292. package/build/cjs/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/bun.js +0 -65
  1293. package/build/cjs/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/bun.js.map +0 -1
  1294. package/build/cjs/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/core-Bd0h-mo3.js.map +0 -1
  1295. package/build/cjs/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/esbuild.js.map +0 -1
  1296. package/build/cjs/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/instrumentation-serde-C-Xxv-jj.js.map +0 -1
  1297. package/build/cjs/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/rollup-DCG8HLmh.js.map +0 -1
  1298. package/build/cjs/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/vite.js +0 -14
  1299. package/build/cjs/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/vite.js.map +0 -1
  1300. package/build/cjs/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/webpack-loader-factory.js +0 -117
  1301. package/build/cjs/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/webpack-loader-factory.js.map +0 -1
  1302. package/build/cjs/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/webpack.js +0 -103
  1303. package/build/cjs/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/webpack.js.map +0 -1
  1304. package/build/cjs/vendored/astring/dist/astring.js +0 -1068
  1305. package/build/cjs/vendored/astring/dist/astring.js.map +0 -1
  1306. package/build/cjs/vendored/esquery/dist/esquery.esm.min.js +0 -847
  1307. package/build/cjs/vendored/esquery/dist/esquery.esm.min.js.map +0 -1
  1308. package/build/cjs/vendored/meriyah/dist/meriyah.js +0 -9192
  1309. package/build/cjs/vendored/meriyah/dist/meriyah.js.map +0 -1
  1310. package/build/cjs/vendored/meriyah/dist/meriyah2.js +0 -9209
  1311. package/build/cjs/vendored/meriyah/dist/meriyah2.js.map +0 -1
  1312. package/build/cjs/vendored/module-details-from-path/index.js +0 -43
  1313. package/build/cjs/vendored/module-details-from-path/index.js.map +0 -1
  1314. package/build/cjs/vendored/semifies/index.js +0 -111
  1315. package/build/cjs/vendored/semifies/index.js.map +0 -1
  1316. package/build/cjs/vendored/source-map/lib/array-set.js +0 -73
  1317. package/build/cjs/vendored/source-map/lib/array-set.js.map +0 -1
  1318. package/build/cjs/vendored/source-map/lib/base64-vlq.js +0 -57
  1319. package/build/cjs/vendored/source-map/lib/base64-vlq.js.map +0 -1
  1320. package/build/cjs/vendored/source-map/lib/base64.js +0 -42
  1321. package/build/cjs/vendored/source-map/lib/base64.js.map +0 -1
  1322. package/build/cjs/vendored/source-map/lib/binary-search.js +0 -55
  1323. package/build/cjs/vendored/source-map/lib/binary-search.js.map +0 -1
  1324. package/build/cjs/vendored/source-map/lib/mapping-list.js +0 -42
  1325. package/build/cjs/vendored/source-map/lib/mapping-list.js.map +0 -1
  1326. package/build/cjs/vendored/source-map/lib/quick-sort.js +0 -36
  1327. package/build/cjs/vendored/source-map/lib/quick-sort.js.map +0 -1
  1328. package/build/cjs/vendored/source-map/lib/source-map-consumer.js +0 -612
  1329. package/build/cjs/vendored/source-map/lib/source-map-consumer.js.map +0 -1
  1330. package/build/cjs/vendored/source-map/lib/source-map-generator.js +0 -285
  1331. package/build/cjs/vendored/source-map/lib/source-map-generator.js.map +0 -1
  1332. package/build/cjs/vendored/source-map/lib/source-node.js +0 -270
  1333. package/build/cjs/vendored/source-map/lib/source-node.js.map +0 -1
  1334. package/build/cjs/vendored/source-map/lib/util.js +0 -300
  1335. package/build/cjs/vendored/source-map/lib/util.js.map +0 -1
  1336. package/build/cjs/vendored/source-map/source-map.js +0 -16
  1337. package/build/cjs/vendored/source-map/source-map.js.map +0 -1
  1338. package/build/esm/_virtual/_commonjsHelpers.js +0 -6
  1339. package/build/esm/_virtual/_commonjsHelpers.js.map +0 -1
  1340. package/build/esm/_virtual/array-set.js +0 -4
  1341. package/build/esm/_virtual/array-set.js.map +0 -1
  1342. package/build/esm/_virtual/astring.js +0 -4
  1343. package/build/esm/_virtual/astring.js.map +0 -1
  1344. package/build/esm/_virtual/base64-vlq.js +0 -4
  1345. package/build/esm/_virtual/base64-vlq.js.map +0 -1
  1346. package/build/esm/_virtual/base64.js +0 -4
  1347. package/build/esm/_virtual/base64.js.map +0 -1
  1348. package/build/esm/_virtual/binary-search.js +0 -4
  1349. package/build/esm/_virtual/binary-search.js.map +0 -1
  1350. package/build/esm/_virtual/mapping-list.js +0 -4
  1351. package/build/esm/_virtual/mapping-list.js.map +0 -1
  1352. package/build/esm/_virtual/meriyah.js +0 -4
  1353. package/build/esm/_virtual/meriyah.js.map +0 -1
  1354. package/build/esm/_virtual/quick-sort.js +0 -4
  1355. package/build/esm/_virtual/quick-sort.js.map +0 -1
  1356. package/build/esm/_virtual/source-map-consumer.js +0 -4
  1357. package/build/esm/_virtual/source-map-consumer.js.map +0 -1
  1358. package/build/esm/_virtual/source-map-generator.js +0 -4
  1359. package/build/esm/_virtual/source-map-generator.js.map +0 -1
  1360. package/build/esm/_virtual/source-map.js +0 -4
  1361. package/build/esm/_virtual/source-map.js.map +0 -1
  1362. package/build/esm/_virtual/source-node.js +0 -4
  1363. package/build/esm/_virtual/source-node.js.map +0 -1
  1364. package/build/esm/_virtual/util.js +0 -4
  1365. package/build/esm/_virtual/util.js.map +0 -1
  1366. package/build/esm/ai/pi-durable/models.js +0 -138
  1367. package/build/esm/ai/pi-durable/models.js.map +0 -1
  1368. package/build/esm/index.no-diagnostic-channels.js.map +0 -1
  1369. package/build/esm/index.request-handler.js.map +0 -1
  1370. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/core-Bd0h-mo3.js.map +0 -1
  1371. package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/rollup-DCG8HLmh.js.map +0 -1
  1372. package/build/esm/vendored/esquery/dist/esquery.esm.min.js +0 -845
  1373. package/build/esm/vendored/esquery/dist/esquery.esm.min.js.map +0 -1
  1374. package/build/types/ai/pi-durable/models.d.ts +0 -10
  1375. package/build/types/ai/pi-durable/models.d.ts.map +0 -1
@@ -1,97 +1,103 @@
1
- import { captureException, getActiveSpan, winterCGRequestToRequestData, getDefaultIsolationScope, getIsolationScope, getClient, getRootSpan, spanToJSON, winterCGHeadersToDict, updateSpanName, INTERNAL_setSegmentNameSourceIfSegment } from '@sentry/core';
2
- import { getClientIPAddress } from '@sentry/core/server';
3
- import { readConnInfo } from './connInfo.js';
4
- import { hasFetchEvent } from './hono-context.js';
5
- import { defaultShouldHandleError } from './defaultShouldHandleError.js';
6
- import { getMiddlewareFlags } from './isMiddleware.js';
7
- import { getMatchedHandlers, wrapRouteHandlers, onRouteHandlerStart } from './matchResult.js';
8
- import { resolveRouteName } from './resolveRouteName.js';
9
- import { CLIENT_ADDRESS, NETWORK_TYPE, HTTP_ROUTE, NETWORK_PEER_ADDRESS, NETWORK_TRANSPORT, NETWORK_PEER_PORT, CLIENT_PORT } from '@sentry/conventions/attributes';
10
-
1
+ import { readConnInfo } from "./connInfo.js";
2
+ import { hasFetchEvent } from "./hono-context.js";
3
+ import { defaultShouldHandleError } from "./defaultShouldHandleError.js";
4
+ import { getMiddlewareFlags } from "./isMiddleware.js";
5
+ import { getMatchedHandlers, onRouteHandlerStart, wrapRouteHandlers } from "./matchResult.js";
6
+ import { resolveRouteName } from "./resolveRouteName.js";
7
+ import { CLIENT_ADDRESS, CLIENT_PORT, HTTP_ROUTE, NETWORK_PEER_ADDRESS, NETWORK_PEER_PORT, NETWORK_TRANSPORT, NETWORK_TYPE } from "@sentry/conventions/attributes";
8
+ import { INTERNAL_setSegmentNameSourceIfSegment, captureException, getActiveSpan, getClient, getDefaultIsolationScope, getIsolationScope, getRootSpan, spanToJSON, updateSpanName, winterCGHeadersToDict, winterCGRequestToRequestData } from "@sentry/core";
9
+ import { getClientIPAddress } from "@sentry/core/server";
10
+ // src/integrations/hono/middlewareHandlers.ts
11
+ /**
12
+ * Request handler for Hono framework
13
+ */
11
14
  function requestHandler(context, runtime) {
12
- const isolationScope = getCurrentIsolationScope();
13
- const span = getActiveSpan();
14
- const matchedHandlers = getMatchedHandlers(context);
15
- const routes = matchedHandlers?.map(([[, route]]) => route) ?? context.req.matchedRoutes ?? [];
16
- const middlewareFlags = getMiddlewareFlags(routes);
17
- const nameSpan = () => updateSpanRouteName(isolationScope, span, context, resolveRouteName(context, routes, middlewareFlags));
18
- nameSpan();
19
- if (!matchedHandlers || wrapRouteHandlers(matchedHandlers, middlewareFlags)) {
20
- onRouteHandlerStart(context, nameSpan);
21
- }
22
- isolationScope.setSDKProcessingMetadata({
23
- normalizedRequest: winterCGRequestToRequestData(hasFetchEvent(context) ? context.event.request : context.req.raw)
24
- });
25
- setConnInfoAttributes(context, runtime, isolationScope);
15
+ const isolationScope = getCurrentIsolationScope();
16
+ const span = getActiveSpan();
17
+ const matchedHandlers = getMatchedHandlers(context);
18
+ const routes = matchedHandlers?.map(([[, route]]) => route) ?? context.req.matchedRoutes ?? [];
19
+ const middlewareFlags = getMiddlewareFlags(routes);
20
+ const nameSpan = () => updateSpanRouteName(isolationScope, span, context, resolveRouteName(context, routes, middlewareFlags));
21
+ nameSpan();
22
+ if (!matchedHandlers || wrapRouteHandlers(matchedHandlers, middlewareFlags)) onRouteHandlerStart(context, nameSpan);
23
+ isolationScope.setSDKProcessingMetadata({ normalizedRequest: winterCGRequestToRequestData(hasFetchEvent(context) ? context.event.request : context.req.raw) });
24
+ setConnInfoAttributes(context, runtime, isolationScope);
26
25
  }
27
26
  function getCurrentIsolationScope() {
28
- const defaultScope = getDefaultIsolationScope();
29
- const currentIsolationScope = getIsolationScope();
30
- return defaultScope === currentIsolationScope ? defaultScope : currentIsolationScope;
27
+ const defaultScope = getDefaultIsolationScope();
28
+ const currentIsolationScope = getIsolationScope();
29
+ return defaultScope === currentIsolationScope ? defaultScope : currentIsolationScope;
31
30
  }
31
+ /**
32
+ * Adds HTTP connection info (client IP, port, transport, address type) from the runtime to the root
33
+ * (server) span and the isolation scope.
34
+ *
35
+ * Keeps attributes that the runtime SDK already set: it reads forwarding headers, while the runtime
36
+ * objects only know the socket peer, which can be a proxy.
37
+ */
32
38
  function setConnInfoAttributes(context, runtime, isolationScope) {
33
- const activeSpan = getActiveSpan();
34
- if (!activeSpan) {
35
- return;
36
- }
37
- const connInfo = readConnInfo(context, runtime);
38
- if (!connInfo) {
39
- return;
40
- }
41
- const { address, port, transport, addressType } = connInfo;
42
- const ipAddress = address && getClient()?.getDataCollectionOptions().userInfo ? address : void 0;
43
- const rootSpan = getRootSpan(activeSpan);
44
- const existingAttributes = spanToJSON(rootSpan).attributes ?? {};
45
- const writesClientAddress = ipAddress !== void 0 && existingAttributes[CLIENT_ADDRESS] === void 0;
46
- rootSpan.setAttributes(
47
- onlyNewAttributes(
48
- {
49
- [CLIENT_PORT]: writesClientAddress ? port : void 0,
50
- [NETWORK_PEER_PORT]: port,
51
- [NETWORK_TRANSPORT]: transport,
52
- [NETWORK_TYPE]: addressType?.toLowerCase(),
53
- [CLIENT_ADDRESS]: ipAddress,
54
- [NETWORK_PEER_ADDRESS]: ipAddress
55
- },
56
- existingAttributes
57
- )
58
- );
59
- if (ipAddress) {
60
- const userIpAddress = getClientIPAddress(winterCGHeadersToDict(context.req.raw.headers)) || ipAddress;
61
- isolationScope.setUser({ ...isolationScope.getUser(), ip_address: userIpAddress });
62
- }
39
+ const activeSpan = getActiveSpan();
40
+ if (!activeSpan) return;
41
+ const connInfo = readConnInfo(context, runtime);
42
+ if (!connInfo) return;
43
+ const { address, port, transport, addressType } = connInfo;
44
+ const ipAddress = address && getClient()?.getDataCollectionOptions().userInfo ? address : void 0;
45
+ const rootSpan = getRootSpan(activeSpan);
46
+ const existingAttributes = spanToJSON(rootSpan).attributes ?? {};
47
+ const writesClientAddress = ipAddress !== void 0 && existingAttributes[CLIENT_ADDRESS] === void 0;
48
+ rootSpan.setAttributes(onlyNewAttributes({
49
+ [CLIENT_PORT]: writesClientAddress ? port : void 0,
50
+ [NETWORK_PEER_PORT]: port,
51
+ [NETWORK_TRANSPORT]: transport,
52
+ [NETWORK_TYPE]: addressType?.toLowerCase(),
53
+ [CLIENT_ADDRESS]: ipAddress,
54
+ [NETWORK_PEER_ADDRESS]: ipAddress
55
+ }, existingAttributes));
56
+ if (ipAddress) {
57
+ const userIpAddress = getClientIPAddress(winterCGHeadersToDict(context.req.raw.headers)) || ipAddress;
58
+ isolationScope.setUser({
59
+ ...isolationScope.getUser(),
60
+ ip_address: userIpAddress
61
+ });
62
+ }
63
63
  }
64
+ /** Keeps the defined attributes that are not on the span yet. */
64
65
  function onlyNewAttributes(attributes, existingAttributes) {
65
- return Object.fromEntries(
66
- Object.entries(attributes).filter(([key, value]) => value !== void 0 && existingAttributes[key] === void 0)
67
- );
66
+ return Object.fromEntries(Object.entries(attributes).filter(([key, value]) => value !== void 0 && existingAttributes[key] === void 0));
68
67
  }
68
+ /**
69
+ * Response handler for Hono framework
70
+ */
69
71
  function responseHandler(context, shouldHandleError) {
70
- captureContextError(context, shouldHandleError);
72
+ captureContextError(context, shouldHandleError);
71
73
  }
74
+ /**
75
+ * Captures an unhandled context error, gated by the user's `shouldHandleError` (or the default).
76
+ *
77
+ * A deduplicated middleware calls it directly to report the error of its own context — e.g. the inner
78
+ * context of an internal `.request()` whose route threw but whose failed response the outer handler
79
+ * swallowed.
80
+ */
72
81
  function captureContextError(context, shouldHandleError) {
73
- if (context.error) {
74
- if ((shouldHandleError ?? defaultShouldHandleError)(context.error)) {
75
- captureException(context.error, {
76
- mechanism: { handled: false, type: "auto.http.hono.context_error" }
77
- });
78
- }
79
- }
82
+ if (context.error) {
83
+ if ((shouldHandleError ?? defaultShouldHandleError)(context.error)) captureException(context.error, { mechanism: {
84
+ handled: false,
85
+ type: "auto.http.hono.context_error"
86
+ } });
87
+ }
80
88
  }
81
89
  function updateSpanRouteName(isolationScope, activeSpan, context, route) {
82
- if (route === void 0) {
83
- return;
84
- }
85
- const routeName = `${context.req.method} ${route}`;
86
- if (activeSpan) {
87
- activeSpan.updateName(routeName);
88
- const rootSpan = getRootSpan(activeSpan);
89
- updateSpanName(rootSpan, routeName);
90
- INTERNAL_setSegmentNameSourceIfSegment(rootSpan, "route");
91
- rootSpan.setAttribute(HTTP_ROUTE, route);
92
- }
93
- isolationScope.setTransactionName(routeName);
90
+ if (route === void 0) return;
91
+ const routeName = `${context.req.method} ${route}`;
92
+ if (activeSpan) {
93
+ activeSpan.updateName(routeName);
94
+ const rootSpan = getRootSpan(activeSpan);
95
+ updateSpanName(rootSpan, routeName);
96
+ INTERNAL_setSegmentNameSourceIfSegment(rootSpan, "route");
97
+ rootSpan.setAttribute(HTTP_ROUTE, route);
98
+ }
99
+ isolationScope.setTransactionName(routeName);
94
100
  }
95
-
96
101
  export { captureContextError, requestHandler, responseHandler };
97
- //# sourceMappingURL=middlewareHandlers.js.map
102
+
103
+ //# sourceMappingURL=middlewareHandlers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"middlewareHandlers.js","sources":["../../../../src/integrations/hono/middlewareHandlers.ts"],"sourcesContent":["import {\n captureException,\n getActiveSpan,\n getClient,\n getDefaultIsolationScope,\n getIsolationScope,\n getRootSpan,\n INTERNAL_setSegmentNameSourceIfSegment,\n updateSpanName,\n type Scope,\n type Span,\n type SpanAttributes,\n spanToJSON,\n winterCGHeadersToDict,\n winterCGRequestToRequestData,\n} from '@sentry/core';\nimport { getClientIPAddress } from '@sentry/core/server';\nimport type { Context } from './honoTypes';\nimport { type HonoRuntime, readConnInfo } from './connInfo';\nimport { hasFetchEvent } from './hono-context';\nimport { defaultShouldHandleError } from './defaultShouldHandleError';\nimport { getMiddlewareFlags } from './isMiddleware';\nimport { getMatchedHandlers, onRouteHandlerStart, wrapRouteHandlers } from './matchResult';\nimport { resolveRouteName } from './resolveRouteName';\nimport { type SentryHonoMiddlewareOptions } from './types';\nimport {\n CLIENT_ADDRESS,\n CLIENT_PORT,\n HTTP_ROUTE,\n NETWORK_PEER_ADDRESS,\n NETWORK_PEER_PORT,\n NETWORK_TRANSPORT,\n NETWORK_TYPE,\n} from '@sentry/conventions/attributes';\n\n/**\n * Request handler for Hono framework\n */\nexport function requestHandler(context: Context, runtime: HonoRuntime): void {\n const isolationScope = getCurrentIsolationScope();\n // Read now: when a route handler starts, a user span can be active.\n const span = getActiveSpan();\n\n // Hono 5 removes `c.req.matchedRoutes`. Before Hono 4.8, it is the only source.\n const matchedHandlers = getMatchedHandlers(context);\n const routes = matchedHandlers?.map(([[, route]]) => route) ?? context.req.matchedRoutes ?? [];\n const middlewareFlags = getMiddlewareFlags(routes);\n const nameSpan = (): void =>\n updateSpanRouteName(isolationScope, span, context, resolveRouteName(context, routes, middlewareFlags));\n\n // Name early, so that events from the handlers carry the route.\n nameSpan();\n\n // A route handler that calls `next()` passes the request on, so rename when each one starts. Without\n // the getter, only the Context hook can wrap the route handlers.\n if (!matchedHandlers || wrapRouteHandlers(matchedHandlers, middlewareFlags)) {\n onRouteHandlerStart(context, nameSpan);\n }\n\n isolationScope.setSDKProcessingMetadata({\n normalizedRequest: winterCGRequestToRequestData(hasFetchEvent(context) ? context.event.request : context.req.raw),\n });\n\n setConnInfoAttributes(context, runtime, isolationScope);\n}\n\nfunction getCurrentIsolationScope(): Scope {\n const defaultScope = getDefaultIsolationScope();\n const currentIsolationScope = getIsolationScope();\n\n return defaultScope === currentIsolationScope ? defaultScope : currentIsolationScope;\n}\n\n/**\n * Adds HTTP connection info (client IP, port, transport, address type) from the runtime to the root\n * (server) span and the isolation scope.\n *\n * Keeps attributes that the runtime SDK already set: it reads forwarding headers, while the runtime\n * objects only know the socket peer, which can be a proxy.\n */\nfunction setConnInfoAttributes(context: Context, runtime: HonoRuntime, isolationScope: Scope): void {\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n return;\n }\n\n const connInfo = readConnInfo(context, runtime);\n if (!connInfo) {\n return;\n }\n\n const { address, port, transport, addressType } = connInfo;\n\n // Only collect client IP if `userInfo` is enabled (this is primarily for setting data with `.setUser`, but in this case we cannot check for `dataCollection.headers` or similar)\n const ipAddress = address && getClient()?.getDataCollectionOptions().userInfo ? address : undefined;\n\n const rootSpan = getRootSpan(activeSpan);\n const existingAttributes = spanToJSON(rootSpan).attributes ?? {};\n // Pair `client.port` only with the socket address: behind a proxy, the socket port is the proxy's.\n const writesClientAddress = ipAddress !== undefined && existingAttributes[CLIENT_ADDRESS] === undefined;\n rootSpan.setAttributes(\n onlyNewAttributes(\n {\n [CLIENT_PORT]: writesClientAddress ? port : undefined,\n [NETWORK_PEER_PORT]: port,\n [NETWORK_TRANSPORT]: transport,\n [NETWORK_TYPE]: addressType?.toLowerCase(),\n [CLIENT_ADDRESS]: ipAddress,\n [NETWORK_PEER_ADDRESS]: ipAddress,\n },\n existingAttributes,\n ),\n );\n\n if (ipAddress) {\n // Like `RequestData`, prefer the forwarding header: behind a proxy, the socket address is the proxy's.\n const userIpAddress = getClientIPAddress(winterCGHeadersToDict(context.req.raw.headers)) || ipAddress;\n isolationScope.setUser({ ...isolationScope.getUser(), ip_address: userIpAddress });\n }\n}\n\n/** Keeps the defined attributes that are not on the span yet. */\nfunction onlyNewAttributes(attributes: SpanAttributes, existingAttributes: Record<string, unknown>): SpanAttributes {\n return Object.fromEntries(\n Object.entries(attributes).filter(([key, value]) => value !== undefined && existingAttributes[key] === undefined),\n );\n}\n\n/**\n * Response handler for Hono framework\n */\nexport function responseHandler(\n context: Context,\n shouldHandleError?: SentryHonoMiddlewareOptions['shouldHandleError'],\n): void {\n captureContextError(context, shouldHandleError);\n}\n\n/**\n * Captures an unhandled context error, gated by the user's `shouldHandleError` (or the default).\n *\n * A deduplicated middleware calls it directly to report the error of its own context — e.g. the inner\n * context of an internal `.request()` whose route threw but whose failed response the outer handler\n * swallowed.\n */\nexport function captureContextError(\n context: Context,\n shouldHandleError?: SentryHonoMiddlewareOptions['shouldHandleError'],\n): void {\n if (context.error) {\n if ((shouldHandleError ?? defaultShouldHandleError)(context.error)) {\n captureException(context.error, {\n mechanism: { handled: false, type: 'auto.http.hono.context_error' },\n });\n }\n }\n}\n\nfunction updateSpanRouteName(\n isolationScope: Scope,\n activeSpan: Span | undefined,\n context: Context,\n route: string | undefined,\n): void {\n // Without a route, keep the span name from the runtime.\n if (route === undefined) {\n return;\n }\n\n const routeName = `${context.req.method} ${route}`;\n\n if (activeSpan) {\n activeSpan.updateName(routeName);\n\n const rootSpan = getRootSpan(activeSpan);\n updateSpanName(rootSpan, routeName);\n INTERNAL_setSegmentNameSourceIfSegment(rootSpan, 'route');\n rootSpan.setAttribute(HTTP_ROUTE, route);\n }\n\n isolationScope.setTransactionName(routeName);\n}\n"],"names":[],"mappings":";;;;;;;;;;AAsCO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAkB,OAAA,CAAA,CAA4B;AAC3E,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,IAAiB,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,CAAyB;AAEhD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,IAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc;AAG3B,CAAA,CAAA,MAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkB,CAAA,CAAA,CAAA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CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAY,KAAK,CAAA;AAAA,CAAA,CACzC;AAEA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAmB,SAAS,CAAA;AAC7C;;"}
1
+ {"version":3,"file":"middlewareHandlers.js","names":[],"sources":["../../../../src/integrations/hono/middlewareHandlers.ts"],"sourcesContent":["import {\n captureException,\n getActiveSpan,\n getClient,\n getDefaultIsolationScope,\n getIsolationScope,\n getRootSpan,\n INTERNAL_setSegmentNameSourceIfSegment,\n updateSpanName,\n type Scope,\n type Span,\n type SpanAttributes,\n spanToJSON,\n winterCGHeadersToDict,\n winterCGRequestToRequestData,\n} from '@sentry/core';\nimport { getClientIPAddress } from '@sentry/core/server';\nimport type { Context } from './honoTypes';\nimport { type HonoRuntime, readConnInfo } from './connInfo';\nimport { hasFetchEvent } from './hono-context';\nimport { defaultShouldHandleError } from './defaultShouldHandleError';\nimport { getMiddlewareFlags } from './isMiddleware';\nimport { getMatchedHandlers, onRouteHandlerStart, wrapRouteHandlers } from './matchResult';\nimport { resolveRouteName } from './resolveRouteName';\nimport { type SentryHonoMiddlewareOptions } from './types';\nimport {\n CLIENT_ADDRESS,\n CLIENT_PORT,\n HTTP_ROUTE,\n NETWORK_PEER_ADDRESS,\n NETWORK_PEER_PORT,\n NETWORK_TRANSPORT,\n NETWORK_TYPE,\n} from '@sentry/conventions/attributes';\n\n/**\n * Request handler for Hono framework\n */\nexport function requestHandler(context: Context, runtime: HonoRuntime): void {\n const isolationScope = getCurrentIsolationScope();\n // Read now: when a route handler starts, a user span can be active.\n const span = getActiveSpan();\n\n // Hono 5 removes `c.req.matchedRoutes`. Before Hono 4.8, it is the only source.\n const matchedHandlers = getMatchedHandlers(context);\n const routes = matchedHandlers?.map(([[, route]]) => route) ?? context.req.matchedRoutes ?? [];\n const middlewareFlags = getMiddlewareFlags(routes);\n const nameSpan = (): void =>\n updateSpanRouteName(isolationScope, span, context, resolveRouteName(context, routes, middlewareFlags));\n\n // Name early, so that events from the handlers carry the route.\n nameSpan();\n\n // A route handler that calls `next()` passes the request on, so rename when each one starts. Without\n // the getter, only the Context hook can wrap the route handlers.\n if (!matchedHandlers || wrapRouteHandlers(matchedHandlers, middlewareFlags)) {\n onRouteHandlerStart(context, nameSpan);\n }\n\n isolationScope.setSDKProcessingMetadata({\n normalizedRequest: winterCGRequestToRequestData(hasFetchEvent(context) ? context.event.request : context.req.raw),\n });\n\n setConnInfoAttributes(context, runtime, isolationScope);\n}\n\nfunction getCurrentIsolationScope(): Scope {\n const defaultScope = getDefaultIsolationScope();\n const currentIsolationScope = getIsolationScope();\n\n return defaultScope === currentIsolationScope ? defaultScope : currentIsolationScope;\n}\n\n/**\n * Adds HTTP connection info (client IP, port, transport, address type) from the runtime to the root\n * (server) span and the isolation scope.\n *\n * Keeps attributes that the runtime SDK already set: it reads forwarding headers, while the runtime\n * objects only know the socket peer, which can be a proxy.\n */\nfunction setConnInfoAttributes(context: Context, runtime: HonoRuntime, isolationScope: Scope): void {\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n return;\n }\n\n const connInfo = readConnInfo(context, runtime);\n if (!connInfo) {\n return;\n }\n\n const { address, port, transport, addressType } = connInfo;\n\n // Only collect client IP if `userInfo` is enabled (this is primarily for setting data with `.setUser`, but in this case we cannot check for `dataCollection.headers` or similar)\n const ipAddress = address && getClient()?.getDataCollectionOptions().userInfo ? address : undefined;\n\n const rootSpan = getRootSpan(activeSpan);\n const existingAttributes = spanToJSON(rootSpan).attributes ?? {};\n // Pair `client.port` only with the socket address: behind a proxy, the socket port is the proxy's.\n const writesClientAddress = ipAddress !== undefined && existingAttributes[CLIENT_ADDRESS] === undefined;\n rootSpan.setAttributes(\n onlyNewAttributes(\n {\n [CLIENT_PORT]: writesClientAddress ? port : undefined,\n [NETWORK_PEER_PORT]: port,\n [NETWORK_TRANSPORT]: transport,\n [NETWORK_TYPE]: addressType?.toLowerCase(),\n [CLIENT_ADDRESS]: ipAddress,\n [NETWORK_PEER_ADDRESS]: ipAddress,\n },\n existingAttributes,\n ),\n );\n\n if (ipAddress) {\n // Like `RequestData`, prefer the forwarding header: behind a proxy, the socket address is the proxy's.\n const userIpAddress = getClientIPAddress(winterCGHeadersToDict(context.req.raw.headers)) || ipAddress;\n isolationScope.setUser({ ...isolationScope.getUser(), ip_address: userIpAddress });\n }\n}\n\n/** Keeps the defined attributes that are not on the span yet. */\nfunction onlyNewAttributes(attributes: SpanAttributes, existingAttributes: Record<string, unknown>): SpanAttributes {\n return Object.fromEntries(\n Object.entries(attributes).filter(([key, value]) => value !== undefined && existingAttributes[key] === undefined),\n );\n}\n\n/**\n * Response handler for Hono framework\n */\nexport function responseHandler(\n context: Context,\n shouldHandleError?: SentryHonoMiddlewareOptions['shouldHandleError'],\n): void {\n captureContextError(context, shouldHandleError);\n}\n\n/**\n * Captures an unhandled context error, gated by the user's `shouldHandleError` (or the default).\n *\n * A deduplicated middleware calls it directly to report the error of its own context — e.g. the inner\n * context of an internal `.request()` whose route threw but whose failed response the outer handler\n * swallowed.\n */\nexport function captureContextError(\n context: Context,\n shouldHandleError?: SentryHonoMiddlewareOptions['shouldHandleError'],\n): void {\n if (context.error) {\n if ((shouldHandleError ?? defaultShouldHandleError)(context.error)) {\n captureException(context.error, {\n mechanism: { handled: false, type: 'auto.http.hono.context_error' },\n });\n }\n }\n}\n\nfunction updateSpanRouteName(\n isolationScope: Scope,\n activeSpan: Span | undefined,\n context: Context,\n route: string | undefined,\n): void {\n // Without a route, keep the span name from the runtime.\n if (route === undefined) {\n return;\n }\n\n const routeName = `${context.req.method} ${route}`;\n\n if (activeSpan) {\n activeSpan.updateName(routeName);\n\n const rootSpan = getRootSpan(activeSpan);\n updateSpanName(rootSpan, routeName);\n INTERNAL_setSegmentNameSourceIfSegment(rootSpan, 'route');\n rootSpan.setAttribute(HTTP_ROUTE, route);\n }\n\n isolationScope.setTransactionName(routeName);\n}\n"],"mappings":";;;;;;;;;;;;;AAsCA,SAAgB,eAAe,SAAkB,SAA4B;CAC3E,MAAM,iBAAiB,yBAAyB;CAEhD,MAAM,OAAO,cAAc;CAG3B,MAAM,kBAAkB,mBAAmB,OAAO;CAClD,MAAM,SAAS,iBAAiB,KAAK,CAAC,GAAG,YAAY,KAAK,KAAK,QAAQ,IAAI,iBAAiB,CAAC;CAC7F,MAAM,kBAAkB,mBAAmB,MAAM;CACjD,MAAM,iBACJ,oBAAoB,gBAAgB,MAAM,SAAS,iBAAiB,SAAS,QAAQ,eAAe,CAAC;CAGvG,SAAS;CAIT,IAAI,CAAC,mBAAmB,kBAAkB,iBAAiB,eAAe,GACxE,oBAAoB,SAAS,QAAQ;CAGvC,eAAe,yBAAyB,EACtC,mBAAmB,6BAA6B,cAAc,OAAO,IAAI,QAAQ,MAAM,UAAU,QAAQ,IAAI,GAAG,EAClH,CAAC;CAED,sBAAsB,SAAS,SAAS,cAAc;AACxD;AAEA,SAAS,2BAAkC;CACzC,MAAM,eAAe,yBAAyB;CAC9C,MAAM,wBAAwB,kBAAkB;CAEhD,OAAO,iBAAiB,wBAAwB,eAAe;AACjE;;;;;;;;AASA,SAAS,sBAAsB,SAAkB,SAAsB,gBAA6B;CAClG,MAAM,aAAa,cAAc;CACjC,IAAI,CAAC,YACH;CAGF,MAAM,WAAW,aAAa,SAAS,OAAO;CAC9C,IAAI,CAAC,UACH;CAGF,MAAM,EAAE,SAAS,MAAM,WAAW,gBAAgB;CAGlD,MAAM,YAAY,WAAW,UAAU,CAAC,EAAE,yBAAyB,CAAC,CAAC,WAAW,UAAU,KAAA;CAE1F,MAAM,WAAW,YAAY,UAAU;CACvC,MAAM,qBAAqB,WAAW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OP } from '@sentry/conventions/attributes';
2
- import { HTTP_SERVER } from '@sentry/conventions/op';
3
- import { getOriginalFunction, debug, getActiveSpan, startSpan } from '@sentry/core';
4
- import { INTERNAL_REQUEST_ORIGIN } from './constants.js';
5
- import { DEBUG_BUILD } from '../../debug-build.js';
6
- import { sentryOriginalTraps } from './sentryOriginalTraps.js';
7
-
1
+ import { INTERNAL_REQUEST_ORIGIN } from "./constants.js";
2
+ import { DEBUG_BUILD } from "../../debug-build.js";
3
+ import { sentryOriginalTraps } from "./sentryOriginalTraps.js";
4
+ import { SENTRY_OP, SENTRY_ORIGIN } from "@sentry/conventions/attributes";
5
+ import { debug, getActiveSpan, getOriginalFunction, startSpan } from "@sentry/core";
6
+ import { HTTP_SERVER } from "@sentry/conventions/op";
7
+ // src/integrations/hono/patchAppRequest.ts
8
8
  const INTERNAL_REQUEST_OP = HTTP_SERVER;
9
- const INTERNAL_REQUEST_SPAN_ACTIVE = /* @__PURE__ */ Symbol.for("sentry.hono.internalRequestSpanActive");
9
+ const INTERNAL_REQUEST_SPAN_ACTIVE = Symbol.for("sentry.hono.internalRequestSpanActive");
10
+ /** Whether the instance `app.request` Proxy is currently opening an internal-request span. */
10
11
  function isInternalRequestSpanActive() {
11
- return !!globalThis[INTERNAL_REQUEST_SPAN_ACTIVE];
12
+ return !!globalThis[INTERNAL_REQUEST_SPAN_ACTIVE];
12
13
  }
13
14
  function setInternalRequestSpanActive(active) {
14
- globalThis[INTERNAL_REQUEST_SPAN_ACTIVE] = active;
15
+ globalThis[INTERNAL_REQUEST_SPAN_ACTIVE] = active;
15
16
  }
16
17
  function stripQueryAndHash(path) {
17
- const end = path.search(/[?#]/);
18
- return end === -1 ? path : path.slice(0, end);
18
+ const end = path.search(/[?#]/);
19
+ return end === -1 ? path : path.slice(0, end);
19
20
  }
21
+ /**
22
+ * Derive the span-name path from an `app.request()` argument, mirroring Hono's own handling so the
23
+ * name matches the path actually dispatched, with the query/hash stripped so they can't leak into
24
+ * span names or inflate cardinality.
25
+ *
26
+ * Hono treats an absolute `http(s)://` input as a full URL and everything else as a path under
27
+ * `http://localhost` (see `hono-base`'s `request`). We prepend that same fixed host rather than
28
+ * resolving the string as a URL reference: resolution rewrites protocol-relative inputs
29
+ * (`//example.com/foo` → host `example.com`, dropping the segment Hono keeps in the path) and throws
30
+ * on inputs Hono accepts (`//`, `http:`). This runs before the underlying dispatch, so it must never
31
+ * throw — the `catch` is a final guard against any remaining malformed input.
32
+ */
20
33
  function extractPathname(input) {
21
- if (typeof input === "string") {
22
- try {
23
- const url = /^https?:\/\//.test(input) ? new URL(input) : new URL(`http://localhost${input.startsWith("/") ? "" : "/"}${input}`);
24
- return url.pathname;
25
- } catch {
26
- return stripQueryAndHash(input);
27
- }
28
- }
29
- if (input instanceof Request) {
30
- return new URL(input.url).pathname;
31
- }
32
- return input instanceof URL ? input.pathname : "/";
34
+ if (typeof input === "string") try {
35
+ return (/^https?:\/\//.test(input) ? new URL(input) : new URL(`http://localhost${input.startsWith("/") ? "" : "/"}${input}`)).pathname;
36
+ } catch {
37
+ return stripQueryAndHash(input);
38
+ }
39
+ if (input instanceof Request) return new URL(input.url).pathname;
40
+ return input instanceof URL ? input.pathname : "/";
33
41
  }
42
+ /**
43
+ * Patches `app.request()` on a Hono instance so that each internal dispatch
44
+ * is traced as an `http.server` span — child of whatever span is active at
45
+ * the call site.
46
+ *
47
+ * `.request()` is a class field (arrow function), so this must run per-instance.
48
+ * Idempotent: safe to call multiple times on the same instance.
49
+ */
34
50
  function patchAppRequest(app) {
35
- if (getOriginalFunction(app.request)) {
36
- DEBUG_BUILD && debug.log("[hono] app.request already patched \u2014 skipping.");
37
- return;
38
- }
39
- const originalRequest = app.request;
40
- app.request = new Proxy(originalRequest, {
41
- apply(_target, thisArg, args) {
42
- const [input, requestInit, ...rest] = args;
43
- if (!getActiveSpan()) {
44
- return Reflect.apply(_target, thisArg, args);
45
- }
46
- let method = requestInit?.method ?? (input instanceof Request ? input.method : "GET");
47
- method = method.toUpperCase();
48
- const path = extractPathname(input);
49
- return startSpan(
50
- {
51
- name: `${method} ${path}`,
52
- onlyIfParent: true,
53
- attributes: {
54
- [SENTRY_OP]: INTERNAL_REQUEST_OP,
55
- [SENTRY_ORIGIN]: INTERNAL_REQUEST_ORIGIN
56
- }
57
- },
58
- () => {
59
- setInternalRequestSpanActive(true);
60
- try {
61
- return Reflect.apply(_target, thisArg, [input, requestInit, ...rest]);
62
- } finally {
63
- setInternalRequestSpanActive(false);
64
- }
65
- }
66
- );
67
- },
68
- ...sentryOriginalTraps(originalRequest)
69
- });
70
- DEBUG_BUILD && debug.log("[hono] Patched app.request for internal dispatch tracing.");
51
+ if (getOriginalFunction(app.request)) {
52
+ DEBUG_BUILD && debug.log("[hono] app.request already patched — skipping.");
53
+ return;
54
+ }
55
+ const originalRequest = app.request;
56
+ app.request = new Proxy(originalRequest, {
57
+ apply(_target, thisArg, args) {
58
+ const [input, requestInit, ...rest] = args;
59
+ if (!getActiveSpan()) return Reflect.apply(_target, thisArg, args);
60
+ let method = requestInit?.method ?? (input instanceof Request ? input.method : "GET");
61
+ method = method.toUpperCase();
62
+ const path = extractPathname(input);
63
+ return startSpan({
64
+ name: `${method} ${path}`,
65
+ onlyIfParent: true,
66
+ attributes: {
67
+ [SENTRY_OP]: INTERNAL_REQUEST_OP,
68
+ [SENTRY_ORIGIN]: INTERNAL_REQUEST_ORIGIN
69
+ }
70
+ }, () => {
71
+ setInternalRequestSpanActive(true);
72
+ try {
73
+ return Reflect.apply(_target, thisArg, [
74
+ input,
75
+ requestInit,
76
+ ...rest
77
+ ]);
78
+ } finally {
79
+ setInternalRequestSpanActive(false);
80
+ }
81
+ });
82
+ },
83
+ ...sentryOriginalTraps(originalRequest)
84
+ });
85
+ DEBUG_BUILD && debug.log("[hono] Patched app.request for internal dispatch tracing.");
71
86
  }
72
-
73
87
  export { extractPathname, isInternalRequestSpanActive, patchAppRequest };
74
- //# sourceMappingURL=patchAppRequest.js.map
88
+
89
+ //# sourceMappingURL=patchAppRequest.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"patchAppRequest.js","sources":["../../../../src/integrations/hono/patchAppRequest.ts"],"sourcesContent":["import { SENTRY_OP, SENTRY_ORIGIN } from '@sentry/conventions/attributes';\nimport { HTTP_SERVER } from '@sentry/conventions/op';\nimport { debug, getActiveSpan, getOriginalFunction, startSpan, type WrappedFunction } from '@sentry/core';\nimport { INTERNAL_REQUEST_ORIGIN } from './constants';\nimport type { Env, Hono } from './honoTypes';\nimport { DEBUG_BUILD } from '../../debug-build';\nimport { sentryOriginalTraps } from './sentryOriginalTraps';\n\nconst INTERNAL_REQUEST_OP = HTTP_SERVER;\n\n// Re-entrancy guard shared with the orchestrion channel subscriber\n// (`instrumentInternalRequests` in `honoIntegration`). Both wrap the same `app.request`: this Proxy\n// calls through to the original, which — when the default integration is active — is orchestrion-\n// instrumented and publishes to the request channel. Without this guard the two stack a second,\n// identical internal-request span inside the first. The Proxy owns the span; the channel subscriber\n// reads this flag and opts out. `Symbol.for` on `globalThis` keeps it shared across copies of\n// `@sentry/server-utils`, matching the request-handling dedup markers.\nconst INTERNAL_REQUEST_SPAN_ACTIVE = Symbol.for('sentry.hono.internalRequestSpanActive');\ntype GuardCarrier = { [INTERNAL_REQUEST_SPAN_ACTIVE]?: boolean };\n\n/** Whether the instance `app.request` Proxy is currently opening an internal-request span. */\nexport function isInternalRequestSpanActive(): boolean {\n return !!(globalThis as GuardCarrier)[INTERNAL_REQUEST_SPAN_ACTIVE];\n}\n\nfunction setInternalRequestSpanActive(active: boolean): void {\n (globalThis as GuardCarrier)[INTERNAL_REQUEST_SPAN_ACTIVE] = active;\n}\n\nfunction stripQueryAndHash(path: string): string {\n const end = path.search(/[?#]/);\n return end === -1 ? path : path.slice(0, end);\n}\n\n/**\n * Derive the span-name path from an `app.request()` argument, mirroring Hono's own handling so the\n * name matches the path actually dispatched, with the query/hash stripped so they can't leak into\n * span names or inflate cardinality.\n *\n * Hono treats an absolute `http(s)://` input as a full URL and everything else as a path under\n * `http://localhost` (see `hono-base`'s `request`). We prepend that same fixed host rather than\n * resolving the string as a URL reference: resolution rewrites protocol-relative inputs\n * (`//example.com/foo` → host `example.com`, dropping the segment Hono keeps in the path) and throws\n * on inputs Hono accepts (`//`, `http:`). This runs before the underlying dispatch, so it must never\n * throw — the `catch` is a final guard against any remaining malformed input.\n */\nexport function extractPathname(input: unknown): string {\n if (typeof input === 'string') {\n try {\n const url = /^https?:\\/\\//.test(input)\n ? new URL(input)\n : new URL(`http://localhost${input.startsWith('/') ? '' : '/'}${input}`);\n return url.pathname;\n } catch {\n return stripQueryAndHash(input);\n }\n }\n\n if (input instanceof Request) {\n return new URL(input.url).pathname;\n }\n\n return input instanceof URL ? input.pathname : '/';\n}\n\n/**\n * Patches `app.request()` on a Hono instance so that each internal dispatch\n * is traced as an `http.server` span — child of whatever span is active at\n * the call site.\n *\n * `.request()` is a class field (arrow function), so this must run per-instance.\n * Idempotent: safe to call multiple times on the same instance.\n */\nexport function patchAppRequest<E extends Env>(app: Hono<E>): void {\n if (getOriginalFunction(app.request as unknown as WrappedFunction)) {\n DEBUG_BUILD && debug.log('[hono] app.request already patched — skipping.');\n return;\n }\n\n const originalRequest = app.request;\n\n app.request = new Proxy(originalRequest, {\n apply(_target, thisArg, args: [string | Request | URL, RequestInit?, ...unknown[]]) {\n const [input, requestInit, ...rest] = args;\n\n if (!getActiveSpan()) {\n return Reflect.apply(_target, thisArg, args);\n }\n\n let method = requestInit?.method ?? (input instanceof Request ? input.method : 'GET');\n method = method.toUpperCase();\n\n const path = extractPathname(input);\n\n return startSpan(\n {\n name: `${method} ${path}`,\n onlyIfParent: true,\n attributes: {\n [SENTRY_OP]: INTERNAL_REQUEST_OP,\n [SENTRY_ORIGIN]: INTERNAL_REQUEST_ORIGIN,\n },\n },\n () => {\n // The flag only needs to cover the synchronous dispatch start, where the orchestrion\n // channel would fire and open its duplicate span. `Reflect.apply` returns the pending\n // promise synchronously, so `finally` clears it before any nested `.request()` runs.\n setInternalRequestSpanActive(true);\n try {\n return Reflect.apply(_target, thisArg, [input, requestInit, ...rest]);\n } finally {\n setInternalRequestSpanActive(false);\n }\n },\n );\n },\n ...sentryOriginalTraps(originalRequest),\n });\n\n DEBUG_BUILD && debug.log('[hono] Patched app.request for internal dispatch tracing.');\n}\n"],"names":[],"mappings":";;;;;;;AAQA,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,GAAsB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAS5B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,4BAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA+B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,CAAA,CAAI,uCAAuC,CAAA;AAIhF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,2BAAA,CAAA,CAAA,CAAuC;AACrD,CAAA,CAAA,OAAO,CAAC,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA4B,4BAA4B,CAAA;AACpE;AAEA,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,EAA6B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAuB;AAC3D,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,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CAAA,CAAA,CAAA,CAAe;AAAA,CAAA,CAAA,CACvC,CAAA;AAED,CAAA,CAAA,WAAA,CAAA,CAAA,CAAA,CAAe,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,EAAI,2DAA2D,CAAA;AACtF;;"}
1
+ {"version":3,"file":"patchAppRequest.js","names":[],"sources":["../../../../src/integrations/hono/patchAppRequest.ts"],"sourcesContent":["import { SENTRY_OP, SENTRY_ORIGIN } from '@sentry/conventions/attributes';\nimport { HTTP_SERVER } from '@sentry/conventions/op';\nimport { debug, getActiveSpan, getOriginalFunction, startSpan, type WrappedFunction } from '@sentry/core';\nimport { INTERNAL_REQUEST_ORIGIN } from './constants';\nimport type { Env, Hono } from './honoTypes';\nimport { DEBUG_BUILD } from '../../debug-build';\nimport { sentryOriginalTraps } from './sentryOriginalTraps';\n\nconst INTERNAL_REQUEST_OP = HTTP_SERVER;\n\n// Re-entrancy guard shared with the orchestrion channel subscriber\n// (`instrumentInternalRequests` in `honoIntegration`). Both wrap the same `app.request`: this Proxy\n// calls through to the original, which — when the default integration is active — is orchestrion-\n// instrumented and publishes to the request channel. Without this guard the two stack a second,\n// identical internal-request span inside the first. The Proxy owns the span; the channel subscriber\n// reads this flag and opts out. `Symbol.for` on `globalThis` keeps it shared across copies of\n// `@sentry/server-utils`, matching the request-handling dedup markers.\nconst INTERNAL_REQUEST_SPAN_ACTIVE = Symbol.for('sentry.hono.internalRequestSpanActive');\ntype GuardCarrier = { [INTERNAL_REQUEST_SPAN_ACTIVE]?: boolean };\n\n/** Whether the instance `app.request` Proxy is currently opening an internal-request span. */\nexport function isInternalRequestSpanActive(): boolean {\n return !!(globalThis as GuardCarrier)[INTERNAL_REQUEST_SPAN_ACTIVE];\n}\n\nfunction setInternalRequestSpanActive(active: boolean): void {\n (globalThis as GuardCarrier)[INTERNAL_REQUEST_SPAN_ACTIVE] = active;\n}\n\nfunction stripQueryAndHash(path: string): string {\n const end = path.search(/[?#]/);\n return end === -1 ? path : path.slice(0, end);\n}\n\n/**\n * Derive the span-name path from an `app.request()` argument, mirroring Hono's own handling so the\n * name matches the path actually dispatched, with the query/hash stripped so they can't leak into\n * span names or inflate cardinality.\n *\n * Hono treats an absolute `http(s)://` input as a full URL and everything else as a path under\n * `http://localhost` (see `hono-base`'s `request`). We prepend that same fixed host rather than\n * resolving the string as a URL reference: resolution rewrites protocol-relative inputs\n * (`//example.com/foo` → host `example.com`, dropping the segment Hono keeps in the path) and throws\n * on inputs Hono accepts (`//`, `http:`). This runs before the underlying dispatch, so it must never\n * throw — the `catch` is a final guard against any remaining malformed input.\n */\nexport function extractPathname(input: unknown): string {\n if (typeof input === 'string') {\n try {\n const url = /^https?:\\/\\//.test(input)\n ? new URL(input)\n : new URL(`http://localhost${input.startsWith('/') ? '' : '/'}${input}`);\n return url.pathname;\n } catch {\n return stripQueryAndHash(input);\n }\n }\n\n if (input instanceof Request) {\n return new URL(input.url).pathname;\n }\n\n return input instanceof URL ? input.pathname : '/';\n}\n\n/**\n * Patches `app.request()` on a Hono instance so that each internal dispatch\n * is traced as an `http.server` span — child of whatever span is active at\n * the call site.\n *\n * `.request()` is a class field (arrow function), so this must run per-instance.\n * Idempotent: safe to call multiple times on the same instance.\n */\nexport function patchAppRequest<E extends Env>(app: Hono<E>): void {\n if (getOriginalFunction(app.request as unknown as WrappedFunction)) {\n DEBUG_BUILD && debug.log('[hono] app.request already patched — skipping.');\n return;\n }\n\n const originalRequest = app.request;\n\n app.request = new Proxy(originalRequest, {\n apply(_target, thisArg, args: [string | Request | URL, RequestInit?, ...unknown[]]) {\n const [input, requestInit, ...rest] = args;\n\n if (!getActiveSpan()) {\n return Reflect.apply(_target, thisArg, args);\n }\n\n let method = requestInit?.method ?? (input instanceof Request ? input.method : 'GET');\n method = method.toUpperCase();\n\n const path = extractPathname(input);\n\n return startSpan(\n {\n name: `${method} ${path}`,\n onlyIfParent: true,\n attributes: {\n [SENTRY_OP]: INTERNAL_REQUEST_OP,\n [SENTRY_ORIGIN]: INTERNAL_REQUEST_ORIGIN,\n },\n },\n () => {\n // The flag only needs to cover the synchronous dispatch start, where the orchestrion\n // channel would fire and open its duplicate span. `Reflect.apply` returns the pending\n // promise synchronously, so `finally` clears it before any nested `.request()` runs.\n setInternalRequestSpanActive(true);\n try {\n return Reflect.apply(_target, thisArg, [input, requestInit, ...rest]);\n } finally {\n setInternalRequestSpanActive(false);\n }\n },\n );\n },\n ...sentryOriginalTraps(originalRequest),\n });\n\n DEBUG_BUILD && debug.log('[hono] Patched app.request for internal dispatch tracing.');\n}\n"],"mappings":";;;;;;;AAQA,MAAM,sBAAsB;AAS5B,MAAM,+BAA+B,OAAO,IAAI,uCAAuC;;AAIvF,SAAgB,8BAAuC;CACrD,OAAO,CAAC,CAAE,WAA4B;AACxC;AAEA,SAAS,6BAA6B,QAAuB;CAC1D,WAA4B,gCAAgC;AAC/D;AAEA,SAAS,kBAAkB,MAAsB;CAC/C,MAAM,MAAM,KAAK,OAAO,MAAM;CAC9B,OAAO,QAAQ,KAAK,OAAO,KAAK,MAAM,GAAG,GAAG;AAC9C;;;;;;;;;;;;;AAcA,SAAgB,gBAAgB,OAAwB;CACtD,IAAI,OAAO,UAAU,UACnB,IAAI;EAIF,QAHY,eAAe,KAAK,KAAK,IACjC,IAAI,IAAI,KAAK,IACb,IAAI,IAAI,mBAAmB,MAAM,WAAW,GAAG,IAAI,KAAK,MAAM,OAAO,EAAA,CAC9D;CACb,QAAQ;EACN,OAAO,kBAAkB,KAAK;CAChC;CAGF,IAAI,iBAAiB,SACnB,OAAO,IAAI,IAAI,MAAM,GAAG,CAAC,CAAC;CAG5B,OAAO,iBAAiB,MAAM,MAAM,WAAW;AACjD;;;;;;;;;AAUA,SAAgB,gBAA+B,KAAoB;CACjE,IAAI,oBAAoB,IAAI,OAAqC,GAAG;EAClE,eAAe,MAAM,IAAI,gDAAgD;EACzE;CACF;CAEA,MAAM,kBAAkB,IAAI;CAE5B,IAAI,UAAU,IAAI,MAAM,iBAAiB;EACvC,MAAM,SAAS,SAAS,MAA4D;GAClF,MAAM,CAAC,OAAO,aAAa,GAAG,QAAQ;GAEtC,IAAI,CAAC,cAAc,GACjB,OAAO,QAAQ,MAAM,SAAS,SAAS,IAAI;GAG7C,IAAI,SAAS,aAAa,WAAW,iBAAiB,UAAU,MAAM,SAAS;GAC/E,SAAS,OAAO,YAAY;GAE5B,MAAM,OAAO,gBAAgB,KAAK;GAElC,OAAO,UACL;IACE,MAAM,GAAG,OAAO,GAAG;IACnB,cAAc;IACd,YAAY;MACT,YAAY;MACZ,gBAAgB;IACnB;GACF,SACM;IAIJ,6BAA6B,IAAI;IACjC,IAAI;KACF,OAAO,QAAQ,MAAM,SAAS,SAAS;MAAC;MAAO;MAAa,GAAG;KAAI,CAAC;IACtE,UAAU;KACR,6BAA6B,KAAK;IACpC;GACF,CACF;EACF;EACA,GAAG,oBAAoB,eAAe;CACxC,CAAC;CAED,eAAe,MAAM,IAAI,2DAA2D;AACtF"}
@@ -1,67 +1,82 @@
1
- import { debug } from '@sentry/core';
2
- import { DEBUG_BUILD } from '../../debug-build.js';
3
- import { wrapMiddlewareWithSpan } from './wrapMiddlewareSpan.js';
4
-
1
+ import { DEBUG_BUILD } from "../../debug-build.js";
2
+ import { wrapMiddlewareWithSpan } from "./wrapMiddlewareSpan.js";
3
+ import { debug } from "@sentry/core";
4
+ // src/integrations/hono/patchAppUse.ts
5
5
  const patchedUseInstances = /* @__PURE__ */ new WeakSet();
6
6
  const patchedMethodInstances = /* @__PURE__ */ new WeakSet();
7
- const HTTP_METHODS = ["get", "post", "put", "delete", "options", "patch", "all", "query"];
7
+ const HTTP_METHODS = [
8
+ "get",
9
+ "post",
10
+ "put",
11
+ "delete",
12
+ "options",
13
+ "patch",
14
+ "all",
15
+ "query"
16
+ ];
17
+ /**
18
+ * Patches `app.use` (instance own property) on a Hono instance to instrument middleware at registration time.
19
+ *
20
+ * Must be per-instance because `use` is a class field, not a prototype method.
21
+ * Idempotent.
22
+ */
8
23
  function patchAppUse(app) {
9
- if (patchedUseInstances.has(app)) {
10
- DEBUG_BUILD && debug.log("[hono] app.use already patched \u2014 skipping.");
11
- return;
12
- }
13
- patchedUseInstances.add(app);
14
- app.use = new Proxy(app.use, {
15
- apply(target, thisArg, args) {
16
- const [first, ...rest] = args;
17
- if (typeof first === "string") {
18
- const wrappedHandlers = rest.map((handler) => wrapMiddlewareWithSpan(handler));
19
- return Reflect.apply(target, thisArg, [first, ...wrappedHandlers]);
20
- }
21
- const allHandlers = [first, ...rest].map((handler) => wrapMiddlewareWithSpan(handler));
22
- return Reflect.apply(target, thisArg, allHandlers);
23
- }
24
- });
24
+ if (patchedUseInstances.has(app)) {
25
+ DEBUG_BUILD && debug.log("[hono] app.use already patched — skipping.");
26
+ return;
27
+ }
28
+ patchedUseInstances.add(app);
29
+ app.use = new Proxy(app.use, { apply(target, thisArg, args) {
30
+ const [first, ...rest] = args;
31
+ if (typeof first === "string") {
32
+ const wrappedHandlers = rest.map((handler) => wrapMiddlewareWithSpan(handler));
33
+ return Reflect.apply(target, thisArg, [first, ...wrappedHandlers]);
34
+ }
35
+ const allHandlers = [first, ...rest].map((handler) => wrapMiddlewareWithSpan(handler));
36
+ return Reflect.apply(target, thisArg, allHandlers);
37
+ } });
25
38
  }
39
+ /**
40
+ * Patches HTTP method class fields to instrument inline middleware at registration time.
41
+ *
42
+ * For `app.get('/path', mw1, mw2, handler)`, all handlers except the last are middleware and get wrapped with spans.
43
+ * The final handler (the route handler) is already covered by the root http.server transaction.
44
+ */
26
45
  function patchHttpMethodHandlers(app) {
27
- if (patchedMethodInstances.has(app)) {
28
- DEBUG_BUILD && debug.log("[hono] HTTP method handlers already patched - skipping.");
29
- return;
30
- }
31
- patchedMethodInstances.add(app);
32
- for (const method of HTTP_METHODS) {
33
- patchRegistrationMethod(app, method, wrapInlineMiddleware);
34
- }
35
- patchRegistrationMethod(app, "on", (args) => {
36
- const [method, path, ...handlers] = args;
37
- return [method, path, ...wrapInlineMiddleware(handlers)];
38
- });
46
+ if (patchedMethodInstances.has(app)) {
47
+ DEBUG_BUILD && debug.log("[hono] HTTP method handlers already patched - skipping.");
48
+ return;
49
+ }
50
+ patchedMethodInstances.add(app);
51
+ for (const method of HTTP_METHODS) patchRegistrationMethod(app, method, wrapInlineMiddleware);
52
+ patchRegistrationMethod(app, "on", (args) => {
53
+ const [method, path, ...handlers] = args;
54
+ return [
55
+ method,
56
+ path,
57
+ ...wrapInlineMiddleware(handlers)
58
+ ];
59
+ });
39
60
  }
61
+ /**
62
+ * Given `[path?, ...handlers]` or `[...handlers]`, wraps all handlers except the last one with spans.
63
+ * The last handler is the route handler and is left as-is.
64
+ */
40
65
  function wrapInlineMiddleware(args) {
41
- const hasPathPrefix = typeof args[0] === "string";
42
- const handlersStart = hasPathPrefix ? 1 : 0;
43
- const handlers = args.slice(handlersStart);
44
- if (handlers.length <= 1) {
45
- return args;
46
- }
47
- const wrapped = [...args];
48
- for (let i = handlersStart; i < wrapped.length - 1; i++) {
49
- wrapped[i] = wrapMiddlewareWithSpan(wrapped[i]);
50
- }
51
- return wrapped;
66
+ const handlersStart = typeof args[0] === "string" ? 1 : 0;
67
+ if (args.slice(handlersStart).length <= 1) return args;
68
+ const wrapped = [...args];
69
+ for (let i = handlersStart; i < wrapped.length - 1; i++) wrapped[i] = wrapMiddlewareWithSpan(wrapped[i]);
70
+ return wrapped;
52
71
  }
53
72
  function patchRegistrationMethod(app, method, transformArgs) {
54
- const registration = Reflect.get(app, method);
55
- if (typeof registration !== "function") {
56
- return;
57
- }
58
- const patchedRegistration = new Proxy(registration, {
59
- apply(target, thisArg, args) {
60
- return Reflect.apply(target, thisArg, transformArgs(args));
61
- }
62
- });
63
- Reflect.set(app, method, patchedRegistration);
73
+ const registration = Reflect.get(app, method);
74
+ if (typeof registration !== "function") return;
75
+ const patchedRegistration = new Proxy(registration, { apply(target, thisArg, args) {
76
+ return Reflect.apply(target, thisArg, transformArgs(args));
77
+ } });
78
+ Reflect.set(app, method, patchedRegistration);
64
79
  }
65
-
66
80
  export { patchAppUse, patchHttpMethodHandlers };
67
- //# sourceMappingURL=patchAppUse.js.map
81
+
82
+ //# sourceMappingURL=patchAppUse.js.map