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