braintrust 3.30.0 → 3.32.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 (55) hide show
  1. package/dev/dist/index.d.mts +740 -1
  2. package/dev/dist/index.d.ts +740 -1
  3. package/dev/dist/index.js +1307 -434
  4. package/dev/dist/index.mjs +886 -13
  5. package/dist/apply-auto-instrumentation.js +281 -216
  6. package/dist/apply-auto-instrumentation.mjs +66 -1
  7. package/dist/auto-instrumentations/bundler/esbuild.cjs +104 -2
  8. package/dist/auto-instrumentations/bundler/esbuild.mjs +2 -2
  9. package/dist/auto-instrumentations/bundler/next.cjs +113 -5
  10. package/dist/auto-instrumentations/bundler/next.mjs +12 -6
  11. package/dist/auto-instrumentations/bundler/rollup.cjs +104 -2
  12. package/dist/auto-instrumentations/bundler/rollup.mjs +2 -2
  13. package/dist/auto-instrumentations/bundler/vite.cjs +104 -2
  14. package/dist/auto-instrumentations/bundler/vite.mjs +2 -2
  15. package/dist/auto-instrumentations/bundler/webpack-loader.cjs +104 -2
  16. package/dist/auto-instrumentations/bundler/webpack.cjs +104 -2
  17. package/dist/auto-instrumentations/bundler/webpack.mjs +3 -3
  18. package/dist/auto-instrumentations/{chunk-U64OYU4Q.mjs → chunk-AFND2U7E.mjs} +38 -1
  19. package/dist/auto-instrumentations/{chunk-OXINGIEZ.mjs → chunk-QEEPRBIS.mjs} +1 -1
  20. package/dist/auto-instrumentations/{chunk-LW4HDHXT.mjs → chunk-RI4Y55ZF.mjs} +69 -2
  21. package/dist/auto-instrumentations/hook.mjs +126 -3
  22. package/dist/auto-instrumentations/index.cjs +39 -1
  23. package/dist/auto-instrumentations/index.d.mts +3 -1
  24. package/dist/auto-instrumentations/index.d.ts +3 -1
  25. package/dist/auto-instrumentations/index.mjs +3 -1
  26. package/dist/browser.d.mts +3052 -927
  27. package/dist/browser.d.ts +3052 -927
  28. package/dist/browser.js +1023 -18
  29. package/dist/browser.mjs +1023 -18
  30. package/dist/{chunk-BU6SM54N.mjs → chunk-4QSAHP7D.mjs} +834 -10
  31. package/dist/{chunk-2XDW3UCG.js → chunk-AW4QECG5.js} +47 -4
  32. package/dist/{chunk-TWCDSYJN.js → chunk-BTRLPQG5.js} +1679 -855
  33. package/dist/{chunk-N3JKQ3D3.mjs → chunk-WV6QZI2W.mjs} +46 -3
  34. package/dist/cli.js +950 -14
  35. package/dist/edge-light.d.mts +1 -1
  36. package/dist/edge-light.d.ts +1 -1
  37. package/dist/edge-light.js +1023 -18
  38. package/dist/edge-light.mjs +1023 -18
  39. package/dist/index.d.mts +3052 -927
  40. package/dist/index.d.ts +3052 -927
  41. package/dist/index.js +594 -450
  42. package/dist/index.mjs +149 -5
  43. package/dist/instrumentation/index.d.mts +434 -0
  44. package/dist/instrumentation/index.d.ts +434 -0
  45. package/dist/instrumentation/index.js +875 -12
  46. package/dist/instrumentation/index.mjs +875 -12
  47. package/dist/vitest-evals-reporter.js +16 -16
  48. package/dist/vitest-evals-reporter.mjs +2 -2
  49. package/dist/workerd.d.mts +1 -1
  50. package/dist/workerd.d.ts +1 -1
  51. package/dist/workerd.js +1023 -18
  52. package/dist/workerd.mjs +1023 -18
  53. package/package.json +1 -1
  54. package/util/dist/index.d.mts +326 -0
  55. package/util/dist/index.d.ts +326 -0
@@ -54,6 +54,8 @@ var envIntegrationAliases = {
54
54
  "openai-agents-core": "openAIAgents",
55
55
  openaiagentscore: "openAIAgents",
56
56
  google: "google",
57
+ "google-generative-ai": "googleGenerativeAI",
58
+ googlegenerativeai: "googleGenerativeAI",
57
59
  "google-genai": "googleGenAI",
58
60
  googlegenai: "googleGenAI",
59
61
  huggingface: "huggingface",
@@ -87,7 +89,9 @@ var envIntegrationAliases = {
87
89
  langsmith: "langsmith",
88
90
  voyage: "voyageai",
89
91
  "voyage-ai": "voyageai",
90
- voyageai: "voyageai"
92
+ voyageai: "voyageai",
93
+ elevenlabs: "elevenlabs",
94
+ "@elevenlabs/elevenlabs-js": "elevenlabs"
91
95
  };
92
96
  function readDisabledInstrumentationEnvConfig(disabledList) {
93
97
  const integrations = {};
@@ -2117,6 +2121,14 @@ var ChatCompletionContentPartImageWithTitle = z6.object({
2117
2121
  ttl: z6.enum(["5m", "1h"]).optional()
2118
2122
  }).optional()
2119
2123
  });
2124
+ var ChatCompletionContentPartInputAudioWithTitle = z6.object({
2125
+ input_audio: z6.object({ data: z6.string(), format: z6.enum(["wav", "mp3"]) }),
2126
+ type: z6.literal("input_audio"),
2127
+ cache_control: z6.object({
2128
+ type: z6.literal("ephemeral"),
2129
+ ttl: z6.enum(["5m", "1h"]).optional()
2130
+ }).optional()
2131
+ });
2120
2132
  var ChatCompletionContentPartFileFile = z6.object({ file_data: z6.string(), filename: z6.string(), file_id: z6.string() }).partial();
2121
2133
  var ChatCompletionContentPartFileWithTitle = z6.object({
2122
2134
  file: ChatCompletionContentPartFileFile,
@@ -2129,6 +2141,7 @@ var ChatCompletionContentPartFileWithTitle = z6.object({
2129
2141
  var ChatCompletionContentPart = z6.union([
2130
2142
  ChatCompletionContentPartTextWithTitle,
2131
2143
  ChatCompletionContentPartImageWithTitle,
2144
+ ChatCompletionContentPartInputAudioWithTitle,
2132
2145
  ChatCompletionContentPartFileWithTitle
2133
2146
  ]);
2134
2147
  var ChatCompletionContentPartText = z6.object({
@@ -3120,6 +3133,7 @@ var ProjectSettings = z6.union([
3120
3133
  ]),
3121
3134
  disable_realtime_queries: z6.union([z6.boolean(), z6.null()]),
3122
3135
  monitor_charts_use_metrics_start: z6.union([z6.boolean(), z6.null()]),
3136
+ blind_reviews: z6.union([z6.boolean(), z6.null()]),
3123
3137
  default_preprocessor: NullableSavedFunctionId
3124
3138
  }).partial(),
3125
3139
  z6.null()
@@ -3181,6 +3195,7 @@ var WindowedAutomationConfig = z6.object({
3181
3195
  auto_approve_tools: z6.array(z6.string().min(1)).optional().default([]),
3182
3196
  harness: z6.enum(["native", "codex", "claude-code"]).optional(),
3183
3197
  model: z6.string().min(1).optional(),
3198
+ endpoint_name: z6.string().min(1).optional(),
3184
3199
  reasoning_effort: z6.enum(["none", "minimal", "low", "medium", "high", "xhigh", "max"]).optional()
3185
3200
  }).optional(),
3186
3201
  actions: z6.array(
@@ -4954,6 +4969,7 @@ var INSTRUMENTATION_NAMES = {
4954
4969
  GENKIT: "genkit",
4955
4970
  GITHUB_COPILOT: "github-copilot",
4956
4971
  GOOGLE_ADK: "google-adk",
4972
+ GOOGLE_GENERATIVE_AI: "google-generative-ai",
4957
4973
  GOOGLE_GENAI: "google-genai",
4958
4974
  GROQ: "groq",
4959
4975
  HUGGINGFACE: "huggingface",
@@ -4969,12 +4985,13 @@ var INSTRUMENTATION_NAMES = {
4969
4985
  OPENROUTER_AGENT: "openrouter-agent",
4970
4986
  PI_CODING_AGENT: "pi-coding-agent",
4971
4987
  STRANDS_AGENT_SDK: "strands-agent-sdk",
4972
- VOYAGEAI: "voyageai"
4988
+ VOYAGEAI: "voyageai",
4989
+ ELEVENLABS: "elevenlabs"
4973
4990
  };
4974
4991
  var INTERNAL_SPAN_INSTRUMENTATION_NAME = /* @__PURE__ */ Symbol.for(
4975
4992
  "braintrust.spanInstrumentationName"
4976
4993
  );
4977
- var SDK_VERSION = true ? "3.30.0" : "0.0.0";
4994
+ var SDK_VERSION = true ? "3.32.0" : "0.0.0";
4978
4995
  function withSpanInstrumentationName(args, instrumentationName) {
4979
4996
  return {
4980
4997
  ...args,
@@ -9463,6 +9480,16 @@ function renderMessageImpl(render, message, variables) {
9463
9480
  }
9464
9481
  }
9465
9482
  ];
9483
+ case "input_audio":
9484
+ return [
9485
+ {
9486
+ ...c,
9487
+ input_audio: {
9488
+ ...c.input_audio,
9489
+ data: render(c.input_audio.data)
9490
+ }
9491
+ }
9492
+ ];
9466
9493
  case "file":
9467
9494
  return [
9468
9495
  {
@@ -12026,6 +12053,40 @@ var googleADKConfigs = [
12026
12053
  }
12027
12054
  ];
12028
12055
 
12056
+ // src/instrumentation/plugins/google-generative-ai-channels.ts
12057
+ var googleGenerativeAIChannels = defineChannels(
12058
+ "@google/generative-ai",
12059
+ {
12060
+ generateContent: channel({ channelName: "GenerativeModel.generateContent", kind: "async" }),
12061
+ generateContentStream: channel({ channelName: "GenerativeModel.generateContentStream", kind: "async" }),
12062
+ embedContent: channel({ channelName: "GenerativeModel.embedContent", kind: "async" }),
12063
+ batchEmbedContents: channel({ channelName: "GenerativeModel.batchEmbedContents", kind: "async" }),
12064
+ sendMessage: channel({ channelName: "ChatSession.sendMessage", kind: "async" }),
12065
+ sendMessageStream: channel({ channelName: "ChatSession.sendMessageStream", kind: "async" })
12066
+ },
12067
+ { instrumentationName: INSTRUMENTATION_NAMES.GOOGLE_GENERATIVE_AI }
12068
+ );
12069
+
12070
+ // src/auto-instrumentations/configs/google-generative-ai.ts
12071
+ var googleGenerativeAIConfigs = [
12072
+ "dist/index.js",
12073
+ "dist/index.mjs"
12074
+ ].flatMap(
12075
+ (filePath) => Object.entries(googleGenerativeAIChannels).map(([methodName, channel2]) => ({
12076
+ channelName: channel2.channelName,
12077
+ module: {
12078
+ name: "@google/generative-ai",
12079
+ versionRange: ">=0.24.0 <0.25.0",
12080
+ filePath
12081
+ },
12082
+ functionQuery: {
12083
+ className: methodName.startsWith("sendMessage") ? "ChatSession" : "GenerativeModel",
12084
+ methodName,
12085
+ kind: "Async"
12086
+ }
12087
+ }))
12088
+ );
12089
+
12029
12090
  // src/instrumentation/plugins/google-genai-channels.ts
12030
12091
  var googleGenAIChannels = defineChannels(
12031
12092
  "@google/genai",
@@ -13590,6 +13651,60 @@ var strandsAgentSDKConfigs = [
13590
13651
  }
13591
13652
  ];
13592
13653
 
13654
+ // src/instrumentation/plugins/elevenlabs-channels.ts
13655
+ var elevenLabsChannels = defineChannels(
13656
+ "@elevenlabs/elevenlabs-js",
13657
+ {
13658
+ convert: channel({
13659
+ channelName: "textToSpeech.convert",
13660
+ kind: "async"
13661
+ }),
13662
+ stream: channel({
13663
+ channelName: "textToSpeech.stream",
13664
+ kind: "async"
13665
+ }),
13666
+ convertWithTimestamps: channel({ channelName: "textToSpeech.convertWithTimestamps", kind: "async" }),
13667
+ streamWithTimestamps: channel({ channelName: "textToSpeech.streamWithTimestamps", kind: "async" }),
13668
+ transcribe: channel({ channelName: "speechToText.convert", kind: "async" })
13669
+ },
13670
+ { instrumentationName: INSTRUMENTATION_NAMES.ELEVENLABS }
13671
+ );
13672
+
13673
+ // src/auto-instrumentations/configs/elevenlabs.ts
13674
+ var elevenLabsConfigs = [
13675
+ ...[
13676
+ "convert",
13677
+ "stream",
13678
+ "convertWithTimestamps",
13679
+ "streamWithTimestamps"
13680
+ ].map((methodName) => ({
13681
+ channelName: elevenLabsChannels[methodName].channelName,
13682
+ module: {
13683
+ name: "@elevenlabs/elevenlabs-js",
13684
+ versionRange: ">=2.67.0 <3.0.0",
13685
+ filePath: "api/resources/textToSpeech/client/Client.js"
13686
+ },
13687
+ functionQuery: {
13688
+ className: "TextToSpeechClient",
13689
+ methodName,
13690
+ kind: "Async"
13691
+ }
13692
+ })),
13693
+ {
13694
+ channelName: elevenLabsChannels.transcribe.channelName,
13695
+ module: {
13696
+ name: "@elevenlabs/elevenlabs-js",
13697
+ versionRange: ">=2.67.0 <3.0.0",
13698
+ filePath: "api/resources/speechToText/client/Client.js"
13699
+ },
13700
+ functionQuery: {
13701
+ className: "SpeechToTextClient",
13702
+ methodName: "convert",
13703
+ kind: "Async"
13704
+ }
13705
+ }
13706
+ ];
13707
+
13593
13708
  // src/instrumentation/plugins/voyageai-channels.ts
13594
13709
  var voyageAIChannels = defineChannels(
13595
13710
  "voyageai",
@@ -13698,6 +13813,10 @@ var defaultInstrumentationConfigGroups = [
13698
13813
  integrations: ["openAIAgents"],
13699
13814
  configs: openAIAgentsCoreConfigs
13700
13815
  },
13816
+ {
13817
+ integrations: ["googleGenerativeAI"],
13818
+ configs: googleGenerativeAIConfigs
13819
+ },
13701
13820
  {
13702
13821
  integrations: ["google", "googleGenAI"],
13703
13822
  configs: googleGenAIConfigs
@@ -13741,6 +13860,10 @@ var defaultInstrumentationConfigGroups = [
13741
13860
  integrations: ["flue"],
13742
13861
  configs: flueConfigs
13743
13862
  },
13863
+ {
13864
+ integrations: ["elevenlabs"],
13865
+ configs: elevenLabsConfigs
13866
+ },
13744
13867
  {
13745
13868
  integrations: ["voyageai"],
13746
13869
  configs: voyageAIConfigs
@@ -33,6 +33,7 @@ __export(index_exports, {
33
33
  gitHubCopilotConfigs: () => gitHubCopilotConfigs,
34
34
  googleADKConfigs: () => googleADKConfigs,
35
35
  googleGenAIConfigs: () => googleGenAIConfigs,
36
+ googleGenerativeAIConfigs: () => googleGenerativeAIConfigs,
36
37
  groqConfigs: () => groqConfigs,
37
38
  huggingFaceConfigs: () => huggingFaceConfigs,
38
39
  langSmithConfigs: () => langSmithConfigs,
@@ -807,6 +808,7 @@ var INSTRUMENTATION_NAMES = {
807
808
  GENKIT: "genkit",
808
809
  GITHUB_COPILOT: "github-copilot",
809
810
  GOOGLE_ADK: "google-adk",
811
+ GOOGLE_GENERATIVE_AI: "google-generative-ai",
810
812
  GOOGLE_GENAI: "google-genai",
811
813
  GROQ: "groq",
812
814
  HUGGINGFACE: "huggingface",
@@ -822,7 +824,8 @@ var INSTRUMENTATION_NAMES = {
822
824
  OPENROUTER_AGENT: "openrouter-agent",
823
825
  PI_CODING_AGENT: "pi-coding-agent",
824
826
  STRANDS_AGENT_SDK: "strands-agent-sdk",
825
- VOYAGEAI: "voyageai"
827
+ VOYAGEAI: "voyageai",
828
+ ELEVENLABS: "elevenlabs"
826
829
  };
827
830
 
828
831
  // src/instrumentation/plugins/openai-channels.ts
@@ -2111,6 +2114,40 @@ var openAIAgentsCoreConfigs = lifecycleMethods.flatMap(
2111
2114
  )
2112
2115
  );
2113
2116
 
2117
+ // src/instrumentation/plugins/google-generative-ai-channels.ts
2118
+ var googleGenerativeAIChannels = defineChannels(
2119
+ "@google/generative-ai",
2120
+ {
2121
+ generateContent: channel({ channelName: "GenerativeModel.generateContent", kind: "async" }),
2122
+ generateContentStream: channel({ channelName: "GenerativeModel.generateContentStream", kind: "async" }),
2123
+ embedContent: channel({ channelName: "GenerativeModel.embedContent", kind: "async" }),
2124
+ batchEmbedContents: channel({ channelName: "GenerativeModel.batchEmbedContents", kind: "async" }),
2125
+ sendMessage: channel({ channelName: "ChatSession.sendMessage", kind: "async" }),
2126
+ sendMessageStream: channel({ channelName: "ChatSession.sendMessageStream", kind: "async" })
2127
+ },
2128
+ { instrumentationName: INSTRUMENTATION_NAMES.GOOGLE_GENERATIVE_AI }
2129
+ );
2130
+
2131
+ // src/auto-instrumentations/configs/google-generative-ai.ts
2132
+ var googleGenerativeAIConfigs = [
2133
+ "dist/index.js",
2134
+ "dist/index.mjs"
2135
+ ].flatMap(
2136
+ (filePath) => Object.entries(googleGenerativeAIChannels).map(([methodName, channel2]) => ({
2137
+ channelName: channel2.channelName,
2138
+ module: {
2139
+ name: "@google/generative-ai",
2140
+ versionRange: ">=0.24.0 <0.25.0",
2141
+ filePath
2142
+ },
2143
+ functionQuery: {
2144
+ className: methodName.startsWith("sendMessage") ? "ChatSession" : "GenerativeModel",
2145
+ methodName,
2146
+ kind: "Async"
2147
+ }
2148
+ }))
2149
+ );
2150
+
2114
2151
  // src/instrumentation/plugins/google-genai-channels.ts
2115
2152
  var googleGenAIChannels = defineChannels(
2116
2153
  "@google/genai",
@@ -4100,6 +4137,7 @@ var piCodingAgentConfigs = [
4100
4137
  gitHubCopilotConfigs,
4101
4138
  googleADKConfigs,
4102
4139
  googleGenAIConfigs,
4140
+ googleGenerativeAIConfigs,
4103
4141
  groqConfigs,
4104
4142
  huggingFaceConfigs,
4105
4143
  langSmithConfigs,
@@ -64,6 +64,8 @@ declare const cursorSDKConfigs: InstrumentationConfig[];
64
64
 
65
65
  declare const openAIAgentsCoreConfigs: InstrumentationConfig[];
66
66
 
67
+ declare const googleGenerativeAIConfigs: InstrumentationConfig[];
68
+
67
69
  /**
68
70
  * Instrumentation configurations for the Google GenAI SDK.
69
71
  *
@@ -123,4 +125,4 @@ declare const langSmithConfigs: InstrumentationConfig[];
123
125
 
124
126
  declare const piCodingAgentConfigs: InstrumentationConfig[];
125
127
 
126
- export { InstrumentationConfig, aiSDKConfigs, anthropicConfigs, bedrockRuntimeConfigs, claudeAgentSDKConfigs, cloudflareAIChatConfigs, cloudflareAgentsConfigs, cloudflareThinkConfigs, cohereConfigs, cursorSDKConfigs, genkitConfigs, gitHubCopilotConfigs, googleADKConfigs, googleGenAIConfigs, groqConfigs, huggingFaceConfigs, langSmithConfigs, langchainConfigs, mistralConfigs, ollamaConfigs, openAIAgentsCoreConfigs, openAICodexConfigs, openRouterAgentConfigs, openRouterConfigs, openaiConfigs, piCodingAgentConfigs };
128
+ export { InstrumentationConfig, aiSDKConfigs, anthropicConfigs, bedrockRuntimeConfigs, claudeAgentSDKConfigs, cloudflareAIChatConfigs, cloudflareAgentsConfigs, cloudflareThinkConfigs, cohereConfigs, cursorSDKConfigs, genkitConfigs, gitHubCopilotConfigs, googleADKConfigs, googleGenAIConfigs, googleGenerativeAIConfigs, groqConfigs, huggingFaceConfigs, langSmithConfigs, langchainConfigs, mistralConfigs, ollamaConfigs, openAIAgentsCoreConfigs, openAICodexConfigs, openRouterAgentConfigs, openRouterConfigs, openaiConfigs, piCodingAgentConfigs };
@@ -64,6 +64,8 @@ declare const cursorSDKConfigs: InstrumentationConfig[];
64
64
 
65
65
  declare const openAIAgentsCoreConfigs: InstrumentationConfig[];
66
66
 
67
+ declare const googleGenerativeAIConfigs: InstrumentationConfig[];
68
+
67
69
  /**
68
70
  * Instrumentation configurations for the Google GenAI SDK.
69
71
  *
@@ -123,4 +125,4 @@ declare const langSmithConfigs: InstrumentationConfig[];
123
125
 
124
126
  declare const piCodingAgentConfigs: InstrumentationConfig[];
125
127
 
126
- export { InstrumentationConfig, aiSDKConfigs, anthropicConfigs, bedrockRuntimeConfigs, claudeAgentSDKConfigs, cloudflareAIChatConfigs, cloudflareAgentsConfigs, cloudflareThinkConfigs, cohereConfigs, cursorSDKConfigs, genkitConfigs, gitHubCopilotConfigs, googleADKConfigs, googleGenAIConfigs, groqConfigs, huggingFaceConfigs, langSmithConfigs, langchainConfigs, mistralConfigs, ollamaConfigs, openAIAgentsCoreConfigs, openAICodexConfigs, openRouterAgentConfigs, openRouterConfigs, openaiConfigs, piCodingAgentConfigs };
128
+ export { InstrumentationConfig, aiSDKConfigs, anthropicConfigs, bedrockRuntimeConfigs, claudeAgentSDKConfigs, cloudflareAIChatConfigs, cloudflareAgentsConfigs, cloudflareThinkConfigs, cohereConfigs, cursorSDKConfigs, genkitConfigs, gitHubCopilotConfigs, googleADKConfigs, googleGenAIConfigs, googleGenerativeAIConfigs, groqConfigs, huggingFaceConfigs, langSmithConfigs, langchainConfigs, mistralConfigs, ollamaConfigs, openAIAgentsCoreConfigs, openAICodexConfigs, openRouterAgentConfigs, openRouterConfigs, openaiConfigs, piCodingAgentConfigs };
@@ -12,6 +12,7 @@ import {
12
12
  gitHubCopilotConfigs,
13
13
  googleADKConfigs,
14
14
  googleGenAIConfigs,
15
+ googleGenerativeAIConfigs,
15
16
  groqConfigs,
16
17
  huggingFaceConfigs,
17
18
  langSmithConfigs,
@@ -24,7 +25,7 @@ import {
24
25
  openRouterConfigs,
25
26
  openaiConfigs,
26
27
  piCodingAgentConfigs
27
- } from "./chunk-U64OYU4Q.mjs";
28
+ } from "./chunk-AFND2U7E.mjs";
28
29
  import "./chunk-JPUFNW7X.mjs";
29
30
  export {
30
31
  aiSDKConfigs,
@@ -40,6 +41,7 @@ export {
40
41
  gitHubCopilotConfigs,
41
42
  googleADKConfigs,
42
43
  googleGenAIConfigs,
44
+ googleGenerativeAIConfigs,
43
45
  groqConfigs,
44
46
  huggingFaceConfigs,
45
47
  langSmithConfigs,