braintrust 3.10.0 → 3.12.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 (78) hide show
  1. package/README.md +8 -8
  2. package/dev/dist/index.d.mts +51 -3
  3. package/dev/dist/index.d.ts +51 -3
  4. package/dev/dist/index.js +13138 -8915
  5. package/dev/dist/index.mjs +13015 -8792
  6. package/dist/apply-auto-instrumentation.browser.d.mts +2 -0
  7. package/dist/apply-auto-instrumentation.browser.d.ts +2 -0
  8. package/dist/apply-auto-instrumentation.browser.js +18 -0
  9. package/dist/apply-auto-instrumentation.browser.mjs +0 -0
  10. package/dist/apply-auto-instrumentation.d.mts +2 -0
  11. package/dist/apply-auto-instrumentation.d.ts +2 -0
  12. package/dist/apply-auto-instrumentation.js +2534 -0
  13. package/dist/apply-auto-instrumentation.mjs +2534 -0
  14. package/dist/auto-instrumentations/bundler/esbuild.cjs +1775 -737
  15. package/dist/auto-instrumentations/bundler/esbuild.d.mts +9 -5
  16. package/dist/auto-instrumentations/bundler/esbuild.d.ts +9 -5
  17. package/dist/auto-instrumentations/bundler/esbuild.mjs +10 -2
  18. package/dist/auto-instrumentations/bundler/next.cjs +3268 -0
  19. package/dist/auto-instrumentations/bundler/next.d.mts +3 -0
  20. package/dist/auto-instrumentations/bundler/next.d.ts +3 -0
  21. package/dist/auto-instrumentations/bundler/next.mjs +189 -0
  22. package/dist/auto-instrumentations/bundler/rollup.cjs +1775 -737
  23. package/dist/auto-instrumentations/bundler/rollup.d.mts +9 -5
  24. package/dist/auto-instrumentations/bundler/rollup.d.ts +9 -5
  25. package/dist/auto-instrumentations/bundler/rollup.mjs +10 -2
  26. package/dist/auto-instrumentations/bundler/vite.cjs +1775 -737
  27. package/dist/auto-instrumentations/bundler/vite.d.mts +9 -5
  28. package/dist/auto-instrumentations/bundler/vite.d.ts +9 -5
  29. package/dist/auto-instrumentations/bundler/vite.mjs +10 -2
  30. package/dist/auto-instrumentations/bundler/webpack-loader.cjs +1713 -690
  31. package/dist/auto-instrumentations/bundler/webpack-loader.d.ts +3 -3
  32. package/dist/auto-instrumentations/bundler/webpack.cjs +1775 -737
  33. package/dist/auto-instrumentations/bundler/webpack.d.mts +9 -5
  34. package/dist/auto-instrumentations/bundler/webpack.d.ts +9 -5
  35. package/dist/auto-instrumentations/bundler/webpack.mjs +6 -6
  36. package/dist/auto-instrumentations/{chunk-GZNXBBPU.mjs → chunk-2DPA74KK.mjs} +856 -5
  37. package/dist/auto-instrumentations/chunk-73BZUKVI.mjs +300 -0
  38. package/dist/auto-instrumentations/chunk-AFXRW7I7.mjs +18 -0
  39. package/dist/auto-instrumentations/{chunk-ITP7RAUY.mjs → chunk-MWZXZQUO.mjs} +23 -1
  40. package/dist/auto-instrumentations/hook.mjs +1912 -1125
  41. package/dist/auto-instrumentations/index.cjs +615 -4
  42. package/dist/auto-instrumentations/index.d.mts +18 -1
  43. package/dist/auto-instrumentations/index.d.ts +18 -1
  44. package/dist/auto-instrumentations/index.mjs +12 -247
  45. package/dist/auto-instrumentations/loader/cjs-patch.cjs +26 -1
  46. package/dist/auto-instrumentations/loader/cjs-patch.mjs +28 -1
  47. package/dist/auto-instrumentations/loader/esm-hook.mjs +35 -3
  48. package/dist/auto-instrumentations/plugin-D7nDswtC.d.mts +44 -0
  49. package/dist/auto-instrumentations/plugin-D7nDswtC.d.ts +44 -0
  50. package/dist/browser.d.mts +577 -287
  51. package/dist/browser.d.ts +577 -287
  52. package/dist/browser.js +10221 -5524
  53. package/dist/browser.mjs +10221 -5524
  54. package/dist/chunk-BW4DF4CY.js +816 -0
  55. package/dist/chunk-MSLBGITU.mjs +816 -0
  56. package/dist/cli.js +13143 -8892
  57. package/dist/edge-light.d.mts +1 -1
  58. package/dist/edge-light.d.ts +1 -1
  59. package/dist/edge-light.js +10221 -5524
  60. package/dist/edge-light.mjs +10221 -5524
  61. package/dist/index.d.mts +590 -300
  62. package/dist/index.d.ts +590 -300
  63. package/dist/index.js +9309 -5371
  64. package/dist/index.mjs +10340 -6402
  65. package/dist/instrumentation/index.d.mts +7863 -39
  66. package/dist/instrumentation/index.d.ts +7863 -39
  67. package/dist/instrumentation/index.js +10263 -6034
  68. package/dist/instrumentation/index.mjs +10262 -6034
  69. package/dist/workerd.d.mts +1 -1
  70. package/dist/workerd.d.ts +1 -1
  71. package/dist/workerd.js +10221 -5524
  72. package/dist/workerd.mjs +10221 -5524
  73. package/package.json +33 -19
  74. package/util/dist/index.js +6 -0
  75. package/util/dist/index.mjs +6 -0
  76. package/dist/auto-instrumentations/chunk-XWEQQOQH.mjs +0 -106
  77. package/dist/auto-instrumentations/plugin-Df3qKIl2.d.mts +0 -22
  78. package/dist/auto-instrumentations/plugin-Df3qKIl2.d.ts +0 -22
@@ -1,11 +1,75 @@
1
1
  import {
2
+ OPENAI_API_PROMISE_PATCH,
2
3
  getPackageName,
3
4
  getPackageVersion
4
- } from "./chunk-ITP7RAUY.mjs";
5
+ } from "./chunk-MWZXZQUO.mjs";
5
6
 
6
7
  // src/auto-instrumentations/hook.mts
7
8
  import { register } from "module";
8
9
 
10
+ // src/instrumentation/config.ts
11
+ var envIntegrationAliases = {
12
+ openai: "openai",
13
+ "openai-codex": "openaiCodexSDK",
14
+ "openai-codex-sdk": "openaiCodexSDK",
15
+ openaicodexsdk: "openaiCodexSDK",
16
+ codex: "openaiCodexSDK",
17
+ "codex-sdk": "openaiCodexSDK",
18
+ anthropic: "anthropic",
19
+ aisdk: "aisdk",
20
+ "ai-sdk": "aisdk",
21
+ "vercel-ai": "aisdk",
22
+ vercel: "vercel",
23
+ claudeagentsdk: "claudeAgentSDK",
24
+ "claude-agent-sdk": "claudeAgentSDK",
25
+ cursor: "cursor",
26
+ "cursor-sdk": "cursorSDK",
27
+ cursorsdk: "cursorSDK",
28
+ flue: "flue",
29
+ "flue-runtime": "flue",
30
+ "openai-agents": "openAIAgents",
31
+ openaiagents: "openAIAgents",
32
+ "openai-agents-core": "openAIAgents",
33
+ openaiagentscore: "openAIAgents",
34
+ google: "google",
35
+ "google-genai": "googleGenAI",
36
+ googlegenai: "googleGenAI",
37
+ huggingface: "huggingface",
38
+ openrouter: "openrouter",
39
+ openrouteragent: "openrouterAgent",
40
+ "openrouter-agent": "openrouterAgent",
41
+ mistral: "mistral",
42
+ googleadk: "googleADK",
43
+ "google-adk": "googleADK",
44
+ cohere: "cohere",
45
+ groq: "groq",
46
+ "groq-sdk": "groq",
47
+ genkit: "genkit",
48
+ "firebase-genkit": "genkit",
49
+ githubcopilot: "gitHubCopilot",
50
+ "github-copilot": "gitHubCopilot",
51
+ "copilot-sdk": "gitHubCopilot",
52
+ langchain: "langchain",
53
+ "langchain-js": "langchain",
54
+ "@langchain": "langchain",
55
+ langgraph: "langgraph"
56
+ };
57
+ function readDisabledInstrumentationEnvConfig(disabledList) {
58
+ const integrations = {};
59
+ if (disabledList) {
60
+ for (const value of disabledList.split(",")) {
61
+ const sdk = value.trim().toLowerCase();
62
+ if (sdk.length > 0) {
63
+ integrations[envIntegrationAliases[sdk] ?? sdk] = false;
64
+ }
65
+ }
66
+ }
67
+ return { integrations };
68
+ }
69
+ function isInstrumentationIntegrationDisabled(integrations, ...names) {
70
+ return names.some((name) => integrations?.[name] === false);
71
+ }
72
+
9
73
  // src/isomorph.ts
10
74
  var DefaultAsyncLocalStorage = class {
11
75
  constructor() {
@@ -149,705 +213,486 @@ function defineChannels(pkg, channels) {
149
213
  );
150
214
  }
151
215
 
152
- // src/instrumentation/plugins/openai-channels.ts
153
- var openAIChannels = defineChannels("openai", {
154
- chatCompletionsCreate: channel({
155
- channelName: "chat.completions.create",
216
+ // src/instrumentation/plugins/ai-sdk-channels.ts
217
+ var aiSDKChannels = defineChannels("ai", {
218
+ generateText: channel({
219
+ channelName: "generateText",
156
220
  kind: "async"
157
221
  }),
158
- embeddingsCreate: channel({
159
- channelName: "embeddings.create",
222
+ streamText: channel({
223
+ channelName: "streamText",
160
224
  kind: "async"
161
225
  }),
162
- betaChatCompletionsParse: channel({
163
- channelName: "beta.chat.completions.parse",
226
+ streamTextSync: channel({
227
+ channelName: "streamText.sync",
228
+ kind: "sync-stream"
229
+ }),
230
+ generateObject: channel({
231
+ channelName: "generateObject",
164
232
  kind: "async"
165
233
  }),
166
- betaChatCompletionsStream: channel({
167
- channelName: "beta.chat.completions.stream",
234
+ streamObject: channel({
235
+ channelName: "streamObject",
236
+ kind: "async"
237
+ }),
238
+ streamObjectSync: channel({
239
+ channelName: "streamObject.sync",
168
240
  kind: "sync-stream"
169
241
  }),
170
- moderationsCreate: channel({
171
- channelName: "moderations.create",
242
+ embed: channel(
243
+ {
244
+ channelName: "embed",
245
+ kind: "async"
246
+ }
247
+ ),
248
+ embedMany: channel({
249
+ channelName: "embedMany",
172
250
  kind: "async"
173
251
  }),
174
- responsesCreate: channel({
175
- channelName: "responses.create",
252
+ rerank: channel({
253
+ channelName: "rerank",
176
254
  kind: "async"
177
255
  }),
178
- responsesStream: channel({
179
- channelName: "responses.stream",
256
+ agentGenerate: channel({
257
+ channelName: "Agent.generate",
258
+ kind: "async"
259
+ }),
260
+ agentStream: channel({
261
+ channelName: "Agent.stream",
262
+ kind: "async"
263
+ }),
264
+ agentStreamSync: channel({
265
+ channelName: "Agent.stream.sync",
180
266
  kind: "sync-stream"
181
267
  }),
182
- responsesParse: channel({
183
- channelName: "responses.parse",
268
+ toolLoopAgentGenerate: channel({
269
+ channelName: "ToolLoopAgent.generate",
184
270
  kind: "async"
185
271
  }),
186
- responsesCompact: channel({
187
- channelName: "responses.compact",
272
+ toolLoopAgentStream: channel({
273
+ channelName: "ToolLoopAgent.stream",
188
274
  kind: "async"
189
275
  })
190
276
  });
191
277
 
192
- // src/auto-instrumentations/configs/openai.ts
193
- var openaiConfigs = [
194
- // Chat Completions
278
+ // src/auto-instrumentations/configs/ai-sdk.ts
279
+ var aiSDKConfigs = [
280
+ // generateText - async function
195
281
  {
196
- channelName: openAIChannels.chatCompletionsCreate.channelName,
282
+ channelName: aiSDKChannels.generateText.channelName,
197
283
  module: {
198
- name: "openai",
199
- versionRange: ">=4.0.0 <5.0.0",
200
- filePath: "resources/chat/completions.mjs"
284
+ name: "ai",
285
+ versionRange: ">=3.0.0",
286
+ filePath: "dist/index.mjs"
201
287
  },
202
288
  functionQuery: {
203
- className: "Completions",
204
- methodName: "create",
289
+ functionName: "generateText",
205
290
  kind: "Async"
206
291
  }
207
292
  },
208
293
  {
209
- channelName: openAIChannels.chatCompletionsCreate.channelName,
294
+ channelName: aiSDKChannels.generateText.channelName,
210
295
  module: {
211
- name: "openai",
212
- versionRange: ">=4.0.0 <5.0.0",
213
- filePath: "resources/chat/completions/completions.mjs"
296
+ name: "ai",
297
+ versionRange: ">=3.0.0",
298
+ filePath: "dist/index.js"
214
299
  },
215
300
  functionQuery: {
216
- className: "Completions",
217
- methodName: "create",
301
+ functionName: "generateText",
218
302
  kind: "Async"
219
303
  }
220
304
  },
305
+ // streamText - async function (v3 only, before the sync refactor in v4)
221
306
  {
222
- channelName: openAIChannels.chatCompletionsCreate.channelName,
307
+ channelName: aiSDKChannels.streamText.channelName,
223
308
  module: {
224
- name: "openai",
225
- versionRange: ">=5.0.0",
226
- filePath: "resources/chat/completions/completions.mjs"
309
+ name: "ai",
310
+ versionRange: ">=3.0.0 <4.0.0",
311
+ filePath: "dist/index.mjs"
227
312
  },
228
313
  functionQuery: {
229
- className: "Completions",
230
- methodName: "create",
314
+ functionName: "streamText",
231
315
  kind: "Async"
232
316
  }
233
317
  },
234
- // Embeddings
318
+ // streamText - sync function returning stream (v4+)
235
319
  {
236
- channelName: openAIChannels.embeddingsCreate.channelName,
320
+ channelName: aiSDKChannels.streamTextSync.channelName,
237
321
  module: {
238
- name: "openai",
322
+ name: "ai",
239
323
  versionRange: ">=4.0.0",
240
- filePath: "resources/embeddings.mjs"
324
+ filePath: "dist/index.mjs"
241
325
  },
242
326
  functionQuery: {
243
- className: "Embeddings",
244
- methodName: "create",
245
- kind: "Async"
327
+ functionName: "streamText",
328
+ kind: "Sync"
246
329
  }
247
330
  },
248
- // Beta Chat Completions Parse
249
331
  {
250
- channelName: openAIChannels.betaChatCompletionsParse.channelName,
332
+ channelName: aiSDKChannels.streamText.channelName,
251
333
  module: {
252
- name: "openai",
253
- versionRange: ">=4.0.0 <5.0.0",
254
- filePath: "resources/beta/chat/completions.mjs"
334
+ name: "ai",
335
+ versionRange: ">=3.0.0 <4.0.0",
336
+ filePath: "dist/index.js"
255
337
  },
256
338
  functionQuery: {
257
- className: "Completions",
258
- methodName: "parse",
339
+ functionName: "streamText",
259
340
  kind: "Async"
260
341
  }
261
342
  },
262
343
  {
263
- channelName: openAIChannels.betaChatCompletionsParse.channelName,
344
+ channelName: aiSDKChannels.streamTextSync.channelName,
264
345
  module: {
265
- name: "openai",
266
- versionRange: ">=5.0.0",
267
- filePath: "resources/chat/completions/completions.mjs"
346
+ name: "ai",
347
+ versionRange: ">=4.0.0",
348
+ filePath: "dist/index.js"
268
349
  },
269
350
  functionQuery: {
270
- className: "Completions",
271
- methodName: "parse",
351
+ functionName: "streamText",
352
+ kind: "Sync"
353
+ }
354
+ },
355
+ // generateObject - async function
356
+ {
357
+ channelName: aiSDKChannels.generateObject.channelName,
358
+ module: {
359
+ name: "ai",
360
+ versionRange: ">=3.0.0",
361
+ filePath: "dist/index.mjs"
362
+ },
363
+ functionQuery: {
364
+ functionName: "generateObject",
272
365
  kind: "Async"
273
366
  }
274
367
  },
275
- // Moderations
276
368
  {
277
- channelName: openAIChannels.moderationsCreate.channelName,
369
+ channelName: aiSDKChannels.generateObject.channelName,
278
370
  module: {
279
- name: "openai",
280
- versionRange: ">=4.0.0",
281
- filePath: "resources/moderations.mjs"
371
+ name: "ai",
372
+ versionRange: ">=3.0.0",
373
+ filePath: "dist/index.js"
282
374
  },
283
375
  functionQuery: {
284
- className: "Moderations",
285
- methodName: "create",
376
+ functionName: "generateObject",
286
377
  kind: "Async"
287
378
  }
288
379
  },
289
- // Beta Chat Completions Stream
380
+ // embed - async function
290
381
  {
291
- channelName: openAIChannels.betaChatCompletionsStream.channelName,
382
+ channelName: aiSDKChannels.embed.channelName,
292
383
  module: {
293
- name: "openai",
294
- versionRange: ">=4.0.0 <5.0.0",
295
- filePath: "resources/beta/chat/completions.mjs"
384
+ name: "ai",
385
+ versionRange: ">=3.0.0",
386
+ filePath: "dist/index.mjs"
296
387
  },
297
388
  functionQuery: {
298
- className: "Completions",
299
- methodName: "stream",
300
- kind: "Sync"
389
+ functionName: "embed",
390
+ kind: "Async"
301
391
  }
302
392
  },
303
393
  {
304
- channelName: openAIChannels.betaChatCompletionsStream.channelName,
394
+ channelName: aiSDKChannels.embed.channelName,
305
395
  module: {
306
- name: "openai",
307
- versionRange: ">=5.0.0",
308
- filePath: "resources/chat/completions/completions.mjs"
396
+ name: "ai",
397
+ versionRange: ">=3.0.0",
398
+ filePath: "dist/index.js"
309
399
  },
310
400
  functionQuery: {
311
- className: "Completions",
312
- methodName: "stream",
313
- kind: "Sync"
401
+ functionName: "embed",
402
+ kind: "Async"
314
403
  }
315
404
  },
316
- // Responses API (v4.87.0+)
405
+ // embedMany - async function
317
406
  {
318
- channelName: openAIChannels.responsesCreate.channelName,
407
+ channelName: aiSDKChannels.embedMany.channelName,
319
408
  module: {
320
- name: "openai",
321
- versionRange: ">=4.87.0",
322
- filePath: "resources/responses/responses.mjs"
409
+ name: "ai",
410
+ versionRange: ">=3.0.0",
411
+ filePath: "dist/index.mjs"
323
412
  },
324
413
  functionQuery: {
325
- className: "Responses",
326
- methodName: "create",
414
+ functionName: "embedMany",
327
415
  kind: "Async"
328
416
  }
329
417
  },
330
418
  {
331
- channelName: openAIChannels.responsesStream.channelName,
419
+ channelName: aiSDKChannels.embedMany.channelName,
332
420
  module: {
333
- name: "openai",
334
- versionRange: ">=4.87.0",
335
- filePath: "resources/responses/responses.mjs"
421
+ name: "ai",
422
+ versionRange: ">=3.0.0",
423
+ filePath: "dist/index.js"
336
424
  },
337
425
  functionQuery: {
338
- className: "Responses",
339
- methodName: "stream",
340
- kind: "Sync"
426
+ functionName: "embedMany",
427
+ kind: "Async"
341
428
  }
342
429
  },
430
+ // rerank - async function
343
431
  {
344
- channelName: openAIChannels.responsesParse.channelName,
432
+ channelName: aiSDKChannels.rerank.channelName,
345
433
  module: {
346
- name: "openai",
347
- versionRange: ">=4.87.0",
348
- filePath: "resources/responses/responses.mjs"
434
+ name: "ai",
435
+ versionRange: ">=5.0.0",
436
+ filePath: "dist/index.mjs"
349
437
  },
350
438
  functionQuery: {
351
- className: "Responses",
352
- methodName: "parse",
439
+ functionName: "rerank",
353
440
  kind: "Async"
354
441
  }
355
442
  },
356
443
  {
357
- channelName: openAIChannels.responsesCompact.channelName,
444
+ channelName: aiSDKChannels.rerank.channelName,
358
445
  module: {
359
- name: "openai",
360
- versionRange: ">=6.10.0",
361
- filePath: "resources/responses/responses.mjs"
446
+ name: "ai",
447
+ versionRange: ">=5.0.0",
448
+ filePath: "dist/index.js"
362
449
  },
363
450
  functionQuery: {
364
- className: "Responses",
365
- methodName: "compact",
366
- kind: "Async"
367
- }
368
- }
369
- ];
370
-
371
- // src/instrumentation/plugins/anthropic-channels.ts
372
- var anthropicChannels = defineChannels("@anthropic-ai/sdk", {
373
- messagesCreate: channel({
374
- channelName: "messages.create",
375
- kind: "async"
376
- }),
377
- betaMessagesCreate: channel({
378
- channelName: "beta.messages.create",
379
- kind: "async"
380
- }),
381
- betaMessagesToolRunner: channel({
382
- channelName: "beta.messages.toolRunner",
383
- kind: "sync-stream"
384
- })
385
- });
386
-
387
- // src/auto-instrumentations/configs/anthropic.ts
388
- var anthropicConfigs = [
389
- // Messages API - create in older SDK layouts (supports streaming via stream=true parameter)
390
- {
391
- channelName: anthropicChannels.messagesCreate.channelName,
392
- module: {
393
- name: "@anthropic-ai/sdk",
394
- versionRange: ">=0.27.0 <0.39.0",
395
- filePath: "resources/messages.mjs"
396
- },
397
- functionQuery: {
398
- className: "Messages",
399
- methodName: "create",
400
- kind: "Async"
401
- }
402
- },
403
- // Messages API - create (supports streaming via stream=true parameter)
404
- {
405
- channelName: anthropicChannels.messagesCreate.channelName,
406
- module: {
407
- name: "@anthropic-ai/sdk",
408
- versionRange: ">=0.39.0",
409
- filePath: "resources/messages/messages.mjs"
410
- },
411
- functionQuery: {
412
- className: "Messages",
413
- methodName: "create",
414
- kind: "Async"
415
- }
416
- },
417
- // Beta Messages API - create (supports streaming via stream=true parameter)
418
- {
419
- channelName: anthropicChannels.betaMessagesCreate.channelName,
420
- module: {
421
- name: "@anthropic-ai/sdk",
422
- versionRange: ">=0.39.0",
423
- filePath: "resources/beta/messages/messages.mjs"
424
- },
425
- functionQuery: {
426
- className: "Messages",
427
- methodName: "create",
451
+ functionName: "rerank",
428
452
  kind: "Async"
429
453
  }
430
454
  },
431
- // Beta Messages API - toolRunner (sync helper returning async iterable/thenable)
432
- {
433
- channelName: anthropicChannels.betaMessagesToolRunner.channelName,
434
- module: {
435
- name: "@anthropic-ai/sdk",
436
- versionRange: ">=0.39.0",
437
- filePath: "resources/beta/messages/messages.mjs"
438
- },
439
- functionQuery: {
440
- className: "Messages",
441
- methodName: "toolRunner",
442
- kind: "Sync"
443
- }
444
- }
445
- ];
446
-
447
- // src/instrumentation/plugins/ai-sdk-channels.ts
448
- var aiSDKChannels = defineChannels("ai", {
449
- generateText: channel({
450
- channelName: "generateText",
451
- kind: "async"
452
- }),
453
- streamText: channel({
454
- channelName: "streamText",
455
- kind: "async"
456
- }),
457
- streamTextSync: channel({
458
- channelName: "streamText.sync",
459
- kind: "sync-stream"
460
- }),
461
- generateObject: channel({
462
- channelName: "generateObject",
463
- kind: "async"
464
- }),
465
- streamObject: channel({
466
- channelName: "streamObject",
467
- kind: "async"
468
- }),
469
- streamObjectSync: channel({
470
- channelName: "streamObject.sync",
471
- kind: "sync-stream"
472
- }),
473
- embed: channel(
474
- {
475
- channelName: "embed",
476
- kind: "async"
477
- }
478
- ),
479
- embedMany: channel({
480
- channelName: "embedMany",
481
- kind: "async"
482
- }),
483
- rerank: channel({
484
- channelName: "rerank",
485
- kind: "async"
486
- }),
487
- agentGenerate: channel({
488
- channelName: "Agent.generate",
489
- kind: "async"
490
- }),
491
- agentStream: channel({
492
- channelName: "Agent.stream",
493
- kind: "async"
494
- }),
495
- agentStreamSync: channel({
496
- channelName: "Agent.stream.sync",
497
- kind: "sync-stream"
498
- }),
499
- toolLoopAgentGenerate: channel({
500
- channelName: "ToolLoopAgent.generate",
501
- kind: "async"
502
- }),
503
- toolLoopAgentStream: channel({
504
- channelName: "ToolLoopAgent.stream",
505
- kind: "async"
506
- })
507
- });
508
-
509
- // src/auto-instrumentations/configs/ai-sdk.ts
510
- var aiSDKConfigs = [
511
- // generateText - async function
455
+ // streamObject - async function (v3 only, before the sync refactor in v4)
512
456
  {
513
- channelName: aiSDKChannels.generateText.channelName,
457
+ channelName: aiSDKChannels.streamObject.channelName,
514
458
  module: {
515
459
  name: "ai",
516
- versionRange: ">=3.0.0",
460
+ versionRange: ">=3.0.0 <4.0.0",
517
461
  filePath: "dist/index.mjs"
518
462
  },
519
463
  functionQuery: {
520
- functionName: "generateText",
464
+ functionName: "streamObject",
521
465
  kind: "Async"
522
466
  }
523
467
  },
468
+ // streamObject - sync function returning stream (v4+)
524
469
  {
525
- channelName: aiSDKChannels.generateText.channelName,
470
+ channelName: aiSDKChannels.streamObjectSync.channelName,
526
471
  module: {
527
472
  name: "ai",
528
- versionRange: ">=3.0.0",
529
- filePath: "dist/index.js"
473
+ versionRange: ">=4.0.0",
474
+ filePath: "dist/index.mjs"
530
475
  },
531
476
  functionQuery: {
532
- functionName: "generateText",
533
- kind: "Async"
477
+ functionName: "streamObject",
478
+ kind: "Sync"
534
479
  }
535
480
  },
536
- // streamText - async function (v3 only, before the sync refactor in v4)
537
481
  {
538
- channelName: aiSDKChannels.streamText.channelName,
482
+ channelName: aiSDKChannels.streamObject.channelName,
539
483
  module: {
540
484
  name: "ai",
541
485
  versionRange: ">=3.0.0 <4.0.0",
542
- filePath: "dist/index.mjs"
486
+ filePath: "dist/index.js"
543
487
  },
544
488
  functionQuery: {
545
- functionName: "streamText",
489
+ functionName: "streamObject",
546
490
  kind: "Async"
547
491
  }
548
492
  },
549
- // streamText - sync function returning stream (v4+)
550
493
  {
551
- channelName: aiSDKChannels.streamTextSync.channelName,
494
+ channelName: aiSDKChannels.streamObjectSync.channelName,
552
495
  module: {
553
496
  name: "ai",
554
497
  versionRange: ">=4.0.0",
555
- filePath: "dist/index.mjs"
498
+ filePath: "dist/index.js"
556
499
  },
557
500
  functionQuery: {
558
- functionName: "streamText",
501
+ functionName: "streamObject",
559
502
  kind: "Sync"
560
503
  }
561
504
  },
505
+ // Agent.generate - async method (v5 only)
506
+ // The compiled AI SDK bundle emits this as an anonymous class method, so we
507
+ // target the first async `generate` method in the file instead of a class name.
562
508
  {
563
- channelName: aiSDKChannels.streamText.channelName,
509
+ channelName: aiSDKChannels.agentGenerate.channelName,
564
510
  module: {
565
511
  name: "ai",
566
- versionRange: ">=3.0.0 <4.0.0",
567
- filePath: "dist/index.js"
512
+ versionRange: ">=5.0.0 <6.0.0",
513
+ filePath: "dist/index.mjs"
568
514
  },
569
515
  functionQuery: {
570
- functionName: "streamText",
571
- kind: "Async"
516
+ methodName: "generate",
517
+ kind: "Async",
518
+ index: 0
572
519
  }
573
520
  },
574
521
  {
575
- channelName: aiSDKChannels.streamTextSync.channelName,
522
+ channelName: aiSDKChannels.agentGenerate.channelName,
576
523
  module: {
577
524
  name: "ai",
578
- versionRange: ">=4.0.0",
525
+ versionRange: ">=5.0.0 <6.0.0",
579
526
  filePath: "dist/index.js"
580
527
  },
581
528
  functionQuery: {
582
- functionName: "streamText",
583
- kind: "Sync"
529
+ methodName: "generate",
530
+ kind: "Async",
531
+ index: 0
584
532
  }
585
533
  },
586
- // generateObject - async function
534
+ // Agent.stream - sync method (v5 only)
535
+ // The compiled AI SDK bundle emits this as an anonymous class method, so we
536
+ // target the first sync `stream` method in the file instead of a class name.
587
537
  {
588
- channelName: aiSDKChannels.generateObject.channelName,
538
+ channelName: aiSDKChannels.agentStreamSync.channelName,
589
539
  module: {
590
540
  name: "ai",
591
- versionRange: ">=3.0.0",
541
+ versionRange: ">=5.0.0 <6.0.0",
592
542
  filePath: "dist/index.mjs"
593
543
  },
594
544
  functionQuery: {
595
- functionName: "generateObject",
596
- kind: "Async"
545
+ methodName: "stream",
546
+ kind: "Sync",
547
+ index: 0
597
548
  }
598
549
  },
599
550
  {
600
- channelName: aiSDKChannels.generateObject.channelName,
551
+ channelName: aiSDKChannels.agentStreamSync.channelName,
601
552
  module: {
602
553
  name: "ai",
603
- versionRange: ">=3.0.0",
554
+ versionRange: ">=5.0.0 <6.0.0",
604
555
  filePath: "dist/index.js"
605
556
  },
606
557
  functionQuery: {
607
- functionName: "generateObject",
608
- kind: "Async"
558
+ methodName: "stream",
559
+ kind: "Sync",
560
+ index: 0
609
561
  }
610
562
  },
611
- // embed - async function
563
+ // ToolLoopAgent.generate - async method (v6 only, Experimental_Agent is an alias)
564
+ // The compiled AI SDK bundle emits this as an anonymous class method, so we
565
+ // target the first async `generate` method in the file instead of a class name.
612
566
  {
613
- channelName: aiSDKChannels.embed.channelName,
567
+ channelName: aiSDKChannels.toolLoopAgentGenerate.channelName,
614
568
  module: {
615
569
  name: "ai",
616
- versionRange: ">=3.0.0",
570
+ versionRange: ">=6.0.0 <7.0.0",
617
571
  filePath: "dist/index.mjs"
618
572
  },
619
573
  functionQuery: {
620
- functionName: "embed",
621
- kind: "Async"
574
+ methodName: "generate",
575
+ kind: "Async",
576
+ index: 0
622
577
  }
623
578
  },
624
579
  {
625
- channelName: aiSDKChannels.embed.channelName,
580
+ channelName: aiSDKChannels.toolLoopAgentGenerate.channelName,
626
581
  module: {
627
582
  name: "ai",
628
- versionRange: ">=3.0.0",
583
+ versionRange: ">=6.0.0 <7.0.0",
629
584
  filePath: "dist/index.js"
630
585
  },
631
586
  functionQuery: {
632
- functionName: "embed",
633
- kind: "Async"
587
+ methodName: "generate",
588
+ kind: "Async",
589
+ index: 0
634
590
  }
635
591
  },
636
- // embedMany - async function
592
+ // ToolLoopAgent.stream - async method (v6 only, Experimental_Agent is an alias)
593
+ // The compiled AI SDK bundle emits this as an anonymous class method, so we
594
+ // target the first async `stream` method in the file instead of a class name.
637
595
  {
638
- channelName: aiSDKChannels.embedMany.channelName,
596
+ channelName: aiSDKChannels.toolLoopAgentStream.channelName,
639
597
  module: {
640
598
  name: "ai",
641
- versionRange: ">=3.0.0",
599
+ versionRange: ">=6.0.0 <7.0.0",
642
600
  filePath: "dist/index.mjs"
643
601
  },
644
602
  functionQuery: {
645
- functionName: "embedMany",
646
- kind: "Async"
603
+ methodName: "stream",
604
+ kind: "Async",
605
+ index: 0
647
606
  }
648
607
  },
649
608
  {
650
- channelName: aiSDKChannels.embedMany.channelName,
609
+ channelName: aiSDKChannels.toolLoopAgentStream.channelName,
651
610
  module: {
652
611
  name: "ai",
653
- versionRange: ">=3.0.0",
612
+ versionRange: ">=6.0.0 <7.0.0",
654
613
  filePath: "dist/index.js"
655
614
  },
656
615
  functionQuery: {
657
- functionName: "embedMany",
658
- kind: "Async"
616
+ methodName: "stream",
617
+ kind: "Async",
618
+ index: 0
659
619
  }
660
- },
661
- // rerank - async function
662
- {
663
- channelName: aiSDKChannels.rerank.channelName,
664
- module: {
665
- name: "ai",
666
- versionRange: ">=5.0.0",
667
- filePath: "dist/index.mjs"
668
- },
669
- functionQuery: {
670
- functionName: "rerank",
671
- kind: "Async"
672
- }
673
- },
620
+ }
621
+ ];
622
+
623
+ // src/instrumentation/plugins/anthropic-channels.ts
624
+ var anthropicChannels = defineChannels("@anthropic-ai/sdk", {
625
+ messagesCreate: channel({
626
+ channelName: "messages.create",
627
+ kind: "async"
628
+ }),
629
+ betaMessagesCreate: channel({
630
+ channelName: "beta.messages.create",
631
+ kind: "async"
632
+ }),
633
+ betaMessagesToolRunner: channel({
634
+ channelName: "beta.messages.toolRunner",
635
+ kind: "sync-stream"
636
+ })
637
+ });
638
+
639
+ // src/auto-instrumentations/configs/anthropic.ts
640
+ var anthropicConfigs = [
641
+ // Messages API - create in older SDK layouts (supports streaming via stream=true parameter)
674
642
  {
675
- channelName: aiSDKChannels.rerank.channelName,
643
+ channelName: anthropicChannels.messagesCreate.channelName,
676
644
  module: {
677
- name: "ai",
678
- versionRange: ">=5.0.0",
679
- filePath: "dist/index.js"
645
+ name: "@anthropic-ai/sdk",
646
+ versionRange: ">=0.27.0 <0.39.0",
647
+ filePath: "resources/messages.mjs"
680
648
  },
681
649
  functionQuery: {
682
- functionName: "rerank",
650
+ className: "Messages",
651
+ methodName: "create",
683
652
  kind: "Async"
684
653
  }
685
654
  },
686
- // streamObject - async function (v3 only, before the sync refactor in v4)
655
+ // Messages API - create (supports streaming via stream=true parameter)
687
656
  {
688
- channelName: aiSDKChannels.streamObject.channelName,
657
+ channelName: anthropicChannels.messagesCreate.channelName,
689
658
  module: {
690
- name: "ai",
691
- versionRange: ">=3.0.0 <4.0.0",
692
- filePath: "dist/index.mjs"
659
+ name: "@anthropic-ai/sdk",
660
+ versionRange: ">=0.39.0",
661
+ filePath: "resources/messages/messages.mjs"
693
662
  },
694
663
  functionQuery: {
695
- functionName: "streamObject",
664
+ className: "Messages",
665
+ methodName: "create",
696
666
  kind: "Async"
697
667
  }
698
668
  },
699
- // streamObject - sync function returning stream (v4+)
700
- {
701
- channelName: aiSDKChannels.streamObjectSync.channelName,
702
- module: {
703
- name: "ai",
704
- versionRange: ">=4.0.0",
705
- filePath: "dist/index.mjs"
706
- },
707
- functionQuery: {
708
- functionName: "streamObject",
709
- kind: "Sync"
710
- }
711
- },
669
+ // Beta Messages API - create (supports streaming via stream=true parameter)
712
670
  {
713
- channelName: aiSDKChannels.streamObject.channelName,
671
+ channelName: anthropicChannels.betaMessagesCreate.channelName,
714
672
  module: {
715
- name: "ai",
716
- versionRange: ">=3.0.0 <4.0.0",
717
- filePath: "dist/index.js"
673
+ name: "@anthropic-ai/sdk",
674
+ versionRange: ">=0.39.0",
675
+ filePath: "resources/beta/messages/messages.mjs"
718
676
  },
719
677
  functionQuery: {
720
- functionName: "streamObject",
678
+ className: "Messages",
679
+ methodName: "create",
721
680
  kind: "Async"
722
681
  }
723
682
  },
683
+ // Beta Messages API - toolRunner (sync helper returning async iterable/thenable)
724
684
  {
725
- channelName: aiSDKChannels.streamObjectSync.channelName,
685
+ channelName: anthropicChannels.betaMessagesToolRunner.channelName,
726
686
  module: {
727
- name: "ai",
728
- versionRange: ">=4.0.0",
729
- filePath: "dist/index.js"
687
+ name: "@anthropic-ai/sdk",
688
+ versionRange: ">=0.39.0",
689
+ filePath: "resources/beta/messages/messages.mjs"
730
690
  },
731
691
  functionQuery: {
732
- functionName: "streamObject",
692
+ className: "Messages",
693
+ methodName: "toolRunner",
733
694
  kind: "Sync"
734
695
  }
735
- },
736
- // Agent.generate - async method (v5 only)
737
- // The compiled AI SDK bundle emits this as an anonymous class method, so we
738
- // target the first async `generate` method in the file instead of a class name.
739
- {
740
- channelName: aiSDKChannels.agentGenerate.channelName,
741
- module: {
742
- name: "ai",
743
- versionRange: ">=5.0.0 <6.0.0",
744
- filePath: "dist/index.mjs"
745
- },
746
- functionQuery: {
747
- methodName: "generate",
748
- kind: "Async",
749
- index: 0
750
- }
751
- },
752
- {
753
- channelName: aiSDKChannels.agentGenerate.channelName,
754
- module: {
755
- name: "ai",
756
- versionRange: ">=5.0.0 <6.0.0",
757
- filePath: "dist/index.js"
758
- },
759
- functionQuery: {
760
- methodName: "generate",
761
- kind: "Async",
762
- index: 0
763
- }
764
- },
765
- // Agent.stream - sync method (v5 only)
766
- // The compiled AI SDK bundle emits this as an anonymous class method, so we
767
- // target the first sync `stream` method in the file instead of a class name.
768
- {
769
- channelName: aiSDKChannels.agentStreamSync.channelName,
770
- module: {
771
- name: "ai",
772
- versionRange: ">=5.0.0 <6.0.0",
773
- filePath: "dist/index.mjs"
774
- },
775
- functionQuery: {
776
- methodName: "stream",
777
- kind: "Sync",
778
- index: 0
779
- }
780
- },
781
- {
782
- channelName: aiSDKChannels.agentStreamSync.channelName,
783
- module: {
784
- name: "ai",
785
- versionRange: ">=5.0.0 <6.0.0",
786
- filePath: "dist/index.js"
787
- },
788
- functionQuery: {
789
- methodName: "stream",
790
- kind: "Sync",
791
- index: 0
792
- }
793
- },
794
- // ToolLoopAgent.generate - async method (v6 only, Experimental_Agent is an alias)
795
- // The compiled AI SDK bundle emits this as an anonymous class method, so we
796
- // target the first async `generate` method in the file instead of a class name.
797
- {
798
- channelName: aiSDKChannels.toolLoopAgentGenerate.channelName,
799
- module: {
800
- name: "ai",
801
- versionRange: ">=6.0.0 <7.0.0",
802
- filePath: "dist/index.mjs"
803
- },
804
- functionQuery: {
805
- methodName: "generate",
806
- kind: "Async",
807
- index: 0
808
- }
809
- },
810
- {
811
- channelName: aiSDKChannels.toolLoopAgentGenerate.channelName,
812
- module: {
813
- name: "ai",
814
- versionRange: ">=6.0.0 <7.0.0",
815
- filePath: "dist/index.js"
816
- },
817
- functionQuery: {
818
- methodName: "generate",
819
- kind: "Async",
820
- index: 0
821
- }
822
- },
823
- // ToolLoopAgent.stream - async method (v6 only, Experimental_Agent is an alias)
824
- // The compiled AI SDK bundle emits this as an anonymous class method, so we
825
- // target the first async `stream` method in the file instead of a class name.
826
- {
827
- channelName: aiSDKChannels.toolLoopAgentStream.channelName,
828
- module: {
829
- name: "ai",
830
- versionRange: ">=6.0.0 <7.0.0",
831
- filePath: "dist/index.mjs"
832
- },
833
- functionQuery: {
834
- methodName: "stream",
835
- kind: "Async",
836
- index: 0
837
- }
838
- },
839
- {
840
- channelName: aiSDKChannels.toolLoopAgentStream.channelName,
841
- module: {
842
- name: "ai",
843
- versionRange: ">=6.0.0 <7.0.0",
844
- filePath: "dist/index.js"
845
- },
846
- functionQuery: {
847
- methodName: "stream",
848
- kind: "Async",
849
- index: 0
850
- }
851
696
  }
852
697
  ];
853
698
 
@@ -893,766 +738,709 @@ var claudeAgentSDKConfigs = [
893
738
  }
894
739
  ];
895
740
 
896
- // src/instrumentation/plugins/cursor-sdk-channels.ts
897
- var cursorSDKChannels = defineChannels("@cursor/sdk", {
898
- create: channel({
899
- channelName: "Agent.create",
741
+ // src/instrumentation/plugins/cohere-channels.ts
742
+ var cohereChannels = defineChannels("cohere-ai", {
743
+ chat: channel({
744
+ channelName: "chat",
900
745
  kind: "async"
901
746
  }),
902
- resume: channel({
903
- channelName: "Agent.resume",
747
+ chatStream: channel({
748
+ channelName: "chatStream",
904
749
  kind: "async"
905
750
  }),
906
- prompt: channel({
907
- channelName: "Agent.prompt",
751
+ embed: channel({
752
+ channelName: "embed",
908
753
  kind: "async"
909
754
  }),
910
- send: channel({
911
- channelName: "agent.send",
755
+ rerank: channel({
756
+ channelName: "rerank",
912
757
  kind: "async"
913
758
  })
914
759
  });
915
760
 
916
- // src/auto-instrumentations/configs/cursor-sdk.ts
917
- var cursorSDKVersionRange = ">=1.0.7 <2.0.0";
918
- var cursorSDKEntrypoints = ["dist/esm/index.js", "dist/cjs/index.js"];
919
- var cursorSDKConfigs = cursorSDKEntrypoints.flatMap((filePath) => [
761
+ // src/auto-instrumentations/configs/cohere.ts
762
+ var cohereConfigs = [
920
763
  {
921
- channelName: cursorSDKChannels.create.channelName,
764
+ channelName: cohereChannels.chat.channelName,
922
765
  module: {
923
- name: "@cursor/sdk",
924
- versionRange: cursorSDKVersionRange,
925
- filePath
766
+ name: "cohere-ai",
767
+ versionRange: ">=7.0.0 <8.0.0",
768
+ filePath: "Client.js"
926
769
  },
927
770
  functionQuery: {
928
- className: "Agent",
929
- methodName: "create",
771
+ className: "CohereClient",
772
+ methodName: "chat",
930
773
  kind: "Async"
931
774
  }
932
775
  },
933
776
  {
934
- channelName: cursorSDKChannels.resume.channelName,
777
+ channelName: cohereChannels.chat.channelName,
935
778
  module: {
936
- name: "@cursor/sdk",
937
- versionRange: cursorSDKVersionRange,
938
- filePath
939
- },
779
+ name: "cohere-ai",
780
+ versionRange: ">=7.0.0 <7.21.0",
781
+ filePath: "api/resources/v2/client/Client.js"
782
+ },
940
783
  functionQuery: {
941
- className: "Agent",
942
- methodName: "resume",
784
+ className: "V2",
785
+ methodName: "chat",
943
786
  kind: "Async"
944
787
  }
945
788
  },
946
789
  {
947
- channelName: cursorSDKChannels.prompt.channelName,
790
+ channelName: cohereChannels.chat.channelName,
948
791
  module: {
949
- name: "@cursor/sdk",
950
- versionRange: cursorSDKVersionRange,
951
- filePath
792
+ name: "cohere-ai",
793
+ versionRange: ">=7.21.0 <8.0.0",
794
+ filePath: "api/resources/v2/client/Client.js"
952
795
  },
953
796
  functionQuery: {
954
- className: "Agent",
955
- methodName: "prompt",
797
+ className: "V2Client",
798
+ methodName: "chat",
956
799
  kind: "Async"
957
800
  }
958
- }
959
- ]);
960
-
961
- // src/instrumentation/plugins/google-genai-channels.ts
962
- var googleGenAIChannels = defineChannels("@google/genai", {
963
- generateContent: channel({
964
- channelName: "models.generateContent",
965
- kind: "async"
966
- }),
967
- generateContentStream: channel({
968
- channelName: "models.generateContentStream",
969
- kind: "async"
970
- }),
971
- embedContent: channel({
972
- channelName: "models.embedContent",
973
- kind: "async"
974
- })
975
- });
976
-
977
- // src/auto-instrumentations/configs/google-genai.ts
978
- var googleGenAIConfigs = [
979
- // Models.generateContentInternal - The actual class method (Node.js entry point)
980
- // Note: generateContent is an arrow function property that calls this internal method
801
+ },
981
802
  {
982
- channelName: googleGenAIChannels.generateContent.channelName,
803
+ channelName: cohereChannels.chat.channelName,
983
804
  module: {
984
- name: "@google/genai",
985
- versionRange: ">=1.0.0",
986
- filePath: "dist/node/index.mjs"
805
+ name: "cohere-ai",
806
+ versionRange: ">=8.0.0 <9.0.0",
807
+ filePath: "Client.js"
987
808
  },
988
809
  functionQuery: {
989
- className: "Models",
990
- methodName: "generateContentInternal",
810
+ className: "CohereClient",
811
+ methodName: "chat",
991
812
  kind: "Async"
992
813
  }
993
814
  },
994
- // Models.generateContentStreamInternal - The actual class method (Node.js entry point)
995
- // Note: generateContentStream is an arrow function property that calls this internal method
996
815
  {
997
- channelName: googleGenAIChannels.generateContentStream.channelName,
816
+ channelName: cohereChannels.chat.channelName,
998
817
  module: {
999
- name: "@google/genai",
1000
- versionRange: ">=1.0.0",
1001
- filePath: "dist/node/index.mjs"
818
+ name: "cohere-ai",
819
+ versionRange: ">=8.0.0 <9.0.0",
820
+ filePath: "api/resources/v2/client/Client.js"
1002
821
  },
1003
822
  functionQuery: {
1004
- className: "Models",
1005
- methodName: "generateContentStreamInternal",
823
+ className: "V2Client",
824
+ methodName: "chat",
1006
825
  kind: "Async"
1007
826
  }
1008
827
  },
1009
- // Models.embedContent - class method in older SDK versions
1010
828
  {
1011
- channelName: googleGenAIChannels.embedContent.channelName,
829
+ channelName: cohereChannels.chatStream.channelName,
1012
830
  module: {
1013
- name: "@google/genai",
1014
- versionRange: ">=1.0.0 <1.44.0",
1015
- filePath: "dist/node/index.mjs"
831
+ name: "cohere-ai",
832
+ versionRange: ">=7.0.0 <8.0.0",
833
+ filePath: "Client.js"
1016
834
  },
1017
835
  functionQuery: {
1018
- className: "Models",
1019
- methodName: "embedContent",
836
+ className: "CohereClient",
837
+ methodName: "chatStream",
1020
838
  kind: "Async"
1021
839
  }
1022
840
  },
1023
- // Models.embedContentInternal - class method in newer SDK versions
1024
- // Note: embedContent is an arrow function property that calls this method
1025
841
  {
1026
- channelName: googleGenAIChannels.embedContent.channelName,
842
+ channelName: cohereChannels.chatStream.channelName,
1027
843
  module: {
1028
- name: "@google/genai",
1029
- versionRange: ">=1.44.0",
1030
- filePath: "dist/node/index.mjs"
844
+ name: "cohere-ai",
845
+ versionRange: ">=7.0.0 <7.21.0",
846
+ filePath: "api/resources/v2/client/Client.js"
1031
847
  },
1032
848
  functionQuery: {
1033
- className: "Models",
1034
- methodName: "embedContentInternal",
849
+ className: "V2",
850
+ methodName: "chatStream",
1035
851
  kind: "Async"
1036
852
  }
1037
- }
1038
- ];
1039
-
1040
- // src/instrumentation/plugins/huggingface-channels.ts
1041
- var huggingFaceChannels = defineChannels("@huggingface/inference", {
1042
- chatCompletion: channel({
1043
- channelName: "chatCompletion",
1044
- kind: "async"
1045
- }),
1046
- chatCompletionStream: channel({
1047
- channelName: "chatCompletionStream",
1048
- kind: "sync-stream"
1049
- }),
1050
- textGeneration: channel({
1051
- channelName: "textGeneration",
1052
- kind: "async"
1053
- }),
1054
- textGenerationStream: channel({
1055
- channelName: "textGenerationStream",
1056
- kind: "sync-stream"
1057
- }),
1058
- featureExtraction: channel({
1059
- channelName: "featureExtraction",
1060
- kind: "async"
1061
- })
1062
- });
1063
-
1064
- // src/auto-instrumentations/configs/huggingface.ts
1065
- var huggingFaceConfigs = [
853
+ },
1066
854
  {
1067
- channelName: huggingFaceChannels.chatCompletion.channelName,
855
+ channelName: cohereChannels.chatStream.channelName,
1068
856
  module: {
1069
- name: "@huggingface/inference",
1070
- versionRange: ">=2.0.0 <3.0.0",
1071
- filePath: "dist/index.js"
857
+ name: "cohere-ai",
858
+ versionRange: ">=7.21.0 <8.0.0",
859
+ filePath: "api/resources/v2/client/Client.js"
1072
860
  },
1073
861
  functionQuery: {
1074
- functionName: "chatCompletion",
862
+ className: "V2Client",
863
+ methodName: "chatStream",
1075
864
  kind: "Async"
1076
865
  }
1077
866
  },
1078
867
  {
1079
- channelName: huggingFaceChannels.chatCompletion.channelName,
868
+ channelName: cohereChannels.chatStream.channelName,
1080
869
  module: {
1081
- name: "@huggingface/inference",
1082
- versionRange: ">=2.0.0 <3.0.0",
1083
- filePath: "dist/index.cjs"
870
+ name: "cohere-ai",
871
+ versionRange: ">=8.0.0 <9.0.0",
872
+ filePath: "Client.js"
1084
873
  },
1085
874
  functionQuery: {
1086
- functionName: "chatCompletion",
875
+ className: "CohereClient",
876
+ methodName: "chatStream",
1087
877
  kind: "Async"
1088
878
  }
1089
879
  },
1090
880
  {
1091
- channelName: huggingFaceChannels.chatCompletionStream.channelName,
881
+ channelName: cohereChannels.chatStream.channelName,
1092
882
  module: {
1093
- name: "@huggingface/inference",
1094
- versionRange: ">=2.0.0 <3.0.0",
1095
- filePath: "dist/index.js"
883
+ name: "cohere-ai",
884
+ versionRange: ">=8.0.0 <9.0.0",
885
+ filePath: "api/resources/v2/client/Client.js"
1096
886
  },
1097
887
  functionQuery: {
1098
- functionName: "chatCompletionStream",
1099
- kind: "Sync"
888
+ className: "V2Client",
889
+ methodName: "chatStream",
890
+ kind: "Async"
1100
891
  }
1101
892
  },
1102
893
  {
1103
- channelName: huggingFaceChannels.chatCompletionStream.channelName,
894
+ channelName: cohereChannels.embed.channelName,
1104
895
  module: {
1105
- name: "@huggingface/inference",
1106
- versionRange: ">=2.0.0 <3.0.0",
1107
- filePath: "dist/index.cjs"
896
+ name: "cohere-ai",
897
+ versionRange: ">=7.0.0 <8.0.0",
898
+ filePath: "Client.js"
1108
899
  },
1109
900
  functionQuery: {
1110
- functionName: "chatCompletionStream",
1111
- kind: "Sync"
901
+ className: "CohereClient",
902
+ methodName: "embed",
903
+ kind: "Async"
1112
904
  }
1113
905
  },
1114
906
  {
1115
- channelName: huggingFaceChannels.textGeneration.channelName,
907
+ channelName: cohereChannels.embed.channelName,
1116
908
  module: {
1117
- name: "@huggingface/inference",
1118
- versionRange: ">=2.0.0 <3.0.0",
1119
- filePath: "dist/index.js"
909
+ name: "cohere-ai",
910
+ versionRange: ">=7.0.0 <7.21.0",
911
+ filePath: "api/resources/v2/client/Client.js"
1120
912
  },
1121
913
  functionQuery: {
1122
- functionName: "textGeneration",
914
+ className: "V2",
915
+ methodName: "embed",
1123
916
  kind: "Async"
1124
917
  }
1125
918
  },
1126
919
  {
1127
- channelName: huggingFaceChannels.textGeneration.channelName,
920
+ channelName: cohereChannels.embed.channelName,
1128
921
  module: {
1129
- name: "@huggingface/inference",
1130
- versionRange: ">=2.0.0 <3.0.0",
1131
- filePath: "dist/index.cjs"
922
+ name: "cohere-ai",
923
+ versionRange: ">=7.21.0 <8.0.0",
924
+ filePath: "api/resources/v2/client/Client.js"
1132
925
  },
1133
926
  functionQuery: {
1134
- functionName: "textGeneration",
927
+ className: "V2Client",
928
+ methodName: "embed",
1135
929
  kind: "Async"
1136
930
  }
1137
931
  },
1138
932
  {
1139
- channelName: huggingFaceChannels.textGenerationStream.channelName,
933
+ channelName: cohereChannels.embed.channelName,
1140
934
  module: {
1141
- name: "@huggingface/inference",
1142
- versionRange: ">=2.0.0 <3.0.0",
1143
- filePath: "dist/index.js"
935
+ name: "cohere-ai",
936
+ versionRange: ">=8.0.0 <9.0.0",
937
+ filePath: "Client.js"
1144
938
  },
1145
939
  functionQuery: {
1146
- functionName: "textGenerationStream",
1147
- kind: "Sync"
940
+ className: "CohereClient",
941
+ methodName: "embed",
942
+ kind: "Async"
1148
943
  }
1149
944
  },
1150
945
  {
1151
- channelName: huggingFaceChannels.textGenerationStream.channelName,
946
+ channelName: cohereChannels.embed.channelName,
1152
947
  module: {
1153
- name: "@huggingface/inference",
1154
- versionRange: ">=2.0.0 <3.0.0",
1155
- filePath: "dist/index.cjs"
948
+ name: "cohere-ai",
949
+ versionRange: ">=8.0.0 <9.0.0",
950
+ filePath: "api/resources/v2/client/Client.js"
1156
951
  },
1157
952
  functionQuery: {
1158
- functionName: "textGenerationStream",
1159
- kind: "Sync"
953
+ className: "V2Client",
954
+ methodName: "embed",
955
+ kind: "Async"
1160
956
  }
1161
957
  },
1162
958
  {
1163
- channelName: huggingFaceChannels.featureExtraction.channelName,
959
+ channelName: cohereChannels.rerank.channelName,
1164
960
  module: {
1165
- name: "@huggingface/inference",
1166
- versionRange: ">=2.0.0 <3.0.0",
1167
- filePath: "dist/index.js"
961
+ name: "cohere-ai",
962
+ versionRange: ">=7.0.0 <8.0.0",
963
+ filePath: "Client.js"
1168
964
  },
1169
965
  functionQuery: {
1170
- functionName: "featureExtraction",
966
+ className: "CohereClient",
967
+ methodName: "rerank",
1171
968
  kind: "Async"
1172
969
  }
1173
970
  },
1174
971
  {
1175
- channelName: huggingFaceChannels.featureExtraction.channelName,
972
+ channelName: cohereChannels.rerank.channelName,
1176
973
  module: {
1177
- name: "@huggingface/inference",
1178
- versionRange: ">=2.0.0 <3.0.0",
1179
- filePath: "dist/index.cjs"
974
+ name: "cohere-ai",
975
+ versionRange: ">=7.0.0 <7.21.0",
976
+ filePath: "api/resources/v2/client/Client.js"
1180
977
  },
1181
978
  functionQuery: {
1182
- functionName: "featureExtraction",
979
+ className: "V2",
980
+ methodName: "rerank",
1183
981
  kind: "Async"
1184
982
  }
1185
983
  },
1186
984
  {
1187
- channelName: huggingFaceChannels.chatCompletion.channelName,
985
+ channelName: cohereChannels.rerank.channelName,
1188
986
  module: {
1189
- name: "@huggingface/inference",
1190
- versionRange: ">=3.0.0 <5.0.0",
1191
- filePath: "dist/esm/tasks/nlp/chatCompletion.js"
987
+ name: "cohere-ai",
988
+ versionRange: ">=7.21.0 <8.0.0",
989
+ filePath: "api/resources/v2/client/Client.js"
1192
990
  },
1193
991
  functionQuery: {
1194
- functionName: "chatCompletion",
992
+ className: "V2Client",
993
+ methodName: "rerank",
1195
994
  kind: "Async"
1196
995
  }
1197
996
  },
1198
997
  {
1199
- channelName: huggingFaceChannels.chatCompletion.channelName,
998
+ channelName: cohereChannels.rerank.channelName,
1200
999
  module: {
1201
- name: "@huggingface/inference",
1202
- versionRange: ">=3.0.0 <5.0.0",
1203
- filePath: "dist/commonjs/tasks/nlp/chatCompletion.js"
1000
+ name: "cohere-ai",
1001
+ versionRange: ">=8.0.0 <9.0.0",
1002
+ filePath: "Client.js"
1204
1003
  },
1205
1004
  functionQuery: {
1206
- functionName: "chatCompletion",
1005
+ className: "CohereClient",
1006
+ methodName: "rerank",
1207
1007
  kind: "Async"
1208
1008
  }
1209
1009
  },
1210
1010
  {
1211
- channelName: huggingFaceChannels.chatCompletionStream.channelName,
1212
- module: {
1213
- name: "@huggingface/inference",
1214
- versionRange: ">=3.0.0 <5.0.0",
1215
- filePath: "dist/esm/tasks/nlp/chatCompletionStream.js"
1216
- },
1217
- functionQuery: {
1218
- functionName: "chatCompletionStream",
1219
- kind: "Sync"
1220
- }
1221
- },
1222
- {
1223
- channelName: huggingFaceChannels.chatCompletionStream.channelName,
1224
- module: {
1225
- name: "@huggingface/inference",
1226
- versionRange: ">=3.0.0 <5.0.0",
1227
- filePath: "dist/commonjs/tasks/nlp/chatCompletionStream.js"
1228
- },
1229
- functionQuery: {
1230
- functionName: "chatCompletionStream",
1231
- kind: "Sync"
1232
- }
1233
- },
1234
- {
1235
- channelName: huggingFaceChannels.textGeneration.channelName,
1011
+ channelName: cohereChannels.rerank.channelName,
1236
1012
  module: {
1237
- name: "@huggingface/inference",
1238
- versionRange: ">=3.0.0 <5.0.0",
1239
- filePath: "dist/esm/tasks/nlp/textGeneration.js"
1013
+ name: "cohere-ai",
1014
+ versionRange: ">=8.0.0 <9.0.0",
1015
+ filePath: "api/resources/v2/client/Client.js"
1240
1016
  },
1241
1017
  functionQuery: {
1242
- functionName: "textGeneration",
1018
+ className: "V2Client",
1019
+ methodName: "rerank",
1243
1020
  kind: "Async"
1244
1021
  }
1245
- },
1022
+ }
1023
+ ];
1024
+
1025
+ // src/instrumentation/plugins/cursor-sdk-channels.ts
1026
+ var cursorSDKChannels = defineChannels("@cursor/sdk", {
1027
+ create: channel({
1028
+ channelName: "Agent.create",
1029
+ kind: "async"
1030
+ }),
1031
+ resume: channel({
1032
+ channelName: "Agent.resume",
1033
+ kind: "async"
1034
+ }),
1035
+ prompt: channel({
1036
+ channelName: "Agent.prompt",
1037
+ kind: "async"
1038
+ }),
1039
+ send: channel({
1040
+ channelName: "agent.send",
1041
+ kind: "async"
1042
+ })
1043
+ });
1044
+
1045
+ // src/auto-instrumentations/configs/cursor-sdk.ts
1046
+ var cursorSDKVersionRange = ">=1.0.7 <2.0.0";
1047
+ var cursorSDKEntrypoints = ["dist/esm/index.js", "dist/cjs/index.js"];
1048
+ var cursorSDKConfigs = cursorSDKEntrypoints.flatMap((filePath) => [
1246
1049
  {
1247
- channelName: huggingFaceChannels.textGeneration.channelName,
1050
+ channelName: cursorSDKChannels.create.channelName,
1248
1051
  module: {
1249
- name: "@huggingface/inference",
1250
- versionRange: ">=3.0.0 <5.0.0",
1251
- filePath: "dist/commonjs/tasks/nlp/textGeneration.js"
1052
+ name: "@cursor/sdk",
1053
+ versionRange: cursorSDKVersionRange,
1054
+ filePath
1252
1055
  },
1253
1056
  functionQuery: {
1254
- functionName: "textGeneration",
1057
+ className: "Agent",
1058
+ methodName: "create",
1255
1059
  kind: "Async"
1256
1060
  }
1257
1061
  },
1258
1062
  {
1259
- channelName: huggingFaceChannels.textGenerationStream.channelName,
1260
- module: {
1261
- name: "@huggingface/inference",
1262
- versionRange: ">=3.0.0 <5.0.0",
1263
- filePath: "dist/esm/tasks/nlp/textGenerationStream.js"
1264
- },
1265
- functionQuery: {
1266
- functionName: "textGenerationStream",
1267
- kind: "Sync"
1268
- }
1269
- },
1270
- {
1271
- channelName: huggingFaceChannels.textGenerationStream.channelName,
1272
- module: {
1273
- name: "@huggingface/inference",
1274
- versionRange: ">=3.0.0 <5.0.0",
1275
- filePath: "dist/commonjs/tasks/nlp/textGenerationStream.js"
1276
- },
1277
- functionQuery: {
1278
- functionName: "textGenerationStream",
1279
- kind: "Sync"
1280
- }
1281
- },
1282
- {
1283
- channelName: huggingFaceChannels.featureExtraction.channelName,
1063
+ channelName: cursorSDKChannels.resume.channelName,
1284
1064
  module: {
1285
- name: "@huggingface/inference",
1286
- versionRange: ">=3.0.0 <5.0.0",
1287
- filePath: "dist/esm/tasks/nlp/featureExtraction.js"
1065
+ name: "@cursor/sdk",
1066
+ versionRange: cursorSDKVersionRange,
1067
+ filePath
1288
1068
  },
1289
1069
  functionQuery: {
1290
- functionName: "featureExtraction",
1070
+ className: "Agent",
1071
+ methodName: "resume",
1291
1072
  kind: "Async"
1292
1073
  }
1293
1074
  },
1294
1075
  {
1295
- channelName: huggingFaceChannels.featureExtraction.channelName,
1076
+ channelName: cursorSDKChannels.prompt.channelName,
1296
1077
  module: {
1297
- name: "@huggingface/inference",
1298
- versionRange: ">=3.0.0 <5.0.0",
1299
- filePath: "dist/commonjs/tasks/nlp/featureExtraction.js"
1078
+ name: "@cursor/sdk",
1079
+ versionRange: cursorSDKVersionRange,
1080
+ filePath
1300
1081
  },
1301
1082
  functionQuery: {
1302
- functionName: "featureExtraction",
1083
+ className: "Agent",
1084
+ methodName: "prompt",
1303
1085
  kind: "Async"
1304
1086
  }
1305
1087
  }
1306
- ];
1088
+ ]);
1307
1089
 
1308
- // src/instrumentation/plugins/openrouter-agent-channels.ts
1309
- var openRouterAgentChannels = defineChannels("@openrouter/agent", {
1310
- callModel: channel({
1311
- channelName: "callModel",
1090
+ // src/instrumentation/plugins/flue-channels.ts
1091
+ var flueChannels = defineChannels("@flue/runtime", {
1092
+ createContext: channel({
1093
+ channelName: "createFlueContext",
1312
1094
  kind: "sync-stream"
1313
1095
  }),
1314
- callModelTurn: channel({
1315
- channelName: "callModel.turn",
1096
+ openSession: channel({
1097
+ channelName: "Harness.openSession",
1316
1098
  kind: "async"
1317
1099
  }),
1318
- toolExecute: channel({
1319
- channelName: "tool.execute",
1100
+ contextEvent: channel({
1101
+ channelName: "context.event",
1102
+ kind: "sync-stream"
1103
+ }),
1104
+ prompt: channel({
1105
+ channelName: "session.prompt",
1106
+ kind: "async"
1107
+ }),
1108
+ skill: channel({
1109
+ channelName: "session.skill",
1110
+ kind: "async"
1111
+ }),
1112
+ task: channel({
1113
+ channelName: "session.task",
1114
+ kind: "async"
1115
+ }),
1116
+ compact: channel({
1117
+ channelName: "session.compact",
1320
1118
  kind: "async"
1321
1119
  })
1322
1120
  });
1323
1121
 
1324
- // src/auto-instrumentations/configs/openrouter-agent.ts
1325
- var openRouterAgentConfigs = [
1122
+ // src/auto-instrumentations/configs/flue.ts
1123
+ var flueVersionRange = ">=0.7.0 <0.8.0";
1124
+ var flueConfigs = [
1326
1125
  {
1327
- channelName: openRouterAgentChannels.callModel.channelName,
1126
+ channelName: flueChannels.createContext.channelName,
1328
1127
  module: {
1329
- name: "@openrouter/agent",
1330
- versionRange: ">=0.1.2",
1331
- filePath: "esm/inner-loop/call-model.js"
1128
+ name: "@flue/runtime",
1129
+ versionRange: flueVersionRange,
1130
+ filePath: "dist/internal.mjs"
1332
1131
  },
1333
1132
  functionQuery: {
1334
- functionName: "callModel",
1133
+ functionName: "createFlueContext",
1335
1134
  kind: "Sync"
1336
1135
  }
1136
+ },
1137
+ {
1138
+ channelName: flueChannels.openSession.channelName,
1139
+ module: {
1140
+ name: "@flue/runtime",
1141
+ versionRange: flueVersionRange,
1142
+ filePath: "dist/internal.mjs"
1143
+ },
1144
+ functionQuery: {
1145
+ className: "Harness",
1146
+ methodName: "openSession",
1147
+ kind: "Async"
1148
+ }
1337
1149
  }
1338
1150
  ];
1339
1151
 
1340
- // src/instrumentation/plugins/openrouter-channels.ts
1341
- var openRouterChannels = defineChannels("@openrouter/sdk", {
1342
- chatSend: channel({
1343
- channelName: "chat.send",
1152
+ // src/instrumentation/plugins/genkit-channels.ts
1153
+ var genkitChannels = defineChannels("@genkit-ai/ai", {
1154
+ generate: channel({
1155
+ channelName: "generate",
1344
1156
  kind: "async"
1345
1157
  }),
1346
- embeddingsGenerate: channel({
1347
- channelName: "embeddings.generate",
1348
- kind: "async"
1158
+ generateStream: channel({
1159
+ channelName: "generateStream",
1160
+ kind: "sync-stream"
1349
1161
  }),
1350
- rerankRerank: channel(
1351
- {
1352
- channelName: "rerank.rerank",
1353
- kind: "async"
1354
- }
1355
- ),
1356
- betaResponsesSend: channel({
1357
- channelName: "beta.responses.send",
1162
+ embed: channel({
1163
+ channelName: "embed",
1358
1164
  kind: "async"
1359
1165
  }),
1360
- callModel: channel({
1361
- channelName: "callModel",
1362
- kind: "sync-stream"
1166
+ embedMany: channel({
1167
+ channelName: "embedMany",
1168
+ kind: "async"
1363
1169
  }),
1364
- callModelTurn: channel({
1365
- channelName: "callModel.turn",
1170
+ actionRun: channel({
1171
+ channelName: "action.run",
1366
1172
  kind: "async"
1367
1173
  }),
1368
- toolExecute: channel({
1369
- channelName: "tool.execute",
1174
+ actionStream: channel({
1175
+ channelName: "action.stream",
1176
+ kind: "sync-stream"
1177
+ })
1178
+ });
1179
+ var genkitCoreChannels = defineChannels("@genkit-ai/core", {
1180
+ actionSpan: channel({
1181
+ channelName: "action.span",
1370
1182
  kind: "async"
1371
1183
  })
1372
1184
  });
1373
1185
 
1374
- // src/auto-instrumentations/configs/openrouter.ts
1375
- var openRouterConfigs = [
1186
+ // src/auto-instrumentations/configs/genkit.ts
1187
+ var genkitVersionRange = ">=1.0.0 <2.0.0";
1188
+ var genkitConfigs = [
1376
1189
  {
1377
- channelName: openRouterChannels.chatSend.channelName,
1190
+ channelName: genkitChannels.generate.channelName,
1378
1191
  module: {
1379
- name: "@openrouter/sdk",
1380
- versionRange: ">=0.9.11 <1.0.0",
1381
- filePath: "esm/sdk/chat.js"
1192
+ name: "@genkit-ai/ai",
1193
+ versionRange: genkitVersionRange,
1194
+ filePath: "lib/genkit-ai.mjs"
1382
1195
  },
1383
1196
  functionQuery: {
1384
- className: "Chat",
1385
- methodName: "send",
1197
+ className: "GenkitAI",
1198
+ methodName: "generate",
1386
1199
  kind: "Async"
1387
1200
  }
1388
1201
  },
1389
1202
  {
1390
- channelName: openRouterChannels.embeddingsGenerate.channelName,
1203
+ channelName: genkitChannels.generate.channelName,
1391
1204
  module: {
1392
- name: "@openrouter/sdk",
1393
- versionRange: ">=0.9.11 <1.0.0",
1394
- filePath: "esm/sdk/embeddings.js"
1205
+ name: "@genkit-ai/ai",
1206
+ versionRange: genkitVersionRange,
1207
+ filePath: "lib/genkit-ai.js"
1395
1208
  },
1396
1209
  functionQuery: {
1397
- className: "Embeddings",
1210
+ className: "GenkitAI",
1398
1211
  methodName: "generate",
1399
1212
  kind: "Async"
1400
1213
  }
1401
1214
  },
1402
1215
  {
1403
- channelName: openRouterChannels.rerankRerank.channelName,
1216
+ channelName: genkitChannels.generateStream.channelName,
1404
1217
  module: {
1405
- name: "@openrouter/sdk",
1406
- versionRange: ">=0.12.0 <1.0.0",
1407
- filePath: "esm/sdk/rerank.js"
1218
+ name: "@genkit-ai/ai",
1219
+ versionRange: genkitVersionRange,
1220
+ filePath: "lib/genkit-ai.mjs"
1408
1221
  },
1409
1222
  functionQuery: {
1410
- className: "Rerank",
1411
- methodName: "rerank",
1223
+ className: "GenkitAI",
1224
+ methodName: "generateStream",
1225
+ kind: "Sync"
1226
+ }
1227
+ },
1228
+ {
1229
+ channelName: genkitChannels.generateStream.channelName,
1230
+ module: {
1231
+ name: "@genkit-ai/ai",
1232
+ versionRange: genkitVersionRange,
1233
+ filePath: "lib/genkit-ai.js"
1234
+ },
1235
+ functionQuery: {
1236
+ className: "GenkitAI",
1237
+ methodName: "generateStream",
1238
+ kind: "Sync"
1239
+ }
1240
+ },
1241
+ {
1242
+ channelName: genkitChannels.embed.channelName,
1243
+ module: {
1244
+ name: "@genkit-ai/ai",
1245
+ versionRange: genkitVersionRange,
1246
+ filePath: "lib/genkit-ai.mjs"
1247
+ },
1248
+ functionQuery: {
1249
+ className: "GenkitAI",
1250
+ methodName: "embed",
1412
1251
  kind: "Async"
1413
1252
  }
1414
1253
  },
1415
1254
  {
1416
- channelName: openRouterChannels.betaResponsesSend.channelName,
1255
+ channelName: genkitChannels.embed.channelName,
1417
1256
  module: {
1418
- name: "@openrouter/sdk",
1419
- versionRange: ">=0.9.11 <1.0.0",
1420
- filePath: "esm/sdk/responses.js"
1257
+ name: "@genkit-ai/ai",
1258
+ versionRange: genkitVersionRange,
1259
+ filePath: "lib/genkit-ai.js"
1421
1260
  },
1422
1261
  functionQuery: {
1423
- className: "Responses",
1424
- methodName: "send",
1262
+ className: "GenkitAI",
1263
+ methodName: "embed",
1425
1264
  kind: "Async"
1426
1265
  }
1427
1266
  },
1428
1267
  {
1429
- channelName: openRouterChannels.callModel.channelName,
1268
+ channelName: genkitChannels.embedMany.channelName,
1430
1269
  module: {
1431
- name: "@openrouter/sdk",
1432
- versionRange: ">=0.9.11 <1.0.0",
1433
- filePath: "esm/sdk/sdk.js"
1270
+ name: "@genkit-ai/ai",
1271
+ versionRange: genkitVersionRange,
1272
+ filePath: "lib/genkit-ai.mjs"
1434
1273
  },
1435
1274
  functionQuery: {
1436
- className: "OpenRouter",
1437
- methodName: "callModel",
1438
- kind: "Sync"
1439
- }
1440
- }
1441
- ];
1442
-
1443
- // src/instrumentation/plugins/mistral-channels.ts
1444
- var mistralChannels = defineChannels("@mistralai/mistralai", {
1445
- chatComplete: channel({
1446
- channelName: "chat.complete",
1447
- kind: "async"
1448
- }),
1449
- chatStream: channel({
1450
- channelName: "chat.stream",
1451
- kind: "async"
1452
- }),
1453
- embeddingsCreate: channel({
1454
- channelName: "embeddings.create",
1455
- kind: "async"
1456
- }),
1457
- fimComplete: channel({
1458
- channelName: "fim.complete",
1459
- kind: "async"
1460
- }),
1461
- fimStream: channel({
1462
- channelName: "fim.stream",
1463
- kind: "async"
1464
- }),
1465
- agentsComplete: channel({
1466
- channelName: "agents.complete",
1467
- kind: "async"
1468
- }),
1469
- agentsStream: channel({
1470
- channelName: "agents.stream",
1471
- kind: "async"
1472
- })
1473
- });
1474
-
1475
- // src/auto-instrumentations/configs/mistral.ts
1476
- var mistralConfigs = [
1477
- {
1478
- channelName: mistralChannels.chatComplete.channelName,
1479
- module: {
1480
- name: "@mistralai/mistralai",
1481
- versionRange: ">=1.0.0 <2.0.0",
1482
- filePath: "sdk/chat.js"
1483
- },
1484
- functionQuery: {
1485
- className: "Chat",
1486
- methodName: "complete",
1487
- kind: "Async"
1488
- }
1489
- },
1490
- {
1491
- channelName: mistralChannels.chatComplete.channelName,
1492
- module: {
1493
- name: "@mistralai/mistralai",
1494
- versionRange: ">=2.0.0 <3.0.0",
1495
- filePath: "esm/sdk/chat.js"
1496
- },
1497
- functionQuery: {
1498
- className: "Chat",
1499
- methodName: "complete",
1500
- kind: "Async"
1501
- }
1502
- },
1503
- {
1504
- channelName: mistralChannels.chatStream.channelName,
1505
- module: {
1506
- name: "@mistralai/mistralai",
1507
- versionRange: ">=1.0.0 <2.0.0",
1508
- filePath: "sdk/chat.js"
1509
- },
1510
- functionQuery: {
1511
- className: "Chat",
1512
- methodName: "stream",
1513
- kind: "Async"
1275
+ className: "GenkitAI",
1276
+ methodName: "embedMany",
1277
+ kind: "Async"
1514
1278
  }
1515
1279
  },
1516
1280
  {
1517
- channelName: mistralChannels.chatStream.channelName,
1281
+ channelName: genkitChannels.embedMany.channelName,
1518
1282
  module: {
1519
- name: "@mistralai/mistralai",
1520
- versionRange: ">=2.0.0 <3.0.0",
1521
- filePath: "esm/sdk/chat.js"
1283
+ name: "@genkit-ai/ai",
1284
+ versionRange: genkitVersionRange,
1285
+ filePath: "lib/genkit-ai.js"
1522
1286
  },
1523
1287
  functionQuery: {
1524
- className: "Chat",
1525
- methodName: "stream",
1288
+ className: "GenkitAI",
1289
+ methodName: "embedMany",
1526
1290
  kind: "Async"
1527
1291
  }
1528
1292
  },
1529
1293
  {
1530
- channelName: mistralChannels.embeddingsCreate.channelName,
1294
+ channelName: genkitChannels.actionRun.channelName,
1531
1295
  module: {
1532
- name: "@mistralai/mistralai",
1533
- versionRange: ">=1.0.0 <2.0.0",
1534
- filePath: "sdk/embeddings.js"
1296
+ name: "@genkit-ai/ai",
1297
+ versionRange: genkitVersionRange,
1298
+ filePath: "lib/genkit-ai.mjs"
1535
1299
  },
1536
1300
  functionQuery: {
1537
- className: "Embeddings",
1538
- methodName: "create",
1301
+ className: "GenkitAI",
1302
+ methodName: "run",
1539
1303
  kind: "Async"
1540
1304
  }
1541
1305
  },
1542
1306
  {
1543
- channelName: mistralChannels.embeddingsCreate.channelName,
1307
+ channelName: genkitChannels.actionRun.channelName,
1544
1308
  module: {
1545
- name: "@mistralai/mistralai",
1546
- versionRange: ">=2.0.0 <3.0.0",
1547
- filePath: "esm/sdk/embeddings.js"
1309
+ name: "@genkit-ai/ai",
1310
+ versionRange: genkitVersionRange,
1311
+ filePath: "lib/genkit-ai.js"
1548
1312
  },
1549
1313
  functionQuery: {
1550
- className: "Embeddings",
1551
- methodName: "create",
1314
+ className: "GenkitAI",
1315
+ methodName: "run",
1552
1316
  kind: "Async"
1553
1317
  }
1554
1318
  },
1555
1319
  {
1556
- channelName: mistralChannels.fimComplete.channelName,
1320
+ channelName: genkitCoreChannels.actionSpan.channelName,
1557
1321
  module: {
1558
- name: "@mistralai/mistralai",
1559
- versionRange: ">=1.0.0 <2.0.0",
1560
- filePath: "sdk/fim.js"
1322
+ name: "@genkit-ai/core",
1323
+ versionRange: genkitVersionRange,
1324
+ filePath: "lib/tracing/instrumentation.mjs"
1561
1325
  },
1562
1326
  functionQuery: {
1563
- className: "Fim",
1564
- methodName: "complete",
1327
+ functionName: "runInNewSpan",
1565
1328
  kind: "Async"
1566
1329
  }
1567
1330
  },
1568
1331
  {
1569
- channelName: mistralChannels.fimComplete.channelName,
1332
+ channelName: genkitCoreChannels.actionSpan.channelName,
1570
1333
  module: {
1571
- name: "@mistralai/mistralai",
1572
- versionRange: ">=2.0.0 <3.0.0",
1573
- filePath: "esm/sdk/fim.js"
1334
+ name: "@genkit-ai/core",
1335
+ versionRange: genkitVersionRange,
1336
+ filePath: "lib/tracing/instrumentation.js"
1574
1337
  },
1575
1338
  functionQuery: {
1576
- className: "Fim",
1577
- methodName: "complete",
1339
+ functionName: "runInNewSpan",
1578
1340
  kind: "Async"
1579
1341
  }
1580
- },
1342
+ }
1343
+ ];
1344
+
1345
+ // src/instrumentation/plugins/github-copilot-channels.ts
1346
+ var gitHubCopilotChannels = defineChannels("@github/copilot-sdk", {
1347
+ createSession: channel({
1348
+ channelName: "client.createSession",
1349
+ kind: "async"
1350
+ }),
1351
+ resumeSession: channel({
1352
+ channelName: "client.resumeSession",
1353
+ kind: "async"
1354
+ }),
1355
+ sendAndWait: channel({
1356
+ channelName: "session.sendAndWait",
1357
+ kind: "async"
1358
+ })
1359
+ });
1360
+
1361
+ // src/auto-instrumentations/configs/github-copilot.ts
1362
+ var gitHubCopilotConfigs = [
1363
+ // ESM: CopilotClient.createSession
1581
1364
  {
1582
- channelName: mistralChannels.fimStream.channelName,
1365
+ channelName: gitHubCopilotChannels.createSession.channelName,
1583
1366
  module: {
1584
- name: "@mistralai/mistralai",
1585
- versionRange: ">=1.0.0 <2.0.0",
1586
- filePath: "sdk/fim.js"
1367
+ name: "@github/copilot-sdk",
1368
+ versionRange: ">=0.3.0",
1369
+ filePath: "dist/client.js"
1587
1370
  },
1588
1371
  functionQuery: {
1589
- className: "Fim",
1590
- methodName: "stream",
1372
+ className: "CopilotClient",
1373
+ methodName: "createSession",
1591
1374
  kind: "Async"
1592
1375
  }
1593
1376
  },
1377
+ // CJS: CopilotClient.createSession
1594
1378
  {
1595
- channelName: mistralChannels.fimStream.channelName,
1379
+ channelName: gitHubCopilotChannels.createSession.channelName,
1596
1380
  module: {
1597
- name: "@mistralai/mistralai",
1598
- versionRange: ">=2.0.0 <3.0.0",
1599
- filePath: "esm/sdk/fim.js"
1381
+ name: "@github/copilot-sdk",
1382
+ versionRange: ">=0.3.0",
1383
+ filePath: "dist/cjs/client.js"
1600
1384
  },
1601
1385
  functionQuery: {
1602
- className: "Fim",
1603
- methodName: "stream",
1386
+ className: "CopilotClient",
1387
+ methodName: "createSession",
1604
1388
  kind: "Async"
1605
1389
  }
1606
1390
  },
1391
+ // ESM: CopilotClient.resumeSession
1607
1392
  {
1608
- channelName: mistralChannels.agentsComplete.channelName,
1393
+ channelName: gitHubCopilotChannels.resumeSession.channelName,
1609
1394
  module: {
1610
- name: "@mistralai/mistralai",
1611
- versionRange: ">=1.0.0 <2.0.0",
1612
- filePath: "sdk/agents.js"
1395
+ name: "@github/copilot-sdk",
1396
+ versionRange: ">=0.3.0",
1397
+ filePath: "dist/client.js"
1613
1398
  },
1614
1399
  functionQuery: {
1615
- className: "Agents",
1616
- methodName: "complete",
1400
+ className: "CopilotClient",
1401
+ methodName: "resumeSession",
1617
1402
  kind: "Async"
1618
1403
  }
1619
1404
  },
1405
+ // CJS: CopilotClient.resumeSession
1620
1406
  {
1621
- channelName: mistralChannels.agentsComplete.channelName,
1407
+ channelName: gitHubCopilotChannels.resumeSession.channelName,
1622
1408
  module: {
1623
- name: "@mistralai/mistralai",
1624
- versionRange: ">=2.0.0 <3.0.0",
1625
- filePath: "esm/sdk/agents.js"
1409
+ name: "@github/copilot-sdk",
1410
+ versionRange: ">=0.3.0",
1411
+ filePath: "dist/cjs/client.js"
1626
1412
  },
1627
1413
  functionQuery: {
1628
- className: "Agents",
1629
- methodName: "complete",
1414
+ className: "CopilotClient",
1415
+ methodName: "resumeSession",
1630
1416
  kind: "Async"
1631
1417
  }
1632
1418
  },
1419
+ // ESM: CopilotSession.sendAndWait
1633
1420
  {
1634
- channelName: mistralChannels.agentsStream.channelName,
1421
+ channelName: gitHubCopilotChannels.sendAndWait.channelName,
1635
1422
  module: {
1636
- name: "@mistralai/mistralai",
1637
- versionRange: ">=1.0.0 <2.0.0",
1638
- filePath: "sdk/agents.js"
1423
+ name: "@github/copilot-sdk",
1424
+ versionRange: ">=0.3.0",
1425
+ filePath: "dist/session.js"
1639
1426
  },
1640
1427
  functionQuery: {
1641
- className: "Agents",
1642
- methodName: "stream",
1428
+ className: "CopilotSession",
1429
+ methodName: "sendAndWait",
1643
1430
  kind: "Async"
1644
1431
  }
1645
1432
  },
1433
+ // CJS: CopilotSession.sendAndWait
1646
1434
  {
1647
- channelName: mistralChannels.agentsStream.channelName,
1435
+ channelName: gitHubCopilotChannels.sendAndWait.channelName,
1648
1436
  module: {
1649
- name: "@mistralai/mistralai",
1650
- versionRange: ">=2.0.0 <3.0.0",
1651
- filePath: "esm/sdk/agents.js"
1437
+ name: "@github/copilot-sdk",
1438
+ versionRange: ">=0.3.0",
1439
+ filePath: "dist/cjs/session.js"
1652
1440
  },
1653
1441
  functionQuery: {
1654
- className: "Agents",
1655
- methodName: "stream",
1442
+ className: "CopilotSession",
1443
+ methodName: "sendAndWait",
1656
1444
  kind: "Async"
1657
1445
  }
1658
1446
  }
@@ -1902,281 +1690,1292 @@ var googleADKConfigs = [
1902
1690
  }
1903
1691
  ];
1904
1692
 
1905
- // src/instrumentation/plugins/cohere-channels.ts
1906
- var cohereChannels = defineChannels("cohere-ai", {
1907
- chat: channel({
1908
- channelName: "chat",
1909
- kind: "async"
1910
- }),
1911
- chatStream: channel({
1912
- channelName: "chatStream",
1693
+ // src/instrumentation/plugins/google-genai-channels.ts
1694
+ var googleGenAIChannels = defineChannels("@google/genai", {
1695
+ generateContent: channel({
1696
+ channelName: "models.generateContent",
1913
1697
  kind: "async"
1914
1698
  }),
1915
- embed: channel({
1916
- channelName: "embed",
1699
+ generateContentStream: channel({
1700
+ channelName: "models.generateContentStream",
1917
1701
  kind: "async"
1918
1702
  }),
1919
- rerank: channel({
1920
- channelName: "rerank",
1703
+ embedContent: channel({
1704
+ channelName: "models.embedContent",
1921
1705
  kind: "async"
1922
1706
  })
1923
1707
  });
1924
1708
 
1925
- // src/auto-instrumentations/configs/cohere.ts
1926
- var cohereConfigs = [
1709
+ // src/auto-instrumentations/configs/google-genai.ts
1710
+ var googleGenAIConfigs = [
1711
+ // Models.generateContentInternal - The actual class method (Node.js entry point)
1712
+ // Note: generateContent is an arrow function property that calls this internal method
1927
1713
  {
1928
- channelName: cohereChannels.chat.channelName,
1714
+ channelName: googleGenAIChannels.generateContent.channelName,
1929
1715
  module: {
1930
- name: "cohere-ai",
1931
- versionRange: ">=7.0.0 <8.0.0",
1932
- filePath: "Client.js"
1716
+ name: "@google/genai",
1717
+ versionRange: ">=1.0.0",
1718
+ filePath: "dist/node/index.mjs"
1933
1719
  },
1934
1720
  functionQuery: {
1935
- className: "CohereClient",
1936
- methodName: "chat",
1721
+ className: "Models",
1722
+ methodName: "generateContentInternal",
1937
1723
  kind: "Async"
1938
1724
  }
1939
1725
  },
1726
+ // Models.generateContentStreamInternal - The actual class method (Node.js entry point)
1727
+ // Note: generateContentStream is an arrow function property that calls this internal method
1940
1728
  {
1941
- channelName: cohereChannels.chat.channelName,
1729
+ channelName: googleGenAIChannels.generateContentStream.channelName,
1942
1730
  module: {
1943
- name: "cohere-ai",
1944
- versionRange: ">=7.20.0 <8.0.0",
1945
- filePath: "api/resources/v2/client/Client.js"
1731
+ name: "@google/genai",
1732
+ versionRange: ">=1.0.0",
1733
+ filePath: "dist/node/index.mjs"
1946
1734
  },
1947
1735
  functionQuery: {
1948
- className: "V2Client",
1949
- methodName: "chat",
1736
+ className: "Models",
1737
+ methodName: "generateContentStreamInternal",
1950
1738
  kind: "Async"
1951
1739
  }
1952
1740
  },
1741
+ // Models.embedContent - class method in older SDK versions
1953
1742
  {
1954
- channelName: cohereChannels.chat.channelName,
1743
+ channelName: googleGenAIChannels.embedContent.channelName,
1955
1744
  module: {
1956
- name: "cohere-ai",
1957
- versionRange: ">=8.0.0 <9.0.0",
1958
- filePath: "Client.js"
1745
+ name: "@google/genai",
1746
+ versionRange: ">=1.0.0 <1.44.0",
1747
+ filePath: "dist/node/index.mjs"
1959
1748
  },
1960
1749
  functionQuery: {
1961
- className: "CohereClient",
1962
- methodName: "chat",
1750
+ className: "Models",
1751
+ methodName: "embedContent",
1963
1752
  kind: "Async"
1964
1753
  }
1965
1754
  },
1755
+ // Models.embedContentInternal - class method in newer SDK versions
1756
+ // Note: embedContent is an arrow function property that calls this method
1966
1757
  {
1967
- channelName: cohereChannels.chat.channelName,
1758
+ channelName: googleGenAIChannels.embedContent.channelName,
1968
1759
  module: {
1969
- name: "cohere-ai",
1970
- versionRange: ">=8.0.0 <9.0.0",
1971
- filePath: "api/resources/v2/client/Client.js"
1760
+ name: "@google/genai",
1761
+ versionRange: ">=1.44.0",
1762
+ filePath: "dist/node/index.mjs"
1972
1763
  },
1973
1764
  functionQuery: {
1974
- className: "V2Client",
1975
- methodName: "chat",
1765
+ className: "Models",
1766
+ methodName: "embedContentInternal",
1767
+ kind: "Async"
1768
+ }
1769
+ }
1770
+ ];
1771
+
1772
+ // src/instrumentation/plugins/groq-channels.ts
1773
+ var groqChannels = defineChannels("groq-sdk", {
1774
+ chatCompletionsCreate: channel({
1775
+ channelName: "chat.completions.create",
1776
+ kind: "async"
1777
+ }),
1778
+ embeddingsCreate: channel(
1779
+ {
1780
+ channelName: "embeddings.create",
1781
+ kind: "async"
1782
+ }
1783
+ )
1784
+ });
1785
+
1786
+ // src/auto-instrumentations/configs/groq.ts
1787
+ var groqConfigs = [
1788
+ {
1789
+ channelName: groqChannels.chatCompletionsCreate.channelName,
1790
+ module: {
1791
+ name: "groq-sdk",
1792
+ versionRange: ">=1.0.0",
1793
+ filePath: "resources/chat/completions.mjs"
1794
+ },
1795
+ functionQuery: {
1796
+ className: "Completions",
1797
+ methodName: "create",
1976
1798
  kind: "Async"
1977
1799
  }
1978
1800
  },
1979
1801
  {
1980
- channelName: cohereChannels.chatStream.channelName,
1802
+ channelName: groqChannels.embeddingsCreate.channelName,
1981
1803
  module: {
1982
- name: "cohere-ai",
1983
- versionRange: ">=7.0.0 <8.0.0",
1984
- filePath: "Client.js"
1804
+ name: "groq-sdk",
1805
+ versionRange: ">=1.0.0",
1806
+ filePath: "resources/embeddings.mjs"
1985
1807
  },
1986
1808
  functionQuery: {
1987
- className: "CohereClient",
1988
- methodName: "chatStream",
1809
+ className: "Embeddings",
1810
+ methodName: "create",
1989
1811
  kind: "Async"
1990
1812
  }
1813
+ }
1814
+ ];
1815
+
1816
+ // src/instrumentation/plugins/huggingface-channels.ts
1817
+ var huggingFaceChannels = defineChannels("@huggingface/inference", {
1818
+ chatCompletion: channel({
1819
+ channelName: "chatCompletion",
1820
+ kind: "async"
1821
+ }),
1822
+ chatCompletionStream: channel({
1823
+ channelName: "chatCompletionStream",
1824
+ kind: "sync-stream"
1825
+ }),
1826
+ textGeneration: channel({
1827
+ channelName: "textGeneration",
1828
+ kind: "async"
1829
+ }),
1830
+ textGenerationStream: channel({
1831
+ channelName: "textGenerationStream",
1832
+ kind: "sync-stream"
1833
+ }),
1834
+ featureExtraction: channel({
1835
+ channelName: "featureExtraction",
1836
+ kind: "async"
1837
+ })
1838
+ });
1839
+
1840
+ // src/auto-instrumentations/configs/huggingface.ts
1841
+ var huggingFaceConfigs = [
1842
+ {
1843
+ channelName: huggingFaceChannels.chatCompletion.channelName,
1844
+ module: {
1845
+ name: "@huggingface/inference",
1846
+ versionRange: ">=2.0.0 <3.0.0",
1847
+ filePath: "dist/index.js"
1848
+ },
1849
+ functionQuery: {
1850
+ functionName: "chatCompletion",
1851
+ kind: "Async"
1852
+ }
1853
+ },
1854
+ {
1855
+ channelName: huggingFaceChannels.chatCompletion.channelName,
1856
+ module: {
1857
+ name: "@huggingface/inference",
1858
+ versionRange: ">=2.0.0 <3.0.0",
1859
+ filePath: "dist/index.cjs"
1860
+ },
1861
+ functionQuery: {
1862
+ functionName: "chatCompletion",
1863
+ kind: "Async"
1864
+ }
1865
+ },
1866
+ {
1867
+ channelName: huggingFaceChannels.chatCompletionStream.channelName,
1868
+ module: {
1869
+ name: "@huggingface/inference",
1870
+ versionRange: ">=2.0.0 <3.0.0",
1871
+ filePath: "dist/index.js"
1872
+ },
1873
+ functionQuery: {
1874
+ functionName: "chatCompletionStream",
1875
+ kind: "Sync"
1876
+ }
1877
+ },
1878
+ {
1879
+ channelName: huggingFaceChannels.chatCompletionStream.channelName,
1880
+ module: {
1881
+ name: "@huggingface/inference",
1882
+ versionRange: ">=2.0.0 <3.0.0",
1883
+ filePath: "dist/index.cjs"
1884
+ },
1885
+ functionQuery: {
1886
+ functionName: "chatCompletionStream",
1887
+ kind: "Sync"
1888
+ }
1889
+ },
1890
+ {
1891
+ channelName: huggingFaceChannels.textGeneration.channelName,
1892
+ module: {
1893
+ name: "@huggingface/inference",
1894
+ versionRange: ">=2.0.0 <3.0.0",
1895
+ filePath: "dist/index.js"
1896
+ },
1897
+ functionQuery: {
1898
+ functionName: "textGeneration",
1899
+ kind: "Async"
1900
+ }
1901
+ },
1902
+ {
1903
+ channelName: huggingFaceChannels.textGeneration.channelName,
1904
+ module: {
1905
+ name: "@huggingface/inference",
1906
+ versionRange: ">=2.0.0 <3.0.0",
1907
+ filePath: "dist/index.cjs"
1908
+ },
1909
+ functionQuery: {
1910
+ functionName: "textGeneration",
1911
+ kind: "Async"
1912
+ }
1913
+ },
1914
+ {
1915
+ channelName: huggingFaceChannels.textGenerationStream.channelName,
1916
+ module: {
1917
+ name: "@huggingface/inference",
1918
+ versionRange: ">=2.0.0 <3.0.0",
1919
+ filePath: "dist/index.js"
1920
+ },
1921
+ functionQuery: {
1922
+ functionName: "textGenerationStream",
1923
+ kind: "Sync"
1924
+ }
1925
+ },
1926
+ {
1927
+ channelName: huggingFaceChannels.textGenerationStream.channelName,
1928
+ module: {
1929
+ name: "@huggingface/inference",
1930
+ versionRange: ">=2.0.0 <3.0.0",
1931
+ filePath: "dist/index.cjs"
1932
+ },
1933
+ functionQuery: {
1934
+ functionName: "textGenerationStream",
1935
+ kind: "Sync"
1936
+ }
1937
+ },
1938
+ {
1939
+ channelName: huggingFaceChannels.featureExtraction.channelName,
1940
+ module: {
1941
+ name: "@huggingface/inference",
1942
+ versionRange: ">=2.0.0 <3.0.0",
1943
+ filePath: "dist/index.js"
1944
+ },
1945
+ functionQuery: {
1946
+ functionName: "featureExtraction",
1947
+ kind: "Async"
1948
+ }
1949
+ },
1950
+ {
1951
+ channelName: huggingFaceChannels.featureExtraction.channelName,
1952
+ module: {
1953
+ name: "@huggingface/inference",
1954
+ versionRange: ">=2.0.0 <3.0.0",
1955
+ filePath: "dist/index.cjs"
1956
+ },
1957
+ functionQuery: {
1958
+ functionName: "featureExtraction",
1959
+ kind: "Async"
1960
+ }
1961
+ },
1962
+ {
1963
+ channelName: huggingFaceChannels.chatCompletion.channelName,
1964
+ module: {
1965
+ name: "@huggingface/inference",
1966
+ versionRange: ">=3.0.0 <5.0.0",
1967
+ filePath: "dist/esm/tasks/nlp/chatCompletion.js"
1968
+ },
1969
+ functionQuery: {
1970
+ functionName: "chatCompletion",
1971
+ kind: "Async"
1972
+ }
1973
+ },
1974
+ {
1975
+ channelName: huggingFaceChannels.chatCompletion.channelName,
1976
+ module: {
1977
+ name: "@huggingface/inference",
1978
+ versionRange: ">=3.0.0 <5.0.0",
1979
+ filePath: "dist/commonjs/tasks/nlp/chatCompletion.js"
1980
+ },
1981
+ functionQuery: {
1982
+ functionName: "chatCompletion",
1983
+ kind: "Async"
1984
+ }
1985
+ },
1986
+ {
1987
+ channelName: huggingFaceChannels.chatCompletionStream.channelName,
1988
+ module: {
1989
+ name: "@huggingface/inference",
1990
+ versionRange: ">=3.0.0 <5.0.0",
1991
+ filePath: "dist/esm/tasks/nlp/chatCompletionStream.js"
1992
+ },
1993
+ functionQuery: {
1994
+ functionName: "chatCompletionStream",
1995
+ kind: "Sync"
1996
+ }
1997
+ },
1998
+ {
1999
+ channelName: huggingFaceChannels.chatCompletionStream.channelName,
2000
+ module: {
2001
+ name: "@huggingface/inference",
2002
+ versionRange: ">=3.0.0 <5.0.0",
2003
+ filePath: "dist/commonjs/tasks/nlp/chatCompletionStream.js"
2004
+ },
2005
+ functionQuery: {
2006
+ functionName: "chatCompletionStream",
2007
+ kind: "Sync"
2008
+ }
2009
+ },
2010
+ {
2011
+ channelName: huggingFaceChannels.textGeneration.channelName,
2012
+ module: {
2013
+ name: "@huggingface/inference",
2014
+ versionRange: ">=3.0.0 <5.0.0",
2015
+ filePath: "dist/esm/tasks/nlp/textGeneration.js"
2016
+ },
2017
+ functionQuery: {
2018
+ functionName: "textGeneration",
2019
+ kind: "Async"
2020
+ }
2021
+ },
2022
+ {
2023
+ channelName: huggingFaceChannels.textGeneration.channelName,
2024
+ module: {
2025
+ name: "@huggingface/inference",
2026
+ versionRange: ">=3.0.0 <5.0.0",
2027
+ filePath: "dist/commonjs/tasks/nlp/textGeneration.js"
2028
+ },
2029
+ functionQuery: {
2030
+ functionName: "textGeneration",
2031
+ kind: "Async"
2032
+ }
2033
+ },
2034
+ {
2035
+ channelName: huggingFaceChannels.textGenerationStream.channelName,
2036
+ module: {
2037
+ name: "@huggingface/inference",
2038
+ versionRange: ">=3.0.0 <5.0.0",
2039
+ filePath: "dist/esm/tasks/nlp/textGenerationStream.js"
2040
+ },
2041
+ functionQuery: {
2042
+ functionName: "textGenerationStream",
2043
+ kind: "Sync"
2044
+ }
2045
+ },
2046
+ {
2047
+ channelName: huggingFaceChannels.textGenerationStream.channelName,
2048
+ module: {
2049
+ name: "@huggingface/inference",
2050
+ versionRange: ">=3.0.0 <5.0.0",
2051
+ filePath: "dist/commonjs/tasks/nlp/textGenerationStream.js"
2052
+ },
2053
+ functionQuery: {
2054
+ functionName: "textGenerationStream",
2055
+ kind: "Sync"
2056
+ }
2057
+ },
2058
+ {
2059
+ channelName: huggingFaceChannels.featureExtraction.channelName,
2060
+ module: {
2061
+ name: "@huggingface/inference",
2062
+ versionRange: ">=3.0.0 <5.0.0",
2063
+ filePath: "dist/esm/tasks/nlp/featureExtraction.js"
2064
+ },
2065
+ functionQuery: {
2066
+ functionName: "featureExtraction",
2067
+ kind: "Async"
2068
+ }
2069
+ },
2070
+ {
2071
+ channelName: huggingFaceChannels.featureExtraction.channelName,
2072
+ module: {
2073
+ name: "@huggingface/inference",
2074
+ versionRange: ">=3.0.0 <5.0.0",
2075
+ filePath: "dist/commonjs/tasks/nlp/featureExtraction.js"
2076
+ },
2077
+ functionQuery: {
2078
+ functionName: "featureExtraction",
2079
+ kind: "Async"
2080
+ }
2081
+ }
2082
+ ];
2083
+
2084
+ // src/instrumentation/plugins/langchain-channels.ts
2085
+ var langChainChannels = defineChannels("@langchain/core", {
2086
+ configure: channel({
2087
+ channelName: "CallbackManager.configure",
2088
+ kind: "sync-stream"
2089
+ }),
2090
+ configureSync: channel({
2091
+ channelName: "CallbackManager._configureSync",
2092
+ kind: "sync-stream"
2093
+ })
2094
+ });
2095
+
2096
+ // src/auto-instrumentations/configs/langchain.ts
2097
+ var langChainCoreVersionRange = ">=0.3.42";
2098
+ var langChainCallbackManagerFilePath = "dist/callbacks/manager.js";
2099
+ var langchainConfigs = [
2100
+ {
2101
+ channelName: langChainChannels.configure.channelName,
2102
+ module: {
2103
+ name: "@langchain/core",
2104
+ versionRange: langChainCoreVersionRange,
2105
+ filePath: langChainCallbackManagerFilePath
2106
+ },
2107
+ functionQuery: {
2108
+ className: "CallbackManager",
2109
+ methodName: "configure",
2110
+ kind: "Sync"
2111
+ }
2112
+ },
2113
+ {
2114
+ channelName: langChainChannels.configureSync.channelName,
2115
+ module: {
2116
+ name: "@langchain/core",
2117
+ versionRange: langChainCoreVersionRange,
2118
+ filePath: langChainCallbackManagerFilePath
2119
+ },
2120
+ functionQuery: {
2121
+ className: "CallbackManager",
2122
+ methodName: "_configureSync",
2123
+ kind: "Sync"
2124
+ }
2125
+ }
2126
+ ];
2127
+
2128
+ // src/instrumentation/plugins/mistral-channels.ts
2129
+ var mistralChannels = defineChannels("@mistralai/mistralai", {
2130
+ chatComplete: channel({
2131
+ channelName: "chat.complete",
2132
+ kind: "async"
2133
+ }),
2134
+ chatStream: channel({
2135
+ channelName: "chat.stream",
2136
+ kind: "async"
2137
+ }),
2138
+ embeddingsCreate: channel({
2139
+ channelName: "embeddings.create",
2140
+ kind: "async"
2141
+ }),
2142
+ classifiersModerate: channel({
2143
+ channelName: "classifiers.moderate",
2144
+ kind: "async"
2145
+ }),
2146
+ classifiersModerateChat: channel({
2147
+ channelName: "classifiers.moderateChat",
2148
+ kind: "async"
2149
+ }),
2150
+ classifiersClassify: channel({
2151
+ channelName: "classifiers.classify",
2152
+ kind: "async"
2153
+ }),
2154
+ classifiersClassifyChat: channel({
2155
+ channelName: "classifiers.classifyChat",
2156
+ kind: "async"
2157
+ }),
2158
+ fimComplete: channel({
2159
+ channelName: "fim.complete",
2160
+ kind: "async"
2161
+ }),
2162
+ fimStream: channel({
2163
+ channelName: "fim.stream",
2164
+ kind: "async"
2165
+ }),
2166
+ agentsComplete: channel({
2167
+ channelName: "agents.complete",
2168
+ kind: "async"
2169
+ }),
2170
+ agentsStream: channel({
2171
+ channelName: "agents.stream",
2172
+ kind: "async"
2173
+ })
2174
+ });
2175
+
2176
+ // src/auto-instrumentations/configs/mistral.ts
2177
+ var mistralConfigs = [
2178
+ {
2179
+ channelName: mistralChannels.chatComplete.channelName,
2180
+ module: {
2181
+ name: "@mistralai/mistralai",
2182
+ versionRange: ">=1.0.0 <2.0.0",
2183
+ filePath: "sdk/chat.js"
2184
+ },
2185
+ functionQuery: {
2186
+ className: "Chat",
2187
+ methodName: "complete",
2188
+ kind: "Async"
2189
+ }
2190
+ },
2191
+ {
2192
+ channelName: mistralChannels.chatComplete.channelName,
2193
+ module: {
2194
+ name: "@mistralai/mistralai",
2195
+ versionRange: ">=2.0.0 <3.0.0",
2196
+ filePath: "esm/sdk/chat.js"
2197
+ },
2198
+ functionQuery: {
2199
+ className: "Chat",
2200
+ methodName: "complete",
2201
+ kind: "Async"
2202
+ }
2203
+ },
2204
+ {
2205
+ channelName: mistralChannels.chatStream.channelName,
2206
+ module: {
2207
+ name: "@mistralai/mistralai",
2208
+ versionRange: ">=1.0.0 <2.0.0",
2209
+ filePath: "sdk/chat.js"
2210
+ },
2211
+ functionQuery: {
2212
+ className: "Chat",
2213
+ methodName: "stream",
2214
+ kind: "Async"
2215
+ }
2216
+ },
2217
+ {
2218
+ channelName: mistralChannels.chatStream.channelName,
2219
+ module: {
2220
+ name: "@mistralai/mistralai",
2221
+ versionRange: ">=2.0.0 <3.0.0",
2222
+ filePath: "esm/sdk/chat.js"
2223
+ },
2224
+ functionQuery: {
2225
+ className: "Chat",
2226
+ methodName: "stream",
2227
+ kind: "Async"
2228
+ }
2229
+ },
2230
+ {
2231
+ channelName: mistralChannels.embeddingsCreate.channelName,
2232
+ module: {
2233
+ name: "@mistralai/mistralai",
2234
+ versionRange: ">=1.0.0 <2.0.0",
2235
+ filePath: "sdk/embeddings.js"
2236
+ },
2237
+ functionQuery: {
2238
+ className: "Embeddings",
2239
+ methodName: "create",
2240
+ kind: "Async"
2241
+ }
2242
+ },
2243
+ {
2244
+ channelName: mistralChannels.embeddingsCreate.channelName,
2245
+ module: {
2246
+ name: "@mistralai/mistralai",
2247
+ versionRange: ">=2.0.0 <3.0.0",
2248
+ filePath: "esm/sdk/embeddings.js"
2249
+ },
2250
+ functionQuery: {
2251
+ className: "Embeddings",
2252
+ methodName: "create",
2253
+ kind: "Async"
2254
+ }
2255
+ },
2256
+ {
2257
+ channelName: mistralChannels.classifiersModerate.channelName,
2258
+ module: {
2259
+ name: "@mistralai/mistralai",
2260
+ versionRange: ">=1.0.0 <2.0.0",
2261
+ filePath: "sdk/classifiers.js"
2262
+ },
2263
+ functionQuery: {
2264
+ className: "Classifiers",
2265
+ methodName: "moderate",
2266
+ kind: "Async"
2267
+ }
2268
+ },
2269
+ {
2270
+ channelName: mistralChannels.classifiersModerate.channelName,
2271
+ module: {
2272
+ name: "@mistralai/mistralai",
2273
+ versionRange: ">=2.0.0 <3.0.0",
2274
+ filePath: "esm/sdk/classifiers.js"
2275
+ },
2276
+ functionQuery: {
2277
+ className: "Classifiers",
2278
+ methodName: "moderate",
2279
+ kind: "Async"
2280
+ }
2281
+ },
2282
+ {
2283
+ channelName: mistralChannels.classifiersModerateChat.channelName,
2284
+ module: {
2285
+ name: "@mistralai/mistralai",
2286
+ versionRange: ">=1.0.0 <2.0.0",
2287
+ filePath: "sdk/classifiers.js"
2288
+ },
2289
+ functionQuery: {
2290
+ className: "Classifiers",
2291
+ methodName: "moderateChat",
2292
+ kind: "Async"
2293
+ }
2294
+ },
2295
+ {
2296
+ channelName: mistralChannels.classifiersModerateChat.channelName,
2297
+ module: {
2298
+ name: "@mistralai/mistralai",
2299
+ versionRange: ">=2.0.0 <3.0.0",
2300
+ filePath: "esm/sdk/classifiers.js"
2301
+ },
2302
+ functionQuery: {
2303
+ className: "Classifiers",
2304
+ methodName: "moderateChat",
2305
+ kind: "Async"
2306
+ }
2307
+ },
2308
+ {
2309
+ channelName: mistralChannels.classifiersClassify.channelName,
2310
+ module: {
2311
+ name: "@mistralai/mistralai",
2312
+ versionRange: ">=1.10.0 <2.0.0",
2313
+ filePath: "sdk/classifiers.js"
2314
+ },
2315
+ functionQuery: {
2316
+ className: "Classifiers",
2317
+ methodName: "classify",
2318
+ kind: "Async"
2319
+ }
2320
+ },
2321
+ {
2322
+ channelName: mistralChannels.classifiersClassify.channelName,
2323
+ module: {
2324
+ name: "@mistralai/mistralai",
2325
+ versionRange: ">=2.0.0 <3.0.0",
2326
+ filePath: "esm/sdk/classifiers.js"
2327
+ },
2328
+ functionQuery: {
2329
+ className: "Classifiers",
2330
+ methodName: "classify",
2331
+ kind: "Async"
2332
+ }
2333
+ },
2334
+ {
2335
+ channelName: mistralChannels.classifiersClassifyChat.channelName,
2336
+ module: {
2337
+ name: "@mistralai/mistralai",
2338
+ versionRange: ">=1.10.0 <2.0.0",
2339
+ filePath: "sdk/classifiers.js"
2340
+ },
2341
+ functionQuery: {
2342
+ className: "Classifiers",
2343
+ methodName: "classifyChat",
2344
+ kind: "Async"
2345
+ }
2346
+ },
2347
+ {
2348
+ channelName: mistralChannels.classifiersClassifyChat.channelName,
2349
+ module: {
2350
+ name: "@mistralai/mistralai",
2351
+ versionRange: ">=2.0.0 <3.0.0",
2352
+ filePath: "esm/sdk/classifiers.js"
2353
+ },
2354
+ functionQuery: {
2355
+ className: "Classifiers",
2356
+ methodName: "classifyChat",
2357
+ kind: "Async"
2358
+ }
2359
+ },
2360
+ {
2361
+ channelName: mistralChannels.fimComplete.channelName,
2362
+ module: {
2363
+ name: "@mistralai/mistralai",
2364
+ versionRange: ">=1.0.0 <2.0.0",
2365
+ filePath: "sdk/fim.js"
2366
+ },
2367
+ functionQuery: {
2368
+ className: "Fim",
2369
+ methodName: "complete",
2370
+ kind: "Async"
2371
+ }
2372
+ },
2373
+ {
2374
+ channelName: mistralChannels.fimComplete.channelName,
2375
+ module: {
2376
+ name: "@mistralai/mistralai",
2377
+ versionRange: ">=2.0.0 <3.0.0",
2378
+ filePath: "esm/sdk/fim.js"
2379
+ },
2380
+ functionQuery: {
2381
+ className: "Fim",
2382
+ methodName: "complete",
2383
+ kind: "Async"
2384
+ }
2385
+ },
2386
+ {
2387
+ channelName: mistralChannels.fimStream.channelName,
2388
+ module: {
2389
+ name: "@mistralai/mistralai",
2390
+ versionRange: ">=1.0.0 <2.0.0",
2391
+ filePath: "sdk/fim.js"
2392
+ },
2393
+ functionQuery: {
2394
+ className: "Fim",
2395
+ methodName: "stream",
2396
+ kind: "Async"
2397
+ }
2398
+ },
2399
+ {
2400
+ channelName: mistralChannels.fimStream.channelName,
2401
+ module: {
2402
+ name: "@mistralai/mistralai",
2403
+ versionRange: ">=2.0.0 <3.0.0",
2404
+ filePath: "esm/sdk/fim.js"
2405
+ },
2406
+ functionQuery: {
2407
+ className: "Fim",
2408
+ methodName: "stream",
2409
+ kind: "Async"
2410
+ }
2411
+ },
2412
+ {
2413
+ channelName: mistralChannels.agentsComplete.channelName,
2414
+ module: {
2415
+ name: "@mistralai/mistralai",
2416
+ versionRange: ">=1.0.0 <2.0.0",
2417
+ filePath: "sdk/agents.js"
2418
+ },
2419
+ functionQuery: {
2420
+ className: "Agents",
2421
+ methodName: "complete",
2422
+ kind: "Async"
2423
+ }
2424
+ },
2425
+ {
2426
+ channelName: mistralChannels.agentsComplete.channelName,
2427
+ module: {
2428
+ name: "@mistralai/mistralai",
2429
+ versionRange: ">=2.0.0 <3.0.0",
2430
+ filePath: "esm/sdk/agents.js"
2431
+ },
2432
+ functionQuery: {
2433
+ className: "Agents",
2434
+ methodName: "complete",
2435
+ kind: "Async"
2436
+ }
2437
+ },
2438
+ {
2439
+ channelName: mistralChannels.agentsStream.channelName,
2440
+ module: {
2441
+ name: "@mistralai/mistralai",
2442
+ versionRange: ">=1.0.0 <2.0.0",
2443
+ filePath: "sdk/agents.js"
2444
+ },
2445
+ functionQuery: {
2446
+ className: "Agents",
2447
+ methodName: "stream",
2448
+ kind: "Async"
2449
+ }
2450
+ },
2451
+ {
2452
+ channelName: mistralChannels.agentsStream.channelName,
2453
+ module: {
2454
+ name: "@mistralai/mistralai",
2455
+ versionRange: ">=2.0.0 <3.0.0",
2456
+ filePath: "esm/sdk/agents.js"
2457
+ },
2458
+ functionQuery: {
2459
+ className: "Agents",
2460
+ methodName: "stream",
2461
+ kind: "Async"
2462
+ }
2463
+ }
2464
+ ];
2465
+
2466
+ // src/instrumentation/plugins/openai-agents-channels.ts
2467
+ var openAIAgentsCoreChannels = defineChannels("@openai/agents-core", {
2468
+ onTraceStart: channel({
2469
+ channelName: "tracing.processor.onTraceStart",
2470
+ kind: "async"
2471
+ }),
2472
+ onTraceEnd: channel({
2473
+ channelName: "tracing.processor.onTraceEnd",
2474
+ kind: "async"
2475
+ }),
2476
+ onSpanStart: channel({
2477
+ channelName: "tracing.processor.onSpanStart",
2478
+ kind: "async"
2479
+ }),
2480
+ onSpanEnd: channel({
2481
+ channelName: "tracing.processor.onSpanEnd",
2482
+ kind: "async"
2483
+ })
2484
+ });
2485
+
2486
+ // src/auto-instrumentations/configs/openai-agents.ts
2487
+ var lifecycleMethods = [
2488
+ ["onTraceStart", openAIAgentsCoreChannels.onTraceStart.channelName],
2489
+ ["onTraceEnd", openAIAgentsCoreChannels.onTraceEnd.channelName],
2490
+ ["onSpanStart", openAIAgentsCoreChannels.onSpanStart.channelName],
2491
+ ["onSpanEnd", openAIAgentsCoreChannels.onSpanEnd.channelName]
2492
+ ];
2493
+ var openAIAgentsCoreConfigs = lifecycleMethods.flatMap(
2494
+ ([methodName, channelName]) => ["dist/tracing/processor.mjs", "dist/tracing/processor.js"].map(
2495
+ (filePath) => ({
2496
+ channelName,
2497
+ module: {
2498
+ name: "@openai/agents-core",
2499
+ versionRange: ">=0.0.14",
2500
+ filePath
2501
+ },
2502
+ functionQuery: {
2503
+ className: "MultiTracingProcessor",
2504
+ methodName,
2505
+ kind: "Async"
2506
+ }
2507
+ })
2508
+ )
2509
+ );
2510
+
2511
+ // src/instrumentation/plugins/openai-channels.ts
2512
+ var openAIChannels = defineChannels("openai", {
2513
+ chatCompletionsCreate: channel({
2514
+ channelName: "chat.completions.create",
2515
+ kind: "async"
2516
+ }),
2517
+ embeddingsCreate: channel({
2518
+ channelName: "embeddings.create",
2519
+ kind: "async"
2520
+ }),
2521
+ betaChatCompletionsParse: channel({
2522
+ channelName: "beta.chat.completions.parse",
2523
+ kind: "async"
2524
+ }),
2525
+ betaChatCompletionsStream: channel({
2526
+ channelName: "beta.chat.completions.stream",
2527
+ kind: "sync-stream"
2528
+ }),
2529
+ moderationsCreate: channel({
2530
+ channelName: "moderations.create",
2531
+ kind: "async"
2532
+ }),
2533
+ responsesCreate: channel({
2534
+ channelName: "responses.create",
2535
+ kind: "async"
2536
+ }),
2537
+ responsesStream: channel({
2538
+ channelName: "responses.stream",
2539
+ kind: "sync-stream"
2540
+ }),
2541
+ responsesParse: channel({
2542
+ channelName: "responses.parse",
2543
+ kind: "async"
2544
+ }),
2545
+ responsesCompact: channel({
2546
+ channelName: "responses.compact",
2547
+ kind: "async"
2548
+ })
2549
+ });
2550
+
2551
+ // src/auto-instrumentations/configs/openai.ts
2552
+ var openaiConfigs = [
2553
+ // Chat Completions
2554
+ {
2555
+ channelName: openAIChannels.chatCompletionsCreate.channelName,
2556
+ module: {
2557
+ name: "openai",
2558
+ versionRange: ">=4.0.0 <5.0.0",
2559
+ filePath: "resources/chat/completions.mjs"
2560
+ },
2561
+ functionQuery: {
2562
+ className: "Completions",
2563
+ methodName: "create",
2564
+ kind: "Async"
2565
+ }
2566
+ },
2567
+ {
2568
+ channelName: openAIChannels.chatCompletionsCreate.channelName,
2569
+ module: {
2570
+ name: "openai",
2571
+ versionRange: ">=4.0.0 <5.0.0",
2572
+ filePath: "resources/chat/completions/completions.mjs"
2573
+ },
2574
+ functionQuery: {
2575
+ className: "Completions",
2576
+ methodName: "create",
2577
+ kind: "Async"
2578
+ }
2579
+ },
2580
+ {
2581
+ channelName: openAIChannels.chatCompletionsCreate.channelName,
2582
+ module: {
2583
+ name: "openai",
2584
+ versionRange: ">=5.0.0",
2585
+ filePath: "resources/chat/completions/completions.mjs"
2586
+ },
2587
+ functionQuery: {
2588
+ className: "Completions",
2589
+ methodName: "create",
2590
+ kind: "Async"
2591
+ }
2592
+ },
2593
+ // Embeddings
2594
+ {
2595
+ channelName: openAIChannels.embeddingsCreate.channelName,
2596
+ module: {
2597
+ name: "openai",
2598
+ versionRange: ">=4.0.0",
2599
+ filePath: "resources/embeddings.mjs"
2600
+ },
2601
+ functionQuery: {
2602
+ className: "Embeddings",
2603
+ methodName: "create",
2604
+ kind: "Async"
2605
+ }
2606
+ },
2607
+ // Beta Chat Completions Parse
2608
+ {
2609
+ channelName: openAIChannels.betaChatCompletionsParse.channelName,
2610
+ module: {
2611
+ name: "openai",
2612
+ versionRange: ">=4.0.0 <5.0.0",
2613
+ filePath: "resources/beta/chat/completions.mjs"
2614
+ },
2615
+ functionQuery: {
2616
+ className: "Completions",
2617
+ methodName: "parse",
2618
+ kind: "Async"
2619
+ }
2620
+ },
2621
+ {
2622
+ channelName: openAIChannels.betaChatCompletionsParse.channelName,
2623
+ module: {
2624
+ name: "openai",
2625
+ versionRange: ">=5.0.0",
2626
+ filePath: "resources/chat/completions/completions.mjs"
2627
+ },
2628
+ functionQuery: {
2629
+ className: "Completions",
2630
+ methodName: "parse",
2631
+ kind: "Async"
2632
+ }
2633
+ },
2634
+ // Moderations
2635
+ {
2636
+ channelName: openAIChannels.moderationsCreate.channelName,
2637
+ module: {
2638
+ name: "openai",
2639
+ versionRange: ">=4.0.0",
2640
+ filePath: "resources/moderations.mjs"
2641
+ },
2642
+ functionQuery: {
2643
+ className: "Moderations",
2644
+ methodName: "create",
2645
+ kind: "Async"
2646
+ }
2647
+ },
2648
+ // Beta Chat Completions Stream
2649
+ {
2650
+ channelName: openAIChannels.betaChatCompletionsStream.channelName,
2651
+ module: {
2652
+ name: "openai",
2653
+ versionRange: ">=4.0.0 <5.0.0",
2654
+ filePath: "resources/beta/chat/completions.mjs"
2655
+ },
2656
+ functionQuery: {
2657
+ className: "Completions",
2658
+ methodName: "stream",
2659
+ kind: "Sync"
2660
+ }
2661
+ },
2662
+ {
2663
+ channelName: openAIChannels.betaChatCompletionsStream.channelName,
2664
+ module: {
2665
+ name: "openai",
2666
+ versionRange: ">=5.0.0",
2667
+ filePath: "resources/chat/completions/completions.mjs"
2668
+ },
2669
+ functionQuery: {
2670
+ className: "Completions",
2671
+ methodName: "stream",
2672
+ kind: "Sync"
2673
+ }
1991
2674
  },
2675
+ // Responses API (v4.87.0+)
1992
2676
  {
1993
- channelName: cohereChannels.chatStream.channelName,
2677
+ channelName: openAIChannels.responsesCreate.channelName,
1994
2678
  module: {
1995
- name: "cohere-ai",
1996
- versionRange: ">=7.20.0 <8.0.0",
1997
- filePath: "api/resources/v2/client/Client.js"
2679
+ name: "openai",
2680
+ versionRange: ">=4.87.0",
2681
+ filePath: "resources/responses/responses.mjs"
1998
2682
  },
1999
2683
  functionQuery: {
2000
- className: "V2Client",
2001
- methodName: "chatStream",
2684
+ className: "Responses",
2685
+ methodName: "create",
2002
2686
  kind: "Async"
2003
2687
  }
2004
2688
  },
2005
2689
  {
2006
- channelName: cohereChannels.chatStream.channelName,
2690
+ channelName: openAIChannels.responsesStream.channelName,
2007
2691
  module: {
2008
- name: "cohere-ai",
2009
- versionRange: ">=8.0.0 <9.0.0",
2010
- filePath: "Client.js"
2692
+ name: "openai",
2693
+ versionRange: ">=4.87.0",
2694
+ filePath: "resources/responses/responses.mjs"
2011
2695
  },
2012
2696
  functionQuery: {
2013
- className: "CohereClient",
2014
- methodName: "chatStream",
2015
- kind: "Async"
2697
+ className: "Responses",
2698
+ methodName: "stream",
2699
+ kind: "Sync"
2016
2700
  }
2017
2701
  },
2018
2702
  {
2019
- channelName: cohereChannels.chatStream.channelName,
2703
+ channelName: openAIChannels.responsesParse.channelName,
2020
2704
  module: {
2021
- name: "cohere-ai",
2022
- versionRange: ">=8.0.0 <9.0.0",
2023
- filePath: "api/resources/v2/client/Client.js"
2705
+ name: "openai",
2706
+ versionRange: ">=4.87.0",
2707
+ filePath: "resources/responses/responses.mjs"
2024
2708
  },
2025
2709
  functionQuery: {
2026
- className: "V2Client",
2027
- methodName: "chatStream",
2710
+ className: "Responses",
2711
+ methodName: "parse",
2028
2712
  kind: "Async"
2029
2713
  }
2030
2714
  },
2031
2715
  {
2032
- channelName: cohereChannels.embed.channelName,
2716
+ channelName: openAIChannels.responsesCompact.channelName,
2033
2717
  module: {
2034
- name: "cohere-ai",
2035
- versionRange: ">=7.0.0 <8.0.0",
2036
- filePath: "Client.js"
2718
+ name: "openai",
2719
+ versionRange: ">=6.10.0",
2720
+ filePath: "resources/responses/responses.mjs"
2037
2721
  },
2038
2722
  functionQuery: {
2039
- className: "CohereClient",
2040
- methodName: "embed",
2723
+ className: "Responses",
2724
+ methodName: "compact",
2041
2725
  kind: "Async"
2042
2726
  }
2043
- },
2727
+ }
2728
+ ];
2729
+
2730
+ // src/instrumentation/plugins/openai-codex-channels.ts
2731
+ var openAICodexChannels = defineChannels("@openai/codex-sdk", {
2732
+ run: channel({
2733
+ channelName: "Thread.run",
2734
+ kind: "async"
2735
+ }),
2736
+ runStreamed: channel({
2737
+ channelName: "Thread.runStreamed",
2738
+ kind: "async"
2739
+ })
2740
+ });
2741
+
2742
+ // src/auto-instrumentations/configs/openai-codex.ts
2743
+ var openAICodexVersionRange = ">=0.128.0 <1.0.0";
2744
+ var openAICodexConfigs = [
2044
2745
  {
2045
- channelName: cohereChannels.embed.channelName,
2746
+ channelName: openAICodexChannels.run.channelName,
2046
2747
  module: {
2047
- name: "cohere-ai",
2048
- versionRange: ">=7.20.0 <8.0.0",
2049
- filePath: "api/resources/v2/client/Client.js"
2748
+ name: "@openai/codex-sdk",
2749
+ versionRange: openAICodexVersionRange,
2750
+ filePath: "dist/index.js"
2050
2751
  },
2051
2752
  functionQuery: {
2052
- className: "V2Client",
2053
- methodName: "embed",
2753
+ className: "Thread",
2754
+ methodName: "run",
2054
2755
  kind: "Async"
2055
2756
  }
2056
2757
  },
2057
2758
  {
2058
- channelName: cohereChannels.embed.channelName,
2759
+ channelName: openAICodexChannels.runStreamed.channelName,
2059
2760
  module: {
2060
- name: "cohere-ai",
2061
- versionRange: ">=8.0.0 <9.0.0",
2062
- filePath: "Client.js"
2761
+ name: "@openai/codex-sdk",
2762
+ versionRange: openAICodexVersionRange,
2763
+ filePath: "dist/index.js"
2063
2764
  },
2064
2765
  functionQuery: {
2065
- className: "CohereClient",
2066
- methodName: "embed",
2766
+ className: "Thread",
2767
+ methodName: "runStreamed",
2067
2768
  kind: "Async"
2068
2769
  }
2069
- },
2770
+ }
2771
+ ];
2772
+
2773
+ // src/instrumentation/plugins/openrouter-channels.ts
2774
+ var openRouterChannels = defineChannels("@openrouter/sdk", {
2775
+ chatSend: channel({
2776
+ channelName: "chat.send",
2777
+ kind: "async"
2778
+ }),
2779
+ embeddingsGenerate: channel({
2780
+ channelName: "embeddings.generate",
2781
+ kind: "async"
2782
+ }),
2783
+ rerankRerank: channel(
2784
+ {
2785
+ channelName: "rerank.rerank",
2786
+ kind: "async"
2787
+ }
2788
+ ),
2789
+ betaResponsesSend: channel({
2790
+ channelName: "beta.responses.send",
2791
+ kind: "async"
2792
+ }),
2793
+ callModel: channel({
2794
+ channelName: "callModel",
2795
+ kind: "sync-stream"
2796
+ }),
2797
+ callModelTurn: channel({
2798
+ channelName: "callModel.turn",
2799
+ kind: "async"
2800
+ }),
2801
+ toolExecute: channel({
2802
+ channelName: "tool.execute",
2803
+ kind: "async"
2804
+ })
2805
+ });
2806
+
2807
+ // src/auto-instrumentations/configs/openrouter.ts
2808
+ var openRouterConfigs = [
2070
2809
  {
2071
- channelName: cohereChannels.embed.channelName,
2810
+ channelName: openRouterChannels.chatSend.channelName,
2072
2811
  module: {
2073
- name: "cohere-ai",
2074
- versionRange: ">=8.0.0 <9.0.0",
2075
- filePath: "api/resources/v2/client/Client.js"
2812
+ name: "@openrouter/sdk",
2813
+ versionRange: ">=0.9.11 <1.0.0",
2814
+ filePath: "esm/sdk/chat.js"
2076
2815
  },
2077
2816
  functionQuery: {
2078
- className: "V2Client",
2079
- methodName: "embed",
2817
+ className: "Chat",
2818
+ methodName: "send",
2080
2819
  kind: "Async"
2081
2820
  }
2082
2821
  },
2083
2822
  {
2084
- channelName: cohereChannels.rerank.channelName,
2823
+ channelName: openRouterChannels.embeddingsGenerate.channelName,
2085
2824
  module: {
2086
- name: "cohere-ai",
2087
- versionRange: ">=7.0.0 <8.0.0",
2088
- filePath: "Client.js"
2825
+ name: "@openrouter/sdk",
2826
+ versionRange: ">=0.9.11 <1.0.0",
2827
+ filePath: "esm/sdk/embeddings.js"
2089
2828
  },
2090
2829
  functionQuery: {
2091
- className: "CohereClient",
2092
- methodName: "rerank",
2830
+ className: "Embeddings",
2831
+ methodName: "generate",
2093
2832
  kind: "Async"
2094
2833
  }
2095
2834
  },
2096
2835
  {
2097
- channelName: cohereChannels.rerank.channelName,
2836
+ channelName: openRouterChannels.rerankRerank.channelName,
2098
2837
  module: {
2099
- name: "cohere-ai",
2100
- versionRange: ">=7.20.0 <8.0.0",
2101
- filePath: "api/resources/v2/client/Client.js"
2838
+ name: "@openrouter/sdk",
2839
+ versionRange: ">=0.12.0 <1.0.0",
2840
+ filePath: "esm/sdk/rerank.js"
2102
2841
  },
2103
2842
  functionQuery: {
2104
- className: "V2Client",
2843
+ className: "Rerank",
2105
2844
  methodName: "rerank",
2106
2845
  kind: "Async"
2107
2846
  }
2108
2847
  },
2109
2848
  {
2110
- channelName: cohereChannels.rerank.channelName,
2849
+ channelName: openRouterChannels.betaResponsesSend.channelName,
2111
2850
  module: {
2112
- name: "cohere-ai",
2113
- versionRange: ">=8.0.0 <9.0.0",
2114
- filePath: "Client.js"
2851
+ name: "@openrouter/sdk",
2852
+ versionRange: ">=0.9.11 <1.0.0",
2853
+ filePath: "esm/sdk/responses.js"
2115
2854
  },
2116
2855
  functionQuery: {
2117
- className: "CohereClient",
2118
- methodName: "rerank",
2856
+ className: "Responses",
2857
+ methodName: "send",
2119
2858
  kind: "Async"
2120
2859
  }
2121
2860
  },
2122
2861
  {
2123
- channelName: cohereChannels.rerank.channelName,
2862
+ channelName: openRouterChannels.callModel.channelName,
2124
2863
  module: {
2125
- name: "cohere-ai",
2126
- versionRange: ">=8.0.0 <9.0.0",
2127
- filePath: "api/resources/v2/client/Client.js"
2864
+ name: "@openrouter/sdk",
2865
+ versionRange: ">=0.9.11 <1.0.0",
2866
+ filePath: "esm/sdk/sdk.js"
2128
2867
  },
2129
2868
  functionQuery: {
2130
- className: "V2Client",
2131
- methodName: "rerank",
2132
- kind: "Async"
2869
+ className: "OpenRouter",
2870
+ methodName: "callModel",
2871
+ kind: "Sync"
2133
2872
  }
2134
2873
  }
2135
2874
  ];
2136
2875
 
2137
- // src/instrumentation/plugins/groq-channels.ts
2138
- var groqChannels = defineChannels("groq-sdk", {
2139
- chatCompletionsCreate: channel({
2140
- channelName: "chat.completions.create",
2876
+ // src/instrumentation/plugins/openrouter-agent-channels.ts
2877
+ var openRouterAgentChannels = defineChannels("@openrouter/agent", {
2878
+ callModel: channel({
2879
+ channelName: "callModel",
2880
+ kind: "sync-stream"
2881
+ }),
2882
+ callModelTurn: channel({
2883
+ channelName: "callModel.turn",
2141
2884
  kind: "async"
2142
2885
  }),
2143
- embeddingsCreate: channel(
2144
- {
2145
- channelName: "embeddings.create",
2146
- kind: "async"
2147
- }
2148
- )
2886
+ toolExecute: channel({
2887
+ channelName: "tool.execute",
2888
+ kind: "async"
2889
+ })
2149
2890
  });
2150
2891
 
2151
- // src/auto-instrumentations/configs/groq.ts
2152
- var groqConfigs = [
2892
+ // src/auto-instrumentations/configs/openrouter-agent.ts
2893
+ var openRouterAgentConfigs = [
2153
2894
  {
2154
- channelName: groqChannels.chatCompletionsCreate.channelName,
2895
+ channelName: openRouterAgentChannels.callModel.channelName,
2155
2896
  module: {
2156
- name: "groq-sdk",
2157
- versionRange: ">=1.0.0",
2158
- filePath: "resources/chat/completions.mjs"
2897
+ name: "@openrouter/agent",
2898
+ versionRange: ">=0.1.2",
2899
+ filePath: "esm/inner-loop/call-model.js"
2159
2900
  },
2160
2901
  functionQuery: {
2161
- className: "Completions",
2162
- methodName: "create",
2163
- kind: "Async"
2902
+ functionName: "callModel",
2903
+ kind: "Sync"
2164
2904
  }
2905
+ }
2906
+ ];
2907
+
2908
+ // src/auto-instrumentations/configs/all.ts
2909
+ var defaultInstrumentationConfigGroups = [
2910
+ { integrations: ["openai"], configs: openaiConfigs },
2911
+ {
2912
+ integrations: ["openaiCodexSDK"],
2913
+ configs: openAICodexConfigs
2165
2914
  },
2915
+ { integrations: ["anthropic"], configs: anthropicConfigs },
2166
2916
  {
2167
- channelName: groqChannels.embeddingsCreate.channelName,
2168
- module: {
2169
- name: "groq-sdk",
2170
- versionRange: ">=1.0.0",
2171
- filePath: "resources/embeddings.mjs"
2172
- },
2173
- functionQuery: {
2174
- className: "Embeddings",
2175
- methodName: "create",
2176
- kind: "Async"
2177
- }
2917
+ integrations: ["aisdk", "vercel"],
2918
+ configs: aiSDKConfigs
2919
+ },
2920
+ {
2921
+ integrations: ["claudeAgentSDK"],
2922
+ configs: claudeAgentSDKConfigs
2923
+ },
2924
+ { integrations: ["cursor", "cursorSDK"], configs: cursorSDKConfigs },
2925
+ { integrations: ["flue"], configs: flueConfigs },
2926
+ {
2927
+ integrations: ["openAIAgents"],
2928
+ configs: openAIAgentsCoreConfigs
2929
+ },
2930
+ {
2931
+ integrations: ["google", "googleGenAI"],
2932
+ configs: googleGenAIConfigs
2933
+ },
2934
+ { integrations: ["huggingface"], configs: huggingFaceConfigs },
2935
+ {
2936
+ integrations: ["langchain", "langgraph"],
2937
+ configs: langchainConfigs
2938
+ },
2939
+ { integrations: ["openrouter"], configs: openRouterConfigs },
2940
+ {
2941
+ integrations: ["openrouterAgent"],
2942
+ configs: openRouterAgentConfigs
2943
+ },
2944
+ { integrations: ["mistral"], configs: mistralConfigs },
2945
+ { integrations: ["googleADK"], configs: googleADKConfigs },
2946
+ { integrations: ["cohere"], configs: cohereConfigs },
2947
+ { integrations: ["groq"], configs: groqConfigs },
2948
+ {
2949
+ integrations: ["genkit"],
2950
+ configs: genkitConfigs
2951
+ },
2952
+ {
2953
+ integrations: ["gitHubCopilot"],
2954
+ configs: gitHubCopilotConfigs
2178
2955
  }
2179
2956
  ];
2957
+ function getDefaultInstrumentationConfigs({
2958
+ additionalInstrumentations,
2959
+ disabledIntegrationConfig,
2960
+ disabledIntegrations
2961
+ } = {}) {
2962
+ const disabledConfig = disabledIntegrationConfig ?? (disabledIntegrations ? readDisabledInstrumentationEnvConfig(
2963
+ [...disabledIntegrations].join(",")
2964
+ ).integrations : void 0);
2965
+ return [
2966
+ ...defaultInstrumentationConfigGroups.flatMap(
2967
+ ({ configs, integrations }) => isInstrumentationIntegrationDisabled(disabledConfig, ...integrations) ? [] : configs
2968
+ ),
2969
+ ...additionalInstrumentations ?? []
2970
+ ];
2971
+ }
2972
+ function getDefaultAutoInstrumentationConfigs() {
2973
+ return getDefaultInstrumentationConfigs({
2974
+ disabledIntegrationConfig: readDisabledInstrumentationEnvConfig(
2975
+ process.env.BRAINTRUST_DISABLE_INSTRUMENTATION
2976
+ ).integrations
2977
+ });
2978
+ }
2180
2979
 
2181
2980
  // src/auto-instrumentations/loader/cjs-patch.ts
2182
2981
  import {
@@ -2215,8 +3014,12 @@ var ModulePatch = class {
2215
3014
  if (!self.packages.has(packageName)) {
2216
3015
  return self.originalCompile.apply(this, args);
2217
3016
  }
2218
- const version = getPackageVersion(resolvedModule.basedir);
2219
3017
  const normalizedModulePath = resolvedModule.path.replace(/\\/g, "/");
3018
+ if (packageName === "openai" && normalizedModulePath.includes("api-promise")) {
3019
+ args[0] = content + OPENAI_API_PROMISE_PATCH;
3020
+ return self.originalCompile.apply(this, args);
3021
+ }
3022
+ const version = getPackageVersion(resolvedModule.basedir);
2220
3023
  const transformer = self.instrumentator.getTransformer(
2221
3024
  packageName,
2222
3025
  version,
@@ -2272,7 +3075,11 @@ function patchTracingChannel(tracingChannelFn) {
2272
3075
  }
2273
3076
  if (TracingChannel.prototype.tracePromise) {
2274
3077
  TracingChannel.prototype.tracePromise = function(fn, context = {}, thisArg, ...args) {
2275
- const { start, end, asyncStart, asyncEnd, error } = this;
3078
+ const start = this.start;
3079
+ const end = this.end;
3080
+ const asyncStart = this.asyncStart;
3081
+ const asyncEnd = this.asyncEnd;
3082
+ const error = this.error;
2276
3083
  function publishRejected(err) {
2277
3084
  context.error = err;
2278
3085
  error?.publish(context);
@@ -2335,59 +3142,39 @@ function patchTracingChannel(tracingChannelFn) {
2335
3142
  }
2336
3143
 
2337
3144
  // src/auto-instrumentations/hook.mts
2338
- var dcPath = ["node", "diagnostics_channel"].join(":");
2339
- var dc = await import(
2340
- /* @vite-ignore */
2341
- dcPath
2342
- );
2343
- patchTracingChannel(dc.tracingChannel);
2344
- function readDisabledIntegrations() {
2345
- const raw = process.env.BRAINTRUST_DISABLE_INSTRUMENTATION;
2346
- if (!raw) {
2347
- return /* @__PURE__ */ new Set();
2348
- }
2349
- return new Set(
2350
- raw.split(",").map((value) => value.trim().toLowerCase()).filter((value) => value.length > 0)
3145
+ var state = globalThis[/* @__PURE__ */ Symbol.for("braintrust.applyAutoInstrumentation")] ??= {};
3146
+ var alreadyApplied = state.applied;
3147
+ if (!alreadyApplied) {
3148
+ const dcPath = ["node", "diagnostics_channel"].join(":");
3149
+ const dc = await import(
3150
+ /* @vite-ignore */
3151
+ dcPath
2351
3152
  );
3153
+ patchTracingChannel(dc.tracingChannel);
2352
3154
  }
2353
- function isDisabled(disabled, ...names) {
2354
- return names.some((name) => disabled.has(name));
2355
- }
2356
- var disabledIntegrations = readDisabledIntegrations();
2357
- var allConfigs = [
2358
- ...isDisabled(disabledIntegrations, "openai") ? [] : openaiConfigs,
2359
- ...isDisabled(disabledIntegrations, "anthropic") ? [] : anthropicConfigs,
2360
- ...isDisabled(disabledIntegrations, "aisdk", "ai-sdk", "vercel-ai") ? [] : aiSDKConfigs,
2361
- ...isDisabled(disabledIntegrations, "claudeagentsdk", "claude-agent-sdk") ? [] : claudeAgentSDKConfigs,
2362
- ...isDisabled(disabledIntegrations, "cursor", "cursor-sdk") ? [] : cursorSDKConfigs,
2363
- ...isDisabled(disabledIntegrations, "google", "google-genai") ? [] : googleGenAIConfigs,
2364
- ...isDisabled(disabledIntegrations, "huggingface") ? [] : huggingFaceConfigs,
2365
- ...isDisabled(disabledIntegrations, "openrouter") ? [] : openRouterConfigs,
2366
- ...isDisabled(disabledIntegrations, "openrouteragent", "openrouter-agent") ? [] : openRouterAgentConfigs,
2367
- ...isDisabled(disabledIntegrations, "mistral") ? [] : mistralConfigs,
2368
- ...isDisabled(disabledIntegrations, "googleadk", "google-adk") ? [] : googleADKConfigs,
2369
- ...isDisabled(disabledIntegrations, "cohere") ? [] : cohereConfigs,
2370
- ...isDisabled(disabledIntegrations, "groq", "groq-sdk") ? [] : groqConfigs
2371
- ];
2372
- register("./loader/esm-hook.mjs", {
2373
- parentURL: import.meta.url,
2374
- data: { instrumentations: allConfigs }
2375
- });
2376
- try {
2377
- const patch = new ModulePatch({ instrumentations: allConfigs });
2378
- patch.patch();
2379
- if (process.env.DEBUG === "@braintrust*" || process.env.DEBUG === "*") {
2380
- console.log(
2381
- "[Braintrust] Auto-instrumentation active (ESM + CJS) for:",
2382
- allConfigs.map((c) => c.channelName).join(", ")
2383
- );
2384
- }
2385
- } catch (err) {
2386
- if (process.env.DEBUG === "@braintrust*" || process.env.DEBUG === "*") {
2387
- console.log(
2388
- "[Braintrust] Auto-instrumentation active (ESM only) for:",
2389
- allConfigs.map((c) => c.channelName).join(", ")
2390
- );
2391
- console.error("[Braintrust] CJS patch failed:", err);
3155
+ if (!alreadyApplied) {
3156
+ const allConfigs = getDefaultAutoInstrumentationConfigs();
3157
+ register("./loader/esm-hook.mjs", {
3158
+ parentURL: import.meta.url,
3159
+ data: { instrumentations: allConfigs }
3160
+ });
3161
+ state.applied = true;
3162
+ try {
3163
+ const patch = new ModulePatch({ instrumentations: allConfigs });
3164
+ patch.patch();
3165
+ if (process.env.DEBUG === "@braintrust*" || process.env.DEBUG === "*") {
3166
+ console.log(
3167
+ "[Braintrust] Auto-instrumentation active (ESM + CJS) for:",
3168
+ allConfigs.map((c) => c.channelName).join(", ")
3169
+ );
3170
+ }
3171
+ } catch (err) {
3172
+ if (process.env.DEBUG === "@braintrust*" || process.env.DEBUG === "*") {
3173
+ console.log(
3174
+ "[Braintrust] Auto-instrumentation active (ESM only) for:",
3175
+ allConfigs.map((c) => c.channelName).join(", ")
3176
+ );
3177
+ console.error("[Braintrust] CJS patch failed:", err);
3178
+ }
2392
3179
  }
2393
3180
  }