@sentry/server-utils 11.0.0-beta.2 → 11.0.0-rc.1

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 (330) hide show
  1. package/build/cjs/ai/core/utils.js +41 -0
  2. package/build/cjs/ai/core/utils.js.map +1 -1
  3. package/build/cjs/ai/flue/constants.js +20 -0
  4. package/build/cjs/ai/flue/constants.js.map +1 -0
  5. package/build/cjs/ai/flue/index.js +115 -0
  6. package/build/cjs/ai/flue/index.js.map +1 -0
  7. package/build/cjs/ai/flue/utils.js +202 -0
  8. package/build/cjs/ai/flue/utils.js.map +1 -0
  9. package/build/cjs/ai/google-genai/index.js +10 -8
  10. package/build/cjs/ai/google-genai/index.js.map +1 -1
  11. package/build/cjs/ai/google-genai/streaming.js +11 -3
  12. package/build/cjs/ai/google-genai/streaming.js.map +1 -1
  13. package/build/cjs/ai/google-genai/utils.js +120 -10
  14. package/build/cjs/ai/google-genai/utils.js.map +1 -1
  15. package/build/cjs/ai/mastra/constants.js +2 -0
  16. package/build/cjs/ai/mastra/constants.js.map +1 -1
  17. package/build/cjs/ai/mastra/index.js +16 -7
  18. package/build/cjs/ai/mastra/index.js.map +1 -1
  19. package/build/cjs/ai/mastra/span-registry.js +20 -0
  20. package/build/cjs/ai/mastra/span-registry.js.map +1 -0
  21. package/build/cjs/ai/mistral/constants.js +20 -0
  22. package/build/cjs/ai/mistral/constants.js.map +1 -0
  23. package/build/cjs/ai/mistral/index.js +130 -0
  24. package/build/cjs/ai/mistral/index.js.map +1 -0
  25. package/build/cjs/ai/mistral/streaming.js +208 -0
  26. package/build/cjs/ai/mistral/streaming.js.map +1 -0
  27. package/build/cjs/ai/mistral/utils.js +87 -0
  28. package/build/cjs/ai/mistral/utils.js.map +1 -0
  29. package/build/cjs/ai/vercel-ai/index.js +6 -1
  30. package/build/cjs/ai/vercel-ai/index.js.map +1 -1
  31. package/build/cjs/ai/workers-ai/index.js +1 -4
  32. package/build/cjs/ai/workers-ai/index.js.map +1 -1
  33. package/build/cjs/ai/workers-ai/streaming.js +2 -3
  34. package/build/cjs/ai/workers-ai/streaming.js.map +1 -1
  35. package/build/cjs/ai/workers-ai/utils.js +2 -27
  36. package/build/cjs/ai/workers-ai/utils.js.map +1 -1
  37. package/build/cjs/eve.js +30 -0
  38. package/build/cjs/eve.js.map +1 -0
  39. package/build/cjs/index.js +62 -44
  40. package/build/cjs/index.js.map +1 -1
  41. package/build/cjs/index.no-diagnostic-channels.js +19 -14
  42. package/build/cjs/index.no-diagnostic-channels.js.map +1 -1
  43. package/build/cjs/integrations/aws-sdk/constants.js +0 -2
  44. package/build/cjs/integrations/aws-sdk/constants.js.map +1 -1
  45. package/build/cjs/integrations/aws-sdk/services/lambda.js +1 -1
  46. package/build/cjs/integrations/aws-sdk/services/lambda.js.map +1 -1
  47. package/build/cjs/integrations/aws-sdk/services/sns.js +1 -1
  48. package/build/cjs/integrations/aws-sdk/services/sns.js.map +1 -1
  49. package/build/cjs/integrations/fastify/index.js.map +1 -1
  50. package/build/cjs/integrations/fastify/instrumentation.js.map +1 -1
  51. package/build/cjs/integrations/flue.js +40 -0
  52. package/build/cjs/integrations/flue.js.map +1 -0
  53. package/build/cjs/integrations/groq.js +21 -0
  54. package/build/cjs/integrations/groq.js.map +1 -0
  55. package/build/cjs/integrations/index.js +10 -0
  56. package/build/cjs/integrations/index.js.map +1 -1
  57. package/build/cjs/integrations/knex.js +5 -3
  58. package/build/cjs/integrations/knex.js.map +1 -1
  59. package/build/cjs/integrations/koa/index.js +2 -8
  60. package/build/cjs/integrations/koa/index.js.map +1 -1
  61. package/build/cjs/integrations/langchain.js +10 -1
  62. package/build/cjs/integrations/langchain.js.map +1 -1
  63. package/build/cjs/integrations/mastra.js +65 -2
  64. package/build/cjs/integrations/mastra.js.map +1 -1
  65. package/build/cjs/integrations/mistral.js +81 -0
  66. package/build/cjs/integrations/mistral.js.map +1 -0
  67. package/build/cjs/integrations/mysql.js +3 -3
  68. package/build/cjs/integrations/mysql.js.map +1 -1
  69. package/build/cjs/integrations/mysql2/index.js +3 -3
  70. package/build/cjs/integrations/mysql2/index.js.map +1 -1
  71. package/build/cjs/integrations/mysql2/mysql2-dc-subscriber.js +1 -2
  72. package/build/cjs/integrations/mysql2/mysql2-dc-subscriber.js.map +1 -1
  73. package/build/cjs/integrations/openai-compatible.js +94 -0
  74. package/build/cjs/integrations/openai-compatible.js.map +1 -0
  75. package/build/cjs/integrations/postgres.js +3 -3
  76. package/build/cjs/integrations/postgres.js.map +1 -1
  77. package/build/cjs/integrations/prisma/tracing-helper.js +1 -1
  78. package/build/cjs/integrations/prisma/tracing-helper.js.map +1 -1
  79. package/build/cjs/integrations/tedious.js +4 -3
  80. package/build/cjs/integrations/tedious.js.map +1 -1
  81. package/build/cjs/integrations/together-ai.js +19 -0
  82. package/build/cjs/integrations/together-ai.js.map +1 -0
  83. package/build/cjs/integrations/vercel-ai/gen-ai-recording-mode.js +13 -0
  84. package/build/cjs/integrations/vercel-ai/gen-ai-recording-mode.js.map +1 -0
  85. package/build/cjs/integrations/vercel-ai/util.js +0 -4
  86. package/build/cjs/integrations/vercel-ai/util.js.map +1 -1
  87. package/build/cjs/integrations/vercel-ai/vercel-ai-dc-subscriber.js +33 -5
  88. package/build/cjs/integrations/vercel-ai/vercel-ai-dc-subscriber.js.map +1 -1
  89. package/build/cjs/integrations/vercel-ai/vercel-ai-orchestrion-subscriber.js +2 -1
  90. package/build/cjs/integrations/vercel-ai/vercel-ai-orchestrion-subscriber.js.map +1 -1
  91. package/build/cjs/orchestrion/bundler/options.js +1 -0
  92. package/build/cjs/orchestrion/bundler/options.js.map +1 -1
  93. package/build/cjs/orchestrion/bundler/rollup.js +6 -2
  94. package/build/cjs/orchestrion/bundler/rollup.js.map +1 -1
  95. package/build/cjs/orchestrion/channels.js +6 -0
  96. package/build/cjs/orchestrion/channels.js.map +1 -1
  97. package/build/cjs/orchestrion/config/channel-integration-definitions.js +4 -0
  98. package/build/cjs/orchestrion/config/channel-integration-definitions.js.map +1 -1
  99. package/build/cjs/orchestrion/config/flue.js +10 -0
  100. package/build/cjs/orchestrion/config/flue.js.map +1 -0
  101. package/build/cjs/orchestrion/config/groq.js +19 -0
  102. package/build/cjs/orchestrion/config/groq.js.map +1 -0
  103. package/build/cjs/orchestrion/config/index.js +16 -0
  104. package/build/cjs/orchestrion/config/index.js.map +1 -1
  105. package/build/cjs/orchestrion/config/mastra.js +14 -2
  106. package/build/cjs/orchestrion/config/mastra.js.map +1 -1
  107. package/build/cjs/orchestrion/config/mistral.js +57 -0
  108. package/build/cjs/orchestrion/config/mistral.js.map +1 -0
  109. package/build/cjs/orchestrion/config/openai-compatible.js +19 -0
  110. package/build/cjs/orchestrion/config/openai-compatible.js.map +1 -0
  111. package/build/cjs/orchestrion/config/together-ai.js +19 -0
  112. package/build/cjs/orchestrion/config/together-ai.js.map +1 -0
  113. package/build/cjs/tracing-channel.js +1 -0
  114. package/build/cjs/tracing-channel.js.map +1 -1
  115. package/build/cjs/utils/sql.js +68 -15
  116. package/build/cjs/utils/sql.js.map +1 -1
  117. package/build/esm/ai/core/utils.js +42 -3
  118. package/build/esm/ai/core/utils.js.map +1 -1
  119. package/build/esm/ai/flue/constants.js +13 -0
  120. package/build/esm/ai/flue/constants.js.map +1 -0
  121. package/build/esm/ai/flue/index.js +113 -0
  122. package/build/esm/ai/flue/index.js.map +1 -0
  123. package/build/esm/ai/flue/utils.js +193 -0
  124. package/build/esm/ai/flue/utils.js.map +1 -0
  125. package/build/esm/ai/google-genai/index.js +12 -10
  126. package/build/esm/ai/google-genai/index.js.map +1 -1
  127. package/build/esm/ai/google-genai/streaming.js +9 -1
  128. package/build/esm/ai/google-genai/streaming.js.map +1 -1
  129. package/build/esm/ai/google-genai/utils.js +117 -11
  130. package/build/esm/ai/google-genai/utils.js.map +1 -1
  131. package/build/esm/ai/mastra/constants.js +2 -1
  132. package/build/esm/ai/mastra/constants.js.map +1 -1
  133. package/build/esm/ai/mastra/index.js +14 -5
  134. package/build/esm/ai/mastra/index.js.map +1 -1
  135. package/build/esm/ai/mastra/span-registry.js +16 -0
  136. package/build/esm/ai/mastra/span-registry.js.map +1 -0
  137. package/build/esm/ai/mistral/constants.js +15 -0
  138. package/build/esm/ai/mistral/constants.js.map +1 -0
  139. package/build/esm/ai/mistral/index.js +126 -0
  140. package/build/esm/ai/mistral/index.js.map +1 -0
  141. package/build/esm/ai/mistral/streaming.js +205 -0
  142. package/build/esm/ai/mistral/streaming.js.map +1 -0
  143. package/build/esm/ai/mistral/utils.js +82 -0
  144. package/build/esm/ai/mistral/utils.js.map +1 -0
  145. package/build/esm/ai/vercel-ai/index.js +6 -1
  146. package/build/esm/ai/vercel-ai/index.js.map +1 -1
  147. package/build/esm/ai/workers-ai/index.js +2 -5
  148. package/build/esm/ai/workers-ai/index.js.map +1 -1
  149. package/build/esm/ai/workers-ai/streaming.js +1 -2
  150. package/build/esm/ai/workers-ai/streaming.js.map +1 -1
  151. package/build/esm/ai/workers-ai/utils.js +2 -27
  152. package/build/esm/ai/workers-ai/utils.js.map +1 -1
  153. package/build/esm/eve.js +27 -0
  154. package/build/esm/eve.js.map +1 -0
  155. package/build/esm/index.js +9 -1
  156. package/build/esm/index.js.map +1 -1
  157. package/build/esm/index.no-diagnostic-channels.js +3 -1
  158. package/build/esm/index.no-diagnostic-channels.js.map +1 -1
  159. package/build/esm/integrations/aws-sdk/constants.js +1 -2
  160. package/build/esm/integrations/aws-sdk/constants.js.map +1 -1
  161. package/build/esm/integrations/aws-sdk/services/lambda.js +2 -2
  162. package/build/esm/integrations/aws-sdk/services/lambda.js.map +1 -1
  163. package/build/esm/integrations/aws-sdk/services/sns.js +3 -3
  164. package/build/esm/integrations/aws-sdk/services/sns.js.map +1 -1
  165. package/build/esm/integrations/fastify/index.js.map +1 -1
  166. package/build/esm/integrations/fastify/instrumentation.js.map +1 -1
  167. package/build/esm/integrations/flue.js +38 -0
  168. package/build/esm/integrations/flue.js.map +1 -0
  169. package/build/esm/integrations/groq.js +18 -0
  170. package/build/esm/integrations/groq.js.map +1 -0
  171. package/build/esm/integrations/index.js +10 -0
  172. package/build/esm/integrations/index.js.map +1 -1
  173. package/build/esm/integrations/knex.js +6 -4
  174. package/build/esm/integrations/knex.js.map +1 -1
  175. package/build/esm/integrations/koa/index.js +3 -9
  176. package/build/esm/integrations/koa/index.js.map +1 -1
  177. package/build/esm/integrations/langchain.js +10 -1
  178. package/build/esm/integrations/langchain.js.map +1 -1
  179. package/build/esm/integrations/mastra.js +67 -4
  180. package/build/esm/integrations/mastra.js.map +1 -1
  181. package/build/esm/integrations/mistral.js +66 -0
  182. package/build/esm/integrations/mistral.js.map +1 -0
  183. package/build/esm/integrations/mysql.js +4 -4
  184. package/build/esm/integrations/mysql.js.map +1 -1
  185. package/build/esm/integrations/mysql2/index.js +4 -4
  186. package/build/esm/integrations/mysql2/index.js.map +1 -1
  187. package/build/esm/integrations/mysql2/mysql2-dc-subscriber.js +2 -3
  188. package/build/esm/integrations/mysql2/mysql2-dc-subscriber.js.map +1 -1
  189. package/build/esm/integrations/openai-compatible.js +79 -0
  190. package/build/esm/integrations/openai-compatible.js.map +1 -0
  191. package/build/esm/integrations/openai.js +1 -1
  192. package/build/esm/integrations/postgres.js +4 -4
  193. package/build/esm/integrations/postgres.js.map +1 -1
  194. package/build/esm/integrations/prisma/tracing-helper.js +2 -2
  195. package/build/esm/integrations/prisma/tracing-helper.js.map +1 -1
  196. package/build/esm/integrations/tedious.js +5 -4
  197. package/build/esm/integrations/tedious.js.map +1 -1
  198. package/build/esm/integrations/together-ai.js +17 -0
  199. package/build/esm/integrations/together-ai.js.map +1 -0
  200. package/build/esm/integrations/vercel-ai/gen-ai-recording-mode.js +10 -0
  201. package/build/esm/integrations/vercel-ai/gen-ai-recording-mode.js.map +1 -0
  202. package/build/esm/integrations/vercel-ai/util.js +1 -4
  203. package/build/esm/integrations/vercel-ai/util.js.map +1 -1
  204. package/build/esm/integrations/vercel-ai/vercel-ai-dc-subscriber.js +34 -6
  205. package/build/esm/integrations/vercel-ai/vercel-ai-dc-subscriber.js.map +1 -1
  206. package/build/esm/integrations/vercel-ai/vercel-ai-orchestrion-subscriber.js +2 -1
  207. package/build/esm/integrations/vercel-ai/vercel-ai-orchestrion-subscriber.js.map +1 -1
  208. package/build/esm/orchestrion/bundler/options.js +1 -0
  209. package/build/esm/orchestrion/bundler/options.js.map +1 -1
  210. package/build/esm/orchestrion/bundler/rollup.js +6 -2
  211. package/build/esm/orchestrion/bundler/rollup.js.map +1 -1
  212. package/build/esm/orchestrion/channels.js +6 -0
  213. package/build/esm/orchestrion/channels.js.map +1 -1
  214. package/build/esm/orchestrion/config/channel-integration-definitions.js +4 -0
  215. package/build/esm/orchestrion/config/channel-integration-definitions.js.map +1 -1
  216. package/build/esm/orchestrion/config/flue.js +8 -0
  217. package/build/esm/orchestrion/config/flue.js.map +1 -0
  218. package/build/esm/orchestrion/config/groq.js +15 -0
  219. package/build/esm/orchestrion/config/groq.js.map +1 -0
  220. package/build/esm/orchestrion/config/index.js +15 -1
  221. package/build/esm/orchestrion/config/index.js.map +1 -1
  222. package/build/esm/orchestrion/config/mastra.js +14 -2
  223. package/build/esm/orchestrion/config/mastra.js.map +1 -1
  224. package/build/esm/orchestrion/config/mistral.js +53 -0
  225. package/build/esm/orchestrion/config/mistral.js.map +1 -0
  226. package/build/esm/orchestrion/config/openai-compatible.js +17 -0
  227. package/build/esm/orchestrion/config/openai-compatible.js.map +1 -0
  228. package/build/esm/orchestrion/config/together-ai.js +15 -0
  229. package/build/esm/orchestrion/config/together-ai.js.map +1 -0
  230. package/build/esm/package.json +1 -1
  231. package/build/esm/tracing-channel.js +1 -1
  232. package/build/esm/tracing-channel.js.map +1 -1
  233. package/build/esm/utils/sql.js +67 -16
  234. package/build/esm/utils/sql.js.map +1 -1
  235. package/build/types/ai/core/utils.d.ts +28 -0
  236. package/build/types/ai/core/utils.d.ts.map +1 -1
  237. package/build/types/ai/flue/constants.d.ts +37 -0
  238. package/build/types/ai/flue/constants.d.ts.map +1 -0
  239. package/build/types/ai/flue/index.d.ts +18 -0
  240. package/build/types/ai/flue/index.d.ts.map +1 -0
  241. package/build/types/ai/flue/types.d.ts +118 -0
  242. package/build/types/ai/flue/types.d.ts.map +1 -0
  243. package/build/types/ai/flue/utils.d.ts +38 -0
  244. package/build/types/ai/flue/utils.d.ts.map +1 -0
  245. package/build/types/ai/google-genai/index.d.ts.map +1 -1
  246. package/build/types/ai/google-genai/streaming.d.ts.map +1 -1
  247. package/build/types/ai/google-genai/utils.d.ts +28 -4
  248. package/build/types/ai/google-genai/utils.d.ts.map +1 -1
  249. package/build/types/ai/index.d.ts +3 -0
  250. package/build/types/ai/index.d.ts.map +1 -1
  251. package/build/types/ai/mastra/constants.d.ts +2 -0
  252. package/build/types/ai/mastra/constants.d.ts.map +1 -1
  253. package/build/types/ai/mastra/index.d.ts +2 -0
  254. package/build/types/ai/mastra/index.d.ts.map +1 -1
  255. package/build/types/ai/mastra/span-registry.d.ts +5 -0
  256. package/build/types/ai/mastra/span-registry.d.ts.map +1 -0
  257. package/build/types/ai/mistral/constants.d.ts +30 -0
  258. package/build/types/ai/mistral/constants.d.ts.map +1 -0
  259. package/build/types/ai/mistral/index.d.ts +20 -0
  260. package/build/types/ai/mistral/index.d.ts.map +1 -0
  261. package/build/types/ai/mistral/streaming.d.ts +24 -0
  262. package/build/types/ai/mistral/streaming.d.ts.map +1 -0
  263. package/build/types/ai/mistral/types.d.ts +39 -0
  264. package/build/types/ai/mistral/types.d.ts.map +1 -0
  265. package/build/types/ai/mistral/utils.d.ts +20 -0
  266. package/build/types/ai/mistral/utils.d.ts.map +1 -0
  267. package/build/types/ai/vercel-ai/index.d.ts.map +1 -1
  268. package/build/types/ai/workers-ai/index.d.ts.map +1 -1
  269. package/build/types/ai/workers-ai/utils.d.ts +2 -14
  270. package/build/types/ai/workers-ai/utils.d.ts.map +1 -1
  271. package/build/types/eve.d.ts +53 -0
  272. package/build/types/eve.d.ts.map +1 -0
  273. package/build/types/exports.d.ts +1 -1
  274. package/build/types/exports.d.ts.map +1 -1
  275. package/build/types/index.d.ts +8 -0
  276. package/build/types/index.d.ts.map +1 -1
  277. package/build/types/integrations/aws-sdk/constants.d.ts +2 -3
  278. package/build/types/integrations/aws-sdk/constants.d.ts.map +1 -1
  279. package/build/types/integrations/aws-sdk/services/lambda.d.ts.map +1 -1
  280. package/build/types/integrations/aws-sdk/services/sns.d.ts.map +1 -1
  281. package/build/types/integrations/fastify/index.d.ts +1 -1
  282. package/build/types/integrations/fastify/instrumentation.d.ts +1 -1
  283. package/build/types/integrations/flue.d.ts +4 -0
  284. package/build/types/integrations/flue.d.ts.map +1 -0
  285. package/build/types/integrations/groq.d.ts +10 -0
  286. package/build/types/integrations/groq.d.ts.map +1 -0
  287. package/build/types/integrations/index.d.ts.map +1 -1
  288. package/build/types/integrations/knex.d.ts.map +1 -1
  289. package/build/types/integrations/koa/index.d.ts.map +1 -1
  290. package/build/types/integrations/langchain.d.ts.map +1 -1
  291. package/build/types/integrations/mastra.d.ts.map +1 -1
  292. package/build/types/integrations/mistral.d.ts +7 -0
  293. package/build/types/integrations/mistral.d.ts.map +1 -0
  294. package/build/types/integrations/openai-compatible.d.ts +32 -0
  295. package/build/types/integrations/openai-compatible.d.ts.map +1 -0
  296. package/build/types/integrations/postgres.d.ts.map +1 -1
  297. package/build/types/integrations/tedious.d.ts.map +1 -1
  298. package/build/types/integrations/together-ai.d.ts +9 -0
  299. package/build/types/integrations/together-ai.d.ts.map +1 -0
  300. package/build/types/integrations/vercel-ai/gen-ai-recording-mode.d.ts +15 -0
  301. package/build/types/integrations/vercel-ai/gen-ai-recording-mode.d.ts.map +1 -0
  302. package/build/types/integrations/vercel-ai/util.d.ts +2 -2
  303. package/build/types/integrations/vercel-ai/util.d.ts.map +1 -1
  304. package/build/types/integrations/vercel-ai/vercel-ai-dc-subscriber.d.ts.map +1 -1
  305. package/build/types/orchestrion/bundler/options.d.ts +9 -0
  306. package/build/types/orchestrion/bundler/options.d.ts.map +1 -1
  307. package/build/types/orchestrion/bundler/rollup.d.ts.map +1 -1
  308. package/build/types/orchestrion/channels.d.ts +13 -3
  309. package/build/types/orchestrion/channels.d.ts.map +1 -1
  310. package/build/types/orchestrion/config/channel-integration-definitions.d.ts +12 -0
  311. package/build/types/orchestrion/config/channel-integration-definitions.d.ts.map +1 -1
  312. package/build/types/orchestrion/config/flue.d.ts +9 -0
  313. package/build/types/orchestrion/config/flue.d.ts.map +1 -0
  314. package/build/types/orchestrion/config/groq.d.ts +8 -0
  315. package/build/types/orchestrion/config/groq.d.ts.map +1 -0
  316. package/build/types/orchestrion/config/index.d.ts +41 -0
  317. package/build/types/orchestrion/config/index.d.ts.map +1 -1
  318. package/build/types/orchestrion/config/mastra.d.ts +1 -0
  319. package/build/types/orchestrion/config/mastra.d.ts.map +1 -1
  320. package/build/types/orchestrion/config/mistral.d.ts +46 -0
  321. package/build/types/orchestrion/config/mistral.d.ts.map +1 -0
  322. package/build/types/orchestrion/config/openai-compatible.d.ts +17 -0
  323. package/build/types/orchestrion/config/openai-compatible.d.ts.map +1 -0
  324. package/build/types/orchestrion/config/together-ai.d.ts +8 -0
  325. package/build/types/orchestrion/config/together-ai.d.ts.map +1 -0
  326. package/build/types/tracing-channel.d.ts +8 -0
  327. package/build/types/tracing-channel.d.ts.map +1 -1
  328. package/build/types/utils/sql.d.ts +23 -4
  329. package/build/types/utils/sql.d.ts.map +1 -1
  330. package/package.json +3 -3
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Structural types for the subset of `@flue/runtime`'s instrumentation contract we consume.
3
+ *
4
+ * Declared locally rather than imported: `@flue/runtime` is ESM-only and not a dependency of this
5
+ * package, and the SDK must not import it. Mirrors `FlueInstrumentation`, `FlueObservation` and
6
+ * `FlueExecutionContext` as of `@flue/runtime` 2.x.
7
+ */
8
+ /** Token counts and Flue-computed costs on a settled turn. */
9
+ export interface FlueUsage {
10
+ input?: number;
11
+ output?: number;
12
+ cacheRead?: number;
13
+ cacheWrite?: number;
14
+ totalTokens?: number;
15
+ cost?: {
16
+ input?: number;
17
+ output?: number;
18
+ cacheRead?: number;
19
+ cacheWrite?: number;
20
+ total?: number;
21
+ };
22
+ }
23
+ /** Mirrors `ModelRequestInfo`. */
24
+ export interface FlueModelRequestInfo {
25
+ requestedModel?: string;
26
+ /** Provider slug (`anthropic`, `openrouter`) — what `gen_ai.provider.name` wants. */
27
+ providerId?: string;
28
+ temperature?: number;
29
+ maxTokens?: number;
30
+ reasoningLevel?: string;
31
+ serverAddress?: string;
32
+ serverPort?: number;
33
+ }
34
+ /** Mirrors `ModelRequestInput` — the content half of `ModelRequest`, on `turn_request` only. */
35
+ export interface FlueModelRequestInput {
36
+ systemPrompt?: string;
37
+ messages?: unknown[];
38
+ tools?: unknown[];
39
+ }
40
+ /** `turn_request` carries `ModelRequest`, which is `ModelRequestInfo` plus the input. */
41
+ export interface FlueModelRequest extends FlueModelRequestInfo {
42
+ input?: FlueModelRequestInput;
43
+ }
44
+ /** Mirrors `ModelResponse`. */
45
+ export interface FlueModelResponse {
46
+ responseId?: string;
47
+ responseModel?: string;
48
+ output?: unknown;
49
+ usage?: FlueUsage;
50
+ finishReason?: string;
51
+ }
52
+ /**
53
+ * Mirrors Flue's `errorInfo`, which it attaches to a failed tool or turn observation. Flue catches
54
+ * the throw and turns it into a tool result, so this serialized form is the only trace of it.
55
+ */
56
+ export interface FlueErrorInfo {
57
+ type?: string;
58
+ name?: string;
59
+ message?: string;
60
+ stack?: string;
61
+ }
62
+ /**
63
+ * One event from Flue's observation stream. Only the fields we read are declared; Flue emits more
64
+ * event types than are handled here, and unknown types are ignored.
65
+ */
66
+ export interface FlueObservation {
67
+ type: string;
68
+ agentName?: string;
69
+ conversationId?: string;
70
+ session?: string;
71
+ turnId?: string;
72
+ taskId?: string;
73
+ submissionId?: string;
74
+ operationId?: string;
75
+ toolName?: string;
76
+ toolCallId?: string;
77
+ isError?: boolean;
78
+ errorInfo?: FlueErrorInfo;
79
+ purpose?: string;
80
+ durationMs?: number;
81
+ request?: FlueModelRequest;
82
+ args?: unknown;
83
+ result?: unknown;
84
+ response?: FlueModelResponse;
85
+ }
86
+ /** The execution unit an interceptor wraps. */
87
+ export interface FlueExecutionOperation {
88
+ type: string;
89
+ operationId?: string;
90
+ operationKind?: string;
91
+ turnId?: string;
92
+ toolCallId?: string;
93
+ }
94
+ /** Mirrors `FlueTraceCarrier` — the W3C headers Flue persists at admission. */
95
+ export interface FlueTraceCarrier {
96
+ traceparent: string;
97
+ tracestate?: string;
98
+ }
99
+ export interface FlueExecutionContext {
100
+ traceCarrier?: FlueTraceCarrier;
101
+ agentName?: string;
102
+ submissionId?: string;
103
+ conversationId?: string;
104
+ session?: string;
105
+ turnId?: string;
106
+ taskId?: string;
107
+ }
108
+ export interface FlueEventContext {
109
+ agentName?: string;
110
+ }
111
+ /** The object `instrument()` accepts. */
112
+ export interface FlueInstrumentation {
113
+ key: symbol;
114
+ observe: (observation: FlueObservation, ctx: FlueEventContext) => void;
115
+ interceptor: <T>(operation: FlueExecutionOperation, ctx: FlueExecutionContext, next: () => Promise<T>) => Promise<T>;
116
+ dispose: () => void;
117
+ }
118
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ai/flue/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,8DAA8D;AAC9D,MAAM,WAAW,SAAS;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE;QACL,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE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,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,CAAC,WAAW,EAAE,eAAe,EAAE,GAAG,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACvE,WAAW,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,sBAAsB,EAAE,GAAG,EAAE,oBAAoB,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IACrH,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB"}
@@ -0,0 +1,38 @@
1
+ import type { LRUMap, Span } from '@sentry/core';
2
+ import type { FlueModelRequestInfo, FlueObservation, FlueUsage } from './types';
3
+ /**
4
+ * Flue persists the incoming W3C `traceparent` at admission and replays it on the agent operation.
5
+ * Sentry's own propagation uses `sentry-trace`, so the carrier has to be converted before it can
6
+ * continue the trace. Kept local until something else needs a W3C parser.
7
+ */
8
+ export declare function sentryTraceFromTraceparent(traceparent: string): string | undefined;
9
+ /**
10
+ * Turn and tool spans, keyed by the id of the work they cover. Bounded, because the key is only
11
+ * removed when the matching end observation arrives and an abandoned stream never emits one.
12
+ */
13
+ export type SpanTracker = LRUMap<string, Span>;
14
+ export declare function startTurnSpan(observation: FlueObservation, turnSpans: SpanTracker): void;
15
+ export declare function endTurnSpan(observation: FlueObservation, turnSpans: SpanTracker, recordOutputs: boolean): void;
16
+ /**
17
+ * Flue reports token counts and its own computed costs on the same `usage` object, so both are set
18
+ * here. The cost figures have no equivalent in the provider SDKs' own instrumentation.
19
+ */
20
+ export declare function setUsageAttributes(span: Span, usage: FlueUsage | undefined, isError?: boolean): void;
21
+ /**
22
+ * Tool spans hang off the agent invocation rather than the turn, matching how Flue's own
23
+ * OpenTelemetry adapter projects them: siblings of `chat`, correlated to model output by tool call
24
+ * id. Keyed by `toolCallId` so concurrent tool calls in one turn cannot cross-attribute.
25
+ */
26
+ export declare function startToolSpan(observation: FlueObservation, toolSpans: SpanTracker, recordInputs: boolean): void;
27
+ export declare function endToolSpan(observation: FlueObservation, toolSpans: SpanTracker, recordOutputs: boolean): void;
28
+ /**
29
+ * `turn_request` is the only event carrying the request's content — the settled `turn` reports
30
+ * metadata alone — so input messages, system prompt and tool definitions are read from it.
31
+ */
32
+ export declare function recordRequestContent(observation: FlueObservation, turnSpans: SpanTracker): void;
33
+ /**
34
+ * Model-call tuning and the provider endpoint, all on the settled turn's `ModelRequestInfo`. These
35
+ * are the conventional attributes the other AI integrations in this package set.
36
+ */
37
+ export declare function setRequestAttributes(span: Span, request: FlueModelRequestInfo | undefined): void;
38
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/ai/flue/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AA0CjD,OAAO,KAAK,EAAiB,oBAAoB,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAE/F;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOlF;AAED;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAkD/C,wBAAgB,aAAa,CAAC,WAAW,EAAE,eAAe,EAAE,SAAS,EAAE,WAAW,GAAG,IAAI,CAsBxF;AAED,wBAAgB,WAAW,CAAC,WAAW,EAAE,eAAe,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,OAAO,GAAG,IAAI,CAkD9G;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CA2BpG;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,eA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AC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,mBAAmB,EAAE,aAAa,CAAC,EAAE,OAAO,GAAG,IAAI,CA6D9G;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAC/B,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC3C,OAAO,EAAE,OAAO,GACf,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAYrC;AA2ID;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,2BAA2B,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,CAAC,CAExG"}
@@ -1 +1 @@
1
- {"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["../../../../src/ai/google-genai/streaming.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAuGnD;;;;GAIG;AACH,wBAAuB,gBAAgB,CACrC,MAAM,EAAE,aAAa,CAAC,mBAAmB,CAAC,EAC1C,IAAI,EAAE,IAAI,EACV,aAAa,EAAE,OAAO,GACrB,cAAc,CAAC,mBAAmB,EAAE,IAAI,EAAE,OAAO,CAAC,CAepD"}
1
+ {"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["../../../../src/ai/google-genai/streaming.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AA+GnD;;;;GAIG;AACH,wBAAuB,gBAAgB,CACrC,MAAM,EAAE,aAAa,CAAC,mBAAmB,CAAC,EAC1C,IAAI,EAAE,IAAI,EACV,aAAa,EAAE,OAAO,GACrB,cAAc,CAAC,mBAAmB,EAAE,IAAI,EAAE,OAAO,CAAC,CAmBpD"}
@@ -1,3 +1,4 @@
1
+ import type { Span } from '@sentry/core';
1
2
  export type ContentListUnion = Content | Content[] | PartListUnion;
2
3
  export type ContentUnion = Content | PartUnion[] | PartUnion;
3
4
  export type Content = {
@@ -14,13 +15,36 @@ export type Part = Record<string, unknown> & {
14
15
  text?: string;
15
16
  };
16
17
  export type PartListUnion = PartUnion[] | PartUnion;
17
- export type Message = Record<string, unknown> & {
18
+ /**
19
+ * A message part as described in https://develop.sentry.dev/sdk/telemetry/traces/modules/ai-agents/.
20
+ * Parts Sentry cannot type are dropped when the message is rendered, so Google's own `Part` shape
21
+ * (`{ text }`, `{ functionCall }`, ...) has to be translated into this one.
22
+ */
23
+ export type MessagePart = Record<string, unknown> & {
24
+ type: string;
25
+ };
26
+ export type Message = {
18
27
  role: string;
19
- content?: PartListUnion;
20
- parts?: PartListUnion;
28
+ parts: MessagePart[];
21
29
  };
22
30
  /**
23
- *
31
+ * Binary payloads are reported by media type only: `inlineData.data` is base64 bytes, which the
32
+ * conventions require to be dropped rather than recorded.
33
+ */
34
+ export declare function partToMessagePart(part: unknown): MessagePart | undefined;
35
+ /**
36
+ * Bare parts are collected into one message rather than one message each: `[{ text }, { inlineData }]`
37
+ * is a single multimodal turn in Google's API, not two turns.
24
38
  */
25
39
  export declare function contentUnionToMessages(content: ContentListUnion, role?: string): Message[];
40
+ /** Collect the message parts of every candidate in a response. */
41
+ export declare function candidatesToMessageParts(candidates: unknown): MessagePart[];
42
+ /**
43
+ * Set alongside the deprecated `gen_ai.response.text` / `gen_ai.response.tool_calls`: Relay migrates
44
+ * those into `gen_ai.output.messages`, but the tool-calls half of that migration is lossy, so a turn
45
+ * that only calls a tool would otherwise render an empty Output.
46
+ */
47
+ export declare function setOutputMessagesAttribute(span: Span, parts: MessagePart[]): void;
48
+ /** Flatten a `ContentUnion` instruction into the plain text `gen_ai.system_instructions` expects. */
49
+ export declare function systemInstructionToText(systemInstruction: unknown): string | undefined;
26
50
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/ai/google-genai/utils.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,OAAO,EAAE,GAAG,aAAa,CAAC;AACnE,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,SAAS,EAAE,GAAG,SAAS,CAAC;AAC7D,MAAM,MAAM,OAAO,GAAG;IACpB,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AACF,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,MAAM,CAAC;AACtC,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAC3C,UAAU,CAAC,EAAE;QACX,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AACF,MAAM,MAAM,aAAa,GAAG,SAAS,EAAE,GAAG,SAAS,CAAC;AAGpD,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAAC;AAEF;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,SAAS,GAAG,OAAO,EAAE,CAe1F"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/ai/google-genai/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAIzC,MAAM,MAAM,gBAA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,GAAG,IAAI,CAKjF;AAED,qGAAqG;AACrG,wBAAgB,uBAAuB,CAAC,iBAAiB,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAOtF"}
@@ -6,8 +6,11 @@
6
6
  export { instrumentOpenAiClient } from './openai';
7
7
  export { instrumentAnthropicAiClient } from './anthropic-ai';
8
8
  export { instrumentGoogleGenAIClient } from './google-genai';
9
+ export { instrumentMistralAiClient } from './mistral';
9
10
  export { instrumentWorkersAiClient } from './workers-ai';
10
11
  export { createLangChainCallbackHandler, instrumentLangChainEmbeddings } from './langchain';
11
12
  export { instrumentStateGraph, instrumentStateGraphCompile, instrumentCreateReactAgent } from './langgraph';
12
13
  export { SentryMastraExporter } from './mastra';
14
+ export { createFlueInstrumentation } from './flue';
15
+ export type { FlueOptions } from './flue';
13
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ai/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,8BAA8B,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAC5F,OAAO,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAC5G,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ai/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,8BAA8B,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAC5F,OAAO,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAC5G,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,yBAAyB,EAAE,MAAM,QAAQ,CAAC;AACnD,YAAY,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC"}
@@ -1,4 +1,6 @@
1
1
  export declare const MASTRA_INTEGRATION_NAME: 'Mastra';
2
+ /** Cap on tracked spans, matching `MAX_TRACKED_PRISMA_SPANS`. Spans that never end would otherwise leak. */
3
+ export declare const MAX_TRACKED_MASTRA_SPANS = 1000;
2
4
  export declare const MASTRA_ORIGIN = "auto.ai.mastra";
3
5
  /** Not `sentry` — that is the community `@mastra/sentry` exporter name. */
4
6
  export declare const MASTRA_EXPORTER_NAME = "sentry-sdk";
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/ai/mastra/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,uBAAuB,EAAG,QAAiB,CAAC;AAEzD,eAAO,MAAM,aAAa,mBAAmB,CAAC;AAE9C,2EAA2E;AAC3E,eAAO,MAAM,oBAAoB,eAAe,CAAC;AAEjD,2DAA2D;AAC3D,eAAO,MAAM,qCAAqC,WAAW,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,qBAAqB,eAAuC,CAAC;AAE1E;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC,CASzF,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,MAAM,CAK9C,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAAiD,CAAC;AAEnG,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAA0D,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/ai/mastra/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,uBAAuB,EAAG,QAAiB,CAAC;AAEzD,4GAA4G;AAC5G,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAE7C,eAAO,MAAM,aAAa,mBAAmB,CAAC;AAE9C,2EAA2E;AAC3E,eAAO,MAAM,oBAAoB,eAAe,CAAC;AAEjD,2DAA2D;AAC3D,eAAO,MAAM,qCAAqC,WAAW,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,qBAAqB,eAAuC,CAAC;AAE1E;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC,CASzF,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,MAAM,CAK9C,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAAiD,CAAC;AAEnG,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAA0D,CAAC"}
@@ -30,6 +30,8 @@ export declare class SentryMastraExporter implements MastraObservabilityExporter
30
30
  private _onSpanStarted;
31
31
  /** Track a started span, ending any Sentry span that would otherwise be dropped without `end()`. */
32
32
  private _trackSpan;
33
+ /** Remove a tracked span and keep the id→span registry in lockstep. */
34
+ private _removeTracked;
33
35
  private _onSpanUpdated;
34
36
  private _onSpanEnded;
35
37
  /** Copy model/usage onto the parent agent so the AI Agents view shows totals. */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ai/mastra/index.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAWlD,OAAO,EAEL,qBAAqB,EAItB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAsB,2BAA2B,EAAkB,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAEnH,MAAM,MAAM,qBAAqB,GAAG,YAAY,CAAC;AAgBjD;;;;;GAKG;AACH,qBAAa,oBAAqB,YAAW,2BAA2B;IAC/D,IAAI,SAAwB;IAEnC,SAAgB,CAAC,qBAAqB,CAAC,QAAQ;IAE/C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6D;IACpF;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAwD;IACjF,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAwB;IAEjD,YAAmB,OAAO,GAAE,qBAA0B,EAErD;IAED,4DAA4D;IAC/C,kBAAkB,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAUxE;IAED,gEAAgE;IACnD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAElC;IAED,oEAAoE;IACvD,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAOrC;IAED,OAAO,CAAC,YAAY;IA8BpB,OAAO,CAAC,cAAc;IAoBtB,oGAAoG;IACpG,OAAO,CAAC,UAAU;IAelB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,YAAY;IAwBpB,iFAAiF;IACjF,OAAO,CAAC,oBAAoB;IAiB5B,mDAAmD;IACnD,OAAO,CAAC,gBAAgB;IAiBxB,OAAO,CAAC,cAAc;CAIvB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ai/mastra/index.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAWlD,OAAO,EAEL,qBAAqB,EAKtB,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAsB,2BAA2B,EAAkB,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAEnH,MAAM,MAAM,qBAAqB,GAAG,YAAY,CAAC;AAajD;;;;;GAKG;AACH,qBAAa,oBAAqB,YAAW,2BAA2B;IAC/D,IAAI,SAAwB;IAEnC,SAAgB,CAAC,qBAAqB,CAAC,QAAQ;IAE/C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6D;IACpF;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAwD;IACjF,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAwB;IAEjD,YAAmB,OAAO,GAAE,qBAA0B,EAErD;IAED,4DAA4D;IAC/C,kBAAkB,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAUxE;IAED,gEAAgE;IACnD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAElC;IAED,oEAAoE;IACvD,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAUrC;IAED,OAAO,CAAC,YAAY;IA8BpB,OAAO,CAAC,cAAc;IAoBtB,oGAAoG;IACpG,OAAO,CAAC,UAAU;IAiBlB,uEAAuE;IACvE,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,YAAY;IAwBpB,iFAAiF;IACjF,OAAO,CAAC,oBAAoB;IAiB5B,mDAAmD;IACnD,OAAO,CAAC,gBAAgB;IAiBxB,OAAO,CAAC,cAAc;CAIvB"}
@@ -0,0 +1,5 @@
1
+ import type { Span } from '@sentry/core';
2
+ export declare function registerMastraSpan(mastraId: string, span: Span): void;
3
+ export declare function unregisterMastraSpan(mastraId: string): void;
4
+ export declare function getSentrySpanForMastraId(mastraId: string): Span | undefined;
5
+ //# sourceMappingURL=span-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"span-registry.d.ts","sourceRoot":"","sources":["../../../../src/ai/mastra/span-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAezC,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CAErE;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAE3D;AAED,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAE3E"}
@@ -0,0 +1,30 @@
1
+ export declare const MISTRAL_INTEGRATION_NAME: 'Mistral';
2
+ export declare const MISTRAL_PROVIDER_NAME: 'mistralai';
3
+ export declare const MISTRAL_ORIGIN: 'auto.ai.mistralai';
4
+ export declare const MISTRAL_METHOD_REGISTRY: {
5
+ readonly 'chat.complete': {
6
+ readonly operation: 'chat';
7
+ };
8
+ readonly 'chat.stream': {
9
+ readonly operation: 'chat';
10
+ readonly streaming: true;
11
+ };
12
+ readonly 'chat.parse': {
13
+ readonly operation: 'chat';
14
+ };
15
+ readonly 'chat.parseStream': {
16
+ readonly operation: 'chat';
17
+ readonly streaming: true;
18
+ };
19
+ readonly 'embeddings.create': {
20
+ readonly operation: 'embeddings';
21
+ };
22
+ readonly 'agents.complete': {
23
+ readonly operation: 'invoke_agent';
24
+ };
25
+ readonly 'agents.stream': {
26
+ readonly operation: 'invoke_agent';
27
+ readonly streaming: true;
28
+ };
29
+ };
30
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/ai/mistral/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,wBAAwB,EAAG,SAAkB,CAAC;AAI3D,eAAO,MAAM,qBAAqB,EAAG,WAAoB,CAAC;AAE1D,eAAO,MAAM,cAAc,EAAG,mBAA4B,CAAC;AAO3D,eAAO,MAAM,uBAAuB;;iBACf,SAAS,EAAE,MAAM;;;iBACnB,SAAS,EAAE,MAAM;iBAAE,SAAS;;;iBAC7B,SAAS,EAAE,MAAM;;;iBACX,SAAS,EAAE,MAAM;iBAAE,SAAS;;;iBAC3B,SAAS,EAAE,YAAY;;;iBACzB,SAAS,EAAE,cAAc;;;iBAC3B,SAAS,EAAE,cAAc;iBAAE,SAAS;;CACV,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { Span } from '@sentry/core';
2
+ import type { MistralOptions } from './types';
3
+ /**
4
+ * Extract request attributes from method arguments.
5
+ *
6
+ * `streaming` comes from the called method, not the request: v2 streams only through the dedicated
7
+ * `*.stream` methods, and their `stream` request field is optional, so a params-derived value would
8
+ * be missing on most streaming calls.
9
+ */
10
+ export declare function extractRequestAttributes(args: unknown[], operationName: string, recordInputs: boolean, streaming: boolean): Record<string, unknown>;
11
+ /**
12
+ * Record AI request inputs on the span, if recording is enabled.
13
+ */
14
+ export declare function addRequestAttributes(span: Span, params: Record<string, unknown>, operationName: string): void;
15
+ /**
16
+ * Instrument a Mistral client with Sentry tracing.
17
+ * Can be used across Node.js, Cloudflare Workers, and Vercel Edge.
18
+ */
19
+ export declare function instrumentMistralAiClient<T extends object>(client: T, options?: MistralOptions): T;
20
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ai/mistral/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,IAAI,EAAsB,MAAM,cAAc,CAAC;AAqB7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAa9C;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,OAAO,EAAE,EACf,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,OAAO,EACrB,SAAS,EAAE,OAAO,GACjB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAwBzB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI,CAoB7G;AAsGD;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,CAAC,CAElG"}
@@ -0,0 +1,24 @@
1
+ import type { Span } from '@sentry/core';
2
+ type AsyncIterableStream = {
3
+ [Symbol.asyncIterator]: () => AsyncIterator<unknown>;
4
+ };
5
+ /** Whether a value can be drained with `for await`. */
6
+ export declare function isAsyncIterable(value: unknown): value is AsyncIterableStream;
7
+ /**
8
+ * Instrument a Mistral event stream in place: accumulate response attributes as it is drained and
9
+ * end `span` when it finishes.
10
+ *
11
+ * The stream is patched rather than replaced because `EventStream` extends `ReadableStream`, so
12
+ * handing back a bare async generator would drop `getReader`, `tee`, `pipeTo` and the rest of the
13
+ * `ReadableStream` API the caller is entitled to.
14
+ *
15
+ * Both `for await` and `getReader()` are valid ways to drain a `ReadableStream`, and the SDK's
16
+ * iterator polyfill reads through `getReader()`, so both are wrapped. The first path to see a chunk
17
+ * claims accumulation and the other stays a pass-through, which keeps a chunk from being counted
18
+ * twice when one path drives the other.
19
+ *
20
+ * Returns `false` for a value that is not a stream, leaving it untouched.
21
+ */
22
+ export declare function instrumentEventStream(stream: unknown, span: Span, recordOutputs: boolean): boolean;
23
+ export {};
24
+ //# sourceMappingURL=streaming.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["../../../../src/ai/mistral/streaming.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAwBzC,KAAK,mBAAmB,GAAG;IAAE,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,MAAM,aAAa,CAAC,OAAO,CAAC,CAAA;CAAE,CAAC;AAepF,uDAAuD;AACvD,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,mBAAmB,CAE5E;AAmLD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,GAAG,OAAO,CA4FlG"}
@@ -0,0 +1,39 @@
1
+ import type { GenAiOptions } from '../core/utils';
2
+ /** Options for the Mistral integration. */
3
+ export type MistralOptions = GenAiOptions;
4
+ /**
5
+ * A tool call as it appears in a response/stream delta. During streaming the `function.arguments`
6
+ * string arrives fragmented and is accumulated by `index`.
7
+ */
8
+ export interface MistralToolCall {
9
+ id?: string;
10
+ type?: string;
11
+ index?: number;
12
+ function?: {
13
+ name?: string;
14
+ arguments?: string;
15
+ };
16
+ }
17
+ /**
18
+ * A single streaming chunk. Field names are camelCase because the SDK deserializes the snake_case
19
+ * wire payload into typed objects before instrumentation sees them. Streaming APIs actually yield
20
+ * `CompletionEvent` objects that wrap this under `data`.
21
+ * @see https://docs.mistral.ai/api/#tag/chat/operation/stream_chat
22
+ */
23
+ export interface MistralCompletionChunk {
24
+ id: string;
25
+ model: string;
26
+ choices?: Array<{
27
+ delta?: {
28
+ content?: string | Array<unknown> | null;
29
+ toolCalls?: MistralToolCall[] | null;
30
+ };
31
+ finishReason?: string | null;
32
+ }>;
33
+ usage?: {
34
+ promptTokens?: number;
35
+ completionTokens?: number;
36
+ totalTokens?: number;
37
+ };
38
+ }
39
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ai/mistral/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,2CAA2C;AAC3C,MAAM,MAAM,cAAc,GAAG,YAAY,CAAC;AAE1C;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE;QACT,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAED;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,KAAK,CAAC;QACd,KAAK,CAAC,EAAE;YAAE,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;YAAC,SAAS,CAAC,EAAE,eAAe,EAAE,GAAG,IAAI,CAAA;SAAE,CAAC;QAC3F,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAC9B,CAAC,CAAC;IACH,KAAK,CAAC,EAAE;QACN,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CACH"}
@@ -0,0 +1,20 @@
1
+ import type { Span } from '@sentry/core';
2
+ /**
3
+ * Turn a Mistral message content (string or content-chunk array) into a plain string.
4
+ */
5
+ export declare function contentToString(content: unknown): string;
6
+ /**
7
+ * Build the span name for an instrumented Mistral call. Agent ids and a missing model are left out
8
+ * to keep the name low cardinality.
9
+ */
10
+ export declare function getSpanName(operationName: string, attributes: Record<string, unknown>): string;
11
+ /**
12
+ * Extract request parameters. Mistral request fields are camelCase.
13
+ */
14
+ export declare function extractRequestParameters(params: Record<string, unknown>): Record<string, unknown>;
15
+ /**
16
+ * Add response attributes to a span using duck-typing. Mistral responses are camelCase
17
+ * (`choices[].message`, `usage.promptTokens`), matching the SDK's deserialized objects.
18
+ */
19
+ export declare function addResponseAttributes(span: Span, result: unknown, recordOutputs?: boolean): void;
20
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/ai/mistral/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAsB,MAAM,cAAc,CAAC;AAqB7D;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAcxD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAQ9F;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAYjG;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,CAAC,EAAE,OAAO,GAAG,IAAI,CA8DhG"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ai/vercel-ai/index.ts"],"names":[],"mappings":"AAWA;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,gBAAgB,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAqExG;AAED;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,aAA2E,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ai/vercel-ai/index.ts"],"names":[],"mappings":"AAWA;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,gBAAgB,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAqExG;AAED;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,aAKpC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ai/workers-ai/index.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAiHhD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,CAAC,CAiBpG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ai/workers-ai/index.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAsGhD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,CAAC,CAiBpG"}
@@ -1,4 +1,6 @@
1
1
  import type { Span, SpanAttributeValue } from '@sentry/core';
2
+ import { setOutputMessagesAttribute } from '../core/utils';
3
+ export { setOutputMessagesAttribute };
2
4
  /**
3
5
  * Determine the gen_ai operation name from the inputs passed to `AI.run`.
4
6
  * Workers AI exposes a single `run` method, so we infer the operation from the input shape.
@@ -15,20 +17,6 @@ export declare function extractRequestAttributes(model: unknown, inputs: unknown
15
17
  * Only called when `recordInputs` is enabled.
16
18
  */
17
19
  export declare function addRequestAttributes(span: Span, inputs: unknown, operationName: string): void;
18
- /**
19
- * Build the `gen_ai.output.messages` value (a single assistant message with text and/or
20
- * tool-call parts) from the response text and tool calls.
21
- *
22
- * We set this in addition to the deprecated `gen_ai.response.text` / `gen_ai.response.tool_calls`
23
- * attributes because Sentry's product reads the model output from `gen_ai.output.messages` first.
24
- * Relay migrates `gen_ai.response.text` into `gen_ai.output.messages`, but the tool-calls half of
25
- * that migration is lossy — so tool-call turns would otherwise render an empty Output. Emitting the
26
- * normalized message here (mirroring the Vercel AI integration) keeps tool calls visible.
27
- */
28
- export declare function setOutputMessagesAttribute(span: Span, { responseText, toolCalls }: {
29
- responseText?: string;
30
- toolCalls?: unknown[];
31
- }): void;
32
20
  /**
33
21
  * Record the response attributes (token usage, response text, tool calls) on the span.
34
22
  */
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/ai/workers-ai/utils.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAM7D;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,YAAY,CAAC;AAE3D,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAAC,sBAAsB,EAAE,MAAM,CAGhF,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,OAAO,GAAG,sBAAsB,CAUxE;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,OAAO,EACf,aAAa,EAAE,MAAM,GACpB,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAmCpC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI,CA+B7F;AAED;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,IAAI,EACV,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE;IAAE,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,EAAE,CAAA;CAAE,GAC5E,IAAI,CAkCN;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,GAAG,IAAI,CAkC/F"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/ai/workers-ai/utils.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAA6B,0BAA0B,EAA2B,MAAM,eAAe,CAAC;AAE/G,OAAO,EAAE,0BAA0B,EAAE,CAAC;AAItC;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,YAAY,CAAC;AAE3D,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAAC,sBAAsB,EAAE,MAAM,CAGhF,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,OAAO,GAAG,sBAAsB,CAUxE;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,OAAO,EACf,aAAa,EAAE,MAAM,GACpB,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAmCpC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI,CA+B7F;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,GAAG,IAAI,CAkC/F"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * The subset of eve's hook context (`HookContext` from `eve/hooks`) this helper reads. Typed
3
+ * structurally rather than importing from `eve`, so the SDK carries no dependency on the framework —
4
+ * the shape is checked at the `defineHook(...)` call site in the user's app instead.
5
+ */
6
+ interface EveHookContext {
7
+ session: {
8
+ id: string;
9
+ };
10
+ }
11
+ type EveHookHandler = (event: unknown, context: EveHookContext) => void;
12
+ interface EveConversationHookOptions {
13
+ /**
14
+ * Derive the Sentry conversation id from the eve hook context. Defaults to the durable session id
15
+ * (`ctx.session.id`), which is stable across every turn of a session and so groups them into one
16
+ * conversation.
17
+ */
18
+ getConversationId?: (context: EveHookContext) => string | null | undefined;
19
+ }
20
+ /**
21
+ * Builds the hook definition for an eve `agent/hooks/*.ts` file that tags a session's AI spans with
22
+ * a Sentry conversation id, linking every turn of the session in the Agents "Conversations" view.
23
+ *
24
+ * ```ts
25
+ * // agent/hooks/sentry.ts
26
+ * import * as Sentry from '@sentry/node';
27
+ * import { defineHook } from 'eve/hooks';
28
+ *
29
+ * export default defineHook(Sentry.eveConversationHook());
30
+ * ```
31
+ *
32
+ * The id is set on the isolation scope; the default (always-on) `conversationIdIntegration` then
33
+ * stamps `gen_ai.conversation.id` onto the gen_ai spans the Vercel AI instrumentation records for
34
+ * that turn. That indirection is why the id has to be set here and not on the AI call: eve's session
35
+ * id never reaches the AI SDK's telemetry channel, so it can only be attached via the scope.
36
+ *
37
+ * Subscribes to both `turn.started` and `step.started`. Each eve turn is a fresh durable-workflow
38
+ * request with its own isolation scope, and a turn that parks and resumes (approvals, compaction)
39
+ * resumes in yet another request; `turn.started` alone would miss the model calls after a resume.
40
+ * `step.started` fires before every model call, so together they cover each request that produces
41
+ * spans. Re-setting the same id is idempotent, so the overlap is harmless.
42
+ */
43
+ export declare function eveConversationHook(options?: EveConversationHookOptions): {
44
+ events: Record<'turn.started' | 'step.started', EveHookHandler>;
45
+ };
46
+ /**
47
+ * Integration that handles tracing instrumentation of [eve](https://eve.dev) apps.
48
+ */
49
+ export declare const eveIntegration: () => import("@sentry/core").Integration & {
50
+ name: "Eve";
51
+ };
52
+ export {};
53
+ //# sourceMappingURL=eve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eve.d.ts","sourceRoot":"","sources":["../../src/eve.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,UAAU,cAAc;IACtB,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;CACzB;AAED,KAAK,cAAc,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;AAExE,UAAU,0BAA0B;IAClC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CAC5E;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,0BAA+B,GAAG;IAC7E,MAAM,EAAE,MAAM,CAAC,cAAc,GAAG,cAAc,EAAE,cAAc,CAAC,CAAC;CACjE,CAcA;AAED;;GAEG;AACH,eAAO,MAAM,cAAc;;CAOzB,CAAC"}
@@ -2,7 +2,7 @@ export { setHttpServerSpanRouteAttribute } from './utils/setHttpServerSpanRouteA
2
2
  export { setAsyncLocalStorageAsyncContextStrategy } from './async-context';
3
3
  export { openTelemetryIntegration, getOtlpTracesEndpoint } from './opentelemetry';
4
4
  export * from './ai';
5
- export { getSqlQuerySummary, sanitizeSqlQuery } from './utils/sql';
5
+ export { getSqlQuerySummary, sanitizeSqlQuery, sanitizeSqlQueryWithSummary } from './utils/sql';
6
6
  export type { SqlDialect } from './utils/sql';
7
7
  export { instrumentPostgresJsSql } from './integrations/postgresjs';
8
8
  export type { PostgresConnectionContext } from './integrations/postgresjs';
@@ -1 +1 @@
1
- {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../src/exports.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAC;AAC1F,OAAO,EAAE,wCAAwC,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAClF,cAAc,MAAM,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACnE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,YAAY,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../src/exports.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAC;AAC1F,OAAO,EAAE,wCAAwC,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAClF,cAAc,MAAM,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAChG,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,YAAY,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC"}
@@ -6,6 +6,8 @@ export { bindTracingChannelToSpan } from './tracing-channel';
6
6
  export type { TracingChannelPayloadWithSpan } from './tracing-channel';
7
7
  export type { InstrumentationConfig } from './orchestrion/apmTypes';
8
8
  export { orchestrionModuleInjected } from './utils/moduleInjected';
9
+ export { eveConversationHook, eveIntegration } from './eve';
10
+ export { getInstrumentedModuleNames } from './orchestrion/config';
9
11
  export { fastifyIntegration, setupFastifyErrorHandler, } from './integrations/fastify';
10
12
  /**
11
13
  * @deprecated This is a temporary export to avoid breaking changes. It will be removed in the next major version.
@@ -26,11 +28,17 @@ export { kafkaIntegration } from './integrations/kafkajs';
26
28
  export { knexIntegration } from './integrations/knex';
27
29
  export { langChainIntegration } from './integrations/langchain';
28
30
  export { langGraphIntegration } from './integrations/langgraph';
31
+ export { createFlueInstrumentation } from './ai/flue';
32
+ export { flueIntegration } from './integrations/flue';
33
+ export type { FlueOptions } from './ai/flue';
29
34
  export { mastraIntegration } from './integrations/mastra';
30
35
  export { SentryMastraExporter } from './ai/mastra';
31
36
  export { lruMemoizerIntegration } from './integrations/lru-memoizer';
32
37
  export { mongoIntegration } from './integrations/mongodb';
33
38
  export { mongooseIntegration } from './integrations/mongoose';
39
+ export { mistralAIIntegration } from './integrations/mistral';
40
+ export { groqIntegration } from './integrations/groq';
41
+ export { togetherAIIntegration } from './integrations/together-ai';
34
42
  export { mysqlIntegration } from './integrations/mysql';
35
43
  export { mysql2Integration } from './integrations/mysql2';
36
44
  export { openAIIntegration } from './integrations/openai';