braintrust 3.8.0 → 3.9.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 (48) hide show
  1. package/dev/dist/index.d.mts +84 -3
  2. package/dev/dist/index.d.ts +84 -3
  3. package/dev/dist/index.js +3687 -691
  4. package/dev/dist/index.mjs +3399 -403
  5. package/dist/auto-instrumentations/bundler/esbuild.cjs +575 -2
  6. package/dist/auto-instrumentations/bundler/esbuild.mjs +2 -2
  7. package/dist/auto-instrumentations/bundler/rollup.cjs +575 -2
  8. package/dist/auto-instrumentations/bundler/rollup.mjs +2 -2
  9. package/dist/auto-instrumentations/bundler/vite.cjs +575 -2
  10. package/dist/auto-instrumentations/bundler/vite.mjs +2 -2
  11. package/dist/auto-instrumentations/bundler/webpack-loader.cjs +575 -2
  12. package/dist/auto-instrumentations/bundler/webpack.cjs +575 -2
  13. package/dist/auto-instrumentations/bundler/webpack.mjs +2 -2
  14. package/dist/auto-instrumentations/{chunk-MD7W27YH.mjs → chunk-G7F6HZGE.mjs} +5 -1
  15. package/dist/auto-instrumentations/{chunk-OLBMPZXE.mjs → chunk-KIMMUFAK.mjs} +578 -3
  16. package/dist/auto-instrumentations/hook.mjs +757 -10
  17. package/dist/auto-instrumentations/index.cjs +739 -2
  18. package/dist/auto-instrumentations/index.d.mts +18 -1
  19. package/dist/auto-instrumentations/index.d.ts +18 -1
  20. package/dist/auto-instrumentations/index.mjs +168 -1
  21. package/dist/auto-instrumentations/loader/esm-hook.mjs +2 -1
  22. package/dist/browser.d.mts +312 -6
  23. package/dist/browser.d.ts +312 -6
  24. package/dist/browser.js +5335 -1892
  25. package/dist/browser.mjs +5335 -1892
  26. package/dist/cli.js +3514 -489
  27. package/dist/edge-light.d.mts +1 -1
  28. package/dist/edge-light.d.ts +1 -1
  29. package/dist/edge-light.js +5335 -1892
  30. package/dist/edge-light.mjs +5335 -1892
  31. package/dist/index.d.mts +312 -6
  32. package/dist/index.d.ts +312 -6
  33. package/dist/index.js +4244 -801
  34. package/dist/index.mjs +5335 -1892
  35. package/dist/instrumentation/index.d.mts +10 -0
  36. package/dist/instrumentation/index.d.ts +10 -0
  37. package/dist/instrumentation/index.js +3160 -286
  38. package/dist/instrumentation/index.mjs +3160 -286
  39. package/dist/workerd.d.mts +1 -1
  40. package/dist/workerd.d.ts +1 -1
  41. package/dist/workerd.js +5335 -1892
  42. package/dist/workerd.mjs +5335 -1892
  43. package/package.json +52 -47
  44. package/util/dist/index.d.mts +42 -1
  45. package/util/dist/index.d.ts +42 -1
  46. package/util/dist/index.js +5 -1
  47. package/util/dist/index.mjs +4 -0
  48. package/LICENSE +0 -201
@@ -377,6 +377,10 @@ var anthropicChannels = defineChannels("@anthropic-ai/sdk", {
377
377
  betaMessagesCreate: channel({
378
378
  channelName: "beta.messages.create",
379
379
  kind: "async"
380
+ }),
381
+ betaMessagesToolRunner: channel({
382
+ channelName: "beta.messages.toolRunner",
383
+ kind: "sync-stream"
380
384
  })
381
385
  });
382
386
 
@@ -423,6 +427,20 @@ var anthropicConfigs = [
423
427
  methodName: "create",
424
428
  kind: "Async"
425
429
  }
430
+ },
431
+ // Beta Messages API - toolRunner (sync helper returning async iterable/thenable)
432
+ {
433
+ channelName: anthropicChannels.betaMessagesToolRunner.channelName,
434
+ module: {
435
+ name: "@anthropic-ai/sdk",
436
+ versionRange: ">=0.39.0",
437
+ filePath: "resources/beta/messages/messages.mjs"
438
+ },
439
+ functionQuery: {
440
+ className: "Messages",
441
+ methodName: "toolRunner",
442
+ kind: "Sync"
443
+ }
426
444
  }
427
445
  ];
428
446
 
@@ -462,6 +480,10 @@ var aiSDKChannels = defineChannels("ai", {
462
480
  channelName: "embedMany",
463
481
  kind: "async"
464
482
  }),
483
+ rerank: channel({
484
+ channelName: "rerank",
485
+ kind: "async"
486
+ }),
465
487
  agentGenerate: channel({
466
488
  channelName: "Agent.generate",
467
489
  kind: "async"
@@ -541,7 +563,7 @@ var aiSDKConfigs = [
541
563
  channelName: aiSDKChannels.streamText.channelName,
542
564
  module: {
543
565
  name: "ai",
544
- versionRange: ">=3.0.0",
566
+ versionRange: ">=3.0.0 <4.0.0",
545
567
  filePath: "dist/index.js"
546
568
  },
547
569
  functionQuery: {
@@ -549,6 +571,18 @@ var aiSDKConfigs = [
549
571
  kind: "Async"
550
572
  }
551
573
  },
574
+ {
575
+ channelName: aiSDKChannels.streamTextSync.channelName,
576
+ module: {
577
+ name: "ai",
578
+ versionRange: ">=4.0.0",
579
+ filePath: "dist/index.js"
580
+ },
581
+ functionQuery: {
582
+ functionName: "streamText",
583
+ kind: "Sync"
584
+ }
585
+ },
552
586
  // generateObject - async function
553
587
  {
554
588
  channelName: aiSDKChannels.generateObject.channelName,
@@ -624,6 +658,31 @@ var aiSDKConfigs = [
624
658
  kind: "Async"
625
659
  }
626
660
  },
661
+ // rerank - async function
662
+ {
663
+ channelName: aiSDKChannels.rerank.channelName,
664
+ module: {
665
+ name: "ai",
666
+ versionRange: ">=5.0.0",
667
+ filePath: "dist/index.mjs"
668
+ },
669
+ functionQuery: {
670
+ functionName: "rerank",
671
+ kind: "Async"
672
+ }
673
+ },
674
+ {
675
+ channelName: aiSDKChannels.rerank.channelName,
676
+ module: {
677
+ name: "ai",
678
+ versionRange: ">=5.0.0",
679
+ filePath: "dist/index.js"
680
+ },
681
+ functionQuery: {
682
+ functionName: "rerank",
683
+ kind: "Async"
684
+ }
685
+ },
627
686
  // streamObject - async function (v3 only, before the sync refactor in v4)
628
687
  {
629
688
  channelName: aiSDKChannels.streamObject.channelName,
@@ -654,7 +713,7 @@ var aiSDKConfigs = [
654
713
  channelName: aiSDKChannels.streamObject.channelName,
655
714
  module: {
656
715
  name: "ai",
657
- versionRange: ">=3.0.0",
716
+ versionRange: ">=3.0.0 <4.0.0",
658
717
  filePath: "dist/index.js"
659
718
  },
660
719
  functionQuery: {
@@ -662,6 +721,18 @@ var aiSDKConfigs = [
662
721
  kind: "Async"
663
722
  }
664
723
  },
724
+ {
725
+ channelName: aiSDKChannels.streamObjectSync.channelName,
726
+ module: {
727
+ name: "ai",
728
+ versionRange: ">=4.0.0",
729
+ filePath: "dist/index.js"
730
+ },
731
+ functionQuery: {
732
+ functionName: "streamObject",
733
+ kind: "Sync"
734
+ }
735
+ },
665
736
  // Agent.generate - async method (v5 only)
666
737
  // The compiled AI SDK bundle emits this as an anonymous class method, so we
667
738
  // target the first async `generate` method in the file instead of a class name.
@@ -831,6 +902,10 @@ var googleGenAIChannels = defineChannels("@google/genai", {
831
902
  generateContentStream: channel({
832
903
  channelName: "models.generateContentStream",
833
904
  kind: "async"
905
+ }),
906
+ embedContent: channel({
907
+ channelName: "models.embedContent",
908
+ kind: "async"
834
909
  })
835
910
  });
836
911
 
@@ -865,6 +940,303 @@ var googleGenAIConfigs = [
865
940
  methodName: "generateContentStreamInternal",
866
941
  kind: "Async"
867
942
  }
943
+ },
944
+ // Models.embedContent - class method in older SDK versions
945
+ {
946
+ channelName: googleGenAIChannels.embedContent.channelName,
947
+ module: {
948
+ name: "@google/genai",
949
+ versionRange: ">=1.0.0 <1.44.0",
950
+ filePath: "dist/node/index.mjs"
951
+ },
952
+ functionQuery: {
953
+ className: "Models",
954
+ methodName: "embedContent",
955
+ kind: "Async"
956
+ }
957
+ },
958
+ // Models.embedContentInternal - class method in newer SDK versions
959
+ // Note: embedContent is an arrow function property that calls this method
960
+ {
961
+ channelName: googleGenAIChannels.embedContent.channelName,
962
+ module: {
963
+ name: "@google/genai",
964
+ versionRange: ">=1.44.0",
965
+ filePath: "dist/node/index.mjs"
966
+ },
967
+ functionQuery: {
968
+ className: "Models",
969
+ methodName: "embedContentInternal",
970
+ kind: "Async"
971
+ }
972
+ }
973
+ ];
974
+
975
+ // src/instrumentation/plugins/huggingface-channels.ts
976
+ var huggingFaceChannels = defineChannels("@huggingface/inference", {
977
+ chatCompletion: channel({
978
+ channelName: "chatCompletion",
979
+ kind: "async"
980
+ }),
981
+ chatCompletionStream: channel({
982
+ channelName: "chatCompletionStream",
983
+ kind: "sync-stream"
984
+ }),
985
+ textGeneration: channel({
986
+ channelName: "textGeneration",
987
+ kind: "async"
988
+ }),
989
+ textGenerationStream: channel({
990
+ channelName: "textGenerationStream",
991
+ kind: "sync-stream"
992
+ }),
993
+ featureExtraction: channel({
994
+ channelName: "featureExtraction",
995
+ kind: "async"
996
+ })
997
+ });
998
+
999
+ // src/auto-instrumentations/configs/huggingface.ts
1000
+ var huggingFaceConfigs = [
1001
+ {
1002
+ channelName: huggingFaceChannels.chatCompletion.channelName,
1003
+ module: {
1004
+ name: "@huggingface/inference",
1005
+ versionRange: ">=2.0.0 <3.0.0",
1006
+ filePath: "dist/index.js"
1007
+ },
1008
+ functionQuery: {
1009
+ functionName: "chatCompletion",
1010
+ kind: "Async"
1011
+ }
1012
+ },
1013
+ {
1014
+ channelName: huggingFaceChannels.chatCompletion.channelName,
1015
+ module: {
1016
+ name: "@huggingface/inference",
1017
+ versionRange: ">=2.0.0 <3.0.0",
1018
+ filePath: "dist/index.cjs"
1019
+ },
1020
+ functionQuery: {
1021
+ functionName: "chatCompletion",
1022
+ kind: "Async"
1023
+ }
1024
+ },
1025
+ {
1026
+ channelName: huggingFaceChannels.chatCompletionStream.channelName,
1027
+ module: {
1028
+ name: "@huggingface/inference",
1029
+ versionRange: ">=2.0.0 <3.0.0",
1030
+ filePath: "dist/index.js"
1031
+ },
1032
+ functionQuery: {
1033
+ functionName: "chatCompletionStream",
1034
+ kind: "Sync"
1035
+ }
1036
+ },
1037
+ {
1038
+ channelName: huggingFaceChannels.chatCompletionStream.channelName,
1039
+ module: {
1040
+ name: "@huggingface/inference",
1041
+ versionRange: ">=2.0.0 <3.0.0",
1042
+ filePath: "dist/index.cjs"
1043
+ },
1044
+ functionQuery: {
1045
+ functionName: "chatCompletionStream",
1046
+ kind: "Sync"
1047
+ }
1048
+ },
1049
+ {
1050
+ channelName: huggingFaceChannels.textGeneration.channelName,
1051
+ module: {
1052
+ name: "@huggingface/inference",
1053
+ versionRange: ">=2.0.0 <3.0.0",
1054
+ filePath: "dist/index.js"
1055
+ },
1056
+ functionQuery: {
1057
+ functionName: "textGeneration",
1058
+ kind: "Async"
1059
+ }
1060
+ },
1061
+ {
1062
+ channelName: huggingFaceChannels.textGeneration.channelName,
1063
+ module: {
1064
+ name: "@huggingface/inference",
1065
+ versionRange: ">=2.0.0 <3.0.0",
1066
+ filePath: "dist/index.cjs"
1067
+ },
1068
+ functionQuery: {
1069
+ functionName: "textGeneration",
1070
+ kind: "Async"
1071
+ }
1072
+ },
1073
+ {
1074
+ channelName: huggingFaceChannels.textGenerationStream.channelName,
1075
+ module: {
1076
+ name: "@huggingface/inference",
1077
+ versionRange: ">=2.0.0 <3.0.0",
1078
+ filePath: "dist/index.js"
1079
+ },
1080
+ functionQuery: {
1081
+ functionName: "textGenerationStream",
1082
+ kind: "Sync"
1083
+ }
1084
+ },
1085
+ {
1086
+ channelName: huggingFaceChannels.textGenerationStream.channelName,
1087
+ module: {
1088
+ name: "@huggingface/inference",
1089
+ versionRange: ">=2.0.0 <3.0.0",
1090
+ filePath: "dist/index.cjs"
1091
+ },
1092
+ functionQuery: {
1093
+ functionName: "textGenerationStream",
1094
+ kind: "Sync"
1095
+ }
1096
+ },
1097
+ {
1098
+ channelName: huggingFaceChannels.featureExtraction.channelName,
1099
+ module: {
1100
+ name: "@huggingface/inference",
1101
+ versionRange: ">=2.0.0 <3.0.0",
1102
+ filePath: "dist/index.js"
1103
+ },
1104
+ functionQuery: {
1105
+ functionName: "featureExtraction",
1106
+ kind: "Async"
1107
+ }
1108
+ },
1109
+ {
1110
+ channelName: huggingFaceChannels.featureExtraction.channelName,
1111
+ module: {
1112
+ name: "@huggingface/inference",
1113
+ versionRange: ">=2.0.0 <3.0.0",
1114
+ filePath: "dist/index.cjs"
1115
+ },
1116
+ functionQuery: {
1117
+ functionName: "featureExtraction",
1118
+ kind: "Async"
1119
+ }
1120
+ },
1121
+ {
1122
+ channelName: huggingFaceChannels.chatCompletion.channelName,
1123
+ module: {
1124
+ name: "@huggingface/inference",
1125
+ versionRange: ">=3.0.0 <5.0.0",
1126
+ filePath: "dist/esm/tasks/nlp/chatCompletion.js"
1127
+ },
1128
+ functionQuery: {
1129
+ functionName: "chatCompletion",
1130
+ kind: "Async"
1131
+ }
1132
+ },
1133
+ {
1134
+ channelName: huggingFaceChannels.chatCompletion.channelName,
1135
+ module: {
1136
+ name: "@huggingface/inference",
1137
+ versionRange: ">=3.0.0 <5.0.0",
1138
+ filePath: "dist/commonjs/tasks/nlp/chatCompletion.js"
1139
+ },
1140
+ functionQuery: {
1141
+ functionName: "chatCompletion",
1142
+ kind: "Async"
1143
+ }
1144
+ },
1145
+ {
1146
+ channelName: huggingFaceChannels.chatCompletionStream.channelName,
1147
+ module: {
1148
+ name: "@huggingface/inference",
1149
+ versionRange: ">=3.0.0 <5.0.0",
1150
+ filePath: "dist/esm/tasks/nlp/chatCompletionStream.js"
1151
+ },
1152
+ functionQuery: {
1153
+ functionName: "chatCompletionStream",
1154
+ kind: "Sync"
1155
+ }
1156
+ },
1157
+ {
1158
+ channelName: huggingFaceChannels.chatCompletionStream.channelName,
1159
+ module: {
1160
+ name: "@huggingface/inference",
1161
+ versionRange: ">=3.0.0 <5.0.0",
1162
+ filePath: "dist/commonjs/tasks/nlp/chatCompletionStream.js"
1163
+ },
1164
+ functionQuery: {
1165
+ functionName: "chatCompletionStream",
1166
+ kind: "Sync"
1167
+ }
1168
+ },
1169
+ {
1170
+ channelName: huggingFaceChannels.textGeneration.channelName,
1171
+ module: {
1172
+ name: "@huggingface/inference",
1173
+ versionRange: ">=3.0.0 <5.0.0",
1174
+ filePath: "dist/esm/tasks/nlp/textGeneration.js"
1175
+ },
1176
+ functionQuery: {
1177
+ functionName: "textGeneration",
1178
+ kind: "Async"
1179
+ }
1180
+ },
1181
+ {
1182
+ channelName: huggingFaceChannels.textGeneration.channelName,
1183
+ module: {
1184
+ name: "@huggingface/inference",
1185
+ versionRange: ">=3.0.0 <5.0.0",
1186
+ filePath: "dist/commonjs/tasks/nlp/textGeneration.js"
1187
+ },
1188
+ functionQuery: {
1189
+ functionName: "textGeneration",
1190
+ kind: "Async"
1191
+ }
1192
+ },
1193
+ {
1194
+ channelName: huggingFaceChannels.textGenerationStream.channelName,
1195
+ module: {
1196
+ name: "@huggingface/inference",
1197
+ versionRange: ">=3.0.0 <5.0.0",
1198
+ filePath: "dist/esm/tasks/nlp/textGenerationStream.js"
1199
+ },
1200
+ functionQuery: {
1201
+ functionName: "textGenerationStream",
1202
+ kind: "Sync"
1203
+ }
1204
+ },
1205
+ {
1206
+ channelName: huggingFaceChannels.textGenerationStream.channelName,
1207
+ module: {
1208
+ name: "@huggingface/inference",
1209
+ versionRange: ">=3.0.0 <5.0.0",
1210
+ filePath: "dist/commonjs/tasks/nlp/textGenerationStream.js"
1211
+ },
1212
+ functionQuery: {
1213
+ functionName: "textGenerationStream",
1214
+ kind: "Sync"
1215
+ }
1216
+ },
1217
+ {
1218
+ channelName: huggingFaceChannels.featureExtraction.channelName,
1219
+ module: {
1220
+ name: "@huggingface/inference",
1221
+ versionRange: ">=3.0.0 <5.0.0",
1222
+ filePath: "dist/esm/tasks/nlp/featureExtraction.js"
1223
+ },
1224
+ functionQuery: {
1225
+ functionName: "featureExtraction",
1226
+ kind: "Async"
1227
+ }
1228
+ },
1229
+ {
1230
+ channelName: huggingFaceChannels.featureExtraction.channelName,
1231
+ module: {
1232
+ name: "@huggingface/inference",
1233
+ versionRange: ">=3.0.0 <5.0.0",
1234
+ filePath: "dist/commonjs/tasks/nlp/featureExtraction.js"
1235
+ },
1236
+ functionQuery: {
1237
+ functionName: "featureExtraction",
1238
+ kind: "Async"
1239
+ }
868
1240
  }
869
1241
  ];
870
1242
 
@@ -910,6 +1282,12 @@ var openRouterChannels = defineChannels("@openrouter/sdk", {
910
1282
  channelName: "embeddings.generate",
911
1283
  kind: "async"
912
1284
  }),
1285
+ rerankRerank: channel(
1286
+ {
1287
+ channelName: "rerank.rerank",
1288
+ kind: "async"
1289
+ }
1290
+ ),
913
1291
  betaResponsesSend: channel({
914
1292
  channelName: "beta.responses.send",
915
1293
  kind: "async"
@@ -956,6 +1334,19 @@ var openRouterConfigs = [
956
1334
  kind: "Async"
957
1335
  }
958
1336
  },
1337
+ {
1338
+ channelName: openRouterChannels.rerankRerank.channelName,
1339
+ module: {
1340
+ name: "@openrouter/sdk",
1341
+ versionRange: ">=0.12.0 <1.0.0",
1342
+ filePath: "esm/sdk/rerank.js"
1343
+ },
1344
+ functionQuery: {
1345
+ className: "Rerank",
1346
+ methodName: "rerank",
1347
+ kind: "Async"
1348
+ }
1349
+ },
959
1350
  {
960
1351
  channelName: openRouterChannels.betaResponsesSend.channelName,
961
1352
  module: {
@@ -1202,6 +1593,346 @@ var mistralConfigs = [
1202
1593
  }
1203
1594
  ];
1204
1595
 
1596
+ // src/instrumentation/plugins/google-adk-channels.ts
1597
+ var googleADKChannels = defineChannels("@google/adk", {
1598
+ runnerRunAsync: channel({
1599
+ channelName: "runner.runAsync",
1600
+ kind: "sync-stream"
1601
+ }),
1602
+ agentRunAsync: channel({
1603
+ channelName: "agent.runAsync",
1604
+ kind: "sync-stream"
1605
+ }),
1606
+ toolRunAsync: channel({
1607
+ channelName: "tool.runAsync",
1608
+ kind: "async"
1609
+ })
1610
+ });
1611
+
1612
+ // src/auto-instrumentations/configs/google-adk.ts
1613
+ var googleADKVersionRange = ">=0.1.0";
1614
+ var googleADKBundledIndexVersionRange = ">=0.6.1 <0.7.0";
1615
+ var googleADKConfigs = [
1616
+ // --- Runner.runAsync --- async generator, kind "Sync" + sync-stream channel
1617
+ // Runner.runAsync — ESM individual module file
1618
+ {
1619
+ channelName: googleADKChannels.runnerRunAsync.channelName,
1620
+ module: {
1621
+ name: "@google/adk",
1622
+ versionRange: googleADKVersionRange,
1623
+ filePath: "dist/esm/runner/runner.js"
1624
+ },
1625
+ functionQuery: {
1626
+ className: "Runner",
1627
+ methodName: "runAsync",
1628
+ kind: "Sync"
1629
+ }
1630
+ },
1631
+ // Runner.runAsync — bundled CJS/ESM indexes
1632
+ // The bundled entrypoints minify class names, so target the 12th sync
1633
+ // `runAsync` method in file order rather than a class name. This mapping is
1634
+ // only validated against the current 0.6.x bundle layout, so keep the range
1635
+ // tight until we verify newer bundled outputs.
1636
+ {
1637
+ channelName: googleADKChannels.runnerRunAsync.channelName,
1638
+ module: {
1639
+ name: "@google/adk",
1640
+ versionRange: googleADKBundledIndexVersionRange,
1641
+ filePath: "dist/cjs/index.js"
1642
+ },
1643
+ functionQuery: {
1644
+ methodName: "runAsync",
1645
+ kind: "Sync",
1646
+ index: 11
1647
+ }
1648
+ },
1649
+ {
1650
+ channelName: googleADKChannels.runnerRunAsync.channelName,
1651
+ module: {
1652
+ name: "@google/adk",
1653
+ versionRange: googleADKBundledIndexVersionRange,
1654
+ filePath: "dist/esm/index.js"
1655
+ },
1656
+ functionQuery: {
1657
+ methodName: "runAsync",
1658
+ kind: "Sync",
1659
+ index: 11
1660
+ }
1661
+ },
1662
+ // --- BaseAgent.runAsync --- async generator, kind "Sync" + sync-stream channel
1663
+ // BaseAgent.runAsync — ESM individual module file
1664
+ {
1665
+ channelName: googleADKChannels.agentRunAsync.channelName,
1666
+ module: {
1667
+ name: "@google/adk",
1668
+ versionRange: googleADKVersionRange,
1669
+ filePath: "dist/esm/agents/base_agent.js"
1670
+ },
1671
+ functionQuery: {
1672
+ className: "BaseAgent",
1673
+ methodName: "runAsync",
1674
+ kind: "Sync"
1675
+ }
1676
+ },
1677
+ // BaseAgent.runAsync — bundled CJS/ESM indexes
1678
+ // The bundled entrypoints minify class names, so target the first sync
1679
+ // `runAsync` method in file order rather than a class name. This mapping is
1680
+ // only validated against the current 0.6.x bundle layout, so keep the range
1681
+ // tight until we verify newer bundled outputs.
1682
+ {
1683
+ channelName: googleADKChannels.agentRunAsync.channelName,
1684
+ module: {
1685
+ name: "@google/adk",
1686
+ versionRange: googleADKBundledIndexVersionRange,
1687
+ filePath: "dist/cjs/index.js"
1688
+ },
1689
+ functionQuery: {
1690
+ methodName: "runAsync",
1691
+ kind: "Sync",
1692
+ index: 0
1693
+ }
1694
+ },
1695
+ {
1696
+ channelName: googleADKChannels.agentRunAsync.channelName,
1697
+ module: {
1698
+ name: "@google/adk",
1699
+ versionRange: googleADKBundledIndexVersionRange,
1700
+ filePath: "dist/esm/index.js"
1701
+ },
1702
+ functionQuery: {
1703
+ methodName: "runAsync",
1704
+ kind: "Sync",
1705
+ index: 0
1706
+ }
1707
+ },
1708
+ // --- FunctionTool.runAsync --- regular async, kind "Async"
1709
+ // FunctionTool.runAsync — ESM individual module file
1710
+ {
1711
+ channelName: googleADKChannels.toolRunAsync.channelName,
1712
+ module: {
1713
+ name: "@google/adk",
1714
+ versionRange: googleADKVersionRange,
1715
+ filePath: "dist/esm/tools/function_tool.js"
1716
+ },
1717
+ functionQuery: {
1718
+ className: "FunctionTool",
1719
+ methodName: "runAsync",
1720
+ kind: "Async"
1721
+ }
1722
+ },
1723
+ // FunctionTool.runAsync — bundled CJS/ESM indexes
1724
+ // The bundled entrypoints minify class names, so target the first async
1725
+ // `runAsync` method in file order rather than a class name. This mapping is
1726
+ // only validated against the current 0.6.x bundle layout, so keep the range
1727
+ // tight until we verify newer bundled outputs.
1728
+ {
1729
+ channelName: googleADKChannels.toolRunAsync.channelName,
1730
+ module: {
1731
+ name: "@google/adk",
1732
+ versionRange: googleADKBundledIndexVersionRange,
1733
+ filePath: "dist/cjs/index.js"
1734
+ },
1735
+ functionQuery: {
1736
+ methodName: "runAsync",
1737
+ kind: "Async",
1738
+ index: 1
1739
+ }
1740
+ },
1741
+ {
1742
+ channelName: googleADKChannels.toolRunAsync.channelName,
1743
+ module: {
1744
+ name: "@google/adk",
1745
+ versionRange: googleADKBundledIndexVersionRange,
1746
+ filePath: "dist/esm/index.js"
1747
+ },
1748
+ functionQuery: {
1749
+ methodName: "runAsync",
1750
+ kind: "Async",
1751
+ index: 1
1752
+ }
1753
+ }
1754
+ ];
1755
+
1756
+ // src/instrumentation/plugins/cohere-channels.ts
1757
+ var cohereChannels = defineChannels("cohere-ai", {
1758
+ chat: channel({
1759
+ channelName: "chat",
1760
+ kind: "async"
1761
+ }),
1762
+ chatStream: channel({
1763
+ channelName: "chatStream",
1764
+ kind: "async"
1765
+ }),
1766
+ embed: channel({
1767
+ channelName: "embed",
1768
+ kind: "async"
1769
+ }),
1770
+ rerank: channel({
1771
+ channelName: "rerank",
1772
+ kind: "async"
1773
+ })
1774
+ });
1775
+
1776
+ // src/auto-instrumentations/configs/cohere.ts
1777
+ var cohereConfigs = [
1778
+ {
1779
+ channelName: cohereChannels.chat.channelName,
1780
+ module: {
1781
+ name: "cohere-ai",
1782
+ versionRange: ">=7.0.0 <8.0.0",
1783
+ filePath: "Client.js"
1784
+ },
1785
+ functionQuery: {
1786
+ className: "CohereClient",
1787
+ methodName: "chat",
1788
+ kind: "Async"
1789
+ }
1790
+ },
1791
+ {
1792
+ channelName: cohereChannels.chat.channelName,
1793
+ module: {
1794
+ name: "cohere-ai",
1795
+ versionRange: ">=8.0.0 <9.0.0",
1796
+ filePath: "Client.js"
1797
+ },
1798
+ functionQuery: {
1799
+ className: "CohereClient",
1800
+ methodName: "chat",
1801
+ kind: "Async"
1802
+ }
1803
+ },
1804
+ {
1805
+ channelName: cohereChannels.chat.channelName,
1806
+ module: {
1807
+ name: "cohere-ai",
1808
+ versionRange: ">=8.0.0 <9.0.0",
1809
+ filePath: "api/resources/v2/client/Client.js"
1810
+ },
1811
+ functionQuery: {
1812
+ className: "V2Client",
1813
+ methodName: "chat",
1814
+ kind: "Async"
1815
+ }
1816
+ },
1817
+ {
1818
+ channelName: cohereChannels.chatStream.channelName,
1819
+ module: {
1820
+ name: "cohere-ai",
1821
+ versionRange: ">=7.0.0 <8.0.0",
1822
+ filePath: "Client.js"
1823
+ },
1824
+ functionQuery: {
1825
+ className: "CohereClient",
1826
+ methodName: "chatStream",
1827
+ kind: "Async"
1828
+ }
1829
+ },
1830
+ {
1831
+ channelName: cohereChannels.chatStream.channelName,
1832
+ module: {
1833
+ name: "cohere-ai",
1834
+ versionRange: ">=8.0.0 <9.0.0",
1835
+ filePath: "Client.js"
1836
+ },
1837
+ functionQuery: {
1838
+ className: "CohereClient",
1839
+ methodName: "chatStream",
1840
+ kind: "Async"
1841
+ }
1842
+ },
1843
+ {
1844
+ channelName: cohereChannels.chatStream.channelName,
1845
+ module: {
1846
+ name: "cohere-ai",
1847
+ versionRange: ">=8.0.0 <9.0.0",
1848
+ filePath: "api/resources/v2/client/Client.js"
1849
+ },
1850
+ functionQuery: {
1851
+ className: "V2Client",
1852
+ methodName: "chatStream",
1853
+ kind: "Async"
1854
+ }
1855
+ },
1856
+ {
1857
+ channelName: cohereChannels.embed.channelName,
1858
+ module: {
1859
+ name: "cohere-ai",
1860
+ versionRange: ">=7.0.0 <8.0.0",
1861
+ filePath: "Client.js"
1862
+ },
1863
+ functionQuery: {
1864
+ className: "CohereClient",
1865
+ methodName: "embed",
1866
+ kind: "Async"
1867
+ }
1868
+ },
1869
+ {
1870
+ channelName: cohereChannels.embed.channelName,
1871
+ module: {
1872
+ name: "cohere-ai",
1873
+ versionRange: ">=8.0.0 <9.0.0",
1874
+ filePath: "Client.js"
1875
+ },
1876
+ functionQuery: {
1877
+ className: "CohereClient",
1878
+ methodName: "embed",
1879
+ kind: "Async"
1880
+ }
1881
+ },
1882
+ {
1883
+ channelName: cohereChannels.embed.channelName,
1884
+ module: {
1885
+ name: "cohere-ai",
1886
+ versionRange: ">=8.0.0 <9.0.0",
1887
+ filePath: "api/resources/v2/client/Client.js"
1888
+ },
1889
+ functionQuery: {
1890
+ className: "V2Client",
1891
+ methodName: "embed",
1892
+ kind: "Async"
1893
+ }
1894
+ },
1895
+ {
1896
+ channelName: cohereChannels.rerank.channelName,
1897
+ module: {
1898
+ name: "cohere-ai",
1899
+ versionRange: ">=7.0.0 <8.0.0",
1900
+ filePath: "Client.js"
1901
+ },
1902
+ functionQuery: {
1903
+ className: "CohereClient",
1904
+ methodName: "rerank",
1905
+ kind: "Async"
1906
+ }
1907
+ },
1908
+ {
1909
+ channelName: cohereChannels.rerank.channelName,
1910
+ module: {
1911
+ name: "cohere-ai",
1912
+ versionRange: ">=8.0.0 <9.0.0",
1913
+ filePath: "Client.js"
1914
+ },
1915
+ functionQuery: {
1916
+ className: "CohereClient",
1917
+ methodName: "rerank",
1918
+ kind: "Async"
1919
+ }
1920
+ },
1921
+ {
1922
+ channelName: cohereChannels.rerank.channelName,
1923
+ module: {
1924
+ name: "cohere-ai",
1925
+ versionRange: ">=8.0.0 <9.0.0",
1926
+ filePath: "api/resources/v2/client/Client.js"
1927
+ },
1928
+ functionQuery: {
1929
+ className: "V2Client",
1930
+ methodName: "rerank",
1931
+ kind: "Async"
1932
+ }
1933
+ }
1934
+ ];
1935
+
1205
1936
  // src/auto-instrumentations/loader/cjs-patch.ts
1206
1937
  import {
1207
1938
  create
@@ -1365,15 +2096,31 @@ var dc = await import(
1365
2096
  dcPath
1366
2097
  );
1367
2098
  patchTracingChannel(dc.tracingChannel);
2099
+ function readDisabledIntegrations() {
2100
+ const raw = process.env.BRAINTRUST_DISABLE_INSTRUMENTATION;
2101
+ if (!raw) {
2102
+ return /* @__PURE__ */ new Set();
2103
+ }
2104
+ return new Set(
2105
+ raw.split(",").map((value) => value.trim().toLowerCase()).filter((value) => value.length > 0)
2106
+ );
2107
+ }
2108
+ function isDisabled(disabled, ...names) {
2109
+ return names.some((name) => disabled.has(name));
2110
+ }
2111
+ var disabledIntegrations = readDisabledIntegrations();
1368
2112
  var allConfigs = [
1369
- ...openaiConfigs,
1370
- ...anthropicConfigs,
1371
- ...aiSDKConfigs,
1372
- ...claudeAgentSDKConfigs,
1373
- ...googleGenAIConfigs,
1374
- ...openRouterConfigs,
1375
- ...openRouterAgentConfigs,
1376
- ...mistralConfigs
2113
+ ...isDisabled(disabledIntegrations, "openai") ? [] : openaiConfigs,
2114
+ ...isDisabled(disabledIntegrations, "anthropic") ? [] : anthropicConfigs,
2115
+ ...isDisabled(disabledIntegrations, "aisdk", "ai-sdk", "vercel-ai") ? [] : aiSDKConfigs,
2116
+ ...isDisabled(disabledIntegrations, "claudeagentsdk", "claude-agent-sdk") ? [] : claudeAgentSDKConfigs,
2117
+ ...isDisabled(disabledIntegrations, "google", "google-genai") ? [] : googleGenAIConfigs,
2118
+ ...isDisabled(disabledIntegrations, "huggingface") ? [] : huggingFaceConfigs,
2119
+ ...isDisabled(disabledIntegrations, "openrouter") ? [] : openRouterConfigs,
2120
+ ...isDisabled(disabledIntegrations, "openrouteragent", "openrouter-agent") ? [] : openRouterAgentConfigs,
2121
+ ...isDisabled(disabledIntegrations, "mistral") ? [] : mistralConfigs,
2122
+ ...isDisabled(disabledIntegrations, "googleadk", "google-adk") ? [] : googleADKConfigs,
2123
+ ...isDisabled(disabledIntegrations, "cohere") ? [] : cohereConfigs
1377
2124
  ];
1378
2125
  register("./loader/esm-hook.mjs", {
1379
2126
  parentURL: import.meta.url,